Skip to content

Commit 3fae385

Browse files
committed
chore: move to npm workspaces
1 parent 1c10757 commit 3fae385

File tree

24 files changed

+30330
-15306
lines changed

24 files changed

+30330
-15306
lines changed

.github/workflows/canary.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ jobs:
2525
FORCE_COLOR: 0
2626
with:
2727
node-version: '18'
28-
cache: 'yarn'
28+
cache: 'npm'
2929
registry-url: 'https://registry.npmjs.org'
3030

3131
- name: Install Dependencies
32-
run: yarn --frozen-lockfile
32+
run: npm ci
3333

3434
- name: Build packages
35-
run: yarn build
35+
run: npm run build
3636

3737
- name: Build for production
38-
run: yarn build:production
38+
run: npm run build:production
3939

4040
- name: Version canary release
41-
run: yarn changeset version --snapshot canary
41+
run: npx changeset version --snapshot canary
4242

4343
- name: Release canary snapshots
4444
id: changesets
4545
uses: changesets/action@master
4646
with:
4747
# This expects you to have a script called release which does a build for your packages and calls changeset publish
48-
publish: yarn changeset publish --tag canary
48+
publish: npx changeset publish --tag canary
4949
env:
5050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5151
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,27 @@ jobs:
2424
FORCE_COLOR: 0
2525
with:
2626
node-version: '18'
27-
cache: 'yarn'
27+
cache: 'npm'
2828
registry-url: 'https://registry.npmjs.org'
2929

3030
- name: Install Dependencies
31-
run: yarn --frozen-lockfile
31+
run: npm ci
3232

3333
- name: Build packages
34-
run: yarn build
34+
run: npm run build
3535

3636
- name: Build for production
37-
run: yarn build:production
37+
run: npm run build:production
3838

3939
- name: Sync blog to dev.to
40-
run: DEV_TO_GIT_TOKEN=${{ secrets.DEV_TO_GIT_TOKEN }} yarn run dev-to-git
40+
run: DEV_TO_GIT_TOKEN=${{ secrets.DEV_TO_GIT_TOKEN }} npm run run dev-to-git
4141

4242
- name: Create Release Pull Request or Publish to npm
4343
id: changesets
4444
uses: changesets/action@master
4545
with:
4646
# This expects you to have a script called release which does a build for your packages and calls changeset publish
47-
publish: yarn release
47+
publish: npm run release
4848
env:
4949
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5050
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/verify-browserstack.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ jobs:
2121
FORCE_COLOR: 0
2222
with:
2323
node-version: '18'
24-
cache: 'yarn'
24+
cache: 'npm'
2525

2626
- name: Install dependencies
27-
run: yarn --frozen-lockfile
27+
run: npm ci
2828

2929
- name: Build packages
30-
run: yarn build
30+
run: npm run build
3131

3232
- name: Test
3333
run: |
3434
cd packages/test-runner-browserstack
35-
yarn test
35+
npm run test
3636
env:
3737
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
3838
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}

.github/workflows/verify-node.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ jobs:
2424
FORCE_COLOR: 0
2525
with:
2626
node-version: ${{ matrix.node-version }}
27-
cache: yarn
27+
cache: npm
2828

2929
- name: Install Playwright dependencies
3030
run: npx playwright install-deps
3131

3232
- name: Install dependencies
33-
run: yarn --frozen-lockfile
33+
run: npm ci
3434

3535
- name: Build packages
36-
run: yarn build
36+
run: npm run build
3737

3838
# build for production in CI to make sure tests can run with production build
3939
- name: Build for production
40-
run: yarn build:production
40+
run: npm run build:production
4141

4242
- name: Lint
43-
run: yarn lint
43+
run: npm run lint
4444

4545
- name: Test
46-
run: yarn test
46+
run: npm run test

.github/workflows/verify-saucelabs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ jobs:
2121
FORCE_COLOR: 0
2222
with:
2323
node-version: '18'
24-
cache: 'yarn'
24+
cache: 'npm'
2525

2626
- name: Install dependencies
27-
run: yarn --frozen-lockfile
27+
run: npm ci
2828

2929
- name: Build packages
30-
run: yarn build
30+
run: npm run build
3131

3232
- name: Test
3333
run: |
3434
cd packages/test-runner-saucelabs
35-
yarn test
35+
npm run test
3636
env:
3737
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
3838
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}

.github/workflows/verify-windows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ jobs:
2020
FORCE_COLOR: 0
2121
with:
2222
node-version: '18'
23-
cache: 'yarn'
23+
cache: 'npm'
2424

2525
- name: Install Playwright dependencies
2626
run: npx playwright install-deps
2727

2828
- name: Install dependencies
29-
run: yarn --frozen-lockfile
29+
run: npm ci
3030

3131
- name: Build
32-
run: yarn build
32+
run: npm run build
3333

3434
# build for production in CI to make sure tests can run with production build
3535
- name: Build for production
36-
run: yarn build:production
36+
run: npm run build:production
3737

3838
- name: Test
39-
run: yarn test
39+
run: npm run test

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ yarn-error.log
2020
## temp folders
2121
/.tmp/
2222

23-
## we prefer yarn.lock
24-
package-lock.json
23+
yarn.lock
2524
## lock files in packages we do not need to save
2625
packages/*/yarn.lock
2726

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn lint-staged
4+
npx lint-staged

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ git remote add upstream git@github.com:modernweb-dev/web.git
2121

2222
## Preparing Your Local Environment for Development
2323

24-
Now that you have cloned the repository, ensure you have [yarn](https://classic.yarnpkg.com/lang/en/) installed, then run the following command to set up the development environment.
24+
Now that you have cloned the repository, ensure you have node 18+ installed, then run the following command to set up the development environment.
2525

2626
```sh
27-
yarn install
28-
yarn build
27+
npm run install
28+
npm run build
2929
```
3030

3131
This will download and install all packages needed.
@@ -46,11 +46,11 @@ Commits are linted using precommit hooks, meaning that any code that raises a li
4646

4747
### Running Tests
4848

49-
To run the tests of a package, it's recommended to `cd` into the package directory and then using `yarn test` to run them. This way you're only running tests of that specific package. The project needs to have been built at least once with `yarn build` for the tests to run.
49+
To run the tests of a package, it's recommended to `cd` into the package directory and then using `npm run test` to run them. This way you're only running tests of that specific package. The project needs to have been built at least once with `npm run build` for the tests to run.
5050

5151
### Adding New Packages
5252

53-
For all projects, the tsconfig/jsconfig configuration files are auto-generated. You need to add an entry to the [./workspace-packages.mjs](./workspace-packages.mjs) to let it generate a config for you. After adding an entry, run `yarn update-package-configs` to generate the files for you.
53+
For all projects, the tsconfig/jsconfig configuration files are auto-generated. You need to add an entry to the [./workspace-packages.mjs](./workspace-packages.mjs) to let it generate a config for you. After adding an entry, run `npm run update-package-configs` to generate the files for you.
5454

5555
### Creating a Changeset
5656

@@ -62,7 +62,7 @@ This documents your intent to release and allows you to specify a message that w
6262
To create a changeset, run:
6363

6464
```sh
65-
yarn changeset
65+
npx changeset
6666
```
6767

6868
Use the menu to select for which packages you need a release, and then select what kind of release. For the release type, we follow [Semantic Versioning](https://semver.org/), so please take a look if you're unfamiliar.

docs/blog/introducing-web-test-runner/index.md.review

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ This will locally install the required versions of Chromium, Firefox, and WebKit
141141
Now all we need to do is run our tests:
142142

143143
```
144-
$ yarn test
144+
$ npm run test
145145
$ web-test-runner "test/**/*.test.js" --node-resolve --playwright --browsers chromium firefox webkit
146146

147147
Chromium: |██████████████████████████████| 2/2 test files | 3 passed, 0 failed

0 commit comments

Comments
 (0)