Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: migrate to Yarn v1 from npm v7 #1141

Merged
merged 1 commit into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,18 @@ on:

jobs:
build:

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}

strategy:
fail-fast: true
fail-fast: false
max-parallel: 1024
matrix:
os: [ubuntu-20.04]
node-version: [v12.22.3, v14.15.1, v16.2.0]
experimental: [false]
# include:
#
# # FIXME macOS does not work due to lack of docker support in GHA.
# https://github.community/t/why-is-docker-not-installed-on-macos/17017
# - os: macos-11.0 # macOS Big Sur 11.0
# node-version: v12.22.3
# experimental: true
# - os: macos-10.15 # macOS Catalina 10.15
# node-version: v12.22.3
# experimental: true
#
# # FIXME
# https://github.com/hyperledger/cactus/issues/171
# - os: windows-2019 # Windows Server 2019
# node-version: v12.22.3
# experimental: true

steps:
# FIXME: These do not work on mac OS as of 2020-12-09
# https://github.community/t/why-is-docker-not-installed-on-macos/17017
# - name: Set up QEMU (ARM64 docker images once we are ready)
# uses: docker/setup-qemu-action@v1.0.1

# - name: Set up Docker Buildx (ARM64 docker images once we are ready)
# uses: docker/setup-buildx-action@v1.0.3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.1.2
with:
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,11 @@ build/
site/

.build-cache/*.tsbuildinfo

.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
2 changes: 2 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ The `npm run watch` script in action:
* WSL2 or any virtual machine running Ubuntu 20.04 LTS
* Git
* NodeJS 16, npm 7 (we recommend using the Node Version Manager (nvm) if available for your OS)
* Yarn
* `npm run install-yarn` (from within the project directory)
* Docker Engine
* Docker Compose

Expand Down
16 changes: 11 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [Running unit tests only](#running-unit-tests-only)
- [Running integration tests only](#running-integration-tests-only)
- [What is npx used for?](#what-is-npx-used-for)
- [What's the equivalent of npx for Yarn?](#whats-the-equivalent-of-npx-for-yarn)
- [Debugging a test case](#debugging-a-test-case)
- [All-In-One Docker Images for Ledger Connector Plugins](#all-in-one-docker-images-for-ledger-connector-plugins)
- [Test Automation of Ledger Plugins](#test-automation-of-ledger-plugins)
Expand Down Expand Up @@ -389,6 +390,10 @@ place every node module (project dependencies) on the OS path or to install them

Read more about npx here: https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner

#### What's the equivalent of npx for Yarn?

Yarn itself. E.g. `npx lerna clean` becomes `yarn lerna clean`.

#### Debugging a test case

Open the `.vscode/template.launch.json` file and either copy it with a name of
Expand Down Expand Up @@ -509,14 +514,15 @@ Example:

```sh
# Adds "got" as a dependency to the cactus common package
# (which resides under the path of ./packages/cactus-common)
npm install got --save-exact --workspace ./packages/cactus-common
# Note that you must specify the fully qualified package name as present in
# the package.json file
yarn workspace @hyperledger/cactus-common add got --save-exact
```

You need to know which package of the monorepo will be using the package and then
run the `npm install` command with an additional parameter specifying the directory
of that package. See [adding-dependencies-to-a-workspace](https://docs.npmjs.com/cli/v7/using-npm/workspaces#adding-dependencies-to-a-workspace) from the official npm documentation
for further details and examples.
run the `yarn workspace` command with an additional parameters specifying the package
name and the dependency name.
See [Yarn Workspaces Documentation](https://classic.yarnpkg.com/en/docs/cli/workspace/) for the official Yarn documentation for further details and examples.

After adding new dependencies, you might need to [Reload VSCode Window After Adding Dependencies](#reload-vscode-window-after-adding-dependencies)

Expand Down
Loading