Skip to content
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
267 changes: 138 additions & 129 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,16 @@
"open-props": "^1.7.23"
},
"devDependencies": {
"@greenwood/cli": "~0.34.0-alpha.4",
"@greenwood/plugin-css-modules": "^0.34.0-alpha.4",
"@greenwood/plugin-import-jsx": "^0.34.0-alpha.4",
"@greenwood/plugin-import-raw": "^0.34.0-alpha.4",
"@greenwood/cli": "~0.34.0-alpha.6",
"@greenwood/plugin-css-modules": "^0.34.0-alpha.6",
"@greenwood/plugin-import-jsx": "^0.34.0-alpha.6",
"@greenwood/plugin-import-raw": "^0.34.0-alpha.6",
"@typescript/native-preview": "^7.0.0-dev.20260506.1",
"husky": "^9.1.7",
"lint-staged": "^16.2.7",
"oxfmt": "^0.28.0",
"oxlint": "^1.43.0",
"patch-package": "^8.0.1",
"typescript": "^6.0.2"
},
"overrides": {
"wc-compiler": "~0.20.0"
}
}
87 changes: 0 additions & 87 deletions patches/@greenwood+cli+0.34.0-alpha.4.patch

This file was deleted.

44 changes: 44 additions & 0 deletions patches/@greenwood+cli+0.34.0-alpha.6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/node_modules/@greenwood/cli/src/lifecycles/serve.js b/node_modules/@greenwood/cli/src/lifecycles/serve.js
index beff516..fcee286 100644
--- a/node_modules/@greenwood/cli/src/lifecycles/serve.js
+++ b/node_modules/@greenwood/cli/src/lifecycles/serve.js
@@ -106,16 +106,14 @@ async function getDevServer(compilation) {
// when looping through and sharing responses between plugins
const response = await resourcePlugins.reduce(async (responsePromise, plugin) => {
const intermediateResponse = await responsePromise;
+ // Create a single snapshot to avoid multiple clone() calls failing on exhausted bodies
+ const responseSnapshot = intermediateResponse.clone();
if (
plugin.shouldPreIntercept &&
- (await plugin.shouldPreIntercept(url, request, intermediateResponse.clone()))
+ (await plugin.shouldPreIntercept(url, request, responseSnapshot.clone()))
) {
- const current = await plugin.preIntercept(
- url,
- request,
- await intermediateResponse.clone(),
- );
- const merged = mergeResponse(intermediateResponse.clone(), current);
+ const current = await plugin.preIntercept(url, request, await responseSnapshot.clone());
+ const merged = mergeResponse(responseSnapshot, current);

return Promise.resolve(merged);
} else {
@@ -152,12 +150,14 @@ async function getDevServer(compilation) {
// when looping through and sharing responses between plugins
const response = await resourcePlugins.reduce(async (responsePromise, plugin) => {
const intermediateResponse = await responsePromise;
+ // Create a single "snapshot" to avoid multiple clone() calls failing on exhausted bodies
+ const responseSnapshot = intermediateResponse.clone();
if (
plugin.shouldIntercept &&
- (await plugin.shouldIntercept(url, request, intermediateResponse.clone()))
+ (await plugin.shouldIntercept(url, request, responseSnapshot.clone()))
) {
- const current = await plugin.intercept(url, request, await intermediateResponse.clone());
- const merged = mergeResponse(intermediateResponse.clone(), current);
+ const current = await plugin.intercept(url, request, await responseSnapshot.clone());
+ const merged = mergeResponse(responseSnapshot, current);

return Promise.resolve(merged);
} else {
13 changes: 0 additions & 13 deletions patches/@greenwood+plugin-import-jsx+0.34.0-alpha.4.patch

This file was deleted.

44 changes: 0 additions & 44 deletions patches/wc-compiler+0.20.0.patch

This file was deleted.

14 changes: 14 additions & 0 deletions patches/wc-compiler+0.22.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/node_modules/wc-compiler/src/jsx-loader.js b/node_modules/wc-compiler/src/jsx-loader.js
index 2e24c74..4b871e5 100644
--- a/node_modules/wc-compiler/src/jsx-loader.js
+++ b/node_modules/wc-compiler/src/jsx-loader.js
@@ -35,7 +35,8 @@ function getParse(html) {
}

export function getParser(moduleURL) {
- const ext = moduleURL.pathname.split('.').pop();
+ // TODO: we only get a Blob URL for the REPL, so will have to craft a "faux" URL
+ const ext = moduleURL?.pathname?.split('.')?.pop();
const isJSX = ext === 'jsx' || ext === 'tsx';

if (!isJSX) {