ci: add packaging & monorepo consistency validation (publint + attw + sherif)#46
Open
martyy-code wants to merge 2 commits into
Open
ci: add packaging & monorepo consistency validation (publint + attw + sherif)#46martyy-code wants to merge 2 commits into
martyy-code wants to merge 2 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
… sherif) Adds three lightweight CI checks plus the lib fixes that make them green: - publint validates package.json / exports / files against npm rules - @arethetypeswrong/cli (attw) resolves types under node16/nodenext/bundler - sherif catches workspace version drift (multiple-dependency-versions) Lib fixes (so attw passes): - src/types/special.ts:5 — add .js extension to relative import - src/types/property.ts:5 — same bug; second instance surfaced by attw Packaging fixes (so publint passes): - exports map: types condition first, nested import.types for moduleResolution:bundler, default conditions for the three entrypoints Workspace version drift (so sherif passes): - apps/web: align eslint to ^9.0.0 and typescript to ^5.0.0 - examples: align typescript to ^5.0.0 CI: build + lint:sherif + lint:publint + lint:attw run after Test in ci.yml. Contributing: updated 'Code quality' section with the three new scripts. Branch protection (required status checks) is a post-merge repo-settings step, documented in the PR description. Co-Authored-By: Claude <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add three lightweight CI checks (publint, @arethetypeswrong/cli, sherif) plus the lib fixes that make them pass on day one. After merge, the same checks run on every PR via the existing CI workflow.
What changed
publint0.3.21,@arethetypeswrong/cli0.18.5,sherif1.13.0; new scriptslint:publint,lint:attw,lint:sherif, pluscheck:packagingshorthand.lint:publint,lint:attww/dependsOn: [^build],lint:sherif) keyed on the lib dist + workspace manifests..github/workflows/ci.yml): afterTest, runsBuildthen the three packaging checks viapnpm turbo lint:*.packages/type-testing/src/types/special.ts:5— add.jsto the relative import.packages/type-testing/src/types/property.ts:5— same bug, second instance surfaced by attw on first run.packages/type-testing/package.jsonexports map:typescondition first, nestedimport.typesformoduleResolution: "bundler", and adefaultcondition on each of the three entrypoints.apps/web/package.json: aligneslintto^9.0.0andtypescriptto^5.0.0.examples/package.json: aligntypescriptto^5.0.0.CONTRIBUTING.md"Code quality" section now lists the three new scripts.attw note
The attw command passes
--ignore-rules no-resolution cjs-resolves-to-esm. The lib is ESM-only (`type: "module""), so:no-resolutionwould otherwise flag the deep subpath exports (./vitest,./vitest/setup) under the legacy node10 resolver — irrelevant for any modern consumer.cjs-resolves-to-esmwould otherwise warn that a CJSrequire()resolves to ESM, which is intrinsic to an ESM-only package.Both exclusions are documented in the script's CLI invocation; the matrix table is otherwise green across
node10 / node16 (CJS) / node16 (ESM) / bundler.Verification
pnpm build— type-testing + web both green (turbo cache hit)pnpm typecheck— turbo across 3 packagespnpm test— 252 tests passpnpm lint— green (one pre-existing web warning unchanged)pnpm check:packaging— publint + attw + sherif all greenPost-merge: required status checks (repo-settings change)
Issue AC requires "wired as required checks on PRs to main". Once this PR merges, a maintainer needs to flip the three new jobs into the branch-protection required-checks list. Run from a shell with scope:
After the first merged run, copy the exact step-name strings from the GitHub Actions UI into the JSON, since they sometimes include the prefix
ci.yml /rather thanbuild /.Related
Closes #34
🤖 Generated with Claude Code