Skip to content

Commit 484a7da

Browse files
committed
fix(release): lint native packages before publish
Native optional packages previously only verified that the staged binary existed during prepack. The publish path now also runs clean-pkg-json and publint so the subpackage manifests receive the same cleanup and package validation as the main ccusage package before npm publish. Each native package declares the release and lint CLIs as devDependencies through the existing catalogs so pnpm can resolve the lifecycle commands from the package itself. The manifests also set type=commonjs to keep publint output clean for packages that do not ship JavaScript entrypoints.
1 parent 7e20024 commit 484a7da

7 files changed

Lines changed: 84 additions & 12 deletions

File tree

‎packages/ccusage-darwin-arm64/package.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "@ccusage/ccusage-darwin-arm64",
3+
"type": "commonjs",
34
"version": "19.0.3",
45
"description": "Native ccusage binary for macOS arm64",
56
"license": "MIT",
@@ -21,6 +22,10 @@
2122
"access": "public"
2223
},
2324
"scripts": {
24-
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs"
25+
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs && clean-pkg-json && publint"
26+
},
27+
"devDependencies": {
28+
"clean-pkg-json": "catalog:release",
29+
"publint": "catalog:lint"
2530
}
2631
}

‎packages/ccusage-darwin-x64/package.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "@ccusage/ccusage-darwin-x64",
3+
"type": "commonjs",
34
"version": "19.0.3",
45
"description": "Native ccusage binary for macOS x64",
56
"license": "MIT",
@@ -21,6 +22,10 @@
2122
"access": "public"
2223
},
2324
"scripts": {
24-
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs"
25+
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs && clean-pkg-json && publint"
26+
},
27+
"devDependencies": {
28+
"clean-pkg-json": "catalog:release",
29+
"publint": "catalog:lint"
2530
}
2631
}

‎packages/ccusage-linux-arm64/package.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "@ccusage/ccusage-linux-arm64",
3+
"type": "commonjs",
34
"version": "19.0.3",
45
"description": "Static native ccusage binary for Linux arm64",
56
"license": "MIT",
@@ -21,6 +22,10 @@
2122
"access": "public"
2223
},
2324
"scripts": {
24-
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs"
25+
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs && clean-pkg-json && publint"
26+
},
27+
"devDependencies": {
28+
"clean-pkg-json": "catalog:release",
29+
"publint": "catalog:lint"
2530
}
2631
}

‎packages/ccusage-linux-x64/package.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "@ccusage/ccusage-linux-x64",
3+
"type": "commonjs",
34
"version": "19.0.3",
45
"description": "Static native ccusage binary for Linux x64",
56
"license": "MIT",
@@ -21,6 +22,10 @@
2122
"access": "public"
2223
},
2324
"scripts": {
24-
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs"
25+
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs && clean-pkg-json && publint"
26+
},
27+
"devDependencies": {
28+
"clean-pkg-json": "catalog:release",
29+
"publint": "catalog:lint"
2530
}
2631
}

‎packages/ccusage-win32-arm64/package.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "@ccusage/ccusage-win32-arm64",
3+
"type": "commonjs",
34
"version": "19.0.3",
45
"description": "Native ccusage binary for Windows arm64",
56
"license": "MIT",
@@ -21,6 +22,10 @@
2122
"access": "public"
2223
},
2324
"scripts": {
24-
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs"
25+
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs && clean-pkg-json && publint"
26+
},
27+
"devDependencies": {
28+
"clean-pkg-json": "catalog:release",
29+
"publint": "catalog:lint"
2530
}
2631
}

‎packages/ccusage-win32-x64/package.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "@ccusage/ccusage-win32-x64",
3+
"type": "commonjs",
34
"version": "19.0.3",
45
"description": "Native ccusage binary for Windows x64",
56
"license": "MIT",
@@ -21,6 +22,10 @@
2122
"access": "public"
2223
},
2324
"scripts": {
24-
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs"
25+
"prepack": "node ../../apps/ccusage/scripts/verify-native-package.mjs && clean-pkg-json && publint"
26+
},
27+
"devDependencies": {
28+
"clean-pkg-json": "catalog:release",
29+
"publint": "catalog:lint"
2530
}
2631
}

‎pnpm-lock.yaml‎

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

0 commit comments

Comments
 (0)