build: bundle @zipkit/core with tsdown into a built package#52
Merged
Conversation
@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/
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
@zipkit/coreheld the project's domain logic but was consumed as raw TSsource via Next's
transpilePackages--exports/main/typesallpointed at
./src/index.ts. That tied the package to Next's build andleft 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 entrysrc/index.ts, ESM,platform: 'neutral',dts,clean) ->dist/index.js+dist/index.d.ts.exports/main/module/typesnow point atdist/; addsbuildanddev(tsdown watch) scripts. Staysprivate: true-- publish-ready, but not published to npm yet.apps/web-- dropstranspilePackages: ["@zipkit/core"]; nowimports the compiled output.
dev/build/lint/typecheck/checkbuild@zipkit/corefirst, sodist/exists before Next, type-awareESLint, and
tscresolve the package..gitignore-- ignoresdist/(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,@zipkitorg + token) isintentionally deferred.