Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Peterbyte committed Sep 18, 2024
0 parents commit b087f88
Show file tree
Hide file tree
Showing 16 changed files with 6,496 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
registries:
npm-github:
type: npm-registry
url: https://npm.pkg.github.com/stackcrafters
token: ${{secrets.SC_NPM_REGISTRY}}
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
registries:
- npm-github
schedule:
interval: "daily"
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Node.js Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v2
with:
node-version: "18.x"
registry-url: "https://npm.pkg.github.com"
# Defaults to the user or organization that owns the workflow file
scope: "@stackcrafters"
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.idea
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Stackcrafters Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions config/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"tabWidth": 2,
"printWidth": 140,
"arrowParens": "always"
}
32 changes: 32 additions & 0 deletions config/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import tsParser from '@typescript-eslint/parser';
import js from "@eslint/js";
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import globals from "globals";

export default [
js.configs.recommended,
eslintPluginPrettierRecommended,
{
languageOptions: {
parser: tsParser,
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.jest
}
},

rules: {
'prettier/prettier': 'warn',
'no-explicit-any': 'off',
'no-inferrable-types': 'off',
'no-unused-vars': ['warn', {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}]
}
}
];
1 change: 1 addition & 0 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exports.jest = require("./jest.config");
12 changes: 12 additions & 0 deletions config/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { jsWithTs: tsjPreset } = require('ts-jest/presets');

module.exports = {
roots: ["<rootDir>/src"],
testRegex: '(.*\\.test\\.(ts|js))$',
transform: {
...tsjPreset.transform,
'^.+\\.(j|t)sx?$': 'esbuild-jest'
},
moduleDirectories: ['node_modules', 'src'],
moduleFileExtensions: ['ts', 'js', 'jsx', 'json', 'node']
};
58 changes: 58 additions & 0 deletions config/react/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import tsParser from '@typescript-eslint/parser';
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import reactPlugin from 'eslint-plugin-react'
import reactHooksPlugin from 'eslint-plugin-react-hooks'
import globals from "globals";
import js from "@eslint/js";

reactPlugin.configs.recommended.plugins = { reactPlugin }
reactPlugin.configs.recommended.languageOptions = {
parserOptions: reactPlugin.configs.recommended.parserOptions
}
delete reactPlugin.configs.recommended.parserOptions

export default [
// reactPlugin.configs.recommended,
// reactHooksPlugin.configs.recommended,
js.configs.recommended,
eslintPluginPrettierRecommended,
{
languageOptions: {
parser: tsParser,
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.jest
},
parserOptions: {
ecmaFeatures: {
jsx: true
}
}
},

settings: {
react: {
version: 'detect'
}
},

rules: {
'prettier/prettier': 'warn',
'no-explicit-any': 'off',
'no-inferrable-types': 'off',
'no-unused-vars': ['warn', {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}],
// 'react-hooks/rules-of-hooks': 'error',
// 'react-hooks/exhaustive-deps': 'warn',
'react/display-name': 'off',
// 'react/jsx-uses-react': 'off',
// 'react/react-in-jsx-scope': 'off'
}
}
];
33 changes: 33 additions & 0 deletions config/react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
10 changes: 10 additions & 0 deletions config/react/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
32 changes: 32 additions & 0 deletions config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "CommonJS",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
9 changes: 9 additions & 0 deletions config/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "commonjs",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
}
}
Loading

0 comments on commit b087f88

Please sign in to comment.