Skip to content

Commit

Permalink
Update Yarn to v4
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <sora@morimoto.io>
  • Loading branch information
smorimoto committed Oct 31, 2023
1 parent 7a1cf78 commit d9448bf
Show file tree
Hide file tree
Showing 15 changed files with 22,852 additions and 16,220 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@ jobs:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: read node version from the .nvmrc file
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
shell: bash
id: nvmrc
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{steps.nvmrc.outputs.NODE_VERSION}}
node-version-file: .nvmrc
# this line is required for the setup-node action to be able to run the npm publish below.
registry-url: 'https://registry.npmjs.org'
- name: Corepack
run: corepack enable
- name: Install
run: yarn install --frozen-lockfile
run: yarn install --immutable
- name: Clean
run: yarn clean
- name: Test
Expand All @@ -40,14 +38,14 @@ jobs:
- name: Create Release Notes
run: yarn create-release-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
- name: 'Get message'
id: 'deploy_message'
run: |
echo "::set-output name=commit_msg::$(git log -1 --format=%B)"
echo "::set-output name=commit_sha::$(git log -1 --format=%H)"
- name: Slack Notify
uses: rtCamp/action-slack-notify@v2.2.0
uses: rtCamp/action-slack-notify@v2.2.1
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: ${{ steps.deploy_message.outputs.commit_msg }}
Expand Down
44 changes: 18 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,17 @@ jobs:
timeout-minutes: 15

steps:
- uses: actions/checkout@v3
- name: read node version from the .nvmrc file
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
shell: bash
id: nvmrc
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{steps.nvmrc.outputs.NODE_VERSION}}
node-version-file: .nvmrc
# this line is required for the setup-node action to be able to run the npm publish below.
registry-url: 'https://registry.npmjs.org'
cache: yarn
- run: yarn install --frozen-lockfile
- run: corepack enable
- run: yarn install --immutable
- run: yarn clean
- run: yarn build:packages
- run: npm run publish-release -- canary
- run: yarn publish-release -- canary
if: ${{ github.ref == 'refs/heads/main' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand All @@ -36,35 +32,31 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: read node version from the .nvmrc file
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
shell: bash
id: nvmrc
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{steps.nvmrc.outputs.NODE_VERSION}}
cache: yarn
- run: yarn install --frozen-lockfile
node-version-file: .nvmrc
- run: corepack enable
- run: yarn install --immutable
- run: yarn lint

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
cache: yarn
node-version-file: .nvmrc
- run: corepack enable
# esbuild requires --ignore-scripts to NOT be added here.
- run: yarn install --frozen-lockfile
- run: yarn install --immutable
- run: yarn clean
- name: Install playwright browsers
run: npx playwright install --with-deps
run: yarn dlx playwright install --with-deps
# run yarn and pass through `-- --all` to turborepo
- run: yarn test -- -- --all
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2.1.0
uses: codecov/codecov-action@v3
with:
verbose: true
2 changes: 1 addition & 1 deletion .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Add issues to project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.3.0
- uses: actions/add-to-project@v0.5.0
with:
project-url: https://github.com/orgs/muxinc/projects/8/views/1
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@
"i18n": "turbo run i18n",
"prepare": "husky install",
"deploy": "lerna publish from-package --no-private --no-verify-access --conventional-commits --conventional-prerelease=@mux/mux-active-viewer-count",
"deploy:canary": "lerna run deploy:canary --npm-client=npm --scope @mux/*",
"deploy:canary": "lerna run deploy:canary --npm-client=npm --scope '@mux/*'",
"version:update": "lerna version --exact --no-private --conventional-commits --conventional-prerelease=@mux/mux-active-viewer-count",
"create-release-notes": "lerna run create-release-notes --scope @mux/*",
"publish-release": "lerna run publish-release --scope @mux/* --"
}
"create-release-notes": "lerna run create-release-notes --scope '@mux/*'",
"publish-release": "lerna run publish-release --scope '@mux/*' --"
},
"packageManager": "yarn@4.0.1+sha256.5a9d054e67fbbae8774cd3667736fd74407ffbbb336898523ca1fe87b3fc4ee3"
}
4 changes: 2 additions & 2 deletions packages/mux-active-viewer-count/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
"dev:esm-module": "yarn build:esm-module --watch=forever",
"dev:types": "yarn build:types -w",
"dev": "npm-run-all --parallel dev:types dev:cjs dev:esm dev:esm-module dev:iife",
"build:esm": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/esm.json --format=esm --outdir=dist --out-extension:.js=.mjs --external:@mux/*",
"build:esm": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/esm.json --format=esm --outdir=dist --out-extension:.js=.mjs --external:'@mux/*'",
"build:esm-module": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/module.json --format=esm --outfile=./dist/mux-active-viewer-counts.mjs",
"build:cjs": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --outdir=dist --out-extension:.js=.cjs.js --external:@mux/*",
"build:cjs": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --outdir=dist --out-extension:.js=.cjs.js --external:'@mux/*'",
"build:iife": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/iife.json --format=iife --outfile=./dist/mux-active-viewer-counts.js",
"copypolyfills": "shx mkdir -p src/polyfills && shx cp ../../shared/polyfills/index.ts ./src/polyfills/index.ts",
"build:types": "tsc --declaration --emitDeclarationOnly --outDir './dist/types'",
Expand Down
4 changes: 2 additions & 2 deletions packages/mux-audio-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"dev:esm": "yarn build:esm --watch=forever",
"dev:types": "yarn build:types -w",
"dev": "npm-run-all --parallel dev:types dev:cjs dev:esm",
"build:cjs": "esbuild src/index.tsx --target=es2019 --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --outdir=dist --out-extension:.js=.cjs.js --external:react --external:prop-types --external:@mux/* --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm": "esbuild src/index.tsx --target=es2019 --bundle --sourcemap --metafile=./dist/esm.json --format=esm --outdir=dist --out-extension:.js=.mjs --external:react --external:prop-types --external:@mux/* --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:cjs": "esbuild src/index.tsx --target=es2019 --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --outdir=dist --out-extension:.js=.cjs.js --external:react --external:prop-types --external:'@mux/*' --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm": "esbuild src/index.tsx --target=es2019 --bundle --sourcemap --metafile=./dist/esm.json --format=esm --outdir=dist --out-extension:.js=.mjs --external:react --external:prop-types --external:'@mux/*' --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:types": "tsc",
"postbuild:types": "downlevel-dts ./dist/types ./dist/types-ts3.4",
"build": "npm-run-all --parallel 'build:cjs --minify' 'build:esm --minify'",
Expand Down
4 changes: 2 additions & 2 deletions packages/mux-audio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
"dev:esm-module": "yarn build:esm-module --watch=forever",
"dev:types": "yarn build:types -w",
"dev": "npm-run-all --parallel dev:types dev:cjs dev:esm dev:esm-module dev:iife",
"build:esm": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/esm.json --format=esm --outdir=dist --out-extension:.js=.mjs --external:@mux/* --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/esm.json --format=esm --outdir=dist --out-extension:.js=.mjs --external:'@mux/*' --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm-module": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/module.json --format=esm --outfile=./dist/mux-audio.mjs --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:cjs": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --outdir=dist --out-extension:.js=.cjs.js --external:@mux/* --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:cjs": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --outdir=dist --out-extension:.js=.cjs.js --external:'@mux/*' --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:iife": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/iife.json --format=iife --outfile=./dist/mux-audio.js --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"copypolyfills": "shx mkdir -p src/polyfills && shx cp ../../shared/polyfills/index.ts ./src/polyfills/index.ts",
"build:types": "tsc",
Expand Down
6 changes: 3 additions & 3 deletions packages/mux-player-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@
"dev:esm:lazy": "yarn build:esm:lazy --watch=forever",
"dev:types": "yarn build:types -w",
"dev": "npm-run-all --parallel dev:types dev:cjs dev:esm dev:esm:lazy",
"build:cjs": "esbuild src/index.tsx src/themes/*.ts --target=es2019 --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --loader:.css=text --outdir=dist --out-extension:.js=.cjs.js --external:react --external:@mux/* --external:prop-types --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm": "esbuild src/index.tsx src/themes/*.ts --target=es2019 --bundle --sourcemap --metafile=./dist/esm.json --format=esm --loader:.css=text --outdir=dist --out-extension:.js=.mjs --external:react --external:@mux/* --external:prop-types --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:cjs": "esbuild src/index.tsx src/themes/*.ts --target=es2019 --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --loader:.css=text --outdir=dist --out-extension:.js=.cjs.js --external:react --external:'@mux/*' --external:prop-types --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm": "esbuild src/index.tsx src/themes/*.ts --target=es2019 --bundle --sourcemap --metafile=./dist/esm.json --format=esm --loader:.css=text --outdir=dist --out-extension:.js=.mjs --external:react --external:'@mux/*' --external:prop-types --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:cjs:lazy": "echo 'esbuild cjs does not support code-splitting. See https://esbuild.github.io/api/#splitting for details'",
"build:esm:lazy": "esbuild src/lazy.tsx --splitting --target=es2019 --bundle --sourcemap --metafile=./dist/esm.lazy.json --format=esm --loader:.css=text --outdir=dist --out-extension:.js=.mjs --external:react --external:@mux/* --external:prop-types --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm:lazy": "esbuild src/lazy.tsx --splitting --target=es2019 --bundle --sourcemap --metafile=./dist/esm.lazy.json --format=esm --loader:.css=text --outdir=dist --out-extension:.js=.mjs --external:react --external:'@mux/*' --external:prop-types --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:types": "tsc",
"postbuild:types": "downlevel-dts ./dist/types ./dist/types-ts3.4",
"build": "npm-run-all --parallel 'build:cjs --minify' 'build:esm --minify' 'build:esm:lazy --minify'",
Expand Down
4 changes: 2 additions & 2 deletions packages/mux-video-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"dev:esm": "yarn build:esm --watch=forever",
"dev:types": "yarn build:types -w",
"dev": "npm-run-all --parallel dev:types dev:cjs dev:esm",
"build:cjs": "esbuild src/index.tsx --target=es2019 --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --outdir=dist --out-extension:.js=.cjs.js --external:react --external:prop-types --external:@mux/* --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm": "esbuild src/index.tsx --target=es2019 --bundle --sourcemap --metafile=./dist/esm.json --format=esm --outdir=dist --out-extension:.js=.mjs --external:react --external:prop-types --external:@mux/* --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:cjs": "esbuild src/index.tsx --target=es2019 --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --outdir=dist --out-extension:.js=.cjs.js --external:react --external:prop-types --external:'@mux/*' --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm": "esbuild src/index.tsx --target=es2019 --bundle --sourcemap --metafile=./dist/esm.json --format=esm --outdir=dist --out-extension:.js=.mjs --external:react --external:prop-types --external:'@mux/*' --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:types": "tsc",
"postbuild:types": "downlevel-dts ./dist/types ./dist/types-ts3.4",
"build": "npm-run-all --parallel 'build:cjs --minify' 'build:esm --minify'",
Expand Down
4 changes: 2 additions & 2 deletions packages/mux-video/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"dev:esm-module": "yarn build:esm-module --watch=forever",
"dev:types": "yarn build:types -w",
"dev": "npm-run-all --parallel dev:types dev:esm dev:cjs dev:iife",
"build:esm": "esbuild src/index.ts --target=es2019 --external:@mux/* --bundle --sourcemap --metafile=./dist/esm.json --format=esm --outdir=dist --out-extension:.js=.mjs --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm": "esbuild src/index.ts --target=es2019 --external:'@mux/*' --bundle --sourcemap --metafile=./dist/esm.json --format=esm --outdir=dist --out-extension:.js=.mjs --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:esm-module": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/module.json --format=esm --outfile=./dist/mux-video.mjs --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:cjs": "esbuild src/index.ts --target=es2019 --external:@mux/* --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --outdir=dist --out-extension:.js=.cjs.js --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:cjs": "esbuild src/index.ts --target=es2019 --external:'@mux/*' --bundle --sourcemap --metafile=./dist/cjs.json --format=cjs --outdir=dist --out-extension:.js=.cjs.js --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"build:iife": "esbuild src/index.ts --target=es2019 --bundle --sourcemap --metafile=./dist/iife.json --format=iife --outfile=./dist/mux-video.js --define:PLAYER_VERSION=\"'$npm_package_version'\"",
"copypolyfills": "shx mkdir -p src/polyfills && shx cp ../../shared/polyfills/index.ts ./src/polyfills/index.ts",
"build:types": "tsc",
Expand Down
4 changes: 1 addition & 3 deletions scripts/create-release-notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"author": "Mux, Inc.",
"license": "MIT",
"private": true,
"bin": {
"create-release-notes": "./create-release-notes.js"
},
"bin": "./create-release-notes.js",
"dependencies": {
"octokit": "^1.7.1"
}
Expand Down
4 changes: 1 addition & 3 deletions scripts/esbuilder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"version": "0.1.0",
"type": "module",
"main": "./esbuilder.js",
"bin": {
"esbuilder": "./esbuilder.js"
},
"bin": "./esbuilder.js",
"dependencies": {
"esbuild": "^0.15.7"
}
Expand Down
4 changes: 1 addition & 3 deletions scripts/i18n-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
"version": "0.1.0",
"type": "module",
"main": "./i18n-utils.js",
"bin": {
"i18n-utils": "./i18n-utils.js"
}
"bin": "./i18n-utils.js"
}
Loading

0 comments on commit d9448bf

Please sign in to comment.