Skip to content

Commit

Permalink
refactor: revert tsconfig.json, remove "type" in package.json, and tu…
Browse files Browse the repository at this point in the history
…ne tsup config
  • Loading branch information
ShookLyngs committed Jul 5, 2024
1 parent a623b44 commit 4f61ed8
Show file tree
Hide file tree
Showing 18 changed files with 334 additions and 305 deletions.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@
"@changesets/cli": "^2.27.1",
"@changesets/get-github-info": "^0.6.0",
"@changesets/types": "^6.0.0",
"@types/lodash": "^4.17.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@types/lodash": "^4.17.0",
"eslint": "^8.56.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"ts-node": "^10.9.2",
"tsup": "^7.2.0",
"vite": "5.2.12",
"vitest": "1.6.0",
"typescript": "^5.4.3"
"tsup": "^8.1.0",
"typescript": "^5.4.3",
"vitest": "1.6.0"
},
"lint-staged": {
"{packages,apps,examples,tests}/**/*.{js,jsx,ts,tsx}": [
Expand Down
18 changes: 9 additions & 9 deletions packages/btc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@
"lint": "tsc && eslint '{src,tests}/**/*.{js,ts}' && prettier --check '{src,tests}/**/*.{js,ts}'",
"lint:fix": "tsc && eslint --fix '{src,tests}/**/*.{js,ts}' && prettier --write '{src,tests}/**/*.{js,ts}'"
},
"type": "module",
"sideEffects": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"src",
"dist"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
"types": "./dist/index.d.js",
"default": "./dist/index.js"
}
},
"./package.json": "./package.json"
},
"files": [
"src",
"dist"
],
"dependencies": {
"@bitcoinerlab/secp256k1": "^1.1.1",
"@ckb-lumos/codec": "0.22.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/btc/src/bitcoin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ECPairFactory, { ECPairInterface } from 'ecpair';
import ecc from '@bitcoinerlab/secp256k1';
import * as bitcoin from 'bitcoinjs-lib';
import { ECPairFactory, ECPairInterface } from 'ecpair';
import { isTaprootInput } from 'bitcoinjs-lib/src/psbt/bip371';
import { isP2TR, isP2WPKH, isP2PKH } from 'bitcoinjs-lib/src/psbt/psbtutils';

Expand Down
19 changes: 19 additions & 0 deletions packages/btc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"moduleResolution": "Bundler",
"module": "ESNext",
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"strict": true,
"noEmit": true,
"allowJs": true,
"sourceMap": true,
"skipLibCheck": true,
"esModuleInterop": true,
"strictNullChecks": true,
"resolveJsonModule": true,
"isolatedModules": true
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
13 changes: 5 additions & 8 deletions packages/btc/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { defineConfig } from 'tsup';

import { dependencies, name } from './package.json';

import config from '../../tsup-base.config';

export default defineConfig({
...config,
name,
name: '@rgbpp-sdk/btc',
dts: true,
clean: true,
sourcemap: true,
format: ['esm', 'cjs'],
entry: ['src/index.ts'],
external: Object.keys(dependencies),
platform: 'browser',
});
18 changes: 9 additions & 9 deletions packages/ckb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
"lint:fix": "tsc && eslint --fix --ext .ts {src,example}/* && prettier --write '{src,example}/**/*.{js,ts}'",
"splitCells": "npx ts-node example/paymaster.ts"
},
"type": "module",
"sideEffects": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"src",
"dist"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./package.json": "./package.json"
},
"files": [
"src",
"dist"
],
"dependencies": {
"@ckb-lumos/base": "^0.22.2",
"@ckb-lumos/codec": "^0.22.2",
Expand Down
27 changes: 27 additions & 0 deletions packages/ckb/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"moduleResolution": "Bundler",
"module": "ESNext",
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"strict": true,
"noEmit": true,
"allowJs": true,
"sourceMap": true,
"skipLibCheck": true,
"esModuleInterop": true,
"strictNullChecks": true,
"resolveJsonModule": true,
"isolatedModules": true
},
"include": ["src"],
"exclude": ["node_modules", "dist", "**/*.spec.ts", "example"],
"ts-node": {
// these options are overrides used only by ts-node
// same as the --compilerOptions flag and the TS_NODE_COMPILER_OPTIONS environment variable
"compilerOptions": {
"module": "CommonJS"
}
}
}
13 changes: 5 additions & 8 deletions packages/ckb/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { defineConfig } from 'tsup';

import { dependencies, name } from './package.json';

import config from '../../tsup-base.config';

export default defineConfig({
...config,
name,
name: '@rgbpp-sdk/ckb',
dts: true,
clean: true,
sourcemap: true,
format: ['esm', 'cjs'],
entry: ['src/index.ts'],
external: Object.keys(dependencies),
platform: 'browser',
});
42 changes: 21 additions & 21 deletions packages/rgbpp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,57 @@
"lint": "tsc && eslint --ext .ts src/* && prettier --check 'src/*.ts'",
"lint:fix": "tsc && eslint --fix --ext .ts src/* && prettier --write 'src/*.ts'"
},
"type": "module",
"sideEffects": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"src",
"dist"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./btc": {
"import": {
"types": "./dist/btc.d.ts",
"default": "./dist/btc.js"
"types": "./dist/btc.d.mts",
"default": "./dist/btc.mjs"
},
"require": {
"types": "./dist/btc.d.cts",
"default": "./dist/btc.cjs"
"types": "./dist/btc.d.ts",
"default": "./dist/btc.js"
}
},
"./ckb": {
"import": {
"types": "./dist/ckb.d.ts",
"default": "./dist/ckb.js"
"types": "./dist/ckb.d.mts",
"default": "./dist/ckb.mjs"
},
"require": {
"types": "./dist/ckb.d.cts",
"default": "./dist/ckb.cjs"
"types": "./dist/ckb.d.ts",
"default": "./dist/ckb.js"
}
},
"./service": {
"import": {
"types": "./dist/service.d.ts",
"default": "./dist/service.js"
"types": "./dist/service.d.mts",
"default": "./dist/service.mjs"
},
"require": {
"types": "./dist/service.d.cts",
"default": "./dist/service.cjs"
"types": "./dist/service.d.ts",
"default": "./dist/service.js"
}
},
"./dist/*": "./dist/*",
"./package.json": "./package.json"
},
"files": [
"src",
"dist"
],
"dependencies": {
"@rgbpp-sdk/btc": "workspace:*",
"@rgbpp-sdk/ckb": "workspace:*",
Expand Down
20 changes: 20 additions & 0 deletions packages/rgbpp/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"moduleResolution": "Bundler",
"module": "ESNext",
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"strict": true,
"noEmit": true,
"allowJs": true,
"sourceMap": true,
"skipLibCheck": true,
"esModuleInterop": true,
"strictNullChecks": true,
"resolveJsonModule": true,
"isolatedModules": true
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist"]
}
13 changes: 5 additions & 8 deletions packages/rgbpp/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { defineConfig } from 'tsup';

import { dependencies, name } from './package.json';

import config from '../../tsup-base.config';

export default defineConfig({
...config,
name,
name: 'rgbpp',
dts: true,
clean: true,
sourcemap: true,
format: ['esm', 'cjs'],
entry: ['src/index.ts', 'src/btc.ts', 'src/ckb.ts', 'src/service.ts'],
external: Object.keys(dependencies),
platform: 'browser',
});
18 changes: 9 additions & 9 deletions packages/service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@
"lint": "tsc && eslint '{src,tests}/**/*.{js,ts}' && prettier --check '{src,tests}/**/*.{js,ts}'",
"lint:fix": "tsc && eslint --fix '{src,tests}/**/*.{js,ts}' && prettier --write '{src,tests}/**/*.{js,ts}'"
},
"type": "module",
"sideEffects": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"src",
"dist"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./package.json": "./package.json"
},
"files": [
"src",
"dist"
],
"dependencies": {
"@ckb-lumos/codec": "0.22.2",
"@ckb-lumos/base": "0.22.2",
Expand Down
19 changes: 19 additions & 0 deletions packages/service/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"moduleResolution": "Bundler",
"module": "ESNext",
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"strict": true,
"noEmit": true,
"allowJs": true,
"sourceMap": true,
"skipLibCheck": true,
"esModuleInterop": true,
"strictNullChecks": true,
"resolveJsonModule": true,
"isolatedModules": true
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
13 changes: 5 additions & 8 deletions packages/service/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { defineConfig } from 'tsup';

import { dependencies, name } from './package.json';

import config from '../../tsup-base.config';

export default defineConfig({
...config,
name,
name: '@rgbpp-sdk/service',
dts: true,
clean: true,
sourcemap: true,
format: ['esm', 'cjs'],
entry: ['src/index.ts'],
external: Object.keys(dependencies),
platform: 'browser',
});
Loading

0 comments on commit 4f61ed8

Please sign in to comment.