Skip to content

Commit 967357f

Browse files
committed
Merge branch 'master' into next
2 parents 0509460 + f7fcf29 commit 967357f

18 files changed

+117
-82
lines changed

.github/workflows/canary.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout Repo
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
with:
2020
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2121
fetch-depth: 0
2222

2323
- name: Setup Node.js
24-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v4
2525
env:
2626
FORCE_COLOR: 0
2727
with:
28-
node-version: '18'
28+
node-version: '20'
2929
cache: 'npm'
3030
registry-url: 'https://registry.npmjs.org'
3131

.github/workflows/lint.yml

+7-11
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,24 @@ env:
66
FORCE_COLOR: true
77

88
jobs:
9-
verify-linux:
9+
linux:
1010
timeout-minutes: 30
11-
name: Verify linux
11+
name: Linux
1212
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
node-version:
16-
- '18'
1713

1814
steps:
19-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
2016

21-
- name: Setup Node ${{ matrix.node-version }}
22-
uses: actions/setup-node@v3
17+
- name: Setup Node 20
18+
uses: actions/setup-node@v4
2319
env:
2420
FORCE_COLOR: 0
2521
with:
26-
node-version: ${{ matrix.node-version }}
22+
node-version: 20
2723
cache: npm
2824

2925
- name: Install Dependencies
3026
run: npm ci
3127

3228
- name: Lint
33-
run: npm run lint
29+
run: npm run lint

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout Repo
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
with:
1919
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2020
fetch-depth: 0
2121

2222
- name: Setup Node.js
23-
uses: actions/setup-node@v3
23+
uses: actions/setup-node@v4
2424
env:
2525
FORCE_COLOR: 0
2626
with:
27-
node-version: '18'
27+
node-version: '20'
2828
cache: 'npm'
2929
registry-url: 'https://registry.npmjs.org'
3030

.github/workflows/verify-browser.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Verify Browser
1+
name: Browser tests
22

33
on: pull_request
44

@@ -8,22 +8,18 @@ env:
88
jobs:
99
verify-linux:
1010
timeout-minutes: 30
11-
name: Verify linux
11+
name: Linux
1212
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
node-version:
16-
- '18'
1713

1814
steps:
19-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
2016

21-
- name: Setup Node ${{ matrix.node-version }}
22-
uses: actions/setup-node@v3
17+
- name: Setup Node 20
18+
uses: actions/setup-node@v4
2319
env:
2420
FORCE_COLOR: 0
2521
with:
26-
node-version: ${{ matrix.node-version }}
22+
node-version: 20
2723
cache: npm
2824

2925
- name: Install Dependencies

.github/workflows/verify-node.yml

+45-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Verify Node
1+
name: Node tests
22

33
on: pull_request
44

@@ -8,19 +8,20 @@ env:
88
jobs:
99
verify-linux:
1010
timeout-minutes: 30
11-
name: Verify linux
11+
name: Linux
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
1515
node-version:
1616
- '18'
17-
- '19'
17+
- '20'
18+
- 'latest'
1819

1920
steps:
20-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2122

2223
- name: Setup Node ${{ matrix.node-version }}
23-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v4
2425
env:
2526
FORCE_COLOR: 0
2627
with:
@@ -48,3 +49,42 @@ jobs:
4849

4950
- name: Test
5051
run: npm run test:node
52+
53+
verify-windows:
54+
timeout-minutes: 30
55+
name: Windows
56+
runs-on: windows-2022
57+
steps:
58+
- name: Set git to use LF
59+
run: |
60+
git config --global core.autocrlf false
61+
git config --global core.eol lf
62+
63+
- uses: actions/checkout@v4
64+
65+
- name: Setup Node '20'
66+
uses: actions/setup-node@v4
67+
env:
68+
FORCE_COLOR: 0
69+
with:
70+
node-version: '20'
71+
cache: 'npm'
72+
73+
- name: Install Playwright dependencies
74+
run: npx playwright install-deps
75+
76+
# Set up GitHub Actions caching for Wireit.
77+
- uses: google/wireit@setup-github-actions-caching/v1
78+
79+
- name: Install Dependencies
80+
run: npm ci
81+
82+
- name: Build
83+
run: npm run build
84+
85+
# build for production in CI to make sure tests can run with production build
86+
- name: Build specific packages for production
87+
run: npm run build:production
88+
89+
- name: Test
90+
run: npm run test:node

.github/workflows/verify-windows.yml

-43
This file was deleted.

packages/dev-server-core/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @web/dev-server-core
22

3+
## 0.7.1
4+
5+
### Patch Changes
6+
7+
- 649edc2b: Add option to modify chokidar watchOptions with @web/dev-server
8+
39
## 0.7.0
410

511
### Minor Changes

packages/dev-server-core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web/dev-server-core",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"publishConfig": {
55
"access": "public"
66
},

packages/dev-server-core/src/server/DevServer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class DevServer {
1818
constructor(
1919
public config: DevServerCoreConfig,
2020
public logger: Logger,
21-
public fileWatcher = chokidar.watch([]),
21+
public fileWatcher = chokidar.watch([], config.chokidarOptions),
2222
) {
2323
if (!config) throw new Error('Missing config.');
2424
if (!logger) throw new Error('Missing logger.');

packages/dev-server-core/src/server/DevServerCoreConfig.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Middleware } from 'koa';
22
import { Plugin } from '../plugins/Plugin';
33
import { Server } from 'net';
4+
import chokidar from 'chokidar';
45

56
export type MimeTypeMappings = Record<string, string>;
67

@@ -67,4 +68,9 @@ export interface DevServerCoreConfig {
6768
* Useful when you want more control over when files are build (e.g. when doing a test run using @web/test-runner).
6869
*/
6970
disableFileWatcher?: boolean;
71+
72+
/**
73+
* Additional options you want to provide to chokidar file watcher
74+
*/
75+
chokidarOptions?: chokidar.WatchOptions;
7076
}

packages/dev-server/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @web/dev-server
22

3+
## 0.4.2
4+
5+
### Patch Changes
6+
7+
- 649edc2b: Add option to modify chokidar watchOptions with @web/dev-server
8+
- Updated dependencies [649edc2b]
9+
- @web/dev-server-core@0.7.1
10+
311
## 0.4.1
412

513
### Patch Changes

packages/dev-server/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web/dev-server",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"publishConfig": {
55
"access": "public"
66
},
@@ -59,7 +59,7 @@
5959
"@babel/code-frame": "^7.12.11",
6060
"@types/command-line-args": "^5.0.0",
6161
"@web/config-loader": "^0.3.0",
62-
"@web/dev-server-core": "^0.7.0",
62+
"@web/dev-server-core": "^0.7.1",
6363
"@web/dev-server-rollup": "^0.6.1",
6464
"camelcase": "^6.2.0",
6565
"command-line-args": "^5.1.1",

packages/dev-server/src/config/parseConfig.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const defaultConfig: Partial<DevServerConfig> = {
1616
clearTerminalOnReload: true,
1717
middleware: [],
1818
plugins: [],
19+
chokidarOptions: {},
1920
};
2021

2122
function validate(config: Record<string, unknown>, key: string, type: string) {

packages/mocks/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @web/mocks
22

3+
## 1.1.1
4+
5+
### Patch Changes
6+
7+
- 17906853: workaround for MSW breaking change
8+
39
## 1.1.0
410

511
### Minor Changes

packages/mocks/browser.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { _registerMockRoutes } from './registerMockRoutes.js';
44

55
const bypassServiceWorker = new URL(window.location.href).searchParams.has('bypass-sw');
66
const worker = setupWorker();
7-
worker
7+
const workerPromise = worker
88
.start({
99
serviceWorker: {
1010
url: '__msw_sw__.js',
@@ -19,8 +19,21 @@ worker
1919
console.error(`[MOCKS]: Failed to load Service Worker.
2020
2121
Did you forget to use the mockPlugin in the dev server?`);
22+
return Promise.resolve();
2223
});
2324

25+
/**
26+
* It's unfortunate to override native `fetch`, and you should never do it, and please don't take this
27+
* code as an example. We have to do this here because MSW removed this behavior which was released as
28+
* a breaking change in a minor version https://github.com/mswjs/msw/issues/1981
29+
*/
30+
const originalFetch = window.fetch;
31+
window.fetch = async (...args) => {
32+
await workerPromise;
33+
window.fetch = originalFetch;
34+
return window.fetch(...args);
35+
};
36+
2437
/**
2538
* Mock the given mocked routes using a Service Worker.
2639
*

packages/mocks/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web/mocks",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"publishConfig": {
55
"access": "public"
66
},

packages/storybook-builder/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @web/storybook-builder
22

3+
## 0.1.6
4+
5+
### Patch Changes
6+
7+
- 010eed69: fix: import both globals and globalsNameReferenceMap from @storybook/preview/globals and use the one that is set. This fixes issue https://github.com/modernweb-dev/web/issues/2619
8+
39
## 0.1.5
410

511
### Patch Changes

packages/storybook-builder/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web/storybook-builder",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"publishConfig": {
55
"access": "public"
66
},

0 commit comments

Comments
 (0)