@tsed/cli-core 3.20.14 → 3.20.17
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/lib/index.js +84 -120
- package/lib/index.js.map +1 -1
- package/lib/index.modern.js +23 -27
- package/lib/index.modern.js.map +1 -1
- package/lib/services/CliExeca.d.ts +21 -19
- package/lib/services/CliHttpClient.d.ts +1 -1
- package/package.json +18 -17
package/lib/index.modern.js
CHANGED
|
@@ -14,16 +14,21 @@ import { EMPTY, throwError, Observable } from 'rxjs';
|
|
|
14
14
|
import { merge, filter, catchError } from 'rxjs/operators';
|
|
15
15
|
import semver$1 from 'semver';
|
|
16
16
|
import execa from 'execa';
|
|
17
|
+
import 'any-observable/register/rxjs-all';
|
|
18
|
+
import streamToObservable from '@samverschueren/stream-to-observable';
|
|
17
19
|
import Fs, { existsSync } from 'fs-extra';
|
|
18
20
|
import readPkgUp from 'read-pkg-up';
|
|
19
21
|
import axios from 'axios';
|
|
20
|
-
import querystring from 'querystring';
|
|
22
|
+
import querystring, { stringify } from 'querystring';
|
|
21
23
|
import tunnel from 'tunnel';
|
|
22
24
|
import { camelCase, snakeCase } from 'change-case';
|
|
23
25
|
import parse from 'url-parse';
|
|
24
26
|
import chalk from 'chalk';
|
|
25
27
|
import url from 'url';
|
|
28
|
+
import registry_url from 'registry-url';
|
|
29
|
+
import runScript from '@npmcli/run-script';
|
|
26
30
|
import Consolidate from 'consolidate';
|
|
31
|
+
import normalizePath$1 from 'normalize-path';
|
|
27
32
|
import globby from 'globby';
|
|
28
33
|
import handlebars from 'handlebars';
|
|
29
34
|
import JsYaml from 'js-yaml';
|
|
@@ -131,10 +136,6 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
131
136
|
return target;
|
|
132
137
|
}
|
|
133
138
|
|
|
134
|
-
require("any-observable/register/rxjs-all");
|
|
135
|
-
|
|
136
|
-
const streamToObservable = require("@samverschueren/stream-to-observable");
|
|
137
|
-
|
|
138
139
|
const split = require("split");
|
|
139
140
|
|
|
140
141
|
let CliExeca = class CliExeca {
|
|
@@ -176,14 +177,14 @@ CliExeca = __decorate([Injectable()], CliExeca);
|
|
|
176
177
|
|
|
177
178
|
const fixPath = require("normalize-path");
|
|
178
179
|
|
|
179
|
-
function normalizePath
|
|
180
|
+
function normalizePath(item, ...paths) {
|
|
180
181
|
if (isString(item)) {
|
|
181
182
|
const path = join(item, ...paths);
|
|
182
183
|
return fixPath(path);
|
|
183
184
|
}
|
|
184
185
|
|
|
185
186
|
if (isArray(item)) {
|
|
186
|
-
return item.map(item => normalizePath
|
|
187
|
+
return item.map(item => normalizePath(item));
|
|
187
188
|
}
|
|
188
189
|
|
|
189
190
|
return item;
|
|
@@ -199,7 +200,7 @@ let CliFs = class CliFs {
|
|
|
199
200
|
}
|
|
200
201
|
|
|
201
202
|
join(...args) {
|
|
202
|
-
return normalizePath
|
|
203
|
+
return normalizePath(join(...args));
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
async readFile(file, encoding) {
|
|
@@ -1490,7 +1491,7 @@ let CliHttpClient = CliHttpClient_1 = class CliHttpClient extends CliHttpLogClie
|
|
|
1490
1491
|
}
|
|
1491
1492
|
|
|
1492
1493
|
static getParamsSerializer(params) {
|
|
1493
|
-
return
|
|
1494
|
+
return stringify(cleanObject(params));
|
|
1494
1495
|
}
|
|
1495
1496
|
|
|
1496
1497
|
async $onInit() {
|
|
@@ -1647,9 +1648,7 @@ async function loadPlugins(injector) {
|
|
|
1647
1648
|
}
|
|
1648
1649
|
|
|
1649
1650
|
var NpmRegistryClient_1;
|
|
1650
|
-
|
|
1651
|
-
const HOST = require("registry-url")();
|
|
1652
|
-
|
|
1651
|
+
const HOST = registry_url();
|
|
1653
1652
|
const REGEX_REGISTRY_ENFORCED_HTTPS = /^https?:\/\/([^\/]+\.)?(yarnpkg\.com|npmjs\.(org|com))(\/|$)/;
|
|
1654
1653
|
const REGEX_REGISTRY_PREFIX = /^(https?:)?\/\//i;
|
|
1655
1654
|
function addSuffix(pattern, suffix) {
|
|
@@ -1816,7 +1815,7 @@ let CliPlugins = class CliPlugins {
|
|
|
1816
1815
|
const tasks = plugins.map(plugin => {
|
|
1817
1816
|
return {
|
|
1818
1817
|
title: `Run plugin '${chalk.cyan(plugin)}'`,
|
|
1819
|
-
task: () => this.cliHooks.emit(CommandStoreKeys.ADD, plugin)
|
|
1818
|
+
task: () => this.cliHooks.emit(CommandStoreKeys.ADD, plugin, ctx)
|
|
1820
1819
|
};
|
|
1821
1820
|
});
|
|
1822
1821
|
return [...tasks, {
|
|
@@ -1853,8 +1852,6 @@ __decorate([Inject(), __metadata("design:type", ProjectPackageJson)], CliPlugins
|
|
|
1853
1852
|
|
|
1854
1853
|
CliPlugins = __decorate([Injectable()], CliPlugins);
|
|
1855
1854
|
|
|
1856
|
-
const runScript = require("@npmcli/run-script");
|
|
1857
|
-
|
|
1858
1855
|
let CliRunScript = class CliRunScript {
|
|
1859
1856
|
constructor() {
|
|
1860
1857
|
this.projectPackageJson = void 0;
|
|
@@ -2974,9 +2971,9 @@ const helpers$2 = {};
|
|
|
2974
2971
|
* @api public
|
|
2975
2972
|
*/
|
|
2976
2973
|
|
|
2977
|
-
helpers$2.extend = function
|
|
2978
|
-
/*objects*/
|
|
2979
|
-
{
|
|
2974
|
+
helpers$2.extend = function
|
|
2975
|
+
/*objects*/
|
|
2976
|
+
() {
|
|
2980
2977
|
// eslint-disable-next-line prefer-rest-params
|
|
2981
2978
|
const args = [].slice.call(arguments);
|
|
2982
2979
|
let opts = {};
|
|
@@ -3361,9 +3358,6 @@ function insertAfter(fileContent, content, pattern) {
|
|
|
3361
3358
|
}
|
|
3362
3359
|
|
|
3363
3360
|
const _excluded = ["path"];
|
|
3364
|
-
|
|
3365
|
-
const normalizePath = require("normalize-path");
|
|
3366
|
-
|
|
3367
3361
|
class Renderer {
|
|
3368
3362
|
constructor() {
|
|
3369
3363
|
this.configuration = void 0;
|
|
@@ -3378,7 +3372,7 @@ class Renderer {
|
|
|
3378
3372
|
rootDir
|
|
3379
3373
|
} = this.mapOptions(path, options);
|
|
3380
3374
|
let content = "";
|
|
3381
|
-
const file = normalizePath(join(templateDir, path));
|
|
3375
|
+
const file = normalizePath$1(join(templateDir, path));
|
|
3382
3376
|
|
|
3383
3377
|
if (path.endsWith(".hbs")) {
|
|
3384
3378
|
content = await Consolidate.handlebars(file, data);
|
|
@@ -3449,10 +3443,12 @@ class Renderer {
|
|
|
3449
3443
|
return existsSync(join(templateDir, path));
|
|
3450
3444
|
}
|
|
3451
3445
|
|
|
3452
|
-
scan(pattern, options = {}) {
|
|
3453
|
-
|
|
3446
|
+
async scan(pattern, options = {}) {
|
|
3447
|
+
const result = await globby(pattern.map(s => normalizePath$1(s)), _extends({}, options, {
|
|
3448
|
+
objectMode: true,
|
|
3454
3449
|
cwd: this.rootDir
|
|
3455
3450
|
}));
|
|
3451
|
+
return result.map(entry => entry.path);
|
|
3456
3452
|
}
|
|
3457
3453
|
|
|
3458
3454
|
relativeFrom(path) {
|
|
@@ -3494,11 +3490,11 @@ class Renderer {
|
|
|
3494
3490
|
} = options;
|
|
3495
3491
|
|
|
3496
3492
|
if (options.baseDir) {
|
|
3497
|
-
output = normalizePath(join("/", relative(options.baseDir, path)));
|
|
3493
|
+
output = normalizePath$1(join("/", relative(options.baseDir, path)));
|
|
3498
3494
|
}
|
|
3499
3495
|
|
|
3500
3496
|
if (options.basename) {
|
|
3501
|
-
output = normalizePath(join(dirname(output), options.basename));
|
|
3497
|
+
output = normalizePath$1(join(dirname(output), options.basename));
|
|
3502
3498
|
}
|
|
3503
3499
|
|
|
3504
3500
|
output = output.replace(/\.hbs$/, "");
|
|
@@ -3828,5 +3824,5 @@ Command$1.prototype.helpInformation = function help() {
|
|
|
3828
3824
|
return "\n" + str.replace("Usage:", chalk.green("Usage:")).replace("Options:", chalk.green("Options:")).replace(/<(\w+)>/gi, `<${chalk.yellow("$1")}>`).replace(/\[(\w+)]/gi, `[${chalk.cyan("$1")}]`) + "\n";
|
|
3829
3825
|
};
|
|
3830
3826
|
|
|
3831
|
-
export { CliConfiguration, CliCore, CliDockerComposeYaml, CliExeca, CliFs, CliHttpClient, CliPackageJson, CliPlugins, CliRunScript, CliService, CliYaml, Command, NpmRegistryClient, OnAdd, OnExec, OnPostInstall, OnPrompt, PackageManager, ProjectPackageJson, Renderer, RootRendererService, SCOPE_SEPARATOR, ScriptsRendererService, SrcRendererService, addSuffix, createInjector, createSubTasks, createTasks, createTasksRunner, getCommandMetadata, getLogger, getPackageJson, loadPlugins, logToCurl, mapCommanderArgs, mapCommanderOptions, normalizePath
|
|
3827
|
+
export { CliConfiguration, CliCore, CliDockerComposeYaml, CliExeca, CliFs, CliHttpClient, CliPackageJson, CliPlugins, CliRunScript, CliService, CliYaml, Command, NpmRegistryClient, OnAdd, OnExec, OnPostInstall, OnPrompt, PackageManager, ProjectPackageJson, Renderer, RootRendererService, SCOPE_SEPARATOR, ScriptsRendererService, SrcRendererService, addSuffix, createInjector, createSubTasks, createTasks, createTasksRunner, getCommandMetadata, getLogger, getPackageJson, loadPlugins, logToCurl, mapCommanderArgs, mapCommanderOptions, normalizePath, parseOption };
|
|
3832
3828
|
//# sourceMappingURL=index.modern.js.map
|