Chore: Solving TypeScript packaging issues#249
Conversation
🦋 Changeset detectedLatest commit: 9699f0d The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
WalkthroughUpdates workspace packaging to include nested package.json files across multiple packages, modifies .gitignore, switches the Vite DTS setup to vite-plugin-dts-build’s dtsForEsm/dtsForCjs in configs/vite-config-custom, bumps that plugin version, removes a dependency, and adds a root build:full script. Adds a Changeset documenting patch releases. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant Vite as Vite Build
participant DTS as vite-plugin-dts-build
participant ESM as dtsForEsm
participant CJS as dtsForCjs
Dev->>Vite: Run build (PACKAGE_PUBLISH=true)
Vite->>DTS: Initialize plugins
DTS->>ESM: Generate ESM .d.ts
DTS->>CJS: Generate CJS .d.ts
note over ESM,CJS: Dual-mode DTS output<br/>(paths handled by plugin)
Vite-->>Dev: Build artifacts + declarations
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Triggered from #249 by @black7375. Checking if we can fast forward Target branch ( commit f1ca15cac81f1356b267060896b2c63cd871cfad (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Thu Aug 7 00:00:00 2025 +0900
Refactor: `hoistSelectors` makes to type-safePull request ( commit 9699f0d9628ec431f49dda9ef329d58516794189 (pull_request/ts-packaging)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Fri Aug 8 00:00:00 2025 +0900
Chore: Solving TypeScript packaging issuesIt is possible to fast forward |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
package.json (1)
15-15: Consider cross-platform environment variable syntax.The
PACKAGE_PUBLISH=trueinline syntax works on Unix-like systems but may fail on Windows. Since other scripts in this file (e.g., line 32) use the same pattern, this is consistent with the project's approach.If Windows compatibility is desired, consider using
cross-env:- "build:full": "PACKAGE_PUBLISH=true yarn task build", + "build:full": "cross-env PACKAGE_PUBLISH=true yarn task build",And add
cross-envto devDependencies..changeset/tasty-ducks-turn.md (1)
14-15: Minor: Consider using a heading for "package".The static analysis tool suggests converting the bolded text to a proper heading for better Markdown structure.
Apply this diff:
-**package** +## package
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (14)
.changeset/tasty-ducks-turn.md(1 hunks).gitignore(2 hunks)configs/vite-config-custom/index.js(2 hunks)configs/vite-config-custom/package.json(1 hunks)package.json(1 hunks)packages/babel/package.json(1 hunks)packages/css-additional-types/package.json(1 hunks)packages/css/package.json(1 hunks)packages/debug-log/package.json(1 hunks)packages/esbuild/package.json(1 hunks)packages/integration/package.json(1 hunks)packages/react/package.json(1 hunks)packages/transform-to-vanilla/package.json(1 hunks)packages/vite/package.json(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
.changeset/tasty-ducks-turn.md (2)
packages/vite/src/index.ts (2)
minchoVitePlugin(72-286)transform(163-284)packages/esbuild/src/index.ts (2)
setup(30-129)minchoEsbuildPlugin(25-131)
🪛 markdownlint-cli2 (0.18.1)
.changeset/tasty-ducks-turn.md
14-14: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
🔇 Additional comments (16)
configs/vite-config-custom/package.json (1)
9-14: Version bump aligns with the new dtsForEsm/Cjs flow.Upgrading to ^0.2.2 matches the plugin guidance for dual-output declaration builds, so this dependency change looks correct. Based on learnings.
packages/css-additional-types/package.json (1)
44-48: Including nested package manifests preserves resolver metadata.Shipping
**/package.jsonalongsidedist/keeps the generated subpath manifests available to consumers, so this whitelist tweak looks good.packages/transform-to-vanilla/package.json (1)
47-51: Files whitelist update looks correct.Adding
**/package.jsonensures the runtime stubs accompanying your compiled outputs get published, preventing resolver gaps.packages/react/package.json (1)
50-54: Shipping nested package.json files avoids subpath resolution issues.The expanded
fileslist will include the manifest stubs needed for the React package’s runtime/type splits, so this change looks good.packages/babel/package.json (1)
39-43: Package manifest glob is a sensible addition.Including
**/package.jsonkeeps any generated subpath metadata with the published bundle, which is exactly what the TypeScript packaging fix needs.packages/css/package.json (1)
69-73: Expanded files list keeps declaration package.json stubs.Publishing
**/package.jsonalongsidedist/will prevent consumers from missing the helper manifests, so this update looks solid.packages/vite/package.json (1)
40-44: Whitelist update matches the packaging fix.With
**/package.jsonincluded, the nested manifests generated during the build will ship correctly; no issues spotted.packages/integration/package.json (1)
39-43: Nested package.json inclusion looks good.This ensures any generated manifest stubs that TypeScript users rely on are part of the published artifact, so I’m on board with the change.
.gitignore (2)
45-48: LGTM! Gitignore patterns align with packaging strategy.The patterns correctly ignore generated nested package.json files in workspace directories while preserving the root package.json files in each workspace. The glob pattern
**/will match files at any depth beyond the first level (e.g.,packages/foo/dist/package.json).
98-98: LGTM! Addition of dist-ssr is appropriate.Adding
dist-ssrto the ignore list is correct for Nuxt.js server-side rendering build artifacts..changeset/tasty-ducks-turn.md (1)
1-15: LGTM! Changeset properly documents the scope of changes.The changeset correctly lists all affected packages and provides a clear description linking to both the "Are the types wrong" tool and the dual mode feature being utilized.
configs/vite-config-custom/index.js (3)
11-11: LGTM! Import updated for dual-mode declaration generation.The switch from
dtstodtsForEsmanddtsForCjsaligns with vite-plugin-dts-build v0.2.2's dual-module declaration support, which generates matching declaration files for both ESM (.d.ts) and CJS (.d.cts) outputs.Based on learnings.
40-44: LGTM! ESM declaration generation configured correctly.The
dtsForEsmplugin is properly configured with:
include: ["src"]to limit scopetsconfigPathto ensure correct type resolutionThis will generate
.d.tsfiles for ESM module consumption.Based on learnings.
46-53: Confirm dual-mode declaration output: please manually verify that a PUBLISH-mode build emits both ESM declarations (.d.ts/.d.mts) and CJS declarations (.d.cts) with matching module specifiers.packages/debug-log/package.json (1)
45-50: Glob scope is safe; only root package.json matches
Verified withfind: onlypackage.jsonat the package root is included—no nested files will be published.packages/esbuild/package.json (1)
39-43: Scope of**/package.jsonis safe
findlists only./package.json; no nested files to be inadvertently published.
|
/fast-forward |
|
Triggered from #249 (comment) by @black7375. Trying to fast forward Target branch ( commit f1ca15cac81f1356b267060896b2c63cd871cfad (HEAD -> main, origin/main)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Thu Aug 7 00:00:00 2025 +0900
Refactor: `hoistSelectors` makes to type-safePull request ( commit 9699f0d9628ec431f49dda9ef329d58516794189 (pull_request/ts-packaging)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Fri Aug 8 00:00:00 2025 +0900
Chore: Solving TypeScript packaging issuesFast forwarding $ git push origin 9699f0d9628ec431f49dda9ef329d58516794189:main
To https://github.com/mincho-js/mincho.git
f1ca15c..9699f0d 9699f0d9628ec431f49dda9ef329d58516794189 -> main |
Description
Fixes all package issues resulting from Are the types wrong.
Related Issue
Summary by CodeRabbit
Chores
Refactor
Additional context
Checklist