@nx/rollup 17.0.0-beta.2 → 17.0.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/executors.json +0 -7
- package/generators.json +0 -14
- package/package.json +6 -6
- package/src/executors/rollup/lib/normalize.js +0 -3
- package/src/executors/rollup/lib/update-package-json.d.ts +1 -4
- package/src/executors/rollup/lib/update-package-json.js +1 -6
- package/src/executors/rollup/rollup.impl.js +2 -2
- package/src/executors/rollup/schema.d.ts +0 -12
- package/src/executors/rollup/schema.json +0 -13
- package/src/generators/configuration/configuration.d.ts +0 -1
- package/src/generators/configuration/configuration.js +1 -2
- package/src/generators/init/init.d.ts +0 -1
- package/src/generators/init/init.js +1 -2
- package/src/executors/rollup/compat.d.ts +0 -2
- package/src/executors/rollup/compat.js +0 -5
package/executors.json
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"builders": {
|
|
3
|
-
"rollup": {
|
|
4
|
-
"implementation": "./src/executors/rollup/compat",
|
|
5
|
-
"schema": "./src/executors/rollup/schema.json",
|
|
6
|
-
"description": "Bundle a package using Rollup."
|
|
7
|
-
}
|
|
8
|
-
},
|
|
9
2
|
"executors": {
|
|
10
3
|
"rollup": {
|
|
11
4
|
"implementation": "./src/executors/rollup/rollup.impl",
|
package/generators.json
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Nx rollup",
|
|
3
3
|
"version": "0.1",
|
|
4
|
-
"schematics": {
|
|
5
|
-
"init": {
|
|
6
|
-
"factory": "./src/generators/init/init#rollupInitSchematic",
|
|
7
|
-
"schema": "./src/generators/init/schema.json",
|
|
8
|
-
"description": "Initialize the `@nrwl/rollup` plugin.",
|
|
9
|
-
"hidden": true
|
|
10
|
-
},
|
|
11
|
-
"configuration": {
|
|
12
|
-
"aliases": ["rollup-project"],
|
|
13
|
-
"factory": "./src/generators/configuration/configuration#compat",
|
|
14
|
-
"schema": "./src/generators/configuration/schema.json",
|
|
15
|
-
"description": "Add rollup configuration to a project."
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
4
|
"generators": {
|
|
19
5
|
"init": {
|
|
20
6
|
"factory": "./src/generators/init/init#rollupInitGenerator",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/rollup",
|
|
3
|
-
"version": "17.0.0-beta.
|
|
3
|
+
"version": "17.0.0-beta.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Rollup contains executors and generators that support building applications using Rollup.",
|
|
6
6
|
"repository": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"url": "https://github.com/nrwl/nx/issues"
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://nx.dev",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"generators": "./generators.json",
|
|
26
|
+
"executors": "./executors.json",
|
|
27
27
|
"ng-update": {
|
|
28
28
|
"requirements": {},
|
|
29
29
|
"migrations": "./migrations.json"
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"rollup-plugin-typescript2": "0.34.1",
|
|
47
47
|
"rxjs": "^7.8.0",
|
|
48
48
|
"tslib": "^2.3.0",
|
|
49
|
-
"@nx/devkit": "17.0.0-beta.
|
|
50
|
-
"@nx/js": "17.0.0-beta.
|
|
51
|
-
"@nrwl/rollup": "17.0.0-beta.
|
|
49
|
+
"@nx/devkit": "17.0.0-beta.5",
|
|
50
|
+
"@nx/js": "17.0.0-beta.5",
|
|
51
|
+
"@nrwl/rollup": "17.0.0-beta.5"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
@@ -14,9 +14,6 @@ function normalizeRollupExecutorOptions(options, context, sourceRoot) {
|
|
|
14
14
|
: (0, path_1.join)(root, 'package.json');
|
|
15
15
|
const projectRoot = (0, path_1.dirname)(project);
|
|
16
16
|
const outputPath = `${root}/${options.outputPath}`;
|
|
17
|
-
if (options.buildableProjectDepsInPackageJsonType == undefined) {
|
|
18
|
-
options.buildableProjectDepsInPackageJsonType = 'peerDependencies';
|
|
19
|
-
}
|
|
20
17
|
return {
|
|
21
18
|
...options,
|
|
22
19
|
// de-dupe formats
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { ExecutorContext } from 'nx/src/config/misc-interfaces';
|
|
2
|
-
import { ProjectGraphProjectNode } from 'nx/src/config/project-graph';
|
|
3
|
-
import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils';
|
|
4
1
|
import { PackageJson } from 'nx/src/utils/package-json';
|
|
5
2
|
import { NormalizedRollupExecutorOptions } from './normalize';
|
|
6
|
-
export declare function updatePackageJson(options: NormalizedRollupExecutorOptions,
|
|
3
|
+
export declare function updatePackageJson(options: NormalizedRollupExecutorOptions, packageJson: PackageJson): void;
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updatePackageJson = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
-
const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
|
|
6
5
|
const fileutils_1 = require("nx/src/utils/fileutils");
|
|
7
6
|
const fs_1 = require("fs");
|
|
8
7
|
const devkit_1 = require("@nx/devkit");
|
|
9
8
|
// TODO(jack): Use updatePackageJson from @nx/js instead.
|
|
10
|
-
function updatePackageJson(options,
|
|
9
|
+
function updatePackageJson(options, packageJson) {
|
|
11
10
|
const hasEsmFormat = options.format.includes('esm');
|
|
12
11
|
const hasCjsFormat = options.format.includes('cjs');
|
|
13
12
|
if (options.generateExportsField) {
|
|
@@ -74,10 +73,6 @@ function updatePackageJson(options, context, target, dependencies, packageJson)
|
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
(0, fileutils_1.writeJsonFile)(`${options.outputPath}/package.json`, packageJson);
|
|
77
|
-
if (dependencies.length > 0 &&
|
|
78
|
-
options.updateBuildableProjectDepsInPackageJson) {
|
|
79
|
-
(0, buildable_libs_utils_1.updateBuildableProjectPackageJsonDependencies)(context.root, context.projectName, context.targetName, context.configurationName, target, dependencies, options.buildableProjectDepsInPackageJsonType);
|
|
80
|
-
}
|
|
81
76
|
}
|
|
82
77
|
exports.updatePackageJson = updatePackageJson;
|
|
83
78
|
function getExports(options) {
|
|
@@ -47,7 +47,7 @@ async function* rollupExecutor(rawOptions, context) {
|
|
|
47
47
|
devkit_1.logger.info(`Bundling ${context.projectName}...`);
|
|
48
48
|
}
|
|
49
49
|
else if (data.code === 'END') {
|
|
50
|
-
(0, update_package_json_1.updatePackageJson)(options,
|
|
50
|
+
(0, update_package_json_1.updatePackageJson)(options, packageJson);
|
|
51
51
|
devkit_1.logger.info('Bundle complete. Watching for file changes...');
|
|
52
52
|
obs.next({ success: true, outfile });
|
|
53
53
|
}
|
|
@@ -80,7 +80,7 @@ async function* rollupExecutor(rawOptions, context) {
|
|
|
80
80
|
if (result.success) {
|
|
81
81
|
const end = process.hrtime.bigint();
|
|
82
82
|
const duration = `${(Number(end - start) / 1000000000).toFixed(2)}s`;
|
|
83
|
-
(0, update_package_json_1.updatePackageJson)(options,
|
|
83
|
+
(0, update_package_json_1.updatePackageJson)(options, packageJson);
|
|
84
84
|
devkit_1.logger.info(`⚡ Done in ${duration}`);
|
|
85
85
|
}
|
|
86
86
|
else {
|
|
@@ -24,18 +24,6 @@ export interface RollupExecutorOptions {
|
|
|
24
24
|
rollupConfig?: string | string[];
|
|
25
25
|
watch?: boolean;
|
|
26
26
|
assets?: any[];
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated Configure the project to use the `@nx/dependency-checks` ESLint
|
|
29
|
-
* rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks).
|
|
30
|
-
* It will be removed in v17.
|
|
31
|
-
*/
|
|
32
|
-
updateBuildableProjectDepsInPackageJson?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated Configure the project to use the `@nx/dependency-checks` ESLint
|
|
35
|
-
* rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks).
|
|
36
|
-
* It will be removed in v17.
|
|
37
|
-
*/
|
|
38
|
-
buildableProjectDepsInPackageJsonType?: 'dependencies' | 'peerDependencies';
|
|
39
27
|
deleteOutputPath?: boolean;
|
|
40
28
|
format?: ('cjs' | 'esm')[];
|
|
41
29
|
compiler?: 'babel' | 'tsc' | 'swc';
|
|
@@ -76,19 +76,6 @@
|
|
|
76
76
|
"description": "Enable re-building when files change.",
|
|
77
77
|
"default": false
|
|
78
78
|
},
|
|
79
|
-
"updateBuildableProjectDepsInPackageJson": {
|
|
80
|
-
"type": "boolean",
|
|
81
|
-
"description": "Update buildable project dependencies in `package.json`.",
|
|
82
|
-
"default": false,
|
|
83
|
-
"x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
|
|
84
|
-
},
|
|
85
|
-
"buildableProjectDepsInPackageJsonType": {
|
|
86
|
-
"type": "string",
|
|
87
|
-
"description": "When `updateBuildableProjectDepsInPackageJson` is `true`, this adds dependencies to either `peerDependencies` or `dependencies`.",
|
|
88
|
-
"enum": ["dependencies", "peerDependencies"],
|
|
89
|
-
"default": "peerDependencies",
|
|
90
|
-
"x-deprecated": "Configure the project to use the '@nx/dependency-checks' ESLint rule instead (https://nx.dev/packages/eslint-plugin/documents/dependency-checks). It will be removed in v17."
|
|
91
|
-
},
|
|
92
79
|
"rollupConfig": {
|
|
93
80
|
"oneOf": [
|
|
94
81
|
{
|
|
@@ -2,4 +2,3 @@ import type { Tree } from '@nx/devkit';
|
|
|
2
2
|
import { RollupProjectSchema } from './schema';
|
|
3
3
|
export declare function configurationGenerator(tree: Tree, options: RollupProjectSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
4
4
|
export default configurationGenerator;
|
|
5
|
-
export declare const compat: (generatorOptions: RollupProjectSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.configurationGenerator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
|
|
6
6
|
const init_1 = require("../init/init");
|
|
@@ -86,4 +86,3 @@ function addBuildTarget(tree, options) {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
exports.default = configurationGenerator;
|
|
89
|
-
exports.compat = (0, devkit_1.convertNxGenerator)(configurationGenerator);
|
|
@@ -2,4 +2,3 @@ import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
|
2
2
|
import { Schema } from './schema';
|
|
3
3
|
export declare function rollupInitGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export default rollupInitGenerator;
|
|
5
|
-
export declare const rollupInitSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.rollupInitGenerator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const versions_1 = require("@nx/js/src/utils/versions");
|
|
6
6
|
const versions_2 = require("../../utils/versions");
|
|
@@ -27,4 +27,3 @@ async function rollupInitGenerator(tree, schema) {
|
|
|
27
27
|
}
|
|
28
28
|
exports.rollupInitGenerator = rollupInitGenerator;
|
|
29
29
|
exports.default = rollupInitGenerator;
|
|
30
|
-
exports.rollupInitSchematic = (0, devkit_1.convertNxGenerator)(rollupInitGenerator);
|