diff --git a/packages/create-qwik/src/helpers/templateManager.ts b/packages/create-qwik/src/helpers/templateManager.ts index f94662edd9a..9221b370e87 100644 --- a/packages/create-qwik/src/helpers/templateManager.ts +++ b/packages/create-qwik/src/helpers/templateManager.ts @@ -1,5 +1,4 @@ import type { IntegrationData, IntegrationType } from 'packages/qwik/src/cli/types'; - import { loadIntegrations } from 'packages/qwik/src/cli/utils/integrations'; let integrations: IntegrationData[] | undefined = undefined; diff --git a/scripts/validate-cli.ts b/scripts/validate-cli.ts index 29a7f0851de..e7c07e8508b 100644 --- a/scripts/validate-cli.ts +++ b/scripts/validate-cli.ts @@ -45,9 +45,10 @@ async function validateCreateQwikCli() { const tmpDir = join(__dirname, '..', 'dist-dev'); await Promise.all([ - validateStarter(api, tmpDir, 'playground', true, `👻`, qwikVersion), - validateStarter(api, tmpDir, 'empty', true, `🫙`, qwikVersion), - validateStarter(api, tmpDir, 'library', false, `📚`, qwikVersion), + validateStarter(api, tmpDir, 'basic-starter', true, `👋`, qwikVersion), + validateStarter(api, tmpDir, 'playground-starter', true, `👻`, qwikVersion), + validateStarter(api, tmpDir, 'empty-starter', true, `🫙`, qwikVersion), + validateStarter(api, tmpDir, 'library-starter', false, `📚`, qwikVersion), ]).catch((e) => { console.error(e); panic(String(e)); diff --git a/starters/apps/basic-starter/package.json b/starters/apps/basic-starter/package.json new file mode 100644 index 00000000000..8037de6c935 --- /dev/null +++ b/starters/apps/basic-starter/package.json @@ -0,0 +1,13 @@ +{ + "name": "qwik-basic-starter", + "description": "One page app ready to go", + "type": "module", + "__qwik__": { + "priority": 2, + "displayName": "Basic App (Qwik City + Qwik)", + "qwikCity": true, + "docs": [ + "https://qwik.dev/docs/getting-started/" + ] + } +} diff --git a/starters/apps/empty/public/favicon.svg b/starters/apps/basic-starter/public/favicon.svg similarity index 100% rename from starters/apps/empty/public/favicon.svg rename to starters/apps/basic-starter/public/favicon.svg diff --git a/starters/apps/playground/public/fonts/poppins-400.woff2 b/starters/apps/basic-starter/public/fonts/poppins-400.woff2 similarity index 100% rename from starters/apps/playground/public/fonts/poppins-400.woff2 rename to starters/apps/basic-starter/public/fonts/poppins-400.woff2 diff --git a/starters/apps/playground/public/fonts/poppins-500.woff2 b/starters/apps/basic-starter/public/fonts/poppins-500.woff2 similarity index 100% rename from starters/apps/playground/public/fonts/poppins-500.woff2 rename to starters/apps/basic-starter/public/fonts/poppins-500.woff2 diff --git a/starters/apps/playground/public/fonts/poppins-700.woff2 b/starters/apps/basic-starter/public/fonts/poppins-700.woff2 similarity index 100% rename from starters/apps/playground/public/fonts/poppins-700.woff2 rename to starters/apps/basic-starter/public/fonts/poppins-700.woff2 diff --git a/starters/apps/empty/public/manifest.json b/starters/apps/basic-starter/public/manifest.json similarity index 100% rename from starters/apps/empty/public/manifest.json rename to starters/apps/basic-starter/public/manifest.json diff --git a/starters/apps/empty/public/robots.txt b/starters/apps/basic-starter/public/robots.txt similarity index 100% rename from starters/apps/empty/public/robots.txt rename to starters/apps/basic-starter/public/robots.txt diff --git a/starters/apps/playground/src/components/router-head/router-head.tsx b/starters/apps/basic-starter/src/components/router-head/router-head.tsx similarity index 100% rename from starters/apps/playground/src/components/router-head/router-head.tsx rename to starters/apps/basic-starter/src/components/router-head/router-head.tsx diff --git a/starters/apps/playground/src/components/starter/footer/footer.module.css b/starters/apps/basic-starter/src/components/starter/footer/footer.module.css similarity index 100% rename from starters/apps/playground/src/components/starter/footer/footer.module.css rename to starters/apps/basic-starter/src/components/starter/footer/footer.module.css diff --git a/starters/apps/basic-starter/src/components/starter/footer/footer.tsx b/starters/apps/basic-starter/src/components/starter/footer/footer.tsx new file mode 100644 index 00000000000..d54749b2bf9 --- /dev/null +++ b/starters/apps/basic-starter/src/components/starter/footer/footer.tsx @@ -0,0 +1,12 @@ +import { component$ } from "@builder.io/qwik"; +import styles from "./footer.module.css"; + +export default component$(() => { + return ( + + ); +}); diff --git a/starters/apps/playground/src/components/starter/header/header.module.css b/starters/apps/basic-starter/src/components/starter/header/header.module.css similarity index 100% rename from starters/apps/playground/src/components/starter/header/header.module.css rename to starters/apps/basic-starter/src/components/starter/header/header.module.css diff --git a/starters/apps/playground/src/components/starter/header/header.tsx b/starters/apps/basic-starter/src/components/starter/header/header.tsx similarity index 100% rename from starters/apps/playground/src/components/starter/header/header.tsx rename to starters/apps/basic-starter/src/components/starter/header/header.tsx diff --git a/starters/apps/playground/src/components/starter/hero/hero.module.css b/starters/apps/basic-starter/src/components/starter/hero/hero.module.css similarity index 100% rename from starters/apps/playground/src/components/starter/hero/hero.module.css rename to starters/apps/basic-starter/src/components/starter/hero/hero.module.css diff --git a/starters/apps/basic-starter/src/components/starter/hero/hero.tsx b/starters/apps/basic-starter/src/components/starter/hero/hero.tsx new file mode 100644 index 00000000000..d84e854e436 --- /dev/null +++ b/starters/apps/basic-starter/src/components/starter/hero/hero.tsx @@ -0,0 +1,82 @@ +import { component$ } from "@builder.io/qwik"; +import ImgThunder from "../../../media/thunder.png?jsx"; +import styles from "./hero.module.css"; + +export default component$(() => { + return ( +
+ +

+ So fantastic +
+ to have you here +

+

To see cooler demos generate the playground app 😉

+
+ + + Explore the docs + +
+
+ ); +}); diff --git a/starters/apps/playground/src/components/starter/icons/qwik.tsx b/starters/apps/basic-starter/src/components/starter/icons/qwik.tsx similarity index 100% rename from starters/apps/playground/src/components/starter/icons/qwik.tsx rename to starters/apps/basic-starter/src/components/starter/icons/qwik.tsx diff --git a/starters/apps/playground/src/components/starter/infobox/infobox.module.css b/starters/apps/basic-starter/src/components/starter/infobox/infobox.module.css similarity index 100% rename from starters/apps/playground/src/components/starter/infobox/infobox.module.css rename to starters/apps/basic-starter/src/components/starter/infobox/infobox.module.css diff --git a/starters/apps/playground/src/components/starter/infobox/infobox.tsx b/starters/apps/basic-starter/src/components/starter/infobox/infobox.tsx similarity index 100% rename from starters/apps/playground/src/components/starter/infobox/infobox.tsx rename to starters/apps/basic-starter/src/components/starter/infobox/infobox.tsx diff --git a/starters/apps/playground/src/global.css b/starters/apps/basic-starter/src/global.css similarity index 100% rename from starters/apps/playground/src/global.css rename to starters/apps/basic-starter/src/global.css diff --git a/starters/apps/playground/src/media/thunder.png b/starters/apps/basic-starter/src/media/thunder.png similarity index 100% rename from starters/apps/playground/src/media/thunder.png rename to starters/apps/basic-starter/src/media/thunder.png diff --git a/starters/apps/playground/src/root.tsx b/starters/apps/basic-starter/src/root.tsx similarity index 100% rename from starters/apps/playground/src/root.tsx rename to starters/apps/basic-starter/src/root.tsx diff --git a/starters/apps/basic-starter/src/routes/index.tsx b/starters/apps/basic-starter/src/routes/index.tsx new file mode 100644 index 00000000000..596f4c7cbe2 --- /dev/null +++ b/starters/apps/basic-starter/src/routes/index.tsx @@ -0,0 +1,94 @@ +import { component$ } from "@builder.io/qwik"; +import type { DocumentHead } from "@builder.io/qwik-city"; + +import Hero from "../components/starter/hero/hero"; +import Infobox from "../components/starter/infobox/infobox"; + +/* To start fresh you can either: + 1. Generate an "empty" starter app + 2. Delete everything from and below, delete all styles, the "components/starter" folder and fonts in "public". +*/ +export default component$(() => { + return ( + <> + + + + +
+ +
+ CLI Commands +
+ <> +

+ npm run dev +
+ Starts the development server and watches for changes +

+

+ npm run preview +
+ Creates production build and starts a server to preview it +

+

+ npm run build +
+ Creates production build +

+

+ npm run qwik add +
+ Runs the qwik CLI to add integrations +

+ +
+ +
+ +
+ Community +
+ +
+
+
+ + ); +}); + +export const head: DocumentHead = { + title: "Welcome to Qwik", + meta: [ + { + name: "description", + content: "Qwik site description", + }, + ], +}; diff --git a/starters/apps/basic-starter/src/routes/layout.tsx b/starters/apps/basic-starter/src/routes/layout.tsx new file mode 100644 index 00000000000..92c5d43e0eb --- /dev/null +++ b/starters/apps/basic-starter/src/routes/layout.tsx @@ -0,0 +1,31 @@ +import { component$, Slot, useStyles$ } from "@builder.io/qwik"; + +import Footer from "../components/starter/footer/footer"; +import Header from "../components/starter/header/header"; + +import type { RequestHandler } from "@builder.io/qwik-city"; +import styles from "./styles.css?inline"; + +export const onGet: RequestHandler = async ({ cacheControl }) => { + // Control caching for this request for best performance and to reduce hosting costs: + // https://qwik.dev/docs/caching/ + cacheControl({ + // Always serve a cached response by default, up to a week stale + staleWhileRevalidate: 60 * 60 * 24 * 7, + // Max once every 5 seconds, revalidate on the server to get a fresh version of this page + maxAge: 5, + }); +}; + +export default component$(() => { + useStyles$(styles); + return ( + <> +
+
+ +
+