ryugi-artifacts 1.33.0 → 1.34.0
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.cjs
CHANGED
|
@@ -29,6 +29,7 @@ var import_node_util = require("node:util");
|
|
|
29
29
|
|
|
30
30
|
// src/cli/paths.ts
|
|
31
31
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
32
|
+
var import_node_os = __toESM(require("node:os"), 1);
|
|
32
33
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
33
34
|
var CliError = class extends Error {
|
|
34
35
|
constructor(message, fields = {}, code = 1) {
|
|
@@ -39,6 +40,21 @@ var CliError = class extends Error {
|
|
|
39
40
|
fields;
|
|
40
41
|
code;
|
|
41
42
|
};
|
|
43
|
+
var resolvesRoot = () => !process.env.RYUGI_ARTIFACTS_COMMAND || process.env.RYUGI_ARTIFACTS_RESOLVE_ROOT === "1";
|
|
44
|
+
function projectRoot(dir) {
|
|
45
|
+
let home = "";
|
|
46
|
+
try {
|
|
47
|
+
home = import_node_fs.default.realpathSync(import_node_os.default.homedir());
|
|
48
|
+
} catch {
|
|
49
|
+
}
|
|
50
|
+
const chain = [];
|
|
51
|
+
for (let current = dir; ; current = import_node_path.default.dirname(current)) {
|
|
52
|
+
chain.push(current);
|
|
53
|
+
if (import_node_fs.default.existsSync(import_node_path.default.join(current, ".git")) && (current !== home || dir === home)) break;
|
|
54
|
+
if (import_node_path.default.dirname(current) === current) return dir;
|
|
55
|
+
}
|
|
56
|
+
return chain.find((candidate) => import_node_fs.default.existsSync(import_node_path.default.join(candidate, ".ryugi", "artifacts"))) ?? chain[chain.length - 1];
|
|
57
|
+
}
|
|
42
58
|
function projectPaths(dir) {
|
|
43
59
|
let project;
|
|
44
60
|
try {
|
|
@@ -47,6 +63,7 @@ function projectPaths(dir) {
|
|
|
47
63
|
} catch {
|
|
48
64
|
throw new CliError(`Project directory not found: ${dir}`);
|
|
49
65
|
}
|
|
66
|
+
if (resolvesRoot()) project = projectRoot(project);
|
|
50
67
|
const root = import_node_path.default.join(project, ".ryugi", "artifacts");
|
|
51
68
|
const state = import_node_path.default.join(root, ".state");
|
|
52
69
|
return {
|
|
@@ -370,7 +387,7 @@ ${groups.map(groupText).join("\n")}` : head;
|
|
|
370
387
|
}
|
|
371
388
|
|
|
372
389
|
// src/cli/config.ts
|
|
373
|
-
var
|
|
390
|
+
var import_node_os2 = __toESM(require("node:os"), 1);
|
|
374
391
|
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
375
392
|
|
|
376
393
|
// src/server/config.ts
|
|
@@ -501,7 +518,7 @@ function writeGlobalAutoPublish(file, value) {
|
|
|
501
518
|
// src/cli/config.ts
|
|
502
519
|
var VALUES = { on: true, off: false, inherit: null };
|
|
503
520
|
function config(options, emit) {
|
|
504
|
-
const globalFile = settingsFileFor(credentialsFile(process.env, process.platform,
|
|
521
|
+
const globalFile = settingsFileFor(credentialsFile(process.env, process.platform, import_node_os2.default.homedir()));
|
|
505
522
|
const projectFile = import_node_path6.default.join(import_node_path6.default.dirname(projectPaths(options.projectDir).root), "config.json");
|
|
506
523
|
if (options.autoPublish !== void 0) {
|
|
507
524
|
const value = VALUES[options.autoPublish];
|
|
@@ -517,7 +534,7 @@ function config(options, emit) {
|
|
|
517
534
|
}
|
|
518
535
|
|
|
519
536
|
// src/cli/monitor-view.ts
|
|
520
|
-
var
|
|
537
|
+
var import_node_os3 = __toESM(require("node:os"), 1);
|
|
521
538
|
var REFRESH_SECONDS = 2;
|
|
522
539
|
var BOLD = "\x1B[1m";
|
|
523
540
|
var DIM = "\x1B[2m";
|
|
@@ -534,7 +551,7 @@ function duration(ms) {
|
|
|
534
551
|
if (hours < 24) return `${hours}h${minutes % 60 ? `${minutes % 60}m` : ""}`;
|
|
535
552
|
return `${Math.floor(hours / 24)}d${hours % 24 ? `${hours % 24}h` : ""}`;
|
|
536
553
|
}
|
|
537
|
-
var shortPath = (project, home =
|
|
554
|
+
var shortPath = (project, home = import_node_os3.default.homedir()) => project === home || project.startsWith(`${home}/`) ? `~${project.slice(home.length)}` : project;
|
|
538
555
|
function tags(row) {
|
|
539
556
|
return [row.safeToStop && "safe to stop", row.oldRelease && "old release", row.status === "no-status" && "no status"].filter(Boolean);
|
|
540
557
|
}
|
|
@@ -641,7 +658,7 @@ function handleKey(state, key, rows) {
|
|
|
641
658
|
// src/cli/monitor-ui.ts
|
|
642
659
|
var import_node_child_process2 = require("node:child_process");
|
|
643
660
|
var import_node_fs9 = __toESM(require("node:fs"), 1);
|
|
644
|
-
var
|
|
661
|
+
var import_node_os5 = __toESM(require("node:os"), 1);
|
|
645
662
|
var import_node_readline = __toESM(require("node:readline"), 1);
|
|
646
663
|
|
|
647
664
|
// src/server/lifecycle.ts
|
|
@@ -660,9 +677,9 @@ var import_node_path8 = __toESM(require("node:path"), 1);
|
|
|
660
677
|
// src/server/registry.ts
|
|
661
678
|
var import_node_crypto = __toESM(require("node:crypto"), 1);
|
|
662
679
|
var import_node_fs7 = __toESM(require("node:fs"), 1);
|
|
663
|
-
var
|
|
680
|
+
var import_node_os4 = __toESM(require("node:os"), 1);
|
|
664
681
|
var import_node_path7 = __toESM(require("node:path"), 1);
|
|
665
|
-
function registryDir(env = process.env, platform = process.platform, uid = process.getuid?.() ?? -1, tmpdir =
|
|
682
|
+
function registryDir(env = process.env, platform = process.platform, uid = process.getuid?.() ?? -1, tmpdir = import_node_os4.default.tmpdir()) {
|
|
666
683
|
if (env.RYUGI_RUNTIME_DIR) return import_node_path7.default.join(env.RYUGI_RUNTIME_DIR, "servers");
|
|
667
684
|
if (platform === "win32") return import_node_path7.default.join(tmpdir, "ryugi", "servers");
|
|
668
685
|
return `/tmp/ryugi-${uid}/servers`;
|
|
@@ -859,7 +876,7 @@ async function runMonitorUi() {
|
|
|
859
876
|
process.on("exit", restore);
|
|
860
877
|
const draw = () => {
|
|
861
878
|
if (closed) return;
|
|
862
|
-
const screen = { width: stdout.columns || 80, height: stdout.rows || 24, now: Date.now(), home:
|
|
879
|
+
const screen = { width: stdout.columns || 80, height: stdout.rows || 24, now: Date.now(), home: import_node_os5.default.homedir() };
|
|
863
880
|
const row = rows[state.selected];
|
|
864
881
|
const lines = state.mode === "log" && row ? renderLog(row, readTail(row.log), screen) : renderList(rows, state, screen);
|
|
865
882
|
stdout.write(`\x1B[H${lines.join("\x1B[K\n")}\x1B[K\x1B[J`);
|
|
@@ -1460,7 +1477,7 @@ async function main(argv) {
|
|
|
1460
1477
|
return await monitor({ json: !!values.json }, emit);
|
|
1461
1478
|
}
|
|
1462
1479
|
if (command === "--version" || command === "-v") {
|
|
1463
|
-
console.log("1.
|
|
1480
|
+
console.log("1.34.0");
|
|
1464
1481
|
return 0;
|
|
1465
1482
|
}
|
|
1466
1483
|
if (command === "--help" || command === "-h") {
|
package/dist/server.cjs
CHANGED
|
@@ -91865,7 +91865,7 @@ function touchEntry(dir, entry) {
|
|
|
91865
91865
|
}
|
|
91866
91866
|
|
|
91867
91867
|
// package.json
|
|
91868
|
-
var version = "1.
|
|
91868
|
+
var version = "1.34.0";
|
|
91869
91869
|
|
|
91870
91870
|
// src/server/main.ts
|
|
91871
91871
|
async function main() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{n as t,t as n}from"./jsx-runtime-CldxteV5.js";import{T as r,o as i,w as a}from"./RailSwitch-B8Aht-FG.js";import{t as o}from"./index.js";import s from"./CloudDocument-DBhwAPZX.js";import{DocumentView as c,t as l}from"./DocumentPage-p78IN0UO.js";var u=e(t(),1),d=`1.
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{n as t,t as n}from"./jsx-runtime-CldxteV5.js";import{T as r,o as i,w as a}from"./RailSwitch-B8Aht-FG.js";import{t as o}from"./index.js";import s from"./CloudDocument-DBhwAPZX.js";import{DocumentView as c,t as l}from"./DocumentPage-p78IN0UO.js";var u=e(t(),1),d=`1.34.0`,f=e=>/^(\d+)\.(\d+)\./.exec(e??``)?.slice(1,3).join(`.`)??null;function p(e,t){let n=f(e);return n!==null&&n===f(t)}var m=(e,t)=>a.t(`document.versionReason`,{host:t??a.t(`document.unknownVersion`),viewer:e}),h=n();function g({id:e,state:t,contentBase:n,liveContentBase:a,comments:f}){let{transport:g,presence:_}=l(e,a??n??``),v=_?.online??!1;i(e,{online:_?.online??null});let[y,b]=(0,u.useState)(!1);(0,u.useEffect)(()=>{v&&b(!0)},[v]);let x=t&&n?(0,h.jsx)(s,{id:e,state:t,contentBase:n,comments:f,offline:_!==null&&!v}):null;if(!g||!(y||v))return x??(0,h.jsx)(o,{children:r(_===null?`common.connecting`:`document.notPublished`)});let S=v&&p(d,_?.version??null),C=v&&!S?m(d,_?.version??null):null;return(0,h.jsx)(c,{id:e,transport:g,live:v,cloud:{online:v,canEdit:S,reason:C},fallback:x})}export{g as default};
|