@qwik.dev/core 0.0.0 → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/LICENSE +22 -0
  2. package/bindings/qwik.darwin-arm64.node +0 -0
  3. package/bindings/qwik.darwin-x64.node +0 -0
  4. package/bindings/qwik.linux-x64-gnu.node +0 -0
  5. package/bindings/qwik.wasm.cjs +484 -0
  6. package/bindings/qwik.wasm.mjs +477 -0
  7. package/bindings/qwik.win32-x64-msvc.node +0 -0
  8. package/bindings/qwik_wasm_bg.wasm +0 -0
  9. package/build.d.ts +2 -0
  10. package/dist/build/index.cjs +35 -0
  11. package/dist/build/index.cjs.map +7 -0
  12. package/dist/build/index.d.ts +22 -0
  13. package/dist/build/index.dev.cjs +37 -0
  14. package/dist/build/index.dev.cjs.map +7 -0
  15. package/dist/build/index.dev.mjs +12 -0
  16. package/dist/build/index.dev.mjs.map +7 -0
  17. package/dist/build/index.mjs +12 -0
  18. package/dist/build/index.mjs.map +7 -0
  19. package/dist/build/index.prod.cjs +37 -0
  20. package/dist/build/index.prod.cjs.map +7 -0
  21. package/dist/build/index.prod.mjs +12 -0
  22. package/dist/build/index.prod.mjs.map +7 -0
  23. package/dist/build/package.json +8 -0
  24. package/dist/cli.cjs +4890 -0
  25. package/dist/core-internal.d.ts +3895 -0
  26. package/dist/core.cjs +10929 -0
  27. package/dist/core.cjs.map +1 -0
  28. package/dist/core.min.mjs +1 -0
  29. package/dist/core.mjs +10825 -0
  30. package/dist/core.mjs.map +1 -0
  31. package/dist/core.prod.cjs +5184 -0
  32. package/dist/core.prod.mjs +6028 -0
  33. package/dist/index.d.ts +2 -0
  34. package/dist/insights/index.d.ts +1 -0
  35. package/dist/insights/index.qwik.cjs +751 -0
  36. package/dist/insights/index.qwik.mjs +751 -0
  37. package/dist/insights/insights.d.ts +59 -0
  38. package/dist/insights/vite/index.cjs +82 -0
  39. package/dist/insights/vite/index.d.ts +1 -0
  40. package/dist/insights/vite/index.mjs +55 -0
  41. package/dist/insights/vite/insights-plugin.d.ts +10 -0
  42. package/dist/jsx-runtime/index.d.ts +2 -0
  43. package/dist/jsx-runtime.d.ts +2 -0
  44. package/dist/loader/index.cjs +4 -0
  45. package/dist/loader/index.d.ts +2 -0
  46. package/dist/loader/index.mjs +3 -0
  47. package/dist/loader/package.json +8 -0
  48. package/dist/optimizer.cjs +9140 -0
  49. package/dist/optimizer.d.ts +707 -0
  50. package/dist/optimizer.mjs +9704 -0
  51. package/dist/prefetch/index.cjs +4 -0
  52. package/dist/prefetch/index.d.ts +2 -0
  53. package/dist/prefetch/index.mjs +3 -0
  54. package/dist/prefetch/package.json +8 -0
  55. package/dist/qwik-prefetch.debug.js +244 -0
  56. package/dist/qwik-prefetch.js +1 -0
  57. package/dist/qwikloader.debug.js +228 -0
  58. package/dist/qwikloader.js +3 -0
  59. package/dist/server-modules.d.ts +38 -0
  60. package/dist/server.cjs +8948 -0
  61. package/dist/server.d.ts +404 -0
  62. package/dist/server.mjs +8883 -0
  63. package/dist/starters/adapters/aws-lambda/.eslintignore +2 -0
  64. package/dist/starters/adapters/aws-lambda/.prettierignore +2 -0
  65. package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/vite.config.mts +21 -0
  66. package/dist/starters/adapters/aws-lambda/gitignore +2 -0
  67. package/dist/starters/adapters/aws-lambda/package.json +23 -0
  68. package/dist/starters/adapters/aws-lambda/serverless.yml +31 -0
  69. package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +32 -0
  70. package/dist/starters/adapters/azure-swa/README.md +13 -0
  71. package/dist/starters/adapters/azure-swa/adapters/azure-swa/vite.config.mts +23 -0
  72. package/dist/starters/adapters/azure-swa/azure-functions/host.json +20 -0
  73. package/dist/starters/adapters/azure-swa/gitignore +3 -0
  74. package/dist/starters/adapters/azure-swa/package.json +28 -0
  75. package/dist/starters/adapters/azure-swa/public/staticwebapp.config.json +23 -0
  76. package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +22 -0
  77. package/dist/starters/adapters/azure-swa/swa-cli.config.json +11 -0
  78. package/dist/starters/adapters/bun/README.md +9 -0
  79. package/dist/starters/adapters/bun/adapters/bun/vite.config.mts +28 -0
  80. package/dist/starters/adapters/bun/package.json +27 -0
  81. package/dist/starters/adapters/bun/src/entry.bun.ts +46 -0
  82. package/dist/starters/adapters/cloud-run/Dockerfile +24 -0
  83. package/dist/starters/adapters/cloud-run/README.md +7 -0
  84. package/dist/starters/adapters/cloud-run/adapters/cloud-run/vite.config.mts +15 -0
  85. package/dist/starters/adapters/cloud-run/package.json +24 -0
  86. package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +96 -0
  87. package/dist/starters/adapters/cloudflare-pages/README.md +46 -0
  88. package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/vite.config.mts +15 -0
  89. package/dist/starters/adapters/cloudflare-pages/gitignore +2 -0
  90. package/dist/starters/adapters/cloudflare-pages/package.json +28 -0
  91. package/dist/starters/adapters/cloudflare-pages/public/_headers +9 -0
  92. package/dist/starters/adapters/cloudflare-pages/public/_redirects +1 -0
  93. package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +24 -0
  94. package/dist/starters/adapters/deno/README.md +9 -0
  95. package/dist/starters/adapters/deno/adapters/deno/vite.config.mts +23 -0
  96. package/dist/starters/adapters/deno/package.json +24 -0
  97. package/dist/starters/adapters/deno/src/entry.deno.ts +45 -0
  98. package/dist/starters/adapters/express/README.md +9 -0
  99. package/dist/starters/adapters/express/adapters/express/vite.config.mts +15 -0
  100. package/dist/starters/adapters/express/package.json +33 -0
  101. package/dist/starters/adapters/express/src/entry.express.tsx +70 -0
  102. package/dist/starters/adapters/fastify/README.md +9 -0
  103. package/dist/starters/adapters/fastify/adapters/fastify/vite.config.mts +15 -0
  104. package/dist/starters/adapters/fastify/package.json +33 -0
  105. package/dist/starters/adapters/fastify/src/entry.fastify.tsx +48 -0
  106. package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +42 -0
  107. package/dist/starters/adapters/firebase/.eslintignore +1 -0
  108. package/dist/starters/adapters/firebase/.prettierignore +1 -0
  109. package/dist/starters/adapters/firebase/adapters/firebase/vite.config.mts +21 -0
  110. package/dist/starters/adapters/firebase/firebase.json +24 -0
  111. package/dist/starters/adapters/firebase/functions/.gitkeep +0 -0
  112. package/dist/starters/adapters/firebase/functions/index.js +5 -0
  113. package/dist/starters/adapters/firebase/functions/package.json +25 -0
  114. package/dist/starters/adapters/firebase/gitignore +3 -0
  115. package/dist/starters/adapters/firebase/package.json +24 -0
  116. package/dist/starters/adapters/firebase/src/entry-firebase.tsx +22 -0
  117. package/dist/starters/adapters/netlify-edge/README.md +64 -0
  118. package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/vite.config.mts +16 -0
  119. package/dist/starters/adapters/netlify-edge/gitignore +2 -0
  120. package/dist/starters/adapters/netlify-edge/netlify.toml +3 -0
  121. package/dist/starters/adapters/netlify-edge/package.json +29 -0
  122. package/dist/starters/adapters/netlify-edge/public/_headers +2 -0
  123. package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +22 -0
  124. package/dist/starters/adapters/node-server/README.md +12 -0
  125. package/dist/starters/adapters/node-server/adapters/node-server/vite.config.mts +15 -0
  126. package/dist/starters/adapters/node-server/package.json +23 -0
  127. package/dist/starters/adapters/node-server/src/entry.node-server.tsx +39 -0
  128. package/dist/starters/adapters/static/README.md +5 -0
  129. package/dist/starters/adapters/static/adapters/static/vite.config.mts +19 -0
  130. package/dist/starters/adapters/static/package.json +19 -0
  131. package/dist/starters/adapters/vercel-edge/README.md +43 -0
  132. package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/vite.config.mts +16 -0
  133. package/dist/starters/adapters/vercel-edge/gitignore +2 -0
  134. package/dist/starters/adapters/vercel-edge/package.json +28 -0
  135. package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +22 -0
  136. package/dist/starters/adapters/vercel-edge/vercel.json +22 -0
  137. package/dist/starters/features/auth/package.json +20 -0
  138. package/dist/starters/features/auth/src/routes/plugin@auth.ts +8 -0
  139. package/dist/starters/features/bootstrap/package.json +33 -0
  140. package/dist/starters/features/bootstrap/src/components/bootstrap/alert.tsx +8 -0
  141. package/dist/starters/features/bootstrap/src/components/bootstrap/button.tsx +8 -0
  142. package/dist/starters/features/bootstrap/src/components/bootstrap/index.ts +4 -0
  143. package/dist/starters/features/bootstrap/src/components/bootstrap/navbar.tsx +44 -0
  144. package/dist/starters/features/bootstrap/src/components/bootstrap/spinner.tsx +13 -0
  145. package/dist/starters/features/bootstrap/src/constants/data.ts +10 -0
  146. package/dist/starters/features/bootstrap/src/models/bootstrap.ts +8 -0
  147. package/dist/starters/features/bootstrap/src/routes/bootstrap/alerts/index.tsx +28 -0
  148. package/dist/starters/features/bootstrap/src/routes/bootstrap/buttons/index.tsx +32 -0
  149. package/dist/starters/features/bootstrap/src/routes/bootstrap/index.tsx +32 -0
  150. package/dist/starters/features/bootstrap/src/routes/bootstrap/layout.tsx +36 -0
  151. package/dist/starters/features/bootstrap/src/routes/bootstrap/spinners/index.tsx +45 -0
  152. package/dist/starters/features/builder.io/README.md +15 -0
  153. package/dist/starters/features/builder.io/package.json +27 -0
  154. package/dist/starters/features/builder.io/src/components/builder-registry.ts +25 -0
  155. package/dist/starters/features/builder.io/src/components/counter/counter.module.css +23 -0
  156. package/dist/starters/features/builder.io/src/components/counter/counter.tsx +81 -0
  157. package/dist/starters/features/builder.io/src/components/gauge/gauge.module.css +27 -0
  158. package/dist/starters/features/builder.io/src/components/gauge/index.tsx +38 -0
  159. package/dist/starters/features/builder.io/src/routes/[...index]/index.tsx +44 -0
  160. package/dist/starters/features/cypress/cypress/fixtures/example.json +5 -0
  161. package/dist/starters/features/cypress/cypress/support/commands.ts +37 -0
  162. package/dist/starters/features/cypress/cypress/support/component-index.html +12 -0
  163. package/dist/starters/features/cypress/cypress/support/component.ts +42 -0
  164. package/dist/starters/features/cypress/cypress/tsconfig.cy.json +17 -0
  165. package/dist/starters/features/cypress/cypress.config.ts +10 -0
  166. package/dist/starters/features/cypress/cypress.d.ts +14 -0
  167. package/dist/starters/features/cypress/package.json +28 -0
  168. package/dist/starters/features/cypress/src/components/example/example.cy.tsx +18 -0
  169. package/dist/starters/features/cypress/src/components/example/example.tsx +17 -0
  170. package/dist/starters/features/drizzle/drizzle/db/.gitkeep +0 -0
  171. package/dist/starters/features/drizzle/drizzle/migrations/.gitkeep +0 -0
  172. package/dist/starters/features/drizzle/drizzle/schema.ts +24 -0
  173. package/dist/starters/features/drizzle/drizzle.config.ts +9 -0
  174. package/dist/starters/features/drizzle/package.json +41 -0
  175. package/dist/starters/features/drizzle/src/routes/create/index.tsx +42 -0
  176. package/dist/starters/features/drizzle/src/routes/users/[userId]/index.tsx +36 -0
  177. package/dist/starters/features/drizzle/src/routes/users/index.tsx +30 -0
  178. package/dist/starters/features/leaflet-map/package.json +30 -0
  179. package/dist/starters/features/leaflet-map/src/components/leaflet-map/index.tsx +60 -0
  180. package/dist/starters/features/leaflet-map/src/helpers/boundary-box.tsx +6 -0
  181. package/dist/starters/features/leaflet-map/src/models/location.ts +9 -0
  182. package/dist/starters/features/leaflet-map/src/models/map.ts +7 -0
  183. package/dist/starters/features/leaflet-map/src/routes/basic-map/index.tsx +25 -0
  184. package/dist/starters/features/localize/package.json +37 -0
  185. package/dist/starters/features/localize/src/entry.ssr.tsx +32 -0
  186. package/dist/starters/features/localize/src/locales/message.en.json +8 -0
  187. package/dist/starters/features/localize/src/locales/message.it.json +8 -0
  188. package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +94 -0
  189. package/dist/starters/features/localize/src/routes/[locale]/index.tsx +52 -0
  190. package/dist/starters/features/localize/src/routes/[locale]/layout.tsx +12 -0
  191. package/dist/starters/features/orama/package.json +23 -0
  192. package/dist/starters/features/orama/src/orama/index.ts +41 -0
  193. package/dist/starters/features/orama/src/routes/orama/index.tsx +110 -0
  194. package/dist/starters/features/pandacss/.eslintignore +3 -0
  195. package/dist/starters/features/pandacss/.prettierignore +2 -0
  196. package/dist/starters/features/pandacss/gitignore +2 -0
  197. package/dist/starters/features/pandacss/package.json +31 -0
  198. package/dist/starters/features/pandacss/panda.config.ts +22 -0
  199. package/dist/starters/features/pandacss/postcss.config.js +5 -0
  200. package/dist/starters/features/pandacss/src/global.css +5 -0
  201. package/dist/starters/features/pandacss/src/routes/pandacss/index.tsx +18 -0
  202. package/dist/starters/features/partytown/package.json +41 -0
  203. package/dist/starters/features/partytown/src/components/partytown/partytown.tsx +19 -0
  204. package/dist/starters/features/playwright/package.json +18 -0
  205. package/dist/starters/features/playwright/playwright-report/index.html +22024 -0
  206. package/dist/starters/features/playwright/playwright.config.ts +40 -0
  207. package/dist/starters/features/playwright/tests/example.spec.ts +14 -0
  208. package/dist/starters/features/postcss/.vscode/settings.json +3 -0
  209. package/dist/starters/features/postcss/package.json +17 -0
  210. package/dist/starters/features/postcss/postcss.config.js +11 -0
  211. package/dist/starters/features/prisma/package.json +35 -0
  212. package/dist/starters/features/prisma/prisma/schema.prisma +17 -0
  213. package/dist/starters/features/prisma/src/routes/create/index.tsx +42 -0
  214. package/dist/starters/features/prisma/src/routes/users/[userId]/index.tsx +31 -0
  215. package/dist/starters/features/prisma/src/routes/users/index.tsx +27 -0
  216. package/dist/starters/features/react/package.json +41 -0
  217. package/dist/starters/features/react/src/integrations/react/mui.tsx +60 -0
  218. package/dist/starters/features/react/src/routes/react/index.tsx +45 -0
  219. package/dist/starters/features/storybook/.storybook/main.ts +22 -0
  220. package/dist/starters/features/storybook/.storybook/preview-head.html +3 -0
  221. package/dist/starters/features/storybook/.storybook/preview.tsx +19 -0
  222. package/dist/starters/features/storybook/.storybook/tsconfig.json +24 -0
  223. package/dist/starters/features/storybook/package.json +25 -0
  224. package/dist/starters/features/storybook/src/components/button/button.stories.tsx +17 -0
  225. package/dist/starters/features/storybook/src/components/button/button.tsx +27 -0
  226. package/dist/starters/features/styled-vanilla-extract/package.json +28 -0
  227. package/dist/starters/features/styled-vanilla-extract/src/routes/styled-flower/flower.css.ts +83 -0
  228. package/dist/starters/features/styled-vanilla-extract/src/routes/styled-flower/index.tsx +75 -0
  229. package/dist/starters/features/tailwind/.prettierrc.js +3 -0
  230. package/dist/starters/features/tailwind/.vscode/settings.json +3 -0
  231. package/dist/starters/features/tailwind/package.json +18 -0
  232. package/dist/starters/features/tailwind/postcss.config.cjs +6 -0
  233. package/dist/starters/features/tailwind/src/global.css +7 -0
  234. package/dist/starters/features/tailwind/tailwind.config.js +8 -0
  235. package/dist/starters/features/turso/.env.local +2 -0
  236. package/dist/starters/features/turso/package.json +30 -0
  237. package/dist/starters/features/turso/src/utils/turso.ts +21 -0
  238. package/dist/starters/features/vitest/package.json +20 -0
  239. package/dist/starters/features/vitest/src/components/example/example.spec.tsx +32 -0
  240. package/dist/starters/features/vitest/src/components/example/example.tsx +17 -0
  241. package/dist/templates/barrel/component/index.tsx.template +13 -0
  242. package/dist/templates/barrel/markdown/index.md.template +5 -0
  243. package/dist/templates/barrel/mdx/index.mdx.template +5 -0
  244. package/dist/templates/barrel/route/index.tsx.template +9 -0
  245. package/dist/templates/qwik/component/[slug].tsx.template +13 -0
  246. package/dist/templates/qwik/markdown/index.md.template +5 -0
  247. package/dist/templates/qwik/mdx/index.mdx.template +5 -0
  248. package/dist/templates/qwik/route/index.tsx.template +9 -0
  249. package/dist/testing/index.cjs +32431 -0
  250. package/dist/testing/index.d.ts +140 -0
  251. package/dist/testing/index.mjs +32395 -0
  252. package/dist/testing/package.json +9 -0
  253. package/jsx-dev-runtime.d.ts +2 -0
  254. package/jsx-runtime.d.ts +2 -0
  255. package/loader.d.ts +2 -0
  256. package/optimizer.d.ts +2 -0
  257. package/package.json +29 -21
  258. package/public.d.ts +70 -0
  259. package/qwik-cli.cjs +4 -0
  260. package/server.d.ts +15 -0
  261. package/testing.d.ts +2 -0
@@ -0,0 +1,9 @@
1
+ # https://developers.cloudflare.com/pages/platform/headers/
2
+
3
+ /*service-worker.js
4
+ Cache-Control: no-store
5
+ Content-Type: application/javascript
6
+ X-Content-Type-Options: nosniff
7
+
8
+ /build/*
9
+ Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable
@@ -0,0 +1 @@
1
+ # https://developers.cloudflare.com/pages/platform/redirects/
@@ -0,0 +1,24 @@
1
+ /*
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * It's the entry point for Cloudflare Pages when building for production.
5
+ *
6
+ * Learn more about the Cloudflare Pages integration here:
7
+ * - https://qwik.dev/docs/deployments/cloudflare-pages/
8
+ *
9
+ */
10
+ import { manifest } from "@qwik-client-manifest";
11
+ import qwikRouterConfig from "@qwik-router-config";
12
+ import {
13
+ createQwikRouter,
14
+ type PlatformCloudflarePages,
15
+ } from "@qwik.dev/router/middleware/cloudflare-pages";
16
+ import render from "./entry.ssr";
17
+
18
+ declare global {
19
+ interface QwikRouterPlatform extends PlatformCloudflarePages {}
20
+ }
21
+
22
+ const fetch = createQwikRouter({ render, qwikRouterConfig, manifest });
23
+
24
+ export { fetch };
@@ -0,0 +1,9 @@
1
+ ## Deno Server
2
+
3
+ This app has a minimal [Deno server](https://docs.deno.com/runtime/tutorials/http_server) implementation. After running a full build, you can preview the build using the command:
4
+
5
+ ```
6
+ npm run serve
7
+ ```
8
+
9
+ Then visit [http://localhost:8080/](http://localhost:8080/)
@@ -0,0 +1,23 @@
1
+ import { denoServerAdapter } from "@qwik.dev/router/adapters/deno-server/vite";
2
+ import { extendConfig } from "@qwik.dev/router/vite";
3
+ import baseConfig from "../../vite.config.mts";
4
+
5
+ export default extendConfig(baseConfig, () => {
6
+ return {
7
+ build: {
8
+ ssr: true,
9
+ rollupOptions: {
10
+ input: ["src/entry.deno.ts", "@qwik-router-config"],
11
+ },
12
+ minify: false,
13
+ },
14
+ plugins: [
15
+ denoServerAdapter({
16
+ ssg: {
17
+ include: ["/*"],
18
+ origin: "https://yoursite.dev",
19
+ },
20
+ }),
21
+ ],
22
+ };
23
+ });
@@ -0,0 +1,24 @@
1
+ {
2
+ "description": "Deno server",
3
+ "scripts": {
4
+ "build.server": "vite build -c adapters/deno/vite.config.mts",
5
+ "serve": "deno run --allow-net --allow-read --allow-env server/entry.deno.js"
6
+ },
7
+ "__qwik__": {
8
+ "priority": 20,
9
+ "displayName": "Adapter: Deno Server",
10
+ "docs": [
11
+ "https://qwik.dev/deployments/deno/",
12
+ "https://docs.deno.com/runtime/tutorials/http_server"
13
+ ],
14
+ "nextSteps": {
15
+ "title": "Next Steps",
16
+ "lines": [
17
+ "Now you can build a production-ready Deno app:",
18
+ "",
19
+ "- pnpm run build: production build",
20
+ "- pnpm run serve: runs the production server locally"
21
+ ]
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,45 @@
1
+ /*
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * It's the entry point for the Deno HTTP server when building for production.
5
+ *
6
+ * Learn more about the Deno integration here:
7
+ * - https://qwik.dev/docs/deployments/deno/
8
+ * - https://docs.deno.com/runtime/tutorials/http_server
9
+ *
10
+ */
11
+ import { manifest } from "@qwik-client-manifest";
12
+ import qwikRouterConfig from "@qwik-router-config";
13
+ import { createQwikRouter } from "@qwik.dev/router/middleware/deno";
14
+ import render from "./entry.ssr";
15
+
16
+ // Create the Qwik Router Deno middleware
17
+ const { router, notFound, staticFile } = createQwikRouter({
18
+ render,
19
+ qwikRouterConfig,
20
+ manifest,
21
+ });
22
+
23
+ // Allow for dynamic port
24
+ const port = Number(Deno.env.get("PORT") ?? 3009);
25
+
26
+ /* eslint-disable */
27
+ console.log(`Server starter: http://localhost:${port}/app/`);
28
+
29
+ Deno.serve({ port }, async (request: Request, info: any) => {
30
+ const staticResponse = await staticFile(request);
31
+ if (staticResponse) {
32
+ return staticResponse;
33
+ }
34
+
35
+ // Server-side render this request with Qwik Router
36
+ const qwikRouterResponse = await router(request, info);
37
+ if (qwikRouterResponse) {
38
+ return qwikRouterResponse;
39
+ }
40
+
41
+ // Path not found
42
+ return notFound(request);
43
+ });
44
+
45
+ declare const Deno: any;
@@ -0,0 +1,9 @@
1
+ ## Express Server
2
+
3
+ This app has a minimal [Express server](https://expressjs.com/) implementation. After running a full build, you can preview the build using the command:
4
+
5
+ ```
6
+ npm run serve
7
+ ```
8
+
9
+ Then visit [http://localhost:8080/](http://localhost:8080/)
@@ -0,0 +1,15 @@
1
+ import { nodeServerAdapter } from "@qwik.dev/router/adapters/node-server/vite";
2
+ import { extendConfig } from "@qwik.dev/router/vite";
3
+ import baseConfig from "../../vite.config.mts";
4
+
5
+ export default extendConfig(baseConfig, () => {
6
+ return {
7
+ build: {
8
+ ssr: true,
9
+ rollupOptions: {
10
+ input: ["src/entry.express.tsx", "@qwik-router-config"],
11
+ },
12
+ },
13
+ plugins: [nodeServerAdapter({ name: "express" })],
14
+ };
15
+ });
@@ -0,0 +1,33 @@
1
+ {
2
+ "description": "Express.js server",
3
+ "scripts": {
4
+ "build.server": "vite build -c adapters/express/vite.config.mts",
5
+ "serve": "node server/entry.express"
6
+ },
7
+ "dependencies": {
8
+ "express": "4.20.0"
9
+ },
10
+ "devDependencies": {
11
+ "@types/compression": "^1.7.2",
12
+ "@types/express": "^4.17.19",
13
+ "compression": "^1.7.4",
14
+ "dotenv": "^16.3.2"
15
+ },
16
+ "__qwik__": {
17
+ "priority": 20,
18
+ "displayName": "Adapter: Node.js Express Server",
19
+ "docs": [
20
+ "https://qwik.dev/deployments/node/",
21
+ "https://expressjs.com/"
22
+ ],
23
+ "nextSteps": {
24
+ "title": "Next Steps",
25
+ "lines": [
26
+ "Now you can build a production-ready Express app:",
27
+ "",
28
+ "- pnpm run build: production build",
29
+ "- pnpm run serve: runs the production server locally"
30
+ ]
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,70 @@
1
+ /*
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * It's the entry point for the Express HTTP server when building for production.
5
+ *
6
+ * Learn more about Node.js server integrations here:
7
+ * - https://qwik.dev/docs/deployments/node/
8
+ *
9
+ */
10
+ import { manifest } from "@qwik-client-manifest";
11
+ import qwikRouterConfig from "@qwik-router-config";
12
+ import {
13
+ createQwikRouter,
14
+ type PlatformNode,
15
+ } from "@qwik.dev/router/middleware/node";
16
+ import "dotenv/config";
17
+ import express from "express";
18
+ import { join } from "node:path";
19
+ import { fileURLToPath } from "node:url";
20
+ import render from "./entry.ssr";
21
+
22
+ declare global {
23
+ interface QwikRouterPlatform extends PlatformNode {}
24
+ }
25
+
26
+ // Directories where the static assets are located
27
+ const distDir = join(fileURLToPath(import.meta.url), "..", "..", "dist");
28
+ const buildDir = join(distDir, "build");
29
+
30
+ // Allow for dynamic port
31
+ const PORT = process.env.PORT ?? 3000;
32
+
33
+ // Create the Qwik Router Node middleware
34
+ const { router, notFound } = createQwikRouter({
35
+ render,
36
+ qwikRouterConfig,
37
+ manifest,
38
+ // getOrigin(req) {
39
+ // // If deploying under a proxy, you may need to build the origin from the request headers
40
+ // // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto
41
+ // const protocol = req.headers["x-forwarded-proto"] ?? "http";
42
+ // // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host
43
+ // const host = req.headers["x-forwarded-host"] ?? req.headers.host;
44
+ // return `${protocol}://${host}`;
45
+ // }
46
+ });
47
+
48
+ // Create the express server
49
+ // https://expressjs.com/
50
+ const app = express();
51
+
52
+ // Enable gzip compression
53
+ // app.use(compression());
54
+
55
+ // Static asset handlers
56
+ // https://expressjs.com/en/starter/static-files.html
57
+ app.use(`/build`, express.static(buildDir, { immutable: true, maxAge: "1y" }));
58
+ app.use(express.static(distDir, { redirect: false }));
59
+
60
+ // Use Qwik Router's page and endpoint request handler
61
+ app.use(router);
62
+
63
+ // Use Qwik Router's 404 handler
64
+ app.use(notFound);
65
+
66
+ // Start the express server
67
+ app.listen(PORT, () => {
68
+ /* eslint-disable */
69
+ console.log(`Server started: http://localhost:${PORT}/`);
70
+ });
@@ -0,0 +1,9 @@
1
+ ## Fastify Server
2
+
3
+ This app has a minimal [Fastify server](https://fastify.dev/) implementation. After running a full build, you can preview the build using the command:
4
+
5
+ ```
6
+ npm run serve
7
+ ```
8
+
9
+ Then visit [http://localhost:3000/](http://localhost:3000/)
@@ -0,0 +1,15 @@
1
+ import { nodeServerAdapter } from "@qwik.dev/router/adapters/node-server/vite";
2
+ import { extendConfig } from "@qwik.dev/router/vite";
3
+ import baseConfig from "../../vite.config.mts";
4
+
5
+ export default extendConfig(baseConfig, () => {
6
+ return {
7
+ build: {
8
+ ssr: true,
9
+ rollupOptions: {
10
+ input: ["src/entry.fastify.tsx", "@qwik-router-config"],
11
+ },
12
+ },
13
+ plugins: [nodeServerAdapter({ name: "fastify" })],
14
+ };
15
+ });
@@ -0,0 +1,33 @@
1
+ {
2
+ "description": "Fastify server",
3
+ "scripts": {
4
+ "build.server": "vite build -c adapters/fastify/vite.config.mts",
5
+ "serve": "node server/entry.fastify"
6
+ },
7
+ "dependencies": {
8
+ "@fastify/compress": "^6.2.1",
9
+ "@fastify/static": "^6.10.1",
10
+ "fastify": "^4.17.0",
11
+ "fastify-plugin": "^4.5.0"
12
+ },
13
+ "devDependencies": {
14
+ "dotenv": "^16.3.2"
15
+ },
16
+ "__qwik__": {
17
+ "priority": 20,
18
+ "displayName": "Adapter: Node.js Fastify Server",
19
+ "docs": [
20
+ "https://qwik.dev/integrations/deployments/node/",
21
+ "https://fastify.dev/"
22
+ ],
23
+ "nextSteps": {
24
+ "title": "Next Steps",
25
+ "lines": [
26
+ "Now you can build a production-ready Fastify app:",
27
+ "",
28
+ "- pnpm run build: production build for Fastify",
29
+ "- pnpm run serve: runs the production server locally"
30
+ ]
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,48 @@
1
+ /*
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * It's the entry point for the Fastify server when building for production.
5
+ *
6
+ * Learn more about Node.js server integrations here:
7
+ * - https://qwik.dev/docs/deployments/node/
8
+ *
9
+ */
10
+ import { type PlatformNode } from "@qwik.dev/router/middleware/node";
11
+ import "dotenv/config";
12
+ import Fastify from "fastify";
13
+ import { join } from "node:path";
14
+ import { fileURLToPath } from "node:url";
15
+ import FastifyQwik from "./plugins/fastify-qwik";
16
+
17
+ declare global {
18
+ interface QwikRouterPlatform extends PlatformNode {}
19
+ }
20
+
21
+ // Directories where the static assets are located
22
+ const distDir = join(fileURLToPath(import.meta.url), "..", "..", "dist");
23
+ const buildDir = join(distDir, "build");
24
+
25
+ // Allow for dynamic port and host
26
+ const PORT = parseInt(process.env.PORT ?? "3000");
27
+ const HOST = process.env.HOST ?? "0.0.0.0";
28
+
29
+ const start = async () => {
30
+ // Create the fastify server
31
+ // https://fastify.dev/docs/latest/Guides/Getting-Started/
32
+ const fastify = Fastify({
33
+ logger: true,
34
+ });
35
+
36
+ // Enable compression
37
+ // https://github.com/fastify/fastify-compress
38
+ // IMPORTANT NOTE: THIS MUST BE REGISTERED BEFORE THE fastify-qwik PLUGIN
39
+ // await fastify.register(import('@fastify/compress'))
40
+
41
+ // Handle Qwik Router using a plugin
42
+ await fastify.register(FastifyQwik, { distDir, buildDir });
43
+
44
+ // Start the fastify server
45
+ await fastify.listen({ port: PORT, host: HOST });
46
+ };
47
+
48
+ start();
@@ -0,0 +1,42 @@
1
+ import fastifyStatic from "@fastify/static";
2
+ import qwikRouterConfig from "@qwik-router-config";
3
+ import { createQwikRouter } from "@qwik.dev/router/middleware/node";
4
+ import type { FastifyPluginAsync } from "fastify";
5
+ import fastifyPlugin from "fastify-plugin";
6
+
7
+ import render from "../entry.ssr";
8
+
9
+ export interface FastifyQwikOptions {
10
+ distDir: string;
11
+ buildDir: string;
12
+ }
13
+
14
+ const { router, notFound } = createQwikRouter({ render, qwikRouterConfig });
15
+
16
+ const qwikPlugin: FastifyPluginAsync<FastifyQwikOptions> = async (
17
+ fastify,
18
+ options,
19
+ ) => {
20
+ const { buildDir, distDir } = options;
21
+
22
+ fastify.register(fastifyStatic, {
23
+ root: buildDir,
24
+ prefix: "/build",
25
+ immutable: true,
26
+ maxAge: "1y",
27
+ decorateReply: false,
28
+ });
29
+
30
+ fastify.register(fastifyStatic, {
31
+ root: distDir,
32
+ redirect: false,
33
+ decorateReply: false,
34
+ });
35
+
36
+ fastify.setNotFoundHandler(async (request, response) => {
37
+ await router(request.raw, response.raw, (err) => fastify.log.error(err));
38
+ await notFound(request.raw, response.raw, (err) => fastify.log.error(err));
39
+ });
40
+ };
41
+
42
+ export default fastifyPlugin(qwikPlugin, { fastify: ">=4.0.0 <6.0.0" });
@@ -0,0 +1 @@
1
+ # Firebase
@@ -0,0 +1 @@
1
+ # Firebase
@@ -0,0 +1,21 @@
1
+ import { nodeServerAdapter } from "@qwik.dev/router/adapters/node-server/vite";
2
+ import { extendConfig } from "@qwik.dev/router/vite";
3
+ import { builtinModules } from "module";
4
+ import baseConfig from "../../vite.config.mts";
5
+ export default extendConfig(baseConfig, () => {
6
+ return {
7
+ ssr: {
8
+ external: builtinModules,
9
+ noExternal: /./,
10
+ },
11
+ build: {
12
+ minify: false,
13
+ ssr: true,
14
+ rollupOptions: {
15
+ input: ["./src/entry-firebase.tsx", "@qwik-router-config"],
16
+ },
17
+ outDir: "./functions/server",
18
+ },
19
+ plugins: [nodeServerAdapter({ name: "firebase" })],
20
+ };
21
+ });
@@ -0,0 +1,24 @@
1
+ {
2
+ "functions": [
3
+ {
4
+ "source": "functions",
5
+ "codebase": "default",
6
+ "ignore": [
7
+ "node_modules",
8
+ ".git",
9
+ "firebase-debug.log",
10
+ "firebase-debug.*.log"
11
+ ]
12
+ }
13
+ ],
14
+ "hosting": {
15
+ "public": "dist",
16
+ "rewrites": [
17
+ {
18
+ "source": "**",
19
+ "function": "app"
20
+ }
21
+ ],
22
+ "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
23
+ }
24
+ }
@@ -0,0 +1,5 @@
1
+ import { https } from "firebase-functions";
2
+ import qwikApp from './server/entry-firebase.mjs';
3
+
4
+
5
+ export const app = https.onRequest(qwikApp)
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "functions",
3
+ "description": "Cloud Functions for Firebase",
4
+ "scripts": {
5
+ "serve": "firebase emulators:start --only functions",
6
+ "shell": "firebase functions:shell",
7
+ "start": "npm run shell",
8
+ "deploy": "firebase deploy --only functions",
9
+ "logs": "firebase functions:log"
10
+ },
11
+ "engines": {
12
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
13
+ },
14
+ "type": "module",
15
+ "main": "index.js",
16
+ "dependencies": {
17
+ "@google-cloud/functions-framework": "^3.3.0",
18
+ "firebase-admin": "^11.8.0",
19
+ "firebase-functions": "^4.3.1"
20
+ },
21
+ "devDependencies": {
22
+ "firebase-functions-test": "^3.1.0"
23
+ },
24
+ "private": true
25
+ }
@@ -0,0 +1,3 @@
1
+ # Firebase
2
+ functions/server
3
+ functions/node_modules
@@ -0,0 +1,24 @@
1
+ {
2
+ "description": "Firebase",
3
+ "scripts": {
4
+ "build.server": "vite build -c adapters/firebase/vite.config.mts",
5
+ "serve": "qwik build && firebase emulators:start",
6
+ "deploy": "firebase deploy"
7
+ },
8
+ "devDependencies": {
9
+ "firebase-tools": "^13.10.2"
10
+ },
11
+ "__qwik__": {
12
+ "priority": 30,
13
+ "displayName": "Adapter: Firebase",
14
+ "docs": [
15
+ "https://qwik.dev/docs/deployments/aws-lambda/"
16
+ ],
17
+ "nextSteps": {
18
+ "title": "Next Steps",
19
+ "lines": [
20
+ "- cd functions && pnpm i"
21
+ ]
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,22 @@
1
+ /*
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * It's the entry point for Firbease when building for production.
5
+ *
6
+ * Learn more about the Firebase integration here:
7
+ * - https://qwik.dev/docs/deployments/firebase/
8
+ *
9
+ */
10
+ import { manifest } from "@qwik-client-manifest";
11
+ import qwikRouterConfig from "@qwik-router-config";
12
+ import {
13
+ createQwikRouter,
14
+ type PlatformFirebase,
15
+ } from "@qwik.dev/router/middleware/firebase";
16
+ import render from "./entry.ssr";
17
+
18
+ declare global {
19
+ interface QwikRouterPlatform extends PlatformFirebase {}
20
+ }
21
+
22
+ export default createQwikRouter({ render, qwikRouterConfig, manifest });
@@ -0,0 +1,64 @@
1
+ ## Netlify
2
+
3
+ This starter site is configured to deploy to [Netlify Edge Functions](https://docs.netlify.com/edge-functions/overview/), which means it will be rendered at an edge location near to your users.
4
+
5
+ ### Local development
6
+
7
+ The [Netlify CLI](https://docs.netlify.com/cli/get-started/) can be used to preview a production build locally. To do so: First build your site, then to start a local server, run:
8
+
9
+ 1. Install Netlify CLI globally `npm i -g netlify-cli`.
10
+ 2. Build your site with both ssr and static `npm run build`.
11
+ 3. Start a local server with `npm run serve`.
12
+ In this project, `npm run serve` uses the `netlify dev` command to spin up a server that can handle Netlify's Edge Functions locally.
13
+ 4. Visit [http://localhost:8888/](http://localhost:8888/) to check out your site.
14
+
15
+ ### Edge Functions Declarations
16
+
17
+ [Netlify Edge Functions declarations](https://docs.netlify.com/edge-functions/declarations/)
18
+ can be configured to run on specific URL patterns. Each edge function declaration associates
19
+ one site path pattern with one function to execute on requests that match the path. A single request can execute a chain of edge functions from a series of declarations. A single edge function can be associated with multiple paths across various declarations.
20
+
21
+ This is useful to determine if a page response should be Server-Side Rendered (SSR) or
22
+ if the response should use a static-site generated (SSG) `index.html` file instead.
23
+
24
+ By default, the Netlify Edge adaptor will generate a `.netlify/edge-middleware/manifest.json` file, which is used by the Netlify deployment to determine which paths should, and should not, use edge functions.
25
+
26
+ To override the generated manifest, you can [add a declaration](https://docs.netlify.com/edge-functions/declarations/#add-a-declaration) to the `netlify.toml` using the `[[edge_functions]]` config. For example:
27
+
28
+ ```toml
29
+ [[edge_functions]]
30
+ path = "/admin"
31
+ function = "auth"
32
+ ```
33
+
34
+ ### Addition Adapter Options
35
+
36
+ Netlify-specific option fields that can be passed to the adapter options:
37
+
38
+ - `excludedPath` this option accepts a `string` glob pattern that represents which path pattern should not go through the generated Edge Functions.
39
+
40
+ ### Deployments
41
+
42
+ You can [deploy your site to Netlify](https://docs.netlify.com/site-deploys/create-deploys/) either via a Git provider integration or through the Netlify CLI. This starter site includes a `netlify.toml` file to configure your build for deployment.
43
+
44
+ #### Deploying via Git
45
+
46
+ Once your site has been pushed to your Git provider, you can either link it [in the Netlify UI](https://app.netlify.com/start) or use the CLI. To link your site to a Git provider from the Netlify CLI, run the command:
47
+
48
+ ```shell
49
+ netlify link
50
+ ```
51
+
52
+ This sets up [continuous deployment](https://docs.netlify.com/site-deploys/create-deploys/#deploy-with-git) for your site's repo. Whenever you push new commits to your repo, Netlify starts the build process..
53
+
54
+ #### Deploying manually via the CLI
55
+
56
+ If you wish to deploy from the CLI rather than using Git, you can use the command:
57
+
58
+ ```shell
59
+ netlify deploy --build
60
+ ```
61
+
62
+ You must use the `--build` flag whenever you deploy. This ensures that the Edge Functions that this starter site relies on are generated and available when you deploy your site.
63
+
64
+ Add `--prod` flag to deploy to production.
@@ -0,0 +1,16 @@
1
+ import { netlifyEdgeAdapter } from "@qwik.dev/router/adapters/netlify-edge/vite";
2
+ import { extendConfig } from "@qwik.dev/router/vite";
3
+ import baseConfig from "../../vite.config.mts";
4
+
5
+ export default extendConfig(baseConfig, () => {
6
+ return {
7
+ build: {
8
+ ssr: true,
9
+ rollupOptions: {
10
+ input: ["src/entry.netlify-edge.tsx", "@qwik-router-config"],
11
+ },
12
+ outDir: ".netlify/edge-functions/entry.netlify-edge",
13
+ },
14
+ plugins: [netlifyEdgeAdapter()],
15
+ };
16
+ });
@@ -0,0 +1,2 @@
1
+ # Netlify
2
+ .netlify
@@ -0,0 +1,3 @@
1
+ [build]
2
+ publish = "dist"
3
+ command = "npm run build"