@loopback/cli 5.0.0 → 5.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.
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const path = require('node:path');
|
|
7
7
|
const {Minimatch} = require('minimatch');
|
|
8
8
|
const _ = require('lodash');
|
|
9
|
-
const path = require('path');
|
|
10
9
|
const chalk = require('chalk');
|
|
10
|
+
const pkgJson = require('@npmcli/package-json');
|
|
11
|
+
const mapWorkspaces = require('@npmcli/map-workspaces');
|
|
11
12
|
const {git, getYears} = require('./git');
|
|
12
13
|
const {FSE, jsOrTsFiles} = require('./fs');
|
|
13
14
|
const {spdxLicenseList} = require('./license');
|
|
@@ -31,8 +32,7 @@ function getCustomTemplate(customLicenseLines = []) {
|
|
|
31
32
|
if (typeof customLicenseLines === 'string') {
|
|
32
33
|
customLicenseLines = [customLicenseLines];
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
let CUSTOM = UNLICENSED;
|
|
35
|
+
let CUSTOM = _.template(COPYRIGHT.join('\n'));
|
|
36
36
|
if (customLicenseLines.length) {
|
|
37
37
|
let copyrightLines = COPYRIGHT;
|
|
38
38
|
if (customLicenseLines.some(line => line.includes('Copyright'))) {
|
|
@@ -59,10 +59,9 @@ function getHeaderRegEx(customLicenseLines) {
|
|
|
59
59
|
customLicenseLines != null && customLicenseLines.length
|
|
60
60
|
? customLicenseLines
|
|
61
61
|
: COPYRIGHT.concat(LICENSE, customLicenseLines);
|
|
62
|
-
|
|
62
|
+
return lines.map(
|
|
63
63
|
l => new RegExp(escapeRegExp(l).replace(/<%[^>]+%>/g, '.*')),
|
|
64
64
|
);
|
|
65
|
-
return regExp;
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
/**
|
|
@@ -108,7 +107,8 @@ function getCopyrightOwner(pkg, options) {
|
|
|
108
107
|
|
|
109
108
|
/**
|
|
110
109
|
* Build the license template params
|
|
111
|
-
* @param {
|
|
110
|
+
* @param {String|Object} spdxLicense - SPDX license id or object
|
|
111
|
+
* @param {Array} customLicenseLines
|
|
112
112
|
*/
|
|
113
113
|
function expandLicense(spdxLicense, customLicenseLines = []) {
|
|
114
114
|
if (typeof spdxLicense === 'string') {
|
|
@@ -202,13 +202,13 @@ async function updateFileHeaders(projectRoot, options = {}) {
|
|
|
202
202
|
...options,
|
|
203
203
|
};
|
|
204
204
|
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
205
|
+
const {content: rootPkg} = await pkgJson.load(projectRoot);
|
|
206
|
+
if ('workspaces' in rootPkg) {
|
|
207
|
+
const workspaces = await mapWorkspaces({cwd: projectRoot, pkg: rootPkg});
|
|
208
|
+
const packages = Array.from(workspaces, ([name, location]) => ({
|
|
209
|
+
name,
|
|
210
|
+
location,
|
|
211
|
+
}));
|
|
212
212
|
|
|
213
213
|
// Update file headers for each package
|
|
214
214
|
const visited = [];
|
|
@@ -383,7 +383,9 @@ module.exports = class DiscoveryGenerator extends ArtifactGenerator {
|
|
|
383
383
|
Object.assign(templateData.properties[relation.foreignKey], {
|
|
384
384
|
relation,
|
|
385
385
|
});
|
|
386
|
-
relationImports.
|
|
386
|
+
if (!relationImports.includes(relation.type)) {
|
|
387
|
+
relationImports.push(relation.type);
|
|
388
|
+
}
|
|
387
389
|
relationDestinationImports.push(relation.model);
|
|
388
390
|
|
|
389
391
|
foreignKeys[relationName] = {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/cli",
|
|
3
3
|
"description": "Yeoman generator for LoopBack 4",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.1.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"LoopBack",
|
|
7
7
|
"CLI",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
".yo-rc.json"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@
|
|
42
|
+
"@npmcli/map-workspaces": "^3.0.4",
|
|
43
|
+
"@npmcli/package-json": "^3.1.1",
|
|
43
44
|
"@openapi-contrib/openapi-schema-to-json-schema": "^3.3.2",
|
|
44
45
|
"@phenomnomnominal/tsquery": "^5.0.1",
|
|
45
46
|
"camelcase-keys": "^7.0.2",
|
|
@@ -47,19 +48,19 @@
|
|
|
47
48
|
"change-case": "^4.1.2",
|
|
48
49
|
"debug": "^4.3.4",
|
|
49
50
|
"fs-extra": "^11.1.1",
|
|
50
|
-
"glob": "^10.
|
|
51
|
+
"glob": "^10.3.1",
|
|
51
52
|
"inquirer-autocomplete-prompt": "^2.0.0",
|
|
52
53
|
"json5": "^2.2.3",
|
|
53
54
|
"latest-version": "^5.1.0",
|
|
54
55
|
"lodash": "^4.17.21",
|
|
55
|
-
"minimatch": "^9.0.
|
|
56
|
+
"minimatch": "^9.0.2",
|
|
56
57
|
"minimist": "^1.2.8",
|
|
57
58
|
"mkdirp": "^3.0.1",
|
|
58
59
|
"natural-compare": "^1.4.0",
|
|
59
|
-
"pacote": "^15.
|
|
60
|
+
"pacote": "^15.2.0",
|
|
60
61
|
"pluralize": "^8.0.0",
|
|
61
62
|
"regenerate": "^1.4.2",
|
|
62
|
-
"semver": "^7.5.
|
|
63
|
+
"semver": "^7.5.3",
|
|
63
64
|
"slash": "^3.0.0",
|
|
64
65
|
"spdx-license-list": "^6.6.0",
|
|
65
66
|
"stringify-object": "^3.3.0",
|
|
@@ -70,34 +71,33 @@
|
|
|
70
71
|
"terminal-link": "^2.1.1",
|
|
71
72
|
"tildify": "^2.0.0",
|
|
72
73
|
"ts-morph": "^17.0.1",
|
|
73
|
-
"typescript": "~
|
|
74
|
+
"typescript": "~5.1.5",
|
|
74
75
|
"unicode-10.0.0": "^0.7.5",
|
|
75
76
|
"untildify": "^4.0.0",
|
|
76
77
|
"update-notifier": "^5.1.0",
|
|
77
|
-
"url-slug": "^3.0.
|
|
78
|
+
"url-slug": "^3.0.6",
|
|
78
79
|
"validate-npm-package-name": "^5.0.0",
|
|
79
80
|
"write-file-atomic": "^5.0.1",
|
|
80
|
-
"yeoman-environment": "^3.
|
|
81
|
-
"yeoman-generator": "^5.
|
|
81
|
+
"yeoman-environment": "^3.19.3",
|
|
82
|
+
"yeoman-generator": "^5.9.0"
|
|
82
83
|
},
|
|
83
84
|
"devDependencies": {
|
|
84
|
-
"@
|
|
85
|
-
"@loopback/
|
|
86
|
-
"@loopback/
|
|
87
|
-
"@loopback/testlab": "^6.0.0",
|
|
85
|
+
"@loopback/build": "^10.1.0",
|
|
86
|
+
"@loopback/eslint-config": "^14.0.1",
|
|
87
|
+
"@loopback/testlab": "^6.1.0",
|
|
88
88
|
"@types/ejs": "^3.1.2",
|
|
89
89
|
"@types/fs-extra": "^11.0.1",
|
|
90
90
|
"@types/minimatch": "^5.1.2",
|
|
91
|
-
"@types/node": "^
|
|
91
|
+
"@types/node": "^16.18.37",
|
|
92
92
|
"@types/yeoman-environment": "^2.10.8",
|
|
93
93
|
"@types/yeoman-generator": "^5.2.11",
|
|
94
94
|
"loopback": "^3.28.0",
|
|
95
|
-
"loopback-datasource-juggler": "^4.28.
|
|
95
|
+
"loopback-datasource-juggler": "^4.28.7",
|
|
96
96
|
"mem-fs": "^2.3.0",
|
|
97
97
|
"mem-fs-editor": "^9.7.0",
|
|
98
98
|
"mock-stdin": "^1.0.0",
|
|
99
|
-
"rimraf": "^5.0.
|
|
100
|
-
"sinon": "^15.0
|
|
99
|
+
"rimraf": "^5.0.1",
|
|
100
|
+
"sinon": "^15.2.0",
|
|
101
101
|
"strong-globalize-cli": "7.1.0",
|
|
102
102
|
"yeoman-assert": "^3.1.1",
|
|
103
103
|
"yeoman-test": "^6.3.0"
|
|
@@ -198,5 +198,5 @@
|
|
|
198
198
|
"@loopback/sequelize": "^0.3.0"
|
|
199
199
|
}
|
|
200
200
|
},
|
|
201
|
-
"gitHead": "
|
|
201
|
+
"gitHead": "10a8fa7fbd00ac77c4aee3e7f40884b07fe1919c"
|
|
202
202
|
}
|