Skip to content

Commit 52d4f00

Browse files
authored
chore: prepare 2.0 of d2 (#100)
BREAKING CHANGE: Remove deprecated `d2-cluster seed` command, and update `d2-style` to 4.1.0. - For changelog of what has changed with cli-style, see https://github.com/dhis2/cli-style/blob/master/CHANGELOG.md#breaking-changes for a list of changes. - `d2-cluster seed` has been deprecated in favour of `d2-cluster db restore`, see `d2 cluster db --help` for more information on usage.
1 parent bd004b1 commit 52d4f00

8 files changed

Lines changed: 527 additions & 277 deletions

File tree

.eslintrc.js

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,5 @@
1-
const SEVERITY = 2
1+
const { config } = require('@dhis2/cli-style')
22

33
module.exports = {
4-
root: true,
5-
6-
parser: 'babel-eslint',
7-
8-
env: {
9-
browser: true,
10-
node: true,
11-
jest: true,
12-
},
13-
14-
parserOptions: {
15-
// latest standard is ok, eq. to 9
16-
ecmaVersion: 2018,
17-
ecmaFeatures: {
18-
jsx: true,
19-
modules: true,
20-
},
21-
},
22-
23-
rules: {
24-
'max-params': [
25-
SEVERITY,
26-
{
27-
max: 3,
28-
},
29-
],
30-
'prefer-const': [
31-
SEVERITY,
32-
{
33-
destructuring: 'any',
34-
ignoreReadBeforeAssign: false,
35-
},
36-
],
37-
'no-mixed-spaces-and-tabs': [SEVERITY],
38-
},
4+
extends: [config.eslint],
395
}

.huskyrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
hooks: {
3+
'commit-msg': 'd2-style commit check',
4+
'pre-commit': 'd2-style validate',
5+
},
6+
}

.prettierrc.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1+
const { config } = require('@dhis2/cli-style')
2+
13
module.exports = {
2-
printWidth: 80,
3-
tabWidth: 4,
4-
useTabs: false,
5-
semi: false,
6-
singleQuote: true,
7-
trailingComma: 'es5',
8-
bracketSpacing: true,
9-
jsxBracketSameLine: false,
10-
jsxSingleQuote: false,
11-
arrowParens: 'avoid',
12-
rangeStart: 0,
13-
rangeEnd: Infinity,
14-
proseWrap: 'preserve',
15-
requirePragma: false,
16-
insertPragma: false,
17-
endOfLine: 'lf',
4+
...require(config.prettier),
185
}

package.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,10 @@
1111
],
1212
"license": "BSD-3-Clause",
1313
"devDependencies": {
14-
"@dhis2/cli-style": "3.3.4",
15-
"husky": "^3.0.0",
14+
"@dhis2/cli-style": "4.1.0",
1615
"tape": "^4.11.0",
1716
"tape-await": "^0.1.2"
1817
},
19-
"husky": {
20-
"hooks": {
21-
"commit-msg": "d2-style commit check",
22-
"pre-commit": "d2-style js apply"
23-
}
24-
},
2518
"scripts": {
2619
"test": "tape packages/**/tests/*.js"
2720
}

packages/cluster/src/commands/seed.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

packages/main/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@dhis2/cli-cluster": "1.4.0",
1717
"@dhis2/cli-create": "1.4.0",
1818
"@dhis2/cli-helpers-engine": "1.3.0",
19-
"@dhis2/cli-style": "3.3.4",
19+
"@dhis2/cli-style": "4.1.0",
2020
"@dhis2/cli-utils": "1.4.0",
2121
"cli-table3": "^0.5.1",
2222
"envinfo": "^7.0.0",

packages/main/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const command = namespace('d2', {
66
yargs.command(require('@dhis2/cli-app'))
77
yargs.command(require('@dhis2/cli-cluster'))
88
yargs.command(require('@dhis2/cli-create'))
9-
yargs.command(require('@dhis2/cli-style'))
9+
yargs.command(require('@dhis2/cli-style').command)
1010
yargs.command(require('@dhis2/cli-utils'))
1111
yargs.commandDir('commands')
1212
},

0 commit comments

Comments
 (0)