chore(cli): Convert to TS: yargsCommandHelpers, cedarPluralize, etc#764
chore(cli): Convert to TS: yargsCommandHelpers, cedarPluralize, etc#764Tobbe wants to merge 6 commits into
Conversation
✅ Deploy Preview for cedarjs canceled.
|
Greptile SummaryThis PR converts several CLI utility files from JavaScript to TypeScript, including renaming Key changes:
Minor implementation note: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Handler as Handler Files (JS)
participant Helpers as helpers.ts
participant YargsHelpers as yargsCommandHelpers.ts
participant CedarPluralize as cedarPluralize.ts
participant PluralHelpers as pluralHelpers.ts
participant Pluralize as pluralize library
Note over Handler,Pluralize: TypeScript Conversion Flow
Handler->>YargsHelpers: Import createBuilder, createCommand
YargsHelpers->>YargsHelpers: Apply yargs types (Argv, Options)
Handler->>Helpers: Import pathName, validateName, etc.
Helpers->>CedarPluralize: Import pluralize, isPlural, isSingular
Handler->>CedarPluralize: Import pluralization functions
Note over CedarPluralize: Renamed from rwPluralize.js
CedarPluralize->>CedarPluralize: Type mappings as Record<string, string>
CedarPluralize->>Pluralize: Call plurals.plural(word)
Pluralize-->>CedarPluralize: Return pluralized word
CedarPluralize-->>Handler: Return typed result
Handler->>PluralHelpers: Import ensureUniquePlural
PluralHelpers->>CedarPluralize: Call isPlural, isSingular
PluralHelpers->>PluralHelpers: Validate with interface types
PluralHelpers-->>Handler: Return validated plural
|
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many -t test --minWorkers=1 --maxWorkers=4 |
❌ Failed | 27s | View ↗ |
nx run-many -t build:pack --exclude create-ceda... |
✅ Succeeded | 3s | View ↗ |
nx run-many -t build |
✅ Succeeded | 2s | View ↗ |
nx run-many -t test:types |
✅ Succeeded | 6s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-12-21 17:11:20 UTC
|
Closing this until we've updated Vite and/or cedarPluralize is only imported from TS files |

Unfortunately have to close this PR
cedarPluralize is now a TS files. Typically in TS ESM projects you'd import it as
'./cedarPluralize.js'(or'./cedarPluralize.ts'depending on your TS config). And this should work both when importing it from other TS files and also when importing it from a JS file. BUT Vitest doesn't support importing TS files from JS files, no matter what extension you use. This is a known issue with the version of Vite we're using. It's fixed in newer versions of Vite/Vitestvitejs/vite#18889
vitest-dev/vitest#5999