You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -89,15 +89,15 @@ You can find more information on the technologies used in this project (Angular.
89
89
Requirements
90
90
------------
91
91
92
-
-[Node.js](https://nodejs.org) and [yarn](https://yarnpkg.com)
93
-
- Ensure you're running node `v16.x` or `v18.x` and yarn == `v1.x`
92
+
-[Node.js](https://nodejs.org)
93
+
- Ensure you're running node `v16.x` or `v18.x`
94
94
95
95
If you have [`nvm`](https://github.com/creationix/nvm#install-script) or [`nvm-windows`](https://github.com/coreybutler/nvm-windows) installed, which is highly recommended, you can run `nvm install --lts && nvm use` to install and start using the latest Node LTS.
96
96
97
97
Installing
98
98
----------
99
99
100
-
-`yarn install` to install the local dependencies
100
+
-`npm install` to install the local dependencies
101
101
102
102
### Configuring
103
103
@@ -202,7 +202,7 @@ import { environment } from '../environment.ts';
202
202
Running the app
203
203
---------------
204
204
205
-
After you have installed all dependencies you can now run the app. Run `yarn run start:dev` to start a local server which will watch for changes, rebuild the code, and reload the server for you. You can visit it at `http://localhost:4000`.
205
+
After you have installed all dependencies you can now run the app. Run `npm run start:dev` to start a local server which will watch for changes, rebuild the code, and reload the server for you. You can visit it at `http://localhost:4000`.
206
206
207
207
### Running in production mode
208
208
@@ -211,20 +211,20 @@ When building for production we're using Ahead of Time (AoT) compilation. With A
211
211
To build the app for production and start the server (in one command) run:
212
212
213
213
```bash
214
-
yarn start
214
+
npm start
215
215
```
216
216
This will run the application in an instance of the Express server, which is included.
217
217
218
218
If you only want to build for production, without starting, run:
219
219
220
220
```bash
221
-
yarn run build:prod
221
+
npm run build:prod
222
222
```
223
223
This will build the application and put the result in the `dist` folder. You can copy this folder to wherever you need it for your application server. If you will be using the built-in Express server, you'll also need a copy of the `node_modules` folder tucked inside your copy of `dist`.
224
224
225
225
After building the app for production, it can be started by running:
226
226
```bash
227
-
yarn run serve:ssr
227
+
npm run serve:ssr
228
228
```
229
229
230
230
### Running the application with Docker
@@ -238,14 +238,14 @@ Cleaning
238
238
--------
239
239
240
240
```bash
241
-
# clean everything, including node_modules. You'll need to run yarn install again afterwards.
242
-
yarn run clean
241
+
# clean everything, including node_modules. You'll need to run npm install again afterwards.
242
+
npm run clean
243
243
244
244
# clean files generated by the production build (.ngfactory files, css files, etc)
245
-
yarn run clean:prod
245
+
npm run clean:prod
246
246
247
247
# cleans the distribution directory
248
-
yarn run clean:dist
248
+
npm run clean:dist
249
249
```
250
250
251
251
@@ -259,9 +259,9 @@ If you would like to contribute by testing a Pull Request (PR), here's how to do
259
259
1. Pull down the branch that the Pull Request was built from. Easy instructions for doing so can be found on the Pull Request itself.
260
260
* Next to the "Merge" button, you'll see a link that says "command line instructions".
261
261
* Click it, and follow "Step 1" of those instructions to checkout the pull down the PR branch.
262
-
2.`yarn run clean` (This resets your local dependencies to ensure you are up-to-date with this PR)
263
-
3.`yarn install` (Updates your local dependencies to those in the PR)
264
-
4.`yarn start` (Rebuilds the project, and deploys to localhost:4000, by default)
262
+
2.`npm run clean` (This resets your local dependencies to ensure you are up-to-date with this PR)
263
+
3.`npm install` (Updates your local dependencies to those in the PR)
264
+
4.`npm start` (Rebuilds the project, and deploys to localhost:4000, by default)
265
265
5. At this point, the code from the PR will be deployed to http://localhost:4000. Test it out, and ensure that it does what is described in the PR (or fixes the bug described in the ticket linked to the PR).
266
266
267
267
Once you have tested the Pull Request, please add a comment and/or approval to the PR to let us know whether you found it to be successful (or not). Thanks!
@@ -271,13 +271,13 @@ Once you have tested the Pull Request, please add a comment and/or approval to t
271
271
272
272
Unit tests use the [Jasmine test framework](https://jasmine.github.io/), and are run via [Karma](https://karma-runner.github.io/).
273
273
274
-
You can find the Karma configuration file at the same level of this README file:`./karma.conf.js` If you are going to use a remote test environment you need to edit the `./karma.conf.js`. Follow the instructions you will find inside it. To executing tests whenever any file changes you can modify the 'autoWatch' option to 'true' and 'singleRun' option to 'false'. A coverage report is also available at: http://localhost:9876/ after you run: `yarn run coverage`.
274
+
You can find the Karma configuration file at the same level of this README file:`./karma.conf.js` If you are going to use a remote test environment you need to edit the `./karma.conf.js`. Follow the instructions you will find inside it. To executing tests whenever any file changes you can modify the 'autoWatch' option to 'true' and 'singleRun' option to 'false'. A coverage report is also available at: http://localhost:9876/ after you run: `npm run coverage`.
275
275
276
276
The default browser is Google Chrome.
277
277
278
278
Place your tests in the same location of the application source code files that they test, e.g. ending with `*.component.spec.ts`
279
279
280
-
and run: `yarn test`
280
+
and run: `npm test`
281
281
282
282
If you run into odd test errors, see the Angular guide to debugging tests: https://angular.io/guide/test-debugging
283
283
@@ -330,9 +330,9 @@ All E2E tests must be created under the `./cypress/integration/` folder, and mus
330
330
* In the [Cypress Test Runner](https://docs.cypress.io/guides/core-concepts/test-runner), you'll Cypress automatically visit the page. This first test will succeed, as all you are doing is making sure the _page exists_.
331
331
* From here, you can use the [Selector Playground](https://docs.cypress.io/guides/core-concepts/test-runner#Selector-Playground) in the Cypress Test Runner window to determine how to tell Cypress to interact with a specific HTML element on that page.
332
332
* Most commands start by telling Cypress to [get()](https://docs.cypress.io/api/commands/get) a specific element, using a CSS or jQuery style selector
333
-
* It's generally best not to rely on attributes like `class` and `id` in tests, as those are likely to change later on. Instead, you can add a `data-test` attribute to makes it clear that it's required for a test.
333
+
* It's generally best not to rely on attributes like `class` and `id` in tests, as those are likely to change later on. Instead, you can add a `data-test` attribute to makes it clear that it's required for a test.
334
334
* Cypress can then do actions like [click()](https://docs.cypress.io/api/commands/click) an element, or [type()](https://docs.cypress.io/api/commands/type) text in an input field, etc.
335
-
* When running with server-side rendering enabled, the client first receives HTML without the JS; only once the page is rendered client-side do some elements (e.g. a button that toggles a Bootstrap dropdown) become fully interactive. This can trip up Cypress in some cases as it may try to `click` or `type` in an element that's not fully loaded yet, causing tests to fail.
335
+
* When running with server-side rendering enabled, the client first receives HTML without the JS; only once the page is rendered client-side do some elements (e.g. a button that toggles a Bootstrap dropdown) become fully interactive. This can trip up Cypress in some cases as it may try to `click` or `type` in an element that's not fully loaded yet, causing tests to fail.
336
336
* To work around this issue, define the attributes you use for Cypress selectors as `[attr.data-test]="'button' | ngBrowserOnly"`. This will only show the attribute in CSR HTML, forcing Cypress to wait until CSR is complete before interacting with the element.
337
337
* Cypress can also validate that something occurs, using [should()](https://docs.cypress.io/api/commands/should) assertions.
338
338
* Any time you save your test file, the Cypress Test Runner will reload & rerun it. This allows you can see your results quickly as you write the tests & correct any broken tests rapidly.
@@ -357,14 +357,14 @@ Some UI specific configuration documentation is also found in the [`./docs`](doc
357
357
358
358
To build the code documentation we use [TYPEDOC](http://typedoc.org). TYPEDOC is a documentation generator for TypeScript projects. It extracts information from properly formatted comments that can be written within the code files. Follow the instructions [here](http://typedoc.org/guides/doccomments/) to know how to make those comments.
359
359
360
-
Run:`yarn run docs` to produce the documentation that will be available in the 'doc' folder.
360
+
Run:`npm run docs` to produce the documentation that will be available in the 'doc' folder.
361
361
362
362
Other commands
363
363
--------------
364
364
365
365
There are many more commands in the `scripts` section of `package.json`. Most of these are executed by one of the commands mentioned above.
366
366
367
-
A command with a name that starts with `pre` or `post` will be executed automatically before or after the script with the matching name. e.g. if you type `yarn run start` the `prestart` script will run first, then the `start` script will trigger.
367
+
A command with a name that starts with `pre` or `post` will be executed automatically before or after the script with the matching name. e.g. if you type `npm run start` the `prestart` script will run first, then the `start` script will trigger.
This project makes use of [`yarn`](https://yarnpkg.com/en/) to ensure that the exact same dependency versions are used every time you install it.
476
+
This project makes use of [`npm`](https://docs.npmjs.com/about-npm) to ensure that the exact same dependency versions are used every time you install it.
477
477
478
-
* `yarn` creates a [`yarn.lock`](https://yarnpkg.com/en/docs/yarn-lock) to track those versions. That file is updated automatically by whenever dependencies are added/updated/removed via yarn.
479
-
* **Adding new dependencies**: To install/add a new dependency (third party library), use [`yarn add`](https://yarnpkg.com/en/docs/cli/add). For example: `yarn add some-lib`.
480
-
* If you are adding a new build tool dependency (to `devDependencies`), use `yarn add some-lib --dev`
481
-
* **Upgrading existing dependencies**: To upgrade existing dependencies, you can use [`yarn upgrade`](https://yarnpkg.com/en/docs/cli/upgrade). For example: `yarn upgrade some-lib` or `yarn upgrade some-lib@version`
482
-
* **Removing dependencies**: If a dependency is no longer needed, or replaced, use [`yarn remove`](https://yarnpkg.com/en/docs/cli/remove) to remove it.
478
+
* `npm` creates a [`package-lock.json`](https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json) to track those versions. That file is updated automatically by whenever dependencies are added/updated/removed via npm.
479
+
* **Adding new dependencies**: To install/add a new dependency (third party library), use [`npm install`](https://docs.npmjs.com/cli/v10/commands/npm-install). For example: `npm install some-lib`.
480
+
* If you are adding a new build tool dependency (to `devDependencies`), use `npm install some-lib --save--dev`
481
+
* **Upgrading existing dependencies**: To upgrade existing dependencies, you can use [`npm update`](https://docs.npmjs.com/cli/v10/commands/npm-update). For example: `npm update some-lib` or `npm update some-lib@version`
482
+
* **Removing dependencies**: If a dependency is no longer needed, or replaced, use [`npm uninstall`](https://docs.npmjs.com/cli/v10/commands/npm-uninstall) to remove it.
483
483
484
-
As you can see above, using `yarn` commandline tools means that you should never need to modify the `package.json` manually. *We recommend always using `yarn` to keep dependencies updated / in sync.*
484
+
As you can see above, using `npm` commandline tools means that you should never need to modify the `package.json` manually. *We recommend always using `npm` to keep dependencies updated / in sync.*
485
485
486
486
### Adding Typings for libraries
487
487
488
-
If the library does not include typings, you can install them using yarn:
488
+
If the library does not include typings, you can install them using npm:
489
489
490
490
```bash
491
-
yarn add d3
492
-
yarn add @types/d3 --dev
491
+
npm install d3
492
+
npm install @types/d3 --save-dev
493
493
```
494
494
495
495
If the library doesn't have typings available at `@types/`, you can still use it by manually adding typings for it:
@@ -528,12 +528,12 @@ Frequently asked questions
528
528
- See [the official angular style guide](https://angular.io/styleguide)
529
529
- Why is the size of my app larger in development?
530
530
- The production build uses a whole host of techniques (ahead-of-time compilation, rollup to remove unreachable code, minification, etc.) to reduce the size, that aren't used during development in the intrest of build speed.
531
-
- node-pre-gyp ERR in yarn install (Windows)
531
+
- node-pre-gyp ERR in npm install (Windows)
532
532
- install Python x86 version between 2.5 and 3.0 on windows. See [this issue](https://github.com/AngularClass/angular2-webpack-starter/issues/626)
533
-
- How do I handle merge conflicts in yarn.lock?
534
-
- first check out the yarn.lock file from the branch you're merging in to yours: e.g. `git checkout --theirs yarn.lock`
535
-
- now run `yarn install` again. Yarn will create a new lockfile that contains both sets of changes.
536
-
- then run `git add yarn.lock` to stage the lockfile for commit
533
+
- How do I handle merge conflicts in package-lock.json?
534
+
- first check out the package-lock.json file from the branch you're merging in to yours: e.g. `git checkout --theirs package-lock.json`
535
+
- now run `npm install` again. NPM will create a new lockfile that contains both sets of changes.
536
+
- then run `git add package-lock.json` to stage the lockfile for commit
0 commit comments