Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tooling #165

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions .eslintrc.js

This file was deleted.

6 changes: 0 additions & 6 deletions jsconfig.json

This file was deleted.

29 changes: 10 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,15 @@
"homepage": "https://secret-in.me",
"main": "electron.js",
"devDependencies": {
"@types/react-dom": "^18.0.9",
"@welldone-software/why-did-you-render": "^6.2.3",
"babel-eslint": "^10.0.3",
"electron": "^18.2.0",
"electron-packager": "^15.5.1",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.9.0",
"eslint-config-react-app": "^5.1.0",
"eslint-import-resolver-webpack": "^0.12.1",
"eslint-plugin-flowtype": "^4.6.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.17.0",
"eslint-plugin-react-hooks": "^2.3.0",
"gh-pages": "^1.0.0",
"node-sass": "^7.0.1",
"prettier": "^1.19.1",
"react-scripts": "4.0.3"
"react-scripts": "5.0.1",
"typescript": "^4.9.3"
},
"dependencies": {
"@reduxjs/toolkit": "^1.5.1",
Expand All @@ -35,11 +26,11 @@
"mousetrap": "^1.6.3",
"prop-types": "^15.7.2",
"qrcode.react": "^1.0.0",
"react": "^16.0.0",
"react": "^18",
"react-bootstrap": "^0.32.4",
"react-dnd": "^5.0.0",
"react-dnd-html5-backend": "^5.0.1",
"react-dom": "^16.0.0",
"react-dom": "^18",
"react-intl": "^6.2.1",
"react-overlays": "^0.8.3",
"react-redux": "^7.2.3",
Expand All @@ -52,20 +43,17 @@
},
"scripts": {
"deploy": "scripts/deploy.sh",
"start": "yarn build-css && yarn run watch-css & NODE_PATH=./src react-scripts start",
"start": "yarn build-css && yarn run watch-css & NODE_PATH=./src DISABLE_ESLINT_PLUGIN=true react-scripts start",
"build": "yarn build-css && NODE_PATH=./src node_modules/.bin/react-scripts build && ./scripts/post-build.sh",
"build-css": "node_modules/.bin/node-sass src/stylesheets/application.sass src/index.css",
"watch-css": "node_modules/.bin/node-sass src/stylesheets/application.sass src/index.css -w",
"__electron": "yarn build && node_modules/.bin/electron-packager ./ --arch=x64 --asar --overwrite --ignore=scripts --ignore=.gitignore --ignore=yarn.lock --ignore=.travis.yml --ignore=.*.zip --ignore=public --ignore=.nvmrc --ignore=.eslintrc.js --ignore=node_modules --ignore=src",
"electron": "yarn __electron -- --platform=all",
"electron:mac": "yarn __electron -- --platform=darwin --icon build/icons/icon-512x512.icns",
"dev-electron": "yarn build && electron .",
"lint": "node_modules/.bin/eslint src/",
"lint": "eslint src/",
"test": "yarn lint"
},
"eslintConfig": {
"extends": "./.eslintrc.js"
},
"resolutions": {
"electron-download": "4.1.1"
},
Expand All @@ -80,5 +68,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"eslintConfig": {
"extends": "react-app"
}
}
20 changes: 5 additions & 15 deletions src/index.js → src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
import './utils/wdyr';

import React from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import App from 'components/App';
import { unregister } from 'utils/registerServiceWorker';

import store from 'stores/store';
import { Provider } from 'react-redux';

// eslint-disable-next-line
import './index.css';

const rootEl = document.getElementById('root');
const container = document.getElementById('root');
const root = createRoot(container!);

ReactDOM.render(
root.render(
<Provider store={store}>
<App />
</Provider>,
rootEl
</Provider>
);
if (typeof window.process === 'undefined') {
unregister(); // Get rid of the service worker, we don't need it
}

// if (module.hot) {
// module.hot.accept('components/App', () => {
// // eslint-disable-next-line global-require
// const NextApp = require('components/App').default;

// ReactDOM.render(<NextApp />, rootEl);
// });
// }
27 changes: 27 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": "src"
},
"include": [
"src"
]
}
Loading