@nx/rollup 23.2.0-beta.4 → 23.2.0-beta.5
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/src/generators/configuration/configuration.js +1 -2
- package/dist/src/plugins/package-json/generate-package-json.d.ts +1 -1
- package/dist/src/plugins/package-json/update-package-json.d.ts +1 -1
- package/dist/src/plugins/package-json/update-package-json.js +6 -6
- package/dist/src/plugins/plugin.js +2 -4
- package/package.json +4 -4
|
@@ -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,
|
|
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, {
|
|
@@ -2,9 +2,9 @@
|
|
|
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");
|
|
7
|
+
const devkit_2 = require("@nx/devkit");
|
|
8
8
|
function updatePackageJson(options, packageJson) {
|
|
9
9
|
const jsFileRegex = /(\.cjs|\.mjs|\.esm\.js|\.cjs\.js|\.mjs\.js|\.js)$/;
|
|
10
10
|
const hasEsmFormat = options.format.includes('esm');
|
|
@@ -63,10 +63,10 @@ function updatePackageJson(options, packageJson) {
|
|
|
63
63
|
// Make sure both ESM and CJS point to same instance of the package because libs like React, RxJS, etc. requires it.
|
|
64
64
|
// Also need a special .cjs.default.js file that re-exports the `default` from CJS, or else
|
|
65
65
|
// default import in Node will not work.
|
|
66
|
-
(0, fs_1.writeFileSync)((0, path_1.join)(
|
|
67
|
-
(0, fs_1.writeFileSync)((0, path_1.join)(
|
|
66
|
+
(0, fs_1.writeFileSync)((0, path_1.join)(devkit_2.workspaceRoot, options.outputPath, filePath.replace(/\.cjs\.js$/, '.cjs.default.js')), `exports._default = require('./${(0, path_1.parse)(filePath).base}').default;`);
|
|
67
|
+
(0, fs_1.writeFileSync)((0, path_1.join)(devkit_2.workspaceRoot, options.outputPath, fauxEsmFilePath),
|
|
68
68
|
// Re-export from relative CJS file, and Node will synthetically export it as ESM.
|
|
69
|
-
(0,
|
|
69
|
+
(0, devkit_2.stripIndents) `
|
|
70
70
|
export * from './${relativeFile}';
|
|
71
71
|
export { _default as default } from './${relativeFile.replace(/\.cjs\.js$/, '.cjs.default.js')}';
|
|
72
72
|
`);
|
|
@@ -83,7 +83,7 @@ function updatePackageJson(options, packageJson) {
|
|
|
83
83
|
else {
|
|
84
84
|
packageJson.types ??= packageJson.main.replace(jsFileRegex, '.d.ts');
|
|
85
85
|
}
|
|
86
|
-
(0,
|
|
86
|
+
(0, devkit_1.writeJsonFile)((0, path_1.join)(devkit_2.workspaceRoot, options.outputPath, 'package.json'), packageJson);
|
|
87
87
|
}
|
|
88
88
|
function getExports(options) {
|
|
89
89
|
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,
|
|
25
|
-
const cachePath = (0, path_1.join)(
|
|
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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/rollup",
|
|
3
|
-
"version": "23.2.0-beta.
|
|
3
|
+
"version": "23.2.0-beta.5",
|
|
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.
|
|
95
|
-
"@nx/js": "23.2.0-beta.
|
|
94
|
+
"@nx/devkit": "23.2.0-beta.5",
|
|
95
|
+
"@nx/js": "23.2.0-beta.5"
|
|
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.
|
|
107
|
+
"nx": "23.2.0-beta.5"
|
|
108
108
|
},
|
|
109
109
|
"publishConfig": {
|
|
110
110
|
"access": "public"
|