Skip to content

Commit

Permalink
init empty project
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanhofer committed Oct 13, 2022
0 parents commit 3f66c5c
Show file tree
Hide file tree
Showing 23 changed files with 3,135 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
23 changes: 23 additions & 0 deletions .dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://plugins.dprint.dev/dprint/dprint-plugin-json/latest/schema.json",
"lineWidth": 120,
"useTabs": true,
"indentWidth": 3,
"typescript": {
"quoteStyle": "preferSingle",
"quoteProps": "asNeeded",
"semiColons": "asi"
},
"plugins": [
"https://plugins.dprint.dev/typescript-0.74.0.wasm",
"https://plugins.dprint.dev/json-0.15.6.wasm",
"https://plugins.dprint.dev/markdown-0.14.1.wasm",
"https://plugins.dprint.dev/dockerfile-0.3.0.wasm"
],
"includes": [
"**/*"
],
"excludes": [
"out"
]
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
out
73 changes: 73 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// @ts-check

/** @type { import('eslint').Linter.Config } */
const config = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'xo'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['*.ts', '*.mts', '*.cts', '*.tsx'],
rules: {
'no-undef': 'off',
},
},
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: [
'./tsconfig.json',
'./tsconfig.eslint.json',
],
},
rules: {
// deactivate defaults
'capitalized-comments': 'off',
'comma-spacing': 'off',
'no-implicit-coercion': 'off',
camelcase: 'off',
'no-redeclare': 'off',
'no-undef': 'off',

// modify defaults
'no-multi-spaces': 'warn',
'no-trailing-spaces': 'warn',
'no-multiple-empty-lines': 'warn',
'no-mixed-spaces-and-tabs': 'warn',
'object-shorthand': 'warn',
'space-in-parens': 'warn',
'comma-dangle': 'warn',
'key-spacing': 'warn',
'padded-blocks': 'warn',

// TypeScript overrides
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'warn',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-redeclare': 'error',
'no-return-assign': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': 'error',

// modify rules
'no-var': 'error',
'no-console': ['error'],
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
semi: ['error', 'never'],
indent: ['off', 'tab'],
'object-curly-spacing': ['warn', 'always'],
curly: ['warn', 'multi-line'],
'no-unused-expressions': ['warn', { allowShortCircuit: true }],
'@typescript-eslint/no-empty-function': ['warn'],
},
}

module.exports = config
33 changes: 33 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: run linters

on:
pull_request:
branches:
- 'main'
push:
branches:
- 'main'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2

- name: setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7.13.4

- name: install node
uses: actions/setup-node@v2
with:
node-version: 16.17.0
cache: 'pnpm'

- name: install dependencies
run: pnpm install --no-save

- name: run linters
run: pnpm lint
19 changes: 19 additions & 0 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: check PR title

on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened

jobs:
check-pr-title:
runs-on: ubuntu-latest
steps:
- name: check PR title
uses: deepakputhraya/action-pr-title@master
with:
regex: '^(chore|fix)|(#\d+): '
prefix_case_sensitive: true
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2

- name: setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7.13.4

- name: install node
uses: actions/setup-node@v2
with:
node-version: 16.17.0
cache: 'pnpm'

- name: install dependencies
run: pnpm install --no-save

- name: create Release PR or publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: run tests

on:
pull_request:
branches:
- 'main'
push:
branches:
- 'main'

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: checkout repository
uses: actions/checkout@v2

- name: setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7.13.4

- name: install node
uses: actions/setup-node@v2
with:
node-version: 16.17.0
cache: 'pnpm'

- name: install dependencies
run: pnpm install --no-save

- name: run tests
run: pnpm test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
out
.eslintcache
4 changes: 4 additions & 0 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm i
4 changes: 4 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm i
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
14 changes: 14 additions & 0 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @ts-check

/** @type { Record<string, string[]> } */
const config = {
'*.{json,md,dockerfile}': [
'pnpm format:fix',
],
'*.{js,cjs,mjs,ts,mts,d.ts}': [
'pnpm format:fix',
'pnpm eslint:fix:base',
],
}

module.exports = config
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"dprint.dprint",
"dbaeumer.vscode-eslint"
]
}
25 changes: 25 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"eslint.validate": [
"typescript",
"javascript"
],
"files.associations": {
"**/tsconfig*.json": "jsonc"
},
"explorer.fileNesting.patterns": {
"package.json": "package-lock.json, yarn.lock, pnpm-lock.yaml, pnpm-workspace.yaml, .npmrc",
"*.ts": "${capture}.test.ts, ${capture}.test.types.ts"
},
"explorer.fileNesting.enabled": true,
"editor.wordWrapColumn": 120,
"editor.wordWrap": "bounded",
"search.exclude": {
"**/out": true
},
"typescript.tsdk": "node_modules/typescript/lib"
}
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"path": "./",
"problemMatcher": [],
"label": "pnpm: dev",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# exceptionally

**A fully type-safe and lightweight way of using exceptions instead of throwing errors**
55 changes: 55 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "exceptionally",
"version": "0.0.0",
"description": "A fully type-safe and lightweight way of using exceptions instead of throwing errors",
"scripts": {
"---- DEV -----------------------------------------------------------------------------": "",
"dev": "echo hi",
"---- BUILD ---------------------------------------------------------------------------": "",
"build": "tsc",
"release": "pnpm build && changeset publish",
"---- TEST ----------------------------------------------------------------------------": "",
"test": "tsc --noEmit",
"---- LINT ----------------------------------------------------------------------------": "",
"lint": "pnpm format && pnpm eslint",
"lint:fix": "pnpm format:fix && pnpm eslint:fix",
"eslint:base": "eslint --cache",
"eslint": "pnpm eslint:base .",
"eslint:fix:base": "pnpm eslint:base --fix",
"eslint:fix": "pnpm eslint:fix:base .",
"format": "dprint check",
"format:fix": "dprint fmt",
"---- OTHER ---------------------------------------------------------------------------": "",
"prepare": "husky install",
"---- SHORTCUTS -----------------------------------------------------------------------": "",
"changeset": "changeset",
"changeset:apply": "changeset version",
"lint-staged": "lint-staged"
},
"dependencies": {},
"devDependencies": {
"@changesets/cli": "^2.25.0",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"dprint": "^0.32.1",
"eslint": "^8.25.0",
"eslint-config-xo": "^0.42.0",
"eslint-config-xo-typescript": "^0.53.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"typescript": "^4.8.4"
},
"type": "module",
"author": "ivanhofer",
"keywords": [],
"license": "MIT",
"homepage": "https://github.com/ivanhofer/exceptionally#readme",
"repository": {
"type": "git",
"url": "https://github.com/ivanhofer/exceptionally"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ivanhofer"
}
}
Loading

0 comments on commit 3f66c5c

Please sign in to comment.