Skip to content

Commit

Permalink
Configure NPM Workspaces (#2088)
Browse files Browse the repository at this point in the history
* Fix taquito-test-dapp build when using local packages

* Add build script for test-dapp to root package.json

* Commit apps/taquito-test-dapp/package-lock.json

* Exclude @taquito/website and taquito-test-dapp-vite from nx build command

* Fix deploy_website pipeline

* Re-link local dependencies when deploying on Netlify

* Only run Taquito packages unit tests

* Remove empty NPM test script from pack-test-tool

* Rebuild dependencies when on Netlify

* Use workspaces

* Remove prebuild-test-dapp script

* Fix taquito-test-dapp build

* Install lerna in apps/taquito-test-dapp

* Trigger Netlify cache deploy

* Remove typeRoots propriety from every tsconfig.json

* Fix dependencies for website

* Delete unused package-lock.json

* Correctly link local dependencies

* Fix taquito-http-utils

* Replace docusaurus2-dotenv with docusaurus-plugin-dotenv

* Use NPM workspaces to run commands

* Fix Jest testResultsProcessor path

* Revert webpack upgrade in @taquito/taquito

* Update package-lock.json

* Update package-lock.json

* Upgrade @taquito/taquito to webpack5

* Update codecov Github Action

* Trigger build

* Remove deprecated Jakartanet testnet from Taquito Test Dapp

* Update root Readme.md file with the latest changes for building Taquito

Co-authored-by: roxaneletourneau <roxane@ecadlabs.com>
  • Loading branch information
danielelisi and roxaneletourneau authored Nov 17, 2022
1 parent bc1ead4 commit 501b4b2
Show file tree
Hide file tree
Showing 76 changed files with 99,433 additions and 31,216 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.13.1
node-version: 16
- run: npm ci
- run: npm run build
- run: npm run build
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
fail-fast: false
matrix:
node:
- '16.13.1'
- '17.3.x'
- '16'
- '18'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm ci
Expand All @@ -30,7 +30,7 @@ jobs:
- run: npm run build-docs
- run: npm run test -- --runInBand
- name: Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3.1.1
with:
file: .coverage/*.json
env:
Expand All @@ -45,37 +45,37 @@ jobs:
protocol:
- kathmandunet
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.13.1
node-version: 16
- run: npm ci
- run: npm run build
- name: Tailscale
uses: tailscale/github-action@v1
with:
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
version: 1.22.2
- run: cd integration-tests && npm run test:${{ matrix.protocol }} -- --maxWorkers=8
version: 1.32.2
- run: npm -w integration-tests run test:${{ matrix.protocol }} -- --maxWorkers=8

integration-tests-flextesa:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.13.1
node-version: 16
- run: docker run --rm --name my-sandbox --detach -p 20000:20000 -e block_time=1 oxheadalpha/flextesa:latest kathmandubox start
- run: npm ci
- run: npm run lerna -- bootstrap
- run: npm run build
- run: cd integration-tests && npm run test:originate-known-contracts && npm run test:kathmandunet-secret-key -- --testPathIgnorePatterns ledger-signer-failing-tests.spec.ts ledger-signer.spec.ts contract-estimation-tests.spec.ts rpc-get-protocol-constants.spec.ts
- run: npm -w integration-tests run test:originate-known-contracts && npm -w integration-tests run test:kathmandunet-secret-key -- --testPathIgnorePatterns ledger-signer-failing-tests.spec.ts ledger-signer.spec.ts contract-estimation-tests.spec.ts rpc-get-protocol-constants.spec.ts
env:
RUN_KATHMANDUNET_WITH_SECRET_KEY: true
SECRET_KEY: edsk3RFfvaFaxbHx8BMtEW1rKQcPtDML3LXjNqMNLCzC3wLC1bWbAt
TEZOS_RPC_KATHMANDUNET: http://0.0.0.0:20000
POLLING_INTERVAL_MILLISECONDS: 100
RPC_CACHE_MILLISECONDS: 0
TEZOS_BAKER: tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb
- run: docker kill my-sandbox
- run: docker kill my-sandbox
2 changes: 1 addition & 1 deletion .github/workflows/mondaynet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: tailscale/github-action@v1
with:
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
version: 1.30.0
version: 1.32.2

- name: Configure SSH
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ website/*.bak
integration-tests/jest-stare
**/saplingOutputParams*
**/saplingSpendParams*
apps/**/node_modules
apps/**/node_modules
35 changes: 15 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ Taquito currently supports the following versions of Node.js®:

| Version | Supported? |
| ---------------- | ---------- |
| v12 ||
| v14 ||
| v12 LTS ||
| v14 LTS ||
| v16.13.1 ||
| v16.13.2 ||
| v16 LTS/Gallium ||
| 17.3.x ||
| v17.5.x ||
| v18 LTS/Hydrogen ||

While other versions often work, the above are what we officially support. YMMV!

Expand Down Expand Up @@ -118,13 +120,7 @@ You would like to make a contribution to Taquito? Wonderful! Please read on.

Install/use a suitable version of **Node.js** (_as listed above_), for example:

`nvm use v17.3.0`

* Install `lerna` globally:

`npm install -g lerna`

*Taquito uses `lerna` internally to simplify the build configuration.*
nvm use lts/gallium

* Install `libudev-dev`, if developing on GNU/Linux:

Expand All @@ -134,13 +130,15 @@ Install/use a suitable version of **Node.js** (_as listed above_), for example:

### Setup and build Taquito

* Run `npm clean-install`
* Run `npm run rebuild`

That command invokes serially the following commands:

* Run `npm run clean`
* Run `npm clean-install` *# n.b. no `run`: `clean-install` is an npm __built-in__*
* Run `npm run build`
* `npm run clean`
* `npm clean-install` *# n.b. no `run`: `clean-install` is an npm __built-in__*
* `npm run bootstrap`
* `npm run build`

The `clean-install` (or just `ci`) command ensures a clean install of all depenencies, and respects `package-lock.json`, to ensure a deterministic and repeatable build (it is also some 2x to 10x faster than `npm install`). It will not adjust `package.json`: hooray!

Expand All @@ -156,9 +154,9 @@ See the top-level `package.json` "scripts" section. Some common targets are:

### Running Integration Tests

The Taquito integration tests are located in the `/integration-tests/` directory.
The Taquito integration tests are located in the `integration-tests/` directory.

To run the integration tests, `cd` into `/integration-tests/` and run `npm run test` (ensure you have completed the build steps as described earlier in this README file.). The integration test suite runs all tests against the current tezos protocol testnet, and typically also against the previous and next protocol testnets. See the `scripts` property in the `integration-tests/package.json` file for specific test targets.
To run the integration tests, `cd` into `integration-tests/` and run `npm run test` (ensure you have completed the build steps as described earlier in this README file.). The integration test suite runs all tests against the current tezos protocol testnet, and typically also against the previous and next protocol testnets. See the `scripts` property in the `integration-tests/package.json` file for specific test targets.

There are many integration tests, and as they interact with real testnets, they can be slow. Furthermore, occasionally tests fail due to extrinsic reasons related to public testnets.

Expand All @@ -176,13 +174,10 @@ Please use `npm run commit` for your last commit before you push, as this will a

The Tezos Taquito [website][4] is built using [Docusaurus][5].

To run the Taquito website in development mode locally, run the following commands:
To run the Taquito website in development mode locally, run the following commands from the repo's root folder:

```
cd website
npm install
npm start
```
* Run `npm clean-install`
* Run `npm -w @taquito/website start`

## Contributions / Reporting Issues

Expand Down
2 changes: 1 addition & 1 deletion apps/taquito-test-dapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A minimal end-to-end testing setup for developing Tezos DApps with Taquito and B
1. Clone the Taquito repository: `git clone git@github.com:ecadlabs/taquito.git`
2. Change your current working directory to the newly cloned repository directory, then change to `apps/taquito-test-dapp`.
3. Install all dependencies:
`npm install`
`npm clean-install`
4. Start development server:
`npm run dev`
5. Open http://localhost:3030 in your browser to see a sample application.
Expand Down
Loading

0 comments on commit 501b4b2

Please sign in to comment.