Skip to content

refactor(config): refactor the config object. #1809

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

Merged
merged 4 commits into from
Aug 24, 2016

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Aug 23, 2016

This also will load angular-cli.json in the HOME directory as a fallback, supports more stuff from the JSON Schema (like default values) than the old one, and actually verify that what you inputs is the right thing.

This will be its own NPM package at some point, as other people will probably be interested in having a JSON Schema loader that gives type safety and provides fallbacks and metadata.

Closes #1763

@hansl hansl force-pushed the config-refactor branch 3 times, most recently from f38ac7a to 6f82d23 Compare August 23, 2016 02:59
@hansl hansl force-pushed the config-refactor branch 2 times, most recently from b857c99 to e93083b Compare August 23, 2016 18:38
config.set(rawArgs[0], rawArgs[1], commandOptions.force);
const [jsonPath, rawValue] = rawArgs;
const config = CliConfig.fromProject();
const type = config.typeOf(rawArgs[0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use config.typeOf(jsonPath); here since it's already destructured?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@filipesilva
Copy link
Contributor

What is the addon/ng2/models/json-schema/schema-tree.ts empty file?

@filipesilva
Copy link
Contributor

Can you also add some information on the README about how to use ng config? We have none atm and mostly ask users to edit the file directly.

@hansl
Copy link
Contributor Author

hansl commented Aug 24, 2016

Re empty file, contains stuff now.
there's no change from the CLI. ng set and ng get are still the same.

@filipesilva
Copy link
Contributor

It's true that they are the same, but we have no documentation whatsoever for users to use them, so no one but us knows how to use this functionality.

@hansl hansl merged commit 1ecd72d into angular:master Aug 24, 2016
@hansl hansl deleted the config-refactor branch August 24, 2016 02:35
@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 Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ng set apps[0].main does not work
4 participants