@lynx-js/rspeedy-canary 0.10.4-canary-20250801-d2961703 → 0.10.5-canary-20250803-9a0f14bf

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/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # @lynx-js/rspeedy
2
2
 
3
- ## 0.10.4-canary-20250801134644-d29617030d83dd5d1ec2aaa8d79856df397d60b1
3
+ ## 0.10.5-canary-20250803092736-9a0f14bf3c282df3c69af623d613b9b9a96f57d3
4
+
5
+ ### Patch Changes
6
+
7
+ - Should support using `.js` extensions when loading configuration with Node.js [builtin type stripping](https://nodejs.org/api/typescript.html#type-stripping). ([#1407](https://github.com/lynx-family/lynx-stack/pull/1407))
8
+
9
+ ## 0.10.4
4
10
 
5
11
  ### Patch Changes
6
12
 
package/dist/index.js CHANGED
@@ -112,7 +112,7 @@ var __webpack_modules__ = {
112
112
  });
113
113
  var core_ = __webpack_require__("@rsbuild/core");
114
114
  var package_namespaceObject = {
115
- i8: "0.10.3"
115
+ i8: "0.10.4"
116
116
  };
117
117
  const version = package_namespaceObject.i8;
118
118
  const rspackVersion = core_.rspack.rspackVersion;
@@ -472,7 +472,10 @@ async function loadConfig(loadConfigOptions) {
472
472
  let { configPath } = loadConfigOptions;
473
473
  if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
474
474
  const specifier = pathToFileURL(configPath).toString();
475
- const unregister = shouldUseNativeImport(configPath) ? ()=>void 0 : register();
475
+ const unregister = register({
476
+ load: !shouldUseNativeImport(configPath),
477
+ resolve: true
478
+ });
476
479
  try {
477
480
  const [exports, { validate }] = await Promise.all([
478
481
  import(`${specifier}?t=${Date.now()}`),
@@ -503,13 +503,16 @@ function getClosingParenthesisPos(node) {
503
503
  }
504
504
  const state = {
505
505
  active: true,
506
- port: null
506
+ port: null,
507
+ options: null
507
508
  };
508
509
  const hooks_initialize = function(data) {
510
+ state.options = data.options;
509
511
  state.port = data.port;
510
512
  data.port.on('message', onMessage);
511
513
  };
512
514
  const hooks_resolve = async function(specifier, context, nextResolve) {
515
+ if (!state.options?.resolve) return nextResolve(specifier, context);
513
516
  try {
514
517
  return await nextResolve(specifier, context);
515
518
  } catch (err) {
@@ -521,6 +524,7 @@ const hooks_resolve = async function(specifier, context, nextResolve) {
521
524
  }
522
525
  };
523
526
  const hooks_load = async function(url, context, nextLoad) {
527
+ if (!state.options?.load) return nextLoad(url, context);
524
528
  const fullURL = parseURL(url);
525
529
  if (!fullURL) return nextLoad(url, context);
526
530
  const { pathname } = fullURL;
@@ -1,4 +1,7 @@
1
1
  // Copyright 2024 The Lynx Authors. All rights reserved.
2
2
  // Licensed under the Apache License Version 2.0 that can be found in the
3
3
  // LICENSE file in the root directory of this source tree.
4
- export function register(): () => void
4
+
5
+ import type { Options } from './data.js'
6
+
7
+ export function register(options: Options): () => void
@@ -1,5 +1,5 @@
1
1
  import node_module from "node:module";
2
- function register() {
2
+ function register(options) {
3
3
  if (!node_module.register) throw new Error([
4
4
  `This version of Node.js (${process.version}) does not support module.register(). You can either:`,
5
5
  " - Upgrade to Node.js v18.19 or v20.6 and above",
@@ -9,6 +9,7 @@ function register() {
9
9
  node_module.register(`./hooks.js?${Date.now()}`, import.meta.url, {
10
10
  parentURL: import.meta.url,
11
11
  data: {
12
+ options,
12
13
  port: port2
13
14
  },
14
15
  transferList: [
@@ -66,7 +66,10 @@ export const __webpack_modules__ = {
66
66
  let { configPath } = loadConfigOptions;
67
67
  if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
68
68
  const specifier = (0, external_node_url_.pathToFileURL)(configPath).toString();
69
- const unregister = shouldUseNativeImport(configPath) ? ()=>void 0 : (0, register_.register)();
69
+ const unregister = (0, register_.register)({
70
+ load: !shouldUseNativeImport(configPath),
71
+ resolve: true
72
+ });
70
73
  try {
71
74
  const [exports, { validate }] = await Promise.all([
72
75
  import(`${specifier}?t=${Date.now()}`),
@@ -40,7 +40,7 @@ export const __webpack_modules__ = {
40
40
  });
41
41
  var core_ = __webpack_require__("@rsbuild/core");
42
42
  var package_namespaceObject = {
43
- i8: "0.10.3"
43
+ i8: "0.10.4"
44
44
  };
45
45
  const version = package_namespaceObject.i8;
46
46
  const rspackVersion = core_.rspack.rspackVersion;
@@ -109,7 +109,10 @@ export const __webpack_modules__ = {
109
109
  let { configPath } = loadConfigOptions;
110
110
  if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
111
111
  const specifier = (0, external_node_url_.pathToFileURL)(configPath).toString();
112
- const unregister = shouldUseNativeImport(configPath) ? ()=>void 0 : (0, register_.register)();
112
+ const unregister = (0, register_.register)({
113
+ load: !shouldUseNativeImport(configPath),
114
+ resolve: true
115
+ });
113
116
  try {
114
117
  const [exports, { validate }] = await Promise.all([
115
118
  import(`${specifier}?t=${Date.now()}`),
@@ -43,7 +43,10 @@ export const __webpack_modules__ = {
43
43
  let { configPath } = loadConfigOptions;
44
44
  if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
45
45
  const specifier = (0, external_node_url_.pathToFileURL)(configPath).toString();
46
- const unregister = shouldUseNativeImport(configPath) ? ()=>void 0 : (0, register_.register)();
46
+ const unregister = (0, register_.register)({
47
+ load: !shouldUseNativeImport(configPath),
48
+ resolve: true
49
+ });
47
50
  try {
48
51
  const [exports, { validate }] = await Promise.all([
49
52
  import(`${specifier}?t=${Date.now()}`),
@@ -43,7 +43,10 @@ export const __webpack_modules__ = {
43
43
  let { configPath } = loadConfigOptions;
44
44
  if (!configPath || !(0, external_node_path_.isAbsolute)(configPath)) configPath = resolveConfigPath(loadConfigOptions.cwd ?? process.cwd(), configPath);
45
45
  const specifier = (0, external_node_url_.pathToFileURL)(configPath).toString();
46
- const unregister = shouldUseNativeImport(configPath) ? ()=>void 0 : (0, register_.register)();
46
+ const unregister = (0, register_.register)({
47
+ load: !shouldUseNativeImport(configPath),
48
+ resolve: true
49
+ });
47
50
  try {
48
51
  const [exports, { validate }] = await Promise.all([
49
52
  import(`${specifier}?t=${Date.now()}`),
@@ -19,11 +19,11 @@ export const __webpack_modules__ = {
19
19
  config,
20
20
  debug: _debug_js__WEBPACK_IMPORTED_MODULE_1__.fF,
21
21
  async exit (code) {
22
- const { exit } = await __webpack_require__.e("src_cli_exit_ts").then(__webpack_require__.bind(__webpack_require__, "./src/cli/exit.ts"));
22
+ const { exit } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "./src/cli/exit.ts"));
23
23
  return exit(code);
24
24
  },
25
25
  logger: _rsbuild_core__WEBPACK_IMPORTED_MODULE_0__.logger,
26
- version: _version_js__WEBPACK_IMPORTED_MODULE_2__.i8
26
+ version: _version_js__WEBPACK_IMPORTED_MODULE_2__.version
27
27
  });
28
28
  }
29
29
  };
@@ -7,10 +7,8 @@ export const __webpack_modules__ = {
7
7
  __webpack_require__.d(__webpack_exports__, {
8
8
  pluginRsdoctor: ()=>pluginRsdoctor
9
9
  });
10
- var core_ = __webpack_require__("@rsbuild/core");
11
- function isCI() {
12
- return !!process.env['CI'] && 'false' !== process.env['CI'];
13
- }
10
+ var _rsbuild_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("@rsbuild/core");
11
+ var _utils_is_ci_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/utils/is-ci.ts");
14
12
  function pluginRsdoctor(options) {
15
13
  return {
16
14
  name: 'lynx:rsbuild:rsdoctor',
@@ -27,7 +25,7 @@ export const __webpack_modules__ = {
27
25
  if (registered) continue;
28
26
  config.plugins ??= [];
29
27
  const defaultOptions = {
30
- disableClientServer: isCI(),
28
+ disableClientServer: (0, _utils_is_ci_js__WEBPACK_IMPORTED_MODULE_1__.y)(),
31
29
  supports: {
32
30
  banner: true
33
31
  },
@@ -42,12 +40,20 @@ export const __webpack_modules__ = {
42
40
  }
43
41
  }
44
42
  };
45
- config.plugins.push(new RsdoctorRspackPlugin((0, core_.mergeRsbuildConfig)(defaultOptions, options)));
43
+ config.plugins.push(new RsdoctorRspackPlugin((0, _rsbuild_core__WEBPACK_IMPORTED_MODULE_0__.mergeRsbuildConfig)(defaultOptions, options)));
46
44
  }
47
- core_.logger.info("Rsdoctor is enabled.");
45
+ _rsbuild_core__WEBPACK_IMPORTED_MODULE_0__.logger.info("Rsdoctor is enabled.");
48
46
  });
49
47
  }
50
48
  };
51
49
  }
50
+ },
51
+ "./src/utils/is-ci.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
52
+ __webpack_require__.d(__webpack_exports__, {
53
+ y: ()=>isCI
54
+ });
55
+ function isCI() {
56
+ return !!process.env['CI'] && 'false' !== process.env['CI'];
57
+ }
52
58
  }
53
59
  };
@@ -10,7 +10,7 @@ export const __webpack_modules__ = {
10
10
  });
11
11
  var core_ = __webpack_require__("@rsbuild/core");
12
12
  var package_namespaceObject = {
13
- i8: "0.10.3"
13
+ i8: "0.10.4"
14
14
  };
15
15
  const version = package_namespaceObject.i8;
16
16
  const rspackVersion = core_.rspack.rspackVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/rspeedy-canary",
3
- "version": "0.10.4-canary-20250801-d2961703",
3
+ "version": "0.10.5-canary-20250803-9a0f14bf",
4
4
  "description": "A webpack/rspack-based frontend toolchain for Lynx",
5
5
  "keywords": [
6
6
  "webpack",