rsbuild-plugin-dts 0.19.0 → 0.19.2
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/dist/index.js +10 -8
- package/dist/tsgo.js +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -24,8 +24,10 @@ const pluginDts = (options = {})=>({
|
|
|
24
24
|
options.redirect.extension = options.redirect.extension ?? false;
|
|
25
25
|
options.alias = options.alias ?? {};
|
|
26
26
|
options.tsgo = options.tsgo ?? false;
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
let dtsPromise = Promise.resolve({
|
|
28
|
+
status: 'success'
|
|
29
|
+
});
|
|
30
|
+
let promiseResult;
|
|
29
31
|
let childProcesses = [];
|
|
30
32
|
api.onBeforeEnvironmentCompile(async ({ isWatch, isFirstCompile, environment })=>{
|
|
31
33
|
if (!isFirstCompile && !options.tsgo) return;
|
|
@@ -68,7 +70,7 @@ const pluginDts = (options = {})=>({
|
|
|
68
70
|
loggerLevel: loggerLevel
|
|
69
71
|
};
|
|
70
72
|
childProcess.send(dtsGenOptions);
|
|
71
|
-
|
|
73
|
+
dtsPromise = new Promise((resolve)=>{
|
|
72
74
|
childProcess.on('message', (message)=>{
|
|
73
75
|
if ('success' === message) resolve({
|
|
74
76
|
status: 'success'
|
|
@@ -78,24 +80,24 @@ const pluginDts = (options = {})=>({
|
|
|
78
80
|
errorMessage: `Error occurred in ${environment.name} declaration files generation.`
|
|
79
81
|
});
|
|
80
82
|
});
|
|
81
|
-
})
|
|
83
|
+
});
|
|
82
84
|
});
|
|
83
85
|
api.onAfterBuild({
|
|
84
86
|
handler: async ({ isFirstCompile })=>{
|
|
85
87
|
if (!isFirstCompile) return;
|
|
86
|
-
|
|
88
|
+
promiseResult = await dtsPromise;
|
|
87
89
|
},
|
|
88
90
|
order: 'pre'
|
|
89
91
|
});
|
|
90
92
|
api.onAfterBuild(({ isFirstCompile })=>{
|
|
91
93
|
if (!isFirstCompile) return;
|
|
92
|
-
|
|
94
|
+
if ('error' === promiseResult.status) {
|
|
93
95
|
if (options.abortOnError) {
|
|
94
|
-
const error = new Error(
|
|
96
|
+
const error = new Error(promiseResult.errorMessage);
|
|
95
97
|
error.stack = '';
|
|
96
98
|
throw error;
|
|
97
99
|
}
|
|
98
|
-
|
|
100
|
+
promiseResult.errorMessage && logger.error(promiseResult.errorMessage);
|
|
99
101
|
logger.warn('With `abortOnError` configuration currently disabled, type errors will not fail the build, but proper type declaration output cannot be guaranteed.');
|
|
100
102
|
}
|
|
101
103
|
});
|
package/dist/tsgo.js
CHANGED
|
@@ -75,7 +75,7 @@ async function emitDtsTsgo(options, _onComplete, bundle = false, isWatch = false
|
|
|
75
75
|
childProcess.stdout?.on('data', (data)=>{
|
|
76
76
|
const output = data.toString();
|
|
77
77
|
const lines = output.split('\n');
|
|
78
|
-
for (const line of lines)if (line.trim())
|
|
78
|
+
for (const line of lines)if (line.trim()) logger.log(picocolors.reset(`${logPrefixTsgo} ${line}`));
|
|
79
79
|
});
|
|
80
80
|
childProcess.stderr?.on('data', (data)=>{
|
|
81
81
|
const output = data.toString();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsbuild-plugin-dts",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.2",
|
|
4
4
|
"description": "Rsbuild plugin that supports emitting declaration files for TypeScript.",
|
|
5
5
|
"homepage": "https://rslib.rs",
|
|
6
6
|
"bugs": {
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@microsoft/api-extractor": "^7.55.2",
|
|
33
|
-
"@rsbuild/core": "
|
|
34
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
33
|
+
"@rsbuild/core": "1.7.1",
|
|
34
|
+
"@typescript/native-preview": "7.0.0-dev.20260111.1",
|
|
35
35
|
"magic-string": "^0.30.21",
|
|
36
36
|
"picocolors": "1.1.1",
|
|
37
37
|
"prebundle": "1.6.0",
|
|
38
38
|
"rsbuild-plugin-publint": "^0.3.3",
|
|
39
|
-
"rslib": "npm:@rslib/core@0.
|
|
39
|
+
"rslib": "npm:@rslib/core@0.19.1",
|
|
40
40
|
"tinyglobby": "0.2.14",
|
|
41
41
|
"tsconfig-paths": "^4.2.0",
|
|
42
42
|
"typescript": "^5.9.3",
|