create-qwik 1.1.5 → 1.2.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.
- package/index.cjs +63 -62
- package/package.json +1 -1
- package/starters/apps/base/.eslintrc.cjs +23 -22
- package/starters/apps/base/.vscode/launch.json +2 -2
- package/starters/apps/base/.vscode/qwik-city.code-snippets +5 -13
- package/starters/apps/base/.vscode/qwik.code-snippets +77 -95
- package/starters/apps/base/.vscode/settings.json +3 -0
- package/starters/apps/base/README.md +5 -5
- package/starters/apps/base/gitignore +3 -1
- package/starters/apps/base/package.json +9 -9
- package/starters/apps/base/src/entry.dev.tsx +2 -2
- package/starters/apps/base/src/entry.preview.tsx +3 -3
- package/starters/apps/base/src/entry.ssr.tsx +7 -4
- package/starters/apps/base/src/global.css +3 -3
- package/starters/apps/base/src/routes/service-worker.ts +3 -4
- package/starters/apps/base/tsconfig.json +1 -1
- package/starters/apps/base/vite.config.ts +5 -5
- package/starters/apps/basic/src/components/router-head/router-head.tsx +2 -2
- package/starters/apps/basic/src/components/starter/counter/counter.tsx +12 -6
- package/starters/apps/basic/src/components/starter/footer/footer.tsx +3 -3
- package/starters/apps/basic/src/components/starter/gauge/index.tsx +9 -3
- package/starters/apps/basic/src/components/starter/header/header.tsx +16 -7
- package/starters/apps/basic/src/components/starter/hero/hero.module.css +10 -0
- package/starters/apps/basic/src/components/starter/hero/hero.tsx +16 -9
- package/starters/apps/basic/src/components/starter/icons/qwik.tsx +7 -1
- package/starters/apps/basic/src/components/starter/infobox/infobox.tsx +2 -2
- package/starters/apps/basic/src/components/starter/next-steps/next-steps.tsx +25 -15
- package/starters/apps/basic/src/global.css +3 -3
- package/starters/apps/basic/src/media/thunder.png +0 -0
- package/starters/apps/basic/src/root.tsx +10 -6
- package/starters/apps/basic/src/routes/demo/flower/flower.css +3 -1
- package/starters/apps/basic/src/routes/demo/flower/index.tsx +12 -7
- package/starters/apps/basic/src/routes/demo/todolist/index.tsx +12 -8
- package/starters/apps/basic/src/routes/index.tsx +10 -10
- package/starters/apps/basic/src/routes/layout.tsx +6 -6
- package/starters/apps/basic/src/routes/service-worker.ts +3 -3
- package/starters/apps/basic/src/routes/styles.css +4 -4
- package/starters/apps/empty/src/components/router-head/router-head.tsx +2 -2
- package/starters/apps/empty/src/root.tsx +9 -5
- package/starters/apps/empty/src/routes/index.tsx +5 -5
- package/starters/apps/empty/src/routes/layout.tsx +2 -2
- package/starters/apps/empty/src/routes/service-worker.ts +3 -3
- package/starters/apps/library/.eslintrc.cjs +21 -21
- package/starters/apps/library/package.json +7 -7
- package/starters/apps/library/src/components/counter/counter.tsx +1 -1
- package/starters/apps/library/src/components/logo/logo.tsx +1 -1
- package/starters/apps/library/src/entry.dev.tsx +2 -2
- package/starters/apps/library/src/entry.ssr.tsx +6 -3
- package/starters/apps/library/src/index.ts +2 -2
- package/starters/apps/library/src/root.tsx +2 -2
- package/starters/apps/library/vite.config.ts +6 -6
- package/starters/apps/site-with-visual-cms/README.md +15 -0
- package/starters/apps/site-with-visual-cms/package.json +2 -2
- package/starters/apps/site-with-visual-cms/src/components/builder-registry.ts +15 -5
- package/starters/apps/site-with-visual-cms/src/components/counter/counter.module.css +0 -1
- package/starters/apps/site-with-visual-cms/src/components/counter/counter.tsx +7 -7
- package/starters/apps/site-with-visual-cms/src/components/footer/footer.tsx +2 -2
- package/starters/apps/site-with-visual-cms/src/components/gauge/index.tsx +9 -3
- package/starters/apps/site-with-visual-cms/src/components/header/header.tsx +15 -6
- package/starters/apps/site-with-visual-cms/src/components/icons/qwik.tsx +7 -1
- package/starters/apps/site-with-visual-cms/src/components/router-head/router-head.tsx +2 -2
- package/starters/apps/site-with-visual-cms/src/entry.dev.tsx +2 -2
- package/starters/apps/site-with-visual-cms/src/entry.preview.tsx +3 -3
- package/starters/apps/site-with-visual-cms/src/entry.ssr.tsx +7 -4
- package/starters/apps/site-with-visual-cms/src/global.css +3 -3
- package/starters/apps/site-with-visual-cms/src/root.tsx +10 -6
- package/starters/apps/site-with-visual-cms/src/routes/[...index]/index.tsx +11 -7
- package/starters/apps/site-with-visual-cms/src/routes/layout.tsx +3 -3
- package/starters/apps/site-with-visual-cms/src/routes/service-worker.ts +3 -3
- package/starters/apps/site-with-visual-cms/vite.config.ts +4 -4
- package/starters/apps/site-with-visual-cms/builder-integration.ts +0 -853
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { component$, $, useOnWindow, useSignal } from
|
|
2
|
-
import styles from
|
|
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:
|
|
6
|
+
message:
|
|
7
|
+
"Press and hold the <b>ALT</b> key to activate 'Click-to-Source' mode",
|
|
7
8
|
},
|
|
8
9
|
{
|
|
9
|
-
message:
|
|
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
|
-
|
|
15
|
-
hint:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
37
|
+
"keydown",
|
|
36
38
|
$((e) => {
|
|
37
|
-
if ((e as KeyboardEvent).key ===
|
|
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={
|
|
55
|
+
dangerouslySetInnerHTML={
|
|
56
|
+
GETTING_STARTED_STEPS[gettingStartedStep.value].message
|
|
57
|
+
}
|
|
54
58
|
/>
|
|
55
59
|
<span
|
|
56
60
|
class={styles.hint}
|
|
57
|
-
dangerouslySetInnerHTML={
|
|
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
|
|
68
|
+
Continue with Step {gettingStartedStep.value + 2} of{" "}
|
|
69
|
+
{GETTING_STARTED_STEPS.length}
|
|
63
70
|
</button>
|
|
64
71
|
) : (
|
|
65
|
-
<button
|
|
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,
|
|
26
|
-
|
|
27
|
-
|
|
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 {
|
|
Binary file
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { component$ } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
|
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
|
-
*
|
|
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(
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
45
|
+
"--state": `${state.count * 0.1}`,
|
|
41
46
|
}}
|
|
42
47
|
class={{
|
|
43
48
|
host: true,
|
|
44
|
-
pride: loc.url.searchParams.get(
|
|
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={{
|
|
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:
|
|
68
|
+
title: "Qwik Flower",
|
|
64
69
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { component$ } from
|
|
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
|
|
10
|
-
import styles from
|
|
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
|
-
{
|
|
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
|
-
)
|
|
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}>
|
|
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:
|
|
77
|
+
title: "Qwik Todo List",
|
|
74
78
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { component$ } from
|
|
2
|
-
import type { DocumentHead } from
|
|
1
|
+
import { component$ } from "@builder.io/qwik";
|
|
2
|
+
import type { DocumentHead } from "@builder.io/qwik-city";
|
|
3
3
|
|
|
4
|
-
import Counter from
|
|
5
|
-
import Hero from
|
|
6
|
-
import Infobox from
|
|
7
|
-
import Starter from
|
|
4
|
+
import Counter from "~/components/starter/counter/counter";
|
|
5
|
+
import Hero from "~/components/starter/hero/hero";
|
|
6
|
+
import Infobox from "~/components/starter/infobox/infobox";
|
|
7
|
+
import Starter from "~/components/starter/next-steps/next-steps";
|
|
8
8
|
|
|
9
9
|
export default component$(() => {
|
|
10
10
|
return (
|
|
@@ -58,7 +58,7 @@ export default component$(() => {
|
|
|
58
58
|
Example Apps
|
|
59
59
|
</div>
|
|
60
60
|
<p>
|
|
61
|
-
Have a look at the <a href="/demo/flower">Flower App</a> or the{
|
|
61
|
+
Have a look at the <a href="/demo/flower">Flower App</a> or the{" "}
|
|
62
62
|
<a href="/demo/todolist">Todo App</a>.
|
|
63
63
|
</p>
|
|
64
64
|
</Infobox>
|
|
@@ -102,11 +102,11 @@ export default component$(() => {
|
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
export const head: DocumentHead = {
|
|
105
|
-
title:
|
|
105
|
+
title: "Welcome to Qwik",
|
|
106
106
|
meta: [
|
|
107
107
|
{
|
|
108
|
-
name:
|
|
109
|
-
content:
|
|
108
|
+
name: "description",
|
|
109
|
+
content: "Qwik site description",
|
|
110
110
|
},
|
|
111
111
|
],
|
|
112
112
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { component$, Slot, useStyles$ } from
|
|
2
|
-
import { routeLoader$ } from
|
|
3
|
-
import type { RequestHandler } from
|
|
1
|
+
import { component$, Slot, useStyles$ } from "@builder.io/qwik";
|
|
2
|
+
import { routeLoader$ } from "@builder.io/qwik-city";
|
|
3
|
+
import type { RequestHandler } from "@builder.io/qwik-city";
|
|
4
4
|
|
|
5
|
-
import Header from
|
|
6
|
-
import Footer from
|
|
5
|
+
import Header from "~/components/starter/header/header";
|
|
6
|
+
import Footer from "~/components/starter/footer/footer";
|
|
7
7
|
|
|
8
|
-
import styles from
|
|
8
|
+
import styles from "./styles.css?inline";
|
|
9
9
|
|
|
10
10
|
export const onGet: RequestHandler = async ({ cacheControl }) => {
|
|
11
11
|
// Control caching for this request for best performance and to reduce hosting costs:
|
|
@@ -7,12 +7,12 @@
|
|
|
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
|
|
10
|
+
import { setupServiceWorker } from "@builder.io/qwik-city/service-worker";
|
|
11
11
|
|
|
12
12
|
setupServiceWorker();
|
|
13
13
|
|
|
14
|
-
addEventListener(
|
|
14
|
+
addEventListener("install", () => self.skipWaiting());
|
|
15
15
|
|
|
16
|
-
addEventListener(
|
|
16
|
+
addEventListener("activate", () => self.clients.claim());
|
|
17
17
|
|
|
18
18
|
declare const self: ServiceWorkerGlobalScope;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
/* SHELL ---------------------------------------- */
|
|
4
4
|
html {
|
|
5
|
-
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
|
|
6
|
+
"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
|
|
7
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
body {
|
|
@@ -182,7 +182,7 @@ button.button-small {
|
|
|
182
182
|
.icon:before {
|
|
183
183
|
width: 18px;
|
|
184
184
|
height: 18px;
|
|
185
|
-
content:
|
|
185
|
+
content: "";
|
|
186
186
|
display: inline-block;
|
|
187
187
|
margin-right: 20px;
|
|
188
188
|
position: relative;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { component$ } from
|
|
2
|
-
import { useDocumentHead, useLocation } from
|
|
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,15 +1,19 @@
|
|
|
1
|
-
import { component$ } from
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
|
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
|
-
*
|
|
16
|
+
* Don't remove the `<head>` and `<body>` elements.
|
|
13
17
|
*/
|
|
14
18
|
|
|
15
19
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { component$ } from
|
|
2
|
-
import type { DocumentHead } from
|
|
1
|
+
import { component$ } from "@builder.io/qwik";
|
|
2
|
+
import type { DocumentHead } from "@builder.io/qwik-city";
|
|
3
3
|
|
|
4
4
|
export default component$(() => {
|
|
5
5
|
return (
|
|
@@ -15,11 +15,11 @@ export default component$(() => {
|
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
export const head: DocumentHead = {
|
|
18
|
-
title:
|
|
18
|
+
title: "Welcome to Qwik",
|
|
19
19
|
meta: [
|
|
20
20
|
{
|
|
21
|
-
name:
|
|
22
|
-
content:
|
|
21
|
+
name: "description",
|
|
22
|
+
content: "Qwik site description",
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { component$, Slot } from
|
|
2
|
-
import type { RequestHandler } from
|
|
1
|
+
import { component$, Slot } from "@builder.io/qwik";
|
|
2
|
+
import type { RequestHandler } from "@builder.io/qwik-city";
|
|
3
3
|
|
|
4
4
|
export const onGet: RequestHandler = async ({ cacheControl }) => {
|
|
5
5
|
// Control caching for this request for best performance and to reduce hosting costs:
|
|
@@ -7,12 +7,12 @@
|
|
|
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
|
|
10
|
+
import { setupServiceWorker } from "@builder.io/qwik-city/service-worker";
|
|
11
11
|
|
|
12
12
|
setupServiceWorker();
|
|
13
13
|
|
|
14
|
-
addEventListener(
|
|
14
|
+
addEventListener("install", () => self.skipWaiting());
|
|
15
15
|
|
|
16
|
-
addEventListener(
|
|
16
|
+
addEventListener("activate", () => self.clients.claim());
|
|
17
17
|
|
|
18
18
|
declare const self: ServiceWorkerGlobalScope;
|
|
@@ -6,35 +6,35 @@ module.exports = {
|
|
|
6
6
|
node: true,
|
|
7
7
|
},
|
|
8
8
|
extends: [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
"eslint:recommended",
|
|
10
|
+
"plugin:@typescript-eslint/recommended",
|
|
11
|
+
"plugin:qwik/recommended",
|
|
12
12
|
],
|
|
13
|
-
parser:
|
|
13
|
+
parser: "@typescript-eslint/parser",
|
|
14
14
|
parserOptions: {
|
|
15
15
|
tsconfigRootDir: __dirname,
|
|
16
|
-
project: [
|
|
16
|
+
project: ["./tsconfig.json"],
|
|
17
17
|
ecmaVersion: 2021,
|
|
18
|
-
sourceType:
|
|
18
|
+
sourceType: "module",
|
|
19
19
|
ecmaFeatures: {
|
|
20
20
|
jsx: true,
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
|
-
plugins: [
|
|
23
|
+
plugins: ["@typescript-eslint"],
|
|
24
24
|
rules: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
26
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
27
|
+
"@typescript-eslint/no-inferrable-types": "off",
|
|
28
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
29
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
30
|
+
"@typescript-eslint/no-namespace": "off",
|
|
31
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
32
|
+
"@typescript-eslint/no-this-alias": "off",
|
|
33
|
+
"@typescript-eslint/ban-types": "off",
|
|
34
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
35
|
+
"prefer-spread": "off",
|
|
36
|
+
"no-case-declarations": "off",
|
|
37
|
+
"no-console": "off",
|
|
38
|
+
"@typescript-eslint/no-unused-vars": ["error"],
|
|
39
39
|
},
|
|
40
40
|
};
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"release": "np"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@builder.io/qwik": "1.1
|
|
36
|
-
"@types/eslint": "8.40.
|
|
37
|
-
"@types/node": "^20.
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
39
|
-
"@typescript-eslint/parser": "5.
|
|
35
|
+
"@builder.io/qwik": "1.2.1",
|
|
36
|
+
"@types/eslint": "8.40.2",
|
|
37
|
+
"@types/node": "^20.3.1",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "5.60.0",
|
|
39
|
+
"@typescript-eslint/parser": "5.60.0",
|
|
40
40
|
"eslint-plugin-qwik": "latest",
|
|
41
|
-
"eslint": "8.
|
|
41
|
+
"eslint": "8.43.0",
|
|
42
42
|
"undici": "5.22.1",
|
|
43
43
|
"np": "7.6.1",
|
|
44
44
|
"prettier": "2.8.8",
|
|
45
|
-
"typescript": "5.
|
|
45
|
+
"typescript": "5.1.3",
|
|
46
46
|
"vite": "4.3.9"
|
|
47
47
|
},
|
|
48
48
|
"__qwik__": {
|
|
@@ -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
|
|
13
|
-
import Root from
|
|
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,12 @@
|
|
|
10
10
|
* - npm run build
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
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 />, {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Logo } from
|
|
2
|
-
export { Counter } from
|
|
1
|
+
export { Logo } from "./components/logo/logo";
|
|
2
|
+
export { Counter } from "./components/counter/counter";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineConfig } from
|
|
2
|
-
import { qwikVite } from
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import { qwikVite } from "@builder.io/qwik/optimizer";
|
|
3
3
|
|
|
4
4
|
export default defineConfig(() => {
|
|
5
5
|
return {
|
|
6
6
|
build: {
|
|
7
|
-
target:
|
|
7
|
+
target: "es2020",
|
|
8
8
|
lib: {
|
|
9
|
-
entry:
|
|
10
|
-
formats: [
|
|
11
|
-
fileName: (format) => `index.qwik.${format ===
|
|
9
|
+
entry: "./src/index.ts",
|
|
10
|
+
formats: ["es", "cjs"],
|
|
11
|
+
fileName: (format) => `index.qwik.${format === "es" ? "mjs" : "cjs"}`,
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
plugins: [qwikVite()],
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## Builder.io + Qwik
|
|
2
|
+
|
|
3
|
+
An example of using [Builder.io's](https://www.builder.io/) visual editor with Qwik.
|
|
4
|
+
|
|
5
|
+
See the catchall route at [src/routes/[...index]/index.tsx](src/routes/[...index]/index.tsx) for the integration code.
|
|
6
|
+
|
|
7
|
+
Registered components can be found in [src/components/builder-registry.ts](src/components/builder-registry.ts)
|
|
8
|
+
|
|
9
|
+
### Docs
|
|
10
|
+
|
|
11
|
+
See our full integration guides [here](https://www.builder.io/c/docs/developers)
|
|
12
|
+
|
|
13
|
+
Also, when you push your integration to production, go back and update your preview URL to your production URL so now anyone on your team can visuall create content in your Qwik app!
|
|
14
|
+
|
|
15
|
+
Also, to integrate structured data, see [this guide](https://www.builder.io/c/docs/integrate-cms-data)
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"name": "qwik-site-with-visual-cms",
|
|
3
3
|
"description": "Site integrated with Builder.io for visual editing",
|
|
4
4
|
"devDependencies": {
|
|
5
|
-
"@builder.io/dev-tools": "^0.0.
|
|
6
|
-
"@builder.io/sdk-qwik": "^0.
|
|
5
|
+
"@builder.io/dev-tools": "^0.0.7",
|
|
6
|
+
"@builder.io/sdk-qwik": "^0.4.1"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"__qwik__": {
|