Skip to content

Commit

Permalink
refactor: prepare code for the future updates (#84)
Browse files Browse the repository at this point in the history
* refactor: prepare code for the future updates

* build: fix
  • Loading branch information
pure-js authored Mar 23, 2024
1 parent 3748a84 commit 8fd2671
Show file tree
Hide file tree
Showing 23 changed files with 1,789 additions and 187 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

17 changes: 17 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
env:
browser: true
es2021: true
node: true
extends:
- love
- plugin:react/recommended
- prettier
parserOptions:
ecmaVersion: latest
sourceType: module
plugins:
- react
- prettier
rules:
'@typescript-eslint/explicit-function-return-type': 'off'
'react/react-in-jsx-scope': 'off'
File renamed without changes.
24 changes: 24 additions & 0 deletions app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use client'

import { useEffect } from "react"

export default function Error({
error,
reset,
}: {
error: Error
reset: () => void
}) {

useEffect(() => {
// TODO: Log the error to an error reporting service
console.error(error)
}, [error])

return (
<div>
<h2>Something went wrong!</h2>
<button type="button" onClick={() => { reset(); }}>Try again</button>
</div>
)
}
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/app/sagas.ts → app/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { call, put, takeEvery, takeLatest } from 'redux-saga/effects';
import { takeLatest } from 'redux-saga/effects';
// import { fetchManufacturers } from './api';

// worker Saga: will be fired on USER_FETCH_REQUESTED actions
Expand Down
Binary file modified bun.lockb
Binary file not shown.
31 changes: 24 additions & 7 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: 'export',
basePath: '/auto-manufacturers',
};
// @ts-check
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants');

module.exports = nextConfig;
module.exports = async (phase) => {
if (phase === PHASE_DEVELOPMENT_SERVER) {
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
reactStrictMode: true,
output: 'export',
}
return nextConfig
}

/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
reactStrictMode: true,
output: 'export',
basePath: '/auto-manufacturers', // GitHub pages
}
return nextConfig
}
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"predeploy": "npm run build",
"deploy": "gh-pages -d out",
"test": "jest",
"lint": "next lint",
"lint": "eslint --ext .js,.jsx,.ts,.tsx src/",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@heroicons/react": "^2.0.18",
"@reduxjs/toolkit": "^1.8.1",
"next": "^13.4.9",
"next": "^13.4.19",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redux-saga": "^1.1.3"
Expand All @@ -35,9 +35,17 @@
"@types/jest": "^29.5.3",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"babel-loader": "^8.2.4",
"eslint": "8.48.0",
"eslint-config-love": "~43.1.0",
"eslint-config-next": "13.4.10",
"eslint-config-prettier": "~9.1.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
"eslint-plugin-prettier": "~5.1.3",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "~7.34.1",
"eslint-plugin-storybook": "^0.6.12",
"gh-pages": "^6.0.0",
"jest": "^29.6.1",
Expand Down
Loading

0 comments on commit 8fd2671

Please sign in to comment.