Skip to content

Commit 576aece

Browse files
committed
README.md: use npm
Use npm instead of yarn. Mostly a search and replace, minus some changes in terminology, for example "yarn add" vs "npm install".
1 parent d11e417 commit 576aece

1 file changed

Lines changed: 42 additions & 42 deletions

File tree

README.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace
3535
Quick start
3636
-----------
3737

38-
**Ensure you're running [Node](https://nodejs.org) `v16.x` or `v18.x`, [npm](https://www.npmjs.com/) >= `v5.x` and [yarn](https://yarnpkg.com) == `v1.x`**
38+
**Ensure you're running [Node](https://nodejs.org) `v16.x` or `v18.x`, [npm](https://www.npmjs.com/) >= `v5.x`**
3939

4040
```bash
4141
# clone the repo
@@ -45,10 +45,10 @@ git clone https://github.com/DSpace/dspace-angular.git
4545
cd dspace-angular
4646

4747
# install the local dependencies
48-
yarn install
48+
npm install
4949

5050
# start the server
51-
yarn start
51+
npm start
5252
```
5353

5454
Then go to [http://localhost:4000](http://localhost:4000) in your browser
@@ -77,7 +77,7 @@ Table of Contents
7777
- [Recommended Editors/IDEs](#recommended-editorsides)
7878
- [Collaborating](#collaborating)
7979
- [File Structure](#file-structure)
80-
- [Managing Dependencies (via yarn)](#managing-dependencies-via-yarn)
80+
- [Managing Dependencies (via npm)](#managing-dependencies-via-npm)
8181
- [Frequently asked questions](#frequently-asked-questions)
8282
- [License](#license)
8383

@@ -89,15 +89,15 @@ You can find more information on the technologies used in this project (Angular.
8989
Requirements
9090
------------
9191

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`
9494

9595
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.
9696

9797
Installing
9898
----------
9999

100-
- `yarn install` to install the local dependencies
100+
- `npm install` to install the local dependencies
101101

102102
### Configuring
103103

@@ -202,7 +202,7 @@ import { environment } from '../environment.ts';
202202
Running the app
203203
---------------
204204

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`.
206206

207207
### Running in production mode
208208

@@ -211,20 +211,20 @@ When building for production we're using Ahead of Time (AoT) compilation. With A
211211
To build the app for production and start the server (in one command) run:
212212

213213
```bash
214-
yarn start
214+
npm start
215215
```
216216
This will run the application in an instance of the Express server, which is included.
217217

218218
If you only want to build for production, without starting, run:
219219

220220
```bash
221-
yarn run build:prod
221+
npm run build:prod
222222
```
223223
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`.
224224

225225
After building the app for production, it can be started by running:
226226
```bash
227-
yarn run serve:ssr
227+
npm run serve:ssr
228228
```
229229

230230
### Running the application with Docker
@@ -238,14 +238,14 @@ Cleaning
238238
--------
239239

240240
```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
243243

244244
# clean files generated by the production build (.ngfactory files, css files, etc)
245-
yarn run clean:prod
245+
npm run clean:prod
246246

247247
# cleans the distribution directory
248-
yarn run clean:dist
248+
npm run clean:dist
249249
```
250250

251251

@@ -259,9 +259,9 @@ If you would like to contribute by testing a Pull Request (PR), here's how to do
259259
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.
260260
* Next to the "Merge" button, you'll see a link that says "command line instructions".
261261
* 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)
265265
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).
266266

267267
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
271271

272272
Unit tests use the [Jasmine test framework](https://jasmine.github.io/), and are run via [Karma](https://karma-runner.github.io/).
273273

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`.
275275

276276
The default browser is Google Chrome.
277277

278278
Place your tests in the same location of the application source code files that they test, e.g. ending with `*.component.spec.ts`
279279

280-
and run: `yarn test`
280+
and run: `npm test`
281281

282282
If you run into odd test errors, see the Angular guide to debugging tests: https://angular.io/guide/test-debugging
283283

@@ -330,9 +330,9 @@ All E2E tests must be created under the `./cypress/integration/` folder, and mus
330330
* 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_.
331331
* 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.
332332
* 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.
334334
* 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.
336336
* 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.
337337
* Cypress can also validate that something occurs, using [should()](https://docs.cypress.io/api/commands/should) assertions.
338338
* 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
357357
358358
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.
359359
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.
361361
362362
Other commands
363363
--------------
364364
365365
There are many more commands in the `scripts` section of `package.json`. Most of these are executed by one of the commands mentioned above.
366366
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.
368368
369369
Recommended Editors/IDEs
370370
------------------------
@@ -456,6 +456,7 @@ dspace-angular
456456
├── LICENSES_THIRD_PARTY *
457457
├── nodemon.json * Nodemon (https://nodemon.io/) configuration
458458
├── package.json * This file describes the npm package for this project, its dependencies, scripts, etc.
459+
├── package-lock.json * npm lockfile (https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json)
459460
├── postcss.config.js * PostCSS (http://postcss.org/) configuration
460461
├── README.md * This document
461462
├── SECURITY.md *
@@ -466,30 +467,29 @@ dspace-angular
466467
├── tsconfig.spec.json * TypeScript config for tests
467468
├── tsconfig.ts-node.json * TypeScript config for using ts-node directly
468469
├── tslint.json * TSLint (https://palantir.github.io/tslint/) configuration
469-
├── typedoc.json * TYPEDOC configuration
470-
└── yarn.lock * Yarn lockfile (https://yarnpkg.com/en/docs/yarn-lock)
470+
└── typedoc.json * TYPEDOC configuration
471471
```
472472
473-
Managing Dependencies (via yarn)
473+
Managing Dependencies (via npm)
474474
-------------
475475
476-
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.
477477
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.
483483
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.*
485485
486486
### Adding Typings for libraries
487487
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:
489489
490490
```bash
491-
yarn add d3
492-
yarn add @types/d3 --dev
491+
npm install d3
492+
npm install @types/d3 --save-dev
493493
```
494494

495495
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
528528
- See [the official angular style guide](https://angular.io/styleguide)
529529
- Why is the size of my app larger in development?
530530
- 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)
532532
- 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
537537
- and `git commit` to conclude the merge
538538

539539
Getting Help

0 commit comments

Comments
 (0)