honox 0.1.28 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -326,11 +326,9 @@ import { createRoute } from 'honox/factory'
|
|
|
326
326
|
import { secureHeaders, NONCE } from 'hono/secure-headers'
|
|
327
327
|
|
|
328
328
|
secureHeaders({
|
|
329
|
-
contentSecurityPolicy:
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
: undefined,
|
|
329
|
+
contentSecurityPolicy: {
|
|
330
|
+
scriptSrc: [NONCE]
|
|
331
|
+
}
|
|
334
332
|
})
|
|
335
333
|
```
|
|
336
334
|
|
|
@@ -163,15 +163,22 @@ function islandComponents(options) {
|
|
|
163
163
|
root = config.root;
|
|
164
164
|
if (!reactApiImportSource) {
|
|
165
165
|
const tsConfigPath = path.resolve(process.cwd(), "tsconfig.json");
|
|
166
|
+
const denoJsonPath = path.resolve(process.cwd(), "deno.json");
|
|
167
|
+
let tsConfigRaw;
|
|
166
168
|
try {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
tsConfigRaw = await fs.readFile(denoJsonPath, "utf8");
|
|
170
|
+
} catch (error1) {
|
|
171
|
+
try {
|
|
172
|
+
tsConfigRaw = await fs.readFile(tsConfigPath, "utf8");
|
|
173
|
+
} catch (error2) {
|
|
174
|
+
console.warn("Cannot find neither tsconfig.json nor deno.json", error1, error2);
|
|
175
|
+
return;
|
|
172
176
|
}
|
|
173
|
-
}
|
|
174
|
-
|
|
177
|
+
}
|
|
178
|
+
const tsConfig = parseJsonc(tsConfigRaw);
|
|
179
|
+
reactApiImportSource = tsConfig?.compilerOptions?.jsxImportSource;
|
|
180
|
+
if (reactApiImportSource === "hono/jsx/dom") {
|
|
181
|
+
reactApiImportSource = "hono/jsx";
|
|
175
182
|
}
|
|
176
183
|
}
|
|
177
184
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "honox",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"@babel/parser": "7.25.6",
|
|
114
114
|
"@babel/traverse": "7.25.6",
|
|
115
115
|
"@babel/types": "7.25.6",
|
|
116
|
-
"@hono/vite-dev-server": "0.
|
|
116
|
+
"@hono/vite-dev-server": "0.18.0",
|
|
117
117
|
"jsonc-parser": "3.3.1",
|
|
118
118
|
"precinct": "12.1.2"
|
|
119
119
|
},
|