create-qwik 1.1.5-dev20230622201058 → 1.1.5-dev20230625145153
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 +3 -3
- package/package.json +1 -1
- package/starters/apps/base/.eslintrc.cjs +23 -23
- package/starters/apps/base/package.json +3 -3
- 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 -3
- 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.tsx +16 -11
- 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/root.tsx +8 -4
- 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 +8 -6
- 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 +8 -4
- 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/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/src/components/builder-registry.ts +5 -5
- package/starters/apps/site-with-visual-cms/src/components/counter/counter.tsx +6 -6
- 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 +8 -4
- 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
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { component$ } from
|
|
2
|
-
import { DocumentHead, routeLoader$ } from
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { component$ } from "@builder.io/qwik";
|
|
2
|
+
import { DocumentHead, routeLoader$ } from "@builder.io/qwik-city";
|
|
3
|
+
import {
|
|
4
|
+
getContent,
|
|
5
|
+
RenderContent,
|
|
6
|
+
getBuilderSearchParams,
|
|
7
|
+
} from "@builder.io/sdk-qwik";
|
|
8
|
+
import { CUSTOM_COMPONENTS } from "../../components/builder-registry";
|
|
5
9
|
|
|
6
10
|
// This page is a catch-all for all routes that don't have a pre-defined route.
|
|
7
11
|
// Using a catch-all route allows you to dynamically create enw pages in Builder.
|
|
@@ -10,13 +14,13 @@ import { CUSTOM_COMPONENTS } from '../../components/builder-registry';
|
|
|
10
14
|
// `routeLoader$()` takes an async function to fetch content
|
|
11
15
|
// from Builder with using `getContent()`.
|
|
12
16
|
export const useBuilderContent = routeLoader$(async ({ url, error }) => {
|
|
13
|
-
const isPreviewing = url.searchParams.has(
|
|
17
|
+
const isPreviewing = url.searchParams.has("builder.preview");
|
|
14
18
|
|
|
15
19
|
// Fetch Builder.io Visual CMS content using the Qwik SDK.
|
|
16
20
|
// The public API key is set in the .env file at the root
|
|
17
21
|
// https://www.builder.io/c/docs/using-your-api-key
|
|
18
22
|
const builderContent = await getContent({
|
|
19
|
-
model:
|
|
23
|
+
model: "page",
|
|
20
24
|
apiKey: import.meta.env.PUBLIC_BUILDER_API_KEY,
|
|
21
25
|
options: getBuilderSearchParams(url.searchParams),
|
|
22
26
|
userAttributes: {
|
|
@@ -27,7 +31,7 @@ export const useBuilderContent = routeLoader$(async ({ url, error }) => {
|
|
|
27
31
|
// If there's no content, throw a 404.
|
|
28
32
|
// You can use your own 404 component here
|
|
29
33
|
if (!builderContent && !isPreviewing) {
|
|
30
|
-
throw error(404,
|
|
34
|
+
throw error(404, "Page not found");
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
// return content fetched from Builder, which is JSON
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { component$, Slot } from
|
|
2
|
-
import Header from
|
|
3
|
-
import Footer from
|
|
1
|
+
import { component$, Slot } from "@builder.io/qwik";
|
|
2
|
+
import Header from "../components/header/header";
|
|
3
|
+
import Footer from "../components/footer/footer";
|
|
4
4
|
|
|
5
5
|
export default component$(() => {
|
|
6
6
|
return (
|
|
@@ -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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineConfig } from
|
|
2
|
-
import { qwikVite } from
|
|
3
|
-
import { qwikCity } from
|
|
4
|
-
import { builderDevTools } from
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import { qwikVite } from "@builder.io/qwik/optimizer";
|
|
3
|
+
import { qwikCity } from "@builder.io/qwik-city/vite";
|
|
4
|
+
import { builderDevTools } from "@builder.io/dev-tools/vite";
|
|
5
5
|
|
|
6
6
|
export default defineConfig(() => {
|
|
7
7
|
return {
|