create-powerapps-project 1.1.0 → 1.2.1

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.
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": "1.1.0",
4
+ "version": "1.2.1",
5
5
  "license": "MIT",
6
6
  "exports": "./lib/index.js",
7
7
  "engines": {
@@ -6,7 +6,7 @@ export interface IAppProps {
6
6
  context: ComponentFramework.Context<IInputs>;
7
7
  }
8
8
 
9
- export const App = React.memo((props: IAppProps) => {
9
+ export const App = (props: IAppProps) => {
10
10
  const {
11
11
  context
12
12
  } = props;
@@ -15,6 +15,6 @@ export const App = React.memo((props: IAppProps) => {
15
15
  <AppContextProvider context={context}>
16
16
  </AppContextProvider>
17
17
  );
18
- });
18
+ };
19
19
 
20
20
  App.displayName = 'App';
@@ -1,10 +1,14 @@
1
1
  import React from 'react';
2
2
  import { IInputs } from './generated/ManifestTypes';
3
3
 
4
- const AppContext = React.createContext<ComponentFramework.Context<IInputs>>({} as ComponentFramework.Context<IInputs>);
5
-
6
- interface IAppContextProviderProps {
4
+ interface IAppContext {
7
5
  context: ComponentFramework.Context<IInputs>;
6
+ theme?: Record<string, string>;
7
+ }
8
+
9
+ const AppContext = React.createContext<IAppContext>({} as IAppContext);
10
+
11
+ interface IAppContextProviderProps extends IAppContext {
8
12
  children?: React.ReactNode;
9
13
  }
10
14
 
@@ -14,4 +18,4 @@ export const AppContextProvider = (props: IAppContextProviderProps): JSX.Element
14
18
  return <AppContext.Provider value={context}>{children}</AppContext.Provider>;
15
19
  };
16
20
 
17
- export const useAppContext = (): ComponentFramework.Context<IInputs> => React.useContext(AppContext);
21
+ export const useAppContext = (): IAppContext => React.useContext(AppContext);
@@ -1,3 +1,3 @@
1
- module.exports = function (plop) {
2
- plop.load('powerapps-project-pcf');
1
+ module.exports = async function (plop) {
2
+ await plop.load('powerapps-project-pcf');
3
3
  };
@@ -2,7 +2,6 @@
2
2
  "version": "1.0.0",
3
3
  "name": "{{kebabCase name}}",
4
4
  "private": true,
5
- "type": "commonjs",
6
5
  "scripts": {
7
6
  "build": "webpack --mode=production",
8
7
  "start": "webpack --mode=development --watch",
@@ -1,3 +1,3 @@
1
- module.exports = function (plop) {
2
- plop.load('powerapps-project-webresource');
1
+ module.exports = async function (plop) {
2
+ await plop.load('powerapps-project-webresource');
3
3
  };