Skip to content

Commit 03d9791

Browse files
authored
Initial commit
0 parents  commit 03d9791

37 files changed

+4455
-0
lines changed

.dockerignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Folders
2+
.git
3+
.github
4+
.vscode
5+
dist
6+
docs
7+
node_modules
8+
9+
# Files
10+
.dockerignore
11+
.editorconfig
12+
.eslintignore
13+
.eslintrc.yaml
14+
.gitignore
15+
.prettierignore
16+
.prettierrc.yaml
17+
*.md
18+
*.test.ts
19+
*.tsbuildinfo
20+
*.txt
21+
Dockerfile
22+
tsconfig.eslint.json
23+
typedoc.json

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = tab
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.yaml]
12+
indent_style = space

.env

Whitespace-only changes.

.github/.markdownlint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/DavidAnson/markdownlint/refs/heads/main/schema/markdownlint-config-schema.json
2+
extends: ../.markdownlint.yaml
3+
first-line-heading: false

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @NatoBoram

.github/FUNDING.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
github:
2+
- NatoBoram
3+
patreon: NatoBoram
4+
custom:
5+
- https://paypal.me/NatoBoram/5

.github/copilot-instructions.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- Avoid `else` by using early `return` or new functions.
2+
- Avoid classes unless they implement a shared behaviour or hide a private state.
3+
- Avoid function-wide scopes, particularly `try`/`catch` and `if`. Instead, make a separate function for its inner scope and have its parent handle the conditions and error handlings.
4+
- Avoid nesting by using early `return` or new functions.
5+
- If a block of code is so complex that it has a paragraph to explain it, move it to a separate function.
6+
- If a method does not use `this`, move it outside the class.
7+
- Instead of using `let`, use `const` and make a function that directly gives the correct value.
8+
- Make all interfaces `readonly`.
9+
- Never use `any`.
10+
- Never use `as`.
11+
- Never use `enum`; replace them by objects with a `const` assertion and export its values as a type alias.
12+
- Never use Hungarian notation.
13+
- Never use tuples; replace them by interfaces.
14+
- Prefer passing around the original object such as `Date` and `URL` instead of serializing it.
15+
- Remove comments that are just repeating the next line. The same goes for `@params` and `@returns` in JSDoc.
16+
- When a comment precedes a declaration, turn it to a TSDoc when that makes sense.

.github/dependabot.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
timezone: America/Toronto
8+
commit-message:
9+
prefix: "⬆️ "
10+
groups:
11+
patch:
12+
update-types:
13+
- patch
14+
minor-development:
15+
update-types:
16+
- minor
17+
dependency-type: development
18+
minor-production:
19+
update-types:
20+
- minor
21+
dependency-type: production
22+
eslint:
23+
patterns:
24+
- "*eslint*"
25+
prettier:
26+
patterns:
27+
- "*prettier*"
28+
typescript:
29+
patterns:
30+
- "*typescript*"
31+
- tsx
32+
- typedoc
33+
34+
- package-ecosystem: github-actions
35+
directory: /
36+
schedule:
37+
interval: monthly
38+
timezone: America/Toronto
39+
commit-message:
40+
prefix: "⬆️ "

.github/pull_request_template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Replace this by a short description under 60 characters -->
2+
3+
### 📝 Description
4+
5+
<!-- Why this pull request? -->
6+
7+
<!-- Why is this the best solution? -->
8+
9+
<!-- What you did -->
10+
11+
### 📓 References
12+
13+
<!-- A list of links to discussions, documentation, issues, pull requests -->

.github/workflows/docker.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Docker CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
merge_group:
8+
branches:
9+
- main
10+
push:
11+
branches:
12+
- main
13+
tags:
14+
- v*
15+
16+
jobs:
17+
docker:
18+
runs-on: ubuntu-latest
19+
20+
if: github.actor != 'nektos/act'
21+
22+
permissions:
23+
packages: write
24+
contents: read
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: docker/login-action@v3
30+
if: github.actor != 'dependabot[bot]'
31+
with:
32+
username: ${{ vars.DOCKER_USERNAME }}
33+
password: ${{ secrets.DOCKER_PASSWORD }}
34+
35+
- uses: docker/login-action@v3
36+
if: github.actor != 'dependabot[bot]'
37+
with:
38+
registry: ghcr.io
39+
username: ${{ github.actor }}
40+
password: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- id: meta
43+
uses: docker/metadata-action@v5
44+
with:
45+
images: |
46+
natoboram/gigachad.ts
47+
ghcr.io/${{ github.repository }}
48+
tags: |
49+
type=ref,event=tag
50+
type=semver,pattern={{major}}
51+
type=semver,pattern={{major}}.{{minor}}
52+
type=semver,pattern={{major}}.{{minor}}.{{patch}}
53+
type=semver,pattern={{version}}
54+
55+
- uses: docker/build-push-action@v6
56+
with:
57+
context: .
58+
push: ${{ github.ref_type == 'tag' }}
59+
tags: ${{ steps.meta.outputs.tags }}
60+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/github-pages.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build_pages:
10+
runs-on: ubuntu-latest
11+
12+
if: github.actor != 'nektos/act'
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: pnpm/action-setup@v4
17+
with:
18+
version: latest
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: latest
22+
cache: pnpm
23+
- run: pnpm install
24+
25+
- run: pnpm run docs
26+
- run: pnpm run test:coverage
27+
- run: cp --force --recursive coverage docs/coverage
28+
29+
- uses: actions/upload-pages-artifact@v3
30+
with:
31+
path: docs
32+
33+
deploy_pages:
34+
needs: build_pages
35+
36+
permissions:
37+
pages: write
38+
id-token: write
39+
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- id: deployment
48+
uses: actions/deploy-pages@v4

.github/workflows/node.js.yaml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Node.js CI
2+
3+
on:
4+
merge_group:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
push:
11+
branches:
12+
- main
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: pnpm/action-setup@v4
21+
with:
22+
version: latest
23+
- uses: actions/setup-node@v4
24+
with:
25+
cache: pnpm
26+
node-version: latest
27+
28+
- run: pnpm install --frozen-lockfile --strict-peer-dependencies
29+
- run: pnpm run build --noEmit
30+
- run: pnpm run lint
31+
- run: pnpm run test
32+
- run: pnpm run test:coverage
33+
34+
- uses: actions/upload-artifact@v4
35+
if: github.actor != 'dependabot[bot]' && github.actor != 'nektos/act'
36+
with:
37+
name: coverage
38+
path: coverage
39+
if-no-files-found: error
40+
41+
fix:
42+
runs-on: ubuntu-latest
43+
44+
permissions:
45+
contents: write
46+
47+
needs:
48+
- test
49+
50+
if: failure() && github.event_name != 'merge_group' && github.actor != 'github-actions[bot]' && github.actor != 'nektos/act'
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
with:
55+
ref: ${{ github.ref }}
56+
- uses: pnpm/action-setup@v4
57+
with:
58+
version: latest
59+
- uses: actions/setup-node@v4
60+
with:
61+
cache: pnpm
62+
node-version: latest
63+
64+
- run: |
65+
pnpm install --fix-lockfile --no-frozen-lockfile
66+
git add .
67+
- id: commit-lockfile
68+
uses: qoomon/actions--create-commit@v1
69+
with:
70+
message: |
71+
📌 pnpm install --fix-lockfile
72+
73+
[dependabot skip]
74+
skip-empty: true
75+
76+
- run: |
77+
pnpm run format
78+
git add .
79+
- id: commit-format
80+
uses: qoomon/actions--create-commit@v1
81+
with:
82+
message: |
83+
🎨 pnpm run format
84+
85+
[dependabot skip]
86+
skip-empty: true
87+
88+
- run: |
89+
pnpm run lint:fix
90+
git add .
91+
- id: commit-lint
92+
uses: qoomon/actions--create-commit@v1
93+
with:
94+
message: |
95+
🚨 pnpm run lint:fix
96+
97+
[dependabot skip]
98+
skip-empty: true
99+
100+
- if: steps.commit-lockfile.outputs.commit || steps.commit-format.outputs.commit || steps.commit-lint.outputs.commit
101+
run: git push

.github/workflows/pnpm-publish.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Node.js Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: write # Upload the release files
14+
id-token: write # Add `--provenance`
15+
packages: write # Publish the package
16+
17+
if: github.actor != 'nektos/act'
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: pnpm/action-setup@v4
22+
with:
23+
version: latest
24+
- uses: actions/setup-node@v4
25+
with:
26+
cache: pnpm
27+
node-version: latest
28+
- run: pnpm install
29+
- run: pnpm build
30+
31+
- uses: actions/setup-node@v4
32+
with:
33+
registry-url: https://npm.pkg.github.com
34+
scope: "@natoboram"
35+
- run: pnpm publish --access public --no-git-checks --provenance
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- uses: actions/setup-node@v4
40+
with:
41+
registry-url: https://registry.npmjs.org
42+
scope: "@natoboram"
43+
- run: pnpm publish --access public --no-git-checks --provenance
44+
env:
45+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
46+
47+
- run: pnpm pack --pack-gzip-level 9
48+
- run: gh release create "$VERSION" --generate-notes --title "$VERSION" --verify-tag natoboram-gigachad.ts-*.tgz
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
VERSION: ${{ github.ref_name }}

0 commit comments

Comments
 (0)