-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,655 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:qwik/recommended", | ||
"../../.eslintrc.json" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": ["apps/qwik-app2/tsconfig.*?.json"], | ||
"ecmaVersion": 2021, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"jsx": true | ||
} | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Files Prettier should not format | ||
**/*.log | ||
**/.DS_Store | ||
*. | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Qwik City App ⚡️ | ||
|
||
- [Qwik Docs](https://qwik.builder.io/) | ||
- [Discord](https://qwik.builder.io/chat) | ||
- [Qwik GitHub](https://github.com/BuilderIO/qwik) | ||
- [@QwikDev](https://twitter.com/QwikDev) | ||
- [Vite](https://vitejs.dev/) | ||
|
||
--- | ||
|
||
## Project Structure | ||
|
||
This project is using Qwik with [QwikCity](https://qwik.builder.io/qwikcity/overview/). QwikCity is just a extra set of tools on top of Qwik to make it easier to build a full site, including directory-based routing, layouts, and more. | ||
|
||
Inside your project, you'll see the following directory structure: | ||
|
||
``` | ||
├── public/ | ||
│ └── ... | ||
└── src/ | ||
├── components/ | ||
│ └── ... | ||
└── routes/ | ||
└── ... | ||
``` | ||
|
||
- `src/routes`: Provides the directory based routing, which can include a hierarchy of `layout.tsx` layout files, and an `index.tsx` file as the page. Additionally, `index.ts` files are endpoints. Please see the [routing docs](https://qwik.builder.io/qwikcity/routing/overview/) for more info. | ||
|
||
- `src/components`: Recommended directory for components. | ||
|
||
- `public`: Any static assets, like images, can be placed in the public directory. Please see the [Vite public directory](https://vitejs.dev/guide/assets.html#the-public-directory) for more info. | ||
|
||
## Add Integrations and deployment | ||
|
||
Use the `pnpm qwik add` command to add additional integrations. Some examples of integrations include: Cloudflare, Netlify or Express server, and the [Static Site Generator (SSG)](https://qwik.builder.io/qwikcity/static-site-generation/static-site-config/). | ||
|
||
```shell | ||
pnpm qwik add # or `yarn qwik add` | ||
``` | ||
|
||
## Development | ||
|
||
Development mode uses [Vite's development server](https://vitejs.dev/). During development, the `dev` command will server-side render (SSR) the output. | ||
|
||
```shell | ||
npm start # or `yarn start` | ||
``` | ||
|
||
> Note: during dev mode, Vite may request a significant number of `.js` files. This does not represent a Qwik production build. | ||
## Preview | ||
|
||
The preview command will create a production build of the client modules, a production build of `src/entry.preview.tsx`, and run a local server. The preview server is only for convenience to locally preview a production build, and it should not be used as a production server. | ||
|
||
```shell | ||
pnpm preview # or `yarn preview` | ||
``` | ||
|
||
## Production | ||
|
||
The production build will generate client and server modules by running both client and server build commands. Additionally, the build command will use Typescript to run a type check on the source code. | ||
|
||
```shell | ||
pnpm build # or `yarn build` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "qwik-app2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"name": "qwik-app2", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"projectType": "application", | ||
"sourceRoot": "apps/qwik-app2/src", | ||
"targets": { | ||
"build": { | ||
"executor": "qwik-nx:build", | ||
"options": { | ||
"runSequence": ["qwik-app2:build.client", "qwik-app2:build.ssr"], | ||
"outputPath": "dist/apps/qwik-app2" | ||
}, | ||
"configurations": { | ||
"preview": {} | ||
} | ||
}, | ||
"build.client": { | ||
"executor": "@nx/vite:build", | ||
"options": { | ||
"outputPath": "dist/apps/qwik-app2", | ||
"configFile": "apps/qwik-app2/vite.config.ts" | ||
} | ||
}, | ||
"build.ssr": { | ||
"executor": "@nx/vite:build", | ||
"defaultConfiguration": "preview", | ||
"options": { | ||
"outputPath": "dist/apps/qwik-app2" | ||
}, | ||
"configurations": { | ||
"preview": { | ||
"ssr": "src/entry.preview.tsx", | ||
"mode": "production" | ||
} | ||
} | ||
}, | ||
"preview": { | ||
"executor": "@nx/vite:preview-server", | ||
"options": { | ||
"buildTarget": "qwik-app2:build", | ||
"port": 4173 | ||
} | ||
}, | ||
"test": { | ||
"executor": "@nx/vite:test", | ||
"outputs": ["{options.reportsDirectory}"], | ||
"options": { | ||
"passWithNoTests": true, | ||
"reportsDirectory": "../../coverage/apps/qwik-app2" | ||
} | ||
}, | ||
"serve": { | ||
"executor": "@nx/vite:dev-server", | ||
"options": { | ||
"buildTarget": "qwik-app2:build.client", | ||
"mode": "ssr", | ||
"port": 5173 | ||
} | ||
}, | ||
"serve.debug": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "node --inspect-brk ../../node_modules/vite/bin/vite.js --mode ssr --force", | ||
"cwd": "apps/qwik-app2" | ||
} | ||
}, | ||
"lint": { | ||
"executor": "@nx/eslint:lint", | ||
"outputs": ["{options.outputFile}"], | ||
"options": { | ||
"lintFilePatterns": ["apps/qwik-app2/**/*.{ts,tsx,js,jsx}"] | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$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." | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
header { | ||
display: flex; | ||
background: white; | ||
border-bottom: 10px solid var(--qwik-dark-purple); | ||
} | ||
|
||
header .logo a { | ||
display: inline-block; | ||
padding: 10px 10px 7px 20px; | ||
} | ||
|
||
header ul { | ||
margin: 0; | ||
padding: 3px 10px 0 0; | ||
list-style: none; | ||
flex: 1; | ||
text-align: right; | ||
} | ||
|
||
header li { | ||
display: inline-block; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
header li a { | ||
display: inline-block; | ||
padding: 15px 10px; | ||
text-decoration: none; | ||
} | ||
|
||
header li a:hover { | ||
text-decoration: underline; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { component$, useStylesScoped$ } from '@builder.io/qwik'; | ||
import { QwikLogo } from '../icons/qwik'; | ||
import styles from './header.css?inline'; | ||
|
||
export default component$(() => { | ||
useStylesScoped$(styles); | ||
|
||
return ( | ||
<header> | ||
<div class="logo"> | ||
<a href="https://qwik.builder.io/" target="_blank"> | ||
<QwikLogo /> | ||
</a> | ||
</div> | ||
<ul> | ||
<li> | ||
<a | ||
href="https://qwik.builder.io/docs/components/overview/" | ||
target="_blank" | ||
> | ||
Docs | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="https://qwik.builder.io/examples/introduction/hello-world/" | ||
target="_blank" | ||
> | ||
Examples | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="https://qwik.builder.io/tutorial/welcome/overview/" | ||
target="_blank" | ||
> | ||
Tutorials | ||
</a> | ||
</li> | ||
</ul> | ||
</header> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
export const QwikLogo = () => ( | ||
<svg | ||
width="100" | ||
height="35" | ||
viewBox="0 0 167 53" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M81.9545 46.5859H75.5513V35.4045C73.4363 36.8579 71.0496 37.5749 68.4884 37.5749C65.0151 37.5749 62.4344 36.6253 60.8239 34.6487C59.2134 32.6915 58.3984 29.2034 58.3984 24.2231C58.3984 19.1266 59.3492 15.5997 61.2702 13.5456C63.23 11.4721 66.3734 10.4644 70.7004 10.4644C74.7946 10.4644 78.5201 11.0264 81.9545 12.131V46.5859ZM75.5513 16.278C74.096 15.8323 72.4661 15.6191 70.7004 15.6191C68.5272 15.6191 66.9749 16.1811 66.1017 17.3244C65.2479 18.4871 64.7823 20.6962 64.7823 23.9712C64.7823 27.0524 65.1897 29.1065 66.0435 30.2304C66.8973 31.335 68.3719 31.897 70.5452 31.897C73.3781 31.897 75.5513 30.7343 75.5513 29.2809V16.278Z" | ||
fill="black" | ||
/> | ||
<path | ||
d="M91.133 11.1426C93.4033 17.4406 95.3242 23.7386 96.993 30.0948C99.205 23.5836 101.087 17.2856 102.542 11.1426H108.15C110.265 17.4406 112.031 23.7386 113.447 30.0948C115.97 23.196 117.949 16.8787 119.404 11.1426H125.71C123.033 20.173 120.064 28.777 116.785 36.8966H109.256C108.402 32.3039 107.044 26.7617 105.22 20.1536C104.056 25.2889 102.445 30.8893 100.33 36.8966H92.8018C90.2793 27.5174 87.5434 18.9522 84.6328 11.1426H91.133Z" | ||
fill="black" | ||
/> | ||
<path | ||
d="M132.832 7.55758C129.999 7.55758 129.203 6.85996 129.203 3.97257C129.203 1.39523 130.018 0.794495 132.832 0.794495C135.665 0.794495 136.46 1.39523 136.46 3.97257C136.46 6.85996 135.665 7.55758 132.832 7.55758ZM129.649 11.1426H136.053V36.8966H129.649V11.1426Z" | ||
fill="black" | ||
/> | ||
<path | ||
d="M166.303 11.1426C161.763 17.5956 158.581 21.5295 156.815 22.9441C158.27 23.8937 162.17 28.8933 167.002 36.916H159.628C153.613 27.7887 150.742 23.8549 149.325 23.2542V36.916H142.922V0H149.325V23.2348C150.78 22.169 153.963 18.1382 158.872 11.1426H166.303Z" | ||
fill="black" | ||
/> | ||
<path | ||
d="M40.973 52.5351L32.0861 43.6985L31.9503 43.7179V43.621L13.0511 24.9595L17.708 20.4637L14.9721 4.76715L1.99103 20.8513C-0.220992 23.0798 -0.628467 26.7036 0.962635 29.3778L9.07337 42.8265C10.3152 44.9 12.566 46.1402 14.9915 46.1208L19.0081 46.082L40.973 52.5351Z" | ||
fill="#18B6F6" | ||
/> | ||
<path | ||
d="M45.8232 20.5411L44.038 17.2468L43.1066 15.5609L42.738 14.902L42.6992 14.9408L37.8094 6.47238C36.587 4.34075 34.2974 3.02301 31.8137 3.04239L27.5255 3.15865L14.7384 3.19741C12.313 3.21679 10.101 4.49577 8.87853 6.56927L1.09766 21.9945L15.0101 4.72831L33.2496 24.7656L30.0091 28.0406L31.9495 43.7178L31.9689 43.679V43.7178H31.9301L31.9689 43.7565L33.4824 45.2293L40.8364 52.4187C41.1469 52.7094 41.6514 52.3606 41.4379 51.9924L36.8975 43.0589L44.8142 28.4282L45.0664 28.1375C45.1634 28.0212 45.2604 27.905 45.3381 27.7887C46.8904 25.6764 47.1038 22.8472 45.8232 20.5411Z" | ||
fill="#AC7EF4" | ||
/> | ||
<path | ||
d="M33.3076 24.6882L15.0099 4.74774L17.61 20.3668L12.9531 24.882L31.9105 43.6985L30.203 28.0794L33.3076 24.6882Z" | ||
fill="white" | ||
/> | ||
</svg> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { component$ } from '@builder.io/qwik'; | ||
import { useDocumentHead, useLocation } from '@builder.io/qwik-city'; | ||
|
||
/** | ||
* The RouterHead component is placed inside of the document `<head>` element. | ||
*/ | ||
export const RouterHead = component$(() => { | ||
const head = useDocumentHead(); | ||
const loc = useLocation(); | ||
|
||
return ( | ||
<> | ||
<title>{head.title}</title> | ||
|
||
<link rel="canonical" href={loc.url.href} /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
|
||
{head.meta.map((m) => ( | ||
<meta key={m.key} {...m} /> | ||
))} | ||
|
||
{head.links.map((l) => ( | ||
<link key={l.key} {...l} /> | ||
))} | ||
|
||
{head.styles.map((s) => ( | ||
<style key={s.key} {...s.props} dangerouslySetInnerHTML={s.style} /> | ||
))} | ||
|
||
{head.scripts.map((s) => ( | ||
<script key={s.key} {...s.props} dangerouslySetInnerHTML={s.script} /> | ||
))} | ||
</> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* WHAT IS THIS FILE? | ||
* | ||
* Development entry point using only client-side modules: | ||
* - Do not use this mode in production! | ||
* - No SSR | ||
* - No portion of the application is pre-rendered on the server. | ||
* - All of the application is running eagerly in the browser. | ||
* - More code is transferred to the browser than in SSR mode. | ||
* - Optimizer/Serialization/Deserialization code is not exercised! | ||
*/ | ||
import { render, RenderOptions } from '@builder.io/qwik'; | ||
import Root from './root'; | ||
|
||
export default function (opts: RenderOptions) { | ||
return render(document, <Root />, opts); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* WHAT IS THIS FILE? | ||
* | ||
* It's the bundle entry point for `npm run preview`. | ||
* That is, serving your app built in production mode. | ||
* | ||
* Feel free to modify this file, but don't remove it! | ||
* | ||
* Learn more about Vite's preview command: | ||
* - https://vitejs.dev/config/preview-options.html#preview-options | ||
* | ||
*/ | ||
import { createQwikCity } from '@builder.io/qwik-city/middleware/node'; | ||
// The `render` import must stay after `qwikCityPlan` import: https://github.com/BuilderIO/qwik/issues/3634 | ||
import qwikCityPlan from '@qwik-city-plan'; | ||
import render from './entry.ssr'; | ||
|
||
/** | ||
* The default export is the QwikCity adaptor used by Vite preview. | ||
*/ | ||
export default createQwikCity({ render, qwikCityPlan }); |
Oops, something went wrong.