Skip to content

Commit 96c02c7

Browse files
committed
Standardise artifacts across packages
1 parent 95e723d commit 96c02c7

7 files changed

Lines changed: 59 additions & 31 deletions

File tree

packages/delegation-abis/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.11.0",
44
"description": "ABIs mapped to versions of the Delegation Framework contracts",
55
"license": "(MIT-0 OR Apache-2.0)",
6+
"type": "module",
67
"keywords": [
78
"MetaMask",
89
"Ethereum"
@@ -18,7 +19,7 @@
1819
"author": "MetaMask <hello@metamask.io>",
1920
"sideEffects": false,
2021
"contributors": [],
21-
"main": "./dist/index.js",
22+
"main": "./dist/index.cjs",
2223
"module": "./dist/index.mjs",
2324
"types": "./dist/index.d.ts",
2425
"files": [
@@ -28,11 +29,11 @@
2829
"exports": {
2930
".": {
3031
"require": {
31-
"types": "./dist/index.d.ts",
32-
"default": "./dist/index.js"
32+
"types": "./dist/index.d.cts",
33+
"default": "./dist/index.cjs"
3334
},
3435
"import": {
35-
"types": "./dist/index.d.mts",
36+
"types": "./dist/index.d.ts",
3637
"default": "./dist/index.mjs"
3738
}
3839
},
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1+
import type { Options } from 'tsup';
12
import config from '../../shared/config/base.tsup.config';
2-
export default config;
3+
4+
const options: Options = {
5+
...config,
6+
entry: ['src/index.ts'],
7+
dts: {
8+
entry: ['src/index.ts'],
9+
},
10+
};
11+
12+
export default options;

packages/delegation-core/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"author": "MetaMask <hello@metamask.io>",
2020
"sideEffects": false,
2121
"contributors": [],
22-
"main": "./dist/index.js",
23-
"module": "./dist/index.js",
22+
"main": "./dist/index.cjs",
23+
"module": "./dist/index.mjs",
2424
"types": "./dist/index.d.ts",
2525
"files": [
2626
"dist/**",
@@ -29,11 +29,11 @@
2929
"exports": {
3030
".": {
3131
"require": {
32-
"types": "./dist/index.d.ts",
33-
"default": "./dist/index.js"
32+
"types": "./dist/index.d.cts",
33+
"default": "./dist/index.cjs"
3434
},
3535
"import": {
36-
"types": "./dist/index.d.mts",
36+
"types": "./dist/index.d.ts",
3737
"default": "./dist/index.mjs"
3838
}
3939
},

packages/delegation-deployments/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.12.0",
44
"description": "A history of deployments of the Delegation Framework",
55
"license": "(MIT-0 OR Apache-2.0)",
6+
"type": "module",
67
"keywords": [
78
"MetaMask",
89
"Ethereum"
@@ -15,7 +16,7 @@
1516
"type": "git",
1617
"url": "https://github.com/metamask/delegation-toolkit.git"
1718
},
18-
"main": "./dist/index.js",
19+
"main": "./dist/index.cjs",
1920
"module": "./dist/index.mjs",
2021
"types": "./dist/index.d.ts",
2122
"files": [
@@ -25,11 +26,11 @@
2526
"exports": {
2627
".": {
2728
"require": {
28-
"types": "./dist/index.d.ts",
29-
"default": "./dist/index.js"
29+
"types": "./dist/index.d.cts",
30+
"default": "./dist/index.cjs"
3031
},
3132
"import": {
32-
"types": "./dist/index.d.mts",
33+
"types": "./dist/index.d.ts",
3334
"default": "./dist/index.mjs"
3435
}
3536
},
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1+
import type { Options } from 'tsup';
12
import config from '../../shared/config/base.tsup.config';
2-
export default config;
3+
4+
const options: Options = {
5+
...config,
6+
entry: ['src/index.ts'],
7+
dts: {
8+
entry: ['src/index.ts'],
9+
},
10+
};
11+
12+
export default options;

packages/delegation-toolkit/package.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,57 +20,58 @@
2020
"dist/**",
2121
"dist/"
2222
],
23-
"main": "./dist/index.js",
23+
"main": "./dist/index.cjs",
24+
"module": "./dist/index.mjs",
2425
"types": "./dist/index.d.ts",
2526
"exports": {
2627
".": {
2728
"require": {
28-
"types": "./dist/index.d.ts",
29-
"default": "./dist/index.js"
29+
"types": "./dist/index.d.cts",
30+
"default": "./dist/index.cjs"
3031
},
3132
"import": {
32-
"types": "./dist/index.d.mts",
33+
"types": "./dist/index.d.ts",
3334
"default": "./dist/index.mjs"
3435
}
3536
},
3637
"./utils": {
3738
"require": {
38-
"types": "./dist/utils/index.d.ts",
39+
"types": "./dist/utils/index.d.cts",
3940
"default": "./dist/utils/index.cjs"
4041
},
4142
"import": {
42-
"types": "./dist/utils/index.d.mts",
43-
"default": "./dist/utils/index.js"
43+
"types": "./dist/utils/index.d.ts",
44+
"default": "./dist/utils/index.mjs"
4445
}
4546
},
4647
"./contracts": {
4748
"require": {
48-
"types": "./dist/contracts/index.d.ts",
49+
"types": "./dist/contracts/index.d.cts",
4950
"default": "./dist/contracts/index.cjs"
5051
},
5152
"import": {
52-
"types": "./dist/contracts/index.d.mts",
53-
"default": "./dist/contracts/index.js"
53+
"types": "./dist/contracts/index.d.ts",
54+
"default": "./dist/contracts/index.mjs"
5455
}
5556
},
5657
"./actions": {
5758
"require": {
58-
"types": "./dist/actions/index.d.ts",
59+
"types": "./dist/actions/index.d.cts",
5960
"default": "./dist/actions/index.cjs"
6061
},
6162
"import": {
62-
"types": "./dist/actions/index.d.mts",
63-
"default": "./dist/actions/index.js"
63+
"types": "./dist/actions/index.d.ts",
64+
"default": "./dist/actions/index.mjs"
6465
}
6566
},
6667
"./experimental": {
6768
"require": {
68-
"types": "./dist/experimental/index.d.ts",
69+
"types": "./dist/experimental/index.d.cts",
6970
"default": "./dist/experimental/index.cjs"
7071
},
7172
"import": {
72-
"types": "./dist/experimental/index.d.mts",
73-
"default": "./dist/experimental/index.js"
73+
"types": "./dist/experimental/index.d.ts",
74+
"default": "./dist/experimental/index.mjs"
7475
}
7576
},
7677
"./package.json": "./package.json"

shared/config/base.tsup.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,9 @@ export default defineConfig({
4141
bundle: true,
4242
skipNodeModulesBundle: true,
4343
outDir: 'dist',
44+
outExtension({ format }) {
45+
return {
46+
js: `.${format === 'cjs' ? 'cjs' : 'mjs'}`,
47+
};
48+
},
4449
});

0 commit comments

Comments
 (0)