create-powerapps-project 2.3.0 → 2.3.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/lib/plopActions.js +1 -1
- package/lib/plopfile.js +17 -20
- package/package.json +1 -1
- package/plop-templates/pcf/App.tsx +1 -1
- package/plop-templates/pcf/AppContext.tsx +1 -1
package/lib/plopActions.js
CHANGED
|
@@ -58,7 +58,7 @@ export default (plop) => {
|
|
|
58
58
|
plop.setActionType('runPcf', async (answers) => {
|
|
59
59
|
const args = ['pcf', 'init', '-ns', answers.namespace, '-n', answers.name, '-t', answers.template, '-npm', 'false'];
|
|
60
60
|
// Set framework to React if selected
|
|
61
|
-
if (answers.react
|
|
61
|
+
if (answers.react) {
|
|
62
62
|
args.push('-fw', 'react');
|
|
63
63
|
}
|
|
64
64
|
console.log('running pac pcf command with args');
|
package/lib/plopfile.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
+
import fs from 'node:fs';
|
|
2
3
|
import { getNugetPackageVersions } from './nuget.js';
|
|
3
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
5
|
export default async (plop) => {
|
|
@@ -327,23 +328,16 @@ export default async (plop) => {
|
|
|
327
328
|
},
|
|
328
329
|
{
|
|
329
330
|
type: 'append',
|
|
330
|
-
path: `${process.cwd()}
|
|
331
|
-
pattern:
|
|
332
|
-
template:
|
|
333
|
-
separator: '\n'
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
type: 'append',
|
|
337
|
-
path: `${process.cwd()}/{{name}}.pcfproj`,
|
|
338
|
-
pattern: "</PowerAppsTargetsPath>",
|
|
339
|
-
template: `<PcfAlwaysNpmInstall Condition=" '$(PcfAlwaysNpmInstall)' == '' ">false</PcfAlwaysNpmInstall>`,
|
|
331
|
+
path: `${process.cwd()}/${path.basename(process.cwd())}.pcfproj`,
|
|
332
|
+
pattern: '</PowerAppsTargetsPath>',
|
|
333
|
+
template: `\t\t<PcfEnableAutoNpmInstall Condition=" '$(PcfEnableAutoNpmInstall)' == '' ">false</PcfEnableAutoNpmInstall>\r\n\t\t<PcfAlwaysNpmInstall Condition=" '$(PcfAlwaysNpmInstall)' == '' ">false</PcfAlwaysNpmInstall>`,
|
|
340
334
|
separator: '\n'
|
|
341
335
|
},
|
|
342
336
|
{
|
|
343
337
|
type: 'append',
|
|
344
338
|
path: `${process.cwd()}/eslint.config.mjs`,
|
|
345
|
-
pattern:
|
|
346
|
-
template:
|
|
339
|
+
pattern: 'reactPlugin.configs.flat.recommended,',
|
|
340
|
+
template: '\treactHooks.configs.flat.recommended,',
|
|
347
341
|
separator: '\n'
|
|
348
342
|
},
|
|
349
343
|
{
|
|
@@ -355,9 +349,9 @@ export default async (plop) => {
|
|
|
355
349
|
},
|
|
356
350
|
{
|
|
357
351
|
type: 'append',
|
|
358
|
-
path: `${process.cwd()}
|
|
359
|
-
pattern:
|
|
360
|
-
template:
|
|
352
|
+
path: `${process.cwd()}/${path.basename(process.cwd())}.pcfproj`,
|
|
353
|
+
pattern: '</OutputPath>',
|
|
354
|
+
template: `\t\t<PcfBuildMode>development</PcfBuildMode>`,
|
|
361
355
|
separator: '\n'
|
|
362
356
|
},
|
|
363
357
|
{
|
|
@@ -372,6 +366,13 @@ export default async (plop) => {
|
|
|
372
366
|
pattern: `const props: IHelloWorldProps = { name: 'Power Apps' };`,
|
|
373
367
|
template: ''
|
|
374
368
|
},
|
|
369
|
+
async (answers) => {
|
|
370
|
+
if (answers.react) {
|
|
371
|
+
await fs.promises.rm(path.resolve(process.cwd(), answers.name, 'HelloWorld.tsx'));
|
|
372
|
+
return 'removed default HelloWorld component';
|
|
373
|
+
}
|
|
374
|
+
return 'react not included';
|
|
375
|
+
},
|
|
375
376
|
{
|
|
376
377
|
type: 'addScript',
|
|
377
378
|
data: {
|
|
@@ -414,11 +415,7 @@ export default async (plop) => {
|
|
|
414
415
|
type: 'npmInstall',
|
|
415
416
|
data: {
|
|
416
417
|
packages: {
|
|
417
|
-
devDependencies: [
|
|
418
|
-
'powerapps-project-pcf',
|
|
419
|
-
'eslint-plugin-react-hooks',
|
|
420
|
-
'@types/xrm'
|
|
421
|
-
],
|
|
418
|
+
devDependencies: ['powerapps-project-pcf', 'eslint-plugin-react-hooks', '@types/xrm'],
|
|
422
419
|
dependencies: ['@fluentui/react-icons']
|
|
423
420
|
}
|
|
424
421
|
},
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import { AppContext } from './contexts/AppContext';
|
|
|
4
4
|
|
|
5
5
|
export const App = ({ context }: { context: ComponentFramework.Context<IInputs>; }) => {
|
|
6
6
|
return (
|
|
7
|
-
<AppContext.Provider value
|
|
7
|
+
<AppContext.Provider value=\{{ context }}>
|
|
8
8
|
</AppContext.Provider>
|
|
9
9
|
);
|
|
10
10
|
};
|