Skip to content

Commit 64f5dc4

Browse files
committed
FIX: how release files are organized
1 parent 713a34f commit 64f5dc4

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
node-version: ${{ matrix.node-version }}
2424

2525
- name: Cache ~/.pnpm-store
26-
uses: actions/cache@v3
26+
uses: actions/cache@v4
2727
env:
2828
cache-name: cache-pnpm-store
2929
with:
@@ -71,7 +71,9 @@ jobs:
7171
${{ runner.os }}-
7272
- run: npm i -g pnpm
7373
- run: pnpm i
74-
- run: pnpm run prepublishOnly
74+
- run: pnpm run clean || true
75+
- run: pnpm run build
76+
- run: pnpm run copy-files
7577
- run: pnpm dlx semantic-release@20 --branches main
7678
env:
7779
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.npmignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
src/
2+
test/
3+
.github/
4+
biome.json
5+
renovate.json
6+
tsconfig.json
7+
dist/
8+
*.config.js
9+
*.config.ts
10+
*.log

package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"try-catch",
88
"errors"
99
],
10-
"version": "2.0.0",
10+
"version": "2.0.1",
1111
"repository": {
1212
"type": "git",
1313
"url": "https://github.com/ahme-dev/tryresult.git"
@@ -16,21 +16,25 @@
1616
"access": "public"
1717
},
1818
"files": [
19-
"dist"
19+
"*.js",
20+
"*.mjs",
21+
"*.d.ts"
2022
],
21-
"main": "./dist/index.js",
22-
"module": "./dist/index.mjs",
23+
"main": "./index.js",
24+
"module": "./index.mjs",
2325
"exports": {
24-
"require": "./dist/index.js",
25-
"import": "./dist/index.mjs"
26+
"require": "./index.js",
27+
"import": "./index.mjs"
2628
},
27-
"types": "./dist/index.d.ts",
29+
"types": "./index.d.ts",
2830
"scripts": {
2931
"build-fast": "tsup src --format cjs,esm",
3032
"build": "pnpm run build-fast --dts",
33+
"copy-files": "cp dist/*.js dist/*.mjs dist/*.d.ts .",
34+
"clean": "rm -f *.js *.mjs *.d.ts",
3135
"test": "vitest run",
3236
"size": "size-limit",
33-
"prepublishOnly": "pnpm run build"
37+
"prepublishOnly": "pnpm run clean && pnpm run build && pnpm run copy-files"
3438
},
3539
"size-limit": [
3640
{

0 commit comments

Comments
 (0)