create-qwik 1.1.5 → 1.2.0

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 (68) hide show
  1. package/index.cjs +63 -62
  2. package/package.json +1 -1
  3. package/starters/apps/base/.eslintrc.cjs +23 -22
  4. package/starters/apps/base/.vscode/settings.json +3 -0
  5. package/starters/apps/base/README.md +5 -5
  6. package/starters/apps/base/gitignore +3 -1
  7. package/starters/apps/base/package.json +9 -9
  8. package/starters/apps/base/src/entry.dev.tsx +2 -2
  9. package/starters/apps/base/src/entry.preview.tsx +3 -3
  10. package/starters/apps/base/src/entry.ssr.tsx +7 -4
  11. package/starters/apps/base/src/global.css +3 -3
  12. package/starters/apps/base/src/routes/service-worker.ts +3 -4
  13. package/starters/apps/base/tsconfig.json +1 -1
  14. package/starters/apps/base/vite.config.ts +5 -5
  15. package/starters/apps/basic/src/components/router-head/router-head.tsx +2 -2
  16. package/starters/apps/basic/src/components/starter/counter/counter.tsx +12 -6
  17. package/starters/apps/basic/src/components/starter/footer/footer.tsx +3 -3
  18. package/starters/apps/basic/src/components/starter/gauge/index.tsx +9 -3
  19. package/starters/apps/basic/src/components/starter/header/header.tsx +16 -7
  20. package/starters/apps/basic/src/components/starter/hero/hero.module.css +10 -0
  21. package/starters/apps/basic/src/components/starter/hero/hero.tsx +16 -9
  22. package/starters/apps/basic/src/components/starter/icons/qwik.tsx +7 -1
  23. package/starters/apps/basic/src/components/starter/infobox/infobox.tsx +2 -2
  24. package/starters/apps/basic/src/components/starter/next-steps/next-steps.tsx +25 -15
  25. package/starters/apps/basic/src/global.css +3 -3
  26. package/starters/apps/basic/src/media/thunder.png +0 -0
  27. package/starters/apps/basic/src/root.tsx +10 -6
  28. package/starters/apps/basic/src/routes/demo/flower/flower.css +3 -1
  29. package/starters/apps/basic/src/routes/demo/flower/index.tsx +12 -7
  30. package/starters/apps/basic/src/routes/demo/todolist/index.tsx +12 -8
  31. package/starters/apps/basic/src/routes/index.tsx +10 -10
  32. package/starters/apps/basic/src/routes/layout.tsx +6 -6
  33. package/starters/apps/basic/src/routes/service-worker.ts +3 -3
  34. package/starters/apps/basic/src/routes/styles.css +4 -4
  35. package/starters/apps/empty/src/components/router-head/router-head.tsx +2 -2
  36. package/starters/apps/empty/src/root.tsx +9 -5
  37. package/starters/apps/empty/src/routes/index.tsx +5 -5
  38. package/starters/apps/empty/src/routes/layout.tsx +2 -2
  39. package/starters/apps/empty/src/routes/service-worker.ts +3 -3
  40. package/starters/apps/library/.eslintrc.cjs +21 -21
  41. package/starters/apps/library/package.json +7 -7
  42. package/starters/apps/library/src/components/counter/counter.tsx +1 -1
  43. package/starters/apps/library/src/components/logo/logo.tsx +1 -1
  44. package/starters/apps/library/src/entry.dev.tsx +2 -2
  45. package/starters/apps/library/src/entry.ssr.tsx +6 -3
  46. package/starters/apps/library/src/index.ts +2 -2
  47. package/starters/apps/library/src/root.tsx +2 -2
  48. package/starters/apps/library/vite.config.ts +6 -6
  49. package/starters/apps/site-with-visual-cms/README.md +15 -0
  50. package/starters/apps/site-with-visual-cms/package.json +2 -2
  51. package/starters/apps/site-with-visual-cms/src/components/builder-registry.ts +15 -5
  52. package/starters/apps/site-with-visual-cms/src/components/counter/counter.module.css +0 -1
  53. package/starters/apps/site-with-visual-cms/src/components/counter/counter.tsx +7 -7
  54. package/starters/apps/site-with-visual-cms/src/components/footer/footer.tsx +2 -2
  55. package/starters/apps/site-with-visual-cms/src/components/gauge/index.tsx +9 -3
  56. package/starters/apps/site-with-visual-cms/src/components/header/header.tsx +15 -6
  57. package/starters/apps/site-with-visual-cms/src/components/icons/qwik.tsx +7 -1
  58. package/starters/apps/site-with-visual-cms/src/components/router-head/router-head.tsx +2 -2
  59. package/starters/apps/site-with-visual-cms/src/entry.dev.tsx +2 -2
  60. package/starters/apps/site-with-visual-cms/src/entry.preview.tsx +3 -3
  61. package/starters/apps/site-with-visual-cms/src/entry.ssr.tsx +7 -4
  62. package/starters/apps/site-with-visual-cms/src/global.css +3 -3
  63. package/starters/apps/site-with-visual-cms/src/root.tsx +10 -6
  64. package/starters/apps/site-with-visual-cms/src/routes/[...index]/index.tsx +11 -7
  65. package/starters/apps/site-with-visual-cms/src/routes/layout.tsx +3 -3
  66. package/starters/apps/site-with-visual-cms/src/routes/service-worker.ts +3 -3
  67. package/starters/apps/site-with-visual-cms/vite.config.ts +4 -4
  68. package/starters/apps/site-with-visual-cms/builder-integration.ts +0 -853
@@ -16,17 +16,17 @@
16
16
  "qwik": "qwik"
17
17
  },
18
18
  "devDependencies": {
19
- "@builder.io/qwik": "^1.1.5",
20
- "@builder.io/qwik-city": "^1.1.5",
21
- "@types/eslint": "8.40.0",
22
- "@types/node": "^20.2.5",
23
- "@typescript-eslint/eslint-plugin": "5.59.8",
24
- "@typescript-eslint/parser": "5.59.8",
25
- "eslint-plugin-qwik": "^1.1.5",
26
- "eslint": "8.41.0",
19
+ "@builder.io/qwik": "^1.2.0",
20
+ "@builder.io/qwik-city": "^1.2.0",
21
+ "@types/eslint": "8.40.2",
22
+ "@types/node": "^20.3.1",
23
+ "@typescript-eslint/eslint-plugin": "5.60.0",
24
+ "@typescript-eslint/parser": "5.60.0",
25
+ "eslint-plugin-qwik": "^1.2.0",
26
+ "eslint": "8.43.0",
27
27
  "undici": "5.22.1",
28
28
  "prettier": "2.8.8",
29
- "typescript": "5.0.4",
29
+ "typescript": "5.1.3",
30
30
  "vite": "4.3.9",
31
31
  "vite-tsconfig-paths": "4.2.0"
32
32
  },
@@ -9,8 +9,8 @@
9
9
  * - More code is transferred to the browser than in SSR mode.
10
10
  * - Optimizer/Serialization/Deserialization code is not exercised!
11
11
  */
12
- import { render, type RenderOptions } from '@builder.io/qwik';
13
- import Root from './root';
12
+ import { render, type RenderOptions } from "@builder.io/qwik";
13
+ import Root from "./root";
14
14
 
15
15
  export default function (opts: RenderOptions) {
16
16
  return render(document, <Root />, opts);
@@ -10,9 +10,9 @@
10
10
  * - https://vitejs.dev/config/preview-options.html#preview-options
11
11
  *
12
12
  */
13
- import { createQwikCity } from '@builder.io/qwik-city/middleware/node';
14
- import qwikCityPlan from '@qwik-city-plan';
15
- import render from './entry.ssr';
13
+ import { createQwikCity } from "@builder.io/qwik-city/middleware/node";
14
+ import qwikCityPlan from "@qwik-city-plan";
15
+ import render from "./entry.ssr";
16
16
 
17
17
  /**
18
18
  * The default export is the QwikCity adapter used by Vite preview.
@@ -10,9 +10,12 @@
10
10
  * - npm run build
11
11
  *
12
12
  */
13
- import { renderToStream, type RenderToStreamOptions } from '@builder.io/qwik/server';
14
- import { manifest } from '@qwik-client-manifest';
15
- import Root from './root';
13
+ import {
14
+ renderToStream,
15
+ type RenderToStreamOptions,
16
+ } from "@builder.io/qwik/server";
17
+ import { manifest } from "@qwik-client-manifest";
18
+ import Root from "./root";
16
19
 
17
20
  export default function (opts: RenderToStreamOptions) {
18
21
  return renderToStream(<Root />, {
@@ -20,7 +23,7 @@ export default function (opts: RenderToStreamOptions) {
20
23
  ...opts,
21
24
  // Use container attributes to set attributes on the html tag.
22
25
  containerAttributes: {
23
- lang: 'en-us',
26
+ lang: "en-us",
24
27
  ...opts.containerAttributes,
25
28
  },
26
29
  });
@@ -10,9 +10,9 @@ html {
10
10
  -moz-tab-size: 4;
11
11
  -o-tab-size: 4;
12
12
  tab-size: 4;
13
- font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
14
- 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
15
- 'Segoe UI Symbol', 'Noto Color Emoji';
13
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
14
+ "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
15
+ "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
16
16
  }
17
17
 
18
18
  body {
@@ -7,12 +7,11 @@
7
7
  * Qwik uses a service worker to speed up your site and reduce latency, ie, not used in the traditional way of offline.
8
8
  * You can also use this file to add more functionality that runs in the service worker.
9
9
  */
10
- import { setupServiceWorker } from '@builder.io/qwik-city/service-worker';
10
+ import { setupServiceWorker } from "@builder.io/qwik-city/service-worker";
11
11
 
12
12
  setupServiceWorker();
13
13
 
14
- addEventListener('install', () => self.skipWaiting());
15
-
16
- addEventListener('activate', () => self.clients.claim());
14
+ self.addEventListener("install", () => self.skipWaiting());
15
+ self.addEventListener("activate", (ev) => ev.waitUntil(self.clients.claim()));
17
16
 
18
17
  declare const self: ServiceWorkerGlobalScope;
@@ -22,5 +22,5 @@
22
22
  }
23
23
  },
24
24
  "files": ["./.eslintrc.cjs"],
25
- "include": ["src", "./*.d.ts"]
25
+ "include": ["src", "./*.d.ts", "./*.config.ts"]
26
26
  }
@@ -1,14 +1,14 @@
1
- import { defineConfig } from 'vite';
2
- import { qwikVite } from '@builder.io/qwik/optimizer';
3
- import { qwikCity } from '@builder.io/qwik-city/vite';
4
- import tsconfigPaths from 'vite-tsconfig-paths';
1
+ import { defineConfig } from "vite";
2
+ import { qwikVite } from "@builder.io/qwik/optimizer";
3
+ import { qwikCity } from "@builder.io/qwik-city/vite";
4
+ import tsconfigPaths from "vite-tsconfig-paths";
5
5
 
6
6
  export default defineConfig(() => {
7
7
  return {
8
8
  plugins: [qwikCity(), qwikVite(), tsconfigPaths()],
9
9
  preview: {
10
10
  headers: {
11
- 'Cache-Control': 'public, max-age=600',
11
+ "Cache-Control": "public, max-age=600",
12
12
  },
13
13
  },
14
14
  };
@@ -1,5 +1,5 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import { useDocumentHead, useLocation } from '@builder.io/qwik-city';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import { useDocumentHead, useLocation } from "@builder.io/qwik-city";
3
3
 
4
4
  /**
5
5
  * The RouterHead component is placed inside of the document `<head>` element.
@@ -1,6 +1,6 @@
1
- import { component$, useSignal, $ } from '@builder.io/qwik';
2
- import styles from './counter.module.css';
3
- import Gauge from '../gauge';
1
+ import { component$, useSignal, $ } from "@builder.io/qwik";
2
+ import styles from "./counter.module.css";
3
+ import Gauge from "../gauge";
4
4
 
5
5
  export default component$(() => {
6
6
  const count = useSignal(70);
@@ -13,12 +13,18 @@ export default component$(() => {
13
13
  });
14
14
 
15
15
  return (
16
- <div class={styles['counter-wrapper']}>
17
- <button class="button-dark button-small" onClick$={() => setCount(count.value - 1)}>
16
+ <div class={styles["counter-wrapper"]}>
17
+ <button
18
+ class="button-dark button-small"
19
+ onClick$={() => setCount(count.value - 1)}
20
+ >
18
21
  -
19
22
  </button>
20
23
  <Gauge value={count.value} />
21
- <button class="button-dark button-small" onClick$={() => setCount(count.value + 1)}>
24
+ <button
25
+ class="button-dark button-small"
26
+ onClick$={() => setCount(count.value + 1)}
27
+ >
22
28
  +
23
29
  </button>
24
30
  </div>
@@ -1,6 +1,6 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import { useServerTimeLoader } from '~/routes/layout';
3
- import styles from './footer.module.css';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import { useServerTimeLoader } from "~/routes/layout";
3
+ import styles from "./footer.module.css";
4
4
 
5
5
  export default component$(() => {
6
6
  const serverTime = useServerTimeLoader();
@@ -1,5 +1,5 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import styles from './gauge.module.css';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import styles from "./gauge.module.css";
3
3
 
4
4
  export default component$(({ value = 50 }: { value?: number }) => {
5
5
  const safeValue = value < 0 || value > 100 ? 50 : value;
@@ -14,7 +14,13 @@ export default component$(({ value = 50 }: { value?: number }) => {
14
14
  </linearGradient>
15
15
  </defs>
16
16
 
17
- <circle r="56" cx="60" cy="60" stroke-width="8" style="fill: #000; stroke: #0000"></circle>
17
+ <circle
18
+ r="56"
19
+ cx="60"
20
+ cy="60"
21
+ stroke-width="8"
22
+ style="fill: #000; stroke: #0000"
23
+ ></circle>
18
24
 
19
25
  <circle
20
26
  r="56"
@@ -1,11 +1,11 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import { QwikLogo } from '../icons/qwik';
3
- import styles from './header.module.css';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import { QwikLogo } from "../icons/qwik";
3
+ import styles from "./header.module.css";
4
4
 
5
5
  export default component$(() => {
6
6
  return (
7
7
  <header class={styles.header}>
8
- <div class={['container', styles.wrapper]}>
8
+ <div class={["container", styles.wrapper]}>
9
9
  <div class={styles.logo}>
10
10
  <a href="/" title="qwik">
11
11
  <QwikLogo height={50} width={143} />
@@ -13,17 +13,26 @@ export default component$(() => {
13
13
  </div>
14
14
  <ul>
15
15
  <li>
16
- <a href="https://qwik.builder.io/docs/components/overview/" target="_blank">
16
+ <a
17
+ href="https://qwik.builder.io/docs/components/overview/"
18
+ target="_blank"
19
+ >
17
20
  Docs
18
21
  </a>
19
22
  </li>
20
23
  <li>
21
- <a href="https://qwik.builder.io/examples/introduction/hello-world/" target="_blank">
24
+ <a
25
+ href="https://qwik.builder.io/examples/introduction/hello-world/"
26
+ target="_blank"
27
+ >
22
28
  Examples
23
29
  </a>
24
30
  </li>
25
31
  <li>
26
- <a href="https://qwik.builder.io/tutorial/welcome/overview/" target="_blank">
32
+ <a
33
+ href="https://qwik.builder.io/tutorial/welcome/overview/"
34
+ target="_blank"
35
+ >
27
36
  Tutorials
28
37
  </a>
29
38
  </li>
@@ -9,6 +9,16 @@
9
9
  gap: 40px;
10
10
  }
11
11
 
12
+ .hero-image {
13
+ width: 100%;
14
+ position: absolute;
15
+ height: auto;
16
+ object-fit: cover;
17
+ z-index: -1;
18
+ opacity: 0.2;
19
+ pointer-events: none;
20
+ }
21
+
12
22
  .hero p {
13
23
  color: white;
14
24
  margin: 0;
@@ -1,16 +1,18 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import styles from './hero.module.css';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import styles from "./hero.module.css";
3
+ import ImgThunder from "~/media/thunder.png?jsx";
3
4
 
4
5
  export default component$(() => {
5
6
  return (
6
- <div class={['container', styles.hero]}>
7
+ <div class={["container", styles.hero]}>
8
+ <ImgThunder class={styles["hero-image"]} />
7
9
  <h1>
8
10
  So <span class="highlight">fantastic</span>
9
11
  <br />
10
12
  to have <span class="highlight">you</span> here
11
13
  </h1>
12
14
  <p>Have fun building your App with Qwik.</p>
13
- <div class={styles['button-group']}>
15
+ <div class={styles["button-group"]}>
14
16
  <button
15
17
  onClick$={async () => {
16
18
  const defaults = {
@@ -19,7 +21,7 @@ export default component$(() => {
19
21
  gravity: 0,
20
22
  decay: 0.95,
21
23
  startVelocity: 30,
22
- colors: ['006ce9', 'ac7ff4', '18b6f6', '713fc2', 'ffffff'],
24
+ colors: ["006ce9", "ac7ff4", "18b6f6", "713fc2", "ffffff"],
23
25
  origin: {
24
26
  x: 0.5,
25
27
  y: 0.35,
@@ -31,10 +33,11 @@ export default component$(() => {
31
33
  if ((globalThis as any).confetti) {
32
34
  return resolve((globalThis as any).confetti as any);
33
35
  }
34
- const script = document.createElement('script');
36
+ const script = document.createElement("script");
35
37
  script.src =
36
- 'https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js';
37
- script.onload = () => resolve((globalThis as any).confetti as any);
38
+ "https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js";
39
+ script.onload = () =>
40
+ resolve((globalThis as any).confetti as any);
38
41
  script.onerror = reject;
39
42
  document.head.appendChild(script);
40
43
  script.remove();
@@ -66,7 +69,11 @@ export default component$(() => {
66
69
  >
67
70
  Time to celebrate
68
71
  </button>
69
- <a href="https://qwik.builder.io/docs" target="_blank" class="button button-dark">
72
+ <a
73
+ href="https://qwik.builder.io/docs"
74
+ target="_blank"
75
+ class="button button-dark"
76
+ >
70
77
  Explore the docs
71
78
  </a>
72
79
  </div>
@@ -1,4 +1,10 @@
1
- export const QwikLogo = ({ width = 100, height = 35 }: { width?: number; height?: number }) => (
1
+ export const QwikLogo = ({
2
+ width = 100,
3
+ height = 35,
4
+ }: {
5
+ width?: number;
6
+ height?: number;
7
+ }) => (
2
8
  <svg
3
9
  width={width}
4
10
  height={height}
@@ -1,5 +1,5 @@
1
- import { Slot, component$ } from '@builder.io/qwik';
2
- import styles from './infobox.module.css';
1
+ import { Slot, component$ } from "@builder.io/qwik";
2
+ import styles from "./infobox.module.css";
3
3
 
4
4
  export default component$(() => {
5
5
  return (
@@ -1,29 +1,31 @@
1
- import { component$, $, useOnWindow, useSignal } from '@builder.io/qwik';
2
- import styles from './next-steps.module.css';
1
+ import { component$, $, useOnWindow, useSignal } from "@builder.io/qwik";
2
+ import styles from "./next-steps.module.css";
3
3
 
4
4
  export const GETTING_STARTED_STEPS = [
5
5
  {
6
- message: "Press and hold the <b>ALT</b> key to activate 'Click-to-Source' mode",
6
+ message:
7
+ "Press and hold the <b>ALT</b> key to activate 'Click-to-Source' mode",
7
8
  },
8
9
  {
9
- message: 'Select the title of this page while keeping the <b>ALT</b> key pressed',
10
+ message:
11
+ "Select the title of this page while keeping the <b>ALT</b> key pressed",
10
12
  hint: 'Edit the title and save the changes. If your editor does not open, have a look at <a href="https://github.com/yyx990803/launch-editor#supported-editors" target="_blank">this page</a> to set the correct <code>LAUNCH_EDITOR</code> value.',
11
13
  },
12
14
  {
13
15
  message:
14
- '<b>Update</b> now the <code>routeLoader$</code> defined in the <code>src/routes//layout.tsx</code> file',
15
- hint: 'Instead of returning the current date, you could return any possible string.<br />The output is displayed in the footer.',
16
+ "<b>Update</b> now the <code>routeLoader$</code> defined in the <code>src/routes//layout.tsx</code> file",
17
+ hint: "Instead of returning the current date, you could return any possible string.<br />The output is displayed in the footer.",
16
18
  },
17
19
  {
18
- message: 'Create a <b>new Route</b> called <code>/me</code>',
20
+ message: "Create a <b>new Route</b> called <code>/me</code>",
19
21
  hint: 'Create a new directory called <code>me</code> in <code>src/routes</code>. Within this directory create a <code>index.tsx</code> file or copy the <code>src/routes/index.tsx</code> file. Your new route is now accessible <a href="/me" target="_blank">here</a> ✨',
20
22
  },
21
23
  {
22
- message: 'Time to have a look at <b>Forms</b>',
24
+ message: "Time to have a look at <b>Forms</b>",
23
25
  hint: 'Open <a href="/demo/todolist" target="_blank">the TODO list App</a> and add some items to the list. Try the same with disabled JavaScript 🐰',
24
26
  },
25
27
  {
26
- message: '<b>Congratulations!</b> You are now familiar with the basics! 🎉',
28
+ message: "<b>Congratulations!</b> You are now familiar with the basics! 🎉",
27
29
  hint: "If you need further info on how to use qwik, have a look at <a href='https://qwik.builder.io' target='_blank'>qwik.builder.io</a> or join the <a href='https://qwik.builder.io/chat' target='_blank'>Discord channel</a>.",
28
30
  },
29
31
  ];
@@ -32,9 +34,9 @@ export default component$(() => {
32
34
  const gettingStartedStep = useSignal(0);
33
35
 
34
36
  useOnWindow(
35
- 'keydown',
37
+ "keydown",
36
38
  $((e) => {
37
- if ((e as KeyboardEvent).key === 'Alt') {
39
+ if ((e as KeyboardEvent).key === "Alt") {
38
40
  gettingStartedStep.value = 1;
39
41
  }
40
42
  })
@@ -50,19 +52,27 @@ export default component$(() => {
50
52
  <div class={styles.gettingstarted}>
51
53
  <div
52
54
  class={styles.intro}
53
- dangerouslySetInnerHTML={GETTING_STARTED_STEPS[gettingStartedStep.value].message}
55
+ dangerouslySetInnerHTML={
56
+ GETTING_STARTED_STEPS[gettingStartedStep.value].message
57
+ }
54
58
  />
55
59
  <span
56
60
  class={styles.hint}
57
- dangerouslySetInnerHTML={GETTING_STARTED_STEPS[gettingStartedStep.value].hint}
61
+ dangerouslySetInnerHTML={
62
+ GETTING_STARTED_STEPS[gettingStartedStep.value].hint
63
+ }
58
64
  />
59
65
  </div>
60
66
  {gettingStartedStep.value + 1 < GETTING_STARTED_STEPS.length ? (
61
67
  <button class="button-dark" onClick$={() => gettingStartedStep.value++}>
62
- Continue with Step {gettingStartedStep.value + 2} of {GETTING_STARTED_STEPS.length}
68
+ Continue with Step {gettingStartedStep.value + 2} of{" "}
69
+ {GETTING_STARTED_STEPS.length}
63
70
  </button>
64
71
  ) : (
65
- <button class="button-dark" onClick$={() => (gettingStartedStep.value = 0)}>
72
+ <button
73
+ class="button-dark"
74
+ onClick$={() => (gettingStartedStep.value = 0)}
75
+ >
66
76
  Re-Start
67
77
  </button>
68
78
  )}
@@ -22,9 +22,9 @@ html {
22
22
  -moz-tab-size: 4;
23
23
  -o-tab-size: 4;
24
24
  tab-size: 4;
25
- font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
26
- 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
27
- 'Segoe UI Symbol', 'Noto Color Emoji';
25
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
26
+ "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
27
+ "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
28
28
  }
29
29
 
30
30
  body {
@@ -1,15 +1,19 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import { QwikCityProvider, RouterOutlet, ServiceWorkerRegister } from '@builder.io/qwik-city';
3
- import { RouterHead } from './components/router-head/router-head';
1
+ import { component$ } from "@builder.io/qwik";
2
+ import {
3
+ QwikCityProvider,
4
+ RouterOutlet,
5
+ ServiceWorkerRegister,
6
+ } from "@builder.io/qwik-city";
7
+ import { RouterHead } from "./components/router-head/router-head";
4
8
 
5
- import './global.css';
9
+ import "./global.css";
6
10
 
7
11
  export default component$(() => {
8
12
  /**
9
13
  * The root of a QwikCity site always start with the <QwikCityProvider> component,
10
14
  * immediately followed by the document's <head> and <body>.
11
15
  *
12
- * Dont remove the `<head>` and `<body>` elements.
16
+ * Don't remove the `<head>` and `<body>` elements.
13
17
  */
14
18
 
15
19
  return (
@@ -18,10 +22,10 @@ export default component$(() => {
18
22
  <meta charSet="utf-8" />
19
23
  <link rel="manifest" href="/manifest.json" />
20
24
  <RouterHead />
25
+ <ServiceWorkerRegister />
21
26
  </head>
22
27
  <body lang="en">
23
28
  <RouterOutlet />
24
- <ServiceWorkerRegister />
25
29
  </body>
26
30
  </QwikCityProvider>
27
31
  );
@@ -31,7 +31,9 @@ h1 {
31
31
  display: block;
32
32
  width: var(--size);
33
33
  height: var(--size);
34
- transform: rotateZ(calc(var(--rotation) * var(--state) * (var(--center) - var(--index))));
34
+ transform: rotateZ(
35
+ calc(var(--rotation) * var(--state) * (var(--center) - var(--index)))
36
+ );
35
37
  transition-property: transform, border-color;
36
38
  transition-duration: 5s;
37
39
  transition-timing-function: ease-in-out;
@@ -1,6 +1,11 @@
1
- import { component$, useVisibleTask$, useStore, useStylesScoped$ } from '@builder.io/qwik';
2
- import { type DocumentHead, useLocation } from '@builder.io/qwik-city';
3
- import styles from './flower.css?inline';
1
+ import {
2
+ component$,
3
+ useVisibleTask$,
4
+ useStore,
5
+ useStylesScoped$,
6
+ } from "@builder.io/qwik";
7
+ import { type DocumentHead, useLocation } from "@builder.io/qwik-city";
8
+ import styles from "./flower.css?inline";
4
9
 
5
10
  export default component$(() => {
6
11
  useStylesScoped$(styles);
@@ -37,11 +42,11 @@ export default component$(() => {
37
42
  />
38
43
  <div
39
44
  style={{
40
- '--state': `${state.count * 0.1}`,
45
+ "--state": `${state.count * 0.1}`,
41
46
  }}
42
47
  class={{
43
48
  host: true,
44
- pride: loc.url.searchParams.get('pride') === 'true',
49
+ pride: loc.url.searchParams.get("pride") === "true",
45
50
  }}
46
51
  >
47
52
  {Array.from({ length: state.number }, (_, i) => (
@@ -51,7 +56,7 @@ export default component$(() => {
51
56
  square: true,
52
57
  odd: i % 2 === 0,
53
58
  }}
54
- style={{ '--index': `${i + 1}` }}
59
+ style={{ "--index": `${i + 1}` }}
55
60
  />
56
61
  )).reverse()}
57
62
  </div>
@@ -60,5 +65,5 @@ export default component$(() => {
60
65
  });
61
66
 
62
67
  export const head: DocumentHead = {
63
- title: 'Qwik Flower',
68
+ title: "Qwik Flower",
64
69
  };
@@ -1,4 +1,4 @@
1
- import { component$ } from '@builder.io/qwik';
1
+ import { component$ } from "@builder.io/qwik";
2
2
  import {
3
3
  type DocumentHead,
4
4
  routeLoader$,
@@ -6,8 +6,8 @@ import {
6
6
  zod$,
7
7
  z,
8
8
  Form,
9
- } from '@builder.io/qwik-city';
10
- import styles from './todolist.module.css';
9
+ } from "@builder.io/qwik-city";
10
+ import styles from "./todolist.module.css";
11
11
 
12
12
  interface ListItem {
13
13
  text: string;
@@ -46,29 +46,33 @@ export default component$(() => {
46
46
  <div role="presentation" class="ellipsis"></div>
47
47
 
48
48
  <div class="container container-center">
49
- {(list.value.length && (
49
+ {list.value.length === 0 ? (
50
+ <span class={styles.empty}>No items found</span>
51
+ ) : (
50
52
  <ul class={styles.list}>
51
53
  {list.value.map((item, index) => (
52
54
  <li key={`items-${index}`}>{item.text}</li>
53
55
  ))}
54
56
  </ul>
55
- )) || <span class={styles.empty}>No items found</span>}
57
+ )}
56
58
  </div>
57
59
 
58
60
  <div class="container container-center">
59
61
  <Form action={action} spaReset>
60
- <input type="text" name="text" required class={styles.input} />{' '}
62
+ <input type="text" name="text" required class={styles.input} />{" "}
61
63
  <button type="submit" class="button-dark">
62
64
  Add item
63
65
  </button>
64
66
  </Form>
65
67
 
66
- <p class={styles.hint}>PS: This little app works even when JavaScript is disabled.</p>
68
+ <p class={styles.hint}>
69
+ PS: This little app works even when JavaScript is disabled.
70
+ </p>
67
71
  </div>
68
72
  </>
69
73
  );
70
74
  });
71
75
 
72
76
  export const head: DocumentHead = {
73
- title: 'Qwik Todo List',
77
+ title: "Qwik Todo List",
74
78
  };