@holo-js/cli 0.1.4 → 0.1.6
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/bin/holo.mjs +192 -35
- package/dist/{broadcast-CSSARTSA.mjs → broadcast-2AZIC5ZP.mjs} +5 -5
- package/dist/{cache-4G6QGIZO.mjs → cache-5OROX4GL.mjs} +5 -5
- package/dist/{cache-migrations-NATT5WPQ.mjs → cache-migrations-7XFVLTOC.mjs} +15 -16
- package/dist/{chunk-EUIVXVJL.mjs → chunk-57SJ566R.mjs} +1 -1
- package/dist/chunk-5BLEC66P.mjs +284 -0
- package/dist/{chunk-JX2ZH6XY.mjs → chunk-5EU32E7X.mjs} +3 -3
- package/dist/{chunk-Q5F6C2D4.mjs → chunk-BAFQ2GOA.mjs} +1 -1
- package/dist/{chunk-CUL4RJTG.mjs → chunk-F4MT6GBK.mjs} +1 -1
- package/dist/{chunk-3OTCSFDG.mjs → chunk-MXKNQACM.mjs} +544 -82
- package/dist/{chunk-ZLRO7HXY.mjs → chunk-ODJA3TFG.mjs} +156 -15
- package/dist/{chunk-QYLSMF7V.mjs → chunk-OZUDZEAW.mjs} +142 -28
- package/dist/{chunk-66FHW725.mjs → chunk-R6BWRY3E.mjs} +28 -2
- package/dist/{chunk-MZXN2YMI.mjs → chunk-USACXIIB.mjs} +3544 -2522
- package/dist/{chunk-VT5IDQG6.mjs → chunk-UZTDQKIY.mjs} +61 -44
- package/dist/{config-LS5USBRB.mjs → config-5JSC6KJG.mjs} +3 -3
- package/dist/{dev-LZ3O2E3U.mjs → dev-F6QUWNCR.mjs} +7 -7
- package/dist/{discovery-GBLAUTXS.mjs → discovery-JLT2EOGH.mjs} +3 -3
- package/dist/{generators-DSN4GWJI.mjs → generators-WVKJLAYB.mjs} +134 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +189 -32
- package/dist/media-migrations-DU7WEKAY.mjs +117 -0
- package/dist/{queue-FV35LLPR.mjs → queue-NOLVWPCH.mjs} +14 -14
- package/dist/{queue-migrations-SSIYKK5S.mjs → queue-migrations-HXNTZMGL.mjs} +24 -20
- package/dist/{runtime-EFZ5H5IL.mjs → runtime-462O2BDR.mjs} +9 -7
- package/dist/{runtime-OOSJ5JBY.mjs → runtime-ZKD6URAV.mjs} +1 -1
- package/dist/{scaffold-7OTDH4UR.mjs → scaffold-WOJV2ZZI.mjs} +18 -5
- package/dist/{security-ATKDC26E.mjs → security-5VGM467J.mjs} +10 -7
- package/package.json +13 -12
- package/dist/broadcast-YSIJCL3R.mjs +0 -85
- package/dist/cache-OWQY4E7W.mjs +0 -67
- package/dist/cache-migrations-RVEA6CEU.mjs +0 -155
- package/dist/chunk-BWW5TDFI.mjs +0 -4
- package/dist/chunk-D4GG556Y.mjs +0 -23
- package/dist/chunk-DMH2B4UQ.mjs +0 -343
- package/dist/chunk-ET7UXHHQ.mjs +0 -166
- package/dist/chunk-G5ADO27Q.mjs +0 -463
- package/dist/chunk-GSQ3HTRO.mjs +0 -165
- package/dist/chunk-H7TJ4FB3.mjs +0 -848
- package/dist/chunk-ICJR7TS4.mjs +0 -66
- package/dist/chunk-M7J3YTHR.mjs +0 -26
- package/dist/chunk-QFUSWV3J.mjs +0 -3237
- package/dist/chunk-S7P7EBM3.mjs +0 -787
- package/dist/chunk-SRWJU3A5.mjs +0 -11
- package/dist/chunk-URK7C3VQ.mjs +0 -538
- package/dist/chunk-XUYKPU5Q.mjs +0 -272
- package/dist/config-DMWBMMGD.mjs +0 -26
- package/dist/dev-KQFT7RHR.mjs +0 -43
- package/dist/discovery-R733D2PO.mjs +0 -29
- package/dist/generators-WX45BI4U.mjs +0 -426
- package/dist/queue-6OG7VJ34.mjs +0 -626
- package/dist/queue-migrations-NK2EYX3J.mjs +0 -163
- package/dist/runtime-4BV3JODY.mjs +0 -56
- package/dist/runtime-ANBO7VQM.mjs +0 -33
- package/dist/scaffold-DRKBGS2K.mjs +0 -120
- package/dist/security-R7VH6W5H.mjs +0 -69
package/dist/chunk-ICJR7TS4.mjs
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
fileExists
|
|
4
|
-
} from "./chunk-M7J3YTHR.mjs";
|
|
5
|
-
|
|
6
|
-
// src/migrations.ts
|
|
7
|
-
import { join } from "path";
|
|
8
|
-
import {
|
|
9
|
-
generateMigrationTemplate,
|
|
10
|
-
inferMigrationTableName,
|
|
11
|
-
inferMigrationTemplateKind,
|
|
12
|
-
normalizeMigrationSlug
|
|
13
|
-
} from "@holo-js/db";
|
|
14
|
-
var MIGRATION_NAME_PREFIX_PATTERN = /^\d{4}_\d{2}_\d{2}_\d{6}_/;
|
|
15
|
-
function stripMigrationNamePrefix(name) {
|
|
16
|
-
return name.replace(MIGRATION_NAME_PREFIX_PATTERN, "");
|
|
17
|
-
}
|
|
18
|
-
function getRegistryMigrationSlug(name) {
|
|
19
|
-
return normalizeMigrationSlug(stripMigrationNamePrefix(name));
|
|
20
|
-
}
|
|
21
|
-
function hasRegisteredMigrationSlug(registry, migrationSlug) {
|
|
22
|
-
return Boolean(registry?.migrations.some((entry) => {
|
|
23
|
-
try {
|
|
24
|
-
return getRegistryMigrationSlug(entry.name) === migrationSlug;
|
|
25
|
-
} catch {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
function hasRegisteredCreateTableMigration(registry, tableName) {
|
|
31
|
-
const expectedSlug = `create_${tableName}_table`;
|
|
32
|
-
return Boolean(registry?.migrations.some((entry) => {
|
|
33
|
-
try {
|
|
34
|
-
const slug = getRegistryMigrationSlug(entry.name);
|
|
35
|
-
if (slug === expectedSlug) {
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
if (inferMigrationTemplateKind(slug) !== "create_table") {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
return inferMigrationTableName(slug, "create_table") === tableName;
|
|
42
|
-
} catch {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
async function nextMigrationTemplate(name, migrationsDir, options = {}) {
|
|
48
|
-
let offsetSeconds = 0;
|
|
49
|
-
while (true) {
|
|
50
|
-
const candidate = generateMigrationTemplate(name, {
|
|
51
|
-
date: new Date(Date.now() + offsetSeconds * 1e3),
|
|
52
|
-
...options
|
|
53
|
-
});
|
|
54
|
-
if (!await fileExists(join(migrationsDir, candidate.fileName))) {
|
|
55
|
-
return candidate;
|
|
56
|
-
}
|
|
57
|
-
offsetSeconds += 1;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export {
|
|
62
|
-
getRegistryMigrationSlug,
|
|
63
|
-
hasRegisteredMigrationSlug,
|
|
64
|
-
hasRegisteredCreateTableMigration,
|
|
65
|
-
nextMigrationTemplate
|
|
66
|
-
};
|
package/dist/chunk-M7J3YTHR.mjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
readTextFile
|
|
4
|
-
} from "./chunk-66FHW725.mjs";
|
|
5
|
-
|
|
6
|
-
// src/fs-utils.ts
|
|
7
|
-
import { stat } from "fs/promises";
|
|
8
|
-
async function fileExists(path) {
|
|
9
|
-
try {
|
|
10
|
-
await stat(path);
|
|
11
|
-
return true;
|
|
12
|
-
} catch {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
async function ensureAbsent(path) {
|
|
17
|
-
const existing = await readTextFile(path);
|
|
18
|
-
if (typeof existing !== "undefined") {
|
|
19
|
-
throw new TypeError(`Refusing to overwrite existing file: ${path}`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
fileExists,
|
|
25
|
-
ensureAbsent
|
|
26
|
-
};
|