@layerzerolabs/vm-tooling 0.2.90 → 0.2.91
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/package.json +11 -10
- package/dist/25W5MXEX.cjs +0 -17
- package/dist/25W5MXEX.cjs.map +0 -1
- package/dist/4BP4CCPZ.cjs +0 -48
- package/dist/4BP4CCPZ.cjs.map +0 -1
- package/dist/7E7TMR5F.cjs +0 -237
- package/dist/7E7TMR5F.cjs.map +0 -1
- package/dist/7WWOPL2K.cjs +0 -109
- package/dist/7WWOPL2K.cjs.map +0 -1
- package/dist/HOQEVWFL.cjs +0 -71
- package/dist/HOQEVWFL.cjs.map +0 -1
- package/dist/KHVGLVR5.cjs +0 -44
- package/dist/KHVGLVR5.cjs.map +0 -1
- package/dist/M6CETDAD.cjs +0 -8
- package/dist/M6CETDAD.cjs.map +0 -1
- package/dist/MH3SPPX5.cjs +0 -140
- package/dist/MH3SPPX5.cjs.map +0 -1
- package/dist/QLR2UW44.cjs +0 -68
- package/dist/QLR2UW44.cjs.map +0 -1
- package/dist/REVK4LZT.cjs +0 -41
- package/dist/REVK4LZT.cjs.map +0 -1
- package/dist/RVRC4KBY.cjs +0 -78
- package/dist/RVRC4KBY.cjs.map +0 -1
- package/dist/S6PEV2YJ.cjs +0 -61
- package/dist/S6PEV2YJ.cjs.map +0 -1
- package/dist/UOFUYV3K.cjs +0 -22
- package/dist/UOFUYV3K.cjs.map +0 -1
- package/dist/WFBRUQAF.cjs +0 -59
- package/dist/WFBRUQAF.cjs.map +0 -1
- package/dist/X64VX57C.cjs +0 -11
- package/dist/X64VX57C.cjs.map +0 -1
- package/dist/XKJWJQ2X.cjs +0 -57
- package/dist/XKJWJQ2X.cjs.map +0 -1
- package/dist/XSZ224E6.cjs +0 -8
- package/dist/XSZ224E6.cjs.map +0 -1
- package/dist/ZZHCL54L.cjs +0 -1347
- package/dist/ZZHCL54L.cjs.map +0 -1
- package/dist/cli.cjs +0 -25
- package/dist/cli.cjs.map +0 -1
- package/dist/config.cjs +0 -25
- package/dist/config.cjs.map +0 -1
- package/dist/context.cjs +0 -8
- package/dist/context.cjs.map +0 -1
- package/dist/core/index.cjs +0 -25
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/lock.cjs +0 -21
- package/dist/core/lock.cjs.map +0 -1
- package/dist/core/lock.test.cjs +0 -18389
- package/dist/core/lock.test.cjs.map +0 -1
- package/dist/core/tool-executor.cjs +0 -20
- package/dist/core/tool-executor.cjs.map +0 -1
- package/dist/core/version-resolver.cjs +0 -15
- package/dist/core/version-resolver.cjs.map +0 -1
- package/dist/display/formatters.cjs +0 -15
- package/dist/display/formatters.cjs.map +0 -1
- package/dist/display/index.cjs +0 -25
- package/dist/display/index.cjs.map +0 -1
- package/dist/display/version-display.cjs +0 -20
- package/dist/display/version-display.cjs.map +0 -1
- package/dist/github/index.cjs +0 -17
- package/dist/github/index.cjs.map +0 -1
- package/dist/github/matrix.cjs +0 -16
- package/dist/github/matrix.cjs.map +0 -1
- package/dist/index.cjs +0 -53
- package/dist/index.cjs.map +0 -1
- package/dist/test.cjs +0 -16
- package/dist/test.cjs.map +0 -1
- package/dist/utils/docker.cjs +0 -27
- package/dist/utils/docker.cjs.map +0 -1
- package/dist/utils/error.cjs +0 -13
- package/dist/utils/error.cjs.map +0 -1
- package/dist/utils/finder.cjs +0 -29
- package/dist/utils/finder.cjs.map +0 -1
- package/dist/utils.cjs +0 -22
- package/dist/utils.cjs.map +0 -1
package/dist/KHVGLVR5.cjs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
-
var __esm = (fn, res) => function __init() {
|
|
11
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
12
|
-
};
|
|
13
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
14
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
-
};
|
|
16
|
-
var __copyProps = (to, from, except, desc) => {
|
|
17
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
-
for (let key of __getOwnPropNames(from))
|
|
19
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
-
mod
|
|
31
|
-
));
|
|
32
|
-
|
|
33
|
-
// ../../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.2_@swc+helpers@0.5.17__jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.8.2_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
|
|
34
|
-
var init_cjs_shims = __esm({
|
|
35
|
-
"../../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.2_@swc+helpers@0.5.17__jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.8.2_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js"() {
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
exports.__commonJS = __commonJS;
|
|
40
|
-
exports.__name = __name;
|
|
41
|
-
exports.__toESM = __toESM;
|
|
42
|
-
exports.init_cjs_shims = init_cjs_shims;
|
|
43
|
-
//# sourceMappingURL=KHVGLVR5.cjs.map
|
|
44
|
-
//# sourceMappingURL=KHVGLVR5.cjs.map
|
package/dist/KHVGLVR5.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.2_@swc+helpers@0.5.17__jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.8.2_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,cAAA,GAAA,KAAA,CAAA","file":"KHVGLVR5.cjs","sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n"]}
|
package/dist/M6CETDAD.cjs
DELETED
package/dist/M6CETDAD.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/display/index.ts"],"names":["init_cjs_shims"],"mappings":";;;;;AAAAA,2BAAA,EAAA","file":"M6CETDAD.cjs","sourcesContent":["// Export formatters\nexport { formatVersionCombination } from './formatters';\n\n// Export version display functions\nexport { displayToolVersionInfo, displayVersionCombinations } from './version-display';\n"]}
|
package/dist/MH3SPPX5.cjs
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var HOQEVWFL_cjs = require('./HOQEVWFL.cjs');
|
|
4
|
-
var _7E7TMR5F_cjs = require('./7E7TMR5F.cjs');
|
|
5
|
-
var RVRC4KBY_cjs = require('./RVRC4KBY.cjs');
|
|
6
|
-
var _4BP4CCPZ_cjs = require('./4BP4CCPZ.cjs');
|
|
7
|
-
var KHVGLVR5_cjs = require('./KHVGLVR5.cjs');
|
|
8
|
-
var commander = require('commander');
|
|
9
|
-
var esToolkit = require('es-toolkit');
|
|
10
|
-
var fs = require('fs');
|
|
11
|
-
var path = require('path');
|
|
12
|
-
var process = require('process');
|
|
13
|
-
|
|
14
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
|
|
16
|
-
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
17
|
-
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
18
|
-
var process__default = /*#__PURE__*/_interopDefault(process);
|
|
19
|
-
|
|
20
|
-
// src/cli.ts
|
|
21
|
-
KHVGLVR5_cjs.init_cjs_shims();
|
|
22
|
-
var createCli = /* @__PURE__ */ KHVGLVR5_cjs.__name((context, registerExtraCommands) => {
|
|
23
|
-
const { tools } = context;
|
|
24
|
-
const toolVersionOptions = Object.fromEntries(tools.map(({ name }) => [
|
|
25
|
-
`${esToolkit.camelCase(name)}Version`,
|
|
26
|
-
name
|
|
27
|
-
]));
|
|
28
|
-
const parseGlobalOptions = /* @__PURE__ */ KHVGLVR5_cjs.__name(async (command) => {
|
|
29
|
-
const { cwd, volume, defaultVolumes, ...options } = command.opts();
|
|
30
|
-
const resolvedCwd = cwd ?? process__default.default.cwd();
|
|
31
|
-
const cliVersions = Object.fromEntries(Object.entries(options).map(([name, version]) => [
|
|
32
|
-
toolVersionOptions[name],
|
|
33
|
-
version
|
|
34
|
-
]).filter(([tool]) => tool));
|
|
35
|
-
const configVersions = await context.getDefaultVersions?.(resolvedCwd) ?? {};
|
|
36
|
-
const versions = {
|
|
37
|
-
...configVersions,
|
|
38
|
-
...cliVersions
|
|
39
|
-
};
|
|
40
|
-
return {
|
|
41
|
-
...options,
|
|
42
|
-
cwd: resolvedCwd,
|
|
43
|
-
volumes: volume,
|
|
44
|
-
versions,
|
|
45
|
-
defaultVolumesEnabled: defaultVolumes
|
|
46
|
-
};
|
|
47
|
-
}, "parseGlobalOptions");
|
|
48
|
-
const program = new commander.Command();
|
|
49
|
-
program.name("lz-tool").description("\u{1F680} LayerZero VM tooling with intelligent version management\n\nUsage pattern:\n lz-tool [global-options] <tool> [tool-args...]\n\nExamples:\n lz-tool -e bash sui --help\n lz-tool --sui-version 1.38.0 sui client\n\nNote: All lz-tool options must appear BEFORE the tool name.").version("1.0.0").enablePositionalOptions();
|
|
50
|
-
if (process__default.default.argv.includes("--list-versions")) {
|
|
51
|
-
HOQEVWFL_cjs.displayVersionCombinations(context);
|
|
52
|
-
process__default.default.exit(0);
|
|
53
|
-
}
|
|
54
|
-
program.option("-c, --cwd <path>", "Current working directory", (input) => {
|
|
55
|
-
if (typeof input !== "string") {
|
|
56
|
-
throw new Error("cwd flag must be a string");
|
|
57
|
-
}
|
|
58
|
-
if (!path__default.default.isAbsolute(input)) {
|
|
59
|
-
throw new Error("cwd must be an absolute path if provided");
|
|
60
|
-
}
|
|
61
|
-
if (!fs__default.default.existsSync(input)) {
|
|
62
|
-
throw new Error("cwd does not exist");
|
|
63
|
-
}
|
|
64
|
-
if (!fs__default.default.statSync(input).isDirectory()) {
|
|
65
|
-
throw new Error("cwd must be a directory");
|
|
66
|
-
}
|
|
67
|
-
return input;
|
|
68
|
-
}).option("-e, --custom-entrypoint <entrypoint>", "Override the default Docker entrypoint for the tool").option("--script <script>", 'Execute a custom script using bash -c in the Docker container (e.g., --script "npm install && npm test")').option("--env <name=value>", "Set environment variables for Docker container (e.g., --env NODE_ENV=production)", (input, variables) => {
|
|
69
|
-
const [name, ...valueParts] = input.split("=");
|
|
70
|
-
if (!name || !valueParts.length) {
|
|
71
|
-
throw new Error(`Invalid environment variable format: ${input}. Use --env NAME=VALUE`);
|
|
72
|
-
}
|
|
73
|
-
return [
|
|
74
|
-
...variables,
|
|
75
|
-
{
|
|
76
|
-
name,
|
|
77
|
-
value: valueParts.join("=")
|
|
78
|
-
}
|
|
79
|
-
];
|
|
80
|
-
}, []).option("-v, --volume <type:hostPath:containerPath[:name]>", "Volume mappings in the format type:hostPath:containerPath[:name] (e.g., host:/host/path:/container/path or isolate::/container/path:volumeName)", (input, volumes) => {
|
|
81
|
-
const [type, hostPath, containerPath, name] = input.split(":");
|
|
82
|
-
switch (type) {
|
|
83
|
-
case "host":
|
|
84
|
-
if (!hostPath) {
|
|
85
|
-
throw new Error(`Host path is required for volume type 'host'`);
|
|
86
|
-
}
|
|
87
|
-
break;
|
|
88
|
-
case "isolate":
|
|
89
|
-
if (!name) {
|
|
90
|
-
throw new Error(`Name is required for volume type 'isolate'`);
|
|
91
|
-
}
|
|
92
|
-
break;
|
|
93
|
-
default:
|
|
94
|
-
throw new Error(`Invalid volume type: ${type}`);
|
|
95
|
-
}
|
|
96
|
-
if (!containerPath) {
|
|
97
|
-
throw new Error(`Container path is required`);
|
|
98
|
-
}
|
|
99
|
-
return [
|
|
100
|
-
...volumes,
|
|
101
|
-
RVRC4KBY_cjs.volumeMappingSchema.parse({
|
|
102
|
-
type,
|
|
103
|
-
hostPath,
|
|
104
|
-
containerPath,
|
|
105
|
-
name
|
|
106
|
-
})
|
|
107
|
-
];
|
|
108
|
-
}, []).option("-p, --publish <host_port:container_port>", "Publish a container's port(s) to the host (repeatable)", (value, previous) => [
|
|
109
|
-
...previous,
|
|
110
|
-
value
|
|
111
|
-
], []).option("--no-default-volumes", "Disable default volumes for the tool");
|
|
112
|
-
for (const tool of tools) {
|
|
113
|
-
const defaultVersion = _4BP4CCPZ_cjs.getToolDefaultVersion(context, tool.name);
|
|
114
|
-
const supportedVersions = _4BP4CCPZ_cjs.getToolSupportedVersions(context, tool.name);
|
|
115
|
-
program.option(`--${tool.name}-version <version>`, `Specify ${tool.name} version (default: ${defaultVersion}, supported: ${supportedVersions.join(", ")})`);
|
|
116
|
-
}
|
|
117
|
-
program.option("--list-versions", "Display all supported version combinations and exit");
|
|
118
|
-
program.command("version-info <tool>").description("Display detailed version information for a specific tool").action((toolName) => HOQEVWFL_cjs.displayToolVersionInfo(context, toolName));
|
|
119
|
-
for (const tool of tools) {
|
|
120
|
-
program.command(tool.name, {
|
|
121
|
-
isDefault: false
|
|
122
|
-
}).description(`Run ${tool.name} with version checking`).passThroughOptions(true).allowUnknownOption().helpOption(false).argument("[args...]", "Arguments to pass to the tool").action(async (args) => {
|
|
123
|
-
await _7E7TMR5F_cjs.executeToolCommand(context, tool.name, args, await parseGlobalOptions(program));
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
registerExtraCommands?.(program, parseGlobalOptions);
|
|
127
|
-
return program;
|
|
128
|
-
}, "createCli");
|
|
129
|
-
var runCli = /* @__PURE__ */ KHVGLVR5_cjs.__name(async (config, registerExtraCommands) => {
|
|
130
|
-
try {
|
|
131
|
-
await createCli(config, registerExtraCommands).parseAsync();
|
|
132
|
-
} catch (error) {
|
|
133
|
-
console.error("\u274C VM tool execution failed", error);
|
|
134
|
-
process__default.default.exit(1);
|
|
135
|
-
}
|
|
136
|
-
}, "runCli");
|
|
137
|
-
|
|
138
|
-
exports.runCli = runCli;
|
|
139
|
-
//# sourceMappingURL=MH3SPPX5.cjs.map
|
|
140
|
-
//# sourceMappingURL=MH3SPPX5.cjs.map
|
package/dist/MH3SPPX5.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts"],"names":["init_cjs_shims","createCli","__name","context","registerExtraCommands","tools","toolVersionOptions","Object","fromEntries","map","name","camelCase","parseGlobalOptions","command","cwd","volume","defaultVolumes","options","opts","resolvedCwd","process","cliVersions","entries","version","filter","tool","configVersions","getDefaultVersions","versions","volumes","defaultVolumesEnabled","program","Command","description","enablePositionalOptions","argv","includes","displayVersionCombinations","exit","option","input","Error","path","isAbsolute","fs","existsSync","statSync","isDirectory","variables","valueParts","split","length","value","join","type","hostPath","containerPath","volumeMappingSchema","parse","previous","defaultVersion","getToolDefaultVersion","supportedVersions","getToolSupportedVersions","action","toolName","displayToolVersionInfo","isDefault","passThroughOptions","allowUnknownOption","helpOption","argument","args","executeToolCommand","runCli","config","parseAsync","error","console"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAAA,2BAAA,EAAA;AA6BA,IAAMC,SAAAA,mBAAYC,mBAAA,CAAA,CACdC,OAAAA,EACAC,qBAAAA,KAAAA;AAEA,EAAA,MAAM,EAAEC,OAAK,GAAKF,OAAAA;AAClB,EAAA,MAAMG,kBAAAA,GAAqBC,OAAOC,WAAAA,CAC9BH,KAAAA,CAAMI,IAAI,CAAC,EAAEC,MAAI,KAAO;IAAC,CAAA,EAAGC,mBAAAA,CAAUD,IAAAA,CAAAA,CAAAA,OAAAA,CAAAA;AAAgBA,IAAAA;GAAK,CAAA,CAAA;AAG/D,EAAA,MAAME,kBAAAA,8CAA4BC,OAAAA,KAAAA;AAC9B,IAAA,MAAM,EAAEC,KAAKC,MAAAA,EAAQC,cAAAA,EAAgB,GAAGC,OAAAA,EAAAA,GAAYJ,QAAQK,IAAAA,EAAI;AAChE,IAAA,MAAMC,WAAAA,GAAcL,GAAAA,IAAOM,wBAAAA,CAAQN,GAAAA,EAAG;AAGtC,IAAA,MAAMO,WAAAA,GAAcd,MAAAA,CAAOC,WAAAA,CACvBD,MAAAA,CAAOe,OAAAA,CAAQL,OAAAA,CAAAA,CACVR,GAAAA,CAAI,CAAC,CAACC,IAAAA,EAAMa,OAAAA,CAAAA,KAAa;AAACjB,MAAAA,kBAAAA,CAAmBI,IAAAA,CAAAA;AAAOa,MAAAA;AAAQ,KAAA,CAAA,CAC5DC,OAAO,CAAC,CAACC,IAAAA,CAAAA,KAAUA,IAAA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.cjs","sourcesContent":["import { Command } from 'commander';\nimport { camelCase } from 'es-toolkit';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport process from 'node:process';\n\nimport type { EnvironmentVariable, VolumeMapping } from './config';\nimport { volumeMappingSchema } from './config';\nimport type { ChainContext } from './context';\nimport type { ToolCommandExecutionOptions } from './core';\nimport { executeToolCommand } from './core';\nimport { displayToolVersionInfo, displayVersionCombinations } from './display';\nimport { getToolDefaultVersion, getToolSupportedVersions } from './utils/finder';\n\ninterface GlobalOptions {\n cwd?: string;\n volume: VolumeMapping[];\n env: EnvironmentVariable[];\n publish?: string[];\n script?: string;\n customEntrypoint?: string;\n defaultVolumes: boolean;\n}\n\ntype RegisterExtraCommands = (\n program: Command,\n parseGlobalOptions: (command: Command) => Promise<ToolCommandExecutionOptions>,\n) => void;\n\nconst createCli = <TImageId extends string>(\n context: ChainContext<TImageId>,\n registerExtraCommands?: RegisterExtraCommands,\n): Command => {\n const { tools } = context;\n const toolVersionOptions = Object.fromEntries(\n tools.map(({ name }) => [`${camelCase(name)}Version`, name]),\n );\n\n const parseGlobalOptions = async (command: Command): Promise<ToolCommandExecutionOptions> => {\n const { cwd, volume, defaultVolumes, ...options } = command.opts<GlobalOptions>();\n const resolvedCwd = cwd ?? process.cwd();\n\n // CLI flags take precedence over project config versions\n const cliVersions = Object.fromEntries(\n Object.entries(options)\n .map(([name, version]) => [toolVersionOptions[name], version])\n .filter(([tool]) => tool),\n );\n\n // Read defaults from project config (e.g., Anchor.toml) if the chain provides a hook\n const configVersions = (await context.getDefaultVersions?.(resolvedCwd)) ?? {};\n const versions = { ...configVersions, ...cliVersions };\n\n return {\n ...options,\n cwd: resolvedCwd,\n volumes: volume,\n versions,\n defaultVolumesEnabled: defaultVolumes,\n };\n };\n\n const program = new Command();\n\n program\n .name('lz-tool')\n .description(\n '🚀 LayerZero VM tooling with intelligent version management\\n' +\n '\\n' +\n 'Usage pattern:\\n' +\n ' lz-tool [global-options] <tool> [tool-args...]\\n' +\n '\\n' +\n 'Examples:\\n' +\n ' lz-tool -e bash sui --help\\n' +\n ' lz-tool --sui-version 1.38.0 sui client\\n' +\n '\\n' +\n 'Note: All lz-tool options must appear BEFORE the tool name.',\n )\n .version('1.0.0')\n .enablePositionalOptions(); // Required for passThroughOptions to work\n\n // Check for --list-versions before parsing to avoid help display\n if (process.argv.includes('--list-versions')) {\n displayVersionCombinations(context);\n process.exit(0);\n }\n\n // Add global options.\n program\n .option('-c, --cwd <path>', 'Current working directory', (input: string) => {\n if (typeof input !== 'string') {\n throw new Error('cwd flag must be a string');\n }\n\n if (!path.isAbsolute(input)) {\n throw new Error('cwd must be an absolute path if provided');\n }\n\n if (!fs.existsSync(input)) {\n throw new Error('cwd does not exist');\n }\n\n if (!fs.statSync(input).isDirectory()) {\n throw new Error('cwd must be a directory');\n }\n\n return input;\n })\n .option(\n '-e, --custom-entrypoint <entrypoint>',\n 'Override the default Docker entrypoint for the tool',\n )\n .option(\n '--script <script>',\n 'Execute a custom script using bash -c in the Docker container (e.g., --script \"npm install && npm test\")',\n )\n .option(\n '--env <name=value>',\n 'Set environment variables for Docker container (e.g., --env NODE_ENV=production)',\n (input: string, variables: EnvironmentVariable[]) => {\n const [name, ...valueParts] = input.split('=');\n\n if (!name || !valueParts.length) {\n throw new Error(\n `Invalid environment variable format: ${input}. Use --env NAME=VALUE`,\n );\n }\n\n return [...variables, { name, value: valueParts.join('=') }];\n },\n [],\n )\n .option(\n '-v, --volume <type:hostPath:containerPath[:name]>',\n 'Volume mappings in the format type:hostPath:containerPath[:name] (e.g., host:/host/path:/container/path or isolate::/container/path:volumeName)',\n (input: string, volumes: VolumeMapping[]) => {\n const [type, hostPath, containerPath, name] = input.split(':');\n\n switch (type) {\n case 'host':\n if (!hostPath) {\n throw new Error(`Host path is required for volume type 'host'`);\n }\n break;\n case 'isolate':\n if (!name) {\n throw new Error(`Name is required for volume type 'isolate'`);\n }\n break;\n default:\n throw new Error(`Invalid volume type: ${type}`);\n }\n\n if (!containerPath) {\n throw new Error(`Container path is required`);\n }\n\n return [\n ...volumes,\n volumeMappingSchema.parse({ type, hostPath, containerPath, name }),\n ];\n },\n [],\n )\n .option(\n '-p, --publish <host_port:container_port>',\n \"Publish a container's port(s) to the host (repeatable)\",\n (value: string, previous: string[]) => [...previous, value],\n [],\n )\n .option('--no-default-volumes', 'Disable default volumes for the tool');\n\n // Add version options for each tool dynamically\n for (const tool of tools) {\n const defaultVersion = getToolDefaultVersion(context, tool.name);\n const supportedVersions = getToolSupportedVersions(context, tool.name);\n\n program.option(\n `--${tool.name}-version <version>`,\n `Specify ${tool.name} version (default: ${defaultVersion}, supported: ${supportedVersions.join(', ')})`,\n );\n }\n\n // Add utility options\n program.option('--list-versions', 'Display all supported version combinations and exit');\n\n // Add version info command\n program\n .command('version-info <tool>')\n .description('Display detailed version information for a specific tool')\n .action((toolName: string) => displayToolVersionInfo(context, toolName));\n\n for (const tool of tools) {\n // Don't add any options to the subcommand level.\n // All lz-tool options must be specified before the subcommand.\n program\n .command(tool.name, { isDefault: false })\n .description(`Run ${tool.name} with version checking`)\n .passThroughOptions(true) // Pass through all options after the subcommand\n .allowUnknownOption()\n .helpOption(false) // Disable automatic help option to pass --help to the tool\n .argument('[args...]', 'Arguments to pass to the tool')\n .action(async (args: string[]) => {\n await executeToolCommand(\n context,\n tool.name,\n args,\n await parseGlobalOptions(program),\n );\n });\n }\n\n // Allow external registration of extra commands\n registerExtraCommands?.(program, parseGlobalOptions);\n\n return program;\n};\n\nexport const runCli = async <TImageId extends string>(\n config: ChainContext<TImageId>,\n registerExtraCommands?: RegisterExtraCommands,\n): Promise<void> => {\n try {\n await createCli<TImageId>(config, registerExtraCommands).parseAsync();\n } catch (error) {\n console.error('❌ VM tool execution failed', error);\n process.exit(1);\n }\n};\n"]}
|
package/dist/QLR2UW44.cjs
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var S6PEV2YJ_cjs = require('./S6PEV2YJ.cjs');
|
|
4
|
-
var KHVGLVR5_cjs = require('./KHVGLVR5.cjs');
|
|
5
|
-
var child_process = require('child_process');
|
|
6
|
-
var util = require('util');
|
|
7
|
-
|
|
8
|
-
// src/test.ts
|
|
9
|
-
KHVGLVR5_cjs.init_cjs_shims();
|
|
10
|
-
var COMMAND_TIMEOUT = 5 * 6e4;
|
|
11
|
-
var PULL_TIMEOUT = 10 * 6e4;
|
|
12
|
-
var VERSION_TEST_TIMEOUT = 15 * 6e4;
|
|
13
|
-
var runCommand = /* @__PURE__ */ KHVGLVR5_cjs.__name(async (command, args, timeout = COMMAND_TIMEOUT) => (await util.promisify(child_process.execFile)(command, args, {
|
|
14
|
-
timeout,
|
|
15
|
-
killSignal: "SIGKILL"
|
|
16
|
-
})).stdout.trim(), "runCommand");
|
|
17
|
-
var ensureDockerImageExists = /* @__PURE__ */ KHVGLVR5_cjs.__name(async (imageUri) => {
|
|
18
|
-
await runCommand("docker", [
|
|
19
|
-
"run",
|
|
20
|
-
"--rm",
|
|
21
|
-
"--entrypoint",
|
|
22
|
-
"true",
|
|
23
|
-
imageUri
|
|
24
|
-
], PULL_TIMEOUT);
|
|
25
|
-
}, "ensureDockerImageExists");
|
|
26
|
-
var testTools = /* @__PURE__ */ KHVGLVR5_cjs.__name(({ describe, expect, it, beforeAll }, images, _versionCombinations, versionCommands) => {
|
|
27
|
-
describe("Docker image IDs", () => {
|
|
28
|
-
for (const [name, image] of Object.entries(images)) {
|
|
29
|
-
it(`has an image ID of ${name}`, () => {
|
|
30
|
-
expect([
|
|
31
|
-
image.name,
|
|
32
|
-
S6PEV2YJ_cjs.getImageTag(image)
|
|
33
|
-
].join(":")).toBe(name);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
describe("Tool versions", () => {
|
|
38
|
-
for (const literalImage of Object.values(images)) {
|
|
39
|
-
const image = literalImage;
|
|
40
|
-
describe(S6PEV2YJ_cjs.getImageTag(image), () => {
|
|
41
|
-
let imageUri;
|
|
42
|
-
beforeAll(async () => {
|
|
43
|
-
imageUri = await S6PEV2YJ_cjs.getImageUri(image);
|
|
44
|
-
await ensureDockerImageExists(imageUri);
|
|
45
|
-
}, PULL_TIMEOUT);
|
|
46
|
-
for (const [tool, expectedVersion] of Object.entries(image.versions)) {
|
|
47
|
-
it(`should have ${tool} of version ${expectedVersion}`, async () => {
|
|
48
|
-
if (!(versionCommands[tool] instanceof Array)) {
|
|
49
|
-
throw new Error("Missing version command");
|
|
50
|
-
}
|
|
51
|
-
const version = await runCommand("docker", [
|
|
52
|
-
"run",
|
|
53
|
-
"--rm",
|
|
54
|
-
"--privileged",
|
|
55
|
-
imageUri,
|
|
56
|
-
...versionCommands[tool]
|
|
57
|
-
]);
|
|
58
|
-
expect(version).toContain(expectedVersion);
|
|
59
|
-
}, VERSION_TEST_TIMEOUT);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}, "testTools");
|
|
65
|
-
|
|
66
|
-
exports.testTools = testTools;
|
|
67
|
-
//# sourceMappingURL=QLR2UW44.cjs.map
|
|
68
|
-
//# sourceMappingURL=QLR2UW44.cjs.map
|
package/dist/QLR2UW44.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/test.ts"],"names":["init_cjs_shims","COMMAND_TIMEOUT","PULL_TIMEOUT","VERSION_TEST_TIMEOUT","runCommand","__name","command","args","timeout","promisify","execFile","killSignal","stdout","trim","ensureDockerImageExists","imageUri","testTools","describe","expect","it","beforeAll","images","_versionCombinations","versionCommands","name","image","Object","entries","getImageTag","join","toBe","literalImage","values","getImageUri","tool","expectedVersion","versions","Array","Error","version","toContain"],"mappings":";;;;;;;;AAAAA,2BAAA,EAAA;AAQA,IAAMC,kBAAkB,CAAA,GAAI,GAAA;AAC5B,IAAMC,eAAe,EAAA,GAAK,GAAA;AAC1B,IAAMC,uBAAuB,EAAA,GAAK,GAAA;AAElC,IAAM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AA,CAAOX,MAAAA,CAAAA,EAAS;AAC9C,MAAA,MAAMI,KAAAA,GAAeM,YAAAA;AAErBd,MAAAA,QAAAA,CAASW,wBAAAA,CAAYH,KAAAA,CAAAA,EAAQ,MAAA;AACzB,QAAA,IAAIV,QAAAA;AAEJK,QAAAA,SAAAA,CAAU,YAAA;AACNL,UAAAA,QAAAA,GAAW,MAAMkB,yBAAYR,KAAAA,CAAAA;AAC7B,UAAA,MAAMX,wBAAwBC,QAAAA,CAAAA;AAClC,QAAA,CAAA,EAAGb,YAAAA,CAAAA;AAEH,QAAA,KAAA,MAAW,CAACgC,MAAMC,eAAAA,CAAAA,IAAoBT,OAAOC,OAAAA,CAAQF,KAAAA,CAAMW,QAAQ,CAAA,EAAG;AAClEjB,UAAAA,EAAAA,CACI,CAAA,YAAA,EAAee,IAAAA,CAAAA,YAAAA,EAAmBC,eAAAA,IAClC,YAAA;AACI,YAAA,IAAI,EAAEZ,eAAAA,CAAgBW,IAAAA,CAAAA,YAAiBG,KAAAA,CAAAA,EAAQ;AAC3C,cAAA,MAAM,IAAIC,MAAM,yBAAA,CAAA;AACpB,YAAA;AAEA,YAAA,MAAMC,OAAAA,GAAU,MAAMnC,UAAAA,CAAW,QAAA,EAAU;AACvC,cAAA,KAAA;AACA,cAAA,MAAA;AACA,cAAA,cAAA;AACAW,cAAAA,QAAAA;AACGQ,cAAAA,GAAAA,eAAAA,CAAgBW,IAAAA;AACtB,aAAA,CAAA;AAEDhB,YAAAA,MAAAA,CAAOqB,OAAAA,CAAAA,CAASC,SAAAA,CAAUL,eAAAA,CAAAA;AAC9B,UAAA,CAAA,EACAhC,oBAAAA,CAAAA;AAER,QAAA;MACJ,CAAA,CAAA;AACJ,IAAA;EACJ,CAAA,CAAA;AACJ,CAAA,EAlDyB,WAAA","file":"QLR2UW44.cjs","sourcesContent":["import { execFile } from 'node:child_process';\nimport { promisify } from 'node:util';\nimport type * as vitest from 'vitest';\n\nimport type { VersionCombination } from './config';\nimport { type Image } from './config';\nimport { getImageTag, getImageUri } from './utils/docker';\n\nconst COMMAND_TIMEOUT = 5 * 60_000;\nconst PULL_TIMEOUT = 10 * 60_000;\nconst VERSION_TEST_TIMEOUT = 15 * 60_000;\n\nconst runCommand = async (\n command: string,\n args: string[],\n timeout = COMMAND_TIMEOUT,\n): Promise<string> =>\n (\n await promisify(execFile)(command, args, {\n timeout,\n killSignal: 'SIGKILL', // Force kill if timeout\n })\n ).stdout.trim();\n\n/** Run a no-op command in the image to trigger a pull if it's not available locally. */\nconst ensureDockerImageExists = async (imageUri: string): Promise<void> => {\n await runCommand('docker', ['run', '--rm', '--entrypoint', 'true', imageUri], PULL_TIMEOUT);\n};\n\nexport const testTools = (\n { describe, expect, it, beforeAll }: typeof vitest,\n images: Record<string, Image>,\n _versionCombinations: VersionCombination<string>[],\n versionCommands: Record<string, string[]>,\n): void => {\n describe('Docker image IDs', () => {\n for (const [name, image] of Object.entries(images)) {\n it(`has an image ID of ${name}`, () => {\n expect([image.name, getImageTag(image)].join(':')).toBe(name);\n });\n }\n });\n\n describe('Tool versions', () => {\n for (const literalImage of Object.values(images)) {\n const image: Image = literalImage;\n\n describe(getImageTag(image), () => {\n let imageUri: string;\n\n beforeAll(async () => {\n imageUri = await getImageUri(image);\n await ensureDockerImageExists(imageUri);\n }, PULL_TIMEOUT);\n\n for (const [tool, expectedVersion] of Object.entries(image.versions)) {\n it(\n `should have ${tool} of version ${expectedVersion}`,\n async () => {\n if (!(versionCommands[tool] instanceof Array)) {\n throw new Error('Missing version command');\n }\n\n const version = await runCommand('docker', [\n 'run',\n '--rm',\n '--privileged',\n imageUri,\n ...versionCommands[tool],\n ]);\n\n expect(version).toContain(expectedVersion);\n },\n VERSION_TEST_TIMEOUT,\n );\n }\n });\n }\n });\n};\n"]}
|
package/dist/REVK4LZT.cjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _4BP4CCPZ_cjs = require('./4BP4CCPZ.cjs');
|
|
4
|
-
var KHVGLVR5_cjs = require('./KHVGLVR5.cjs');
|
|
5
|
-
var promises = require('fs/promises');
|
|
6
|
-
var path = require('path');
|
|
7
|
-
|
|
8
|
-
// src/utils.ts
|
|
9
|
-
KHVGLVR5_cjs.init_cjs_shims();
|
|
10
|
-
var rootFiles = [
|
|
11
|
-
"pnpm-workspace.yaml",
|
|
12
|
-
".git"
|
|
13
|
-
];
|
|
14
|
-
var getCombinationId = /* @__PURE__ */ KHVGLVR5_cjs.__name((context, combination) => Object.entries(_4BP4CCPZ_cjs.findToolVersionsForCombination(context, combination)).toSorted().flat().join("-"), "getCombinationId");
|
|
15
|
-
var findFileInParentDirectory = /* @__PURE__ */ KHVGLVR5_cjs.__name(async (directory, filename) => {
|
|
16
|
-
while (directory !== path.dirname(directory)) {
|
|
17
|
-
const path$1 = path.join(directory, filename);
|
|
18
|
-
try {
|
|
19
|
-
await promises.access(path$1);
|
|
20
|
-
return path$1;
|
|
21
|
-
} catch (_) {
|
|
22
|
-
}
|
|
23
|
-
directory = path.dirname(directory);
|
|
24
|
-
}
|
|
25
|
-
return null;
|
|
26
|
-
}, "findFileInParentDirectory");
|
|
27
|
-
var findWorkspaceRoot = /* @__PURE__ */ KHVGLVR5_cjs.__name(async (directory) => {
|
|
28
|
-
for (const rootFile of rootFiles) {
|
|
29
|
-
const path$1 = await findFileInParentDirectory(directory, rootFile);
|
|
30
|
-
if (path$1) {
|
|
31
|
-
return path.dirname(path$1);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
throw new Error(`Workspace root not found from directory: ${directory}`);
|
|
35
|
-
}, "findWorkspaceRoot");
|
|
36
|
-
|
|
37
|
-
exports.findFileInParentDirectory = findFileInParentDirectory;
|
|
38
|
-
exports.findWorkspaceRoot = findWorkspaceRoot;
|
|
39
|
-
exports.getCombinationId = getCombinationId;
|
|
40
|
-
//# sourceMappingURL=REVK4LZT.cjs.map
|
|
41
|
-
//# sourceMappingURL=REVK4LZT.cjs.map
|
package/dist/REVK4LZT.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils.ts"],"names":["init_cjs_shims","rootFiles","getCombinationId","__name","context","combination","Object","entries","findToolVersionsForCombination","toSorted","flat","join","findFileInParentDirectory","directory","filename","dirname","path","access","_","findWorkspaceRoot","rootFile","Error"],"mappings":";;;;;;;;AAAAA,2BAAA,EAAA;AAQA,IAAMC,SAAAA,GAAsB;AAAC,EAAA,qBAAA;AAAuB,EAAA;;AAE7C,IAAMC,mCAAmBC,mBAAA,CAAA,CAC5BC,OAAAA,EACAC,WAAAA,KAEAC,MAAAA,CAAOC,QAAQC,4CAAAA,CAA+BJ,OAAAA,EAASC,WAAAA,CAAAA,EAClDI,QAAAA,EAAQ,CACRC,MAAI,CACJC,IAAAA,CAAK,GAAA,CAAA,EAPkB,kBAAA;AASzB,IAAMC,yBAAAA,mBAA4BT,mBAAA,CAAA,OACrCU,SAAAA,EACAC,QAAAA,KAAAA;AAEA,EAAA,OAAOD,SAAAA,KAAcE,YAAAA,CAAQF,SAAAA,CAAAA,EAAY;AACrC,IAAA,MAAMG,MAAAA,GAAOL,SAAAA,CAAKE,SAAAA,EAAWC,QAAAA,CAAAA;AAE7B,IAAA,IAAI;AACA,MAAA,MAAMG,gBAAOD,MAAAA,CAAAA;AACb,MAAA,OAAOA,MAAAA;AACX,IAAA,CAAA,CAAA,OAASE,CAAAA,EAAG;AAAC,IAAA;AAEbL,IAAAA,SAAAA,GAAYE,aAAQF,SAAAA,CAAAA;AACxB,EAAA;AAEA,EAAA,OAAO,IAAA;AACX,CAAA,EAhByC,2BAAA;AAkBlC,IAAMM,iBAAAA,8CAA2BN,SAAAA,KAAAA;AACpC,EAAA,KAAA,MAAWO,YAAYnB,SAAAA,EAAW;AAC9B,IAAA,MAAMe,MAAAA,GAAO,MAAMJ,yBAAAA,CAA0BC,SAAAA,EAAWO,QAAAA,CAAAA;AAExD,IAAA,IAAIJ,MAAAA,EAAM;AACN,MAAA,OAAOD,aAAQC,MAAAA,CAAAA;AACnB,IAAA;AACJ,EAAA;AAEA,EAAA,MAAM,IAAIK,KAAAA,CAAM,CAAA,yCAAA,EAA4CR,SAAAA,CAAAA,CAAW,CAAA;AAC3E,CAAA,EAViC,mBAAA","file":"REVK4LZT.cjs","sourcesContent":["import { access } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\n\nimport type { VersionCombination } from './config';\nimport type { ChainContext } from './context';\nimport { findToolVersionsForCombination } from './utils/finder';\n\n// TODO Add more root markers when we publish the VM tooling package.\nconst rootFiles: string[] = ['pnpm-workspace.yaml', '.git'];\n\nexport const getCombinationId = <TImageId extends string>(\n context: ChainContext<TImageId>,\n combination: VersionCombination<TImageId>,\n): string =>\n Object.entries(findToolVersionsForCombination(context, combination))\n .toSorted()\n .flat()\n .join('-');\n\nexport const findFileInParentDirectory = async (\n directory: string,\n filename: string,\n): Promise<string | null> => {\n while (directory !== dirname(directory)) {\n const path = join(directory, filename);\n\n try {\n await access(path);\n return path;\n } catch (_) {}\n\n directory = dirname(directory);\n }\n\n return null;\n};\n\nexport const findWorkspaceRoot = async (directory: string): Promise<string> => {\n for (const rootFile of rootFiles) {\n const path = await findFileInParentDirectory(directory, rootFile);\n\n if (path) {\n return dirname(path);\n }\n }\n\n throw new Error(`Workspace root not found from directory: ${directory}`);\n};\n"]}
|
package/dist/RVRC4KBY.cjs
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var KHVGLVR5_cjs = require('./KHVGLVR5.cjs');
|
|
4
|
-
var path = require('path');
|
|
5
|
-
var z = require('zod');
|
|
6
|
-
var commonNodeUtils = require('@layerzerolabs/common-node-utils');
|
|
7
|
-
|
|
8
|
-
function _interopNamespace(e) {
|
|
9
|
-
if (e && e.__esModule) return e;
|
|
10
|
-
var n = Object.create(null);
|
|
11
|
-
if (e) {
|
|
12
|
-
Object.keys(e).forEach(function (k) {
|
|
13
|
-
if (k !== 'default') {
|
|
14
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return e[k]; }
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
n.default = e;
|
|
23
|
-
return Object.freeze(n);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var z__namespace = /*#__PURE__*/_interopNamespace(z);
|
|
27
|
-
|
|
28
|
-
// src/config.ts
|
|
29
|
-
KHVGLVR5_cjs.init_cjs_shims();
|
|
30
|
-
var registryConfigCache;
|
|
31
|
-
var getRegistryConfig = /* @__PURE__ */ KHVGLVR5_cjs.__name(async () => {
|
|
32
|
-
if (!registryConfigCache) {
|
|
33
|
-
const envRegistry = process.env.VM_TOOLING_REGISTRY;
|
|
34
|
-
const envImageDirectory = process.env.VM_TOOLING_IMAGE_DIRECTORY;
|
|
35
|
-
if (envRegistry && envImageDirectory) {
|
|
36
|
-
registryConfigCache = {
|
|
37
|
-
registry: envRegistry,
|
|
38
|
-
imageDirectory: envImageDirectory
|
|
39
|
-
};
|
|
40
|
-
} else {
|
|
41
|
-
const workspaceRoot = await commonNodeUtils.getFullyQualifiedRepoRootPath();
|
|
42
|
-
const configPath = path.join(workspaceRoot, "configs", "vm-tooling", "values", "docker-image-repo.ts");
|
|
43
|
-
const module = await import(configPath);
|
|
44
|
-
registryConfigCache = module.default;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return registryConfigCache;
|
|
48
|
-
}, "getRegistryConfig");
|
|
49
|
-
var volumeMappingBaseSchema = z__namespace.object({
|
|
50
|
-
containerPath: z__namespace.string()
|
|
51
|
-
});
|
|
52
|
-
var hostVolumeMappingSchema = volumeMappingBaseSchema.extend({
|
|
53
|
-
type: z__namespace.literal("host"),
|
|
54
|
-
hostPath: z__namespace.string()
|
|
55
|
-
});
|
|
56
|
-
var isolateVolumeMappingSchema = volumeMappingBaseSchema.extend({
|
|
57
|
-
type: z__namespace.literal("isolate"),
|
|
58
|
-
name: z__namespace.string(),
|
|
59
|
-
shared: z__namespace.optional(z__namespace.boolean()),
|
|
60
|
-
locked: z__namespace.optional(z__namespace.boolean())
|
|
61
|
-
});
|
|
62
|
-
var volumeMappingSchema = z__namespace.union([
|
|
63
|
-
hostVolumeMappingSchema,
|
|
64
|
-
isolateVolumeMappingSchema
|
|
65
|
-
]);
|
|
66
|
-
var DockerRegistryMirror = /* @__PURE__ */ (function(DockerRegistryMirror2) {
|
|
67
|
-
DockerRegistryMirror2["PUBLIC_GAR"] = "public-gar";
|
|
68
|
-
return DockerRegistryMirror2;
|
|
69
|
-
})({});
|
|
70
|
-
var getImageDirectory = /* @__PURE__ */ KHVGLVR5_cjs.__name(async () => (await getRegistryConfig()).imageDirectory, "getImageDirectory");
|
|
71
|
-
var getRegistry = /* @__PURE__ */ KHVGLVR5_cjs.__name(async () => (await getRegistryConfig()).registry, "getRegistry");
|
|
72
|
-
|
|
73
|
-
exports.DockerRegistryMirror = DockerRegistryMirror;
|
|
74
|
-
exports.getImageDirectory = getImageDirectory;
|
|
75
|
-
exports.getRegistry = getRegistry;
|
|
76
|
-
exports.volumeMappingSchema = volumeMappingSchema;
|
|
77
|
-
//# sourceMappingURL=RVRC4KBY.cjs.map
|
|
78
|
-
//# sourceMappingURL=RVRC4KBY.cjs.map
|
package/dist/RVRC4KBY.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts"],"names":["init_cjs_shims","registryConfigCache","getRegistryConfig","__name","envRegistry","process","env","VM_TOOLING_REGISTRY","envImageDirectory","VM_TOOLING_IMAGE_DIRECTORY","registry","imageDirectory","workspaceRoot","getFullyQualifiedRepoRootPath","configPath","join","module","default","volumeMappingBaseSchema","object","containerPath","string","hostVolumeMappingSchema","extend","type","literal","hostPath","isolateVolumeMappingSchema","name","shared","optional","boolean","locked","volumeMapp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,CAAA;AAChBG,EAAAA,IAAAA,EAAQP,YAAAA,CAAAA,MAAAA,EAAM;EACdQ,MAAAA,EAAUC,YAAAA,CAAAA,QAAAA,CAAWC,sBAAO,CAAA;EAC5BC,MAAAA,EAAUF,YAAAA,CAAAA,QAAAA,CAAWC,sBAAO;AAChC,CAAA,CAAA;AAEO,IAAME,sBAAwBC,YAAAA,CAAAA,KAAAA,CAAM;AAACZ,EAAAA,uBAAAA;AAAyBK,EAAAA;AAA2B,CAAA;AA6BzF,IAAKQ,oBAAAA,6BAAAA,qBAAAA,EAAAA;;AAAAA,EAAAA,OAAAA,qBAAAA;;AAkBL,IAAMC,iBAAAA,mBAAoBjC,mBAAA,CAAA,YAAA,CAAa,MAAMD,iBAAAA,IAAqBS,cAAAA,EAAxC,mBAAA;AAC1B,IAAM0B,WAAAA,mBAAclC,mBAAA,CAAA,YAAA,CAAa,MAAMD,iBAAAA,IAAqBQ,QAAAA,EAAxC,aAAA","file":"RVRC4KBY.cjs","sourcesContent":["import { join } from 'node:path';\nimport * as z from 'zod';\n\nimport { getFullyQualifiedRepoRootPath } from '@layerzerolabs/common-node-utils';\n\nimport type { ChainContext } from './context';\nimport type { ToolCommandExecutionOptions } from './core/tool-executor';\n\ninterface RegistryConfig {\n registry: string;\n imageDirectory: string;\n}\n\nlet registryConfigCache: RegistryConfig | undefined;\n\nconst getRegistryConfig = async (): Promise<RegistryConfig> => {\n if (!registryConfigCache) {\n const envRegistry = process.env.VM_TOOLING_REGISTRY;\n const envImageDirectory = process.env.VM_TOOLING_IMAGE_DIRECTORY;\n\n if (envRegistry && envImageDirectory) {\n registryConfigCache = { registry: envRegistry, imageDirectory: envImageDirectory };\n } else {\n const workspaceRoot = await getFullyQualifiedRepoRootPath();\n const configPath = join(\n workspaceRoot,\n 'configs',\n 'vm-tooling',\n 'values',\n 'docker-image-repo.ts',\n );\n\n const module = await import(configPath);\n registryConfigCache = module.default;\n }\n }\n return registryConfigCache!;\n};\n\nconst volumeMappingBaseSchema = z.object({\n containerPath: z.string(),\n});\n\nconst hostVolumeMappingSchema = volumeMappingBaseSchema.extend({\n type: z.literal('host'),\n hostPath: z.string(),\n});\n\nconst isolateVolumeMappingSchema = volumeMappingBaseSchema.extend({\n type: z.literal('isolate'),\n name: z.string(),\n shared: z.optional(z.boolean()),\n locked: z.optional(z.boolean()),\n});\n\nexport const volumeMappingSchema = z.union([hostVolumeMappingSchema, isolateVolumeMappingSchema]);\n\nexport type VolumeMapping = z.infer<typeof volumeMappingSchema>;\n\nexport interface EnvironmentVariable {\n name: string;\n value: string;\n}\n\nexport interface Tool {\n name: string;\n privileged?: boolean;\n\n // Default isolate volumes for caching (user volumes can override these)\n defaultVolumes?: readonly VolumeMapping[];\n\n // Default environment variables (user env vars can override these)\n defaultEnv?: readonly EnvironmentVariable[];\n\n // Optional version parsing and validation functions\n getSecondaryVersion?: (args: { cwd: string }) => Promise<string>;\n\n // Optional hook called before every tool command execution (e.g., toolchain sync)\n preExecute?: (\n context: ChainContext<string>,\n options: ToolCommandExecutionOptions,\n ) => Promise<void>;\n}\n\nexport enum DockerRegistryMirror {\n PUBLIC_GAR = 'public-gar',\n}\n\nexport interface Image {\n name: string;\n versions: Record<string, string>;\n dependencies?: Record<string, string>;\n patch?: number;\n mirrorRegistries?: DockerRegistryMirror[];\n}\n\nexport interface VersionCombination<TImageId> {\n images: Record<string, TImageId>;\n description?: string;\n stable?: boolean;\n}\n\nexport const getImageDirectory = async () => (await getRegistryConfig()).imageDirectory;\nexport const getRegistry = async () => (await getRegistryConfig()).registry;\n"]}
|
package/dist/S6PEV2YJ.cjs
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var RVRC4KBY_cjs = require('./RVRC4KBY.cjs');
|
|
4
|
-
var _4BP4CCPZ_cjs = require('./4BP4CCPZ.cjs');
|
|
5
|
-
var KHVGLVR5_cjs = require('./KHVGLVR5.cjs');
|
|
6
|
-
var path = require('path');
|
|
7
|
-
var process = require('process');
|
|
8
|
-
|
|
9
|
-
// src/utils/docker.ts
|
|
10
|
-
KHVGLVR5_cjs.init_cjs_shims();
|
|
11
|
-
var getImageUriForTool = /* @__PURE__ */ KHVGLVR5_cjs.__name(async (context, toolName, version) => {
|
|
12
|
-
const [image] = context.versionCombinations.flatMap((combination) => {
|
|
13
|
-
const imageId = combination.images[toolName];
|
|
14
|
-
if (!imageId) {
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
|
-
const image2 = context.images[imageId];
|
|
18
|
-
return image2 && _4BP4CCPZ_cjs.findToolVersionsForCombination(context, combination)[toolName] === version ? [
|
|
19
|
-
image2
|
|
20
|
-
] : [];
|
|
21
|
-
});
|
|
22
|
-
if (!image) {
|
|
23
|
-
throw new Error(`No version combination found for tool ${toolName} with version ${version}`);
|
|
24
|
-
}
|
|
25
|
-
return getImageUri(image);
|
|
26
|
-
}, "getImageUriForTool");
|
|
27
|
-
var getImageUri = /* @__PURE__ */ KHVGLVR5_cjs.__name(async (image) => path.join(await RVRC4KBY_cjs.getRegistry(), await RVRC4KBY_cjs.getImageDirectory(), `${_4BP4CCPZ_cjs.getImageName(image.name)}:${getImageTag(image)}`), "getImageUri");
|
|
28
|
-
var getImageTag = /* @__PURE__ */ KHVGLVR5_cjs.__name(({ versions, patch }) => [
|
|
29
|
-
...Object.entries(versions).sort().flat(),
|
|
30
|
-
...patch ? [
|
|
31
|
-
"patch",
|
|
32
|
-
patch
|
|
33
|
-
] : []
|
|
34
|
-
].join("-"), "getImageTag");
|
|
35
|
-
var qualifyVolumeName = /* @__PURE__ */ KHVGLVR5_cjs.__name((volume) => {
|
|
36
|
-
if (volume.type !== "isolate") {
|
|
37
|
-
return volume;
|
|
38
|
-
}
|
|
39
|
-
const components = [
|
|
40
|
-
"lz-tooling-cache",
|
|
41
|
-
volume.name
|
|
42
|
-
];
|
|
43
|
-
if (!volume.shared) {
|
|
44
|
-
const packageName = process.env.npm_package_name;
|
|
45
|
-
if (!packageName) {
|
|
46
|
-
throw new Error("npm_package_name environment variable not defined");
|
|
47
|
-
}
|
|
48
|
-
components.push(path.basename(packageName));
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
...volume,
|
|
52
|
-
name: components.join("-")
|
|
53
|
-
};
|
|
54
|
-
}, "qualifyVolumeName");
|
|
55
|
-
|
|
56
|
-
exports.getImageTag = getImageTag;
|
|
57
|
-
exports.getImageUri = getImageUri;
|
|
58
|
-
exports.getImageUriForTool = getImageUriForTool;
|
|
59
|
-
exports.qualifyVolumeName = qualifyVolumeName;
|
|
60
|
-
//# sourceMappingURL=S6PEV2YJ.cjs.map
|
|
61
|
-
//# sourceMappingURL=S6PEV2YJ.cjs.map
|
package/dist/S6PEV2YJ.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/docker.ts"],"names":["init_cjs_shims","getImageUriForTool","__name","context","toolName","version","image","versionCombinations","flatMap","combination","imageId","images","findToolVersionsForCombination","Error","getImageUri","join","getRegistry","getImageDirectory","getImageName","name","getImageTag","versions","patch","Object","entries","sort","flat","qualifyVolumeName","volume","type","components","shared","packageName","env","npm_package_name","push","basename"],"mappings":";;;;;;;;;AAAAA,2BAAA,EAAA;AAQO,IAAMC,kBAAAA,mBAAqBC,mBAAA,CAAA,OAC9BC,OAAAA,EACAC,QAAAA,EACAC,OAAAA,KAAAA;AAEA,EAAA,MAAM,CAACC,KAAAA,CAAAA,GAASH,QAAQI,mBAAAA,CAAoBC,OAAAA,CAAQ,CAACC,WAAAA,KAAAA;AACjD,IAAA,MAAMC,OAAAA,GAAUD,WAAAA,CAAYE,MAAAA,CAAOP,QAAAA,CAAAA;AAEnC,IAAA,IAAI,CAACM,OAAAA,EAAS;AACV,MAAA,OAAO,EAAA;AACX,IAAA;AAEA,IAAA,MAAMJ,MAAAA,GAAQH,OAAAA,CAAQQ,MAAAA,CAAOD,OAAAA,CAAAA;AAE7B,IAAA,OAAOJ,UAASM,4CAAAA,CA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ACd,MAAA,MAAM,IAAInB,MAAM,mDAAA,CAAA;AACpB,IAAA;AAEAiB,IAAAA,UAAAA,CAAWK,IAAAA,CAAKC,aAAAA,CAASJ,WAAAA,CAAAA,CAAAA;AAC7B,EAAA;AAEA,EAAA,OAAO;IAAE,GAAGJ,MAAAA;IAAQT,IAAAA,EAAMW,UAAAA,CAAWf,KAAK,GAAA;AAAK,GAAA;AACnD,CAAA,EAnBiC,mBAAA","file":"S6PEV2YJ.cjs","sourcesContent":["import { basename, join } from 'node:path';\nimport { env } from 'node:process';\n\nimport type { Image, VolumeMapping } from '../config';\nimport { getImageDirectory, getRegistry } from '../config';\nimport type { ChainContext } from '../context';\nimport { findToolVersionsForCombination, getImageName } from './finder';\n\nexport const getImageUriForTool = async <TImageId extends string>(\n context: ChainContext<TImageId>,\n toolName: string,\n version: string,\n): Promise<string> => {\n const [image] = context.versionCombinations.flatMap((combination) => {\n const imageId = combination.images[toolName];\n\n if (!imageId) {\n return [];\n }\n\n const image = context.images[imageId];\n\n return image && findToolVersionsForCombination(context, combination)[toolName] === version\n ? [image]\n : [];\n });\n\n if (!image) {\n throw new Error(\n `No version combination found for tool ${toolName} with version ${version}`,\n );\n }\n\n return getImageUri(image);\n};\n\nexport const getImageUri = async (image: Image): Promise<string> =>\n join(\n await getRegistry(),\n await getImageDirectory(),\n `${getImageName(image.name)}:${getImageTag(image)}`,\n );\n\nexport const getImageTag = ({ versions, patch }: Image): string =>\n [...Object.entries(versions).sort().flat(), ...(patch ? ['patch', patch] : [])].join('-');\n\nexport const qualifyVolumeName = (volume: VolumeMapping): VolumeMapping => {\n if (volume.type !== 'isolate') {\n return volume;\n }\n\n const components = ['lz-tooling-cache', volume.name];\n\n if (!volume.shared) {\n // This is the package name where the `lz-tool` command is executed.\n const packageName = env.npm_package_name;\n\n if (!packageName) {\n throw new Error('npm_package_name environment variable not defined');\n }\n\n components.push(basename(packageName));\n }\n\n return { ...volume, name: components.join('-') };\n};\n"]}
|
package/dist/UOFUYV3K.cjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var REVK4LZT_cjs = require('./REVK4LZT.cjs');
|
|
4
|
-
var _4BP4CCPZ_cjs = require('./4BP4CCPZ.cjs');
|
|
5
|
-
var KHVGLVR5_cjs = require('./KHVGLVR5.cjs');
|
|
6
|
-
|
|
7
|
-
// src/display/formatters.ts
|
|
8
|
-
KHVGLVR5_cjs.init_cjs_shims();
|
|
9
|
-
function formatVersionCombination(context, combination, isDefault) {
|
|
10
|
-
const tools = Object.entries(_4BP4CCPZ_cjs.findToolVersionsForCombination(context, combination)).filter(([_, version]) => version !== void 0).map(([tool, version]) => `${tool}:${version}`).join(", ");
|
|
11
|
-
const badges = [
|
|
12
|
-
isDefault ? "\u{1F3AF} Default" : null,
|
|
13
|
-
combination.stable ? "\u2705 Stable" : null,
|
|
14
|
-
combination.description
|
|
15
|
-
].filter(Boolean).join(" ");
|
|
16
|
-
return ` ${REVK4LZT_cjs.getCombinationId(context, combination)}: ${tools} ${badges}`;
|
|
17
|
-
}
|
|
18
|
-
KHVGLVR5_cjs.__name(formatVersionCombination, "formatVersionCombination");
|
|
19
|
-
|
|
20
|
-
exports.formatVersionCombination = formatVersionCombination;
|
|
21
|
-
//# sourceMappingURL=UOFUYV3K.cjs.map
|
|
22
|
-
//# sourceMappingURL=UOFUYV3K.cjs.map
|
package/dist/UOFUYV3K.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/display/formatters.ts"],"names":["init_cjs_shims","formatVersionCombination","context","combination","isDefault","tools","Object","entries","findToolVersionsForCombination","filter","_","version","undefined","map","tool","join","badges","stable","description","Boolean","getCombinationId"],"mappings":";;;;;;;AAEAA,2BAAA,EAAA;AAMO,SAASC,wBAAAA,CACZC,OAAAA,EACAC,WAAAA,EACAC,SAAAA,EAAmB;AAEnB,EAAA,MAAMC,KAAAA,GAAQC,MAAAA,CAAOC,OAAAA,CAAQC,4CAAAA,CAA+BN,OAAAA,EAASC,WAAAA,CAAAA,CAAAA,CAChEM,MAAAA,CAAO,CAAC,CAACC,CAAAA,EAAGC,OAAAA,CAAAA,KAAaA,OAAAA,KAAYC,MAAAA,CAAAA,CACrCC,GAAAA,CAAI,CAAC,CAACC,IAAAA,EAAMH,OAAAA,CAAAA,KAAa,CAAA,EAAGG,IAAAA,CAAAA,CAAAA,EAAQH,OAAAA,CAAAA,CAAS,CAAA,CAC7CI,KAAK,IAAA,CAAA;AAEV,EAAA,MAAMC,MAAAA,GAAS;AACXZ,IAAAA,SAAAA,GAAY,mBAAA,GAAe,IAAA;AAC3BD,IAAAA,WAAAA,CAAYc,SAAS,eAAA,GAAa,IAAA;IAClCd,WAAAA,CAAYe;IAEXT,MAAAA,CAAOU,OAAAA,CAAAA,CACPJ,IAAAA,CAAK,GAAA,CAAA;AAEV,EAAA,OAAO,CAAA,EAAA,EAAKK,8BAAiBlB,OAAAA,EAASC,WAAAA,CAAAA,CAAAA,EAAAA,EAAiBE,KAAAA,IAASW,MAAAA,CAAAA,CAAAA;AACpE;AAnBgBf,mBAAAA,CAAAA,wBAAAA,EAAAA,0BAAAA,CAAAA","file":"UOFUYV3K.cjs","sourcesContent":["import type { VersionCombination } from '../config';\nimport type { ChainContext } from '../context';\nimport { getCombinationId } from '../utils';\nimport { findToolVersionsForCombination } from '../utils/finder';\n\n/**\n * Format version combinations for display\n */\nexport function formatVersionCombination<TImageId extends string>(\n context: ChainContext<TImageId>,\n combination: VersionCombination<TImageId>,\n isDefault?: boolean,\n): string {\n const tools = Object.entries(findToolVersionsForCombination(context, combination))\n .filter(([_, version]) => version !== undefined)\n .map(([tool, version]) => `${tool}:${version}`)\n .join(', ');\n\n const badges = [\n isDefault ? '🎯 Default' : null,\n combination.stable ? '✅ Stable' : null,\n combination.description,\n ]\n .filter(Boolean)\n .join(' ');\n\n return ` ${getCombinationId(context, combination)}: ${tools} ${badges}`;\n}\n"]}
|
package/dist/WFBRUQAF.cjs
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var REVK4LZT_cjs = require('./REVK4LZT.cjs');
|
|
4
|
-
var _4BP4CCPZ_cjs = require('./4BP4CCPZ.cjs');
|
|
5
|
-
var KHVGLVR5_cjs = require('./KHVGLVR5.cjs');
|
|
6
|
-
var console = require('console');
|
|
7
|
-
|
|
8
|
-
function _interopNamespace(e) {
|
|
9
|
-
if (e && e.__esModule) return e;
|
|
10
|
-
var n = Object.create(null);
|
|
11
|
-
if (e) {
|
|
12
|
-
Object.keys(e).forEach(function (k) {
|
|
13
|
-
if (k !== 'default') {
|
|
14
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return e[k]; }
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
n.default = e;
|
|
23
|
-
return Object.freeze(n);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var console__namespace = /*#__PURE__*/_interopNamespace(console);
|
|
27
|
-
|
|
28
|
-
// src/core/version-resolver.ts
|
|
29
|
-
KHVGLVR5_cjs.init_cjs_shims();
|
|
30
|
-
var resolveTypeVersions = /* @__PURE__ */ KHVGLVR5_cjs.__name((context, userVersions) => {
|
|
31
|
-
const versions = {};
|
|
32
|
-
for (const tool of context.tools) {
|
|
33
|
-
const defaultVersion = _4BP4CCPZ_cjs.getToolDefaultVersion(context, tool.name);
|
|
34
|
-
const version = userVersions[tool.name] || defaultVersion;
|
|
35
|
-
if (!version) {
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
versions[tool.name] = version;
|
|
39
|
-
if (version === defaultVersion) {
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
const supportedVersions = _4BP4CCPZ_cjs.getToolSupportedVersions(context, tool.name);
|
|
43
|
-
if (!supportedVersions.includes(version)) {
|
|
44
|
-
console__namespace.warn(`\u26A0\uFE0F Version ${version} for ${tool.name} is not in the supported list.`);
|
|
45
|
-
console__namespace.warn(` Supported versions: ${supportedVersions.join(", ")}`);
|
|
46
|
-
console__namespace.warn(` Continuing with Docker availability as final validation...`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
const combination = context.versionCombinations.find((combination2) => Object.entries(_4BP4CCPZ_cjs.findToolVersionsForCombination(context, combination2)).every(([tool, version]) => versions[tool] === version));
|
|
50
|
-
if (!combination) {
|
|
51
|
-
throw new Error("Compatible combination of tool versions not found");
|
|
52
|
-
}
|
|
53
|
-
console__namespace.info(`\u2705 ${REVK4LZT_cjs.getCombinationId(context, combination)} ${combination.description ? `(${combination.description})` : ""}`);
|
|
54
|
-
return versions;
|
|
55
|
-
}, "resolveTypeVersions");
|
|
56
|
-
|
|
57
|
-
exports.resolveTypeVersions = resolveTypeVersions;
|
|
58
|
-
//# sourceMappingURL=WFBRUQAF.cjs.map
|
|
59
|
-
//# sourceMappingURL=WFBRUQAF.cjs.map
|