-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use js cra and support app name config
- Loading branch information
Showing
29 changed files
with
3,020 additions
and
991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# For more information about the properties used in | ||
# this file, please see the EditorConfig documentation: | ||
# https://editorconfig.org/ | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const SEVERITY = 2 | ||
|
||
module.exports = { | ||
root: true, | ||
|
||
parser: 'babel-eslint', | ||
|
||
env: { | ||
browser: true, | ||
node: true, | ||
jest: true, | ||
}, | ||
|
||
parserOptions: { | ||
// latest standard is ok, eq. to 9 | ||
ecmaVersion: 2018, | ||
ecmaFeatures: { | ||
jsx: true, | ||
modules: true, | ||
}, | ||
}, | ||
|
||
rules: { | ||
'max-params': [ | ||
SEVERITY, | ||
{ | ||
max: 3, | ||
}, | ||
], | ||
'prefer-const': [ | ||
SEVERITY, | ||
{ | ||
destructuring: 'any', | ||
ignoreReadBeforeAssign: false, | ||
}, | ||
], | ||
'no-mixed-spaces-and-tabs': [SEVERITY], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
{ | ||
"name": "@dhis2/app-shell", | ||
"version": "0.1.0", | ||
"repository": "https://github.com/amcgee/dhis2-app-platform", | ||
"author": "Austin McGee <[email protected]>", | ||
"license": "BSD-3-Clause", | ||
"private": true, | ||
"dependencies": { | ||
"@dhis2/ui": "^1.0.0-beta.12", | ||
"@types/jest": "24.0.5", | ||
"@types/node": "11.9.4", | ||
"@types/react": "16.8.3", | ||
"@types/react-dom": "16.8.1", | ||
"prop-types": "^15.7.2", | ||
"react": "^16.8.2", | ||
"react-dom": "^16.8.2", | ||
"react-scripts": "2.1.5", | ||
"typeface-roboto": "^0.0.54", | ||
"typescript": "3.3.3" | ||
"@dhis2/app-runtime": "^1.1.0", | ||
"@dhis2/ui-core": "^2.2.0", | ||
"@dhis2/ui-widgets": "^1.0.2", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"react-scripts": "3.0.1" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
|
@@ -27,19 +19,16 @@ | |
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
"installConfig": { | ||
"pnp": false | ||
}, | ||
"browserslist": [ | ||
">0.5%", | ||
"last 2 versions", | ||
"Firefox ESR", | ||
"ie 11", | ||
"not dead" | ||
], | ||
"devDependencies": { | ||
"enzyme": "^3.7.0", | ||
"enzyme-adapter-react-16": "^1.7.0", | ||
"jest-enzyme": "^7.0.2" | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"short_name": "DHIS2 - Simple App", | ||
"name": "Simple DHIS2 App sample", | ||
"icons": [ | ||
{ | ||
"src": "favicon.ico", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
} | ||
], | ||
"start_url": ".", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
"short_name": "React App", | ||
"name": "Create React App Sample", | ||
"icons": [ | ||
{ | ||
"src": "favicon.ico", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
} | ||
], | ||
"start_url": ".", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
packages/app-shell/src/App.tsx → packages/app-shell/src/App.js
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import React from 'react' | ||
import HeaderBar from '@dhis2/ui/widgets/HeaderBar' | ||
import { HeaderBar } from '@dhis2/ui-widgets' | ||
import { DataProvider } from '@dhis2/app-runtime' | ||
|
||
// @ts-ignore | ||
const D2App = React.lazy(() => import('./current-d2-app/App')) // Automatic bundle splitting! | ||
|
||
const url = process.env.REACT_APP_DHIS2_BASE_URL | ||
const url = process.env.REACT_APP_DHIS2_BASE_URL || 'http://localhost:8080' | ||
|
||
const App = () => ( | ||
<div> | ||
<HeaderBar appName={process.env.REACT_APP_DHIS2_APP_NAME} /> | ||
<DataProvider baseUrl={url} apiVersion={32}> | ||
<HeaderBar appName={process.env.REACT_APP_DHIS2_APP_NAME || ''} /> | ||
<React.Suspense fallback={<div />}> | ||
<D2App | ||
config={{ | ||
url, | ||
}} | ||
/> | ||
</React.Suspense> | ||
</div> | ||
</DataProvider> | ||
) | ||
|
||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import App from './App' | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div') | ||
ReactDOM.render(<App />, div) | ||
ReactDOM.unmountComponentAtNode(div) | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.