-
Notifications
You must be signed in to change notification settings - Fork 491
fix(cli): convert to ESM to support @clack/prompts v1.x #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,10 @@ | |
| "extends": "../../tsconfig.base.json", | ||
| "compilerOptions": { | ||
| "outDir": "./dist", | ||
| "rootDir": "./src" | ||
| "rootDir": "./src", | ||
| "module": "Node16", | ||
| "moduleResolution": "Node16", | ||
| "rewriteRelativeImportExtensions": true | ||
|
Comment on lines
+6
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With TypeScript falls back to "exports": {
".": {
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
}
}This is not introduced by this PR per se, but the move to |
||
| }, | ||
| "include": ["src/**/*"], | ||
| "references": [ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mainfield is misleading for an ESM CLI packageThe
"main": "dist/shared.js"entry points to an internal utility module rather than a primary package entry. Now that the package is ESM ("type": "module"), any externalrequire('@tinyclaw/cli')call will fail because ESM cannot be synchronously required. For a CLI-only package this is generally fine at runtime (since nothing imports it), but it would be cleaner to either:"main"entirely if the package is not meant to be imported programmatically, or"exports"field mapping to communicate intent and support Node16 module resolution tooling properly.Additionally, the absence of a
"bin"field means the CLI scripts cannot be installed globally via npm — this was already the case before this PR, but converting to ESM is a good opportunity to revisit the package's public shape.