@lynx-js/rspeedy-canary 0.9.10 → 0.9.11-canary-20250626-0ff9eb54
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 +38 -32
- package/dist/cli/main.js +6 -6
- package/dist/index.d.ts +0 -2
- package/dist/index.js +3 -3
- package/dist/register/hooks.js +14 -14
- package/dist/register/index.js +3 -3
- package/dist/src_config_validate_ts.js +3286 -3003
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @lynx-js/rspeedy
|
|
2
2
|
|
|
3
|
+
## 0.9.11-canary-20250626115840-0ff9eb54e58dcbac602ea29c19a6daac1ed5746d
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- docs: remove chunks: 'all' in comments ([#1168](https://github.com/lynx-family/lynx-stack/pull/1168))
|
|
8
|
+
|
|
3
9
|
## 0.9.10
|
|
4
10
|
|
|
5
11
|
## 0.9.9
|
|
@@ -38,13 +44,13 @@
|
|
|
38
44
|
example:
|
|
39
45
|
|
|
40
46
|
```js
|
|
41
|
-
import { defineConfig } from
|
|
47
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
42
48
|
|
|
43
49
|
export default defineConfig({
|
|
44
50
|
output: {
|
|
45
51
|
inlineScripts: false,
|
|
46
52
|
},
|
|
47
|
-
})
|
|
53
|
+
});
|
|
48
54
|
```
|
|
49
55
|
|
|
50
56
|
- Bump Rsbuild v1.3.21 with Rspack v1.3.11. ([#863](https://github.com/lynx-family/lynx-stack/pull/863))
|
|
@@ -64,12 +70,12 @@
|
|
|
64
70
|
example:
|
|
65
71
|
|
|
66
72
|
```js
|
|
67
|
-
import { defineConfig } from
|
|
73
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
68
74
|
export default defineConfig({
|
|
69
75
|
source: {
|
|
70
|
-
preEntry:
|
|
76
|
+
preEntry: "./src/polyfill.ts",
|
|
71
77
|
},
|
|
72
|
-
})
|
|
78
|
+
});
|
|
73
79
|
```
|
|
74
80
|
|
|
75
81
|
- Bump Rsbuild v1.3.20 with Rspack v1.3.10. ([#799](https://github.com/lynx-family/lynx-stack/pull/799))
|
|
@@ -80,17 +86,17 @@
|
|
|
80
86
|
|
|
81
87
|
```js
|
|
82
88
|
export const myPlugin = {
|
|
83
|
-
name:
|
|
89
|
+
name: "my-plugin",
|
|
84
90
|
setup(api) {
|
|
85
|
-
const { callerName } = api.context
|
|
91
|
+
const { callerName } = api.context;
|
|
86
92
|
|
|
87
|
-
if (callerName ===
|
|
93
|
+
if (callerName === "rslib") {
|
|
88
94
|
// ...
|
|
89
|
-
} else if (callerName ===
|
|
95
|
+
} else if (callerName === "rspeedy") {
|
|
90
96
|
// ...
|
|
91
97
|
}
|
|
92
98
|
},
|
|
93
|
-
}
|
|
99
|
+
};
|
|
94
100
|
```
|
|
95
101
|
|
|
96
102
|
- Support `performance.buildCache`. ([#766](https://github.com/lynx-family/lynx-stack/pull/766))
|
|
@@ -113,7 +119,7 @@
|
|
|
113
119
|
Set `tools.rsdoctor.experiments.enableNativePlugin` to `false` to use the old JS plugin.
|
|
114
120
|
|
|
115
121
|
```js
|
|
116
|
-
import { defineConfig } from
|
|
122
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
117
123
|
|
|
118
124
|
export default defineConfig({
|
|
119
125
|
tools: {
|
|
@@ -123,7 +129,7 @@
|
|
|
123
129
|
},
|
|
124
130
|
},
|
|
125
131
|
},
|
|
126
|
-
})
|
|
132
|
+
});
|
|
127
133
|
```
|
|
128
134
|
|
|
129
135
|
See [Rsdoctor - 1.0](https://rsdoctor.dev/blog/release/release-note-1_0#-faster-analysis) for more details.
|
|
@@ -255,12 +261,12 @@
|
|
|
255
261
|
example:
|
|
256
262
|
|
|
257
263
|
```js
|
|
258
|
-
import { defineConfig } from
|
|
264
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
259
265
|
export default defineConfig({
|
|
260
266
|
server: {
|
|
261
|
-
base:
|
|
267
|
+
base: "/dist",
|
|
262
268
|
},
|
|
263
|
-
})
|
|
269
|
+
});
|
|
264
270
|
```
|
|
265
271
|
|
|
266
272
|
- Updated dependencies [[`b026c8b`](https://github.com/lynx-family/lynx-stack/commit/b026c8bdcbf7bdcda73e170477297213b447d876)]:
|
|
@@ -313,11 +319,11 @@
|
|
|
313
319
|
You can switch to other tools by using:
|
|
314
320
|
|
|
315
321
|
```js
|
|
316
|
-
import { defineConfig } from
|
|
322
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
317
323
|
import {
|
|
318
324
|
CssMinimizerWebpackPlugin,
|
|
319
325
|
pluginCssMinimizer,
|
|
320
|
-
} from
|
|
326
|
+
} from "@rsbuild/plugin-css-minimizer";
|
|
321
327
|
|
|
322
328
|
export default defineConfig({
|
|
323
329
|
plugins: [
|
|
@@ -330,7 +336,7 @@
|
|
|
330
336
|
},
|
|
331
337
|
}),
|
|
332
338
|
],
|
|
333
|
-
})
|
|
339
|
+
});
|
|
334
340
|
```
|
|
335
341
|
|
|
336
342
|
See [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) for details.
|
|
@@ -340,8 +346,8 @@
|
|
|
340
346
|
You can use custom options with [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer):
|
|
341
347
|
|
|
342
348
|
```js
|
|
343
|
-
import { defineConfig } from
|
|
344
|
-
import { pluginCssMinimizer } from
|
|
349
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
350
|
+
import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
|
|
345
351
|
|
|
346
352
|
export default defineConfig({
|
|
347
353
|
plugins: [
|
|
@@ -353,7 +359,7 @@
|
|
|
353
359
|
},
|
|
354
360
|
}),
|
|
355
361
|
],
|
|
356
|
-
})
|
|
362
|
+
});
|
|
357
363
|
```
|
|
358
364
|
|
|
359
365
|
## 0.7.1
|
|
@@ -373,7 +379,7 @@
|
|
|
373
379
|
You may turn it off using `output.minify.css: false`:
|
|
374
380
|
|
|
375
381
|
```js
|
|
376
|
-
import { defineConfig } from
|
|
382
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
377
383
|
|
|
378
384
|
export default defineConfig({
|
|
379
385
|
output: {
|
|
@@ -381,18 +387,18 @@
|
|
|
381
387
|
css: false,
|
|
382
388
|
},
|
|
383
389
|
},
|
|
384
|
-
})
|
|
390
|
+
});
|
|
385
391
|
```
|
|
386
392
|
|
|
387
393
|
Or you may use [@rsbuild/plugin-css-minimizer](https://github.com/rspack-contrib/rsbuild-plugin-css-minimizer) to use `cssnano` as CSS minimizer.
|
|
388
394
|
|
|
389
395
|
```js
|
|
390
|
-
import { defineConfig } from
|
|
391
|
-
import { pluginCssMinimizer } from
|
|
396
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
397
|
+
import { pluginCssMinimizer } from "@rsbuild/plugin-css-minimizer";
|
|
392
398
|
|
|
393
399
|
export default defineConfig({
|
|
394
400
|
plugins: [pluginCssMinimizer()],
|
|
395
|
-
})
|
|
401
|
+
});
|
|
396
402
|
```
|
|
397
403
|
|
|
398
404
|
- 525554c: **BREAKING CHANGE**: Bump ts-blank-space to ^0.6.0.
|
|
@@ -419,22 +425,22 @@
|
|
|
419
425
|
- The new `type: 'reload-server'` will restart the development server when it detects changes in the specified files.
|
|
420
426
|
|
|
421
427
|
```js
|
|
422
|
-
import { defineConfig } from
|
|
428
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
423
429
|
|
|
424
430
|
export default defineConfig({
|
|
425
431
|
dev: {
|
|
426
432
|
watchFiles: [
|
|
427
433
|
{
|
|
428
|
-
type:
|
|
429
|
-
paths: [
|
|
434
|
+
type: "reload-server",
|
|
435
|
+
paths: ["public/**/*.txt"],
|
|
430
436
|
},
|
|
431
437
|
{
|
|
432
|
-
type:
|
|
433
|
-
paths: [
|
|
438
|
+
type: "reload-page",
|
|
439
|
+
paths: ["public/**/*.json"],
|
|
434
440
|
},
|
|
435
441
|
],
|
|
436
442
|
},
|
|
437
|
-
})
|
|
443
|
+
});
|
|
438
444
|
```
|
|
439
445
|
|
|
440
446
|
- be9b003: Add `source.exclude`.
|
package/dist/cli/main.js
CHANGED
|
@@ -194,9 +194,9 @@ var __webpack_modules__ = {
|
|
|
194
194
|
NW: ()=>debugList,
|
|
195
195
|
fF: ()=>debug
|
|
196
196
|
});
|
|
197
|
-
var
|
|
198
|
-
var
|
|
199
|
-
var
|
|
197
|
+
var _rsbuild_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("@rsbuild/core");
|
|
198
|
+
var picocolors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
199
|
+
var picocolors__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/ __webpack_require__.n(picocolors__WEBPACK_IMPORTED_MODULE_1__);
|
|
200
200
|
const isDebug = ()=>{
|
|
201
201
|
if (!process.env['DEBUG']) return false;
|
|
202
202
|
const values = process.env['DEBUG'].toLocaleLowerCase().split(',');
|
|
@@ -206,12 +206,12 @@ var __webpack_modules__ = {
|
|
|
206
206
|
'*'
|
|
207
207
|
].some((key)=>values.includes(key));
|
|
208
208
|
};
|
|
209
|
-
const label =
|
|
209
|
+
const label = picocolors__WEBPACK_IMPORTED_MODULE_1___default().bgCyan('lynx');
|
|
210
210
|
const debug = (message)=>{
|
|
211
211
|
if (isDebug()) {
|
|
212
212
|
const result = 'string' == typeof message ? message : message();
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
_rsbuild_core__WEBPACK_IMPORTED_MODULE_0__.logger.level = 'verbose';
|
|
214
|
+
_rsbuild_core__WEBPACK_IMPORTED_MODULE_0__.logger.debug(`${label} ${result}`);
|
|
215
215
|
}
|
|
216
216
|
};
|
|
217
217
|
const debugList = (prefix, messages)=>debug(()=>`${prefix} ${[
|
package/dist/index.d.ts
CHANGED
|
@@ -179,7 +179,6 @@ export declare interface ChunkSplit {
|
|
|
179
179
|
* react: {
|
|
180
180
|
* test: /node_modules[\\/](@lynx-js[\\/]react|react-router)[\\/]/,
|
|
181
181
|
* name: 'lib-react',
|
|
182
|
-
* chunks: 'all',
|
|
183
182
|
* },
|
|
184
183
|
* },
|
|
185
184
|
* },
|
|
@@ -282,7 +281,6 @@ export declare interface ChunkSplitCustom {
|
|
|
282
281
|
* react: {
|
|
283
282
|
* test: /node_modules[\\/](@lynx-js[\\/]react|react-router)[\\/]/,
|
|
284
283
|
* name: 'lib-react',
|
|
285
|
-
* chunks: 'all',
|
|
286
284
|
* },
|
|
287
285
|
* },
|
|
288
286
|
* },
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__ from "node:fs/
|
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__ from "node:process";
|
|
7
|
-
import
|
|
7
|
+
import node_fs from "node:fs";
|
|
8
8
|
import { pathToFileURL } from "node:url";
|
|
9
9
|
import { register } from "@lynx-js/rspeedy/register";
|
|
10
10
|
var __webpack_modules__ = {
|
|
@@ -439,7 +439,7 @@ const resolveConfigPath = (root, customConfig)=>{
|
|
|
439
439
|
if (customConfig) {
|
|
440
440
|
(0, debug.fF)(`load custom config file ${customConfig} from ${root}`);
|
|
441
441
|
const customConfigPath = (0, external_node_path_.isAbsolute)(customConfig) ? customConfig : (0, external_node_path_.join)(root, customConfig);
|
|
442
|
-
if (
|
|
442
|
+
if (node_fs.existsSync(customConfigPath)) return customConfigPath;
|
|
443
443
|
throw new Error(`Cannot find config file: ${picocolors_default().dim(customConfigPath)}`);
|
|
444
444
|
}
|
|
445
445
|
const CONFIG_FILES = [
|
|
@@ -451,7 +451,7 @@ const resolveConfigPath = (root, customConfig)=>{
|
|
|
451
451
|
for (const file of CONFIG_FILES){
|
|
452
452
|
(0, debug.fF)(`load default config file ${file} from ${root}`);
|
|
453
453
|
const configFile = (0, external_node_path_.join)(root, file);
|
|
454
|
-
if (
|
|
454
|
+
if (node_fs.existsSync(configFile)) {
|
|
455
455
|
(0, debug.fF)(`default config ${configFile} found`);
|
|
456
456
|
return configFile;
|
|
457
457
|
}
|
package/dist/register/hooks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { URL } from "node:url";
|
|
2
|
-
import
|
|
2
|
+
import typescript from "typescript";
|
|
3
3
|
const FLAG_REPLACE_WITH_OPEN_PAREN = 1;
|
|
4
4
|
const FLAG_REPLACE_WITH_CLOSE_PAREN = 2;
|
|
5
5
|
const FLAG_REPLACE_WITH_SEMI = 3;
|
|
@@ -67,17 +67,17 @@ class BlankString {
|
|
|
67
67
|
return out + input.slice(previousEnd);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
const SK =
|
|
70
|
+
const SK = typescript.SyntaxKind;
|
|
71
71
|
const VISIT_BLANKED = "";
|
|
72
72
|
const VISITED_JS = null;
|
|
73
73
|
const languageOptions = {
|
|
74
|
-
languageVersion:
|
|
75
|
-
impliedNodeFormat:
|
|
74
|
+
languageVersion: typescript.ScriptTarget.ESNext,
|
|
75
|
+
impliedNodeFormat: typescript.ModuleKind.ESNext
|
|
76
76
|
};
|
|
77
|
-
const scanner =
|
|
78
|
-
if (
|
|
79
|
-
languageOptions.jsDocParsingMode =
|
|
80
|
-
scanner.setJSDocParsingMode(
|
|
77
|
+
const scanner = typescript.createScanner(typescript.ScriptTarget.ESNext, true, typescript.LanguageVariant.Standard);
|
|
78
|
+
if (typescript.JSDocParsingMode) {
|
|
79
|
+
languageOptions.jsDocParsingMode = typescript.JSDocParsingMode.ParseNone;
|
|
80
|
+
scanner.setJSDocParsingMode(typescript.JSDocParsingMode.ParseNone);
|
|
81
81
|
}
|
|
82
82
|
let src = "";
|
|
83
83
|
let str = new BlankString("");
|
|
@@ -86,7 +86,7 @@ let onError;
|
|
|
86
86
|
let seenJS = false;
|
|
87
87
|
let parentStatement;
|
|
88
88
|
function tsBlankSpace(input, onErrorArg) {
|
|
89
|
-
return blankSourceFile(
|
|
89
|
+
return blankSourceFile(typescript.createSourceFile("input.ts", input, languageOptions, false, typescript.ScriptKind.TS), onErrorArg);
|
|
90
90
|
}
|
|
91
91
|
function blankSourceFile(source, onErrorArg) {
|
|
92
92
|
try {
|
|
@@ -110,7 +110,7 @@ function blankSourceFile(source, onErrorArg) {
|
|
|
110
110
|
}
|
|
111
111
|
function visitUnknownNodeArray(nodes) {
|
|
112
112
|
if (0 === nodes.length) return VISITED_JS;
|
|
113
|
-
return visitNodeArray(nodes,
|
|
113
|
+
return visitNodeArray(nodes, typescript.isStatement(nodes[0]), false);
|
|
114
114
|
}
|
|
115
115
|
function visitNodeArray(nodes, isStatementLike, isFunctionBody) {
|
|
116
116
|
const previousParentStatement = parentStatement;
|
|
@@ -371,7 +371,7 @@ function visitImportDeclaration(node) {
|
|
|
371
371
|
return VISIT_BLANKED;
|
|
372
372
|
}
|
|
373
373
|
const { namedBindings } = node.importClause;
|
|
374
|
-
if (namedBindings &&
|
|
374
|
+
if (namedBindings && typescript.isNamedImports(namedBindings)) {
|
|
375
375
|
const elements = namedBindings.elements;
|
|
376
376
|
for(let i = 0; i < elements.length; i++){
|
|
377
377
|
const e = elements[i];
|
|
@@ -387,7 +387,7 @@ function visitExportDeclaration(node) {
|
|
|
387
387
|
return VISIT_BLANKED;
|
|
388
388
|
}
|
|
389
389
|
const { exportClause } = node;
|
|
390
|
-
if (exportClause &&
|
|
390
|
+
if (exportClause && typescript.isNamedExports(exportClause)) {
|
|
391
391
|
const elements = exportClause.elements;
|
|
392
392
|
for(let i = 0; i < elements.length; i++){
|
|
393
393
|
const e = elements[i];
|
|
@@ -405,7 +405,7 @@ function visitExportAssignment(node) {
|
|
|
405
405
|
return VISITED_JS;
|
|
406
406
|
}
|
|
407
407
|
function visitModule(node) {
|
|
408
|
-
if (node.flags &
|
|
408
|
+
if (node.flags & typescript.NodeFlags.GlobalAugmentation || node.flags & typescript.NodeFlags.Namespace && (node.modifiers && modifiersContainsDeclare(node.modifiers) || !valueNamespaceWorker(node)) || node.name.kind === SK.StringLiteral) {
|
|
409
409
|
blankStatement(node);
|
|
410
410
|
return VISIT_BLANKED;
|
|
411
411
|
}
|
|
@@ -432,7 +432,7 @@ function valueNamespaceWorker(node) {
|
|
|
432
432
|
}
|
|
433
433
|
case SK.ModuleDeclaration:
|
|
434
434
|
{
|
|
435
|
-
if (!(node.flags &
|
|
435
|
+
if (!(node.flags & typescript.NodeFlags.Namespace)) return true;
|
|
436
436
|
const { body } = node;
|
|
437
437
|
if (!body) return false;
|
|
438
438
|
if (body.kind === SK.ModuleDeclaration) return valueNamespaceWorker(body);
|
package/dist/register/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import node_module from "node:module";
|
|
2
2
|
function register() {
|
|
3
|
-
if (!
|
|
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",
|
|
6
6
|
" - Use `lynx.config.js` instead of `lynx.config.ts`"
|
|
7
7
|
].join('\n'));
|
|
8
8
|
const { port1, port2 } = new MessageChannel();
|
|
9
|
-
|
|
9
|
+
node_module.register(`./hooks.js?${Date.now()}`, import.meta.url, {
|
|
10
10
|
parentURL: import.meta.url,
|
|
11
11
|
data: {
|
|
12
12
|
port: port2
|