-
Notifications
You must be signed in to change notification settings - Fork 14
chore(test-project): Prepare for fully switching to ESM #932
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
Conversation
✅ Deploy Preview for cedarjs canceled.
|
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many -t build:pack --exclude create-ceda... |
✅ Succeeded | 7s | View ↗ |
nx run-many -t build |
✅ Succeeded | 5s | View ↗ |
nx run-many -t test --minWorkers=1 --maxWorkers=4 |
✅ Succeeded | 5s | View ↗ |
nx run-many -t test:types |
✅ Succeeded | 9s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-01-04 14:11:53 UTC
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many -t build |
✅ Succeeded | 7s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-01-04 13:57:49 UTC
Greptile SummaryConverts test-project maintenance scripts from CommonJS to ESM by renaming Key changes:
Files needing attention:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Scripts as NPM Scripts
participant TSX as TSX Runtime
participant Utils as util.mts
participant Tasks as tasks.mts
participant Framework as frameworkLinking.mts
participant Execa as execa
Dev->>Scripts: yarn build:test-project
Scripts->>TSX: tsx test-project.mts
TSX->>Tasks: import { apiTasks, webTasks }
Tasks->>Utils: import { getExecaOptions, exec }
Tasks->>Framework: (optional) import for linking
Note over Tasks,Utils: ESM imports now use .mjs extensions
Tasks->>Utils: getExecaOptions(path)
Utils-->>Tasks: ExecaOptions
Tasks->>Execa: execa(cmd, args, options)
Note over Tasks,Execa: Array syntax with shell:true
Framework->>Execa: execa('yarn', ['project:deps'], options)
Note over Framework,Execa: Changed from string to array syntax
Execa-->>Framework: Process result
Framework-->>Tasks: Completion
Tasks-->>TSX: Task execution complete
TSX-->>Scripts: Build complete
|
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.
15 files reviewed, 1 comment
| }, | ||
| } | ||
|
|
||
| return execa('yarn', ['project:deps'], options) |
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.
style: changed from execa('yarn project:deps', options) (string command) to execa('yarn', ['project:deps'], options) (array syntax). verify this behaves the same with shell: true
Prompt To Fix With AI
This is a comment left during a code review.
Path: tasks/test-project/frameworkLinking.mts
Line: 19:19
Comment:
**style:** changed from `execa('yarn project:deps', options)` (string command) to `execa('yarn', ['project:deps'], options)` (array syntax). verify this behaves the same with `shell: true`
How can I resolve this? If you propose a fix, please make it concise.|
@greptileai A lot of the changes in this PR have already been merged to |
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.
Based on my analysis, this PR appears to be largely redundant. Here's what I found:
Already merged to main:
-
ESM conversion is complete: All the key files like
tasks.mts,frameworkLinking.mts,util.mts, etc. already exist in their ESM form with TypeScript types -
Package.json scripts already updated: The scripts that were changed in this PR are already using
tsxinstead ofnode:- ✅
"build:test-project": "tsx ./tasks/test-project/test-project.mts" - ✅
"rebuild-test-project-fixture": "tsx ./tasks/test-project/rebuild-test-project.mts" - ✅
"rebuild-test-project-fixture-esm": "tsx ./tasks/test-project/rebuild-test-project-fixture-esm.mts"
- ✅
-
Import statements updated: The files I checked already have proper ES6 imports and
.mjsextensions in import paths -
TypeScript types added: Proper TypeScript interfaces and type annotations are already present
What this PR was trying to accomplish:
- Convert CommonJS modules to ESM modules (
.js→.mts) - Add TypeScript type annotations
- Update import/export statements
- Update package.json scripts to use
tsx - Add ESM-specific polyfills like
__filenameand__dirname
Conclusion:
Yes, it's safe to close this PR. All the ESM conversion work that this PR was attempting to do has already been completed and merged to main through other PRs. The current state of main already has the fully converted ESM test-project scripts with proper TypeScript types.

No description provided.