Skip to content

Commit

Permalink
Allow building standalone file. Switch to jsbt for tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Mar 17, 2024
1 parent 3d3663d commit 3c7f760
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 30 deletions.
1 change: 0 additions & 1 deletion .github/funding.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
github: paulmillr
# custom: https://paulmillr.com/funding/
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node CI
name: Run node.js tests
on:
- push
- pull_request
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Package to npm
name: Publish package to npm
on:
release:
types: [created]
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/upload-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Upload standalone file to GitHub Releases
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: npm
- run: npm install -g npm
- run: npm ci
- run: npm run build
- run: |
cd build
npm ci
npm run build:release
cd ..
- run: gh release upload ${{ github.event.release.tag_name }} build/`npx jsbt outfile`
env:
GH_TOKEN: ${{ github.token }}
22 changes: 19 additions & 3 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"micro-packed": "^0.5.1"
},
"devDependencies": {
"@paulmillr/jsbt": "0.1.0",
"micro-should": "0.4.0",
"prettier": "3.1.1",
"typescript": "5.3.2"
Expand Down
21 changes: 4 additions & 17 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
{
"extends": "@paulmillr/jsbt/tsconfigs/esm.json",
"compilerOptions": {
"target": "es2020",
"lib": ["es2020"],
"strict": true,
"sourceMap": false,
"allowSyntheticDefaultImports": false,
"allowUnreachableCode": false,
"esModuleInterop": false,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"baseUrl": ".",

"module": "es2020",
"outDir": "lib/esm",
"moduleResolution": "bundler"
"moduleResolution": "bundler",
"outDir": "lib/esm"
},
"include": ["index.ts"],
"include": ["index.ts", "src"],
"exclude": ["node_modules", "lib"]
}
12 changes: 5 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"extends": "./tsconfig.esm.json",
"extends": "@paulmillr/jsbt/tsconfigs/cjs.json",
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node10",
"outDir": "lib",
"declaration": true,
"declarationMap": true
}
"outDir": "lib"
},
"include": ["index.ts", "src"],
"exclude": ["node_modules", "lib"]
}

0 comments on commit 3c7f760

Please sign in to comment.