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

Update to Yarn Berry #6271

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
929f4f4
Update to Yarn Berry
queengooborg May 14, 2022
ebeab49
Update workflows to install Yarn Berry (and fix arguments)
queengooborg May 14, 2022
9ad79b0
Don't install corepack (already installed)
queengooborg May 14, 2022
b602b63
Install Jest
queengooborg May 14, 2022
f27dda4
Fix Markdown Docs workflow
queengooborg May 14, 2022
39cac7b
Merge remote-tracking branch 'upstream/main' into yarn-berry
caugner May 25, 2022
9d0e8e5
build(deps): recreate yarn.lock
caugner May 25, 2022
17c6655
fix(gitignore): ignore .yarn recursively
caugner May 25, 2022
fc2f283
build(deps): recreate yarn.lock recursively
caugner May 25, 2022
1fb5c7e
fixup! build(deps): recreate yarn.lock recursively
caugner May 25, 2022
7cbecc9
fixup! fixup! build(deps): recreate yarn.lock recursively
caugner May 25, 2022
745f2de
buid(workflow): use yarn classic in mdn/content
caugner May 25, 2022
d22afa9
fixup! buid(workflow): use yarn classic in mdn/content
caugner May 25, 2022
e2d9496
build(workflow): separate tarball build/install
caugner May 25, 2022
2e74c56
fixup! build(workflow): separate tarball build/install
caugner May 25, 2022
f068061
build(package.json): add workspaces
caugner May 25, 2022
2d2e84f
fixup! build(package.json): add workspaces
caugner May 25, 2022
b0b54ae
fix(workspaces): add libs/{constants,fundamental-redirects,get-locale}
caugner May 25, 2022
e919149
Revert "build(package.json): add workspaces"
caugner May 25, 2022
a9f01a4
fixup! Revert "build(package.json): add workspaces"
caugner May 25, 2022
a56b90e
fixup! fixup! Revert "build(package.json): add workspaces"
caugner May 25, 2022
8e28bd5
fixup! fixup! fixup! Revert "build(package.json): add workspaces"
caugner May 25, 2022
6fa2ef7
fix(workflows/aws-lambda): install without `--immutable`
caugner May 25, 2022
a90c0c5
fix(yarn): replace `file:` by `portal:`
caugner May 25, 2022
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
9 changes: 6 additions & 3 deletions .github/workflows/aws-lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
with:
node-version: "16"

- name: Install Yarn Berry
run: corepack enable

# Note!
# We need to install all node modules in each of the 3 directories.
# 1. content-origin-request
Expand All @@ -46,7 +49,7 @@ jobs:
- name: Install all yarn packages
if: steps.cached-node_modules-content-origin-request.outputs.cache-hit != 'true'
working-directory: deployer/aws-lambda/content-origin-request
run: yarn --frozen-lockfile
run: yarn #--immutable

- name: Cache node_modules content-origin-response
uses: actions/cache@v3
Expand All @@ -58,7 +61,7 @@ jobs:
- name: Install all yarn packages
if: steps.cached-node_modules-content-origin-response.outputs.cache-hit != 'true'
working-directory: deployer/aws-lambda/content-origin-response
run: yarn --frozen-lockfile
run: yarn #--immutable

- name: Cache node_modules
uses: actions/cache@v3
Expand All @@ -70,7 +73,7 @@ jobs:
- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
working-directory: deployer/aws-lambda/tests
run: yarn --frozen-lockfile
run: yarn #--immutable

- name: Run test server
working-directory: deployer/aws-lambda/tests
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ jobs:
with:
node-version: "16"

- name: Install Yarn Berry
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
Expand All @@ -78,7 +81,7 @@ jobs:

- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
run: yarn --immutable

- name: Install Python
uses: actions/[email protected]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/developing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
node-version: "16"
cache: "yarn"

- name: Install Yarn Berry
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
Expand All @@ -31,7 +34,7 @@ jobs:

- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
run: yarn --immutable

- name: Setup kernel for react native, increase watchers
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
with:
node-version: "16"

- name: Install Yarn Berry
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
Expand All @@ -35,7 +38,7 @@ jobs:

- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
run: yarn --immutable

- name: Build the build
env:
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/npm-published-simulation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
node-version: "16"
cache: "yarn"

- name: Install Yarn Berry
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
Expand All @@ -36,7 +39,7 @@ jobs:

- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
run: yarn --immutable

- name: Setup kernel for react native, increase watchers
run: |
Expand All @@ -57,16 +60,24 @@ jobs:
run: |
yarn build:prepare

- name: Build and install tarball
- name: Build tarball
run: |
echo mdn/content/ >> .npmignore
npm pack
TARBALL=`ls mdn-yari-*.tgz`
echo $TARBALL
ls -lh $TARBALL
mv $TARBALL mdn/content/
cd mdn/content
yarn add file:$TARBALL
mv $TARBALL mdn/content/mdn-yari.tgz

- name: Install Yarn Classic
run: |
yarn set version classic
yarn --version

- name: Install tarball
working-directory: mdn/content
run: |
yarn add file:mdn-yari.tgz

- name: Start Yari from mock content repo
working-directory: mdn/content
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
with:
node-version: "16"

- name: Install Yarn Berry
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
Expand All @@ -40,7 +43,7 @@ jobs:
- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: |
yarn --frozen-lockfile
yarn --immutable

- name: Build select important pages
env:
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/pr-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,22 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"

- name: Install Yarn Berry
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
with:
path: |
node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('.github/workflows/performance.yml') }}

- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: |
yarn --immutable

- name: Lint markdown files
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pr-kumascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
with:
node-version: "16"

- name: Install Yarn Berry
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
Expand All @@ -39,7 +42,7 @@ jobs:
- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: |
yarn --frozen-lockfile
yarn --immutable

- name: Unit testing kumascript
env:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/prod-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ jobs:
with:
node-version: "16"

- name: Install Yarn Berry
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
Expand All @@ -101,7 +104,7 @@ jobs:

- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
run: yarn --immutable

- name: Install Python
uses: actions/[email protected]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/stage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ jobs:
with:
node-version: "16"

- name: Install Yarn Berry
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
Expand All @@ -101,7 +104,7 @@ jobs:

- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
run: yarn --immutable

- name: Install Python
uses: actions/[email protected]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
node-version: "16"
cache: "yarn"

- name: Install Yarn Berry
run: corepack enable

- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
Expand All @@ -33,7 +36,7 @@ jobs:
- name: Install all yarn packages
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: |
yarn --frozen-lockfile
yarn --immutable

- name: Lint prettier
run: yarn prettier-check
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
node_modules/
/.pnp
.pnp.js
.yarn
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# testing
/coverage
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn install --ignore-scripts && yarn lint-staged
yarn install --immutable --immutable-cache && yarn lint-staged
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ jest.config.js
*.test.js
.storybook/
.nvmrc
.yarn/*
.pnp.*
786 changes: 786 additions & 0 deletions .yarn/releases/yarn-3.2.1.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarnPath: .yarn/releases/yarn-3.2.1.cjs
nodeLinker: node-modules
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Before you can start working with Yari, you need to:
<!-- markdownlint-disable list-marker-space -->

1. Install [git](https://git-scm.com/), [Node.js](https://nodejs.org) (>=
16.0.0), and [Yarn 1](https://classic.yarnpkg.com/en/docs/install).
16.0.0), and [Yarn 2+](https://yarnpkg.com/getting-started/install).

1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo)
the MDN [content](https://github.com/mdn/content) and
Expand Down
Loading