Skip to content

Commit

Permalink
chore: upgrade cli-style and clean up some internals
Browse files Browse the repository at this point in the history
  • Loading branch information
amcgee committed Aug 27, 2019
1 parent 0231ed5 commit 43817c2
Show file tree
Hide file tree
Showing 24 changed files with 925 additions and 4,637 deletions.
7 changes: 7 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 1

update_configs:
- package_manager: "javascript"
directory: "/"
update_schedule: "live"
version_requirement_updates: "increase_versions"
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/cli/assets
36 changes: 3 additions & 33 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@
const SEVERITY = 2
const { config } = require('@dhis2/cli-style')

module.exports = {
root: true,

parser: 'babel-eslint',

env: {
browser: true,
node: true,
jest: true,
},

extends: [config.eslint],
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],
allowImportExportEverywhere: true,
},
}
4 changes: 4 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
titleOnly: true
commitsOnly: false
titleAndCommits: false
allowMergeCommits: false
1 change: 1 addition & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_extends: .github
6 changes: 6 additions & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
hooks: {
'commit-msg': 'd2-style commit check',
'pre-commit': 'd2-style validate',
},
}
19 changes: 3 additions & 16 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
const { config } = require('@dhis2/cli-style')

module.exports = {
printWidth: 80,
tabWidth: 4,
useTabs: false,
semi: false,
singleQuote: true,
trailingComma: 'es5',
bracketSpacing: true,
jsxBracketSameLine: false,
jsxSingleQuote: false,
arrowParens: 'avoid',
rangeStart: 0,
rangeEnd: Infinity,
proseWrap: 'preserve',
requirePragma: false,
insertPragma: false,
endOfLine: 'lf',
...require(config.prettier),
}
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

Unified application architecture and build pipeline to simplify and standardize application development within the DHIS2 ecosystem.

See the [JIRA epic](https://jira.dhis2.org/browse/TECH-179) for project status.

![DHIS2 application architecture diagram](./docs/images/architecture-diagram.png)
See the [JIRA epic](https://jira.dhis2.org/browse/TECH-179) for project status and [platform.dhis2.nu](https://platform.dhis2.nu) for documentation.
8 changes: 0 additions & 8 deletions cli/config/.eslintrc.js

This file was deleted.

18 changes: 0 additions & 18 deletions cli/config/.prettierrc.js

This file was deleted.

81 changes: 0 additions & 81 deletions cli/config/webpack.configBuilder.js

This file was deleted.

91 changes: 43 additions & 48 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,45 @@
{
"name": "@dhis2/cli-app",
"version": "1.0.0",
"main": "src/index.js",
"repository": "https://github.com/amcgee/dhis2-app-platform",
"author": "Austin McGee <[email protected]>",
"license": "BSD-3-Clause",
"private": true,
"files": [
"assets",
"bin",
"config",
"src"
],
"dependencies": {
"@babel/core": "^7.3.3",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/plugin-proposal-object-rest-spread": "^7.4.4",
"@babel/preset-env": "^7.3.1",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.3.3",
"@dhis2/cli-helpers-engine": "^1.2.0",
"babel-loader": "^8.0.5",
"chalk": "^2.4.2",
"css-loader": "^2.1.0",
"file-loader": "^3.0.1",
"fs-extra": "^7.0.1",
"gaze": "^1.1.3",
"handlebars": "^4.1.2",
"i18next-conv": "^7",
"i18next-scanner": "^2.9.1",
"lodash": "^4.17.11",
"rollup": "^1.15.1",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.0.1",
"style-loader": "^0.23.1",
"styled-jsx": "^3.2.1",
"url-loader": "^1.1.2",
"webpack": "^4.29.5"
},
"bin": {
"d2-app": "./bin/d2-app"
},
"scripts": {
"copy:shell": "mkdir -p assets && rm -rf assets/shell && cp -rf ../shell assets/shell && rm -rf assets/shell/node_modules",
"build": "yarn copy:shell"
}
"name": "@dhis2/cli-app",
"version": "1.0.0",
"main": "src/index.js",
"repository": "https://github.com/amcgee/dhis2-app-platform",
"author": "Austin McGee <[email protected]>",
"license": "BSD-3-Clause",
"files": [
"assets",
"bin",
"config",
"src"
],
"dependencies": {
"@babel/core": "^7.3.3",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/plugin-proposal-object-rest-spread": "^7.4.4",
"@babel/preset-env": "^7.3.1",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.3.3",
"@dhis2/cli-helpers-engine": "^1.2.0",
"chalk": "^2.4.2",
"fs-extra": "^7.0.1",
"gaze": "^1.1.3",
"handlebars": "^4.1.2",
"i18next-conv": "^7",
"i18next-scanner": "^2.9.1",
"lodash": "^4.17.11",
"rollup": "^1.15.1",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.0.1",
"styled-jsx": "^3.2.1",
"react": "*"
},
"bin": {
"d2-app": "./bin/d2-app"
},
"scripts": {
"copy:shell": "mkdir -p assets && rm -rf assets/shell && cp -rf ../shell assets/shell && rm -rf assets/shell/node_modules",
"build": "yarn copy:shell",
"prepublishOnly": "yarn build"
}
}
1 change: 0 additions & 1 deletion cli/src/lib/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const shellAppDirname = 'src/current-d2-app'
module.exports = makePaths = (cwd = process.cwd()) => {
const base = path.resolve(cwd)
const paths = {
webpackConfig: path.join(__dirname, '../../config/webpack.config.js'),
babelConfig: path.join(__dirname, '../../config/babel.config.js'),

shellSource: path.join(__dirname, '../../assets/shell'),
Expand Down
46 changes: 23 additions & 23 deletions examples/simple-app/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"name": "simple-app",
"version": "1.0.0",
"main": "src/index.js",
"repository": "https://github.com/amcgee/dhis2-app-platform",
"author": "Austin McGee <[email protected]>",
"license": "BSD-3-Clause",
"private": true,
"dependencies": {},
"devDependencies": {
"@dhis2/cli-app": "file:../../cli"
},
"scripts": {
"start": "d2-app start",
"build": "d2-app build",
"test": "d2-app test --no-cypress"
},
"peerDependencies": {
"@dhis2/app-runtime": "*",
"@dhis2/d2-i18n": "*",
"react": "^16.8",
"react-dom": "^16.8",
"moment": "*"
}
"name": "simple-app",
"version": "1.0.0",
"main": "src/index.js",
"repository": "https://github.com/amcgee/dhis2-app-platform",
"author": "Austin McGee <[email protected]>",
"license": "BSD-3-Clause",
"private": true,
"dependencies": {},
"devDependencies": {
"@dhis2/cli-app": "file:../../cli"
},
"scripts": {
"start": "d2-app start",
"build": "d2-app build",
"test": "d2-app test --no-cypress"
},
"peerDependencies": {
"@dhis2/app-runtime": "*",
"@dhis2/d2-i18n": "*",
"moment": "*",
"react": "^16.8",
"react-dom": "^16.8"
}
}
Loading

0 comments on commit 43817c2

Please sign in to comment.