@nx/js 19.8.2 → 19.8.4

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": "19.8.2",
3
+ "version": "19.8.4",
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": "19.8.2",
43
- "@nx/workspace": "19.8.2",
42
+ "@nx/devkit": "19.8.4",
43
+ "@nx/workspace": "19.8.4",
44
44
  "babel-plugin-const-enum": "^1.0.1",
45
45
  "babel-plugin-macros": "^2.8.0",
46
46
  "babel-plugin-transform-typescript-metadata": "^0.3.1",
@@ -61,7 +61,7 @@
61
61
  "ts-node": "10.9.1",
62
62
  "tsconfig-paths": "^4.1.2",
63
63
  "tslib": "^2.3.0",
64
- "@nrwl/js": "19.8.2"
64
+ "@nrwl/js": "19.8.4"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "verdaccio": "^5.0.4"
@@ -19,7 +19,7 @@ packages:
19
19
  proxy: npmjs
20
20
 
21
21
  # log settings
22
- logs:
22
+ log:
23
23
  type: stdout
24
24
  format: pretty
25
25
  level: warn
@@ -1,4 +1,4 @@
1
1
  import { type Tree } from '@nx/devkit';
2
- import type { SyncGeneratorResult } from 'nx/src/utils/sync-generators';
2
+ import { type SyncGeneratorResult } from 'nx/src/utils/sync-generators';
3
3
  export declare function syncGenerator(tree: Tree): Promise<SyncGeneratorResult>;
4
4
  export default syncGenerator;
@@ -5,6 +5,7 @@ const devkit_1 = require("@nx/devkit");
5
5
  const ignore_1 = require("ignore");
6
6
  const jsonc_parser_1 = require("jsonc-parser");
7
7
  const posix_1 = require("node:path/posix");
8
+ const sync_generators_1 = require("nx/src/utils/sync-generators");
8
9
  const ts = require("typescript");
9
10
  const plugin_1 = require("../../plugins/typescript/plugin");
10
11
  const COMMON_RUNTIME_TS_CONFIG_FILE_NAMES = [
@@ -25,12 +26,16 @@ async function syncGenerator(tree) {
25
26
  return p.plugin === plugin_1.PLUGIN_NAME;
26
27
  });
27
28
  if (!tscPluginConfig) {
28
- throw new Error(`The ${plugin_1.PLUGIN_NAME} plugin must be added to the "plugins" array in nx.json before syncing tsconfigs`);
29
+ throw new sync_generators_1.SyncError(`The "${plugin_1.PLUGIN_NAME}" plugin is not registered`, [
30
+ `The "${plugin_1.PLUGIN_NAME}" plugin must be added to the "plugins" array in "nx.json" in order to sync the project graph information to the TypeScript configuration files.`,
31
+ ]);
29
32
  }
30
33
  // Root tsconfig containing project references for the whole workspace
31
34
  const rootTsconfigPath = 'tsconfig.json';
32
35
  if (!tree.exists(rootTsconfigPath)) {
33
- throw new Error(`A "tsconfig.json" file must exist in the workspace root in order to use this sync generator.`);
36
+ throw new sync_generators_1.SyncError('Missing root "tsconfig.json"', [
37
+ `A "tsconfig.json" file must exist in the workspace root in order to sync the project graph information to the TypeScript configuration files.`,
38
+ ]);
34
39
  }
35
40
  const rawTsconfigContentsCache = new Map();
36
41
  const stringifiedRootJsonContents = readRawTsconfigContents(tree, rawTsconfigContentsCache, rootTsconfigPath);
@@ -128,7 +133,7 @@ async function syncGenerator(tree) {
128
133
  if (hasChanges) {
129
134
  await (0, devkit_1.formatFiles)(tree);
130
135
  return {
131
- outOfSyncMessage: 'Based on the workspace project graph, some TypeScript configuration files are missing project references to the projects they depend on.',
136
+ outOfSyncMessage: 'Based on the workspace project graph, some TypeScript configuration files are missing project references to the projects they depend on or contain outdated project references.',
132
137
  };
133
138
  }
134
139
  }