nx 23.0.0-beta.15 → 23.0.0-beta.16
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/command-line/release/utils/resolve-changelog-renderer.js +7 -19
- package/dist/src/command-line/release/version/version-actions.js +3 -7
- package/dist/src/config/schema-utils.js +9 -5
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/devkit-internals.d.ts +1 -1
- package/dist/src/devkit-internals.js +4 -1
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/plugins/js/utils/register.d.ts +113 -0
- package/dist/src/plugins/js/utils/register.js +438 -34
- package/dist/src/project-graph/plugins/transpiler.d.ts +12 -0
- package/dist/src/project-graph/plugins/transpiler.js +37 -0
- package/dist/src/utils/handle-import.d.ts +4 -1
- package/dist/src/utils/handle-import.js +56 -2
- package/migrations.json +1 -1
- package/package.json +11 -11
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveChangelogRenderer = resolveChangelogRenderer;
|
|
4
4
|
const register_1 = require("../../../plugins/js/utils/register");
|
|
5
|
-
const typescript_1 = require("../../../plugins/js/utils/typescript");
|
|
6
5
|
const utils_1 = require("../../../tasks-runner/utils");
|
|
7
6
|
const workspace_root_1 = require("../../../utils/workspace-root");
|
|
8
7
|
function resolveChangelogRenderer(changelogRendererPathOrImplementation) {
|
|
@@ -13,22 +12,11 @@ function resolveChangelogRenderer(changelogRendererPathOrImplementation) {
|
|
|
13
12
|
const interpolatedChangelogRendererPath = (0, utils_1.interpolate)(changelogRendererPathOrImplementation, {
|
|
14
13
|
workspaceRoot: workspace_root_1.workspaceRoot,
|
|
15
14
|
});
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
const r = require(interpolatedChangelogRendererPath);
|
|
25
|
-
ChangelogRendererClass = r.default || r;
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
throw err;
|
|
29
|
-
}
|
|
30
|
-
finally {
|
|
31
|
-
cleanupTranspiler();
|
|
32
|
-
}
|
|
33
|
-
return ChangelogRendererClass;
|
|
15
|
+
// TS renderers go through loadTsFile (native-strip -> swc/ts-node + paths).
|
|
16
|
+
// JS renderers use require() with a lazy tsconfig-paths fallback so workspace
|
|
17
|
+
// alias imports still resolve, without paying registration cost up front.
|
|
18
|
+
const r = /\.[cm]?ts$/.test(interpolatedChangelogRendererPath)
|
|
19
|
+
? (0, register_1.loadTsFile)(interpolatedChangelogRendererPath)
|
|
20
|
+
: (0, register_1.requireWithTsconfigFallback)(interpolatedChangelogRendererPath);
|
|
21
|
+
return r.default || r;
|
|
34
22
|
}
|
|
@@ -4,7 +4,6 @@ exports.NOOP_VERSION_ACTIONS = exports.VersionActions = void 0;
|
|
|
4
4
|
exports.resolveVersionActionsForProject = resolveVersionActionsForProject;
|
|
5
5
|
const node_path_1 = require("node:path");
|
|
6
6
|
const register_1 = require("../../../plugins/js/utils/register");
|
|
7
|
-
const typescript_1 = require("../../../plugins/js/utils/typescript");
|
|
8
7
|
const utils_1 = require("../../../tasks-runner/utils");
|
|
9
8
|
const workspace_root_1 = require("../../../utils/workspace-root");
|
|
10
9
|
const config_1 = require("../config/config");
|
|
@@ -52,12 +51,9 @@ async function resolveVersionActionsForProject(tree, releaseGroup, projectGraphN
|
|
|
52
51
|
afterAllProjectsVersioned = cachedData.afterAllProjectsVersioned;
|
|
53
52
|
}
|
|
54
53
|
else {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
const loaded = require(versionActionsPath);
|
|
60
|
-
cleanupTranspiler?.();
|
|
54
|
+
const loaded = /\.[cm]?ts$/.test(versionActionsPath)
|
|
55
|
+
? (0, register_1.loadTsFile)(versionActionsPath)
|
|
56
|
+
: (0, register_1.requireWithTsconfigFallback)(versionActionsPath);
|
|
61
57
|
VersionActionsClass = loaded.default ?? loaded;
|
|
62
58
|
if (!VersionActionsClass) {
|
|
63
59
|
throw new Error(`For project "${projectGraphNode.name}" it was not possible to resolve the VersionActions implementation from: "${versionActionsPath}"`);
|
|
@@ -6,8 +6,8 @@ exports.resolveSchema = resolveSchema;
|
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const resolve_exports_1 = require("resolve.exports");
|
|
9
|
+
const register_1 = require("../plugins/js/utils/register");
|
|
9
10
|
const packages_1 = require("../plugins/js/utils/packages");
|
|
10
|
-
const plugins_1 = require("../project-graph/plugins");
|
|
11
11
|
const path_2 = require("../utils/path");
|
|
12
12
|
/**
|
|
13
13
|
* This function is used to get the implementation factory of an executor or generator.
|
|
@@ -19,10 +19,14 @@ function getImplementationFactory(implementation, directory, packageName, projec
|
|
|
19
19
|
const [implementationModulePath, implementationExportName] = implementation.split('#');
|
|
20
20
|
return () => {
|
|
21
21
|
const modulePath = resolveImplementation(implementationModulePath, directory, packageName, projects);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
// Route .ts entrypoints through loadTsFile so the native-strip ->
|
|
23
|
+
// swc/ts-node fallback chain runs. Plain require() bypasses the matcher
|
|
24
|
+
// set and bubbles errors like extensionless `./schema` imports (strict
|
|
25
|
+
// ESM resolution failures) straight to the CLI. JS entrypoints use
|
|
26
|
+
// requireWithTsconfigFallback so workspace-alias imports still resolve.
|
|
27
|
+
const module = /\.[cm]?ts$/.test(modulePath)
|
|
28
|
+
? (0, register_1.loadTsFile)(modulePath)
|
|
29
|
+
: (0, register_1.requireWithTsconfigFallback)(modulePath);
|
|
26
30
|
return implementationExportName
|
|
27
31
|
? module[implementationExportName]
|
|
28
32
|
: (module.default ?? module);
|