Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Markkos89 authored Sep 6, 2023
0 parents commit 4431b42
Show file tree
Hide file tree
Showing 164 changed files with 16,616 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"
}
}
71 changes: 71 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
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
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
71 changes: 71 additions & 0 deletions .github/workflows/run-lighthouse-on-vercel-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Vercel Preview URL Lighthouse Audit

on:
issue_comment:
types: [edited]

jobs:
generate_lighthouse_audit:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Add comment to PR
id: loading_comment_to_pr
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ github.event.issue.number }}
header: lighthouse
message: |
Running Lighthouse audit...
- name: Capture Vercel preview URL
id: vercel_preview_url
uses: aaimio/[email protected] # aaron-binary/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- name: Audit preview URL with Lighthouse
id: lighthouse_audit
uses: treosh/lighthouse-ci-action@v10
with:
urls: |
${{ steps.vercel_preview_url.outputs.vercel_preview_url }}
uploadArtifacts: true
temporaryPublicStorage: true
- name: Format lighthouse score
id: format_lighthouse_score
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const result = ${{ steps.lighthouse_audit.outputs.manifest }}[0].summary
const links = ${{ steps.lighthouse_audit.outputs.links }}
const formatResult = (res) => Math.round((res * 100))
Object.keys(result).forEach(key => result[key] = formatResult(result[key]))
const score = res => res >= 90 ? '🟢' : res >= 50 ? '🟠' : '🔴'
const comment = [
`⚡️ [Lighthouse report](${Object.values(links)[0]}) for the changes in this PR:`,
'| Category | Score |',
'| --- | --- |',
`| ${score(result.performance)} Performance | ${result.performance} |`,
`| ${score(result.accessibility)} Accessibility | ${result.accessibility} |`,
`| ${score(result['best-practices'])} Best practices | ${result['best-practices']} |`,
`| ${score(result.seo)} SEO | ${result.seo} |`,
`| ${score(result.pwa)} PWA | ${result.pwa} |`,
' ',
`*Lighthouse ran on [${Object.keys(links)[0]}](${Object.keys(links)[0]})*`
].join('\n')
core.setOutput("comment", comment);
- name: Add comment to PR
id: comment_to_pr
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ github.event.issue.number }}
header: lighthouse
message: |
${{ steps.format_lighthouse_score.outputs.comment }}
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.cache/
.lighthouseci/
.next/
.swc/
.turbo/
coverage/
dist/
e2e-report/
e2e-results/
node_modules/
out/
storybook-static/
.env
.env.*
!.env.example
.eslintcache
**/graph.svg

# PWA files
**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map
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
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
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 4431b42

Please sign in to comment.