@wocker/ws 1.0.2 → 1.0.4
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/README.md +1 -1
- package/lib/App.d.ts +4 -3
- package/lib/App.js +98 -77
- package/lib/controllers/ImageController.d.ts +2 -2
- package/lib/controllers/ImageController.js +27 -27
- package/lib/controllers/PluginController.d.ts +2 -2
- package/lib/controllers/PluginController.js +78 -56
- package/lib/controllers/PresetController.d.ts +3 -1
- package/lib/controllers/PresetController.js +155 -136
- package/lib/controllers/ProjectController.d.ts +5 -5
- package/lib/controllers/ProjectController.js +653 -603
- package/lib/controllers/ProxyController.d.ts +4 -1
- package/lib/controllers/ProxyController.js +269 -245
- package/lib/controllers/index.js +19 -58
- package/lib/decorators/Inject.d.ts +1 -0
- package/lib/decorators/Inject.js +8 -0
- package/lib/decorators/Injectable.d.ts +4 -0
- package/lib/decorators/Injectable.js +17 -0
- package/lib/decorators/index.d.ts +1 -0
- package/lib/decorators/index.js +17 -0
- package/lib/env.js +33 -15
- package/lib/index.d.ts +3 -0
- package/lib/index.js +31 -16
- package/lib/makes/Controller.js +4 -8
- package/lib/makes/DI.d.ts +7 -0
- package/lib/makes/DI.js +27 -0
- package/lib/makes/Docker.js +298 -382
- package/lib/makes/FS.d.ts +3 -9
- package/lib/makes/FS.js +277 -305
- package/lib/makes/LineConvertStream.js +37 -40
- package/lib/makes/Logger.d.ts +9 -1
- package/lib/makes/Logger.js +22 -11
- package/lib/makes/Model.js +8 -12
- package/lib/makes/MySQL.js +6 -27
- package/lib/makes/Plugin.d.ts +1 -1
- package/lib/makes/Plugin.js +55 -37
- package/lib/makes/Preset.d.ts +46 -0
- package/lib/makes/Preset.js +33 -0
- package/lib/makes/Project.d.ts +45 -0
- package/lib/makes/Project.js +127 -0
- package/lib/makes/Repository.js +18 -21
- package/lib/makes/index.d.ts +3 -0
- package/lib/makes/index.js +23 -69
- package/lib/plugins/ElasticSearchPlugin.d.ts +3 -1
- package/lib/plugins/ElasticSearchPlugin.js +66 -66
- package/lib/plugins/LocaltunnelPlugin.d.ts +2 -2
- package/lib/plugins/LocaltunnelPlugin.js +256 -257
- package/lib/plugins/MaildevPlugin.d.ts +2 -2
- package/lib/plugins/MaildevPlugin.js +45 -44
- package/lib/plugins/MongodbPlugin.d.ts +2 -2
- package/lib/plugins/MongodbPlugin.js +303 -248
- package/lib/plugins/NgrokPlugin.d.ts +2 -2
- package/lib/plugins/NgrokPlugin.js +221 -231
- package/lib/plugins/PageKitePlugin.d.ts +2 -2
- package/lib/plugins/PageKitePlugin.js +150 -149
- package/lib/plugins/PostgresPlugin.d.ts +1 -1
- package/lib/plugins/PostgresPlugin.js +115 -89
- package/lib/plugins/ProxmoxPlugin.d.ts +1 -1
- package/lib/plugins/ProxmoxPlugin.js +50 -38
- package/lib/plugins/RedisPlugin.d.ts +3 -1
- package/lib/plugins/RedisPlugin.js +73 -72
- package/lib/plugins/index.js +25 -103
- package/lib/services/AppConfigService.d.ts +3 -3
- package/lib/services/AppConfigService.js +162 -157
- package/lib/services/AppEventsService.js +26 -24
- package/lib/services/DockerService.d.ts +37 -2
- package/lib/services/DockerService.js +185 -205
- package/lib/services/LogService.d.ts +3 -2
- package/lib/services/LogService.js +33 -34
- package/lib/services/PluginService.d.ts +2 -1
- package/lib/services/PluginService.js +11 -14
- package/lib/services/PresetService.d.ts +8 -3
- package/lib/services/PresetService.js +60 -59
- package/lib/services/ProjectService.d.ts +11 -4
- package/lib/services/ProjectService.js +140 -129
- package/lib/services/index.js +21 -80
- package/lib/types/Config.d.ts +4 -3
- package/lib/types/Config.js +1 -4
- package/lib/types/EnvConfig.js +1 -4
- package/lib/types/index.js +16 -25
- package/lib/utils/buildOptions.js +5 -8
- package/lib/utils/demuxOutput.js +16 -20
- package/lib/utils/escapeRegExp.js +4 -7
- package/lib/utils/exec.js +38 -39
- package/lib/utils/fetch.js +46 -30
- package/lib/utils/followProgress.js +66 -77
- package/lib/utils/format-size-units.js +16 -16
- package/lib/utils/get-config.d.ts +1 -1
- package/lib/utils/get-config.js +13 -16
- package/lib/utils/get-cursor-position.js +22 -29
- package/lib/utils/image-build.js +35 -23
- package/lib/utils/index.js +32 -191
- package/lib/utils/injectVariables.js +10 -13
- package/lib/utils/parse-table.js +20 -23
- package/lib/utils/set-config.d.ts +1 -1
- package/lib/utils/set-config.js +12 -15
- package/lib/utils/spawn.js +17 -20
- package/lib/utils/tty.js +2 -6
- package/lib/utils/volumeFormat.js +5 -12
- package/lib/utils/volumeParse.js +10 -13
- package/package.json +13 -39
- package/presets/bun/Dockerfile +11 -0
- package/presets/bun/config.json +3 -0
- package/presets/node/Dockerfile +4 -2
- package/presets/php-apache/Dockerfile +3 -2
- package/.github/workflows/publish.yml +0 -31
- package/plugins/mariadb/admin/conf/config.user.inc.php +0 -9
package/lib/utils/index.js
CHANGED
|
@@ -1,192 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
get: function () {
|
|
35
|
-
return _escapeRegExp[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _exec = require("./exec");
|
|
40
|
-
Object.keys(_exec).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _exec[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _exec[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _fetch = require("./fetch");
|
|
51
|
-
Object.keys(_fetch).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _fetch[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _fetch[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var _followProgress = require("./followProgress");
|
|
62
|
-
Object.keys(_followProgress).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _followProgress[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _followProgress[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
var _formatSizeUnits = require("./format-size-units");
|
|
73
|
-
Object.keys(_formatSizeUnits).forEach(function (key) {
|
|
74
|
-
if (key === "default" || key === "__esModule") return;
|
|
75
|
-
if (key in exports && exports[key] === _formatSizeUnits[key]) return;
|
|
76
|
-
Object.defineProperty(exports, key, {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function () {
|
|
79
|
-
return _formatSizeUnits[key];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
var _getConfig = require("./get-config");
|
|
84
|
-
Object.keys(_getConfig).forEach(function (key) {
|
|
85
|
-
if (key === "default" || key === "__esModule") return;
|
|
86
|
-
if (key in exports && exports[key] === _getConfig[key]) return;
|
|
87
|
-
Object.defineProperty(exports, key, {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function () {
|
|
90
|
-
return _getConfig[key];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
var _getCursorPosition = require("./get-cursor-position");
|
|
95
|
-
Object.keys(_getCursorPosition).forEach(function (key) {
|
|
96
|
-
if (key === "default" || key === "__esModule") return;
|
|
97
|
-
if (key in exports && exports[key] === _getCursorPosition[key]) return;
|
|
98
|
-
Object.defineProperty(exports, key, {
|
|
99
|
-
enumerable: true,
|
|
100
|
-
get: function () {
|
|
101
|
-
return _getCursorPosition[key];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
var _imageBuild = require("./image-build");
|
|
106
|
-
Object.keys(_imageBuild).forEach(function (key) {
|
|
107
|
-
if (key === "default" || key === "__esModule") return;
|
|
108
|
-
if (key in exports && exports[key] === _imageBuild[key]) return;
|
|
109
|
-
Object.defineProperty(exports, key, {
|
|
110
|
-
enumerable: true,
|
|
111
|
-
get: function () {
|
|
112
|
-
return _imageBuild[key];
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
var _injectVariables = require("./injectVariables");
|
|
117
|
-
Object.keys(_injectVariables).forEach(function (key) {
|
|
118
|
-
if (key === "default" || key === "__esModule") return;
|
|
119
|
-
if (key in exports && exports[key] === _injectVariables[key]) return;
|
|
120
|
-
Object.defineProperty(exports, key, {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () {
|
|
123
|
-
return _injectVariables[key];
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
var _parseTable = require("./parse-table");
|
|
128
|
-
Object.keys(_parseTable).forEach(function (key) {
|
|
129
|
-
if (key === "default" || key === "__esModule") return;
|
|
130
|
-
if (key in exports && exports[key] === _parseTable[key]) return;
|
|
131
|
-
Object.defineProperty(exports, key, {
|
|
132
|
-
enumerable: true,
|
|
133
|
-
get: function () {
|
|
134
|
-
return _parseTable[key];
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
var _setConfig = require("./set-config");
|
|
139
|
-
Object.keys(_setConfig).forEach(function (key) {
|
|
140
|
-
if (key === "default" || key === "__esModule") return;
|
|
141
|
-
if (key in exports && exports[key] === _setConfig[key]) return;
|
|
142
|
-
Object.defineProperty(exports, key, {
|
|
143
|
-
enumerable: true,
|
|
144
|
-
get: function () {
|
|
145
|
-
return _setConfig[key];
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
var _spawn = require("./spawn");
|
|
150
|
-
Object.keys(_spawn).forEach(function (key) {
|
|
151
|
-
if (key === "default" || key === "__esModule") return;
|
|
152
|
-
if (key in exports && exports[key] === _spawn[key]) return;
|
|
153
|
-
Object.defineProperty(exports, key, {
|
|
154
|
-
enumerable: true,
|
|
155
|
-
get: function () {
|
|
156
|
-
return _spawn[key];
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
var _tty = require("./tty");
|
|
161
|
-
Object.keys(_tty).forEach(function (key) {
|
|
162
|
-
if (key === "default" || key === "__esModule") return;
|
|
163
|
-
if (key in exports && exports[key] === _tty[key]) return;
|
|
164
|
-
Object.defineProperty(exports, key, {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function () {
|
|
167
|
-
return _tty[key];
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
var _volumeFormat = require("./volumeFormat");
|
|
172
|
-
Object.keys(_volumeFormat).forEach(function (key) {
|
|
173
|
-
if (key === "default" || key === "__esModule") return;
|
|
174
|
-
if (key in exports && exports[key] === _volumeFormat[key]) return;
|
|
175
|
-
Object.defineProperty(exports, key, {
|
|
176
|
-
enumerable: true,
|
|
177
|
-
get: function () {
|
|
178
|
-
return _volumeFormat[key];
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
|
-
var _volumeParse = require("./volumeParse");
|
|
183
|
-
Object.keys(_volumeParse).forEach(function (key) {
|
|
184
|
-
if (key === "default" || key === "__esModule") return;
|
|
185
|
-
if (key in exports && exports[key] === _volumeParse[key]) return;
|
|
186
|
-
Object.defineProperty(exports, key, {
|
|
187
|
-
enumerable: true,
|
|
188
|
-
get: function () {
|
|
189
|
-
return _volumeParse[key];
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
});
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./buildOptions"), exports);
|
|
18
|
+
__exportStar(require("./demuxOutput"), exports);
|
|
19
|
+
__exportStar(require("./escapeRegExp"), exports);
|
|
20
|
+
__exportStar(require("./exec"), exports);
|
|
21
|
+
__exportStar(require("./fetch"), exports);
|
|
22
|
+
__exportStar(require("./followProgress"), exports);
|
|
23
|
+
__exportStar(require("./format-size-units"), exports);
|
|
24
|
+
__exportStar(require("./get-config"), exports);
|
|
25
|
+
__exportStar(require("./get-cursor-position"), exports);
|
|
26
|
+
__exportStar(require("./image-build"), exports);
|
|
27
|
+
__exportStar(require("./injectVariables"), exports);
|
|
28
|
+
__exportStar(require("./parse-table"), exports);
|
|
29
|
+
__exportStar(require("./set-config"), exports);
|
|
30
|
+
__exportStar(require("./spawn"), exports);
|
|
31
|
+
__exportStar(require("./tty"), exports);
|
|
32
|
+
__exportStar(require("./volumeFormat"), exports);
|
|
33
|
+
__exportStar(require("./volumeParse"), exports);
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.injectVariables = void 0;
|
|
7
4
|
const injectVariables = (str, data) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
let res = str;
|
|
6
|
+
Object.keys(data).forEach((key) => {
|
|
7
|
+
const variableName = `\\$\\{${key}\\}`;
|
|
8
|
+
const variableValue = data[key];
|
|
9
|
+
const regex = new RegExp(variableName, "g");
|
|
10
|
+
res = res.replace(regex, variableValue);
|
|
11
|
+
});
|
|
12
|
+
return res;
|
|
16
13
|
};
|
|
17
|
-
exports.injectVariables = injectVariables;
|
|
14
|
+
exports.injectVariables = injectVariables;
|
package/lib/utils/parse-table.js
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.parseTable = void 0;
|
|
7
4
|
const parseTable = (string, pos) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
return string.split("\n").filter((line) => {
|
|
6
|
+
return line.split(new RegExp("\\s\\s+")).filter((item) => {
|
|
7
|
+
return item !== "";
|
|
8
|
+
}).length > 0;
|
|
9
|
+
}).map((line, index) => {
|
|
10
|
+
if (index === 0) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
let data = line.split(new RegExp("\\s\\s+"));
|
|
14
|
+
let row = {};
|
|
15
|
+
for (let i in data) {
|
|
16
|
+
let name = pos[i];
|
|
17
|
+
row[name] = data[i];
|
|
18
|
+
}
|
|
19
|
+
return row;
|
|
20
|
+
}).filter((line) => {
|
|
21
|
+
return !!line;
|
|
22
|
+
});
|
|
26
23
|
};
|
|
27
|
-
exports.parseTable = parseTable;
|
|
24
|
+
exports.parseTable = parseTable;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Config } from "
|
|
1
|
+
import { Config } from "../types";
|
|
2
2
|
export declare const setConfig: (data: Partial<Config>) => Promise<Config>;
|
package/lib/utils/set-config.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.setConfig = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const setConfig = async data => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
const env_1 = require("../env");
|
|
5
|
+
const FS_1 = require("../makes/FS");
|
|
6
|
+
const get_config_1 = require("./get-config");
|
|
7
|
+
const setConfig = async (data) => {
|
|
8
|
+
const config = {
|
|
9
|
+
...await (0, get_config_1.getConfig)(),
|
|
10
|
+
...data
|
|
11
|
+
};
|
|
12
|
+
await FS_1.FS.writeJSON(env_1.MAP_PATH, config);
|
|
13
|
+
return config;
|
|
17
14
|
};
|
|
18
|
-
exports.setConfig = setConfig;
|
|
15
|
+
exports.setConfig = setConfig;
|
package/lib/utils/spawn.js
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.spawn = void 0;
|
|
7
|
-
|
|
8
|
-
const spawn = async command => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const spawn = async (command) => {
|
|
6
|
+
return new Promise((resolve) => {
|
|
7
|
+
let [prog, ...options] = command.split(/\s+/);
|
|
8
|
+
let worker = (0, child_process_1.spawn)(prog, options);
|
|
9
|
+
worker.stdout.on("data", (data) => {
|
|
10
|
+
console.log(`stdout: ${data}`);
|
|
11
|
+
});
|
|
12
|
+
worker.stderr.on("data", (data) => {
|
|
13
|
+
console.error(`stderr: ${data}`);
|
|
14
|
+
});
|
|
15
|
+
worker.on("close", (code) => {
|
|
16
|
+
console.log(`child process exited with code ${code}`);
|
|
17
|
+
resolve(undefined);
|
|
18
|
+
});
|
|
14
19
|
});
|
|
15
|
-
worker.stderr.on("data", data => {
|
|
16
|
-
console.error(`stderr: ${data}`);
|
|
17
|
-
});
|
|
18
|
-
worker.on("close", code => {
|
|
19
|
-
console.log(`child process exited with code ${code}`);
|
|
20
|
-
resolve(undefined);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
20
|
};
|
|
24
|
-
exports.spawn = spawn;
|
|
21
|
+
exports.spawn = spawn;
|
package/lib/utils/tty.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.volumeFormat = void 0;
|
|
7
|
-
const volumeFormat = volume => {
|
|
8
|
-
|
|
9
|
-
source
|
|
10
|
-
destination,
|
|
11
|
-
options
|
|
12
|
-
} = volume;
|
|
13
|
-
return `${source}:${destination}` + (options ? `:${options}` : "");
|
|
4
|
+
const volumeFormat = (volume) => {
|
|
5
|
+
const { source, destination, options } = volume;
|
|
6
|
+
return `${source}:${destination}` + (options ? `:${options}` : "");
|
|
14
7
|
};
|
|
15
|
-
exports.volumeFormat = volumeFormat;
|
|
8
|
+
exports.volumeFormat = volumeFormat;
|
package/lib/utils/volumeParse.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.volumeParse = void 0;
|
|
7
|
-
const volumeParse = volume => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
const volumeParse = (volume) => {
|
|
5
|
+
const regVolume = /^([^:]+):([^:]+)(?::([^:]+))?$/;
|
|
6
|
+
const [, source, destination, options] = regVolume.exec(volume);
|
|
7
|
+
return {
|
|
8
|
+
source,
|
|
9
|
+
destination,
|
|
10
|
+
options
|
|
11
|
+
};
|
|
15
12
|
};
|
|
16
|
-
exports.volumeParse = volumeParse;
|
|
13
|
+
exports.volumeParse = volumeParse;
|
package/package.json
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wocker/ws",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"author": "Kris Papercut <krispcut@gmail.com>",
|
|
5
5
|
"description": "Docker workspace for web projects",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"main": "lib/index.js",
|
|
8
|
-
"types": "lib/index.d.ts",
|
|
9
7
|
"homepage": "https://kearisp.github.io/wocker",
|
|
10
8
|
"repository": {
|
|
11
9
|
"type": "git",
|
|
@@ -14,31 +12,21 @@
|
|
|
14
12
|
"bugs": {
|
|
15
13
|
"url": "https://github.com/kearisp/wocker-ws/issues"
|
|
16
14
|
},
|
|
15
|
+
"main": "lib/index.js",
|
|
16
|
+
"types": "lib/index.d.ts",
|
|
17
17
|
"bin": {
|
|
18
18
|
"ws": "./bin/ws.js"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"prepare": "npm run build",
|
|
22
22
|
"start": "npm run watch",
|
|
23
|
-
"build": "
|
|
24
|
-
"watch": "
|
|
25
|
-
"webpack:build": "webpack --mode=development --node-env=development",
|
|
26
|
-
"webpack:watch": "webpack --watch",
|
|
27
|
-
"babel:build": "babel src --out-dir lib --extensions .js --extensions .ts",
|
|
28
|
-
"babel:watch": "npm run babel:build -- --watch",
|
|
29
|
-
"ts:build": "tsc",
|
|
30
|
-
"ts:watch": "tsc -w",
|
|
31
|
-
"test": "jest --colors",
|
|
32
|
-
"test:cli": "npm run test --workspace @kearisp/cli",
|
|
33
|
-
"test-watch": "jest --colors --watch",
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"watch": "tsc -w",
|
|
34
25
|
"lint": "eslint \"**/*.{js,jsx,ts,tsx}\""
|
|
35
26
|
},
|
|
36
|
-
"workspaces": [
|
|
37
|
-
"packages/*"
|
|
38
|
-
],
|
|
39
27
|
"dependencies": {
|
|
40
|
-
"@kearisp/cli": "^1.0.
|
|
41
|
-
"@wocker/core": "^1.0.
|
|
28
|
+
"@kearisp/cli": "^1.0.6",
|
|
29
|
+
"@wocker/core": "^1.0.4",
|
|
42
30
|
"@wocker/utils": "^1.0.2",
|
|
43
31
|
"async-mutex": "^0.4.0",
|
|
44
32
|
"axios": "^1.4.0",
|
|
@@ -46,45 +34,31 @@
|
|
|
46
34
|
"child_process": "^1.0.2",
|
|
47
35
|
"cli-table3": "^0.6.2",
|
|
48
36
|
"date-fns": "^2.29.3",
|
|
49
|
-
"dockerode": "^
|
|
37
|
+
"dockerode": "^4.0.2",
|
|
50
38
|
"fs": "^0.0.1-security",
|
|
51
39
|
"inquirer": "^7.0.0",
|
|
52
40
|
"md5": "^2.3.0",
|
|
53
41
|
"os": "^0.1.2",
|
|
54
42
|
"path": "^0.12.7",
|
|
55
43
|
"readable-stream": "^4.1.0",
|
|
44
|
+
"reflect-metadata": "^0.2.1",
|
|
56
45
|
"tty": "^1.0.1"
|
|
57
46
|
},
|
|
58
47
|
"devDependencies": {
|
|
59
|
-
"@
|
|
60
|
-
"@babel/core": "^7.22.11",
|
|
61
|
-
"@babel/eslint-parser": "^7.15.8",
|
|
62
|
-
"@babel/eslint-plugin": "^7.14.5",
|
|
63
|
-
"@babel/preset-env": "^7.21.5",
|
|
64
|
-
"@babel/preset-typescript": "^7.21.5",
|
|
65
|
-
"@types/dockerode": "^3.3.14",
|
|
48
|
+
"@types/dockerode": "^3.3.23",
|
|
66
49
|
"@types/inquirer": "^7.0.0",
|
|
67
|
-
"@types/jest": "^
|
|
50
|
+
"@types/jest": "^29.5.12",
|
|
68
51
|
"@types/lodash": "^4.14.161",
|
|
69
52
|
"@types/md5": "^2.3.2",
|
|
70
53
|
"@types/mute-stream": "^0.0.1",
|
|
71
|
-
"@types/node": "^
|
|
54
|
+
"@types/node": "^20.11.16",
|
|
72
55
|
"@types/readable-stream": "^2.3.15",
|
|
73
56
|
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
|
74
57
|
"@typescript-eslint/parser": "^6.5.0",
|
|
75
|
-
"@webpack-cli/generators": "^3.0.1",
|
|
76
|
-
"babel-jest": "^28.0.0",
|
|
77
|
-
"babel-loader": "^8.2.3",
|
|
78
|
-
"babel-plugin-module-resolver": "^5.0.0",
|
|
79
58
|
"eslint": "^8.48.0",
|
|
80
59
|
"eslint-plugin-import": "^2.28.1",
|
|
81
60
|
"eslint-plugin-node": "^11.1.0",
|
|
82
61
|
"eslint-webpack-plugin": "^3.1.0",
|
|
83
|
-
"
|
|
84
|
-
"ts-loader": "^9.2.6",
|
|
85
|
-
"ts-node": "^10.9.1",
|
|
86
|
-
"typescript": "^5.2.2",
|
|
87
|
-
"webpack": "^5.60.0",
|
|
88
|
-
"webpack-cli": "^4.9.1"
|
|
62
|
+
"typescript": "^5.3.3"
|
|
89
63
|
}
|
|
90
64
|
}
|
package/presets/node/Dockerfile
CHANGED
|
@@ -3,6 +3,9 @@ ARG PACKAGE_MANAGER
|
|
|
3
3
|
|
|
4
4
|
FROM node:${NODE_VERSION}
|
|
5
5
|
|
|
6
|
+
ARG UID=1000
|
|
7
|
+
ARG USER=user
|
|
8
|
+
|
|
6
9
|
ENV TZ=America/Los_Angeles
|
|
7
10
|
ENV APP_PORT 80
|
|
8
11
|
ENV PORT=$APP_PORT
|
|
@@ -26,8 +29,7 @@ WORKDIR /usr/app
|
|
|
26
29
|
|
|
27
30
|
EXPOSE 80
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
# ${NPM_RUN}
|
|
32
|
+
USER $UID
|
|
31
33
|
|
|
32
34
|
CMD if [ "$PACKAGE_MANAGER" = "npm" ]; then \
|
|
33
35
|
npm install --quiet --no-progress; \
|
|
@@ -3,9 +3,10 @@ ARG PHP_VERSION
|
|
|
3
3
|
FROM php:${PHP_VERSION}-apache
|
|
4
4
|
|
|
5
5
|
ARG UID=1000
|
|
6
|
-
ARG USER=
|
|
6
|
+
ARG USER=www-data
|
|
7
7
|
|
|
8
|
-
RUN
|
|
8
|
+
RUN usermod -u 1000 www-data && \
|
|
9
|
+
# useradd -G root,www-data -u $UID -d /home/$USER $USER && \
|
|
9
10
|
mkdir -p /home/$USER && \
|
|
10
11
|
touch /home/$USER/.bashrc && \
|
|
11
12
|
chown -R $USER:$USER /home/$USER
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
name: Publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types:
|
|
6
|
-
- published
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
publish:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
environment: publish
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout code
|
|
14
|
-
uses: actions/checkout@v3
|
|
15
|
-
|
|
16
|
-
- name: Set up Node.js
|
|
17
|
-
uses: actions/setup-node@v3
|
|
18
|
-
with:
|
|
19
|
-
node-version: '18'
|
|
20
|
-
registry-url: 'https://registry.npmjs.org'
|
|
21
|
-
|
|
22
|
-
- name: Install dependencies
|
|
23
|
-
run: npm install
|
|
24
|
-
|
|
25
|
-
- name: Build
|
|
26
|
-
run: npm run build
|
|
27
|
-
|
|
28
|
-
- name: Publish to NPM
|
|
29
|
-
env:
|
|
30
|
-
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
|
|
31
|
-
run: npm publish
|