Skip to content

Commit

Permalink
ci: replace react scripts with vite (#2)
Browse files Browse the repository at this point in the history
* chore: replace scripts

* ci: replace react scripts to vite
  • Loading branch information
AKharytonchyk authored Nov 3, 2024
1 parent 6afa1eb commit 51675d9
Show file tree
Hide file tree
Showing 19 changed files with 3,597 additions and 16,455 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ jobs:
node-version: '20'
- name: Build
run: |
export REACT_APP_GITHUB_API_URL=$REACT_APP_GITHUB_API_URL
export VITE_GITHUB_API_URL=$VITE_GITHUB_API_URL
npm ci
npm run build
env:
CI: true
REACT_APP_GITHUB_API_URL: "https://api.github.com"
VITE_GITHUB_API_URL: "https://api.github.com"
- name: Update HTML Links
run: |
sed -i 's|href="/|href="|g' build/index.html
sed -i 's|src="/|src="|g' build/index.html
sed -i 's|href="/|href="|g' dist/index.html
sed -i 's|src="/|src="|g' dist/index.html
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './build'
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# production
/build
/dist

# misc
.DS_Store
Expand Down
30 changes: 30 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
"max-len": ["error", { "code": 250 }],
"@typescript-eslint/no-explicit-any": "off",
},
},
)
Loading

0 comments on commit 51675d9

Please sign in to comment.