-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
@arkenv/vite-pluginIssues or Pull Requests involving the Vite plugin for ArkEnvIssues or Pull Requests involving the Vite plugin for ArkEnvarkenvChanges to the `arkenv` npm package.Changes to the `arkenv` npm package.enhancementNew feature or requestNew feature or requestinfraInfrastructure related issue or pull requestInfrastructure related issue or pull request
Description
Problem
The @repo/types internal package currently requires a build step (tsc) to generate .d.ts files in the dist/ directory, even though it's a types-only package with no runtime code.
This is necessary because:
- tsdown's
dts.resolveconfiguration needs the package to have declaration files to bundle types correctly - The package.json points to
./dist/index.d.tsfor type resolution - Without the build step, TypeScript can't resolve the types during the bundling process
Why This Is Not Ideal
- Types-only packages shouldn't need builds - The original design was for a zero-build types package
- Adds unnecessary complexity - Requires maintaining a build script and dist directory
- Build order dependency - The internal types package must be built before packages that depend on it
- Goes against the original proposal - The proposal stated "no build config needed"
Current Workaround
The package currently has:
"build": "tsc"script to generate declaration files"types": "./dist/index.d.ts"pointing to built files- Build step required before consuming packages can use the types
Potential Solutions
- Investigate tsdown alternatives - Find a way to make
dts.resolvework with source.tsfiles directly - Use a different bundling approach - Maybe inline the types directly in source files instead of using a separate package
- Wait for tsdown improvements - See if future versions support resolving types from source files
- Accept the build requirement - Document it as a necessary trade-off for type bundling
Related
- Created as part of:
add-internal-types-package(archived) - See:
packages/internal/types/package.json - See:
packages/arkenv/tsdown.config.tsandpackages/vite-plugin/tsdown.config.ts - Internal types package #416 (closed by Internal types package #419)
Priority
Low - This is a technical debt item. The current solution works, but it's not ideal.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@arkenv/vite-pluginIssues or Pull Requests involving the Vite plugin for ArkEnvIssues or Pull Requests involving the Vite plugin for ArkEnvarkenvChanges to the `arkenv` npm package.Changes to the `arkenv` npm package.enhancementNew feature or requestNew feature or requestinfraInfrastructure related issue or pull requestInfrastructure related issue or pull request