Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
CielSachen committed May 1, 2024
0 parents commit 3366fa4
Show file tree
Hide file tree
Showing 19 changed files with 3,370 additions and 0 deletions.
93 changes: 93 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
env: {
node: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:import/recommended",
"plugin:jsdoc/recommended-typescript-flavor",
"prettier",
],
ignorePatterns: "dist/**/*",
overrides: [
{
extends: [
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:import/typescript",
"plugin:jsdoc/recommended-typescript",
],
files: ["**/*.ts", "**/*.cts", "**/*.mts"],
parser: "@typescript-eslint/parser",
parserOptions: { project: true, tsconfigRootDir: __dirname },
plugins: ["@typescript-eslint"],
rules: {
"no-shadow": "off",
"@typescript-eslint/no-empty-interface": ["error", { allowSingleExtends: true }],
"@typescript-eslint/no-shadow": "error",
"jsdoc/require-jsdoc": [
"warn",
{
publicOnly: true,
require: {
ArrowFunctionExpression: true,
ClassDeclaration: true,
ClassExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
MethodDefinition: true,
},
contexts: [
"PropertyDefinition",
"TSEnumDeclaration",
"TSInterfaceDeclaration",
"TSMethodSignature",
"TSModuleDeclaration",
"TSPropertySignature",
"TSTypeAliasDeclaration",
],
},
],
},
settings: { "import/resolver": { typescript: true, node: true } },
},
],
parserOptions: {
ecmaFeatures: { impliedStrict: true },
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["import", "jsdoc", "simple-import-sort"],
root: true,
rules: {
curly: ["error", "multi", "consistent"],
"max-nested-callbacks": ["error", { max: 4 }],
"no-console": "off",
"no-empty-function": "error",
"no-inline-comments": "error",
"no-lonely-if": "error",
"no-shadow": "error",
"no-var": "error",
"prefer-const": "error",
yoda: "error",
"jsdoc/require-jsdoc": [
"warn",
{
publicOnly: true,
require: {
ArrowFunctionExpression: true,
ClassDeclaration: true,
ClassExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
MethodDefinition: true,
},
contexts: ["PropertyDefinition"],
},
],
"simple-import-sort/exports": "warn",
"simple-import-sort/imports": "warn",
},
};
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Bug Report
description: Create a report to help us improve
title: "[BUG]: "
labels: ["bug"]
assignees:
- CielSachen
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Describe the Bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- OS: [e.g. MacOS, Windows]
- Node.js Version: [e.g. 20.x]
- Package Manager Version: [e.g. pnpm 9.x]
value: |
- OS:
- Node.js Version:
- Package Manager Version:
render: Markdown
validations:
required: true
- type: textarea
attributes:
label: Additional Context
description: Add any other context about the problem here.
validations:
required: false
29 changes: 29 additions & 0 deletions .github/workflows/publish-package-to-github-packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish package to GitHub packages
on:
release:
types: [published]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
registry-url: https://npm.pkg.github.com/
scope: "@cielsachen"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Publish
run: pnpm publish --access restricted --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Visual Studio Code
.vscode/**/*
!.vscode/extensions.json
!.vscode/settings.json

# Dependencies
node_modules

# Generated output
dist

# Packed package
*.tgz

# Logs
.pnpm-debug.log*

# Miscellaneous
**/.DS_Store
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Lock file
pnpm-lock.yaml
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"aaron-bond.better-comments",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"pmneo.tsimporter",
"redhat.vscode-yaml"
]
}
24 changes: 24 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"[javascript][typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.detectIndentation": true,
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"files.insertFinalNewline": true,
"javascript.preferences.importModuleSpecifier": "non-relative",
"javascript.preferences.importModuleSpecifierEnding": "js",
"javascript.preferences.quoteStyle": "double",
"js/ts.implicitProjectConfig.target": "ESNext",
"npm.packageManager": "pnpm",
"prettier.configPath": "./prettier.config.js",
"prettier.printWidth": 100,
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.importModuleSpecifierEnding": "js",
"typescript.preferences.quoteStyle": "double",
"typescript.tsdk": "./node_modules/typescript/lib"
}
15 changes: 15 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2024 CielSachen

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Loading

0 comments on commit 3366fa4

Please sign in to comment.