Skip to content

Commit

Permalink
Update token-swap js build
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque committed Nov 8, 2023
1 parent ce0fb1d commit 7563d76
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 177 deletions.
141 changes: 3 additions & 138 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion token-swap/js/.eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/dist
/lib
2 changes: 1 addition & 1 deletion token-swap/js/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
test-ledger/
dist/
lib/
27 changes: 15 additions & 12 deletions token-swap/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.4.0",
"description": "SPL Token Swap JavaScript API",
"license": "MIT",
"type": "module",
"author": "Solana Labs Maintainers <[email protected]>",
"homepage": "https://solana.com/",
"repository": {
Expand All @@ -15,23 +16,23 @@
"publishConfig": {
"access": "public"
},
"main": "dist/cjs/index.js",
"types": "dist/types/index.d.ts",
"module": "dist/esm/index.js",
"main": "lib/cjs/index.js",
"types": "lib/types/index.d.ts",
"module": "lib/esm/index.js",
"sideEffects": false,
"exports": {
"types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
"types": "./lib/types/index.d.ts",
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js"
},
"files": [
"dist",
"lib",
"src",
"README.md"
],
"scripts": {
"build": "tsc -p tsconfig.json && tsc-esm -p tsconfig.json && tsc -p tsconfig.cjs.json",
"postbuild": "echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json && echo '{\"type\":\"module\"}' > dist/esm/package.json",
"build": "tsc --build --verbose tsconfig.all.json",
"postbuild": "echo '{\"type\":\"commonjs\"}' > lib/cjs/package.json && echo '{\"type\":\"module\"}' > lib/esm/package.json",
"test": "mocha test",
"start-with-test-validator": "start-server-and-test 'solana-test-validator --bpf-program SwapsVeCiPHMUAtzQWZw7RjsKjgCjhwU55QGu4U1Szw ../../target/deploy/spl_token_swap.so --reset --quiet' http://127.0.0.1:8899/health test",
"lint": "npm run pretty && eslint --max-warnings 0 .",
Expand All @@ -43,11 +44,14 @@
"keywords": [],
"dependencies": {
"@solana/buffer-layout": "^4.0.0",
"@solana/buffer-layout-utils": "^0.2.0",
"@solana/buffer-layout-utils": "^0.2.0"
},
"peerDependencies": {
"@solana/web3.js": "^1.42.0"
},
"devDependencies": {
"@solana/spl-token": "workspace:*",
"@solana/web3.js": "^1.42.0",
"@types/bn.js": "^5.1.0",
"@types/chai-as-promised": "^7.1.4",
"@types/chai": "^4.3.3",
Expand All @@ -60,7 +64,6 @@
"prettier": "^3.0.0",
"start-server-and-test": "^2.0.0",
"ts-node": "^10.0.0",
"typescript": "^5.0.4",
"typescript-esm": "^2.0.0"
"typescript": "^5.0.4"
}
}
11 changes: 11 additions & 0 deletions token-swap/js/tsconfig.all.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.root.json",
"references": [
{
"path": "./tsconfig.cjs.json"
},
{
"path": "./tsconfig.esm.json"
}
]
}
14 changes: 14 additions & 0 deletions token-swap/js/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"include": [],
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node",
"esModuleInterop": true,
"isolatedModules": true,
"noEmitOnError": true,
"resolveJsonModule": true,
"strict": true,
"stripInternal": true
}
}
12 changes: 6 additions & 6 deletions token-swap/js/tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": "./tsconfig.json",
"extends": "./tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"outDir": "dist/cjs",
"declarationDir": null,
"declaration": false
"outDir": "lib/cjs",
"target": "ES2016",
"module": "CommonJS",
"sourceMap": true
}
}
13 changes: 13 additions & 0 deletions token-swap/js/tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "./tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"outDir": "lib/esm",
"declarationDir": "lib/types",
"target": "ES2020",
"module": "ES2020",
"sourceMap": true,
"declaration": true,
"declarationMap": true
}
}
Loading

0 comments on commit 7563d76

Please sign in to comment.