Skip to content

Commit

Permalink
chore: 🤖 add boilerplate from ts-starter
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-guzman committed Apr 6, 2024
1 parent 8a307fb commit 3b9bacb
Show file tree
Hide file tree
Showing 24 changed files with 6,205 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "@commitlint/config-conventional",
"rules": { "header-max-length": [2, "always", 64] }
}
6 changes: 6 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["jimmy-guzman", "jimmy-guzman/typescript", "jimmy-guzman/vitest"],
"parserOptions": {
"project": ["./tsconfig.json"]
}
}
21 changes: 21 additions & 0 deletions .github/actions/check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check
description: Check everything

runs:
using: composite
steps:
- name: 🚨 Lint
shell: bash
run: pnpm lint

- name: 🎨 Format
shell: bash
run: pnpm format

- name: 🏷️ Type Check
shell: bash
run: pnpm typecheck

- name: ✅ Coverage
shell: bash
run: pnpm coverage
39 changes: 39 additions & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Install
description: Install everything for the repo

inputs:
node-version:
description: Version of Node to use
default: 20.x

runs:
using: composite
steps:
- name: 🏗 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- name: 🏗 Setup pnpm
uses: pnpm/action-setup@v3
with:
run_install: false

- name: 🗃️ Get pnpm Store Directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: 🏗 Setup Cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-${{ inputs.node-version }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ inputs.node-version }}-pnpm-store-
${{ runner.os }}-pnpm-store-
- name: 📦 Install Deps
run: pnpm install
shell: bash
11 changes: 11 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"semanticCommits": "enabled",
"reviewers": ["@jimmy-guzman"],
"commitMessageAction": "bump",
"commitMessagePrefix": "chore: 🤖 ",
"commitMessageTopic": "`{{depName}}`",
"labels": ["scope:deps", "type:chore"],
"schedule": ["every weekend"]
}
30 changes: 30 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: cd

on:
push:
branches: [main]

permissions:
contents: write

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: 🏗 Setup Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 📦 Install
uses: ./.github/actions/install

- name: 🦺 Check
uses: ./.github/actions/check

- name: 🚀 Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm exec semantic-release --branches main --dry-run
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: ci

on: [pull_request]

jobs:
code_check:
runs-on: ubuntu-latest
strategy:
matrix:
node: ["20"]

steps:
- name: 🏗 Setup Repository
uses: actions/checkout@v4

- name: 📦 Install
uses: ./.github/actions/install
with:
node-version: ${{ matrix.node }}

- name: 🦺 Check
uses: ./.github/actions/check

- name: 🔧 Build
run: pnpm build

commit_check:
runs-on: ubuntu-latest

permissions:
contents: read
pull-requests: read

steps:
- name: 🏗 Setup Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🚨 Commitlint
uses: wagoid/commitlint-github-action@v6
with:
configFile: .commitlintrc.json

spell_check:
runs-on: ubuntu-latest

steps:
- name: 🏗 Setup Repository
uses: actions/checkout@v4

- name: 🚨 Spellcheck
uses: streetsidesoftware/cspell-action@v6
with:
inline: error
25 changes: 25 additions & 0 deletions .lefthook.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://json.schemastore.org/lefthook.json",
"pre-commit": {
"parallel": true,
"commands": {
"lint": {
"glob": "*.ts",
"run": "pnpm exec eslint --fix {staged_files}",
"stage_fixed": true
},
"format": {
"glob": "*.{md,json,yml,ts}",
"run": "pnpm exec prettier --write {staged_files}",
"stage_fixed": true
}
}
},
"commit-msg": {
"commands": {
"commitlint": {
"run": "pnpm exec commitlint --edit {1}"
}
}
}
}
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
save-prefix=''
engine-strict=true
auto-install-peers=false
color=always
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.12.1
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CHANGELOG.md

16 changes: 16 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": ["package.json", "README.md", "CHANGELOG.md"],
"message": "chore: 🤖 release v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"streetsidesoftware.code-spell-checker",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Getting Started

Clone the repo, by running the following:

```bash
gh repo clone jimmy-guzman/eslint-config
```

Use latest version of node, by running the following:

```bash
nvm use
```

Enable `corepack`, by running the following:

```bash
corepack enable
```

Install dependencies, by running the following:

```bash
pnpm install
```
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Jimmy Guzman
Copyright (c) 2024 @jimmy.codes/eslint-config

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# eslint-config
# @jimmy.codes/eslint-config

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/jimmy-guzman/eslint-config/cd.yml?style=flat-square&logo=github-actions)
[![version](https://img.shields.io/npm/v/@jimmy.codes/eslint-config.svg?logo=npm&style=flat-square)](https://www.npmjs.com/package/@jimmy.codes/eslint-config)
[![downloads](https://img.shields.io/npm/dm/@jimmy.codes/eslint-config.svg?logo=npm&style=flat-square)](http://www.npmtrends.com/@jimmy.codes/eslint-config)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://semantic-release.gitbook.io/semantic-release)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square&logo=prettier)](https://github.com/prettier/prettier)

> 🔍 my personal [eslint](https://eslint.org/) config
## 🛠️ Usage

```
pnpm add -D @jimmy.codes/eslint-config
```
39 changes: 39 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"version": "0.2",
"words": [
"cicd",
"commitlint",
"commitlintrc",
"corepack",
"dbaeumer",
"deps",
"esbenp",
"esbuild",
"gitzy",
"gruntfuggly",
"lcov",
"lefthook",
"nvmrc",
"pkgroll",
"pnpm",
"shellcheck",
"streetsidesoftware",
"tiged",
"typecheck",
"vitest",
"wagoid"
],
"ignorePaths": [
"node_modules",
"**/node_modules",
"**/node_modules/**",
"node_modules/**",
"vscode-extension",
".git",
".gitignore",
"*.dll",
"**/*.dll",
"yarn.lock",
"pnpm-lock.yaml"
]
}
Loading

0 comments on commit 3b9bacb

Please sign in to comment.