From bd572ec79291ee61c02ac950792aa3b15a66ebcc Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Fri, 14 Apr 2023 20:13:03 +0100 Subject: [PATCH] refactor: update docs and linting CI --- .eslintrc.json | 1 + .github/workflows/docs.yml | 39 +++++++++++++++++++-------------- .github/workflows/lint.yml | 37 +++++++++++++++++++++++++++++++ .github/workflows/typecheck.yml | 24 -------------------- package.json | 7 +++++- 5 files changed, 66 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/typecheck.yml diff --git a/.eslintrc.json b/.eslintrc.json index 9283ee17..286cbf33 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,4 +1,5 @@ { + "root": true, "parser": "@typescript-eslint/parser", "plugins": ["solid", "spellcheck"], "extends": [ diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ff69d104..4b6b7709 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,27 +2,32 @@ name: Publish Documentation on: push: - branches: [ master ] + branches: [master] jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout repository and submodules + uses: actions/checkout@v3 + with: + submodules: recursive + - uses: pnpm/action-setup@v2.2.4 + with: + version: 7 + - name: Use Node.js 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "pnpm" + - name: Install packages + run: pnpm install - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: 16 + - name: Build + run: pnpm run docs - - name: Install dependencies - run: yarn install - - - name: Build - run: yarn run docs - - - name: Deploy - uses: JamesIves/github-pages-deploy-action@4.1.5 - with: - branch: docs - folder: docs + - name: Deploy + uses: JamesIves/github-pages-deploy-action@4.1.5 + with: + branch: docs + folder: docs diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..6c4c980a --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,37 @@ +name: Lint + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x, 18.x] + + steps: + - name: Checkout repository and submodules + uses: actions/checkout@v3 + with: + submodules: recursive + - uses: pnpm/action-setup@v2.2.4 + with: + version: 7 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + - name: Install packages + run: pnpm install + + - name: Typecheck + run: pnpm typecheck + - name: Code Formatting + run: pnpm fmt:check + - name: Lint + run: pnpm lint diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml deleted file mode 100644 index 8b1ff4b4..00000000 --- a/.github/workflows/typecheck.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Typecheck - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x, 14.x, 16.x, 18.x] - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: 'yarn' - - run: yarn install - - run: yarn run typecheck diff --git a/package.json b/package.json index 4943a452..09dcc3e4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,11 @@ "build": "tsc", "build:watch": "tsc-watch --onSuccess \"node .\"", "lint": "eslint --ext .ts,.tsx src/", - "lint:fix": "eslint --fix --ext .ts,.tsx src/" + "lint:fix": "eslint --fix --ext .ts,.tsx src/", + "typecheck": "tsc --noEmit", + "docs": "typedoc --readme README.md src/", + "fmt": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'", + "fmt:check": "prettier --check 'src/**/*.{js,jsx,ts,tsx}'" }, "files": [ "README.md", @@ -27,6 +31,7 @@ "long": "^5.2.1", "revolt-api": "^0.5.17", "solid-js": "^1.7.2", + "typedoc": "^0.24.1", "ulid": "^2.3.0", "ws": "^8.13.0" },