Skip to content

refactor: extract svelteplot library into packages/svelteplot (monorepo)#551

Merged
gka merged 12 commits into
mainfrom
chore/monorepo
Apr 24, 2026
Merged

refactor: extract svelteplot library into packages/svelteplot (monorepo)#551
gka merged 12 commits into
mainfrom
chore/monorepo

Conversation

@gka

@gka gka commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Moves src/lib/packages/svelteplot/src/lib/ (the published library), keeping src/lib/helpers/data.ts in the docs app (docs-only helper)
  • Moves src/tests/packages/svelteplot/src/tests/ (tests belong with the library they test)
  • Adds packages/svelteplot/package.json with library metadata, runtime deps, and build config
  • Adds packages/svelteplot/vite.config.js with a regex-based alias so tests resolve svelteplot/* subpath imports from source
  • Updates root package.json: removes library fields, adds svelteplot: workspace:* dependency, delegates pnpm test to the package
  • Updates vite.config.js and svelte.config.js aliases to point at packages/svelteplot/src/lib — dev HMR continues to work without a build step
  • Fixes root .gitignore patterns (/.svelte-kit.svelte-kit, /distdist) to cover subdirectories
  • Removes duplicate htmlTooltip.test.svelte files that caused a case-sensitivity collision on macOS

Test plan

  • All 96 test files / 835 tests pass (pnpm test)
  • Dev server starts and docs render correctly (pnpm dev)
  • pnpm prepack in packages/svelteplot builds dist/ correctly

🤖 Generated with Claude Code

gka and others added 3 commits April 24, 2026 16:53
- 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>
@netlify

netlify Bot commented Apr 24, 2026

Copy link
Copy Markdown

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit fde4b37
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/69ebec30f6c593000895d4f3
😎 Deploy Preview https://deploy-preview-551--svelteplot.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread svelte.config.js Outdated
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>
@github-actions

Copy link
Copy Markdown

📦 Preview package for this PR is published!

Version: 0.14.2-pr-551.0

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>
@github-actions

Copy link
Copy Markdown

📦 Preview package for this PR is published!

Version: 0.14.2-pr-551.1

Install it with:

npm install svelteplot@pr-551
# or install the specific version
npm install svelteplot@0.14.2-pr-551.1

@github-actions

Copy link
Copy Markdown

📦 Preview package for this PR is published!

Version: 0.14.2-pr-551.2

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>
@github-actions

Copy link
Copy Markdown

📦 Preview package for this PR is published!

Version: 0.14.2-pr-551.3

Install it with:

npm install svelteplot@pr-551
# or install the specific version
npm install svelteplot@0.14.2-pr-551.3

@gka gka merged commit 3a1d520 into main Apr 24, 2026
8 checks passed
@gka gka deleted the chore/monorepo branch April 24, 2026 22:22
gka pushed a commit that referenced this pull request Apr 27, 2026
…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>
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.

1 participant