Skip to content
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

feat(serve): Persist serve options in angular-cli.json #3908

Merged
merged 1 commit into from
Jan 30, 2017

Conversation

delasteve
Copy link
Contributor

Fixes #1156

@clydin
Copy link
Member

clydin commented Jan 9, 2017

host and port would probably be the more useful options to persist.
Especially since liveReloadPort doesn't do anything anymore.
I put a PR together to cleanup the options for serve: #3910

@delasteve delasteve force-pushed the feature/persist-ng-serve-options branch 3 times, most recently from e1211e5 to c80108c Compare January 9, 2017 16:09
};
serve?: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This block was the only thing truly added. The rest was whitespace reindentation (editorconfig).

Copy link
Contributor

Choose a reason for hiding this comment

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

This is because generating the schema.d.ts is not done manually. You need to run npm run build-config-interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I see the $comment! Thanks 😄

Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

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

A few nits. In general looks good to me.

};
serve?: {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is because generating the schema.d.ts is not done manually. You need to run npm run build-config-interface.

const defaultPort = process.env.PORT || 4200;
const defaultLiveReloadPort = config.get('defaults.serve.liveReloadPort') || 49152;
const defaultPort = process.env.PORT || config.get('defaults.serve.port');
const defaultHost = config.get('defaults.serve.host') || 'localhost';
Copy link
Contributor

Choose a reason for hiding this comment

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

config.get should be avoided in the code. It removes typing information as it returns any.

@@ -54,6 +54,11 @@
"module": false,
"pipe": true,
"service": true
},
"serve": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you already have good default values, those are not needed and just add noise to this file. I'd like the default config to grow slimmer.

@delasteve delasteve force-pushed the feature/persist-ng-serve-options branch 3 times, most recently from 7062118 to 8baa45e Compare January 9, 2017 23:07
@delasteve delasteve changed the title feat(serve): Persist port and liveReloadPort in angular-cli.json feat(serve): Persist serve options in angular-cli.json Jan 10, 2017
@delasteve delasteve force-pushed the feature/persist-ng-serve-options branch 2 times, most recently from f92bf97 to 339c8b5 Compare January 19, 2017 21:52
@filipesilva
Copy link
Contributor

@hansl can you re-review?

@delasteve delasteve force-pushed the feature/persist-ng-serve-options branch 7 times, most recently from 81206d7 to 0905cff Compare January 24, 2017 22:26
Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

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

LGTM, just one more thing.

"type": "object",
"properties": {
"port": {
"type": "number",
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to add description for all new properties. We're going to do a full run through existing ones, but new properties should have proper descriptions. This is because we're going to add support for IDEs that support schema, and those descriptions will be shown to users. Also, the config documentation will be generated from these.

@delasteve delasteve force-pushed the feature/persist-ng-serve-options branch from 0905cff to b32835a Compare January 30, 2017 19:45
@hansl hansl merged commit da255b0 into angular:master Jan 30, 2017
@delasteve delasteve deleted the feature/persist-ng-serve-options branch January 30, 2017 20:03
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this pull request Feb 9, 2017
@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 11, 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.

Persist "serve" informations ("port", "live-reload-port") into the angular-cli.json
5 participants