create-qwik 0.0.109-0 → 0.0.109

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 (95) hide show
  1. package/index.cjs +63 -67
  2. package/package.json +1 -1
  3. package/starters/apps/base/README.md +46 -11
  4. package/starters/apps/base/package.json +8 -8
  5. package/starters/apps/base/public/favicon.svg +1 -0
  6. package/starters/apps/{qwik-city → base}/src/routes/service-worker.ts +0 -1
  7. package/starters/apps/base/vite.config.ts +3 -1
  8. package/starters/apps/blank/package.json +3 -1
  9. package/starters/apps/blank/src/components/header/header.css +37 -0
  10. package/starters/apps/blank/src/components/header/header.tsx +34 -0
  11. package/starters/apps/blank/src/components/icons/qwik.tsx +32 -0
  12. package/starters/apps/blank/src/components/router-head/router-head.tsx +43 -0
  13. package/starters/apps/blank/src/global.css +70 -3
  14. package/starters/apps/blank/src/root.tsx +17 -9
  15. package/starters/apps/blank/src/routes/index.tsx +81 -0
  16. package/starters/apps/{qwik-city → blank}/src/routes/layout.tsx +4 -6
  17. package/starters/apps/documentation-site/package.json +9 -0
  18. package/starters/apps/{qwik-city → documentation-site}/src/components/breadcrumbs/breadcrumbs.css +0 -0
  19. package/starters/apps/{qwik-city → documentation-site}/src/components/breadcrumbs/breadcrumbs.tsx +0 -0
  20. package/starters/apps/{qwik-city → documentation-site}/src/components/footer/footer.css +1 -1
  21. package/starters/apps/{qwik-city → documentation-site}/src/components/footer/footer.tsx +13 -6
  22. package/starters/apps/documentation-site/src/components/header/header.css +34 -0
  23. package/starters/apps/documentation-site/src/components/header/header.tsx +26 -0
  24. package/starters/apps/documentation-site/src/components/icons/qwik.tsx +20 -0
  25. package/starters/apps/{qwik-city → documentation-site}/src/components/menu/menu.css +0 -0
  26. package/starters/apps/{qwik-city → documentation-site}/src/components/menu/menu.tsx +1 -1
  27. package/starters/apps/documentation-site/src/components/on-this-page/on-this-page.css +33 -0
  28. package/starters/apps/documentation-site/src/components/on-this-page/on-this-page.tsx +62 -0
  29. package/starters/apps/documentation-site/src/components/router-head/router-head.tsx +43 -0
  30. package/starters/apps/documentation-site/src/global.css +66 -0
  31. package/starters/apps/documentation-site/src/root.tsx +26 -0
  32. package/starters/apps/documentation-site/src/routes/about-us/index.md +15 -0
  33. package/starters/apps/documentation-site/src/routes/docs/advanced/index.md +11 -0
  34. package/starters/apps/documentation-site/src/routes/docs/docs.css +22 -0
  35. package/starters/apps/documentation-site/src/routes/docs/getting-started/index.md +13 -0
  36. package/starters/apps/documentation-site/src/routes/docs/index.md +22 -0
  37. package/starters/apps/documentation-site/src/routes/docs/layout.tsx +25 -0
  38. package/starters/apps/documentation-site/src/routes/docs/menu.md +21 -0
  39. package/starters/apps/documentation-site/src/routes/index.tsx +89 -0
  40. package/starters/apps/documentation-site/src/routes/layout.tsx +15 -0
  41. package/starters/apps/library/package.json +1 -0
  42. package/starters/apps/base/public/favicon.ico +0 -0
  43. package/starters/apps/base/public/favicons/android-chrome-192x192.png +0 -0
  44. package/starters/apps/base/public/favicons/apple-touch-icon.png +0 -0
  45. package/starters/apps/base/public/favicons/favicon-16x16.png +0 -0
  46. package/starters/apps/base/public/favicons/favicon-32x32.png +0 -0
  47. package/starters/apps/base/public/favicons/favicon.svg +0 -13
  48. package/starters/apps/base/src/root.tsx +0 -14
  49. package/starters/apps/blank/dist/q-manifest.json +0 -105
  50. package/starters/apps/blank/src/components/app/app.tsx +0 -54
  51. package/starters/apps/blank/src/components/logo/logo.tsx +0 -16
  52. package/starters/apps/blank/src/entry.preview.tsx +0 -18
  53. package/starters/apps/blank/src/entry.ssr.tsx +0 -15
  54. package/starters/apps/qwik-city/dist/favicons/android-chrome-192x192.png +0 -0
  55. package/starters/apps/qwik-city/dist/favicons/android-chrome-256x256.png +0 -0
  56. package/starters/apps/qwik-city/dist/favicons/apple-touch-icon.png +0 -0
  57. package/starters/apps/qwik-city/dist/favicons/favicon.svg +0 -1
  58. package/starters/apps/qwik-city/dist/logos/qwik-logo.svg +0 -1
  59. package/starters/apps/qwik-city/dist/logos/qwik.svg +0 -1
  60. package/starters/apps/qwik-city/dist/q-manifest.json +0 -904
  61. package/starters/apps/qwik-city/dist/service-worker.js +0 -167
  62. package/starters/apps/qwik-city/package.json +0 -8
  63. package/starters/apps/qwik-city/src/components/counter/counter.tsx +0 -19
  64. package/starters/apps/qwik-city/src/components/head/analytics.tsx +0 -13
  65. package/starters/apps/qwik-city/src/components/head/head.tsx +0 -34
  66. package/starters/apps/qwik-city/src/components/head/social.tsx +0 -10
  67. package/starters/apps/qwik-city/src/components/header/header.css +0 -46
  68. package/starters/apps/qwik-city/src/components/header/header.tsx +0 -36
  69. package/starters/apps/qwik-city/src/entry.ssr.tsx +0 -17
  70. package/starters/apps/qwik-city/src/global.css +0 -24
  71. package/starters/apps/qwik-city/src/root.tsx +0 -16
  72. package/starters/apps/qwik-city/src/routes/about-us/index.tsx +0 -17
  73. package/starters/apps/qwik-city/src/routes/api/[org]/[user].json/index.ts +0 -15
  74. package/starters/apps/qwik-city/src/routes/api/api.css +0 -14
  75. package/starters/apps/qwik-city/src/routes/api/data.json/index.ts +0 -9
  76. package/starters/apps/qwik-city/src/routes/api/index@api.tsx +0 -34
  77. package/starters/apps/qwik-city/src/routes/api/layout-api.tsx +0 -37
  78. package/starters/apps/qwik-city/src/routes/blog/[...slug]/index.tsx +0 -36
  79. package/starters/apps/qwik-city/src/routes/blog/index.md +0 -7
  80. package/starters/apps/qwik-city/src/routes/blog/layout.tsx +0 -21
  81. package/starters/apps/qwik-city/src/routes/dashboard/dashboard.css +0 -14
  82. package/starters/apps/qwik-city/src/routes/dashboard/index.tsx +0 -15
  83. package/starters/apps/qwik-city/src/routes/dashboard/layout!.tsx +0 -44
  84. package/starters/apps/qwik-city/src/routes/dashboard/profile/index.tsx +0 -15
  85. package/starters/apps/qwik-city/src/routes/dashboard/settings/index.tsx +0 -15
  86. package/starters/apps/qwik-city/src/routes/docs/[category]/[id]/index.tsx +0 -23
  87. package/starters/apps/qwik-city/src/routes/docs/docs.css +0 -10
  88. package/starters/apps/qwik-city/src/routes/docs/getting-started/index.md +0 -44
  89. package/starters/apps/qwik-city/src/routes/docs/index.tsx +0 -14
  90. package/starters/apps/qwik-city/src/routes/docs/layout!.tsx +0 -31
  91. package/starters/apps/qwik-city/src/routes/docs/menu.md +0 -11
  92. package/starters/apps/qwik-city/src/routes/docs/overview/index.md +0 -7
  93. package/starters/apps/qwik-city/src/routes/index.tsx +0 -16
  94. package/starters/apps/qwik-city/src/routes/products/[id]/index.tsx +0 -123
  95. package/starters/apps/qwik-city/vite.config.ts +0 -10
@@ -1,44 +0,0 @@
1
- import { component$, Slot, useStyles$ } from '@builder.io/qwik';
2
- import type { DocumentHead } from '@builder.io/qwik-city';
3
- import Footer from '../../components/footer/footer';
4
- import Header from '../../components/header/header';
5
- import styles from './dashboard.css?inline';
6
-
7
- /**
8
- * `layout!` means this is the top level layout. Because of the
9
- * `!` at the end of the filename, it stops at this layout and does
10
- * not keep crawling up the directories making more nested layouts.
11
- */
12
-
13
- export default component$(() => {
14
- useStyles$(styles);
15
-
16
- return (
17
- <div>
18
- <Header />
19
- <main class="dashboard">
20
- <aside class="dashboard-menu">
21
- <h5>Dashboard Menu</h5>
22
- <ul>
23
- <li>
24
- <a href="/dashboard/profile">Profile</a>
25
- </li>
26
- <li>
27
- <a href="/dashboard/settings">Settings</a>
28
- </li>
29
- </ul>
30
- </aside>
31
- <section class="dashboard-content">
32
- <Slot />
33
- </section>
34
- </main>
35
- <Footer />
36
- </div>
37
- );
38
- });
39
-
40
- export const head: DocumentHead = ({ head }) => {
41
- return {
42
- title: `Dashboard ${head.title}`,
43
- };
44
- };
@@ -1,15 +0,0 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import type { DocumentHead } from '@builder.io/qwik-city';
3
-
4
- export default component$(() => {
5
- return (
6
- <div>
7
- <h1>Profile</h1>
8
- <p>My Profile</p>
9
- </div>
10
- );
11
- });
12
-
13
- export const head: DocumentHead = {
14
- title: 'Profile',
15
- };
@@ -1,15 +0,0 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import type { DocumentHead } from '@builder.io/qwik-city';
3
-
4
- export default component$(() => {
5
- return (
6
- <div>
7
- <h1>Settings</h1>
8
- <p>My Settings</p>
9
- </div>
10
- );
11
- });
12
-
13
- export const head: DocumentHead = {
14
- title: 'Settings',
15
- };
@@ -1,23 +0,0 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import { useLocation, DocumentHead } from '@builder.io/qwik-city';
3
-
4
- export default component$(() => {
5
- const { pathname, params } = useLocation();
6
-
7
- return (
8
- <div>
9
- <h1>
10
- Docs: {params.category} {params.id}
11
- </h1>
12
- <p>pathname: {pathname}</p>
13
- <p>category: {params.category}</p>
14
- <p>id: {params.id}</p>
15
- </div>
16
- );
17
- });
18
-
19
- export const head: DocumentHead = ({ params }) => {
20
- return {
21
- title: `${params.category} ${params.id}`,
22
- };
23
- };
@@ -1,10 +0,0 @@
1
- .docs main {
2
- display: grid;
3
- grid-template-columns: 200px 1fr;
4
- padding: 0;
5
- margin: 0;
6
- }
7
-
8
- .docs-content {
9
- padding-left: 20px;
10
- }
@@ -1,44 +0,0 @@
1
- ---
2
- title: Getting Started
3
- ---
4
-
5
- # Getting Started
6
-
7
- ## Creating an app using the CLI
8
-
9
- The first step is to create an application. Qwik comes with a CLI that allows you to create a basic working skeleton of an application. We will use the CLI to create a Todo sample app, and we will use that application to do a walk-through of Qwik so that you can familiarize yourself with it.
10
-
11
- ## Running in development
12
-
13
- Once the application is download.
14
-
15
- 1. Change into the directory created by the `npm create qwik@latest`.
16
-
17
- ```shell
18
- cd qwik-todo
19
- ```
20
-
21
- 2. Install NPM modules:
22
-
23
- ```shell
24
- npm install
25
- ```
26
-
27
- 3. Invoke the dev server
28
-
29
- ```shell
30
- npm start
31
- ```
32
-
33
- 4. You should see a server running with your To-do application
34
-
35
- ```shell
36
- vite v2.8.6 dev server running at:
37
-
38
- > Local: http://localhost:3000/
39
- > Network: use `--host` to expose
40
-
41
- ready in 157ms.
42
- ```
43
-
44
- 5. Visit http://localhost:3000/ to explore the To-do app.
@@ -1,14 +0,0 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import type { DocumentHead } from '@builder.io/qwik-city';
3
-
4
- export default component$(() => {
5
- return (
6
- <div>
7
- <h1>Welcome to the Docs!</h1>
8
- </div>
9
- );
10
- });
11
-
12
- export const head: DocumentHead = {
13
- title: 'Welcome!',
14
- };
@@ -1,31 +0,0 @@
1
- import { component$, Slot, useStyles$ } from '@builder.io/qwik';
2
- import type { DocumentHead } from '@builder.io/qwik-city';
3
- import { Breadcrumbs } from '../../components/breadcrumbs/breadcrumbs';
4
- import Footer from '../../components/footer/footer';
5
- import Header from '../../components/header/header';
6
- import { Menu } from '../../components/menu/menu';
7
- import styles from './docs.css?inline';
8
-
9
- export default component$(() => {
10
- useStyles$(styles);
11
-
12
- return (
13
- <div class="docs full-screen">
14
- <Header />
15
- <main>
16
- <Menu />
17
- <section class="docs-content">
18
- <Breadcrumbs />
19
- <Slot />
20
- <Footer />
21
- </section>
22
- </main>
23
- </div>
24
- );
25
- });
26
-
27
- export const head: DocumentHead = ({ head }) => {
28
- return {
29
- title: `Docs: ${head.title}`,
30
- };
31
- };
@@ -1,11 +0,0 @@
1
- # Docs
2
-
3
- ## Introduction
4
-
5
- - [Overview](overview/index.md)
6
- - [Getting Started](getting-started/index.md)
7
-
8
- ## Components
9
-
10
- - [Basics](/docs/components/basics)
11
- - [Listeners](/docs/components/listeners)
@@ -1,7 +0,0 @@
1
- ---
2
- title: Overview
3
- ---
4
-
5
- # Overview
6
-
7
- Qwik is a new kind of web framework that can deliver instant loading web applications at any size or complexity. Your sites and apps can boot with less than 1kb of JS (_including_ your code, regardless of complexity), and achieve unheard of performance at scale.
@@ -1,16 +0,0 @@
1
- import { component$ } from '@builder.io/qwik';
2
- import type { DocumentHead } from '@builder.io/qwik-city';
3
-
4
- export default component$(() => {
5
- return (
6
- <div>
7
- <h1>Welcome to Qwik City</h1>
8
-
9
- <p>The meta-framework for Qwik.</p>
10
- </div>
11
- );
12
- });
13
-
14
- export const head: DocumentHead = {
15
- title: 'Welcome to Qwik City',
16
- };
@@ -1,123 +0,0 @@
1
- import { Resource, component$ } from '@builder.io/qwik';
2
- import { useEndpoint, useLocation, RequestHandler, DocumentHead } from '@builder.io/qwik-city';
3
-
4
- export default component$(() => {
5
- const { params } = useLocation();
6
-
7
- const resource = useEndpoint<typeof onGet>();
8
-
9
- return (
10
- <>
11
- <Resource
12
- value={resource}
13
- onPending={() => <p>Loading</p>}
14
- onResolved={(product) => {
15
- if (product == null) {
16
- return <h1>Product "{params.id}" not found</h1>;
17
- }
18
-
19
- return (
20
- <>
21
- <h1>Product: {product.productId}</h1>
22
- <p>Price: {product.price}</p>
23
- <p>{product.description}</p>
24
- </>
25
- );
26
- }}
27
- />
28
-
29
- <p>(Artificial response delay of 250ms)</p>
30
-
31
- <hr />
32
-
33
- <ul>
34
- <li>
35
- <a href="/products/jacket">Jacket</a>
36
- </li>
37
- <li>
38
- <a href="/products/hat">Hat</a>
39
- </li>
40
- <li>
41
- <a href="/products/shirt">T-Shirt (Redirect to /products/tshirt)</a>
42
- </li>
43
- <li>
44
- <a href="/products/hoodie">Hoodie (404 Not Found)</a>
45
- </li>
46
- </ul>
47
- </>
48
- );
49
- });
50
-
51
- export const head: DocumentHead<EndpointData> = ({ data }) => {
52
- if (!data) {
53
- return {
54
- title: `Product not found`,
55
- };
56
- }
57
- return {
58
- title: `Product ${data.productId}, ${data.price}`,
59
- };
60
- };
61
-
62
- export const onGet: RequestHandler<EndpointData> = async ({ params, response }) => {
63
- // Serverside Endpoint
64
- // During SSR, this method is called directly on the server and returns the data object
65
- // On the client, this same data can be requested with fetch() at the same URL, but also
66
- // requires the "accept: application/json" request header.
67
-
68
- if (params.id === 'shirt') {
69
- // Redirect, which will skip any rendering and the server will immediately redirect
70
- throw response.redirect('/products/tshirt');
71
- }
72
-
73
- // artificially slow database call
74
- const productData = await loadProduct(params.id);
75
- if (!productData) {
76
- // Product data not found, but the data is still
77
- // given to the renderer to decide how to render
78
- response.status = 404;
79
- return productData;
80
- }
81
-
82
- // Found the product data
83
- // This same data is passed to the head() function
84
- // and in the component$() it can be access with useEndpoint()
85
- response.headers.set('Cache-Control', 'no-cache, no-store, no-fun');
86
- return productData;
87
- };
88
-
89
- // our pretty awesome function to load product data
90
- const loadProduct = (productId: string) => {
91
- return new Promise<ProductData | null>((resolve) =>
92
- setTimeout(() => {
93
- const productPrice = PRODUCT_DB[productId];
94
- if (productPrice) {
95
- // awesome product database found product data
96
- const productData: ProductData = {
97
- productId,
98
- price: productPrice,
99
- description: `Product description here.`,
100
- };
101
- resolve(productData);
102
- } else {
103
- // awesome product database did not find product data
104
- resolve(null);
105
- }
106
- }, 250)
107
- );
108
- };
109
-
110
- // Our pretty awesome database of prices
111
- const PRODUCT_DB: Record<string, string> = {
112
- hat: '$21.96',
113
- jacket: '$48.96',
114
- tshirt: '$18.96',
115
- };
116
-
117
- type EndpointData = ProductData | null;
118
-
119
- interface ProductData {
120
- productId: string;
121
- price: string;
122
- description: string;
123
- }
@@ -1,10 +0,0 @@
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
-
6
- export default defineConfig(() => {
7
- return {
8
- plugins: [qwikCity(), qwikVite(), tsconfigPaths()],
9
- };
10
- });