Skip to content

Commit ab1e622

Browse files
Mrtenznaugtur
authored andcommitted
Build packages with tsup (#2120)
This changes all packages to be built with `tsup`, instead of SWC. `tsup` uses `esbuild` under the hood, so performance should be comparable. More context here: MetaMask/utils#144.
1 parent 51a1d04 commit ab1e622

File tree

34 files changed

+182
-248
lines changed

34 files changed

+182
-248
lines changed

.github/workflows/build-lint-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ jobs:
4848
runs-on: ubuntu-latest
4949
needs: prepare
5050
steps:
51-
- uses: actions/checkout@v4
51+
- uses: actions/checkout@v3
5252
- name: Setup Node
53-
uses: actions/setup-node@v4
53+
uses: actions/setup-node@v3
5454
with:
5555
node-version-file: '.nvmrc'
5656
cache: yarn

constraints.pro

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ gen_enforced_field(WorkspaceCwd, 'files', ['dist']) :-
194194
\+ is_example(WorkspaceCwd),
195195
\+ workspace_field(WorkspaceCwd, 'private', true),
196196
WorkspaceCwd \= '.',
197-
WorkspaceCwd \= 'packages/snaps-jest',
198-
WorkspaceCwd \= 'packages/snaps-cli'.
197+
WorkspaceCwd \= 'packages/snaps-jest'.
199198
gen_enforced_field(WorkspaceCwd, 'files', ['dist', 'jest-preset.js']) :-
200199
WorkspaceCwd = 'packages/snaps-jest'.
201200

@@ -205,9 +204,8 @@ gen_enforced_field(WorkspaceCwd, 'scripts.build', 'tsup --clean && yarn build:ty
205204
\+ workspace_field(WorkspaceCwd, 'private', true),
206205
WorkspaceCwd \= '.',
207206
WorkspaceCwd \= 'packages/snaps-simulator',
208-
WorkspaceCwd \= 'packages/snaps-cli',
209-
WorkspaceCwd \= 'packages/snaps-execution-environments'.
210-
gen_enforced_field(WorkspaceCwd, 'scripts.build:types', 'tsc --project tsconfig.build.json') :-
207+
WorkspaceCwd \= 'packages/snaps-cli'.
208+
gen_enforced_field(WorkspaceCwd, 'build:types', 'tsc --project tsconfig.build.json') :-
211209
\+ is_example(WorkspaceCwd),
212210
\+ workspace_field(WorkspaceCwd, 'private', true),
213211
WorkspaceCwd \= '.'.

packages/create-snap/tsup.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ const { default: baseConfig } = require('../../tsup.config');
99

1010
const config: Options = {
1111
name: packageJson.name,
12-
external: ['@metamask/create-snap'],
13-
platform: 'node',
1412
};
1513

1614
export default deepmerge<Options>(baseConfig, config);

packages/examples/packages/bip32/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "NVydltk67wE3e1uAxlmal62P2EcP+cMfsNZ66EyJ7O4=",
10+
"shasum": "AaLbshZePKcSV2NORnmd5AjzkX5vNQToD3PaE4YpUUQ=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/bip44/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "cGgUQlMw+WDBaoWHvG4s/xaZO47vBrEp9sa+4DhBmTA=",
10+
"shasum": "q5WeZJXrE5mgP2Z6Fo/aJrVuspPsQgsUn3/SmHuwsGY=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/browserify/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "8pImYekIrQ0oaGuxf8Lta25MPIq2td4KPEVQ8jWgos8=",
10+
"shasum": "anrkssxnQgvz6naNxnXCSIHGLkc2FoDcKx0BeDoWR/k=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/cronjobs/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "J8ekYCK9+rqN9d6qBw85RomNqdXMbkB9s1eHnQkaABs=",
10+
"shasum": "wXAAi/QR4BT1Gp6OiSqCpq+3U7pyRtMQ/LP9LeWwEPk=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/dialogs/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "2omN9u/lT2cXPZ3O6j4wG3W3HBn/6No9JxH4ncqUG6M=",
10+
"shasum": "EepV6igtZ0ZCX579Ws6f9u0/kYnp65+6OK1SgzCm9Dg=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/ethers-js/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "dHiE+9mYVkqNRma5GsZprTawv/bDUzcdbeciRzCmkhQ=",
10+
"shasum": "AjzlrjmJQTKwGM77EXcpEzjF9bsKK7up36BSA4qhasU=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/get-entropy/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "dTL+fLvEFKI0vtcRZ0ZGxU2menzmWl3rPuOwnsqNMIQ=",
10+
"shasum": "9jRaEw4/0RCp3b3oAI+PK2zcgwupdOnBhaL4zX4pKRg=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

0 commit comments

Comments
 (0)