Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
iokk3732 authored Dec 16, 2024
0 parents commit 4516282
Show file tree
Hide file tree
Showing 54 changed files with 11,348 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 16.x

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
11 changes: 11 additions & 0 deletions .github/workflows/update-license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Update License

on:
workflow_dispatch:
schedule:
# Update the license once a year on January 1
- cron: "0 0 1 1 *"

jobs:
update-license:
uses: agustinusnathaniel/workflows/.github/workflows/update-license.yml@main
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
node_modules
.DS_Store
dist
build
dist-ssr
*.local

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

# TS
*.tsbuildinfo

# Turbo
.turbo

.vscode/settings.json

stats.*

# Test
coverage/

# ESLint
.eslintcache

# React Router
.react-router
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm check:turbo
5 changes: 5 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
"biome check --write --no-errors-on-unmatched"
]
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.11.0
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"biomejs.biome",
"dsznajder.es7-react-js-snippets",
"mhutchie.git-graph",
"oderwat.indent-rainbow",
"yoavbls.pretty-ts-errors"
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.importModuleSpecifier": "non-relative",
"editor.defaultFormatter": "biomejs.biome"
}
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) 2024 Agustinus Nathaniel

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.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<img src="https://og.sznm.dev/api/generate?heading=vite-react-chakra-starter&text=React+vite+template+with+Chakra-UI+and+TypeScript+setup.&template=color&center=true&height=330" />

This is a project bootstrapped with [`@vitejs/app`](https://vitejs.dev/guide/#scaffolding-your-first-vite-project) (`react-ts`), added with [Chakra UI](https://chakra-ui.com) and [TypeScript](https://www.typescriptlang.org) setup.

- ⚡ blazing fast dev server and build
- 🔗 route management added (`react-router` v7 - Framework configuration)

[**Live Demo**](https://vite-react-chakra-starter.sznm.dev/)

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/git?s=https://github.com/agustinusnathaniel/vite-react-chakra-starter) [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/agustinusnathaniel/vite-react-chakra-starter)

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/agustinusnathaniel/vite-react-chakra-starter)

## Getting Started

You can either click [`Use this template`](https://github.com/agustinusnathaniel/vite-react-chakra-starter/generate) button on this repository and clone the repo or use npx degit like so:

```bash
npx degit agustinusnathaniel/vite-react-chakra-starter <app_name>
```

Then, run the development server:

```bash
pnpm dev
```

## Deployment

- build command: `pnpm build`
- output directory: `build/client`

## References

- [vite](https://vitejs.dev)
- [avoid manual import](https://vitejs.dev/guide/features.html#jsx)
- [Chakra UI](https://chakra-ui.com/)
- [TypeScript](https://www.typescriptlang.org)
83 changes: 83 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.1/schema.json",
"files": {
"include": ["src", "*.config.ts"],
"ignore": [".react-router"]
},
"organizeImports": {
"enabled": true
},
"formatter": {
"indentStyle": "space"
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"a11y": {
"useSemanticElements": "error"
},
"complexity": {
"noExcessiveCognitiveComplexity": "error",
"noUselessStringConcat": "error",
"noUselessUndefinedInitialization": "error",
"useSimplifiedLogicExpression": "error",
"noVoid": "warn"
},
"correctness": {
"noUnusedImports": "error",
"noUnusedVariables": "error",
"noUnusedFunctionParameters": "error",
"useHookAtTopLevel": "error"
},
"nursery": {
"noDuplicateElseIf": "error"
},
"performance": {
"noBarrelFile": "error",
"useTopLevelRegex": "error"
},
"style": {
"noDefaultExport": "error",
"useBlockStatements": "error",
"useCollapsedElseIf": "error",
"useDefaultSwitchClause": "error",
"useConsistentArrayType": {
"level": "error",
"options": {
"syntax": "generic"
}
},
"useFilenamingConvention": {
"level": "error",
"options": {
"filenameCases": ["kebab-case"]
}
}
},
"suspicious": {
"noConsole": "error",
"noConsoleLog": "error",
"noEmptyBlockStatements": "error",
"useAwait": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
},
"overrides": [
{
"include": ["src/lib/pages/**/*", "*.ts"],
"linter": {
"rules": {
"style": {
"noDefaultExport": "off"
}
}
}
}
]
}
10 changes: 10 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { RuleConfigSeverity, type UserConfig } from '@commitlint/types';

const commitlintConfiguration: UserConfig = {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-case': [RuleConfigSeverity.Error, 'always', 'kebab-case'],
},
};

export default commitlintConfiguration;
10 changes: 10 additions & 0 deletions knip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { KnipConfig } from 'knip';

const config: KnipConfig = {
entry: ['src/root.tsx'],
project: ['src/**/*.{ts,tsx,js,jsx,css,scss}'],
ignoreBinaries: ['changelogithub'],
ignoreDependencies: ['@react-router/node', 'isbot']
};

export default config;
11 changes: 11 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[[redirects]]
from="/*"
to="/index.html"
status=200

[build]
command = 'pnpm build'
publish = 'build/client/'

[build.environment]
NODE_VERSION="20"
70 changes: 70 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "vite-react-chakra-starter",
"version": "0.1.0",
"private": true,
"author": "agustinusnathaniel",
"type": "module",
"engines": {
"node": ">=22.11.x",
"pnpm": ">=9"
},
"packageManager": "[email protected]",
"scripts": {
"dev": "react-router dev",
"build": "react-router build",
"serve": "vite preview",
"biome:check": "biome check",
"biome:fix": "pnpm biome:check --write",
"biome:ci": "biome ci",
"turbo": "pnpm dlx [email protected]",
"type:check": "react-router typegen && tsc",
"test": "vitest run",
"test:ui": "vitest --ui --coverage",
"test:coverage": "vitest --coverage run",
"check:turbo": "pnpm turbo biome:check type:check test",
"knip": "knip",
"up-interactive": "pnpm up -i",
"up-latest": "pnpm up-interactive -L",
"release": "cross-env HUSKY=0 commit-and-tag-version",
"push-release": "git push --follow-tags origin main",
"prepare": "husky"
},
"dependencies": {
"@chakra-ui/react": "^3.2.2",
"@emotion/react": "^11.13.5",
"@fontsource-variable/plus-jakarta-sans": "^5.1.0",
"@react-router/node": "^7.0.2",
"isbot": "^5",
"next-themes": "^0.4.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet-async": "^2.0.5",
"react-icons": "^5.4.0",
"react-router": "^7.0.2"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@chakra-ui/cli": "^3.2.2",
"@commitlint/cli": "^19.6.0",
"@commitlint/config-conventional": "^19.6.0",
"@commitlint/types": "^19.5.0",
"@react-router/dev": "^7.0.2",
"@types/node": "^22.10.1",
"@types/react": "18.3.12",
"@types/react-dom": "^18.3.1",
"@vitest/coverage-v8": "^2.1.8",
"@vitest/ui": "^2.1.8",
"commit-and-tag-version": "^12.5.0",
"cross-env": "^7.0.3",
"husky": "^9.1.7",
"knip": "^5.39.1",
"lint-staged": "^15.2.10",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "5.7.2",
"vite": "^6.0.2",
"vite-plugin-checker": "^0.8.0",
"vite-plugin-pwa": "^0.21.1",
"vite-tsconfig-paths": "^5.1.3",
"vitest": "^2.1.8"
}
}
Loading

0 comments on commit 4516282

Please sign in to comment.