@nx/rollup 22.7.0-beta.1 → 22.7.0-beta.11

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/rollup",
3
- "version": "22.7.0-beta.1",
3
+ "version": "22.7.0-beta.11",
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": {
@@ -15,7 +15,8 @@
15
15
  "CLI"
16
16
  ],
17
17
  "main": "./index.js",
18
- "typings": "./index.d.ts",
18
+ "type": "commonjs",
19
+ "types": "./index.d.ts",
19
20
  "author": "Victor Savkin",
20
21
  "license": "MIT",
21
22
  "bugs": {
@@ -29,8 +30,8 @@
29
30
  "migrations": "./migrations.json"
30
31
  },
31
32
  "dependencies": {
32
- "@nx/devkit": "22.7.0-beta.1",
33
- "@nx/js": "22.7.0-beta.1",
33
+ "@nx/devkit": "22.7.0-beta.11",
34
+ "@nx/js": "22.7.0-beta.11",
34
35
  "@rollup/plugin-babel": "^6.0.4",
35
36
  "@rollup/plugin-commonjs": "^25.0.7",
36
37
  "@rollup/plugin-image": "^3.0.3",
@@ -40,7 +41,7 @@
40
41
  "autoprefixer": "^10.4.9",
41
42
  "concat-with-sourcemaps": "^1.1.0",
42
43
  "picocolors": "^1.1.0",
43
- "picomatch": "4.0.2",
44
+ "picomatch": "4.0.4",
44
45
  "postcss": "^8.4.38",
45
46
  "postcss-modules": "^6.0.1",
46
47
  "rollup": "^4.14.0",
@@ -48,12 +49,10 @@
48
49
  "tslib": "^2.3.0"
49
50
  },
50
51
  "devDependencies": {
51
- "nx": "22.7.0-beta.1",
52
+ "nx": "22.7.0-beta.11",
52
53
  "source-map-js": "^1.2.0"
53
54
  },
54
55
  "publishConfig": {
55
56
  "access": "public"
56
- },
57
- "types": "./index.d.ts",
58
- "type": "commonjs"
57
+ }
59
58
  }
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rollupExecutor = rollupExecutor;
4
4
  exports.createRollupOptions = createRollupOptions;
5
- const rollup = require("rollup");
5
+ const tslib_1 = require("tslib");
6
+ const rollup = tslib_1.__importStar(require("rollup"));
6
7
  const path_1 = require("path");
7
8
  const devkit_1 = require("@nx/devkit");
8
9
  const normalize_1 = require("./lib/normalize");
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.analyze = analyze;
4
- const pc = require("picocolors");
4
+ const tslib_1 = require("tslib");
5
+ const pc = tslib_1.__importStar(require("picocolors"));
5
6
  const devkit_1 = require("@nx/devkit");
6
7
  const formatBytes = (bytes) => {
7
8
  if (bytes === 0)
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/rollup/src/plugins/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,kBAAkB,EAGvB,aAAa,EAOd,MAAM,YAAY,CAAC;AAwBpB;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,mBAAmB,CA8B1D,CAAC;AAEF,eAAO,MAAM,aAAa,oCAAc,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/rollup/src/plugins/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,kBAAkB,EAGvB,aAAa,EAOd,MAAM,YAAY,CAAC;AAsBpB;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,mBAAmB,CAkC1D,CAAC;AAEF,eAAO,MAAM,aAAa,oCAAc,CAAC"}
@@ -11,7 +11,6 @@ const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
11
11
  const file_hasher_1 = require("nx/src/hasher/file-hasher");
12
12
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
13
13
  const util_1 = require("@nx/js/src/plugins/typescript/util");
14
- const pmc = (0, devkit_1.getPackageManagerCommand)();
15
14
  function readTargetsCache(cachePath) {
16
15
  return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
17
16
  }
@@ -34,8 +33,9 @@ exports.createNodes = [
34
33
  const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `rollup-${optionsHash}.hash`);
35
34
  const targetsCache = readTargetsCache(cachePath);
36
35
  const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
36
+ const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
37
37
  try {
38
- return await (0, devkit_1.createNodesFromFiles)((configFile, _, context) => createNodesInternal(configFile, normalizedOptions, context, targetsCache, isTsSolutionSetup), configFilePaths, normalizedOptions, context);
38
+ return await (0, devkit_1.createNodesFromFiles)((configFile, _, context) => createNodesInternal(configFile, normalizedOptions, context, targetsCache, isTsSolutionSetup, pmc), configFilePaths, normalizedOptions, context);
39
39
  }
40
40
  finally {
41
41
  writeTargetsToCache(cachePath, targetsCache);
@@ -43,7 +43,7 @@ exports.createNodes = [
43
43
  },
44
44
  ];
45
45
  exports.createNodesV2 = exports.createNodes;
46
- async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup) {
46
+ async function createNodesInternal(configFilePath, options, context, targetsCache, isTsSolutionSetup, pmc) {
47
47
  const projectRoot = (0, path_1.dirname)(configFilePath);
48
48
  const fullyQualifiedProjectRoot = (0, path_1.join)(context.workspaceRoot, projectRoot);
49
49
  // Do not create a project if package.json and project.json do not exist
@@ -53,7 +53,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
53
53
  return {};
54
54
  }
55
55
  const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
56
- targetsCache[hash] ??= await buildRollupTarget(configFilePath, projectRoot, options, context, isTsSolutionSetup);
56
+ targetsCache[hash] ??= await buildRollupTarget(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc);
57
57
  return {
58
58
  projects: {
59
59
  [projectRoot]: {
@@ -63,7 +63,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
63
63
  },
64
64
  };
65
65
  }
66
- async function buildRollupTarget(configFilePath, projectRoot, options, context, isTsSolutionSetup) {
66
+ async function buildRollupTarget(configFilePath, projectRoot, options, context, isTsSolutionSetup, pmc) {
67
67
  let loadConfigFile;
68
68
  try {
69
69
  // Try to load the workspace version of rollup first (it should already exist).
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createPostCSSLoader = createPostCSSLoader;
4
+ const tslib_1 = require("tslib");
4
5
  const path_1 = require("path");
5
- const postcss_1 = require("postcss");
6
+ const postcss_1 = tslib_1.__importDefault(require("postcss"));
6
7
  const utils_1 = require("../utils");
7
8
  /**
8
9
  * Check if a file should use CSS modules based on its filename
@@ -1 +1 @@
1
- {"version":3,"file":"swc.d.ts","sourceRoot":"","sources":["../../../../../packages/rollup/src/plugins/swc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,wBAAgB,GAAG,IAAI,MAAM,CAe5B"}
1
+ {"version":3,"file":"swc.d.ts","sourceRoot":"","sources":["../../../../../packages/rollup/src/plugins/swc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,wBAAgB,GAAG,IAAI,MAAM,CAgB5B"}
@@ -8,6 +8,7 @@ function swc() {
8
8
  transform(code, filename) {
9
9
  return transform(code, {
10
10
  filename,
11
+ inputSourceMap: false,
11
12
  jsc: {
12
13
  transform: {
13
14
  react: { runtime: 'automatic' },
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withNx = withNx;
4
+ const tslib_1 = require("tslib");
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const type_definitions_1 = require("@nx/js/src/plugins/rollup/type-definitions");
6
7
  const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
7
8
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
8
9
  const plugin_babel_1 = require("@rollup/plugin-babel");
9
- const plugin_node_resolve_1 = require("@rollup/plugin-node-resolve");
10
- const autoprefixer = require("autoprefixer");
10
+ const plugin_node_resolve_1 = tslib_1.__importDefault(require("@rollup/plugin-node-resolve"));
11
+ const autoprefixer_1 = tslib_1.__importDefault(require("autoprefixer"));
11
12
  const node_fs_1 = require("node:fs");
12
13
  const node_path_1 = require("node:path");
13
14
  const analyze_1 = require("../analyze");
@@ -202,7 +203,7 @@ dependencies) {
202
203
  inject: true,
203
204
  extract: options.extractCss,
204
205
  autoModules: true,
205
- plugins: [autoprefixer],
206
+ plugins: [autoprefixer_1.default],
206
207
  use: {
207
208
  less: {
208
209
  javascriptEnabled: options.javascriptEnabled,
package/src/utils/fs.js CHANGED
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deleteOutputDir = deleteOutputDir;
4
- const path = require("path");
4
+ const tslib_1 = require("tslib");
5
+ const path = tslib_1.__importStar(require("path"));
5
6
  const fs_1 = require("fs");
6
7
  /**
7
8
  * Delete an output directory, but error out if it's the root of the project.
package/project.json DELETED
@@ -1,52 +0,0 @@
1
- {
2
- "name": "rollup",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/rollup",
5
- "projectType": "library",
6
- "targets": {
7
- "build": {
8
- "outputs": ["{workspaceRoot}/dist/packages/rollup/README.md"],
9
- "command": "node ./scripts/copy-readme.js rollup"
10
- },
11
- "legacy-post-build": {
12
- "executor": "@nx/workspace-plugin:legacy-post-build",
13
- "options": {
14
- "tsConfig": "./tsconfig.lib.json",
15
- "assets": [
16
- {
17
- "input": "packages/rollup",
18
- "glob": "**/files/**",
19
- "output": "/"
20
- },
21
- {
22
- "input": "packages/rollup",
23
- "glob": "**/files/**/.gitkeep",
24
- "output": "/"
25
- },
26
- {
27
- "input": "packages/rollup",
28
- "glob": "**/*.json",
29
- "ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"],
30
- "output": "/"
31
- },
32
- {
33
- "input": "packages/rollup",
34
- "glob": "**/*.js",
35
- "ignore": ["**/jest.config.js"],
36
- "output": "/"
37
- },
38
- {
39
- "input": "packages/rollup",
40
- "glob": "**/*.d.ts",
41
- "output": "/"
42
- },
43
- {
44
- "input": "",
45
- "glob": "LICENSE",
46
- "output": "/"
47
- }
48
- ]
49
- }
50
- }
51
- }
52
- }