@loopback/build 5.4.1 → 6.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/CHANGELOG.md +53 -0
- package/bin/compile-package.js +3 -1
- package/bin/run-mocha.js +0 -1
- package/bin/utils.js +0 -1
- package/config/.mocharc.json +1 -1
- package/index.js +2 -0
- package/package.json +48 -44
- package/src/merge-mocha-configs.js +39 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,59 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [6.1.0](https://github.com/strongloop/loopback-next/compare/@loopback/build@6.0.0...@loopback/build@6.1.0) (2020-06-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **build:** add a helper to merge mocha config objects ([3ce9eef](https://github.com/strongloop/loopback-next/commit/3ce9eefdb3a286f2d2b2690ec471f00d8124efb9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [6.0.0](https://github.com/strongloop/loopback-next/compare/@loopback/build@5.4.3...@loopback/build@6.0.0) (2020-06-23)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* set node version to >=10.16 to support events.once ([e39da1c](https://github.com/strongloop/loopback-next/commit/e39da1ca47728eafaf83c10ce35b09b03b6a4edc))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **build:** upgrade to mocha 8.x ([c83270d](https://github.com/strongloop/loopback-next/commit/c83270dbdbe42e1e17fabc7b81c345df45e869d8))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### BREAKING CHANGES
|
|
31
|
+
|
|
32
|
+
* **build:** After have upgraded to `mocha` version 8, which no longer
|
|
33
|
+
supports `--opts` and `test/mocha.opts`. It may break your application
|
|
34
|
+
if it depends on earlier version of `@loopback/build` for `npm test`.
|
|
35
|
+
|
|
36
|
+
See a list of breaking changes of mocha 8.x at:
|
|
37
|
+
https://github.com/mochajs/mocha/releases/tag/v8.0.0
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## [5.4.3](https://github.com/strongloop/loopback-next/compare/@loopback/build@5.4.2...@loopback/build@5.4.3) (2020-06-11)
|
|
44
|
+
|
|
45
|
+
**Note:** Version bump only for package @loopback/build
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## [5.4.2](https://github.com/strongloop/loopback-next/compare/@loopback/build@5.4.1...@loopback/build@5.4.2) (2020-05-28)
|
|
52
|
+
|
|
53
|
+
**Note:** Version bump only for package @loopback/build
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
6
59
|
## [5.4.1](https://github.com/strongloop/loopback-next/compare/@loopback/build@5.4.0...@loopback/build@5.4.1) (2020-05-20)
|
|
7
60
|
|
|
8
61
|
**Note:** Version bump only for package @loopback/build
|
package/bin/compile-package.js
CHANGED
|
@@ -102,11 +102,13 @@ function run(argv, options) {
|
|
|
102
102
|
|
|
103
103
|
const args = [];
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
let cwd = process.env.LERNA_ROOT_PATH || process.cwd();
|
|
106
106
|
if (tsConfigFile && fs.existsSync(tsConfigFile)) {
|
|
107
107
|
const tsconfig = require(tsConfigFile);
|
|
108
108
|
if (tsconfig.references) {
|
|
109
109
|
args.unshift('-b');
|
|
110
|
+
// Reset the cwd for a composite project
|
|
111
|
+
cwd = process.cwd();
|
|
110
112
|
} else {
|
|
111
113
|
// Make the config file relative the current directory
|
|
112
114
|
args.push('-p', path.relative(cwd, tsConfigFile));
|
package/bin/run-mocha.js
CHANGED
package/bin/utils.js
CHANGED
package/config/.mocharc.json
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,46 +1,50 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
2
|
+
"name": "@loopback/build",
|
|
3
|
+
"description": "A set of common scripts and default configurations to build LoopBack 4 or other TypeScript modules",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/strongloop/loopback-next.git",
|
|
7
|
+
"directory": "packages/build"
|
|
8
|
+
},
|
|
9
|
+
"version": "6.1.0",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=10.16"
|
|
12
|
+
},
|
|
13
|
+
"main": "index.js",
|
|
14
|
+
"author": "IBM Corp.",
|
|
15
|
+
"copyright.owner": "IBM Corp.",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@loopback/eslint-config": "^8.0.3",
|
|
22
|
+
"@types/mocha": "^7.0.2",
|
|
23
|
+
"@types/node": "^10.17.26",
|
|
24
|
+
"cross-spawn": "^7.0.3",
|
|
25
|
+
"debug": "^4.1.1",
|
|
26
|
+
"eslint": "^7.3.1",
|
|
27
|
+
"fs-extra": "^9.0.1",
|
|
28
|
+
"glob": "^7.1.6",
|
|
29
|
+
"lodash": "^4.17.15",
|
|
30
|
+
"mocha": "^8.0.1",
|
|
31
|
+
"nyc": "^15.1.0",
|
|
32
|
+
"prettier": "^2.0.5",
|
|
33
|
+
"rimraf": "^3.0.2",
|
|
34
|
+
"source-map-support": "^0.5.19",
|
|
35
|
+
"typescript": "~3.9.5"
|
|
36
|
+
},
|
|
37
|
+
"bin": {
|
|
38
|
+
"lb-tsc": "./bin/compile-package.js",
|
|
39
|
+
"lb-eslint": "./bin/run-eslint.js",
|
|
40
|
+
"lb-prettier": "./bin/run-prettier.js",
|
|
41
|
+
"lb-mocha": "./bin/run-mocha.js",
|
|
42
|
+
"lb-nyc": "./bin/run-nyc.js",
|
|
43
|
+
"lb-clean": "./bin/run-clean.js"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"test": "npm run mocha",
|
|
47
|
+
"mocha": "node bin/run-mocha --timeout 30000 \"test/integration/*.js\" \"test/unit/*.js\""
|
|
48
|
+
},
|
|
49
|
+
"gitHead": "b89db3d3b8be6a36e63e91c2331d217fda7538de"
|
|
46
50
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright IBM Corp. 2017,2020. All Rights Reserved.
|
|
2
|
+
// Node module: @loopback/build
|
|
3
|
+
// This file is licensed under the MIT License.
|
|
4
|
+
// License text available at https://opensource.org/licenses/MIT
|
|
5
|
+
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
const debug = require('debug')('loopback:build:merge-mocha-configs');
|
|
9
|
+
const {assignWith} = require('lodash');
|
|
10
|
+
|
|
11
|
+
module.exports = mergeMochaConfigs;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Merge multiple Mocha configuration files into a single one.
|
|
15
|
+
*
|
|
16
|
+
* @param {MochaConfig[]} configs A list of Mocha configuration objects
|
|
17
|
+
* as provided by `.mocharc.js` files.
|
|
18
|
+
*/
|
|
19
|
+
function mergeMochaConfigs(...configs) {
|
|
20
|
+
debug('Merging mocha configurations', ...configs);
|
|
21
|
+
const result = assignWith({}, ...configs, assignMochaConfigEntry);
|
|
22
|
+
debug('Merged config:', result);
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function assignMochaConfigEntry(targetValue, sourceValue, key) {
|
|
27
|
+
switch (key) {
|
|
28
|
+
case 'timeout':
|
|
29
|
+
return Math.max(targetValue || 0, sourceValue);
|
|
30
|
+
case 'require':
|
|
31
|
+
if (Array.isArray(sourceValue)) {
|
|
32
|
+
debug('Adding an array of files to require:', sourceValue);
|
|
33
|
+
return [...(targetValue || []), ...sourceValue];
|
|
34
|
+
} else {
|
|
35
|
+
debug('Adding a single file to require:', sourceValue);
|
|
36
|
+
return [...(targetValue || []), sourceValue];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|