create-powerapps-project 0.17.2 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,9 +25,9 @@ const install = (cwd, type) => {
25
25
  }
26
26
  }
27
27
  else {
28
- (0, child_process_1.spawnSync)(getNpm(), ['add', ...packages.devDependencies], { stdio: 'inherit', cwd });
28
+ (0, child_process_1.spawnSync)(getNpm(), ['install', ...packages.devDependencies], { stdio: 'inherit', cwd });
29
29
  if (packages.dependencies) {
30
- (0, child_process_1.spawnSync)(getNpm(), ['add', ...packages.dependencies], { stdio: 'inherit', cwd });
30
+ (0, child_process_1.spawnSync)(getNpm(), ['install', ...packages.dependencies], { stdio: 'inherit', cwd });
31
31
  }
32
32
  }
33
33
  };
@@ -45,7 +45,8 @@ function getPackages(type) {
45
45
  //`powerapps-project-${type}`,
46
46
  '@types/react',
47
47
  '@types/react-dom',
48
- '@types/xrm'
48
+ '@types/xrm',
49
+ '-D'
49
50
  ]
50
51
  };
51
52
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-powerapps-project",
3
3
  "description": "💧 plop generator for Dataverse development",
4
- "version": "0.17.2",
4
+ "version": "0.18.0",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
7
7
  "main": "lib/index.js",
@@ -1,12 +1,13 @@
1
1
  import { IInputs, IOutputs } from "./generated/ManifestTypes";
2
2
  import React from 'react';
3
- import ReactDOM from 'react-dom';
3
+ import { createRoot, Root } from 'react-dom/client';
4
4
  import { initializeIcons } from '@fluentui/font-icons-mdl2';
5
5
 
6
6
  import { App, AppProps } from './App';
7
7
 
8
8
  export class {{name}} implements ComponentFramework.StandardControl<IInputs, IOutputs> {
9
9
  container: HTMLDivElement;
10
+ root: Root;
10
11
  context: ComponentFramework.Context<IInputs>;
11
12
  isTestHarness: boolean;
12
13
  props: AppProps;
@@ -32,6 +33,7 @@ export class {{name}} implements ComponentFramework.StandardControl<IInputs, IOu
32
33
  this.container = container;
33
34
  this.context = context;
34
35
  this.isTestHarness = document.getElementById('control-dimensions') !== null;
36
+ this.root = createRoot(this.container);
35
37
  }
36
38
 
37
39
 
@@ -44,9 +46,8 @@ export class {{name}} implements ComponentFramework.StandardControl<IInputs, IOu
44
46
  isTestHarness: this.isTestHarness
45
47
  };
46
48
 
47
- ReactDOM.render(
48
- React.createElement(App, this.props),
49
- this.container
49
+ this.root.render(
50
+ React.createElement(App, this.props)
50
51
  );
51
52
  }
52
53
 
@@ -63,7 +64,7 @@ export class {{name}} implements ComponentFramework.StandardControl<IInputs, IOu
63
64
  * i.e. cancelling any pending remote calls, removing listeners, etc.
64
65
  */
65
66
  public destroy(): void {
66
- ReactDOM.unmountComponentAtNode(this.container);
67
+ this.root.unmount();
67
68
  }
68
69
 
69
70
  }