@nestjs/cli 11.0.16 → 12.0.0-alpha.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/actions/abstract.action.d.ts +1 -2
- package/actions/abstract.action.js +1 -5
- package/actions/add.action.d.ts +3 -4
- package/actions/add.action.js +38 -52
- package/actions/build.action.d.ts +11 -10
- package/actions/build.action.js +85 -72
- package/actions/generate.action.d.ts +3 -3
- package/actions/generate.action.js +56 -59
- package/actions/index.d.ts +7 -7
- package/actions/index.js +7 -23
- package/actions/info.action.d.ts +12 -28
- package/actions/info.action.js +47 -55
- package/actions/new.action.d.ts +3 -3
- package/actions/new.action.js +75 -105
- package/actions/start.action.d.ts +4 -7
- package/actions/start.action.js +36 -46
- package/bin/nest.js +14 -10
- package/commands/abstract.command.d.ts +3 -3
- package/commands/abstract.command.js +2 -5
- package/commands/add.command.d.ts +3 -3
- package/commands/add.command.js +13 -20
- package/commands/build.command.d.ts +3 -3
- package/commands/build.command.js +25 -54
- package/commands/command.input.js +1 -2
- package/commands/command.loader.d.ts +2 -2
- package/commands/command.loader.js +18 -22
- package/commands/context/add.context.d.ts +7 -0
- package/commands/context/add.context.js +1 -0
- package/commands/context/build.context.d.ts +13 -0
- package/commands/context/build.context.js +1 -0
- package/commands/context/generate.context.d.ts +15 -0
- package/commands/context/generate.context.js +1 -0
- package/commands/context/index.d.ts +5 -0
- package/commands/context/index.js +5 -0
- package/commands/context/new.context.d.ts +11 -0
- package/commands/context/new.context.js +1 -0
- package/commands/context/start.context.d.ts +19 -0
- package/commands/context/start.context.js +1 -0
- package/commands/generate.command.d.ts +3 -3
- package/commands/generate.command.js +26 -54
- package/commands/index.d.ts +3 -2
- package/commands/index.js +3 -18
- package/commands/info.command.d.ts +3 -3
- package/commands/info.command.js +2 -6
- package/commands/new.command.d.ts +3 -3
- package/commands/new.command.js +24 -33
- package/commands/start.command.d.ts +3 -3
- package/commands/start.command.js +34 -71
- package/lib/compiler/assets-manager.d.ts +1 -1
- package/lib/compiler/assets-manager.js +27 -33
- package/lib/compiler/base-compiler.d.ts +5 -5
- package/lib/compiler/base-compiler.js +10 -13
- package/lib/compiler/compiler.d.ts +6 -6
- package/lib/compiler/compiler.js +7 -9
- package/lib/compiler/defaults/rspack-defaults.d.ts +2 -0
- package/lib/compiler/defaults/rspack-defaults.js +117 -0
- package/lib/compiler/defaults/swc-defaults.d.ts +1 -1
- package/lib/compiler/defaults/swc-defaults.js +1 -5
- package/lib/compiler/defaults/webpack-defaults.d.ts +2 -2
- package/lib/compiler/defaults/webpack-defaults.js +13 -16
- package/lib/compiler/helpers/append-extension.js +3 -6
- package/lib/compiler/helpers/copy-path-resolve.js +2 -5
- package/lib/compiler/helpers/delete-out-dir.d.ts +1 -1
- package/lib/compiler/helpers/delete-out-dir.js +5 -8
- package/lib/compiler/helpers/get-builder.d.ts +9 -7
- package/lib/compiler/helpers/get-builder.js +3 -6
- package/lib/compiler/helpers/get-rspack-config-path.d.ts +9 -0
- package/lib/compiler/helpers/get-rspack-config-path.js +15 -0
- package/lib/compiler/helpers/get-tsc-config.path.d.ts +2 -3
- package/lib/compiler/helpers/get-tsc-config.path.js +6 -9
- package/lib/compiler/helpers/get-value-or-default.d.ts +2 -3
- package/lib/compiler/helpers/get-value-or-default.js +3 -8
- package/lib/compiler/helpers/get-webpack-config-path.d.ts +2 -3
- package/lib/compiler/helpers/get-webpack-config-path.js +4 -7
- package/lib/compiler/helpers/manual-restart.js +4 -8
- package/lib/compiler/helpers/tsconfig-provider.d.ts +1 -1
- package/lib/compiler/helpers/tsconfig-provider.js +8 -11
- package/lib/compiler/hooks/tsconfig-paths.hook.js +13 -13
- package/lib/compiler/interfaces/readonly-visitor.interface.js +1 -2
- package/lib/compiler/plugins/plugin-metadata-generator.d.ts +1 -1
- package/lib/compiler/plugins/plugin-metadata-generator.js +10 -13
- package/lib/compiler/plugins/plugin-metadata-printer.d.ts +1 -1
- package/lib/compiler/plugins/plugin-metadata-printer.js +5 -9
- package/lib/compiler/plugins/plugins-loader.d.ts +2 -2
- package/lib/compiler/plugins/plugins-loader.js +13 -13
- package/lib/compiler/rspack-compiler.d.ts +19 -0
- package/lib/compiler/rspack-compiler.js +97 -0
- package/lib/compiler/swc/constants.d.ts +0 -1
- package/lib/compiler/swc/constants.js +9 -13
- package/lib/compiler/swc/forked-type-checker.js +13 -18
- package/lib/compiler/swc/swc-compiler.d.ts +4 -4
- package/lib/compiler/swc/swc-compiler.js +41 -39
- package/lib/compiler/swc/type-checker-host.js +12 -18
- package/lib/compiler/typescript-loader.js +5 -7
- package/lib/compiler/watch-compiler.d.ts +5 -5
- package/lib/compiler/watch-compiler.js +14 -18
- package/lib/compiler/webpack-compiler.d.ts +6 -7
- package/lib/compiler/webpack-compiler.js +14 -18
- package/lib/configuration/configuration.d.ts +9 -4
- package/lib/configuration/configuration.js +1 -2
- package/lib/configuration/configuration.loader.d.ts +1 -1
- package/lib/configuration/configuration.loader.js +1 -2
- package/lib/configuration/defaults.d.ts +2 -1
- package/lib/configuration/defaults.js +8 -10
- package/lib/configuration/index.d.ts +3 -3
- package/lib/configuration/index.js +3 -19
- package/lib/configuration/nest-configuration.loader.d.ts +3 -3
- package/lib/configuration/nest-configuration.loader.js +11 -20
- package/lib/package-managers/abstract.package-manager.d.ts +4 -4
- package/lib/package-managers/abstract.package-manager.js +19 -30
- package/lib/package-managers/index.d.ts +8 -8
- package/lib/package-managers/index.js +8 -24
- package/lib/package-managers/npm.package-manager.d.ts +2 -2
- package/lib/package-managers/npm.package-manager.js +6 -10
- package/lib/package-managers/package-manager-commands.js +1 -2
- package/lib/package-managers/package-manager.factory.d.ts +2 -2
- package/lib/package-managers/package-manager.factory.js +16 -20
- package/lib/package-managers/package-manager.js +2 -5
- package/lib/package-managers/pnpm.package-manager.d.ts +2 -2
- package/lib/package-managers/pnpm.package-manager.js +6 -10
- package/lib/package-managers/project.dependency.js +1 -2
- package/lib/package-managers/yarn.package-manager.d.ts +2 -2
- package/lib/package-managers/yarn.package-manager.js +6 -10
- package/lib/questions/questions.d.ts +5 -1
- package/lib/questions/questions.js +2 -7
- package/lib/readers/file-system.reader.d.ts +1 -1
- package/lib/readers/file-system.reader.js +6 -9
- package/lib/readers/index.d.ts +2 -2
- package/lib/readers/index.js +2 -18
- package/lib/readers/reader.js +3 -5
- package/lib/runners/abstract.runner.js +10 -12
- package/lib/runners/git.runner.d.ts +1 -1
- package/lib/runners/git.runner.js +2 -6
- package/lib/runners/index.d.ts +3 -3
- package/lib/runners/index.js +3 -19
- package/lib/runners/npm.runner.d.ts +1 -1
- package/lib/runners/npm.runner.js +2 -6
- package/lib/runners/pnpm.runner.d.ts +1 -1
- package/lib/runners/pnpm.runner.js +2 -6
- package/lib/runners/runner.factory.d.ts +6 -6
- package/lib/runners/runner.factory.js +15 -20
- package/lib/runners/runner.js +2 -5
- package/lib/runners/schematic.runner.d.ts +1 -1
- package/lib/runners/schematic.runner.js +5 -7
- package/lib/runners/yarn.runner.d.ts +1 -1
- package/lib/runners/yarn.runner.js +2 -6
- package/lib/schematics/abstract.collection.d.ts +3 -3
- package/lib/schematics/abstract.collection.js +3 -5
- package/lib/schematics/collection.factory.d.ts +2 -2
- package/lib/schematics/collection.factory.js +9 -13
- package/lib/schematics/collection.js +2 -5
- package/lib/schematics/custom.collection.d.ts +2 -2
- package/lib/schematics/custom.collection.js +4 -8
- package/lib/schematics/index.d.ts +4 -4
- package/lib/schematics/index.js +4 -20
- package/lib/schematics/nest.collection.d.ts +3 -3
- package/lib/schematics/nest.collection.js +104 -108
- package/lib/schematics/schematic.option.js +7 -9
- package/lib/ui/banner.js +1 -4
- package/lib/ui/emojis.d.ts +17 -17
- package/lib/ui/emojis.js +19 -22
- package/lib/ui/errors.js +1 -5
- package/lib/ui/index.d.ts +5 -5
- package/lib/ui/index.js +5 -21
- package/lib/ui/messages.js +15 -19
- package/lib/ui/prefixes.js +3 -6
- package/lib/utils/formatting.js +1 -4
- package/lib/utils/get-default-tsconfig-path.js +4 -7
- package/lib/utils/gracefully-exit-on-prompt-error.js +1 -4
- package/lib/utils/is-module-available.js +3 -4
- package/lib/utils/load-configuration.d.ts +1 -1
- package/lib/utils/load-configuration.js +4 -7
- package/lib/utils/local-binaries.d.ts +1 -1
- package/lib/utils/local-binaries.js +8 -11
- package/lib/utils/os-info.utils.js +1 -4
- package/lib/utils/project-utils.d.ts +1 -3
- package/lib/utils/project-utils.js +16 -28
- package/lib/utils/remaining-flags.d.ts +2 -2
- package/lib/utils/remaining-flags.js +2 -5
- package/lib/utils/tree-kill.js +7 -10
- package/lib/utils/type-assertions.js +1 -4
- package/package.json +31 -33
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tools_1 = require("@angular-devkit/schematics/tools");
|
|
5
|
-
const abstract_collection_1 = require("./abstract.collection");
|
|
6
|
-
class CustomCollection extends abstract_collection_1.AbstractCollection {
|
|
1
|
+
import { NodeWorkflow } from '@angular-devkit/schematics/tools/index.js';
|
|
2
|
+
import { AbstractCollection } from './abstract.collection.js';
|
|
3
|
+
export class CustomCollection extends AbstractCollection {
|
|
7
4
|
getSchematics() {
|
|
8
|
-
const workflow = new
|
|
5
|
+
const workflow = new NodeWorkflow(process.cwd(), {});
|
|
9
6
|
const collection = workflow.engine.createCollection(this.collection);
|
|
10
7
|
const collectionDescriptions = [
|
|
11
8
|
collection.description,
|
|
@@ -30,4 +27,3 @@ class CustomCollection extends abstract_collection_1.AbstractCollection {
|
|
|
30
27
|
return schematics.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
|
-
exports.CustomCollection = CustomCollection;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './collection';
|
|
2
|
-
export * from './collection.factory';
|
|
3
|
-
export * from './schematic.option';
|
|
4
|
-
export * from './abstract.collection';
|
|
1
|
+
export * from './collection.js';
|
|
2
|
+
export * from './collection.factory.js';
|
|
3
|
+
export * from './schematic.option.js';
|
|
4
|
+
export * from './abstract.collection.js';
|
package/lib/schematics/index.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./collection"), exports);
|
|
18
|
-
__exportStar(require("./collection.factory"), exports);
|
|
19
|
-
__exportStar(require("./schematic.option"), exports);
|
|
20
|
-
__exportStar(require("./abstract.collection"), exports);
|
|
1
|
+
export * from './collection.js';
|
|
2
|
+
export * from './collection.factory.js';
|
|
3
|
+
export * from './schematic.option.js';
|
|
4
|
+
export * from './abstract.collection.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AbstractRunner } from '../runners';
|
|
2
|
-
import { AbstractCollection } from './abstract.collection';
|
|
3
|
-
import { SchematicOption } from './schematic.option';
|
|
1
|
+
import { AbstractRunner } from '../runners/index.js';
|
|
2
|
+
import { AbstractCollection } from './abstract.collection.js';
|
|
3
|
+
import { SchematicOption } from './schematic.option.js';
|
|
4
4
|
export interface Schematic {
|
|
5
5
|
name: string;
|
|
6
6
|
alias: string;
|
|
@@ -1,8 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { AbstractCollection } from './abstract.collection.js';
|
|
2
|
+
export class NestCollection extends AbstractCollection {
|
|
3
|
+
static schematics = [
|
|
4
|
+
{
|
|
5
|
+
name: 'application',
|
|
6
|
+
alias: 'application',
|
|
7
|
+
description: 'Generate a new application workspace',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: 'angular-app',
|
|
11
|
+
alias: 'ng-app',
|
|
12
|
+
description: '',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'class',
|
|
16
|
+
alias: 'cl',
|
|
17
|
+
description: 'Generate a new class',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'configuration',
|
|
21
|
+
alias: 'config',
|
|
22
|
+
description: 'Generate a CLI configuration file',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'controller',
|
|
26
|
+
alias: 'co',
|
|
27
|
+
description: 'Generate a controller declaration',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'decorator',
|
|
31
|
+
alias: 'd',
|
|
32
|
+
description: 'Generate a custom decorator',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'filter',
|
|
36
|
+
alias: 'f',
|
|
37
|
+
description: 'Generate a filter declaration',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'gateway',
|
|
41
|
+
alias: 'ga',
|
|
42
|
+
description: 'Generate a gateway declaration',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'guard',
|
|
46
|
+
alias: 'gu',
|
|
47
|
+
description: 'Generate a guard declaration',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'interceptor',
|
|
51
|
+
alias: 'itc',
|
|
52
|
+
description: 'Generate an interceptor declaration',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'interface',
|
|
56
|
+
alias: 'itf',
|
|
57
|
+
description: 'Generate an interface',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'library',
|
|
61
|
+
alias: 'lib',
|
|
62
|
+
description: 'Generate a new library within a monorepo',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'middleware',
|
|
66
|
+
alias: 'mi',
|
|
67
|
+
description: 'Generate a middleware declaration',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'module',
|
|
71
|
+
alias: 'mo',
|
|
72
|
+
description: 'Generate a module declaration',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'pipe',
|
|
76
|
+
alias: 'pi',
|
|
77
|
+
description: 'Generate a pipe declaration',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'provider',
|
|
81
|
+
alias: 'pr',
|
|
82
|
+
description: 'Generate a provider declaration',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'resolver',
|
|
86
|
+
alias: 'r',
|
|
87
|
+
description: 'Generate a GraphQL resolver declaration',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'resource',
|
|
91
|
+
alias: 'res',
|
|
92
|
+
description: 'Generate a new CRUD resource',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'service',
|
|
96
|
+
alias: 's',
|
|
97
|
+
description: 'Generate a service declaration',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'sub-app',
|
|
101
|
+
alias: 'app',
|
|
102
|
+
description: 'Generate a new application within a monorepo',
|
|
103
|
+
},
|
|
104
|
+
];
|
|
6
105
|
constructor(runner) {
|
|
7
106
|
super('@nestjs/schematics', runner);
|
|
8
107
|
}
|
|
@@ -21,106 +120,3 @@ class NestCollection extends abstract_collection_1.AbstractCollection {
|
|
|
21
120
|
return schematic.name;
|
|
22
121
|
}
|
|
23
122
|
}
|
|
24
|
-
exports.NestCollection = NestCollection;
|
|
25
|
-
NestCollection.schematics = [
|
|
26
|
-
{
|
|
27
|
-
name: 'application',
|
|
28
|
-
alias: 'application',
|
|
29
|
-
description: 'Generate a new application workspace',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: 'angular-app',
|
|
33
|
-
alias: 'ng-app',
|
|
34
|
-
description: '',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: 'class',
|
|
38
|
-
alias: 'cl',
|
|
39
|
-
description: 'Generate a new class',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'configuration',
|
|
43
|
-
alias: 'config',
|
|
44
|
-
description: 'Generate a CLI configuration file',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: 'controller',
|
|
48
|
-
alias: 'co',
|
|
49
|
-
description: 'Generate a controller declaration',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: 'decorator',
|
|
53
|
-
alias: 'd',
|
|
54
|
-
description: 'Generate a custom decorator',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: 'filter',
|
|
58
|
-
alias: 'f',
|
|
59
|
-
description: 'Generate a filter declaration',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'gateway',
|
|
63
|
-
alias: 'ga',
|
|
64
|
-
description: 'Generate a gateway declaration',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'guard',
|
|
68
|
-
alias: 'gu',
|
|
69
|
-
description: 'Generate a guard declaration',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: 'interceptor',
|
|
73
|
-
alias: 'itc',
|
|
74
|
-
description: 'Generate an interceptor declaration',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'interface',
|
|
78
|
-
alias: 'itf',
|
|
79
|
-
description: 'Generate an interface',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: 'library',
|
|
83
|
-
alias: 'lib',
|
|
84
|
-
description: 'Generate a new library within a monorepo',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: 'middleware',
|
|
88
|
-
alias: 'mi',
|
|
89
|
-
description: 'Generate a middleware declaration',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: 'module',
|
|
93
|
-
alias: 'mo',
|
|
94
|
-
description: 'Generate a module declaration',
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: 'pipe',
|
|
98
|
-
alias: 'pi',
|
|
99
|
-
description: 'Generate a pipe declaration',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: 'provider',
|
|
103
|
-
alias: 'pr',
|
|
104
|
-
description: 'Generate a provider declaration',
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'resolver',
|
|
108
|
-
alias: 'r',
|
|
109
|
-
description: 'Generate a GraphQL resolver declaration',
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: 'resource',
|
|
113
|
-
alias: 'res',
|
|
114
|
-
description: 'Generate a new CRUD resource',
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: 'service',
|
|
118
|
-
alias: 's',
|
|
119
|
-
description: 'Generate a service declaration',
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: 'sub-app',
|
|
123
|
-
alias: 'app',
|
|
124
|
-
description: 'Generate a new application within a monorepo',
|
|
125
|
-
},
|
|
126
|
-
];
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class SchematicOption {
|
|
1
|
+
import { normalizeToKebabOrSnakeCase } from '../utils/formatting.js';
|
|
2
|
+
export class SchematicOption {
|
|
3
|
+
name;
|
|
4
|
+
value;
|
|
6
5
|
constructor(name, value) {
|
|
7
6
|
this.name = name;
|
|
8
7
|
this.value = value;
|
|
9
8
|
}
|
|
10
9
|
get normalizedName() {
|
|
11
|
-
return
|
|
10
|
+
return normalizeToKebabOrSnakeCase(this.name);
|
|
12
11
|
}
|
|
13
12
|
toCommandString() {
|
|
14
13
|
if (typeof this.value === 'string') {
|
|
@@ -24,14 +23,14 @@ class SchematicOption {
|
|
|
24
23
|
}
|
|
25
24
|
else if (typeof this.value === 'boolean') {
|
|
26
25
|
const str = this.normalizedName;
|
|
27
|
-
return this.value ? `--${str}` :
|
|
26
|
+
return this.value ? `--${str}` : `--${str}=false`;
|
|
28
27
|
}
|
|
29
28
|
else {
|
|
30
29
|
return `--${this.normalizedName}=${this.value}`;
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
format() {
|
|
34
|
-
return
|
|
33
|
+
return normalizeToKebabOrSnakeCase(this.value)
|
|
35
34
|
.split('')
|
|
36
35
|
.reduce((content, char) => {
|
|
37
36
|
if (char === '(' || char === ')' || char === '[' || char === ']') {
|
|
@@ -41,4 +40,3 @@ class SchematicOption {
|
|
|
41
40
|
}, '');
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
exports.SchematicOption = SchematicOption;
|
package/lib/ui/banner.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BANNER = void 0;
|
|
4
|
-
exports.BANNER = `
|
|
1
|
+
export const BANNER = `
|
|
5
2
|
_ _ _ ___ _____ _____ _ _____
|
|
6
3
|
| \\ | | | | |_ |/ ___|/ __ \\| | |_ _|
|
|
7
4
|
| \\| | ___ ___ | |_ | |\\ \`--. | / \\/| | | |
|
package/lib/ui/emojis.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const EMOJIS: {
|
|
2
|
-
HEART: string;
|
|
3
|
-
COFFEE: string;
|
|
4
|
-
BEER: string;
|
|
5
|
-
BROKEN_HEART: string;
|
|
6
|
-
CRYING: string;
|
|
7
|
-
HEART_EYES: string;
|
|
8
|
-
JOY: string;
|
|
9
|
-
KISSING: string;
|
|
10
|
-
SCREAM: string;
|
|
11
|
-
ROCKET: string;
|
|
12
|
-
SMIRK: string;
|
|
13
|
-
RAISED_HANDS: string;
|
|
14
|
-
POINT_RIGHT: string;
|
|
15
|
-
SPARKLES: string;
|
|
16
|
-
BOOM: string;
|
|
17
|
-
PRAY: string;
|
|
18
|
-
WINE: string;
|
|
2
|
+
HEART: string | undefined;
|
|
3
|
+
COFFEE: string | undefined;
|
|
4
|
+
BEER: string | undefined;
|
|
5
|
+
BROKEN_HEART: string | undefined;
|
|
6
|
+
CRYING: string | undefined;
|
|
7
|
+
HEART_EYES: string | undefined;
|
|
8
|
+
JOY: string | undefined;
|
|
9
|
+
KISSING: string | undefined;
|
|
10
|
+
SCREAM: string | undefined;
|
|
11
|
+
ROCKET: string | undefined;
|
|
12
|
+
SMIRK: string | undefined;
|
|
13
|
+
RAISED_HANDS: string | undefined;
|
|
14
|
+
POINT_RIGHT: string | undefined;
|
|
15
|
+
SPARKLES: string | undefined;
|
|
16
|
+
BOOM: string | undefined;
|
|
17
|
+
PRAY: string | undefined;
|
|
18
|
+
WINE: string | undefined;
|
|
19
19
|
};
|
package/lib/ui/emojis.js
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
BOOM: (0, node_emoji_1.get)('boom'),
|
|
21
|
-
PRAY: (0, node_emoji_1.get)('pray'),
|
|
22
|
-
WINE: (0, node_emoji_1.get)('wine_glass'),
|
|
1
|
+
import { get } from 'node-emoji';
|
|
2
|
+
export const EMOJIS = {
|
|
3
|
+
HEART: get('heart'),
|
|
4
|
+
COFFEE: get('coffee'),
|
|
5
|
+
BEER: get('beer'),
|
|
6
|
+
BROKEN_HEART: get('broken_heart'),
|
|
7
|
+
CRYING: get('crying_cat_face'),
|
|
8
|
+
HEART_EYES: get('heart_eyes_cat'),
|
|
9
|
+
JOY: get('joy_cat'),
|
|
10
|
+
KISSING: get('kissing_cat'),
|
|
11
|
+
SCREAM: get('scream_cat'),
|
|
12
|
+
ROCKET: get('rocket'),
|
|
13
|
+
SMIRK: get('smirk_cat'),
|
|
14
|
+
RAISED_HANDS: get('raised_hands'),
|
|
15
|
+
POINT_RIGHT: get('point_right'),
|
|
16
|
+
SPARKLES: get('sparkles'),
|
|
17
|
+
BOOM: get('boom'),
|
|
18
|
+
PRAY: get('pray'),
|
|
19
|
+
WINE: get('wine_glass'),
|
|
23
20
|
};
|
package/lib/ui/errors.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// tslint:disable:max-line-length
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.CLI_ERRORS = void 0;
|
|
5
|
-
exports.CLI_ERRORS = {
|
|
1
|
+
export const CLI_ERRORS = {
|
|
6
2
|
MISSING_TYPESCRIPT: (path) => `Could not find TypeScript configuration file "${path}". Please, ensure that you are running this command in the appropriate directory (inside Nest workspace).`,
|
|
7
3
|
WRONG_PLUGIN: (name) => `The "${name}" plugin is not compatible with Nest CLI. Neither "after()" nor "before()" nor "afterDeclarations()" function have been provided.`,
|
|
8
4
|
};
|
package/lib/ui/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './banner';
|
|
2
|
-
export * from './emojis';
|
|
3
|
-
export * from './errors';
|
|
4
|
-
export * from './messages';
|
|
5
|
-
export * from './prefixes';
|
|
1
|
+
export * from './banner.js';
|
|
2
|
+
export * from './emojis.js';
|
|
3
|
+
export * from './errors.js';
|
|
4
|
+
export * from './messages.js';
|
|
5
|
+
export * from './prefixes.js';
|
package/lib/ui/index.js
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./banner"), exports);
|
|
18
|
-
__exportStar(require("./emojis"), exports);
|
|
19
|
-
__exportStar(require("./errors"), exports);
|
|
20
|
-
__exportStar(require("./messages"), exports);
|
|
21
|
-
__exportStar(require("./prefixes"), exports);
|
|
1
|
+
export * from './banner.js';
|
|
2
|
+
export * from './emojis.js';
|
|
3
|
+
export * from './errors.js';
|
|
4
|
+
export * from './messages.js';
|
|
5
|
+
export * from './prefixes.js';
|
package/lib/ui/messages.js
CHANGED
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const ansis_1 = require("ansis");
|
|
5
|
-
const emojis_1 = require("./emojis");
|
|
6
|
-
exports.MESSAGES = {
|
|
1
|
+
import { green } from 'ansis';
|
|
2
|
+
import { EMOJIS } from './emojis.js';
|
|
3
|
+
export const MESSAGES = {
|
|
7
4
|
PROJECT_NAME_QUESTION: 'What name would you like to use for the new project?',
|
|
8
5
|
PROJECT_SELECTION_QUESTION: 'Which project would you like to generate to?',
|
|
9
6
|
LIBRARY_PROJECT_SELECTION_QUESTION: 'Which project would you like to add the library to?',
|
|
10
7
|
DRY_RUN_MODE: 'Command has been executed in dry run mode, nothing changed!',
|
|
11
|
-
PROJECT_INFORMATION_START: `${
|
|
8
|
+
PROJECT_INFORMATION_START: `${EMOJIS.SPARKLES} We will scaffold your app in a few seconds..`,
|
|
12
9
|
RUNNER_EXECUTION_ERROR: (command) => `\nFailed to execute command: ${command}`,
|
|
13
|
-
PACKAGE_MANAGER_QUESTION: `Which package manager would you ${
|
|
14
|
-
PACKAGE_MANAGER_INSTALLATION_IN_PROGRESS: `Installation in progress... ${
|
|
15
|
-
PACKAGE_MANAGER_UPDATE_IN_PROGRESS: `Installation in progress... ${
|
|
16
|
-
PACKAGE_MANAGER_UPGRADE_IN_PROGRESS: `Installation in progress... ${
|
|
17
|
-
PACKAGE_MANAGER_PRODUCTION_INSTALLATION_IN_PROGRESS: `Package installation in progress... ${
|
|
10
|
+
PACKAGE_MANAGER_QUESTION: `Which package manager would you ${EMOJIS.HEART} to use?`,
|
|
11
|
+
PACKAGE_MANAGER_INSTALLATION_IN_PROGRESS: `Installation in progress... ${EMOJIS.COFFEE}`,
|
|
12
|
+
PACKAGE_MANAGER_UPDATE_IN_PROGRESS: `Installation in progress... ${EMOJIS.COFFEE}`,
|
|
13
|
+
PACKAGE_MANAGER_UPGRADE_IN_PROGRESS: `Installation in progress... ${EMOJIS.COFFEE}`,
|
|
14
|
+
PACKAGE_MANAGER_PRODUCTION_INSTALLATION_IN_PROGRESS: `Package installation in progress... ${EMOJIS.COFFEE}`,
|
|
18
15
|
GIT_INITIALIZATION_ERROR: 'Git repository has not been initialized',
|
|
19
16
|
PACKAGE_MANAGER_INSTALLATION_SUCCEED: (name) => name !== '.'
|
|
20
|
-
? `${
|
|
21
|
-
: `${
|
|
22
|
-
GET_STARTED_INFORMATION: `${
|
|
17
|
+
? `${EMOJIS.ROCKET} Successfully created project ${green(name)}`
|
|
18
|
+
: `${EMOJIS.ROCKET} Successfully created a new project`,
|
|
19
|
+
GET_STARTED_INFORMATION: `${EMOJIS.POINT_RIGHT} Get started with the following commands:`,
|
|
23
20
|
CHANGE_DIR_COMMAND: (name) => `$ cd ${name}`,
|
|
24
21
|
START_COMMAND: (name) => `$ ${name} run start`,
|
|
25
|
-
PACKAGE_MANAGER_INSTALLATION_FAILED: (commandToRunManually) => `${
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
NEST_INFORMATION_PACKAGE_WARNING_FAILED: (nestDependencies) => `${emojis_1.EMOJIS.SMIRK} failed to compare dependencies versions, please check that following packages are in the same minor version : \n ${nestDependencies.join('\n')}`,
|
|
22
|
+
PACKAGE_MANAGER_INSTALLATION_FAILED: (commandToRunManually) => `${EMOJIS.SCREAM} Packages installation failed!\nIn case you don't see any errors above, consider manually running the failed command ${commandToRunManually} to see more details on why it errored out.`,
|
|
23
|
+
NEST_INFORMATION_PACKAGE_MANAGER_FAILED: `${EMOJIS.SMIRK} cannot read your project package.json file, are you inside your project directory?`,
|
|
24
|
+
NEST_INFORMATION_PACKAGE_WARNING_FAILED: (nestDependencies) => `${EMOJIS.SMIRK} failed to compare dependencies versions, please check that following packages are in the same minor version : \n ${nestDependencies.join('\n')}`,
|
|
29
25
|
LIBRARY_INSTALLATION_FAILED_BAD_PACKAGE: (name) => `Unable to install library ${name} because package did not install. Please check package name.`,
|
|
30
26
|
LIBRARY_INSTALLATION_FAILED_NO_LIBRARY: 'No library found.',
|
|
31
27
|
LIBRARY_INSTALLATION_STARTS: 'Starting library setup...',
|
package/lib/ui/prefixes.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const ansis_1 = require("ansis");
|
|
5
|
-
exports.ERROR_PREFIX = (0, ansis_1.bgRgb)(210, 0, 75).bold.rgb(0, 0, 0)(' Error ');
|
|
6
|
-
exports.INFO_PREFIX = (0, ansis_1.bgRgb)(60, 190, 100).bold.rgb(0, 0, 0)(' Info ');
|
|
1
|
+
import { bgRgb } from 'ansis';
|
|
2
|
+
export const ERROR_PREFIX = bgRgb(210, 0, 75).bold.rgb(0, 0, 0)(' Error ');
|
|
3
|
+
export const INFO_PREFIX = bgRgb(60, 190, 100).bold.rgb(0, 0, 0)(' Info ');
|
package/lib/utils/formatting.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeToKebabOrSnakeCase = normalizeToKebabOrSnakeCase;
|
|
4
1
|
/**
|
|
5
2
|
*
|
|
6
3
|
* @param str
|
|
@@ -8,7 +5,7 @@ exports.normalizeToKebabOrSnakeCase = normalizeToKebabOrSnakeCase;
|
|
|
8
5
|
* @description normalizes input to supported path and file name format.
|
|
9
6
|
* Changes camelCase strings to kebab-case, replaces spaces with dash and keeps underscores.
|
|
10
7
|
*/
|
|
11
|
-
function normalizeToKebabOrSnakeCase(str) {
|
|
8
|
+
export function normalizeToKebabOrSnakeCase(str) {
|
|
12
9
|
const STRING_DASHERIZE_REGEXP = /\s/g;
|
|
13
10
|
const STRING_DECAMELIZE_REGEXP = /([a-z\d])([A-Z])/g;
|
|
14
11
|
return str
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getDefaultTsconfigPath = getDefaultTsconfigPath;
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const path_1 = require("path");
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
6
3
|
const TSCONFIG_BUILD_JSON = 'tsconfig.build.json';
|
|
7
4
|
const TSCONFIG_JSON = 'tsconfig.json';
|
|
8
|
-
function getDefaultTsconfigPath() {
|
|
9
|
-
return fs.existsSync(
|
|
5
|
+
export function getDefaultTsconfigPath() {
|
|
6
|
+
return fs.existsSync(join(process.cwd(), TSCONFIG_BUILD_JSON))
|
|
10
7
|
? TSCONFIG_BUILD_JSON
|
|
11
8
|
: TSCONFIG_JSON;
|
|
12
9
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gracefullyExitOnPromptError = gracefullyExitOnPromptError;
|
|
4
|
-
function gracefullyExitOnPromptError(err) {
|
|
1
|
+
export function gracefullyExitOnPromptError(err) {
|
|
5
2
|
if (err.name === 'ExitPromptError') {
|
|
6
3
|
process.exit(1);
|
|
7
4
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function isModuleAvailable(path) {
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
export function isModuleAvailable(path) {
|
|
5
4
|
try {
|
|
6
5
|
require.resolve(path);
|
|
7
6
|
return true;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Configuration } from '../configuration';
|
|
1
|
+
import { Configuration } from '../configuration/index.js';
|
|
2
2
|
export declare function loadConfiguration(): Promise<Required<Configuration>>;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const readers_1 = require("../readers");
|
|
6
|
-
async function loadConfiguration() {
|
|
7
|
-
const loader = new nest_configuration_loader_1.NestConfigurationLoader(new readers_1.FileSystemReader(process.cwd()));
|
|
1
|
+
import { NestConfigurationLoader } from '../configuration/nest-configuration.loader.js';
|
|
2
|
+
import { FileSystemReader } from '../readers/index.js';
|
|
3
|
+
export async function loadConfiguration() {
|
|
4
|
+
const loader = new NestConfigurationLoader(new FileSystemReader(process.cwd()));
|
|
8
5
|
return loader.load();
|
|
9
6
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const fs_1 = require("fs");
|
|
6
|
-
const path_1 = require("path");
|
|
1
|
+
import { existsSync } from 'fs';
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { join, posix } from 'path';
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
7
5
|
const localBinPathSegments = [process.cwd(), 'node_modules', '@nestjs', 'cli'];
|
|
8
|
-
function localBinExists() {
|
|
9
|
-
return
|
|
6
|
+
export function localBinExists() {
|
|
7
|
+
return existsSync(join(...localBinPathSegments));
|
|
10
8
|
}
|
|
11
|
-
function loadLocalBinCommandLoader() {
|
|
12
|
-
|
|
13
|
-
const commandsFile = require(path_1.posix.join(...localBinPathSegments, 'commands'));
|
|
9
|
+
export function loadLocalBinCommandLoader() {
|
|
10
|
+
const commandsFile = require(posix.join(...localBinPathSegments, 'commands'));
|
|
14
11
|
return commandsFile.CommandLoader;
|
|
15
12
|
}
|