@nx/webpack 23.2.0-beta.4 → 23.2.0-beta.6

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.
@@ -1,5 +1,4 @@
1
- import { type Tree } from '@nx/devkit';
2
- import { logger as devkitLogger } from 'nx/src/devkit-exports';
1
+ import { type Tree, logger as devkitLogger } from '@nx/devkit';
3
2
  interface Schema {
4
3
  project?: string;
5
4
  skipFormat?: boolean;
@@ -8,7 +8,6 @@ const tsquery_1 = require("@phenomnomnominal/tsquery");
8
8
  const plugin_1 = require("../../plugins/plugin");
9
9
  const versions_1 = require("../../utils/versions");
10
10
  const utils_1 = require("./utils");
11
- const devkit_exports_1 = require("nx/src/devkit-exports");
12
11
  async function convertToInferred(tree, options) {
13
12
  (0, versions_1.assertSupportedWebpackVersion)(tree);
14
13
  const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
@@ -90,12 +89,12 @@ function createCollectingLogger() {
90
89
  loggedMessages.forEach((messages, method) => {
91
90
  messages.forEach((message) => {
92
91
  if (!filter || filter(message)) {
93
- devkit_exports_1.logger[method](message);
92
+ devkit_1.logger[method](message);
94
93
  }
95
94
  });
96
95
  });
97
96
  };
98
- return new Proxy({ ...devkit_exports_1.logger, loggedMessages, flushLogs }, {
97
+ return new Proxy({ ...devkit_1.logger, loggedMessages, flushLogs }, {
99
98
  get(target, property) {
100
99
  const originalMethod = target[property];
101
100
  if (typeof originalMethod === 'function') {
@@ -6,8 +6,6 @@ const devkit_1 = require("@nx/devkit");
6
6
  const js_1 = require("@nx/js");
7
7
  const internal_2 = require("@nx/js/internal");
8
8
  const fs_1 = require("fs");
9
- const file_hasher_1 = require("nx/src/hasher/file-hasher");
10
- const cache_directory_1 = require("nx/src/utils/cache-directory");
11
9
  const path_1 = require("path");
12
10
  const read_webpack_options_1 = require("../utils/webpack/read-webpack-options");
13
11
  const resolve_user_defined_webpack_config_1 = require("../utils/webpack/resolve-user-defined-webpack-config");
@@ -22,8 +20,8 @@ const webpackConfigGlob = '**/webpack.config.{js,ts,mjs,cjs}';
22
20
  exports.createNodes = [
23
21
  webpackConfigGlob,
24
22
  async (configFilePaths, options, context) => {
25
- const optionsHash = (0, file_hasher_1.hashObject)(options);
26
- const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `webpack-${optionsHash}.hash`);
23
+ const optionsHash = (0, internal_1.hashObject)(options);
24
+ const cachePath = (0, path_1.join)(internal_1.workspaceDataDirectory, `webpack-${optionsHash}.hash`);
27
25
  const targetsCache = new internal_1.PluginCache(cachePath);
28
26
  const normalizedOptions = normalizeOptions(options);
29
27
  const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)();
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLegacyNxPlugin = useLegacyNxPlugin;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const normalize_options_1 = require("../nx-webpack-plugin/lib/normalize-options");
6
- const configuration_1 = require("nx/src/config/configuration");
6
+ const internal_1 = require("@nx/devkit/internal");
7
7
  /**
8
8
  * This function is used to wrap the legacy plugin function to be used with the `composePlugins` function.
9
9
  * Initially the webpack config would be passed to the legacy plugin function and the options would be passed as a second argument.
@@ -44,7 +44,7 @@ async function useLegacyNxPlugin(fn, executorOptions) {
44
44
  root: devkit_1.workspaceRoot,
45
45
  projectGraph,
46
46
  projectsConfigurations: (0, devkit_1.readProjectsConfigurationFromProjectGraph)(projectGraph),
47
- nxJsonConfiguration: (0, configuration_1.readNxJson)(devkit_1.workspaceRoot),
47
+ nxJsonConfiguration: (0, internal_1.readNxJsonFromDisk)(devkit_1.workspaceRoot),
48
48
  target: project.data.targets[targetName],
49
49
  targetName: targetName,
50
50
  projectName: projectName,
@@ -2,9 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WebpackNxBuildCoordinationPlugin = void 0;
4
4
  const child_process_1 = require("child_process");
5
- const client_1 = require("nx/src/daemon/client/client");
6
- const watch_1 = require("nx/src/command-line/watch/watch");
7
- const output_1 = require("nx/src/utils/output");
5
+ const internal_1 = require("@nx/devkit/internal");
6
+ const devkit_1 = require("@nx/devkit");
8
7
  class WebpackNxBuildCoordinationPlugin {
9
8
  constructor(buildCmd, skipInitialBuildOrOptions) {
10
9
  this.buildCmd = buildCmd;
@@ -17,11 +16,11 @@ class WebpackNxBuildCoordinationPlugin {
17
16
  this.buildChangedProjects();
18
17
  }
19
18
  if (!options?.skipWatchingDeps) {
20
- if ((0, client_1.isDaemonEnabled)()) {
19
+ if ((0, devkit_1.isDaemonEnabled)()) {
21
20
  this.startWatchingBuildableLibs();
22
21
  }
23
22
  else {
24
- output_1.output.warn({
23
+ devkit_1.output.warn({
25
24
  title: 'Nx Daemon is not enabled. Buildable libs will not be rebuilt on file changes.',
26
25
  });
27
26
  }
@@ -70,8 +69,8 @@ class WebpackNxBuildCoordinationPlugin {
70
69
  }
71
70
  }
72
71
  createFileWatcher() {
73
- const runner = new watch_1.BatchFunctionRunner(() => this.buildChangedProjects());
74
- return client_1.daemonClient.registerFileWatcher({
72
+ const runner = new internal_1.BatchFunctionRunner(() => this.buildChangedProjects());
73
+ return internal_1.daemonClient.registerFileWatcher({
75
74
  watchProjects: 'all',
76
75
  }, (err, { changedProjects, changedFiles }) => {
77
76
  if (err === 'reconnecting') {
@@ -83,13 +82,13 @@ class WebpackNxBuildCoordinationPlugin {
83
82
  return;
84
83
  }
85
84
  else if (err === 'closed') {
86
- output_1.output.error({
85
+ devkit_1.output.error({
87
86
  title: 'Failed to reconnect to daemon after multiple attempts',
88
87
  });
89
88
  process.exit(1);
90
89
  }
91
90
  else if (err) {
92
- output_1.output.error({
91
+ devkit_1.output.error({
93
92
  title: `Watch error: ${err?.message ?? 'Unknown'}`,
94
93
  });
95
94
  }
@@ -6,8 +6,8 @@ exports.composePlugins = composePlugins;
6
6
  exports.composePluginsSync = composePluginsSync;
7
7
  const devkit_1 = require("@nx/devkit");
8
8
  const internal_1 = require("@nx/js/internal");
9
- const configuration_1 = require("nx/src/config/configuration");
10
9
  const deprecation_1 = require("./deprecation");
10
+ const internal_2 = require("@nx/devkit/internal");
11
11
  exports.nxWebpackComposablePlugin = 'nxWebpackComposablePlugin';
12
12
  function isNxWebpackComposablePlugin(a) {
13
13
  return a?.[exports.nxWebpackComposablePlugin] === true;
@@ -78,7 +78,7 @@ function ensureNxWebpackExecutionContext(ctx) {
78
78
  targetName,
79
79
  configurationName,
80
80
  projectsConfigurations: (0, devkit_1.readProjectsConfigurationFromProjectGraph)(projectGraph),
81
- nxJsonConfiguration: (0, configuration_1.readNxJson)(devkit_1.workspaceRoot),
81
+ nxJsonConfiguration: (0, internal_2.readNxJsonFromDisk)(devkit_1.workspaceRoot),
82
82
  cwd: process.cwd(),
83
83
  root: devkit_1.workspaceRoot,
84
84
  isVerbose: process.env['NX_VERBOSE_LOGGING'] === 'true',
@@ -6,7 +6,7 @@ exports.deleteOutputDir = deleteOutputDir;
6
6
  const tslib_1 = require("tslib");
7
7
  const path = tslib_1.__importStar(require("path"));
8
8
  const fs_1 = require("fs");
9
- const fileutils_1 = require("nx/src/utils/fileutils");
9
+ const internal_1 = require("@nx/devkit/internal");
10
10
  function findUp(names, from, stopOnNodeModules = false) {
11
11
  if (!Array.isArray(names)) {
12
12
  names = [names];
@@ -35,7 +35,7 @@ function findAllNodeModules(from, root) {
35
35
  let current = from;
36
36
  while (current && current !== root) {
37
37
  const potential = path.join(current, 'node_modules');
38
- if ((0, fileutils_1.directoryExists)(potential)) {
38
+ if ((0, internal_1.directoryExists)(potential)) {
39
39
  nodeModules.push(potential);
40
40
  }
41
41
  const next = path.dirname(current);
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.readWebpackOptions = readWebpackOptions;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const config_1 = require("../config");
6
- const devkit_internals_1 = require("nx/src/devkit-internals");
6
+ const internal_1 = require("@nx/devkit/internal");
7
7
  /**
8
8
  * Reads the webpack options from a give webpack configuration. The configuration can be:
9
9
  * 1. A standard config object
@@ -34,7 +34,7 @@ async function readWebpackOptions(webpackConfig) {
34
34
  isVerbose: false,
35
35
  projectsConfigurations: null,
36
36
  projectGraph: null,
37
- nxJsonConfiguration: (0, devkit_internals_1.readNxJsonFromDisk)(devkit_1.workspaceRoot),
37
+ nxJsonConfiguration: (0, internal_1.readNxJsonFromDisk)(devkit_1.workspaceRoot),
38
38
  },
39
39
  });
40
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/webpack",
3
- "version": "23.2.0-beta.4",
3
+ "version": "23.2.0-beta.6",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -86,7 +86,7 @@
86
86
  }
87
87
  },
88
88
  "dependencies": {
89
- "@babel/core": "^7.23.2",
89
+ "@babel/core": "^7.29.6",
90
90
  "@phenomnomnominal/tsquery": "~6.2.0",
91
91
  "ajv": "^8.0.0",
92
92
  "autoprefixer": "^10.4.9",
@@ -97,7 +97,7 @@
97
97
  "css-loader": "^6.4.0",
98
98
  "css-minimizer-webpack-plugin": "^8.0.0",
99
99
  "fork-ts-checker-webpack-plugin": "9.1.0",
100
- "less": ">=4.1.3 <4.6.0",
100
+ "less": ">=4.1.3 <4.9.0",
101
101
  "less-loader": "^12.2.0",
102
102
  "license-webpack-plugin": "^4.0.2",
103
103
  "loader-utils": "^2.0.3",
@@ -118,8 +118,8 @@
118
118
  "tslib": "^2.3.0",
119
119
  "webpack-node-externals": "^3.0.0",
120
120
  "webpack-subresource-integrity": "^5.1.0",
121
- "@nx/devkit": "23.2.0-beta.4",
122
- "@nx/js": "23.2.0-beta.4"
121
+ "@nx/js": "23.2.0-beta.6",
122
+ "@nx/devkit": "23.2.0-beta.6"
123
123
  },
124
124
  "peerDependencies": {
125
125
  "webpack": "^5.0.0",
@@ -138,7 +138,7 @@
138
138
  }
139
139
  },
140
140
  "devDependencies": {
141
- "nx": "23.2.0-beta.4"
141
+ "nx": "23.2.0-beta.6"
142
142
  },
143
143
  "publishConfig": {
144
144
  "access": "public"