@nx/express 0.0.0-pr-31222-862e973 → 0.0.0-pr-31313-387cdca
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/LICENSE +1 -1
- package/README.md +1 -1
- package/migrations.json +1 -8
- package/package.json +8 -8
- package/src/generators/application/application.js +7 -5
- package/src/generators/application/schema.d.ts +3 -5
- package/src/generators/application/schema.json +17 -27
- package/src/utils/versions.d.ts +2 -2
- package/src/utils/versions.js +2 -2
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +0 -2
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +0 -9
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
[](https://circleci.com/gh/nrwl/nx)
|
|
11
11
|
[]()
|
|
12
|
-
[](https://www.npmjs.com/package/nx)
|
|
13
13
|
[]()
|
|
14
14
|
[](http://commitizen.github.io/cz-cli/)
|
|
15
15
|
[](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
package/migrations.json
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generators": {
|
|
3
|
-
"update-16-0-0-add-nx-packages": {
|
|
4
|
-
"cli": "nx",
|
|
5
|
-
"version": "16.0.0-beta.1",
|
|
6
|
-
"description": "Replace @nrwl/express with @nx/express",
|
|
7
|
-
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
|
|
8
|
-
}
|
|
9
|
-
},
|
|
2
|
+
"generators": {},
|
|
10
3
|
"packageJsonUpdates": {}
|
|
11
4
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/express",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-31313-387cdca",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Express contains executors and generators for allowing your workspace to create powerful Express Node applications and APIs.",
|
|
6
6
|
"repository": {
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"migrations": "./migrations.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@nx/devkit": "0.0.0-pr-
|
|
35
|
-
"@nx/
|
|
36
|
-
"
|
|
37
|
-
"
|
|
34
|
+
"@nx/devkit": "0.0.0-pr-31313-387cdca",
|
|
35
|
+
"@nx/js": "0.0.0-pr-31313-387cdca",
|
|
36
|
+
"@nx/node": "0.0.0-pr-31313-387cdca",
|
|
37
|
+
"tslib": "^2.3.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"express": "^4.
|
|
40
|
+
"express": "^4.21.2"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
43
|
"express": {
|
|
@@ -47,6 +47,6 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"
|
|
51
|
-
"
|
|
50
|
+
"types": "./index.d.ts",
|
|
51
|
+
"type": "commonjs"
|
|
52
52
|
}
|
|
@@ -4,6 +4,7 @@ exports.applicationGenerator = applicationGenerator;
|
|
|
4
4
|
exports.applicationGeneratorInternal = applicationGeneratorInternal;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
7
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
8
|
const node_1 = require("@nx/node");
|
|
8
9
|
const versions_1 = require("@nx/node/src/utils/versions");
|
|
9
10
|
const path_1 = require("path");
|
|
@@ -45,7 +46,7 @@ server.on('error', console.error);
|
|
|
45
46
|
async function applicationGenerator(tree, schema) {
|
|
46
47
|
return await applicationGeneratorInternal(tree, {
|
|
47
48
|
addPlugin: false,
|
|
48
|
-
|
|
49
|
+
useProjectJson: true,
|
|
49
50
|
...schema,
|
|
50
51
|
});
|
|
51
52
|
}
|
|
@@ -57,6 +58,7 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
57
58
|
const applicationTask = await (0, node_1.applicationGenerator)(tree, {
|
|
58
59
|
...options,
|
|
59
60
|
bundler: 'webpack',
|
|
61
|
+
framework: 'express',
|
|
60
62
|
skipFormat: true,
|
|
61
63
|
});
|
|
62
64
|
tasks.push(applicationTask);
|
|
@@ -72,22 +74,22 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
72
74
|
}
|
|
73
75
|
exports.default = applicationGenerator;
|
|
74
76
|
async function normalizeOptions(host, options) {
|
|
75
|
-
|
|
77
|
+
await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
|
|
78
|
+
const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
76
79
|
name: options.name,
|
|
77
80
|
projectType: 'application',
|
|
78
81
|
directory: options.directory,
|
|
79
|
-
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
80
|
-
callingGenerator: '@nx/express:application',
|
|
81
82
|
});
|
|
82
|
-
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
|
83
83
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
84
84
|
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
85
85
|
nxJson.useInferencePlugins !== false;
|
|
86
86
|
options.addPlugin ??= addPlugin;
|
|
87
|
+
const useProjectJson = options.useProjectJson ?? !(0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
|
|
87
88
|
return {
|
|
88
89
|
...options,
|
|
89
90
|
appProjectName,
|
|
90
91
|
appProjectRoot,
|
|
92
|
+
useProjectJson,
|
|
91
93
|
};
|
|
92
94
|
}
|
|
93
95
|
function ensureDependencies(tree) {
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
|
|
2
1
|
import type { Linter, LinterType } from '@nx/eslint';
|
|
3
2
|
import type { UnitTestRunner } from '../../utils/test-runners';
|
|
4
3
|
|
|
5
4
|
export interface Schema {
|
|
6
|
-
|
|
5
|
+
directory: string;
|
|
6
|
+
name?: string;
|
|
7
7
|
skipFormat: boolean;
|
|
8
8
|
skipPackageJson: boolean;
|
|
9
|
-
directory?: string;
|
|
10
|
-
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
|
11
9
|
unitTestRunner: UnitTestRunner;
|
|
12
10
|
tags?: string;
|
|
13
11
|
linter: Linter | LinterType;
|
|
@@ -16,8 +14,8 @@ export interface Schema {
|
|
|
16
14
|
/** @deprecated use `swcJest` instead */
|
|
17
15
|
babelJest?: boolean;
|
|
18
16
|
js: boolean;
|
|
19
|
-
pascalCaseFiles: boolean;
|
|
20
17
|
standaloneConfig?: boolean;
|
|
21
18
|
setParserOptionsProject?: boolean;
|
|
22
19
|
addPlugin?: boolean;
|
|
20
|
+
useProjectJson?: boolean;
|
|
23
21
|
}
|
|
@@ -6,25 +6,20 @@
|
|
|
6
6
|
"description": "Nx Application Options Schema.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
|
-
"
|
|
10
|
-
"description": "The
|
|
9
|
+
"directory": {
|
|
10
|
+
"description": "The directory of the new application.",
|
|
11
11
|
"type": "string",
|
|
12
12
|
"$default": {
|
|
13
13
|
"$source": "argv",
|
|
14
14
|
"index": 0
|
|
15
15
|
},
|
|
16
|
-
"x-prompt": "
|
|
17
|
-
"pattern": "^[a-zA-Z][^:]*$"
|
|
16
|
+
"x-prompt": "Which directory do you want to create the application in?"
|
|
18
17
|
},
|
|
19
|
-
"
|
|
20
|
-
"description": "The
|
|
18
|
+
"name": {
|
|
19
|
+
"description": "The name of the application.",
|
|
20
|
+
"pattern": "^[a-zA-Z][^:]*$",
|
|
21
21
|
"type": "string"
|
|
22
22
|
},
|
|
23
|
-
"projectNameAndRootFormat": {
|
|
24
|
-
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
|
25
|
-
"type": "string",
|
|
26
|
-
"enum": ["as-provided", "derived"]
|
|
27
|
-
},
|
|
28
23
|
"skipFormat": {
|
|
29
24
|
"description": "Skip formatting files.",
|
|
30
25
|
"type": "boolean",
|
|
@@ -38,14 +33,17 @@
|
|
|
38
33
|
"linter": {
|
|
39
34
|
"description": "The tool to use for running lint checks.",
|
|
40
35
|
"type": "string",
|
|
41
|
-
"enum": ["eslint"],
|
|
42
|
-
"default": "
|
|
36
|
+
"enum": ["eslint", "none"],
|
|
37
|
+
"default": "none",
|
|
38
|
+
"x-prompt": "Which linter would you like to use?",
|
|
39
|
+
"x-priority": "important"
|
|
43
40
|
},
|
|
44
41
|
"unitTestRunner": {
|
|
45
42
|
"type": "string",
|
|
46
43
|
"enum": ["jest", "none"],
|
|
47
44
|
"description": "Test runner to use for unit tests.",
|
|
48
|
-
"default": "
|
|
45
|
+
"default": "none",
|
|
46
|
+
"x-prompt": "Which unit test runner would you like to use?"
|
|
49
47
|
},
|
|
50
48
|
"tags": {
|
|
51
49
|
"type": "string",
|
|
@@ -66,28 +64,20 @@
|
|
|
66
64
|
"default": false,
|
|
67
65
|
"x-deprecated": "Use --swcJest instead for faster compilation"
|
|
68
66
|
},
|
|
69
|
-
"pascalCaseFiles": {
|
|
70
|
-
"type": "boolean",
|
|
71
|
-
"description": "Use pascal case file names.",
|
|
72
|
-
"alias": "P",
|
|
73
|
-
"default": false
|
|
74
|
-
},
|
|
75
67
|
"js": {
|
|
76
68
|
"type": "boolean",
|
|
77
69
|
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
78
70
|
"default": false
|
|
79
71
|
},
|
|
80
|
-
"standaloneConfig": {
|
|
81
|
-
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
|
82
|
-
"type": "boolean",
|
|
83
|
-
"default": true,
|
|
84
|
-
"x-deprecated": "Nx only supports standaloneConfig"
|
|
85
|
-
},
|
|
86
72
|
"setParserOptionsProject": {
|
|
87
73
|
"type": "boolean",
|
|
88
74
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
89
75
|
"default": false
|
|
76
|
+
},
|
|
77
|
+
"useProjectJson": {
|
|
78
|
+
"type": "boolean",
|
|
79
|
+
"description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
|
|
90
80
|
}
|
|
91
81
|
},
|
|
92
|
-
"required": []
|
|
82
|
+
"required": ["directory"]
|
|
93
83
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const expressVersion = "^4.
|
|
3
|
-
export declare const expressTypingsVersion = "4.17.
|
|
2
|
+
export declare const expressVersion = "^4.21.2";
|
|
3
|
+
export declare const expressTypingsVersion = "^4.17.21";
|
package/src/utils/versions.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.expressTypingsVersion = exports.expressVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.expressVersion = '^4.
|
|
6
|
-
exports.expressTypingsVersion = '4.17.
|
|
5
|
+
exports.expressVersion = '^4.21.2';
|
|
6
|
+
exports.expressTypingsVersion = '^4.17.21';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = replacePackage;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
|
|
6
|
-
async function replacePackage(tree) {
|
|
7
|
-
await (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/express', '@nx/express');
|
|
8
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
9
|
-
}
|