@wocker/ws 1.0.2 → 1.0.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.
Files changed (100) hide show
  1. package/README.md +1 -1
  2. package/lib/App.d.ts +4 -3
  3. package/lib/App.js +98 -77
  4. package/lib/controllers/ImageController.d.ts +2 -2
  5. package/lib/controllers/ImageController.js +27 -27
  6. package/lib/controllers/PluginController.d.ts +2 -2
  7. package/lib/controllers/PluginController.js +78 -56
  8. package/lib/controllers/PresetController.d.ts +3 -1
  9. package/lib/controllers/PresetController.js +155 -136
  10. package/lib/controllers/ProjectController.d.ts +5 -5
  11. package/lib/controllers/ProjectController.js +653 -603
  12. package/lib/controllers/ProxyController.d.ts +4 -1
  13. package/lib/controllers/ProxyController.js +269 -245
  14. package/lib/controllers/index.js +19 -58
  15. package/lib/env.js +33 -15
  16. package/lib/index.d.ts +2 -0
  17. package/lib/index.js +30 -16
  18. package/lib/makes/Controller.js +4 -8
  19. package/lib/makes/DI.d.ts +7 -0
  20. package/lib/makes/DI.js +27 -0
  21. package/lib/makes/Docker.js +298 -382
  22. package/lib/makes/FS.js +328 -304
  23. package/lib/makes/LineConvertStream.js +37 -40
  24. package/lib/makes/Logger.d.ts +9 -1
  25. package/lib/makes/Logger.js +22 -11
  26. package/lib/makes/Model.js +8 -12
  27. package/lib/makes/MySQL.js +6 -27
  28. package/lib/makes/Plugin.d.ts +1 -1
  29. package/lib/makes/Plugin.js +55 -37
  30. package/lib/makes/Preset.d.ts +46 -0
  31. package/lib/makes/Preset.js +33 -0
  32. package/lib/makes/Project.d.ts +45 -0
  33. package/lib/makes/Project.js +127 -0
  34. package/lib/makes/Repository.js +18 -21
  35. package/lib/makes/index.d.ts +3 -0
  36. package/lib/makes/index.js +23 -69
  37. package/lib/plugins/ElasticSearchPlugin.d.ts +3 -1
  38. package/lib/plugins/ElasticSearchPlugin.js +66 -66
  39. package/lib/plugins/LocaltunnelPlugin.d.ts +2 -2
  40. package/lib/plugins/LocaltunnelPlugin.js +256 -257
  41. package/lib/plugins/MaildevPlugin.d.ts +2 -2
  42. package/lib/plugins/MaildevPlugin.js +45 -44
  43. package/lib/plugins/MongodbPlugin.d.ts +2 -2
  44. package/lib/plugins/MongodbPlugin.js +303 -248
  45. package/lib/plugins/NgrokPlugin.d.ts +2 -2
  46. package/lib/plugins/NgrokPlugin.js +221 -231
  47. package/lib/plugins/PageKitePlugin.d.ts +2 -2
  48. package/lib/plugins/PageKitePlugin.js +150 -149
  49. package/lib/plugins/PostgresPlugin.d.ts +1 -1
  50. package/lib/plugins/PostgresPlugin.js +115 -89
  51. package/lib/plugins/ProxmoxPlugin.d.ts +1 -1
  52. package/lib/plugins/ProxmoxPlugin.js +50 -38
  53. package/lib/plugins/RedisPlugin.d.ts +3 -1
  54. package/lib/plugins/RedisPlugin.js +73 -72
  55. package/lib/plugins/index.js +25 -103
  56. package/lib/services/AppConfigService.d.ts +3 -3
  57. package/lib/services/AppConfigService.js +162 -157
  58. package/lib/services/AppEventsService.js +26 -24
  59. package/lib/services/DockerService.d.ts +37 -2
  60. package/lib/services/DockerService.js +185 -205
  61. package/lib/services/LogService.d.ts +3 -2
  62. package/lib/services/LogService.js +33 -34
  63. package/lib/services/PluginService.d.ts +2 -1
  64. package/lib/services/PluginService.js +11 -14
  65. package/lib/services/PresetService.d.ts +8 -3
  66. package/lib/services/PresetService.js +60 -59
  67. package/lib/services/ProjectService.d.ts +11 -4
  68. package/lib/services/ProjectService.js +140 -129
  69. package/lib/services/index.js +21 -80
  70. package/lib/types/Config.d.ts +4 -3
  71. package/lib/types/Config.js +1 -4
  72. package/lib/types/EnvConfig.js +1 -4
  73. package/lib/types/index.js +16 -25
  74. package/lib/utils/buildOptions.js +5 -8
  75. package/lib/utils/demuxOutput.js +16 -20
  76. package/lib/utils/escapeRegExp.js +4 -7
  77. package/lib/utils/exec.js +38 -39
  78. package/lib/utils/fetch.js +46 -30
  79. package/lib/utils/followProgress.js +66 -77
  80. package/lib/utils/format-size-units.js +16 -16
  81. package/lib/utils/get-config.d.ts +1 -1
  82. package/lib/utils/get-config.js +13 -16
  83. package/lib/utils/get-cursor-position.js +22 -29
  84. package/lib/utils/image-build.js +35 -23
  85. package/lib/utils/index.js +32 -191
  86. package/lib/utils/injectVariables.js +10 -13
  87. package/lib/utils/parse-table.js +20 -23
  88. package/lib/utils/set-config.d.ts +1 -1
  89. package/lib/utils/set-config.js +12 -15
  90. package/lib/utils/spawn.js +17 -20
  91. package/lib/utils/tty.js +2 -6
  92. package/lib/utils/volumeFormat.js +5 -12
  93. package/lib/utils/volumeParse.js +10 -13
  94. package/package.json +13 -39
  95. package/presets/bun/Dockerfile +11 -0
  96. package/presets/bun/config.json +3 -0
  97. package/presets/node/Dockerfile +4 -2
  98. package/presets/php-apache/Dockerfile +3 -2
  99. package/.github/workflows/publish.yml +0 -31
  100. package/plugins/mariadb/admin/conf/config.user.inc.php +0 -9
package/README.md CHANGED
@@ -26,4 +26,4 @@ This will enable tab completion for `ws` commands, providing a more convenient a
26
26
 
27
27
  Wocker is a powerful tool for managing your web project's Docker workspace. It provides a convenient and efficient way to set up and manage your Docker containers.
28
28
 
29
- For more information and detailed usage, please refer to the [documentation](https://kearisp.github.io/wocker)
29
+ For more information and detailed usage, please refer to the [documentation](https://kearisp.github.io/wocker).
package/lib/App.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { DI, Controller } from "@wocker/core";
1
+ import { Controller } from "@wocker/core";
2
2
  import { Cli } from "@kearisp/cli";
3
- import { AppConfigService } from "src/services";
3
+ import { DI } from "./makes";
4
+ import { AppConfigService } from "./services";
4
5
  export declare class App {
5
6
  protected di: DI;
6
7
  protected cli: Cli;
@@ -10,6 +11,6 @@ export declare class App {
10
11
  use(Constructor: {
11
12
  new (...params: any[]): Controller;
12
13
  }): void;
13
- setDebug(status: string): Promise<void>;
14
+ setDebug(status: string): Promise<string>;
14
15
  run(): Promise<string>;
15
16
  }
package/lib/App.js CHANGED
@@ -1,86 +1,107 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
5
17
  });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
6
26
  exports.App = void 0;
7
- var _core = require("@wocker/core");
8
- var _cli = require("@kearisp/cli");
9
- var Path = _interopRequireWildcard(require("path"));
10
- var _env = require("./env");
11
- var _utils = require("./utils");
12
- var _makes = require("./makes");
13
- var _services = require("./services");
14
- var _controllers = require("./controllers");
15
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
27
+ const cli_1 = require("@kearisp/cli");
28
+ const Path = __importStar(require("path"));
29
+ const env_1 = require("./env");
30
+ const utils_1 = require("./utils");
31
+ const makes_1 = require("./makes");
32
+ const services_1 = require("./services");
33
+ const controllers_1 = require("./controllers");
17
34
  class App {
18
- constructor() {
19
- this.di = new _core.DI();
20
- this.appConfigService = new _services.AppConfigService();
21
- this.di.registerService(_core.AppConfigService, this.appConfigService);
22
- this.di.registerService(_core.AppEventsService, new _services.AppEventsService());
23
- this.di.registerService(_core.DockerService, new _services.DockerService(this.di));
24
- this.di.registerService(_core.PresetService, new _services.PresetService(this.di));
25
- this.di.registerService(_services.PluginService, new _services.PluginService(this.di));
26
- this.di.registerService(_core.ProjectService, new _services.ProjectService(this.di));
27
- this.di.registerService(_core.LogService, new _services.LogService(this.di));
28
- this.di.registerService(_cli.Cli, this.cli);
29
- this.cli = new _cli.Cli(_core.Logger);
30
- _core.Preset.install(this.di);
31
- _core.Project.install(this.di);
32
- _core.Logger.install(this.di);
33
- this.install();
34
- this.use(_controllers.ImageController);
35
- this.use(_controllers.PluginController);
36
- this.use(_controllers.PresetController);
37
- this.use(_controllers.ProjectController);
38
- this.use(_controllers.ProxyController);
39
- }
40
- install() {
41
- this.cli.command("completion script").help(false).action(() => this.cli.completionScript());
42
- this.cli.command("log [...items]").action((options, items) => {
43
- _core.Logger.log(...items);
44
- });
45
- this.cli.command("debug <status>").completion("status", () => ["on", "off"]).action(async (options, status) => this.setDebug(status));
46
- }
47
- use(Constructor) {
48
- const controller = new Constructor(this.di);
49
- controller.install(this.cli);
50
- }
51
- async setDebug(status) {
52
- _core.Logger.info(`Set debug ${status}`);
53
- await (0, _utils.setConfig)({
54
- debug: status === "on"
55
- });
56
- }
57
- async run() {
58
- const mapDir = Path.dirname(_env.MAP_PATH);
59
- if (!_makes.FS.existsSync(mapDir)) {
60
- await _makes.FS.mkdir(mapDir);
35
+ constructor() {
36
+ this.di = new makes_1.DI();
37
+ this.appConfigService = new services_1.AppConfigService();
38
+ this.di.registerService(services_1.AppConfigService, this.appConfigService);
39
+ this.di.registerService(services_1.AppEventsService, new services_1.AppEventsService());
40
+ this.di.registerService(services_1.DockerService, new services_1.DockerService(this.di));
41
+ this.di.registerService(services_1.PresetService, new services_1.PresetService(this.di));
42
+ this.di.registerService(services_1.PluginService, new services_1.PluginService(this.di));
43
+ this.di.registerService(services_1.ProjectService, new services_1.ProjectService(this.di));
44
+ this.di.registerService(services_1.LogService, new services_1.LogService(this.di));
45
+ this.di.registerService(cli_1.Cli, this.cli);
46
+ this.cli = new cli_1.Cli(makes_1.Logger);
47
+ makes_1.Preset.install(this.di);
48
+ makes_1.Project.install(this.di);
49
+ makes_1.Logger.install(this.di);
50
+ this.install();
51
+ this.use(controllers_1.ImageController);
52
+ this.use(controllers_1.PluginController);
53
+ this.use(controllers_1.PresetController);
54
+ this.use(controllers_1.ProjectController);
55
+ this.use(controllers_1.ProxyController);
56
+ }
57
+ install() {
58
+ this.cli.command("completion script")
59
+ .help(false)
60
+ .action(() => this.cli.completionScript());
61
+ this.cli.command("log [...items]")
62
+ .action((options, items) => {
63
+ makes_1.Logger.log(...items);
64
+ return "";
65
+ });
66
+ this.cli.command("debug <status>")
67
+ .completion("status", () => ["on", "off"])
68
+ .action(async (options, status) => this.setDebug(status));
61
69
  }
62
- if (!_makes.FS.existsSync(_env.MAP_PATH)) {
63
- await _makes.FS.writeJSON(_env.MAP_PATH, {
64
- projects: []
65
- });
70
+ use(Constructor) {
71
+ const controller = new Constructor(this.di);
72
+ controller.install(this.cli);
66
73
  }
67
- if (!_makes.FS.existsSync(`${_env.DATA_DIR}/projects`)) {
68
- await _makes.FS.mkdir(`${_env.DATA_DIR}/projects`);
74
+ async setDebug(status) {
75
+ makes_1.Logger.info(`Set debug ${status}`);
76
+ await (0, utils_1.setConfig)({
77
+ debug: status === "on"
78
+ });
79
+ return "";
69
80
  }
70
- const {
71
- plugins = []
72
- } = await this.appConfigService.getAppConfig();
73
- for (const plugin of plugins) {
74
- try {
75
- const {
76
- default: Plugin
77
- } = await (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(plugin);
78
- this.use(Plugin);
79
- } catch (err) {
80
- _core.Logger.error(err.message);
81
- }
81
+ async run() {
82
+ const mapDir = Path.dirname(env_1.MAP_PATH);
83
+ if (!makes_1.FS.existsSync(mapDir)) {
84
+ await makes_1.FS.mkdir(mapDir);
85
+ }
86
+ if (!makes_1.FS.existsSync(env_1.MAP_PATH)) {
87
+ await makes_1.FS.writeJSON(env_1.MAP_PATH, {
88
+ projects: []
89
+ });
90
+ }
91
+ if (!makes_1.FS.existsSync(`${env_1.DATA_DIR}/projects`)) {
92
+ await makes_1.FS.mkdir(`${env_1.DATA_DIR}/projects`);
93
+ }
94
+ const { plugins = [] } = await this.appConfigService.getAppConfig();
95
+ for (const plugin of plugins) {
96
+ try {
97
+ const { default: Plugin } = await Promise.resolve(`${plugin}`).then(s => __importStar(require(s)));
98
+ this.use(Plugin);
99
+ }
100
+ catch (err) {
101
+ makes_1.Logger.error(err.message);
102
+ }
103
+ }
104
+ return this.cli.run(process.argv);
82
105
  }
83
- return this.cli.run(process.argv);
84
- }
85
106
  }
86
- exports.App = App;
107
+ exports.App = App;
@@ -1,6 +1,6 @@
1
- import { AppConfigService, DI } from "@wocker/core";
2
1
  import { Cli } from "@kearisp/cli";
3
- import { Controller } from "src/makes";
2
+ import { DI, Controller } from "../makes";
3
+ import { AppConfigService } from "../services";
4
4
  declare class ImageController extends Controller {
5
5
  protected appConfigService: AppConfigService;
6
6
  constructor(di: DI);
@@ -1,31 +1,31 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ImageController = void 0;
7
- var _core = require("@wocker/core");
8
- var _cliTable = _interopRequireDefault(require("cli-table3"));
9
- var _makes = require("../makes");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- class ImageController extends _makes.Controller {
12
- constructor(di) {
13
- super();
14
- this.appConfigService = di.resolveService(_core.AppConfigService);
15
- }
16
- install(cli) {
17
- super.install(cli);
18
- cli.command("images").action(() => this.list());
19
- }
20
- async list() {
21
- const images = await _makes.Docker.imageLs({});
22
- const table = new _cliTable.default({
23
- head: ["Name"]
24
- });
25
- for (const image of images) {
26
- table.push([image.Id]);
7
+ const cli_table3_1 = __importDefault(require("cli-table3"));
8
+ const makes_1 = require("../makes");
9
+ const services_1 = require("../services");
10
+ class ImageController extends makes_1.Controller {
11
+ constructor(di) {
12
+ super();
13
+ this.appConfigService = di.resolveService(services_1.AppConfigService);
14
+ }
15
+ install(cli) {
16
+ super.install(cli);
17
+ cli.command("images")
18
+ .action(() => this.list());
19
+ }
20
+ async list() {
21
+ const images = await makes_1.Docker.imageLs({});
22
+ const table = new cli_table3_1.default({
23
+ head: ["Name"]
24
+ });
25
+ for (const image of images) {
26
+ table.push([image.Id]);
27
+ }
28
+ return table.toString() + "\n";
27
29
  }
28
- return table.toString() + "\n";
29
- }
30
30
  }
31
- exports.ImageController = ImageController;
31
+ exports.ImageController = ImageController;
@@ -1,6 +1,6 @@
1
- import { DI, AppConfigService, Controller } from "@wocker/core";
2
1
  import { Cli } from "@kearisp/cli";
3
- import { PluginService } from "src/services";
2
+ import { DI, Controller } from "../makes";
3
+ import { AppConfigService, PluginService } from "../services";
4
4
  type AddOptions = {};
5
5
  type RemoveOptions = {};
6
6
  declare class PluginController extends Controller {
@@ -1,62 +1,84 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
5
17
  });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
6
29
  exports.PluginController = void 0;
7
- var _core = require("@wocker/core");
8
- var _axios = _interopRequireDefault(require("axios"));
9
- var _chalk = _interopRequireDefault(require("chalk"));
10
- var _services = require("../services");
11
- var _utils = require("../utils");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
- class PluginController extends _core.Controller {
16
- constructor(di) {
17
- super();
18
- this.appConfigService = di.resolveService(_core.AppConfigService);
19
- this.pluginService = di.resolveService(_services.PluginService);
20
- }
21
- install(cli) {
22
- super.install(cli);
23
- cli.command("plugin:add <name>").action((options, name) => this.add(options, name));
24
- cli.command("plugin:remove <name>").action((options, name) => this.remove(options, name));
25
- }
26
- async add(options, addName) {
27
- const [, prefix = "@wocker/", name, suffix = "-plugin"] = /^(@wocker\/)?(\w+)(-plugin)?$/.exec(addName) || [];
28
- const fullName = `${prefix}${name}${suffix}`;
29
- try {
30
- const {
31
- default: Plugin
32
- } = await (specifier => new Promise(r => r(`${specifier}`)).then(s => _interopRequireWildcard(require(s))))(fullName);
33
- this.pluginService.use(Plugin);
34
- await this.appConfigService.activatePlugin(fullName);
35
- console.info(`Plugin ${fullName} activated`);
36
- return;
37
- } catch (err) {
38
- _core.Logger.error(err.message);
30
+ const axios_1 = __importDefault(require("axios"));
31
+ const chalk_1 = __importDefault(require("chalk"));
32
+ const makes_1 = require("../makes");
33
+ const services_1 = require("../services");
34
+ const utils_1 = require("../utils");
35
+ class PluginController extends makes_1.Controller {
36
+ constructor(di) {
37
+ super();
38
+ this.appConfigService = di.resolveService(services_1.AppConfigService);
39
+ this.pluginService = di.resolveService(services_1.PluginService);
40
+ }
41
+ install(cli) {
42
+ super.install(cli);
43
+ cli.command("plugin:add <name>")
44
+ .action((options, name) => this.add(options, name));
45
+ cli.command("plugin:remove <name>")
46
+ .action((options, name) => this.remove(options, name));
47
+ }
48
+ async add(options, addName) {
49
+ const [, prefix = "@wocker/", name, suffix = "-plugin"] = /^(@wocker\/)?(\w+)(-plugin)?$/.exec(addName) || [];
50
+ const fullName = `${prefix}${name}${suffix}`;
51
+ try {
52
+ const { default: Plugin } = await Promise.resolve(`${fullName}`).then(s => __importStar(require(s)));
53
+ this.pluginService.use(Plugin);
54
+ await this.appConfigService.activatePlugin(fullName);
55
+ console.info(`Plugin ${fullName} activated`);
56
+ return;
57
+ }
58
+ catch (err) {
59
+ makes_1.Logger.error(err.message);
60
+ }
61
+ try {
62
+ const res = await axios_1.default.get(`https://registry.npmjs.org/${encodeURIComponent(fullName)}`, {
63
+ validateStatus: () => true
64
+ });
65
+ if (res.status !== 200) {
66
+ console.error(chalk_1.default.red(`Plugin ${fullName} not found`));
67
+ return;
68
+ }
69
+ console.info(`Installing ${fullName}`);
70
+ await (0, utils_1.exec)(`npm install -g ${fullName}`);
71
+ await this.appConfigService.activatePlugin(fullName);
72
+ }
73
+ catch (err) {
74
+ makes_1.Logger.error(err.message);
75
+ }
39
76
  }
40
- try {
41
- const res = await _axios.default.get(`https://registry.npmjs.org/${encodeURIComponent(fullName)}`, {
42
- validateStatus: () => true
43
- });
44
- if (res.status !== 200) {
45
- console.error(_chalk.default.red(`Plugin ${fullName} not found`));
46
- return;
47
- }
48
- console.info(`Installing ${fullName}`);
49
- await (0, _utils.exec)(`npm install -g ${fullName}`);
50
- await this.appConfigService.activatePlugin(fullName);
51
- } catch (err) {
52
- _core.Logger.error(err.message);
77
+ async remove(options, removeName) {
78
+ const [, prefix = "@wocker/", name, suffix = "-plugin"] = /^(@wocker\/)?(\w+)(-plugin)?$/.exec(removeName) || [];
79
+ const fullName = `${prefix}${name}${suffix}`;
80
+ await this.appConfigService.deactivatePlugin(fullName);
81
+ console.info(`Plugin ${fullName} deactivated`);
53
82
  }
54
- }
55
- async remove(options, removeName) {
56
- const [, prefix = "@wocker/", name, suffix = "-plugin"] = /^(@wocker\/)?(\w+)(-plugin)?$/.exec(removeName) || [];
57
- const fullName = `${prefix}${name}${suffix}`;
58
- await this.appConfigService.deactivatePlugin(fullName);
59
- console.info(`Plugin ${fullName} deactivated`);
60
- }
61
83
  }
62
- exports.PluginController = PluginController;
84
+ exports.PluginController = PluginController;
@@ -1,4 +1,6 @@
1
- import { DI, Controller, Cli, AppConfigService, AppEventsService, ProjectService, PresetService, DockerService, Project } from "@wocker/core";
1
+ import { Cli } from "@wocker/core";
2
+ import { DI, Controller, Project } from "../makes";
3
+ import { AppConfigService, AppEventsService, ProjectService, PresetService, DockerService } from "../services";
2
4
  type BuildParams = {
3
5
  rebuild?: boolean;
4
6
  };