Skip to content

Commit

Permalink
[package] initial commit with config files and folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhyde committed May 23, 2023
0 parents commit ca77625
Show file tree
Hide file tree
Showing 20 changed files with 6,289 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{md,snap}]
trim_trailing_whitespace = false
45 changes: 45 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
parser: '@typescript-eslint/parser'
parserOptions:
project: './tsconfig.json'

ignorePatterns:
- 'build'
- 'vitest.config.ts'

plugins:
- '@typescript-eslint'
- 'prettier'
- 'import'

extends:
- 'eslint:recommended'
- 'plugin:@typescript-eslint/recommended'
- 'plugin:@typescript-eslint/recommended-requiring-type-checking'
- 'plugin:@typescript-eslint/strict'
- 'standard-with-typescript'
- 'plugin:promise/recommended'
- 'plugin:import/recommended'
- 'plugin:import/typescript'
- 'plugin:n/recommended'
- 'plugin:prettier/recommended'
- 'plugin:jsdoc/recommended-typescript-error'
- 'plugin:vitest/all'

settings:
import/resolver:
typescript: true
node: true

rules:
'@typescript-eslint/consistent-type-definitions': ['error', 'type']
'@typescript-eslint/promise-function-async': 'off'
'import/no-default-export': 'error'
'import/no-unresolved': 'error'
# disabled since it's already covered by the 'import/no-unresolved'
'n/no-missing-import': 'off'
'jsdoc/require-returns': 'off'
'jsdoc/require-throws': 'error'
'jsdoc/require-param': ['error', checkDestructured: false]
'jsdoc/check-param-names': ['error', checkDestructured: false]
'jsdoc/tag-lines': ['error', 'any', startLines: 1]
'vitest/no-hooks': ['error', 'allow': ['afterEach']]
19 changes: 19 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"schedule:weekly",
"group:allNonMajor",
":pinAllExceptPeerDependencies",
":semanticCommitTypeAll(package)",
":semanticCommitScopeDisabled"
],
"rebaseWhen": "behind-base-branch",
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch"],
"matchDepTypes": ["devDependencies"],
"automerge": true
}
]
}
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build

on:
push:
paths-ignore:
- 'docs/**'
- '*.md'

jobs:
test:
name: node@${{ matrix.node-version }}
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['16', '18', '20']

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run lint
- run: npm run format:check
- run: npm run test:unit
- run: npm run build
30 changes: 30 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Integration

on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
schedule:
- cron: '0 20 * * *'

jobs:
test:
name: node@${{ matrix.node-version }}
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['16', '18', '20']

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test:integration
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: integration
21 changes: 21 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish
on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Windows
Thumbs.db
Desktop.ini
$RECYCLE.BIN/

## OS X
.DS_Store
.AppleDouble
.LSOverride
Icon
._*
.Spotlight-V100
.Trashes

## Editors and IDE
*.sublime*
*.code-workspace

## Node.js
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
*.swp
pids
logs
results
tmp
node_modules
npm-debug.log

## Build
build

## Coverage reports
coverage

## API keys and secrets
.env
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact=true
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "editorconfig.editorconfig", "esbenp.prettier-vscode"]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnPaste": true,
"editor.formatOnSave": true
}
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Breaking Changes

### Added

### Fixed

### Changed

### Removed
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) 2023 2BAD

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.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Typescript starter
Loading

0 comments on commit ca77625

Please sign in to comment.