Skip to content

Commit a597f4b

Browse files
authored
Initial commit
0 parents  commit a597f4b

27 files changed

+31813
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"image": "mcr.microsoft.com/devcontainers/universal:2",
3+
"features": {
4+
"ghcr.io/dhoeric/features/act:1": {}
5+
},
6+
"customizations": {
7+
"vscode": {
8+
"extensions": [
9+
"cschleiden.vscode-github-actions",
10+
"redhat.vscode-yaml"
11+
]
12+
}
13+
}
14+
}

.eslintrc.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
module.exports = {
2+
extends: [
3+
"eslint:recommended",
4+
"plugin:@typescript-eslint/strict-type-checked", // Enable type checking, max strictness
5+
"plugin:prettier/recommended" // prettier rules
6+
],
7+
8+
parser: "@typescript-eslint/parser",
9+
10+
parserOptions: {
11+
project: true,
12+
tsconfigRootDir: __dirname
13+
},
14+
15+
plugins: ["@typescript-eslint"],
16+
17+
root: true,
18+
19+
ignorePatterns: [
20+
".eslintrc.js",
21+
"*.spec.ts",
22+
"*.test.ts",
23+
"dist/",
24+
"coverage/",
25+
"lib/",
26+
"pnpm-lock.yaml",
27+
".pnpm-store/",
28+
], // ESLINT IGNORE
29+
30+
env: {
31+
// ESLINT ENV
32+
node: true,
33+
jest: true
34+
},
35+
36+
rules: {
37+
"no-else-return": ["error", { allowElseIf: false }],
38+
"consistent-return": "error",
39+
"no-console": "warn",
40+
"@typescript-eslint/typedef": [
41+
"error",
42+
{
43+
variableDeclaration: true,
44+
memberVariableDeclaration: true
45+
}
46+
],
47+
"@typescript-eslint/explicit-module-boundary-types": "error",
48+
"@typescript-eslint/naming-convention": [
49+
"error",
50+
{
51+
selector: "class",
52+
format: ["PascalCase"]
53+
}
54+
],
55+
"@typescript-eslint/prefer-readonly": "error",
56+
"@typescript-eslint/explicit-member-accessibility": [
57+
"error",
58+
{
59+
accessibility: "explicit",
60+
overrides: {
61+
accessors: "explicit",
62+
constructors: "no-public",
63+
methods: "explicit",
64+
properties: "explicit",
65+
parameterProperties: "explicit"
66+
}
67+
}
68+
]
69+
}
70+
};

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/check-dist.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# In TypeScript actions, `dist/` is a special directory. When you reference
2+
# an action with the `uses:` property, `dist/index.js` is the code that will be
3+
# run. For this project, the `dist/index.js` file is transpiled from other
4+
# source files. This workflow ensures the `dist/` directory contains the
5+
# expected transpiled code.
6+
#
7+
# If this workflow is run from a feature branch, it will act as an additional CI
8+
# check and fail if the checked-in `dist/` directory does not match what is
9+
# expected from the build.
10+
name: Check Transpiled JavaScript
11+
12+
on:
13+
pull_request:
14+
branches:
15+
- main
16+
push:
17+
branches:
18+
- main
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
check-dist:
25+
name: Check dist/
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout
30+
id: checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Install pnpm
34+
id: setup-pnpm
35+
uses: pnpm/action-setup@v3
36+
37+
- name: Set node version
38+
id: setup-node
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version-file: .node-version
42+
cache: 'pnpm'
43+
44+
- name: Build dist/ Directory
45+
id: build
46+
run: pnpm run preflight
47+
48+
# This will fail the workflow if the `dist/` directory is different from
49+
# expected.
50+
- name: Compare Directories
51+
id: diff
52+
run: |
53+
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
54+
echo "Detected uncommitted changes after build. See status below:"
55+
git diff --ignore-space-at-eol --text dist/
56+
exit 1
57+
fi
58+
59+
# If `dist/` was different from expected, upload the expected version as a
60+
# workflow artifact.
61+
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
62+
name: Upload Artifact
63+
id: upload
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: dist
67+
path: dist/

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Continuous Integration
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
test-typescript:
17+
name: TypeScript Tests
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout
22+
id: checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Install pnpm
26+
id: setup-pnpm
27+
uses: pnpm/action-setup@v3
28+
29+
- name: Set node version
30+
id: setup-node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version-file: .node-version
34+
cache: 'pnpm'
35+
36+
- name: Install Dependencies
37+
id: install
38+
run: pnpm install
39+
40+
- name: Check Format
41+
id: pnpm-format-check
42+
run: pnpm run format:check
43+
44+
- name: Lint
45+
id: pnpm-lint
46+
run: pnpm run lint
47+
48+
- name: Test
49+
id: pnpm-ci-test
50+
run: pnpm run ci-test
51+
52+
test-action:
53+
runs-on: ubuntu-latest
54+
name: A job to say hello
55+
steps:
56+
# To use this repository's private action,
57+
# you must check out the repository
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
- name: Install pnpm
61+
id: setup-pnpm
62+
uses: pnpm/action-setup@v3
63+
- name: Install dependencies and build
64+
run: pnpm run preflight
65+
- name: Hello world action step
66+
uses: ./ # Uses an action in the root directory
67+
id: hello
68+
with:
69+
who-to-greet: "Mona the Octocat"
70+
# Use the output from the `hello` step
71+
- name: Get the output time
72+
run: echo "The time was ${{ steps.hello.outputs.time }}"

.github/workflows/codeql-analysis.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CodeQL
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: "31 7 * * 3"
12+
13+
permissions:
14+
actions: read
15+
checks: write
16+
contents: read
17+
security-events: write
18+
19+
jobs:
20+
analyze:
21+
name: Analyze
22+
runs-on: ubuntu-latest
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
language:
28+
- TypeScript
29+
30+
steps:
31+
- name: Checkout
32+
id: checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Initialize CodeQL
36+
id: initialize
37+
uses: github/codeql-action/init@v3
38+
with:
39+
languages: ${{ matrix.language }}
40+
source-root: src
41+
42+
- name: Autobuild
43+
id: autobuild
44+
uses: github/codeql-action/autobuild@v3
45+
46+
- name: Perform CodeQL Analysis
47+
id: analyze
48+
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)