Skip to content

Commit

Permalink
inital
Browse files Browse the repository at this point in the history
  • Loading branch information
Mararok committed Mar 6, 2024
0 parents commit 2a0416b
Show file tree
Hide file tree
Showing 78 changed files with 9,930 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true

[Makefile]
indent_style = tab
indent_size = 2

[*.{md,txt}]
indent_style = space
trim_trailing_whitespace = false
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lib
node_modules
bin
.yarn
.eslintrc.js
.github
tmp
40 changes: 40 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module.exports = {
root: true,
env: {
node: true,
browser: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2022,
sourceType: 'commonjs',
project: __dirname + '/tsconfig.json',
},
plugins: ['@typescript-eslint', 'unused-imports'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
varsIgnorePattern: '^',
},
],
'@typescript-eslint/explicit-module-boundary-types': ['error', { allowArgumentsExplicitlyTypedAsAny: true }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/explicit-member-accessibility': 'error',
semi: ['error', 'always'],
'array-element-newline': 'off',
'array-bracket-newline': 'off',
'function-call-argument-newline': 'off',
'no-console': 'off',
'unused-imports/no-unused-imports': 'warn',
//'@typescript-eslint/consistent-type-exports': 'error',
//'@typescript-eslint/consistent-type-imports': 'error',
quotes: ['error', 'single'],
},
};
206 changes: 206 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
## GITATTRIBUTES FOR WEB PROJECTS
#
# These settings are for any web project.
#
# Details per file setting:
# text These files should be normalized (i.e. convert CRLF to LF).
# binary These files are binary and should be left untouched.
#
# Note that binary is a macro for -text -diff.
######################################################################

# Auto detect
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text=auto
*.* text eol=lf
# Source code
*.bash text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.coffee text
*.css text diff=css
*.htm text diff=html
*.html text diff=html
*.inc text
*.ini text
*.js text
*.json text
*.jsx text
*.less text
*.ls text
*.map text -diff
*.od text
*.onlydata text
*.php text diff=php
*.pl text
*.ps1 text eol=crlf
*.py text diff=python
*.rb text diff=ruby
*.sass text
*.scm text
*.scss text diff=css
*.sh text eol=lf
*.sql text
*.styl text
*.tag text
*.ts text eol=lf
*.tsx text
*.xml text
*.xhtml text diff=html

# Docker
Dockerfile text

# Documentation
*.ipynb text
*.markdown text diff=markdown
*.md text diff=markdown
*.mdwn text diff=markdown
*.mdown text diff=markdown
*.mkd text diff=markdown
*.mkdn text diff=markdown
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text

# Templates
*.dot text
*.ejs text
*.erb text
*.haml text
*.handlebars text
*.hbs text
*.hbt text
*.jade text
*.latte text
*.mustache text
*.njk text
*.phtml text
*.svelte text
*.tmpl text
*.tpl text
*.twig text
*.vue text

# Configs
*.cnf text
*.conf text
*.config text
.editorconfig text
.env text
.gitattributes text
.gitconfig text
.htaccess text
*.lock text -diff
package.json text eol=lf
package-lock.json text -diff
pnpm-lock.yaml text eol=lf -diff
.prettierrc text
yarn.lock text -diff
*.toml text
*.yaml text
*.yml text
browserslist text
Makefile text
makefile text

# Heroku
Procfile text

# Graphics
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.gifv binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
# SVG treated as an asset (binary) by default.
*.svg text
# If you want to treat it as binary,
# use the following line instead.
# *.svg binary
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary

# Audio
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary

# Video
*.3gpp binary
*.3gp binary
*.as binary
*.asf binary
*.asx binary
*.avi binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.ogv binary
*.swc binary
*.swf binary
*.webm binary

# Archives
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary

# Fonts
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary

# Executables
*.exe binary
*.pyc binary

# RC files (like .babelrc or .eslintrc)
*.*rc text

# Ignore files (like .npmignore or .gitignore)
*.*ignore text
40 changes: 40 additions & 0 deletions .github/actions/publish/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test
description: 'execute tests'
runs:
using: 'composite'
steps:
# Bump version
- name: Bump package version
shell: bash
run: |
yarn version $RELEASE_TYPE
echo "RELEASE_TAG=latest" >> $GITHUB_ENV
echo "NEW_VERSION=$(jq -r '.version' < package.json)" >> $GITHUB_ENV
env:
RELEASE_TYPE: ${{ inputs.releaseType }}

- name: Update CHANGELOG.md
uses: 'zen8sol/[email protected]'
with:
newVersion: '${{ env.NEW_VERSION }}'

# Publish package
- name: Publish
shell: bash
run: |
echo -e "\nnpmAuthToken: '${{ env.NODE_AUTH_TOKEN }}'" >> ./.yarnrc.yml
yarn npm publish --access public --tag ${{ env.RELEASE_TAG }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# Commit
- name: Commit CHANGELOG.md and package.json changes and create tag
shell: bash
run: |
git config --global user.email "[email protected]"
git config --global user.name "Hexancore Bot"
git add "package.json"
git add "CHANGELOG.md"
git commit -m "chore: release ${{ env.NEW_VERSION }}"
git tag -m 'new version' ${{ env.NEW_VERSION }}
git push --follow-tags
10 changes: 10 additions & 0 deletions .github/actions/test/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Test
description: 'execute tests'
runs:
using: 'composite'
steps:
# Yarn test
- name: Test
shell: bash
run: yarn test

19 changes: 19 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Pull Request
on:
pull_request:
branches: [ master, main ]

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Yarn install
uses: hexancore/[email protected]
- name: Lint
run: yarn lint
- name: Test
uses: ./.github/actions/test
- name: Build
run: yarn build
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
workflow_dispatch:
inputs:
releaseType:
description: 'Release type (one of): patch, minor, major'
required: true
type: choice
options:
- patch
- minor
- major

jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ env.HEXANCORE_BOT_TOKEN }}
env:
HEXANCORE_BOT_TOKEN: ${{ secrets.HEXANCORE_BOT_TOKEN }}

- name: Yarn install
uses: hexancore/[email protected]

- name: test
uses: ./.github/actions/test

# Publish package
- name: Publish
shell: bash
run: |
echo -e "\nnpmAuthToken: '${{ env.NODE_AUTH_TOKEN }}'" >> ./.yarnrc.yml
yarn npm publish --access public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

#- name: publish
# uses: ./.github/actions/publish
Loading

0 comments on commit 2a0416b

Please sign in to comment.