cra-template-dvhb
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -0,1 +1,8 @@ | ||
# [1.3.0](https://github.com/dvhb/template-react/compare/v1.2.0...v1.3.0) (2020-02-07) | ||
### Features | ||
* set up storybook, tslint and ui ([92e620b](https://github.com/dvhb/template-react/commit/92e620bcbced1da0bd189108f9e05700f5c4fcbe)) | ||
# [1.2.0](https://github.com/dvhb/template-react/compare/v1.1.0...v1.2.0) (2020-02-06) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "cra-template-dvhb", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "The base template for dvhb web app.", | ||
@@ -54,5 +54,5 @@ "keywords": [ | ||
"next", | ||
"webview" | ||
"/^feature.*$/" | ||
] | ||
} | ||
} |
@@ -5,3 +5,6 @@ { | ||
"eject": "react-scripts eject", | ||
"lint": "tslint -p tsconfig.json -c tslint.json -t verbose", | ||
"start": "craco start --verbose", | ||
"storybook": "start-storybook -p 9009 -s public", | ||
"storybook:build": "build-storybook -s public", | ||
"test": "craco test" | ||
@@ -12,9 +15,22 @@ }, | ||
"@craco/craco": "^5.6.2", | ||
"classnames": "^2.2.6" | ||
}, | ||
"devDependencies": { | ||
"@dvhb/tslint-config-react": "^1.0.9", | ||
"@storybook/addon-actions": "^5.3.12", | ||
"@storybook/addon-links": "^5.3.12", | ||
"@storybook/addons": "^5.3.12", | ||
"@storybook/preset-create-react-app": "^1.5.2", | ||
"@storybook/react": "^5.3.12", | ||
"@testing-library/jest-dom": "^4.2.4", | ||
"@testing-library/react": "^9.3.2", | ||
"@testing-library/jest-dom": "^4.2.4", | ||
"@testing-library/user-event": "^7.1.2", | ||
"@types/classnames": "^2.2.9", | ||
"@types/jest": "^24.0.0", | ||
"@types/node": "^12.0.0", | ||
"@types/react": "^16.9.0", | ||
"@types/react-dom": "^16.9.0", | ||
"@types/jest": "^24.0.0", | ||
"node-sass": "^4.13.1", | ||
"prettier": "^1.19.1", | ||
"tslint": "^6.0.0", | ||
"typescript": "~3.7.2" | ||
@@ -21,0 +37,0 @@ } |
@@ -9,3 +9,5 @@ # dvhb web app | ||
- React `16.12.0` | ||
- TypeScript `3.7.2` | ||
- craco `5.6.2` | ||
- react `16.12.0` | ||
- typeScript `3.7.2` | ||
- storybook `5.3.12` |
@@ -18,5 +18,3 @@ // This optional code is used to register a service worker. | ||
// 127.0.0.0/8 are considered localhost for IPv4. | ||
window.location.hostname.match( | ||
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ | ||
) | ||
window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/), | ||
); | ||
@@ -32,6 +30,3 @@ | ||
// The URL constructor is available in all browsers that support SW. | ||
const publicUrl = new URL( | ||
process.env.PUBLIC_URL, | ||
window.location.href | ||
); | ||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); | ||
if (publicUrl.origin !== window.location.origin) { | ||
@@ -54,5 +49,5 @@ // Our service worker won't work if PUBLIC_URL is on a different origin | ||
navigator.serviceWorker.ready.then(() => { | ||
console.log( | ||
console.info( | ||
'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', | ||
); | ||
@@ -83,5 +78,5 @@ }); | ||
// content until all client tabs are closed. | ||
console.log( | ||
console.info( | ||
'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.', | ||
); | ||
@@ -97,3 +92,3 @@ | ||
// "Content is cached for offline use." message. | ||
console.log('Content is cached for offline use.'); | ||
console.info('Content is cached for offline use.'); | ||
@@ -117,3 +112,3 @@ // Execute callback | ||
fetch(swUrl, { | ||
headers: { 'Service-Worker': 'script' } | ||
headers: { 'Service-Worker': 'script' }, | ||
}) | ||
@@ -123,6 +118,3 @@ .then(response => { | ||
const contentType = response.headers.get('content-type'); | ||
if ( | ||
response.status === 404 || | ||
(contentType != null && contentType.indexOf('javascript') === -1) | ||
) { | ||
if (response.status === 404 || (contentType != null && contentType.indexOf('javascript') === -1)) { | ||
// No service worker found. Probably a different app. Reload the page. | ||
@@ -140,5 +132,3 @@ navigator.serviceWorker.ready.then(registration => { | ||
.catch(() => { | ||
console.log( | ||
'No internet connection found. App is running in offline mode.' | ||
); | ||
console.info('No internet connection found. App is running in offline mode.'); | ||
}); | ||
@@ -145,0 +135,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
42878
40
350