Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lautr authored Nov 18, 2024
0 parents commit d407397
Show file tree
Hide file tree
Showing 67 changed files with 18,158 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"hostRequirements": {
"cpus": 4
},
"waitFor": "onCreateCommand",
"updateContentCommand": "pnpm install",
"postCreateCommand": "",
"postAttachCommand": {},
"customizations": {
"codespaces": {
"openFiles": [
"package.json"
]
}
},
"portsAttributes": {
"3000": {
"label": "Application",
"onAutoForward": "openPreview"
}
},
"forwardPorts": [3000]
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
31 changes: 31 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build Environment
runs:
using: composite
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/[email protected]
name: Install pnpm
with:
version: 9.12.2
- uses: actions/checkout@v4
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-l
- name: Install dependencies
shell: bash
run: pnpm install
73 changes: 73 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: CodeQL

on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '27 2 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [javascript]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{matrix.language}}'
49 changes: 49 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]

permissions:
contents: write

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build
- name: All lining
run: pnpm lint

webapp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build
- name: Webapp Build
run: pnpm webapp build
- name: Webapp Tests
run: pnpm webapp ci:test
- name: Webapp Development Smoke Test
run: pnpm webapp ci:smoke

design:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build
- name: Install Playwright
run: npx playwright install
- name: Design System Build & Test
run: pnpm design ci:test
- name: Design System Development Smoke Test
run: pnpm design dev --smoke-test

deploy:
needs: [linting, design, webapp]
runs-on: ubuntu-latest

steps:
- run: echo "Deploying .."
59 changes: 59 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
node_modules
yarn.lock
dist

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

storybook-static

# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
save-exact=true
shamefully-hoist=true
strict-peer-dependencies=false
auto-install-peers=false
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"antfu.goto-alias",
"bradlc.vscode-tailwindcss",
"csstools.postcss",
"cpylua.language-postcss",
"dbaeumer.vscode-eslint",
"vue.volar"
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"files.associations": {
"*.css": "postcss"
},
"typescript.tsdk": "node_modules/typescript/lib"
}
5 changes: 5 additions & 0 deletions ISSUES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Issues

## Dependencies

https://github.com/storybookjs/storybook/issues/20395
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# lautr/initium-nuxt 🔥

<pre align="center">
🚀 Opinionated Nuxt, Tailwind & Storybook monorepo template
</pre>
<hr />

> inspired by [antfu vitesse nuxt](https://github.com/antfu/vitesse-nuxt3)
## Features
- [💚 Nuxt 3](https://v3.nuxtjs.org) - SSR, ESR, File-based routing, components auto importing, modules, etc.
- 🤓 Optimized for VSCode usage
- [⚡️ Vite](https://vitejs.dev/) - Instant HMR
- [✨ Vitest](https://vitest.dev/guide/) - A blazing fast unit test framework
- [🚝 Monorepo](https://pnpm.io/workspaces) - workspace setup using [pnpm](https://pnpm.io/)
- [🌬️ Tailwind 3](https://tailwindcss.com/) - the utility-first CSS framework
- [🖌️ Storybook](https://storybook.js.org/) - build UI components and pages in isolation
- [🌓 Color Mode](https://github.com/nuxt-community/color-mode-module) - dark, light & custom mode integrated in Tailwind and Nuxt
- 🔥 The `<script setup>` syntax
- [🍍 State Management via Pinia](https://pinia.esm.dev), see [./stores/AuthStore.ts](./stores/AuthStore.ts)
- [🧹 Vue Macros](https://vue-macros.sxzz.moe/) Explore and extend more macros and syntax sugar to Vue.
- 📥 APIs auto importing - for Composition API, VueUse, Components (localy & from design) and custom composables
- [🦾 TypeScript](https://www.typescriptlang.org/) - JavaScript, but strongly typed and better

## Plugins

### Nuxt Modules

- [VueUse](https://github.com/vueuse/vueuse) - collection of useful composition APIs.
- [ColorMode](https://github.com/nuxt-community/color-mode-module) - dark and Light mode with auto detection made easy with Nuxt.
- [Pinia](https://pinia.esm.dev/) - intuitive, type safe, light and flexible Store for Vue.
- [Nuxt Devools](https://devtools.nuxtjs.org/) - Unleash Nuxt Developer Experience.

## Commands
```
# install all dependencies of the monorepo
pnpm install
# start webapp & storybook
pnpm dev
# start dev webapp
pnpm webapp dev
# build webapp for prod
pnpm webapp build
# start webapp for prod
pnpm webapp start
# start dev storybook
pnpm design dev
```

## IDE

This Template is designed to provide great DX with [VS Code](https://code.visualstudio.com/) and [Volar](https://github.com/johnsoncodehk/volar).

## Usage

### GitHub Template

[Create a repo from this template on GitHub](https://github.com/lautr/initium-nuxt/generate).

### Clone to local

If you prefer to do it manually with the cleaner git history

```bash
npx degit lautr/initium-nuxt my-nuxt3-app
cd my-nuxt3-app
pnpm i # If you don't have pnpm installed, run: npm install -g pnpm
```
8 changes: 8 additions & 0 deletions apps/alpha/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<template>
<NuxtLayout name="default">
<template #header>
This is the Alpha Webapp
</template>
<NuxtPage />
</NuxtLayout>
</template>
6 changes: 6 additions & 0 deletions apps/alpha/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
extends: [
'../webapp',
],
})
Loading

0 comments on commit d407397

Please sign in to comment.