Skip to content

Feature request: add ability to define angular.json in TypeScript as a .ts file #12943

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

Closed
ilDon opened this issue Nov 12, 2018 · 5 comments
Closed
Labels
area: @angular-devkit/architect feature Issue that requests a new feature
Milestone

Comments

@ilDon
Copy link

ilDon commented Nov 12, 2018

Bug Report or Feature Request

- [ ] bug report -> please search issues before submitting
- [x] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [x] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Any

Desired functionality

Currently all configuration goes into one single file angular.json.

As some projects grow in dimensions, such json file can get long (in terms of lines) and messy (in terms of number of configurations and alike). To make life easier angular-cli could support also a configuration file in TypeScript (e.g. angular.ts).

Such file could be exporting: const config: AngularConfiguration = { ... }.

This would make it possible to split the different parts of the configurations in multiple sub-files, that we could import in angular.ts configuration constant, and all other awesome things that TypeScript allows us to do.

Mention any other details that might be useful

The cli could look first for angular.json, if it does not find it, it could look for angular.ts. Then, if angular.ts is present, it could parse the exported config constant (JSON.parse(config)) and work as usual.

Eventually, we could add to the TS config file the ability to define WebPack Plugins to be added to the build process, so that we do not need to run ng eject, keeping everything tide and clean. In this case, though, we would need a deeper review of the cli, as the parse route described above would not work for this purpose.

@alan-agius4 alan-agius4 added feature Issue that requests a new feature area: @angular-devkit/architect labels Nov 12, 2018
@ngbot ngbot bot added this to the Backlog milestone Nov 12, 2018
@jonathanlie
Copy link

would love this as well. That said, is there any way we could define the project definition in just .js? Currently in need to define several custom architect commands that share common options, this would help a lot.

@fetis
Copy link

fetis commented Jun 21, 2019

I think it relates to this #10612

@JounQin
Copy link
Contributor

JounQin commented Jan 2, 2020

would love this as well. That said, is there any way we could define the project definition in just .js? Currently in need to define several custom architect commands that share common options, this would help a lot.

+1 for this, is there any news? Or related PR? But it seems a lot of Angular related tools like @storybook/angular hard codes angular.json in their source files. It maybe a BREAKING CHANGE.

@clydin
Copy link
Member

clydin commented May 27, 2020

Having the configuration be represented as data (JSON) provides support for the update and migration stories of the Angular CLI. It would drastically increase the complexity and in many cases prevent the current migration experience from occurring if the format was changed to be code instead of data. Based on this, the Angular CLI does not have any plans to expand the supported formats at this time.

@clydin clydin closed this as completed May 27, 2020
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular-devkit/architect feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

6 participants