@nx/plugin 21.2.1 → 21.2.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/plugin",
|
|
3
|
-
"version": "21.2.
|
|
3
|
+
"version": "21.2.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "This plugin is used to create Nx plugins! It contains generators for generating common plugin features like generators, executors, migrations and more.",
|
|
6
6
|
"repository": {
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"tslib": "^2.3.0",
|
|
31
|
-
"@nx/devkit": "21.2.
|
|
32
|
-
"@nx/jest": "21.2.
|
|
33
|
-
"@nx/js": "21.2.
|
|
34
|
-
"@nx/eslint": "21.2.
|
|
31
|
+
"@nx/devkit": "21.2.3",
|
|
32
|
+
"@nx/jest": "21.2.3",
|
|
33
|
+
"@nx/js": "21.2.3",
|
|
34
|
+
"@nx/eslint": "21.2.3"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
@@ -131,7 +131,7 @@ function addE2eProject(host, options) {
|
|
|
131
131
|
const e2eProjectConfiguration = (0, devkit_1.readProjectConfiguration)(host, options.e2eProject);
|
|
132
132
|
const projectConfiguration = (0, devkit_1.readProjectConfiguration)(host, options.project);
|
|
133
133
|
const { name: pluginPackageName } = (0, devkit_1.readJson)(host, (0, path_1.join)(projectConfiguration.root, 'package.json'));
|
|
134
|
-
(0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, './files/e2e'), e2eProjectConfiguration
|
|
134
|
+
(0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, './files/e2e'), (0, ts_solution_setup_1.getProjectSourceRoot)(e2eProjectConfiguration, host), {
|
|
135
135
|
pluginName: options.project,
|
|
136
136
|
cliName: options.name,
|
|
137
137
|
packageManagerCommands: (0, devkit_1.getPackageManagerCommand)(),
|
|
@@ -97,16 +97,18 @@ async function addJest(host, options) {
|
|
|
97
97
|
(0, jest_1.addPropertyToJestConfig)(host, (0, path_1.join)(options.projectRoot, 'jest.config.ts'), 'globalTeardown', (0, path_1.join)((0, devkit_1.offsetFromRoot)(options.projectRoot), stopLocalRegistryPath));
|
|
98
98
|
const project = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
|
|
99
99
|
project.targets ??= {};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
if (project.targets.e2e) {
|
|
101
|
+
const e2eTarget = project.targets.e2e;
|
|
102
|
+
project.targets.e2e = {
|
|
103
|
+
...e2eTarget,
|
|
104
|
+
dependsOn: [`^build`],
|
|
105
|
+
options: {
|
|
106
|
+
...e2eTarget.options,
|
|
107
|
+
runInBand: true,
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
(0, devkit_1.updateProjectConfiguration)(host, options.projectName, project);
|
|
111
|
+
}
|
|
110
112
|
return jestTask;
|
|
111
113
|
}
|
|
112
114
|
async function addLintingToApplication(tree, options) {
|
|
@@ -6,6 +6,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
7
|
const add_swc_dependencies_1 = require("@nx/js/src/utils/swc/add-swc-dependencies");
|
|
8
8
|
const add_tslib_dependencies_1 = require("@nx/js/src/utils/typescript/add-tslib-dependencies");
|
|
9
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
9
10
|
const path = require("path");
|
|
10
11
|
const e2e_1 = require("../e2e-project/e2e");
|
|
11
12
|
const generator_1 = require("../lint-checks/generator");
|
|
@@ -22,8 +23,7 @@ function updatePluginConfig(host, options) {
|
|
|
22
23
|
const project = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
|
|
23
24
|
if (project.targets.build) {
|
|
24
25
|
if (options.isTsSolutionSetup && options.bundler === 'tsc') {
|
|
25
|
-
project.targets.build.options.rootDir =
|
|
26
|
-
project.sourceRoot ?? (0, devkit_1.joinPathFragments)(project.root, 'src');
|
|
26
|
+
project.targets.build.options.rootDir = (0, ts_solution_setup_1.getProjectSourceRoot)(project, host);
|
|
27
27
|
project.targets.build.options.generatePackageJson = false;
|
|
28
28
|
}
|
|
29
29
|
project.targets.build.options.assets = [
|
package/src/utils/paths.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getArtifactMetadataDirectory = getArtifactMetadataDirectory;
|
|
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 posix_1 = require("node:path/posix");
|
|
6
7
|
function getArtifactMetadataDirectory(tree, projectName, sourceDirectory, isTsSolutionSetup) {
|
|
7
8
|
const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
@@ -23,9 +24,6 @@ function getArtifactMetadataDirectory(tree, projectName, sourceDirectory, isTsSo
|
|
|
23
24
|
// unless the user manually changed the build process. In that case, we can't
|
|
24
25
|
// reliably determine the output directory because it depends on the build
|
|
25
26
|
// tool, so we'll just assume some defaults.
|
|
26
|
-
const baseDir = project
|
|
27
|
-
(tree.exists((0, posix_1.join)(project.root, 'src'))
|
|
28
|
-
? (0, posix_1.join)(project.root, 'src')
|
|
29
|
-
: project.root);
|
|
27
|
+
const baseDir = (0, ts_solution_setup_1.getProjectSourceRoot)(project, tree);
|
|
30
28
|
return `./${(0, posix_1.join)('dist', (0, posix_1.relative)(baseDir, sourceDirectory))}`;
|
|
31
29
|
}
|