@nx/js 17.2.5 → 17.3.0-beta.1
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/js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.3.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
|
|
6
6
|
"repository": {
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"semver": "7.5.3",
|
|
58
58
|
"source-map-support": "0.5.19",
|
|
59
59
|
"tslib": "^2.3.0",
|
|
60
|
-
"@nx/devkit": "
|
|
61
|
-
"@nx/workspace": "
|
|
62
|
-
"@nrwl/js": "
|
|
60
|
+
"@nx/devkit": "17.3.0-beta.1",
|
|
61
|
+
"@nx/workspace": "17.3.0-beta.1",
|
|
62
|
+
"@nrwl/js": "17.3.0-beta.1"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"verdaccio": "^5.0.4"
|
|
@@ -14,6 +14,6 @@ Run `<%= cliCommand %> build <%= name %>` to build the library.
|
|
|
14
14
|
|
|
15
15
|
## Running unit tests
|
|
16
16
|
|
|
17
|
-
Run `<%= cliCommand %> test <%= name %>` to execute the unit tests via [Jest](https://jestjs.io).
|
|
17
|
+
Run `<%= cliCommand %> test <%= name %>` to execute the unit tests via <% if(unitTestRunner === 'jest') { %>[Jest](https://jestjs.io)<% } else { %>[Vitest](https://vitest.dev/)<% } %>.
|
|
18
18
|
|
|
19
19
|
<% } %>
|
|
@@ -6,5 +6,9 @@
|
|
|
6
6
|
"types": ["node"]
|
|
7
7
|
},
|
|
8
8
|
"include": ["src/**/*.ts"<% if (js) { %>, "src/**/*.js"<% } %>],
|
|
9
|
-
"exclude": [
|
|
9
|
+
"exclude": [
|
|
10
|
+
<% if (hasUnitTestRunner && unitTestRunner === 'jest') { %>"jest.config.ts",
|
|
11
|
+
<% } else if (hasUnitTestRunner) { %>"vite.config.ts",
|
|
12
|
+
<% } %>"src/**/*.spec.ts", "src/**/*.test.ts"<% if (js) { %>, "src/**/*.spec.js", "src/**/*.test.js"<% } %>
|
|
13
|
+
]
|
|
10
14
|
}
|
|
@@ -18,8 +18,12 @@ async function releaseVersionGenerator(tree, options) {
|
|
|
18
18
|
try {
|
|
19
19
|
const versionData = {};
|
|
20
20
|
// If the user provided a specifier, validate that it is valid semver or a relative semver keyword
|
|
21
|
-
if (options.specifier
|
|
22
|
-
|
|
21
|
+
if (options.specifier) {
|
|
22
|
+
if (!(0, semver_1.isValidSemverSpecifier)(options.specifier)) {
|
|
23
|
+
throw new Error(`The given version specifier "${options.specifier}" is not valid. You provide an exact version or a valid semver keyword such as "major", "minor", "patch", etc.`);
|
|
24
|
+
}
|
|
25
|
+
// The node semver library classes a leading `v` as valid, but we want to ensure it is not present in the final version
|
|
26
|
+
options.specifier = options.specifier.replace(/^v/, '');
|
|
23
27
|
}
|
|
24
28
|
const projects = options.projects;
|
|
25
29
|
const createResolvePackageRoot = (customPackageRoot) => (projectNode) => {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findNodes = exports.findClass = exports.addMethod = exports.addParameterToConstructor = exports.replaceNodeValue = exports.getImport = exports.addGlobal = exports.insertImport = exports.removeChange = exports.replaceChange = exports.insertChange = exports.resolveModuleByImport = void 0;
|
|
4
|
-
// TODO(colum): replace when https://github.com/nrwl/nx/pull/15497 is merged
|
|
5
|
-
const typescript_1 = require("@nx/workspace/src/utilities/typescript");
|
|
6
4
|
const ensure_typescript_1 = require("./ensure-typescript");
|
|
7
5
|
const devkit_1 = require("@nx/devkit");
|
|
8
6
|
const path_1 = require("path");
|
|
7
|
+
const get_source_nodes_1 = require("./get-source-nodes");
|
|
9
8
|
const normalizedAppRoot = devkit_1.workspaceRoot.replace(/\\/g, '/');
|
|
10
9
|
let tsModule;
|
|
11
10
|
let compilerHost;
|
|
@@ -228,7 +227,7 @@ function findClass(source, className, silent = false) {
|
|
|
228
227
|
if (!tsModule) {
|
|
229
228
|
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
230
229
|
}
|
|
231
|
-
const nodes = (0,
|
|
230
|
+
const nodes = (0, get_source_nodes_1.getSourceNodes)(source);
|
|
232
231
|
const clazz = nodes.filter((n) => n.kind === tsModule.SyntaxKind.ClassDeclaration &&
|
|
233
232
|
n.name.text === className)[0];
|
|
234
233
|
if (!clazz && !silent) {
|