@xrystal/core 3.55.68 → 3.55.72
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 +46 -2
- package/package.json +1 -1
- package/x/bin/commands/config.mjs +102 -19
- package/x/bin/commands/telepresence.mjs +30 -16
- package/x/bin/helpers/.generated/tmp-schema.mjs +39 -34
- package/x/bin/helpers/build-config.mjs +7 -7
- package/x/bin/helpers/cli-help.mjs +1 -1
- package/x/bin/helpers/config-sync.mjs +145 -0
- package/x/bin/helpers/resolve-tls-bundle.mjs +109 -0
- package/x/bin/helpers/telepresence-install.mjs +16 -0
- package/x/bin/helpers/telepresence-layout.mjs +24 -6
- package/x/bin/helpers/telepresence-runtime.mjs +109 -66
- package/x/bin/helpers/telepresence-tls-path-rewrite.mjs +69 -0
- package/x/bin/helpers/workspace-scaffold.mjs +4 -1
- package/x/bin/helpers/xrystal-config.mjs +55 -13
- package/x/bin/scripts/telepresence-client-install.sh +27 -0
- package/x/dist/utils/helpers/tmp/tmp-schema.js +6 -1
- package/x/templates/api-service/docker/Dockerfile +2 -2
- package/x/templates/api-service/docker/Dockerfile.dev +2 -2
- package/x/templates/api-service/docker/docker-compose.dev.yml +2 -2
- package/x/templates/api-service/docker/docker-compose.yml +1 -1
- package/x/bin/helpers/resolve-infra-helper.mjs +0 -90
|
@@ -178,7 +178,7 @@ export function assertNoLegacyTmpKeys(configs) {
|
|
|
178
178
|
throw new Error(`${defaults.packageName}: configs.depends.loaders.build removed — use configs.global.build`);
|
|
179
179
|
}
|
|
180
180
|
if (isRecord(configs?.cluster)) {
|
|
181
|
-
throw new Error(`${defaults.packageName}: configs.cluster removed — deployment name is
|
|
181
|
+
throw new Error(`${defaults.packageName}: configs.cluster removed — deployment name is configs.service.name (CLI --deployment overrides)`);
|
|
182
182
|
}
|
|
183
183
|
const global = isRecord(configs?.global) ? configs.global : {};
|
|
184
184
|
if ('fileWatchIntervalMs' in global && global.fileWatchIntervalMs !== undefined && global.fileWatchIntervalMs !== null) {
|
|
@@ -210,6 +210,11 @@ export function resolveTmpLoaders(configs) {
|
|
|
210
210
|
}
|
|
211
211
|
export function resolveTmpDeploymentName(tmp) {
|
|
212
212
|
assertNoLegacyTmpKeys(isRecord(tmp?.configs) ? tmp.configs : undefined);
|
|
213
|
+
const configs = isRecord(tmp?.configs) ? tmp.configs : {};
|
|
214
|
+
const service = isRecord(configs.service) ? configs.service : {};
|
|
215
|
+
const serviceName = typeof service.name === 'string' ? service.name.trim() : undefined;
|
|
216
|
+
if (serviceName)
|
|
217
|
+
return serviceName;
|
|
213
218
|
const project = isRecord(tmp?.project) ? tmp.project : {};
|
|
214
219
|
const projectName = typeof project.name === 'string' ? project.name.trim() : undefined;
|
|
215
220
|
return projectName || undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
FROM oven/bun:1.
|
|
1
|
+
FROM oven/bun:1.4-alpine AS builder
|
|
2
2
|
ARG SERVICE_PATH
|
|
3
3
|
WORKDIR /app
|
|
4
4
|
|
|
@@ -13,7 +13,7 @@ ARG OUTPUT_DIR=x
|
|
|
13
13
|
ENV ROOT_FOLDER_PATH=${OUTPUT_DIR}
|
|
14
14
|
RUN bun run build
|
|
15
15
|
|
|
16
|
-
FROM oven/bun:1.
|
|
16
|
+
FROM oven/bun:1.4-alpine
|
|
17
17
|
ARG OUTPUT_DIR=x
|
|
18
18
|
ENV ROOT_FOLDER_PATH=${OUTPUT_DIR}
|
|
19
19
|
WORKDIR /app
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
ARG SERVICE_PATH
|
|
2
2
|
|
|
3
|
-
FROM oven/bun:1.
|
|
3
|
+
FROM oven/bun:1.4-alpine AS base
|
|
4
4
|
ARG SERVICE_PATH
|
|
5
5
|
WORKDIR /app
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ COPY ${SERVICE_PATH}/package.json ${SERVICE_PATH}/bun.lockb* ./
|
|
|
9
9
|
RUN --mount=type=cache,id=bun,target=/root/.bun/install/cache \
|
|
10
10
|
bun install
|
|
11
11
|
|
|
12
|
-
FROM oven/bun:1.
|
|
12
|
+
FROM oven/bun:1.4-alpine AS release
|
|
13
13
|
ARG SERVICE_PATH
|
|
14
14
|
WORKDIR /app
|
|
15
15
|
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import { fileURLToPath } from 'node:url'
|
|
4
|
-
|
|
5
|
-
import { getCliConfigInfraDir } from './xrystal-config.mjs'
|
|
6
|
-
|
|
7
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
8
|
-
const HELPERS_DIR = 'scripts/helpers'
|
|
9
|
-
|
|
10
|
-
function infraRootHasHelpers(root) {
|
|
11
|
-
if (!root) return false
|
|
12
|
-
return fs.existsSync(path.join(root, HELPERS_DIR))
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/** Walk cwd → parents; sibling `-infrastructure-` next to each ancestor folder. */
|
|
16
|
-
export function walkUpForInfraRoot(start = process.cwd(), { maxDepth = 12 } = {}) {
|
|
17
|
-
let dir = path.resolve(start)
|
|
18
|
-
for (let depth = 0; depth < maxDepth; depth += 1) {
|
|
19
|
-
const sibling = path.join(path.dirname(dir), '-infrastructure-')
|
|
20
|
-
if (infraRootHasHelpers(sibling)) return sibling
|
|
21
|
-
|
|
22
|
-
const parent = path.dirname(dir)
|
|
23
|
-
if (parent === dir) break
|
|
24
|
-
dir = parent
|
|
25
|
-
}
|
|
26
|
-
return null
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function listInfraRootCandidates(start = process.cwd()) {
|
|
30
|
-
const seen = new Set()
|
|
31
|
-
const out = []
|
|
32
|
-
|
|
33
|
-
const push = (value) => {
|
|
34
|
-
const resolved = value ? path.resolve(String(value)) : null
|
|
35
|
-
if (!resolved || seen.has(resolved)) return
|
|
36
|
-
seen.add(resolved)
|
|
37
|
-
out.push(resolved)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
push(process.env.XRYSTAL_INFRA_DIR)
|
|
41
|
-
push(process.env.XRYSTAL_INFRA_ROOT)
|
|
42
|
-
push(getCliConfigInfraDir())
|
|
43
|
-
push(walkUpForInfraRoot(start))
|
|
44
|
-
push(path.resolve(start, '../-infrastructure-'))
|
|
45
|
-
push(path.resolve(start, '../../-infrastructure-'))
|
|
46
|
-
push(path.resolve(__dirname, '../../../..', '-infrastructure-'))
|
|
47
|
-
|
|
48
|
-
return out
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function findHelperScriptUnderRoot(root, name) {
|
|
52
|
-
const base = path.join(root, HELPERS_DIR)
|
|
53
|
-
const direct = path.join(base, name)
|
|
54
|
-
if (fs.existsSync(direct)) return direct
|
|
55
|
-
|
|
56
|
-
let entries
|
|
57
|
-
try {
|
|
58
|
-
entries = fs.readdirSync(base, { withFileTypes: true })
|
|
59
|
-
} catch {
|
|
60
|
-
return null
|
|
61
|
-
}
|
|
62
|
-
for (const ent of entries) {
|
|
63
|
-
if (!ent.isDirectory()) continue
|
|
64
|
-
const nested = path.join(base, ent.name, name)
|
|
65
|
-
if (fs.existsSync(nested)) return nested
|
|
66
|
-
}
|
|
67
|
-
return null
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** Resolve a script under -infrastructure-/scripts/helpers (incl. domain subdirs). */
|
|
71
|
-
export function resolveInfraHelperScript(name, { cwd = process.cwd() } = {}) {
|
|
72
|
-
for (const root of listInfraRootCandidates(cwd)) {
|
|
73
|
-
const script = findHelperScriptUnderRoot(root, name)
|
|
74
|
-
if (script) return script
|
|
75
|
-
}
|
|
76
|
-
return null
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export function formatInfraResolveHint({ cliName = 'xry', cwd = process.cwd() } = {}) {
|
|
80
|
-
const walked = walkUpForInfraRoot(cwd)
|
|
81
|
-
const lines = [
|
|
82
|
-
'Set infra repo path (one of):',
|
|
83
|
-
` ${cliName} config infra /path/to/-infrastructure-`,
|
|
84
|
-
' export XRYSTAL_INFRA_DIR=/path/to/-infrastructure-',
|
|
85
|
-
]
|
|
86
|
-
if (walked) {
|
|
87
|
-
lines.push(` detected near cwd: ${walked}`)
|
|
88
|
-
}
|
|
89
|
-
return lines.join('\n')
|
|
90
|
-
}
|