Skip to content

Commit ea7a2a5

Browse files
committed
feat: add publint for package compatibility checks
Add publint tool to ensure the library is compatible with various bundlers and catch common packaging issues. Changes: - Add publint as dev dependency - Add 'lint:package' script to run publint - Add publint step to CI lint workflow - Add 'files' field to ensure dist is published - Convert repository field to standard object format Closes #255 Signed-off-by: ivanauth <[email protected]>
1 parent 969ba4b commit ea7a2a5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/lint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
run: "CI=true yarn run prettier src -c"
2323
- name: "Run lint"
2424
run: "CI=true yarn lint"
25+
- name: "Run publint"
26+
run: "yarn build && yarn lint:package"
2527

2628
conventional-commits:
2729
name: "Lint Commit Messages"

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@
2828
"import": "./dist/src/index.js"
2929
}
3030
},
31-
"repository": "https://github.com/authzed/authzed-node",
31+
"repository": {
32+
"type": "git",
33+
"url": "git+https://github.com/authzed/authzed-node.git"
34+
},
3235
"license": "Apache-2.0",
3336
"private": false,
37+
"files": [
38+
"dist"
39+
],
3440
"scripts": {
3541
"test": "./scripts/run-and-test.sh",
3642
"only-run-tests": "vitest",
3743
"buf": "buf generate && tsc-esm-fix --src src/authzedapi --ext='.js'",
3844
"lint": "./node_modules/.bin/eslint src",
45+
"lint:package": "publint --pack npm",
3946
"format": "prettier -w src",
4047
"build": "tsc",
4148
"postbuild": "rollup dist/src/index.js --file dist/src/index.cjs --format cjs && cp dist/src/index.d.ts dist/src/index.d.cts",
@@ -58,6 +65,7 @@
5865
"eslint": "^9.39.2",
5966
"grpc-tools": "^1.13.1",
6067
"prettier": "^3.7.4",
68+
"publint": "^0.3.16",
6169
"rollup": "^4.54.0",
6270
"tsc-esm-fix": "^3.1.2",
6371
"typescript": "^5.9",

0 commit comments

Comments
 (0)