@wocker/ws 1.0.1 → 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 (136) hide show
  1. package/README.md +11 -137
  2. package/bin/ws.js +7 -3
  3. package/lib/App.d.ts +10 -7
  4. package/lib/App.js +99 -44
  5. package/lib/controllers/ImageController.d.ts +4 -2
  6. package/lib/controllers/ImageController.js +27 -25
  7. package/lib/controllers/PluginController.d.ts +14 -0
  8. package/lib/controllers/PluginController.js +84 -0
  9. package/lib/controllers/PresetController.d.ts +21 -0
  10. package/lib/controllers/PresetController.js +169 -0
  11. package/lib/controllers/ProjectController.d.ts +11 -3
  12. package/lib/controllers/ProjectController.js +653 -536
  13. package/lib/{plugins/ProxyPlugin.d.ts → controllers/ProxyController.d.ts} +12 -11
  14. package/lib/controllers/ProxyController.js +273 -0
  15. package/lib/controllers/index.d.ts +3 -0
  16. package/lib/controllers/index.js +19 -25
  17. package/lib/env.js +33 -22
  18. package/lib/index.d.ts +2 -0
  19. package/lib/index.js +29 -28
  20. package/lib/makes/Controller.js +4 -8
  21. package/lib/makes/DI.d.ts +7 -0
  22. package/lib/makes/DI.js +27 -0
  23. package/lib/makes/Docker.js +299 -397
  24. package/lib/makes/FS.d.ts +1 -1
  25. package/lib/makes/FS.js +328 -301
  26. package/lib/makes/LineConvertStream.js +37 -40
  27. package/lib/makes/Logger.d.ts +5 -3
  28. package/lib/makes/Logger.js +18 -34
  29. package/lib/makes/Model.js +8 -12
  30. package/lib/makes/MySQL.js +6 -27
  31. package/lib/makes/Plugin.d.ts +1 -1
  32. package/lib/makes/Plugin.js +55 -37
  33. package/lib/makes/Preset.d.ts +46 -0
  34. package/lib/makes/Preset.js +33 -0
  35. package/lib/{models → makes}/Project.d.ts +23 -16
  36. package/lib/makes/Project.js +127 -0
  37. package/lib/makes/Repository.js +18 -21
  38. package/lib/makes/index.d.ts +3 -0
  39. package/lib/makes/index.js +23 -69
  40. package/lib/plugins/ElasticSearchPlugin.d.ts +18 -0
  41. package/lib/plugins/ElasticSearchPlugin.js +72 -0
  42. package/lib/plugins/LocaltunnelPlugin.d.ts +4 -4
  43. package/lib/plugins/LocaltunnelPlugin.js +256 -255
  44. package/lib/plugins/MaildevPlugin.d.ts +4 -2
  45. package/lib/plugins/MaildevPlugin.js +45 -41
  46. package/lib/plugins/MongodbPlugin.d.ts +6 -4
  47. package/lib/plugins/MongodbPlugin.js +303 -254
  48. package/lib/plugins/NgrokPlugin.d.ts +3 -4
  49. package/lib/plugins/NgrokPlugin.js +221 -230
  50. package/lib/plugins/PageKitePlugin.d.ts +3 -4
  51. package/lib/plugins/PageKitePlugin.js +150 -147
  52. package/lib/plugins/PostgresPlugin.d.ts +1 -1
  53. package/lib/plugins/PostgresPlugin.js +115 -88
  54. package/lib/plugins/ProxmoxPlugin.d.ts +1 -1
  55. package/lib/plugins/ProxmoxPlugin.js +50 -38
  56. package/lib/plugins/RedisPlugin.d.ts +10 -2
  57. package/lib/plugins/RedisPlugin.js +77 -39
  58. package/lib/plugins/index.d.ts +2 -6
  59. package/lib/plugins/index.js +25 -158
  60. package/lib/services/AppConfigService.d.ts +13 -3
  61. package/lib/services/AppConfigService.js +161 -71
  62. package/lib/services/AppEventsService.d.ts +5 -8
  63. package/lib/services/AppEventsService.js +26 -25
  64. package/lib/services/DockerService.d.ts +51 -0
  65. package/lib/services/DockerService.js +200 -0
  66. package/lib/services/LogService.d.ts +12 -0
  67. package/lib/services/LogService.js +38 -0
  68. package/lib/services/PluginService.d.ts +11 -0
  69. package/lib/services/PluginService.js +15 -0
  70. package/lib/services/PresetService.d.ts +14 -0
  71. package/lib/services/PresetService.js +64 -0
  72. package/lib/services/ProjectService.d.ts +12 -4
  73. package/lib/services/ProjectService.js +141 -78
  74. package/lib/services/index.d.ts +4 -0
  75. package/lib/services/index.js +21 -36
  76. package/lib/types/Config.d.ts +4 -3
  77. package/lib/types/Config.js +1 -4
  78. package/lib/types/EnvConfig.js +1 -4
  79. package/lib/types/index.js +16 -25
  80. package/lib/utils/buildOptions.js +5 -8
  81. package/lib/utils/demuxOutput.js +16 -22
  82. package/lib/utils/escapeRegExp.js +4 -7
  83. package/lib/utils/exec.d.ts +1 -1
  84. package/lib/utils/exec.js +38 -40
  85. package/lib/utils/fetch.js +45 -30
  86. package/lib/utils/followProgress.js +66 -77
  87. package/lib/utils/format-size-units.js +16 -16
  88. package/lib/utils/get-config.d.ts +1 -1
  89. package/lib/utils/get-config.js +13 -16
  90. package/lib/utils/get-cursor-position.js +22 -29
  91. package/lib/utils/image-build.js +35 -23
  92. package/lib/utils/index.d.ts +0 -4
  93. package/lib/utils/index.js +32 -235
  94. package/lib/utils/injectVariables.js +10 -13
  95. package/lib/utils/parse-table.js +20 -23
  96. package/lib/utils/set-config.d.ts +1 -1
  97. package/lib/utils/set-config.js +12 -15
  98. package/lib/utils/spawn.js +17 -20
  99. package/lib/utils/tty.js +2 -6
  100. package/lib/utils/volumeFormat.js +5 -12
  101. package/lib/utils/volumeParse.js +10 -13
  102. package/package.json +21 -47
  103. package/presets/bun/Dockerfile +11 -0
  104. package/presets/bun/config.json +3 -0
  105. package/presets/node/Dockerfile +4 -2
  106. package/presets/node/config.json +9 -7
  107. package/presets/php-apache/Dockerfile +40 -38
  108. package/presets/php-apache/config.json +10 -15
  109. package/presets/php-fpm/Dockerfile +21 -0
  110. package/presets/php-fpm/config.json +25 -0
  111. package/lib/models/Preset.d.ts +0 -19
  112. package/lib/models/Preset.js +0 -60
  113. package/lib/models/Project.js +0 -151
  114. package/lib/models/index.d.ts +0 -2
  115. package/lib/models/index.js +0 -27
  116. package/lib/plugins/MariadbPlugin.d.ts +0 -25
  117. package/lib/plugins/MariadbPlugin.js +0 -297
  118. package/lib/plugins/PresetPlugin.d.ts +0 -19
  119. package/lib/plugins/PresetPlugin.js +0 -164
  120. package/lib/plugins/ProjectPlugin.d.ts +0 -12
  121. package/lib/plugins/ProjectPlugin.js +0 -54
  122. package/lib/plugins/ProxyPlugin.js +0 -257
  123. package/lib/plugins/ServeoPlugin.d.ts +0 -36
  124. package/lib/plugins/ServeoPlugin.js +0 -260
  125. package/lib/plugins/TestPlugin.d.ts +0 -10
  126. package/lib/plugins/TestPlugin.js +0 -75
  127. package/lib/utils/promptConfirm.d.ts +0 -6
  128. package/lib/utils/promptConfirm.js +0 -21
  129. package/lib/utils/promptGroup.d.ts +0 -16
  130. package/lib/utils/promptGroup.js +0 -39
  131. package/lib/utils/promptSelect.d.ts +0 -12
  132. package/lib/utils/promptSelect.js +0 -47
  133. package/lib/utils/promptText.d.ts +0 -13
  134. package/lib/utils/promptText.js +0 -53
  135. package/plugins/mariadb/admin/conf/config.user.inc.php +0 -9
  136. package/plugins/serveo/Dockerfile +0 -17
@@ -1,561 +1,678 @@
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.ProjectController = void 0;
7
- var _cliTable = _interopRequireDefault(require("cli-table3"));
8
- var _chalk = _interopRequireDefault(require("chalk"));
9
- var Path = _interopRequireWildcard(require("path"));
10
- var _asyncMutex = require("async-mutex");
11
- var _env = require("../env");
12
- var _makes = require("../makes");
13
- var _models = require("../models");
14
- var _utils = require("../utils");
15
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
- class ProjectController extends _makes.Controller {
19
- constructor(appConfigService, appEventsService, projectService) {
20
- super();
21
- this.appConfigService = appConfigService;
22
- this.appEventsService = appEventsService;
23
- this.projectService = projectService;
24
- }
25
- install(cli) {
26
- super.install(cli);
27
- cli.command("init").help({
28
- description: "Init project"
29
- }).option("name", {
30
- type: "string",
31
- description: "Ім'я контейнеру",
32
- alias: "n"
33
- }).option("type", {
34
- type: "string",
35
- description: "Тип запуску контейнеру"
36
- }).completion("type", () => {
37
- return [];
38
- }).option("preset", {
39
- type: "string",
40
- description: "Preset",
41
- default: ""
42
- }).action(options => this.init(options));
43
- cli.command("start").help({
44
- description: "Run project"
45
- }).option("name", {
46
- type: "string",
47
- alias: "n"
48
- }).completion("name", () => this.getProjectNames()).option("rebuild", {
49
- type: "boolean",
50
- alias: "r"
51
- }).option("detach", {
52
- type: "boolean",
53
- alias: "d"
54
- }).action(options => this.start(options));
55
- cli.command("stop").option("name", {
56
- type: "string",
57
- alias: "n"
58
- }).completion("name", () => this.getProjectNames()).action(options => this.stop(options));
59
- cli.command("attach").option("name", {
60
- type: "string",
61
- alias: "n"
62
- }).completion("name", () => this.getProjectNames()).action(options => this.attach(options));
63
- cli.command("config").option("name", {
64
- type: "string",
65
- alias: "n"
66
- }).completion("name", () => this.getProjectNames()).option("global", {
67
- type: "boolean",
68
- alias: "g"
69
- }).action(options => this.configList(options));
70
- cli.command("config:get <key>").help({
71
- description: "Get project env variable"
72
- }).option("global", {
73
- alias: "g",
74
- description: "Global"
75
- }).option("name", {
76
- type: "string",
77
- alias: "n"
78
- }).completion("name", () => this.getProjectNames()).action((options, key) => this.configGet(options, key));
79
- cli.command("config:set [...configs]").option("name", {
80
- type: "string",
81
- alias: "n"
82
- }).option("global", {
83
- type: "boolean",
84
- alias: "g"
85
- }).completion("name", () => this.getProjectNames()).action((options, configs) => this.configSet(options, configs));
86
- cli.command("config:unset [...configs]").option("name", {
87
- type: "string",
88
- alias: "n"
89
- }).completion("name", () => this.getProjectNames()).option("global", {
90
- type: "boolean",
91
- alias: "g"
92
- }).action((options, configs) => this.configUnset(options, configs));
93
- cli.command("build-args").option("name", {
94
- type: "string",
95
- alias: "n"
96
- }).completion("name", () => this.getProjectNames()).action(options => this.buildArgsList(options));
97
- cli.command("build-args:get [...buildArgs]").option("name", {
98
- type: "string",
99
- alias: "n"
100
- }).completion("name", () => this.getProjectNames()).action((options, buildArgs) => this.buildArgsGet(options, buildArgs));
101
- cli.command("build-args:set [...buildArgs]").option("name", {
102
- type: "string",
103
- alias: "n"
104
- }).completion("name", () => this.getProjectNames()).action((options, buildArgs) => this.buildArgsSet(options, buildArgs));
105
- cli.command("build-args:unset [...buildArgs]").option("name", {
106
- type: "string",
107
- alias: "n"
108
- }).completion("name", () => this.getProjectNames()).action((options, buildArgs) => this.buildArgsUnset(options, buildArgs));
109
- cli.command("volumes").option("name", {
110
- type: "string",
111
- alias: "n"
112
- }).completion("name", () => this.getProjectNames()).action(options => this.volumeList(options));
113
- cli.command("volume:mount <...volumes>").option("name", {
114
- type: "string",
115
- alias: "n"
116
- }).completion("name", () => this.getProjectNames()).action((options, volumes) => this.volumeMount(options, volumes));
117
- cli.command("volume:unmount <...volumes>").option("name", {
118
- type: "string",
119
- alias: "n"
120
- }).completion("name", () => this.getProjectNames()).action((options, volumes) => this.volumeUnmount(options, volumes));
121
- cli.command("logs").help({
122
- description: "Logs"
123
- }).option("name", {
124
- type: "boolean",
125
- alias: "n"
126
- }).option("global", {
127
- type: "boolean",
128
- alias: "g"
129
- }).option("follow", {
130
- type: "boolean",
131
- alias: "f"
132
- }).option("detach", {
133
- type: "boolean",
134
- alias: "d"
135
- }).completion("name", () => this.getProjectNames()).action(options => this.logs(options));
136
- cli.command("exec [...command]").option("name", {
137
- type: "string",
138
- alias: "n"
139
- }).completion("name", () => this.getProjectNames()).action((options, command) => this.exec(options, command));
140
- }
141
- async getProjectNames() {
142
- const projects = await _models.Project.search();
143
- return projects.map(project => {
144
- return project.name;
145
- });
146
- }
147
- async init(options) {
148
- let project = await _models.Project.searchOne({
149
- src: this.appConfigService.getPWD()
150
- });
151
- if (!project) {
152
- project = new _models.Project();
153
- }
154
- if (options.name) {
155
- project.name = options.name;
156
- }
157
- if (!options.name || !project.name) {
158
- project.name = await (0, _utils.promptText)({
159
- type: "string",
160
- required: true,
161
- label: "Project name",
162
- default: project.name
163
- });
164
- }
165
- if (options.type) {
166
- project.type = options.type;
30
+ const utils_1 = require("@wocker/utils");
31
+ const cli_table3_1 = __importDefault(require("cli-table3"));
32
+ const chalk_1 = __importDefault(require("chalk"));
33
+ const Path = __importStar(require("path"));
34
+ const async_mutex_1 = require("async-mutex");
35
+ const env_1 = require("../env");
36
+ const makes_1 = require("../makes");
37
+ const makes_2 = require("../makes");
38
+ const services_1 = require("../services");
39
+ const utils_2 = require("../utils");
40
+ class ProjectController extends makes_1.Controller {
41
+ constructor(di) {
42
+ super();
43
+ this.di = di;
44
+ this.appConfigService = this.di.resolveService(services_1.AppConfigService);
45
+ this.appEventsService = this.di.resolveService(services_1.AppEventsService);
46
+ this.projectService = this.di.resolveService(services_1.ProjectService);
47
+ this.dockerService = this.di.resolveService(services_1.DockerService);
48
+ }
49
+ install(cli) {
50
+ super.install(cli);
51
+ cli.command("init")
52
+ .help({
53
+ description: "Init project"
54
+ })
55
+ .option("name", {
56
+ type: "string",
57
+ description: "Ім'я контейнеру",
58
+ alias: "n"
59
+ })
60
+ .option("type", {
61
+ type: "string",
62
+ description: "Тип запуску контейнеру"
63
+ })
64
+ .completion("type", () => {
65
+ return [];
66
+ })
67
+ .option("preset", {
68
+ type: "string",
69
+ description: "Preset",
70
+ default: ""
71
+ })
72
+ .action((options) => this.init(options));
73
+ cli.command("ps")
74
+ .option("all", {
75
+ type: "boolean",
76
+ alias: "a",
77
+ description: "All projects"
78
+ })
79
+ .action((options) => this.projectList(options));
80
+ cli.command("start")
81
+ .help({
82
+ description: "Run project"
83
+ })
84
+ .option("name", {
85
+ type: "string",
86
+ alias: "n"
87
+ })
88
+ .completion("name", () => this.getProjectNames())
89
+ .option("rebuild", {
90
+ type: "boolean",
91
+ alias: "r"
92
+ })
93
+ .option("detach", {
94
+ type: "boolean",
95
+ alias: "d"
96
+ })
97
+ .action((options) => this.start(options));
98
+ cli.command("stop")
99
+ .option("name", {
100
+ type: "string",
101
+ alias: "n"
102
+ })
103
+ .completion("name", () => this.getProjectNames())
104
+ .action((options) => this.stop(options));
105
+ cli.command("run <script>")
106
+ .completion("script", (options) => this.getScripts())
107
+ .action((options, script) => this.run(script));
108
+ cli.command("attach")
109
+ .option("name", {
110
+ type: "string",
111
+ alias: "n"
112
+ })
113
+ .completion("name", () => this.getProjectNames())
114
+ .action((options) => this.attach(options));
115
+ cli.command("config")
116
+ .option("name", {
117
+ type: "string",
118
+ alias: "n"
119
+ })
120
+ .completion("name", () => this.getProjectNames())
121
+ .option("global", {
122
+ type: "boolean",
123
+ alias: "g"
124
+ })
125
+ .action((options) => this.configList(options));
126
+ cli.command("config:get <key>")
127
+ .help({
128
+ description: "Get project env variable"
129
+ })
130
+ .option("global", {
131
+ alias: "g",
132
+ description: "Global"
133
+ })
134
+ .option("name", {
135
+ type: "string",
136
+ alias: "n"
137
+ })
138
+ .completion("name", () => this.getProjectNames())
139
+ .action((options, key) => this.configGet(options, key));
140
+ cli.command("config:set [...configs]")
141
+ .option("name", {
142
+ type: "string",
143
+ alias: "n"
144
+ })
145
+ .option("global", {
146
+ type: "boolean",
147
+ alias: "g"
148
+ })
149
+ .completion("name", () => this.getProjectNames())
150
+ .action((options, configs) => this.configSet(options, configs));
151
+ cli.command("config:unset [...configs]")
152
+ .option("name", {
153
+ type: "string",
154
+ alias: "n"
155
+ })
156
+ .completion("name", () => this.getProjectNames())
157
+ .option("global", {
158
+ type: "boolean",
159
+ alias: "g"
160
+ })
161
+ .action((options, configs) => this.configUnset(options, configs));
162
+ cli.command("build-args")
163
+ .option("name", {
164
+ type: "string",
165
+ alias: "n"
166
+ })
167
+ .completion("name", () => this.getProjectNames())
168
+ .action((options) => this.buildArgsList(options));
169
+ cli.command("build-args:get [...buildArgs]")
170
+ .option("name", {
171
+ type: "string",
172
+ alias: "n"
173
+ })
174
+ .completion("name", () => this.getProjectNames())
175
+ .action((options, buildArgs) => this.buildArgsGet(options, buildArgs));
176
+ cli.command("build-args:set [...buildArgs]")
177
+ .option("name", {
178
+ type: "string",
179
+ alias: "n"
180
+ })
181
+ .completion("name", () => this.getProjectNames())
182
+ .action((options, buildArgs) => this.buildArgsSet(options, buildArgs));
183
+ cli.command("build-args:unset [...buildArgs]")
184
+ .option("name", {
185
+ type: "string",
186
+ alias: "n"
187
+ })
188
+ .completion("name", () => this.getProjectNames())
189
+ .action((options, buildArgs) => this.buildArgsUnset(options, buildArgs));
190
+ cli.command("volumes")
191
+ .option("name", {
192
+ type: "string",
193
+ alias: "n"
194
+ })
195
+ .completion("name", () => this.getProjectNames())
196
+ .action((options) => this.volumeList(options));
197
+ cli.command("volume:mount [...volumes]")
198
+ .option("name", {
199
+ type: "string",
200
+ alias: "n"
201
+ })
202
+ .completion("name", () => this.getProjectNames())
203
+ .action((options, volumes) => this.volumeMount(options, volumes));
204
+ cli.command("volume:unmount [...volumes]")
205
+ .option("name", {
206
+ type: "string",
207
+ alias: "n"
208
+ })
209
+ .completion("name", () => this.getProjectNames())
210
+ .action((options, volumes) => this.volumeUnmount(options, volumes));
211
+ cli.command("logs")
212
+ .help({
213
+ description: "Logs"
214
+ })
215
+ .option("name", {
216
+ type: "boolean",
217
+ alias: "n"
218
+ })
219
+ .option("global", {
220
+ type: "boolean",
221
+ alias: "g"
222
+ })
223
+ .option("follow", {
224
+ type: "boolean",
225
+ alias: "f"
226
+ })
227
+ .option("detach", {
228
+ type: "boolean",
229
+ alias: "d"
230
+ })
231
+ .completion("name", () => this.getProjectNames())
232
+ .action((options) => this.logs(options));
233
+ cli.command("exec [...command]")
234
+ .option("name", {
235
+ type: "string",
236
+ alias: "n"
237
+ })
238
+ .completion("name", () => this.getProjectNames())
239
+ .action((options, command) => this.exec(options, command));
240
+ }
241
+ async getProjectNames() {
242
+ const projects = await makes_2.Project.search();
243
+ return projects.map((project) => {
244
+ return project.name;
245
+ });
167
246
  }
168
- const mapTypes = this.appConfigService.getProjectTypes();
169
- if (!options.type || !project.type || !mapTypes[project.type]) {
170
- project.type = await (0, _utils.promptSelect)({
171
- message: "Project type",
172
- options: mapTypes,
173
- default: project.type
174
- });
247
+ async getScripts() {
248
+ try {
249
+ const project = await this.projectService.get();
250
+ return Object.keys(project.scripts || {});
251
+ }
252
+ catch (ignore) {
253
+ return [];
254
+ }
175
255
  }
176
- switch (project.type) {
177
- case _models.PROJECT_TYPE_DOCKERFILE:
178
- {
179
- const files = await _makes.FS.readdirFiles(this.appConfigService.getPWD());
180
- const dockerfiles = files.filter(fileName => {
181
- if (new RegExp("^(.*)\\.dockerfile$").test(fileName)) {
182
- return true;
256
+ async init(options) {
257
+ let project = await makes_2.Project.searchOne({
258
+ path: this.appConfigService.getPWD()
259
+ });
260
+ if (!project) {
261
+ project = new makes_2.Project({});
262
+ }
263
+ if (options.name) {
264
+ project.name = options.name;
265
+ }
266
+ if (!options.name || !project.name) {
267
+ project.name = await (0, utils_1.promptText)({
268
+ type: "string",
269
+ required: true,
270
+ message: "Project name",
271
+ default: project.name
272
+ });
273
+ }
274
+ if (options.type) {
275
+ project.type = options.type;
276
+ }
277
+ const mapTypes = this.appConfigService.getProjectTypes();
278
+ if (!options.type || !project.type || !mapTypes[project.type]) {
279
+ project.type = await (0, utils_1.promptSelect)({
280
+ message: "Project type",
281
+ options: mapTypes,
282
+ default: project.type
283
+ });
284
+ }
285
+ switch (project.type) {
286
+ case makes_2.PROJECT_TYPE_DOCKERFILE: {
287
+ const files = await makes_1.FS.readdirFiles(this.appConfigService.getPWD());
288
+ const dockerfiles = files.filter((fileName) => {
289
+ if (new RegExp("^(.*)\\.dockerfile$").test(fileName)) {
290
+ return true;
291
+ }
292
+ return new RegExp("^Dockerfile(\\..*)?").test(fileName);
293
+ });
294
+ project.dockerfile = await (0, utils_1.promptSelect)({
295
+ options: dockerfiles.map((dockerfile) => {
296
+ return {
297
+ value: dockerfile
298
+ };
299
+ }),
300
+ message: "Dockerfile",
301
+ default: project.dockerfile
302
+ });
303
+ break;
183
304
  }
184
- return new RegExp("^Dockerfile(\\..*)?").test(fileName);
185
- });
186
- project.dockerfile = await (0, _utils.promptSelect)({
187
- options: dockerfiles.map(dockerfile => {
188
- return {
189
- value: dockerfile
190
- };
191
- }),
192
- message: "Dockerfile",
193
- default: project.dockerfile
194
- });
195
- break;
196
- }
197
- case _models.PROJECT_TYPE_IMAGE:
198
- {
199
- project.imageName = await (0, _utils.promptText)({
200
- message: "Image Name",
201
- default: project.imageName
202
- });
203
- break;
204
- }
205
- default:
206
- break;
207
- }
208
- await this.appEventsService.emit("project:init", project);
209
- project.path = this.appConfigService.getPWD();
210
- await project.save();
211
- }
212
- async start(options) {
213
- const {
214
- name,
215
- rebuild,
216
- detach
217
- } = options;
218
- if (name) {
219
- await this.projectService.cdProject(name);
220
- }
221
- if (rebuild) {
222
- const project = await this.projectService.get();
223
- await this.appEventsService.emit("project:rebuild", project);
224
- }
225
- await this.projectService.start();
226
- if (!detach) {
227
- const project = await this.projectService.get();
228
- const containerName = `${project.name}.workspace`;
229
- const container = await _makes.Docker.getContainer(containerName);
230
- await container.resize({
231
- w: process.stdout.columns,
232
- h: process.stdout.rows
233
- });
234
- await _makes.Docker.attach(containerName);
235
- }
236
- }
237
- async stop(options) {
238
- const {
239
- name
240
- } = options;
241
- if (name) {
242
- await this.projectService.cdProject(name);
243
- }
244
- await this.projectService.stop();
245
- }
246
- async attach(options) {
247
- const {
248
- name
249
- } = options;
250
- if (name) {
251
- await this.projectService.cdProject(name);
252
- }
253
- const containerName = `${name}.workspace`;
254
- await _makes.Docker.attach(containerName);
255
- }
256
- async configList(options) {
257
- const {
258
- name,
259
- global
260
- } = options;
261
- if (name) {
262
- await this.projectService.cdProject(name);
263
- }
264
- let env = {};
265
- if (!global) {
266
- const project = await this.projectService.get();
267
- env = project.env || {};
268
- } else {
269
- const config = await (0, _utils.getConfig)();
270
- env = config.env || {};
271
- }
272
- const table = new _cliTable.default({
273
- head: ["KEY", "VALUE"]
274
- });
275
- for (const i in env) {
276
- table.push([i, env[i]]);
277
- }
278
- return table.toString() + "\n";
279
- }
280
- async configGet(options, key) {
281
- const {
282
- name,
283
- global
284
- } = options;
285
- if (name) {
286
- await this.projectService.cdProject(name);
287
- }
288
- let value = "";
289
- if (global) {
290
- const config = await (0, _utils.getConfig)();
291
- value = config[key] || "";
292
- } else {
293
- const project = await this.projectService.get();
294
- value = project.getEnv(key);
295
- }
296
- const table = new _cliTable.default({
297
- head: ["KEY", "VALUE"]
298
- });
299
- table.push([key, value]);
300
- return table.toString() + "\n";
301
- }
302
- async configSet(options, configs) {
303
- const {
304
- name,
305
- global
306
- } = options;
307
- const env = configs.reduce((env, config) => {
308
- const [key, value] = config.split("=");
309
- env[key.trim()] = value.trim();
310
- return env;
311
- }, {});
312
- if (global) {
313
- const config = await (0, _utils.getConfig)();
314
- await (0, _utils.setConfig)({
315
- ...config,
316
- env: {
317
- ...(config.env || {}),
318
- ...env
319
- }
320
- });
321
- return;
322
- }
323
- if (name) {
324
- await this.projectService.cdProject(name);
325
- }
326
- const project = await this.projectService.get();
327
- for (const i in env) {
328
- project.setEnv(i, env[i]);
329
- }
330
- await project.save();
331
- }
332
- async configUnset(options, configs) {
333
- const {
334
- name,
335
- global
336
- } = options;
337
- const env = configs.reduce((env, config) => {
338
- const [key] = config.split("=");
339
- env[key.trim()] = null;
340
- return env;
341
- }, {});
342
- if (global) {
343
- return;
305
+ case makes_2.PROJECT_TYPE_IMAGE: {
306
+ project.imageName = await (0, utils_1.promptText)({
307
+ message: "Image Name",
308
+ default: project.imageName
309
+ });
310
+ break;
311
+ }
312
+ default:
313
+ break;
314
+ }
315
+ await this.appEventsService.emit("project:init", project);
316
+ project.path = this.appConfigService.getPWD();
317
+ await project.save();
318
+ }
319
+ async projectList(options) {
320
+ const { all } = options;
321
+ const table = new cli_table3_1.default({
322
+ head: ["Name", "Type", "Status"],
323
+ colAligns: ["left", "center", "center"]
324
+ });
325
+ const projects = await this.projectService.search({});
326
+ for (const project of projects) {
327
+ const container = await this.dockerService.getContainer(`${project.name}.workspace`);
328
+ if (!container) {
329
+ if (all) {
330
+ table.push([project.name, project.type, "-"]);
331
+ }
332
+ continue;
333
+ }
334
+ const { State: { Status = "stopped" } = {} } = await container.inspect();
335
+ table.push([project.name, project.type, Status]);
336
+ }
337
+ return table.toString() + "\n";
344
338
  }
345
- if (name) {
346
- await this.projectService.cdProject(name);
339
+ async start(options) {
340
+ const { name, rebuild, detach } = options;
341
+ if (name) {
342
+ await this.projectService.cdProject(name);
343
+ }
344
+ const project = await this.projectService.get();
345
+ if (rebuild) {
346
+ await this.appEventsService.emit("project:rebuild", project);
347
+ }
348
+ await this.projectService.start();
349
+ if (!detach) {
350
+ const project = await this.projectService.get();
351
+ const containerName = `${project.name}.workspace`;
352
+ const container = await makes_1.Docker.getContainer(containerName);
353
+ await container.resize({
354
+ w: process.stdout.columns,
355
+ h: process.stdout.rows
356
+ });
357
+ await makes_1.Docker.attach(containerName);
358
+ }
347
359
  }
348
- const project = await this.projectService.get();
349
- for (const i in env) {
350
- project.unsetEnv(i);
360
+ async stop(options) {
361
+ const { name } = options;
362
+ if (name) {
363
+ await this.projectService.cdProject(name);
364
+ }
365
+ await this.projectService.stop();
351
366
  }
352
- await project.save();
353
- }
354
- async buildArgsList(options) {
355
- const {
356
- name
357
- } = options;
358
- if (name) {
359
- await this.projectService.cdProject(name);
367
+ async run(script) {
368
+ const project = await this.projectService.get();
369
+ if (!project.scripts || !project.scripts[script]) {
370
+ throw new Error(`Script ${script} not found`);
371
+ }
372
+ const container = await this.dockerService.getContainer(`${project.name}.workspace`);
373
+ if (!container) {
374
+ throw new Error("The project is not started");
375
+ }
376
+ const exec = await container.exec({
377
+ Cmd: ["bash", "-i", "-c", project.scripts[script]],
378
+ AttachStdin: true,
379
+ AttachStdout: true,
380
+ AttachStderr: true,
381
+ Tty: process.stdin.isTTY
382
+ });
383
+ const stream = await exec.start({
384
+ hijack: true,
385
+ stdin: true,
386
+ Tty: process.stdin.isTTY
387
+ });
388
+ await this.dockerService.attachStream(stream);
360
389
  }
361
- const project = await this.projectService.get();
362
- const table = new _cliTable.default({
363
- head: ["KEY", "VALUE"]
364
- });
365
- const buildArgs = project.buildArgs || {};
366
- for (const i in buildArgs) {
367
- table.push([i, buildArgs[i]]);
390
+ async attach(options) {
391
+ const { name } = options;
392
+ if (name) {
393
+ await this.projectService.cdProject(name);
394
+ }
395
+ const containerName = `${name}.workspace`;
396
+ await makes_1.Docker.attach(containerName);
368
397
  }
369
- return table.toString() + "\n";
370
- }
371
- async buildArgsGet(options, args) {
372
- const {
373
- name
374
- } = options;
375
- if (name) {
376
- await this.projectService.cdProject(name);
398
+ async configList(options) {
399
+ const { name, global } = options;
400
+ if (name) {
401
+ await this.projectService.cdProject(name);
402
+ }
403
+ let env = {};
404
+ if (!global) {
405
+ const project = await this.projectService.get();
406
+ env = project.env || {};
407
+ }
408
+ else {
409
+ const config = await (0, utils_2.getConfig)();
410
+ env = config.env || {};
411
+ }
412
+ const table = new cli_table3_1.default({
413
+ head: ["KEY", "VALUE"]
414
+ });
415
+ for (const i in env) {
416
+ table.push([i, env[i]]);
417
+ }
418
+ return table.toString() + "\n";
377
419
  }
378
- const project = await this.projectService.get();
379
- const table = new _cliTable.default({
380
- head: ["KEY", "VALUE"]
381
- });
382
- _makes.Logger.info("...");
383
- for (const key of args) {
384
- if (project.buildArgs && typeof project.buildArgs[key] !== "undefined") {
385
- const value = project.buildArgs[key] || "";
420
+ async configGet(options, key) {
421
+ const { name, global } = options;
422
+ if (name) {
423
+ await this.projectService.cdProject(name);
424
+ }
425
+ let value = "";
426
+ if (global) {
427
+ const config = await (0, utils_2.getConfig)();
428
+ value = config[key] || "";
429
+ }
430
+ else {
431
+ const project = await this.projectService.get();
432
+ value = project.getEnv(key);
433
+ }
434
+ const table = new cli_table3_1.default({
435
+ head: ["KEY", "VALUE"]
436
+ });
386
437
  table.push([key, value]);
387
- }
388
- }
389
- return table.toString() + "\n";
390
- }
391
- async buildArgsSet(options, args) {
392
- const {
393
- name
394
- } = options;
395
- if (name) {
396
- await this.projectService.cdProject(name);
438
+ return table.toString() + "\n";
439
+ }
440
+ async configSet(options, configs) {
441
+ const { name, global } = options;
442
+ const env = configs.reduce((env, config) => {
443
+ const [key, value] = config.split("=");
444
+ env[key.trim()] = value.trim();
445
+ return env;
446
+ }, {});
447
+ if (global) {
448
+ const config = await (0, utils_2.getConfig)();
449
+ await (0, utils_2.setConfig)({
450
+ ...config,
451
+ env: {
452
+ ...config.env || {},
453
+ ...env
454
+ }
455
+ });
456
+ return;
457
+ }
458
+ if (name) {
459
+ await this.projectService.cdProject(name);
460
+ }
461
+ const project = await this.projectService.get();
462
+ for (const i in env) {
463
+ project.setEnv(i, env[i]);
464
+ }
465
+ await project.save();
466
+ }
467
+ async configUnset(options, configs) {
468
+ const { name, global } = options;
469
+ const env = configs.reduce((env, config) => {
470
+ const [key] = config.split("=");
471
+ env[key.trim()] = null;
472
+ return env;
473
+ }, {});
474
+ if (global) {
475
+ return;
476
+ }
477
+ if (name) {
478
+ await this.projectService.cdProject(name);
479
+ }
480
+ const project = await this.projectService.get();
481
+ for (const i in env) {
482
+ project.unsetEnv(i);
483
+ }
484
+ await project.save();
397
485
  }
398
- const project = await this.projectService.get();
399
- const buildArgs = args.reduce((env, config) => {
400
- const [key, value] = config.split("=");
401
- env[key.trim()] = value.trim();
402
- return env;
403
- }, {});
404
- for (const key in buildArgs) {
405
- if (!project.buildArgs) {
406
- project.buildArgs = {};
407
- }
408
- project.buildArgs[key] = buildArgs[key];
486
+ async buildArgsList(options) {
487
+ const { name } = options;
488
+ if (name) {
489
+ await this.projectService.cdProject(name);
490
+ }
491
+ const project = await this.projectService.get();
492
+ const table = new cli_table3_1.default({
493
+ head: ["KEY", "VALUE"]
494
+ });
495
+ const buildArgs = project.buildArgs || {};
496
+ for (const i in buildArgs) {
497
+ table.push([i, typeof buildArgs[i] === "string" ? buildArgs[i] : JSON.stringify(buildArgs[i])]);
498
+ }
499
+ return table.toString() + "\n";
409
500
  }
410
- await project.save();
411
- }
412
- async buildArgsUnset(options, args) {
413
- const {
414
- name
415
- } = options;
416
- if (name) {
417
- await this.projectService.cdProject(name);
501
+ async buildArgsGet(options, args) {
502
+ const { name } = options;
503
+ if (name) {
504
+ await this.projectService.cdProject(name);
505
+ }
506
+ const project = await this.projectService.get();
507
+ const table = new cli_table3_1.default({
508
+ head: ["KEY", "VALUE"]
509
+ });
510
+ makes_1.Logger.info("...");
511
+ for (const key of args) {
512
+ if (project.buildArgs && typeof project.buildArgs[key] !== "undefined") {
513
+ const value = project.buildArgs[key] || "";
514
+ table.push([key, value]);
515
+ }
516
+ }
517
+ return table.toString() + "\n";
418
518
  }
419
- const project = await this.projectService.get();
420
- const buildArgs = args.reduce((env, config) => {
421
- const [key, value] = config.split("=");
422
- env[key.trim()] = value.trim();
423
- return env;
424
- }, {});
425
- for (const key in buildArgs) {
426
- if (!project.buildArgs) {
427
- break;
428
- }
429
- if (typeof project.buildArgs[key] !== "undefined") {
430
- delete project.buildArgs[key];
431
- }
519
+ async buildArgsSet(options, args) {
520
+ const { name } = options;
521
+ if (name) {
522
+ await this.projectService.cdProject(name);
523
+ }
524
+ const project = await this.projectService.get();
525
+ const buildArgs = args.reduce((env, config) => {
526
+ const [key, value] = config.split("=");
527
+ env[key.trim()] = value.trim();
528
+ return env;
529
+ }, {});
530
+ for (const key in buildArgs) {
531
+ if (!project.buildArgs) {
532
+ project.buildArgs = {};
533
+ }
534
+ project.buildArgs[key] = buildArgs[key];
535
+ }
536
+ await project.save();
432
537
  }
433
- await project.save();
434
- }
435
- async volumeList(options) {
436
- const {
437
- name
438
- } = options;
439
- if (name) {
440
- await this.projectService.cdProject(name);
538
+ async buildArgsUnset(options, args) {
539
+ const { name } = options;
540
+ if (name) {
541
+ await this.projectService.cdProject(name);
542
+ }
543
+ const project = await this.projectService.get();
544
+ const buildArgs = args.reduce((env, config) => {
545
+ const [key, value] = config.split("=");
546
+ env[key.trim()] = value.trim();
547
+ return env;
548
+ }, {});
549
+ for (const key in buildArgs) {
550
+ if (!project.buildArgs) {
551
+ break;
552
+ }
553
+ if (typeof project.buildArgs[key] !== "undefined") {
554
+ delete project.buildArgs[key];
555
+ }
556
+ }
557
+ await project.save();
441
558
  }
442
- const project = await this.projectService.get();
443
- const table = new _cliTable.default({
444
- head: ["Volume"]
445
- });
446
- const volumes = project.volumes || [];
447
- for (const volume of volumes) {
448
- table.push([volume]);
559
+ async volumeList(options) {
560
+ const { name } = options;
561
+ if (name) {
562
+ await this.projectService.cdProject(name);
563
+ }
564
+ const project = await this.projectService.get();
565
+ const table = new cli_table3_1.default({
566
+ head: ["Volume"]
567
+ });
568
+ const volumes = project.volumes || [];
569
+ for (const volume of volumes) {
570
+ table.push([volume]);
571
+ }
572
+ return table.toString() + "\n";
449
573
  }
450
- return table.toString() + "\n";
451
- }
452
- async volumeMount(options, volumes) {
453
- const {
454
- name
455
- } = options;
456
- if (name) {
457
- await this.projectService.cdProject(name);
574
+ async volumeMount(options, volumes) {
575
+ const { name } = options;
576
+ if (name) {
577
+ await this.projectService.cdProject(name);
578
+ }
579
+ const project = await this.projectService.get();
580
+ if (Array.isArray(volumes) && volumes.length > 0) {
581
+ project.volumeMount(...volumes);
582
+ await project.save();
583
+ }
458
584
  }
459
- const project = await this.projectService.get();
460
- console.log(volumes);
461
- project.volumeMount(...volumes);
462
- await project.save();
463
- }
464
- async volumeUnmount(options, volumes) {
465
- const {
466
- name
467
- } = options;
468
- if (name) {
469
- await this.projectService.cdProject(name);
585
+ async volumeUnmount(options, volumes) {
586
+ const { name } = options;
587
+ if (name) {
588
+ await this.projectService.cdProject(name);
589
+ }
590
+ const project = await this.projectService.get();
591
+ if (Array.isArray(volumes) && volumes.length > 0) {
592
+ project.volumeUnmount(...volumes);
593
+ await project.save();
594
+ }
470
595
  }
471
- const project = await this.projectService.get();
472
- project.volumeUnmount(...volumes);
473
- await project.save();
474
- }
475
- async logs(options) {
476
- const {
477
- name,
478
- global,
479
- detach,
480
- follow
481
- } = options;
482
- if (global) {
483
- const logFilepath = Path.join(_env.DATA_DIR, "ws.log");
484
- const prepareLog = str => {
485
- return str.replace(/^\[.*]\s([^:]+):\s.*$/gm, (substring, type) => {
486
- switch (type) {
487
- case "info":
488
- return _chalk.default.green(substring);
489
- case "warning":
490
- return _chalk.default.yellow(substring);
491
- case "error":
492
- return _chalk.default.red(substring);
493
- default:
494
- return substring;
495
- }
496
- });
497
- };
498
- const stream = _makes.FS.createReadLinesStream(logFilepath, follow ? -10 : undefined);
499
- stream.on("data", data => {
500
- process.stdout.write(prepareLog(data.toString()));
501
- process.stdout.write("\n");
502
- });
503
- if (follow) {
504
- const stats = await _makes.FS.stat(logFilepath);
505
- const watcher = _makes.FS.watch(logFilepath);
506
- const mutex = new _asyncMutex.Mutex();
507
- let position = BigInt(stats.size);
508
- watcher.on("change", async () => {
509
- await mutex.acquire();
510
- try {
511
- const stats = await _makes.FS.stat(logFilepath);
512
- if (BigInt(stats.size) < position) {
513
- console.log("file truncated");
514
- position = 0n;
596
+ async logs(options) {
597
+ const { name, global, detach, follow } = options;
598
+ if (global) {
599
+ const logFilepath = Path.join(env_1.DATA_DIR, "ws.log");
600
+ const prepareLog = (str) => {
601
+ return str.replace(/^\[.*]\s([^:]+):\s.*$/gm, (substring, type) => {
602
+ switch (type) {
603
+ case "info":
604
+ return chalk_1.default.green(substring);
605
+ case "warn":
606
+ case "warning":
607
+ return chalk_1.default.yellow(substring);
608
+ case "error":
609
+ return chalk_1.default.red(substring);
610
+ default:
611
+ return substring;
612
+ }
613
+ });
614
+ };
615
+ const stream = makes_1.FS.createReadLinesStream(logFilepath, follow ? -10 : undefined);
616
+ stream.on("data", (data) => {
617
+ process.stdout.write(prepareLog(data.toString()));
618
+ process.stdout.write("\n");
619
+ });
620
+ if (follow) {
621
+ const stats = await makes_1.FS.stat(logFilepath);
622
+ const watcher = makes_1.FS.watch(logFilepath);
623
+ const mutex = new async_mutex_1.Mutex();
624
+ let position = BigInt(stats.size);
625
+ watcher.on("change", async () => {
626
+ await mutex.acquire();
627
+ try {
628
+ const stats = await makes_1.FS.stat(logFilepath);
629
+ if (BigInt(stats.size) < position) {
630
+ console.log("file truncated");
631
+ position = 0n;
632
+ }
633
+ const buffer = await makes_1.FS.readBytes(logFilepath, position);
634
+ position += BigInt(buffer.length);
635
+ process.stdout.write(prepareLog(buffer.toString("utf-8")));
636
+ }
637
+ finally {
638
+ mutex.release();
639
+ }
640
+ });
515
641
  }
516
- const buffer = await _makes.FS.readBytes(logFilepath, position);
517
- position += BigInt(buffer.length);
518
- process.stdout.write(prepareLog(buffer.toString("utf-8")));
519
- } finally {
520
- mutex.release();
521
- }
522
- });
523
- }
524
- return;
525
- }
526
- if (name) {
527
- await this.projectService.cdProject(name);
528
- }
529
- const project = await this.projectService.get();
530
- const container = await _makes.Docker.getContainer(`${project.name}.workspace`);
531
- if (!detach) {
532
- const stream = await container.logs({
533
- stdout: true,
534
- stderr: true,
535
- follow: true
536
- });
537
- stream.on("data", data => {
538
- process.stdout.write((0, _utils.demuxOutput)(data));
539
- });
540
- } else {
541
- const buffer = await container.logs({
542
- stdout: true,
543
- stderr: true,
544
- follow: false
545
- });
546
- process.stdout.write((0, _utils.demuxOutput)(buffer));
642
+ return;
643
+ }
644
+ if (name) {
645
+ await this.projectService.cdProject(name);
646
+ }
647
+ const project = await this.projectService.get();
648
+ const container = await makes_1.Docker.getContainer(`${project.name}.workspace`);
649
+ if (!detach) {
650
+ const stream = await container.logs({
651
+ stdout: true,
652
+ stderr: true,
653
+ follow: true
654
+ });
655
+ stream.on("data", (data) => {
656
+ process.stdout.write((0, utils_2.demuxOutput)(data));
657
+ });
658
+ }
659
+ else {
660
+ const buffer = await container.logs({
661
+ stdout: true,
662
+ stderr: true,
663
+ follow: false
664
+ });
665
+ process.stdout.write((0, utils_2.demuxOutput)(buffer));
666
+ }
547
667
  }
548
- }
549
- async exec(options, command) {
550
- const {
551
- name
552
- } = options;
553
- if (name) {
554
- await this.projectService.cdProject(name);
668
+ async exec(options, command) {
669
+ const { name } = options;
670
+ if (name) {
671
+ await this.projectService.cdProject(name);
672
+ }
673
+ const project = await this.projectService.get();
674
+ const containerName = `${project.name}.workspace`;
675
+ await makes_1.Docker.exec(containerName, command);
555
676
  }
556
- const project = await this.projectService.get();
557
- const containerName = `${project.name}.workspace`;
558
- await _makes.Docker.exec(containerName, command);
559
- }
560
677
  }
561
- exports.ProjectController = ProjectController;
678
+ exports.ProjectController = ProjectController;