@m2c2kit/cli 0.3.16 → 0.3.18
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/dist/index.d.ts +1 -1
- package/dist/index.js +18 -6
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* The code in this file is adapted from a reference CLI implementation from
|
|
4
4
|
* the Angular devkit repository:
|
|
5
|
-
* https://github.com/angular/angular-cli/blob/
|
|
5
|
+
* https://github.com/angular/angular-cli/blob/a7f466a5fa87c51b914441524bd0dff5b3957ced/packages/angular_devkit/schematics_cli/bin/schematics.ts
|
|
6
6
|
* The license for that code is as follows:
|
|
7
7
|
* @license
|
|
8
8
|
* Copyright Google LLC All Rights Reserved.
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* The code in this file is adapted from a reference CLI implementation from
|
|
5
5
|
* the Angular devkit repository:
|
|
6
|
-
* https://github.com/angular/angular-cli/blob/
|
|
6
|
+
* https://github.com/angular/angular-cli/blob/a7f466a5fa87c51b914441524bd0dff5b3957ced/packages/angular_devkit/schematics_cli/bin/schematics.ts
|
|
7
7
|
* The license for that code is as follows:
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -41,6 +41,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
41
41
|
exports.main = main;
|
|
42
42
|
// symbol polyfill must go first
|
|
43
43
|
require("symbol-observable");
|
|
44
|
+
const core_1 = require("@angular-devkit/core");
|
|
44
45
|
const node_1 = require("@angular-devkit/core/node");
|
|
45
46
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
46
47
|
const tools_1 = require("@angular-devkit/schematics/tools");
|
|
@@ -110,6 +111,12 @@ function _createPromptProvider() {
|
|
|
110
111
|
answers[definition.id] = await (definition.multiselect ? prompts.checkbox : prompts.select)({
|
|
111
112
|
message: definition.message,
|
|
112
113
|
default: definition.default,
|
|
114
|
+
validate: (values) => {
|
|
115
|
+
if (!definition.validator) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
return definition.validator(Object.values(values).map(({ value }) => value));
|
|
119
|
+
},
|
|
113
120
|
choices: definition.items.map((item) => typeof item == "string"
|
|
114
121
|
? {
|
|
115
122
|
name: item,
|
|
@@ -299,6 +306,7 @@ async function main({ args, stdout = process.stdout, stderr = process.stderr, })
|
|
|
299
306
|
error = false;
|
|
300
307
|
}
|
|
301
308
|
});
|
|
309
|
+
workflow.registry.addPostTransform(core_1.schema.transforms.addUndefinedDefaults);
|
|
302
310
|
// Show usage of deprecated options
|
|
303
311
|
workflow.registry.useXDeprecatedProvider((msg) => logger.warn(msg));
|
|
304
312
|
// Pass the rest of the arguments as the smart default "argv". Then delete it.
|
|
@@ -357,16 +365,20 @@ function getUsage() {
|
|
|
357
365
|
m2c2kit CLI
|
|
358
366
|
|
|
359
367
|
${colors.blue("Commands:")}
|
|
360
|
-
m2 new [name]
|
|
368
|
+
m2 new [name] Create a new m2c2kit project.
|
|
361
369
|
|
|
362
370
|
Arguments:
|
|
363
|
-
name
|
|
371
|
+
name The name of the new project.
|
|
364
372
|
|
|
365
373
|
Options:
|
|
366
|
-
-g, --skipGit
|
|
367
|
-
-m, --module
|
|
374
|
+
-g, --skipGit Skip initializing a git repository.
|
|
375
|
+
-m, --module Create a m2c2kit assessment module (default is application).
|
|
368
376
|
|
|
369
|
-
m2
|
|
377
|
+
m2 static-site Create a static website containing m2c2kit assessments.
|
|
378
|
+
|
|
379
|
+
Options:
|
|
380
|
+
--config <file.mjs> The name of the configuration file, must end in .mjs
|
|
381
|
+
--init Create site-config.mjs file in the current directory.
|
|
370
382
|
`;
|
|
371
383
|
}
|
|
372
384
|
/** Parse the command line. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m2c2kit/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.18",
|
|
4
4
|
"description": "Command line interface to create new m2c2kit apps",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**"
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://m2c2-project.github.io/m2c2kit",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/core": "^18.
|
|
29
|
-
"@angular-devkit/schematics": "^18.
|
|
30
|
-
"@inquirer/prompts": "5.
|
|
31
|
-
"@m2c2kit/schematics": "0.1.
|
|
32
|
-
"@schematics/angular": "^18.
|
|
28
|
+
"@angular-devkit/core": "^18.2.0",
|
|
29
|
+
"@angular-devkit/schematics": "^18.2.0",
|
|
30
|
+
"@inquirer/prompts": "5.3.8",
|
|
31
|
+
"@m2c2kit/schematics": "0.1.18",
|
|
32
|
+
"@schematics/angular": "^18.2.0",
|
|
33
33
|
"ansi-colors": "4.1.3",
|
|
34
34
|
"symbol-observable": "4.0.0",
|
|
35
35
|
"yargs-parser": "21.1.1"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/inquirer": "9.0.7",
|
|
39
39
|
"rimraf": "6.0.1",
|
|
40
|
-
"typescript": "5.5.
|
|
40
|
+
"typescript": "5.5.4"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=18"
|