Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/design/docker-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ If an `env` name is provided, other than "default", generate compose files with

If `--use-image == false` and the selected machine for the environment is a Docker Swarm machine, warn the user. Docker Swarm clusters cannot use the `build:` option in compose, since the resulting built image will not be distributed to other nodes. Swarm requires using the `image:` option in compose, pushing the image to a registry beforehand so that the Swarm nodes have a place to pull the image from (see [Swarm Limitations](https://docs.docker.com/compose/swarm/#building-images)).

Certain configuration values will be stored in the project's ngConfig `angular-cli.json` for use with other docker commands (ie. deploy, logs, exec). See also: [Saved State](#saved-state) section.
Certain configuration values will be stored in the project's ngConfig `.angular-cli.json` for use with other docker commands (ie. deploy, logs, exec). See also: [Saved State](#saved-state) section.

Provide instructions on what the user can do after initialization completes (push, deploy).

Expand Down
6 changes: 3 additions & 3 deletions docs/design/ngConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Since the data is static, we only need to keep it in a static store somewhere.

One solution would be to keep the data in the `package.json`. Unfortunately, the metadata contains too much data and the `package.json` file would become unmanageable.

Instead of polluting the package file, a `angular-cli.json` file will be created that contains all the values. Access to that file will be allowed to the user if he knows the structure of the file (unknown keys will be kept but ignored), and it's easy to read and write.
Instead of polluting the package file, a `.angular-cli.json` file will be created that contains all the values. Access to that file will be allowed to the user if he knows the structure of the file (unknown keys will be kept but ignored), and it's easy to read and write.
Copy link
Contributor

Choose a reason for hiding this comment

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

avoid he and she. be gender indifferent. Instead use who here.



## Fallback

There should be two `angular-cli.json` files; one for the project and a general one. The general one should contain information that can be useful when scaffolding new apps, or informations about the user.
There should be two `.angular-cli.json` files; one for the project and a general one. The general one should contain information that can be useful when scaffolding new apps, or informations about the user.
Copy link
Contributor

Choose a reason for hiding this comment

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

informations --> information


The project `angular-cli.json` goes into the project root. The global configuration should live at `$HOME/.angular-cli.json`.
The project `.angular-cli.json` goes into the project root. The global configuration should live at `$HOME/.angular-cli.json`.

## Structure

Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The build artifacts will be stored in the `dist/` directory.
environment file to be used with that build (`--environment=dev` or `--environment=prod`).
By default, the development build target and environment are used.

The mapping used to determine which environment file is used can be found in `angular-cli.json`:
The mapping used to determine which environment file is used can be found in `.angular-cli.json`:
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be nice to show the schema or a link to it somewhere.


```json
"environments": {
Expand All @@ -46,7 +46,7 @@ ng build

You can also add your own env files other than `dev` and `prod` by doing the following:
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe say environment files instead of env files.

- create a `src/environments/environment.NAME.ts`
- add `{ "NAME": 'src/environments/environment.NAME.ts' }` to the `apps[0].environments` object in `angular-cli.json`
- add `{ "NAME": 'src/environments/environment.NAME.ts' }` to the `apps[0].environments` object in `.angular-cli.json`
- use them via the `--env=NAME` flag on the build/serve commands.

### Base tag handling in index.html
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ng e2e
End-to-end tests are run via [Protractor](https://angular.github.io/protractor/).

## Options
`--config` (`-c`) use a specific config file. Defaults to the protractor config file in `angular-cli.json`.
`--config` (`-c`) use a specific config file. Defaults to the protractor config file in `.angular-cli.json`.

`--specs` (`-sp`) override specs in the protractor config.
Can send in multiple specs by repeating flag (`ng e2e --specs=spec1.ts --specs=spec2.ts`).
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/stories/asset-configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Project assets

You use the `assets` array in `angular-cli.json` to list files or folders you want to copy as-is
You use the `assets` array in `.angular-cli.json` to list files or folders you want to copy as-is
when building your project.

By default, the `src/assets/` folder and `src/favicon.ico` are copied over.
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/stories/global-lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Some javascript libraries need to be added to the global scope, and loaded as if
they were in a script tag. We can do this using the `apps[0].scripts` and
`apps[0].styles` properties of `angular-cli.json`.
`apps[0].styles` properties of `.angular-cli.json`.

As an example, to use [Bootstrap 4](http://v4-alpha.getbootstrap.com/) this is
what you need to do:
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/stories/global-scripts.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Global styles

You can add Javascript files to the global scope via the `apps[0].scripts`
property in `angular-cli.json`.
property in `.angular-cli.json`.
These will be loaded exactly as if you had added them in a `<script>` tag inside `index.html`.

This is especially useful for legacy libraries or analytic snippets.
Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/stories/global-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The `styles.css` file allows users to add global styles and supports
If the project is created with the `--style=sass` option, this will be a `.sass`
file instead, and the same applies to `scss/less/styl`.

You can add more global styles via the `apps[0].styles` property in `angular-cli.json`.
You can add more global styles via the `apps[0].styles` property in `.angular-cli.json`.
These will be loaded exactly as if you had added them in a `<link>` tag inside `index.html`.

```json
Expand All @@ -25,4 +25,4 @@ You can also rename the output and lazy load it by using the object format:
{ "input": "lazy-style.scss", "lazy": true },
{ "input": "pre-rename-style.scss", "output": "renamed-style" },
],
```
```
4 changes: 2 additions & 2 deletions docs/documentation/stories/include-bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ npm install bootstrap@next --save

Now that the project is set up it must be configured to include the bootstrap CSS.

- Open the file `angular-cli.json` from the root of your project.
- Open the file `.angular-cli.json` from the root of your project.
- Under the property `apps` the first item in that array is the default application.
- There is a property `styles` which allows external global styles to be applied to your application.
- Specify the path to `bootstrap.min.css`
Expand All @@ -46,7 +46,7 @@ Now that the project is set up it must be configured to include the bootstrap CS
],
```

**Note:** When you make changes to `angular-cli.json` you will need to re-start `ng serve` to pick up configuration changes.
**Note:** When you make changes to `.angular-cli.json` you will need to re-start `ng serve` to pick up configuration changes.

### Testing Project

Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/stories/include-font-awesome.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ npm install --save font-awesome

To add Font Awesome CSS icons to your app...
```json
// in angular-cli.json
// in .angular-cli.json

"styles": [
"styles.css",
Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/stories/moving-into-the-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ relative paths instead.
- Polyfills are listed in `./src/polyfills.ts` so remove `core-js` and `zone.js` from `index.html`.
- SystemJS is not needed anymore, so remove it from `index.html` as well.
- Instead of using `<script>` and `<link>` tags directly in `index.html`, use
`angular-cli.json` instead.
- Look for the `styles` array in `angular-cli.json` and add in any CSS files you have in
`.angular-cli.json` instead.
- Look for the `styles` array in `.angular-cli.json` and add in any CSS files you have in
`src/index.html`. Use a relative path from `./src/`.
- Do the same for any remaining script tags as well, using the `scripts` array instead.

Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/stories/moving-out-of-the-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Each project is unique, and even though we try to cater to most setups in Angula
you need a custom setup.

Even if you need to use a different build system, you can still use other Angular CLI features
like `ng generate`, `ng lint`, `ng test` and `ng e2e` by leaving in `angular-cli.json` and
like `ng generate`, `ng lint`, `ng test` and `ng e2e` by leaving in `.angular-cli.json` and
supporting files like `src/test.ts`.

Moving out of the CLI is very similar to [Moving into the CLI](moving-into-the-cli).
Expand Down Expand Up @@ -40,7 +40,7 @@ You might also need to make adjustments to conform to your new build system.
You might need to change these.
- Polyfills are listed in `../old-awesome-app/src/polyfills.ts`. Incorporate these into the new
project.
- The CLI lists used `<script>` and `<link>` tags in the `angular-cli.json` `scripts`
- The CLI lists used `<script>` and `<link>` tags in the `.angular-cli.json` `scripts`
and `styles` array. Check import these in your new project and add them accordingly.

The final step is to copy your git history so you can continue working without losing anything:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `angular-cli.json`.
// The list of which env maps to which file can be found in `.angular-cli.json`.

export const environment = {
production: false
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/blueprints/ng2/files/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function (config) {
fixWebpackSourcePaths: true
},
angularCli: {
config: './angular-cli.json',
config: './.angular-cli.json',
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/commands/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const E2eCommand = Command.extend({
const e2eConfig = CliConfig.fromProject().config.e2e;

if (!e2eConfig.protractor.config) {
throw new SilentError('No protractor config found in angular-cli.json.');
throw new SilentError('No protractor config found in .angular-cli.json.');
}

commandOptions.config = e2eConfig.protractor.config;
Expand Down
3 changes: 2 additions & 1 deletion packages/@angular/cli/ember-cli/lib/models/blueprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,8 @@ Blueprint.list = function(options) {
@property renameFiles
*/
Blueprint.renamedFiles = {
'gitignore': '.gitignore'
'gitignore': '.gitignore',
'angular-cli.json': '.angular-cli.json'
};

/**
Expand Down
12 changes: 8 additions & 4 deletions packages/@angular/cli/models/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import * as chalk from 'chalk';
import * as fs from 'fs';
import * as path from 'path';

export const CLI_CONFIG_FILE_NAME = 'angular-cli.json';
export const CLI_CONFIG_FILE_NAME = '.angular-cli.json';
const CLI_CONFIG_FILE_NAME_ALT = 'angular-cli.json';
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we show a warning if users are using the old one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I spoke with @hansl about this, and we think we should silently fallback to the old file name. This means fewer changes are needed, but newly generated projects will generate with the new file name.



function _findUp(name: string, from: string) {
Expand Down Expand Up @@ -38,8 +39,11 @@ export class CliConfig extends CliConfigBase<ConfigInterface> {
// Find the configuration, either where specified, in the angular-cli project
// (if it's in node_modules) or from the current process.
return (projectPath && _findUp(CLI_CONFIG_FILE_NAME, projectPath))
|| (projectPath && _findUp(CLI_CONFIG_FILE_NAME_ALT, projectPath))
|| _findUp(CLI_CONFIG_FILE_NAME, process.cwd())
|| _findUp(CLI_CONFIG_FILE_NAME, __dirname);
|| _findUp(CLI_CONFIG_FILE_NAME_ALT, process.cwd())
|| _findUp(CLI_CONFIG_FILE_NAME, __dirname)
|| _findUp(CLI_CONFIG_FILE_NAME_ALT, __dirname);
}

static fromGlobal(): CliConfig {
Expand All @@ -66,7 +70,7 @@ export class CliConfig extends CliConfigBase<ConfigInterface> {
// If any of them returned true, output a deprecation warning.
if (aliases.some(x => !!x)) {
console.error(chalk.yellow(oneLine`
The "defaults.prefix" and "defaults.sourceDir" properties of angular-cli.json
The "defaults.prefix" and "defaults.sourceDir" properties of .angular-cli.json
are deprecated in favor of "apps[0].root" and "apps[0].prefix".\n
Please update in order to avoid errors in future versions of Angular CLI.
`));
Expand Down Expand Up @@ -94,7 +98,7 @@ export class CliConfig extends CliConfigBase<ConfigInterface> {
// If any of them returned true, output a deprecation warning.
if (aliases.some(x => !!x)) {
console.error(chalk.yellow(oneLine`
The "defaults.prefix" and "defaults.sourceDir" properties of angular-cli.json
The "defaults.prefix" and "defaults.sourceDir" properties of .angular-cli.json
are deprecated in favor of "apps[0].root" and "apps[0].prefix".\n
Please update in order to avoid errors in future versions of Angular CLI.
`));
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/models/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class CliConfig<JsonType> {
content = JSON.parse(configContent);
} catch (err) {
throw new InvalidConfigError(
'Parsing angular-cli.json failed. Please make sure your angular-cli.json'
'Parsing .angular-cli.json failed. Please make sure your .angular-cli.json'
+ ' is valid JSON. Error:\n' + err
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/models/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class NgCliWebpackConfig {
return Object.assign({}, targetDefaults[buildOptions.target], buildOptions);
}

// Fill in defaults from angular-cli.json
// Fill in defaults from .angular-cli.json
private mergeConfigs(buildOptions: BuildOptions, appConfig: any) {
const mergeableOptions = {
outputPath: appConfig.outDir,
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/models/webpack-configs/production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const getProdConfig = function (wco: WebpackConfigOptions) {
throw new Error(stripIndent`
Your project is configured with serviceWorker = true, but @angular/service-worker
is not installed. Run \`npm install --save-dev @angular/service-worker\`
and try again, or run \`ng set apps.0.serviceWorker=false\` in your angular-cli.json.
and try again, or run \`ng set apps.0.serviceWorker=false\` in your .angular-cli.json.
`);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/tasks/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default Task.extend({
rimraf.sync(path.resolve(this.project.root, outputPath));

const serveDefaults = {
// default deployUrl to '' on serve to prevent the default from angular-cli.json
// default deployUrl to '' on serve to prevent the default from .angular-cli.json
deployUrl: ''
};

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tests/build/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export default function () {
'./src/output-asset.txt': 'output-asset.txt',
'./node_modules/some-package/node_modules-asset.txt': 'node_modules-asset.txt',
}))
// Add asset config in angular-cli.json.
.then(() => updateJsonFile('angular-cli.json', configJson => {
// Add asset config in .angular-cli.json.
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['assets'] = [
'folder',
Expand Down
10 changes: 10 additions & 0 deletions tests/e2e/tests/build/config-file-fallback.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {ng} from '../../utils/process';
import {moveFile} from '../../utils/fs';


export default function() {
return Promise.resolve()
.then(() => ng('build'))
.then(() => moveFile('.angular-cli.json', 'angular-cli.json'))
.then(() => ng('build'));
}
2 changes: 1 addition & 1 deletion tests/e2e/tests/build/deploy-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function () {
// verify --deploy-url isn't applied to extracted css urls
.then(() => expectFileToMatch('dist/styles.bundle.css', 'url\(more.svg\)'))
// verify option also works in config
.then(() => updateJsonFile('angular-cli.json', configJson => {
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['deployUrl'] = 'config-deployUrl/';
}))
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/build/filename.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {copyFile} from '../../utils/fs';
export default function() {
return Promise.resolve()
.then(() => copyFile('src/index.html', 'src/config-index.html'))
.then(() => updateJsonFile('angular-cli.json', configJson => {
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['outDir'] = 'config-build-output';
app['index'] = 'config-index.html';
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/build/output-dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function() {
.then(() => expectFileToExist('./build-output/index.html'))
.then(() => expectFileToExist('./build-output/main.bundle.js'))
.then(() => expectToFail(expectGitToBeClean))
.then(() => updateJsonFile('angular-cli.json', configJson => {
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['outDir'] = 'config-build-output';
}))
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/build/scripts-array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function () {
'src/common-entry-style.css': '.common-entry-style { color: red }',
})
.then(() => appendToFile('src/main.ts', 'import \'./string-script.js\';'))
.then(() => updateJsonFile('angular-cli.json', configJson => {
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['scripts'] = [
'string-script.js',
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/build/styles/extract-css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function () {
'src/common-entry-style.css': '.common-entry-style { color: red }',
'src/common-entry-script.js': 'console.log(\'common-entry-script\');'
}))
.then(() => updateJsonFile('angular-cli.json', configJson => {
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['styles'] = [
'string-style.css',
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tests/build/styles/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function () {
h1 { background: #000; }
`})
// change files to use preprocessor
.then(() => updateJsonFile('angular-cli.json', configJson => {
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['styles'] = [`styles.${ext}`];
}))
Expand All @@ -57,7 +57,7 @@ export default function () {
.then(() => expectFileToMatch('dist/main.bundle.js',
/h1.*background:\s*#000+/))
// change files back
.then(() => updateJsonFile('angular-cli.json', configJson => {
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['styles'] = ['styles.css'];
}))
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/build/styles/include-paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function () {
}))
.then(() => replaceInFile('src/app/app.component.ts', `'./app.component.css\'`,
`'./app.component.scss', './app.component.styl'`))
.then(() => updateJsonFile('angular-cli.json', configJson => {
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['styles'] = [
'styles.scss',
Expand Down
Loading