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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Schematics: Run local a schematic written in TypeScript directly (ts-node integration) #13858
Comments
Hi, In general, I don't think shipping or transpile TypeScript at runtime is a good idea as it opens a whole new pandora box. Compiling a
Apart from that consumers of a schematic, shouldn't care if it's written in TypeScript or vanilla JavaScript and hence when compiling at runtime they might get a TypeScript error, which for them are un-actionable and irrelevant. Also, the consumers might need to install dev only dependencies which otherwise won't have too. Such as an |
@alan-agius4 Shipping TS is not good, totally I agree. I've mentioned about only project local use of schematics. It's a common demand that scaffolding some application code in project local. |
@lacolaco, yeah in your case, ts-node might work, however this would mean a couple of things.
|
Technically, I don't want to introduce ts-node in the CLI. I just want to run schematics with ts-node. Currently, schematics-cli is doing many jobs. It is designed as a general reference implementation of schematics runner but technically I don't think it is easy to implement another tool equivalent to that. If it can be executed in Node.js script with well-abstracted easy API, I can run just |
something like |
Hi @lacolaco, This is a great feature request. Unfortunately the schematics CLI is not a priority right now, but we do accept pull requests to add features like these. I'm going to remove the need further discussion, but let us know if you can implement that we can help you answer questions. |
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends. Find more details about Angular's feature request process in our documentation. |
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage. We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package. You can find more details about the feature request process in our documentation. |
馃殌 Feature request
Command (mark with an
x
)Description
Schematics runner can accept a JavsScript file as a
factory
of a schematic.To create boilerplates in my app, it seems a good solution to create local schematics. But it is not easy to get ready.
Writing schematics without TypeScript's help is tough and unsafe. But schematics cannot use them. We have to do manually transpiling with
tsc
and executing the output JS. Very primitive and boring.Describe the solution you'd like
If schematics runner can handle TypeScript files directly, developers are free from non-essencial jobs and the repository can keep clean.
I think ts-node/register can help it.
The text was updated successfully, but these errors were encountered: