@absolutejs/absolute 0.13.5 → 0.13.7
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/cli/index.js +19 -7
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// @bun
|
|
3
3
|
|
|
4
4
|
// src/cli/index.ts
|
|
5
|
+
var {$ } = globalThis.Bun;
|
|
5
6
|
import { existsSync } from "fs";
|
|
6
7
|
import { resolve } from "path";
|
|
7
8
|
var COMPOSE_PATH = "db/docker-compose.db.yml";
|
|
@@ -17,16 +18,27 @@ var readDbScripts = async () => {
|
|
|
17
18
|
return null;
|
|
18
19
|
return { upCommand, downCommand };
|
|
19
20
|
};
|
|
21
|
+
var timed = async (label, fn) => {
|
|
22
|
+
process.stdout.write(label);
|
|
23
|
+
const start = performance.now();
|
|
24
|
+
await fn();
|
|
25
|
+
const duration = ((performance.now() - start) / 1000).toFixed(2);
|
|
26
|
+
process.stdout.write(` \x1B[90m${duration}s\x1B[0m
|
|
27
|
+
`);
|
|
28
|
+
};
|
|
20
29
|
var startDatabase = async (scripts) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
await timed("Starting database container...", async () => {
|
|
31
|
+
const { exitCode } = await $`${{ raw: scripts.upCommand }}`.quiet().nothrow();
|
|
32
|
+
if (exitCode !== 0)
|
|
33
|
+
process.exit(exitCode);
|
|
34
|
+
});
|
|
25
35
|
};
|
|
26
36
|
var stopDatabase = async (scripts) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
await
|
|
37
|
+
process.stdout.write(`
|
|
38
|
+
`);
|
|
39
|
+
await timed("Stopping database container...", async () => {
|
|
40
|
+
await $`${{ raw: scripts.downCommand }}`.quiet().nothrow();
|
|
41
|
+
});
|
|
30
42
|
};
|
|
31
43
|
var dev = async (serverEntry) => {
|
|
32
44
|
const usesDocker = existsSync(resolve(COMPOSE_PATH));
|
package/package.json
CHANGED