Skip to content

Commit

Permalink
feat: initial template codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Markkos89 committed Sep 2, 2023
0 parents commit a1a6000
Show file tree
Hide file tree
Showing 149 changed files with 17,818 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@commitlint/config-conventional"
]
}
12 changes: 12 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.cache/
.lighthouseci/
.next/
.swc/
.turbo/
coverage/
dist/
e2e-report/
e2e-results/
out/
storybook-static/
*.js
9 changes: 9 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"root": true,
"extends": ["custom"],
"settings": {
"next": {
"rootDir": ["apps/*/"]
}
}
}
34 changes: 34 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Setup
description: "Install required dependencies and build site"

inputs:
node-version:
description: "Node version"
required: true
default: "18"
pnpm-version:
description: "pnpm version"
required: true
default: "8"

runs:
using: "composite"
steps:
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ inputs.pnpm-version }}
- name: Set up Node ${{ inputs.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install
shell: bash
- name: Install Playwright browsers
run: pnpm playwright install --with-deps
shell: bash
- name: Install Lighthouse globally
run: npm install -g @lhci/cli
shell: bash
23 changes: 23 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:best-practices",
"config:js-app",
"config:semverAllMonthly",
":disableRateLimiting",
":noUnscheduledUpdates",
":automergeLinters",
":automergeTesters",
":automergeTypes",
":automergeMinor"
],
"timezone": "America/Los_Angeles",
"schedule": ["after 8pm every weekday", "every weekend"],
"automergeType": "pr",
"platformAutomerge": true,
"rebaseWhen": "conflicted",
"semanticCommits": "enabled",
"constraints": {
"pnpm": "8"
}
}
64 changes: 64 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build

on:
pull_request:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure Pages
id: pages
uses: actions/configure-pages@v3
- name: Setup
uses: ./.github/actions/setup
- name: Build
run: pnpm build
- name: Run linters
run: pnpm lint
# - name: Run unit tests
# run: pnpm test:unit
# - name: Run e2e tests
# run: pnpm test:e2e
- name: Move output of Website SSR
run: |
mkdir -p out
mv apps/website-ssr/out out/website-ssr
mv out apps/website-ssr/
- name: Run Lighthouse tests on Website SSR
run: |
cd apps/website-ssr
lhci autorun --config=lighthouse.config.js
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
- name: Move output of website
run: |
mkdir -p out
mv apps/website/out out${{ steps.pages.outputs.base_path }}
mv out apps/website/
- name: Run Lighthouse tests on website
run: |
cd apps/website
lhci autorun --config=lighthouse.config.js
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
- name: Upload website
uses: actions/upload-artifact@v3
with:
name: website
path: apps/website/out${{ steps.pages.outputs.base_path }}
retention-days: 1
- name: Upload e2e test reports
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: e2e-reports
path: |
apps/website-ssr/e2e-report/
apps/website-ssr/e2e-results/
apps/website/e2e-report/
apps/website/e2e-results/
retention-days: 7
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy

on:
push:
branches: main
workflow_call:

permissions:
contents: write

jobs:
build:
uses: ./.github/workflows/build.yml

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download website
uses: actions/download-artifact@v3
with:
name: website
path: .
- name: Add `.nojekyll` file
run: touch .nojekyll
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release

on:
push:
branches: main

permissions:
contents: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Release
uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: turbo-monorepo-template
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.cache/
.lighthouseci/
.next/
.swc/
.turbo/
coverage/
dist/
e2e-report/
e2e-results/
node_modules/
out/
storybook-static/
.env
.env.*
!.env.example
.eslintcache
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm commitlint --edit ${1}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint-staged
16 changes: 16 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.cache/
.lighthouseci/
.next/
.swc/
.turbo/
coverage/
dist/
e2e-report/
e2e-results/
out/
storybook-static/
.eslintcache
CHANGELOG.md
package-lock.json
pnpm-lock.yaml
yarn.lock
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 100,
"plugins": ["prettier-plugin-tailwindcss"]
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"bradlc.vscode-tailwindcss",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
30 changes: 30 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.rulers": [{ "column": 100 }],
"editor.tabSize": 2,
"files.associations": {
"*.css": "tailwindcss"
},
"files.readonlyInclude": {
".cache/**": true,
".next/**": true,
".swc/**": true,
".turbo/**": true,
"coverage/**": true,
"dist/**": true,
"e2e-report/**": true,
"e2e-results/**": true,
"node_modules/**": true,
"out/**": true,
"storybook-static/**": true,
".eslintcache": true
},
"javascript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.tsdk": "root/node_modules/typescript/lib",
"workbench.editor.labelFormat": "medium"
}
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 Markkos98

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.
Loading

0 comments on commit a1a6000

Please sign in to comment.