Skip to content

Commit

Permalink
Upgrades to Yarn 4.1.1 (#1190)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleshike authored Apr 22, 2024
1 parent 22296e2 commit 2190725
Show file tree
Hide file tree
Showing 12 changed files with 17,997 additions and 13,137 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# .github/workflows/chromatic.yml

# Workflow name
name: 'Chromatic build on main'
name: "Chromatic build on main"

# Event for the workflow
on:
Expand All @@ -14,16 +14,23 @@ jobs:
chromatic-deployment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- uses: actions/setup-node@v3
- name: Checkout branch
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
- run: |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
- run: yarn
node-version-file: ".node-version"

- name: Setup Yarn
uses: volta-cli/action@v4

- name: Setup env
run: echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env

- name: Install dependencies
run: yarn install

- name: Publish to Chromatic
uses: chromaui/action@v1
with:
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/create-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@ jobs:
name: Create new release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- name: Checkout branch
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
- run: |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
- run: yarn install
node-version-file: ".node-version"

- name: Setup Yarn
uses: volta-cli/action@v4

- name: Setup env
run: echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env

- name: Install dependencies
run: yarn install

- name: Initialize mandatory git config
uses: fregante/setup-git-user@v1
Expand Down
94 changes: 48 additions & 46 deletions .github/workflows/gh-pages-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,48 @@
name: Deploy to github pages
on:
workflow_dispatch:
push:
branches:
- main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
gh-pages-deploy:
name: Deploying to gh-pages
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: 'yarn'

- name: Configure npm
run: npm config set "@fortawesome:registry" https://npm.fontawesome.com/ &&
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build-storybook

- name: Upload
uses: actions/upload-pages-artifact@v3
with:
path: 'storybook-static'

- name: Deploy
uses: actions/deploy-pages@v4
with:
token: ${{ github.token }}
name: Deploy to github pages
on:
workflow_dispatch:
push:
branches:
- main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
gh-pages-deploy:
name: Deploying to gh-pages
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: ".node-version"
cache: "yarn"

- name: Setup Yarn
uses: volta-cli/action@v4

- name: Setup env
run: echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build-storybook

- name: Upload
uses: actions/upload-pages-artifact@v3
with:
path: "storybook-static"

- name: Deploy
uses: actions/deploy-pages@v4
with:
token: ${{ github.token }}
26 changes: 18 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ jobs:
js-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- name: Checkout branch
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
- run: |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
- run: yarn
- run: yarn lint
node-version-file: ".node-version"

- name: Setup Yarn
uses: volta-cli/action@v4

- name: Setup env
run: echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env

- name: Install dependencies
run: yarn install

- name: Lint
run: yarn lint
18 changes: 13 additions & 5 deletions .github/workflows/prepare-hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,29 @@ on:
workflow_dispatch:
inputs:
version:
description: 'The version you want to release.'
description: "The version you want to release."
required: true

jobs:
prepare-hotfix:
name: Prepare hotfix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout branch
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
node-version-file: ".node-version"

- name: Setup Yarn
uses: volta-cli/action@v4

- name: Setup env
run: echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env

- name: Create hotfix branch
run: git checkout -b hotfix/${{ github.event.inputs.version }}
Expand Down Expand Up @@ -56,4 +65,3 @@ jobs:
head: hotfix/${{ github.event.inputs.version }}
base: develop
title: Merge hotfix/${{ github.event.inputs.version }} into develop branch

18 changes: 13 additions & 5 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,29 @@ on:
workflow_dispatch:
inputs:
version:
description: 'The version you want to release.'
description: "The version you want to release."
required: true

jobs:
prepare-release:
name: Prepare release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout branch
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
node-version-file: ".node-version"

- name: Setup Yarn
uses: volta-cli/action@v4

- name: Setup env
run: echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env

- name: Create release branch
run: git checkout -b release/${{ github.event.inputs.version }}
Expand Down Expand Up @@ -56,4 +65,3 @@ jobs:
head: release/${{ github.event.inputs.version }}
base: develop
title: Merge release/${{ github.event.inputs.version }} into develop branch

26 changes: 18 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ jobs:
js-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- name: Checkout branch
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
- run: |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
- run: yarn
- run: yarn test
node-version-file: ".node-version"

- name: Setup Yarn
uses: volta-cli/action@v4

- name: Setup env
run: echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env

- name: Install dependencies
run: yarn install

- name: Test
run: yarn test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ lib
.env.test.local
.env.production.local
.npmrc
.yarn
.env

# Ignore Jetbrains IDE settings
Expand Down
10 changes: 10 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
nodeLinker: node-modules

injectEnvironmentFiles:
- .env

npmScopes:
fortawesome:
npmAlwaysAuth: true
npmRegistryServer: "https://npm.fontawesome.com/"
npmAuthToken: ${FONTAWESOME_NPM_AUTH_TOKEN}
8 changes: 8 additions & 0 deletions bin/migrate-yarn
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

volta install [email protected]
volta setup
touch .env

FONTAWESOME_NPM_AUTH_TOKEN=$(echo "$FONTAWESOME_NPM_AUTH_TOKEN" | sed -n 's/.*authToken=//p' .npmrc)
echo "FONTAWESOME_NPM_AUTH_TOKEN=${FONTAWESOME_NPM_AUTH_TOKEN}" >> .env
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"file-loader": "^6.2.0",
"jest": "^27.4.6",
"jest-css-modules-transform": "^4.3.0",
"node-sass": "^8.0.0",
"node-sass": "^9.0.0",
"nodemon": "^3.0.1",
"prop-types": "^15.6.1",
"react": "^18.2.0",
Expand All @@ -149,7 +149,7 @@
"react-popper": "^2.2.3",
"react-test-renderer": "^18.0.2",
"react-tracking": "^9.3",
"sass-loader": "^10.4.1",
"sass-loader": "^14.2.1",
"storybook": "^8.0.5",
"storybook-addon-designs": "6.3.1",
"style-loader": "^1.1.3",
Expand All @@ -170,8 +170,8 @@
"scss"
],
"engines": {
"node": ">= 20",
"yarn": "^ 1.22"
"node": "^ 20.12",
"yarn": "^ 4.1"
},
"main": "lib/index",
"types": "lib/index",
Expand All @@ -194,7 +194,7 @@
"homepage": "https://github.com/user-interviews/ui-design-system",
"_id": "@user-interviews/[email protected]",
"volta": {
"node": "18.18.2",
"yarn": "1.22.21"
"node": "20.12.1",
"yarn": "4.1.1"
}
}
Loading

0 comments on commit 2190725

Please sign in to comment.