@nx/rsbuild 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/config-utils.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hasRsbuildPlugin = exports.getRsbuildE2EWebServerInfo = exports.versions = exports.addSourceDefine = exports.addExperimentalSwcPlugin = exports.addHtmlTemplatePath = exports.addCopyAssets = exports.addBuildPlugin = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  var add_build_plugin_1 = require("./src/utils/add-build-plugin");
5
6
  Object.defineProperty(exports, "addBuildPlugin", { enumerable: true, get: function () { return add_build_plugin_1.addBuildPlugin; } });
6
7
  var ast_utils_1 = require("./src/utils/ast-utils");
@@ -8,7 +9,7 @@ Object.defineProperty(exports, "addCopyAssets", { enumerable: true, get: functio
8
9
  Object.defineProperty(exports, "addHtmlTemplatePath", { enumerable: true, get: function () { return ast_utils_1.addHtmlTemplatePath; } });
9
10
  Object.defineProperty(exports, "addExperimentalSwcPlugin", { enumerable: true, get: function () { return ast_utils_1.addExperimentalSwcPlugin; } });
10
11
  Object.defineProperty(exports, "addSourceDefine", { enumerable: true, get: function () { return ast_utils_1.addSourceDefine; } });
11
- exports.versions = require("./src/utils/versions");
12
+ exports.versions = tslib_1.__importStar(require("./src/utils/versions"));
12
13
  var e2e_web_server_info_utils_1 = require("./src/utils/e2e-web-server-info-utils");
13
14
  Object.defineProperty(exports, "getRsbuildE2EWebServerInfo", { enumerable: true, get: function () { return e2e_web_server_info_utils_1.getRsbuildE2EWebServerInfo; } });
14
15
  var has_rsbuild_plugin_1 = require("./src/utils/has-rsbuild-plugin");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nx/rsbuild",
3
3
  "description": "The Nx Plugin for Rsbuild contains an Nx plugin, executors and utilities that support building applications using Rsbuild.",
4
- "version": "22.7.0-beta.1",
4
+ "version": "22.7.0-beta.11",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -30,14 +30,14 @@
30
30
  "executors": "./executors.json",
31
31
  "dependencies": {
32
32
  "tslib": "^2.3.0",
33
- "@nx/devkit": "22.7.0-beta.1",
34
- "@nx/js": "22.7.0-beta.1",
33
+ "@nx/devkit": "22.7.0-beta.11",
34
+ "@nx/js": "22.7.0-beta.11",
35
35
  "@rsbuild/core": "1.1.8",
36
36
  "minimatch": "10.2.4",
37
37
  "@phenomnomnominal/tsquery": "~6.1.4"
38
38
  },
39
39
  "devDependencies": {
40
- "nx": "22.7.0-beta.1"
40
+ "nx": "22.7.0-beta.11"
41
41
  },
42
42
  "peerDependencies": {},
43
43
  "nx-migrations": {
@@ -63,6 +63,5 @@
63
63
  "types": "./config-utils.d.ts",
64
64
  "default": "./config-utils.js"
65
65
  }
66
- },
67
- "types": "./src/index.d.ts"
66
+ }
68
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/rsbuild/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,aAAa,EAMd,MAAM,YAAY,CAAC;AAepB,MAAM,WAAW,oBAAoB;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAiBD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,oBAAoB,CA4B7D,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/rsbuild/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,aAAa,EAMd,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,oBAAoB;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAiBD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,oBAAoB,CAgC7D,CAAC"}
@@ -13,7 +13,6 @@ const path_1 = require("path");
13
13
  const minimatch_1 = require("minimatch");
14
14
  const core_1 = require("@rsbuild/core");
15
15
  const util_1 = require("@nx/js/src/plugins/typescript/util");
16
- const pmc = (0, devkit_1.getPackageManagerCommand)();
17
16
  function readTargetsCache(cachePath) {
18
17
  return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
19
18
  }
@@ -28,15 +27,16 @@ exports.createNodesV2 = [
28
27
  const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `rsbuild-${optionsHash}.hash`);
29
28
  const targetsCache = readTargetsCache(cachePath);
30
29
  const isUsingTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
30
+ const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
31
31
  try {
32
- return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isUsingTsSolutionSetup), configFilePaths, options, context);
32
+ return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, targetsCache, isUsingTsSolutionSetup, pmc), configFilePaths, options, context);
33
33
  }
34
34
  finally {
35
35
  writeTargetsCache(cachePath, targetsCache);
36
36
  }
37
37
  },
38
38
  ];
39
- async function createNodesInternal(configFilePath, options, context, targetsCache, isUsingTsSolutionSetup) {
39
+ async function createNodesInternal(configFilePath, options, context, targetsCache, isUsingTsSolutionSetup, pmc) {
40
40
  const projectRoot = (0, path_1.dirname)(configFilePath);
41
41
  // Do not create a project if package.json and project.json isn't there.
42
42
  const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
@@ -47,7 +47,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
47
47
  const tsConfigFiles = siblingFiles.filter((p) => (0, minimatch_1.minimatch)(p, 'tsconfig*{.json,.*.json}')) ?? [];
48
48
  const normalizedOptions = normalizeOptions(options);
49
49
  const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, { ...normalizedOptions, isUsingTsSolutionSetup }, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
50
- targetsCache[hash] ??= await createRsbuildTargets(configFilePath, projectRoot, normalizedOptions, tsConfigFiles, isUsingTsSolutionSetup, context);
50
+ targetsCache[hash] ??= await createRsbuildTargets(configFilePath, projectRoot, normalizedOptions, tsConfigFiles, isUsingTsSolutionSetup, context, pmc);
51
51
  const { targets, metadata } = targetsCache[hash];
52
52
  return {
53
53
  projects: {
@@ -59,7 +59,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
59
59
  },
60
60
  };
61
61
  }
62
- async function createRsbuildTargets(configFilePath, projectRoot, options, tsConfigFiles, isUsingTsSolutionSetup, context) {
62
+ async function createRsbuildTargets(configFilePath, projectRoot, options, tsConfigFiles, isUsingTsSolutionSetup, context, pmc) {
63
63
  const absoluteConfigFilePath = (0, devkit_1.joinPathFragments)(context.workspaceRoot, configFilePath);
64
64
  const rsbuildConfig = await (0, core_1.loadConfig)({
65
65
  path: absoluteConfigFilePath,
package/project.json DELETED
@@ -1,52 +0,0 @@
1
- {
2
- "name": "rsbuild",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/rsbuild",
5
- "projectType": "library",
6
- "targets": {
7
- "build": {
8
- "outputs": ["{workspaceRoot}/dist/packages/rsbuild/README.md"],
9
- "command": "node ./scripts/copy-readme.js rsbuild"
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/rsbuild",
18
- "glob": "**/files/**",
19
- "output": "/"
20
- },
21
- {
22
- "input": "packages/rsbuild",
23
- "glob": "**/files/**/.gitkeep",
24
- "output": "/"
25
- },
26
- {
27
- "input": "packages/rsbuild",
28
- "glob": "**/*.json",
29
- "ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"],
30
- "output": "/"
31
- },
32
- {
33
- "input": "packages/rsbuild",
34
- "glob": "**/*.js",
35
- "ignore": ["**/jest.config.js"],
36
- "output": "/"
37
- },
38
- {
39
- "input": "packages/rsbuild",
40
- "glob": "**/*.d.ts",
41
- "output": "/"
42
- },
43
- {
44
- "input": "",
45
- "glob": "LICENSE",
46
- "output": "/"
47
- }
48
- ]
49
- }
50
- }
51
- }
52
- }