@nx/js 22.0.0-canary.20251006-738b06b → 22.0.0-canary.20251008-05ab516

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": "22.0.0-canary.20251006-738b06b",
3
+ "version": "22.0.0-canary.20251008-05ab516",
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": {
@@ -39,8 +39,8 @@
39
39
  "@babel/preset-env": "^7.23.2",
40
40
  "@babel/preset-typescript": "^7.22.5",
41
41
  "@babel/runtime": "^7.22.6",
42
- "@nx/devkit": "22.0.0-canary.20251006-738b06b",
43
- "@nx/workspace": "22.0.0-canary.20251006-738b06b",
42
+ "@nx/devkit": "22.0.0-canary.20251008-05ab516",
43
+ "@nx/workspace": "22.0.0-canary.20251008-05ab516",
44
44
  "@zkochan/js-yaml": "0.0.7",
45
45
  "babel-plugin-const-enum": "^1.0.1",
46
46
  "babel-plugin-macros": "^3.1.0",
@@ -60,7 +60,7 @@
60
60
  "tslib": "^2.3.0"
61
61
  },
62
62
  "devDependencies": {
63
- "nx": "22.0.0-canary.20251006-738b06b"
63
+ "nx": "22.0.0-canary.20251008-05ab516"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "verdaccio": "^6.0.5"
@@ -1,4 +1,4 @@
1
- import { type CreateDependencies, type CreateNodes, type CreateNodesV2 } from '@nx/devkit';
1
+ import { type CreateDependencies, type CreateNodesV2 } from '@nx/devkit';
2
2
  export interface TscPluginOptions {
3
3
  typecheck?: boolean | {
4
4
  targetName?: string;
@@ -18,5 +18,5 @@ export interface TscPluginOptions {
18
18
  export declare const createDependencies: CreateDependencies;
19
19
  export declare const PLUGIN_NAME = "@nx/js/typescript";
20
20
  export declare const createNodesV2: CreateNodesV2<TscPluginOptions>;
21
- export declare const createNodes: CreateNodes<TscPluginOptions>;
21
+ export declare const createNodes: CreateNodesV2<TscPluginOptions>;
22
22
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/plugins/typescript/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAGhB,KAAK,aAAa,EAInB,MAAM,YAAY,CAAC;AAiCpB,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EACN,OAAO,GACP;QACE,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACN,KAAK,CAAC,EACF,OAAO,GACP;QACE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;IACN,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAyFD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAI/C,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,gBAAgB,CA4DzD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,gBAAgB,CAsCrD,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/plugins/typescript/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAInB,MAAM,YAAY,CAAC;AAiCpB,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EACN,OAAO,GACP;QACE,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACN,KAAK,CAAC,EACF,OAAO,GACP;QACE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;IACN,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAyFD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAI/C,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,gBAAgB,CA6DzD,CAAC;AAEF,eAAO,MAAM,WAAW,iCAAgB,CAAC"}
@@ -83,7 +83,7 @@ exports.createNodesV2 = [
83
83
  const projectRoot = projectRoots[idx];
84
84
  const hash = hashes[idx];
85
85
  const cacheKey = `${hash}_${configFilePath}`;
86
- targetsCache[cacheKey] ??= buildTscTargets((0, node_path_1.join)(context.workspaceRoot, configFilePath), projectRoot, options, context);
86
+ targetsCache[cacheKey] ??= buildTscTargets((0, node_path_1.join)(context.workspaceRoot, configFilePath), projectRoot, options, context, validConfigFilePaths);
87
87
  const { targets } = targetsCache[cacheKey];
88
88
  return {
89
89
  projects: {
@@ -100,29 +100,7 @@ exports.createNodesV2 = [
100
100
  }
101
101
  },
102
102
  ];
103
- exports.createNodes = [
104
- tsConfigGlob,
105
- async (configFilePath, options, context) => {
106
- devkit_1.logger.warn('`createNodes` is deprecated. Update your plugin to utilize createNodesV2 instead. In Nx 20, this will change to the createNodesV2 API.');
107
- const projectRoot = (0, node_path_1.dirname)(configFilePath);
108
- if (!checkIfConfigFileShouldBeProject(configFilePath, projectRoot, context)) {
109
- return {};
110
- }
111
- const normalizedOptions = normalizePluginOptions(options);
112
- cache = { fileHashes: {}, rawFiles: {}, isExternalProjectReference: {} };
113
- initializeTsConfigCache([configFilePath], context.workspaceRoot);
114
- const { targets } = buildTscTargets((0, node_path_1.join)(context.workspaceRoot, configFilePath), projectRoot, normalizedOptions, context);
115
- writeTsConfigCache(toRelativePaths(tsConfigCacheData, context.workspaceRoot));
116
- return {
117
- projects: {
118
- [projectRoot]: {
119
- projectType: 'library',
120
- targets,
121
- },
122
- },
123
- };
124
- },
125
- ];
103
+ exports.createNodes = exports.createNodesV2;
126
104
  async function resolveValidConfigFilesAndHashes(configFilePaths, optionsHash, context) {
127
105
  const lockFileHash = (0, file_hasher_1.hashFile)((0, node_path_1.join)(context.workspaceRoot, (0, lock_file_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot)))) ?? '';
128
106
  const validConfigFilePaths = [];
@@ -201,7 +179,7 @@ function checkIfConfigFileShouldBeProject(configFilePath, projectRoot, context)
201
179
  }
202
180
  return true;
203
181
  }
204
- function buildTscTargets(configFilePath, projectRoot, options, context) {
182
+ function buildTscTargets(configFilePath, projectRoot, options, context, configFiles) {
205
183
  const targets = {};
206
184
  const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
207
185
  const tsConfig = retrieveTsConfigFromCache(configFilePath, context.workspaceRoot);
@@ -229,7 +207,7 @@ function buildTscTargets(configFilePath, projectRoot, options, context) {
229
207
  else if (options.build) {
230
208
  // check if the project will have a build target
231
209
  const buildConfigPath = (0, devkit_1.joinPathFragments)(projectRoot, options.build.configName);
232
- if (context.configFiles.some((f) => f === buildConfigPath) &&
210
+ if (configFiles.some((f) => f === buildConfigPath) &&
233
211
  (options.build.skipBuildCheck ||
234
212
  (0, util_1.isValidPackageJsonBuildConfig)(retrieveTsConfigFromCache(buildConfigPath, context.workspaceRoot), context.workspaceRoot, projectRoot))) {
235
213
  dependsOn.unshift(options.build.targetName);