Skip to content

Commit 67bd72c

Browse files
fix: upgrade cli-app-scripts to enable modern headerbar and tree-shaking (DHIS2-9893) (#192)
* chore: update app scripts and other dhis2 deps * chore: formatting * chore: fix error during linting in actions * chore: fix 'can't resolve locales' error during actions * chore: fix app name in d2.config.js Co-authored-by: Médi-Rémi Hashim <[email protected]>
1 parent b2aa921 commit 67bd72c

12 files changed

+4621
-2218
lines changed

.github/dependabot.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: '/'
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
target-branch: master
9+
versioning-strategy: increase

.github/workflows/dhis2-verify-app.yml

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ jobs:
7676
path: '**/node_modules'
7777
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
7878

79+
- name: Generate translations
80+
run: yarn d2-app-scripts i18n generate
81+
7982
- name: Lint
8083
run: yarn lint
8184

d2.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const config = {
55
coreApp: true,
66

77
entryPoints: {
8-
app: './src/AppWrapper',
8+
app: './src/AppWrapper.js',
99
},
1010
}
1111

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@
2525
},
2626
"homepage": "https://github.com/dhis2/app-management-app#readme",
2727
"devDependencies": {
28-
"@dhis2/cli-app-scripts": "^5.1.0",
29-
"@dhis2/cli-style": "^7.0.0",
28+
"@dhis2/cli-app-scripts": "^6.0.0",
29+
"@dhis2/cli-style": "^7.3.0",
3030
"babel-plugin-minify-replace": "^0.5.0",
3131
"node-sass": "^4.14.1"
3232
},
3333
"dependencies": {
3434
"@babel/polyfill": "^7.2.5",
35-
"@dhis2/app-runtime": "^2.2.2",
35+
"@dhis2/app-runtime": "^2.8.0",
3636
"@dhis2/app-runtime-adapter-d2": "^1.0.1",
37-
"@dhis2/d2-i18n": "^1.0.6",
37+
"@dhis2/d2-i18n": "^1.1.0",
38+
"@dhis2/ui": "^6.5.5",
3839
"d2": "^31.8.2",
3940
"d2-ui": "^29.0.35",
4041
"d2-utilizr": "^0.2.16",

src/AppWrapper.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import React from 'react'
2-
3-
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
41
import { useD2 } from '@dhis2/app-runtime-adapter-d2'
5-
6-
import installedAppHub from './stores/installedApp.store'
2+
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
3+
import React from 'react'
74
import App from './components/App.component'
5+
import installedAppHub from './stores/installedApp.store'
86
import theme from './theme'
97

108
import './locales'

src/actions.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
import Debug from 'debug'
2-
3-
import Action from 'd2-ui/lib/action/Action'
1+
import i18n from '@dhis2/d2-i18n'
42
import { getInstance as getD2 } from 'd2'
3+
import Action from 'd2-ui/lib/action/Action'
4+
import Debug from 'debug'
55
import log from 'loglevel'
6-
76
import appHubStore from './stores/appHub.store'
87
import installedAppHub from './stores/installedApp.store'
98

10-
import i18n from '@dhis2/d2-i18n'
11-
129
const debug = Debug('app-management-app:frontend:client')
1310

1411
const actions = {

src/components/App.component.js

+9-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
import React from 'react'
2-
import PropTypes from 'prop-types'
3-
1+
import i18n from '@dhis2/d2-i18n'
42
import Sidebar from 'd2-ui/lib/sidebar/Sidebar.component'
5-
3+
import { Card, CardText } from 'material-ui/Card'
64
import CircularProgress from 'material-ui/CircularProgress'
5+
import FontIcon from 'material-ui/FontIcon'
76
import LinearProgress from 'material-ui/LinearProgress'
8-
9-
import { Card, CardText } from 'material-ui/Card'
107
import Snackbar from 'material-ui/Snackbar'
11-
import FontIcon from 'material-ui/FontIcon'
12-
13-
import AppList from './AppList.component'
14-
import AppHub from './AppHub.component'
15-
import { SelfUpdateNoticeBox } from './SelfUpdateNoticeBox.component'
16-
import AppTheme from '../theme'
17-
8+
import PropTypes from 'prop-types'
9+
import React from 'react'
1810
import actions from '../actions'
1911
import appHubStore from '../stores/appHub.store'
2012
import installedAppHub from '../stores/installedApp.store'
21-
22-
import i18n from '@dhis2/d2-i18n'
13+
import AppTheme from '../theme'
14+
import AppHub from './AppHub.component'
15+
import AppList from './AppList.component'
16+
import { SelfUpdateNoticeBox } from './SelfUpdateNoticeBox.component'
2317

2418
const styles = {
2519
header: {

src/components/AppHub.component.js

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
import React from 'react'
2-
import PropTypes from 'prop-types'
3-
1+
import i18n from '@dhis2/d2-i18n'
2+
import LoadingMask from 'd2-ui/lib/loading-mask/LoadingMask.component'
3+
import Avatar from 'material-ui/Avatar'
44
import { Card, CardActions, CardHeader, CardText } from 'material-ui/Card'
55
import FlatButton from 'material-ui/FlatButton'
66
import FontIcon from 'material-ui/FontIcon'
7-
import Avatar from 'material-ui/Avatar'
8-
9-
import LoadingMask from 'd2-ui/lib/loading-mask/LoadingMask.component'
10-
11-
import AppTheme from '../theme'
7+
import PropTypes from 'prop-types'
8+
import React from 'react'
129
import actions from '../actions'
13-
import i18n from '@dhis2/d2-i18n'
10+
import AppTheme from '../theme'
1411

1512
/*
1613
* Discontinued...

src/components/AppList.component.js

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
import React from 'react'
2-
import PropTypes from 'prop-types'
3-
1+
import i18n from '@dhis2/d2-i18n'
42
import Avatar from 'material-ui/Avatar'
3+
import { Card, CardText } from 'material-ui/Card'
4+
import FloatingActionButton from 'material-ui/FloatingActionButton'
5+
import FontIcon from 'material-ui/FontIcon'
56
import IconButton from 'material-ui/IconButton'
67
import IconMenu from 'material-ui/IconMenu'
78
import { List, ListItem } from 'material-ui/List'
89
import MenuItem from 'material-ui/MenuItem'
9-
10-
import { Card, CardText } from 'material-ui/Card'
11-
12-
import FloatingActionButton from 'material-ui/FloatingActionButton'
13-
import FontIcon from 'material-ui/FontIcon'
14-
15-
import AppTheme from '../theme'
10+
import PropTypes from 'prop-types'
11+
import React from 'react'
1612
import actions from '../actions'
17-
18-
import i18n from '@dhis2/d2-i18n'
13+
import AppTheme from '../theme'
1914

2015
// const appTypeLabels = {
2116
// app: 'Standard Apps',

src/components/SelfUpdateNoticeBox.component.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/* global __VERSION__ */
22

3-
import React from 'react'
4-
import PropTypes from 'prop-types'
5-
import { NoticeBox, Button } from '@dhis2/ui'
63
import i18n from '@dhis2/d2-i18n'
7-
4+
import { NoticeBox, Button } from '@dhis2/ui'
5+
import PropTypes from 'prop-types'
6+
import React from 'react'
87
import actions from '../actions'
98

109
const currentVersion = __VERSION__

src/theme.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import Spacing from 'material-ui/styles/spacing'
2-
import getMuiTheme from 'material-ui/styles/getMuiTheme'
31
import {
42
blue700,
53
blue100,
@@ -10,6 +8,8 @@ import {
108
white,
119
grey400,
1210
} from 'material-ui/styles/colors'
11+
import getMuiTheme from 'material-ui/styles/getMuiTheme'
12+
import Spacing from 'material-ui/styles/spacing'
1313
import { fade } from 'material-ui/utils/colorManipulator'
1414

1515
const theme = {

0 commit comments

Comments
 (0)