refactor: extract svelteplot library into packages/svelteplot (monorepo)#551
Conversation
- Move src/lib/ → packages/svelteplot/src/lib/ (library source) - Move src/tests/ → packages/svelteplot/src/tests/ (library tests) - Keep src/lib/helpers/data.ts in docs app (docs-only helper) - Add packages/svelteplot/package.json with library metadata and deps - Add packages/svelteplot/vite.config.js for running tests in package context - Add packages/svelteplot/svelte.config.js and tsconfig.json - Move scripts/fix-js-imports.js to packages/svelteplot/scripts/ - Update root package.json: remove library fields, add svelteplot workspace dep - Update vite.config.js and svelte.config.js aliases to point at packages/svelteplot/src/lib - Update root pnpm test script to delegate to package Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The capital-T and lowercase-t variants are the same file on case-insensitive filesystems. Keep only the lowercase version which has the correct imports. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove leading slashes from .svelte-kit and dist so they match in packages/svelteplot/ as well as the repo root. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for svelteplot ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc2612a4a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d3-array, d3-geo, d3-random, topojson-client and topojson types were moved to packages/svelteplot but are also needed by docs source files that import these packages directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Run version bump and npm publish from packages/svelteplot/ since that is now the publishable package. Read version from packages/svelteplot/package.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-551
# or install the specific version
npm install svelteplot@0.14.2-pr-551.0 |
… package root Removes the SvelteKit-only src/lib/ nesting convention from the library package — library source now lives directly in packages/svelteplot/src/, and tests move from src/tests/ to packages/svelteplot/tests/. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-551
# or install the specific version
npm install svelteplot@0.14.2-pr-551.1 |
|
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-551
# or install the specific version
npm install svelteplot@0.14.2-pr-551.2 |
The REPL environment can't resolve package-name imports within the package itself — they need to be relative. Also removes leftover debug console.log. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-551
# or install the specific version
npm install svelteplot@0.14.2-pr-551.3 |
…558) Adds a `CONTRIBUTING.md` at the repo root following the convention used by Vega-Lite, Svelte, and shadcn/ui — single root file covering project layout, adding a new mark, adding a new transform, and per-PR expectations. Also fixes `scripts/generate-api.js`, which had stale `src/lib/...` paths from before the monorepo refactor (#551). `pnpm docs:api:marks` (referenced from `CONTRIBUTING.md`) won't work without this fix. Both pieces were originally bundled with #552 but they're project-wide tooling, not part of the hexbin feature, so splitting them out so they can land independently. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
src/lib/→packages/svelteplot/src/lib/(the published library), keepingsrc/lib/helpers/data.tsin the docs app (docs-only helper)src/tests/→packages/svelteplot/src/tests/(tests belong with the library they test)packages/svelteplot/package.jsonwith library metadata, runtime deps, and build configpackages/svelteplot/vite.config.jswith a regex-based alias so tests resolvesvelteplot/*subpath imports from sourcepackage.json: removes library fields, addssvelteplot: workspace:*dependency, delegatespnpm testto the packagevite.config.jsandsvelte.config.jsaliases to point atpackages/svelteplot/src/lib— dev HMR continues to work without a build step.gitignorepatterns (/.svelte-kit→.svelte-kit,/dist→dist) to cover subdirectorieshtmlTooltip.test.sveltefiles that caused a case-sensitivity collision on macOSTest plan
pnpm test)pnpm dev)pnpm prepackinpackages/svelteplotbuildsdist/correctly🤖 Generated with Claude Code