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

tools: replace yarn v1 with NPM #1085

Merged
merged 4 commits into from
Mar 21, 2025
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
10 changes: 5 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ jobs:

- name: Install
if: ${{ steps.release.outputs.releases_created == 'true' }}
run: yarn install --frozen-lockfile
run: npm ci
- name: Clean
if: ${{ steps.release.outputs.releases_created == 'true' }}
run: yarn clean
run: npm run clean
- name: Test
if: ${{ steps.release.outputs.releases_created == 'true' }}
run: yarn test
run: npm test
- name: Clean
if: ${{ steps.release.outputs.releases_created == 'true' }}
run: yarn clean
run: npm run clean
- name: Build
if: ${{ steps.release.outputs.releases_created == 'true' }}
run: yarn build:packages
run: npm run build:packages
- name: Publish
if: ${{ steps.release.outputs.releases_created == 'true' }}
run: npm exec -c publish-packages
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
node-version: ${{steps.nvmrc.outputs.NODE_VERSION}}
# 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: yarn clean
- run: yarn build:packages
cache: npm
- run: npm ci
- run: npm run clean
- run: npm run build:packages
- run: npx --yes -w packages [email protected] release prerelease --prerelease canary --provenance --log-level verbose
if: ${{ github.ref == 'refs/heads/main' }}
env:
Expand All @@ -52,9 +52,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{steps.nvmrc.outputs.NODE_VERSION}}
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint
cache: npm
- run: npm ci
- run: npm run lint

test:
# Don't run if the CI is triggered by Release Please
Expand All @@ -67,19 +67,19 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache: npm
# esbuild requires --ignore-scripts to NOT be added here.
- run: yarn install --frozen-lockfile
- run: yarn clean
- run: npm ci
- run: npm run clean
- name: Install playwright browsers
run: npx playwright install --with-deps
# Retry the test command up to 3 times with a timeout of 10 minutes
- uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
# run yarn and pass through `-- --all` to turborepo
command: yarn test -- -- --all
# run npm test and pass through `-- --all` to turborepo
command: npm run test -- -- --all
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
Expand Down
22 changes: 11 additions & 11 deletions README_INTERNAL.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Local Development

To run this repo locally, run `yarn` to install and link dependencies.
To run this repo locally, run `npm i` to install and link dependencies.

For dev testing, run `yarn dev`. By default, this only runs the packages.
To run examples, you'll want to run run a `yarn dev` in the example folder of your choice or modify the `dev` script in the [top level package.json](./package.json).
For dev testing, run `npm run dev`. By default, this only runs the packages.
To run examples, you'll want to run run a `npm run dev` in the example folder of your choice or modify the `dev` script in the [top level package.json](./package.json).
Examples:

- To run all examples
- include `--filter 'demo-*'` in the dev script
- Run `npx turbo run dev --filter 'demo-*'` locally after running `yarn dev`
- Run `npx turbo run dev --filter 'demo-*'` locally after running `npm run dev`
- To only run `vanilla-ts-esm` demo
- include `--filter '*-esm'` in the dev script
- Run `npx turbo run dev --filter '*-esm'` locally after running `yarn dev`
- Alternatively, run `yarn dev` and then, from another terminal, `cd ./examples/vanilla-ts-esm` and `yarn dev`
- Run `npx turbo run dev --filter '*-esm'` locally after running `npm run dev`
- Alternatively, run `npm run dev` and then, from another terminal, `cd ./examples/vanilla-ts-esm` and `npm run dev`

## Testing your changes

To run tests for the entire monorepo, run `yarn test` from the monorepo root. In addition, you can:
To run tests for the entire monorepo, run `npm test` from the monorepo root. In addition, you can:

- Run tests across multiple browsers via `yarn test -- -- --all`
- Run tests for a particular package by navigating to that package and running its `yarn test` (with or without the `--all` flag)
- Example: for `playback-core`, `cd ./packages/playback-core` and `yarn test`
- Run tests on Sauce Labs from your local machine (where available) by going to the relevant package and running `yarn test:saucelabs`
- Run tests across multiple browsers via `npm test -- -- --all`
- Run tests for a particular package by navigating to that package and running its `npm test` (with or without the `--all` flag)
- Example: for `playback-core`, `cd ./packages/playback-core` and `npm test`
- Run tests on Sauce Labs from your local machine (where available) by going to the relevant package and running `npm run test:saucelabs`
- **NOTE**: This is only available for core contributors and requires `SAUCE_USERNAME` + `SAUCE_ACCESS_KEY` env variables setup. Reach out to relevant team members for assistance.
- **NOTE**: Currently only implemented for the `mux-player` package.

Expand Down
2 changes: 1 addition & 1 deletion examples/create-react-app-with-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"dev": "PORT=3001 BROWSER=none GENERATE_SOURCEMAP=false yarn start",
"dev": "PORT=3001 BROWSER=none GENERATE_SOURCEMAP=false npm start",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
Expand Down
4 changes: 2 additions & 2 deletions examples/vanilla-ts-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"author": "Mux, Inc.",
"license": "MIT",
"scripts": {
"dev": "yarn esbuild --servedir=public --serve=0.0.0.0:8004",
"dev": "npm run esbuild -- --servedir=public --serve=0.0.0.0:8004",
"esbuild": "esbuild src/** --bundle --target=es2019 --format=esm --outdir=public/dist",
"build": "yarn esbuild --minify"
"build": "npm run esbuild -- --minify"
},
"devDependencies": {
"esbuild": "^0.24.1",
Expand Down
Loading
Loading