Skip to content

Commit

Permalink
docs: improve README files generated by Angular schematics
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-agius4 committed Oct 14, 2024
1 parent a68e832 commit 29855bf
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 19 deletions.
59 changes: 49 additions & 10 deletions packages/schematics/angular/library/files/README.md.template
Original file line number Diff line number Diff line change
@@ -1,24 +1,63 @@
# <%= classify(name) %>

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version <%= angularLatestVersion %>.
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version <%= angularLatestVersion %>.

## Code scaffolding

Run `ng generate component component-name --project <%= name %>` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project <%= name %>`.
> Note: Don't forget to add `--project <%= name %>` or else it will be added to the default project in your `angular.json` file.
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:

## Build
```bash
ng generate component component-name
```

Run `ng build <%= name %>` to build the project. The build artifacts will be stored in the `dist/` directory.
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:

## Publishing
```bash
ng generate --help
```

After building your library with `ng build <%= name %>`, go to the dist folder `cd dist/<%= dasherize(name) %>` and run `npm publish`.
## Building

To build the library, run:

```bash
ng build <%= name %>
```

This command will compile your project, and the build artifacts will be placed in the `dist/` directory.

### Publishing the Library

Once the project is built, you can publish your library by following these steps:

1. Navigate to the `dist` directory:
```bash
cd dist/<%= dasherize(name) %>
```

2. Run the `npm publish` command to publish your library to the npm registry:
```bash
npm publish
```

## Running unit tests

Run `ng test <%= name %>` to execute the unit tests via [Karma](https://karma-runner.github.io).
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:

```bash
ng test
```

## Running end-to-end tests

For end-to-end (e2e) testing, run:

```bash
ng e2e
```

Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.

## Further help
## Additional Resources

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
50 changes: 41 additions & 9 deletions packages/schematics/angular/workspace/files/README.md.template
Original file line number Diff line number Diff line change
@@ -1,27 +1,59 @@
# <%= utils.classify(name) %>

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version <%= version %>.
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version <%= version %>.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
To start a local development server, run:

```bash
ng serve
```

Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate --help` to see all the available schematics you can generate.
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:

```bash
ng generate component component-name
```

For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:

```bash
ng generate --help
```

## Build
## Building

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
To build the project run:

```bash
ng build
```

This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:

```bash
ng test
```

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
For end-to-end (e2e) testing, run:

```bash
ng e2e
```

Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.

## Further help
## Additional Resources

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.

0 comments on commit 29855bf

Please sign in to comment.