Repository navigation
fix(check): judge docs and links by what the package ships - #58
Merged
Merged
Conversation
check took the docs pages from git and tested links against the disk. So docs built at prepack, which git ignores but npm packs, went unchecked, and a link to a file the package does not ship passed. check now reads `files` in package.json as npm does (paths, folders, globs, ! entries and the files npm always packs) and links in .mdx pages are checked too. It never runs npm: npm pack --dry-run runs prepare even with --ignore-scripts. The private-key warning now needs a key body, so a PEM header used as a placeholder in docs no longer triggers it. The new check found 29 spec links into docs/research/, which does not ship. They now lead to GitHub. Closes #52 Closes #53 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Gr8S7FAHF2ZZjma1gHg43N
Contributor
📦 Snapshot releasePublished |
Merged
This branch was previously deployed
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.
In short
harnesspm checknow judges docs and links by what the package ships: it readsfilesinpackage.jsonas npm does. Before, it asked git and the disk.prepack(git ignores them, npm packs them), reports links to files that don't ship, and checks links in.mdxpages.Closes #52. Closes #53.
What changed
checkreadsfilespacks in the docs folder, git-ignored or notfilesleaves outpoints at a file the package does not ship.mdxpages-----BEGIN PRIVATE KEY-----aloneHow
filesis read (packs()insrc/check.ts): a listed path, a folder and everything in it, or a glob with*,**and?, less!entries, plus what npm always packs (package.json, README, license,main,bin). Withoutfiles, or with a pattern it doesn't read (braces, character classes),checkbehaves as before. So it never reports a false "does not ship".Why not ask npm
The first version asked
npm pack --dry-run --json --ignore-scripts. npm 10.9.9 still runs the package'spreparescript with--ignore-scripts(it skips onlyprepack). For@cube-dev/ui-kit, whoseprepareishusky install && harnesspm sync, one listing took 4.8 s and ran a sync. Apreparethat rancheckwould loop. Socheckreadsfilesitself, takes 0.14 s there, and runs nothing. Recorded indocs/research/package-managers.md.Spec
checkreads the docs as the tarball has them.checkreadsfiles, and why it never runs npm.docs/research/, which isn't infiles, now point to GitHub, as the site's pages already do.Where this came from
cube-js/cube-ui-kit#1697 builds UI Kit's docs into
docs/atprepack, next to its trackeddocs/rules/. Itsprepackrunsharnesspm check, which read onlydocs/rules/, so it had to check the extracted tarball in a test instead.Verification
npm run typecheck,npm test(121 tests, 3 new),npm run check(harness +sync --check).checkon real harnesses: Glaze (its.mdxdocs), Tasty, eslint-plugin-tasty, harnesspm itself and UI Kit (repo and packed) all pass.docs/components/actions/Button.mdis reported. Without built docs (its CI lint job),checkpasses. On the packed UI Kit, the PasswordInput placeholder no longer warns.Generated by Claude Code