Skip to content

Commit 83707d9

Browse files
committed
setup
0 parents  commit 83707d9

18 files changed

+16166
-0
lines changed

.eslintrc.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
node: true,
6+
},
7+
ignorePatterns: ["rollup.config.js"],
8+
overrides: [
9+
{
10+
files: ["*.ts", "*.tsx"],
11+
extends: [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended",
14+
"plugin:react/recommended",
15+
"plugin:react-hooks/recommended",
16+
"plugin:prettier/recommended",
17+
],
18+
parser: "@typescript-eslint/parser",
19+
parserOptions: {
20+
ecmaFeatures: {
21+
jsx: true,
22+
},
23+
ecmaVersion: 12,
24+
sourceType: "module",
25+
project: "./tsconfig.json",
26+
},
27+
plugins: [
28+
"react",
29+
"@typescript-eslint",
30+
"prettier",
31+
"simple-import-sort",
32+
"unused-imports",
33+
],
34+
rules: {
35+
"react/react-in-jsx-scope": "off",
36+
"@typescript-eslint/explicit-module-boundary-types": "off",
37+
"@typescript-eslint/no-unused-vars": "off", // Replaced by unused-imports/no-unused-vars
38+
"@typescript-eslint/no-explicit-any": "off",
39+
"prettier/prettier": "error",
40+
41+
// Import organization rules
42+
"simple-import-sort/imports": [
43+
"error",
44+
{
45+
groups: [
46+
// React first
47+
["^react$", "^react/"],
48+
// External packages
49+
["^@?\\w"],
50+
// Internal packages (relative imports starting with . or ..)
51+
["^\\u0000"],
52+
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
53+
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
54+
// Style imports last
55+
["^.+\\.s?css$"],
56+
],
57+
},
58+
],
59+
"simple-import-sort/exports": "error",
60+
"unused-imports/no-unused-imports": "error",
61+
"unused-imports/no-unused-vars": [
62+
"warn",
63+
{
64+
vars: "all",
65+
varsIgnorePattern: "^_",
66+
args: "after-used",
67+
argsIgnorePattern: "^_",
68+
},
69+
],
70+
},
71+
settings: {
72+
react: {
73+
version: "detect",
74+
},
75+
},
76+
},
77+
{
78+
files: ["*.js"],
79+
extends: ["eslint:recommended", "plugin:prettier/recommended"],
80+
parserOptions: {
81+
ecmaVersion: 12,
82+
sourceType: "module",
83+
},
84+
},
85+
],
86+
};
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy Documentation to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
# Build job
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '18'
33+
cache: 'npm'
34+
35+
- name: Install dependencies
36+
run: npm ci
37+
38+
- name: Build the package
39+
run: npm run build
40+
41+
- name: Build documentation site
42+
run: npm run styleguide:build
43+
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v4
46+
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
path: './styleguide'
51+
52+
# Deployment job
53+
deploy:
54+
environment:
55+
name: github-pages
56+
url: ${{ steps.deployment.outputs.page_url }}
57+
runs-on: ubuntu-latest
58+
needs: build
59+
if: github.ref == 'refs/heads/main'
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
dist/
6+
build/
7+
example-dist/
8+
9+
# Environment files
10+
.env
11+
.env.local
12+
.env.development.local
13+
.env.test.local
14+
.env.production.local
15+
16+
# Logs
17+
npm-debug.log*
18+
yarn-debug.log*
19+
yarn-error.log*
20+
lerna-debug.log*
21+
22+
# Runtime data
23+
pids
24+
*.pid
25+
*.seed
26+
*.pid.lock
27+
28+
# Coverage directory used by tools like istanbul
29+
coverage/
30+
*.lcov
31+
32+
# nyc test coverage
33+
.nyc_output
34+
35+
# ESLint cache
36+
.eslintcache
37+
38+
# Optional npm cache directory
39+
.npm
40+
41+
# Optional REPL history
42+
.node_repl_history
43+
44+
# Output of 'npm pack'
45+
*.tgz
46+
47+
# Yarn Integrity file
48+
.yarn-integrity
49+
50+
# IDE
51+
.vscode/
52+
.idea/
53+
*.sublime-project
54+
*.sublime-workspace
55+
56+
# OS
57+
.DS_Store
58+
Thumbs.db

.npmignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Source files
2+
src/
3+
MouseGradientBackground/
4+
example/
5+
6+
# Configuration files
7+
rollup.config.js
8+
tsconfig.json
9+
.eslintrc.js
10+
.gitignore
11+
12+
# Development files
13+
node_modules/
14+
coverage/
15+
.npm/
16+
*.log
17+
.DS_Store
18+
19+
# Git
20+
.git/
21+
.github/
22+
23+
# IDE
24+
.vscode/
25+
.idea/
26+
27+
# Test files
28+
**/*.test.ts
29+
**/*.test.tsx
30+
**/*.spec.ts
31+
**/*.spec.tsx

.prettierignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Build outputs
8+
dist/
9+
build/
10+
*.tsbuildinfo
11+
12+
# Package files
13+
package-lock.json
14+
yarn.lock
15+
16+
# Git
17+
.git/
18+
19+
# IDE
20+
.vscode/
21+
.idea/
22+
23+
# OS
24+
.DS_Store
25+
Thumbs.db
26+
27+
# Config files that might have specific formatting
28+
*.json
29+
!tsconfig.json

.prettierrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": false,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"quoteProps": "as-needed",
9+
"jsxSingleQuote": false,
10+
"bracketSpacing": true,
11+
"bracketSameLine": false,
12+
"arrowParens": "always",
13+
"endOfLine": "lf"
14+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 react-gradient-hover
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)