@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,29 @@
1
+ {
2
+ "description": "Netlify Edge Functions",
3
+ "scripts": {
4
+ "build.server": "vite build -c adapters/netlify-edge/vite.config.mts",
5
+ "deploy": "netlify deploy --build"
6
+ },
7
+ "devDependencies": {
8
+ "@netlify/edge-functions": "^2.0.0",
9
+ "netlify-cli": "^15.0.0"
10
+ },
11
+ "__qwik__": {
12
+ "priority": 30,
13
+ "displayName": "Adapter: Netlify Edge",
14
+ "docs": [
15
+ "https://qwik.dev/deployments/netlify-edge/",
16
+ "https://docs.netlify.com/edge-functions/overview/",
17
+ "https://docs.netlify.com/"
18
+ ],
19
+ "nextSteps": {
20
+ "title": "Next Steps",
21
+ "lines": [
22
+ "Now you can build and deploy to Netlify with:",
23
+ "",
24
+ "- pnpm run build: production build for Netlify",
25
+ "- pnpm run deploy: it will use the netlify CLI to deploy your site"
26
+ ]
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,2 @@
1
+ /build/*
2
+ Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable
@@ -0,0 +1,22 @@
1
+ /*
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * It's the entry point for Netlify Edge when building for production.
5
+ *
6
+ * Learn more about the Netlify integration here:
7
+ * - https://qwik.dev/docs/deployments/netlify-edge/
8
+ *
9
+ */
10
+ import { manifest } from "@qwik-client-manifest";
11
+ import qwikRouterConfig from "@qwik-router-config";
12
+ import {
13
+ createQwikRouter,
14
+ type PlatformNetlify,
15
+ } from "@qwik.dev/router/middleware/netlify-edge";
16
+ import render from "./entry.ssr";
17
+
18
+ declare global {
19
+ interface QwikRouterPlatform extends PlatformNetlify {}
20
+ }
21
+
22
+ export default createQwikRouter({ render, qwikRouterConfig, manifest });
@@ -0,0 +1,12 @@
1
+ ## Node Server
2
+
3
+ This app has a minimal zero-dependencies server. Using the built-in `http.createServer` API.
4
+ This should be faster and less overhead than Express or other frameworks.
5
+
6
+ After running a full build, you can preview the build using the command:
7
+
8
+ ```
9
+ npm run serve
10
+ ```
11
+
12
+ Then visit [http://localhost:3004/](http://localhost:3004/)
@@ -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.node-server.tsx", "@qwik-router-config"],
11
+ },
12
+ },
13
+ plugins: [nodeServerAdapter({ name: "node-server" })],
14
+ };
15
+ });
@@ -0,0 +1,23 @@
1
+ {
2
+ "description": "Vanilla Node server",
3
+ "scripts": {
4
+ "build.server": "vite build -c adapters/node-server/vite.config.mts",
5
+ "serve": "node server/entry.node-server"
6
+ },
7
+ "__qwik__": {
8
+ "priority": 19,
9
+ "displayName": "Adapter: Node.js Server",
10
+ "docs": [
11
+ "https://qwik.dev/deployments/node/"
12
+ ],
13
+ "nextSteps": {
14
+ "title": "Next Steps",
15
+ "lines": [
16
+ "Now you can build a production-ready node app:",
17
+ "",
18
+ "- pnpm run build: production build",
19
+ "- pnpm run serve: runs the production server locally"
20
+ ]
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,39 @@
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 { createQwikRouter } from "@qwik.dev/router/middleware/node";
13
+ import { createServer } from "node:http";
14
+ import render from "./entry.ssr";
15
+
16
+ // Allow for dynamic port
17
+ const PORT = process.env.PORT ?? 3004;
18
+
19
+ // Create the Qwik Router express middleware
20
+ const { router, notFound, staticFile } = createQwikRouter({
21
+ render,
22
+ qwikRouterConfig,
23
+ manifest,
24
+ });
25
+
26
+ const server = createServer();
27
+
28
+ server.on("request", (req, res) => {
29
+ staticFile(req, res, () => {
30
+ router(req, res, () => {
31
+ notFound(req, res, () => {});
32
+ });
33
+ });
34
+ });
35
+
36
+ server.listen(PORT, () => {
37
+ // eslint-disable-next-line no-console
38
+ console.log(`Node server listening on http://localhost:${PORT}`);
39
+ });
@@ -0,0 +1,5 @@
1
+ ## Static Site Generator (Node.js)
2
+
3
+ ```shell
4
+ npm run build.server
5
+ ```
@@ -0,0 +1,19 @@
1
+ import { staticAdapter } from "@qwik.dev/router/adapters/static/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: ["@qwik-router-config"],
11
+ },
12
+ },
13
+ plugins: [
14
+ staticAdapter({
15
+ origin: "https://yoursite.qwik.dev",
16
+ }),
17
+ ],
18
+ };
19
+ });
@@ -0,0 +1,19 @@
1
+ {
2
+ "description": "Static Site Generator",
3
+ "scripts": {
4
+ "build.server": "vite build -c adapters/static/vite.config.mts"
5
+ },
6
+ "__qwik__": {
7
+ "priority": 10,
8
+ "displayName": "Adapter: Static site (.html files)",
9
+ "docs": [
10
+ "https://qwik.dev/docs/guides/static-site-generation/"
11
+ ],
12
+ "nextSteps": {
13
+ "lines": [
14
+ "You have to change the 'origin' url under staticAdapter",
15
+ "inside './adapters/static/vite.config.mts'"
16
+ ]
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,43 @@
1
+ ## Vercel Edge
2
+
3
+ This starter site is configured to deploy to [Vercel Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions), which means it will be rendered at an edge location near to your users.
4
+
5
+ ## Installation
6
+
7
+ The adaptor will add a new `vite.config.mts` within the `adapters/` directory, and a new entry file will be created, such as:
8
+
9
+ ```
10
+ └── adapters/
11
+ └── vercel-edge/
12
+ └── vite.config.mts
13
+ └── src/
14
+ └── entry.vercel-edge.tsx
15
+ ```
16
+
17
+ Additionally, within the `package.json`, the `build.server` script will be updated with the Vercel Edge build.
18
+
19
+ ## Production build
20
+
21
+ To build the application for production, use the `build` command, this command will automatically run `npm run build.server` and `npm run build.client`:
22
+
23
+ ```shell
24
+ npm run build
25
+ ```
26
+
27
+ [Read the full guide here](https://github.com/QwikDev/qwik/blob/main/starters/adapters/vercel-edge/README.md)
28
+
29
+ ## Dev deploy
30
+
31
+ To deploy the application for development:
32
+
33
+ ```shell
34
+ npm run deploy
35
+ ```
36
+
37
+ Notice that you might need a [Vercel account](https://docs.Vercel.com/get-started/) in order to complete this step!
38
+
39
+ ## Production deploy
40
+
41
+ The project is ready to be deployed to Vercel. However, you will need to create a git repository and push the code to it.
42
+
43
+ You can [deploy your site to Vercel](https://vercel.com/docs/concepts/deployments/overview) either via a Git provider integration or through the Vercel CLI.
@@ -0,0 +1,16 @@
1
+ import { vercelEdgeAdapter } from "@qwik.dev/router/adapters/vercel-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.vercel-edge.tsx", "@qwik-router-config"],
11
+ },
12
+ outDir: ".vercel/output/functions/_qwik-router.func",
13
+ },
14
+ plugins: [vercelEdgeAdapter()],
15
+ };
16
+ });
@@ -0,0 +1,2 @@
1
+ # Vercel
2
+ .vercel
@@ -0,0 +1,28 @@
1
+ {
2
+ "description": "Vercel Edge Functions",
3
+ "scripts": {
4
+ "build.server": "vite build -c adapters/vercel-edge/vite.config.mts",
5
+ "deploy": "vercel deploy"
6
+ },
7
+ "devDependencies": {
8
+ "vercel": "^29.1.1"
9
+ },
10
+ "__qwik__": {
11
+ "priority": 30,
12
+ "displayName": "Adapter: Vercel Edge",
13
+ "docs": [
14
+ "https://qwik.dev/deployments/vercel-edge/",
15
+ "https://vercel.com/docs/concepts/functions/edge-functions",
16
+ "https://vercel.com/docs"
17
+ ],
18
+ "nextSteps": {
19
+ "title": "Next Steps",
20
+ "lines": [
21
+ "Now you can build and deploy to Vercel with:",
22
+ "",
23
+ "- pnpm run build: production build for Vercel",
24
+ "- pnpm run deploy: it will use the Vercel CLI to deploy your site"
25
+ ]
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,22 @@
1
+ /*
2
+ * WHAT IS THIS FILE?
3
+ *
4
+ * It's the entry point for Vercel Edge when building for production.
5
+ *
6
+ * Learn more about the Vercel Edge integration here:
7
+ * - https://qwik.dev/docs/deployments/vercel-edge/
8
+ *
9
+ */
10
+ import { manifest } from "@qwik-client-manifest";
11
+ import qwikRouterConfig from "@qwik-router-config";
12
+ import {
13
+ createQwikRouter,
14
+ type PlatformVercel,
15
+ } from "@qwik.dev/router/middleware/vercel-edge";
16
+ import render from "./entry.ssr";
17
+
18
+ declare global {
19
+ interface QwikRouterPlatform extends PlatformVercel {}
20
+ }
21
+
22
+ export default createQwikRouter({ render, qwikRouterConfig, manifest });
@@ -0,0 +1,22 @@
1
+ {
2
+ "headers": [
3
+ {
4
+ "source": "/(.*)?service-worker.js",
5
+ "headers": [
6
+ {
7
+ "key": "Cache-Control",
8
+ "value": "public, max-age=0, must-revalidate"
9
+ }
10
+ ]
11
+ },
12
+ {
13
+ "source": "/build/(.*)",
14
+ "headers": [
15
+ {
16
+ "key": "Cache-Control",
17
+ "value": "public, max-age=31536000, s-maxage=31536000, immutable"
18
+ }
19
+ ]
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "description": "Authentication plugin for using battle-tested Auth.js (aka NextAuth)",
3
+ "__qwik__": {
4
+ "displayName": "Integration: Auth.js (authentication)",
5
+ "priority": -10,
6
+ "docs": [
7
+ "https://qwik.dev/docs/integrations/authjs/",
8
+ "https://authjs.dev/"
9
+ ],
10
+ "nextSteps": {
11
+ "lines": [
12
+ " Have a look at the docs for more info: ",
13
+ " https://qwik.dev/docs/integrations/authjs/"
14
+ ]
15
+ }
16
+ },
17
+ "devDependencies": {
18
+ "@auth/qwik": "0.2.2"
19
+ }
20
+ }
@@ -0,0 +1,8 @@
1
+ import { QwikAuth$ } from "@auth/qwik";
2
+ import GitHub from "@auth/qwik/providers/github";
3
+
4
+ export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(
5
+ () => ({
6
+ providers: [GitHub],
7
+ }),
8
+ );
@@ -0,0 +1,33 @@
1
+ {
2
+ "description": "Boostrap 5 - Build fast, responsive sites with Bootstrap in Qwik App",
3
+ "__qwik__": {
4
+ "displayName": "Integration: Boostrap",
5
+ "priority": -10,
6
+ "viteConfig": {},
7
+ "docs": [
8
+ "https://getbootstrap.com/docs/5.0/getting-started/introduction/"
9
+ ],
10
+ "nextSteps": {
11
+ "lines": [
12
+ "We start the project with the `start` npm script",
13
+ "Once started, we access the `/bootstrap/` ",
14
+ "path to see all demo examples list.",
15
+ "You can make changes and experiment within ",
16
+ "`src/routes/bootstrap/index.tsx` to add more examples",
17
+ "apart from the default ones.",
18
+ "",
19
+ "Any changes to the different components or adding new ",
20
+ "ones will be done within `src/components/bootstrap`.",
21
+ "",
22
+ "It is recommended to implement these new functionalities",
23
+ "following the main Bootstrap guide: https://getbootstrap.com/"
24
+ ]
25
+ }
26
+ },
27
+ "dependencies": {
28
+ "bootstrap": "5"
29
+ },
30
+ "devDependencies": {
31
+ "@types/bootstrap": "5"
32
+ }
33
+ }
@@ -0,0 +1,8 @@
1
+ import { component$ } from "@qwik.dev/core";
2
+ import { type BsComponentProps } from "~/models/bootstrap";
3
+
4
+ export const Alert = component$<BsComponentProps>(({ text, colorVariant }) => (
5
+ <div class={`alert alert-${colorVariant}`} role="alert">
6
+ {text || `A simple ${colorVariant} alert—check it out!`}
7
+ </div>
8
+ ));
@@ -0,0 +1,8 @@
1
+ import { component$ } from "@qwik.dev/core";
2
+ import { type BsComponentProps } from "~/models/bootstrap";
3
+
4
+ export const Button = component$<BsComponentProps>(({ text, colorVariant }) => (
5
+ <button type="button" class={`btn btn-${colorVariant}`}>
6
+ {text || "Button text"}
7
+ </button>
8
+ ));
@@ -0,0 +1,4 @@
1
+ export * from "./alert";
2
+ export * from "./button";
3
+ export * from "./navbar";
4
+ export * from "./spinner";
@@ -0,0 +1,44 @@
1
+ import { Link } from "@qwik.dev/router";
2
+ import { $, component$, useOn } from "@qwik.dev/core";
3
+ export const Navbar = component$(() => {
4
+ useOn(
5
+ "qvisible",
6
+ $(() => import("bootstrap")),
7
+ );
8
+
9
+ return (
10
+ <nav class="navbar navbar-expand-lg bg-body-tertiary">
11
+ <div class="container-fluid">
12
+ <button
13
+ class="navbar-toggler"
14
+ type="button"
15
+ data-bs-toggle="collapse"
16
+ data-bs-target="#navbarTogglerDemo01"
17
+ aria-controls="navbarTogglerDemo01"
18
+ aria-expanded="false"
19
+ aria-label="Toggle navigation"
20
+ >
21
+ <span class="navbar-toggler-icon"></span>
22
+ </button>
23
+ <div class="collapse navbar-collapse" id="navbarTogglerDemo01">
24
+ <Link class="navbar-brand" href={"/bootstrap/"}>
25
+ Boostrap in Qwik
26
+ </Link>
27
+ <ul class="navbar-nav me-auto mb-2 mb-lg-0">
28
+ <li class="nav-item">
29
+ <Link class="nav-link" href={"/bootstrap/alerts"}>
30
+ Alerts
31
+ </Link>
32
+ </li>
33
+ <Link class="nav-link" href={"/bootstrap/buttons"}>
34
+ Buttons
35
+ </Link>
36
+ <Link class="nav-link" href={"/bootstrap/spinners"}>
37
+ Spinners
38
+ </Link>
39
+ </ul>
40
+ </div>
41
+ </div>
42
+ </nav>
43
+ );
44
+ });
@@ -0,0 +1,13 @@
1
+ import { component$ } from "@qwik.dev/core";
2
+ import { type BsSpinnerComponentProps } from "~/models/bootstrap";
3
+
4
+ export const Spinner = component$<BsSpinnerComponentProps>(
5
+ ({ text, colorVariant, growing }) => (
6
+ <div
7
+ class={`spinner-${growing ? "grow" : "border"} text-${colorVariant}`}
8
+ role="status"
9
+ >
10
+ <span class="visually-hidden">{text || "Loading..."}</span>
11
+ </div>
12
+ ),
13
+ );
@@ -0,0 +1,10 @@
1
+ export const colorVariantsList: Array<string> = [
2
+ "primary",
3
+ "secondary",
4
+ "success",
5
+ "danger",
6
+ "warning",
7
+ "info",
8
+ "light",
9
+ "dark",
10
+ ];
@@ -0,0 +1,8 @@
1
+ export interface BsComponentProps {
2
+ text?: string;
3
+ colorVariant: string;
4
+ }
5
+
6
+ export interface BsSpinnerComponentProps extends BsComponentProps {
7
+ growing: boolean;
8
+ }
@@ -0,0 +1,28 @@
1
+ import type { DocumentHead } from "@qwik.dev/router";
2
+ import { component$ } from "@qwik.dev/core";
3
+ import { Alert } from "~/components/bootstrap";
4
+ import { colorVariantsList } from "~/constants/data";
5
+ export default component$(() => {
6
+ return (
7
+ <>
8
+ <h2>Alerts</h2>
9
+ <hr />
10
+ {colorVariantsList.map((colorVariant, index) => (
11
+ <Alert
12
+ key={`${index + 1}_${colorVariant}`}
13
+ colorVariant={colorVariant}
14
+ />
15
+ ))}
16
+ </>
17
+ );
18
+ });
19
+
20
+ export const head: DocumentHead = {
21
+ title: "Qwik - Bootstrap v5 - Alerts",
22
+ meta: [
23
+ {
24
+ name: "description",
25
+ content: "Alerts with Boostrap in Qwik",
26
+ },
27
+ ],
28
+ };
@@ -0,0 +1,32 @@
1
+ import type { DocumentHead } from "@qwik.dev/router";
2
+ import { component$ } from "@qwik.dev/core";
3
+ import { Button } from "~/components/bootstrap";
4
+ import { colorVariantsList } from "~/constants/data";
5
+
6
+ export default component$(() => {
7
+ return (
8
+ <>
9
+ <h2>Buttons</h2>
10
+ <hr />
11
+ {colorVariantsList.map((colorVariant, index) => (
12
+ <>
13
+ <Button
14
+ key={`${index + 1}_${colorVariant}`}
15
+ colorVariant={colorVariant}
16
+ />
17
+ <span class="me-3"></span>
18
+ </>
19
+ ))}
20
+ </>
21
+ );
22
+ });
23
+
24
+ export const head: DocumentHead = {
25
+ title: "Qwik - Bootstrap v5 - Buttons",
26
+ meta: [
27
+ {
28
+ name: "description",
29
+ content: "Buttons with Boostrap in Qwik",
30
+ },
31
+ ],
32
+ };
@@ -0,0 +1,32 @@
1
+ import { Link, type DocumentHead } from "@qwik.dev/router";
2
+ import { component$ } from "@qwik.dev/core";
3
+
4
+ export default component$(() => {
5
+ return (
6
+ <>
7
+ <h2>Bootstrap components</h2>
8
+ <hr />
9
+ <ul>
10
+ <li>
11
+ <Link href="/bootstrap/alerts/">Alerts</Link>
12
+ </li>
13
+ <li>
14
+ <Link href="/bootstrap/buttons/">Buttons</Link>
15
+ </li>
16
+ <li>
17
+ <Link href="/bootstrap/spinners/">Spinners</Link>
18
+ </li>
19
+ </ul>
20
+ </>
21
+ );
22
+ });
23
+
24
+ export const head: DocumentHead = {
25
+ title: "Welcome to Qwik",
26
+ meta: [
27
+ {
28
+ name: "description",
29
+ content: "Qwik site description",
30
+ },
31
+ ],
32
+ };
@@ -0,0 +1,36 @@
1
+ import type { RequestHandler } from "@qwik.dev/router";
2
+ import { component$, Slot, useStyles$ } from "@qwik.dev/core";
3
+ import { Navbar } from "~/components/bootstrap";
4
+
5
+ // Add bootstrap styles
6
+
7
+ import bootstrapStyles from "../../../node_modules/bootstrap/dist/css/bootstrap.min.css?inline";
8
+
9
+ export const onGet: RequestHandler = async ({ cacheControl }) => {
10
+ // Control caching for this request for best performance and to reduce hosting costs:
11
+ // https://qwik.dev/docs/caching/
12
+ cacheControl({
13
+ // Always serve a cached response by default, up to a week stale
14
+ staleWhileRevalidate: 60 * 60 * 24 * 7,
15
+ // Max once every 5 seconds, revalidate on the server to get a fresh version of this page
16
+ maxAge: 5,
17
+ });
18
+ };
19
+
20
+ export default component$(() => {
21
+ useStyles$(bootstrapStyles);
22
+ return (
23
+ <>
24
+ <Navbar />
25
+ <div class="container">
26
+ <div class="row mb-2 mt-4">
27
+ <p>
28
+ Bootstrap is a powerful, feature-packed frontend toolkit. Build
29
+ anything—from prototype to production—in minutes.
30
+ </p>
31
+ </div>
32
+ <Slot />
33
+ </div>
34
+ </>
35
+ );
36
+ });