@nx/rollup 23.2.0-beta.0 → 23.2.0-beta.10

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.
@@ -6,7 +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 posix_1 = require("node:path/posix");
9
- const devkit_internals_1 = require("nx/src/devkit-internals");
10
9
  const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
11
10
  const has_plugin_1 = require("../../utils/has-plugin");
12
11
  const deprecation_1 = require("../../utils/deprecation");
@@ -119,7 +118,7 @@ function updatePackageJson(tree, options, outputConfig, isTsSolutionSetup) {
119
118
  // target must exist if we don't receive an outputConfig
120
119
  const projectTarget = project.targets[options.buildTarget];
121
120
  const nxJson = (0, devkit_1.readNxJson)(tree);
122
- const mergedTarget = (0, devkit_internals_1.mergeTargetConfigurations)(projectTarget, (0, internal_1.readTargetDefaultsForTarget)(options.buildTarget, nxJson.targetDefaults, projectTarget.executor));
121
+ const mergedTarget = (0, internal_1.mergeTargetConfigurations)(projectTarget, (0, internal_1.readTargetDefaultsForTarget)(options.buildTarget, nxJson.targetDefaults, projectTarget.executor));
123
122
  ({ main, outputPath } = mergedTarget.options);
124
123
  }
125
124
  packageJson = (0, js_1.getUpdatedPackageJsonContent)(packageJson, {
@@ -209,11 +208,7 @@ function updateTsConfig(tree, options) {
209
208
  if (!ts) {
210
209
  ts = (0, internal_2.ensureTypescript)();
211
210
  }
212
- const parsedTsConfig = (0, js_1.readTsConfig)(tsconfigPath, {
213
- ...ts.sys,
214
- readFile: (p) => tree.read(p, 'utf-8'),
215
- fileExists: (p) => tree.exists(p),
216
- });
211
+ const parsedTsConfig = (0, js_1.readTsConfig)(tsconfigPath, (0, internal_2.createTreeParseConfigHost)(tree));
217
212
  (0, devkit_1.updateJson)(tree, tsconfigPath, (json) => {
218
213
  if (parsedTsConfig.options.module === ts.ModuleKind.NodeNext) {
219
214
  json.compilerOptions ??= {};
@@ -1,5 +1,5 @@
1
1
  import type { Plugin } from 'rollup';
2
- import type { PackageJson } from 'nx/src/utils/package-json';
2
+ import { type PackageJson } from '@nx/devkit/internal';
3
3
  export interface GeneratePackageJsonOptions {
4
4
  outputPath: string;
5
5
  main: string;
@@ -1,4 +1,4 @@
1
- import { PackageJson } from 'nx/src/utils/package-json';
1
+ import { PackageJson } from '@nx/devkit/internal';
2
2
  export declare function updatePackageJson(options: {
3
3
  outputPath: string;
4
4
  main: string;
@@ -2,9 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updatePackageJson = updatePackageJson;
4
4
  const path_1 = require("path");
5
- const fileutils_1 = require("nx/src/utils/fileutils");
6
- const fs_1 = require("fs");
7
5
  const devkit_1 = require("@nx/devkit");
6
+ const fs_1 = require("fs");
8
7
  function updatePackageJson(options, packageJson) {
9
8
  const jsFileRegex = /(\.cjs|\.mjs|\.esm\.js|\.cjs\.js|\.mjs\.js|\.js)$/;
10
9
  const hasEsmFormat = options.format.includes('esm');
@@ -83,7 +82,7 @@ function updatePackageJson(options, packageJson) {
83
82
  else {
84
83
  packageJson.types ??= packageJson.main.replace(jsFileRegex, '.d.ts');
85
84
  }
86
- (0, fileutils_1.writeJsonFile)((0, path_1.join)(devkit_1.workspaceRoot, options.outputPath, 'package.json'), packageJson);
85
+ (0, devkit_1.writeJsonFile)((0, path_1.join)(devkit_1.workspaceRoot, options.outputPath, 'package.json'), packageJson);
87
86
  }
88
87
  function getExports(options) {
89
88
  const exports = {};
@@ -2,12 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createNodesV2 = exports.createNodes = exports.createDependencies = void 0;
4
4
  const internal_1 = require("@nx/devkit/internal");
5
- const cache_directory_1 = require("nx/src/utils/cache-directory");
6
5
  const path_1 = require("path");
7
6
  const fs_1 = require("fs");
8
7
  const devkit_1 = require("@nx/devkit");
9
8
  const js_1 = require("@nx/js");
10
- const file_hasher_1 = require("nx/src/hasher/file-hasher");
11
9
  const internal_2 = require("@nx/js/internal");
12
10
  /**
13
11
  * @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
@@ -21,8 +19,8 @@ exports.createNodes = [
21
19
  rollupConfigGlob,
22
20
  async (configFilePaths, options, context) => {
23
21
  const normalizedOptions = normalizeOptions(options);
24
- const optionsHash = (0, file_hasher_1.hashObject)(normalizedOptions);
25
- const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `rollup-${optionsHash}.hash`);
22
+ const optionsHash = (0, internal_1.hashObject)(normalizedOptions);
23
+ const cachePath = (0, path_1.join)(internal_1.workspaceDataDirectory, `rollup-${optionsHash}.hash`);
26
24
  const targetsCache = new internal_1.PluginCache(cachePath);
27
25
  const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)();
28
26
  const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
@@ -2,14 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ensureDependencies = ensureDependencies;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const internal_1 = require("@nx/js/internal");
5
+ const internal_1 = require("@nx/devkit/internal");
6
+ const internal_2 = require("@nx/js/internal");
6
7
  const versions_1 = require("./versions");
7
8
  function ensureDependencies(tree, options) {
8
9
  switch (options.compiler) {
9
10
  case 'swc':
11
+ // @swc/core's postinstall only installs a wasm fallback for platforms not
12
+ // covered by its prebuilt optional dependencies, so skip it.
13
+ (0, internal_1.acknowledgeBuildScripts)(tree, (0, devkit_1.detectPackageManager)(tree.root), {
14
+ '@swc/core': false,
15
+ });
10
16
  return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
11
- '@swc/helpers': internal_1.swcHelpersVersion,
12
- '@swc/core': internal_1.swcCoreVersion,
17
+ '@swc/helpers': internal_2.swcHelpersVersion,
18
+ '@swc/core': internal_2.swcCoreVersion,
13
19
  'swc-loader': versions_1.swcLoaderVersion,
14
20
  }, undefined, true);
15
21
  case 'babel':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/rollup",
3
- "version": "23.2.0-beta.0",
3
+ "version": "23.2.0-beta.10",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -91,8 +91,8 @@
91
91
  "postcss": "^8.4.38",
92
92
  "postcss-modules": "^6.0.1",
93
93
  "tslib": "^2.3.0",
94
- "@nx/devkit": "23.2.0-beta.0",
95
- "@nx/js": "23.2.0-beta.0"
94
+ "@nx/devkit": "23.2.0-beta.10",
95
+ "@nx/js": "23.2.0-beta.10"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "rollup": "^3.0.0 || ^4.0.0"
@@ -104,7 +104,7 @@
104
104
  },
105
105
  "devDependencies": {
106
106
  "source-map-js": "^1.2.0",
107
- "nx": "23.2.0-beta.0"
107
+ "nx": "23.2.0-beta.10"
108
108
  },
109
109
  "publishConfig": {
110
110
  "access": "public"