Skip to content

Commit 0e064c5

Browse files
committed
build: add publint for export checks
1 parent 2cc31fc commit 0e064c5

File tree

3 files changed

+65
-3
lines changed

3 files changed

+65
-3
lines changed

.hooks/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
#!/bin/sh
22

3+
set -eu
4+
set -o pipefail
5+
36
pnpm run lint
7+
pnpm publint

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,24 @@
55
"license": "MIT",
66
"exports": {
77
".": {
8+
"types": "./dist/beautiful-tree.d.ts",
89
"import": "./dist/beautiful-tree.mjs",
910
"require": "./dist/beautiful-tree.cjs",
1011
"browser": "./dist/beautiful-tree.iife.js",
11-
"types": "./dist/beautiful-tree.d.ts",
1212
"default": "./dist/beautiful-tree.umd.js"
1313
},
1414
"./min": {
15+
"types": "./dist/beautiful-tree.d.ts",
1516
"import": "./dist/beautiful-tree.min.mjs",
1617
"require": "./dist/beautiful-tree.min.cjs",
1718
"browser": "./dist/beautiful-tree.min.iife.js",
1819
"default": "./dist/beautiful-tree.min.umd.js"
1920
}
2021
},
22+
"files": ["dist"],
2123
"scripts": {
22-
"build": "rollup --config rollup.config.prod.mjs",
23-
"install-githooks": "if [ -d .git ]; then git config core.hooksPath .hooks; fi",
24+
"build": "rollup --config rollup.config.prod.mjs",
25+
"install-githooks": "if [ -d .git ]; then git config core.hooksPath .hooks; fi",
2426
"lint": "tsc && eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0",
2527
"lint:eslint": "eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0",
2628
"lint:tsc": "tsc"
@@ -42,6 +44,7 @@
4244
"eslint-plugin-react-hooks": "^4.6.0",
4345
"eslint-plugin-react-refresh": "^0.4.3",
4446
"prettier": "^3.0.0",
47+
"publint": "^0.2.0",
4548
"react": "^18.2.0",
4649
"react-dom": "^18.2.0",
4750
"rollup": "^3.26.3",

pnpm-lock.yaml

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)