Skip to content

Commit

Permalink
Merge pull request #3 from Callenowy/init-setup
Browse files Browse the repository at this point in the history
feat: initial setup
  • Loading branch information
Callenowy authored Jan 31, 2024
2 parents 7585568 + 5a83b2d commit 5a9f3de
Show file tree
Hide file tree
Showing 34 changed files with 16,096 additions and 3 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"
]
}
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.next/*
.github/*
.husky/*
.vscode/*
dist/*
public/*
out/*
node_modules/*
.eslintrc.cjs
postcss.*
38 changes: 38 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,

extends: [
'plugin:@typescript-eslint/recommended-type-checked',
'next/core-web-vitals',
],

plugins: ['prettier'],

parserOptions: {
project: true,
},

rules: {
'prettier/prettier': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_'},
],
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-import-type-side-effects': 'error',
},

overrides: [
{
files: [
'**/__test__/**/*.[jt]s?(x)',
'**/?(*.)+test.[jt]s?(x)',
'!**/tests/playwright/**/*.ts',
],
plugins: ['testing-library'],
extends: ['plugin:testing-library/react', 'plugin:jest-dom/recommended'],
},
],
};
45 changes: 45 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Commitlint

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
commitlint:
name: Commitlint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20

- name: Print versions
run: |
git --version
node --version
npm --version
npx commitlint --version
- name: Setup commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run:
npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{
github.event.pull_request.commits }} --to ${{
github.event.pull_request.head.sha }} --verbose
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release
on:
push:
branches:
- main-branch

permissions:
contents: read # for checkout

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm clean-install
- name:
Verify the integrity of provenance attestations and registry
signatures for installed dependencies
run: npm audit signatures
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit \
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
10 changes: 10 additions & 0 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import path from 'node:path';

const buildEslintCommand = filenames =>
`next lint --fix --file ${filenames
.map(f => path.relative(process.cwd(), f))
.join(' --file ')}`;

export default {
'*.{js,jsx,ts,tsx}': [buildEslintCommand],
};
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v21.6.0
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist
public
node_modules
.github
.husky
.vscode
.next
20 changes: 20 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/** @type {import('prettier').Config} */

const config = {
arrowParens: 'avoid',
bracketSpacing: true,
endOfLine: 'lf',
bracketSameLine: false,
jsxSingleQuote: false,
printWidth: 80,
quoteProps: 'as-needed',
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
useTabs: false,

plugins: ['prettier-plugin-tailwindcss'],
};

export default config;
12 changes: 12 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
branches: ["main-branch"],
"plugins":
[
["@semantic-release/npm", { "npmPublish": false }],
"@semantic-release/release-notes-generator",
"@semantic-release/github",
"@semantic-release/commit-analyzer",
"@semantic-release/git",
"@semantic-release/changelog",
],
}
14 changes: 14 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"github.vscode-github-actions",
"esbenp.prettier-vscode",
"snyk-security.snyk-vulnerability-scanner",
"bradlc.vscode-tailwindcss",
"hbenl.vscode-test-explorer",
"ms-vscode.test-adapter-converter",
"ms-playwright.playwright",
"zixuanchen.vitest-explorer",
"ms-azuretools.vscode-docker"
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"editor.wordWrap": "on",
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cn\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
],
"vitest.commandLine": "npx vitest",
"vitest.enable": true,
}
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
# atmosphere
<!-- Improved compatibility of back-to-top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->

<a name="readme-top"></a>

# Next.js + Tailwind - template

## Table of Contents

- [Overview](#overview)
- [Stack](#stack)
- [Version Control and Maintenance](#version-control)
- [License](#license)

## <a name="overview">Overview</a>

This clean Next.js template provides a well-organized structure for setting up a project quickly, including essential configurations and commonly used libraries.

> WIP
## <a name="stack">Stack</a>

- Next.js
- TypeScript
- Tailwind
- CVA - Class Variance Authority
- Vitest
- Testing Library
- ESLint
- Prettier
- Commitlint
- Conventional Commits
- Lint Staged
- Husky
- Semantic Release
- TS Reset
- Renovate

## <a name="version-control">Version Control and Maintenance</a>

This project uses `semantic-release` for version management, ensuring automated versioning and changelog generation. Before committing, we provide code quality by using `lint-staged` and following the `Conventional Commits` standard for commit messages. Renovate helps in keeping dependencies up-to-date.

## <a name="license">License</a>

The Stack App is software licensed under the [MIT license](LICENSE).
9 changes: 9 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('next').NextConfig} */

const nextConfig = {
reactStrictMode: true,
poweredByHeader: false,
output: 'standalone',
};

export default nextConfig;
Loading

0 comments on commit 5a9f3de

Please sign in to comment.