Repository navigation
refactor: remove dead code, dedupe helpers, and split shared utils - #358
Conversation
Delete helpers and exports that nothing calls, share one copy of isRecord, errorMessage, stringArray, and isWithinOrEqual, and drop comments that restate the code. Command output, exit codes, and the public API stay as they are. Tests of the deleted exports go with them. One test is new: validate reads a tracked type entry of a workspace package that is its own git repository.
Share the permission prompt fixture and the global package fixture, use vi.stubEnv and vi.restoreAllMocks in place of manual save and restore, and merge cases that differ by one argument into it.each. Drop one load --path test that repeated the test before it.
Remove repeated caveats and filler words from the CLI reference, concept pages, and quick starts, and fix a stray list marker in the README badge row.
Remove filler words and restated context from the skills that ship in meta/. Every instruction, rule, step, and table row stays.
Check tracked type entries per workspace package again in place of the batched git call, substitute template variables with the original replace chain, read _artifacts behind the existence check, and read the message of any thrown object in the install catches. Restore the JSDoc on findSkillFiles so the published types match.
Bring back the first-run permission rules and example, the outcome table, the setup and registry notes, the policy mode bullets, and the other statements that no longer appeared anywhere in docs/. The edits that only shorten wording stay.
Reuse getPackageShortName, errorMessage, and isRecord where local copies remained, and read manifests for example checks through the shared filesystem cache. Drop three pass-through exports, parameters that every caller gave one value, and a notice set that never removed a duplicate. Output does not change.
core and discovery import this module, so it belongs in the layer they share. The file moves unchanged except for its own import path.
shared/utils.ts becomes guards, paths, fs-identity, skill-files, node-modules, and frontmatter. The code moves unchanged; only import paths differ. The shared exports now come first in src/index.ts so the published type declarations keep their order.
setup stopped with an error on a workspace package whose package.json is not an object. The cleanup read such a file as empty and carried on. Read it as before so setup output does not change.
|
Important Review skippedToo many files! This PR contains 115 files, which is 15 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. CodeRabbit couldn't verify your organization's usage billing state, so no usage-priced review was started. Retry after the billing service recovers.
|
🦋 Changeset detectedLatest commit: 63fc7e4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
View your CI Pipeline Execution ↗ for commit 63fc7e4
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
🎯 Changes
sourceIdentityKey,sourceIdentityEquals,isSkillSourcesParseError,hasPackageManagerInternalPath, the unreachablegitvariant ofSkillSource,src/discovery/index.ts, and the threesrc/hooks/agents/*.tsfiles that only tests imported. The tests that covered only that code go with it.isRecord(five copies),isWithinOrEqual(four), andgetPackageShortName. Thepackage.jsonreader invalidate/blocks.tsis gone too;validatenow reads through the file cache it already builds.setup/workspace-patterns.tstocore/workspace-patterns.ts, becausecoreanddiscoveryimport it. Splitsshared/utils.tsintoguards,paths,fs-identity,skill-files,node-modules, andfrontmatter. Neither move changes logic.docs/,README.md, and the bundled skills inmeta/. The instructions in the skills do not change.README.md.✅ Checklist
pnpm run test:pr(runpnpm build:allfirst).🚀 Release Impact