Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
adriencaccia committed Jan 29, 2023
0 parents commit 10c8ac3
Show file tree
Hide file tree
Showing 24 changed files with 4,552 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org

#########################
## Usage with Prettier ##
#########################

# The following settings will be directly integrated in Prettier !
# Please remain consistent and do not set those settings in a
# .prettierrc file or the following settings will be overriden

# end_of_line
# indent_style
# indent_size/tab_width
# max_line_length

#########################

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 = 100
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
90 changes: 90 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
module.exports = {
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
rules: {
curly: ['error', 'all'],
eqeqeq: ['error', 'smart'],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
optionalDependencies: false,
peerDependencies: false,
},
],
'no-shadow': [
'error',
{
hoist: 'all',
},
],
'prefer-const': 'error',
'sort-imports': [
'error',
{
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: '*',
next: 'return',
},
],
complexity: ['error', 8],
'max-lines': ['error', 200],
'max-depth': ['error', 3],
'max-params': ['error', 2],
},
root: true,
plugins: ['import'],
env: {
browser: true,
es6: true,
node: true,
},
parserOptions: { ecmaVersion: 2021 },
overrides: [
{
files: ['**/*.ts?(x)'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_$', varsIgnorePattern: '^_$' },
],
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-ignore': 'allow-with-description',
minimumDescriptionLength: 10,
},
],
},
},
],
};
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 🏗 CI

on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, synchronize, reopened]

env:
CI: true
NODE_VERSION: 16

defaults:
run:
shell: bash

jobs:
lint:
name: 📚 lint and type check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
shell: bash
- name: lint
run: pnpm test-linter
- name: type check
run: pnpm test-type
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 🚀 Release

on:
push:
tags:
- 'v*'

env:
CI: true
NODE_VERSION: 16

defaults:
run:
shell: bash

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: npx changelogithub --draft
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# package directories
node_modules
.npm

# Serverless directories
.serverless

# Webpack directories
.webpack

# Esbuild directories
.esbuild

# Ignore stack.json files
**/stack.json

# production
/build
**/dist

# testing
coverage

# Ignore Jetbrains folder settings
.idea

# local env
.env
.env.dev
.env.development
.env.local

# misc
.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm precommit
3 changes: 3 additions & 0 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'*.{js,jsx,ts,tsx}': 'pnpm lint-fix',
};
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.15.0
16 changes: 16 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.hbs
.next
pnpm-lock.yaml
**/.serverless
**/stack.json
.gitlab-ci.yml
.npm
.webpack
.esbuild
**/coverage
**/dist
**/build
**/public

# forestamdin
.forestadmin-schema.json
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "avoid"
}
41 changes: 41 additions & 0 deletions .syncpackrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
dev: true,
filter: '.',
indent: ' ',
peer: true,
prod: true,
semverRange: '',
sortAz: [
'contributors',
'scripts',
'dependencies',
'devDependencies',
'keywords',
'peerDependencies',
],
sortFirst: [
'name',
'description',
'private',
'version',
'author',
'contributors',
'license',
'homepage',
'bugs',
'repository',
'keywords',
'publishConfig',
'workspaces',
'sideEffects',
'files',
'type',
'main',
'module',
'types',
'contracts',
'generators',
'scripts',
],
versionGroups: [],
};
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig"
]
}
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"search.exclude": {
"**/coverage": true,
"**/node_modules": true,
"**/.serverless": true,
"pnpm-lock.yaml": true
},
"[shellscript][ignore]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"files.exclude": {}
}
Loading

0 comments on commit 10c8ac3

Please sign in to comment.