@loopback/build 1.5.5 → 1.7.1
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 +39 -0
- package/README.md +6 -5
- package/bin/compile-package.js +7 -6
- package/bin/generate-apidocs.js +1 -1
- package/bin/run-clean.js +3 -3
- package/bin/run-eslint.js +49 -0
- package/bin/utils.js +5 -5
- package/config/.eslintignore +4 -0
- package/config/.eslintrc.js +3 -0
- package/docs.json +1 -0
- package/index.js +6 -0
- package/package.json +14 -6
- package/src/fail-on-console-logs.js +1 -1
- package/test/integration/scripts.integration.js +73 -65
- package/api-docs/apple-touch-icon-114x114-precomposed.png +0 -0
- package/api-docs/apple-touch-icon-144x144-precomposed.png +0 -0
- package/api-docs/apple-touch-icon-57x57-precomposed.png +0 -0
- package/api-docs/apple-touch-icon-72x72-precomposed.png +0 -0
- package/api-docs/apple-touch-icon-precomposed.png +0 -0
- package/api-docs/apple-touch-icon.png +0 -0
- package/api-docs/css/bootstrap.min.css +0 -9
- package/api-docs/css/code-themes/arta.css +0 -158
- package/api-docs/css/code-themes/ascetic.css +0 -50
- package/api-docs/css/code-themes/brown_paper.css +0 -104
- package/api-docs/css/code-themes/brown_papersq.png +0 -0
- package/api-docs/css/code-themes/dark.css +0 -103
- package/api-docs/css/code-themes/default.css +0 -135
- package/api-docs/css/code-themes/far.css +0 -111
- package/api-docs/css/code-themes/github.css +0 -127
- package/api-docs/css/code-themes/googlecode.css +0 -144
- package/api-docs/css/code-themes/idea.css +0 -121
- package/api-docs/css/code-themes/ir_black.css +0 -104
- package/api-docs/css/code-themes/magula.css +0 -121
- package/api-docs/css/code-themes/monokai.css +0 -114
- package/api-docs/css/code-themes/pojoaque.css +0 -104
- package/api-docs/css/code-themes/pojoaque.jpg +0 -0
- package/api-docs/css/code-themes/rainbow.css +0 -114
- package/api-docs/css/code-themes/school_book.css +0 -111
- package/api-docs/css/code-themes/school_book.png +0 -0
- package/api-docs/css/code-themes/sl-theme.css +0 -45
- package/api-docs/css/code-themes/solarized_dark.css +0 -88
- package/api-docs/css/code-themes/solarized_light.css +0 -88
- package/api-docs/css/code-themes/sunburst.css +0 -158
- package/api-docs/css/code-themes/tomorrow-night-blue.css +0 -52
- package/api-docs/css/code-themes/tomorrow-night-bright.css +0 -51
- package/api-docs/css/code-themes/tomorrow-night-eighties.css +0 -51
- package/api-docs/css/code-themes/tomorrow-night.css +0 -52
- package/api-docs/css/code-themes/tomorrow.css +0 -49
- package/api-docs/css/code-themes/vs.css +0 -86
- package/api-docs/css/code-themes/xcode.css +0 -154
- package/api-docs/css/code-themes/zenburn.css +0 -115
- package/api-docs/css/main.css +0 -151
- package/api-docs/favicon.ico +0 -0
- package/api-docs/fonts/0ihfXUL2emPh0ROJezvraLO3LdcAZYWl9Si6vvxL-qU.woff +0 -0
- package/api-docs/fonts/OsJ2DjdpjqFRVUSto6IffLO3LdcAZYWl9Si6vvxL-qU.woff +0 -0
- package/api-docs/fonts/_aijTyevf54tkVDLy-dlnLO3LdcAZYWl9Si6vvxL-qU.woff +0 -0
- package/api-docs/index.html +0 -107
- package/api-docs/js/main.js +0 -19
- package/api-docs/js/vendor/bootstrap.min.js +0 -6
- package/api-docs/js/vendor/jquery-1.10.1.min.js +0 -6
- package/api-docs/js/vendor/jquery.scrollTo-1.4.3.1.js +0 -218
- package/api-docs/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,45 @@
|
|
|
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
|
+
## [1.7.1](https://github.com/strongloop/loopback-next/compare/@loopback/build@1.7.0...@loopback/build@1.7.1) (2019-06-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @loopback/build
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [1.7.0](https://github.com/strongloop/loopback-next/compare/@loopback/build@1.6.1...@loopback/build@1.7.0) (2019-06-03)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* replace tslint with eslint ([44185a7](https://github.com/strongloop/loopback-next/commit/44185a7))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [1.6.1](https://github.com/strongloop/loopback-next/compare/@loopback/build@1.6.0...@loopback/build@1.6.1) (2019-05-31)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @loopback/build
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [1.6.0](https://github.com/strongloop/loopback-next/compare/@loopback/build@1.5.5...@loopback/build@1.6.0) (2019-05-30)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Features
|
|
37
|
+
|
|
38
|
+
* **build:** add eslint scripts and default configs ([a6abe86](https://github.com/strongloop/loopback-next/commit/a6abe86))
|
|
39
|
+
* **tsdocs:** add integration with api-extractor/documenter ([c8d9572](https://github.com/strongloop/loopback-next/commit/c8d9572))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
6
45
|
## [1.5.5](https://github.com/strongloop/loopback-next/compare/@loopback/build@1.5.4...@loopback/build@1.5.5) (2019-05-23)
|
|
7
46
|
|
|
8
47
|
**Note:** Version bump only for package @loopback/build
|
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@ LoopBack 4 or other TypeScript modules, including:
|
|
|
6
6
|
- lb-tsc: Use
|
|
7
7
|
[`tsc`](https://www.typescriptlang.org/docs/handbook/compiler-options.html) to
|
|
8
8
|
compile typescript files
|
|
9
|
+
- lb-eslint: Run [`eslint`](https://typescript-eslint.io/)
|
|
9
10
|
- lb-tslint: Run [`tslint`](https://github.com/palantir/tslint)
|
|
10
11
|
- lb-prettier: Run [`prettier`](https://github.com/prettier/prettier)
|
|
11
12
|
- lb-mocha: Run [`mocha`](https://mochajs.org/) to execute test cases
|
|
@@ -32,13 +33,13 @@ To use `@loopback/build` for your package:
|
|
|
32
33
|
"build": "lb-tsc",
|
|
33
34
|
"build:watch": "lb-tsc --watch",
|
|
34
35
|
"clean": "lb-clean",
|
|
35
|
-
"lint": "npm run prettier:check && npm run
|
|
36
|
-
"lint:fix": "npm run prettier:fix && npm run
|
|
36
|
+
"lint": "npm run prettier:check && npm run eslint",
|
|
37
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
37
38
|
"prettier:cli": "lb-prettier \"**/*.ts\" \"**/*.js\"",
|
|
38
39
|
"prettier:check": "npm run prettier:cli -- -l",
|
|
39
40
|
"prettier:fix": "npm run prettier:cli -- --write",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
41
|
+
"eslint": "lb-eslint --report-unused-disable-directives .",
|
|
42
|
+
"eslint:fix": "npm run eslint -- --fix",
|
|
42
43
|
"pretest": "npm run clean && npm run build",
|
|
43
44
|
"test": "lb-mocha \"dist/__tests__\"",
|
|
44
45
|
"posttest": "npm run lint",
|
|
@@ -54,7 +55,7 @@ Now you run the scripts, such as:
|
|
|
54
55
|
- `npm run build` - Compile TypeScript files and copy resources (non `.ts`
|
|
55
56
|
files) to outDir
|
|
56
57
|
- `npm test` - Run all mocha tests
|
|
57
|
-
- `npm run lint` - Run `
|
|
58
|
+
- `npm run lint` - Run `eslint` and `prettier` on source files
|
|
58
59
|
|
|
59
60
|
3. Override default configurations in your project
|
|
60
61
|
|
package/bin/compile-package.js
CHANGED
|
@@ -36,7 +36,7 @@ function run(argv, options) {
|
|
|
36
36
|
'--copy-resources',
|
|
37
37
|
);
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
let target;
|
|
40
40
|
|
|
41
41
|
// --copy-resources is not a TS Compiler option so we remove it from the
|
|
42
42
|
// list of compiler options to avoid compiler errors.
|
|
@@ -47,7 +47,7 @@ function run(argv, options) {
|
|
|
47
47
|
if (!isTargetSet) {
|
|
48
48
|
// Find the last non-option argument as the `target`
|
|
49
49
|
// For example `-p tsconfig.json es2017` or `es2017 -p tsconfig.json`
|
|
50
|
-
for (
|
|
50
|
+
for (let i = compilerOpts.length - 1; i >= 0; i--) {
|
|
51
51
|
target = compilerOpts[i];
|
|
52
52
|
// It's an option
|
|
53
53
|
if (target.indexOf('-') === 0) {
|
|
@@ -69,7 +69,7 @@ function run(argv, options) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
let outDir;
|
|
73
73
|
|
|
74
74
|
if (isOutDirSet) {
|
|
75
75
|
const outDirIx = compilerOpts.indexOf('--outDir');
|
|
@@ -79,14 +79,15 @@ function run(argv, options) {
|
|
|
79
79
|
outDir = path.join(packageDir, utils.getDistribution(target));
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
let tsConfigFile;
|
|
83
83
|
|
|
84
|
+
let rootDir;
|
|
84
85
|
if (!isProjectSet) {
|
|
85
|
-
|
|
86
|
+
rootDir = utils.getRootDir();
|
|
86
87
|
tsConfigFile = utils.getConfigFile('tsconfig.build.json', 'tsconfig.json');
|
|
87
88
|
if (tsConfigFile === path.join(rootDir, 'config/tsconfig.build.json')) {
|
|
88
89
|
// No local tsconfig.build.json or tsconfig.json found
|
|
89
|
-
|
|
90
|
+
let baseConfigFile = path.join(rootDir, 'config/tsconfig.common.json');
|
|
90
91
|
baseConfigFile = path.relative(packageDir, baseConfigFile);
|
|
91
92
|
if (baseConfigFile.indexOf('..' + path.sep) !== 0) {
|
|
92
93
|
// tsconfig only supports relative or rooted path
|
package/bin/generate-apidocs.js
CHANGED
|
@@ -10,7 +10,7 @@ function run(argv, options) {
|
|
|
10
10
|
const utils = require('./utils');
|
|
11
11
|
const fs = require('fs-extra');
|
|
12
12
|
const path = require('path');
|
|
13
|
-
|
|
13
|
+
let tsPath;
|
|
14
14
|
try {
|
|
15
15
|
tsPath = require.resolve('typedoc/node_modules/typescript/package.json');
|
|
16
16
|
} catch (e) {
|
package/bin/run-clean.js
CHANGED
|
@@ -27,8 +27,8 @@ function run(argv, options) {
|
|
|
27
27
|
const rimraf = require('rimraf');
|
|
28
28
|
const path = require('path');
|
|
29
29
|
const utils = require('./utils');
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
let globPatterns = argv.slice(2);
|
|
31
|
+
const removed = [];
|
|
32
32
|
if (!globPatterns.length) {
|
|
33
33
|
globPatterns = [utils.getDistribution()];
|
|
34
34
|
}
|
|
@@ -36,7 +36,7 @@ function run(argv, options) {
|
|
|
36
36
|
if (typeof options === 'boolean') options = {dryRun: options};
|
|
37
37
|
options = options || {};
|
|
38
38
|
globPatterns.forEach(pattern => {
|
|
39
|
-
|
|
39
|
+
const relativePath = path.relative(process.cwd(), pattern);
|
|
40
40
|
if (relativePath.indexOf('..') !== -1) {
|
|
41
41
|
if (!options.dryRun) {
|
|
42
42
|
console.error(
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
|
|
3
|
+
// Node module: @loopback/build
|
|
4
|
+
// This file is licensed under the MIT License.
|
|
5
|
+
// License text available at https://opensource.org/licenses/MIT
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
========
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
node ./bin/run-eslint
|
|
12
|
+
|
|
13
|
+
========
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
'use strict';
|
|
17
|
+
|
|
18
|
+
function run(argv, options) {
|
|
19
|
+
const utils = require('./utils');
|
|
20
|
+
|
|
21
|
+
const eslintOpts = argv.slice(2);
|
|
22
|
+
|
|
23
|
+
const isConfigSet = utils.isOptionSet(eslintOpts, '-c', '--config');
|
|
24
|
+
const isExtSet = utils.isOptionSet(eslintOpts, '--ext');
|
|
25
|
+
|
|
26
|
+
const eslintConfigFile = isConfigSet
|
|
27
|
+
? null
|
|
28
|
+
: utils.getConfigFile('.eslintrc.js', '.eslintrc.json');
|
|
29
|
+
|
|
30
|
+
const eslintIgnoreFile = utils.getConfigFile('.eslintignore');
|
|
31
|
+
|
|
32
|
+
const args = [];
|
|
33
|
+
if (eslintConfigFile) {
|
|
34
|
+
args.push('-c', eslintConfigFile);
|
|
35
|
+
}
|
|
36
|
+
if (eslintIgnoreFile) {
|
|
37
|
+
args.push('--ignore-path', eslintIgnoreFile);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!isExtSet) {
|
|
41
|
+
args.push('--ext', '.js,.ts');
|
|
42
|
+
}
|
|
43
|
+
args.push(...eslintOpts);
|
|
44
|
+
|
|
45
|
+
return utils.runCLI('eslint/bin/eslint', args, options);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
module.exports = run;
|
|
49
|
+
if (require.main === module) run(process.argv);
|
package/bin/utils.js
CHANGED
|
@@ -31,7 +31,7 @@ function getDistribution(target) {
|
|
|
31
31
|
if (!target) {
|
|
32
32
|
target = getCompilationTarget();
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
let dist;
|
|
35
35
|
switch (target) {
|
|
36
36
|
case 'es2018':
|
|
37
37
|
dist = 'dist10';
|
|
@@ -71,8 +71,8 @@ function getPackageDir() {
|
|
|
71
71
|
* @param {string} defaultName Default file
|
|
72
72
|
*/
|
|
73
73
|
function getConfigFile(name, defaultName) {
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
const dir = getPackageDir();
|
|
75
|
+
let configFile = path.join(dir, name);
|
|
76
76
|
if (!fs.existsSync(configFile)) {
|
|
77
77
|
debug('%s does not exist', configFile);
|
|
78
78
|
if (defaultName) {
|
|
@@ -132,7 +132,7 @@ function runCLI(cli, args, options) {
|
|
|
132
132
|
args = options.nodeArgs.concat(args);
|
|
133
133
|
}
|
|
134
134
|
debug('Spawn %s %s', process.execPath, args.join(' '));
|
|
135
|
-
|
|
135
|
+
const child = spawn(
|
|
136
136
|
process.execPath, // Typically '/usr/local/bin/node'
|
|
137
137
|
args,
|
|
138
138
|
Object.assign(
|
|
@@ -167,7 +167,7 @@ function runShell(command, args, options) {
|
|
|
167
167
|
if (options.dryRun) {
|
|
168
168
|
return util.format('%s %s', command, args.join(' '));
|
|
169
169
|
}
|
|
170
|
-
|
|
170
|
+
const child = spawn(
|
|
171
171
|
command,
|
|
172
172
|
args,
|
|
173
173
|
Object.assign(
|
package/docs.json
CHANGED
package/index.js
CHANGED
|
@@ -16,3 +16,9 @@ exports.clean = require('./bin/run-clean');
|
|
|
16
16
|
const utils = require('./bin/utils');
|
|
17
17
|
exports.runCLI = utils.runCLI;
|
|
18
18
|
exports.runShell = utils.runShell;
|
|
19
|
+
|
|
20
|
+
const path = require('path');
|
|
21
|
+
exports.typeScriptPath = path.resolve(
|
|
22
|
+
require.resolve('typescript/package.json'),
|
|
23
|
+
'..',
|
|
24
|
+
);
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/strongloop/loopback-next.git"
|
|
7
7
|
},
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.7.1",
|
|
9
9
|
"engines": {
|
|
10
10
|
"node": ">=8.9"
|
|
11
11
|
},
|
|
@@ -14,11 +14,18 @@
|
|
|
14
14
|
"copyright.owner": "IBM Corp.",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@loopback/
|
|
18
|
-
"@
|
|
17
|
+
"@loopback/eslint-config": "^1.1.1",
|
|
18
|
+
"@loopback/tslint-config": "^2.1.0",
|
|
19
|
+
"@types/mocha": "^5.2.7",
|
|
19
20
|
"@types/node": "^10.11.2",
|
|
21
|
+
"@typescript-eslint/eslint-plugin": "^1.9.0",
|
|
22
|
+
"@typescript-eslint/parser": "^1.9.0",
|
|
20
23
|
"cross-spawn": "^6.0.5",
|
|
21
24
|
"debug": "^4.0.1",
|
|
25
|
+
"eslint": "^5.16.0",
|
|
26
|
+
"eslint-config-prettier": "^4.3.0",
|
|
27
|
+
"eslint-plugin-eslint-plugin": "^2.1.0",
|
|
28
|
+
"eslint-plugin-mocha": "^5.3.0",
|
|
22
29
|
"fs-extra": "^8.0.1",
|
|
23
30
|
"glob": "^7.1.4",
|
|
24
31
|
"mocha": "^6.1.4",
|
|
@@ -27,11 +34,12 @@
|
|
|
27
34
|
"rimraf": "^2.6.2",
|
|
28
35
|
"source-map-support": "^0.5.12",
|
|
29
36
|
"strong-docs": "^4.2.0",
|
|
30
|
-
"tslint": "^5.
|
|
31
|
-
"typescript": "
|
|
37
|
+
"tslint": "^5.17.0",
|
|
38
|
+
"typescript": "~3.5.1"
|
|
32
39
|
},
|
|
33
40
|
"bin": {
|
|
34
41
|
"lb-tsc": "./bin/compile-package.js",
|
|
42
|
+
"lb-eslint": "./bin/run-eslint.js",
|
|
35
43
|
"lb-tslint": "./bin/run-tslint.js",
|
|
36
44
|
"lb-prettier": "./bin/run-prettier.js",
|
|
37
45
|
"lb-mocha": "./bin/run-mocha.js",
|
|
@@ -44,5 +52,5 @@
|
|
|
44
52
|
"test": "npm run mocha",
|
|
45
53
|
"mocha": "node bin/run-mocha --timeout 30000 \"test/integration/*.js\""
|
|
46
54
|
},
|
|
47
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "84f2a09c401f44f3156d90b8d65e9d0a2a4bc78e"
|
|
48
56
|
}
|