Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
fix(free provider): remove yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
glethuillier committed Jun 8, 2023
1 parent 26c0ee6 commit b87638c
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/regression_tests_custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install Xpub Scan dependencies and build it
run: |
yarn && yarn build
npm i && npm run build
- name: ${{ matrix.product }} x ${{ matrix.currency }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression_tests_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install Xpub Scan dependencies and build it
run: |
yarn && yarn build
npm i && npm run build
- name: ${{ matrix.product }} x ${{ matrix.currency }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- uses: actions/checkout@v2

- name: Install dependencies
run: yarn
run: npm i

- name: Generate code coverage
run: yarn sonarqube
run: npm run sonarqube

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
- name: Check dependencies
run: |
npm i
yarn check --verify-tree
check-outdated --ignore-packages chalk,jest,bitcoinjs-lib
npm audit --audit-level=low --json
Expand All @@ -33,13 +32,13 @@ jobs:
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/npm-shrinkwrap.json') }}

- name: Install dependencies
run: yarn
run: npm i

- name: Prettify
run: yarn prettier
run: npm run prettier

- name: Run checks
run: yarn ci
run: npm run ci
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.env
node_modules
lib
yarn.lock
package-lock.json
coverage/
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ doc
node_modules
src
tsconfig.json
yarn.lock
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ XPUB_SCAN_CUSTOM_API_KEY_V2=<your key>
Your code has to be correctly formatted. To this effect, a set of rules are defined in `.prettierrc.json` and automatically enforced with this command:

```
$ yarn prettier
$ npm run prettier
```

## Add Unit Tests
Expand All @@ -77,7 +77,7 @@ The general idea is to progressively reach near 100% coverage.

Once your fix or feature has been implemented, you can locally ensure that the project will pass the tests in the CI.

(Note: you can run all tests at once: `$ yarn dev:test:all`).
(Note: you can run all tests at once: `$ npm run dev:test:all`).

## Up-to-date Requirements

Expand All @@ -86,7 +86,7 @@ For security reasons, the dependencies have to be up-to-date and strictly pinpoi
To this effect, a dedicated command verifies the dependencies:

```
$ yarn check:dep
$ npm run check:dep
```

If this command reveals that dependencies are outdated, update them in `package.json` **using strict versioning**:
Expand All @@ -102,7 +102,7 @@ Run `check:dep` again and, if the check passes, run the subsequent tests to ensu
To run the unit tests, do:

```
$ yarn ci
$ npm run ci
```

To generate the coverage (prerequisites: `jest` and `ts-node`, run:
Expand All @@ -120,7 +120,7 @@ Regression tests are essential to ensure that the core logic of Xpub Scan is not
To run the regression tests locally, use the following command:

```
$ yarn regression
$ npm run regression
```

(Important: the tests will fail if no CryptoAPIs API v2 key is provided).
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WORKDIR /app

COPY package.json npm-shrinkwrap.json ./

RUN npm i && npm ci
RUN npm i && npm run ci

COPY . .

Expand Down
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ Given an extended public key (xpub, Ltub, _etc._), get the balances of its deriv

## Install

With yarn:

```
$ yarn global add @ledgerhq/xpub-scan
```

With npm:

```
$ npm i -g @ledgerhq/xpub-scan
```
Expand Down Expand Up @@ -66,7 +58,7 @@ scanResult("your_xpub");
Install dependencies:

```
$ npm ci
$ npm run ci
```

Build the project
Expand All @@ -84,7 +76,7 @@ $ node ./lib/scan.js [options] <xpub>
_Alternatively, if you want to use the locally-built version of xpub-scan with just `xpub-scan` command, you can:_

```
$ yarn link
$ npm link
```

### Currencies
Expand Down Expand Up @@ -207,7 +199,7 @@ The derived addresses are displayed during the analysis. Perfect matches are dis
### Change Settings

1. Modify `./src/settings.ts`
2. rebuild the tool: `$ yarn build`
2. rebuild the tool: `$ npm run build`
3. Re-run it: `$ node ./lib/scan.js <xpub> …`

### Change External Provider
Expand All @@ -218,6 +210,6 @@ The derived addresses are displayed during the analysis. Perfect matches are dis

1. At the root of the project, rename `.env.template` to `.env`
2. In `.env`, set the `XPUB_SCAN_CUSTOM_API_KEY_V2` (corresponding to your Crypto APIs v2 API key—e.g.: `XPUB_SCAN_CUSTOM_API_KEY_V2=abcd6eacca264f7530eb2f7025a84f8`)
3. rebuild the tool: `$ yarn build`
3. rebuild the tool: `$ npm run build`
4. Re-run it: `$ node ./lib/scan.js <xpub> …`
5. Ensure that, when running the tool, it shows that the _custom_ provider is being used
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
"xpub-scan": "./lib/scan.js"
},
"scripts": {
"clean": "yarn cache clean --force && rm -rf lib/",
"clean": "npm cache clean --force && rm -rf lib/",
"build": "tsc && chmod +x ./lib/scan.js",
"test": "jest",
"sonarqube": "jest --collect-coverage --testResultsProcessor jest-sonar-reporter",
"lint": "eslint .",
"ts:check": "tsc --noEmit",
"prettier": "prettier --write .",
"ci": "yarn prettier && yarn ts:check && yarn test",
"check:dep": "npm i && yarn check --verify-tree && check-outdated --ignore-packages chalk,jest && npm audit --audit-level=low && npm shrinkwrap",
"regression": "yarn build && python3 .github/workflows/regression_tests/check.py",
"dev:test": "yarn clean && yarn check:dep && yarn prettier && yarn ci && yarn && tsc -p .",
"dev:test:all": "yarn clean && yarn check:dep && yarn prettier && yarn ci && yarn && tsc -p . && yarn regression"
"ci": "npm run prettier && npm run ts:check && npm test",
"check:dep": "npm i && check-outdated --ignore-packages chalk,jest && npm audit --audit-level=low && npm shrinkwrap",
"regression": "npm run build && python3 .github/workflows/regression_tests/check.py",
"dev:test": "npm run clean && npm check:dep && npm run prettier && npm run ci && npm i && tsc -p .",
"dev:test:all": "npm run clean && npm run check:dep && npm run prettier && npm run ci && npm i && tsc -p . && npm run regression"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit b87638c

Please sign in to comment.