From 220536fa8d938209d26fa654ad4add5971c3b506 Mon Sep 17 00:00:00 2001 From: Jack Shelton <104264123+thejackshelton@users.noreply.github.com> Date: Tue, 2 Jul 2024 22:33:00 -0500 Subject: [PATCH] refactor: simplify CLI starters (#6632) --- .../src/run-create-interactive-cli.ts | 5 +- scripts/validate-cli.ts | 3 +- starters/apps/empty/package.json | 2 +- starters/apps/library/package.json | 4 +- .../apps/{basic => playground}/package.json | 4 +- .../{basic => playground}/public/favicon.svg | 0 .../public/fonts/poppins-400.woff2 | Bin .../public/fonts/poppins-500.woff2 | Bin .../public/fonts/poppins-700.woff2 | Bin .../public/manifest.json | 0 .../{basic => playground}/public/robots.txt | 0 .../components/router-head/router-head.tsx | 0 .../starter/counter/counter.module.css | 0 .../components/starter/counter/counter.tsx | 0 .../starter/footer/footer.module.css | 0 .../src/components/starter/footer/footer.tsx | 0 .../components/starter/gauge/gauge.module.css | 0 .../src/components/starter/gauge/index.tsx | 0 .../starter/header/header.module.css | 0 .../src/components/starter/header/header.tsx | 0 .../components/starter/hero/hero.module.css | 0 .../src/components/starter/hero/hero.tsx | 0 .../src/components/starter/icons/qwik.tsx | 0 .../starter/infobox/infobox.module.css | 0 .../components/starter/infobox/infobox.tsx | 0 .../starter/next-steps/next-steps.module.css | 0 .../starter/next-steps/next-steps.tsx | 0 .../apps/{basic => playground}/src/global.css | 0 .../src/media/thunder.png | Bin .../apps/{basic => playground}/src/root.tsx | 0 .../src/routes/demo/flower/flower.css | 0 .../src/routes/demo/flower/index.tsx | 0 .../src/routes/demo/todolist/index.tsx | 0 .../routes/demo/todolist/todolist.module.css | 0 .../src/routes/index.tsx | 0 .../src/routes/layout.tsx | 0 .../src/routes/service-worker.ts | 0 .../src/routes/styles.css | 0 starters/apps/site-with-visual-cms/.env | 2 - starters/apps/site-with-visual-cms/README.md | 15 -- .../apps/site-with-visual-cms/package.json | 17 --- .../site-with-visual-cms/public/favicon.svg | 1 - .../site-with-visual-cms/public/manifest.json | 9 -- .../site-with-visual-cms/public/robots.txt | 0 .../src/components/builder-registry.ts | 25 ---- .../src/components/counter/counter.module.css | 23 ---- .../src/components/counter/counter.tsx | 81 ----------- .../src/components/footer/footer.module.css | 17 --- .../src/components/footer/footer.tsx | 14 -- .../src/components/gauge/gauge.module.css | 22 --- .../src/components/gauge/index.tsx | 36 ----- .../src/components/header/header.module.css | 50 ------- .../src/components/header/header.tsx | 43 ------ .../src/components/icons/qwik.tsx | 44 ------ .../components/router-head/router-head.tsx | 32 ----- .../site-with-visual-cms/src/entry.dev.tsx | 17 --- .../src/entry.preview.tsx | 20 --- .../site-with-visual-cms/src/entry.ssr.tsx | 33 ----- .../apps/site-with-visual-cms/src/global.css | 128 ------------------ .../apps/site-with-visual-cms/src/root.tsx | 32 ----- .../src/routes/[...index]/index.tsx | 61 --------- .../src/routes/layout.tsx | 15 -- .../src/routes/service-worker.ts | 18 --- .../apps/site-with-visual-cms/vite.config.ts | 11 -- 64 files changed, 10 insertions(+), 774 deletions(-) rename starters/apps/{basic => playground}/package.json (61%) rename starters/apps/{basic => playground}/public/favicon.svg (100%) rename starters/apps/{basic => playground}/public/fonts/poppins-400.woff2 (100%) rename starters/apps/{basic => playground}/public/fonts/poppins-500.woff2 (100%) rename starters/apps/{basic => playground}/public/fonts/poppins-700.woff2 (100%) rename starters/apps/{basic => playground}/public/manifest.json (100%) rename starters/apps/{basic => playground}/public/robots.txt (100%) rename starters/apps/{basic => playground}/src/components/router-head/router-head.tsx (100%) rename starters/apps/{basic => playground}/src/components/starter/counter/counter.module.css (100%) rename starters/apps/{basic => playground}/src/components/starter/counter/counter.tsx (100%) rename starters/apps/{basic => playground}/src/components/starter/footer/footer.module.css (100%) rename starters/apps/{basic => playground}/src/components/starter/footer/footer.tsx (100%) rename starters/apps/{basic => playground}/src/components/starter/gauge/gauge.module.css (100%) rename starters/apps/{basic => playground}/src/components/starter/gauge/index.tsx (100%) rename starters/apps/{basic => playground}/src/components/starter/header/header.module.css (100%) rename starters/apps/{basic => playground}/src/components/starter/header/header.tsx (100%) rename starters/apps/{basic => playground}/src/components/starter/hero/hero.module.css (100%) rename starters/apps/{basic => playground}/src/components/starter/hero/hero.tsx (100%) rename starters/apps/{basic => playground}/src/components/starter/icons/qwik.tsx (100%) rename starters/apps/{basic => playground}/src/components/starter/infobox/infobox.module.css (100%) rename starters/apps/{basic => playground}/src/components/starter/infobox/infobox.tsx (100%) rename starters/apps/{basic => playground}/src/components/starter/next-steps/next-steps.module.css (100%) rename starters/apps/{basic => playground}/src/components/starter/next-steps/next-steps.tsx (100%) rename starters/apps/{basic => playground}/src/global.css (100%) rename starters/apps/{basic => playground}/src/media/thunder.png (100%) rename starters/apps/{basic => playground}/src/root.tsx (100%) rename starters/apps/{basic => playground}/src/routes/demo/flower/flower.css (100%) rename starters/apps/{basic => playground}/src/routes/demo/flower/index.tsx (100%) rename starters/apps/{basic => playground}/src/routes/demo/todolist/index.tsx (100%) rename starters/apps/{basic => playground}/src/routes/demo/todolist/todolist.module.css (100%) rename starters/apps/{basic => playground}/src/routes/index.tsx (100%) rename starters/apps/{basic => playground}/src/routes/layout.tsx (100%) rename starters/apps/{basic => playground}/src/routes/service-worker.ts (100%) rename starters/apps/{basic => playground}/src/routes/styles.css (100%) delete mode 100644 starters/apps/site-with-visual-cms/.env delete mode 100644 starters/apps/site-with-visual-cms/README.md delete mode 100644 starters/apps/site-with-visual-cms/package.json delete mode 100644 starters/apps/site-with-visual-cms/public/favicon.svg delete mode 100644 starters/apps/site-with-visual-cms/public/manifest.json delete mode 100644 starters/apps/site-with-visual-cms/public/robots.txt delete mode 100644 starters/apps/site-with-visual-cms/src/components/builder-registry.ts delete mode 100644 starters/apps/site-with-visual-cms/src/components/counter/counter.module.css delete mode 100644 starters/apps/site-with-visual-cms/src/components/counter/counter.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/components/footer/footer.module.css delete mode 100644 starters/apps/site-with-visual-cms/src/components/footer/footer.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/components/gauge/gauge.module.css delete mode 100644 starters/apps/site-with-visual-cms/src/components/gauge/index.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/components/header/header.module.css delete mode 100644 starters/apps/site-with-visual-cms/src/components/header/header.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/components/icons/qwik.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/components/router-head/router-head.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/entry.dev.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/entry.preview.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/entry.ssr.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/global.css delete mode 100644 starters/apps/site-with-visual-cms/src/root.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/routes/[...index]/index.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/routes/layout.tsx delete mode 100644 starters/apps/site-with-visual-cms/src/routes/service-worker.ts delete mode 100644 starters/apps/site-with-visual-cms/vite.config.ts diff --git a/packages/create-qwik/src/run-create-interactive-cli.ts b/packages/create-qwik/src/run-create-interactive-cli.ts index d467a97afef..788bf5228be 100644 --- a/packages/create-qwik/src/run-create-interactive-cli.ts +++ b/packages/create-qwik/src/run-create-interactive-cli.ts @@ -43,7 +43,10 @@ export async function runCreateInteractiveCli(): Promise { throw new Error('Base app not found'); } - const starterApps = templateManager.templates.filter((a) => a.id !== baseApp.id); + // sorted alphabetically + const starterApps = templateManager.templates + .filter((a) => a.id !== baseApp.id) + .sort((a, b) => a.name.localeCompare(b.name)); const outDir: string = resolveRelativeDir(projectNameAnswer.trim()); baseApp.target = outDir; diff --git a/scripts/validate-cli.ts b/scripts/validate-cli.ts index 7d88e52b69d..0840a65b6b7 100644 --- a/scripts/validate-cli.ts +++ b/scripts/validate-cli.ts @@ -44,9 +44,8 @@ async function validateCreateQwikCli() { const tmpDir = join(__dirname, '..', 'dist-dev'); await Promise.all([ - validateStarter(api, tmpDir, 'basic', true, `👻`), + validateStarter(api, tmpDir, 'playground', true, `👻`), validateStarter(api, tmpDir, 'empty', true, `🫙`), - validateStarter(api, tmpDir, 'site-with-visual-cms', true, `😈`), validateStarter(api, tmpDir, 'library', false, `📚`), ]).catch((e) => { console.error(e); diff --git a/starters/apps/empty/package.json b/starters/apps/empty/package.json index 8ef63d4d9b7..96020d4a21f 100644 --- a/starters/apps/empty/package.json +++ b/starters/apps/empty/package.json @@ -1,6 +1,6 @@ { "name": "qwik-empty-starter", - "description": "App with Routing built-in ready to create your app", + "description": "Blank project with routing included", "type": "module", "__qwik__": { "priority": 1, diff --git a/starters/apps/library/package.json b/starters/apps/library/package.json index 1fec5dc0978..ed7ab48d57b 100644 --- a/starters/apps/library/package.json +++ b/starters/apps/library/package.json @@ -1,6 +1,6 @@ { "name": "qwik-library-name", - "description": "Create a reusable Qwik component library", + "description": "Create a Qwik library", "version": "0.0.1", "private": false, "main": "./lib/index.qwik.mjs", @@ -48,7 +48,7 @@ "vite-tsconfig-paths": "^4.2.1" }, "__qwik__": { - "displayName": "Component library (Qwik)", + "displayName": "Library (Qwik)", "priority": -1, "docs": [ "https://qwik.dev/docs/getting-started/" diff --git a/starters/apps/basic/package.json b/starters/apps/playground/package.json similarity index 61% rename from starters/apps/basic/package.json rename to starters/apps/playground/package.json index 4023e181cbe..cea100fc5ec 100644 --- a/starters/apps/basic/package.json +++ b/starters/apps/playground/package.json @@ -1,10 +1,10 @@ { "name": "qwik-basic-starter", - "description": "Demo App with Routing built-in (recommended)", + "description": "Demo app with sample routes", "type": "module", "__qwik__": { "priority": 2, - "displayName": "Basic App (Qwik City + Qwik)", + "displayName": "Playground App (Qwik City + Qwik)", "qwikCity": true, "docs": [ "https://qwik.dev/docs/getting-started/" diff --git a/starters/apps/basic/public/favicon.svg b/starters/apps/playground/public/favicon.svg similarity index 100% rename from starters/apps/basic/public/favicon.svg rename to starters/apps/playground/public/favicon.svg diff --git a/starters/apps/basic/public/fonts/poppins-400.woff2 b/starters/apps/playground/public/fonts/poppins-400.woff2 similarity index 100% rename from starters/apps/basic/public/fonts/poppins-400.woff2 rename to starters/apps/playground/public/fonts/poppins-400.woff2 diff --git a/starters/apps/basic/public/fonts/poppins-500.woff2 b/starters/apps/playground/public/fonts/poppins-500.woff2 similarity index 100% rename from starters/apps/basic/public/fonts/poppins-500.woff2 rename to starters/apps/playground/public/fonts/poppins-500.woff2 diff --git a/starters/apps/basic/public/fonts/poppins-700.woff2 b/starters/apps/playground/public/fonts/poppins-700.woff2 similarity index 100% rename from starters/apps/basic/public/fonts/poppins-700.woff2 rename to starters/apps/playground/public/fonts/poppins-700.woff2 diff --git a/starters/apps/basic/public/manifest.json b/starters/apps/playground/public/manifest.json similarity index 100% rename from starters/apps/basic/public/manifest.json rename to starters/apps/playground/public/manifest.json diff --git a/starters/apps/basic/public/robots.txt b/starters/apps/playground/public/robots.txt similarity index 100% rename from starters/apps/basic/public/robots.txt rename to starters/apps/playground/public/robots.txt diff --git a/starters/apps/basic/src/components/router-head/router-head.tsx b/starters/apps/playground/src/components/router-head/router-head.tsx similarity index 100% rename from starters/apps/basic/src/components/router-head/router-head.tsx rename to starters/apps/playground/src/components/router-head/router-head.tsx diff --git a/starters/apps/basic/src/components/starter/counter/counter.module.css b/starters/apps/playground/src/components/starter/counter/counter.module.css similarity index 100% rename from starters/apps/basic/src/components/starter/counter/counter.module.css rename to starters/apps/playground/src/components/starter/counter/counter.module.css diff --git a/starters/apps/basic/src/components/starter/counter/counter.tsx b/starters/apps/playground/src/components/starter/counter/counter.tsx similarity index 100% rename from starters/apps/basic/src/components/starter/counter/counter.tsx rename to starters/apps/playground/src/components/starter/counter/counter.tsx diff --git a/starters/apps/basic/src/components/starter/footer/footer.module.css b/starters/apps/playground/src/components/starter/footer/footer.module.css similarity index 100% rename from starters/apps/basic/src/components/starter/footer/footer.module.css rename to starters/apps/playground/src/components/starter/footer/footer.module.css diff --git a/starters/apps/basic/src/components/starter/footer/footer.tsx b/starters/apps/playground/src/components/starter/footer/footer.tsx similarity index 100% rename from starters/apps/basic/src/components/starter/footer/footer.tsx rename to starters/apps/playground/src/components/starter/footer/footer.tsx diff --git a/starters/apps/basic/src/components/starter/gauge/gauge.module.css b/starters/apps/playground/src/components/starter/gauge/gauge.module.css similarity index 100% rename from starters/apps/basic/src/components/starter/gauge/gauge.module.css rename to starters/apps/playground/src/components/starter/gauge/gauge.module.css diff --git a/starters/apps/basic/src/components/starter/gauge/index.tsx b/starters/apps/playground/src/components/starter/gauge/index.tsx similarity index 100% rename from starters/apps/basic/src/components/starter/gauge/index.tsx rename to starters/apps/playground/src/components/starter/gauge/index.tsx diff --git a/starters/apps/basic/src/components/starter/header/header.module.css b/starters/apps/playground/src/components/starter/header/header.module.css similarity index 100% rename from starters/apps/basic/src/components/starter/header/header.module.css rename to starters/apps/playground/src/components/starter/header/header.module.css diff --git a/starters/apps/basic/src/components/starter/header/header.tsx b/starters/apps/playground/src/components/starter/header/header.tsx similarity index 100% rename from starters/apps/basic/src/components/starter/header/header.tsx rename to starters/apps/playground/src/components/starter/header/header.tsx diff --git a/starters/apps/basic/src/components/starter/hero/hero.module.css b/starters/apps/playground/src/components/starter/hero/hero.module.css similarity index 100% rename from starters/apps/basic/src/components/starter/hero/hero.module.css rename to starters/apps/playground/src/components/starter/hero/hero.module.css diff --git a/starters/apps/basic/src/components/starter/hero/hero.tsx b/starters/apps/playground/src/components/starter/hero/hero.tsx similarity index 100% rename from starters/apps/basic/src/components/starter/hero/hero.tsx rename to starters/apps/playground/src/components/starter/hero/hero.tsx diff --git a/starters/apps/basic/src/components/starter/icons/qwik.tsx b/starters/apps/playground/src/components/starter/icons/qwik.tsx similarity index 100% rename from starters/apps/basic/src/components/starter/icons/qwik.tsx rename to starters/apps/playground/src/components/starter/icons/qwik.tsx diff --git a/starters/apps/basic/src/components/starter/infobox/infobox.module.css b/starters/apps/playground/src/components/starter/infobox/infobox.module.css similarity index 100% rename from starters/apps/basic/src/components/starter/infobox/infobox.module.css rename to starters/apps/playground/src/components/starter/infobox/infobox.module.css diff --git a/starters/apps/basic/src/components/starter/infobox/infobox.tsx b/starters/apps/playground/src/components/starter/infobox/infobox.tsx similarity index 100% rename from starters/apps/basic/src/components/starter/infobox/infobox.tsx rename to starters/apps/playground/src/components/starter/infobox/infobox.tsx diff --git a/starters/apps/basic/src/components/starter/next-steps/next-steps.module.css b/starters/apps/playground/src/components/starter/next-steps/next-steps.module.css similarity index 100% rename from starters/apps/basic/src/components/starter/next-steps/next-steps.module.css rename to starters/apps/playground/src/components/starter/next-steps/next-steps.module.css diff --git a/starters/apps/basic/src/components/starter/next-steps/next-steps.tsx b/starters/apps/playground/src/components/starter/next-steps/next-steps.tsx similarity index 100% rename from starters/apps/basic/src/components/starter/next-steps/next-steps.tsx rename to starters/apps/playground/src/components/starter/next-steps/next-steps.tsx diff --git a/starters/apps/basic/src/global.css b/starters/apps/playground/src/global.css similarity index 100% rename from starters/apps/basic/src/global.css rename to starters/apps/playground/src/global.css diff --git a/starters/apps/basic/src/media/thunder.png b/starters/apps/playground/src/media/thunder.png similarity index 100% rename from starters/apps/basic/src/media/thunder.png rename to starters/apps/playground/src/media/thunder.png diff --git a/starters/apps/basic/src/root.tsx b/starters/apps/playground/src/root.tsx similarity index 100% rename from starters/apps/basic/src/root.tsx rename to starters/apps/playground/src/root.tsx diff --git a/starters/apps/basic/src/routes/demo/flower/flower.css b/starters/apps/playground/src/routes/demo/flower/flower.css similarity index 100% rename from starters/apps/basic/src/routes/demo/flower/flower.css rename to starters/apps/playground/src/routes/demo/flower/flower.css diff --git a/starters/apps/basic/src/routes/demo/flower/index.tsx b/starters/apps/playground/src/routes/demo/flower/index.tsx similarity index 100% rename from starters/apps/basic/src/routes/demo/flower/index.tsx rename to starters/apps/playground/src/routes/demo/flower/index.tsx diff --git a/starters/apps/basic/src/routes/demo/todolist/index.tsx b/starters/apps/playground/src/routes/demo/todolist/index.tsx similarity index 100% rename from starters/apps/basic/src/routes/demo/todolist/index.tsx rename to starters/apps/playground/src/routes/demo/todolist/index.tsx diff --git a/starters/apps/basic/src/routes/demo/todolist/todolist.module.css b/starters/apps/playground/src/routes/demo/todolist/todolist.module.css similarity index 100% rename from starters/apps/basic/src/routes/demo/todolist/todolist.module.css rename to starters/apps/playground/src/routes/demo/todolist/todolist.module.css diff --git a/starters/apps/basic/src/routes/index.tsx b/starters/apps/playground/src/routes/index.tsx similarity index 100% rename from starters/apps/basic/src/routes/index.tsx rename to starters/apps/playground/src/routes/index.tsx diff --git a/starters/apps/basic/src/routes/layout.tsx b/starters/apps/playground/src/routes/layout.tsx similarity index 100% rename from starters/apps/basic/src/routes/layout.tsx rename to starters/apps/playground/src/routes/layout.tsx diff --git a/starters/apps/basic/src/routes/service-worker.ts b/starters/apps/playground/src/routes/service-worker.ts similarity index 100% rename from starters/apps/basic/src/routes/service-worker.ts rename to starters/apps/playground/src/routes/service-worker.ts diff --git a/starters/apps/basic/src/routes/styles.css b/starters/apps/playground/src/routes/styles.css similarity index 100% rename from starters/apps/basic/src/routes/styles.css rename to starters/apps/playground/src/routes/styles.css diff --git a/starters/apps/site-with-visual-cms/.env b/starters/apps/site-with-visual-cms/.env deleted file mode 100644 index 2b548ab08df..00000000000 --- a/starters/apps/site-with-visual-cms/.env +++ /dev/null @@ -1,2 +0,0 @@ -# https://www.builder.io/c/docs/using-your-api-key -PUBLIC_BUILDER_API_KEY=YOUR_API_KEY \ No newline at end of file diff --git a/starters/apps/site-with-visual-cms/README.md b/starters/apps/site-with-visual-cms/README.md deleted file mode 100644 index 54491ea64ed..00000000000 --- a/starters/apps/site-with-visual-cms/README.md +++ /dev/null @@ -1,15 +0,0 @@ -## Builder.io + Qwik - -An example of using [Builder.io's](https://www.builder.io/) visual editor with Qwik. - -See the catchall route at [src/routes/[...index]/index.tsx](src/routes/[...index]/index.tsx) for the integration code. - -Registered components can be found in [src/components/builder-registry.ts](src/components/builder-registry.ts) - -### Docs - -See our full integration guides [here](https://www.builder.io/c/docs/developers) - -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! - -Also, to integrate structured data, see [this guide](https://www.builder.io/c/docs/integrate-cms-data) diff --git a/starters/apps/site-with-visual-cms/package.json b/starters/apps/site-with-visual-cms/package.json deleted file mode 100644 index 84cdbb61301..00000000000 --- a/starters/apps/site-with-visual-cms/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "qwik-site-with-visual-cms", - "description": "Site integrated with Builder.io for visual editing", - "devDependencies": { - "@builder.io/dev-tools": "^0.0.7", - "@builder.io/sdk-qwik": "^0.4.1" - }, - "type": "module", - "__qwik__": { - "priority": 2, - "docs": [ - "https://www.builder.io/c/docs/quickstart" - ], - "displayName": "Site with Visual CMS (Qwik City + Qwik)", - "qwikCity": true - } -} diff --git a/starters/apps/site-with-visual-cms/public/favicon.svg b/starters/apps/site-with-visual-cms/public/favicon.svg deleted file mode 100644 index 0ded7c138b6..00000000000 --- a/starters/apps/site-with-visual-cms/public/favicon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/starters/apps/site-with-visual-cms/public/manifest.json b/starters/apps/site-with-visual-cms/public/manifest.json deleted file mode 100644 index c18e75f72a5..00000000000 --- a/starters/apps/site-with-visual-cms/public/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/web-manifest-combined.json", - "name": "qwik-project-name", - "short_name": "Welcome to Qwik", - "start_url": ".", - "display": "standalone", - "background_color": "#fff", - "description": "A Qwik project app." -} diff --git a/starters/apps/site-with-visual-cms/public/robots.txt b/starters/apps/site-with-visual-cms/public/robots.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/starters/apps/site-with-visual-cms/src/components/builder-registry.ts b/starters/apps/site-with-visual-cms/src/components/builder-registry.ts deleted file mode 100644 index d9f7abb5f36..00000000000 --- a/starters/apps/site-with-visual-cms/src/components/builder-registry.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { RegisteredComponent } from "@builder.io/sdk-qwik"; -import Counter from "./counter/counter"; - -/** - * This array is used to integrate custom components within Builder. - * https://www.builder.io/c/docs/custom-components-intro - * - * These components will be found the "Custom Components" - * section of Builder's visual editor. - * You can also turn on "components only mode" to limit - * editing to only these components. - * https://www.builder.io/c/docs/guides/components-only-mode - */ -export const CUSTOM_COMPONENTS: RegisteredComponent[] = [ - { - component: Counter, - name: "Counter", - inputs: [ - { - name: "initialValue", - type: "number", - }, - ], - }, -]; diff --git a/starters/apps/site-with-visual-cms/src/components/counter/counter.module.css b/starters/apps/site-with-visual-cms/src/components/counter/counter.module.css deleted file mode 100644 index 99168f7ab2a..00000000000 --- a/starters/apps/site-with-visual-cms/src/components/counter/counter.module.css +++ /dev/null @@ -1,23 +0,0 @@ -.wrapper { - display: flex; - align-items: center; - justify-content: center; - gap: 20px; -} - -.button { - background: var(--qwik-dirty-black); - border: none; - border-radius: 8px; - color: white; - cursor: pointer; - padding: 10px; - text-align: center; - font-weight: 700; - font-size: 2em; - min-width: 50px; -} - -.button:hover { - background: var(--qwik-dark-blue); -} diff --git a/starters/apps/site-with-visual-cms/src/components/counter/counter.tsx b/starters/apps/site-with-visual-cms/src/components/counter/counter.tsx deleted file mode 100644 index 35a326df519..00000000000 --- a/starters/apps/site-with-visual-cms/src/components/counter/counter.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { component$, useSignal, $ } from "@builder.io/qwik"; -import styles from "./counter.module.css"; -import Gauge from "../gauge"; - -export default component$((props: { initialValue: number }) => { - const count = useSignal(props.initialValue || 99); - - const setCount = $((newValue: number) => { - if (newValue >= 0 && newValue <= 100) { - count.value = newValue; - - if (newValue === 100) { - celebrate(); - } - } - }); - - return ( -
- - - -
- ); -}); - -export const celebrate = $(async () => { - const defaults = { - spread: 360, - ticks: 70, - gravity: 0, - decay: 0.95, - startVelocity: 30, - colors: ["006ce9", "ac7ff4", "18b6f6", "713fc2", "ffffff"], - origin: { - x: 0.5, - y: 0.35, - }, - }; - - function loadConfetti() { - return new Promise<(opts: any) => void>((resolve, reject) => { - if ((globalThis as any).confetti) { - return resolve((globalThis as any).confetti as any); - } - const script = document.createElement("script"); - script.src = - "https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js"; - script.onload = () => resolve((globalThis as any).confetti as any); - script.onerror = reject; - document.head.appendChild(script); - script.remove(); - }); - } - - const confetti = await loadConfetti(); - - function shoot() { - confetti({ - ...defaults, - particleCount: 80, - scalar: 1.2, - }); - - confetti({ - ...defaults, - particleCount: 60, - scalar: 0.75, - }); - } - - setTimeout(shoot, 0); - setTimeout(shoot, 100); - setTimeout(shoot, 200); - setTimeout(shoot, 300); - setTimeout(shoot, 400); -}); diff --git a/starters/apps/site-with-visual-cms/src/components/footer/footer.module.css b/starters/apps/site-with-visual-cms/src/components/footer/footer.module.css deleted file mode 100644 index 1e788a762e5..00000000000 --- a/starters/apps/site-with-visual-cms/src/components/footer/footer.module.css +++ /dev/null @@ -1,17 +0,0 @@ -.wrapper { - margin: 0 auto; - padding: 30px 40px; -} - -.anchor { - color: white; - display: block; - font-size: 0.8rem; - text-align: center; - text-decoration: none; - line-height: 1.5; -} - -.anchor:hover { - color: var(--qwik-light-blue); -} diff --git a/starters/apps/site-with-visual-cms/src/components/footer/footer.tsx b/starters/apps/site-with-visual-cms/src/components/footer/footer.tsx deleted file mode 100644 index d760fdef2e8..00000000000 --- a/starters/apps/site-with-visual-cms/src/components/footer/footer.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { component$ } from "@builder.io/qwik"; -import styles from "./footer.module.css"; - -export default component$(() => { - return ( - - ); -}); diff --git a/starters/apps/site-with-visual-cms/src/components/gauge/gauge.module.css b/starters/apps/site-with-visual-cms/src/components/gauge/gauge.module.css deleted file mode 100644 index 5368dc8ab30..00000000000 --- a/starters/apps/site-with-visual-cms/src/components/gauge/gauge.module.css +++ /dev/null @@ -1,22 +0,0 @@ -.wrapper { - position: relative; -} - -.gauge { - width: 100%; - min-width: 100px; -} - -.value { - position: absolute; - top: 50%; - left: 50%; - color: white; - font-size: 3rem; - transform: translate(-50%, -50%); - text-align: center; -} - -circle { - transition: all 500ms ease-in-out; -} diff --git a/starters/apps/site-with-visual-cms/src/components/gauge/index.tsx b/starters/apps/site-with-visual-cms/src/components/gauge/index.tsx deleted file mode 100644 index b010a66426e..00000000000 --- a/starters/apps/site-with-visual-cms/src/components/gauge/index.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { component$ } from "@builder.io/qwik"; -import styles from "./gauge.module.css"; - -export default component$(({ value = 50 }: { value?: number }) => { - const safeValue = value < 0 || value > 100 ? 50 : value; - - return ( -
- - - - - - - - - - - {safeValue} -
- ); -}); diff --git a/starters/apps/site-with-visual-cms/src/components/header/header.module.css b/starters/apps/site-with-visual-cms/src/components/header/header.module.css deleted file mode 100644 index 280fca9a59d..00000000000 --- a/starters/apps/site-with-visual-cms/src/components/header/header.module.css +++ /dev/null @@ -1,50 +0,0 @@ -.wrapper { - display: flex; - align-items: center; - justify-content: space-between; - margin: 0 auto; - padding: 30px 40px; -} - -.logo { - display: inline-block; -} -.logo a { - display: block; -} - -.header { - background-color: var(--header-background); -} - -.header ul { - margin: 0; - padding: 0; - list-style: none; - display: flex; - gap: 30px; -} - -.header li { - display: none; - margin: 0; - padding: 0; - font-size: 0.8rem; -} - -.header li a { - color: white; - display: inline-block; - padding: 0; - text-decoration: none; -} - -.header li a:hover { - color: var(--qwik-light-blue); -} - -@media (min-width: 450px) { - .header li { - display: inline-block; - } -} diff --git a/starters/apps/site-with-visual-cms/src/components/header/header.tsx b/starters/apps/site-with-visual-cms/src/components/header/header.tsx deleted file mode 100644 index df7ab23510e..00000000000 --- a/starters/apps/site-with-visual-cms/src/components/header/header.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { component$ } from "@builder.io/qwik"; -import { QwikLogo } from "../icons/qwik"; -import styles from "./header.module.css"; - -export default component$(() => { - return ( -
- -
- ); -}); diff --git a/starters/apps/site-with-visual-cms/src/components/icons/qwik.tsx b/starters/apps/site-with-visual-cms/src/components/icons/qwik.tsx deleted file mode 100644 index 4f94b0883bb..00000000000 --- a/starters/apps/site-with-visual-cms/src/components/icons/qwik.tsx +++ /dev/null @@ -1,44 +0,0 @@ -export const QwikLogo = ({ - width = 100, - height = 35, -}: { - width?: number; - height?: number; -}) => ( - - - - - - - - - -); diff --git a/starters/apps/site-with-visual-cms/src/components/router-head/router-head.tsx b/starters/apps/site-with-visual-cms/src/components/router-head/router-head.tsx deleted file mode 100644 index 127f8cae9f9..00000000000 --- a/starters/apps/site-with-visual-cms/src/components/router-head/router-head.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { component$ } from "@builder.io/qwik"; -import { useDocumentHead, useLocation } from "@builder.io/qwik-city"; - -/** - * The RouterHead component is placed inside of the document `` element. - */ -export const RouterHead = component$(() => { - const head = useDocumentHead(); - const loc = useLocation(); - - return ( - <> - {head.title} - - - - - - {head.meta.map((m) => ( - - ))} - - {head.links.map((l) => ( - - ))} - - {head.styles.map((s) => ( -