Skip to content

Commit

Permalink
build(typescript): set up
Browse files Browse the repository at this point in the history
set up typescript toolchain to target Node@18

fix #3
  • Loading branch information
Nargonath committed Oct 20, 2023
1 parent 2fce43c commit a9fafd8
Show file tree
Hide file tree
Showing 11 changed files with 1,142 additions and 87 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tests/**
dist/**
18 changes: 18 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
sourceType: "module",
},
plugins: ["@typescript-eslint/eslint-plugin"],
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
root: true,
env: {
node: true,
jest: true,
},
};
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "lts/*"
cache: "npm"
- name: Install dependencies
run: npm clean-install
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,24 @@ name: Test
on: [pull_request]

jobs:
deps-setup:
runs-on: ubuntu-22.04
steps:
- name: Fetch codebase
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "npm"
- name: Install dependencies
run: npm ci

commitlint:
runs-on: ubuntu-22.04
needs: deps-setup
steps:
- name: Fetch codebase
uses: actions/checkout@v3
Expand All @@ -14,7 +30,26 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Validate PR commits with commitlint
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

test:
runs-on: ubuntu-22.04
needs: deps-setup
steps:
- name: Fetch codebase
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const test = "i am a test";
Loading

0 comments on commit a9fafd8

Please sign in to comment.