diff --git a/.prettierrc b/.prettierrc index b35e33e7..3446d363 100644 --- a/.prettierrc +++ b/.prettierrc @@ -8,6 +8,7 @@ "^node:(.*)$", "^[./]" ], + "importAttributes": true, "importOrderSeparation": true, "importOrderSortSpecifiers": true, "overrides": [ diff --git a/examples/react/rsc/fw/CHANGELOG.md b/examples/react/rsc/fw/CHANGELOG.md index d2314547..6687bef4 100644 --- a/examples/react/rsc/fw/CHANGELOG.md +++ b/examples/react/rsc/fw/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/react/rsc/fw/package.json b/examples/react/rsc/fw/package.json index c8c97b61..26b6d781 100644 --- a/examples/react/rsc/fw/package.json +++ b/examples/react/rsc/fw/package.json @@ -15,7 +15,7 @@ "react": "0.0.0-experimental-035a41c4e-20230704", "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/react/rsc/spa/CHANGELOG.md b/examples/react/rsc/spa/CHANGELOG.md index 2743dc32..9b5f8653 100644 --- a/examples/react/rsc/spa/CHANGELOG.md +++ b/examples/react/rsc/spa/CHANGELOG.md @@ -4,6 +4,15 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - @vinxi/server-functions@0.0.38 + - vinxi@0.0.46 + - @vinxi/server-components@0.0.38 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 - @vinxi/server-components@0.0.37 diff --git a/examples/react/rsc/spa/package.json b/examples/react/rsc/spa/package.json index 6794a808..bd40080c 100644 --- a/examples/react/rsc/spa/package.json +++ b/examples/react/rsc/spa/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@picocss/pico": "^1.5.10", - "@vinxi/server-components": "0.0.37", - "@vinxi/server-functions": "0.0.37", + "@vinxi/server-components": "0.0.38", + "@vinxi/server-functions": "0.0.38", "@vinxi/react": "0.0.12", "@vinxi/react-server-dom": "0.0.3", "@vitejs/plugin-react": "^4.0.4", @@ -21,7 +21,7 @@ "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", "unstorage": "^1.9.0", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/react/spa/basic/CHANGELOG.md b/examples/react/spa/basic/CHANGELOG.md index e9c90dc3..fd29af7c 100644 --- a/examples/react/spa/basic/CHANGELOG.md +++ b/examples/react/spa/basic/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/react/spa/basic/package.json b/examples/react/spa/basic/package.json index c0751541..960dc805 100644 --- a/examples/react/spa/basic/package.json +++ b/examples/react/spa/basic/package.json @@ -16,7 +16,7 @@ "react": "0.0.0-experimental-035a41c4e-20230704", "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/react/spa/mdx/CHANGELOG.md b/examples/react/spa/mdx/CHANGELOG.md index 9d589b04..96502b19 100644 --- a/examples/react/spa/mdx/CHANGELOG.md +++ b/examples/react/spa/mdx/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/react/spa/mdx/package.json b/examples/react/spa/mdx/package.json index 0c62799b..872048fb 100644 --- a/examples/react/spa/mdx/package.json +++ b/examples/react/spa/mdx/package.json @@ -20,7 +20,7 @@ "react": "0.0.0-experimental-035a41c4e-20230704", "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45", + "vinxi": "0.0.46", "vite-plugin-inspect": "^0.7.38", "wouter": "^2.11.0" }, diff --git a/examples/react/spa/tanstack-router-app/CHANGELOG.md b/examples/react/spa/tanstack-router-app/CHANGELOG.md index 04a8dafc..387bb9bd 100644 --- a/examples/react/spa/tanstack-router-app/CHANGELOG.md +++ b/examples/react/spa/tanstack-router-app/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/react/spa/tanstack-router-app/package.json b/examples/react/spa/tanstack-router-app/package.json index 1db6da9e..0bc6771c 100644 --- a/examples/react/spa/tanstack-router-app/package.json +++ b/examples/react/spa/tanstack-router-app/package.json @@ -21,7 +21,7 @@ "react": "0.0.0-experimental-035a41c4e-20230704", "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/react/spa/tanstack-router/CHANGELOG.md b/examples/react/spa/tanstack-router/CHANGELOG.md index ce787739..11272931 100644 --- a/examples/react/spa/tanstack-router/CHANGELOG.md +++ b/examples/react/spa/tanstack-router/CHANGELOG.md @@ -4,6 +4,14 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + - @vinxi/openapi@0.0.3 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 - @vinxi/openapi@0.0.3 diff --git a/examples/react/spa/tanstack-router/package.json b/examples/react/spa/tanstack-router/package.json index 9b1d9394..1f850104 100644 --- a/examples/react/spa/tanstack-router/package.json +++ b/examples/react/spa/tanstack-router/package.json @@ -23,7 +23,7 @@ "react": "0.0.0-experimental-035a41c4e-20230704", "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/react/spa/wouter/package.json b/examples/react/spa/wouter/package.json index 859b29ca..17ce5166 100644 --- a/examples/react/spa/wouter/package.json +++ b/examples/react/spa/wouter/package.json @@ -22,6 +22,6 @@ "@vitejs/plugin-react": "^4.0.4", "autoprefixer": "^10.4.15", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" } } diff --git a/examples/react/ssr/basic-cloudflare/CHANGELOG.md b/examples/react/ssr/basic-cloudflare/CHANGELOG.md index f96bc101..d88bdcc5 100644 --- a/examples/react/ssr/basic-cloudflare/CHANGELOG.md +++ b/examples/react/ssr/basic-cloudflare/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/react/ssr/basic-cloudflare/package.json b/examples/react/ssr/basic-cloudflare/package.json index 90df79ab..11cee839 100644 --- a/examples/react/ssr/basic-cloudflare/package.json +++ b/examples/react/ssr/basic-cloudflare/package.json @@ -22,7 +22,7 @@ "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", "unenv": "^1.7.4", - "vinxi": "0.0.45", + "vinxi": "0.0.46", "ws": "^8.13.0" }, "devDependencies": { diff --git a/examples/react/ssr/basic/CHANGELOG.md b/examples/react/ssr/basic/CHANGELOG.md index 4930a199..2e28f77f 100644 --- a/examples/react/ssr/basic/CHANGELOG.md +++ b/examples/react/ssr/basic/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/react/ssr/basic/package.json b/examples/react/ssr/basic/package.json index 85f42a46..41fa40ac 100644 --- a/examples/react/ssr/basic/package.json +++ b/examples/react/ssr/basic/package.json @@ -16,7 +16,7 @@ "react": "0.0.0-experimental-035a41c4e-20230704", "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/react/ssr/tanstack-router-app/CHANGELOG.md b/examples/react/ssr/tanstack-router-app/CHANGELOG.md index 71e60ce9..672fbcc6 100644 --- a/examples/react/ssr/tanstack-router-app/CHANGELOG.md +++ b/examples/react/ssr/tanstack-router-app/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/react/ssr/tanstack-router-app/package.json b/examples/react/ssr/tanstack-router-app/package.json index bb5e6bfe..11620d49 100644 --- a/examples/react/ssr/tanstack-router-app/package.json +++ b/examples/react/ssr/tanstack-router-app/package.json @@ -22,7 +22,7 @@ "react": "0.0.0-experimental-035a41c4e-20230704", "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/examples/react/ssr/wouter/CHANGELOG.md b/examples/react/ssr/wouter/CHANGELOG.md index 077b02fc..d2ee0550 100644 --- a/examples/react/ssr/wouter/CHANGELOG.md +++ b/examples/react/ssr/wouter/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/react/ssr/wouter/package.json b/examples/react/ssr/wouter/package.json index ed3405f1..07c831b7 100644 --- a/examples/react/ssr/wouter/package.json +++ b/examples/react/ssr/wouter/package.json @@ -17,7 +17,7 @@ "react": "0.0.0-experimental-035a41c4e-20230704", "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45", + "vinxi": "0.0.46", "wouter": "^2.11.0" }, "devDependencies": { diff --git a/examples/solid/spa/basic/CHANGELOG.md b/examples/solid/spa/basic/CHANGELOG.md index a56cf401..32067018 100644 --- a/examples/solid/spa/basic/CHANGELOG.md +++ b/examples/solid/spa/basic/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/solid/spa/basic/package.json b/examples/solid/spa/basic/package.json index b2d1f716..67249003 100644 --- a/examples/solid/spa/basic/package.json +++ b/examples/solid/spa/basic/package.json @@ -13,7 +13,7 @@ "autoprefixer": "^10.4.15", "solid-js": "^1.7.11", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45", + "vinxi": "0.0.46", "vite": "^4.5.0", "vite-plugin-solid": "^2.7.0" } diff --git a/examples/solid/ssr/basic/CHANGELOG.md b/examples/solid/ssr/basic/CHANGELOG.md index 059b92c0..c40da5a1 100644 --- a/examples/solid/ssr/basic/CHANGELOG.md +++ b/examples/solid/ssr/basic/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/solid/ssr/basic/package.json b/examples/solid/ssr/basic/package.json index febb0c20..63ea5888 100644 --- a/examples/solid/ssr/basic/package.json +++ b/examples/solid/ssr/basic/package.json @@ -16,7 +16,7 @@ "autoprefixer": "^10.4.15", "solid-js": "^1.7.11", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45", + "vinxi": "0.0.46", "vite-plugin-solid": "^2.7.0" } } diff --git a/examples/solid/ssr/solid-router/CHANGELOG.md b/examples/solid/ssr/solid-router/CHANGELOG.md index 1cf68abb..fdfd2cd3 100644 --- a/examples/solid/ssr/solid-router/CHANGELOG.md +++ b/examples/solid/ssr/solid-router/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/solid/ssr/solid-router/package.json b/examples/solid/ssr/solid-router/package.json index 030249b3..82e146aa 100644 --- a/examples/solid/ssr/solid-router/package.json +++ b/examples/solid/ssr/solid-router/package.json @@ -18,7 +18,7 @@ "autoprefixer": "^10.4.15", "solid-js": "^1.7.11", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45", + "vinxi": "0.0.46", "vite-plugin-solid": "^2.7.0" }, "devDependencies": { diff --git a/examples/solid/ssr/solid-start/CHANGELOG.md b/examples/solid/ssr/solid-start/CHANGELOG.md index 20c64f5e..c35abcb3 100644 --- a/examples/solid/ssr/solid-start/CHANGELOG.md +++ b/examples/solid/ssr/solid-start/CHANGELOG.md @@ -4,6 +4,14 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + - @vinxi/solid-start@0.2.4 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 - @vinxi/solid-start@0.2.4 diff --git a/examples/solid/ssr/solid-start/package.json b/examples/solid/ssr/solid-start/package.json index 5000cc48..1a9228a3 100644 --- a/examples/solid/ssr/solid-start/package.json +++ b/examples/solid/ssr/solid-start/package.json @@ -16,7 +16,7 @@ "solid-js": "^1.7.11", "@vinxi/solid-start": "workspace:^", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { "axios": "^1.5.0" diff --git a/examples/vanilla/empty/CHANGELOG.md b/examples/vanilla/empty/CHANGELOG.md index 1225181f..3bcc26a3 100644 --- a/examples/vanilla/empty/CHANGELOG.md +++ b/examples/vanilla/empty/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/vanilla/empty/package.json b/examples/vanilla/empty/package.json index a9c39bd5..cf0428c1 100644 --- a/examples/vanilla/empty/package.json +++ b/examples/vanilla/empty/package.json @@ -9,6 +9,6 @@ "start": "vinxi start" }, "dependencies": { - "vinxi": "0.0.45" + "vinxi": "0.0.46" } } diff --git a/examples/vanilla/partyroom/CHANGELOG.md b/examples/vanilla/partyroom/CHANGELOG.md index 5bc93fca..2f28ed87 100644 --- a/examples/vanilla/partyroom/CHANGELOG.md +++ b/examples/vanilla/partyroom/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/vanilla/partyroom/package.json b/examples/vanilla/partyroom/package.json index b4ffc2eb..1f4f8795 100644 --- a/examples/vanilla/partyroom/package.json +++ b/examples/vanilla/partyroom/package.json @@ -13,6 +13,6 @@ "@vinxi/plugin-references": "0.0.29", "autoprefixer": "^10.4.15", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" } } diff --git a/examples/vanilla/spa/CHANGELOG.md b/examples/vanilla/spa/CHANGELOG.md index 493713fd..2a8d7847 100644 --- a/examples/vanilla/spa/CHANGELOG.md +++ b/examples/vanilla/spa/CHANGELOG.md @@ -4,6 +4,14 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - @vinxi/server-functions@0.0.38 + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [355daea] - @vinxi/plugin-references@0.0.24 - vinxi@0.0.34 diff --git a/examples/vanilla/spa/package.json b/examples/vanilla/spa/package.json index fc4acdc7..719b298e 100644 --- a/examples/vanilla/spa/package.json +++ b/examples/vanilla/spa/package.json @@ -10,9 +10,9 @@ }, "dependencies": { "@picocss/pico": "^1.5.10", - "@vinxi/server-functions": "0.0.37", + "@vinxi/server-functions": "0.0.38", "autoprefixer": "^10.4.15", "tailwindcss": "^3.3.3", - "vinxi": "0.0.43" + "vinxi": "0.0.46" } } diff --git a/examples/vanilla/stack/CHANGELOG.md b/examples/vanilla/stack/CHANGELOG.md index 2888aae5..c8b08fe5 100644 --- a/examples/vanilla/stack/CHANGELOG.md +++ b/examples/vanilla/stack/CHANGELOG.md @@ -4,6 +4,14 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - @vinxi/server-functions@0.0.38 + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 - @vinxi/server-functions@0.0.37 diff --git a/examples/vanilla/stack/package.json b/examples/vanilla/stack/package.json index bfe79ab6..87f8fd66 100644 --- a/examples/vanilla/stack/package.json +++ b/examples/vanilla/stack/package.json @@ -1,5 +1,5 @@ { - "name": "example-vanilla-spa", + "name": "example-vanilla-stack", "type": "module", "private": true, "version": null, @@ -10,10 +10,11 @@ }, "dependencies": { "@picocss/pico": "^1.5.10", - "@vinxi/server-functions": "workspace:^", + "@vinxi/server-functions": "0.0.38", + "@vitejs/plugin-react": "^4.0.4", "autoprefixer": "^10.4.15", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { "@types/resolve": "^1.20.4" diff --git a/examples/vanilla/trpc/CHANGELOG.md b/examples/vanilla/trpc/CHANGELOG.md index 5bc93fca..2f28ed87 100644 --- a/examples/vanilla/trpc/CHANGELOG.md +++ b/examples/vanilla/trpc/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/examples/vanilla/trpc/package.json b/examples/vanilla/trpc/package.json index fbbb2211..a7ca6e6a 100644 --- a/examples/vanilla/trpc/package.json +++ b/examples/vanilla/trpc/package.json @@ -16,6 +16,6 @@ "autoprefixer": "^10.4.15", "superjson": "^1.13.3", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" } } diff --git a/frameworks/solid-start/package.json b/frameworks/solid-start/package.json index e4d34ae3..b7344b1d 100644 --- a/frameworks/solid-start/package.json +++ b/frameworks/solid-start/package.json @@ -42,7 +42,7 @@ "@solidjs/router": "^0.8.3", "@vinxi/solid": "0.0.14", "solid-js": "^1.7.11", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "dependencies": { "vite-plugin-solid": "^2.7.0" diff --git a/packages/vinxi-devtools/package.json b/packages/vinxi-devtools/package.json index 638c61c0..ff418707 100644 --- a/packages/vinxi-devtools/package.json +++ b/packages/vinxi-devtools/package.json @@ -63,6 +63,6 @@ "tailwind-merge": "^1.14.0", "unocss": "^0.56.5", "unocss-preset-radix": "^2.5.5", - "vinxi": "0.0.45" + "vinxi": "0.0.46" } } diff --git a/packages/vinxi-directives/CHANGELOG.md b/packages/vinxi-directives/CHANGELOG.md index 693a7165..56d75ee4 100644 --- a/packages/vinxi-directives/CHANGELOG.md +++ b/packages/vinxi-directives/CHANGELOG.md @@ -1,5 +1,12 @@ # @vinxi/plugin-references +## 0.0.38 + +### Patch Changes + +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + ## 0.0.37 ### Patch Changes diff --git a/packages/vinxi-directives/package.json b/packages/vinxi-directives/package.json index 3e49ab38..8aee5e18 100644 --- a/packages/vinxi-directives/package.json +++ b/packages/vinxi-directives/package.json @@ -1,6 +1,6 @@ { "name": "@vinxi/plugin-directives", - "version": "0.0.37", + "version": "0.0.38", "type": "module", "author": "Nikhil Saraf ", "files": [ @@ -21,11 +21,11 @@ }, "devDependencies": { "@vitest/ui": "^0.34.6", - "vinxi": "^0.0.45", + "vinxi": "^0.0.46", "vitest": "^0.28.5" }, "peerDependencies": { - "vinxi": "^0.0.45" + "vinxi": "^0.0.46" }, "dependencies": { "acorn": "^8.10.0", diff --git a/packages/vinxi-react-server/package.json b/packages/vinxi-react-server/package.json index e128cb34..a20fc8c2 100644 --- a/packages/vinxi-react-server/package.json +++ b/packages/vinxi-react-server/package.json @@ -35,7 +35,7 @@ "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "react": "0.0.0-experimental-035a41c4e-20230704", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "dependencies": { "@vinxi/plugin-references": "0.0.29", diff --git a/packages/vinxi-react/package.json b/packages/vinxi-react/package.json index 2229a1e7..3b42d78d 100644 --- a/packages/vinxi-react/package.json +++ b/packages/vinxi-react/package.json @@ -36,6 +36,6 @@ "devDependencies": { "@types/react": "^18.2.21", "react": "0.0.0-experimental-035a41c4e-20230704", - "vinxi": "0.0.45" + "vinxi": "0.0.46" } } diff --git a/packages/vinxi-router/CHANGELOG.md b/packages/vinxi-router/CHANGELOG.md index 49d2f49c..7a3cda47 100644 --- a/packages/vinxi-router/CHANGELOG.md +++ b/packages/vinxi-router/CHANGELOG.md @@ -1,5 +1,12 @@ # @vinxi/router +## 0.0.26 + +### Patch Changes + +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + ## 0.0.25 ### Patch Changes diff --git a/packages/vinxi-router/package.json b/packages/vinxi-router/package.json index 7faf954d..0127a4ca 100644 --- a/packages/vinxi-router/package.json +++ b/packages/vinxi-router/package.json @@ -1,6 +1,6 @@ { "name": "@vinxi/router", - "version": "0.0.25", + "version": "0.0.26", "description": "", "module": "index.js", "type": "module", @@ -20,9 +20,9 @@ "./spa": "./spa.js" }, "peerDependencies": { - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { - "vinxi": "0.0.45" + "vinxi": "0.0.46" } } diff --git a/packages/vinxi-server-components/CHANGELOG.md b/packages/vinxi-server-components/CHANGELOG.md index bf1fd8c0..fc9a65ec 100644 --- a/packages/vinxi-server-components/CHANGELOG.md +++ b/packages/vinxi-server-components/CHANGELOG.md @@ -1,5 +1,13 @@ # @vinxi/plugin-references +## 0.0.38 + +### Patch Changes + +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + - @vinxi/plugin-directives@0.0.38 + ## 0.0.37 ### Patch Changes diff --git a/packages/vinxi-server-components/package.json b/packages/vinxi-server-components/package.json index 95369f4f..f42f7b15 100644 --- a/packages/vinxi-server-components/package.json +++ b/packages/vinxi-server-components/package.json @@ -1,6 +1,6 @@ { "name": "@vinxi/server-components", - "version": "0.0.37", + "version": "0.0.38", "type": "module", "author": "Nikhil Saraf ", "files": [ @@ -20,14 +20,14 @@ } }, "devDependencies": { - "vinxi": "^0.0.45", + "vinxi": "^0.0.46", "vitest": "^0.28.5" }, "peerDependencies": { - "vinxi": "^0.0.45" + "vinxi": "^0.0.46" }, "dependencies": { - "@vinxi/plugin-directives": "0.0.37", + "@vinxi/plugin-directives": "0.0.38", "acorn": "^8.10.0", "acorn-loose": "^8.3.0", "acorn-typescript": "^1.4.3", diff --git a/packages/vinxi-server-functions/CHANGELOG.md b/packages/vinxi-server-functions/CHANGELOG.md index a4ec8c4e..e5130f48 100644 --- a/packages/vinxi-server-functions/CHANGELOG.md +++ b/packages/vinxi-server-functions/CHANGELOG.md @@ -1,5 +1,14 @@ # @vinxi/plugin-references +## 0.0.38 + +### Patch Changes + +- a4512f5: new CLI infra using citty and server-function fix +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + - @vinxi/plugin-directives@0.0.38 + ## 0.0.37 ### Patch Changes diff --git a/packages/vinxi-server-functions/index.js b/packages/vinxi-server-functions/index.js index cb23bf8f..8ef632d3 100644 --- a/packages/vinxi-server-functions/index.js +++ b/packages/vinxi-server-functions/index.js @@ -4,15 +4,8 @@ import { serverFunctions } from "./plugin.js"; export default function serverFns(app) { app.addRouter(serverFunctions.router()); - const clientRouters = app.config.routers.filter( + app.addRouterPlugins( (router) => router.target === "browser", + () => [serverFunctions.client()], ); - - clientRouters.forEach((router) => { - if (router.plugins) { - router.plugins = () => [serverFunctions.client(), ...router.plugins()]; - } else if (router.plugins === undefined) { - router.plugins = () => [serverFunctions.client()]; - } - }); } diff --git a/packages/vinxi-server-functions/package.json b/packages/vinxi-server-functions/package.json index 9ae5596f..5944cf70 100644 --- a/packages/vinxi-server-functions/package.json +++ b/packages/vinxi-server-functions/package.json @@ -1,6 +1,6 @@ { "name": "@vinxi/server-functions", - "version": "0.0.37", + "version": "0.0.38", "type": "module", "author": "Nikhil Saraf ", "files": [ @@ -20,14 +20,14 @@ } }, "devDependencies": { - "vinxi": "^0.0.45", + "vinxi": "^0.0.46", "vitest": "^0.28.5" }, "peerDependencies": { - "vinxi": "^0.0.45" + "vinxi": "^0.0.46" }, "dependencies": { - "@vinxi/plugin-directives": "0.0.37", + "@vinxi/plugin-directives": "0.0.38", "acorn": "^8.10.0", "acorn-loose": "^8.3.0", "acorn-typescript": "^1.4.3", diff --git a/packages/vinxi-server-functions/server-handler.js b/packages/vinxi-server-functions/server-handler.js index 39f9c144..9f7927c9 100644 --- a/packages/vinxi-server-functions/server-handler.js +++ b/packages/vinxi-server-functions/server-handler.js @@ -10,7 +10,7 @@ export async function handleServerAction(event) { invariant(typeof serverReference === "string", "Invalid server action"); // This is the client-side case const [filepath, name] = serverReference.split("#"); - const action = (await import.meta.env.MANIFEST["server"].chunks[filepath].import())[name]; + const action = (await import.meta.env.MANIFEST[import.meta.env.ROUTER_NAME].chunks[filepath].import())[name]; const text = await new Promise((resolve) => { const requestBody = []; event.node.req.on("data", (chunks) => { @@ -27,7 +27,7 @@ export async function handleServerAction(event) { // Wait for any mutations const response = await result; event.node.res.setHeader("Content-Type", "application/json"); - event.node.res.setHeader("Router", "server"); + event.node.res.setHeader("Router", "server-fns"); return JSON.stringify(response ?? null); } catch (x) { diff --git a/packages/vinxi-solid/package.json b/packages/vinxi-solid/package.json index 7d523d00..46fb8566 100644 --- a/packages/vinxi-solid/package.json +++ b/packages/vinxi-solid/package.json @@ -37,6 +37,6 @@ "devDependencies": { "@solidjs/meta": "^0.28.6", "solid-js": "^1.7.11", - "vinxi": "0.0.45" + "vinxi": "0.0.46" } } diff --git a/packages/vinxi/CHANGELOG.md b/packages/vinxi/CHANGELOG.md index 4689d1b9..035d4576 100644 --- a/packages/vinxi/CHANGELOG.md +++ b/packages/vinxi/CHANGELOG.md @@ -1,5 +1,12 @@ # vinxi +## 0.0.46 + +### Patch Changes + +- a4512f5: new CLI infra using citty and server-function fix + - @vinxi/devtools@0.0.5 + ## 0.0.45 ### Patch Changes diff --git a/packages/vinxi/bin/cli.mjs b/packages/vinxi/bin/cli.mjs index 057862ad..49cee451 100755 --- a/packages/vinxi/bin/cli.mjs +++ b/packages/vinxi/bin/cli.mjs @@ -1,94 +1,165 @@ #!/usr/bin/env node import chokidar from "chokidar"; -import mri from "mri"; +import { defineCommand, runMain } from "citty"; +import fs from "fs"; +// import mri from "mri"; +import { fileURLToPath } from "url"; import { exec } from "node:child_process"; import { loadApp } from "../lib/load-app.js"; import { log } from "../lib/logger.js"; -import { resolve } from "../lib/path.js"; -async function main() { - const args = mri(process.argv.slice(2)); - const command = args._[0]; - const rootDir = resolve(args._[1] || "."); +const packageJson = JSON.parse( + fs.readFileSync( + fileURLToPath(new URL("../package.json", import.meta.url)), + "utf-8", + ), +); - const configFile = args.config; - globalThis.MANIFEST = {}; - const app = await loadApp(configFile, args); +const command = defineCommand({ + meta: { + name: "vinxi", + version: packageJson.version, + description: "Vinxi: The JavaScript/TypeScript Server SDK", + }, + args: { + config: { + type: "string", + description: "Path to config file (default: app.config.js)", + }, + }, + subCommands: () => ({ + dev: { + meta: { + name: "dev", + version: packageJson.version, + description: "Start a Vinxi development server", + }, + args: { + config: { + type: "string", + description: "Path to config file (default: app.config.js)", + }, + force: { + type: "boolean", + description: "Force optimize deps (default: false)", + }, + devtools: { + type: "boolean", + description: "Enable devtools (default: false)", + }, + port: { + type: "number", + description: "Port to listen on (default: 3000)", + }, + host: { + type: "boolean", + description: "Expose to host (default: false)", + }, + stack: { + type: "string", + description: "Stacks", + alias: "s", + }, + }, + async run({ args }) { + const configFile = args.config; + globalThis.MANIFEST = {}; + const app = await loadApp(configFile, args); - if (command === "dev") { - let devServer; - /** @type {import('chokidar').FSWatcher} */ - let watcher; + let devServer; + /** @type {import('chokidar').FSWatcher} */ + let watcher; - function createWatcher() { - watcher = chokidar.watch( - ["app.config.*", "vite.config.*", configFile].filter(Boolean), - { - ignoreInitial: true, - }, - ); - watcher.on("all", async (ctx, path) => { - log("change detected in", path); - log("reloading app"); - const newApp = await loadApp(configFile, args); - if (!newApp) return; - restartDevServer(newApp); - }); - } + function createWatcher() { + watcher = chokidar.watch( + ["app.config.*", "vite.config.*", configFile].filter(Boolean), + { + ignoreInitial: true, + }, + ); + watcher.on("all", async (ctx, path) => { + log("change detected in", path); + log("reloading app"); + const newApp = await loadApp(configFile, args); + if (!newApp) return; + restartDevServer(newApp); + }); + } - async function restartDevServer(newApp) { - const { createDevServer } = await import("../lib/dev-server.js"); - await devServer?.close(); - devServer = await createDevServer(newApp, { - force: args.force, - devtools: args.devtools || Boolean(process.env.DEVTOOLS), - port: Number(process.env.PORT ?? 3000), - }); - log("restarting dev server"); - devServer.listen(); - } + async function restartDevServer(newApp) { + const { createDevServer } = await import("../lib/dev-server.js"); + await devServer?.close(); + devServer = await createDevServer(newApp, { + force: args.force, + devtools: args.devtools || Boolean(process.env.DEVTOOLS), + port: Number(process.env.PORT ?? 3000), + }); + log("restarting dev server"); + devServer.listen(); + } - if (!app) { - let fsWatcher = (watcher = chokidar.watch( - ["app.config.*", "vite.config.*", configFile].filter(Boolean), - { - ignoreInitial: true, - persistent: true, - }, - )); - fsWatcher.on("all", async (path) => { - log("change detected in", path); - log("reloading app"); - const newApp = await loadApp(configFile, args); - if (!newApp) return; + if (!app) { + let fsWatcher = (watcher = chokidar.watch( + ["app.config.*", "vite.config.*", configFile].filter(Boolean), + { + ignoreInitial: true, + persistent: true, + }, + )); + fsWatcher.on("all", async (path) => { + log("change detected in", path); + log("reloading app"); + const newApp = await loadApp(configFile, args); + if (!newApp) return; - fsWatcher.close(); + fsWatcher.close(); + createWatcher(); + restartDevServer(newApp); + }); + return; + } createWatcher(); - restartDevServer(newApp); - }); - return; - } - createWatcher(); - const { createDevServer } = await import("../lib/dev-server.js"); - devServer = await createDevServer(app, { - force: args.force, - port: Number(process.env.PORT ?? 3000), - devtools: args.devtools || Boolean(process.env.DEVTOOLS), - }); - devServer.listen(); - } else if (command === "build") { - process.env.NODE_ENV = "production"; - const { createBuild } = await import("../lib/build.js"); - await createBuild(app, {}); - } else if (command === "start") { - await exec(`node .output/server/index.mjs`); - } else { - throw new Error(`Unknown command ${command}`); - } -} -main().catch((err) => { - console.error(err); - process.exit(1); + const { createDevServer } = await import("../lib/dev-server.js"); + devServer = await createDevServer(app, { + force: args.force, + port: Number(process.env.PORT ?? 3000), + devtools: args.devtools || Boolean(process.env.DEVTOOLS), + }); + devServer.listen(); + }, + }, + build: { + meta: { + name: "build", + version: packageJson.version, + description: "Build your Vinxi app", + }, + args: { + config: { + type: "string", + description: "Path to config file (default: app.config.js)", + }, + stack: { + type: "string", + description: "Stacks", + }, + preset: { + type: "string", + description: "Server preset (default: node-server)", + }, + }, + async run({ args }) { + const configFile = args.config; + globalThis.MANIFEST = {}; + const app = await loadApp(configFile, args); + process.env.NODE_ENV = "production"; + const { createBuild } = await import("../lib/build.js"); + await createBuild(app, { preset: args.preset }); + }, + }, + }), }); + +runMain(command); diff --git a/packages/vinxi/lib/app.js b/packages/vinxi/lib/app.js index a3c48390..1c601505 100644 --- a/packages/vinxi/lib/app.js +++ b/packages/vinxi/lib/app.js @@ -1,5 +1,6 @@ // @ts-ignore import { createHooks } from "hookable"; +import resolve from "resolve"; import { isMainThread } from "worker_threads"; import invariant, { InvariantError } from "./invariant.js"; @@ -24,7 +25,10 @@ import { resolveRouterConfig, routerSchema } from "./router-modes.js"; root: string; }; addRouter: (router: any) => App; + addRouterPlugins: (apply: (router: import("./router-mode.js").Router) => boolean, plugins: () => any[]) => void; getRouter: (name: string) => import("./router-mode.js").Router; + resolveSync: (mod: string) => string; + import: (mod: string) => Promise; stack: (stack: (app: App) => void | Promise) => Promise; dev(): Promise; build(): Promise; @@ -121,6 +125,28 @@ export function createApp({ config.routers.push(resolvedRouter); return app; }, + addRouterPlugins(apply, plugins) { + const routers = app.config.routers.filter(apply); + + routers.forEach((router) => { + if (router.plugins) { + let prevPlugins = router.plugins; + router.plugins = () => [ + ...(plugins?.() ?? []), + ...(prevPlugins() ?? []), + ]; + } else if (router.plugins === undefined) { + router.plugins = plugins; + } + }); + }, + resolveSync(mod) { + return resolve.sync(mod, { basedir: config.root }); + }, + async import(mod) { + const resolved = app.resolveSync(mod); + return await import(resolved); + }, getRouter(/** @type {string} */ name) { const router = config.routers.find((router) => router.name === name); if (!router) { diff --git a/packages/vinxi/lib/build.js b/packages/vinxi/lib/build.js index 13afa32e..8b68d3cb 100644 --- a/packages/vinxi/lib/build.js +++ b/packages/vinxi/lib/build.js @@ -76,7 +76,9 @@ export async function createBuild(app, buildConfig) { dev: false, preset: + buildConfig.preset ?? process.env.TARGET ?? + process.env.SERVER_PRESET ?? process.env.NITRO_PRESET ?? app.config.server.preset, alias: { diff --git a/packages/vinxi/lib/load-app.js b/packages/vinxi/lib/load-app.js index 366d6854..500ebce9 100644 --- a/packages/vinxi/lib/load-app.js +++ b/packages/vinxi/lib/load-app.js @@ -87,7 +87,7 @@ async function applyStacks(app, s) { const stacks = await Promise.all( s.map(async (stack) => { if (stack.includes("/") || stack.includes("@")) { - var res = resolve.sync(stack, { basedir: app.config.root }); + var res = app.resolveSync(stack); const mod = await import(res); return mod.default; } diff --git a/packages/vinxi/package.json b/packages/vinxi/package.json index 97604307..84fd6a22 100644 --- a/packages/vinxi/package.json +++ b/packages/vinxi/package.json @@ -1,6 +1,6 @@ { "name": "vinxi", - "version": "0.0.45", + "version": "0.0.46", "type": "module", "author": "Nikhil Saraf ", "files": [ @@ -143,6 +143,7 @@ "boxen": "^7.1.1", "c12": "^1.4.2", "chokidar": "^3.5.3", + "citty": "^0.1.4", "consola": "^3.2.3", "defu": "^6.1.2", "dts-buddy": "^0.2.4", diff --git a/packages/vinxi/stack/react.js b/packages/vinxi/stack/react.js new file mode 100644 index 00000000..612f1f9e --- /dev/null +++ b/packages/vinxi/stack/react.js @@ -0,0 +1,10 @@ +import { createStack } from "./index.js"; + +export default createStack(async (app) => { + const { default: reactRefresh } = await app.import("@vitejs/plugin-react"); + + app.addRouterPlugins( + (router) => router.target === "browser", + () => [reactRefresh()], + ); +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 01d58fec..fa452221 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -771,8 +771,8 @@ importers: specifier: ^3.3.3 version: 3.3.5 vinxi: - specifier: 0.0.43 - version: 0.0.43 + specifier: 0.0.45 + version: link:../../../packages/vinxi examples/vanilla/stack: dependencies: @@ -780,8 +780,11 @@ importers: specifier: ^1.5.10 version: 1.5.10 '@vinxi/server-functions': - specifier: workspace:^ + specifier: 0.0.37 version: link:../../../packages/vinxi-server-functions + '@vitejs/plugin-react': + specifier: ^4.0.4 + version: 4.1.0(vite@4.5.0) autoprefixer: specifier: ^10.4.15 version: 10.4.16(postcss@8.4.31) @@ -882,6 +885,9 @@ importers: chokidar: specifier: ^3.5.3 version: 3.5.3 + citty: + specifier: ^0.1.4 + version: 0.1.4 consola: specifier: ^3.2.3 version: 3.2.3 diff --git a/test/templates/react-rsc/CHANGELOG.md b/test/templates/react-rsc/CHANGELOG.md index 2743dc32..9b5f8653 100644 --- a/test/templates/react-rsc/CHANGELOG.md +++ b/test/templates/react-rsc/CHANGELOG.md @@ -4,6 +4,15 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - @vinxi/server-functions@0.0.38 + - vinxi@0.0.46 + - @vinxi/server-components@0.0.38 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 - @vinxi/server-components@0.0.37 diff --git a/test/templates/react-rsc/package.json b/test/templates/react-rsc/package.json index 702501a9..a2f9cd9e 100644 --- a/test/templates/react-rsc/package.json +++ b/test/templates/react-rsc/package.json @@ -10,8 +10,8 @@ }, "dependencies": { "@picocss/pico": "^1.5.10", - "@vinxi/server-functions": "0.0.37", - "@vinxi/server-components": "0.0.37", + "@vinxi/server-functions": "0.0.38", + "@vinxi/server-components": "0.0.38", "@vinxi/react": "0.0.12", "@vinxi/react-server-dom": "0.0.3", "@vitejs/plugin-react": "^4.0.4", @@ -20,7 +20,7 @@ "react": "0.0.0-experimental-035a41c4e-20230704", "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { "@types/react": "^18.2.21", diff --git a/test/templates/react-ssr-fs/CHANGELOG.md b/test/templates/react-ssr-fs/CHANGELOG.md index 077b02fc..d2ee0550 100644 --- a/test/templates/react-ssr-fs/CHANGELOG.md +++ b/test/templates/react-ssr-fs/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/test/templates/react-ssr-fs/package.json b/test/templates/react-ssr-fs/package.json index 344a08fc..6197705e 100644 --- a/test/templates/react-ssr-fs/package.json +++ b/test/templates/react-ssr-fs/package.json @@ -17,7 +17,7 @@ "react": "0.0.0-experimental-035a41c4e-20230704", "react-dom": "0.0.0-experimental-035a41c4e-20230704", "tailwindcss": "^3.3.3", - "vinxi": "0.0.45", + "vinxi": "0.0.46", "wouter": "^2.11.0" }, "devDependencies": { diff --git a/test/templates/react/CHANGELOG.md b/test/templates/react/CHANGELOG.md index ef363d5a..34d91aae 100644 --- a/test/templates/react/CHANGELOG.md +++ b/test/templates/react/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies [a4512f5] + - vinxi@0.0.46 + +## null + +### Patch Changes + - Updated dependencies [8d1f0dd] - vinxi@0.0.45 diff --git a/test/templates/react/package.json b/test/templates/react/package.json index 4cf07e45..8fbde025 100644 --- a/test/templates/react/package.json +++ b/test/templates/react/package.json @@ -14,7 +14,7 @@ "path-to-regexp": "^6.2.1", "react": "0.0.0-experimental-035a41c4e-20230704", "react-dom": "0.0.0-experimental-035a41c4e-20230704", - "vinxi": "0.0.45" + "vinxi": "0.0.46" }, "devDependencies": { "@types/react": "^18.2.21",