Skip to content

feat: add apps-package-check reusable workflow (publint gate) - #54

Draft
MaximusHaximus wants to merge 1 commit into
mainfrom
feat/apps-package-check-workflow
Draft

feat: add apps-package-check reusable workflow (publint gate)#54
MaximusHaximus wants to merge 1 commit into
mainfrom
feat/apps-package-check-workflow

Conversation

@MaximusHaximus

Copy link
Copy Markdown
Contributor

Why

A package can build, lint, and test green and still ship broken: an exports/main/types/bin entry pointing at a file the tarball doesn't contain, wrong ESM/CJS format, mis-ordered types conditions, or a files set that silently drops CHANGELOG.md/MIGRATION.md. None of the existing gates look at the packed artifact — publint does exactly that (it packs the package via pnpm pack and validates the result), so it belongs on the publish-readiness axis alongside apps-changeset-check.yml and apps-codegen-drift-check.yml, not in the fast pnpm lint loop and not inside the ci composite action.

What changed

  • .github/workflows/apps-package-check.yml (new reusable workflow, workflow_call only, contents: read): checkout → pnpm + node (node-version-file: .nvmrc, pnpm cache) → pnpm install --frozen-lockfilepnpm run --if-present build (publint lints the packed artifact, so compiled output must exist) → pnpm -r --include-workspace-root run --if-present check:package. Skips changeset-release/* branches, mirroring apps-codegen-drift-check.yml.
  • check:package convention: each publishable package defines the script (currently "check:package": "publint"); the generic name is a stable CI contract that can grow more artifact checks (e.g. attw) without renaming. --if-present makes the job a fast green no-op for repos with no publishable package.
  • apps-ci-trigger.yml: package-check added as a third job, same discrete-PR-status rationale as drift-check.
  • README.md: table row + section documenting the workflow and the convention.

Merge ordering

This PR merges first. The companion apps-team-ts-template PR references apps-package-check.yml@main and wires example-db as the canonical consumer — its CI goes green only after this lands.

https://claude.ai/code/session_01BNdm93FPjkK8G7NmuTEbXD

New PR gate on the publish-readiness axis alongside
apps-changeset-check and apps-codegen-drift-check: builds the
workspace, then runs each publishable package's check:package script
(publint) to validate the packed artifact — exports/main/types/bin
resolution, ESM/CJS format, types condition order, and files-set
completeness — none of which lint/typecheck/test can see.

check:package is a per-package named-script contract invoked with
--if-present, so the job is a fast green no-op for repos with no
publishable package and the script can grow more artifact checks
(e.g. attw) without renaming. Wired into the canonical
apps-ci-trigger.yml as a third job and documented in the README,
mirroring apps-codegen-drift-check.

Claude-Session: https://claude.ai/code/session_01BNdm93FPjkK8G7NmuTEbXD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant