Skip to content

Commit b2d4131

Browse files
committed
init
0 parents  commit b2d4131

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5361
-0
lines changed

.eslintignore

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
**/*.log
2+
**/.DS_Store
3+
*.
4+
.vscode/settings.json
5+
.history
6+
.yarn
7+
bazel-*
8+
bazel-bin
9+
bazel-out
10+
bazel-qwik
11+
bazel-testlogs
12+
dist
13+
dist-dev
14+
lib
15+
lib-types
16+
etc
17+
external
18+
node_modules
19+
temp
20+
tsc-out
21+
tsdoc-metadata.json
22+
target
23+
output
24+
rollup.config.js
25+
build
26+
.cache
27+
.vscode
28+
.rollup.cache
29+
dist
30+
tsconfig.tsbuildinfo
31+
vite.config.ts
32+
*.spec.tsx
33+
*.spec.ts
34+
.netlify
35+
pnpm-lock.yaml
36+
package-lock.json
37+
yarn.lock
38+
server

.eslintrc.cjs

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
node: true,
7+
},
8+
extends: [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/recommended",
11+
"plugin:qwik/recommended",
12+
],
13+
parser: "@typescript-eslint/parser",
14+
parserOptions: {
15+
tsconfigRootDir: __dirname,
16+
project: ["./tsconfig.json"],
17+
ecmaVersion: 2021,
18+
sourceType: "module",
19+
ecmaFeatures: {
20+
jsx: true,
21+
},
22+
},
23+
plugins: ["@typescript-eslint"],
24+
rules: {
25+
"@typescript-eslint/no-explicit-any": "off",
26+
"@typescript-eslint/explicit-module-boundary-types": "off",
27+
"@typescript-eslint/no-inferrable-types": "off",
28+
"@typescript-eslint/no-non-null-assertion": "off",
29+
"@typescript-eslint/no-empty-interface": "off",
30+
"@typescript-eslint/no-namespace": "off",
31+
"@typescript-eslint/no-empty-function": "off",
32+
"@typescript-eslint/no-this-alias": "off",
33+
"@typescript-eslint/ban-types": "off",
34+
"@typescript-eslint/ban-ts-comment": "off",
35+
"prefer-spread": "off",
36+
"no-case-declarations": "off",
37+
"no-console": "off",
38+
"@typescript-eslint/no-unused-vars": ["error"],
39+
"@typescript-eslint/consistent-type-imports": "warn",
40+
"@typescript-eslint/no-unnecessary-condition": "warn",
41+
},
42+
};

.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Build
2+
/dist
3+
/lib
4+
/lib-types
5+
/server
6+
7+
# Development
8+
node_modules
9+
*.local
10+
11+
# Cache
12+
.cache
13+
.mf
14+
.rollup.cache
15+
tsconfig.tsbuildinfo
16+
17+
# Logs
18+
logs
19+
*.log
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
pnpm-debug.log*
24+
lerna-debug.log*
25+
26+
# Editor
27+
.vscode/*
28+
!.vscode/launch.json
29+
!.vscode/*.code-snippets
30+
31+
.idea
32+
.DS_Store
33+
*.suo
34+
*.ntvs*
35+
*.njsproj
36+
*.sln
37+
*.sw?
38+
39+
# Yarn
40+
.yarn/*
41+
!.yarn/releases

.prettierignore

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
**/*.log
2+
**/.DS_Store
3+
*.
4+
.vscode/settings.json
5+
.history
6+
.yarn
7+
bazel-*
8+
bazel-bin
9+
bazel-out
10+
bazel-qwik
11+
bazel-testlogs
12+
dist
13+
dist-dev
14+
lib
15+
lib-types
16+
etc
17+
external
18+
node_modules
19+
temp
20+
tsc-out
21+
tsdoc-metadata.json
22+
target
23+
output
24+
rollup.config.js
25+
build
26+
.cache
27+
.vscode
28+
.rollup.cache
29+
dist
30+
tsconfig.tsbuildinfo
31+
vite.config.ts
32+
*.spec.tsx
33+
*.spec.ts
34+
.netlify
35+
pnpm-lock.yaml
36+
package-lock.json
37+
yarn.lock
38+
server

.vscode/launch.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch Chrome",
9+
"request": "launch",
10+
"type": "chrome",
11+
"url": "http://localhost:5173",
12+
"webRoot": "${workspaceFolder}"
13+
},
14+
{
15+
"type": "node",
16+
"name": "dev.debug",
17+
"request": "launch",
18+
"skipFiles": ["<node_internals>/**"],
19+
"cwd": "${workspaceFolder}",
20+
"program": "${workspaceFolder}/node_modules/vite/bin/vite.js",
21+
"args": ["--mode", "ssr", "--force"]
22+
}
23+
]
24+
}

.vscode/qwik-city.code-snippets

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"onRequest": {
3+
"scope": "javascriptreact,typescriptreact",
4+
"prefix": "qonRequest",
5+
"description": "onRequest function for a route index",
6+
"body": [
7+
"export const onRequest: RequestHandler = (request) => {",
8+
" $0",
9+
"};"
10+
]
11+
},
12+
"loader$": {
13+
"scope": "javascriptreact,typescriptreact",
14+
"prefix": "qloader$",
15+
"description": "loader$()",
16+
"body": ["export const $1 = routeLoader$(() => {", " $0", "});"]
17+
},
18+
"action$": {
19+
"scope": "javascriptreact,typescriptreact",
20+
"prefix": "qaction$",
21+
"description": "action$()",
22+
"body": ["export const $1 = routeAction$((data) => {", " $0", "});"]
23+
},
24+
"Full Page": {
25+
"scope": "javascriptreact,typescriptreact",
26+
"prefix": "qpage",
27+
"description": "Simple page component",
28+
"body": [
29+
"import { component$ } from '@builder.io/qwik';",
30+
"",
31+
"export default component$(() => {",
32+
" $0",
33+
"});"
34+
]
35+
}
36+
}

.vscode/qwik.code-snippets

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"Qwik component (simple)": {
3+
"scope": "javascriptreact,typescriptreact",
4+
"prefix": "qcomponent$",
5+
"description": "Simple Qwik component",
6+
"body": [
7+
"export const ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}} = component$(() => {",
8+
" return <${2:div}>$4</$2>",
9+
"});"
10+
]
11+
},
12+
"Qwik component (props)": {
13+
"scope": "typescriptreact",
14+
"prefix": "qcomponent$ + props",
15+
"description": "Qwik component w/ props",
16+
"body": [
17+
"export interface ${1:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/}}Props {",
18+
" $2",
19+
"}",
20+
"",
21+
"export const $1 = component$<$1Props>((props) => {",
22+
" const ${2:count} = useSignal(0);",
23+
" return (",
24+
" <${3:div} on${4:Click}$={(ev) => {$5}}>",
25+
" $6",
26+
" </${3}>",
27+
" );",
28+
"});"
29+
]
30+
},
31+
"Qwik signal": {
32+
"scope": "javascriptreact,typescriptreact",
33+
"prefix": "quseSignal",
34+
"description": "useSignal() declaration",
35+
"body": ["const ${1:foo} = useSignal($2);", "$0"]
36+
},
37+
"Qwik store": {
38+
"scope": "javascriptreact,typescriptreact",
39+
"prefix": "quseStore",
40+
"description": "useStore() declaration",
41+
"body": ["const ${1:state} = useStore({", " $2", "});", "$0"]
42+
},
43+
"$ hook": {
44+
"scope": "javascriptreact,typescriptreact",
45+
"prefix": "q$",
46+
"description": "$() function hook",
47+
"body": ["$(() => {", " $0", "});", ""]
48+
},
49+
"useVisibleTask": {
50+
"scope": "javascriptreact,typescriptreact",
51+
"prefix": "quseVisibleTask",
52+
"description": "useVisibleTask$() function hook",
53+
"body": ["useVisibleTask$(({ track }) => {", " $0", "});", ""]
54+
},
55+
"useTask": {
56+
"scope": "javascriptreact,typescriptreact",
57+
"prefix": "quseTask$",
58+
"description": "useTask$() function hook",
59+
"body": [
60+
"useTask$(({ track }) => {",
61+
" track(() => $1);",
62+
" $0",
63+
"});",
64+
""
65+
]
66+
},
67+
"useResource": {
68+
"scope": "javascriptreact,typescriptreact",
69+
"prefix": "quseResource$",
70+
"description": "useResource$() declaration",
71+
"body": [
72+
"const $1 = useResource$(({ track, cleanup }) => {",
73+
" $0",
74+
"});",
75+
""
76+
]
77+
}
78+
}

README.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Qwik City App ⚡️
2+
3+
- [Qwik Docs](https://qwik.builder.io/)
4+
- [Discord](https://qwik.builder.io/chat)
5+
- [Qwik GitHub](https://github.com/BuilderIO/qwik)
6+
- [@QwikDev](https://twitter.com/QwikDev)
7+
- [Vite](https://vitejs.dev/)
8+
9+
---
10+
11+
## Project Structure
12+
13+
This project is using Qwik with [QwikCity](https://qwik.builder.io/qwikcity/overview/). QwikCity is just an extra set of tools on top of Qwik to make it easier to build a full site, including directory-based routing, layouts, and more.
14+
15+
Inside your project, you'll see the following directory structure:
16+
17+
```
18+
├── public/
19+
│ └── ...
20+
└── src/
21+
├── components/
22+
│ └── ...
23+
└── routes/
24+
└── ...
25+
```
26+
27+
- `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.
28+
29+
- `src/components`: Recommended directory for components.
30+
31+
- `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.
32+
33+
## Add Integrations and deployment
34+
35+
Use the `npm run qwik add` command to add additional integrations. Some examples of integrations includes: Cloudflare, Netlify or Express Server, and the [Static Site Generator (SSG)](https://qwik.builder.io/qwikcity/guides/static-site-generation/).
36+
37+
```shell
38+
npm run qwik add # or `yarn qwik add`
39+
```
40+
41+
## Development
42+
43+
Development mode uses [Vite's development server](https://vitejs.dev/). The `dev` command will server-side render (SSR) the output during development.
44+
45+
```shell
46+
npm start # or `yarn start`
47+
```
48+
49+
> Note: during dev mode, Vite may request a significant number of `.js` files. This does not represent a Qwik production build.
50+
51+
## Preview
52+
53+
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 preview a production build locally and should not be used as a production server.
54+
55+
```shell
56+
npm run preview # or `yarn preview`
57+
```
58+
59+
## Production
60+
61+
The production build will generate client and server modules by running both client and server build commands. The build command will use Typescript to run a type check on the source code.
62+
63+
```shell
64+
npm run build # or `yarn build`
65+
```
66+
67+
## Static Site Generator (Node.js)
68+
69+
```shell
70+
npm run build.server
71+
```

adapters/static/vite.config.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { staticAdapter } from "@builder.io/qwik-city/adapters/static/vite";
2+
import { extendConfig } from "@builder.io/qwik-city/vite";
3+
import baseConfig from "../../vite.config";
4+
5+
export default extendConfig(baseConfig, () => {
6+
return {
7+
build: {
8+
ssr: true,
9+
rollupOptions: {
10+
input: ["@qwik-city-plan"],
11+
},
12+
},
13+
plugins: [
14+
staticAdapter({
15+
origin: "http://localhost",
16+
}),
17+
],
18+
};
19+
});

0 commit comments

Comments
 (0)