Skip to content

refactor: move sources from ts/ to src/ - #252

Merged
unional merged 2 commits into
mainfrom
chore/move-ts-to-src
Sep 7, 2026
Merged

refactor: move sources from ts/ to src/#252
unional merged 2 commits into
mainfrom
chore/move-ts-to-src

Conversation

@unional

@unional unional commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #251

packages/path-equal/ts/ and packages/uni-path/ts/ held this repo's TypeScript sources. ts/ is not a convention anyone else follows, and the concrete cost was that @repobuddy/vitest's presets glob {src,source,code}/** — importing one here matched nothing, so the repo hand-wrote its test config instead.

What changed

Both source directories renamed with git mv, so history follows the files (GitHub shows them as pure renames). Every reference that named the old path was updated:

File What moved
packages/*/tsconfig.json include, rootDir, typedoc entryPoints
packages/*/package.json files
packages/path-equal/jsr.json exports, publish include/exclude
packages/path-equal/tsdown.config.ts build entry
packages/*/vitest.config.ts test include, coverage include/exclude
turbo.json task inputs for build, coverage, size, test, typecheck

No workflow paths filters, README, or doc references named ts/.

The second commit takes the payoff the issue describes: packages/path-equal/vitest.config.ts now imports nodeTestPreset from @repobuddy/vitest/config/node instead of hand-writing globs. It passes includeGeneralTests: true, because the preset matches only the platform-suffixed *.spec.node.ts form by default and this package uses plain *.spec.ts. The 100% coverage thresholds stay local — they are this package's gate, not something the shared preset sets.

Verification

pnpm verify (biome ci, build, typecheck, coverage, depcheck, size) is green. Coverage still reports 100% on all four counters with the thresholds enforced, and the resolved config was checked to confirm the preset does not clobber thresholds, provider, or reporter.

pnpm pack confirms the published tarball layout — package/src/index.ts in place of package/ts/index.ts, spec files still excluded, cjs/ and esm/ untouched. The exports map is unchanged, so import 'path-equal' and require('path-equal') resolve exactly as before; a patch changeset covers the tarball layout change.

Note

packages/uni-path is excluded from the pnpm workspace (!packages/uni-path in pnpm-workspace.yaml), so neither CI nor pnpm verify builds or tests it. Its rename and config updates are mechanical and were made for consistency, but they are unverified by any run. It also keeps its hand-written vitest config rather than adopting the preset — adding a dependency to a package that cannot be installed or exercised here would be untested change.

🤖 Generated with Claude Code

https://claude.ai/code/session_018zwSon8Goytv7sZrXLoays

unional and others added 2 commits September 7, 2026 16:26
`ts/` is not a convention anyone else follows. The ecosystem standard is
`src/`, and shared tooling assumes it — `@repobuddy/vitest`'s presets glob
`{src,source,code}/**`, which matched nothing here.

Renamed with `git mv` so history follows the files, and updated every
reference: tsconfig `include`/`rootDir`/typedoc entry points, package.json
`files`, jsr.json exports and publish globs, the tsdown entry, the vitest
include/coverage globs, and turbo's task inputs.

Closes #251

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zwSon8Goytv7sZrXLoays
With sources under `src/`, the shared preset's globs finally match, so the
hand-written include and coverage globs can go. `includeGeneralTests` opts in
to the plain `*.spec.ts` names this package uses; the preset only matches the
platform-suffixed `*.spec.node.ts` form by default.

The 100% coverage thresholds stay local — they are this package's gate, not
something the shared preset sets.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zwSon8Goytv7sZrXLoays
@changeset-bot

changeset-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d54fa3e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
path-equal Patch

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

@unional
unional added this pull request to the merge queue Sep 7, 2026
Merged via the queue into main with commit 11291a7 Sep 7, 2026
5 checks passed
@unional
unional deleted the chore/move-ts-to-src branch September 7, 2026 23:41
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.

Move sources from ts/ to src/

1 participant