Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
BroKun committed Jun 5, 2024
1 parent f2226d6 commit ad01b78
Show file tree
Hide file tree
Showing 92 changed files with 4,341 additions and 0 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# http://editorconfig.org
root = true

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

[Makefile]
indent_style = tab
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
!.dumi
.dumi/tmp
.dumi/tmp-production

**/dist/**/*.js
**/dist/**/*.cjs
**/dist/**/*.mjs
97 changes: 97 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:promise/recommended',
'prettier',
],
plugins: ['import'],

env: {
node: true,
},
settings: {
react: {
version: '18',
},
},

rules: {
// common pitfalls
eqeqeq: 'error',
curly: 'error',

// stricter type correctness
'no-unused-vars': [
'warn',
{
vars: 'local',
args: 'none',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
caughtErrors: 'none',
},
],
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-explicit-any': ['warn', { ignoreRestArgs: true }],
'@typescript-eslint/no-shadow': [
'warn',
{
ignoreTypeValueShadow: true,
},
],

// react rules
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',

// no sloppiness
'no-console': ['error', { allow: ['error', 'warn', 'info'] }],

// import rules and fixes
'@typescript-eslint/consistent-type-imports': 'error',
'import/newline-after-import': 'warn',
'import/order': [
'warn',
{
pathGroups: [
{
pattern: '@/**',
group: 'internal',
position: 'before',
},
],
distinctGroup: false,
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},

overrides: [
{
files: ['*.js', '*.cjs', '*.mjs', '*.jsx'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
};
7 changes: 7 additions & 0 deletions .eslintrc.node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
root: true,
extends: [require.resolve('./.eslintrc.js')],
rules: {
'no-console': 'off',
},
};
46 changes: 46 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Fix end-of-lines in Git versions older than 2.10
# https://github.com/git/git/blob/master/Documentation/RelNotes/2.10.0.txt#L248 # https://github.com/git/git/blob/master/Documentation/RelNotes/2.10.0.txt#L248
* text=auto eol=lf

# ===
# Binary Files (don't diff, don't fix line endings)
# ===

# Images
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.tiff binary

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

# Videos
*.mov binary
*.mp4 binary
*.webm binary
*.ogg binary
*.mpg binary
*.3gp binary
*.avi binary
*.wmv binary
*.flv binary
*.asf binary

# Audio
*.mp3 binary
*.wav binary
*.flac binary

# Compressed
*.gz binary
*.zip binary
*.7z binary
*.tar.gz binary
*.tgz binary
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Code: CI'

on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
workflow_call:

jobs:
ci-javascript:
name: 'CI: JavaScript'
uses: difizen/actions/.github/workflows/ci-javascript.yml@main
with:
node-version: ${{ matrix.node-version }}
python-version: ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
node-version: ['16']
python-version: ['3.8']
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# # https://github.com/sveltejs/kit/blob/32afba695088b946aefe96da75b36de9b0667fbe/.github/workflows/release.yml
# name: 'Release'

# on:
# push:
# branches: ['main']

# jobs:
# changesets:
# # prevents this action from running on forks
# if: github.repository == 'difizen/magent'

# name: Changesets
# uses: difizen/actions/.github/workflows/release-changesets.yml@main
# secrets:
# BOT_APP_ID: ${{ secrets.BOT_APP_ID }}
# BOT_PRIVATE_KEY: ${{ secrets.BOT_PRIVATE_KEY }}

# permissions:
# pull-requests: write
# contents: write

# ci:
# needs: [changesets]
# if: |
# needs.changesets.outputs.should-release == 'true'

# name: Prerelease CI
# uses: ./.github/workflows/ci.yml

# permissions:
# contents: read
# actions: read

# publish:
# needs: [ci]
# if: |
# needs.ci.result == 'success'

# name: Publish
# uses: difizen/actions/.github/workflows/release-publish.yml@main

# with:
# node-version: '18'
# python-version: '3.8'

# permissions:
# contents: write

# secrets:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading

0 comments on commit ad01b78

Please sign in to comment.