create-powerapps-project 0.24.1 → 0.24.3
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/README.md
CHANGED
|
@@ -23,11 +23,12 @@ Project generator for Dataverse development
|
|
|
23
23
|
* Workflow activity base class
|
|
24
24
|
* No ILMerge needed
|
|
25
25
|
* Deploy workflow assemblies and types
|
|
26
|
+
* PCF project scaffolding
|
|
26
27
|
|
|
27
28
|
# Create project
|
|
28
29
|
|
|
29
30
|
```sh
|
|
30
|
-
|
|
31
|
+
npx create-powerapps-project
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
# Add files to project
|
package/lib/plopActions.js
CHANGED
|
@@ -45,7 +45,6 @@ exports.default = (plop) => {
|
|
|
45
45
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
46
46
|
const packageJson = require(packagePath);
|
|
47
47
|
packageJson.scripts[answers.scriptKey] = answers.scriptValue;
|
|
48
|
-
answers.scriptValue = plop.renderString(answers.scriptValue, answers);
|
|
49
48
|
await fs_1.default.promises.writeFile(packagePath, JSON.stringify(packageJson, null, 4), 'utf8');
|
|
50
49
|
return `added ${answers.scriptKey} script to package.json`;
|
|
51
50
|
});
|
package/lib/plopfile.js
CHANGED
|
@@ -136,103 +136,105 @@ exports.default = (plop) => {
|
|
|
136
136
|
packageQuestion,
|
|
137
137
|
...sharedQuestions,
|
|
138
138
|
],
|
|
139
|
-
actions:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
type: 'add',
|
|
160
|
-
templateFile: '../plop-templates/assembly/package.csproj.hbs',
|
|
161
|
-
path: path_1.default.resolve(process.cwd(), '{{name}}.csproj'),
|
|
162
|
-
skip: (answers) => {
|
|
163
|
-
if (!answers.pluginPackage) {
|
|
164
|
-
return 'generating regular assembly';
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
return;
|
|
139
|
+
actions: (data) => {
|
|
140
|
+
return [
|
|
141
|
+
async (answers) => {
|
|
142
|
+
const xrmVersions = await (0, nuget_1.getNugetPackageVersions)('JourneyTeam.Xrm');
|
|
143
|
+
answers.xrmVersion = xrmVersions.shift();
|
|
144
|
+
return `retrieved latest JourneyTeam.Xrm version ${answers.xrmVersion}`;
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
type: 'add',
|
|
148
|
+
templateFile: '../plop-templates/assembly/assembly.csproj.hbs',
|
|
149
|
+
path: path_1.default.resolve(process.cwd(), '{{name}}.csproj'),
|
|
150
|
+
skip: (answers) => {
|
|
151
|
+
if (answers.pluginPackage) {
|
|
152
|
+
return 'generating plugin package';
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
168
157
|
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
type: 'add',
|
|
161
|
+
templateFile: '../plop-templates/assembly/package.csproj.hbs',
|
|
162
|
+
path: path_1.default.resolve(process.cwd(), '{{name}}.csproj'),
|
|
163
|
+
skip: (answers) => {
|
|
164
|
+
if (!answers.pluginPackage) {
|
|
165
|
+
return 'generating regular assembly';
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
178
170
|
}
|
|
179
|
-
|
|
180
|
-
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
type: 'add',
|
|
174
|
+
templateFile: '../plop-templates/assembly/dataverse.config.json.hbs',
|
|
175
|
+
path: path_1.default.resolve(process.cwd(), 'dataverse.config.json'),
|
|
176
|
+
skip: (answers) => {
|
|
177
|
+
if (answers.pluginPackage) {
|
|
178
|
+
return 'generating plugin package';
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
181
183
|
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
type: 'add',
|
|
187
|
+
templateFile: '../plop-templates/assembly/dataverse.package.config.json.hbs',
|
|
188
|
+
path: path_1.default.resolve(process.cwd(), 'dataverse.config.json'),
|
|
189
|
+
skip: (answers) => {
|
|
190
|
+
if (!answers.pluginPackage) {
|
|
191
|
+
return 'generating regular assembly';
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
191
196
|
}
|
|
192
|
-
|
|
193
|
-
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
type: 'addMany',
|
|
200
|
+
templateFiles: [
|
|
201
|
+
'../plop-templates/assembly/package.json.hbs',
|
|
202
|
+
'../plop-templates/assembly/plopfile.js',
|
|
203
|
+
'../plop-templates/assembly/.gitignore',
|
|
204
|
+
'../plop-templates/assembly/Entities/EarlyBoundGenerator.xml',
|
|
205
|
+
'../plop-templates/assembly/.vscode/tasks.json.hbs',
|
|
206
|
+
'../plop-templates/assembly/.editorconfig'
|
|
207
|
+
],
|
|
208
|
+
base: '../plop-templates/assembly',
|
|
209
|
+
destination: process.cwd(),
|
|
210
|
+
force: true
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
type: 'addScript',
|
|
214
|
+
data: {
|
|
215
|
+
scriptKey: 'preinstall',
|
|
216
|
+
scriptValue: `npx only-allow ${data.package}`
|
|
194
217
|
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
'
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
'
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
{
|
|
212
|
-
type: 'addScript',
|
|
213
|
-
data: {
|
|
214
|
-
scriptKey: 'preinstall',
|
|
215
|
-
scriptValue: 'npx only-allow {{ package }}'
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
type: 'signAssembly'
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
type: 'nugetRestore'
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
type: 'npmInstall',
|
|
226
|
-
data: {
|
|
227
|
-
packages: {
|
|
228
|
-
devDependencies: [
|
|
229
|
-
'powerapps-project-assembly',
|
|
230
|
-
'dataverse-utils'
|
|
231
|
-
]
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
type: 'signAssembly'
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
type: 'nugetRestore'
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
type: 'npmInstall',
|
|
227
|
+
data: {
|
|
228
|
+
packages: {
|
|
229
|
+
devDependencies: [
|
|
230
|
+
'powerapps-project-assembly',
|
|
231
|
+
'dataverse-utils'
|
|
232
|
+
]
|
|
233
|
+
}
|
|
232
234
|
}
|
|
233
235
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
+
];
|
|
237
|
+
}
|
|
236
238
|
});
|
|
237
239
|
plop.setGenerator('pcf', {
|
|
238
240
|
description: 'generate dataverse pcf project',
|
|
@@ -263,76 +265,78 @@ exports.default = (plop) => {
|
|
|
263
265
|
},
|
|
264
266
|
packageQuestion
|
|
265
267
|
],
|
|
266
|
-
actions:
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
268
|
+
actions: (data) => {
|
|
269
|
+
return [
|
|
270
|
+
{
|
|
271
|
+
type: 'runPcf'
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
type: 'add',
|
|
275
|
+
templateFile: '../plop-templates/pcf/tsconfig.json',
|
|
276
|
+
path: path_1.default.resolve(process.cwd(), 'tsconfig.json'),
|
|
277
|
+
force: true
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
type: 'addMany',
|
|
281
|
+
templateFiles: [
|
|
282
|
+
'../plop-templates/pcf/App.tsx.hbs',
|
|
283
|
+
'../plop-templates/pcf/AppContext.ts'
|
|
284
|
+
],
|
|
285
|
+
base: '../plop-templates/pcf',
|
|
286
|
+
destination: `${process.cwd()}/{{name}}`,
|
|
287
|
+
skip: (answers) => {
|
|
288
|
+
if (!answers.react) {
|
|
289
|
+
return 'react not included';
|
|
290
|
+
}
|
|
291
|
+
return;
|
|
287
292
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
return 'npm packages already installed';
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
type: 'modify',
|
|
296
|
+
path: `${process.cwd()}/{{name}}/index.ts`,
|
|
297
|
+
pattern: 'import { HelloWorld, IHelloWorldProps } from "./HelloWorld";',
|
|
298
|
+
template: `import { App, IAppProps } from './App';`
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
type: 'modify',
|
|
302
|
+
path: `${process.cwd()}/{{name}}/index.ts`,
|
|
303
|
+
pattern: 'HelloWorld, props',
|
|
304
|
+
template: 'App, props'
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
type: 'modify',
|
|
308
|
+
path: `${process.cwd()}/{{name}}/index.ts`,
|
|
309
|
+
pattern: `const props: IHelloWorldProps = { name: 'Hello, World!' };`,
|
|
310
|
+
template: `const props: IAppProps = { context: context };`
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
type: 'addScript',
|
|
314
|
+
data: {
|
|
315
|
+
scriptKey: 'build:prod',
|
|
316
|
+
scriptValue: 'pcf-scripts build --buildMode production'
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
type: 'addScript',
|
|
321
|
+
data: {
|
|
322
|
+
scriptKey: 'preinstall',
|
|
323
|
+
scriptValue: `npx only-allow ${data.package}`
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
async (answers) => {
|
|
327
|
+
await fs_1.default.promises.rm(path_1.default.resolve(process.cwd(), answers.name, 'HelloWorld.tsx'));
|
|
328
|
+
return 'removed HelloWorld component';
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
type: 'npmInstall',
|
|
332
|
+
skip: (answers) => {
|
|
333
|
+
if (answers.package === 'npm') {
|
|
334
|
+
return 'npm packages already installed';
|
|
335
|
+
}
|
|
332
336
|
}
|
|
333
337
|
}
|
|
334
|
-
|
|
335
|
-
|
|
338
|
+
];
|
|
339
|
+
}
|
|
336
340
|
});
|
|
337
341
|
plop.setGenerator('webresource', {
|
|
338
342
|
description: 'generate dataverse web resource project',
|
|
@@ -351,58 +355,62 @@ exports.default = (plop) => {
|
|
|
351
355
|
packageQuestion,
|
|
352
356
|
...sharedQuestions
|
|
353
357
|
],
|
|
354
|
-
actions:
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
358
|
+
actions: (data) => {
|
|
359
|
+
return [
|
|
360
|
+
{
|
|
361
|
+
type: 'addMany',
|
|
362
|
+
templateFiles: ['../plop-templates/webresource/*', '../plop-templates/webresource/.*'],
|
|
363
|
+
base: '../plop-templates/webresource',
|
|
364
|
+
destination: process.cwd(),
|
|
365
|
+
force: true
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
type: 'addScript',
|
|
369
|
+
data: {
|
|
370
|
+
scriptKey: 'preinstall',
|
|
371
|
+
scriptValue: `npx only-allow ${data.package}`
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
type: 'npmInstall',
|
|
376
|
+
data: {
|
|
377
|
+
packages: {
|
|
378
|
+
devDependencies: [
|
|
379
|
+
'powerapps-project-webresource',
|
|
380
|
+
'dataverse-utils',
|
|
381
|
+
'@types/xrm',
|
|
382
|
+
'typescript',
|
|
383
|
+
'eslint',
|
|
384
|
+
'prettier',
|
|
385
|
+
'eslint-config-prettier',
|
|
386
|
+
'@typescript-eslint/eslint-plugin',
|
|
387
|
+
'@typescript-eslint/parser',
|
|
388
|
+
'webpack-event-plugin',
|
|
389
|
+
'clean-webpack-plugin',
|
|
390
|
+
'source-map-loader',
|
|
391
|
+
'babel-loader',
|
|
392
|
+
'ts-loader',
|
|
393
|
+
'@babel/core',
|
|
394
|
+
'@babel/preset-env',
|
|
395
|
+
'@babel/preset-typescript',
|
|
396
|
+
'xrm-mock',
|
|
397
|
+
'webpack',
|
|
398
|
+
'webpack-cli',
|
|
399
|
+
'cross-spawn',
|
|
400
|
+
'ts-node',
|
|
401
|
+
'@microsoft/eslint-plugin-power-apps',
|
|
402
|
+
'-D'
|
|
403
|
+
],
|
|
404
|
+
dependencies: [
|
|
405
|
+
'core-js',
|
|
406
|
+
'regenerator-runtime',
|
|
407
|
+
'powerapps-common',
|
|
408
|
+
'dataverse-webapi'
|
|
409
|
+
]
|
|
410
|
+
}
|
|
403
411
|
}
|
|
404
412
|
}
|
|
405
|
-
|
|
406
|
-
|
|
413
|
+
];
|
|
414
|
+
}
|
|
407
415
|
});
|
|
408
416
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lib
|