@nx/express 20.0.0-beta.4 → 20.0.0-beta.6
Sign up to get free protection for your applications and to get access to all the features.
- package/migrations.json +1 -8
- package/package.json +5 -5
- package/src/generators/application/application.js +4 -3
- package/src/generators/application/schema.d.ts +2 -4
- package/src/generators/application/schema.json +7 -18
- package/src/generators/init/init.js +2 -0
- 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/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": "20.0.0-beta.
|
3
|
+
"version": "20.0.0-beta.6",
|
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,10 +31,10 @@
|
|
31
31
|
"migrations": "./migrations.json"
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
|
-
"@nx/devkit": "20.0.0-beta.
|
35
|
-
"@nx/
|
36
|
-
"
|
37
|
-
"
|
34
|
+
"@nx/devkit": "20.0.0-beta.6",
|
35
|
+
"@nx/js": "20.0.0-beta.6",
|
36
|
+
"@nx/node": "20.0.0-beta.6",
|
37
|
+
"tslib": "^2.3.0"
|
38
38
|
},
|
39
39
|
"peerDependencies": {
|
40
40
|
"express": "^4.18.1"
|
@@ -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");
|
@@ -49,6 +50,7 @@ async function applicationGenerator(tree, schema) {
|
|
49
50
|
});
|
50
51
|
}
|
51
52
|
async function applicationGeneratorInternal(tree, schema) {
|
53
|
+
(0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(tree, 'express', 'application');
|
52
54
|
const options = await normalizeOptions(tree, schema);
|
53
55
|
const tasks = [];
|
54
56
|
const initTask = await (0, init_1.initGenerator)(tree, { ...options, skipFormat: true });
|
@@ -71,13 +73,12 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
71
73
|
}
|
72
74
|
exports.default = applicationGenerator;
|
73
75
|
async function normalizeOptions(host, options) {
|
74
|
-
|
76
|
+
await (0, project_name_and_root_utils_1.ensureProjectName)(host, options, 'application');
|
77
|
+
const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
75
78
|
name: options.name,
|
76
79
|
projectType: 'application',
|
77
80
|
directory: options.directory,
|
78
|
-
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
79
81
|
});
|
80
|
-
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
81
82
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
82
83
|
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
83
84
|
nxJson.useInferencePlugins !== false;
|
@@ -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;
|
@@ -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",
|
@@ -71,17 +66,11 @@
|
|
71
66
|
"description": "Generate JavaScript files rather than TypeScript files.",
|
72
67
|
"default": false
|
73
68
|
},
|
74
|
-
"standaloneConfig": {
|
75
|
-
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
76
|
-
"type": "boolean",
|
77
|
-
"default": true,
|
78
|
-
"x-deprecated": "Nx only supports standaloneConfig"
|
79
|
-
},
|
80
69
|
"setParserOptionsProject": {
|
81
70
|
"type": "boolean",
|
82
71
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
83
72
|
"default": false
|
84
73
|
}
|
85
74
|
},
|
86
|
-
"required": []
|
75
|
+
"required": ["directory"]
|
87
76
|
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.initGenerator = initGenerator;
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
5
6
|
const versions_1 = require("../../utils/versions");
|
6
7
|
function updateDependencies(tree, schema) {
|
7
8
|
const tasks = [];
|
@@ -10,6 +11,7 @@ function updateDependencies(tree, schema) {
|
|
10
11
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
11
12
|
}
|
12
13
|
async function initGenerator(tree, schema) {
|
14
|
+
(0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(tree, 'express', 'init');
|
13
15
|
let installTask = () => { };
|
14
16
|
if (!schema.skipPackageJson) {
|
15
17
|
installTask = updateDependencies(tree, schema);
|
@@ -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
|
-
}
|