@nx/js 23.1.1 → 23.1.2
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/internal.d.ts +3 -3
- package/dist/internal.js +12 -15
- package/dist/src/executors/copy-workspace-modules/copy-workspace-modules.js +4 -6
- package/dist/src/executors/node/lib/output-file.js +4 -4
- package/dist/src/executors/node/node.impl.js +9 -10
- package/dist/src/executors/prune-lockfile/prune-lockfile.d.ts +1 -1
- package/dist/src/executors/prune-lockfile/prune-lockfile.js +4 -9
- package/dist/src/executors/tsc/lib/batch/watch.js +3 -3
- package/dist/src/executors/tsc/tsc.batch-impl.d.ts +1 -1
- package/dist/src/executors/tsc/tsc.batch-impl.js +2 -2
- package/dist/src/executors/verdaccio/verdaccio.impl.js +1 -2
- package/dist/src/generators/library/utils/add-release-config.js +2 -2
- package/dist/src/generators/setup-build/generator.js +1 -2
- package/dist/src/generators/typescript-sync/typescript-sync.d.ts +1 -1
- package/dist/src/generators/typescript-sync/typescript-sync.js +2 -2
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +5 -7
- package/dist/src/plugins/typescript/plugin.js +9 -14
- package/dist/src/plugins/typescript/util.d.ts +1 -1
- package/dist/src/release/utils/update-lock-file.js +5 -7
- package/dist/src/release/version-actions.d.ts +12 -3
- package/dist/src/release/version-actions.js +232 -74
- package/dist/src/utils/assets/copy-assets-handler.d.ts +1 -1
- package/dist/src/utils/assets/copy-assets-handler.js +2 -2
- package/dist/src/utils/buildable-libs-utils.js +10 -13
- package/dist/src/utils/find-npm-dependencies.js +7 -10
- package/dist/src/utils/generate-globs.js +11 -14
- package/dist/src/utils/get-main-file-dir.js +2 -2
- package/dist/src/utils/npm-config.d.ts +1 -1
- package/dist/src/utils/package-json/update-package-json.d.ts +1 -1
- package/dist/src/utils/package-json/update-package-json.js +6 -11
- package/dist/src/utils/package-manager-workspaces.js +2 -2
- package/dist/src/utils/typescript/create-ts-config.d.ts +1 -1
- package/dist/src/utils/typescript/create-ts-config.js +5 -5
- package/dist/src/utils/typescript/plugin.js +2 -2
- package/dist/src/utils/typescript/run-type-check.js +2 -2
- package/dist/src/utils/typescript/ts-solution-setup.d.ts +1 -1
- package/dist/src/utils/typescript/ts-solution-setup.js +3 -3
- package/dist/src/utils/watch-for-single-file-changes.js +2 -2
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExecutorContext, ProjectFileMap, ProjectGraphProjectNode } from '@nx/devkit';
|
|
2
2
|
import { DependentBuildableProjectNode } from '../buildable-libs-utils';
|
|
3
|
-
import type { PackageJson } from 'nx/
|
|
3
|
+
import type { PackageJson } from '@nx/devkit/internal';
|
|
4
4
|
export type SupportedFormat = 'cjs' | 'esm';
|
|
5
5
|
export interface UpdatePackageJsonOption {
|
|
6
6
|
rootDir?: string;
|
|
@@ -4,24 +4,19 @@ exports.updatePackageJson = updatePackageJson;
|
|
|
4
4
|
exports.getExports = getExports;
|
|
5
5
|
exports.getUpdatedPackageJsonContent = getUpdatedPackageJsonContent;
|
|
6
6
|
exports.getOutputDir = getOutputDir;
|
|
7
|
-
|
|
8
|
-
const lock_file_1 = require("nx/src/plugins/js/lock-file/lock-file");
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
10
|
-
const create_package_json_1 = require("nx/src/plugins/js/package-json/create-package-json");
|
|
7
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
11
8
|
const devkit_1 = require("@nx/devkit");
|
|
12
9
|
const node_fs_1 = require("node:fs");
|
|
13
10
|
const path_1 = require("path");
|
|
14
|
-
const fileutils_1 = require("nx/src/utils/fileutils");
|
|
15
|
-
const nx_deps_cache_1 = require("nx/src/project-graph/nx-deps-cache");
|
|
16
11
|
const get_main_file_dir_1 = require("../get-main-file-dir");
|
|
17
12
|
const strip_glob_to_base_dir_1 = require("../strip-glob-to-base-dir");
|
|
18
13
|
function updatePackageJson(options, context, target, dependencies, fileMap = null) {
|
|
19
14
|
let packageJson;
|
|
20
15
|
if (fileMap == null) {
|
|
21
|
-
fileMap = (0,
|
|
16
|
+
fileMap = (0, internal_1.readFileMapCache)()?.fileMap?.projectFileMap || {};
|
|
22
17
|
}
|
|
23
18
|
if (options.updateBuildableProjectDepsInPackageJson) {
|
|
24
|
-
packageJson = (0,
|
|
19
|
+
packageJson = (0, internal_1.createPackageJson)(context.projectName, context.projectGraph, {
|
|
25
20
|
target: context.targetName,
|
|
26
21
|
root: context.root,
|
|
27
22
|
// By default we remove devDependencies since this is a production build.
|
|
@@ -34,7 +29,7 @@ function updatePackageJson(options, context, target, dependencies, fileMap = nul
|
|
|
34
29
|
}
|
|
35
30
|
else {
|
|
36
31
|
const pathToPackageJson = (0, path_1.join)(context.root, options.projectRoot, 'package.json');
|
|
37
|
-
packageJson = (0,
|
|
32
|
+
packageJson = (0, internal_1.fileExists)(pathToPackageJson)
|
|
38
33
|
? (0, devkit_1.readJsonFile)(pathToPackageJson)
|
|
39
34
|
: { name: context.projectName, version: '0.0.1' };
|
|
40
35
|
}
|
|
@@ -60,8 +55,8 @@ function updatePackageJson(options, context, target, dependencies, fileMap = nul
|
|
|
60
55
|
devkit_1.logger.warn(`Bun lockfile generation is unsupported. Remove "generateLockfile" option or set it to false.`);
|
|
61
56
|
}
|
|
62
57
|
else {
|
|
63
|
-
const lockFile = (0,
|
|
64
|
-
(0, node_fs_1.writeFileSync)(`${options.outputPath}/${(0,
|
|
58
|
+
const lockFile = (0, internal_1.createLockFile)(packageJson, context.projectGraph, packageManager);
|
|
59
|
+
(0, node_fs_1.writeFileSync)(`${options.outputPath}/${(0, internal_1.getLockFileName)(packageManager)}`, lockFile, {
|
|
65
60
|
encoding: 'utf-8',
|
|
66
61
|
});
|
|
67
62
|
}
|
|
@@ -8,8 +8,8 @@ exports.getProjectPackageManagerWorkspaceStateWarningTask = getProjectPackageMan
|
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
9
|
const picomatch = require("picomatch");
|
|
10
10
|
const posix_1 = require("node:path/posix");
|
|
11
|
-
const package_json_1 = require("nx/src/plugins/package-json");
|
|
12
11
|
const semver_1 = require("semver");
|
|
12
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
13
13
|
function getProjectPackageManagerWorkspaceState(tree, projectRoot) {
|
|
14
14
|
if (!isUsingPackageManagerWorkspaces(tree)) {
|
|
15
15
|
return 'no-workspaces';
|
|
@@ -19,7 +19,7 @@ function getProjectPackageManagerWorkspaceState(tree, projectRoot) {
|
|
|
19
19
|
return isIncluded ? 'included' : 'excluded';
|
|
20
20
|
}
|
|
21
21
|
function getPackageManagerWorkspacesPatterns(tree) {
|
|
22
|
-
return (0,
|
|
22
|
+
return (0, internal_1.getGlobPatternsFromPackageManagerWorkspaces)(tree.root, (path) => (0, devkit_1.readJson)(tree, path, { expectComments: true }), (path) => {
|
|
23
23
|
const content = tree.read(path, 'utf-8');
|
|
24
24
|
const { load } = require('@zkochan/js-yaml');
|
|
25
25
|
return load(content, { filename: path });
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.tsConfigBaseOptions = void 0;
|
|
4
4
|
exports.getTsConfigBaseOptions = getTsConfigBaseOptions;
|
|
5
5
|
exports.extractTsConfigBase = extractTsConfigBase;
|
|
6
|
-
const json_1 = require("nx/src/generators/utils/json");
|
|
7
6
|
const is_typescript_version_at_least_1 = require("../is-typescript-version-at-least");
|
|
7
|
+
const devkit_1 = require("@nx/devkit");
|
|
8
8
|
exports.tsConfigBaseOptions = {
|
|
9
9
|
rootDir: '.',
|
|
10
10
|
sourceMap: true,
|
|
@@ -32,7 +32,7 @@ function getTsConfigBaseOptions(tree) {
|
|
|
32
32
|
function extractTsConfigBase(host) {
|
|
33
33
|
if (host.exists('tsconfig.base.json'))
|
|
34
34
|
return;
|
|
35
|
-
const tsconfig = (0,
|
|
35
|
+
const tsconfig = (0, devkit_1.readJson)(host, 'tsconfig.json');
|
|
36
36
|
const baseCompilerOptions = {};
|
|
37
37
|
if (tsconfig.compilerOptions) {
|
|
38
38
|
for (let compilerOption of Object.keys(exports.tsConfigBaseOptions)) {
|
|
@@ -41,7 +41,7 @@ function extractTsConfigBase(host) {
|
|
|
41
41
|
delete tsconfig.compilerOptions[compilerOption];
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
(0,
|
|
44
|
+
(0, devkit_1.writeJson)(host, 'tsconfig.base.json', {
|
|
45
45
|
compileOnSave: false,
|
|
46
46
|
compilerOptions: baseCompilerOptions,
|
|
47
47
|
exclude: tsconfig.exclude,
|
|
@@ -49,10 +49,10 @@ function extractTsConfigBase(host) {
|
|
|
49
49
|
tsconfig.extends = './tsconfig.base.json';
|
|
50
50
|
delete tsconfig.compileOnSave;
|
|
51
51
|
delete tsconfig.exclude;
|
|
52
|
-
(0,
|
|
52
|
+
(0, devkit_1.writeJson)(host, 'tsconfig.json', tsconfig);
|
|
53
53
|
// special case for updating e2e tests.
|
|
54
54
|
if (host.exists('e2e/tsconfig.json')) {
|
|
55
|
-
(0,
|
|
55
|
+
(0, devkit_1.updateJson)(host, 'e2e/tsconfig.json', (json) => {
|
|
56
56
|
json.extends = '../tsconfig.base.json';
|
|
57
57
|
return json;
|
|
58
58
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ensureProjectIsIncludedInPluginRegistrations = ensureProjectIsIncludedInPluginRegistrations;
|
|
4
|
-
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
5
4
|
const picomatch = require("picomatch");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
function ensureProjectIsIncludedInPluginRegistrations(nxJson, projectRoot, buildTargetName) {
|
|
7
7
|
nxJson.plugins ??= [];
|
|
8
8
|
let isIncluded = false;
|
|
@@ -32,7 +32,7 @@ function ensureProjectIsIncludedInPluginRegistrations(nxJson, projectRoot, build
|
|
|
32
32
|
// before the registration's include/exclude filters are applied.
|
|
33
33
|
const tsconfigPath = `${projectRoot}/tsconfig.json`;
|
|
34
34
|
const matchingConfigFiles = picomatch('**/tsconfig.json', { dot: true })(tsconfigPath)
|
|
35
|
-
? (0,
|
|
35
|
+
? (0, internal_1.findMatchingConfigFiles)([tsconfigPath], registration.include, registration.exclude)
|
|
36
36
|
: [];
|
|
37
37
|
if (matchingConfigFiles.length) {
|
|
38
38
|
// it's included by the plugin registration, check if the user-specified options would result
|
|
@@ -6,9 +6,9 @@ exports.getFormattedDiagnostic = getFormattedDiagnostic;
|
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
8
|
const path = tslib_1.__importStar(require("path"));
|
|
9
|
-
const code_frames_1 = require("nx/src/utils/code-frames");
|
|
10
9
|
const highlight_1 = require("../code-frames/highlight");
|
|
11
10
|
const ts_config_1 = require("../../utils/typescript/ts-config");
|
|
11
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
12
12
|
async function runTypeCheckWatch(options, callback) {
|
|
13
13
|
const { ts, workspaceRoot, config, compilerOptions } = await setupTypeScript(options);
|
|
14
14
|
const host = ts.createWatchCompilerHost(config.fileNames, compilerOptions, ts.sys, ts.createEmitAndSemanticDiagnosticsBuilderProgram);
|
|
@@ -133,7 +133,7 @@ function getFormattedDiagnostic(ts, workspaceRoot, diagnostic) {
|
|
|
133
133
|
const code = diagnostic.file.getFullText(diagnostic.file.getSourceFile());
|
|
134
134
|
message +=
|
|
135
135
|
'\n' +
|
|
136
|
-
(0,
|
|
136
|
+
(0, internal_1.codeFrameColumns)(code, {
|
|
137
137
|
start: { line: line, column },
|
|
138
138
|
}, { highlight: highlight_1.highlight });
|
|
139
139
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ProjectConfiguration, type Tree } from '@nx/devkit';
|
|
2
|
-
import type { JsonInput } from 'nx/
|
|
2
|
+
import type { JsonInput } from '@nx/devkit/internal';
|
|
3
3
|
export declare const TS_SOLUTION_SETUP_TSCONFIG_INPUT: JsonInput;
|
|
4
4
|
export declare function isUsingTypeScriptPlugin(tree: Tree): boolean;
|
|
5
5
|
export declare function shouldConfigureTsSolutionSetup(tree: Tree, addPlugins: boolean, addTsPlugin?: boolean): boolean;
|
|
@@ -15,7 +15,7 @@ exports.getDefinedCustomConditionName = getDefinedCustomConditionName;
|
|
|
15
15
|
const devkit_1 = require("@nx/devkit");
|
|
16
16
|
const node_fs_1 = require("node:fs");
|
|
17
17
|
const posix_1 = require("node:path/posix");
|
|
18
|
-
const
|
|
18
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
19
19
|
const package_manager_workspaces_1 = require("../package-manager-workspaces");
|
|
20
20
|
const configuration_1 = require("./configuration");
|
|
21
21
|
exports.TS_SOLUTION_SETUP_TSCONFIG_INPUT = {
|
|
@@ -48,7 +48,7 @@ function shouldConfigureTsSolutionSetup(tree, addPlugins, addTsPlugin) {
|
|
|
48
48
|
return !tree.exists('tsconfig.base.json') && !tree.exists('tsconfig.json');
|
|
49
49
|
}
|
|
50
50
|
function isUsingTsSolutionSetup(tree) {
|
|
51
|
-
tree ??= new
|
|
51
|
+
tree ??= new internal_1.FsTree(devkit_1.workspaceRoot, false);
|
|
52
52
|
return ((0, package_manager_workspaces_1.isUsingPackageManagerWorkspaces)(tree) &&
|
|
53
53
|
isWorkspaceSetupWithTsSolution(tree));
|
|
54
54
|
}
|
|
@@ -113,7 +113,7 @@ function assertNotUsingTsSolutionSetup(tree, pluginName, generatorName) {
|
|
|
113
113
|
throw new Error(`The ${artifactString} doesn't yet support the existing TypeScript setup. See the error above.`);
|
|
114
114
|
}
|
|
115
115
|
function findRuntimeTsConfigName(projectRoot, tree) {
|
|
116
|
-
tree ??= new
|
|
116
|
+
tree ??= new internal_1.FsTree(devkit_1.workspaceRoot, false);
|
|
117
117
|
if (tree.exists((0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.app.json')))
|
|
118
118
|
return 'tsconfig.app.json';
|
|
119
119
|
if (tree.exists((0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.lib.json')))
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.watchForSingleFileChanges = watchForSingleFileChanges;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const client_1 = require("nx/src/daemon/client/client");
|
|
6
5
|
const path_1 = require("path");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
async function watchForSingleFileChanges(projectName, projectRoot, relativeFilePath, callback) {
|
|
8
|
-
const unregisterFileWatcher = await
|
|
8
|
+
const unregisterFileWatcher = await internal_1.daemonClient.registerFileWatcher({ watchProjects: [projectName] }, (err, data) => {
|
|
9
9
|
if (err === 'reconnecting') {
|
|
10
10
|
// Silent - daemon restarts automatically on lockfile changes
|
|
11
11
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "23.1.
|
|
3
|
+
"version": "23.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
"dependencies": {
|
|
123
|
-
"@babel/core": "^7.
|
|
123
|
+
"@babel/core": "^7.29.6",
|
|
124
124
|
"@babel/plugin-proposal-decorators": "^7.22.7",
|
|
125
125
|
"@babel/plugin-transform-class-properties": "^7.22.5",
|
|
126
126
|
"@babel/plugin-transform-class-static-block": "^7.22.5",
|
|
@@ -147,11 +147,11 @@
|
|
|
147
147
|
"source-map-support": "0.5.19",
|
|
148
148
|
"tinyglobby": "^0.2.12",
|
|
149
149
|
"tslib": "^2.3.0",
|
|
150
|
-
"@nx/devkit": "23.1.
|
|
151
|
-
"@nx/workspace": "23.1.
|
|
150
|
+
"@nx/devkit": "23.1.2",
|
|
151
|
+
"@nx/workspace": "23.1.2"
|
|
152
152
|
},
|
|
153
153
|
"devDependencies": {
|
|
154
|
-
"nx": "23.1.
|
|
154
|
+
"nx": "23.1.2"
|
|
155
155
|
},
|
|
156
156
|
"peerDependencies": {
|
|
157
157
|
"@swc/cli": ">=0.6.0 <0.9.0",
|