Skip to content

Commit

Permalink
initial mono-repo setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rherwig committed Nov 1, 2023
1 parent 740ab84 commit ae63524
Show file tree
Hide file tree
Showing 43 changed files with 7,606 additions and 809 deletions.
5 changes: 3 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 100

[*.md]
max_line_length = off
Expand Down
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/

dist/
public/
vite.config.ts
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eof=lf
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ node_modules

# IDEs and editors
/.idea
/.vscode
.project
.classpath
.c9/
Expand Down Expand Up @@ -38,4 +39,4 @@ testem.log
.DS_Store
Thumbs.db

.nx/cache
.nx/cache
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Add files here to ignore them from prettier formatting
.nx/
dist/
coverage/
var/
16 changes: 16 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"singleQuote": true,
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"editorconfig": true,
"semi": true,
"tabWidth": 4,
"trailingComma": "all",
"quoteProps": "consistent",
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"vueIndentScriptAndStyle": false,
"embeddedLanguageFormatting": "auto",
"singleAttributePerLine": true
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Rico Herwig

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions apps/website/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/

dist/
public/
vite.config.ts
65 changes: 65 additions & 0 deletions apps/website/README.md
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`
```
34 changes: 34 additions & 0 deletions apps/website/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import baseConfig from '../../eslint.config.js';
import tsParser from '@typescript-eslint/parser';
import { FlatCompat } from '@eslint/eslintrc';
import { fileURLToPath } from 'url';
import path from 'path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

export default [
...baseConfig,
...compat.plugins('qwik'),
...compat.extends('plugin:qwik/recommended'),
{
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: [
'./tsconfig.*?.json',
],
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
},
];
10 changes: 10 additions & 0 deletions apps/website/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { join } = require('path');

module.exports = {
plugins: {
autoprefixer: {},
tailwindcss: {
config: join(__dirname, 'tailwind.config.cjs'),
},
},
};
84 changes: 84 additions & 0 deletions apps/website/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/website/src",
"targets": {
"build": {
"executor": "qwik-nx:build",
"options": {
"runSequence": [
"website:build.client",
"website:build.ssr"
],
"outputPath": "dist/apps/website"
},
"configurations": {
"preview": {}
}
},
"build.client": {
"executor": "@nx/vite:build",
"options": {
"outputPath": "dist/apps/website",
"configFile": "apps/website/vite.config.ts"
}
},
"build.ssr": {
"executor": "@nx/vite:build",
"defaultConfiguration": "preview",
"options": {
"outputPath": "dist/apps/website"
},
"configurations": {
"preview": {
"ssr": "src/entry.preview.tsx",
"mode": "production"
}
}
},
"preview": {
"executor": "@nx/vite:preview-server",
"options": {
"buildTarget": "website:build",
"port": 4300
}
},
"test": {
"executor": "@nx/vite:test",
"outputs": [
"../../coverage/apps/website"
],
"options": {
"passWithNoTests": true,
"reportsDirectory": "../../coverage/apps/website"
}
},
"serve": {
"executor": "@nx/vite:dev-server",
"options": {
"buildTarget": "website:build.client",
"mode": "ssr",
"port": 4200
}
},
"serve.debug": {
"executor": "nx:run-commands",
"options": {
"command": "node --inspect-brk ../../node_modules/vite/bin/vite.js --mode ssr --force",
"cwd": "apps/website"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": [
"{options.outputFile}"
],
"options": {
"lintFilePatterns": [
"apps/website/**/*.{ts,tsx,js,jsx}"
]
}
}
},
"tags": []
}
1 change: 1 addition & 0 deletions apps/website/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions apps/website/public/manifest.json
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."
}
2 changes: 2 additions & 0 deletions apps/website/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
34 changes: 34 additions & 0 deletions apps/website/src/components/header/header.scss
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;
}
43 changes: 43 additions & 0 deletions apps/website/src/components/header/header.tsx
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.scss?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>
);
});
Loading

0 comments on commit ae63524

Please sign in to comment.