@nx/nest 24.0.0-pr.37405.acdaf31 → 24.0.0-rc.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/dist/src/generators/application/application.js +0 -1
- package/dist/src/generators/application/files/common/main.ts__tmpl__ +10 -0
- package/dist/src/generators/application/lib/normalize-options.js +4 -11
- package/dist/src/generators/application/schema.d.ts +0 -5
- package/dist/src/generators/application/schema.json +0 -6
- package/dist/src/generators/library/lib/normalize-options.js +5 -13
- package/dist/src/generators/library/library.js +0 -1
- package/dist/src/generators/library/schema.d.ts +0 -5
- package/dist/src/generators/library/schema.json +0 -6
- package/package.json +4 -5
|
@@ -11,7 +11,6 @@ const assert_vitest_supported_1 = require("../../utils/assert-vitest-supported")
|
|
|
11
11
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
12
12
|
async function applicationGenerator(tree, rawOptions) {
|
|
13
13
|
return await applicationGeneratorInternal(tree, {
|
|
14
|
-
addPlugin: false,
|
|
15
14
|
useProjectJson: true,
|
|
16
15
|
...rawOptions,
|
|
17
16
|
});
|
|
@@ -13,6 +13,16 @@ async function bootstrap() {
|
|
|
13
13
|
app.setGlobalPrefix(globalPrefix);
|
|
14
14
|
const port = process.env.PORT || 3000;
|
|
15
15
|
await app.listen(port);
|
|
16
|
+
// Set when Nx waits for this server to be ready
|
|
17
|
+
if (process.env.NX_READY_SIGNAL_SOCKET) {
|
|
18
|
+
try {
|
|
19
|
+
// Function keeps TypeScript and bundlers from rewriting or bundling the import
|
|
20
|
+
const load = new Function('s', 'return import(s)') as (s: string) => Promise<{ emitReadySignal(server: unknown): boolean }>;
|
|
21
|
+
(await load('@nx/js/ready-signal')).emitReadySignal(app.getHttpServer());
|
|
22
|
+
} catch {
|
|
23
|
+
// @nx/js isn't installed
|
|
24
|
+
}
|
|
25
|
+
}
|
|
16
26
|
Logger.log(`🚀 Application is running on: http://localhost:${port}/${globalPrefix}`);
|
|
17
27
|
}
|
|
18
28
|
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
exports.toNodeApplicationGeneratorOptions = toNodeApplicationGeneratorOptions;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
-
const internal_2 = require("@nx/
|
|
8
|
-
const internal_3 = require("@nx/js/internal");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
9
7
|
async function normalizeOptions(tree, options) {
|
|
10
8
|
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
11
9
|
const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
|
|
@@ -15,19 +13,15 @@ async function normalizeOptions(tree, options) {
|
|
|
15
13
|
rootProject: options.rootProject,
|
|
16
14
|
});
|
|
17
15
|
options.rootProject = appProjectRoot === '.';
|
|
18
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
19
|
-
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
20
|
-
nxJson.useInferencePlugins !== false;
|
|
21
16
|
return {
|
|
22
|
-
addPlugin,
|
|
23
17
|
...options,
|
|
24
18
|
strict: options.strict ?? false,
|
|
25
19
|
appProjectName,
|
|
26
20
|
appProjectRoot,
|
|
27
|
-
linter: await (0,
|
|
21
|
+
linter: await (0, internal_2.normalizeLinterOption)(tree, options.linter),
|
|
28
22
|
unitTestRunner: options.unitTestRunner ?? 'jest',
|
|
29
23
|
e2eTestRunner: options.e2eTestRunner ?? 'jest',
|
|
30
|
-
useProjectJson: options.useProjectJson ?? !(0,
|
|
24
|
+
useProjectJson: options.useProjectJson ?? !(0, internal_2.isUsingTsSolutionSetup)(tree),
|
|
31
25
|
};
|
|
32
26
|
}
|
|
33
27
|
function toNodeApplicationGeneratorOptions(options) {
|
|
@@ -42,11 +36,10 @@ function toNodeApplicationGeneratorOptions(options) {
|
|
|
42
36
|
tags: options.tags,
|
|
43
37
|
unitTestRunner: options.unitTestRunner,
|
|
44
38
|
e2eTestRunner: options.e2eTestRunner,
|
|
45
|
-
enableTypedLinting:
|
|
39
|
+
enableTypedLinting: options.enableTypedLinting,
|
|
46
40
|
rootProject: options.rootProject,
|
|
47
41
|
bundler: 'webpack', // Some features require webpack plugins such as TS transformers
|
|
48
42
|
isNest: true,
|
|
49
|
-
addPlugin: options.addPlugin,
|
|
50
43
|
useProjectJson: options.useProjectJson,
|
|
51
44
|
};
|
|
52
45
|
}
|
|
@@ -12,13 +12,8 @@ export interface ApplicationGeneratorOptions {
|
|
|
12
12
|
unitTestRunner?: 'jest' | 'vitest' | 'none';
|
|
13
13
|
e2eTestRunner?: 'jest' | 'none';
|
|
14
14
|
enableTypedLinting?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
17
|
-
*/
|
|
18
|
-
setParserOptionsProject?: boolean;
|
|
19
15
|
rootProject?: boolean;
|
|
20
16
|
strict?: boolean;
|
|
21
|
-
addPlugin?: boolean;
|
|
22
17
|
useTsSolution?: boolean;
|
|
23
18
|
useProjectJson?: boolean;
|
|
24
19
|
}
|
|
@@ -71,12 +71,6 @@
|
|
|
71
71
|
"description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
|
|
72
72
|
"default": false
|
|
73
73
|
},
|
|
74
|
-
"setParserOptionsProject": {
|
|
75
|
-
"type": "boolean",
|
|
76
|
-
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
77
|
-
"default": false,
|
|
78
|
-
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
79
|
-
},
|
|
80
74
|
"strict": {
|
|
81
75
|
"type": "boolean",
|
|
82
76
|
"description": "Adds strictNullChecks, noImplicitAny, strictBindCallApply, forceConsistentCasingInFileNames and noFallthroughCasesInSwitch to tsconfig.",
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
exports.toJsLibraryGeneratorOptions = toJsLibraryGeneratorOptions;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
-
const internal_2 = require("@nx/
|
|
8
|
-
const internal_3 = require("@nx/js/internal");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
9
7
|
async function normalizeOptions(tree, options) {
|
|
10
8
|
await (0, internal_1.ensureRootProjectName)(options, 'library');
|
|
11
9
|
const { projectName, names: projectNames, projectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
|
|
@@ -14,10 +12,6 @@ async function normalizeOptions(tree, options) {
|
|
|
14
12
|
directory: options.directory,
|
|
15
13
|
importPath: options.importPath,
|
|
16
14
|
});
|
|
17
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
18
|
-
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
19
|
-
nxJson.useInferencePlugins !== false;
|
|
20
|
-
options.addPlugin ??= addPlugin;
|
|
21
15
|
const fileName = projectNames.projectFileName;
|
|
22
16
|
const parsedTags = options.tags
|
|
23
17
|
? options.tags.split(',').map((s) => s.trim())
|
|
@@ -25,17 +19,16 @@ async function normalizeOptions(tree, options) {
|
|
|
25
19
|
// this helper is called before the jsLibraryGenerator is called, so, if the
|
|
26
20
|
// TS solution setup is not configured, we additionally check if the TS
|
|
27
21
|
// solution setup will be configured by the jsLibraryGenerator
|
|
28
|
-
const isUsingTsSolutionsConfig = (0,
|
|
29
|
-
(0, internal_3.shouldConfigureTsSolutionSetup)(tree, addPlugin);
|
|
22
|
+
const isUsingTsSolutionsConfig = (0, internal_2.isUsingTsSolutionSetup)(tree) || (0, internal_2.shouldConfigureTsSolutionSetup)(tree);
|
|
30
23
|
const normalized = {
|
|
31
24
|
...options,
|
|
32
25
|
strict: options.strict ?? true,
|
|
33
26
|
controller: options.controller ?? false,
|
|
34
27
|
fileName,
|
|
35
28
|
global: options.global ?? false,
|
|
36
|
-
linter: await (0,
|
|
29
|
+
linter: await (0, internal_2.normalizeLinterOption)(tree, options.linter),
|
|
37
30
|
parsedTags,
|
|
38
|
-
prefix: (0,
|
|
31
|
+
prefix: (0, internal_2.getNpmScope)(tree), // we could also allow customizing this
|
|
39
32
|
projectName: isUsingTsSolutionsConfig && !options.name ? importPath : projectName,
|
|
40
33
|
projectRoot,
|
|
41
34
|
importPath,
|
|
@@ -66,8 +59,7 @@ function toJsLibraryGeneratorOptions(options) {
|
|
|
66
59
|
// `deleteFiles` drops the generated spec, and a library without a
|
|
67
60
|
// controller or service is left with none at all.
|
|
68
61
|
passWithNoTests: true,
|
|
69
|
-
enableTypedLinting:
|
|
70
|
-
addPlugin: options.addPlugin,
|
|
62
|
+
enableTypedLinting: options.enableTypedLinting,
|
|
71
63
|
useProjectJson: options.useProjectJson,
|
|
72
64
|
};
|
|
73
65
|
}
|
|
@@ -13,7 +13,6 @@ const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
|
13
13
|
const lib_1 = require("./lib");
|
|
14
14
|
async function libraryGenerator(tree, rawOptions) {
|
|
15
15
|
return await libraryGeneratorInternal(tree, {
|
|
16
|
-
addPlugin: false,
|
|
17
16
|
useProjectJson: true,
|
|
18
17
|
...rawOptions,
|
|
19
18
|
});
|
|
@@ -29,12 +29,7 @@ export interface LibraryGeneratorOptions {
|
|
|
29
29
|
testEnvironment?: 'jsdom' | 'node';
|
|
30
30
|
unitTestRunner?: UnitTestRunner;
|
|
31
31
|
enableTypedLinting?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
34
|
-
*/
|
|
35
|
-
setParserOptionsProject?: boolean;
|
|
36
32
|
skipPackageJson?: boolean;
|
|
37
|
-
addPlugin?: boolean;
|
|
38
33
|
isUsingTsSolutionsConfig?: boolean;
|
|
39
34
|
useProjectJson?: boolean;
|
|
40
35
|
}
|
|
@@ -121,12 +121,6 @@
|
|
|
121
121
|
"description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
|
|
122
122
|
"default": false
|
|
123
123
|
},
|
|
124
|
-
"setParserOptionsProject": {
|
|
125
|
-
"type": "boolean",
|
|
126
|
-
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
127
|
-
"default": false,
|
|
128
|
-
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
129
|
-
},
|
|
130
124
|
"skipPackageJson": {
|
|
131
125
|
"description": "Do not add dependencies to `package.json`.",
|
|
132
126
|
"type": "boolean",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/nest",
|
|
3
|
-
"version": "24.0.0-
|
|
3
|
+
"version": "24.0.0-rc.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -60,10 +60,9 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@nestjs/schematics": "^11.0.0",
|
|
63
|
-
"@nx/devkit": "24.0.0-
|
|
64
|
-
"@nx/js": "24.0.0-
|
|
65
|
-
"@nx/
|
|
66
|
-
"@nx/node": "24.0.0-pr.37405.acdaf31",
|
|
63
|
+
"@nx/devkit": "24.0.0-rc.0",
|
|
64
|
+
"@nx/js": "24.0.0-rc.0",
|
|
65
|
+
"@nx/node": "24.0.0-rc.0",
|
|
67
66
|
"semver": "^7.6.3",
|
|
68
67
|
"tslib": "^2.3.0"
|
|
69
68
|
},
|