Skip to content

Commit

Permalink
Change: prepare npmjs.com build by change package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
NobleMajo committed Jan 18, 2025
1 parent 9443d6f commit 983d7d0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Commit and push changes
uses: EndBug/add-and-commit@v9
with:
add: 'package*.json'
add: 'package*.json bun.lockb'
message: 'Bot: bun deps update'

- name: Store build artifacts
Expand All @@ -42,6 +42,7 @@ jobs:
path: |
dist
package*.json
bun.lockb
publish-npm:
needs: update-deps
Expand All @@ -59,6 +60,11 @@ jobs:
uses: actions/download-artifact@v4
with:
name: build-artifacts

- name: Prepare npm build
run: |
sed -i 's!./src!./dist!g' ./package.json
bun i
- name: Publish to npmjs.com
run: bun publish
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ jobs:
uses: actions/download-artifact@v4
with:
name: build-artifacts

- name: Prepare npm build
run: |
sed -i 's!./src!./dist!g' ./package.json
bun i
- name: Publish to npmjs.com
run: bun publish
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
"version": "1.1.1",
"description": "A fast, Express-like router for the high-performance bun.serve() HTTP server.",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./src/index.cjs",
"module": "./src/index.js",
"types": "./src/index.d.ts",
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
"types": "./src/index.d.ts",
"import": "./src/index.js",
"require": "./src/index.cjs"
},
"scripts": {
"bump": "bun --print \"const pkg = await Bun.file('package.json').json(); pkg.version = pkg.version.split('.').map((v, i) => i===2?+v+1:v).join('.'); await Bun.write('package.json', JSON.stringify(pkg, null, 2)); export default pkg.version\"",
"test": "bun test",
"build": "bun run .github/build.ts"
},
"files": [
"dist"
"./src"
],
"keywords": [
"bun",
Expand Down

0 comments on commit 983d7d0

Please sign in to comment.