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