Skip to content

Commit ea11b30

Browse files
chore: initial push
1 parent 67518b4 commit ea11b30

31 files changed

+7203
-2
lines changed

.commitlintrc.cjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [
5+
2,
6+
'always',
7+
[
8+
'build',
9+
'chore',
10+
'ci',
11+
'docs',
12+
'feat',
13+
'fix',
14+
'perf',
15+
'poc',
16+
'refactor',
17+
'revert',
18+
'style',
19+
'test',
20+
'tidy',
21+
'wip',
22+
],
23+
],
24+
},
25+
}

.devcontainer/devcontainer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
3+
{
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm",
7+
"features": {
8+
"ghcr.io/devcontainers-contrib/features/vercel-ncc:1": {}
9+
}
10+
11+
// Features to add to the dev container. More info: https://containers.dev/features.
12+
// "features": {},
13+
14+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
15+
// "forwardPorts": [],
16+
17+
// Use 'postCreateCommand' to run commands after the container is created.
18+
// "postCreateCommand": "yarn install",
19+
20+
// Configure tool-specific properties.
21+
// "customizations": {},
22+
23+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
24+
// "remoteUser": "root"
25+
}

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
lib/
3+
node_modules/
4+
jest.config.js

.eslintrc.cjs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
const noUnusedVarRule = [
2+
'error',
3+
{
4+
vars: 'all',
5+
varsIgnorePattern: '^_',
6+
args: 'after-used',
7+
argsIgnorePattern: '^_',
8+
ignoreRestSiblings: true,
9+
},
10+
]
11+
12+
module.exports = {
13+
'env': {
14+
'node': true,
15+
'es2024': true,
16+
'jest/globals': true,
17+
},
18+
'extends': ['plugin:github/recommended', 'prettier', 'plugin:prettier/recommended'],
19+
'parser': '@typescript-eslint/parser',
20+
'parserOptions': {
21+
'ecmaVersion': 'latest',
22+
'sourceType': 'module',
23+
'project': ['tsconfig(.*)?.json'],
24+
},
25+
'plugins': ['jest', '@typescript-eslint', 'eslint-plugin-prettier', 'prettier'],
26+
'rules': {
27+
'@typescript-eslint/array-type': 'error',
28+
'@typescript-eslint/await-thenable': 'error',
29+
'@typescript-eslint/ban-ts-comment': 'error',
30+
'@typescript-eslint/consistent-type-assertions': 'error',
31+
'@typescript-eslint/explicit-function-return-type': [
32+
'error',
33+
{ 'allowExpressions': true },
34+
],
35+
'@typescript-eslint/explicit-member-accessibility': [
36+
'error',
37+
{ 'accessibility': 'no-public' },
38+
],
39+
'@typescript-eslint/func-call-spacing': ['error', 'never'],
40+
'@typescript-eslint/no-array-constructor': 'error',
41+
'@typescript-eslint/no-empty-interface': 'error',
42+
'@typescript-eslint/no-explicit-any': 'error',
43+
'@typescript-eslint/no-extraneous-class': 'error',
44+
'@typescript-eslint/no-for-in-array': 'error',
45+
'@typescript-eslint/no-inferrable-types': 'error',
46+
'@typescript-eslint/no-misused-new': 'error',
47+
'@typescript-eslint/no-namespace': 'error',
48+
'@typescript-eslint/no-non-null-assertion': 'warn',
49+
'@typescript-eslint/no-require-imports': 'warn',
50+
'@typescript-eslint/no-unnecessary-qualifier': 'warn',
51+
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
52+
'@typescript-eslint/no-unused-vars': noUnusedVarRule,
53+
'@typescript-eslint/no-useless-constructor': 'error',
54+
'@typescript-eslint/no-var-requires': 'error',
55+
'@typescript-eslint/prefer-for-of': 'warn',
56+
'@typescript-eslint/prefer-function-type': 'warn',
57+
'@typescript-eslint/prefer-includes': 'error',
58+
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
59+
'@typescript-eslint/promise-function-async': 'error',
60+
'@typescript-eslint/require-array-sort-compare': 'error',
61+
'@typescript-eslint/restrict-plus-operands': 'error',
62+
'@typescript-eslint/semi': ['error', 'never'],
63+
'@typescript-eslint/type-annotation-spacing': 'error',
64+
'@typescript-eslint/unbound-method': 'error',
65+
'camelcase': 'off',
66+
'eslint-comments/no-use': 'off',
67+
'filenames/match-regex': 'off',
68+
'i18n-text/no-en': 'off',
69+
'import/no-namespace': 'off',
70+
'prettier/prettier': ['error', { 'usePrettierrc': true }],
71+
'semi': 'off',
72+
},
73+
overrides: [
74+
{
75+
files: ['*.cjs'],
76+
rules: {
77+
'import/no-commonjs': 'off',
78+
},
79+
},
80+
],
81+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/** -diff linguist-generated=true

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
8+
- package-ecosystem: npm
9+
directory: /
10+
schedule:
11+
interval: daily

.github/workflows/build.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- "**.md"
9+
pull_request:
10+
paths-ignore:
11+
- "**.md"
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 16
25+
26+
- uses: pnpm/action-setup@v3
27+
name: Install PNPM
28+
with:
29+
version: 8
30+
run_install: false
31+
32+
- name: Get PNPM store directory
33+
shell: bash
34+
run: |
35+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
36+
37+
- uses: actions/cache@v3
38+
name: Setup PNPM cache
39+
with:
40+
path: ${{ env.STORE_PATH }}
41+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-pnpm-store-
44+
45+
- name: Install dependencies
46+
run: pnpm install
47+
48+
- name: Validate and Bundle
49+
run: pnpm validate
50+
51+
- name: Compare the expected and actual dist/ directories
52+
run: |
53+
if [ "$(git diff -b --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
54+
echo "Detected uncommitted changes after build. See status below:"
55+
git diff
56+
exit 1
57+
fi
58+
id: diff
59+
60+
# If index.js was different than expected, upload the expected version as an artifact
61+
- uses: actions/upload-artifact@v4
62+
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
63+
with:
64+
name: dist
65+
path: dist/

.gitignore

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Dependency directory
2+
node_modules
3+
4+
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
13+
# Diagnostic reports (https://nodejs.org/api/report.html)
14+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
15+
16+
# Runtime data
17+
pids
18+
*.pid
19+
*.seed
20+
*.pid.lock
21+
22+
# Directory for instrumented libs generated by jscoverage/JSCover
23+
lib-cov
24+
25+
# Coverage directory used by tools like istanbul
26+
coverage
27+
*.lcov
28+
29+
# nyc test coverage
30+
.nyc_output
31+
32+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33+
.grunt
34+
35+
# Bower dependency directory (https://bower.io/)
36+
bower_components
37+
38+
# node-waf configuration
39+
.lock-wscript
40+
41+
# Compiled binary addons (https://nodejs.org/api/addons.html)
42+
build/Release
43+
44+
# Dependency directories
45+
jspm_packages/
46+
47+
# TypeScript v1 declaration files
48+
typings/
49+
50+
# TypeScript cache
51+
*.tsbuildinfo
52+
53+
# Optional npm cache directory
54+
.npm
55+
56+
# Optional eslint cache
57+
.eslintcache
58+
59+
# Optional REPL history
60+
.node_repl_history
61+
62+
# Output of 'npm pack'
63+
*.tgz
64+
65+
# Yarn Integrity file
66+
.yarn-integrity
67+
68+
# dotenv environment variables file
69+
.env
70+
.env.test
71+
72+
# parcel-bundler cache (https://parceljs.org/)
73+
.cache
74+
75+
# next.js build output
76+
.next
77+
78+
# nuxt.js build output
79+
.nuxt
80+
81+
# vuepress build output
82+
.vuepress/dist
83+
84+
# Serverless directories
85+
.serverless/
86+
87+
# FuseBox cache
88+
.fusebox/
89+
90+
# DynamoDB Local files
91+
.dynamodb/
92+
93+
# OS metadata
94+
.DS_Store
95+
Thumbs.db
96+
97+
# Ignore built ts files
98+
__tests__/runner/*
99+
lib/**/*
100+
101+
# IDE
102+
.vscode

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpx commitlint --edit $1

.husky/common.sh

Whitespace-only changes.

0 commit comments

Comments
 (0)