MCPcopy Create free account
hub / github.com/Noumena-Network/code / getVersionPublishTimes

Function getVersionPublishTimes

src/cli/rollback.ts:47–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45}
46
47async function getVersionPublishTimes(): Promise<Record<string, string>> {
48 const packageUrl = MACRO.NATIVE_PACKAGE_URL ?? MACRO.PACKAGE_URL
49 const result = await execFileNoThrowWithCwd(
50 'npm',
51 ['view', packageUrl, 'time', '--json', '--prefer-online'],
52 {
53 cwd: homedir(),
54 timeout: 30_000,
55 },
56 )
57
58 if (result.code !== 0) {
59 logForDebugging(`rollback: failed to load version publish times: ${result.stderr}`)
60 return {}
61 }
62
63 try {
64 const parsed = JSON.parse(result.stdout) as Record<string, string>
65 return parsed && typeof parsed === 'object' ? parsed : {}
66 } catch (error) {
67 logForDebugging(`rollback: failed to parse version publish times: ${String(error)}`)
68 return {}
69 }
70}
71
72async function listVersions(): Promise<void> {
73 const [versions, publishTimes] = await Promise.all([

Callers 1

listVersionsFunction · 0.85

Calls 2

execFileNoThrowWithCwdFunction · 0.85
logForDebuggingFunction · 0.50

Tested by

no test coverage detected