You passed the '--typescript' flag but there is no TypeScript blueprint available. A JavaScript blueprint will be generated instead.
alakameljebali opened this issue · comments
Summary
The --typescript
flag does not work with the ember new
command and generates a JavaScript blueprint instead.
Steps to reproduce
- Run
ember new project --package-manager=pnpm --typescript --interactive
- Answer the prompts as follows:
- Is this an app or an addon? App
- Please provide the spoken/content language of your app: fr-FR
- Which CI provider do you want to use? Ignore/Skip
- Observe the output of the command
Expected behavior
The command should create a new Ember app with TypeScript support and generate a TypeScript blueprint.
Actual behavior
The command creates a new Ember app but prints the following message multiple times:
You passed the '--typescript' flag but there is no TypeScript blueprint available. A JavaScript blueprint will be generated instead.
The command then generates a JavaScript blueprint instead of a TypeScript blueprint.
Environment
- Ember CLI version: 5.5.0
- Operating system: Linux Fedora 39
- Node.js Version: 20.10.0
- Package manager: pnpm
The warning comes from here
ember-cli/lib/models/blueprint.js
Lines 483 to 497 in 31cf87a
I suspect it is from files like config/targets.js
and ember-cli-build.js
etc
Can we make the message more friendly, maybe include the filename that outputs the warning?
Maybe something like
You passed the '--typescript' flag, we're just letting you know that ${fileInfo.outputPath} will be generated as a JavaScript file as it is run directly through node.
Had a new user confused with the output
https://discord.com/channels/480462759797063690/486548111221719040/1206049226480558100
I think ideally we should remove the warning for the ones we expect to be javascript.
I could be wrong, but it's probably "hard" to know which files are expected to be JavaScript without maintaining a hardcoded list? Which doesn't feel ideal. I was thinking we could just remove the warning altogether?
I think that is fine, but we should ask @emberjs/core-typescript -- @wagenet @gitKrystan?
I'm in favor of removing the warning altogether.
PR => #10450.