Skip to content

Commit ae91f45

Browse files
jbogarthydejasonaden
authored andcommitted
docs: update file structure and workspace config for v8 (angular#30595)
PR Close angular#30595
1 parent f74e0fd commit ae91f45

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

aio/content/guide/file-structure.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ You develop applications in the context of an Angular [workspace](guide/glossary
55
The Angular CLI `ng new` command creates a workspace.
66

77
<code-example language="bash" linenums="false">
8-
ng new &lt;project_name&gt;
8+
ng new &lt;my-project&gt;
99
</code-example>
1010

11-
When you run this command, the CLI installs the necessary Angular npm packages and other dependencies in a new workspace, with a root folder named *project_name*.
12-
The workspace root folder contains workspace configuration files and a README file with generated descriptive text that you can customize.
11+
When you run this command, the CLI installs the necessary Angular npm packages and other dependencies in a new workspace, with a root-level application named *my-project*.
12+
The workspace root folder contains various support and configuration files, and a README file with generated descriptive text that you can customize.
1313

14-
By default, `ng new` also creates an initial skeleton application, along with its end-to-end tests.
14+
By default, `ng new` creates an initial skeleton application at the root level of the workspace, along with its end-to-end tests.
1515
The skeleton is for a simple Welcome application that is ready to run and easy to modify.
16-
This *root application* has the same name as the workspace, and the source files reside in the `src/` subfolder of the workspace.
16+
The root-level application has the same name as the workspace, and the source files reside in the `src/` subfolder of the workspace.
1717

1818
This default behavior is suitable for a typical "multi-repo" development style where each application resides in its own workspace.
1919
Beginners and intermediate users are encouraged to use `ng new` to create a separate workspace for each application.
@@ -28,27 +28,29 @@ See [Setting up for a multi-project workspace](#multiple-projects) below.
2828
## Workspace configuration files
2929

3030
All projects within a workspace share a [CLI configuration context](guide/workspace-config).
31-
The top level of the workspace contains workspace-wide configuration files.
31+
The top level of the workspace contains workspace-wide configuration files, configuration files for the root-level application, and subfolders for the root-level application source and test files.
3232

3333
| WORKSPACE CONFIG FILES | PURPOSE |
3434
| :--------------------- | :------------------------------------------|
35-
| `node_modules/` | Provides [npm packages](guide/npm-packages) to the entire workspace. Workspace-wide `node_modules` dependencies are visible to all projects. |
3635
| `.editorconfig` | Configuration for code editors. See [EditorConfig](https://editorconfig.org/). |
3736
| `.gitignore` | Specifies intentionally untracked files that [Git](https://git-scm.com/) should ignore. |
37+
| `README.md` | Introductory documentation for the root app. |
3838
| `angular.json` | CLI configuration defaults for all projects in the workspace, including configuration options for build, serve, and test tools that the CLI uses, such as [TSLint](https://palantir.github.io/tslint/), [Karma](https://karma-runner.github.io/), and [Protractor](http://www.protractortest.org/). For details, see [Angular Workspace Configuration](guide/workspace-config). |
3939
| `package.json` | Configures [npm package dependencies](guide/npm-packages) that are available to all projects in the workspace. See [npm documentation](https://docs.npmjs.com/files/package.json) for the specific format and contents of this file. |
4040
| `package-lock.json` | Provides version information for all packages installed into `node_modules` by the npm client. See [npm documentation](https://docs.npmjs.com/files/package-lock.json) for details. If you use the yarn client, this file will be [yarn.lock](https://yarnpkg.com/lang/en/docs/yarn-lock/) instead. |
41-
| `README.md` | Introductory documentation for the root app. |
41+
| `src/` | Source files for the root-level application project. |
42+
| `node_modules/` | Provides [npm packages](guide/npm-packages) to the entire workspace. Workspace-wide `node_modules` dependencies are visible to all projects. |
4243
| `tsconfig.json` | Default [TypeScript](https://www.typescriptlang.org/) configuration for projects in the workspace. |
4344
| `tslint.json` | Default [TSLint](https://palantir.github.io/tslint/) configuration for projects in the workspace. |
4445

46+
4547
## Application project files
4648

47-
By default, the CLI command `ng new my-app` creates a workspace folder named "my-app" and generates a new application skeleton for a root application at the top level of the workspace.
49+
By default, the CLI command `ng new my-app` creates a workspace folder named "my-app" and generates a new application skeleton in a `src/` folder at the top level of the workspace.
4850
A newly generated application contains source files for a root module, with a root component and template.
4951

5052
When the workspace file structure is in place, you can use the `ng generate` command on the command line to add functionality and data to the application.
51-
This initial starter application is the *default app* for CLI commands (unless you change the default after creating [additional apps](#multiple-projects)).
53+
This initial root-level application is the *default app* for CLI commands (unless you change the default after creating [additional apps](#multiple-projects)).
5254

5355
<div class="alert is-helpful">
5456

@@ -105,10 +107,11 @@ Project-specific [TypeScript](https://www.typescriptlang.org/) configuration fil
105107

106108
### End-to-end test files
107109

108-
An `e2e/` subfolder contains source files for a set of end-to-end tests that correspond to an application, along with test-specific configuration files.
110+
An `e2e/` folder at the top level contains source files for a set of end-to-end tests that correspond to the root-level application, along with test-specific configuration files.
111+
112+
For a multi-project workspace, application-specific end-to-end tests are in the project root, under `projects/project-name/e2e/`.
109113

110114
<code-example language="none" linenums="false">
111-
my-app/
112115
e2e/
113116
src/ (end-to-end tests for my-app)
114117
app.e2e-spec.ts
@@ -126,7 +129,7 @@ A multi-project workspace is suitable for an enterprise that uses a single repos
126129
### Setting up for a multi-project workspace
127130

128131
If you intend to have multiple projects in a workspace, you can skip the initial application generation when you create the workspace, and give the workspace a unique name.
129-
The following command creates a workspace with all of the workspace-wide configuration files, but no root application.
132+
The following command creates a workspace with all of the workspace-wide configuration files, but no root-level application.
130133

131134
<code-example language="bash" linenums="false">
132135
ng new my-workspace --createApplication="false"

aio/content/guide/workspace-config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ When you create a library project with `ng generate library`, the library projec
4444
The following top-level configuration properties are available for each project, under `projects:<project_name>`.
4545

4646
<code-example format="." language="json" linenums="false">
47-
"my-v7-app": {
47+
"my-app": {
4848
"root": "",
4949
"sourceRoot": "src",
5050
"projectType": "application",

0 commit comments

Comments
 (0)