Repository navigation
setup(typescript): update - #146
Conversation
|
Should we have 1 tsconfig at the root? 🤔 |
That was the question with @brunocroh on discord. |
|
When we use npx codemod@init, it creates a tsconfig.json for each recipe. From what I understand, each recipe needs to be independent. However, having duplicated TypeScript configs can be a pain when we need to update them. What I'm thinking as a solution is to have a recipe-tsconfig.json at the root and copy it to each recipe folder during the publish process in CI. |
|
do the codemod cli understand |
|
We can put a root tsconfig and add one to each directory extending the root one, if need be |
That's what I was thinking |
tsconfig.jsontsconfig.json): use root and extend it
tsconfig.json): use root and extend itThere was a problem hiding this comment.
Pull Request Overview
This PR updates TypeScript configuration and type imports across the codebase to use more specific JavaScript AST types instead of generic TypesMap and Kinds types. It also introduces a new TypeScript compiler (tsgo) and updates the project dependencies.
- Replaces generic
TypesMapandKinds<TypesMap>type parameters with specific JavaScript language types (Js) - Updates TypeScript tooling from standard TypeScript to
@typescript/native-previewwithtsgocompiler - Removes individual
tsconfig.jsonfiles from recipe directories to use root configuration
Reviewed Changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| utils/src/ast-grep/*.ts | Updated type parameters from generic TypesMap, Kinds<TypesMap> to specific Js type |
| recipes/*/src/workflow.ts | Updated transform function signatures to use SgRoot<Js> instead of generic SgRoot |
| recipes/*/tsconfig.json | Removed individual TypeScript configurations |
| package.json | Updated TypeScript dependency and build script |
| .vscode/settings.json | Enabled experimental tsgo support |
Comments suppressed due to low confidence (2)
recipes/fs-access-mode-constants/src/workflow.ts:1
- The
@ts-expect-errorcomments are no longer needed since the type updates in this PR should have resolved the type compatibility issues between ast-grep and JSSG types.
import { getNodeRequireCalls } from "@nodejs/codemod-utils/ast-grep/require-call"
recipes/fs-access-mode-constants/src/workflow.ts:1
- The
@ts-expect-errorcomments are no longer needed since the type updates in this PR should have resolved the type compatibility issues between ast-grep and JSSG types.
import { getNodeRequireCalls } from "@nodejs/codemod-utils/ast-grep/require-call"
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
JakobJingleheimer
left a comment
There was a problem hiding this comment.
Should all of the tsconfigs (except the root one) be removed via this PR? (more were probably committed since you started this)
Aside from the committed test result mutation, looks fine to me. Only blocking to ensure that is not merged (which would cause the test to silently fail).
I had tried that but codemod cli wasn't happy. I am going to re try and maybe ask codemod team.
Good catch but strange |
just run: git checkout main -- recipes/correct-ts-specifiers/src/fixtures/e2e/test.ts
git add recipes/correct-ts-specifiers/src/fixtures/e2e/test.ts
git commit -m 'fixup!: undo erroneous change to test file' |
I was talking about one root tsconfig file 😓 |
|
@AugustinMauroy any luck from the codemod folks? |
|
Okay good now I didn't ask codemod team using lasted version it's work ! |
JakobJingleheimer
left a comment
There was a problem hiding this comment.
Shall we switch to tsgo as part of this?
tsgo