-
Notifications
You must be signed in to change notification settings - Fork 12k
refactor(@angular/cli): simplify default arguments in angular-cli.json #4389
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,17 @@ export class CliConfig extends CliConfigBase<ConfigInterface> { | |
cliConfig.alias('apps.0.prefix', 'defaults.prefix') | ||
]; | ||
|
||
// Additional aliases which do not emit any messages. | ||
cliConfig.alias('defaults.interface.prefix', 'defaults.inline.prefixInterfaces'); | ||
cliConfig.alias('defaults.component.inlineStyle', 'defaults.inline.style'); | ||
cliConfig.alias('defaults.component.inlineTemplate', 'defaults.inline.template'); | ||
cliConfig.alias('defaults.component.spec', 'defaults.spec.component'); | ||
cliConfig.alias('defaults.class.spec', 'defaults.spec.class'); | ||
cliConfig.alias('defaults.component.directive', 'defaults.spec.directive'); | ||
cliConfig.alias('defaults.component.module', 'defaults.spec.module'); | ||
cliConfig.alias('defaults.component.pipe', 'defaults.spec.pipe'); | ||
cliConfig.alias('defaults.component.service', 'defaults.spec.service'); | ||
|
||
// If any of them returned true, output a deprecation warning. | ||
if (aliases.some(x => !!x)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This warning should also be updated. Maybe it should be a generic warning? Not sure. I have a PR that will also need to do this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hansl and I chatted and we decided to leave the remapping of these as silent, as the correct values will still be handled correctly in the config file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll do the same to mine then. |
||
console.error(chalk.yellow(oneLine` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {join} from 'path'; | ||
import {ng} from '../../../utils/process'; | ||
import {expectFileToExist} from '../../../utils/fs'; | ||
import {updateJsonFile} from '../../../utils/project'; | ||
|
||
|
||
export default function() { | ||
const appDir = join('src', 'app'); | ||
|
||
return Promise.resolve() | ||
.then(() => updateJsonFile('angular-cli.json', configJson => { | ||
const comp = configJson.defaults.component; | ||
comp.flat = true; | ||
})) | ||
.then(() => ng('generate', 'component', 'test-component')) | ||
.then(() => expectFileToExist(appDir)) | ||
.then(() => expectFileToExist(join(appDir, 'test-component.component.ts'))) | ||
.then(() => expectFileToExist(join(appDir, 'test-component.component.spec.ts'))) | ||
.then(() => expectFileToExist(join(appDir, 'test-component.component.html'))) | ||
.then(() => expectFileToExist(join(appDir, 'test-component.component.css'))) | ||
|
||
// Try to run the unit tests. | ||
.then(() => ng('test', '--single-run')); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use an alias for these, and a warning if the alias is used.
See here for an example.