Skip to content

Commit

Permalink
Merge pull request #341 from dhis2/update-commit-checking-workflows
Browse files Browse the repository at this point in the history
ci: replace semantic commit checks with new workflow
  • Loading branch information
HendrikThePendric authored Jun 13, 2022
2 parents 40c2817 + f7938cb commit f963c5c
Show file tree
Hide file tree
Showing 106 changed files with 52,446 additions and 50,440 deletions.
26 changes: 13 additions & 13 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
version: 1

update_configs:
- package_manager: "javascript"
directory: "/"
update_schedule: "live"
version_requirement_updates: "increase_versions"
- package_manager: "java:maven"
directory: "/"
update_schedule: "monthly"
- package_manager: "docker"
directory: "/"
update_schedule: "weekly"
- package_manager: "submodules"
directory: "/"
update_schedule: "weekly"
- package_manager: 'javascript'
directory: '/'
update_schedule: 'live'
version_requirement_updates: 'increase_versions'
- package_manager: 'java:maven'
directory: '/'
update_schedule: 'monthly'
- package_manager: 'docker'
directory: '/'
update_schedule: 'weekly'
- package_manager: 'submodules'
directory: '/'
update_schedule: 'weekly'
4 changes: 0 additions & 4 deletions .github/semantic.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/dhis2-verify-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'dhis2: verify (commits)'

on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']

jobs:
lint-pr-title:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
- id: commitlint
run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)")
- uses: JulienKode/[email protected]
with:
configuration-path: ${{ steps.commitlint.outputs.config_path }}

lint-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
- id: commitlint
run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)")
- uses: wagoid/commitlint-github-action@v4
with:
configFile: ${{ steps.commitlint.outputs.config_path }}
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ The full api documentation is available [here](https://d2-ci.github.io/d2/). To

For more information on how the models work the [model module documentation](https://d2-ci.github.io/d2/module-model.html) is helpful reference material. For other questions see the [FAQ](https://d2-ci.github.io/d2/tutorial-FAQ.html).


## Quickstart guide

### Install
Expand All @@ -21,24 +20,24 @@ After installing you will be able to import the library into your project by usi

```js
// Using ES2015 imports
import d2 from 'd2';
import d2 from 'd2'

// Using CommonJS imports
var d2 = require('d2');
var d2 = require('d2')
```

### Initialise the library

To be able to use d2 you will first need to initialise the library. This is required to let the library know where it should load its data from (e.g. the schemas, currentUser, authorities). The schemas are the definitions of the data model as used in DHIS2.

To do this you can provide d2 with a `baseUrl` (if you don't provide any the default of `../api` will be used):

```js
import { init } from 'd2';
import { init } from 'd2'

init({ baseUrl: 'http://apps.dhis2.org/dev/api' })
.then(d2 => {
init({ baseUrl: 'http://apps.dhis2.org/dev/api' }).then((d2) => {
//Your d2 is initialised and ready to use.
});
})
```

### Get first page of users and print their names
Expand All @@ -52,7 +51,6 @@ d2.models.user.list()

That's it! See the documentation referenced above for further information.


## Report an issue

The issue tracker can be found in [DHIS2 JIRA](https://jira.dhis2.org)
Expand Down
4 changes: 2 additions & 2 deletions codemods/31.1.0-change-imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module.exports = (fileInfo, api) => {
const ast = j(fileInfo.source)

ast.find(j.ImportDeclaration, j.Literal)
.filter(path => path.node.source.value === 'd2/lib/d2')
.forEach(path => {
.filter((path) => path.node.source.value === 'd2/lib/d2')
.forEach((path) => {
path.node.source.value = 'd2'
})

Expand Down
36 changes: 17 additions & 19 deletions jsdoc.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
{
"source": {
"include": "./src",
"includePattern": ".js$",
"excludePattern": "(node_modules/|docs|__tests__|__mocks__|__fixtures__)"
},
"opts": {
"template": "node_modules/docdash",
"encoding": "utf8",
"destination": "./docs/",
"recurse": true,
"verbose": true
},
"plugins": [
"plugins/markdown"
],
"docdash": {
"static": true,
"sort": true
}
"source": {
"include": "./src",
"includePattern": ".js$",
"excludePattern": "(node_modules/|docs|__tests__|__mocks__|__fixtures__)"
},
"opts": {
"template": "node_modules/docdash",
"encoding": "utf8",
"destination": "./docs/",
"recurse": true,
"verbose": true
},
"plugins": ["plugins/markdown"],
"docdash": {
"static": true,
"sort": true
}
}
138 changes: 69 additions & 69 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
{
"name": "d2",
"version": "31.10.2",
"description": "Javascript library for DHIS2",
"main": "d2.js",
"scripts": {
"build:dev": "webpack --config webpack.config.dev.js --mode development",
"build:docs": "jsdoc -c jsdoc.json --readme ./README.md -u ./tutorials",
"build:prod": "webpack --config webpack.config.prod.js --mode production",
"build": "npm run transpile && npm run build:dev && npm run build:prod && npm run build:docs",
"lint": "d2-style js check",
"test:coverage": "npm test -- --coverage",
"test": "TZ=UTC jest",
"transpile": "babel src --out-dir . --source-maps --ignore '/**/__tests__/*','/**/__mocks__/*','/**/__fixtures__/*'"
},
"repository": {
"type": "git",
"url": "https://github.com/dhis2/d2.git"
},
"keywords": [
"dhis2",
"api",
"library"
],
"author": "Mark Polak",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/dhis2/d2/issues"
},
"homepage": "https://github.com/dhis2/d2",
"dependencies": {
"isomorphic-fetch": "^2.2.1"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.3",
"@babel/plugin-proposal-class-properties": "^7.3.3",
"@babel/preset-env": "^7.3.1",
"@dhis2/cli-style": "^7.2.1",
"eslint-config-airbnb": "^18.2.1",
"babel-loader": "^8.0.5",
"docdash": "^1.0.3",
"form-data": "^2.3.3",
"jest": "^24.1.0",
"jsdoc": "^3.6.6",
"lodash": "^4.17.11",
"rimraf": "^2.6.3",
"webpack": "^4.29.5",
"webpack-cli": "^3.2.3"
},
"engines": {
"npm": ">=3.5.1",
"node": ">=5.1.1"
},
"nyc": {
"sourceMap": false,
"instrument": false
},
"jest": {
"coveragePathIgnorePatterns": [
"/node_modules/",
"/__fixtures__/"
"name": "d2",
"version": "31.10.2",
"description": "Javascript library for DHIS2",
"main": "d2.js",
"scripts": {
"build:dev": "webpack --config webpack.config.dev.js --mode development",
"build:docs": "jsdoc -c jsdoc.json --readme ./README.md -u ./tutorials",
"build:prod": "webpack --config webpack.config.prod.js --mode production",
"build": "npm run transpile && npm run build:dev && npm run build:prod && npm run build:docs",
"lint": "d2-style check js",
"test:coverage": "npm test -- --coverage",
"test": "TZ=UTC jest",
"transpile": "babel src --out-dir . --source-maps --ignore '/**/__tests__/*','/**/__mocks__/*','/**/__fixtures__/*'"
},
"repository": {
"type": "git",
"url": "https://github.com/dhis2/d2.git"
},
"keywords": [
"dhis2",
"api",
"library"
],
"testPathIgnorePatterns": [
".*\\.e2e\\.jsx?$"
"author": "Mark Polak",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/dhis2/d2/issues"
},
"homepage": "https://github.com/dhis2/d2",
"dependencies": {
"isomorphic-fetch": "^2.2.1"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.3",
"@babel/plugin-proposal-class-properties": "^7.3.3",
"@babel/preset-env": "^7.3.1",
"@dhis2/cli-style": "^10.4.1",
"babel-loader": "^8.0.5",
"docdash": "^1.0.3",
"eslint-config-airbnb": "^18.2.1",
"form-data": "^2.3.3",
"jest": "^24.1.0",
"jsdoc": "^3.6.6",
"lodash": "^4.17.11",
"rimraf": "^2.6.3",
"webpack": "^4.29.5",
"webpack-cli": "^3.2.3"
},
"engines": {
"npm": ">=3.5.1",
"node": ">=5.1.1"
},
"nyc": {
"sourceMap": false,
"instrument": false
},
"jest": {
"coveragePathIgnorePatterns": [
"/node_modules/",
"/__fixtures__/"
],
"testPathIgnorePatterns": [
".*\\.e2e\\.jsx?$"
]
},
"files": [
"**/*.js",
"**/*.js.map",
"docs"
]
},
"files": [
"**/*.js",
"**/*.js.map",
"docs"
]
}
20 changes: 4 additions & 16 deletions src/__fixtures__/json/api/analytics/aggregate.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,12 @@
}
},
"dimensions": {
"pe": [
2016
],
"ou": [
"O6uvpzGd5pu"
],
"oZg33kd9taw": [
"Female"
]
"pe": [2016],
"ou": ["O6uvpzGd5pu"],
"oZg33kd9taw": ["Female"]
}
},
"width": 3,
"height": 1,
"rows": [
[
2016,
"O6uvpzGd5pu",
2875
]
]
"rows": [[2016, "O6uvpzGd5pu", 2875]]
}
4 changes: 1 addition & 3 deletions src/__fixtures__/json/api/analytics/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@
},
"dimensions": {
"pe": [],
"ou": [
"ImspTQPwCqd"
],
"ou": ["ImspTQPwCqd"],
"qrur9Dvnyt5": []
}
},
Expand Down
16 changes: 3 additions & 13 deletions src/__fixtures__/json/api/analytics/rawData.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@
}
},
"dimensions": {
"dx": [
"fbfJHSPpUQD",
"cYeuwXTCPkU",
"Jtf34kNZhzP"
],
"dx": ["fbfJHSPpUQD", "cYeuwXTCPkU", "Jtf34kNZhzP"],
"pe": [],
"J5jldMd8OHv": [
"uYxK4wmcPqA",
Expand All @@ -78,14 +74,8 @@
"tDZVQ1WtwpA",
"CXw2yu5fodb"
],
"ou": [
"O6uvpzGd5pu",
"fdc6uOvgoji"
],
"co": [
"pq2XI5kz2BY",
"PT59n8BQbqM"
],
"ou": ["O6uvpzGd5pu", "fdc6uOvgoji"],
"co": ["pq2XI5kz2BY", "PT59n8BQbqM"],
"Bpx0589u8y0": [
"PVLOW4bCshG",
"MAs88nJc9nL",
Expand Down
Loading

0 comments on commit f963c5c

Please sign in to comment.