Skip to content

Commit fb5be8c

Browse files
chore: #6 bump greenwood v0.34.0-alpha.6 (#30)
1 parent 64bfc55 commit fb5be8c

7 files changed

Lines changed: 200 additions & 280 deletions

package-lock.json

Lines changed: 138 additions & 129 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,16 @@
3333
"open-props": "^1.7.23"
3434
},
3535
"devDependencies": {
36-
"@greenwood/cli": "~0.34.0-alpha.4",
37-
"@greenwood/plugin-css-modules": "^0.34.0-alpha.4",
38-
"@greenwood/plugin-import-jsx": "^0.34.0-alpha.4",
39-
"@greenwood/plugin-import-raw": "^0.34.0-alpha.4",
36+
"@greenwood/cli": "~0.34.0-alpha.6",
37+
"@greenwood/plugin-css-modules": "^0.34.0-alpha.6",
38+
"@greenwood/plugin-import-jsx": "^0.34.0-alpha.6",
39+
"@greenwood/plugin-import-raw": "^0.34.0-alpha.6",
4040
"@typescript/native-preview": "^7.0.0-dev.20260506.1",
4141
"husky": "^9.1.7",
4242
"lint-staged": "^16.2.7",
4343
"oxfmt": "^0.28.0",
4444
"oxlint": "^1.43.0",
4545
"patch-package": "^8.0.1",
4646
"typescript": "^6.0.2"
47-
},
48-
"overrides": {
49-
"wc-compiler": "~0.20.0"
5047
}
5148
}

patches/@greenwood+cli+0.34.0-alpha.4.patch

Lines changed: 0 additions & 87 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
diff --git a/node_modules/@greenwood/cli/src/lifecycles/serve.js b/node_modules/@greenwood/cli/src/lifecycles/serve.js
2+
index beff516..fcee286 100644
3+
--- a/node_modules/@greenwood/cli/src/lifecycles/serve.js
4+
+++ b/node_modules/@greenwood/cli/src/lifecycles/serve.js
5+
@@ -106,16 +106,14 @@ async function getDevServer(compilation) {
6+
// when looping through and sharing responses between plugins
7+
const response = await resourcePlugins.reduce(async (responsePromise, plugin) => {
8+
const intermediateResponse = await responsePromise;
9+
+ // Create a single snapshot to avoid multiple clone() calls failing on exhausted bodies
10+
+ const responseSnapshot = intermediateResponse.clone();
11+
if (
12+
plugin.shouldPreIntercept &&
13+
- (await plugin.shouldPreIntercept(url, request, intermediateResponse.clone()))
14+
+ (await plugin.shouldPreIntercept(url, request, responseSnapshot.clone()))
15+
) {
16+
- const current = await plugin.preIntercept(
17+
- url,
18+
- request,
19+
- await intermediateResponse.clone(),
20+
- );
21+
- const merged = mergeResponse(intermediateResponse.clone(), current);
22+
+ const current = await plugin.preIntercept(url, request, await responseSnapshot.clone());
23+
+ const merged = mergeResponse(responseSnapshot, current);
24+
25+
return Promise.resolve(merged);
26+
} else {
27+
@@ -152,12 +150,14 @@ async function getDevServer(compilation) {
28+
// when looping through and sharing responses between plugins
29+
const response = await resourcePlugins.reduce(async (responsePromise, plugin) => {
30+
const intermediateResponse = await responsePromise;
31+
+ // Create a single "snapshot" to avoid multiple clone() calls failing on exhausted bodies
32+
+ const responseSnapshot = intermediateResponse.clone();
33+
if (
34+
plugin.shouldIntercept &&
35+
- (await plugin.shouldIntercept(url, request, intermediateResponse.clone()))
36+
+ (await plugin.shouldIntercept(url, request, responseSnapshot.clone()))
37+
) {
38+
- const current = await plugin.intercept(url, request, await intermediateResponse.clone());
39+
- const merged = mergeResponse(intermediateResponse.clone(), current);
40+
+ const current = await plugin.intercept(url, request, await responseSnapshot.clone());
41+
+ const merged = mergeResponse(responseSnapshot, current);
42+
43+
return Promise.resolve(merged);
44+
} else {

patches/@greenwood+plugin-import-jsx+0.34.0-alpha.4.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.

patches/wc-compiler+0.20.0.patch

Lines changed: 0 additions & 44 deletions
This file was deleted.

patches/wc-compiler+0.22.0.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/node_modules/wc-compiler/src/jsx-loader.js b/node_modules/wc-compiler/src/jsx-loader.js
2+
index 2e24c74..4b871e5 100644
3+
--- a/node_modules/wc-compiler/src/jsx-loader.js
4+
+++ b/node_modules/wc-compiler/src/jsx-loader.js
5+
@@ -35,7 +35,8 @@ function getParse(html) {
6+
}
7+
8+
export function getParser(moduleURL) {
9+
- const ext = moduleURL.pathname.split('.').pop();
10+
+ // TODO: we only get a Blob URL for the REPL, so will have to craft a "faux" URL
11+
+ const ext = moduleURL?.pathname?.split('.')?.pop();
12+
const isJSX = ext === 'jsx' || ext === 'tsx';
13+
14+
if (!isJSX) {

0 commit comments

Comments
 (0)