Skip to content

Commit 1653885

Browse files
committed
Migarte from yarn to npm
1 parent 89d7c83 commit 1653885

14 files changed

+5325
-6975
lines changed

.github/workflows/coverage.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
- uses: actions/setup-node@v2
1515
with:
1616
node-version: ${{ matrix.node-version }}
17-
cache: 'yarn'
18-
- run: yarn set version berry
19-
- run: yarn install
20-
- run: yarn coverage:check
17+
cache: npm
18+
- run: npm -v
19+
- run: node -v
20+
- run: npm ci
21+
- run: npm run coverage:check

.github/workflows/test.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
- uses: actions/setup-node@v2
1919
with:
2020
node-version: ${{ matrix.node-version }}
21-
cache: 'yarn'
22-
- run: yarn set version berry
23-
- run: yarn -v
24-
- run: yarn install
25-
- run: yarn test
21+
cache: npm
22+
- run: npm -v
23+
- run: node -v
24+
- run: npm ci
25+
- run: npm test

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn lint
4+
npm run lint

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14

.yarn/plugins/@yarnpkg/plugin-echo-execute.cjs

-8
This file was deleted.

.yarn/releases/yarn-3.1.0.cjs

-768
This file was deleted.

.yarnrc.yml

-5
This file was deleted.

README.md

+17-33
Original file line numberDiff line numberDiff line change
@@ -15,96 +15,79 @@ Setup necessary tooling and install dependencies first:
1515

1616
Refer to [official docs](https://nodejs.org/en/download/). Alternatively you may use Node version manager like [nvm](https://github.com/nvm-sh/nvm).
1717

18-
### Yarn (3.x)
19-
20-
```bash
21-
npm install -g yarn
22-
```
2318

2419
### Setup project
2520

26-
Update yarn to 3.x version:
27-
28-
```bash
29-
yarn set version berry
30-
```
31-
3221
Install project dependencies:
3322

3423
```bash
35-
yarn install
36-
```
37-
38-
Setup husky:
39-
40-
```bash
41-
yarn prepare
24+
npm i
4225
```
4326

4427
## Commands
4528

4629
```bash
47-
yarn build[:w]
30+
npm run build[:w]
4831
```
4932

5033
Transpiles `.ts` sources and tests (`src` and `test` dirs) and outputs JS files to `build` directory. When run with `:w` it will watch for changes and rebuild automatically.
5134

5235
```bash
53-
yarn test[:w]
36+
npm run test[:w]
5437
```
5538

5639
Runs all tests from `test` folder. It runs `build` internally so it doesn't have to be run manually. When run with `:w` it will watch for changes, rebuild and rerun test automatically.
5740

5841
```bash
59-
yarn bdd
42+
npm run bdd
6043
```
6144

6245
Runs all BDD tests from `bdd` directory. It runs `build` internally so it doesn't have to be run manually.
6346

6447
```bash
65-
yarn coverage
48+
npm run coverage
6649
```
6750

6851
Checks code coverage, generates HTML report and serves it on 8080 port.
6952

7053
```bash
71-
yarn coverage:check
54+
npm run coverage:check
7255
```
7356

7457
Checks code coverage. Will fail if it is below a threshold defined in `package.json`. Useful as a CI job.
7558

7659
```bash
77-
yarn coverage:generate
60+
npm run coverage:generate
7861
```
7962

8063
Checks code coverage and generates HTML report.
8164

8265
```bash
83-
yarn coverage:[unit|bdd]
66+
npm run coverage:[unit|bdd]
8467
```
8568

8669
Generates code coverage for given set of tests. _It's a subtask and should not be run separately_.
8770

8871
```bash
89-
yarn coverage:report
72+
npm run coverage:report
9073
```
9174

9275
Creates coverage report based on generated coverage files from unit and bdd tests. _It's a subtask and should not be run separately_.
9376

9477
```bash
95-
yarn dist
78+
npm run dist
9679
```
9780

9881
Builds dist files - similar to `build` but skips `test` folder and additionaly generates source maps and TS typings files.
9982

10083
```bash
101-
yarn lint
84+
npm run lint
10285
```
10386

10487
Lints `src` and `test` dirs. Used as a `pre-commit` hook.
10588

10689
```bash
107-
yarn prepare
90+
npm run prepare
10891
```
10992

11093
Installs husky hooks. Necessary only for development. Needs to be run only once after repo checkout.
@@ -114,19 +97,19 @@ Installs husky hooks. Necessary only for development. Needs to be run only once
11497
Single test file can be run by passing its path to `test` command:
11598

11699
```bash
117-
yarn test build/test/ifca/common.spec.js
100+
npm run test -- build/test/ifca/common.spec.js
118101
```
119102

120103
While specific test cases can be run using `-m` (match) option:
121104

122105
```bash
123-
yarn test -m "*default*"
106+
npm run test -- -m "*default*"
124107
```
125108

126109
Both can be mixed to run specific tests from a given file or folder:
127110

128111
```bash
129-
yarn test build/test/ifca/common.spec.js -m "*default*"
112+
npm run test -- build/test/ifca/common.spec.js -m "*default*"
130113
```
131114

132115
## Publish
@@ -138,4 +121,5 @@ yarn test build/test/ifca/common.spec.js -m "*default*"
138121
Project structure:
139122

140123
* `src/` - directory with all the source code
141-
* `test/` - directory with test
124+
* `test/` - directory with unit tests
125+
* `bdd/` - directory with bdd tests

0 commit comments

Comments
 (0)