generator-ehrcraft-script 1.2.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/generators/app/index.js
CHANGED
|
@@ -9,7 +9,6 @@ module.exports = class extends Generator {
|
|
|
9
9
|
// eslint-disable-next-line no-useless-constructor
|
|
10
10
|
constructor(args,opts) {
|
|
11
11
|
super(args,opts);
|
|
12
|
-
this.env.options.nodePackageManager = 'npm';
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
prompting() {
|
|
@@ -85,5 +84,7 @@ module.exports = class extends Generator {
|
|
|
85
84
|
this.fs.copy(this.templatePath("src"),this.destinationPath("src"));
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
|
|
87
|
+
install() {
|
|
88
|
+
this.spawnCommandSync("pnpm", ["install"]);
|
|
89
|
+
}
|
|
89
90
|
};
|
|
@@ -17,13 +17,15 @@ DIPS has developed a typescript library with API for formscript. There are two v
|
|
|
17
17
|
|
|
18
18
|
DIPS Form Renderer support, currently, attribute names with lower and upper case. This might change and when DIPS Web Renderer support script it will only support lowercase. To be future proof you should upgrade. `v1` is still there for existing repos. They should be migrated into `v2` when changes are done on them.
|
|
19
19
|
|
|
20
|
+
> There are currently (as of september 2024 not implementations using v2 of the API)
|
|
21
|
+
|
|
20
22
|
### How to upgrade?
|
|
21
23
|
|
|
22
24
|
Update package.json file:
|
|
23
25
|
|
|
24
26
|
```json
|
|
25
27
|
"dependencies": {
|
|
26
|
-
"ehrcraft-form-api": "^2.
|
|
28
|
+
"ehrcraft-form-api": "^2.4.0",
|
|
27
29
|
}
|
|
28
30
|
```
|
|
29
31
|
|
|
@@ -34,7 +36,6 @@ Update package.json file:
|
|
|
34
36
|
|
|
35
37
|
```cmd
|
|
36
38
|
npm install gulp-cli -g
|
|
37
|
-
|
|
38
39
|
```
|
|
39
40
|
|
|
40
41
|
## Get started
|
|
@@ -43,9 +44,7 @@ Install the dependencies with npm. This is done by the following commands. Note
|
|
|
43
44
|
|
|
44
45
|
```cmd
|
|
45
46
|
npm update
|
|
46
|
-
|
|
47
47
|
npm update -D
|
|
48
|
-
|
|
49
48
|
```
|
|
50
49
|
|
|
51
50
|
## Code and build
|
|
@@ -61,3 +60,34 @@ When you change the source code it will be automatically compiled and copied int
|
|
|
61
60
|
## Need support?
|
|
62
61
|
|
|
63
62
|
Contact Bifrost by DIPS on bifrost@dips.no.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Using the LAB API
|
|
67
|
+
LAB API is introduced by Arena 24.1. Older version will not have it. This is a case where a feature toggle may be needed. Here we will give an example on how to set this up:
|
|
68
|
+
|
|
69
|
+
### First change the boot in gulpfile
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
const boot = 'var labapi = typeof lab === "undefined" || lab === null? undefined: lab ; main(api,labapi);';
|
|
73
|
+
```
|
|
74
|
+
This snippet will check if lab is present in the context or not. If not present it will define variable `labapi`as undefined.
|
|
75
|
+
|
|
76
|
+
### Use the labapi
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
/**
|
|
80
|
+
* Main function invoked from container (defined by build script)
|
|
81
|
+
* @param api
|
|
82
|
+
* @param lab
|
|
83
|
+
*/
|
|
84
|
+
export function main(api: API, lab: Lab | undefined) {
|
|
85
|
+
if (lab) {
|
|
86
|
+
// the labapi is defined and you can use it in your business logic
|
|
87
|
+
mainWithLab(api, lab);
|
|
88
|
+
} else {
|
|
89
|
+
// main us undefined - you are in an older DIPS Arena with no lab API present
|
|
90
|
+
mainWithNoLab(api);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
@@ -37,6 +37,9 @@ const full_deploy_series = series(compile, injectBootStrapLine, bundle, minify,
|
|
|
37
37
|
* Since version 2.3.x there is support for terminology search and system configuration - they are exposed as "terminology" and "config".
|
|
38
38
|
* main(api,ctx,terminology, config)
|
|
39
39
|
*
|
|
40
|
+
* Since version 2.4.x support for LAB was added. Exposed as lab
|
|
41
|
+
* const boot = 'var labapi = typeof lab === "undefined" || lab === null? undefined: lab ; main(api,labapi);';
|
|
42
|
+
*
|
|
40
43
|
* NOTE:
|
|
41
44
|
* If you want to use api2, the second generation of script api delivered with DIPS Arena 22.2, add the following:
|
|
42
45
|
*
|
|
@@ -44,7 +47,7 @@ const full_deploy_series = series(compile, injectBootStrapLine, bundle, minify,
|
|
|
44
47
|
*
|
|
45
48
|
* Then you have to changes the export function main(......) in index.ts as well
|
|
46
49
|
*/
|
|
47
|
-
const boot = 'main(api,ctx,terminology,
|
|
50
|
+
const boot = 'main(api,ctx,terminology,config);';
|
|
48
51
|
|
|
49
52
|
/**
|
|
50
53
|
* Task to compile source as typescript
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<%= appname %>",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "<%= appname %>",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "ts-mocha test/**/*.spec.ts"
|
|
8
|
-
},
|
|
9
|
-
"keywords": [
|
|
10
|
-
"openEHR",
|
|
11
|
-
"<%= appname %>",
|
|
12
|
-
"BIFROST",
|
|
13
|
-
"Arena"
|
|
14
|
-
],
|
|
15
|
-
"author": "Bjørn Næss <bna@dips.no>",
|
|
16
|
-
"license": "ISC",
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"browserify": "^17.0.0",
|
|
19
|
-
"ehrcraft-form-api": "^2.
|
|
20
|
-
"gulp": "^4.0.0",
|
|
21
|
-
"gulp-inject-string": "^1.1.2",
|
|
22
|
-
"gulp-rename": "^2.0.0",
|
|
23
|
-
"gulp-terser": "^2.1.0",
|
|
24
|
-
"gulp-typescript": "^6.0.0-alpha.1",
|
|
25
|
-
"mocha": "^10.2.0",
|
|
26
|
-
"through": "^2.3.8",
|
|
27
|
-
"ts-mocha": "^10.0.0",
|
|
28
|
-
"typescript": "^4.9.5",
|
|
29
|
-
"vinyl-buffer": "^1.0.1",
|
|
30
|
-
"vinyl-source-stream": "^2.0.0",
|
|
31
|
-
"yaml": "^2.2.1"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {}
|
|
34
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= appname %>",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "<%= appname %>",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "ts-mocha test/**/*.spec.ts"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"openEHR",
|
|
11
|
+
"<%= appname %>",
|
|
12
|
+
"BIFROST",
|
|
13
|
+
"Arena"
|
|
14
|
+
],
|
|
15
|
+
"author": "Bjørn Næss <bna@dips.no>",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"browserify": "^17.0.0",
|
|
19
|
+
"ehrcraft-form-api": "^2.6.0",
|
|
20
|
+
"gulp": "^4.0.0",
|
|
21
|
+
"gulp-inject-string": "^1.1.2",
|
|
22
|
+
"gulp-rename": "^2.0.0",
|
|
23
|
+
"gulp-terser": "^2.1.0",
|
|
24
|
+
"gulp-typescript": "^6.0.0-alpha.1",
|
|
25
|
+
"mocha": "^10.2.0",
|
|
26
|
+
"through": "^2.3.8",
|
|
27
|
+
"ts-mocha": "^10.0.0",
|
|
28
|
+
"typescript": "^4.9.5",
|
|
29
|
+
"vinyl-buffer": "^1.0.1",
|
|
30
|
+
"vinyl-source-stream": "^2.0.0",
|
|
31
|
+
"yaml": "^2.2.1"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {}
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "generator-ehrcraft-script",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "A code generator for DIPS Forms typescript",
|
|
5
|
-
"homepage": "https://dev.azure.com/dips/DIPS%20Configured%20Products/_git/generator-ehrcraft-script",
|
|
6
|
-
"author": {
|
|
7
|
-
"name": "Bjørn Næss",
|
|
8
|
-
"email": "bna@dips.no",
|
|
9
|
-
"url": "https://dev.azure.com/dips/DIPS%20Configured%20Products/_git/generator-ehrcraft-script"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"generators"
|
|
13
|
-
],
|
|
14
|
-
"main": "generators/index.js",
|
|
15
|
-
"keywords": [
|
|
16
|
-
"",
|
|
17
|
-
"yeoman-generator"
|
|
18
|
-
],
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@types/chai": "^4.3.4",
|
|
21
|
-
"@types/mocha": "^10.0.1",
|
|
22
|
-
"chai": "^4.3.7",
|
|
23
|
-
"coveralls": "^3.1.1",
|
|
24
|
-
"ehrcraft-form-api": "^2.3.4",
|
|
25
|
-
"eslint": "^8.31.0",
|
|
26
|
-
"eslint-config-prettier": "^8.6.0",
|
|
27
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
28
|
-
"husky": "^4.3.8",
|
|
29
|
-
"jest": "^29.3.1",
|
|
30
|
-
"lint-staged": "^13.1.0",
|
|
31
|
-
"mocha": "^10.2.0",
|
|
32
|
-
"prettier": "^2.8.2",
|
|
33
|
-
"ts-mockito": "^2.6.1",
|
|
34
|
-
"yeoman-assert": "^3.1.1",
|
|
35
|
-
"yeoman-test": "^7.2.0"
|
|
36
|
-
},
|
|
37
|
-
"engines": {
|
|
38
|
-
"npm": ">= 4.0.0"
|
|
39
|
-
},
|
|
40
|
-
"dependencies": {
|
|
41
|
-
"chalk": "4.1.2",
|
|
42
|
-
"loadash": "^1.0.0",
|
|
43
|
-
"lodash": "^4.17.21",
|
|
44
|
-
"yeoman-generator": "^5.7.0",
|
|
45
|
-
"yosay": "^2.0.2"
|
|
46
|
-
},
|
|
47
|
-
"jest": {
|
|
48
|
-
"testEnvironment": "node"
|
|
49
|
-
},
|
|
50
|
-
"lint-staged": {
|
|
51
|
-
"*.js": [
|
|
52
|
-
"eslint --fix",
|
|
53
|
-
"git add"
|
|
54
|
-
],
|
|
55
|
-
"*.json": [
|
|
56
|
-
"prettier --write",
|
|
57
|
-
"git add"
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
"husky": {
|
|
61
|
-
"hooks": {
|
|
62
|
-
"pre-commit": "lint-staged"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"eslintConfig": {
|
|
66
|
-
"extends": [
|
|
67
|
-
"eslint:recommended"
|
|
68
|
-
],
|
|
69
|
-
"env": {
|
|
70
|
-
"jest": true,
|
|
71
|
-
"node": true
|
|
72
|
-
},
|
|
73
|
-
"rules": {
|
|
74
|
-
"prettier/prettier": "error"
|
|
75
|
-
},
|
|
76
|
-
"plugins": [
|
|
77
|
-
"prettier"
|
|
78
|
-
]
|
|
79
|
-
},
|
|
80
|
-
"scripts": {
|
|
81
|
-
"pretest": "eslint .",
|
|
82
|
-
"test": "jest"
|
|
83
|
-
},
|
|
84
|
-
"repository": "ehrforce/generator-ehrcraft-script",
|
|
85
|
-
"license": "MIT"
|
|
86
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "generator-ehrcraft-script",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "A code generator for DIPS Forms typescript",
|
|
5
|
+
"homepage": "https://dev.azure.com/dips/DIPS%20Configured%20Products/_git/generator-ehrcraft-script",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Bjørn Næss",
|
|
8
|
+
"email": "bna@dips.no",
|
|
9
|
+
"url": "https://dev.azure.com/dips/DIPS%20Configured%20Products/_git/generator-ehrcraft-script"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"generators"
|
|
13
|
+
],
|
|
14
|
+
"main": "generators/index.js",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"",
|
|
17
|
+
"yeoman-generator"
|
|
18
|
+
],
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/chai": "^4.3.4",
|
|
21
|
+
"@types/mocha": "^10.0.1",
|
|
22
|
+
"chai": "^4.3.7",
|
|
23
|
+
"coveralls": "^3.1.1",
|
|
24
|
+
"ehrcraft-form-api": "^2.3.4",
|
|
25
|
+
"eslint": "^8.31.0",
|
|
26
|
+
"eslint-config-prettier": "^8.6.0",
|
|
27
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
28
|
+
"husky": "^4.3.8",
|
|
29
|
+
"jest": "^29.3.1",
|
|
30
|
+
"lint-staged": "^13.1.0",
|
|
31
|
+
"mocha": "^10.2.0",
|
|
32
|
+
"prettier": "^2.8.2",
|
|
33
|
+
"ts-mockito": "^2.6.1",
|
|
34
|
+
"yeoman-assert": "^3.1.1",
|
|
35
|
+
"yeoman-test": "^7.2.0"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"npm": ">= 4.0.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"chalk": "^4.1.2",
|
|
42
|
+
"loadash": "^1.0.0",
|
|
43
|
+
"lodash": "^4.17.21",
|
|
44
|
+
"yeoman-generator": "^5.7.0",
|
|
45
|
+
"yosay": "^2.0.2"
|
|
46
|
+
},
|
|
47
|
+
"jest": {
|
|
48
|
+
"testEnvironment": "node"
|
|
49
|
+
},
|
|
50
|
+
"lint-staged": {
|
|
51
|
+
"*.js": [
|
|
52
|
+
"eslint --fix",
|
|
53
|
+
"git add"
|
|
54
|
+
],
|
|
55
|
+
"*.json": [
|
|
56
|
+
"prettier --write",
|
|
57
|
+
"git add"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"husky": {
|
|
61
|
+
"hooks": {
|
|
62
|
+
"pre-commit": "lint-staged"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"eslintConfig": {
|
|
66
|
+
"extends": [
|
|
67
|
+
"eslint:recommended"
|
|
68
|
+
],
|
|
69
|
+
"env": {
|
|
70
|
+
"jest": true,
|
|
71
|
+
"node": true
|
|
72
|
+
},
|
|
73
|
+
"rules": {
|
|
74
|
+
"prettier/prettier": "error"
|
|
75
|
+
},
|
|
76
|
+
"plugins": [
|
|
77
|
+
"prettier"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"pretest": "eslint .",
|
|
82
|
+
"test": "jest"
|
|
83
|
+
},
|
|
84
|
+
"repository": "ehrforce/generator-ehrcraft-script",
|
|
85
|
+
"license": "MIT"
|
|
86
|
+
}
|