diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index b6edad35..1ecb48c9 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -42,6 +42,10 @@ jobs:
working-directory: ./update
run: deno publish
+ - name: Publish @fresh/plugin-vite
+ working-directory: ./plugin-vite
+ run: deno publish
+
- name: Publish @fresh/examples
working-directory: ./examples
run: deno publish
diff --git a/.gitignore b/.gitignore
index d76c6907..8ccb285c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
_fresh/
+.vite/
vendor/
node_modules/
.docs/
diff --git a/deno.json b/deno.json
index d55e7dfe..61966de2 100644
--- a/deno.json
+++ b/deno.json
@@ -5,6 +5,7 @@
"./init",
"./plugin-tailwindcss",
"./plugin-tailwindcss-v3",
+ "./plugin-vite",
"./update",
"./www"
],
@@ -14,9 +15,12 @@
"exports": {
".": "./src/mod.ts",
"./runtime": "./src/runtime/shared.ts",
+ "./runtime-client": "./src/runtime/client/mod.tsx",
"./dev": "./src/dev/mod.ts",
"./compat": "./src/compat.ts",
- "./do-not-use": "./src/internals.ts"
+ "./internal": "./src/internals.ts",
+ "./internal-dev": "./src/internals_dev.ts",
+ "./build-id": "./src/runtime/build_id.ts"
},
"tasks": {
"test": "deno test -A --parallel",
@@ -30,7 +34,14 @@
"test:www": "deno test -A www/main_test.*",
"release": "deno run -A tools/release.ts"
},
- "exclude": ["**/_fresh/*", "**/tmp/*", "*/tests_OLD/**"],
+ "exclude": [
+ "**/_fresh/*",
+ "**/tmp/*",
+ "*/tests_OLD/**",
+ "**/vite.config.ts.*",
+ "*/vite.config.ts.*",
+ "vite.config.ts.*"
+ ],
"publish": {
"include": [
"src/**",
diff --git a/deno.lock b/deno.lock
index 514679a5..0c831d22 100644
--- a/deno.lock
+++ b/deno.lock
@@ -1,77 +1,22 @@
{
"version": "5",
"specifiers": {
- "jsr:@astral/astral@~0.5.3": "0.5.3",
- "jsr:@deno-library/progress@^1.5.1": "1.5.1",
- "jsr:@deno/cache-dir@0.14": "0.14.0",
- "jsr:@deno/doc@0.172": "0.172.0",
- "jsr:@deno/esbuild-plugin@^1.1.3": "1.1.4",
- "jsr:@deno/esbuild-plugin@^1.1.4": "1.1.4",
- "jsr:@deno/graph@0.86": "0.86.9",
- "jsr:@deno/graph@~0.82.3": "0.82.3",
- "jsr:@deno/loader@~0.3.2": "0.3.2",
- "jsr:@fresh/core@^2.0.0-alpha.37": "2.0.0-alpha.51",
- "jsr:@marvinh-test/fresh-island@^0.0.1": "0.0.1",
- "jsr:@std/assert@^1.0.13": "1.0.13",
- "jsr:@std/async@1": "1.0.14",
- "jsr:@std/async@^1.0.13": "1.0.14",
- "jsr:@std/bytes@^1.0.5": "1.0.6",
- "jsr:@std/bytes@^1.0.6": "1.0.6",
- "jsr:@std/cli@^1.0.19": "1.0.21",
- "jsr:@std/cli@^1.0.21": "1.0.21",
"jsr:@std/collections@^1.0.11": "1.1.1",
"jsr:@std/collections@^1.1.1": "1.1.2",
"jsr:@std/collections@^1.1.2": "1.1.2",
- "jsr:@std/crypto@^1.0.5": "1.0.5",
- "jsr:@std/data-structures@^1.0.9": "1.0.9",
- "jsr:@std/encoding@1": "1.0.10",
- "jsr:@std/encoding@^1.0.10": "1.0.10",
- "jsr:@std/expect@^1.0.16": "1.0.16",
- "jsr:@std/fmt@1.0.3": "1.0.3",
- "jsr:@std/fmt@^1.0.3": "1.0.8",
- "jsr:@std/fmt@^1.0.7": "1.0.8",
- "jsr:@std/fmt@^1.0.8": "1.0.8",
"jsr:@std/front-matter@^1.0.5": "1.0.9",
- "jsr:@std/fs@1": "1.0.19",
- "jsr:@std/fs@^1.0.19": "1.0.19",
- "jsr:@std/fs@^1.0.6": "1.0.19",
- "jsr:@std/html@1": "1.0.4",
- "jsr:@std/html@^1.0.4": "1.0.4",
- "jsr:@std/http@^1.0.15": "1.0.20",
- "jsr:@std/internal@^1.0.10": "1.0.10",
- "jsr:@std/internal@^1.0.6": "1.0.10",
- "jsr:@std/internal@^1.0.7": "1.0.10",
- "jsr:@std/internal@^1.0.9": "1.0.10",
- "jsr:@std/io@0.225": "0.225.2",
- "jsr:@std/io@0.225.0": "0.225.0",
- "jsr:@std/json@^1.0.2": "1.0.2",
- "jsr:@std/jsonc@1": "1.0.2",
- "jsr:@std/media-types@1": "1.1.0",
- "jsr:@std/media-types@^1.1.0": "1.1.0",
- "jsr:@std/net@^1.0.4": "1.0.4",
- "jsr:@std/path@1": "1.1.1",
- "jsr:@std/path@^1.0.8": "1.1.1",
- "jsr:@std/path@^1.1.1": "1.1.1",
- "jsr:@std/semver@1": "1.0.5",
- "jsr:@std/streams@1": "1.0.10",
- "jsr:@std/streams@^1.0.10": "1.0.10",
- "jsr:@std/testing@^1.0.12": "1.0.15",
"jsr:@std/toml@^1.0.3": "1.0.8",
- "jsr:@std/uuid@^1.0.7": "1.0.9",
"jsr:@std/yaml@^1.0.5": "1.0.9",
- "jsr:@zip-js/zip-js@^2.7.52": "2.7.71",
"npm:@opentelemetry/api@^1.9.0": "1.9.0",
- "npm:@preact/signals@^1.2.3": "1.3.2_preact@10.27.0",
"npm:@preact/signals@^2.2.1": "2.2.1_preact@10.27.0",
+ "npm:@prefresh/vite@^2.4.8": "2.4.8_preact@10.27.0_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0_@types+node@22.15.15",
"npm:@tailwindcss/postcss@^4.1.10": "4.1.11",
"npm:@types/node@*": "22.15.15",
+ "npm:@types/node@^24.1.0": "24.1.0",
"npm:autoprefixer@^10.4.21": "10.4.21_postcss@8.5.6",
"npm:cssnano@^6.1.2": "6.1.2_postcss@8.5.6",
"npm:esbuild-wasm@0.25.7": "0.25.7",
- "npm:esbuild-wasm@~0.25.8": "0.25.8",
"npm:esbuild@0.25.7": "0.25.7",
- "npm:esbuild@~0.25.5": "0.25.8",
- "npm:esbuild@~0.25.8": "0.25.8",
"npm:fflate@~0.8.2": "0.8.2",
"npm:github-slugger@2": "2.0.0",
"npm:linkedom@~0.18.10": "0.18.11",
@@ -80,142 +25,25 @@
"npm:postcss@8.5.6": "8.5.6",
"npm:postcss@^8.5.6": "8.5.6",
"npm:preact-render-to-string@^6.5.11": "6.5.13_preact@10.27.0",
- "npm:preact@^10.22.0": "10.27.0",
+ "npm:preact@^10.26.9": "10.27.0",
"npm:preact@^10.27.0": "10.27.0",
"npm:prismjs@^1.29.0": "1.30.0",
"npm:tailwindcss@^3.4.17": "3.4.17_postcss@8.5.6",
"npm:tailwindcss@^4.1.10": "4.1.11",
"npm:ts-morph@26": "26.0.0",
- "npm:vite@^7.0.6": "7.0.6_@types+node@22.15.15_picomatch@4.0.3"
+ "npm:vite-plugin-inspect@^11.3.2": "11.3.2_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0_@types+node@22.15.15",
+ "npm:vite@^7.0.6": "7.0.6_@types+node@24.1.0_picomatch@4.0.3_@types+node@22.15.15"
},
"jsr": {
- "@astral/astral@0.5.3": {
- "integrity": "d6a4628313d8be99aac0f51005c1dc090fa3b4c6b5c8335c26a52d4842aa1276",
- "dependencies": [
- "jsr:@deno-library/progress",
- "jsr:@std/async@1",
- "jsr:@std/fs@1",
- "jsr:@std/path@1",
- "jsr:@zip-js/zip-js"
- ]
- },
- "@deno-library/progress@1.5.1": {
- "integrity": "966611826b8bb27baae73ab1c4fa4317cd4edd2abb99750cd6f8488d22d5b121",
- "dependencies": [
- "jsr:@std/fmt@1.0.3",
- "jsr:@std/io@0.225.0"
- ]
- },
- "@deno/cache-dir@0.14.0": {
- "integrity": "729f0b68e7fc96443c09c2c544b830ca70897bdd5168598446d752f7a4c731ad",
- "dependencies": [
- "jsr:@deno/graph@0.86",
- "jsr:@std/fmt@^1.0.3",
- "jsr:@std/fs@^1.0.6",
- "jsr:@std/io@0.225",
- "jsr:@std/path@^1.0.8"
- ]
- },
- "@deno/doc@0.172.0": {
- "integrity": "72a68ed533576a06feb930a84784ad9ba6d83ca9d581fc734d498c58e32b7cf5",
- "dependencies": [
- "jsr:@deno/cache-dir",
- "jsr:@deno/graph@~0.82.3"
- ]
- },
- "@deno/esbuild-plugin@1.1.4": {
- "integrity": "a9574e2c394cbfec57ce573482bef265e0c32180a498929c4594aa1bb010ee6e",
- "dependencies": [
- "jsr:@deno/loader",
- "jsr:@std/path@^1.1.1",
- "npm:esbuild@~0.25.5"
- ]
- },
- "@deno/graph@0.82.3": {
- "integrity": "5c1fe944368172a9c87588ac81b82eb027ca78002a57521567e6264be322637e"
- },
- "@deno/graph@0.86.9": {
- "integrity": "c4f353a695bcc5246c099602977dabc6534eacea9999a35a8cb24e807192e6a1"
- },
- "@deno/loader@0.3.2": {
- "integrity": "2734cfcd7d91cb2be49279c0d68ae1d1922138525c0f9d409260c085efb1983d"
- },
- "@fresh/core@2.0.0-alpha.51": {
- "integrity": "5b521a96c8a0af96942bb5599e7d786321a6b4b74031489bf1d96d60d9df05b5",
- "dependencies": [
- "jsr:@deno/esbuild-plugin@^1.1.3",
- "jsr:@std/encoding@1",
- "jsr:@std/fmt@^1.0.7",
- "jsr:@std/fs@1",
- "jsr:@std/html@1",
- "jsr:@std/http",
- "jsr:@std/jsonc",
- "jsr:@std/media-types@1",
- "jsr:@std/path@1",
- "jsr:@std/semver",
- "jsr:@std/uuid",
- "npm:@opentelemetry/api",
- "npm:@preact/signals@^2.2.1",
- "npm:esbuild-wasm@~0.25.8",
- "npm:esbuild@~0.25.8",
- "npm:preact-render-to-string",
- "npm:preact@^10.27.0"
- ]
- },
- "@marvinh-test/fresh-island@0.0.1": {
- "integrity": "890f2595e60b1aaeaa8d73c6ad2c1247d4c5b895387df230f7f3b2a4da29b585",
- "dependencies": [
- "npm:@preact/signals@^1.2.3",
- "npm:preact@^10.22.0",
- "npm:preact@^10.27.0"
- ]
- },
- "@std/assert@1.0.13": {
- "integrity": "ae0d31e41919b12c656c742b22522c32fb26ed0cba32975cb0de2a273cb68b29",
- "dependencies": [
- "jsr:@std/internal@^1.0.6"
- ]
- },
"@std/async@1.0.13": {
"integrity": "1d76ca5d324aef249908f7f7fe0d39aaf53198e5420604a59ab5c035adc97c96"
},
- "@std/async@1.0.14": {
- "integrity": "62e954a418652c704d37563a3e54a37d4cf0268a9dcaeac1660cc652880b5326"
- },
- "@std/bytes@1.0.6": {
- "integrity": "f6ac6adbd8ccd99314045f5703e23af0a68d7f7e58364b47d2c7f408aeb5820a"
- },
- "@std/cli@1.0.21": {
- "integrity": "cd25b050bdf6282e321854e3822bee624f07aca7636a3a76d95f77a3a919ca2a"
- },
"@std/collections@1.1.1": {
"integrity": "eff6443fbd9d5a6697018fb39c5d13d5f662f0045f21392d640693d0008ab2af"
},
"@std/collections@1.1.2": {
"integrity": "f1685dd45c3ec27c39d0e8a642ccf810f391ec8a6cb5e7355926e6dacc64c43e"
},
- "@std/crypto@1.0.5": {
- "integrity": "0dcfbb319fe0bba1bd3af904ceb4f948cde1b92979ec1614528380ed308a3b40"
- },
- "@std/data-structures@1.0.9": {
- "integrity": "033d6e17e64bf1f84a614e647c1b015fa2576ae3312305821e1a4cb20674bb4d"
- },
- "@std/encoding@1.0.10": {
- "integrity": "8783c6384a2d13abd5e9e87a7ae0520a30e9f56aeeaa3bdf910a3eaaf5c811a1"
- },
- "@std/expect@1.0.16": {
- "integrity": "ceeef6dda21f256a5f0f083fcc0eaca175428b523359a9b1d9b3a1df11cc7391",
- "dependencies": [
- "jsr:@std/assert",
- "jsr:@std/internal@^1.0.7"
- ]
- },
- "@std/fmt@1.0.3": {
- "integrity": "97765c16aa32245ff4e2204ecf7d8562496a3cb8592340a80e7e554e0bb9149f"
- },
- "@std/fmt@1.0.8": {
- "integrity": "71e1fc498787e4434d213647a6e43e794af4fd393ef8f52062246e06f7e372b7"
- },
"@std/front-matter@1.0.9": {
"integrity": "ee6201d06674cbef137dda2252f62477450b48249e7d8d9ab57a30f85ff6f051",
"dependencies": [
@@ -223,99 +51,15 @@
"jsr:@std/yaml"
]
},
- "@std/fs@1.0.19": {
- "integrity": "051968c2b1eae4d2ea9f79a08a3845740ef6af10356aff43d3e2ef11ed09fb06",
- "dependencies": [
- "jsr:@std/internal@^1.0.9",
- "jsr:@std/path@^1.1.1"
- ]
- },
- "@std/html@1.0.4": {
- "integrity": "eff3497c08164e6ada49b7f81a28b5108087033823153d065e3f89467dd3d50e"
- },
- "@std/http@1.0.20": {
- "integrity": "b5cc33fc001bccce65ed4c51815668c9891c69ccd908295997e983d8f56070a1",
- "dependencies": [
- "jsr:@std/cli@^1.0.21",
- "jsr:@std/encoding@^1.0.10",
- "jsr:@std/fmt@^1.0.8",
- "jsr:@std/fs@^1.0.19",
- "jsr:@std/html@^1.0.4",
- "jsr:@std/media-types@^1.1.0",
- "jsr:@std/net",
- "jsr:@std/path@^1.1.1",
- "jsr:@std/streams@^1.0.10"
- ]
- },
- "@std/internal@1.0.10": {
- "integrity": "e3be62ce42cab0e177c27698e5d9800122f67b766a0bea6ca4867886cbde8cf7"
- },
- "@std/io@0.225.0": {
- "integrity": "c1db7c5e5a231629b32d64b9a53139445b2ca640d828c26bf23e1c55f8c079b3"
- },
- "@std/io@0.225.2": {
- "integrity": "3c740cd4ee4c082e6cfc86458f47e2ab7cb353dc6234d5e9b1f91a2de5f4d6c7",
- "dependencies": [
- "jsr:@std/bytes@^1.0.5"
- ]
- },
- "@std/json@1.0.2": {
- "integrity": "d9e5497801c15fb679f55a2c01c7794ad7a5dfda4dd1bebab5e409cb5e0d34d4"
- },
- "@std/jsonc@1.0.2": {
- "integrity": "909605dae3af22bd75b1cbda8d64a32cf1fd2cf6efa3f9e224aba6d22c0f44c7",
- "dependencies": [
- "jsr:@std/json"
- ]
- },
- "@std/media-types@1.1.0": {
- "integrity": "c9d093f0c05c3512932b330e3cc1fe1d627b301db33a4c2c2185c02471d6eaa4"
- },
- "@std/net@1.0.4": {
- "integrity": "2f403b455ebbccf83d8a027d29c5a9e3a2452fea39bb2da7f2c04af09c8bc852"
- },
"@std/path@1.1.0": {
"integrity": "ddc94f8e3c275627281cbc23341df6b8bcc874d70374f75fec2533521e3d6886"
},
- "@std/path@1.1.1": {
- "integrity": "fe00026bd3a7e6a27f73709b83c607798be40e20c81dde655ce34052fd82ec76",
- "dependencies": [
- "jsr:@std/internal@^1.0.9"
- ]
- },
- "@std/semver@1.0.5": {
- "integrity": "529f79e83705714c105ad0ba55bec0f9da0f24d2f726b6cc1c15e505cc2c0624"
- },
- "@std/streams@1.0.10": {
- "integrity": "75c0b1431873cd0d8b3d679015220204d36d3c7420d93b60acfc379eb0dc30af",
- "dependencies": [
- "jsr:@std/bytes@^1.0.6"
- ]
- },
- "@std/testing@1.0.15": {
- "integrity": "a490169f5ccb0f3ae9c94fbc69d2cd43603f2cffb41713a85f99bbb0e3087cbc",
- "dependencies": [
- "jsr:@std/assert",
- "jsr:@std/async@^1.0.13",
- "jsr:@std/data-structures",
- "jsr:@std/fs@^1.0.19",
- "jsr:@std/internal@^1.0.10",
- "jsr:@std/path@^1.1.1"
- ]
- },
"@std/toml@1.0.8": {
"integrity": "eb8ae76b4cc1c6c13f2a91123675823adbec2380de75cd3748c628960d952164",
"dependencies": [
"jsr:@std/collections@^1.1.1"
]
},
- "@std/uuid@1.0.9": {
- "integrity": "44b627bf2d372fe1bd099e2ad41b2be41a777fc94e62a3151006895a037f1642",
- "dependencies": [
- "jsr:@std/bytes@^1.0.6",
- "jsr:@std/crypto"
- ]
- },
"@std/yaml@1.0.8": {
"integrity": "90b8aab62995e929fa0ea5f4151c287275b63e321ac375c35ff7406ca60c169d"
},
@@ -324,9 +68,6 @@
},
"@zip-js/zip-js@2.7.62": {
"integrity": "11cbe0746fa1e52e6e0a601c89ba97365f16e38a07f139b9d9914f988aec9081"
- },
- "@zip-js/zip-js@2.7.71": {
- "integrity": "e8f66fe04b58ca6483a6dde6b185e579784729320687bd21b473aa0f37fa8796"
}
},
"npm": {
@@ -340,21 +81,141 @@
"@jridgewell/trace-mapping"
]
},
- "@emnapi/core@1.4.3": {
- "integrity": "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g==",
+ "@babel/code-frame@7.27.1": {
+ "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==",
+ "dependencies": [
+ "@babel/helper-validator-identifier",
+ "js-tokens",
+ "picocolors"
+ ]
+ },
+ "@babel/compat-data@7.28.0": {
+ "integrity": "sha512-60X7qkglvrap8mn1lh2ebxXdZYtUcpd7gsmy9kLaBJ4i/WdY8PqTSdxyA8qraikqKQK5C1KRBKXqznrVapyNaw=="
+ },
+ "@babel/core@7.28.0": {
+ "integrity": "sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ==",
+ "dependencies": [
+ "@ampproject/remapping",
+ "@babel/code-frame",
+ "@babel/generator",
+ "@babel/helper-compilation-targets",
+ "@babel/helper-module-transforms",
+ "@babel/helpers",
+ "@babel/parser",
+ "@babel/template",
+ "@babel/traverse",
+ "@babel/types",
+ "convert-source-map",
+ "debug",
+ "gensync",
+ "json5",
+ "semver"
+ ]
+ },
+ "@babel/generator@7.28.0": {
+ "integrity": "sha512-lJjzvrbEeWrhB4P3QBsH7tey117PjLZnDbLiQEKjQ/fNJTjuq4HSqgFA+UNSwZT8D7dxxbnuSBMsa1lrWzKlQg==",
+ "dependencies": [
+ "@babel/parser",
+ "@babel/types",
+ "@jridgewell/gen-mapping",
+ "@jridgewell/trace-mapping",
+ "jsesc"
+ ]
+ },
+ "@babel/helper-compilation-targets@7.27.2": {
+ "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==",
+ "dependencies": [
+ "@babel/compat-data",
+ "@babel/helper-validator-option",
+ "browserslist",
+ "lru-cache@5.1.1",
+ "semver"
+ ]
+ },
+ "@babel/helper-globals@7.28.0": {
+ "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw=="
+ },
+ "@babel/helper-module-imports@7.27.1": {
+ "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==",
+ "dependencies": [
+ "@babel/traverse",
+ "@babel/types"
+ ]
+ },
+ "@babel/helper-module-transforms@7.27.3_@babel+core@7.28.0": {
+ "integrity": "sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg==",
+ "dependencies": [
+ "@babel/core",
+ "@babel/helper-module-imports",
+ "@babel/helper-validator-identifier",
+ "@babel/traverse"
+ ]
+ },
+ "@babel/helper-string-parser@7.27.1": {
+ "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="
+ },
+ "@babel/helper-validator-identifier@7.27.1": {
+ "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow=="
+ },
+ "@babel/helper-validator-option@7.27.1": {
+ "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg=="
+ },
+ "@babel/helpers@7.28.2": {
+ "integrity": "sha512-/V9771t+EgXz62aCcyofnQhGM8DQACbRhvzKFsXKC9QM+5MadF8ZmIm0crDMaz3+o0h0zXfJnd4EhbYbxsrcFw==",
+ "dependencies": [
+ "@babel/template",
+ "@babel/types"
+ ]
+ },
+ "@babel/parser@7.28.0": {
+ "integrity": "sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g==",
+ "dependencies": [
+ "@babel/types"
+ ],
+ "bin": true
+ },
+ "@babel/template@7.27.2": {
+ "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==",
+ "dependencies": [
+ "@babel/code-frame",
+ "@babel/parser",
+ "@babel/types"
+ ]
+ },
+ "@babel/traverse@7.28.0": {
+ "integrity": "sha512-mGe7UK5wWyh0bKRfupsUchrQGqvDbZDbKJw+kcRGSmdHVYrv+ltd0pnpDTVpiTqnaBru9iEvA8pz8W46v0Amwg==",
+ "dependencies": [
+ "@babel/code-frame",
+ "@babel/generator",
+ "@babel/helper-globals",
+ "@babel/parser",
+ "@babel/template",
+ "@babel/types",
+ "debug"
+ ]
+ },
+ "@babel/types@7.28.2": {
+ "integrity": "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==",
+ "dependencies": [
+ "@babel/helper-string-parser",
+ "@babel/helper-validator-identifier"
+ ]
+ },
+ "@emnapi/core@1.4.5": {
+ "integrity": "sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==",
"dependencies": [
"@emnapi/wasi-threads",
"tslib"
]
},
- "@emnapi/runtime@1.4.3": {
- "integrity": "sha512-pBPWdu6MLKROBX05wSNKcNb++m5Er+KQ9QkB+WVM+pW2Kx9hoSrVTnu3BdkI5eBLZoKu/J6mW/B6i6bJB2ytXQ==",
+ "@emnapi/runtime@1.4.5": {
+ "integrity": "sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==",
"dependencies": [
"tslib"
]
},
- "@emnapi/wasi-threads@1.0.2": {
- "integrity": "sha512-5n3nTJblwRi8LlXkJ9eBzu+kZR8Yxcc7ubakyQTFzPMtIhFpUBRbsnc2Dv88IZDIbCDlBiWrknhB4Lsz7mg6BA==",
+ "@emnapi/wasi-threads@1.0.4": {
+ "integrity": "sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==",
"dependencies": [
"tslib"
]
@@ -379,11 +240,6 @@
"os": ["aix"],
"cpu": ["ppc64"]
},
- "@esbuild/aix-ppc64@0.25.8": {
- "integrity": "sha512-urAvrUedIqEiFR3FYSLTWQgLu5tb+m0qZw0NBEasUeo6wuqatkMDaRT+1uABiGXEu5vqgPd7FGE1BhsAIy9QVA==",
- "os": ["aix"],
- "cpu": ["ppc64"]
- },
"@esbuild/android-arm64@0.25.4": {
"integrity": "sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A==",
"os": ["android"],
@@ -404,11 +260,6 @@
"os": ["android"],
"cpu": ["arm64"]
},
- "@esbuild/android-arm64@0.25.8": {
- "integrity": "sha512-OD3p7LYzWpLhZEyATcTSJ67qB5D+20vbtr6vHlHWSQYhKtzUYrETuWThmzFpZtFsBIxRvhO07+UgVA9m0i/O1w==",
- "os": ["android"],
- "cpu": ["arm64"]
- },
"@esbuild/android-arm@0.25.4": {
"integrity": "sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ==",
"os": ["android"],
@@ -429,11 +280,6 @@
"os": ["android"],
"cpu": ["arm"]
},
- "@esbuild/android-arm@0.25.8": {
- "integrity": "sha512-RONsAvGCz5oWyePVnLdZY/HHwA++nxYWIX1atInlaW6SEkwq6XkP3+cb825EUcRs5Vss/lGh/2YxAb5xqc07Uw==",
- "os": ["android"],
- "cpu": ["arm"]
- },
"@esbuild/android-x64@0.25.4": {
"integrity": "sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ==",
"os": ["android"],
@@ -454,11 +300,6 @@
"os": ["android"],
"cpu": ["x64"]
},
- "@esbuild/android-x64@0.25.8": {
- "integrity": "sha512-yJAVPklM5+4+9dTeKwHOaA+LQkmrKFX96BM0A/2zQrbS6ENCmxc4OVoBs5dPkCCak2roAD+jKCdnmOqKszPkjA==",
- "os": ["android"],
- "cpu": ["x64"]
- },
"@esbuild/darwin-arm64@0.25.4": {
"integrity": "sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g==",
"os": ["darwin"],
@@ -479,11 +320,6 @@
"os": ["darwin"],
"cpu": ["arm64"]
},
- "@esbuild/darwin-arm64@0.25.8": {
- "integrity": "sha512-Jw0mxgIaYX6R8ODrdkLLPwBqHTtYHJSmzzd+QeytSugzQ0Vg4c5rDky5VgkoowbZQahCbsv1rT1KW72MPIkevw==",
- "os": ["darwin"],
- "cpu": ["arm64"]
- },
"@esbuild/darwin-x64@0.25.4": {
"integrity": "sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A==",
"os": ["darwin"],
@@ -504,11 +340,6 @@
"os": ["darwin"],
"cpu": ["x64"]
},
- "@esbuild/darwin-x64@0.25.8": {
- "integrity": "sha512-Vh2gLxxHnuoQ+GjPNvDSDRpoBCUzY4Pu0kBqMBDlK4fuWbKgGtmDIeEC081xi26PPjn+1tct+Bh8FjyLlw1Zlg==",
- "os": ["darwin"],
- "cpu": ["x64"]
- },
"@esbuild/freebsd-arm64@0.25.4": {
"integrity": "sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ==",
"os": ["freebsd"],
@@ -529,11 +360,6 @@
"os": ["freebsd"],
"cpu": ["arm64"]
},
- "@esbuild/freebsd-arm64@0.25.8": {
- "integrity": "sha512-YPJ7hDQ9DnNe5vxOm6jaie9QsTwcKedPvizTVlqWG9GBSq+BuyWEDazlGaDTC5NGU4QJd666V0yqCBL2oWKPfA==",
- "os": ["freebsd"],
- "cpu": ["arm64"]
- },
"@esbuild/freebsd-x64@0.25.4": {
"integrity": "sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ==",
"os": ["freebsd"],
@@ -554,11 +380,6 @@
"os": ["freebsd"],
"cpu": ["x64"]
},
- "@esbuild/freebsd-x64@0.25.8": {
- "integrity": "sha512-MmaEXxQRdXNFsRN/KcIimLnSJrk2r5H8v+WVafRWz5xdSVmWLoITZQXcgehI2ZE6gioE6HirAEToM/RvFBeuhw==",
- "os": ["freebsd"],
- "cpu": ["x64"]
- },
"@esbuild/linux-arm64@0.25.4": {
"integrity": "sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ==",
"os": ["linux"],
@@ -579,11 +400,6 @@
"os": ["linux"],
"cpu": ["arm64"]
},
- "@esbuild/linux-arm64@0.25.8": {
- "integrity": "sha512-WIgg00ARWv/uYLU7lsuDK00d/hHSfES5BzdWAdAig1ioV5kaFNrtK8EqGcUBJhYqotlUByUKz5Qo6u8tt7iD/w==",
- "os": ["linux"],
- "cpu": ["arm64"]
- },
"@esbuild/linux-arm@0.25.4": {
"integrity": "sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ==",
"os": ["linux"],
@@ -604,11 +420,6 @@
"os": ["linux"],
"cpu": ["arm"]
},
- "@esbuild/linux-arm@0.25.8": {
- "integrity": "sha512-FuzEP9BixzZohl1kLf76KEVOsxtIBFwCaLupVuk4eFVnOZfU+Wsn+x5Ryam7nILV2pkq2TqQM9EZPsOBuMC+kg==",
- "os": ["linux"],
- "cpu": ["arm"]
- },
"@esbuild/linux-ia32@0.25.4": {
"integrity": "sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ==",
"os": ["linux"],
@@ -629,11 +440,6 @@
"os": ["linux"],
"cpu": ["ia32"]
},
- "@esbuild/linux-ia32@0.25.8": {
- "integrity": "sha512-A1D9YzRX1i+1AJZuFFUMP1E9fMaYY+GnSQil9Tlw05utlE86EKTUA7RjwHDkEitmLYiFsRd9HwKBPEftNdBfjg==",
- "os": ["linux"],
- "cpu": ["ia32"]
- },
"@esbuild/linux-loong64@0.25.4": {
"integrity": "sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA==",
"os": ["linux"],
@@ -654,11 +460,6 @@
"os": ["linux"],
"cpu": ["loong64"]
},
- "@esbuild/linux-loong64@0.25.8": {
- "integrity": "sha512-O7k1J/dwHkY1RMVvglFHl1HzutGEFFZ3kNiDMSOyUrB7WcoHGf96Sh+64nTRT26l3GMbCW01Ekh/ThKM5iI7hQ==",
- "os": ["linux"],
- "cpu": ["loong64"]
- },
"@esbuild/linux-mips64el@0.25.4": {
"integrity": "sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg==",
"os": ["linux"],
@@ -679,11 +480,6 @@
"os": ["linux"],
"cpu": ["mips64el"]
},
- "@esbuild/linux-mips64el@0.25.8": {
- "integrity": "sha512-uv+dqfRazte3BzfMp8PAQXmdGHQt2oC/y2ovwpTteqrMx2lwaksiFZ/bdkXJC19ttTvNXBuWH53zy/aTj1FgGw==",
- "os": ["linux"],
- "cpu": ["mips64el"]
- },
"@esbuild/linux-ppc64@0.25.4": {
"integrity": "sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag==",
"os": ["linux"],
@@ -704,11 +500,6 @@
"os": ["linux"],
"cpu": ["ppc64"]
},
- "@esbuild/linux-ppc64@0.25.8": {
- "integrity": "sha512-GyG0KcMi1GBavP5JgAkkstMGyMholMDybAf8wF5A70CALlDM2p/f7YFE7H92eDeH/VBtFJA5MT4nRPDGg4JuzQ==",
- "os": ["linux"],
- "cpu": ["ppc64"]
- },
"@esbuild/linux-riscv64@0.25.4": {
"integrity": "sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA==",
"os": ["linux"],
@@ -729,11 +520,6 @@
"os": ["linux"],
"cpu": ["riscv64"]
},
- "@esbuild/linux-riscv64@0.25.8": {
- "integrity": "sha512-rAqDYFv3yzMrq7GIcen3XP7TUEG/4LK86LUPMIz6RT8A6pRIDn0sDcvjudVZBiiTcZCY9y2SgYX2lgK3AF+1eg==",
- "os": ["linux"],
- "cpu": ["riscv64"]
- },
"@esbuild/linux-s390x@0.25.4": {
"integrity": "sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g==",
"os": ["linux"],
@@ -754,11 +540,6 @@
"os": ["linux"],
"cpu": ["s390x"]
},
- "@esbuild/linux-s390x@0.25.8": {
- "integrity": "sha512-Xutvh6VjlbcHpsIIbwY8GVRbwoviWT19tFhgdA7DlenLGC/mbc3lBoVb7jxj9Z+eyGqvcnSyIltYUrkKzWqSvg==",
- "os": ["linux"],
- "cpu": ["s390x"]
- },
"@esbuild/linux-x64@0.25.4": {
"integrity": "sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA==",
"os": ["linux"],
@@ -779,11 +560,6 @@
"os": ["linux"],
"cpu": ["x64"]
},
- "@esbuild/linux-x64@0.25.8": {
- "integrity": "sha512-ASFQhgY4ElXh3nDcOMTkQero4b1lgubskNlhIfJrsH5OKZXDpUAKBlNS0Kx81jwOBp+HCeZqmoJuihTv57/jvQ==",
- "os": ["linux"],
- "cpu": ["x64"]
- },
"@esbuild/netbsd-arm64@0.25.4": {
"integrity": "sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ==",
"os": ["netbsd"],
@@ -804,11 +580,6 @@
"os": ["netbsd"],
"cpu": ["arm64"]
},
- "@esbuild/netbsd-arm64@0.25.8": {
- "integrity": "sha512-d1KfruIeohqAi6SA+gENMuObDbEjn22olAR7egqnkCD9DGBG0wsEARotkLgXDu6c4ncgWTZJtN5vcgxzWRMzcw==",
- "os": ["netbsd"],
- "cpu": ["arm64"]
- },
"@esbuild/netbsd-x64@0.25.4": {
"integrity": "sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw==",
"os": ["netbsd"],
@@ -829,11 +600,6 @@
"os": ["netbsd"],
"cpu": ["x64"]
},
- "@esbuild/netbsd-x64@0.25.8": {
- "integrity": "sha512-nVDCkrvx2ua+XQNyfrujIG38+YGyuy2Ru9kKVNyh5jAys6n+l44tTtToqHjino2My8VAY6Lw9H7RI73XFi66Cg==",
- "os": ["netbsd"],
- "cpu": ["x64"]
- },
"@esbuild/openbsd-arm64@0.25.4": {
"integrity": "sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A==",
"os": ["openbsd"],
@@ -854,11 +620,6 @@
"os": ["openbsd"],
"cpu": ["arm64"]
},
- "@esbuild/openbsd-arm64@0.25.8": {
- "integrity": "sha512-j8HgrDuSJFAujkivSMSfPQSAa5Fxbvk4rgNAS5i3K+r8s1X0p1uOO2Hl2xNsGFppOeHOLAVgYwDVlmxhq5h+SQ==",
- "os": ["openbsd"],
- "cpu": ["arm64"]
- },
"@esbuild/openbsd-x64@0.25.4": {
"integrity": "sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw==",
"os": ["openbsd"],
@@ -879,11 +640,6 @@
"os": ["openbsd"],
"cpu": ["x64"]
},
- "@esbuild/openbsd-x64@0.25.8": {
- "integrity": "sha512-1h8MUAwa0VhNCDp6Af0HToI2TJFAn1uqT9Al6DJVzdIBAd21m/G0Yfc77KDM3uF3T/YaOgQq3qTJHPbTOInaIQ==",
- "os": ["openbsd"],
- "cpu": ["x64"]
- },
"@esbuild/openharmony-arm64@0.25.6": {
"integrity": "sha512-+SqBcAWoB1fYKmpWoQP4pGtx+pUUC//RNYhFdbcSA16617cchuryuhOCRpPsjCblKukAckWsV+aQ3UKT/RMPcA==",
"os": ["openharmony"],
@@ -894,11 +650,6 @@
"os": ["openharmony"],
"cpu": ["arm64"]
},
- "@esbuild/openharmony-arm64@0.25.8": {
- "integrity": "sha512-r2nVa5SIK9tSWd0kJd9HCffnDHKchTGikb//9c7HX+r+wHYCpQrSgxhlY6KWV1nFo1l4KFbsMlHk+L6fekLsUg==",
- "os": ["openharmony"],
- "cpu": ["arm64"]
- },
"@esbuild/sunos-x64@0.25.4": {
"integrity": "sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q==",
"os": ["sunos"],
@@ -919,11 +670,6 @@
"os": ["sunos"],
"cpu": ["x64"]
},
- "@esbuild/sunos-x64@0.25.8": {
- "integrity": "sha512-zUlaP2S12YhQ2UzUfcCuMDHQFJyKABkAjvO5YSndMiIkMimPmxA+BYSBikWgsRpvyxuRnow4nS5NPnf9fpv41w==",
- "os": ["sunos"],
- "cpu": ["x64"]
- },
"@esbuild/win32-arm64@0.25.4": {
"integrity": "sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ==",
"os": ["win32"],
@@ -944,11 +690,6 @@
"os": ["win32"],
"cpu": ["arm64"]
},
- "@esbuild/win32-arm64@0.25.8": {
- "integrity": "sha512-YEGFFWESlPva8hGL+zvj2z/SaK+pH0SwOM0Nc/d+rVnW7GSTFlLBGzZkuSU9kFIGIo8q9X3ucpZhu8PDN5A2sQ==",
- "os": ["win32"],
- "cpu": ["arm64"]
- },
"@esbuild/win32-ia32@0.25.4": {
"integrity": "sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg==",
"os": ["win32"],
@@ -969,11 +710,6 @@
"os": ["win32"],
"cpu": ["ia32"]
},
- "@esbuild/win32-ia32@0.25.8": {
- "integrity": "sha512-hiGgGC6KZ5LZz58OL/+qVVoZiuZlUYlYHNAmczOm7bs2oE1XriPFi5ZHHrS8ACpV5EjySrnoCKmcbQMN+ojnHg==",
- "os": ["win32"],
- "cpu": ["ia32"]
- },
"@esbuild/win32-x64@0.25.4": {
"integrity": "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ==",
"os": ["win32"],
@@ -994,11 +730,6 @@
"os": ["win32"],
"cpu": ["x64"]
},
- "@esbuild/win32-x64@0.25.8": {
- "integrity": "sha512-cn3Yr7+OaaZq1c+2pe+8yxC8E144SReCQjN6/2ynubzYjvyqZjTXfQJpAcQpsdJq3My7XADANiYGHoFC69pLQw==",
- "os": ["win32"],
- "cpu": ["x64"]
- },
"@isaacs/balanced-match@4.0.1": {
"integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ=="
},
@@ -1025,8 +756,8 @@
"minipass"
]
},
- "@jridgewell/gen-mapping@0.3.10": {
- "integrity": "sha512-HM2F4B9N4cA0RH2KQiIZOHAZqtP4xGS4IZ+SFe1SIbO4dyjf9MTY2Bo3vHYnm0hglWfXqBrzUBSa+cJfl3Xvrg==",
+ "@jridgewell/gen-mapping@0.3.12": {
+ "integrity": "sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==",
"dependencies": [
"@jridgewell/sourcemap-codec",
"@jridgewell/trace-mapping"
@@ -1035,22 +766,22 @@
"@jridgewell/resolve-uri@3.1.2": {
"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="
},
- "@jridgewell/sourcemap-codec@1.5.2": {
- "integrity": "sha512-gKYheCylLIedI+CSZoDtGkFV9YEBxRRVcfCH7OfAqh4TyUyRjEE6WVE/aXDXX0p8BIe/QgLcaAoI0220KRRFgg=="
+ "@jridgewell/sourcemap-codec@1.5.4": {
+ "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw=="
},
- "@jridgewell/trace-mapping@0.3.27": {
- "integrity": "sha512-VO95AxtSFMelbg3ouljAYnfvTEwSWVt/2YLf+U5Ejd8iT5mXE2Sa/1LGyvySMne2CGsepGLI7KpF3EzE3Aq9Mg==",
+ "@jridgewell/trace-mapping@0.3.29": {
+ "integrity": "sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==",
"dependencies": [
"@jridgewell/resolve-uri",
"@jridgewell/sourcemap-codec"
]
},
- "@napi-rs/wasm-runtime@0.2.11": {
- "integrity": "sha512-9DPkXtvHydrcOsopiYpUgPHpmj0HWZKMUnL2dZqpvC42lsratuBG06V5ipyno0fUek5VlFsNQ+AcFATSrJXgMA==",
+ "@napi-rs/wasm-runtime@0.2.12": {
+ "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==",
"dependencies": [
"@emnapi/core",
"@emnapi/runtime",
- "@tybys/wasm-util"
+ "@tybys/wasm-util@0.10.0"
]
},
"@nodelib/fs.scandir@2.1.5": {
@@ -1076,16 +807,12 @@
"@pkgjs/parseargs@0.11.0": {
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg=="
},
+ "@polka/url@1.0.0-next.29": {
+ "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww=="
+ },
"@preact/signals-core@1.11.0": {
"integrity": "sha512-jglbibeWHuFRzEWVFY/TT7wB1PppJxmcSfUHcK+2J9vBRtiooMfw6tAPttojNYrrpdGViqAYCbPpmWYlMm+eMQ=="
},
- "@preact/signals@1.3.2_preact@10.27.0": {
- "integrity": "sha512-naxcJgUJ6BTOROJ7C3QML7KvwKwCXQJYTc5L/b0eEsdYgPB6SxwoQ1vDGcS0Q7GVjAenVq/tXrybVdFShHYZWg==",
- "dependencies": [
- "@preact/signals-core",
- "preact"
- ]
- },
"@preact/signals@2.2.1_preact@10.27.0": {
"integrity": "sha512-cX3mijdjHbbz3dBoJ6z687CGYEOp9ifj3uFnm4UKW+DxXKPMvE2y/VSdm0PXhXmHnr6F0iSnDJ+dLwmV7CYT5A==",
"dependencies": [
@@ -1093,6 +820,49 @@
"preact"
]
},
+ "@prefresh/babel-plugin@0.5.2": {
+ "integrity": "sha512-AOl4HG6dAxWkJ5ndPHBgBa49oo/9bOiJuRDKHLSTyH+Fd9x00shTXpdiTj1W41l6oQIwUOAgJeHMn4QwIDpHkA=="
+ },
+ "@prefresh/core@1.5.5_preact@10.27.0": {
+ "integrity": "sha512-H6GTXUl4V4fe3ijz7yhSa/mZ+pGSOh7XaJb6uP/sQsagBx9yl0D1HKDaeoMQA8Ad2Xm27LqvbitMGSdY9UFSKQ==",
+ "dependencies": [
+ "preact"
+ ]
+ },
+ "@prefresh/utils@1.2.1": {
+ "integrity": "sha512-vq/sIuN5nYfYzvyayXI4C2QkprfNaHUQ9ZX+3xLD8nL3rWyzpxOm1+K7RtMbhd+66QcaISViK7amjnheQ/4WZw=="
+ },
+ "@prefresh/vite@2.4.8_preact@10.27.0_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0": {
+ "integrity": "sha512-H7vlo9UbJInuRbZhRQrdgVqLP7qKjDoX7TgYWWwIVhEHeHO0hZ4zyicvwBrV1wX5A3EPOmArgRkUaN7cPI2VXQ==",
+ "dependencies": [
+ "@babel/core",
+ "@prefresh/babel-plugin",
+ "@prefresh/core",
+ "@prefresh/utils",
+ "@rollup/pluginutils",
+ "preact",
+ "vite@7.0.6_@types+node@24.1.0_picomatch@4.0.3"
+ ]
+ },
+ "@prefresh/vite@2.4.8_preact@10.27.0_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0_@types+node@22.15.15": {
+ "integrity": "sha512-H7vlo9UbJInuRbZhRQrdgVqLP7qKjDoX7TgYWWwIVhEHeHO0hZ4zyicvwBrV1wX5A3EPOmArgRkUaN7cPI2VXQ==",
+ "dependencies": [
+ "@babel/core",
+ "@prefresh/babel-plugin",
+ "@prefresh/core",
+ "@prefresh/utils",
+ "@rollup/pluginutils",
+ "preact",
+ "vite@7.0.6_@types+node@24.1.0_picomatch@4.0.3_@types+node@22.15.15"
+ ]
+ },
+ "@rollup/pluginutils@4.2.1": {
+ "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==",
+ "dependencies": [
+ "estree-walker",
+ "picomatch@2.3.1"
+ ]
+ },
"@rollup/rollup-android-arm-eabi@4.46.2": {
"integrity": "sha512-Zj3Hl6sN34xJtMv7Anwb5Gu01yujyE/cLBDB2gnHTAHaWS1Z38L7kuSG+oAh0giZMqG060f/YBStXtMH6FvPMA==",
"os": ["android"],
@@ -1198,7 +968,7 @@
"dependencies": [
"@ampproject/remapping",
"enhanced-resolve",
- "jiti@2.4.2",
+ "jiti@2.5.1",
"lightningcss",
"magic-string",
"source-map-js",
@@ -1257,7 +1027,7 @@
"@emnapi/runtime",
"@emnapi/wasi-threads",
"@napi-rs/wasm-runtime",
- "@tybys/wasm-util",
+ "@tybys/wasm-util@0.9.0",
"tslib"
],
"cpu": ["wasm32"]
@@ -1315,6 +1085,12 @@
"path-browserify"
]
},
+ "@tybys/wasm-util@0.10.0": {
+ "integrity": "sha512-VyyPYFlOMNylG45GoAe0xDoLwWuowvf92F9kySqzYh8vmYm7D2u4iUJKa1tOUpS70Ku13ASrOkS4ScXFsTaCNQ==",
+ "dependencies": [
+ "tslib"
+ ]
+ },
"@tybys/wasm-util@0.9.0": {
"integrity": "sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==",
"dependencies": [
@@ -1327,7 +1103,13 @@
"@types/node@22.15.15": {
"integrity": "sha512-R5muMcZob3/Jjchn5LcO8jdKwSCbzqmPB6ruBxMcf9kbxtniZHP327s6C37iOfuw8mbKK3cAQa7sEl7afLrQ8A==",
"dependencies": [
- "undici-types"
+ "undici-types@6.21.0"
+ ]
+ },
+ "@types/node@24.1.0": {
+ "integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==",
+ "dependencies": [
+ "undici-types@7.8.0"
]
},
"ansi-regex@5.0.1": {
@@ -1345,6 +1127,9 @@
"ansi-styles@6.2.1": {
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug=="
},
+ "ansis@4.1.0": {
+ "integrity": "sha512-BGcItUBWSMRgOCe+SVZJ+S7yTRG0eGt9cXAHev72yuGcY23hnLA7Bky5L/xLyPINoSN95geovfBkqoTlNZYa7w=="
+ },
"any-promise@1.3.0": {
"integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A=="
},
@@ -1377,6 +1162,9 @@
"binary-extensions@2.3.0": {
"integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw=="
},
+ "birpc@2.5.0": {
+ "integrity": "sha512-VSWO/W6nNQdyP520F1mhf+Lc2f8pjGQOtoHHm7Ze8Go1kX7akpVIrtTa0fn+HB0QJEDVacl6aO08YE0PgXfdnQ=="
+ },
"boolbase@1.0.0": {
"integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="
},
@@ -1402,6 +1190,12 @@
],
"bin": true
},
+ "bundle-name@4.1.0": {
+ "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==",
+ "dependencies": [
+ "run-applescript"
+ ]
+ },
"camelcase-css@2.0.1": {
"integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA=="
},
@@ -1414,8 +1208,8 @@
"lodash.uniq"
]
},
- "caniuse-lite@1.0.30001727": {
- "integrity": "sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q=="
+ "caniuse-lite@1.0.30001731": {
+ "integrity": "sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg=="
},
"chokidar@3.6.0": {
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
@@ -1456,6 +1250,9 @@
"commander@7.2.0": {
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="
},
+ "convert-source-map@2.0.0": {
+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="
+ },
"cross-spawn@7.0.6": {
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dependencies": [
@@ -1560,6 +1357,25 @@
"cssom@0.5.0": {
"integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw=="
},
+ "debug@4.4.1": {
+ "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
+ "dependencies": [
+ "ms"
+ ]
+ },
+ "default-browser-id@5.0.0": {
+ "integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA=="
+ },
+ "default-browser@5.2.1": {
+ "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==",
+ "dependencies": [
+ "bundle-name",
+ "default-browser-id"
+ ]
+ },
+ "define-lazy-prop@3.0.0": {
+ "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg=="
+ },
"detect-libc@2.0.4": {
"integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA=="
},
@@ -1597,8 +1413,8 @@
"eastasianwidth@0.2.0": {
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
},
- "electron-to-chromium@1.5.190": {
- "integrity": "sha512-k4McmnB2091YIsdCgkS0fMVMPOJgxl93ltFzaryXqwip1AaxeDqKCGLxkXODDA5Ab/D+tV5EL5+aTx76RvLRxw=="
+ "electron-to-chromium@1.5.192": {
+ "integrity": "sha512-rP8Ez0w7UNw/9j5eSXCe10o1g/8B1P5SM90PCCMVkIRQn2R0LEHWz4Eh9RnxkniuDe1W0cTSOB3MLlkTGDcuCg=="
},
"emoji-regex@8.0.0": {
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
@@ -1619,14 +1435,13 @@
"entities@6.0.1": {
"integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="
},
+ "error-stack-parser-es@1.0.5": {
+ "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA=="
+ },
"esbuild-wasm@0.25.7": {
"integrity": "sha512-x3t1BlU59YOMtpwzayHxF4LPVujOvNKqm7y6jPvFKC13J8FmJRCdHPJwHq86er7ik+f7uwGcMbe+6KVzLGmsGw==",
"bin": true
},
- "esbuild-wasm@0.25.8": {
- "integrity": "sha512-VFUDMoZdf/NsyCepv5heZqvNLYj9HL+xEKG5tktsFbx+shR8Dt9MchKBEdu/5the2RfTzgxkO6B/nUfzmsWN9Q==",
- "bin": true
- },
"esbuild@0.25.7": {
"integrity": "sha512-daJB0q2dmTzo90L9NjRaohhRWrCzYxWNFTjEi72/h+p5DcY3yn4MacWfDakHmaBaDzDiuLJsCh0+6LK/iX+c+Q==",
"optionalDependencies": [
@@ -1660,42 +1475,12 @@
"scripts": true,
"bin": true
},
- "esbuild@0.25.8": {
- "integrity": "sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q==",
- "optionalDependencies": [
- "@esbuild/aix-ppc64@0.25.8",
- "@esbuild/android-arm@0.25.8",
- "@esbuild/android-arm64@0.25.8",
- "@esbuild/android-x64@0.25.8",
- "@esbuild/darwin-arm64@0.25.8",
- "@esbuild/darwin-x64@0.25.8",
- "@esbuild/freebsd-arm64@0.25.8",
- "@esbuild/freebsd-x64@0.25.8",
- "@esbuild/linux-arm@0.25.8",
- "@esbuild/linux-arm64@0.25.8",
- "@esbuild/linux-ia32@0.25.8",
- "@esbuild/linux-loong64@0.25.8",
- "@esbuild/linux-mips64el@0.25.8",
- "@esbuild/linux-ppc64@0.25.8",
- "@esbuild/linux-riscv64@0.25.8",
- "@esbuild/linux-s390x@0.25.8",
- "@esbuild/linux-x64@0.25.8",
- "@esbuild/netbsd-arm64@0.25.8",
- "@esbuild/netbsd-x64@0.25.8",
- "@esbuild/openbsd-arm64@0.25.8",
- "@esbuild/openbsd-x64@0.25.8",
- "@esbuild/openharmony-arm64@0.25.8",
- "@esbuild/sunos-x64@0.25.8",
- "@esbuild/win32-arm64@0.25.8",
- "@esbuild/win32-ia32@0.25.8",
- "@esbuild/win32-x64@0.25.8"
- ],
- "scripts": true,
- "bin": true
- },
"escalade@3.2.0": {
"integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="
},
+ "estree-walker@2.0.2": {
+ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
+ },
"fast-glob@3.3.3": {
"integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
"dependencies": [
@@ -1748,6 +1533,9 @@
"function-bind@1.1.2": {
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="
},
+ "gensync@1.0.0-beta.2": {
+ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="
+ },
"github-slugger@2.0.0": {
"integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw=="
},
@@ -1808,6 +1596,10 @@
"hasown"
]
},
+ "is-docker@3.0.0": {
+ "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==",
+ "bin": true
+ },
"is-extglob@2.1.1": {
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="
},
@@ -1820,9 +1612,22 @@
"is-extglob"
]
},
+ "is-inside-container@1.0.0": {
+ "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==",
+ "dependencies": [
+ "is-docker"
+ ],
+ "bin": true
+ },
"is-number@7.0.0": {
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="
},
+ "is-wsl@3.1.0": {
+ "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==",
+ "dependencies": [
+ "is-inside-container"
+ ]
+ },
"isexe@2.0.0": {
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="
},
@@ -1839,8 +1644,19 @@
"integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==",
"bin": true
},
- "jiti@2.4.2": {
- "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==",
+ "jiti@2.5.1": {
+ "integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==",
+ "bin": true
+ },
+ "js-tokens@4.0.0": {
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
+ },
+ "jsesc@3.1.0": {
+ "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
+ "bin": true
+ },
+ "json5@2.2.3": {
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"bin": true
},
"lightningcss-darwin-arm64@1.30.1": {
@@ -1936,6 +1752,12 @@
"lru-cache@10.4.3": {
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="
},
+ "lru-cache@5.1.1": {
+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
+ "dependencies": [
+ "yallist@3.1.1"
+ ]
+ },
"magic-string@0.30.17": {
"integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==",
"dependencies": [
@@ -1993,6 +1815,12 @@
"integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==",
"bin": true
},
+ "mrmime@2.0.1": {
+ "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ=="
+ },
+ "ms@2.1.3": {
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
+ },
"mz@2.7.0": {
"integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==",
"dependencies": [
@@ -2026,6 +1854,18 @@
"object-hash@3.0.0": {
"integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw=="
},
+ "ohash@2.0.11": {
+ "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ=="
+ },
+ "open@10.2.0": {
+ "integrity": "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==",
+ "dependencies": [
+ "default-browser",
+ "define-lazy-prop",
+ "is-inside-container",
+ "wsl-utils"
+ ]
+ },
"package-json-from-dist@1.0.1": {
"integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw=="
},
@@ -2041,10 +1881,16 @@
"path-scurry@1.11.1": {
"integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
"dependencies": [
- "lru-cache",
+ "lru-cache@10.4.3",
"minipass"
]
},
+ "pathe@2.0.3": {
+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="
+ },
+ "perfect-debounce@1.0.0": {
+ "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA=="
+ },
"picocolors@1.1.1": {
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="
},
@@ -2382,12 +2228,19 @@
],
"bin": true
},
+ "run-applescript@7.0.0": {
+ "integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A=="
+ },
"run-parallel@1.2.0": {
"integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
"dependencies": [
"queue-microtask"
]
},
+ "semver@6.3.1": {
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "bin": true
+ },
"shebang-command@2.0.0": {
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dependencies": [
@@ -2400,6 +2253,14 @@
"signal-exit@4.1.0": {
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="
},
+ "sirv@3.0.1": {
+ "integrity": "sha512-FoqMu0NCGBLCcAkS1qA+XJIQTR6/JHfQXl+uGteNCQ76T91DMUjPa9xfmeqMY3z80nLSg9yQmNjK0Px6RWsH/A==",
+ "dependencies": [
+ "@polka/url",
+ "mrmime",
+ "totalist"
+ ]
+ },
"source-map-js@1.2.1": {
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="
},
@@ -2510,7 +2371,7 @@
"minipass",
"minizlib",
"mkdirp",
- "yallist"
+ "yallist@5.0.0"
]
},
"thenify-all@1.6.0": {
@@ -2538,6 +2399,9 @@
"is-number"
]
},
+ "totalist@3.0.1": {
+ "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ=="
+ },
"ts-interface-checker@0.1.13": {
"integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="
},
@@ -2557,6 +2421,16 @@
"undici-types@6.21.0": {
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="
},
+ "undici-types@7.8.0": {
+ "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="
+ },
+ "unplugin-utils@0.2.4": {
+ "integrity": "sha512-8U/MtpkPkkk3Atewj1+RcKIjb5WBimZ/WSLhhR3w6SsIj8XJuKTacSP8g+2JhfSGw0Cb125Y+2zA/IzJZDVbhA==",
+ "dependencies": [
+ "pathe",
+ "picomatch@4.0.3"
+ ]
+ },
"update-browserslist-db@1.1.3_browserslist@4.25.1": {
"integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==",
"dependencies": [
@@ -2569,11 +2443,69 @@
"util-deprecate@1.0.2": {
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
},
- "vite@7.0.6_@types+node@22.15.15_picomatch@4.0.3": {
+ "vite-dev-rpc@1.1.0_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0": {
+ "integrity": "sha512-pKXZlgoXGoE8sEKiKJSng4hI1sQ4wi5YT24FCrwrLt6opmkjlqPPVmiPWWJn8M8byMxRGzp1CrFuqQs4M/Z39A==",
+ "dependencies": [
+ "birpc",
+ "vite@7.0.6_@types+node@24.1.0_picomatch@4.0.3",
+ "vite-hot-client@2.1.0_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0"
+ ]
+ },
+ "vite-dev-rpc@1.1.0_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0_@types+node@22.15.15": {
+ "integrity": "sha512-pKXZlgoXGoE8sEKiKJSng4hI1sQ4wi5YT24FCrwrLt6opmkjlqPPVmiPWWJn8M8byMxRGzp1CrFuqQs4M/Z39A==",
+ "dependencies": [
+ "birpc",
+ "vite@7.0.6_@types+node@24.1.0_picomatch@4.0.3_@types+node@22.15.15",
+ "vite-hot-client@2.1.0_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0_@types+node@22.15.15"
+ ]
+ },
+ "vite-hot-client@2.1.0_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0": {
+ "integrity": "sha512-7SpgZmU7R+dDnSmvXE1mfDtnHLHQSisdySVR7lO8ceAXvM0otZeuQQ6C8LrS5d/aYyP/QZ0hI0L+dIPrm4YlFQ==",
+ "dependencies": [
+ "vite@7.0.6_@types+node@24.1.0_picomatch@4.0.3"
+ ]
+ },
+ "vite-hot-client@2.1.0_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0_@types+node@22.15.15": {
+ "integrity": "sha512-7SpgZmU7R+dDnSmvXE1mfDtnHLHQSisdySVR7lO8ceAXvM0otZeuQQ6C8LrS5d/aYyP/QZ0hI0L+dIPrm4YlFQ==",
+ "dependencies": [
+ "vite@7.0.6_@types+node@24.1.0_picomatch@4.0.3_@types+node@22.15.15"
+ ]
+ },
+ "vite-plugin-inspect@11.3.2_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0": {
+ "integrity": "sha512-nzwvyFQg58XSMAmKVLr2uekAxNYvAbz1lyPmCAFVIBncCgN9S/HPM+2UM9Q9cvc4JEbC5ZBgwLAdaE2onmQuKg==",
+ "dependencies": [
+ "ansis",
+ "debug",
+ "error-stack-parser-es",
+ "ohash",
+ "open",
+ "perfect-debounce",
+ "sirv",
+ "unplugin-utils",
+ "vite@7.0.6_@types+node@24.1.0_picomatch@4.0.3",
+ "vite-dev-rpc@1.1.0_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0"
+ ]
+ },
+ "vite-plugin-inspect@11.3.2_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0_@types+node@22.15.15": {
+ "integrity": "sha512-nzwvyFQg58XSMAmKVLr2uekAxNYvAbz1lyPmCAFVIBncCgN9S/HPM+2UM9Q9cvc4JEbC5ZBgwLAdaE2onmQuKg==",
+ "dependencies": [
+ "ansis",
+ "debug",
+ "error-stack-parser-es",
+ "ohash",
+ "open",
+ "perfect-debounce",
+ "sirv",
+ "unplugin-utils",
+ "vite@7.0.6_@types+node@24.1.0_picomatch@4.0.3_@types+node@22.15.15",
+ "vite-dev-rpc@1.1.0_vite@7.0.6__@types+node@24.1.0__picomatch@4.0.3_@types+node@24.1.0_@types+node@22.15.15"
+ ]
+ },
+ "vite@7.0.6_@types+node@24.1.0_picomatch@4.0.3": {
"integrity": "sha512-MHFiOENNBd+Bd9uvc8GEsIzdkn1JxMmEeYX35tI3fv0sJBUTfW5tQsoaOwuY4KhBI09A3dUJ/DXf2yxPVPUceg==",
"dependencies": [
- "@types/node",
- "esbuild@0.25.8",
+ "@types/node@24.1.0",
+ "esbuild",
"fdir",
"picomatch@4.0.3",
"postcss",
@@ -2584,7 +2516,26 @@
"fsevents"
],
"optionalPeers": [
- "@types/node"
+ "@types/node@24.1.0"
+ ],
+ "bin": true
+ },
+ "vite@7.0.6_@types+node@24.1.0_picomatch@4.0.3_@types+node@22.15.15": {
+ "integrity": "sha512-MHFiOENNBd+Bd9uvc8GEsIzdkn1JxMmEeYX35tI3fv0sJBUTfW5tQsoaOwuY4KhBI09A3dUJ/DXf2yxPVPUceg==",
+ "dependencies": [
+ "@types/node@22.15.15",
+ "esbuild",
+ "fdir",
+ "picomatch@4.0.3",
+ "postcss",
+ "rollup",
+ "tinyglobby"
+ ],
+ "optionalDependencies": [
+ "fsevents"
+ ],
+ "optionalPeers": [
+ "@types/node@22.15.15"
],
"bin": true
},
@@ -2611,6 +2562,15 @@
"strip-ansi@7.1.0"
]
},
+ "wsl-utils@0.1.0": {
+ "integrity": "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==",
+ "dependencies": [
+ "is-wsl"
+ ]
+ },
+ "yallist@3.1.1": {
+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
+ },
"yallist@5.0.0": {
"integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw=="
},
@@ -2728,6 +2688,16 @@
"npm:postcss@^8.5.6",
"npm:tailwindcss@^3.4.17"
]
+ },
+ "plugin-vite": {
+ "dependencies": [
+ "jsr:@deno/loader@~0.3.2",
+ "npm:@prefresh/vite@^2.4.8",
+ "npm:@types/node@^24.1.0",
+ "npm:preact@^10.26.9",
+ "npm:vite-plugin-inspect@^11.3.2",
+ "npm:vite@^7.0.6"
+ ]
}
}
}
diff --git a/plugin-vite/README.md b/plugin-vite/README.md
new file mode 100644
index 00000000..17fc64c4
--- /dev/null
+++ b/plugin-vite/README.md
@@ -0,0 +1,35 @@
+# EXPERIMENTAL: vite plugin for Fresh
+
+> **Warning** This package is experimental. Please report bugs to
+> https://github.com/denoland/fresh/issues
+
+## Usage
+
+1. Run `deno install jsr:@fresh/plugin-vite npm:vite`
+2. Ensure that your `deno.json` has the `fresh` import mapping:
+
+```json
+{
+ "imports": {
+ "fresh": "jsr:@fresh/core"
+ }
+}
+```
+
+3. Update your `vite.config.ts` file:
+
+```diff
+ import { defineConfig } from "vite";
++ import { fresh } from "@fresh/plugin-vite";
+
+ export default defineConfig({
+ plugins: [
++ fresh(),
+ ],
+ });
+```
+
+4. Update your deno tasks respectively:
+
+- Dev: `vite`
+- Build: `vite build`
diff --git a/plugin-vite/demo/islands/Bar.tsx b/plugin-vite/demo/islands/Bar.tsx
new file mode 100644
index 00000000..52ce8306
--- /dev/null
+++ b/plugin-vite/demo/islands/Bar.tsx
@@ -0,0 +1,13 @@
+import { useState } from "preact/hooks";
+
+export function Bar() {
+ const [count, set] = useState(0);
+ return (
+
+
island asdf
+
+
+ );
+}
diff --git a/plugin-vite/demo/islands/Foo.tsx b/plugin-vite/demo/islands/Foo.tsx
new file mode 100644
index 00000000..156c047e
--- /dev/null
+++ b/plugin-vite/demo/islands/Foo.tsx
@@ -0,0 +1,13 @@
+import { useSignal } from "@preact/signals";
+
+export function Foo() {
+ const count = useSignal(0);
+ return (
+
+
island
+
+
+ );
+}
diff --git a/plugin-vite/demo/islands/tests/CounterHooks.tsx b/plugin-vite/demo/islands/tests/CounterHooks.tsx
new file mode 100644
index 00000000..ea53fb53
--- /dev/null
+++ b/plugin-vite/demo/islands/tests/CounterHooks.tsx
@@ -0,0 +1,13 @@
+import { useState } from "preact/hooks";
+
+export function CounterHooks() {
+ const [count, set] = useState(0);
+
+ return (
+
+
+
+ );
+}
diff --git a/plugin-vite/demo/main.ts b/plugin-vite/demo/main.ts
new file mode 100644
index 00000000..84cba68f
--- /dev/null
+++ b/plugin-vite/demo/main.ts
@@ -0,0 +1,7 @@
+import { App, staticFiles, trailingSlashes } from "fresh";
+
+export const app = new App()
+ .use(staticFiles())
+ .use(trailingSlashes("never"))
+ .get("/", () => new Response("it works"))
+ .fsRoutes();
diff --git a/plugin-vite/demo/routes/about.tsx b/plugin-vite/demo/routes/about.tsx
new file mode 100644
index 00000000..0489d2cb
--- /dev/null
+++ b/plugin-vite/demo/routes/about.tsx
@@ -0,0 +1,17 @@
+import { Bar } from "../islands/Bar.tsx";
+import { Foo } from "../islands/Foo.tsx";
+
+export const handler = () => {
+ return { data: {} };
+};
+
+export default function About() {
+ return (
+
+
Hello from Vite
+
This page is the prod Fresh build and served by vite
+
+
+
+ );
+}
diff --git a/plugin-vite/demo/routes/index.tsx b/plugin-vite/demo/routes/index.tsx
new file mode 100644
index 00000000..00f3b280
--- /dev/null
+++ b/plugin-vite/demo/routes/index.tsx
@@ -0,0 +1,3 @@
+export default function Index() {
+ return index page2
;
+}
diff --git a/plugin-vite/demo/routes/tests/island_hooks.tsx b/plugin-vite/demo/routes/tests/island_hooks.tsx
new file mode 100644
index 00000000..1aab54d0
--- /dev/null
+++ b/plugin-vite/demo/routes/tests/island_hooks.tsx
@@ -0,0 +1,5 @@
+import { CounterHooks } from "../../islands/tests/CounterHooks.tsx";
+
+export default function Page() {
+ return ;
+}
diff --git a/plugin-vite/demo/routes/tests/it_works.tsx b/plugin-vite/demo/routes/tests/it_works.tsx
new file mode 100644
index 00000000..5048322b
--- /dev/null
+++ b/plugin-vite/demo/routes/tests/it_works.tsx
@@ -0,0 +1,3 @@
+export default function Page() {
+ return it works
;
+}
diff --git a/plugin-vite/demo/static/foo.txt b/plugin-vite/demo/static/foo.txt
new file mode 100644
index 00000000..19102815
--- /dev/null
+++ b/plugin-vite/demo/static/foo.txt
@@ -0,0 +1 @@
+foo
\ No newline at end of file
diff --git a/plugin-vite/demo/static/test_static/foo.txt b/plugin-vite/demo/static/test_static/foo.txt
new file mode 100644
index 00000000..85c88293
--- /dev/null
+++ b/plugin-vite/demo/static/test_static/foo.txt
@@ -0,0 +1 @@
+it works
\ No newline at end of file
diff --git a/plugin-vite/demo/vite.config.ts b/plugin-vite/demo/vite.config.ts
new file mode 100644
index 00000000..653f850e
--- /dev/null
+++ b/plugin-vite/demo/vite.config.ts
@@ -0,0 +1,10 @@
+import { defineConfig } from "vite";
+import { fresh } from "@fresh/plugin-vite";
+import inspect from "vite-plugin-inspect";
+
+export default defineConfig({
+ plugins: [
+ inspect(),
+ fresh(),
+ ],
+});
diff --git a/plugin-vite/deno.json b/plugin-vite/deno.json
new file mode 100644
index 00000000..00411770
--- /dev/null
+++ b/plugin-vite/deno.json
@@ -0,0 +1,26 @@
+{
+ "name": "@fresh/plugin-vite",
+ "version": "0.0.1",
+ "license": "MIT",
+ "exports": {
+ ".": "./src/mod.ts"
+ },
+ "compilerOptions": {
+ "jsx": "precompile",
+ "jsxImportSource": "preact"
+ },
+ "tasks": {
+ "demo": "vite demo",
+ "debug": "deno run -A --inspect-brk npm:vite demo",
+ "demo:build": "vite build demo",
+ "demo:start": "cd demo && deno serve -A _fresh/server/server-entry.mjs"
+ },
+ "imports": {
+ "@deno/loader": "jsr:@deno/loader@^0.3.2",
+ "@prefresh/vite": "npm:@prefresh/vite@^2.4.8",
+ "@types/node": "npm:@types/node@^24.1.0",
+ "preact": "npm:preact@^10.26.9",
+ "vite": "npm:vite@^7.0.6",
+ "vite-plugin-inspect": "npm:vite-plugin-inspect@^11.3.2"
+ }
+}
diff --git a/plugin-vite/src/mod.ts b/plugin-vite/src/mod.ts
new file mode 100644
index 00000000..1d19b6a0
--- /dev/null
+++ b/plugin-vite/src/mod.ts
@@ -0,0 +1,128 @@
+import type { Plugin } from "vite";
+import {
+ type FreshViteConfig,
+ pathWithRoot,
+ type ResolvedFreshViteConfig,
+} from "./utils.ts";
+import { deno } from "./plugins/deno.ts";
+import prefresh from "@prefresh/vite";
+import { serverEntryPlugin } from "./plugins/server_entry.ts";
+import { clientEntryPlugin } from "./plugins/client_entry.ts";
+import { devServer } from "./plugins/dev_server.ts";
+import { buildIdPlugin } from "./plugins/build_id.ts";
+import { clientSnapshot } from "./plugins/client_snapshot.ts";
+import { serverSnapshot } from "./plugins/server_snapshot.ts";
+
+export function fresh(config?: FreshViteConfig): Plugin[] {
+ const fConfig: ResolvedFreshViteConfig = {
+ serverEntry: config?.serverEntry ?? "main.ts",
+ islandsDir: config?.islandsDir ?? "islands",
+ routeDir: config?.routeDir ?? "routes",
+ ignore: config?.ignore ?? [],
+ };
+
+ return [
+ {
+ name: "fresh",
+ config(config, env) {
+ return {
+ esbuild: {
+ jsx: "automatic",
+ jsxImportSource: "preact",
+ jsxDev: env.command === "serve",
+ },
+ resolve: {
+ alias: {
+ "react-dom/test-utils": "preact/test-utils",
+ "react-dom": "preact/compat",
+ react: "preact/compat",
+ },
+ noExternal: true,
+ },
+ optimizeDeps: {
+ include: [
+ "preact",
+ "preact/compat",
+ "preact/debug",
+ "preact/devtools",
+ "preact/hooks",
+ "preact/jsx-runtime",
+ "preact/jsx-dev-runtime",
+ "@preact/signals",
+ ],
+ },
+
+ publicDir: pathWithRoot("static", config.root),
+
+ builder: {
+ async buildApp(builder) {
+ // Build client env first
+ const clientEnv = builder.environments.client;
+ if (clientEnv !== undefined) {
+ await builder.build(clientEnv);
+ }
+
+ await Promise.all(
+ Object.values(builder.environments).filter((env) =>
+ env !== clientEnv
+ ).map((env) => builder.build(env)),
+ );
+ },
+ },
+ environments: {
+ client: {
+ build: {
+ copyPublicDir: false,
+ manifest: true,
+
+ outDir: config.environments?.client?.build?.outDir ??
+ "_fresh/client",
+ rollupOptions: {
+ preserveEntrySignatures: "strict",
+ input: {
+ "client-entry": "fresh:client-entry",
+ "client-snapshot": "fresh:client-snapshot",
+ },
+ },
+ },
+ },
+ ssr: {
+ build: {
+ manifest: false,
+ copyPublicDir: false,
+
+ outDir: config.environments?.ssr?.build?.outDir ??
+ "_fresh/server",
+ rollupOptions: {
+ input: {
+ "server-entry": "fresh:server_entry",
+ },
+ },
+ },
+ },
+ },
+ };
+ },
+ configResolved(config) {
+ fConfig.islandsDir = pathWithRoot(fConfig.islandsDir, config.root);
+ fConfig.routeDir = pathWithRoot(fConfig.routeDir, config.root);
+ },
+ },
+ serverEntryPlugin(fConfig),
+ ...serverSnapshot(fConfig),
+ clientEntryPlugin(),
+ clientSnapshot(fConfig),
+ buildIdPlugin(),
+ ...devServer(),
+ prefresh({
+ include: [/\.[cm]?[tj]sx?$/],
+ exclude: [/node_modules/],
+ parserPlugins: [
+ "importMeta",
+ "explicitResourceManagement",
+ "topLevelAwait",
+ ],
+ }),
+ deno(),
+ ];
+}
diff --git a/plugin-vite/src/plugins/build_id.ts b/plugin-vite/src/plugins/build_id.ts
new file mode 100644
index 00000000..c5ae2eff
--- /dev/null
+++ b/plugin-vite/src/plugins/build_id.ts
@@ -0,0 +1,51 @@
+import type { Plugin } from "vite";
+
+export function buildIdPlugin(): Plugin {
+ let buildId = "";
+
+ return {
+ name: "fresh:build-id",
+ async config(_, env) {
+ const isDev = env.command === "serve";
+
+ buildId = await getBuildId(isDev);
+
+ return {
+ define: {
+ BUILD_ID: JSON.stringify(buildId),
+ },
+ };
+ },
+ applyToEnvironment() {
+ return true;
+ },
+ resolveId(id) {
+ if (id === "fresh/build-id") {
+ return `\0fresh/build-id`;
+ }
+ },
+ load(id) {
+ if (id !== `\0fresh/build-id`) return;
+
+ return `export let BUILD_ID = ${JSON.stringify(buildId)};
+export const DENO_DEPLOYMENT_ID = undefined;
+export function setBuildId(id) {
+ BUILD_ID = id;
+}`;
+ },
+ };
+}
+
+export async function getBuildId(dev: boolean): Promise {
+ if (!dev) {
+ const bin = Deno.build.os === "windows" ? "git.exe" : "git";
+ const res = await new Deno.Command(bin, { args: ["rev-parse", "HEAD"] })
+ .output();
+
+ return new TextDecoder().decode(res.stdout);
+ }
+
+ const arr = new Uint32Array(1);
+ crypto.getRandomValues(arr);
+ return String(arr[0]);
+}
diff --git a/plugin-vite/src/plugins/client_entry.ts b/plugin-vite/src/plugins/client_entry.ts
new file mode 100644
index 00000000..45c6a3d3
--- /dev/null
+++ b/plugin-vite/src/plugins/client_entry.ts
@@ -0,0 +1,33 @@
+import type { Plugin } from "vite";
+
+export function clientEntryPlugin(): Plugin {
+ const modName = "fresh:client-entry";
+
+ return {
+ name: "fresh:client-entry",
+ applyToEnvironment(env) {
+ return env.name === "client";
+ },
+ resolveId(id) {
+ if (id === modName) {
+ return `\0${modName}`;
+ }
+ },
+ load(id) {
+ if (id !== `\0${modName}`) return;
+
+ return `export * from "fresh/runtime-client";
+
+if (import.meta.hot) {
+ import.meta.hot.accept(() => {
+ console.log("accepting")
+ });
+ import.meta.hot.on("fresh:reload", ev => {
+ console.log(ev)
+ window.location.reload();
+ });
+}
+`;
+ },
+ };
+}
diff --git a/plugin-vite/src/plugins/client_snapshot.ts b/plugin-vite/src/plugins/client_snapshot.ts
new file mode 100644
index 00000000..d1ab7d16
--- /dev/null
+++ b/plugin-vite/src/plugins/client_snapshot.ts
@@ -0,0 +1,79 @@
+import type { Plugin, ViteDevServer } from "vite";
+import type { ResolvedFreshViteConfig } from "../utils.ts";
+import { crawlFsItem } from "fresh/internal-dev";
+
+export function clientSnapshot(options: ResolvedFreshViteConfig): Plugin {
+ const modName = "fresh:client-snapshot";
+
+ const islands = new Set();
+ let server: ViteDevServer | undefined;
+ let isDev = false;
+
+ return {
+ name: "fresh:client-snapshot",
+ applyToEnvironment(env) {
+ return env.name === "client";
+ },
+ config(_, env) {
+ isDev = env.command === "serve";
+
+ return {
+ environments: {
+ client: {
+ build: {
+ rollupOptions: {
+ input: {
+ "client-snapshot": "fresh:client-snapshot",
+ },
+ },
+ },
+ },
+ },
+ };
+ },
+ async buildStart() {
+ const result = await crawlFsItem({
+ islandDir: options.islandsDir,
+ routeDir: options.routeDir,
+ ignore: options.ignore,
+ });
+
+ for (let i = 0; i < result.islands.length; i++) {
+ const filePath = result.islands[i];
+ islands.add(filePath);
+ }
+ },
+ resolveId(id) {
+ if (id === modName) {
+ return `\0${modName}`;
+ }
+ },
+ configureServer(devServer) {
+ server = devServer;
+ },
+ load(id) {
+ if (id !== `\0${modName}`) return;
+
+ const imports = Array.from(islands.keys()).map((file, i) => {
+ return `export const mod_${i} = await import(${JSON.stringify(file)});`;
+ }).join("\n");
+
+ if (isDev && server !== undefined) {
+ const mod = server.environments.ssr.moduleGraph.getModuleById(
+ "\0fresh:server-snapshot",
+ );
+ if (mod) {
+ server.environments.ssr.moduleGraph.invalidateModule(mod);
+ }
+ }
+
+ return `${imports}
+if (import.meta.hot) {
+ import.meta.hot.accept(() => {
+ console.log("accepting client-snapshot")
+ });
+}
+`;
+ },
+ };
+}
diff --git a/plugin-vite/src/plugins/deno.ts b/plugin-vite/src/plugins/deno.ts
new file mode 100644
index 00000000..56f08124
--- /dev/null
+++ b/plugin-vite/src/plugins/deno.ts
@@ -0,0 +1,187 @@
+import type { Plugin } from "vite";
+import {
+ type Loader,
+ RequestedModuleType,
+ ResolutionMode,
+ Workspace,
+} from "@deno/loader";
+import * as path from "@std/path";
+
+interface DenoState {
+ type: RequestedModuleType;
+}
+
+export function deno(): Plugin {
+ let loader: Loader;
+
+ return {
+ name: "deno",
+ async configResolved() {
+ // TODO: Pass conditions
+ loader = await new Workspace({}).createLoader();
+ },
+ applyToEnvironment() {
+ return true;
+ },
+ async resolveId(id, importer, options) {
+ importer = isDenoSpecifier(importer)
+ ? parseDenoSpecifier(importer).specifier
+ : importer;
+
+ try {
+ // Ensure we're passing a valid importer that Deno understands
+ const denoImporter = importer && !importer.startsWith("\0")
+ ? importer
+ : undefined;
+
+ let resolved = await loader.resolve(
+ id,
+ denoImporter,
+ ResolutionMode.Import,
+ );
+
+ if (id === resolved) {
+ return id;
+ }
+
+ const type = getDenoType(options.attributes.type ?? "default");
+ if (
+ type !== RequestedModuleType.Default ||
+ /^(https?|jsr|npm):/.test(resolved) ||
+ // Vite does weird things to windows file paths
+ Deno.build.os === "windows"
+ ) {
+ return toDenoSpecifier(resolved, type);
+ }
+
+ if (resolved.startsWith("file://")) {
+ resolved = path.fromFileUrl(resolved);
+ }
+
+ return {
+ id: resolved,
+ meta: {
+ deno: {
+ type,
+ },
+ },
+ };
+ } catch {
+ // ignore
+ }
+ },
+ async load(id) {
+ if (isDenoSpecifier(id)) {
+ const { type, specifier } = parseDenoSpecifier(id);
+
+ const result = await loader.load(specifier, type);
+ if (result.kind === "external") {
+ return null;
+ }
+
+ return {
+ code: new TextDecoder().decode(result.code),
+ };
+ }
+
+ if (id.startsWith("\0")) {
+ id = id.slice(1);
+ }
+
+ const meta = this.getModuleInfo(id)?.meta.deno as
+ | DenoState
+ | undefined
+ | null;
+
+ if (meta === null || meta === undefined) return;
+
+ const url = path.toFileUrl(id);
+
+ const result = await loader.load(url.href, meta.type);
+ if (result.kind === "external") {
+ return null;
+ }
+
+ return {
+ code: new TextDecoder().decode(result.code),
+ };
+ },
+ async transform(_, id, options) {
+ // This transform is a hack to be able to re-use Deno's precompile
+ // jsx transform.
+ if (!options?.ssr || !id.endsWith(".tsx") || id.endsWith(".jsx")) {
+ return;
+ }
+
+ let actualId = id;
+ if (isDenoSpecifier(id)) {
+ const { specifier } = parseDenoSpecifier(id);
+ actualId = specifier;
+ }
+ if (path.isAbsolute(actualId)) {
+ actualId = path.toFileUrl(actualId).href;
+ }
+
+ const resolved = await loader.resolve(
+ actualId,
+ undefined,
+ ResolutionMode.Import,
+ );
+ const result = await loader.load(resolved, RequestedModuleType.Default);
+ if (result.kind === "external") {
+ return;
+ }
+
+ const code = new TextDecoder().decode(result.code);
+
+ return {
+ code,
+ };
+ },
+ };
+}
+
+export type DenoSpecifier = string & { __deno: string };
+
+function isDenoSpecifier(str: unknown): str is DenoSpecifier {
+ return typeof str === "string" && str.startsWith("\0deno::");
+}
+
+function toDenoSpecifier(spec: string, type: RequestedModuleType) {
+ return `\0deno::${type}::${spec}`;
+}
+
+function parseDenoSpecifier(
+ spec: DenoSpecifier,
+): { type: RequestedModuleType; specifier: string } {
+ const match = spec.match(/^\0deno::([^:]+)::(.*)$/)!;
+
+ let specifier = match[2];
+
+ const specMatch = specifier.match(/^(\w+):\/([^/].*)$/);
+ if (specMatch !== null) {
+ const protocol = specMatch[1];
+
+ let rest = specMatch[2];
+ if (protocol === "file") {
+ rest = "/" + rest;
+ }
+
+ specifier = `${protocol}://${rest}`;
+ }
+
+ return { type: +match[1], specifier };
+}
+
+function getDenoType(type: string): RequestedModuleType {
+ switch (type) {
+ case "json":
+ return RequestedModuleType.Json;
+ case "bytes":
+ return RequestedModuleType.Bytes;
+ case "text":
+ return RequestedModuleType.Text;
+ default:
+ return RequestedModuleType.Default;
+ }
+}
diff --git a/plugin-vite/src/plugins/dev_server.ts b/plugin-vite/src/plugins/dev_server.ts
new file mode 100644
index 00000000..5e630209
--- /dev/null
+++ b/plugin-vite/src/plugins/dev_server.ts
@@ -0,0 +1,79 @@
+import type { Plugin } from "vite";
+import { nodeToRequest, responseToNode } from "../request.ts";
+import * as path from "@std/path";
+import { pathWithRoot } from "../utils.ts";
+
+export function devServer(): Plugin[] {
+ let publicDir = "";
+
+ return [
+ {
+ name: "fresh:dev_server",
+ configResolved(cfg) {
+ publicDir = pathWithRoot(cfg.publicDir, cfg.root);
+ },
+ configureServer(server) {
+ const IGNORE_URLS = /^\/(@(vite|fs|id)|\.vite)\//;
+
+ server.middlewares.use(async (nodeReq, nodeRes, next) => {
+ const serverCfg = server.config.server;
+
+ const protocol = serverCfg.https ? "https" : "http";
+ const host = serverCfg.host ? serverCfg.host : "localhost";
+ const port = serverCfg.port;
+ const url = new URL(
+ `${protocol}://${host}:${port}${nodeReq.url ?? "/"}`,
+ );
+
+ // Check if it's a vite url
+ if (
+ IGNORE_URLS.test(url.pathname) ||
+ server.environments.client.moduleGraph.urlToModuleMap.has(
+ url.pathname,
+ )
+ ) {
+ return next();
+ }
+
+ // Check if it's a static file first
+ // FIXME: Should this still go through fresh?
+ if (url.pathname !== "/") {
+ try {
+ await Deno.stat(path.join(publicDir, url.pathname));
+ return next();
+ } catch (err) {
+ if (!(err instanceof Deno.errors.NotFound)) {
+ return next(err);
+ }
+ }
+ }
+
+ const mod = await server.ssrLoadModule("fresh:server_entry");
+
+ try {
+ const req = nodeToRequest(nodeReq, url);
+ const res = await mod.default.fetch(req);
+ await responseToNode(res, nodeRes);
+ return nodeRes;
+ } catch (err) {
+ return next(err);
+ }
+ });
+ },
+ },
+ {
+ name: "fresh:server_hmr",
+ applyToEnvironment(env) {
+ return env.name === "ssr";
+ },
+ hotUpdate(options) {
+ const clientMod = options.server.environments.client.moduleGraph
+ .getModulesByFile(options.file);
+
+ if (clientMod === undefined) {
+ options.server.hot.send("fresh:reload");
+ }
+ },
+ },
+ ];
+}
diff --git a/plugin-vite/src/plugins/server_entry.ts b/plugin-vite/src/plugins/server_entry.ts
new file mode 100644
index 00000000..76627a3f
--- /dev/null
+++ b/plugin-vite/src/plugins/server_entry.ts
@@ -0,0 +1,65 @@
+import type { Plugin } from "vite";
+import { generateServerEntry } from "fresh/internal-dev";
+import { pathWithRoot, type ResolvedFreshViteConfig } from "../utils.ts";
+import * as path from "@std/path";
+
+export function serverEntryPlugin(
+ options: ResolvedFreshViteConfig,
+): Plugin {
+ const modName = "fresh:server_entry";
+
+ let serverEntry = "";
+ let serverOutDir = "";
+ let root = "";
+
+ let isDev = false;
+
+ return {
+ name: "fresh:server_entry",
+ applyToEnvironment(env) {
+ return env.name === "ssr";
+ },
+ config(_, env) {
+ isDev = env.command === "serve";
+ },
+ configResolved(config) {
+ root = config.root;
+ serverEntry = pathWithRoot(options.serverEntry, config.root);
+ serverOutDir = pathWithRoot(
+ config.environments.ssr.build.outDir,
+ config.root,
+ );
+ },
+ resolveId(id) {
+ if (id === modName) {
+ return `\0${modName}`;
+ }
+ },
+ load(id) {
+ if (id !== `\0${modName}`) return;
+
+ let code = generateServerEntry({
+ root,
+ serverEntry: path.toFileUrl(serverEntry).href,
+ snapshotSpecifier: "fresh:server-snapshot",
+ });
+
+ if (isDev) {
+ code += `if (import.meta.hot) import.meta.hot.accept();\n`;
+ }
+
+ return code;
+ },
+ async writeBundle() {
+ const outDir = path.dirname(serverOutDir);
+ await Deno.writeTextFile(
+ path.join(outDir, "server.js"),
+ `import server from "./server/server-entry.mjs";
+export default {
+ fetch: server.fetch
+};
+`,
+ );
+ },
+ };
+}
diff --git a/plugin-vite/src/plugins/server_snapshot.ts b/plugin-vite/src/plugins/server_snapshot.ts
new file mode 100644
index 00000000..f51fbf9b
--- /dev/null
+++ b/plugin-vite/src/plugins/server_snapshot.ts
@@ -0,0 +1,189 @@
+import type { Manifest, Plugin, ViteDevServer } from "vite";
+import {
+ crawlFsItem,
+ fsAdapter,
+ generateSnapshotServer,
+ type IslandModChunk,
+ pathToSpec,
+ type PendingStaticFile,
+ specToName,
+ UniqueNamer,
+} from "fresh/internal-dev";
+import { pathWithRoot, type ResolvedFreshViteConfig } from "../utils.ts";
+import * as path from "@std/path";
+import { getBuildId } from "./build_id.ts";
+
+export function serverSnapshot(options: ResolvedFreshViteConfig): Plugin[] {
+ const modName = "fresh:server-snapshot";
+
+ let isDev = false;
+ let server: ViteDevServer | undefined;
+
+ const namer = new UniqueNamer();
+
+ let clientOutDir = "";
+ let root = "";
+ let publicDir = "";
+
+ const islands = new Map();
+ const islandSpecByName = new Map();
+
+ return [{
+ name: "fresh:server-snapshot",
+ applyToEnvironment(env) {
+ return env.name === "ssr";
+ },
+ config(_, env) {
+ isDev = env.command === "serve";
+ },
+ configResolved(config) {
+ root = config.root;
+
+ publicDir = pathWithRoot(config.publicDir, config.root);
+ clientOutDir = pathWithRoot(
+ config.environments.client.build.outDir,
+ config.root,
+ );
+ },
+ configureServer(viteServer) {
+ server = viteServer;
+ },
+ async buildStart() {
+ },
+ resolveId(id) {
+ if (id === modName) {
+ return `\0${modName}`;
+ }
+ },
+ async load(id) {
+ if (id !== `\0${modName}`) return;
+
+ const result = await crawlFsItem({
+ islandDir: options.islandsDir,
+ routeDir: options.routeDir,
+ ignore: options.ignore,
+ });
+
+ for (let i = 0; i < result.islands.length; i++) {
+ const spec = result.islands[i];
+ const specName = specToName(spec);
+ const name = namer.getUniqueName(specName);
+
+ islands.set(spec, { name, chunk: null });
+ islandSpecByName.set(name, spec);
+ }
+
+ const staticFiles: PendingStaticFile[] = [];
+ let islandMods: IslandModChunk[] = [];
+ let clientEntry = "/@id/fresh:client-entry";
+ let buildId = "";
+
+ if (isDev && server !== undefined) {
+ for (const id of islands.keys()) {
+ const mod = server.environments.client.moduleGraph.getModuleById(
+ id,
+ );
+ if (mod !== undefined) {
+ const def = islands.get(id);
+ if (def !== undefined) def.chunk = mod.url;
+ }
+ }
+
+ islandMods = Array.from(islands.entries()).map(([id, def]) => {
+ return {
+ name: def.name,
+ server: id,
+ browser: def.chunk ?? `/@id/fresh-island::${def.name}`,
+ };
+ });
+ } else {
+ buildId = await getBuildId(false);
+ const manifest = JSON.parse(
+ await Deno.readTextFile(
+ path.join(clientOutDir, ".vite", "manifest.json"),
+ ),
+ ) as Manifest;
+
+ for (const chunk of Object.values(manifest)) {
+ if (chunk.name === "client-entry") {
+ clientEntry = pathToSpec(clientOutDir, chunk.file);
+ }
+
+ staticFiles.push({
+ filePath: path.join(clientOutDir, chunk.file),
+ pathname: chunk.file,
+ hash: null,
+ });
+
+ const namer = new UniqueNamer();
+ if (chunk.name === "client-snapshot") {
+ for (const id of chunk.dynamicImports ?? []) {
+ const mod = manifest[id];
+ const serverPath = path.join(root, mod.src ?? id);
+
+ const name = namer.getUniqueName(specToName(id));
+ islandMods.push({
+ name,
+ browser: pathToSpec(clientOutDir, mod.file),
+ server: serverPath,
+ });
+ }
+ }
+ }
+
+ const entries = await fsAdapter.walk(
+ publicDir,
+ {
+ followSymlinks: false,
+ includeDirs: false,
+ includeFiles: true,
+ skip: options.ignore,
+ },
+ );
+
+ for await (const entry of entries) {
+ const relative = path.relative(publicDir, entry.path);
+ const filePath = path.join(clientOutDir, relative);
+
+ try {
+ await Deno.mkdir(path.dirname(filePath), { recursive: true });
+ } catch (err) {
+ if (!(err instanceof Deno.errors.AlreadyExists)) {
+ throw err;
+ }
+ }
+ await Deno.copyFile(entry.path, filePath);
+
+ staticFiles.push({
+ filePath,
+ hash: null,
+ pathname: relative,
+ });
+ }
+ }
+
+ const code = await generateSnapshotServer({
+ outDir: root,
+ staticFiles,
+ buildId,
+ clientEntry,
+ fsRoutesFiles: result.routes,
+ islands: islandMods,
+ writeSpecifier: (file) => {
+ return path.toFileUrl(file).href;
+ },
+ });
+
+ return code;
+ },
+ }, {
+ name: "fresh:island-resolver",
+ resolveId(id) {
+ if (id.startsWith("fresh-island::")) {
+ const name = id.slice("fresh-island::".length);
+ const spec = islandSpecByName.get(name);
+ if (spec !== undefined) return spec;
+ }
+ },
+ }];
+}
diff --git a/plugin-vite/src/request.ts b/plugin-vite/src/request.ts
new file mode 100644
index 00000000..967aea9f
--- /dev/null
+++ b/plugin-vite/src/request.ts
@@ -0,0 +1,84 @@
+import type { IncomingMessage, ServerResponse } from "node:http";
+
+export function nodeToRequest(node: IncomingMessage, url: URL): Request {
+ const controller = new AbortController();
+ node.once("aborted", () => controller.abort());
+
+ const body = undefined;
+
+ if (
+ node.method !== "HEAD" && node.method !== "GET" && node.method !== "OPTIONS"
+ ) {
+ // FIXME
+ }
+
+ return new Request(url, {
+ headers: node.headers as Record,
+ method: node.method,
+ body,
+ signal: controller.signal,
+ });
+}
+
+export async function responseToNode(
+ res: Response,
+ node: ServerResponse,
+): Promise {
+ res.headers.forEach((value, key) => {
+ node.setHeader(key, value);
+ });
+
+ node.writeHead(res.status);
+
+ if (res.body === null) {
+ node.end();
+ return;
+ }
+
+ if (res.body.locked) {
+ node.end(`Error: Response body is locked.`);
+ return;
+ }
+
+ const reader = res.body.getReader();
+
+ if (node.destroyed) {
+ await reader.cancel();
+ return;
+ }
+
+ const cancel = (error: unknown) => {
+ node.off("close", cancel);
+ node.off("error", cancel);
+
+ // Can't respond anymore with error
+ reader.cancel(error).catch(() => {});
+
+ if (error) {
+ node.destroy(error instanceof Error ? error : new Error(String(error)));
+ }
+ };
+
+ node.on("close", cancel);
+ node.on("error", cancel);
+
+ async function next() {
+ try {
+ while (true) {
+ const { done, value } = await reader.read();
+ if (done) break;
+
+ if (!node.write(value)) {
+ node.once("drain", next);
+ return;
+ }
+ }
+
+ node.end();
+ } catch (error) {
+ cancel(error);
+ }
+ }
+
+ next();
+}
diff --git a/plugin-vite/src/utils.ts b/plugin-vite/src/utils.ts
new file mode 100644
index 00000000..0b231760
--- /dev/null
+++ b/plugin-vite/src/utils.ts
@@ -0,0 +1,41 @@
+import * as path from "@std/path";
+import type { FsRouteFileNoMod, UniqueNamer } from "fresh/internal-dev";
+
+export function pathWithRoot(fileOrDir: string, root?: string): string {
+ if (path.isAbsolute(fileOrDir)) return fileOrDir;
+
+ if (root === undefined) {
+ return path.join(Deno.cwd(), fileOrDir);
+ }
+
+ if (path.isAbsolute(root)) return path.join(root, fileOrDir);
+
+ return path.join(Deno.cwd(), root, fileOrDir);
+}
+
+export interface FreshState {
+ namer: UniqueNamer;
+ root: string;
+ serverEntry: string;
+ islandDir: string;
+ routeDir: string;
+ dev: boolean;
+ islands: Map;
+ // deno-lint-ignore no-explicit-any
+ routes: FsRouteFileNoMod[];
+ clientOutDir: string;
+ serverOutDir: string;
+}
+
+export interface ClientSnapshot {
+ entry: string;
+}
+
+export interface FreshViteConfig {
+ serverEntry?: string;
+ islandsDir?: string;
+ routeDir?: string;
+ ignore?: RegExp[];
+}
+
+export type ResolvedFreshViteConfig = Required;
diff --git a/plugin-vite/tests/build_test.ts b/plugin-vite/tests/build_test.ts
new file mode 100644
index 00000000..8ebdafa1
--- /dev/null
+++ b/plugin-vite/tests/build_test.ts
@@ -0,0 +1,71 @@
+import { expect } from "@std/expect";
+import {
+ waitForText,
+ withBrowser,
+ withChildProcessServer,
+} from "../../tests/test_utils.tsx";
+import { buildVite } from "./test_utils.ts";
+
+Deno.test({
+ name: "vite build - launches",
+ fn: async () => {
+ await using res = await buildVite();
+
+ await withChildProcessServer(
+ res.tmp,
+ ["serve", "-A", "--port", "0", "_fresh/server.js"],
+ async (address) => {
+ const res = await fetch(address);
+ const text = await res.text();
+ expect(text).toEqual("it works");
+ },
+ );
+ },
+ sanitizeOps: false,
+ sanitizeResources: false,
+});
+
+Deno.test({
+ name: "vite build - serves static files",
+ fn: async () => {
+ await using res = await buildVite();
+
+ await withChildProcessServer(
+ res.tmp,
+ ["serve", "-A", "--port", "0", "_fresh/server.js"],
+ async (address) => {
+ const res = await fetch(`${address}/test_static/foo.txt`);
+ const text = await res.text();
+ expect(text).toEqual("it works");
+ },
+ );
+ },
+ sanitizeOps: false,
+ sanitizeResources: false,
+});
+
+Deno.test({
+ name: "vite build - loads islands",
+ fn: async () => {
+ await using res = await buildVite();
+
+ await withChildProcessServer(
+ res.tmp,
+ ["serve", "-A", "--port", "0", "_fresh/server.js"],
+ async (address) => {
+ await withBrowser(async (page) => {
+ await page.goto(`${address}/tests/island_hooks`, {
+ waitUntil: "networkidle2",
+ });
+
+ await waitForText(page, "button", "count: 0");
+
+ await page.locator("button").click();
+ await waitForText(page, "button", "count: 1");
+ });
+ },
+ );
+ },
+ sanitizeOps: false,
+ sanitizeResources: false,
+});
diff --git a/plugin-vite/tests/dev_server_test.ts b/plugin-vite/tests/dev_server_test.ts
new file mode 100644
index 00000000..c5bf1b11
--- /dev/null
+++ b/plugin-vite/tests/dev_server_test.ts
@@ -0,0 +1,83 @@
+import * as path from "@std/path";
+import { expect } from "@std/expect";
+import { waitForText, withBrowser } from "../../tests/test_utils.tsx";
+import { updateFile, withDevServer } from "./test_utils.ts";
+
+Deno.test({
+ name: "vite dev - launches",
+ fn: async () => {
+ await withDevServer(async (address) => {
+ const res = await fetch(`${address}/tests/it_works`);
+ const text = await res.text();
+ expect(text).toContain("it works");
+ });
+ },
+ sanitizeResources: false,
+ sanitizeOps: false,
+});
+
+Deno.test({
+ name: "vite dev - serves static files",
+ fn: async () => {
+ await withDevServer(async (address) => {
+ const res = await fetch(`${address}/test_static/foo.txt`);
+ const text = await res.text();
+ expect(text).toContain("it works");
+ });
+ },
+ sanitizeResources: false,
+ sanitizeOps: false,
+});
+
+Deno.test({
+ name: "vite dev - loads islands",
+ fn: async () => {
+ await withDevServer(async (address) => {
+ await withBrowser(async (page) => {
+ await page.goto(`${address}/tests/island_hooks`, {
+ waitUntil: "networkidle2",
+ });
+ await waitForText(page, "button", "count: 0");
+
+ await page.locator("button").click();
+ await waitForText(page, "button", "count: 1");
+ });
+ });
+ },
+ sanitizeResources: false,
+ sanitizeOps: false,
+});
+
+Deno.test({
+ name: "vite dev - can apply HMR to islands (hooks)",
+ ignore: true, // Test is very flaky
+ fn: async () => {
+ await withDevServer(async (address, dir) => {
+ await withBrowser(async (page) => {
+ await page.goto(`${address}/tests/island_hooks`, {
+ waitUntil: "networkidle2",
+ });
+ await waitForText(page, "button", "count: 0");
+ await page.locator("button").click();
+ await waitForText(page, "button", "count: 1");
+
+ const island = path.join(
+ dir,
+ "islands",
+ "tests",
+ "CounterHooks.tsx",
+ );
+ await using _ = await updateFile(
+ island,
+ (text) => text.replace("count:", "hmr:"),
+ );
+
+ await waitForText(page, "button", "hmr: 1");
+ await page.locator("button").click();
+ await waitForText(page, "button", "hmr: 2");
+ });
+ });
+ },
+ sanitizeResources: false,
+ sanitizeOps: false,
+});
diff --git a/plugin-vite/tests/test_utils.ts b/plugin-vite/tests/test_utils.ts
new file mode 100644
index 00000000..853bd175
--- /dev/null
+++ b/plugin-vite/tests/test_utils.ts
@@ -0,0 +1,108 @@
+import { createBuilder } from "vite";
+import * as path from "@std/path";
+import { walk } from "@std/fs/walk";
+import { withTmpDir } from "../../src/test_utils.ts";
+import { withChildProcessServer } from "../../tests/test_utils.tsx";
+
+export const DEMO_DIR = path.join(import.meta.dirname!, "..", "demo");
+
+export async function updateFile(
+ filePath: string,
+ fn: (text: string) => string | Promise,
+) {
+ const original = await Deno.readTextFile(filePath);
+ const result = await fn(original);
+ await Deno.writeTextFile(filePath, result);
+
+ return {
+ async [Symbol.asyncDispose]() {
+ await Deno.writeTextFile(filePath, original);
+ },
+ };
+}
+
+async function copyDir(from: string, to: string) {
+ const entries = walk(from, {
+ includeFiles: true,
+ includeDirs: false,
+ skip: [/([\\/]+(_fresh|node_modules|vendor)[\\/]+|[\\/]+vite\.config\.ts)/],
+ });
+
+ for await (const entry of entries) {
+ if (entry.isFile) {
+ const relative = path.relative(from, entry.path);
+ const target = path.join(to, relative);
+
+ try {
+ await Deno.mkdir(path.dirname(target), { recursive: true });
+ } catch (err) {
+ if (!(err instanceof Deno.errors.NotFound)) {
+ throw err;
+ }
+ }
+
+ await Deno.copyFile(entry.path, target);
+ }
+ }
+}
+
+export async function withDevServer(
+ fn: (address: string, dir: string) => void | Promise,
+) {
+ await using tmp = await withTmpDir({
+ dir: path.join(import.meta.dirname!, ".."),
+ prefix: "tmp_",
+ });
+
+ await copyDir(DEMO_DIR, tmp.dir);
+
+ await Deno.writeTextFile(
+ path.join(tmp.dir, "vite.config.ts"),
+ `import { defineConfig } from "vite";
+import { fresh } from "@fresh/plugin-vite";
+
+export default defineConfig({
+ plugins: [
+ fresh(),
+ ],
+});
+`,
+ );
+
+ await withChildProcessServer(
+ tmp.dir,
+ ["run", "-A", "npm:vite"],
+ (address) => fn(address, tmp.dir),
+ );
+}
+
+export async function buildVite() {
+ const tmp = await withTmpDir();
+
+ const builder = await createBuilder({
+ root: DEMO_DIR,
+ build: {
+ emptyOutDir: true,
+ },
+ environments: {
+ ssr: {
+ build: {
+ outDir: path.join(tmp.dir, "_fresh", "server"),
+ },
+ },
+ client: {
+ build: {
+ outDir: path.join(tmp.dir, "_fresh", "client"),
+ },
+ },
+ },
+ });
+ await builder.buildApp();
+
+ return {
+ tmp: tmp.dir,
+ async [Symbol.asyncDispose]() {
+ return await tmp[Symbol.asyncDispose]();
+ },
+ };
+}
diff --git a/src/app.ts b/src/app.ts
index 880c3fc6..03653ca8 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -1,6 +1,6 @@
import { trace } from "@opentelemetry/api";
-import { DENO_DEPLOYMENT_ID } from "./runtime/build_id.ts";
+import { DENO_DEPLOYMENT_ID } from "fresh/build-id";
import * as colors from "@std/fmt/colors";
import {
type MaybeLazyMiddleware,
@@ -152,6 +152,7 @@ export let getBuildCache: (app: App) => BuildCache | null;
export let setBuildCache: (
app: App,
cache: BuildCache,
+ mode: "development" | "production",
) => void;
/**
@@ -164,8 +165,9 @@ export class App {
static {
getBuildCache = (app) => app.#getBuildCache();
- setBuildCache = (app, cache) => {
+ setBuildCache = (app, cache, mode: "development" | "production") => {
app.config.root = cache.root;
+ app.config.mode = mode;
app.#getBuildCache = () => cache;
};
}
@@ -179,7 +181,7 @@ export class App {
this.config = {
root: Deno.cwd(),
basePath: config.basePath ?? "",
- mode: "production",
+ mode: config.mode ?? "production",
};
}
@@ -363,7 +365,7 @@ export class App {
`Could not find _fresh directory. Maybe you forgot to run "deno task build"?`,
);
} else {
- buildCache = new MockBuildCache([]);
+ buildCache = new MockBuildCache([], this.config.mode);
}
}
diff --git a/src/build_cache.ts b/src/build_cache.ts
index de707508..36aaa171 100644
--- a/src/build_cache.ts
+++ b/src/build_cache.ts
@@ -1,10 +1,10 @@
import * as path from "@std/path";
-import { setBuildId } from "./runtime/build_id.ts";
import type { Command } from "./commands.ts";
import { fsItemsToCommands, type FsRouteFile } from "./fs_routes.ts";
import type { ServerIslandRegistry } from "./context.ts";
import type { AnyComponent } from "preact";
import { UniqueNamer } from "./utils.ts";
+import { setBuildId } from "fresh/build-id";
export interface FileSnapshot {
name: string;
@@ -15,6 +15,7 @@ export interface FileSnapshot {
export interface BuildSnapshot {
version: string;
+ clientEntry: string;
fsRoutes: FsRouteFile[];
staticFiles: Map;
islands: ServerIslandRegistry;
@@ -32,6 +33,10 @@ export interface StaticFile {
export interface BuildCache {
root: string;
islandRegistry: ServerIslandRegistry;
+ clientEntry: string;
+ features: {
+ errorOverlay: boolean;
+ };
getFsRoutes(): Command[];
readFile(pathname: string): Promise;
}
@@ -39,11 +44,14 @@ export interface BuildCache {
export class ProdBuildCache implements BuildCache {
#snapshot: BuildSnapshot;
islandRegistry: ServerIslandRegistry;
+ clientEntry: string;
+ features = { errorOverlay: false };
constructor(public root: string, snapshot: BuildSnapshot) {
setBuildId(snapshot.version);
this.#snapshot = snapshot;
this.islandRegistry = snapshot.islands;
+ this.clientEntry = snapshot.clientEntry;
}
getFsRoutes(): Command[] {
diff --git a/src/config.ts b/src/config.ts
index 8a312cd5..7fae4f08 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -7,6 +7,10 @@ export interface FreshConfig {
* @default undefined
*/
basePath?: string;
+ /**
+ * The mode Fresh can run in.
+ */
+ mode?: "development" | "production";
}
/**
diff --git a/src/context.ts b/src/context.ts
index a829ef4a..fdaabe0d 100644
--- a/src/context.ts
+++ b/src/context.ts
@@ -296,15 +296,3 @@ export class Context {
return new Response(html, responseInit);
}
}
-
-Object.defineProperties(Context.prototype, {
- config: { enumerable: true },
- url: { enumerable: true },
- req: { enumerable: true },
- params: { enumerable: true },
- state: { enumerable: true },
- data: { enumerable: true },
- error: { enumerable: true },
- next: { enumerable: true },
- info: { enumerable: true },
-});
diff --git a/src/context_test.tsx b/src/context_test.tsx
index 6bc6ff05..6e4c717d 100644
--- a/src/context_test.tsx
+++ b/src/context_test.tsx
@@ -3,7 +3,7 @@ import { Context } from "./context.ts";
import { App } from "fresh";
import { asset } from "fresh/runtime";
import { FakeServer } from "./test_utils.ts";
-import { BUILD_ID } from "./runtime/build_id.ts";
+import { BUILD_ID } from "fresh/build-id";
import { parseHtml } from "../tests/test_utils.tsx";
Deno.test("FreshReqContext.prototype.redirect", () => {
diff --git a/src/dev/builder.ts b/src/dev/builder.ts
index 08bc3634..ac20e850 100644
--- a/src/dev/builder.ts
+++ b/src/dev/builder.ts
@@ -24,7 +24,7 @@ import { automaticWorkspaceFolders } from "./middlewares/automatic_workspace_fol
import { parseDirPath } from "../config.ts";
import { pathToExportName, UniqueNamer } from "../utils.ts";
import { checkDenoCompilerOptions } from "./check.ts";
-import { crawlRouteDir, walkDir } from "./fs_crawl.ts";
+import { crawlFsItem } from "./fs_crawl.ts";
import { DAY } from "../constants.ts";
export interface BuildOptions {
@@ -169,7 +169,7 @@ export class Builder {
app.config.root = this.config.root;
app.config.mode = "development";
- setBuildCache(app, buildCache);
+ setBuildCache(app, buildCache, "development");
const appHandler = app.handler();
@@ -187,7 +187,7 @@ export class Builder {
devApp.config.root = this.config.root;
devApp.config.mode = "development";
- setBuildCache(devApp, buildCache);
+ setBuildCache(devApp, buildCache, "development");
// Boot in parallel to spin up the server quicker. We'll hold
// requests until the required assets are processed.
@@ -248,26 +248,24 @@ export class Builder {
await buildCache.prepare();
return (app) => {
- setBuildCache(app, buildCache);
+ setBuildCache(app, buildCache, app.config.mode);
};
}
async #crawlFsItems() {
- await Promise.all([
- walkDir(
- fsAdapter,
- this.config.islandDir,
- (entry) => this.registerIsland(entry.path),
- this.config.ignore,
- ),
- crawlRouteDir(
- fsAdapter,
- this.config.routeDir,
- this.config.ignore,
- (entry) => this.registerIsland(entry),
- this.#fsRoutes.files,
- ),
- ]);
+ const { islands, routes } = await crawlFsItem(
+ {
+ islandDir: this.config.islandDir,
+ routeDir: this.config.routeDir,
+ ignore: this.config.ignore,
+ },
+ );
+
+ for (let i = 0; i < islands.length; i++) {
+ this.registerIsland(islands[i]);
+ }
+
+ this.#fsRoutes.files = routes;
}
async #build(buildCache: DevBuildCache, dev: boolean): Promise {
diff --git a/src/dev/builder_test.ts b/src/dev/builder_test.ts
index c8645666..a2a54600 100644
--- a/src/dev/builder_test.ts
+++ b/src/dev/builder_test.ts
@@ -3,7 +3,7 @@ import * as path from "@std/path";
import { Builder, specToName } from "./builder.ts";
import { App } from "../app.ts";
import { DEV_ERROR_OVERLAY_URL } from "../constants.ts";
-import { BUILD_ID } from "../runtime/build_id.ts";
+import { BUILD_ID } from "fresh/build-id";
import { withTmpDir, writeFiles } from "../test_utils.ts";
import { withChildProcessServer } from "../../tests/test_utils.tsx";
@@ -64,7 +64,7 @@ Deno.test({
await builder.build();
const snapshotJson = await Deno.readTextFile(
- path.join(tmp, "dist", "static-files.json"),
+ path.join(tmp, "dist", "snapshot.js"),
);
expect(snapshotJson).toContain("/images/batman.svg");
},
diff --git a/src/dev/dev_build_cache.ts b/src/dev/dev_build_cache.ts
index 9c45b36e..a0b59cba 100644
--- a/src/dev/dev_build_cache.ts
+++ b/src/dev/dev_build_cache.ts
@@ -1,11 +1,10 @@
import {
type BuildCache,
- type FileSnapshot,
IslandPreparer,
type StaticFile,
} from "../build_cache.ts";
import * as path from "@std/path";
-import { SEPARATOR as WINDOWS_SEPARATOR } from "@std/path/windows/constants";
+import * as pathWin32 from "@std/path/windows";
import { encodeHex } from "@std/encoding/hex";
import { fsAdapter } from "../fs.ts";
import type { FileTransformer } from "./file_transformer.ts";
@@ -16,6 +15,8 @@ import type { Command } from "../commands.ts";
import type { ServerIslandRegistry } from "../context.ts";
import { contentType as getStdContentType } from "@std/media-types/content-type";
+const WINDOWS_SEPARATOR = pathWin32.SEPARATOR;
+
export interface MemoryFile {
hash: string | null;
contentType: string;
@@ -60,16 +61,24 @@ export class MemoryBuildCache implements DevBuildCache {
#commands: Command[] = [];
root: string;
islandRegistry: ServerIslandRegistry = new Map();
+ clientEntry: string;
+ features = { errorOverlay: false };
constructor(
config: ResolvedBuildConfig,
fsRoutes: FsRoute,
transformer: FileTransformer,
) {
+ if (config.mode === "development") {
+ this.features.errorOverlay = true;
+ }
+
this.#config = config;
this.#fsRoutes = fsRoutes;
this.#transformer = transformer;
this.root = config.root;
+
+ this.clientEntry = getClientEntry(config.buildId);
}
getFsRoutes(): Command[] {
@@ -220,12 +229,17 @@ export class DiskBuildCache implements DevBuildCache {
#fsRoutes: FsRoute;
root: string;
islandRegistry: ServerIslandRegistry = new Map();
+ clientEntry: string = "";
+ features = { errorOverlay: false };
constructor(
config: ResolvedBuildConfig,
fsRoutes: FsRoute,
transformer: FileTransformer,
) {
+ if (config.mode === "development") {
+ this.features.errorOverlay = true;
+ }
this.#fsRoutes = fsRoutes;
this.#transformer = transformer;
this.#config = config;
@@ -308,155 +322,62 @@ export class DiskBuildCache implements DevBuildCache {
}
}
- const staticFiles = new Map();
+ const staticFiles: PendingStaticFile[] = [];
for (const [name, filePath] of this.#unprocessedFiles.entries()) {
- const file = await Deno.open(filePath);
- const hash = await hashContent(file.readable);
-
- staticFiles.set(name, {
- name,
- hash,
- filePath: path.relative(root, filePath),
- contentType: getContentType(filePath),
- });
+ staticFiles.push({ filePath, pathname: name, hash: null });
}
for (const [name, maybeHash] of this.#processedFiles.entries()) {
- let hash = maybeHash;
-
// Ignore esbuild meta file. It's not intended for serving
if (name === "/metafile.json") {
continue;
}
const filePath = path.join(outDir, "static", name);
- if (maybeHash === null) {
- const file = await Deno.open(filePath);
- hash = await hashContent(file.readable);
- }
-
- staticFiles.set(name, {
- name,
- hash,
- filePath: path.relative(root, filePath),
- contentType: getContentType(filePath),
- });
+ staticFiles.push({ filePath, pathname: name, hash: maybeHash });
}
- await Deno.writeTextFile(
- path.join(outDir, "static-files.json"),
- JSON.stringify(Array.from(staticFiles.values()), null, 2),
- );
-
const islandSpecifiers: string[] = [];
for (const spec of this.islandModNameToChunk.keys()) {
islandSpecifiers.push(spec);
}
- const editWarning =
- `// WARNING: DO NOT EDIT THIS FILE. It is autogenerated by Fresh.`;
-
const islands = Array.from(this.islandModNameToChunk.values());
await Deno.writeTextFile(
path.join(outDir, "snapshot.js"),
- `${editWarning}
-
-import { IslandPreparer } from "fresh/do-not-use";
-import staticFileData from "./static-files.json" with { type: "json" };
-
-// Import islands
-${
- islands
- .map((item) => {
- const spec = pathToSpec(outDir, item.server);
- return `import * as ${item.name} from "${spec}";`;
- })
- .join("\n")
- }
-
-// Import routes
-${
- this.#fsRoutes.files
- .map((item, i) => {
- if (item.lazy) return null;
- const spec = pathToSpec(outDir, item.filePath);
- return `import * as fsRoute_${i} from "${spec}"`;
- })
- .filter(Boolean)
- .join("\n")
- }
-
-export const version = ${JSON.stringify(this.#config.buildId)};
-
-const prefix = \`/_fresh/js/\${version}\`;
-
-export const islands = new Map();
-const islandPreparer = new IslandPreparer();
-${
- islands.map((item) => {
- // Strip prefix
- const prefix = `/_fresh/js/${this.#config.buildId}`;
- const chunkName = item.browser
- ? item.browser.slice(prefix.length)
- : item.browser;
- return `islandPreparer.prepare(islands, ${item.name}, \`\${prefix}${chunkName}\`, ${
- JSON.stringify(item.name)
- });`;
- }).join("\n")
- }
-
-export const staticFiles = new Map();
-for (let i = 0; i < staticFileData.length; i++) {
- const data = staticFileData[i];
- staticFiles.set(data.name, data);
-}
-
-export const fsRoutes = [
-${
- this.#fsRoutes.files
- .map((item, i) => {
- const id = JSON.stringify(item.id);
- const pattern = JSON.stringify(item.pattern);
- const type = JSON.stringify(item.type);
- const routePattern = JSON.stringify(item.routePattern);
-
- let mod = "";
- if (item.lazy) {
- const spec = pathToSpec(outDir, item.filePath);
- mod = `() => import(${JSON.stringify(spec)})`;
- } else {
- mod = `fsRoute_${i}`;
- }
-
- return ` { id: ${id}, mod: ${mod}, type: ${type}, pattern: ${pattern}, routePattern: ${routePattern} },`;
- })
- .join("\n")
- }
-];
-`,
+ await generateSnapshotServer({
+ buildId: this.#config.buildId,
+ clientEntry: getClientEntry(this.#config.buildId),
+ staticFiles,
+ islands,
+ writeSpecifier: (filePath) => {
+ return pathToSpec(outDir, filePath);
+ },
+ fsRoutesFiles: this.#fsRoutes.files,
+ outDir: root,
+ }),
);
// TODO: Make main file configurable
const appPath = path.relative(outDir, root);
await Deno.writeTextFile(
path.join(outDir, "server.js"),
- `${editWarning}
-import { setBuildCache, ProdBuildCache, path } from "fresh/do-not-use";
-import * as snapshot from "./snapshot.js";
-import { app } from "${appPath}/main.ts";
-
-const root = path.join(import.meta.dirname, ${JSON.stringify(appPath)});
-setBuildCache(app, new ProdBuildCache(root, snapshot));
-
-export default {
- fetch: app.handler()
-}`,
+ generateServerEntry({
+ root: appPath,
+ serverEntry: path
+ .join(appPath, "main.ts")
+ .replaceAll(/[\\/]+/g, "/"),
+ snapshotSpecifier: "./snapshot.js",
+ }),
);
}
}
-async function hashContent(
+const EDIT_WARNING =
+ `// WARNING: DO NOT EDIT THIS FILE. It is autogenerated by Fresh.`;
+
+export async function hashContent(
content: Uint8Array | ReadableStream,
): Promise {
const buffer = await new Response(content).arrayBuffer();
@@ -476,3 +397,137 @@ export function getContentType(filePath: string): string {
function maybeToFileUrl(file: string) {
return file.startsWith("file://") ? file : path.toFileUrl(file).href;
}
+
+export interface PendingStaticFile {
+ pathname: string;
+ filePath: string;
+ hash: string | null;
+}
+
+export async function generateSnapshotServer(
+ options: {
+ outDir: string;
+ buildId: string;
+ clientEntry: string;
+ islands: IslandModChunk[];
+ // deno-lint-ignore no-explicit-any
+ fsRoutesFiles: FsRouteFileNoMod[];
+ staticFiles: PendingStaticFile[];
+ writeSpecifier: (filePath: string) => string;
+ },
+): Promise {
+ const {
+ islands,
+ writeSpecifier,
+ fsRoutesFiles,
+ outDir,
+ } = options;
+
+ const islandImports = islands
+ .map((item) => {
+ const spec = writeSpecifier(item.server);
+ return `import * as ${item.name} from "${spec}";`;
+ })
+ .join("\n");
+
+ const fsRouteImports = fsRoutesFiles
+ .map((item, i) => {
+ if (item.lazy) return null;
+ const spec = writeSpecifier(item.filePath);
+ return `import * as fsRoute_${i} from "${spec}"`;
+ })
+ .filter(Boolean)
+ .join("\n");
+
+ const islandMarkers = islands.map((item) => {
+ const browser = JSON.stringify(item.browser);
+ const name = JSON.stringify(item.name);
+ return `islandPreparer.prepare(islands, ${item.name}, ${browser}, ${name});`;
+ }).join("\n");
+
+ const serializedFsRoutes = fsRoutesFiles
+ .map((item, i) => {
+ const id = JSON.stringify(item.id);
+ const pattern = JSON.stringify(item.pattern);
+ const type = JSON.stringify(item.type);
+ const routePattern = JSON.stringify(item.routePattern);
+
+ let mod = "";
+ if (item.lazy) {
+ const spec = writeSpecifier(item.filePath);
+ mod = `() => import(${JSON.stringify(spec)})`;
+ } else {
+ mod = `fsRoute_${i}`;
+ }
+
+ return ` { id: ${id}, mod: ${mod}, type: ${type}, pattern: ${pattern}, routePattern: ${routePattern} },`;
+ })
+ .join("\n");
+
+ const staticFiles = await Promise.all(
+ options.staticFiles.map(async (item) => {
+ const file = await Deno.open(item.filePath);
+ const hash = item.hash ? item.hash : await hashContent(file.readable);
+ const url = new URL(item.pathname, "http://localhost");
+
+ return {
+ name: url.pathname,
+ hash,
+ filePath: path.isAbsolute(item.filePath)
+ ? path.relative(outDir, item.filePath)
+ : item.filePath,
+ contentType: getContentType(item.filePath),
+ };
+ }),
+ );
+
+ return `${EDIT_WARNING}
+import { IslandPreparer } from "fresh/internal";
+${islandImports}
+${fsRouteImports}
+
+export const clientEntry = ${JSON.stringify(options.clientEntry)}
+export const version = ${JSON.stringify(options.buildId)}
+
+export const islands = new Map();
+const islandPreparer = new IslandPreparer();
+${islandMarkers}
+
+export const staticFiles = new Map([
+${
+ staticFiles.map((def) =>
+ ` [${JSON.stringify(def.name)}, ${JSON.stringify(def)}]`
+ ).join(",\n")
+ }
+]);
+
+export const fsRoutes = [
+${serializedFsRoutes}
+];
+`.replaceAll(/\n[\n]+/g, "\n\n");
+}
+
+export function generateServerEntry(
+ options: {
+ root: string;
+ serverEntry: string;
+ snapshotSpecifier: string;
+ },
+): string {
+ return `${EDIT_WARNING}
+import { setBuildCache, ProdBuildCache, path } from "fresh/internal";
+import * as snapshot from "${options.snapshotSpecifier}";
+import { app } from "${options.serverEntry}";
+
+const root = "";
+setBuildCache(app, new ProdBuildCache(root, snapshot), "production");
+
+export default {
+ fetch: app.handler()
+};
+`;
+}
+
+function getClientEntry(buildId: string) {
+ return `/_fresh/js/${buildId}/fresh-runtime.js`;
+}
diff --git a/src/dev/esbuild.ts b/src/dev/esbuild.ts
index 496972aa..eec6289d 100644
--- a/src/dev/esbuild.ts
+++ b/src/dev/esbuild.ts
@@ -166,14 +166,14 @@ function buildIdPlugin(buildId: string): EsbuildPlugin {
return {
name: "fresh-build-id",
setup(build) {
- build.onResolve({ filter: /[/\\]+build_id\.ts$/ }, (args) => {
+ build.onResolve({ filter: /^fresh\/build-id$/ }, (args) => {
return {
path: args.path,
namespace: "fresh-internal",
};
});
build.onLoad({
- filter: /[/\\]build_id\.ts$/,
+ filter: /^fresh\/build-id$/,
namespace: "fresh-internal",
}, () => {
return {
diff --git a/src/dev/fs_crawl.ts b/src/dev/fs_crawl.ts
index 9cc9832f..126358af 100644
--- a/src/dev/fs_crawl.ts
+++ b/src/dev/fs_crawl.ts
@@ -1,4 +1,4 @@
-import type { FsAdapter } from "../fs.ts";
+import { type FsAdapter, fsAdapter } from "../fs.ts";
import type { WalkEntry } from "@std/fs/walk";
import type { FsRouteFileNoMod } from "./dev_build_cache.ts";
import * as path from "@std/path";
@@ -14,92 +14,90 @@ export async function crawlRouteDir(
routeDir: string,
ignore: RegExp[],
onIslandSpecifier: (spec: string) => void,
- files: FsRouteFileNoMod[],
-) {
- await walkDir(
- fs,
- routeDir,
- async (entry) => {
- // A `(_islands)` path segment is a local island folder.
- // Any route path segment wrapped in `(_...)` is ignored
- // during route collection.
- const match = entry.path.match(GROUP_REG);
- if (match !== null) {
- if (match[1] === "_islands") {
- onIslandSpecifier(entry.path);
+): Promise[]> {
+ const files: FsRouteFileNoMod[] = [];
+
+ await walkDir(fs, routeDir, async (entry) => {
+ // A `(_islands)` path segment is a local island folder.
+ // Any route path segment wrapped in `(_...)` is ignored
+ // during route collection.
+ const match = entry.path.match(GROUP_REG);
+ if (match !== null) {
+ if (match[1] === "_islands") {
+ onIslandSpecifier(entry.path);
+ }
+ return;
+ }
+
+ let lazy = false;
+ const relative = path.relative(routeDir, entry.path);
+ const url = new URL(relative, "http://localhost/");
+ const id = url.pathname.slice(0, url.pathname.lastIndexOf("."));
+
+ let overrideConfig: RouteConfig | undefined;
+ let pattern = "*";
+ let routePattern = pattern;
+ let type = CommandType.Route;
+ if (id.endsWith("/_middleware")) {
+ type = CommandType.Middleware;
+ pattern = pathToPattern(
+ id.slice(1, -"/_middleware".length),
+ { keepGroups: true },
+ );
+ routePattern = pattern;
+ } else if (id.endsWith("/_layout")) {
+ type = CommandType.Layout;
+ pattern = pathToPattern(
+ id.slice(1, -"/_layout".length),
+ { keepGroups: true },
+ );
+ routePattern = pattern;
+ } else if (id.endsWith("/_app")) {
+ type = CommandType.App;
+ } else if (id.endsWith("/_404")) {
+ type = CommandType.NotFound;
+ } else if (id.endsWith("/_error") || id.endsWith("/_500")) {
+ type = CommandType.Error;
+ pattern = pathToPattern(
+ id.slice(1, -"/_error".length),
+ { keepGroups: true },
+ );
+ routePattern = pattern;
+ } else {
+ pattern = pathToPattern(id.slice(1), { keepGroups: true });
+ if (id.endsWith("/index")) {
+ if (!pattern.endsWith("/")) {
+ pattern += "/";
}
- return;
}
- let lazy = false;
- const relative = path.relative(routeDir, entry.path);
- const url = new URL(relative, "http://localhost/");
- const id = url.pathname.slice(0, url.pathname.lastIndexOf("."));
+ routePattern = pathToPattern(id.slice(1));
- let overrideConfig: RouteConfig | undefined;
- let pattern = "*";
- let routePattern = pattern;
- let type = CommandType.Route;
- if (id.endsWith("/_middleware")) {
- type = CommandType.Middleware;
- pattern = pathToPattern(
- id.slice(1, -"/_middleware".length),
- { keepGroups: true },
- );
- routePattern = pattern;
- } else if (id.endsWith("/_layout")) {
- type = CommandType.Layout;
- pattern = pathToPattern(
- id.slice(1, -"/_layout".length),
- { keepGroups: true },
- );
- routePattern = pattern;
- } else if (id.endsWith("/_app")) {
- type = CommandType.App;
- } else if (id.endsWith("/_404")) {
- type = CommandType.NotFound;
- } else if (id.endsWith("/_error") || id.endsWith("/_500")) {
- type = CommandType.Error;
- pattern = pathToPattern(
- id.slice(1, -"/_error".length),
- { keepGroups: true },
- );
- routePattern = pattern;
- } else {
- pattern = pathToPattern(id.slice(1), { keepGroups: true });
- if (id.endsWith("/index")) {
- if (!pattern.endsWith("/")) {
- pattern += "/";
- }
- }
+ const code = await fs.readTextFile(entry.path);
+ lazy = !code.includes("routeOverride");
- routePattern = pathToPattern(id.slice(1));
+ // TODO: We could do an AST parse here to detect the
+ // kind of handler that's used to get a more accurate
+ // list of methods this route supports.
+ overrideConfig = {
+ methods: "ALL",
+ };
+ }
- const code = await fs.readTextFile(entry.path);
- lazy = !code.includes("routeOverride");
-
- // TODO: We could do an AST parse here to detect the
- // kind of handler that's used to get a more accurate
- // list of methods this route supports.
- overrideConfig = {
- methods: "ALL",
- };
- }
-
- files.push({
- id,
- filePath: entry.path,
- type,
- pattern,
- routePattern,
- lazy,
- overrideConfig,
- });
- },
- ignore,
- );
+ files.push({
+ id,
+ filePath: entry.path,
+ type,
+ pattern,
+ routePattern,
+ lazy,
+ overrideConfig,
+ });
+ }, ignore);
files.sort((a, b) => sortRoutePaths(a.id, b.id));
+
+ return files;
}
export async function walkDir(
@@ -121,3 +119,28 @@ export async function walkDir(
await callback(entry);
}
}
+
+export async function crawlFsItem(
+ options: { islandDir: string; routeDir: string; ignore: RegExp[] },
+): Promise<{ islands: string[]; routes: FsRouteFileNoMod[] }> {
+ const islands: string[] = [];
+
+ const [, routes] = await Promise.all([
+ walkDir(
+ fsAdapter,
+ options.islandDir,
+ (entry) => {
+ islands.push(entry.path);
+ },
+ options.ignore,
+ ),
+ crawlRouteDir(
+ fsAdapter,
+ options.routeDir,
+ options.ignore,
+ (entry) => islands.push(entry),
+ ),
+ ]);
+
+ return { islands, routes };
+}
diff --git a/src/dev/middlewares/error_overlay/code_frame.tsx b/src/dev/middlewares/error_overlay/code_frame.tsx
index 203a512a..047031d5 100644
--- a/src/dev/middlewares/error_overlay/code_frame.tsx
+++ b/src/dev/middlewares/error_overlay/code_frame.tsx
@@ -89,7 +89,7 @@ function getFirstUserFile(
const lines = stack.split("\n");
for (let i = 0; i < lines.length; i++) {
const match = lines[i].match(STACK_FRAME);
- if (match && match) {
+ if (match) {
const fnName = match[1] ?? "";
const file = match[2];
const line = +match[3];
diff --git a/src/dev/middlewares/error_overlay/middleware_test.tsx b/src/dev/middlewares/error_overlay/middleware_test.tsx
index ba72b8c3..8e7a2d01 100644
--- a/src/dev/middlewares/error_overlay/middleware_test.tsx
+++ b/src/dev/middlewares/error_overlay/middleware_test.tsx
@@ -86,9 +86,8 @@ Deno.test(
);
Deno.test("error overlay - should not be visible in prod", async () => {
- const app = new App();
+ const app = new App({ mode: "production" });
app.use(devErrorOverlay());
- app.config.mode = "production";
app.get("/", () => {
throw new HttpError(500);
diff --git a/src/fs_routes_test.tsx b/src/fs_routes_test.tsx
index b76c14c8..1332d0da 100644
--- a/src/fs_routes_test.tsx
+++ b/src/fs_routes_test.tsx
@@ -9,7 +9,6 @@ import type { Method } from "./router.ts";
import { parseHtml } from "../tests/test_utils.tsx";
import type { Context } from "./context.ts";
import { HttpError } from "./error.ts";
-import type { FsRouteFileNoMod } from "./dev/dev_build_cache.ts";
import { crawlRouteDir } from "./dev/fs_crawl.ts";
import * as path from "@std/path";
@@ -19,8 +18,7 @@ async function createServer(
const fs = createFakeFs(files);
const routeDir = path.join(fs.cwd(), "routes");
- const rawFiles: FsRouteFileNoMod[] = [];
- await crawlRouteDir(fs, routeDir, [], () => {}, rawFiles);
+ const rawFiles = await crawlRouteDir(fs, routeDir, [], () => {});
const fsFiles = rawFiles.map((file) => {
// deno-lint-ignore no-explicit-any
@@ -30,8 +28,8 @@ async function createServer(
const app = new App()
.fsRoutes();
- const buildCache = new MockBuildCache(fsFiles);
- setBuildCache(app, buildCache);
+ const buildCache = new MockBuildCache(fsFiles, "development");
+ setBuildCache(app, buildCache, "development");
return new FakeServer(app.handler());
}
@@ -229,7 +227,9 @@ Deno.test("fsRoutes - middleware array", async () => {
return ctx.next();
},
},
- "routes/foo/index.ts": { default: (ctx) => {ctx.state.text}
},
+ "routes/foo/index.ts": {
+ default: (ctx) => {ctx.state.text}
,
+ },
});
const res = await server.get("/foo");
diff --git a/src/internals_dev.ts b/src/internals_dev.ts
new file mode 100644
index 00000000..27ba8825
--- /dev/null
+++ b/src/internals_dev.ts
@@ -0,0 +1,11 @@
+export { crawlFsItem } from "./dev/fs_crawl.ts";
+export { type FsAdapter, fsAdapter } from "./fs.ts";
+export {
+ type FsRouteFileNoMod,
+ generateServerEntry,
+ generateSnapshotServer,
+ type IslandModChunk,
+ type PendingStaticFile,
+} from "./dev/dev_build_cache.ts";
+export { specToName } from "./dev/builder.ts";
+export { pathToSpec, UniqueNamer } from "./utils.ts";
diff --git a/src/middlewares/static_files.ts b/src/middlewares/static_files.ts
index 57899ff7..370b9c29 100644
--- a/src/middlewares/static_files.ts
+++ b/src/middlewares/static_files.ts
@@ -1,6 +1,6 @@
import type { Middleware } from "./mod.ts";
import { ASSET_CACHE_BUST_KEY } from "../runtime/shared_internal.tsx";
-import { BUILD_ID } from "../runtime/build_id.ts";
+import { BUILD_ID } from "fresh/build-id";
import { tracer } from "../otel.ts";
import { getBuildCache } from "../context.ts";
diff --git a/src/middlewares/static_files_test.ts b/src/middlewares/static_files_test.ts
index a85ba3b2..eec3d60c 100644
--- a/src/middlewares/static_files_test.ts
+++ b/src/middlewares/static_files_test.ts
@@ -3,7 +3,7 @@ import { serveMiddleware } from "../test_utils.ts";
import type { BuildCache, StaticFile } from "../build_cache.ts";
import { expect } from "@std/expect";
import { ASSET_CACHE_BUST_KEY } from "../runtime/shared_internal.tsx";
-import { BUILD_ID } from "../runtime/build_id.ts";
+import { BUILD_ID } from "fresh/build-id";
import type { Command } from "../commands.ts";
import type { ServerIslandRegistry } from "../context.ts";
import { getContentType } from "../dev/dev_build_cache.ts";
@@ -13,6 +13,8 @@ class MockBuildCache implements BuildCache {
buildId = "MockId";
files = new Map();
islandRegistry: ServerIslandRegistry = new Map();
+ clientEntry = "";
+ features = { errorOverlay: false };
constructor(files: Record) {
const encoder = new TextEncoder();
diff --git a/src/render.ts b/src/render.ts
index d5000898..5588492d 100644
--- a/src/render.ts
+++ b/src/render.ts
@@ -14,7 +14,6 @@ import type { Context } from "./context.ts";
import { recordSpanError, tracer } from "./otel.ts";
import { DEV_ERROR_OVERLAY_URL } from "./constants.ts";
import { renderToString } from "preact-render-to-string";
-import { BUILD_ID } from "./runtime/build_id.ts";
export type AsyncAnyComponent = {
(
@@ -85,12 +84,17 @@ export function preactRender(
} finally {
// Add preload headers
const basePath = ctx.config.basePath;
- const runtimeUrl = `${basePath}/_fresh/js/${BUILD_ID}/fresh-runtime.js`;
- let link = `<${encodeURI(runtimeUrl)}>; rel="modulepreload"; as="script"`;
+ const runtimeUrl = state.buildCache.clientEntry.startsWith(".")
+ ? state.buildCache.clientEntry.slice(1)
+ : state.buildCache.clientEntry;
+ let link = `<${
+ encodeURI(`${basePath}${runtimeUrl}`)
+ }>; rel="modulepreload"; as="script"`;
state.islands.forEach((island) => {
- link += `, <${
- encodeURI(`${basePath}${island.file}`)
- }>; rel="modulepreload"; as="script"`;
+ const specifier = `${basePath}${
+ island.file.startsWith(".") ? island.file.slice(1) : island.file
+ }`;
+ link += `, <${encodeURI(specifier)}>; rel="modulepreload"; as="script"`;
});
if (link !== "") {
diff --git a/src/runtime/build_id.ts b/src/runtime/build_id.ts
index 1e9ddcd8..a7f3375b 100644
--- a/src/runtime/build_id.ts
+++ b/src/runtime/build_id.ts
@@ -1,6 +1,8 @@
import { encodeHex } from "@std/encoding/hex";
-export const DENO_DEPLOYMENT_ID = Deno.env.get("DENO_DEPLOYMENT_ID");
+export const DENO_DEPLOYMENT_ID: string | undefined = Deno.env.get(
+ "DENO_DEPLOYMENT_ID",
+);
const deploymentId = DENO_DEPLOYMENT_ID ||
// For CI
Deno.env.get("GITHUB_SHA") ||
@@ -10,8 +12,8 @@ const buildIdHash = await crypto.subtle.digest(
new TextEncoder().encode(deploymentId),
);
-export let BUILD_ID = encodeHex(buildIdHash);
+export let BUILD_ID: string = encodeHex(buildIdHash);
-export function setBuildId(buildId: string) {
+export function setBuildId(buildId: string): void {
BUILD_ID = buildId;
}
diff --git a/src/runtime/client/partials.ts b/src/runtime/client/partials.ts
index 5db02a99..26af1878 100644
--- a/src/runtime/client/partials.ts
+++ b/src/runtime/client/partials.ts
@@ -329,7 +329,7 @@ export async function applyPartials(res: Response): Promise {
for (let i = 0; i < json.islands.length; i++) {
const island = json.islands[i];
promises.push(
- import(island.chunk).then((mod) => {
+ import(/* @vite-ignore */ island.chunk).then((mod) => {
ISLAND_REGISTRY.set(island.name, mod[island.exportName]);
}),
);
diff --git a/src/runtime/client/preact_hooks_client.ts b/src/runtime/client/preact_hooks_client.ts
index 34564882..9684385a 100644
--- a/src/runtime/client/preact_hooks_client.ts
+++ b/src/runtime/client/preact_hooks_client.ts
@@ -1,6 +1,6 @@
import { options } from "preact";
import { assetHashingHook, CLIENT_NAV_ATTR } from "../shared_internal.tsx";
-import { BUILD_ID } from "../build_id.ts";
+import { BUILD_ID } from "fresh/build-id";
const oldVNodeHook = options.vnode;
options.vnode = (vnode) => {
diff --git a/src/runtime/server/preact_hooks.tsx b/src/runtime/server/preact_hooks.tsx
index 09d209f5..ab01760c 100644
--- a/src/runtime/server/preact_hooks.tsx
+++ b/src/runtime/server/preact_hooks.tsx
@@ -23,7 +23,7 @@ import {
setActiveUrl,
} from "../shared_internal.tsx";
import type { BuildCache } from "../../build_cache.ts";
-import { BUILD_ID } from "../build_id.ts";
+import { BUILD_ID } from "fresh/build-id";
import {
DEV_ERROR_OVERLAY_URL,
PARTIAL_SEARCH_PARAM,
@@ -433,7 +433,8 @@ export interface PartialStateJson {
}
function FreshRuntimeScript() {
- const { islands, nonce, ctx, islandProps, partialId } = RENDER_STATE!;
+ const { islands, nonce, ctx, islandProps, partialId, buildCache } =
+ RENDER_STATE!;
const basePath = ctx.config.basePath;
const islandArr = Array.from(islands);
@@ -470,7 +471,11 @@ function FreshRuntimeScript() {
: island.exportName === island.name
? `{ ${island.exportName} }`
: `{ ${island.exportName} as ${island.name} }`;
- return `import ${named} from "${`${basePath}${island.file}`}";`;
+
+ const islandSpec = island.file.startsWith(".")
+ ? island.file.slice(1)
+ : island.file;
+ return `import ${named} from "${basePath}${islandSpec}";`;
}).join("");
const islandObj = "{" + islandArr.map((island) => island.name)
@@ -482,9 +487,12 @@ function FreshRuntimeScript() {
{ json: true },
);
- const runtimeUrl = `${basePath}/_fresh/js/${BUILD_ID}/fresh-runtime.js`;
+ // const runtimeUrl = `${basePath}/_fresh/js/${BUILD_ID}/fresh-runtime.js`;
+ const runtimeUrl = buildCache.clientEntry.startsWith(".")
+ ? buildCache.clientEntry.slice(1)
+ : buildCache.clientEntry;
const scriptContent =
- `import { boot } from "${runtimeUrl}";${islandImports}boot(${islandObj},${serializedProps});`;
+ `import { boot } from "${basePath}${runtimeUrl}";${islandImports}boot(${islandObj},${serializedProps});`;
return (
<>
@@ -496,7 +504,7 @@ function FreshRuntimeScript() {
__html: scriptContent,
}}
/>
- {ctx.config.mode === "development" ? : null}
+ {buildCache.features.errorOverlay ? : null}
>
);
}
diff --git a/src/runtime/shared.ts b/src/runtime/shared.ts
index c2293ac6..f316a834 100644
--- a/src/runtime/shared.ts
+++ b/src/runtime/shared.ts
@@ -1,5 +1,5 @@
import type { ComponentChildren, VNode } from "preact";
-import { BUILD_ID } from "./build_id.ts";
+import { BUILD_ID } from "fresh/build-id";
import { assetInternal, assetSrcSetInternal } from "./shared_internal.tsx";
/**
diff --git a/src/test_utils.ts b/src/test_utils.ts
index fa408dc1..449f9d54 100644
--- a/src/test_utils.ts
+++ b/src/test_utils.ts
@@ -83,7 +83,7 @@ export function serveMiddleware(
(() => new Response("not found", { status: 404 }));
const config = options.config ?? DEFAULT_CONFIG;
const buildCache = options.buildCache ??
- new MockBuildCache([]);
+ new MockBuildCache([], options.config?.mode ?? "production");
const ctx = new Context(
req,
@@ -149,9 +149,12 @@ export async function withTmpDir(
export class MockBuildCache implements BuildCache {
#files: FsRouteFile[];
root = "";
+ clientEntry = "";
islandRegistry: ServerIslandRegistry = new Map();
+ features = { errorOverlay: false };
- constructor(files: FsRouteFile[]) {
+ constructor(files: FsRouteFile[], mode: "development" | "production") {
+ this.features.errorOverlay = mode === "development";
this.#files = files;
}
diff --git a/tests/test_utils.tsx b/tests/test_utils.tsx
index 226b656c..df482a22 100644
--- a/tests/test_utils.tsx
+++ b/tests/test_utils.tsx
@@ -124,7 +124,8 @@ export async function withChildProcessServer(
let address = "";
let found = false;
// @ts-ignore yes it does
- for await (const line of lines.values({ preventCancel: true })) {
+ for await (const raw of lines.values({ preventCancel: true })) {
+ const line = colors.stripAnsiCode(raw);
output.push(line);
const match = line.match(
/https?:\/\/[^:]+:\d+(\/\w+[-\w]*)*/g,