Skip to content

Commit 0de4178

Browse files
committed
build: Migrate to ts-bridge
1 parent 17e7413 commit 0de4178

File tree

4 files changed

+68
-574
lines changed

4 files changed

+68
-574
lines changed

package.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,29 @@
1717
"url": "https://github.com/MetaMask/rpc-errors.git"
1818
},
1919
"license": "MIT",
20-
"author": "Erik Marks <[email protected]>",
20+
"sideEffects": false,
2121
"exports": {
2222
".": {
23-
"import": "./dist/index.mjs",
24-
"require": "./dist/index.js",
25-
"types": "./dist/types/index.d.ts"
23+
"import": {
24+
"types": "./dist/index.d.mts",
25+
"default": "./dist/index.mjs"
26+
},
27+
"require": {
28+
"types": "./dist/index.d.cts",
29+
"default": "./dist/index.cjs"
30+
}
2631
},
2732
"./package.json": "./package.json"
2833
},
29-
"main": "./dist/index.js",
34+
"main": "./dist/index.cjs",
3035
"module": "./dist/index.mjs",
31-
"types": "./dist/types/index.d.ts",
36+
"types": "./dist/index.d.cts",
3237
"files": [
3338
"dist"
3439
],
3540
"scripts": {
36-
"build": "tsup --clean && yarn build:types",
37-
"build:clean": "rimraf dist && yarn build",
41+
"build": "ts-bridge --project tsconfig.build.json --clean",
3842
"build:docs": "typedoc",
39-
"build:types": "tsc --project tsconfig.build.json",
4043
"lint": "yarn lint:eslint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog",
4144
"lint:changelog": "auto-changelog validate --prettier",
4245
"lint:constraints": "yarn constraints",
@@ -60,6 +63,7 @@
6063
"@metamask/eslint-config-jest": "^12.1.0",
6164
"@metamask/eslint-config-nodejs": "^12.1.0",
6265
"@metamask/eslint-config-typescript": "^12.1.0",
66+
"@ts-bridge/cli": "^0.5.1",
6367
"@types/jest": "^28.1.6",
6468
"@types/node": "^16",
6569
"@typescript-eslint/eslint-plugin": "^5.43.0",
@@ -79,7 +83,6 @@
7983
"prettier-plugin-packagejson": "^2.3.0",
8084
"ts-jest": "^28.0.7",
8185
"ts-node": "^10.7.0",
82-
"tsup": "^7.2.0",
8386
"typedoc": "^0.23.28",
8487
"typescript": "~4.9.5"
8588
},
@@ -93,8 +96,7 @@
9396
},
9497
"lavamoat": {
9598
"allowScripts": {
96-
"@lavamoat/preinstall-always-fail": false,
97-
"tsup>esbuild": false
99+
"@lavamoat/preinstall-always-fail": false
98100
}
99101
}
100102
}

tsconfig.build.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4+
"baseUrl": "./",
45
"declaration": true,
56
"declarationMap": true,
67
"emitDeclarationOnly": true,
78
"inlineSources": true,
89
"noEmit": false,
9-
"outDir": "dist/types",
10-
"rootDir": "src",
10+
"outDir": "./dist",
11+
"rootDir": "./src",
1112
"sourceMap": true
1213
},
1314
"include": ["./src/**/*.ts"],

tsup.config.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)