@m2c2kit/cli 0.3.12 → 0.3.14
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 -2
- package/dist/index.js +21 -33
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
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/72cf799388e16c21855b12a08b29f7dbcb464845/packages/angular_devkit/schematics_cli/bin/schematics.ts
|
|
6
6
|
* The license for that code is as follows:
|
|
7
|
-
*
|
|
8
7
|
* @license
|
|
9
8
|
* Copyright Google LLC All Rights Reserved.
|
|
10
9
|
*
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
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/72cf799388e16c21855b12a08b29f7dbcb464845/packages/angular_devkit/schematics_cli/bin/schematics.ts
|
|
7
7
|
* The license for that code is as follows:
|
|
8
|
-
*
|
|
9
8
|
* @license
|
|
10
9
|
* Copyright Google LLC All Rights Reserved.
|
|
11
10
|
*
|
|
@@ -35,17 +34,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
35
34
|
__setModuleDefault(result, mod);
|
|
36
35
|
return result;
|
|
37
36
|
};
|
|
37
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
|
+
};
|
|
38
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
41
|
exports.loadEsmModule = exports.main = void 0;
|
|
40
42
|
// symbol polyfill must go first
|
|
41
43
|
require("symbol-observable");
|
|
42
|
-
const core_1 = require("@angular-devkit/core");
|
|
43
44
|
const node_1 = require("@angular-devkit/core/node");
|
|
44
45
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
45
46
|
const tools_1 = require("@angular-devkit/schematics/tools");
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const path = __importStar(require("path"));
|
|
47
|
+
const ansi_colors_1 = __importDefault(require("ansi-colors"));
|
|
48
|
+
const node_fs_1 = require("node:fs");
|
|
49
|
+
const path = __importStar(require("node:path"));
|
|
49
50
|
const yargs_parser_1 = __importStar(require("yargs-parser"));
|
|
50
51
|
/**
|
|
51
52
|
* Parse the name of schematic passed in argument, and return a {collection, schematic} named
|
|
@@ -158,7 +159,7 @@ function findUp(names, from) {
|
|
|
158
159
|
while (currentDir && currentDir !== root) {
|
|
159
160
|
for (const name of names) {
|
|
160
161
|
const p = path.join(currentDir, name);
|
|
161
|
-
if ((0,
|
|
162
|
+
if ((0, node_fs_1.existsSync)(p)) {
|
|
162
163
|
return p;
|
|
163
164
|
}
|
|
164
165
|
}
|
|
@@ -186,7 +187,7 @@ function getPackageManagerName() {
|
|
|
186
187
|
async function main({ args, stdout = process.stdout, stderr = process.stderr, }) {
|
|
187
188
|
const { cliOptions, schematicOptions, _ } = parseArgs(args);
|
|
188
189
|
// Create a separate instance to prevent unintended global changes to the color configuration
|
|
189
|
-
const colors =
|
|
190
|
+
const colors = ansi_colors_1.default.create();
|
|
190
191
|
/** Create the DevKit Logger used through the CLI. */
|
|
191
192
|
const logger = (0, node_1.createConsoleLogger)(!!cliOptions.verbose, stdout, stderr, {
|
|
192
193
|
info: (s) => s,
|
|
@@ -345,35 +346,22 @@ exports.main = main;
|
|
|
345
346
|
* Get usage of the CLI tool.
|
|
346
347
|
*/
|
|
347
348
|
function getUsage() {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
Commands:
|
|
352
|
-
m2 new <name> create a new m2c2kit app.
|
|
353
|
-
|
|
354
|
-
Options:
|
|
355
|
-
--debug Debug mode. This is true by default if the collection is a relative
|
|
356
|
-
path (in that case, turn off with --debug=false).
|
|
357
|
-
|
|
358
|
-
--allow-private Allow private schematics to be run from the command line. Default to
|
|
359
|
-
false.
|
|
360
|
-
|
|
361
|
-
--dry-run Do not output anything, but instead just show what actions would be
|
|
362
|
-
performed. Default to true if debug is also true.
|
|
363
|
-
|
|
364
|
-
--force Force overwriting files that would otherwise be an error.
|
|
365
|
-
|
|
366
|
-
--list-schematics List all schematics from the collection, by name. A collection name
|
|
367
|
-
should be suffixed by a colon. Example: '@angular-devkit/schematics-cli:'.
|
|
349
|
+
const colors = ansi_colors_1.default.create();
|
|
350
|
+
return `
|
|
351
|
+
m2c2kit CLI
|
|
368
352
|
|
|
369
|
-
|
|
353
|
+
${colors.blue("Commands:")}
|
|
354
|
+
m2 new [name] Create a new m2c2kit project.
|
|
370
355
|
|
|
371
|
-
|
|
356
|
+
Arguments:
|
|
357
|
+
name The name of the new project.
|
|
372
358
|
|
|
373
|
-
|
|
359
|
+
Options:
|
|
360
|
+
-g, --skipGit Skip initializing a git repository.
|
|
361
|
+
-m, --module Create a m2c2kit assessment module (default is application).
|
|
374
362
|
|
|
375
|
-
|
|
376
|
-
|
|
363
|
+
m2 zip Package a built assessment module into a zip file.
|
|
364
|
+
`;
|
|
377
365
|
}
|
|
378
366
|
/** Parse the command line. */
|
|
379
367
|
const booleanArgs = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m2c2kit/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.14",
|
|
4
4
|
"description": "Command line interface to create new m2c2kit apps",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**"
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://m2c2-project.github.io/m2c2kit",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/core": "^17.0
|
|
29
|
-
"@angular-devkit/schematics": "^17.0
|
|
30
|
-
"@m2c2kit/schematics": "^0.1.
|
|
31
|
-
"@schematics/angular": "^17.0
|
|
28
|
+
"@angular-devkit/core": "^17.3.0",
|
|
29
|
+
"@angular-devkit/schematics": "^17.3.0",
|
|
30
|
+
"@m2c2kit/schematics": "^0.1.13",
|
|
31
|
+
"@schematics/angular": "^17.3.0",
|
|
32
32
|
"ansi-colors": "4.1.3",
|
|
33
|
-
"inquirer": "9.2.
|
|
33
|
+
"inquirer": "9.2.14",
|
|
34
34
|
"symbol-observable": "4.0.0",
|
|
35
35
|
"yargs-parser": "21.1.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/inquirer": "9.0.7",
|
|
39
39
|
"rimraf": "5.0.5",
|
|
40
|
-
"typescript": "5.
|
|
40
|
+
"typescript": "5.4.2"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=18"
|