Skip to content

Commit cfcc02e

Browse files
dkryaklinclaude
andcommitted
chore: tighten package boundary + clean rebuild
Two changes that prevent long-term shape drift once published: - package.json `exports`: gate the public surface to the documented default import (`postcss-calc` → `./dist/src/index.js`) plus `./package.json` for tooling that reads it. Modern Node and bundlers will reject deep imports like `postcss-calc/dist/...` or `postcss-calc/src/...`, preventing consumers from accidentally locking themselves to the internal AST / tokenizer modules. - Add a `prebuild` script that `rm -rf dist`s before each tsc emit. Without this, stale build output from earlier directory layouts (e.g., a previous `dist/src/v11/` tree) survives across rebuilds and ships in the npm tarball. Also sync pnpm-lock.yaml — the previous commit dropped postcss-selector-parser from dependencies but didn't regenerate the lockfile, which would break `pnpm install --frozen-lockfile` on the maintainer's CI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 48d3454 commit cfcc02e

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
},
1717
"main": "dist/src/index.js",
1818
"types": "dist/src/index.d.ts",
19+
"exports": {
20+
".": {
21+
"types": "./dist/src/index.d.ts",
22+
"default": "./dist/src/index.js"
23+
},
24+
"./package.json": "./package.json"
25+
},
1926
"files": [
2027
"dist",
2128
"src",
@@ -24,6 +31,7 @@
2431
],
2532
"scripts": {
2633
"prepare": "pnpm run build",
34+
"prebuild": "rm -rf dist",
2735
"build": "tsc -p tsconfig.build.json",
2836
"build:jison": "jison ./parser.jison -o src/parser.js",
2937
"lint": "eslint . && tsc",

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)