From 983d7d0818997f70b9673a4282f7f67eb3efd363 Mon Sep 17 00:00:00 2001 From: root <39386799+NobleMajo@users.noreply.github.com> Date: Sat, 18 Jan 2025 20:41:21 +0000 Subject: [PATCH] Change: prepare npmjs.com build by change package.json --- .github/workflows/auto-update.yml | 8 +++++++- .github/workflows/npm-publish.yml | 5 +++++ package.json | 14 +++++++------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 9f9f892..a678762 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -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 @@ -42,6 +42,7 @@ jobs: path: | dist package*.json + bun.lockb publish-npm: needs: update-deps @@ -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 diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 7bdb992..c204e7b 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -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 diff --git a/package.json b/package.json index f46070d..314c841 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,13 @@ "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\"", @@ -17,7 +17,7 @@ "build": "bun run .github/build.ts" }, "files": [ - "dist" + "./src" ], "keywords": [ "bun",