Skip to content

Commit

Permalink
Chore: Update Dependencies, Linting, and TypeScript (#296)
Browse files Browse the repository at this point in the history
* Use PNPM

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Prettier ignore PNPM lockfile

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* PNPM save TypeScript to dev

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Finish changing NPM to pnpm

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Use new Renovate config

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Use specific Node version

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Update deps and add Vitest

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Start configuring vitest

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Continue configuring vitest

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* More Vitest configuration

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Update lint deps and remove Jest

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Remove old file from tsconfig

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Remove old file from TS4 tsconfig

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Update ESLint and use tsup

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Automatic lint fixes

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Fix projectService

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Manual lint fixes

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Exclude renamed internal type from typedoc

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Widen supported TypeScript versions

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Use Codecov token in CI

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

* Add ESLint JS config

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>

---------

Signed-off-by: Collin Bachman <3395010+bachmacintosh@users.noreply.github.com>
  • Loading branch information
bachmacintosh authored Aug 13, 2024
1 parent f551674 commit 69406f2
Show file tree
Hide file tree
Showing 34 changed files with 3,162 additions and 11,785 deletions.
519 changes: 0 additions & 519 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>bachmacintosh/renovate-config:jslib"]
"extends": ["github>bachman-dev/renovate-config:jslib"]
}
57 changes: 31 additions & 26 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,66 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install Dependencies
run: npm ci
run: pnpm install
- name: Lint Code
run: npm run lint
run: pnpm lint
- name: Run Unit Tests
run: npm test
run: pnpm test
- name: Upload Coverage Reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Build Documentation
run: npm run build:docs
run: pnpm build:docs
- name: Install TypeScript 4.5
run: 'npm install --no-save typescript@"~4.5"'
run: 'pnpm add --save-dev typescript@"~4.5"'
- name: Build Library on TypeScript 4.5
run: npm run build:ts4
run: pnpm build:ts4
- name: Install TypeScript 4.6
run: 'npm install --no-save typescript@"~4.6"'
run: 'pnpm add --save-dev typescript@"~4.6"'
- name: Build Library on TypeScript 4.6
run: npm run build:ts4
run: pnpm build:ts4
- name: Install TypeScript 4.7
run: 'npm install --no-save typescript@"~4.7"'
run: 'pnpm add --save-dev typescript@"~4.7"'
- name: Build Library on TypeScript 4.7
run: npm run build:ts4
run: pnpm build:ts4
- name: Install TypeScript 4.8
run: 'npm install --no-save typescript@"~4.8"'
run: 'pnpm add --save-dev typescript@"~4.8"'
- name: Build Library on TypeScript 4.8
run: npm run build:ts4
run: pnpm build:ts4
- name: Install TypeScript 4.9
run: 'npm install --no-save typescript@"~4.9"'
run: 'pnpm add --save-dev typescript@"~4.9"'
- name: Build Library on TypeScript 4.9
run: npm run build:ts4
run: pnpm build:ts4
- name: Install TypeScript 5.0
run: 'npm install --no-save typescript@"~5.0"'
run: 'pnpm add --save-dev typescript@"~5.0"'
- name: Build Library on TypeScript 5.0
run: npm run build
run: pnpm build
- name: Install TypeScript 5.1
run: 'npm install --no-save typescript@"~5.1"'
run: 'pnpm add --save-dev typescript@"~5.1"'
- name: Build Library on TypeScript 5.1
run: npm run build
run: pnpm build
- name: Install TypeScript 5.2
run: 'npm install --no-save typescript@"~5.2"'
run: 'pnpm add --save-dev typescript@"~5.2"'
- name: Build Library on TypeScript 5.2
run: npm run build
run: pnpm build
- name: Install TypeScript 5.3
run: 'npm install --no-save typescript@"~5.3"'
run: 'pnpm add --save-dev typescript@"~5.3"'
- name: Build Library on TypeScript 5.3
run: npm run build
run: pnpm build
- name: Install TypeScript 5.4
run: 'npm install --no-save typescript@"~5.4"'
run: 'pnpm add --save-dev typescript@"~5.4"'
- name: Build Library on TypeScript 5.4
run: npm run build
run: pnpm build
- name: Install TypeScript 5.5
run: 'npm install --no-save typescript@"~5.5"'
run: 'pnpm add --save-dev typescript@"~5.5"'
- name: Build Library on TypeScript 5.5
run: npm run build
run: pnpm build
15 changes: 10 additions & 5 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,24 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install Dependencies
run: npm ci
run: pnpm install
- name: Lint Code
run: npm run lint
run: pnpm lint
- name: Run Unit Tests
run: npm test
run: pnpm test
- name: Upload Coverage Reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Build Documentation
run: npm run build:docs
run: pnpm build:docs
- name: Build Library
run: npm run build
run: pnpm build
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ jobs:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
registry-url: "https://registry.npmjs.org"
- name: Install Latest NPM Version
run: npm install -g npm@latest
- name: Install Dependencies
run: npm ci
run: pnpm install
- name: Lint Code
run: npm run lint
run: pnpm lint
- name: Run Unit Tests
run: npm test
run: pnpm test
- name: Build Documentation
run: npm run build:docs
run: pnpm build:docs
- name: Build Library
run: npm run build
run: pnpm build
- name: Publish Library
run: npm publish --provenance
run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Publish Documentation
run: "curl -X POST ${{ secrets.VERCEL_DEPLOY_HOOK }}"
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
20.16.0
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ coverage

# Generated data
dist/
docs/
docs/

# Lockfile
pnpm-lock.yaml
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 120,
"semi": true,
"singleAttributePerLine": true,
"singleQuote": false,
"trailingComma": "all"
}
15 changes: 0 additions & 15 deletions .prettierrc.cjs

This file was deleted.

32 changes: 32 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import bachmanDev from "@bachman-dev/eslint-config";
import eslint from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";

export default tseslint.config(
{
// Replace output folder if needed, e.g. "dist"
ignores: ["{coverage,docs,dist,tests}/**"],
},
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
bachmanDev({ language: "typescript" }),
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ["**/*.js"],
...tseslint.configs.disableTypeChecked,
},
{
files: ["**/*.js"],
...bachmanDev({ language: "javascript-in-typescript" }),
},
eslintConfigPrettier,
);
22 changes: 0 additions & 22 deletions jest.config.cjs

This file was deleted.

Loading

0 comments on commit 69406f2

Please sign in to comment.