Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template updates #2

Merged
merged 11 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .env.example

This file was deleted.

3 changes: 3 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# create local copy of this file and rename to .env.local
# make sure to add .env.local to .gitignore!!
MONGO_URI={mongo-uri-here}
7 changes: 6 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"extends": ["next/core-web-vitals", "prettier"]
"parser": "@typescript-eslint/parser",
"extends": ["next/core-web-vitals", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error"
}
}
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci

# Controls when the workflow will run
on:
push:
branches: ["main", "develop"]
pull_request:
branches: ["main", "develop"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Use matrix strategy to test multiple Node.js versions
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Dry-run build
run: npm run build
env:
# These env variables must be set in the repository's secrets
# - Settings -> Secrets and variables -> New repository secret
MONGO_URI: ${{ secrets.MONGO_URI }}
# Add additional environment variables here

- name: Run tests
run: npm test
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{js,jsx,ts,tsx}": "eslint --fix",
"*.{js,jsx,ts,tsx,css,md,json}": "prettier --write"
}
6 changes: 5 additions & 1 deletion docs/template-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ This template uses Next.js version 14.0.0. The following lists what is configure
6. Import aliasing. See paths in `tsconfig.json` for predefined aliases
7. Template documentation to fill in
8. Two branches called `develop` and `main` (if you selected copy branches when creating from template)
9. Issue and Pull Request templates. Modify them in the `.github` folder
10. Some common GitHub tags
11. Pre-commit linting hook with Husky and lint-staged
12. Continuous integration with GitHub Actions

Last updated 10/27/23
Last updated 10/17/2024
Loading