Skip to content

Commit

Permalink
chore: initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-newhall committed Apr 11, 2023
0 parents commit 6a88d49
Show file tree
Hide file tree
Showing 85 changed files with 192,777 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"allowCompoundWords": true,
"ignoreRegExpList": [
"/.*[0-9].*/"
],
"language": "en",
"minWordLength": 5,
"version": "0.2",
"words": []
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
3 changes: 3 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SUPABASE_PROJECT_REF=ref
NEXT_PUBLIC_SUPABASE_URL=url
NEXT_PUBLIC_SUPABASE_ANON_KEY=key
61 changes: 61 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
var tsConfigs = ['./tsconfig.json'];

var ruleOverrides = {};

module.exports = {
overrides: [
{
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@next/next/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: tsConfigs,
},
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'prettier/prettier': 'error',
},
files: [
'src/**/*.ts',
'src/**/*.tsx',
'emails/**/*.ts',
'emails/**/*.tsx',
],
},
{
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: tsConfigs,
},
plugins: [
'@typescript-eslint',
'prettier',
'plugin:playwright/playwright-test',
],
rules: {
'prettier/prettier': 'error',
},
files: ['e2e/**/*.spec.ts'],
},
{
extends: ['eslint:recommended', 'prettier', 'esnext'],
files: '*.mjs',
rules: ruleOverrides,
},
{
extends: ['prettier'],
files: '*.js',
rules: ruleOverrides,
},
],
root: true,
};
23 changes: 23 additions & 0 deletions .github/actions/ci-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'CI setup'
runs:
using: 'composite'
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
shell: bash
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install project dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here!
run: yarn
shell: bash
Binary file added .github/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/litebanner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

name: Build with ${{ matrix.node-version }}
runs-on: ubuntu-latest
if: ${{ github.repository == 'imbhargav5/nextbase-nextjs13-supabase-starter'}}
steps:
- name: 'Check if user has write access'
uses: 'lannonbr/[email protected]'
with:
permission: 'write'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: github.event_name == 'pull_request'
name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- if: github.event_name != 'pull_request'
name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
persist-credentials: false
- name: 🚂 CI Setup
uses: ./.github/actions/ci-setup
- run: yarn run build

test:
strategy:
matrix:
node-version: [18.x]

name: Run all tests
runs-on: ubuntu-latest
if: ${{ github.repository == 'imbhargav5/nextbase-nextjs13-supabase-starter'}}
steps:
- name: 'Check if user has write access'
uses: 'lannonbr/[email protected]'
with:
permission: 'write'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: github.event_name == 'pull_request'
name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- if: github.event_name != 'pull_request'
name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
persist-credentials: false
- name: 🚂 CI Setup
uses: ./.github/actions/ci-setup
- if: github.event_name == 'pull_request'
uses: wagoid/commitlint-github-action@v5
- name: Linter
run: yarn run lint

- name: Type checking
run: yarn run tsc

- name: Run unit tests
run: yarn run test
- name: Install playwright browsers
run: yarn playwright install --with-deps

- name: Run e2e tests
run: yarn run test:e2e
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
workflow_run:
workflows: ['CI']
types:
- completed
branches:
- main

jobs:
release:
strategy:
matrix:
node-version: [18.x]

name: Create a new release
runs-on: ubuntu-latest
if: ${{ github.repository == 'imbhargav5/nextbase-nextjs13-supabase-starter'}}
steps:
- name: 'Check if user has write access'
uses: 'lannonbr/[email protected]'
with:
permission: 'write'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: github.event_name == 'pull_request'
name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
persist-credentials: false
- if: github.event_name != 'pull_request'
name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
persist-credentials: false
- name: 🚂 CI Setup
uses: ./.github/actions/ci-setup
- name: Semantic release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: yarn semantic-release
45 changes: 45 additions & 0 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Update dependencies

on:
workflow_dispatch:
schedule:
- cron: '0 0 */7 * *'

jobs:
update:
strategy:
matrix:
node-version: [18.x]

name: Update all dependencies
runs-on: ubuntu-latest
if: ${{ github.repository == 'imbhargav5/nextbase-nextjs13-supabase-starter'}}
steps:
- name: 'Check if user has write access'
uses: 'lannonbr/[email protected]'
with:
permission: 'write'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: github.event_name == 'pull_request'
name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
persist-credentials: false
- if: github.event_name != 'pull_request'
name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
persist-credentials: false
- name: 🚂 CI Setup
uses: ./.github/actions/ci-setup
- run: yarn npm-check-updates -u # Update dependencies
- run: rm -Rf node_modules yarn.lock
- run: yarn
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: 'build: update dependencies to the latest version'
title: Update dependencies to the latest version
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.env.local
node_modules
tsconfig.tsbuildinfo
supabase/.temp/project-ref
.DS_Store

# next.js
/.next
/out

# next-sitemap
public/robots.txt
public/sitemap.xml
public/sitemap-*.xml

# debug
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*

*.tsbuildinfo
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

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

# Disable concurent to run `check-types` after ESLint in lint-staged
npx lint-staged --concurrent false
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/app/*.css
src/lib/database.types.ts
30 changes: 30 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"eslint.workingDirectories": ["./"],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.codeActionsOnSave.rules": ["!@typescript-eslint/*", "*"],
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.packageManager": "yarn",
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/node_modules": false
},
"typescript.enablePromptUseWorkspaceTsdk": true,
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"cSpell.words": ["Reflio", "signup"]
}
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## [1.0.3](https://github.com/imbhargav5/nextbase-nextjs13-supabase-starter/compare/v1.0.2...v1.0.3) (2023-02-26)


### Bug Fixes

* **upgrade:** upgrade to next 13.2 ([7ac20ea](https://github.com/imbhargav5/nextbase-nextjs13-supabase-starter/commit/7ac20ea9926645d85120f19c81aeb8184f25fe97))

## [1.0.2](https://github.com/imbhargav5/nextbase-nextjs13-supabase-starter/compare/v1.0.1...v1.0.2) (2023-02-14)


### Bug Fixes

* **tailwindcss:** production build ([5872cf3](https://github.com/imbhargav5/nextbase-nextjs13-supabase-starter/commit/5872cf38a4d704ecf319d0d12c4ca211e2dc17b4))

## [1.0.1](https://github.com/imbhargav5/nextbase-nextjs13-supabase-starter/compare/v1.0.0...v1.0.1) (2023-02-08)


### Bug Fixes

* **react-no-ssr:** remove react no ssr ([0030eaa](https://github.com/imbhargav5/nextbase-nextjs13-supabase-starter/commit/0030eaab147b3f4184c42dca160d8030bb944cfe))

# 1.0.0 (2023-02-08)


### Features

* **items:** ability to view and add items ([9610939](https://github.com/imbhargav5/nextbase-nextjs13-supabase-starter/commit/9610939028ecd510757c3d89ab2124c3d452bb64))
Loading

0 comments on commit 6a88d49

Please sign in to comment.