Skip to content

build: bundle @zipkit/core with tsdown into a built package#52

Merged
ronload merged 2 commits into
mainfrom
build/core-publish
Jun 24, 2026
Merged

build: bundle @zipkit/core with tsdown into a built package#52
ronload merged 2 commits into
mainfrom
build/core-publish

Conversation

@ronload

@ronload ronload commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Why

@zipkit/core held the project's domain logic but was consumed as raw TS
source via Next's transpilePackages -- exports/main/types all
pointed at ./src/index.ts. That tied the package to Next's build and
left it unable to stand on its own as a framework-agnostic library. This
makes it a real, built, publish-ready package: compiled once to dist/
and consumed like any other dependency.

What

  • packages/core -- build with tsdown
    (tsdown.config.ts: single entry src/index.ts, ESM,
    platform: 'neutral', dts, clean) -> dist/index.js +
    dist/index.d.ts. exports/main/module/types now point at
    dist/; adds build and dev (tsdown watch) scripts. Stays
    private: true -- publish-ready, but not published to npm yet.
  • apps/web -- drops transpilePackages: ["@zipkit/core"]; now
    imports the compiled output.
  • Root scripts -- dev/build/lint/typecheck/check build
    @zipkit/core first, so dist/ exists before Next, type-aware
    ESLint, and tsc resolve the package.
  • .gitignore -- ignores dist/ (build artifact).

Verification

pnpm format:check, pnpm lint, pnpm typecheck, pnpm test (29/29),
and pnpm build (379 static pages) all pass locally. CI is unchanged --
every web-facing root script self-builds core, so the existing steps work
as-is.

Notes

Scoped to the build pipeline only. Actual npm publishing (removing
private, Changesets, release workflow, @zipkit org + token) is
intentionally deferred.

@zipkit/core is now built to dist/ (ESM + .d.ts) via tsdown instead of
being consumed as raw TS source, making it a real, publish-ready package.
apps/web imports the compiled output and Next no longer needs
transpilePackages.

- packages/core: add tsdown build (tsdown.config.ts -- single entry,
  ESM, platform neutral, dts, clean); point exports/main/module/types
  at dist/; add build + dev (watch) scripts; keep private (publish-ready,
  not published to npm yet)
- apps/web: drop transpilePackages for @zipkit/core
- root scripts: dev/build/lint/typecheck/check build @zipkit/core first
  so dist/ exists before Next, type-aware ESLint, and tsc resolve it
- .gitignore: ignore dist/
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zipkit Ready Ready Preview, Comment Jun 24, 2026 6:25am

Vercel deploys apps/web with rootDirectory=apps/web and runs its
`pnpm run build` directly, bypassing the root build script. Since the
app now consumes @zipkit/core's built dist/ (no transpilePackages), the
build failed with module-not-found because dist/ was never built.

Build @zipkit/core from within apps/web's own build script so dist/
exists before `next build`, regardless of how the build is invoked
(Vercel, CI, or local). pnpm --filter is workspace-wide, so it resolves
@zipkit/core from apps/web's cwd; the monorepo install provides tsdown.
Revert the redundant core build from the root build script.
@ronload ronload merged commit 7c50ff9 into main Jun 24, 2026
4 checks passed
@ronload ronload deleted the build/core-publish branch June 24, 2026 08:26
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