Skip to content

Commit e18f07b

Browse files
fix(dts-plugin): align workspace entrypoints and RawSource typing
Resolve the dts-plugin TYPE-001 failure by correcting package entry paths for workspace dependencies and updating RawSource usage for webpack typings. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent ab21e4d commit e18f07b

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

packages/dts-plugin/src/plugins/GenerateTypesPlugin.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ export class GenerateTypesPlugin implements WebpackPluginInstance {
172172
compilation.emitAsset(
173173
zipName,
174174
new compiler.webpack.sources.RawSource(
175-
fs.readFileSync(zipTypesPath),
176-
false,
175+
fs.readFileSync(zipTypesPath) as unknown as string,
177176
),
178177
);
179178
}
@@ -186,8 +185,7 @@ export class GenerateTypesPlugin implements WebpackPluginInstance {
186185
compilation.emitAsset(
187186
apiFileName,
188187
new compiler.webpack.sources.RawSource(
189-
fs.readFileSync(apiTypesPath),
190-
false,
188+
fs.readFileSync(apiTypesPath) as unknown as string,
191189
),
192190
);
193191
}

packages/error-codes/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
"browser": {
2626
"url": false
2727
},
28-
"main": "./dist/index.cjs.js",
29-
"module": "./dist/index.esm.mjs",
28+
"main": "./dist/index.cjs",
29+
"module": "./dist/index.mjs",
3030
"types": "./dist/index.d.ts",
3131
"exports": {
3232
".": {
3333
"types": "./dist/index.d.ts",
34-
"import": "./dist/index.esm.mjs",
35-
"require": "./dist/index.cjs.js"
34+
"import": "./dist/index.mjs",
35+
"require": "./dist/index.cjs"
3636
}
3737
},
3838
"typesVersions": {

packages/sdk/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
},
2424
"author": "zhanghang <hanric.zhang@gmail.com>",
2525
"sideEffects": false,
26-
"main": "./dist/index.cjs.cjs",
27-
"module": "./dist/index.esm.js",
26+
"main": "./dist/index.cjs",
27+
"module": "./dist/index.js",
2828
"types": "./dist/index.d.ts",
2929
"browser": {
3030
"url": false
@@ -33,21 +33,21 @@
3333
".": {
3434
"import": {
3535
"types": "./dist/index.d.ts",
36-
"default": "./dist/index.esm.js"
36+
"default": "./dist/index.js"
3737
},
3838
"require": {
3939
"types": "./dist/index.d.ts",
40-
"default": "./dist/index.cjs.cjs"
40+
"default": "./dist/index.cjs"
4141
}
4242
},
4343
"./normalize-webpack-path": {
4444
"import": {
4545
"types": "./dist/normalize-webpack-path.d.ts",
46-
"default": "./dist/normalize-webpack-path.esm.js"
46+
"default": "./dist/normalize-webpack-path.js"
4747
},
4848
"require": {
4949
"types": "./dist/normalize-webpack-path.d.ts",
50-
"default": "./dist/normalize-webpack-path.cjs.cjs"
50+
"default": "./dist/normalize-webpack-path.cjs"
5151
}
5252
}
5353
},

0 commit comments

Comments
 (0)