Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Commit

Permalink
feat: starter for Vite react-ts (#1)
Browse files Browse the repository at this point in the history
* chore: put configurations

* feat: starter for vite react-ts
  • Loading branch information
tenzyu authored Dec 12, 2022
1 parent c759fbe commit 2a2134f
Show file tree
Hide file tree
Showing 14 changed files with 2,612 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"type-enum": [2, "always", ["chore", "feat", "fix"]]
}
}
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Logs
logs
*.log
pnpm-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Plugins
.history
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 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint-staged
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
dist/
pnpm-lock.yaml
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @tenzyu/ks

A Kick-Starter for TypeScript Projects.

## 🚧 This package is still under construction.
3 changes: 3 additions & 0 deletions bin/ks
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env zx

import '../dist/index.js'
26 changes: 26 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { build } from 'esbuild'

////////////////////////////////////////////////////////////////

const flags = new Set(process.argv.filter((arg) => arg.startsWith('--')))
const isProd = process.env['APP_ENV'] === 'prod'

// https://esbuild.github.io/api/
const options = {
legalComments: 'eof',
drop: isProd ? ['console', 'debugger'] : [],
minify: flags.has('--minify') || isProd,
color: true,
logLevel: 'warning',

/* Build Options */
bundle: true,
outfile: './dist/index.js',
entryPoints: ['./src/index.ts'],
watch: flags.has('--watch'),
platform: 'node',
target: 'es2022',
format: 'esm',
}

build(options).catch(() => process.exit(1))
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "ks",
"version": "0.1.0",
"description": "A kick-starter for the Typescript projects.",
"repository": "github:tenzyu/ks",
"license": "MIT",
"author": "Tenzyu Masuda",
"type": "module",
"bin": "./bin/ks",
"scripts": {
"build": "rimraf dist && node build.js --minify"
},
"lint-staged": {
"*": "prettier --write --cache --ignore-unknown",
"!(package).json": "sort-json",
"package.json": "sort-package-json"
},
"files": [
"bin",
"dist"
],
"dependencies": {
"zx": "^7.1.1"
},
"devDependencies": {
"@commitlint/cli": "^17.3.0",
"@commitlint/config-conventional": "^17.3.0",
"@tenzyu/tsconfig": "^0.1.4",
"esbuild": "^0.16.4",
"husky": "^8.0.2",
"lint-staged": "^13.1.0",
"prettier": "^2.8.1",
"rimraf": "^3.0.2",
"sort-package-json": "^2.1.0",
"typescript": "^4.9.4"
}
}
Loading

0 comments on commit 2a2134f

Please sign in to comment.