@tsed/cli-core 6.1.1 → 6.1.3

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.
@@ -1,7 +1,8 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { Inject, Injectable } from "@tsed/di";
1
+ import { __decorate } from "tslib";
2
+ import { inject, Injectable } from "@tsed/di";
3
3
  import { join } from "path";
4
4
  import { Observable } from "rxjs";
5
+ import { CliFs } from "../../services/CliFs.js";
5
6
  import { CliYaml } from "../../services/CliYaml.js";
6
7
  import { BaseManager } from "./BaseManager.js";
7
8
  let YarnBerryManager = class YarnBerryManager extends BaseManager {
@@ -9,10 +10,20 @@ let YarnBerryManager = class YarnBerryManager extends BaseManager {
9
10
  super(...arguments);
10
11
  this.name = "yarn_berry";
11
12
  this.cmd = "yarn";
13
+ this.verboseOpt = "";
14
+ this.cliYaml = inject(CliYaml);
15
+ this.fs = inject(CliFs);
12
16
  }
13
17
  async init(options) {
18
+ const lockFile = join(String(options.cwd), "yarn.lock");
19
+ if (!this.fs.exists(lockFile)) {
20
+ this.fs.writeFileSync(lockFile, "");
21
+ }
14
22
  // init yarn v1
15
- this.install(options);
23
+ try {
24
+ await this.install(options).toPromise();
25
+ }
26
+ catch (er) { }
16
27
  // then switch write file
17
28
  await this.cliYaml.write(join(String(options.cwd), ".yarnrc.yml"), {
18
29
  nodeLinker: "node-modules"
@@ -27,13 +38,9 @@ let YarnBerryManager = class YarnBerryManager extends BaseManager {
27
38
  return this.run("add", ["-D", ...deps], options);
28
39
  }
29
40
  install(options) {
30
- return this.run("install", [options.verbose && "--verbose"], options);
41
+ return this.run("install", [], options);
31
42
  }
32
43
  };
33
- __decorate([
34
- Inject(),
35
- __metadata("design:type", CliYaml)
36
- ], YarnBerryManager.prototype, "cliYaml", void 0);
37
44
  YarnBerryManager = __decorate([
38
45
  Injectable({
39
46
  type: "package:manager"
@@ -1,10 +1,13 @@
1
1
  import { Observable } from "rxjs";
2
+ import { CliFs } from "../../services/CliFs.js";
2
3
  import { CliYaml } from "../../services/CliYaml.js";
3
4
  import { BaseManager, type ManagerCmdOpts } from "./BaseManager.js";
4
5
  export declare class YarnBerryManager extends BaseManager {
5
6
  readonly name = "yarn_berry";
6
7
  readonly cmd = "yarn";
8
+ protected verboseOpt: string;
7
9
  protected cliYaml: CliYaml;
10
+ protected fs: CliFs;
8
11
  init(options: ManagerCmdOpts): Promise<void>;
9
12
  add(deps: string[], options: ManagerCmdOpts): Observable<any>;
10
13
  addDev(deps: string[], options: ManagerCmdOpts): Observable<any>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tsed/cli-core",
3
3
  "description": "Build your CLI with TypeScript and Decorators",
4
- "version": "6.1.1",
4
+ "version": "6.1.3",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "source": "./src/index.ts",
@@ -66,7 +66,7 @@
66
66
  "uuid": "^10.0.0"
67
67
  },
68
68
  "devDependencies": {
69
- "@tsed/typescript": "6.1.1",
69
+ "@tsed/typescript": "6.1.3",
70
70
  "@types/commander": "2.12.2",
71
71
  "@types/consolidate": "0.14.4",
72
72
  "@types/figures": "3.0.1",
@@ -83,9 +83,9 @@
83
83
  "vitest": "2.1.1"
84
84
  },
85
85
  "peerDependencies": {
86
- "@tsed/core": ">=8.0.0",
87
- "@tsed/di": ">=8.0.0",
88
- "@tsed/hooks": ">=8.0.0"
86
+ "@tsed/core": ">=8.3.1",
87
+ "@tsed/di": ">=8.3.1",
88
+ "@tsed/hooks": ">=8.3.1"
89
89
  },
90
90
  "repository": "https://github.com/tsedio/tsed-cli",
91
91
  "bugs": {