create-powerapps-project 0.14.5 → 0.15.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/CHANGELOG.json +769 -0
- package/CHANGELOG.md +378 -0
- package/lib/createDataverseProject.d.ts +3 -2
- package/lib/createDataverseProject.js +41 -40
- package/lib/getEnvInfo.d.ts +10 -1
- package/lib/getEnvInfo.js +5 -1
- package/lib/index.js +17 -9
- package/lib/logger.d.ts +5 -0
- package/lib/logger.js +26 -0
- package/lib/packageManager.js +10 -1
- package/lib/plop.d.ts +1 -2
- package/lib/plop.js +6 -6
- package/lib/plopfile.js +2 -1
- package/package.json +6 -6
- package/plop-templates/assembly/.editorconfig +132 -0
- package/plop-templates/assembly/.gitignore +362 -0
- package/plop-templates/assembly/.vscode/tasks.json +6 -0
- package/plop-templates/assembly/package.json.hbs +0 -1
- package/plop-templates/assembly/plopfile.js +2 -2
- package/plop-templates/webresource/.gitignore +43 -0
- package/plop-templates/webresource/package.json.hbs +0 -1
- package/plop-templates/webresource/plopfile.js +2 -2
- package/bin/sn.exe +0 -0
- package/bin/sn.exe.config +0 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
# Change Log - create-powerapps-project
|
|
2
|
+
|
|
3
|
+
This log was last generated on Sun, 16 Jan 2022 22:07:55 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
<!-- Start content -->
|
|
6
|
+
|
|
7
|
+
## 0.15.1
|
|
8
|
+
|
|
9
|
+
Sun, 16 Jan 2022 22:07:55 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Fix program command (derek.finlinson@journeyteam.com)
|
|
14
|
+
|
|
15
|
+
## 0.15.0
|
|
16
|
+
|
|
17
|
+
Sun, 16 Jan 2022 21:30:27 GMT
|
|
18
|
+
|
|
19
|
+
### Minor changes
|
|
20
|
+
|
|
21
|
+
- Remove dependencies; Fix plop dependency (derek.finlinson@journeyteam.com)
|
|
22
|
+
|
|
23
|
+
## 0.14.7
|
|
24
|
+
|
|
25
|
+
Tue, 07 Dec 2021 19:52:53 GMT
|
|
26
|
+
|
|
27
|
+
### Patches
|
|
28
|
+
|
|
29
|
+
- Switch to commonjs (derek.finlinson@journeyteam.com)
|
|
30
|
+
|
|
31
|
+
## 0.14.6
|
|
32
|
+
|
|
33
|
+
Tue, 07 Dec 2021 19:41:35 GMT
|
|
34
|
+
|
|
35
|
+
### Patches
|
|
36
|
+
|
|
37
|
+
- Revert to plop v2 (derek.finlinson@journeyteam.com)
|
|
38
|
+
|
|
39
|
+
## 0.14.5
|
|
40
|
+
|
|
41
|
+
Tue, 07 Dec 2021 18:47:59 GMT
|
|
42
|
+
|
|
43
|
+
### Patches
|
|
44
|
+
|
|
45
|
+
- Swap to commonjs (derek.finlinson@journeyteam.com)
|
|
46
|
+
|
|
47
|
+
## 0.14.4
|
|
48
|
+
|
|
49
|
+
Thu, 02 Dec 2021 20:50:52 GMT
|
|
50
|
+
|
|
51
|
+
### Patches
|
|
52
|
+
|
|
53
|
+
- Fix node-plop (derek.finlinson@journeyteam.com)
|
|
54
|
+
- Update plop (derek.finlinson@journeyteam.com)
|
|
55
|
+
|
|
56
|
+
## 0.14.3
|
|
57
|
+
|
|
58
|
+
Wed, 22 Sep 2021 16:01:21 GMT
|
|
59
|
+
|
|
60
|
+
### Patches
|
|
61
|
+
|
|
62
|
+
- Update deploy script (derek.finlinson@journeyteam.com)
|
|
63
|
+
|
|
64
|
+
## 0.14.2
|
|
65
|
+
|
|
66
|
+
Thu, 16 Sep 2021 20:49:48 GMT
|
|
67
|
+
|
|
68
|
+
### Patches
|
|
69
|
+
|
|
70
|
+
- New dataverse-utils scripts (derek.finlinson@journeyteam.com)
|
|
71
|
+
|
|
72
|
+
## 0.14.1
|
|
73
|
+
|
|
74
|
+
Thu, 02 Sep 2021 16:46:01 GMT
|
|
75
|
+
|
|
76
|
+
### Patches
|
|
77
|
+
|
|
78
|
+
- Update default scripts (derek.finlinson@journeyteam.com)
|
|
79
|
+
|
|
80
|
+
## 0.14.0
|
|
81
|
+
|
|
82
|
+
Thu, 02 Sep 2021 16:22:00 GMT
|
|
83
|
+
|
|
84
|
+
### Minor changes
|
|
85
|
+
|
|
86
|
+
- Use new dataverse-utils package (derek.finlinson@journeyteam.com)
|
|
87
|
+
|
|
88
|
+
## 0.13.1
|
|
89
|
+
|
|
90
|
+
Mon, 28 Jun 2021 20:38:16 GMT
|
|
91
|
+
|
|
92
|
+
### Patches
|
|
93
|
+
|
|
94
|
+
- Update package versions (derek.finlinson@journeyteam.com)
|
|
95
|
+
|
|
96
|
+
## 0.12.1
|
|
97
|
+
|
|
98
|
+
Wed, 02 Jun 2021 16:21:14 GMT
|
|
99
|
+
|
|
100
|
+
### Patches
|
|
101
|
+
|
|
102
|
+
- applying package updates (derek.finlinson@journeyteam.com)
|
|
103
|
+
|
|
104
|
+
## 0.12.0
|
|
105
|
+
|
|
106
|
+
Mon, 24 May 2021 16:33:16 GMT
|
|
107
|
+
|
|
108
|
+
### Minor changes
|
|
109
|
+
|
|
110
|
+
- Merge creds with config.json (derek.finlinson@journeyteam.com)
|
|
111
|
+
|
|
112
|
+
## 0.11.4
|
|
113
|
+
|
|
114
|
+
Fri, 12 Feb 2021 17:05:15 GMT
|
|
115
|
+
|
|
116
|
+
### Patches
|
|
117
|
+
|
|
118
|
+
- Use assets if emittedAssets is empty (derek.finlinson@journeyteam.com)
|
|
119
|
+
|
|
120
|
+
## 0.11.3
|
|
121
|
+
|
|
122
|
+
Mon, 01 Feb 2021 18:27:32 GMT
|
|
123
|
+
|
|
124
|
+
### Patches
|
|
125
|
+
|
|
126
|
+
- Fix scripts (derek.finlinson@journeyteam.com)
|
|
127
|
+
|
|
128
|
+
## 0.11.2
|
|
129
|
+
|
|
130
|
+
Mon, 01 Feb 2021 17:31:23 GMT
|
|
131
|
+
|
|
132
|
+
### Patches
|
|
133
|
+
|
|
134
|
+
- Make executable (derek.finlinson@journeyteam.com)
|
|
135
|
+
|
|
136
|
+
## 0.11.1
|
|
137
|
+
|
|
138
|
+
Mon, 01 Feb 2021 17:20:22 GMT
|
|
139
|
+
|
|
140
|
+
### Patches
|
|
141
|
+
|
|
142
|
+
- Fix package dependencies (derek.finlinson@journeyteam.com)
|
|
143
|
+
|
|
144
|
+
## 0.11.0
|
|
145
|
+
|
|
146
|
+
Sat, 30 Jan 2021 05:31:27 GMT
|
|
147
|
+
|
|
148
|
+
### Minor changes
|
|
149
|
+
|
|
150
|
+
- Update deployment scripts; Refactor (derek.finlinson@journeyteam.com)
|
|
151
|
+
|
|
152
|
+
## 0.10.3
|
|
153
|
+
|
|
154
|
+
Tue, 19 Jan 2021 16:29:25 GMT
|
|
155
|
+
|
|
156
|
+
### Patches
|
|
157
|
+
|
|
158
|
+
- Always add solution (derek.finlinson@journeyteam.com)
|
|
159
|
+
|
|
160
|
+
## 0.10.2
|
|
161
|
+
|
|
162
|
+
Mon, 18 Jan 2021 20:48:31 GMT
|
|
163
|
+
|
|
164
|
+
### Patches
|
|
165
|
+
|
|
166
|
+
- Fix default webpack config (derek.finlinson@journeyteam.com)
|
|
167
|
+
|
|
168
|
+
## 0.10.1
|
|
169
|
+
|
|
170
|
+
Fri, 15 Jan 2021 21:17:38 GMT
|
|
171
|
+
|
|
172
|
+
### Patches
|
|
173
|
+
|
|
174
|
+
- Remove dependency (derek.finlinson@journeyteam.com)
|
|
175
|
+
|
|
176
|
+
## 0.10.0
|
|
177
|
+
|
|
178
|
+
Thu, 14 Jan 2021 23:48:11 GMT
|
|
179
|
+
|
|
180
|
+
### Minor changes
|
|
181
|
+
|
|
182
|
+
- Remove just-scripts (derek.finlinson@journeyteam.com)
|
|
183
|
+
|
|
184
|
+
### Patches
|
|
185
|
+
|
|
186
|
+
- Bump dataverse-webapi to v1.0.1 (derek.finlinson@journeyteam.com)
|
|
187
|
+
|
|
188
|
+
## 0.9.0
|
|
189
|
+
|
|
190
|
+
Thu, 14 Jan 2021 00:33:39 GMT
|
|
191
|
+
|
|
192
|
+
### Minor changes
|
|
193
|
+
|
|
194
|
+
- Switch to dataverse-webapi (derek.finlinson@journeyteam.com)
|
|
195
|
+
|
|
196
|
+
## 0.8.2
|
|
197
|
+
|
|
198
|
+
Tue, 29 Dec 2020 19:55:03 GMT
|
|
199
|
+
|
|
200
|
+
### Patches
|
|
201
|
+
|
|
202
|
+
- Fix webpack compilation assets (derek.finlinson@journeyteam.com)
|
|
203
|
+
|
|
204
|
+
## 0.8.1
|
|
205
|
+
|
|
206
|
+
Tue, 15 Dec 2020 20:28:34 GMT
|
|
207
|
+
|
|
208
|
+
### Patches
|
|
209
|
+
|
|
210
|
+
- Fix files (derek.finlinson@journeyteam.com)
|
|
211
|
+
|
|
212
|
+
## 0.8.0
|
|
213
|
+
|
|
214
|
+
Tue, 08 Dec 2020 18:10:21 GMT
|
|
215
|
+
|
|
216
|
+
### Minor changes
|
|
217
|
+
|
|
218
|
+
- Add files to package.json (derek.finlinson@journeyteam.com)
|
|
219
|
+
|
|
220
|
+
## 0.7.0
|
|
221
|
+
|
|
222
|
+
Mon, 07 Dec 2020 22:04:22 GMT
|
|
223
|
+
|
|
224
|
+
### Minor changes
|
|
225
|
+
|
|
226
|
+
- Switch to TS just.config (derek.finlinson@journeyteam.com)
|
|
227
|
+
|
|
228
|
+
## 0.6.7
|
|
229
|
+
|
|
230
|
+
Tue, 01 Dec 2020 19:40:31 GMT
|
|
231
|
+
|
|
232
|
+
### Patches
|
|
233
|
+
|
|
234
|
+
- Remove IE support; Fix webpack config (derek.finlinson@journeyteam.com)
|
|
235
|
+
|
|
236
|
+
## 0.6.6
|
|
237
|
+
|
|
238
|
+
Tue, 01 Dec 2020 17:28:45 GMT
|
|
239
|
+
|
|
240
|
+
### Patches
|
|
241
|
+
|
|
242
|
+
- Fix bug when adding plugin step; Add tasks.json (derek.finlinson@journeyteam.com)
|
|
243
|
+
|
|
244
|
+
## 0.6.5
|
|
245
|
+
|
|
246
|
+
Wed, 18 Nov 2020 15:18:31 GMT
|
|
247
|
+
|
|
248
|
+
### Patches
|
|
249
|
+
|
|
250
|
+
- Remove default namespace for assemblies (derek.finlinson@journeyteam.com)
|
|
251
|
+
|
|
252
|
+
## 0.6.4
|
|
253
|
+
|
|
254
|
+
Thu, 15 Oct 2020 20:08:59 GMT
|
|
255
|
+
|
|
256
|
+
### Patches
|
|
257
|
+
|
|
258
|
+
- Re-add corejs (derek.finlinson@journeyteam.com)
|
|
259
|
+
|
|
260
|
+
## 0.6.3
|
|
261
|
+
|
|
262
|
+
Thu, 15 Oct 2020 17:22:02 GMT
|
|
263
|
+
|
|
264
|
+
### Patches
|
|
265
|
+
|
|
266
|
+
- Update dependencies (derek.finlinson@journeyteam.com)
|
|
267
|
+
|
|
268
|
+
## 0.6.2
|
|
269
|
+
|
|
270
|
+
Tue, 13 Oct 2020 15:42:51 GMT
|
|
271
|
+
|
|
272
|
+
### Patches
|
|
273
|
+
|
|
274
|
+
- Use specific just-scripts version (derek.finlinson@journeyteam.com)
|
|
275
|
+
|
|
276
|
+
## 0.6.1
|
|
277
|
+
|
|
278
|
+
Tue, 13 Oct 2020 15:38:50 GMT
|
|
279
|
+
|
|
280
|
+
### Patches
|
|
281
|
+
|
|
282
|
+
- Update dependencies (derek.finlinson@journeyteam.com)
|
|
283
|
+
|
|
284
|
+
## 0.6.0
|
|
285
|
+
|
|
286
|
+
Fri, 02 Oct 2020 16:20:30 GMT
|
|
287
|
+
|
|
288
|
+
### Minor changes
|
|
289
|
+
|
|
290
|
+
- Add tenant back but default to common (derek.finlinson@journeyteam.com)
|
|
291
|
+
|
|
292
|
+
## 0.5.1
|
|
293
|
+
|
|
294
|
+
Tue, 25 Aug 2020 22:13:42 GMT
|
|
295
|
+
|
|
296
|
+
### Patches
|
|
297
|
+
|
|
298
|
+
- Fix adding project to solution (derek.finlinson@journeyteam.com)
|
|
299
|
+
|
|
300
|
+
## 0.5.0
|
|
301
|
+
|
|
302
|
+
Tue, 25 Aug 2020 22:05:30 GMT
|
|
303
|
+
|
|
304
|
+
### Minor changes
|
|
305
|
+
|
|
306
|
+
- Add option to add VS solution (derek.finlinson@journeyteam.com)
|
|
307
|
+
|
|
308
|
+
## 0.4.0
|
|
309
|
+
|
|
310
|
+
Wed, 19 Aug 2020 15:10:11 GMT
|
|
311
|
+
|
|
312
|
+
### Minor changes
|
|
313
|
+
|
|
314
|
+
- Add deploy to webpack config (derek.finlinson@journeyteam.com)
|
|
315
|
+
|
|
316
|
+
## 0.3.6
|
|
317
|
+
|
|
318
|
+
Tue, 21 Jul 2020 21:04:25 GMT
|
|
319
|
+
|
|
320
|
+
### Patches
|
|
321
|
+
|
|
322
|
+
- Remove rename action (derek.finlinson@journeyteam.com)
|
|
323
|
+
|
|
324
|
+
## 0.3.5
|
|
325
|
+
|
|
326
|
+
Tue, 21 Jul 2020 20:30:49 GMT
|
|
327
|
+
|
|
328
|
+
### Patches
|
|
329
|
+
|
|
330
|
+
- Fix rename action (derek.finlinson@journeyteam.com)
|
|
331
|
+
|
|
332
|
+
## 0.3.4
|
|
333
|
+
|
|
334
|
+
Tue, 21 Jul 2020 19:05:10 GMT
|
|
335
|
+
|
|
336
|
+
### Patches
|
|
337
|
+
|
|
338
|
+
- Fix renaming (derek.finlinson@journeyteam.com)
|
|
339
|
+
|
|
340
|
+
## 0.3.3
|
|
341
|
+
|
|
342
|
+
Mon, 20 Jul 2020 14:46:25 GMT
|
|
343
|
+
|
|
344
|
+
### Patches
|
|
345
|
+
|
|
346
|
+
- Rename dot files (derek.finlinson@journeyteam.com)
|
|
347
|
+
|
|
348
|
+
## 0.3.2
|
|
349
|
+
|
|
350
|
+
Mon, 20 Jul 2020 14:16:22 GMT
|
|
351
|
+
|
|
352
|
+
### Patches
|
|
353
|
+
|
|
354
|
+
- Fix missing dependencies (derek.finlinson@journeyteam.com)
|
|
355
|
+
|
|
356
|
+
## 0.3.1
|
|
357
|
+
|
|
358
|
+
Mon, 20 Jul 2020 13:55:48 GMT
|
|
359
|
+
|
|
360
|
+
### Patches
|
|
361
|
+
|
|
362
|
+
- Add yargs as dependency (derek.finlinson@journeyteam.com)
|
|
363
|
+
|
|
364
|
+
## 0.3.0
|
|
365
|
+
|
|
366
|
+
Sun, 19 Jul 2020 16:43:41 GMT
|
|
367
|
+
|
|
368
|
+
### Minor changes
|
|
369
|
+
|
|
370
|
+
- Use new Nuget API URL (derek.finlinson@journeyteam.com)
|
|
371
|
+
|
|
372
|
+
## 0.2.0
|
|
373
|
+
|
|
374
|
+
Thu, 16 Jul 2020 15:09:52 GMT
|
|
375
|
+
|
|
376
|
+
### Minor changes
|
|
377
|
+
|
|
378
|
+
- Enable powerapps dependencies (derek.finlinson@journeyteam.com)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import yargs from 'yargs';
|
|
2
1
|
export interface Config {
|
|
3
2
|
name: string;
|
|
4
3
|
isolation: number;
|
|
@@ -8,4 +7,6 @@ export interface Config {
|
|
|
8
7
|
xrmVersion?: string;
|
|
9
8
|
sdkVersion?: string;
|
|
10
9
|
}
|
|
11
|
-
|
|
10
|
+
declare const _default: (type: string) => Promise<void>;
|
|
11
|
+
export default _default;
|
|
12
|
+
export declare const done: (type: string) => void;
|
|
@@ -22,50 +22,50 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.done = void 0;
|
|
25
26
|
const prompts_1 = __importDefault(require("prompts"));
|
|
26
27
|
const nuget_1 = require("./nuget");
|
|
27
28
|
const path_1 = __importDefault(require("path"));
|
|
28
29
|
const plop_1 = require("./plop");
|
|
29
30
|
const pkg = __importStar(require("./packageManager"));
|
|
30
|
-
const just_scripts_utils_1 = require("just-scripts-utils");
|
|
31
31
|
const getEnvInfo_1 = require("./getEnvInfo");
|
|
32
|
-
|
|
32
|
+
const logger_1 = require("./logger");
|
|
33
|
+
exports.default = async (type) => {
|
|
33
34
|
await (0, getEnvInfo_1.initialize)();
|
|
34
|
-
|
|
35
|
-
if (!
|
|
36
|
-
const invalid =
|
|
37
|
-
const invalidMessage = invalid ? `${
|
|
38
|
-
const {
|
|
35
|
+
const name = path_1.default.basename(process.cwd());
|
|
36
|
+
if (!type || (type !== 'webresource' && type !== 'assembly')) {
|
|
37
|
+
const invalid = type !== undefined && type !== 'webresource' && type !== 'assembly';
|
|
38
|
+
const invalidMessage = invalid ? `${type} is not a valid project type.` : '';
|
|
39
|
+
const { promptType } = await (0, prompts_1.default)({
|
|
39
40
|
type: 'select',
|
|
40
|
-
name: '
|
|
41
|
+
name: 'promptType',
|
|
41
42
|
message: `${invalidMessage} Select dataverse project to create?`,
|
|
42
43
|
choices: [
|
|
43
44
|
{ title: 'web resource', value: 'webresource' },
|
|
44
45
|
{ title: 'plugin or workflow activity', value: 'assembly' }
|
|
45
46
|
]
|
|
46
47
|
});
|
|
47
|
-
|
|
48
|
+
type = promptType;
|
|
48
49
|
}
|
|
49
|
-
const questions = await getAnswers(
|
|
50
|
+
const questions = await getAnswers(type);
|
|
50
51
|
const config = (await (0, prompts_1.default)(questions));
|
|
51
|
-
if (
|
|
52
|
+
if (type === 'assembly') {
|
|
52
53
|
const xrmVersions = await (0, nuget_1.getNugetPackageVersions)('JourneyTeam.Xrm');
|
|
53
54
|
config.xrmVersion = xrmVersions.shift();
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
-
const generator = await (0, plop_1.getGenerator)(
|
|
57
|
-
|
|
56
|
+
logger_1.logger.info('get plop generator');
|
|
57
|
+
const generator = await (0, plop_1.getGenerator)(type, name);
|
|
58
|
+
logger_1.logger.info(`run powerapps-project-${type} code generator`);
|
|
58
59
|
await (0, plop_1.runGenerator)(generator, config);
|
|
59
|
-
|
|
60
|
-
pkg.install(process.cwd(),
|
|
61
|
-
if (
|
|
62
|
-
|
|
60
|
+
logger_1.logger.info('initialize project');
|
|
61
|
+
pkg.install(process.cwd(), type);
|
|
62
|
+
if (type === 'assembly') {
|
|
63
|
+
logger_1.logger.info('add nuget packages');
|
|
63
64
|
(0, nuget_1.install)(config.name, config.sdkVersion, config.xrmVersion);
|
|
64
65
|
}
|
|
65
|
-
done(
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
async function getAnswers(type) {
|
|
66
|
+
(0, exports.done)(type);
|
|
67
|
+
};
|
|
68
|
+
const getAnswers = async (type) => {
|
|
69
69
|
let questions = [];
|
|
70
70
|
if (type === 'webresource') {
|
|
71
71
|
questions.push({
|
|
@@ -125,28 +125,29 @@ async function getAnswers(type) {
|
|
|
125
125
|
}
|
|
126
126
|
];
|
|
127
127
|
return questions;
|
|
128
|
-
}
|
|
129
|
-
|
|
128
|
+
};
|
|
129
|
+
const done = (type) => {
|
|
130
130
|
const message = `
|
|
131
|
-
${
|
|
131
|
+
${type} project created!
|
|
132
132
|
|
|
133
|
-
## Keeping Up-to-date
|
|
134
133
|
keep your build tools up-to-date by updating these two devDependencies:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
${argv.type === 'webresource' ? '* just-scripts' : ''}
|
|
134
|
+
* dataverse-utils
|
|
135
|
+
* powerapps-project-${type}
|
|
138
136
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
${pkg.getYarn() ? 'yarn' : 'npm'} start
|
|
137
|
+
${type === 'webresource' ?
|
|
138
|
+
`build your project in watch mode with this command:
|
|
139
|
+
${pkg.getYarn() ? 'yarn' : 'npm run'} start
|
|
143
140
|
build your project in production mode with this command:
|
|
144
|
-
${pkg.getYarn() ? 'yarn' : 'npm run'} build
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
${pkg.getYarn() ? 'yarn' : 'npm run'} build
|
|
142
|
+
generate table definition files with this command:
|
|
143
|
+
${pkg.getYarn() ? 'yarn' : 'npm run'} generate` :
|
|
144
|
+
`build your project with this command:
|
|
145
|
+
dotnet build
|
|
146
|
+
deploy your project with this command:
|
|
147
|
+
${pkg.getYarn() ? 'yarn' : 'npm run'} deploy`}
|
|
147
148
|
|
|
148
149
|
run code generator with this command:
|
|
149
|
-
${pkg.getYarn() ? 'yarn' : 'npm run'} gen
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
${pkg.getYarn() ? 'yarn' : 'npm run'} gen`;
|
|
151
|
+
logger_1.logger.info(message);
|
|
152
|
+
};
|
|
153
|
+
exports.done = done;
|
package/lib/getEnvInfo.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface EnvInfoCache {
|
|
2
|
+
Binaries: {
|
|
3
|
+
Yarn: any;
|
|
4
|
+
npm: any;
|
|
5
|
+
};
|
|
6
|
+
npmGlobalPackages: {
|
|
7
|
+
pnpm: any;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare const getEnvInfo: () => EnvInfoCache;
|
|
2
11
|
export declare const initialize: () => Promise<any>;
|
package/lib/getEnvInfo.js
CHANGED
|
@@ -15,7 +15,8 @@ const getEnvInfo = () => {
|
|
|
15
15
|
exports.getEnvInfo = getEnvInfo;
|
|
16
16
|
const initialize = async () => {
|
|
17
17
|
envInfoCache = JSON.parse(await envinfo_1.default.run({
|
|
18
|
-
Binaries: ['Yarn', 'npm']
|
|
18
|
+
Binaries: ['Yarn', 'npm'],
|
|
19
|
+
npmGlobalPackages: ['pnpm']
|
|
19
20
|
}, { json: true, showNotFound: false }));
|
|
20
21
|
if (envInfoCache.Binaries.Yarn) {
|
|
21
22
|
envInfoCache.Binaries.Yarn.path = expandHome(envInfoCache.Binaries.Yarn.path);
|
|
@@ -23,6 +24,9 @@ const initialize = async () => {
|
|
|
23
24
|
if (envInfoCache.Binaries.npm) {
|
|
24
25
|
envInfoCache.Binaries.npm.path = expandHome(envInfoCache.Binaries.npm.path);
|
|
25
26
|
}
|
|
27
|
+
if (envInfoCache.npmGlobalPackages.pnpm) {
|
|
28
|
+
envInfoCache.npmGlobalPackages.pnpm.path = 'pnpm';
|
|
29
|
+
}
|
|
26
30
|
return envInfoCache;
|
|
27
31
|
};
|
|
28
32
|
exports.initialize = initialize;
|
package/lib/index.js
CHANGED
|
@@ -4,13 +4,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const kleur_1 = __importDefault(require("kleur"));
|
|
8
9
|
const createDataverseProject_1 = __importDefault(require("./createDataverseProject"));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
11
|
+
const packageJson = require('../package');
|
|
12
|
+
const program = new commander_1.Command(packageJson.name);
|
|
13
|
+
program
|
|
14
|
+
.version(packageJson.version)
|
|
15
|
+
.description('Create new Dataverse project')
|
|
16
|
+
.usage(kleur_1.default.green('[type]'))
|
|
17
|
+
.argument('[type]', 'Type of project to generate')
|
|
18
|
+
.action(type => {
|
|
19
|
+
(0, createDataverseProject_1.default)(type);
|
|
20
|
+
});
|
|
21
|
+
program.parse(process.argv);
|
|
22
|
+
if (!process.argv.slice(1).length) {
|
|
23
|
+
program.outputHelp();
|
|
24
|
+
}
|
package/lib/logger.d.ts
ADDED
package/lib/logger.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.logger = void 0;
|
|
7
|
+
const kleur_1 = __importDefault(require("kleur"));
|
|
8
|
+
const square = '\u25a0';
|
|
9
|
+
const triangle = '\u25b2';
|
|
10
|
+
const emptySquare = '\u25a1';
|
|
11
|
+
const log = (method, symbol, ...args) => {
|
|
12
|
+
const now = new Date();
|
|
13
|
+
const timestamp = kleur_1.default.gray(`[${now.toLocaleTimeString()}]`);
|
|
14
|
+
console[method](timestamp, symbol, args);
|
|
15
|
+
};
|
|
16
|
+
exports.logger = {
|
|
17
|
+
info(...args) {
|
|
18
|
+
log('info', kleur_1.default.green(square), args);
|
|
19
|
+
},
|
|
20
|
+
warn(...args) {
|
|
21
|
+
log('warn', kleur_1.default.yellow(triangle), args);
|
|
22
|
+
},
|
|
23
|
+
error(...args) {
|
|
24
|
+
log('error', kleur_1.default.red(emptySquare), args);
|
|
25
|
+
}
|
|
26
|
+
};
|
package/lib/packageManager.js
CHANGED
|
@@ -13,6 +13,10 @@ const getNpm = () => {
|
|
|
13
13
|
const npmInfo = (0, getEnvInfo_1.getEnvInfo)().Binaries.npm;
|
|
14
14
|
return npmInfo && npmInfo.path;
|
|
15
15
|
};
|
|
16
|
+
const getPnpm = () => {
|
|
17
|
+
const pnpmInfo = (0, getEnvInfo_1.getEnvInfo)().npmGlobalPackages.pnpm;
|
|
18
|
+
return pnpmInfo && pnpmInfo.path;
|
|
19
|
+
};
|
|
16
20
|
const install = (cwd, type) => {
|
|
17
21
|
const packages = getPackages(type);
|
|
18
22
|
if ((0, exports.getYarn)()) {
|
|
@@ -21,6 +25,12 @@ const install = (cwd, type) => {
|
|
|
21
25
|
(0, child_process_1.spawnSync)((0, exports.getYarn)(), ['add', ...packages.dependencies], { stdio: 'inherit', cwd });
|
|
22
26
|
}
|
|
23
27
|
}
|
|
28
|
+
else if (getPnpm()) {
|
|
29
|
+
(0, child_process_1.spawnSync)(getPnpm(), ['add', ...packages.devDependencies], { stdio: 'inherit', cwd });
|
|
30
|
+
if (packages.dependencies) {
|
|
31
|
+
(0, child_process_1.spawnSync)(getPnpm(), ['add', ...packages.dependencies], { stdio: 'inherit', cwd });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
24
34
|
else {
|
|
25
35
|
(0, child_process_1.spawnSync)(getNpm(), ['add', ...packages.devDependencies], { stdio: 'inherit', cwd });
|
|
26
36
|
if (packages.dependencies) {
|
|
@@ -32,7 +42,6 @@ exports.install = install;
|
|
|
32
42
|
function getPackages(type) {
|
|
33
43
|
const packages = {
|
|
34
44
|
devDependencies: [
|
|
35
|
-
'plop',
|
|
36
45
|
`powerapps-project-${type}`,
|
|
37
46
|
'dataverse-utils'
|
|
38
47
|
]
|
package/lib/plop.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PlopGenerator } from 'node-plop';
|
|
2
|
-
import yargs from 'yargs';
|
|
3
2
|
import { Config } from './createDataverseProject';
|
|
4
|
-
export declare const getGenerator: (
|
|
3
|
+
export declare const getGenerator: (type: string, name: string) => Promise<PlopGenerator>;
|
|
5
4
|
export declare const runGenerator: (generator: PlopGenerator, args: Config) => Promise<void>;
|
package/lib/plop.js
CHANGED
|
@@ -6,19 +6,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.runGenerator = exports.getGenerator = void 0;
|
|
7
7
|
const node_plop_1 = __importDefault(require("node-plop"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const
|
|
9
|
+
const logger_1 = require("./logger");
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
-
const getGenerator = async (
|
|
11
|
+
const getGenerator = async (type, name) => {
|
|
12
12
|
const plopFile = path_1.default.resolve(__dirname, 'plopfile.js');
|
|
13
|
-
const plop = await (0, node_plop_1.default)(plopFile, { destBasePath:
|
|
14
|
-
const generator = plop.getGenerator(
|
|
13
|
+
const plop = await (0, node_plop_1.default)(plopFile, { destBasePath: name, force: false });
|
|
14
|
+
const generator = plop.getGenerator(type);
|
|
15
15
|
return generator;
|
|
16
16
|
};
|
|
17
17
|
exports.getGenerator = getGenerator;
|
|
18
18
|
const runGenerator = async (generator, args) => {
|
|
19
19
|
const results = await generator.runActions(args, {
|
|
20
20
|
onComment: (comment) => {
|
|
21
|
-
|
|
21
|
+
logger_1.logger.info(comment);
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
if (results.failures && results.failures.length > 0) {
|
|
@@ -27,7 +27,7 @@ const runGenerator = async (generator, args) => {
|
|
|
27
27
|
// do something after the actions have run
|
|
28
28
|
for (const change of results.changes) {
|
|
29
29
|
if (change.path) {
|
|
30
|
-
|
|
30
|
+
logger_1.logger.info(change.path);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
};
|
package/lib/plopfile.js
CHANGED
|
@@ -39,7 +39,8 @@ exports.default = (plop) => {
|
|
|
39
39
|
'../plop-templates/assembly/*.ts.hbs',
|
|
40
40
|
'../plop-templates/assembly/.gitignore',
|
|
41
41
|
'../plop-templates/assembly/Entities/EarlyBoundGenerator.xml',
|
|
42
|
-
'../plop-templates/assembly/.vscode/tasks.json'
|
|
42
|
+
'../plop-templates/assembly/.vscode/tasks.json',
|
|
43
|
+
'../plop-templates/assembly/.editorconfig'
|
|
43
44
|
],
|
|
44
45
|
base: '../plop-templates/assembly',
|
|
45
46
|
destination: process.cwd(),
|