@nx/plugin 23.2.0-beta.4 → 23.2.0-beta.5
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/create-package/create-package.js +3 -3
- package/dist/src/generators/lint-checks/generator.d.ts +1 -1
- package/dist/src/generators/lint-checks/generator.js +5 -6
- package/dist/src/generators/migration/migration.js +1 -2
- package/dist/src/utils/testing-utils/utils.d.ts +1 -1
- package/dist/src/utils/testing-utils/utils.js +4 -4
- package/package.json +7 -7
|
@@ -5,11 +5,11 @@ exports.createPackageGeneratorInternal = createPackageGeneratorInternal;
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
7
|
const internal_1 = require("@nx/js/internal");
|
|
8
|
-
const versions_1 = require("nx/src/utils/versions");
|
|
9
8
|
const path_1 = require("path");
|
|
10
9
|
const has_generator_1 = require("../../utils/has-generator");
|
|
11
10
|
const generator_1 = require("../generator/generator");
|
|
12
11
|
const normalize_schema_1 = require("./utils/normalize-schema");
|
|
12
|
+
const internal_2 = require("@nx/devkit/internal");
|
|
13
13
|
async function createPackageGenerator(host, schema) {
|
|
14
14
|
return await createPackageGeneratorInternal(host, {
|
|
15
15
|
useProjectJson: true,
|
|
@@ -25,7 +25,7 @@ async function createPackageGeneratorInternal(host, schema) {
|
|
|
25
25
|
tasks.push((0, js_1.addTsLibDependencies)(host));
|
|
26
26
|
}
|
|
27
27
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
28
|
-
'create-nx-workspace':
|
|
28
|
+
'create-nx-workspace': internal_2.nxVersion,
|
|
29
29
|
}, {});
|
|
30
30
|
tasks.push(installTask);
|
|
31
31
|
const cliPackageTask = await createCliPackage(host, options, pluginPackageName);
|
|
@@ -86,7 +86,7 @@ async function createCliPackage(host, options, pluginPackageName) {
|
|
|
86
86
|
delete packageJson.exports;
|
|
87
87
|
}
|
|
88
88
|
packageJson.dependencies = {
|
|
89
|
-
'create-nx-workspace':
|
|
89
|
+
'create-nx-workspace': internal_2.nxVersion,
|
|
90
90
|
...(options.bundler === 'tsc' && { tslib: internal_1.tsLibVersion }),
|
|
91
91
|
};
|
|
92
92
|
return packageJson;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ProjectConfiguration, TargetConfiguration, Tree } from '@nx/devkit';
|
|
2
2
|
import type { Schema as EsLintExecutorOptions } from '@nx/eslint/internal';
|
|
3
3
|
import { PluginLintChecksGeneratorSchema } from './schema';
|
|
4
|
-
import { PackageJson } from 'nx/
|
|
4
|
+
import { PackageJson } from '@nx/devkit/internal';
|
|
5
5
|
export default function pluginLintCheckGenerator(host: Tree, options: PluginLintChecksGeneratorSchema): Promise<void>;
|
|
6
6
|
export declare function addMigrationJsonChecks(host: Tree, options: PluginLintChecksGeneratorSchema, packageJson: PackageJson): void;
|
|
7
7
|
export declare function getEsLintOptions(project: ProjectConfiguration): [target: string, configuration: TargetConfiguration<EsLintExecutorOptions>];
|
|
@@ -4,9 +4,8 @@ exports.default = pluginLintCheckGenerator;
|
|
|
4
4
|
exports.addMigrationJsonChecks = addMigrationJsonChecks;
|
|
5
5
|
exports.getEsLintOptions = getEsLintOptions;
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const logger_1 = require("nx/src/utils/logger");
|
|
8
|
-
const package_json_1 = require("nx/src/utils/package-json");
|
|
9
7
|
const internal_1 = require("@nx/eslint/internal");
|
|
8
|
+
const internal_2 = require("@nx/devkit/internal");
|
|
10
9
|
async function pluginLintCheckGenerator(host, options) {
|
|
11
10
|
const project = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
|
|
12
11
|
const packageJson = (0, devkit_1.readJson)(host, (0, devkit_1.joinPathFragments)(project.root, 'package.json'));
|
|
@@ -21,7 +20,7 @@ async function pluginLintCheckGenerator(host, options) {
|
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
22
|
else {
|
|
24
|
-
devkit_1.logger.error(`${
|
|
23
|
+
devkit_1.logger.error(`${internal_2.NX_PREFIX} plugin lint checks can only be added to plugins which use eslint for linting`);
|
|
25
24
|
}
|
|
26
25
|
if (!options.skipFormat) {
|
|
27
26
|
await (0, devkit_1.formatFiles)(host);
|
|
@@ -33,7 +32,7 @@ function addMigrationJsonChecks(host, options, packageJson) {
|
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
34
|
const [eslintTarget, eslintTargetConfiguration] = getEsLintOptions(projectConfiguration) ?? [];
|
|
36
|
-
const relativeMigrationsJsonPath = (0,
|
|
35
|
+
const relativeMigrationsJsonPath = (0, internal_2.readNxMigrateConfig)(packageJson).migrations;
|
|
37
36
|
if (!relativeMigrationsJsonPath) {
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
@@ -129,7 +128,7 @@ function updateProjectEslintConfig(host, options, packageJson) {
|
|
|
129
128
|
packageJson.executors,
|
|
130
129
|
packageJson.schematics,
|
|
131
130
|
packageJson.builders,
|
|
132
|
-
(0,
|
|
131
|
+
(0, internal_2.readNxMigrateConfig)(packageJson).migrations,
|
|
133
132
|
].filter((f) => !!f);
|
|
134
133
|
const parser = (0, internal_1.useFlatConfig)(host)
|
|
135
134
|
? { languageOptions: { parser: 'jsonc-eslint-parser' } }
|
|
@@ -195,7 +194,7 @@ function setupVsCodeLintingForJsonFiles(host) {
|
|
|
195
194
|
existing = (0, devkit_1.readJson)(host, '.vscode/settings.json');
|
|
196
195
|
}
|
|
197
196
|
else {
|
|
198
|
-
devkit_1.logger.info(`${
|
|
197
|
+
devkit_1.logger.info(`${internal_2.NX_PREFIX} We've updated the vscode settings for this repository to ensure that plugin lint checks show up inside your IDE. This created .vscode/settings.json. To read more about this file, check vscode's documentation. It is frequently not committed, so other developers may need to add similar settings if they'd like to see the lint checks in the IDE rather than only during linting.`);
|
|
199
198
|
}
|
|
200
199
|
// setup eslint validation for json files
|
|
201
200
|
const eslintValidate = existing['eslint.validate'] ?? [];
|
|
@@ -5,7 +5,6 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
|
-
const package_json_1 = require("nx/src/utils/package-json");
|
|
9
8
|
const paths_1 = require("../../utils/paths");
|
|
10
9
|
const versions_1 = require("../../utils/versions");
|
|
11
10
|
const generator_1 = require("../lint-checks/generator");
|
|
@@ -38,7 +37,7 @@ function addFiles(host, options) {
|
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
39
|
function updateMigrationsJson(host, options) {
|
|
41
|
-
const configuredMigrationPath = (0,
|
|
40
|
+
const configuredMigrationPath = (0, internal_1.readNxMigrateConfig)((0, devkit_1.readJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'))).migrations;
|
|
42
41
|
const migrationsPath = (0, devkit_1.joinPathFragments)(options.projectRoot, configuredMigrationPath ?? 'migrations.json');
|
|
43
42
|
const migrations = host.exists(migrationsPath)
|
|
44
43
|
? (0, devkit_1.readJson)(host, migrationsPath)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JsonParseOptions } from '@nx/devkit';
|
|
2
|
-
import { directoryExists, fileExists } from 'nx/
|
|
2
|
+
import { directoryExists, fileExists } from '@nx/devkit/internal';
|
|
3
3
|
export { directoryExists, fileExists };
|
|
4
4
|
/**
|
|
5
5
|
* Copies module folders from the working directory to the e2e directory
|
|
@@ -19,9 +19,9 @@ const node_fs_1 = require("node:fs");
|
|
|
19
19
|
const path_1 = require("path");
|
|
20
20
|
const paths_1 = require("./paths");
|
|
21
21
|
const devkit_1 = require("@nx/devkit");
|
|
22
|
-
const
|
|
23
|
-
Object.defineProperty(exports, "directoryExists", { enumerable: true, get: function () { return
|
|
24
|
-
Object.defineProperty(exports, "fileExists", { enumerable: true, get: function () { return
|
|
22
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
23
|
+
Object.defineProperty(exports, "directoryExists", { enumerable: true, get: function () { return internal_1.directoryExists; } });
|
|
24
|
+
Object.defineProperty(exports, "fileExists", { enumerable: true, get: function () { return internal_1.fileExists; } });
|
|
25
25
|
/**
|
|
26
26
|
* Copies module folders from the working directory to the e2e directory
|
|
27
27
|
* @param modules a list of module names or scopes to copy
|
|
@@ -136,7 +136,7 @@ function getCwd() {
|
|
|
136
136
|
* @param path Path to file or directory
|
|
137
137
|
*/
|
|
138
138
|
function exists(path) {
|
|
139
|
-
return (0,
|
|
139
|
+
return (0, internal_1.directoryExists)(path) || (0, internal_1.fileExists)(path);
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
142
|
* Get the size of a file on disk
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/plugin",
|
|
3
|
-
"version": "23.2.0-beta.
|
|
3
|
+
"version": "23.2.0-beta.5",
|
|
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": {
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"tslib": "^2.3.0",
|
|
39
|
-
"@nx/devkit": "23.2.0-beta.
|
|
40
|
-
"@nx/jest": "23.2.0-beta.
|
|
41
|
-
"@nx/js": "23.2.0-beta.
|
|
42
|
-
"@nx/eslint": "23.2.0-beta.
|
|
39
|
+
"@nx/devkit": "23.2.0-beta.5",
|
|
40
|
+
"@nx/jest": "23.2.0-beta.5",
|
|
41
|
+
"@nx/js": "23.2.0-beta.5",
|
|
42
|
+
"@nx/eslint": "23.2.0-beta.5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"nx": "23.2.0-beta.
|
|
45
|
+
"nx": "23.2.0-beta.5"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@nx/vitest": "23.2.0-beta.
|
|
48
|
+
"@nx/vitest": "23.2.0-beta.5"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"@nx/vitest": {
|