Skip to content

Commit 8b33b2c

Browse files
committed
add esm build
1 parent 6c44c8c commit 8b33b2c

File tree

6 files changed

+103
-82
lines changed

6 files changed

+103
-82
lines changed

.github/workflows/rust.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ on:
66
paths:
77
- Anchor.toml
88
- .github/workflows/rust.yml
9-
- lib/**
109
- programs/**
1110
- Cargo.*
1211
pull_request:
1312
branches: [master]
1413
paths:
1514
- Anchor.toml
1615
- .github/workflows/rust.yml
17-
- lib/**
1816
- programs/**
1917
- Cargo.*
2018

package.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
"name": "@deploydao/migrator",
3-
"version": "0.2.1",
3+
"version": "0.1.0",
44
"description": "Migration management for Solana programs.",
5-
"main": "dist/index.js",
5+
"main": "dist/cjs/index.js",
6+
"module": "dist/esm/index.js",
67
"keywords": [
78
"solana",
89
"blockchain"
910
],
1011
"bugs": {
1112
"url": "https://github.com/deploydao/migrator/issues",
12-
"email": "[email protected]"
13+
"email": "[email protected]"
1314
},
1415
"repository": {
1516
"type": "git",
1617
"url": "git+https://github.com/deploydao/migrator.git"
1718
},
18-
"author": "Deploy DAO <[email protected]>",
19+
"author": "DeployDAO <[email protected]>",
1920
"homepage": "https://deploydao.com",
2021
"license": "Apache-2.0",
2122
"publishConfig": {
@@ -45,7 +46,7 @@
4546
"eslint-plugin-import": "^2.24.2",
4647
"husky": "^7.0.2",
4748
"lint-staged": "^11.2.0",
48-
"mocha": "^9.1.2",
49+
"mocha": "8",
4950
"prettier": "^2.4.1",
5051
"ts-mocha": "^8.0.0",
5152
"ts-node": "^10.2.1",
@@ -57,7 +58,7 @@
5758
"*.nix": "nixfmt"
5859
},
5960
"scripts": {
60-
"build": "tsc -P tsconfig.build.json",
61+
"build": "rm -fr dist/ && tsc -P tsconfig.build.json && tsc -P tsconfig.esm.json",
6162
"lint": "eslint . --cache",
6263
"test": "anchor test --skip-build tests/*.ts",
6364
"prepare": "husky install",
@@ -69,7 +70,11 @@
6970
"tslib": "^2.3.1"
7071
},
7172
"peerDependencies": {
72-
"@project-serum/anchor": "^0.16.2",
73+
"@project-serum/anchor": "^0.17.0",
74+
"@saberhq/anchor-contrib": "^1.3.14",
75+
"@saberhq/solana-contrib": "^1.3.14",
76+
"@saberhq/token-utils": "^1.3.14",
77+
"@solana/web3.js": "^1.29.2",
7378
"bn.js": "^5.2.0"
7479
},
7580
"packageManager": "[email protected]",

tsconfig.build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"compilerOptions": {
44
"noEmit": false,
55
"declaration": true,
6-
"removeComments": false,
76
"declarationMap": true,
87
"sourceMap": true,
9-
"outDir": "dist/"
8+
"outDir": "dist/cjs/",
9+
"importHelpers": true
1010
},
1111
"include": ["src/"]
1212
}

tsconfig.esm.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.build.json",
3+
"compilerOptions": {
4+
"module": "ES2015",
5+
"outDir": "dist/esm/"
6+
},
7+
"include": ["src/"]
8+
}

tsconfig.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
{
22
"compilerOptions": {
33
"target": "ES2015",
4-
"module": "commonjs",
4+
"module": "CommonJS",
55
"moduleResolution": "node",
6+
67
"strict": true,
7-
"strictFunctionTypes": true,
88
"noImplicitOverride": true,
9-
"esModuleInterop": true,
109
"noUncheckedIndexedAccess": true,
11-
"skipLibCheck": true,
1210
"forceConsistentCasingInFileNames": true,
11+
12+
"esModuleInterop": true,
13+
"skipLibCheck": true,
1314
"resolveJsonModule": true,
1415
"noEmit": true,
15-
"lib": ["ES2019"]
16+
"lib": ["ES2015"]
1617
},
1718
"include": ["./src", "./tests", "scripts/"]
1819
}

0 commit comments

Comments
 (0)