@giteeteam/apps-cli 0.2.3 → 0.2.5
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/dist/index.js +21 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var execa__default = /*#__PURE__*/_interopDefaultLegacy(execa);
|
|
|
31
31
|
var child_process__default = /*#__PURE__*/_interopDefaultLegacy(child_process);
|
|
32
32
|
var chokidar__default = /*#__PURE__*/_interopDefaultLegacy(chokidar);
|
|
33
33
|
|
|
34
|
-
var version = "0.2.
|
|
34
|
+
var version = "0.2.5";
|
|
35
35
|
|
|
36
36
|
const packageApp = async ({ outputDir, manifest, copyFiles }) => {
|
|
37
37
|
const { resources } = manifest;
|
|
@@ -399,7 +399,7 @@ class DockerService {
|
|
|
399
399
|
await this.execPromise(command);
|
|
400
400
|
}
|
|
401
401
|
async removeContainer(containerName) {
|
|
402
|
-
await this.execPromise(`docker rm -f ${containerName}`);
|
|
402
|
+
await this.execPromise(`docker rm -f ${containerName}`).catch(() => { });
|
|
403
403
|
}
|
|
404
404
|
execPromise(cmd) {
|
|
405
405
|
return new Promise((resolve, reject) => {
|
|
@@ -420,32 +420,30 @@ const watchFiles = async (options) => {
|
|
|
420
420
|
const { inputDir, outputDir } = options;
|
|
421
421
|
const manifest = await getManifest();
|
|
422
422
|
const functionFiles = manifest.getFunctionFiles();
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
});
|
|
442
|
-
}
|
|
423
|
+
let timer;
|
|
424
|
+
// 监听整个文件夹,有一个文件改动,则全部重新build
|
|
425
|
+
// TODO 解析出文件之间的依赖关系,提升构建速度
|
|
426
|
+
const watcher = chokidar__default["default"].watch(inputDir);
|
|
427
|
+
watcher.on('change', () => {
|
|
428
|
+
clearTimeout(timer);
|
|
429
|
+
timer = setTimeout(() => {
|
|
430
|
+
console.log(`build ${inputDir}`);
|
|
431
|
+
for (const fileName of functionFiles) {
|
|
432
|
+
appsBundler.bundle({
|
|
433
|
+
inputDir,
|
|
434
|
+
outputDir,
|
|
435
|
+
fileName,
|
|
436
|
+
mode: appsBundler.MODE.DEV,
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
}, 1000);
|
|
440
|
+
});
|
|
443
441
|
};
|
|
444
442
|
|
|
445
443
|
var _a, _b;
|
|
446
444
|
const image = {
|
|
447
445
|
repository: 'registry.baidubce.com/proxima/proxima-apps-runtime-server',
|
|
448
|
-
tag: (_a = process.env.IMAGE_TAG) !== null && _a !== void 0 ? _a : '2.
|
|
446
|
+
tag: (_a = process.env.IMAGE_TAG) !== null && _a !== void 0 ? _a : '2.7.0-alpha-44',
|
|
449
447
|
};
|
|
450
448
|
const containerPort = Number((_b = process.env.CONTAINER_PORT) !== null && _b !== void 0 ? _b : 8455);
|
|
451
449
|
const containerName = 'cli-dev-apps-runtime-server';
|