Skip to content

Switch to Yarn v3 as the package manager default #26

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

Closed
Closed
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
40 changes: 21 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,40 @@ jobs:
uses: nrwl/nx-set-shas@v2
with:
main-branch-name: 'master'
- uses: actions/setup-node@v1
with:
- uses: actions/setup-node@v1
with:
node-version: '16'
- run: npm ci
- run: npx nx-cloud start-ci-run
- run: npm run build
- run: npx nx affected --target=lint --parallel --max-parallel=3
- run: npx nx affected --target=test --parallel --max-parallel=3
- run: npm run e2e
- run: npx nx-cloud stop-all-agents
- run: yarn run nx-cloud start-ci-run
- run: yarn run build
- run: yarn dlx nx affected --target=lint --parallel=3
- run: yarn dlx nx affected --target=test --parallel=3
- run: yarn run e2e
- run: yarn run nx-cloud stop-all-agents
pr:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
# see: https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/
# regarding `pull_request_target`
ref: ${{ github.event.pull_request_target.head.ref }}
fetch-depth: 0
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v2
with:
main-branch-name: 'master'
- uses: actions/setup-node@v1
with:
- uses: actions/setup-node@v1
with:
node-version: '16'
- run: npm ci
- run: npx nx-cloud start-ci-run
- run: npm run build
- run: npx nx affected --target=lint --parallel --max-parallel=3
- run: npx nx affected --target=test --parallel --max-parallel=3
- run: npm run e2e
- run: npx nx-cloud stop-all-agents
- run: yarn run nx-cloud start-ci-run
- run: yarn run build
- run: yarn dlx nx affected --target=lint --parallel=3
- run: yarn dlx nx affected --target=test --parallel=3
- run: yarn run e2e
- run: yarn run nx-cloud stop-all-agents
agents:
runs-on: ubuntu-latest
name: Agent 1
Expand All @@ -64,8 +66,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
with:
node-version: '16'
- run: npm ci
- name: Start Nx Agent ${{ matrix.agent }}
run: npx nx-cloud start-agent
run: yarn run nx-cloud start-agent
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ testem.log
# System Files
.DS_Store
Thumbs.db

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
yarn dlx commitlint --edit $1
2 changes: 1 addition & 1 deletion .husky/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
git fetch origin --prune && git tag -l | xargs git tag -d && git fetch -t

# its always good to make sure your package.json is sorted :)
npx sort-package-json
yarn dlx sort-package-json

# after merging code, new package.json dependencies might be introduced
npm install
13 changes: 13 additions & 0 deletions .yarn/patches/@nrwl-nx-plugin-npm-13.3.0-beta.13-8b8229d6d1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/utils/testing-utils/nx-project.js b/src/utils/testing-utils/nx-project.js
index 7284da90de99a43453af342e2686273b66132738..59f3657afa59d06fdf0b9129f1b5a5e5fff5b206 100644
--- a/src/utils/testing-utils/nx-project.js
+++ b/src/utils/testing-utils/nx-project.js
@@ -10,7 +10,7 @@ const paths_1 = require("./paths");
const utils_1 = require("./utils");
function runNxNewCommand(args, silent) {
const localTmpDir = (0, path_1.dirname)((0, paths_1.tmpProjPath)());
- return (0, child_process_1.execSync)(`node ${require.resolve('@nrwl/tao')} new proj --nx-workspace-root=${localTmpDir} --no-interactive --skip-install --collection=@nrwl/workspace --npmScope=proj --preset=empty ${args || ''}`, Object.assign({ cwd: localTmpDir }, (silent && false ? { stdio: ['ignore', 'ignore', 'ignore'] } : {})));
+ return (0, child_process_1.execSync)(`node ${require.resolve('@nrwl/tao')} new proj --nx-workspace-root=${localTmpDir} --packageManager=yarn --no-interactive --skip-install --collection=@nrwl/workspace --npmScope=proj --preset=empty ${args || ''}`, Object.assign({ cwd: localTmpDir }, (silent && false ? { stdio: ['ignore', 'ignore', 'ignore'] } : {})));
}
function patchPackageJsonForPlugin(npmPackageName, distPath) {
const path = (0, paths_1.tmpProjPath)('package.json');
13 changes: 13 additions & 0 deletions .yarn/patches/@nrwl-nx-plugin-npm-13.3.0-beta.3-f28720d9c3
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/utils/testing-utils/nx-project.js b/src/utils/testing-utils/nx-project.js
index 7284da90de99a43453af342e2686273b66132738..e2974e7158ed8ab5359312dd252af004fff25cf6 100644
--- a/src/utils/testing-utils/nx-project.js
+++ b/src/utils/testing-utils/nx-project.js
@@ -10,7 +10,7 @@ const paths_1 = require("./paths");
const utils_1 = require("./utils");
function runNxNewCommand(args, silent) {
const localTmpDir = (0, path_1.dirname)((0, paths_1.tmpProjPath)());
- return (0, child_process_1.execSync)(`node ${require.resolve('@nrwl/tao')} new proj --nx-workspace-root=${localTmpDir} --no-interactive --skip-install --collection=@nrwl/workspace --npmScope=proj --preset=empty ${args || ''}`, Object.assign({ cwd: localTmpDir }, (silent && false ? { stdio: ['ignore', 'ignore', 'ignore'] } : {})));
+ return (0, child_process_1.execSync)(`node ${require.resolve('@nrwl/tao')} new proj --nx-workspace-root=${localTmpDir} --no-interactive --skip-install --collection=@nrwl/workspace --npmScope=proj --packageManager=yarn --preset=empty ${args || ''}`, Object.assign({ cwd: localTmpDir }, (silent && false ? { stdio: ['ignore', 'ignore', 'ignore'] } : {})));
}
function patchPackageJsonForPlugin(npmPackageName, distPath) {
const path = (0, paths_1.tmpProjPath)('package.json');
13 changes: 13 additions & 0 deletions .yarn/patches/@nrwl-tao-npm-13.3.0-beta.13-ea6b8d3d23
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/shared/package-manager.js b/src/shared/package-manager.js
index 259ff28b90bea84abd71e53d410798d9e71ba1db..f7f99cb848d81cc5f3cc19ae748501247deb67df 100644
--- a/src/shared/package-manager.js
+++ b/src/shared/package-manager.js
@@ -29,7 +29,7 @@ exports.detectPackageManager = detectPackageManager;
function getPackageManagerCommand(packageManager = detectPackageManager()) {
const commands = {
yarn: () => ({
- install: 'yarn',
+ install: 'yarn dlx touch yarn.lock && yarn',
add: 'yarn add',
addDev: 'yarn add -D',
rm: 'yarn remove',
13 changes: 13 additions & 0 deletions .yarn/patches/@nrwl-tao-npm-13.3.0-beta.3-16932da4db
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/shared/package-manager.js b/src/shared/package-manager.js
index 259ff28b90bea84abd71e53d410798d9e71ba1db..bc7136f9ab264df9daa6de110cfb90a4f9c2d5f1 100644
--- a/src/shared/package-manager.js
+++ b/src/shared/package-manager.js
@@ -29,7 +29,7 @@ exports.detectPackageManager = detectPackageManager;
function getPackageManagerCommand(packageManager = detectPackageManager()) {
const commands = {
yarn: () => ({
- install: 'yarn',
+ install: 'yarn dlx touch yarn.lock && yarn',
add: 'yarn add',
addDev: 'yarn add -D',
rm: 'yarn remove',
546 changes: 546 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

766 changes: 766 additions & 0 deletions .yarn/releases/yarn-3.2.0-rc.6.cjs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: '@yarnpkg/plugin-interactive-tools'

yarnPath: .yarn/releases/yarn-3.2.0-rc.6.cjs
Loading