Skip to content
Snippets Groups Projects
Commit 17b54655 authored by bmate711's avatar bmate711
Browse files

Merge branch 'configuration' into 'DEV'

Configuration

See merge request kszk/devteam/bodysch/bodysch-frontend!1
parents 986e5a62 6a4e780a
No related branches found
No related tags found
2 merge requests!7update master to dev,!1Configuration
SKIP_PREFLIGHT_CHECK=true
\ No newline at end of file
.*rc.js
.eslintrc*.js
.prettierrc.js
# Auto generated by React
serviceWorker.*
setupTests.*
\ No newline at end of file
module.exports = {
extends: ['airbnb-typescript'],
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
},
};
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # from .gitignore
# dependencies # dependencies
/node_modules node_modules
/.pnp .pnp
.pnp.js .pnp.js
# testing # Tests
/coverage coverage
.nyc_output
# compiled output
build
dist
# production # env
/build *.env
# misc # OS
.DS_Store .DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
# Logs
logs
*.log
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
lerna-debug.log*
# tools
.eslintcache
# IDE
*.*workspace*
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
.vscode
# commit these, but ignore format
# lock files
yarn.lock
package-lock.json
# assets
*.png
*.jpeg
*.jpg
*.ico
# Docker files
Dockerfile*
Dockerfile.*
docker-compose.*
# Configuration files
config/*
# from .gitignore
# dependencies
node_modules
.pnp
.pnp.js
# Tests
coverage
.nyc_output
# compiled output
build
dist
# env
*.env*
# OS
.DS_Store
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# tools
.eslintcache
# IDE
*.*workspace*
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
.vscode
# commit these, but ignore format
# lock files
yarn.lock
package-lock.json
# assets
*.png
*.jpeg
*.jpg
*.ico
# misc
.*ignore
# Docker files
Dockerfile*
Dockerfile.*
docker-compose.*
# Configuration files
config/*
# Auto generated by React
serviceWorker.*
setupTests.*
\ No newline at end of file
{
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "always",
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf"
}
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
Environment variables needed in development found in `.env.example` !
## Available Scripts ## Available Scripts
In the project directory, you can run: In the project directory, you can run:
...@@ -9,9 +11,6 @@ In the project directory, you can run: ...@@ -9,9 +11,6 @@ In the project directory, you can run:
Runs the app in the development mode.<br /> Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `npm test` ### `npm test`
Launches the test runner in the interactive watch mode.<br /> Launches the test runner in the interactive watch mode.<br />
...@@ -19,26 +18,20 @@ See the section about [running tests](https://facebook.github.io/create-react-ap ...@@ -19,26 +18,20 @@ See the section about [running tests](https://facebook.github.io/create-react-ap
### `npm run build` ### `npm run build`
Builds the app for production to the `build` folder.<br /> Builds the app
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject` ### `npm run lint`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!** Runs the linter in the console.
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. ### `npm run format`
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. Format the files in the project with prettier.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. ### `npm run validate`
## Learn More Checks the formatting and linter rules for all the files in the source.
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). ### `npm run fix`
To learn React, check out the [React documentation](https://reactjs.org/). It runs the formatting and the linter with --fix option
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -2,29 +2,32 @@ ...@@ -2,29 +2,32 @@
"name": "bodysch-frontend", "name": "bodysch-frontend",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@types/jest": "^24.9.1",
"@types/node": "^12.12.29",
"@types/react": "^16.9.23",
"@types/react-dom": "^16.9.5",
"react": "^16.13.0",
"react-dom": "^16.13.0",
"react-scripts": "3.4.0",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^0.88.2",
"typescript": "^3.7.5"
},
"scripts": { "scripts": {
"start": "react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
"test": "react-scripts test", "eject": "react-scripts eject",
"eject": "react-scripts eject" "fix": "run-s format lint:fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "eslint --cache src",
"lint:fix": "eslint src --fix",
"pre-commit": "lint-staged -p false",
"start": "react-scripts start",
"test": "react-scripts test --watchAll=false --passWithNoTests",
"test:watch": "react-scripts test",
"validate": "run-s format:check lint"
}, },
"eslintConfig": { "husky": {
"extends": "react-app" "hooks": {
"pre-commit": "npm run pre-commit"
}
},
"lint-staged": {
"*": [
"prettier --write ."
],
"*.{js,jsx,ts,tsx}": [
"eslint --cache --fix"
]
}, },
"browserslist": { "browserslist": {
"production": [ "production": [
...@@ -37,5 +40,43 @@ ...@@ -37,5 +40,43 @@
"last 1 firefox version", "last 1 firefox version",
"last 1 safari version" "last 1 safari version"
] ]
},
"eslintConfig": {
"extends": "./eslintrc.js"
},
"dependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.0",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^0.88.2",
"typescript": "^3.9.7"
},
"devDependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@types/jest": "^24.9.1",
"@types/node": "^12.12.53",
"@types/react": "^16.9.43",
"@types/react-dom": "^16.9.8",
"@typescript-eslint/eslint-plugin": "^3.7.0",
"@typescript-eslint/parser": "^3.7.0",
"eslint": "^7.5.0",
"eslint-config-airbnb-typescript": "^9.0.0",
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.3",
"husky": "^4.2.5",
"lint-staged": "^10.2.11",
"npm-run-all": "^4.1.5",
"prettier": "^2.0.5",
"prettier-plugin-organize-imports": "^1.1.1",
"prettier-plugin-packagejson": "^2.2.5",
"prettier-plugin-sh": "^0.5.0"
} }
} }
...@@ -5,10 +5,7 @@ ...@@ -5,10 +5,7 @@
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta <meta name="description" content="Web site created using create-react-app" />
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!-- <!--
manifest.json provides metadata used when your web app is installed on a manifest.json provides metadata used when your web app is installed on a
......
import React from "react"; import React from 'react';
function App() { function App() {
return ( return (
<div className="App"> <div className="App">
<header className="App-header"> <header className="App-header">
<p> <p>
Edit <code>src/App.tsx</code> and save to reload. Edit
<code>src/App.tsx</code>
and save to reload.
</p> </p>
<a <a
className="App-link" className="App-link"
......
import React from "react"; import React from 'react';
import ReactDOM from "react-dom"; import ReactDOM from 'react-dom';
import App from "./core/App"; import 'semantic-ui-css/semantic.min.css';
import * as serviceWorker from "./serviceWorker"; import App from './core/App';
import "semantic-ui-css/semantic.min.css"; import * as serviceWorker from './serviceWorker';
ReactDOM.render(<App />, document.getElementById("root")); ReactDOM.render(<App />, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change // If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls. // unregister() to register() below. Note this comes with some pitfalls.
......
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
// opt-in, read https://bit.ly/CRA-PWA // opt-in, read https://bit.ly/CRA-PWA
const isLocalhost = Boolean( const isLocalhost = Boolean(
window.location.hostname === 'localhost' || window.location.hostname === 'localhost'
// [::1] is the IPv6 localhost address. // [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' || || window.location.hostname === '[::1]'
// 127.0.0.0/8 are considered localhost for IPv4. // 127.0.0.0/8 are considered localhost for IPv4.
window.location.hostname.match( || window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/,
) ),
); );
type Config = { type Config = {
...@@ -28,10 +28,7 @@ type Config = { ...@@ -28,10 +28,7 @@ type Config = {
export function register(config?: Config) { export function register(config?: Config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW. // The URL constructor is available in all browsers that support SW.
const publicUrl = new URL( const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
process.env.PUBLIC_URL,
window.location.href
);
if (publicUrl.origin !== window.location.origin) { if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin // Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to // from what our page is served on. This might happen if a CDN is used to
...@@ -50,8 +47,8 @@ export function register(config?: Config) { ...@@ -50,8 +47,8 @@ export function register(config?: Config) {
// service worker/PWA documentation. // service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => { navigator.serviceWorker.ready.then(() => {
console.log( console.log(
'This web app is being served cache-first by a service ' + 'This web app is being served cache-first by a service '
'worker. To learn more, visit https://bit.ly/CRA-PWA' + 'worker. To learn more, visit https://bit.ly/CRA-PWA',
); );
}); });
} else { } else {
...@@ -65,7 +62,7 @@ export function register(config?: Config) { ...@@ -65,7 +62,7 @@ export function register(config?: Config) {
function registerValidSW(swUrl: string, config?: Config) { function registerValidSW(swUrl: string, config?: Config) {
navigator.serviceWorker navigator.serviceWorker
.register(swUrl) .register(swUrl)
.then(registration => { .then((registration) => {
registration.onupdatefound = () => { registration.onupdatefound = () => {
const installingWorker = registration.installing; const installingWorker = registration.installing;
if (installingWorker == null) { if (installingWorker == null) {
...@@ -78,8 +75,8 @@ function registerValidSW(swUrl: string, config?: Config) { ...@@ -78,8 +75,8 @@ function registerValidSW(swUrl: string, config?: Config) {
// but the previous service worker will still serve the older // but the previous service worker will still serve the older
// content until all client tabs are closed. // content until all client tabs are closed.
console.log( console.log(
'New content is available and will be used when all ' + 'New content is available and will be used when all '
'tabs for this page are closed. See https://bit.ly/CRA-PWA.' + 'tabs for this page are closed. See https://bit.ly/CRA-PWA.',
); );
// Execute callback // Execute callback
...@@ -101,7 +98,7 @@ function registerValidSW(swUrl: string, config?: Config) { ...@@ -101,7 +98,7 @@ function registerValidSW(swUrl: string, config?: Config) {
}; };
}; };
}) })
.catch(error => { .catch((error) => {
console.error('Error during service worker registration:', error); console.error('Error during service worker registration:', error);
}); });
} }
...@@ -109,17 +106,17 @@ function registerValidSW(swUrl: string, config?: Config) { ...@@ -109,17 +106,17 @@ function registerValidSW(swUrl: string, config?: Config) {
function checkValidServiceWorker(swUrl: string, config?: Config) { function checkValidServiceWorker(swUrl: string, config?: Config) {
// Check if the service worker can be found. If it can't reload the page. // Check if the service worker can be found. If it can't reload the page.
fetch(swUrl, { fetch(swUrl, {
headers: { 'Service-Worker': 'script' } headers: { 'Service-Worker': 'script' },
}) })
.then(response => { .then((response) => {
// Ensure service worker exists, and that we really are getting a JS file. // Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type'); const contentType = response.headers.get('content-type');
if ( if (
response.status === 404 || response.status === 404
(contentType != null && contentType.indexOf('javascript') === -1) || (contentType != null && contentType.indexOf('javascript') === -1)
) { ) {
// No service worker found. Probably a different app. Reload the page. // No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => { navigator.serviceWorker.ready.then((registration) => {
registration.unregister().then(() => { registration.unregister().then(() => {
window.location.reload(); window.location.reload();
}); });
...@@ -131,7 +128,7 @@ function checkValidServiceWorker(swUrl: string, config?: Config) { ...@@ -131,7 +128,7 @@ function checkValidServiceWorker(swUrl: string, config?: Config) {
}) })
.catch(() => { .catch(() => {
console.log( console.log(
'No internet connection found. App is running in offline mode.' 'No internet connection found. App is running in offline mode.',
); );
}); });
} }
...@@ -139,10 +136,10 @@ function checkValidServiceWorker(swUrl: string, config?: Config) { ...@@ -139,10 +136,10 @@ function checkValidServiceWorker(swUrl: string, config?: Config) {
export function unregister() { export function unregister() {
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready navigator.serviceWorker.ready
.then(registration => { .then((registration) => {
registration.unregister(); registration.unregister();
}) })
.catch(error => { .catch((error) => {
console.error(error.message); console.error(error.message);
}); });
} }
......
File moved
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"lib": [ "lib": ["dom", "dom.iterable", "esnext"],
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"esModuleInterop": true, "esModuleInterop": true,
...@@ -19,7 +15,5 @@ ...@@ -19,7 +15,5 @@
"noEmit": true, "noEmit": true,
"jsx": "react" "jsx": "react"
}, },
"include": [ "include": ["src"]
"src"
]
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment