Skip to content

Commit 0034b72

Browse files
committed
fix: Invalid 'main' field in 'package.json', close #15
1 parent d59e2d7 commit 0034b72

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
- run: npm publish
3535
env:
3636
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
37-
working-directory: lib
37+
working-directory: pkg

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.vscode
22
/node_modules
33
/lib
4+
/pkg
45
/dist
56
/test/out
67
/test/zips

build.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as fs from "node:fs/promises";
22

3-
await fs.copyFile("./LICENSE", "./lib/LICENSE");
4-
await fs.copyFile("./README.md", "./lib/README.md");
5-
await fs.copyFile("./package.json", "./lib/package.json");
3+
await fs.copyFile("./LICENSE", "./pkg/LICENSE");
4+
await fs.copyFile("./README.md", "./pkg/README.md");
5+
await fs.copyFile("./package.json", "./pkg/package.json");

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
"version": "1.1.1",
44
"description": "zip and unzip library for node",
55
"main": "lib/index.js",
6+
"types": "./lib/index.d.ts",
67
"scripts": {
78
"compile": "rimraf ./dist && tsc -p ./src/tsconfig.json",
8-
"release": "rimraf ./lib && tsc -p ./src/tsconfig.release.json && node ./build.mjs",
9+
"release": "rimraf ./pkg && npm run tsc-cjs && node ./build.mjs",
10+
"tsc-cjs": "tsc -p ./src/tsconfig.production.cjs.json",
911
"compile-test": "rimraf ./test/out && tsc -p ./test/src/tsconfig.json",
1012
"test": "npm run compile && npm run compile-test && node ./test/src/before.js && mocha ./test/out --timeout 10000"
1113
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "./tsconfig.base.json",
33
"compilerOptions": {
44
"target": "es2017",
5-
"outDir": "../lib",
5+
"outDir": "../pkg/lib",
66
"sourceMap": false,
77
}
88
}

0 commit comments

Comments
 (0)