Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Apr 17, 2024
0 parents commit 9fedea8
Show file tree
Hide file tree
Showing 17 changed files with 2,279 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"env": {
"es2022": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"no-useless-escape": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"no-mixed-spaces-and-tabs": "warn",
"no-unreachable": "warn",
"no-extra-semi": "warn",
"@typescript-eslint/no-extra-semi": "warn",
"no-fallthrough": "warn",
"no-empty": "warn",
"@typescript-eslint/no-empty-function": "warn",
"no-case-declarations": "warn",
"prefer-const": "warn",
"@typescript-eslint/adjacent-overload-signatures": "warn",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": "warn"
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
81 changes: 81 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Continuous Integration

on:
push:
branches:
- main
workflow_dispatch:
workflow_call:
pull_request:

jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: ${{ matrix.os }}
permissions:
contents: read
id-token: write
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Formatting
run: npm run format:check

- name: Linting
run: npm run lint

- name: Unit tests
run: npm run test

- name: Build
run: npm run build
docs:
needs: ci
runs-on: ubuntu-latest
name: Docs build and deploy
permissions:
contents: write
id-token: write
pages: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Build docs
run: npm run build:docs

- name: Upload docs artifact
uses: actions/upload-pages-artifact@v3
if: github.event_name != 'pull_request'
with:
path: ./docs
- name: 'Deploy docs'
id: deploy
if: github.event_name != 'pull_request'
uses: actions/deploy-pages@v4
35 changes: 35 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
release:
types: [created]

jobs:
ci:
uses: ./.github/workflows/ci.yaml
permissions:
contents: write
id-token: write
pages: write
release:
runs-on: ubuntu-latest
needs: ci
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup npm authenication
uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Publish
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
docs
tmp
temp
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!src/**/*
!dist/**/*
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"useTabs": true,
"trailingComma": "es5",
"tabWidth": 4,
"printWidth": 180,
"arrowParens": "avoid"
}
Loading

0 comments on commit 9fedea8

Please sign in to comment.