@tsed/cli-core 3.20.11 → 3.20.14

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.
@@ -141,14 +141,13 @@ let CliExeca = class CliExeca {
141
141
  constructor() {
142
142
  this.raw = execa;
143
143
  }
144
+
144
145
  /**
145
146
  *
146
147
  * @param cmd
147
148
  * @param args
148
149
  * @param opts
149
150
  */
150
-
151
-
152
151
  run(cmd, args, opts) {
153
152
  const cp = this.raw(cmd, args, opts);
154
153
  const stdout = streamToObservable(cp.stdout.pipe(split()), {
@@ -335,9 +334,14 @@ function defaultPreferences(pkg) {
335
334
 
336
335
  let ProjectPackageJson = class ProjectPackageJson {
337
336
  constructor(configuration) {
338
- this.configuration = configuration;
337
+ this.configuration = void 0;
339
338
  this.rewrite = false;
340
339
  this.reinstall = false;
340
+ this.cliExeca = void 0;
341
+ this.fs = void 0;
342
+ this.GH_TOKEN = void 0;
343
+ this.raw = void 0;
344
+ this.configuration = configuration;
341
345
  this.setRaw({
342
346
  name: "",
343
347
  version: "1.0.0",
@@ -939,6 +943,10 @@ function parseOption(value, options) {
939
943
  }
940
944
 
941
945
  let CliHooks = class CliHooks {
946
+ constructor() {
947
+ this.injector = void 0;
948
+ }
949
+
942
950
  async emit(hookName, cmd, ...args) {
943
951
  const providers = this.injector.getProviders();
944
952
  let results = [];
@@ -974,6 +982,10 @@ let CliService = class CliService {
974
982
  constructor() {
975
983
  this.program = new Command$1();
976
984
  this.reinstallAfterRun = false;
985
+ this.pkg = void 0;
986
+ this.injector = void 0;
987
+ this.hooks = void 0;
988
+ this.projectPkg = void 0;
977
989
  this.commands = new Map();
978
990
  }
979
991
 
@@ -1298,6 +1310,11 @@ function cast(value) {
1298
1310
  }
1299
1311
 
1300
1312
  let CliProxyAgent = class CliProxyAgent {
1313
+ constructor() {
1314
+ this.proxySettings = void 0;
1315
+ this.cliExeca = void 0;
1316
+ }
1317
+
1301
1318
  hasProxy() {
1302
1319
  return !!this.proxySettings.url;
1303
1320
  }
@@ -1383,6 +1400,8 @@ function logToCurl({
1383
1400
 
1384
1401
  let CliHttpLogClient = class CliHttpLogClient {
1385
1402
  constructor(options = {}) {
1403
+ this.callee = void 0;
1404
+ this.logger = void 0;
1386
1405
  this.callee = options.callee || "http";
1387
1406
  }
1388
1407
 
@@ -1464,6 +1483,12 @@ CliHttpLogClient = __decorate([__param(0, Opts), __metadata("design:paramtypes",
1464
1483
 
1465
1484
  var CliHttpClient_1;
1466
1485
  let CliHttpClient = CliHttpClient_1 = class CliHttpClient extends CliHttpLogClient {
1486
+ constructor(...args) {
1487
+ super(...args);
1488
+ this.cliProxyAgent = void 0;
1489
+ this.host = void 0;
1490
+ }
1491
+
1467
1492
  static getParamsSerializer(params) {
1468
1493
  return querystring.stringify(cleanObject(params));
1469
1494
  }
@@ -1579,12 +1604,8 @@ CliHttpClient = CliHttpClient_1 = __decorate([Injectable()], CliHttpClient);
1579
1604
  const all = promises => Promise.all(promises);
1580
1605
 
1581
1606
  async function loadPlugins(injector) {
1582
- const {
1583
- name,
1584
- project: {
1585
- rootDir
1586
- }
1587
- } = injector.settings;
1607
+ const name = injector.settings.get("name");
1608
+ const rootDir = injector.settings.get("project.rootDir");
1588
1609
  const projectPackageJson = injector.invoke(ProjectPackageJson);
1589
1610
  const fs = injector.invoke(CliFs);
1590
1611
  const promises = Object.keys(projectPackageJson.allDependencies).filter(mod => mod.startsWith(`@${name}/cli-plugin`) || mod.includes(`${name}-cli-plugin`)).map(async mod => {
@@ -1604,7 +1625,7 @@ async function loadPlugins(injector) {
1604
1625
 
1605
1626
  injector.add(token, (_GlobalProviders$get2 = GlobalProviders.get(token)) == null ? void 0 : _GlobalProviders$get2.clone());
1606
1627
 
1607
- if (injector.settings.loaded) {
1628
+ if (injector.settings.get("loaded")) {
1608
1629
  await injector.invoke(token);
1609
1630
  }
1610
1631
  }));
@@ -1612,7 +1633,7 @@ async function loadPlugins(injector) {
1612
1633
 
1613
1634
  injector.add(plugin, provider);
1614
1635
 
1615
- if (injector.settings.loaded) {
1636
+ if (injector.settings.get("loaded")) {
1616
1637
  await injector.invoke(plugin);
1617
1638
  }
1618
1639
  }
@@ -1640,6 +1661,10 @@ function addSuffix(pattern, suffix) {
1640
1661
  }
1641
1662
  const SCOPE_SEPARATOR = "%2f";
1642
1663
  let NpmRegistryClient = NpmRegistryClient_1 = class NpmRegistryClient {
1664
+ constructor() {
1665
+ this.httpClient = void 0;
1666
+ }
1667
+
1643
1668
  static escapeName(name) {
1644
1669
  // scoped packages contain slashes and the npm registry expects them to be escaped
1645
1670
  return name.replace("/", SCOPE_SEPARATOR);
@@ -1765,6 +1790,14 @@ function mapPlugins(_ref) {
1765
1790
  }
1766
1791
 
1767
1792
  let CliPlugins = class CliPlugins {
1793
+ constructor() {
1794
+ this.name = void 0;
1795
+ this.npmRegistryClient = void 0;
1796
+ this.injector = void 0;
1797
+ this.cliHooks = void 0;
1798
+ this.packageJson = void 0;
1799
+ }
1800
+
1768
1801
  async searchPlugins(keyword = "", options = {}) {
1769
1802
  const result = await this.npmRegistryClient.search(this.getKeyword(keyword), options);
1770
1803
  return result.filter(({
@@ -1823,6 +1856,10 @@ CliPlugins = __decorate([Injectable()], CliPlugins);
1823
1856
  const runScript = require("@npmcli/run-script");
1824
1857
 
1825
1858
  let CliRunScript = class CliRunScript {
1859
+ constructor() {
1860
+ this.projectPackageJson = void 0;
1861
+ }
1862
+
1826
1863
  run(cmd, args, options = {}) {
1827
1864
  return runScript(_extends({
1828
1865
  event: "run"
@@ -3328,6 +3365,12 @@ const _excluded = ["path"];
3328
3365
  const normalizePath = require("normalize-path");
3329
3366
 
3330
3367
  class Renderer {
3368
+ constructor() {
3369
+ this.configuration = void 0;
3370
+ this.templateDir = void 0;
3371
+ this.fs = void 0;
3372
+ }
3373
+
3331
3374
  async render(path, data, options = {}) {
3332
3375
  const {
3333
3376
  output,
@@ -3468,6 +3511,8 @@ class Renderer {
3468
3511
 
3469
3512
  }
3470
3513
 
3514
+ __decorate([Configuration(), __metadata("design:type", Object)], Renderer.prototype, "configuration", void 0);
3515
+
3471
3516
  __decorate([Constant("templateDir"), __metadata("design:type", String)], Renderer.prototype, "templateDir", void 0);
3472
3517
 
3473
3518
  __decorate([Inject(), __metadata("design:type", CliFs)], Renderer.prototype, "fs", void 0);
@@ -3480,11 +3525,6 @@ let RootRendererService = class RootRendererService extends Renderer {
3480
3525
  }
3481
3526
 
3482
3527
  };
3483
-
3484
- __decorate([Constant("templateDir"), __metadata("design:type", String)], RootRendererService.prototype, "templateDir", void 0);
3485
-
3486
- __decorate([Configuration(), __metadata("design:type", Object)], RootRendererService.prototype, "configuration", void 0);
3487
-
3488
3528
  RootRendererService = __decorate([Injectable()], RootRendererService);
3489
3529
  let SrcRendererService = class SrcRendererService extends Renderer {
3490
3530
  get rootDir() {
@@ -3494,11 +3534,6 @@ let SrcRendererService = class SrcRendererService extends Renderer {
3494
3534
  }
3495
3535
 
3496
3536
  };
3497
-
3498
- __decorate([Constant("templateDir"), __metadata("design:type", String)], SrcRendererService.prototype, "templateDir", void 0);
3499
-
3500
- __decorate([Configuration(), __metadata("design:type", Object)], SrcRendererService.prototype, "configuration", void 0);
3501
-
3502
3537
  SrcRendererService = __decorate([Injectable()], SrcRendererService);
3503
3538
  let ScriptsRendererService = class ScriptsRendererService extends Renderer {
3504
3539
  get rootDir() {
@@ -3508,14 +3543,14 @@ let ScriptsRendererService = class ScriptsRendererService extends Renderer {
3508
3543
  }
3509
3544
 
3510
3545
  };
3511
-
3512
- __decorate([Constant("templateDir"), __metadata("design:type", String)], ScriptsRendererService.prototype, "templateDir", void 0);
3513
-
3514
- __decorate([Configuration(), __metadata("design:type", Object)], ScriptsRendererService.prototype, "configuration", void 0);
3515
-
3516
3546
  ScriptsRendererService = __decorate([Injectable()], ScriptsRendererService);
3517
3547
 
3518
3548
  let CliYaml = class CliYaml {
3549
+ constructor() {
3550
+ this.projectPackageJson = void 0;
3551
+ this.fs = void 0;
3552
+ }
3553
+
3519
3554
  async read(path) {
3520
3555
  const file = !this.fs.exists(path) ? this.fs.findUpFile(this.projectPackageJson.dir, path) : path;
3521
3556
 
@@ -3546,6 +3581,10 @@ __decorate([Inject(), __metadata("design:type", CliFs)], CliYaml.prototype, "fs"
3546
3581
  CliYaml = __decorate([Injectable()], CliYaml);
3547
3582
 
3548
3583
  let CliDockerComposeYaml = class CliDockerComposeYaml {
3584
+ constructor() {
3585
+ this.cliYaml = void 0;
3586
+ }
3587
+
3549
3588
  async read() {
3550
3589
  return this.cliYaml.read("docker-compose.yml");
3551
3590
  }
@@ -3633,6 +3672,8 @@ class CliError extends Error {
3633
3672
  }) {
3634
3673
  super(origin.message);
3635
3674
  this.name = "CLI_ERROR";
3675
+ this.cli = void 0;
3676
+ this.origin = void 0;
3636
3677
  this.cli = cli;
3637
3678
  this.origin = origin;
3638
3679
  this.stack = origin.stack;
@@ -3649,6 +3690,11 @@ function isHelpManual(argv) {
3649
3690
  }
3650
3691
 
3651
3692
  let CliCore = CliCore_1 = class CliCore {
3693
+ constructor() {
3694
+ this.injector = void 0;
3695
+ this.cliService = void 0;
3696
+ }
3697
+
3652
3698
  static checkNodeVersion(wanted, id) {
3653
3699
  if (!semver.satisfies(process.version, wanted)) {
3654
3700
  console.log(chalk.red("You are using Node " + process.version + ", but this version of " + id + " requires Node " + wanted + ".\nPlease upgrade your Node version."));
@@ -3666,7 +3712,7 @@ let CliCore = CliCore_1 = class CliCore {
3666
3712
  const cli = injector.get(CliCore_1);
3667
3713
 
3668
3714
  try {
3669
- await cli.cliService.parseArgs(injector.settings.argv);
3715
+ await cli.cliService.parseArgs(injector.settings.get("argv"));
3670
3716
  } catch (er) {
3671
3717
  throw new CliError({
3672
3718
  origin: er,
@@ -3682,7 +3728,7 @@ let CliCore = CliCore_1 = class CliCore {
3682
3728
  const container = createContainer();
3683
3729
  await injector.load(container, module);
3684
3730
  await injector.emit("$afterInit");
3685
- injector.settings.loaded = true;
3731
+ injector.settings.set("loaded", true);
3686
3732
  }
3687
3733
 
3688
3734
  static updateNotifier(pkg) {