@layerzerolabs/vm-tooling-stellar 0.2.45 → 0.2.46

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.
@@ -12,29 +12,29 @@ async function syncToolchain(context, options) {
12
12
  return;
13
13
  }
14
14
  const filePath = path.join(options.cwd, "rust-toolchain.toml");
15
- try {
16
- await access(filePath);
17
- } catch {
18
- console.info("No rust-toolchain.toml found, skipping toolchain sync");
19
- return;
20
- }
21
- const parsed = parse(await readFile(filePath, "utf-8"));
22
- const channel = parsed.toolchain?.channel;
23
- if (typeof channel !== "string") {
24
- throw new Error(`Missing 'toolchain.channel' in ${filePath}`);
25
- }
26
- const targets = parsed.toolchain?.targets ?? [];
27
- const components = parsed.toolchain?.components ?? [];
28
- const installArgs = [
29
- `rustup toolchain install ${channel}`
30
- ];
31
- for (const target of targets) {
32
- installArgs.push(`--target ${target}`);
33
- }
34
- for (const component of components) {
35
- installArgs.push(`--component ${component}`);
15
+ let installCmd;
16
+ const hasToolchainFile = await access(filePath).then(() => true, () => false);
17
+ if (hasToolchainFile) {
18
+ const parsed = parse(await readFile(filePath, "utf-8"));
19
+ const channel = parsed.toolchain?.channel;
20
+ if (typeof channel !== "string") {
21
+ throw new Error(`Missing 'toolchain.channel' in ${filePath}`);
22
+ }
23
+ const targets = parsed.toolchain?.targets ?? [];
24
+ const components = parsed.toolchain?.components ?? [];
25
+ const installArgs = [
26
+ `rustup toolchain install ${channel}`
27
+ ];
28
+ for (const target of targets) {
29
+ installArgs.push(`--target ${target}`);
30
+ }
31
+ for (const component of components) {
32
+ installArgs.push(`--component ${component}`);
33
+ }
34
+ installCmd = installArgs.join(" ");
35
+ } else {
36
+ installCmd = "rustup default stable";
36
37
  }
37
- const installCmd = installArgs.join(" ");
38
38
  const script = [
39
39
  "mkdir -p $CARGO_HOME/bin",
40
40
  "ln -sf /usr/local/cargo/bin/rustup $CARGO_HOME/bin/rustup",
@@ -60,5 +60,5 @@ async function syncToolchain(context, options) {
60
60
  __name(syncToolchain, "syncToolchain");
61
61
 
62
62
  export { syncToolchain };
63
- //# sourceMappingURL=NHURSN57.js.map
64
- //# sourceMappingURL=NHURSN57.js.map
63
+ //# sourceMappingURL=76ISNWAF.js.map
64
+ //# sourceMappingURL=76ISNWAF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/sync-toolchain.ts"],"names":["syncedCwds","Set","syncToolchain","context","options","has","cwd","filePath","path","join","installCmd","hasToolchainFile","access","then","parsed","parse","readFile","channel","toolchain","Error","targets","components","installArgs","target","push","component","script","console","info","add","executeToolCommand","volumes","type","containerPath","name","shared","locked"],"mappings":";;;;;;;AAAA,cAAA,EAAA;AAeA,IAAMA,UAAAA,uBAAiBC,GAAAA,EAAAA;AAEvB,eAAsBC,aAAAA,CAClBC,SACAC,OAAAA,EAAoC;AAEpC,EAAA,IAAIJ,UAAAA,CAAWK,GAAAA,CAAID,OAAAA,CAAQE,GAAG,CAAA,EAAG;AAC7B,IAAA;AACJ,EAAA;AAEA,EAAA,MAAMC,QAAAA,GAAWC,IAAAA,CAAKC,IAAAA,CAAKL,OAAAA,CAAQE,KAAK,qBAAA,CAAA;AAExC,EAAA,IAAII,UAAAA;AACJ,EAAA,MAAMC,gBAAAA,GAAmB,MAAMC,MAAAA,CAAOL,QAAAA,EAAUM,IAAAA,CAC5C,MAAM,IAAA,EACN,MAAM,KAAA,CAAA;AAGV,EAAA,IAAIF,gBAAAA,EAAkB;AAClB,IAAA,MAAMG,SAA4BC,KAAAA,CAAM,MAAMC,QAAAA,CAAST,QAAAA,EAAU,OAAA,CAAA,CAAA;AAEjE,IAAA,MAAMU,OAAAA,GAAUH,OAAOI,SAAAA,EAAWD,OAAAA;AAClC,IAAA,IAAI,OAAOA,YAAY,QAAA,EAAU;AAC7B,MAAA,MAAM,IAAIE,KAAAA,CAAM,CAAA,+BAAA,EAAkCZ,QAAAA,CAAAA,CAAU,CAAA;AAChE,IAAA;AAEA,IAAA,MAAMa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AAAA,EAAQ;AACZ;;GAER,CAAA;AACJ;AArEsBlC,MAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"76ISNWAF.js","sourcesContent":["import { access, readFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport { parse } from 'toml';\n\nimport type { ChainContext, ToolCommandExecutionOptions } from '@layerzerolabs/vm-tooling';\nimport { executeToolCommand } from '@layerzerolabs/vm-tooling';\n\ninterface RustToolchainToml {\n toolchain?: {\n channel?: string;\n targets?: string[];\n components?: string[];\n };\n}\n\nconst syncedCwds = new Set<string>();\n\nexport async function syncToolchain(\n context: ChainContext<string>,\n options: ToolCommandExecutionOptions,\n): Promise<void> {\n if (syncedCwds.has(options.cwd)) {\n return;\n }\n\n const filePath = path.join(options.cwd, 'rust-toolchain.toml');\n\n let installCmd: string;\n const hasToolchainFile = await access(filePath).then(\n () => true,\n () => false,\n );\n\n if (hasToolchainFile) {\n const parsed: RustToolchainToml = parse(await readFile(filePath, 'utf-8'));\n\n const channel = parsed.toolchain?.channel;\n if (typeof channel !== 'string') {\n throw new Error(`Missing 'toolchain.channel' in ${filePath}`);\n }\n\n const targets: string[] = parsed.toolchain?.targets ?? [];\n const components: string[] = parsed.toolchain?.components ?? [];\n\n const installArgs = [`rustup toolchain install ${channel}`];\n for (const target of targets) {\n installArgs.push(`--target ${target}`);\n }\n for (const component of components) {\n installArgs.push(`--component ${component}`);\n }\n\n installCmd = installArgs.join(' ');\n } else {\n // No rust-toolchain.toml found — install stable as the default so that\n // cargo (a rustup proxy) can resolve a toolchain from the empty RUSTUP_HOME volume.\n installCmd = 'rustup default stable';\n }\n\n // rustup expects to find itself at $CARGO_HOME/bin/rustup to manage proxy\n // binaries there. At runtime CARGO_HOME points to /cache/cargo (volume),\n // so we symlink the image-installed rustup binary into the volume.\n const script = [\n 'mkdir -p $CARGO_HOME/bin',\n 'ln -sf /usr/local/cargo/bin/rustup $CARGO_HOME/bin/rustup',\n installCmd,\n ].join(' && ');\n console.info(`🔧 Syncing Rust toolchain: ${installCmd}`);\n\n // Mark as synced before executeToolCommand to prevent recursive preExecute calls\n syncedCwds.add(options.cwd);\n\n await executeToolCommand(context, 'stellar', [], {\n ...options,\n script,\n volumes: [\n ...options.volumes,\n {\n type: 'isolate',\n containerPath: '/cache/rustup',\n name: 'stellar-rustup',\n shared: true,\n locked: true,\n },\n ],\n });\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var KBDPPUCS_cjs = require('./KBDPPUCS.cjs');
3
+ var YR76RYJU_cjs = require('./YR76RYJU.cjs');
4
4
  var JBSG7YXG_cjs = require('./JBSG7YXG.cjs');
5
5
  var vmTooling = require('@layerzerolabs/vm-tooling');
6
6
 
@@ -9,7 +9,7 @@ JBSG7YXG_cjs.init_cjs_shims();
9
9
  var tools = [
10
10
  {
11
11
  name: "stellar",
12
- preExecute: KBDPPUCS_cjs.syncToolchain,
12
+ preExecute: YR76RYJU_cjs.syncToolchain,
13
13
  defaultVolumes: [
14
14
  // NOTE: for configuration commands, you should never put it in your package.json#build or #test, since the config is locked for parallel builds
15
15
  // while common commands like contract build and binding generation are allowed since they are not writing to the config files
@@ -128,5 +128,5 @@ var versionCombinations = [
128
128
  exports.images = images;
129
129
  exports.tools = tools;
130
130
  exports.versionCombinations = versionCombinations;
131
- //# sourceMappingURL=ZQJGQNTW.cjs.map
132
- //# sourceMappingURL=ZQJGQNTW.cjs.map
131
+ //# sourceMappingURL=IDI24AAI.cjs.map
132
+ //# sourceMappingURL=IDI24AAI.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/config.ts"],"names":["init_cjs_shims","tools","name","preExecute","syncToolchain","defaultVolumes","type","containerPath","shared","hostPath","defaultEnv","value","images","versions","stellar","patch","mirrorRegistries","DockerRegistryMirror","PUBLIC_GAR","unreleased","versionCombinations","description","stable"],"mappings":";;;;;;;AAAAA,2BAAA,EAAA;AASO,IAAMC,KAAAA,GAAoC;AAC7C,EAAA;IACIC,IAAAA,EAA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AA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAC,KAAAA,EAAO;AACX,GAAA;AACA,EAAA,CAAC,gCAAA,GAAmC;IAChCb,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAC,KAAAA,EAAO;AACX,GAAA;AACA,EAAA,CAAC,wBAAA,GAA2B;IACxBb,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAE,gBAAAA,EAAkB;MAACC,8BAAAA,CAAqBC;;AAC5C,GAAA;AACA,EAAA,CAAC,wBAAA,GAA2B;IACxBhB,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAK,UAAAA,EAAY,IAAA;IACZH,gBAAAA,EAAkB;MAACC,8BAAAA,CAAqBC;;AAC5C;AACJ;AAIO,IAAME,mBAAAA,GACT;AACI,EAAA;IACIR,MAAAA,EAAQ;MACJE,OAAAA,EAAS;AACb,KAAA;IACAO,WAAAA,EAAa,uBAAA;IACbC,MAAAA,EAAQ;AACZ","file":"ZQJGQNTW.cjs","sourcesContent":["import {\n DockerRegistryMirror,\n type Image,\n type Tool,\n type VersionCombination,\n} from '@layerzerolabs/vm-tooling';\n\nimport { syncToolchain } from './commands/sync-toolchain';\n\nexport const tools: readonly [Tool, ...Tool[]] = [\n {\n name: 'stellar',\n preExecute: syncToolchain,\n defaultVolumes: [\n // NOTE: for configuration commands, you should never put it in your package.json#build or #test, since the config is locked for parallel builds\n // while common commands like contract build and binding generation are allowed since they are not writing to the config files\n {\n type: 'isolate',\n containerPath: '/cache/stellar',\n name: 'stellar-config',\n shared: true,\n },\n // safe to be unlocked as it is POSIX lock guarded\n {\n type: 'isolate',\n containerPath: '/cache/cargo',\n name: 'stellar-cargo',\n shared: true,\n },\n // shared across packages — toolchain is pre-synced via `sync-toolchain` (locked)\n // so concurrent reads from build/test/lint are safe\n {\n type: 'isolate',\n containerPath: '/cache/rustup',\n name: 'stellar-rustup',\n shared: true,\n },\n // safe as the wort case of corruption is cache miss, since it is key-based cache, concurrent writes will produce identical content\n {\n type: 'host',\n containerPath: '/cache/sccache',\n hostPath: '~/.sccache',\n },\n ],\n defaultEnv: [\n // sccache configuration\n { name: 'RUSTC_WRAPPER', value: '/usr/local/bin/sccache' },\n // mold linker for faster linking\n { name: 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER', value: 'clang' },\n { name: 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER', value: 'clang' },\n {\n name: 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS',\n value: '-C link-arg=-fuse-ld=mold',\n },\n {\n name: 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS',\n value: '-C link-arg=-fuse-ld=mold',\n },\n ],\n },\n];\n\nexport const images = {\n ['stellar:stellar-23.1.4']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n },\n ['stellar:stellar-23.1.4-patch-1']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 1,\n },\n ['stellar:stellar-23.1.4-patch-3']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 3,\n },\n ['stellar:stellar-23.1.4-patch-6']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 6,\n },\n ['stellar:stellar-25.0.0']: {\n name: 'stellar',\n versions: {\n stellar: '25.0.0',\n },\n mirrorRegistries: [DockerRegistryMirror.PUBLIC_GAR],\n },\n ['stellar:stellar-25.1.0']: {\n name: 'stellar',\n versions: {\n stellar: '25.1.0',\n },\n unreleased: true,\n mirrorRegistries: [DockerRegistryMirror.PUBLIC_GAR],\n },\n} satisfies Record<string, Image>;\n\nexport type ImageId = keyof typeof images;\n\nexport const versionCombinations: [VersionCombination<ImageId>, ...VersionCombination<ImageId>[]] =\n [\n {\n images: {\n stellar: 'stellar:stellar-25.1.0',\n },\n description: 'Latest stable release',\n stable: true,\n },\n ];\n"]}
1
+ {"version":3,"sources":["../src/config.ts"],"names":["init_cjs_shims","tools","name","preExecute","syncToolchain","defaultVolumes","type","containerPath","shared","hostPath","defaultEnv","value","images","versions","stellar","patch","mirrorRegistries","DockerRegistryMirror","PUBLIC_GAR","unreleased","versionCombinations","description","stable"],"mappings":";;;;;;;AAAAA,2BAAA,EAAA;AASO,IAAMC,KAAAA,GAAoC;AAC7C,EAAA;IACIC,IAAAA,EAAM,SAAA;IACNC,UAAAA,EAAYC,0BAAAA;IACZC,cAAAA,EAAgB;;;AAGZ,MAAA;QACIC,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,gBAAA;QACfL,IAAAA,EAAM,gBAAA;QACNM,MAAAA,EAAQ;AACZ,OAAA;;AAEA,MAAA;QACIF,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,cAAA;QACfL,IAAAA,EAAM,eAAA;QACNM,MAAAA,EAAQ;AACZ,OAAA;;;AAGA,MAAA;QACIF,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,eAAA;QACfL,IAAAA,EAAM,gBAAA;QACNM,MAAAA,EAAQ;AACZ,OAAA;;AAEA,MAAA;QACIF,IAAAA,EAAM,MAAA;QACNC,aAAAA,EAAe,gBAAA;QACfE,QAAAA,EAAU;AACd;;IAEJC,UAAAA,EAAY;;AAER,MAAA;QAAER,IAAAA,EAAM,eAAA;QAAiBS,KAAAA,EAAO;AAAyB,OAAA;;AAEzD,MAAA;QAAET,IAAAA,EAAM,8CAAA;QAAgDS,KAAAA,EAAO;AAAQ,OAAA;AACvE,MAAA;QAAET,IAAAA,EAAM,+CAAA;QAAiDS,KAAAA,EAAO;AAAQ,OAAA;AACxE,MAAA;QACIT,IAAAA,EAAM,iDAAA;QACNS,KAAAA,EAAO;AACX,OAAA;AACA,MAAA;QACIT,IAAAA,EAAM,kDAAA;QACNS,KAAAA,EAAO;AACX;;AAER;;AAGG,IAAMC,MAAAA,GAAS;AAClB,EAAA,CAAC,wBAAA,GAA2B;IACxBV,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb;AACJ,GAAA;AACA,EAAA,CAAC,gCAAA,GAAmC;IAChCZ,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAC,KAAAA,EAAO;AACX,GAAA;AACA,EAAA,CAAC,gCAAA,GAAmC;IAChCb,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAC,KAAAA,EAAO;AACX,GAAA;AACA,EAAA,CAAC,gCAAA,GAAmC;IAChCb,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAC,KAAAA,EAAO;AACX,GAAA;AACA,EAAA,CAAC,wBAAA,GAA2B;IACxBb,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAE,gBAAAA,EAAkB;MAACC,8BAAAA,CAAqBC;;AAC5C,GAAA;AACA,EAAA,CAAC,wBAAA,GAA2B;IACxBhB,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAK,UAAAA,EAAY,IAAA;IACZH,gBAAAA,EAAkB;MAACC,8BAAAA,CAAqBC;;AAC5C;AACJ;AAIO,IAAME,mBAAAA,GACT;AACI,EAAA;IACIR,MAAAA,EAAQ;MACJE,OAAAA,EAAS;AACb,KAAA;IACAO,WAAAA,EAAa,uBAAA;IACbC,MAAAA,EAAQ;AACZ","file":"IDI24AAI.cjs","sourcesContent":["import {\n DockerRegistryMirror,\n type Image,\n type Tool,\n type VersionCombination,\n} from '@layerzerolabs/vm-tooling';\n\nimport { syncToolchain } from './commands/sync-toolchain';\n\nexport const tools: readonly [Tool, ...Tool[]] = [\n {\n name: 'stellar',\n preExecute: syncToolchain,\n defaultVolumes: [\n // NOTE: for configuration commands, you should never put it in your package.json#build or #test, since the config is locked for parallel builds\n // while common commands like contract build and binding generation are allowed since they are not writing to the config files\n {\n type: 'isolate',\n containerPath: '/cache/stellar',\n name: 'stellar-config',\n shared: true,\n },\n // safe to be unlocked as it is POSIX lock guarded\n {\n type: 'isolate',\n containerPath: '/cache/cargo',\n name: 'stellar-cargo',\n shared: true,\n },\n // shared across packages — toolchain is pre-synced via `sync-toolchain` (locked)\n // so concurrent reads from build/test/lint are safe\n {\n type: 'isolate',\n containerPath: '/cache/rustup',\n name: 'stellar-rustup',\n shared: true,\n },\n // safe as the wort case of corruption is cache miss, since it is key-based cache, concurrent writes will produce identical content\n {\n type: 'host',\n containerPath: '/cache/sccache',\n hostPath: '~/.sccache',\n },\n ],\n defaultEnv: [\n // sccache configuration\n { name: 'RUSTC_WRAPPER', value: '/usr/local/bin/sccache' },\n // mold linker for faster linking\n { name: 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER', value: 'clang' },\n { name: 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER', value: 'clang' },\n {\n name: 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS',\n value: '-C link-arg=-fuse-ld=mold',\n },\n {\n name: 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS',\n value: '-C link-arg=-fuse-ld=mold',\n },\n ],\n },\n];\n\nexport const images = {\n ['stellar:stellar-23.1.4']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n },\n ['stellar:stellar-23.1.4-patch-1']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 1,\n },\n ['stellar:stellar-23.1.4-patch-3']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 3,\n },\n ['stellar:stellar-23.1.4-patch-6']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 6,\n },\n ['stellar:stellar-25.0.0']: {\n name: 'stellar',\n versions: {\n stellar: '25.0.0',\n },\n mirrorRegistries: [DockerRegistryMirror.PUBLIC_GAR],\n },\n ['stellar:stellar-25.1.0']: {\n name: 'stellar',\n versions: {\n stellar: '25.1.0',\n },\n unreleased: true,\n mirrorRegistries: [DockerRegistryMirror.PUBLIC_GAR],\n },\n} satisfies Record<string, Image>;\n\nexport type ImageId = keyof typeof images;\n\nexport const versionCombinations: [VersionCombination<ImageId>, ...VersionCombination<ImageId>[]] =\n [\n {\n images: {\n stellar: 'stellar:stellar-25.1.0',\n },\n description: 'Latest stable release',\n stable: true,\n },\n ];\n"]}
@@ -1,4 +1,4 @@
1
- import { syncToolchain } from './NHURSN57.js';
1
+ import { syncToolchain } from './76ISNWAF.js';
2
2
  import { init_esm_shims } from './PHXMTVK6.js';
3
3
  import { DockerRegistryMirror } from '@layerzerolabs/vm-tooling';
4
4
 
@@ -124,5 +124,5 @@ var versionCombinations = [
124
124
  ];
125
125
 
126
126
  export { images, tools, versionCombinations };
127
- //# sourceMappingURL=7X2ZWY4F.js.map
128
- //# sourceMappingURL=7X2ZWY4F.js.map
127
+ //# sourceMappingURL=IWCY7QHM.js.map
128
+ //# sourceMappingURL=IWCY7QHM.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/config.ts"],"names":["tools","name","preExecute","syncToolchain","defaultVolumes","type","containerPath","shared","hostPath","defaultEnv","value","images","versions","stellar","patch","mirrorRegistries","DockerRegistryMirror","PUBLIC_GAR","unreleased","versionCombinations","description","stable"],"mappings":";;;;;AAAA,cAAA,EAAA;AASO,IAAMA,KAAAA,GAAoC;AAC7C,EAAA;IACIC,IAAAA,EAAM,SAAA;IACNC,UAAAA,EAAYC,aAAAA;IACZC,cAAAA,EAAgB;;;AAGZ,MAAA;QACIC,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,gBAAA;QACfL,IAAAA,EAAM,gBAAA;QACNM,MAAAA,EA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AAAA,EAAS;AACb,KAAA;IACAC,KAAAA,EAAO;AACX,GAAA;AACA,EAAA,CAAC,wBAAA,GAA2B;IACxBb,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAE,gBAAAA,EAAkB;MAACC,oBAAAA,CAAqBC;;AAC5C,GAAA;AACA,EAAA,CAAC,wBAAA,GAA2B;IACxBhB,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAK,UAAAA,EAAY,IAAA;IACZH,gBAAAA,EAAkB;MAACC,oBAAAA,CAAqBC;;AAC5C;AACJ;AAIO,IAAME,mBAAAA,GACT;AACI,EAAA;IACIR,MAAAA,EAAQ;MACJE,OAAAA,EAAS;AACb,KAAA;IACAO,WAAAA,EAAa,uBAAA;IACbC,MAAAA,EAAQ;AACZ","file":"7X2ZWY4F.js","sourcesContent":["import {\n DockerRegistryMirror,\n type Image,\n type Tool,\n type VersionCombination,\n} from '@layerzerolabs/vm-tooling';\n\nimport { syncToolchain } from './commands/sync-toolchain';\n\nexport const tools: readonly [Tool, ...Tool[]] = [\n {\n name: 'stellar',\n preExecute: syncToolchain,\n defaultVolumes: [\n // NOTE: for configuration commands, you should never put it in your package.json#build or #test, since the config is locked for parallel builds\n // while common commands like contract build and binding generation are allowed since they are not writing to the config files\n {\n type: 'isolate',\n containerPath: '/cache/stellar',\n name: 'stellar-config',\n shared: true,\n },\n // safe to be unlocked as it is POSIX lock guarded\n {\n type: 'isolate',\n containerPath: '/cache/cargo',\n name: 'stellar-cargo',\n shared: true,\n },\n // shared across packages — toolchain is pre-synced via `sync-toolchain` (locked)\n // so concurrent reads from build/test/lint are safe\n {\n type: 'isolate',\n containerPath: '/cache/rustup',\n name: 'stellar-rustup',\n shared: true,\n },\n // safe as the wort case of corruption is cache miss, since it is key-based cache, concurrent writes will produce identical content\n {\n type: 'host',\n containerPath: '/cache/sccache',\n hostPath: '~/.sccache',\n },\n ],\n defaultEnv: [\n // sccache configuration\n { name: 'RUSTC_WRAPPER', value: '/usr/local/bin/sccache' },\n // mold linker for faster linking\n { name: 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER', value: 'clang' },\n { name: 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER', value: 'clang' },\n {\n name: 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS',\n value: '-C link-arg=-fuse-ld=mold',\n },\n {\n name: 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS',\n value: '-C link-arg=-fuse-ld=mold',\n },\n ],\n },\n];\n\nexport const images = {\n ['stellar:stellar-23.1.4']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n },\n ['stellar:stellar-23.1.4-patch-1']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 1,\n },\n ['stellar:stellar-23.1.4-patch-3']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 3,\n },\n ['stellar:stellar-23.1.4-patch-6']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 6,\n },\n ['stellar:stellar-25.0.0']: {\n name: 'stellar',\n versions: {\n stellar: '25.0.0',\n },\n mirrorRegistries: [DockerRegistryMirror.PUBLIC_GAR],\n },\n ['stellar:stellar-25.1.0']: {\n name: 'stellar',\n versions: {\n stellar: '25.1.0',\n },\n unreleased: true,\n mirrorRegistries: [DockerRegistryMirror.PUBLIC_GAR],\n },\n} satisfies Record<string, Image>;\n\nexport type ImageId = keyof typeof images;\n\nexport const versionCombinations: [VersionCombination<ImageId>, ...VersionCombination<ImageId>[]] =\n [\n {\n images: {\n stellar: 'stellar:stellar-25.1.0',\n },\n description: 'Latest stable release',\n stable: true,\n },\n ];\n"]}
1
+ {"version":3,"sources":["../src/config.ts"],"names":["tools","name","preExecute","syncToolchain","defaultVolumes","type","containerPath","shared","hostPath","defaultEnv","value","images","versions","stellar","patch","mirrorRegistries","DockerRegistryMirror","PUBLIC_GAR","unreleased","versionCombinations","description","stable"],"mappings":";;;;;AAAA,cAAA,EAAA;AASO,IAAMA,KAAAA,GAAoC;AAC7C,EAAA;IACIC,IAAAA,EAAM,SAAA;IACNC,UAAAA,EAAYC,aAAAA;IACZC,cAAAA,EAAgB;;;AAGZ,MAAA;QACIC,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,gBAAA;QACfL,IAAAA,EAAM,gBAAA;QACNM,MAAAA,EAAQ;AACZ,OAAA;;AAEA,MAAA;QACIF,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,cAAA;QACfL,IAAAA,EAAM,eAAA;QACNM,MAAAA,EAAQ;AACZ,OAAA;;;AAGA,MAAA;QACIF,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,eAAA;QACfL,IAAAA,EAAM,gBAAA;QACNM,MAAAA,EAAQ;AACZ,OAAA;;AAEA,MAAA;QACIF,IAAAA,EAAM,MAAA;QACNC,aAAAA,EAAe,gBAAA;QACfE,QAAAA,EAAU;AACd;;IAEJC,UAAAA,EAAY;;AAER,MAAA;QAAER,IAAAA,EAAM,eAAA;QAAiBS,KAAAA,EAAO;AAAyB,OAAA;;AAEzD,MAAA;QAAET,IAAAA,EAAM,8CAAA;QAAgDS,KAAAA,EAAO;AAAQ,OAAA;AACvE,MAAA;QAAET,IAAAA,EAAM,+CAAA;QAAiDS,KAAAA,EAAO;AAAQ,OAAA;AACxE,MAAA;QACIT,IAAAA,EAAM,iDAAA;QACNS,KAAAA,EAAO;AACX,OAAA;AACA,MAAA;QACIT,IAAAA,EAAM,kDAAA;QACNS,KAAAA,EAAO;AACX;;AAER;;AAGG,IAAMC,MAAAA,GAAS;AAClB,EAAA,CAAC,wBAAA,GAA2B;IACxBV,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb;AACJ,GAAA;AACA,EAAA,CAAC,gCAAA,GAAmC;IAChCZ,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAC,KAAAA,EAAO;AACX,GAAA;AACA,EAAA,CAAC,gCAAA,GAAmC;IAChCb,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAC,KAAAA,EAAO;AACX,GAAA;AACA,EAAA,CAAC,gCAAA,GAAmC;IAChCb,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAC,KAAAA,EAAO;AACX,GAAA;AACA,EAAA,CAAC,wBAAA,GAA2B;IACxBb,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAE,gBAAAA,EAAkB;MAACC,oBAAAA,CAAqBC;;AAC5C,GAAA;AACA,EAAA,CAAC,wBAAA,GAA2B;IACxBhB,IAAAA,EAAM,SAAA;IACNW,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAK,UAAAA,EAAY,IAAA;IACZH,gBAAAA,EAAkB;MAACC,oBAAAA,CAAqBC;;AAC5C;AACJ;AAIO,IAAME,mBAAAA,GACT;AACI,EAAA;IACIR,MAAAA,EAAQ;MACJE,OAAAA,EAAS;AACb,KAAA;IACAO,WAAAA,EAAa,uBAAA;IACbC,MAAAA,EAAQ;AACZ","file":"IWCY7QHM.js","sourcesContent":["import {\n DockerRegistryMirror,\n type Image,\n type Tool,\n type VersionCombination,\n} from '@layerzerolabs/vm-tooling';\n\nimport { syncToolchain } from './commands/sync-toolchain';\n\nexport const tools: readonly [Tool, ...Tool[]] = [\n {\n name: 'stellar',\n preExecute: syncToolchain,\n defaultVolumes: [\n // NOTE: for configuration commands, you should never put it in your package.json#build or #test, since the config is locked for parallel builds\n // while common commands like contract build and binding generation are allowed since they are not writing to the config files\n {\n type: 'isolate',\n containerPath: '/cache/stellar',\n name: 'stellar-config',\n shared: true,\n },\n // safe to be unlocked as it is POSIX lock guarded\n {\n type: 'isolate',\n containerPath: '/cache/cargo',\n name: 'stellar-cargo',\n shared: true,\n },\n // shared across packages — toolchain is pre-synced via `sync-toolchain` (locked)\n // so concurrent reads from build/test/lint are safe\n {\n type: 'isolate',\n containerPath: '/cache/rustup',\n name: 'stellar-rustup',\n shared: true,\n },\n // safe as the wort case of corruption is cache miss, since it is key-based cache, concurrent writes will produce identical content\n {\n type: 'host',\n containerPath: '/cache/sccache',\n hostPath: '~/.sccache',\n },\n ],\n defaultEnv: [\n // sccache configuration\n { name: 'RUSTC_WRAPPER', value: '/usr/local/bin/sccache' },\n // mold linker for faster linking\n { name: 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER', value: 'clang' },\n { name: 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER', value: 'clang' },\n {\n name: 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS',\n value: '-C link-arg=-fuse-ld=mold',\n },\n {\n name: 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS',\n value: '-C link-arg=-fuse-ld=mold',\n },\n ],\n },\n];\n\nexport const images = {\n ['stellar:stellar-23.1.4']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n },\n ['stellar:stellar-23.1.4-patch-1']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 1,\n },\n ['stellar:stellar-23.1.4-patch-3']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 3,\n },\n ['stellar:stellar-23.1.4-patch-6']: {\n name: 'stellar',\n versions: {\n stellar: '23.1.4',\n },\n patch: 6,\n },\n ['stellar:stellar-25.0.0']: {\n name: 'stellar',\n versions: {\n stellar: '25.0.0',\n },\n mirrorRegistries: [DockerRegistryMirror.PUBLIC_GAR],\n },\n ['stellar:stellar-25.1.0']: {\n name: 'stellar',\n versions: {\n stellar: '25.1.0',\n },\n unreleased: true,\n mirrorRegistries: [DockerRegistryMirror.PUBLIC_GAR],\n },\n} satisfies Record<string, Image>;\n\nexport type ImageId = keyof typeof images;\n\nexport const versionCombinations: [VersionCombination<ImageId>, ...VersionCombination<ImageId>[]] =\n [\n {\n images: {\n stellar: 'stellar:stellar-25.1.0',\n },\n description: 'Latest stable release',\n stable: true,\n },\n ];\n"]}
@@ -18,29 +18,29 @@ async function syncToolchain(context, options) {
18
18
  return;
19
19
  }
20
20
  const filePath = path__default.default.join(options.cwd, "rust-toolchain.toml");
21
- try {
22
- await promises.access(filePath);
23
- } catch {
24
- console.info("No rust-toolchain.toml found, skipping toolchain sync");
25
- return;
26
- }
27
- const parsed = toml.parse(await promises.readFile(filePath, "utf-8"));
28
- const channel = parsed.toolchain?.channel;
29
- if (typeof channel !== "string") {
30
- throw new Error(`Missing 'toolchain.channel' in ${filePath}`);
31
- }
32
- const targets = parsed.toolchain?.targets ?? [];
33
- const components = parsed.toolchain?.components ?? [];
34
- const installArgs = [
35
- `rustup toolchain install ${channel}`
36
- ];
37
- for (const target of targets) {
38
- installArgs.push(`--target ${target}`);
39
- }
40
- for (const component of components) {
41
- installArgs.push(`--component ${component}`);
21
+ let installCmd;
22
+ const hasToolchainFile = await promises.access(filePath).then(() => true, () => false);
23
+ if (hasToolchainFile) {
24
+ const parsed = toml.parse(await promises.readFile(filePath, "utf-8"));
25
+ const channel = parsed.toolchain?.channel;
26
+ if (typeof channel !== "string") {
27
+ throw new Error(`Missing 'toolchain.channel' in ${filePath}`);
28
+ }
29
+ const targets = parsed.toolchain?.targets ?? [];
30
+ const components = parsed.toolchain?.components ?? [];
31
+ const installArgs = [
32
+ `rustup toolchain install ${channel}`
33
+ ];
34
+ for (const target of targets) {
35
+ installArgs.push(`--target ${target}`);
36
+ }
37
+ for (const component of components) {
38
+ installArgs.push(`--component ${component}`);
39
+ }
40
+ installCmd = installArgs.join(" ");
41
+ } else {
42
+ installCmd = "rustup default stable";
42
43
  }
43
- const installCmd = installArgs.join(" ");
44
44
  const script = [
45
45
  "mkdir -p $CARGO_HOME/bin",
46
46
  "ln -sf /usr/local/cargo/bin/rustup $CARGO_HOME/bin/rustup",
@@ -66,5 +66,5 @@ async function syncToolchain(context, options) {
66
66
  JBSG7YXG_cjs.__name(syncToolchain, "syncToolchain");
67
67
 
68
68
  exports.syncToolchain = syncToolchain;
69
- //# sourceMappingURL=KBDPPUCS.cjs.map
70
- //# sourceMappingURL=KBDPPUCS.cjs.map
69
+ //# sourceMappingURL=YR76RYJU.cjs.map
70
+ //# sourceMappingURL=YR76RYJU.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/sync-toolchain.ts"],"names":["init_cjs_shims","syncedCwds","Set","syncToolchain","context","options","has","cwd","filePath","path","join","installCmd","hasToolchainFile","access","then","parsed","parse","readFile","channel","toolchain","Error","targets","components","installArgs","target","push","component","script","console","info","add","executeToolCommand","volumes","type","containerPath","name","shared","locked"],"mappings":";;;;;;;;;;;;;AAAAA,2BAAA,EAAA;AAeA,IAAMC,UAAAA,uBAAiBC,GAAAA,EAAAA;AAEvB,eAAsBC,aAAAA,CAClBC,SACAC,OAAAA,EAAoC;AAEpC,EAAA,IAAIJ,UAAAA,CAAWK,GAAAA,CAAID,OAAAA,CAAQE,GAAG,CAAA,EAAG;AAC7B,IAAA;AACJ,EAAA;AAEA,EAAA,MAAMC,QAAAA,GAAWC,qBAAAA,CAAKC,IAAAA,CAAKL,OAAAA,CAAQE,KAAK,qBAAA,CAAA;AAExC,EAAA,IAAII,UAAAA;AACJ,EAAA,MAAMC,gBAAAA,GAAmB,MAAMC,eAAAA,CAAOL,QAAAA,EAAUM,IAAAA,CAC5C,MAAM,IAAA,EACN,MAAM,KAAA,CAAA;AAGV,EAAA,IAAIF,gBAAAA,EAAkB;AAClB,IAAA,MAAMG,SAA4BC,UAAAA,CAAM,MAAMC,iBAAAA,CAAST,QAAAA,EAAU,OAAA,CAAA,CAAA;AAEjE,IAAA,MAAMU,O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GC,OAAAA;AACHsB,IAAAA,MAAAA;IACAK,OAAAA,EAAS;SACF3B,OAAAA,CAAQ2B,OAAAA;AACX,MAAA;QACIC,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,eAAA;QACfC,IAAAA,EAAM,gBAAA;QACNC,MAAAA,EAAQ,IAAA;QACRC,MAAAA,EAAQ;AACZ;;GAER,CAAA;AACJ;AArEsBlC,mBAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"YR76RYJU.cjs","sourcesContent":["import { access, readFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport { parse } from 'toml';\n\nimport type { ChainContext, ToolCommandExecutionOptions } from '@layerzerolabs/vm-tooling';\nimport { executeToolCommand } from '@layerzerolabs/vm-tooling';\n\ninterface RustToolchainToml {\n toolchain?: {\n channel?: string;\n targets?: string[];\n components?: string[];\n };\n}\n\nconst syncedCwds = new Set<string>();\n\nexport async function syncToolchain(\n context: ChainContext<string>,\n options: ToolCommandExecutionOptions,\n): Promise<void> {\n if (syncedCwds.has(options.cwd)) {\n return;\n }\n\n const filePath = path.join(options.cwd, 'rust-toolchain.toml');\n\n let installCmd: string;\n const hasToolchainFile = await access(filePath).then(\n () => true,\n () => false,\n );\n\n if (hasToolchainFile) {\n const parsed: RustToolchainToml = parse(await readFile(filePath, 'utf-8'));\n\n const channel = parsed.toolchain?.channel;\n if (typeof channel !== 'string') {\n throw new Error(`Missing 'toolchain.channel' in ${filePath}`);\n }\n\n const targets: string[] = parsed.toolchain?.targets ?? [];\n const components: string[] = parsed.toolchain?.components ?? [];\n\n const installArgs = [`rustup toolchain install ${channel}`];\n for (const target of targets) {\n installArgs.push(`--target ${target}`);\n }\n for (const component of components) {\n installArgs.push(`--component ${component}`);\n }\n\n installCmd = installArgs.join(' ');\n } else {\n // No rust-toolchain.toml found — install stable as the default so that\n // cargo (a rustup proxy) can resolve a toolchain from the empty RUSTUP_HOME volume.\n installCmd = 'rustup default stable';\n }\n\n // rustup expects to find itself at $CARGO_HOME/bin/rustup to manage proxy\n // binaries there. At runtime CARGO_HOME points to /cache/cargo (volume),\n // so we symlink the image-installed rustup binary into the volume.\n const script = [\n 'mkdir -p $CARGO_HOME/bin',\n 'ln -sf /usr/local/cargo/bin/rustup $CARGO_HOME/bin/rustup',\n installCmd,\n ].join(' && ');\n console.info(`🔧 Syncing Rust toolchain: ${installCmd}`);\n\n // Mark as synced before executeToolCommand to prevent recursive preExecute calls\n syncedCwds.add(options.cwd);\n\n await executeToolCommand(context, 'stellar', [], {\n ...options,\n script,\n volumes: [\n ...options.volumes,\n {\n type: 'isolate',\n containerPath: '/cache/rustup',\n name: 'stellar-rustup',\n shared: true,\n locked: true,\n },\n ],\n });\n}\n"]}
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var KBDPPUCS_cjs = require('../KBDPPUCS.cjs');
3
+ var YR76RYJU_cjs = require('../YR76RYJU.cjs');
4
4
  require('../JBSG7YXG.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "syncToolchain", {
9
9
  enumerable: true,
10
- get: function () { return KBDPPUCS_cjs.syncToolchain; }
10
+ get: function () { return YR76RYJU_cjs.syncToolchain; }
11
11
  });
12
12
  //# sourceMappingURL=sync-toolchain.cjs.map
13
13
  //# sourceMappingURL=sync-toolchain.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"sync-toolchain.d.ts","sourceRoot":"","sources":["../../src/commands/sync-toolchain.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAa3F,wBAAsB,aAAa,CAC/B,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,EAC7B,OAAO,EAAE,2BAA2B,GACrC,OAAO,CAAC,IAAI,CAAC,CA0Df"}
1
+ {"version":3,"file":"sync-toolchain.d.ts","sourceRoot":"","sources":["../../src/commands/sync-toolchain.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAa3F,wBAAsB,aAAa,CAC/B,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,EAC7B,OAAO,EAAE,2BAA2B,GACrC,OAAO,CAAC,IAAI,CAAC,CAkEf"}
@@ -1,4 +1,4 @@
1
- export { syncToolchain } from '../NHURSN57.js';
1
+ export { syncToolchain } from '../76ISNWAF.js';
2
2
  import '../PHXMTVK6.js';
3
3
  //# sourceMappingURL=sync-toolchain.js.map
4
4
  //# sourceMappingURL=sync-toolchain.js.map
package/dist/config.cjs CHANGED
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
 
3
- var ZQJGQNTW_cjs = require('./ZQJGQNTW.cjs');
4
- require('./KBDPPUCS.cjs');
3
+ var IDI24AAI_cjs = require('./IDI24AAI.cjs');
4
+ require('./YR76RYJU.cjs');
5
5
  require('./JBSG7YXG.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "images", {
10
10
  enumerable: true,
11
- get: function () { return ZQJGQNTW_cjs.images; }
11
+ get: function () { return IDI24AAI_cjs.images; }
12
12
  });
13
13
  Object.defineProperty(exports, "tools", {
14
14
  enumerable: true,
15
- get: function () { return ZQJGQNTW_cjs.tools; }
15
+ get: function () { return IDI24AAI_cjs.tools; }
16
16
  });
17
17
  Object.defineProperty(exports, "versionCombinations", {
18
18
  enumerable: true,
19
- get: function () { return ZQJGQNTW_cjs.versionCombinations; }
19
+ get: function () { return IDI24AAI_cjs.versionCombinations; }
20
20
  });
21
21
  //# sourceMappingURL=config.cjs.map
22
22
  //# sourceMappingURL=config.cjs.map
package/dist/config.js CHANGED
@@ -1,5 +1,5 @@
1
- export { images, tools, versionCombinations } from './7X2ZWY4F.js';
2
- import './NHURSN57.js';
1
+ export { images, tools, versionCombinations } from './IWCY7QHM.js';
2
+ import './76ISNWAF.js';
3
3
  import './PHXMTVK6.js';
4
4
  //# sourceMappingURL=config.js.map
5
5
  //# sourceMappingURL=config.js.map
package/dist/index.cjs CHANGED
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var ZQJGQNTW_cjs = require('./ZQJGQNTW.cjs');
4
- var KBDPPUCS_cjs = require('./KBDPPUCS.cjs');
3
+ var IDI24AAI_cjs = require('./IDI24AAI.cjs');
4
+ var YR76RYJU_cjs = require('./YR76RYJU.cjs');
5
5
  var JBSG7YXG_cjs = require('./JBSG7YXG.cjs');
6
6
  var vmTooling = require('@layerzerolabs/vm-tooling');
7
7
 
8
8
  // src/index.ts
9
9
  JBSG7YXG_cjs.init_cjs_shims();
10
10
  var context = {
11
- tools: ZQJGQNTW_cjs.tools,
12
- images: ZQJGQNTW_cjs.images,
13
- versionCombinations: ZQJGQNTW_cjs.versionCombinations
11
+ tools: IDI24AAI_cjs.tools,
12
+ images: IDI24AAI_cjs.images,
13
+ versionCombinations: IDI24AAI_cjs.versionCombinations
14
14
  };
15
15
  var main = /* @__PURE__ */ JBSG7YXG_cjs.__name(() => vmTooling.runCli(context, (program, parseGlobalOptions) => {
16
- program.command("sync-toolchain").description("Pre-download the Rust toolchain specified in rust-toolchain.toml under a lock").action(() => KBDPPUCS_cjs.syncToolchain(context, parseGlobalOptions(program)));
16
+ program.command("sync-toolchain").description("Pre-download the Rust toolchain specified in rust-toolchain.toml under a lock").action(() => YR76RYJU_cjs.syncToolchain(context, parseGlobalOptions(program)));
17
17
  }), "main");
18
18
 
19
19
  exports.main = main;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { versionCombinations, images, tools } from './7X2ZWY4F.js';
2
- import { syncToolchain } from './NHURSN57.js';
1
+ import { versionCombinations, images, tools } from './IWCY7QHM.js';
2
+ import { syncToolchain } from './76ISNWAF.js';
3
3
  import { init_esm_shims, __name } from './PHXMTVK6.js';
4
4
  import { runCli } from '@layerzerolabs/vm-tooling';
5
5
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var ZQJGQNTW_cjs = require('./ZQJGQNTW.cjs');
4
- require('./KBDPPUCS.cjs');
3
+ var IDI24AAI_cjs = require('./IDI24AAI.cjs');
4
+ require('./YR76RYJU.cjs');
5
5
  var JBSG7YXG_cjs = require('./JBSG7YXG.cjs');
6
6
  var tty = require('tty');
7
7
  var vmTooling = require('@layerzerolabs/vm-tooling');
@@ -18194,7 +18194,7 @@ var assertType = /* @__PURE__ */ JBSG7YXG_cjs.__name(function assertType2() {
18194
18194
 
18195
18195
  // ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.19.1_jiti@2.6.1_lightningcss@1.30.1_terser@5.44.1_tsx@4.20.6_yaml@2.8.1/node_modules/vitest/dist/index.js
18196
18196
  var import_expect_type2 = JBSG7YXG_cjs.__toESM(require_dist(), 1);
18197
- vmTooling.testTools(dist_exports2, ZQJGQNTW_cjs.images, ZQJGQNTW_cjs.versionCombinations, {
18197
+ vmTooling.testTools(dist_exports2, IDI24AAI_cjs.images, IDI24AAI_cjs.versionCombinations, {
18198
18198
  stellar: [
18199
18199
  "stellar",
18200
18200
  "--version"
@@ -1,5 +1,5 @@
1
- import { images, versionCombinations } from './7X2ZWY4F.js';
2
- import './NHURSN57.js';
1
+ import { images, versionCombinations } from './IWCY7QHM.js';
2
+ import './76ISNWAF.js';
3
3
  import { __commonJS, init_esm_shims, __name, __export, __toESM } from './PHXMTVK6.js';
4
4
  import { isatty } from 'tty';
5
5
  import { testTools } from '@layerzerolabs/vm-tooling';
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var ZQJGQNTW_cjs = require('../ZQJGQNTW.cjs');
4
- require('../KBDPPUCS.cjs');
3
+ var IDI24AAI_cjs = require('../IDI24AAI.cjs');
4
+ require('../YR76RYJU.cjs');
5
5
  var JBSG7YXG_cjs = require('../JBSG7YXG.cjs');
6
6
  var vmTooling = require('@layerzerolabs/vm-tooling');
7
7
 
8
8
  // src/scripts/generate-github-matrix.ts
9
9
  JBSG7YXG_cjs.init_cjs_shims();
10
- vmTooling.runGithubMatrixGenerator(ZQJGQNTW_cjs.images, "tools/vm-tooling-stellar", ZQJGQNTW_cjs.versionCombinations).catch((error) => {
10
+ vmTooling.runGithubMatrixGenerator(IDI24AAI_cjs.images, "tools/vm-tooling-stellar", IDI24AAI_cjs.versionCombinations).catch((error) => {
11
11
  console.error(error);
12
12
  process.exit(1);
13
13
  });
@@ -1,5 +1,5 @@
1
- import { images, versionCombinations } from '../7X2ZWY4F.js';
2
- import '../NHURSN57.js';
1
+ import { images, versionCombinations } from '../IWCY7QHM.js';
2
+ import '../76ISNWAF.js';
3
3
  import { init_esm_shims } from '../PHXMTVK6.js';
4
4
  import { runGithubMatrixGenerator } from '@layerzerolabs/vm-tooling';
5
5
 
package/package.json CHANGED
@@ -21,15 +21,15 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "toml": "^3.0.0",
24
- "@layerzerolabs/vm-tooling": "0.2.45"
24
+ "@layerzerolabs/vm-tooling": "0.2.46"
25
25
  },
26
26
  "devDependencies": {
27
27
  "tsup": "^8.4.0",
28
28
  "tsx": "^4.19.3",
29
29
  "typescript": "^5.8.2",
30
30
  "vitest": "^3.2.3",
31
- "@layerzerolabs/tsup-configuration": "0.2.45",
32
- "@layerzerolabs/typescript-configuration": "0.2.45"
31
+ "@layerzerolabs/tsup-configuration": "0.2.46",
32
+ "@layerzerolabs/typescript-configuration": "0.2.46"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "restricted",
@@ -41,7 +41,7 @@
41
41
  "everdawn-asset0"
42
42
  ]
43
43
  },
44
- "version": "0.2.45",
44
+ "version": "0.2.46",
45
45
  "scripts": {
46
46
  "build": "tsup",
47
47
  "generate-github-matrix": "tsx src/scripts/generate-github-matrix.ts",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/sync-toolchain.ts"],"names":["init_cjs_shims","syncedCwds","Set","syncToolchain","context","options","has","cwd","filePath","path","join","access","console","info","parsed","parse","readFile","channel","toolchain","Error","targets","components","installArgs","target","push","component","installCmd","script","add","execute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A,KAAA,MAAWE,aAAaJ,UAAAA,EAAY;AAChCC,IAAAA,WAAAA,CAAYE,IAAAA,CAAK,CAAA,YAAA,EAAeC,SAAAA,CAAAA,CAAW,CAAA;AAC/C,EAAA;AAEA,EAAA,MAAMC,UAAAA,GAAaJ,WAAAA,CAAYZ,IAAAA,CAAK,GAAA,CAAA;AAIpC,EAAA,MAAMiB,MAAAA,GAAS;AACX,IAAA,0BAAA;AACA,IAAA,2DAAA;AACAD,IAAAA;AACFhB,GAAAA,CAAAA,IAAAA,CAAK,MAAA,CAAA;AACPE,EAAAA,OAAAA,CAAQC,IAAAA,CAAK,CAAA,kCAAA,EAA8Ba,UAAAA,CAAAA,CAAY,CAAA;AAGvDzB,EAAAA,UAAAA,CAAW2B,GAAAA,CAAIvB,QAAQE,GAAG,CAAA;AAE1B,EAAA,MAAMsB,4BAAAA,CAAmBzB,OAAAA,EAAS,SAAA,EAAW,EAAA,EAAI;IAC7C,GAAGC,OAAAA;AACHsB,IAAAA,MAAAA;IACAG,OAAAA,EAAS;SACFzB,OAAAA,CAAQyB,OAAAA;AACX,MAAA;QACIC,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,eAAA;QACfC,IAAAA,EAAM,gBAAA;QACNC,MAAAA,EAAQ,IAAA;QACRC,MAAAA,EAAQ;AACZ;;GAER,CAAA;AACJ;AA7DsBhC,mBAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"KBDPPUCS.cjs","sourcesContent":["import { access, readFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport { parse } from 'toml';\n\nimport type { ChainContext, ToolCommandExecutionOptions } from '@layerzerolabs/vm-tooling';\nimport { executeToolCommand } from '@layerzerolabs/vm-tooling';\n\ninterface RustToolchainToml {\n toolchain?: {\n channel?: string;\n targets?: string[];\n components?: string[];\n };\n}\n\nconst syncedCwds = new Set<string>();\n\nexport async function syncToolchain(\n context: ChainContext<string>,\n options: ToolCommandExecutionOptions,\n): Promise<void> {\n if (syncedCwds.has(options.cwd)) {\n return;\n }\n\n const filePath = path.join(options.cwd, 'rust-toolchain.toml');\n try {\n await access(filePath);\n } catch {\n console.info('No rust-toolchain.toml found, skipping toolchain sync');\n return;\n }\n const parsed: RustToolchainToml = parse(await readFile(filePath, 'utf-8'));\n\n const channel = parsed.toolchain?.channel;\n if (typeof channel !== 'string') {\n throw new Error(`Missing 'toolchain.channel' in ${filePath}`);\n }\n\n const targets: string[] = parsed.toolchain?.targets ?? [];\n const components: string[] = parsed.toolchain?.components ?? [];\n\n const installArgs = [`rustup toolchain install ${channel}`];\n for (const target of targets) {\n installArgs.push(`--target ${target}`);\n }\n for (const component of components) {\n installArgs.push(`--component ${component}`);\n }\n\n const installCmd = installArgs.join(' ');\n // rustup expects to find itself at $CARGO_HOME/bin/rustup to manage proxy\n // binaries there. At runtime CARGO_HOME points to /cache/cargo (volume),\n // so we symlink the image-installed rustup binary into the volume.\n const script = [\n 'mkdir -p $CARGO_HOME/bin',\n 'ln -sf /usr/local/cargo/bin/rustup $CARGO_HOME/bin/rustup',\n installCmd,\n ].join(' && ');\n console.info(`🔧 Syncing Rust toolchain: ${installCmd}`);\n\n // Mark as synced before executeToolCommand to prevent recursive preExecute calls\n syncedCwds.add(options.cwd);\n\n await executeToolCommand(context, 'stellar', [], {\n ...options,\n script,\n volumes: [\n ...options.volumes,\n {\n type: 'isolate',\n containerPath: '/cache/rustup',\n name: 'stellar-rustup',\n shared: true,\n locked: true,\n },\n ],\n });\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/sync-toolchain.ts"],"names":["syncedCwds","Set","syncToolchain","context","options","has","cwd","filePath","path","join","access","console","info","parsed","parse","readFile","channel","toolchain","Error","targets","components","installArgs","target","push","component","installCmd","script","add","executeToolCommand","volumes","type","containerPath","name","shared","locked"],"mappings":";;;;;;;AAAA,cAAA,EAAA;AAeA,IAAMA,UAAAA,uBAAiBC,GAAAA,EAAAA;AAEvB,eAAsBC,aAAAA,CAClBC,SACAC,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UAAAA,GAAaJ,WAAAA,CAAYZ,IAAAA,CAAK,GAAA,CAAA;AAIpC,EAAA,MAAMiB,MAAAA,GAAS;AACX,IAAA,0BAAA;AACA,IAAA,2DAAA;AACAD,IAAAA;AACFhB,GAAAA,CAAAA,IAAAA,CAAK,MAAA,CAAA;AACPE,EAAAA,OAAAA,CAAQC,IAAAA,CAAK,CAAA,kCAAA,EAA8Ba,UAAAA,CAAAA,CAAY,CAAA;AAGvDzB,EAAAA,UAAAA,CAAW2B,GAAAA,CAAIvB,QAAQE,GAAG,CAAA;AAE1B,EAAA,MAAMsB,kBAAAA,CAAmBzB,OAAAA,EAAS,SAAA,EAAW,EAAA,EAAI;IAC7C,GAAGC,OAAAA;AACHsB,IAAAA,MAAAA;IACAG,OAAAA,EAAS;SACFzB,OAAAA,CAAQyB,OAAAA;AACX,MAAA;QACIC,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,eAAA;QACfC,IAAAA,EAAM,gBAAA;QACNC,MAAAA,EAAQ,IAAA;QACRC,MAAAA,EAAQ;AACZ;;GAER,CAAA;AACJ;AA7DsBhC,MAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"NHURSN57.js","sourcesContent":["import { access, readFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport { parse } from 'toml';\n\nimport type { ChainContext, ToolCommandExecutionOptions } from '@layerzerolabs/vm-tooling';\nimport { executeToolCommand } from '@layerzerolabs/vm-tooling';\n\ninterface RustToolchainToml {\n toolchain?: {\n channel?: string;\n targets?: string[];\n components?: string[];\n };\n}\n\nconst syncedCwds = new Set<string>();\n\nexport async function syncToolchain(\n context: ChainContext<string>,\n options: ToolCommandExecutionOptions,\n): Promise<void> {\n if (syncedCwds.has(options.cwd)) {\n return;\n }\n\n const filePath = path.join(options.cwd, 'rust-toolchain.toml');\n try {\n await access(filePath);\n } catch {\n console.info('No rust-toolchain.toml found, skipping toolchain sync');\n return;\n }\n const parsed: RustToolchainToml = parse(await readFile(filePath, 'utf-8'));\n\n const channel = parsed.toolchain?.channel;\n if (typeof channel !== 'string') {\n throw new Error(`Missing 'toolchain.channel' in ${filePath}`);\n }\n\n const targets: string[] = parsed.toolchain?.targets ?? [];\n const components: string[] = parsed.toolchain?.components ?? [];\n\n const installArgs = [`rustup toolchain install ${channel}`];\n for (const target of targets) {\n installArgs.push(`--target ${target}`);\n }\n for (const component of components) {\n installArgs.push(`--component ${component}`);\n }\n\n const installCmd = installArgs.join(' ');\n // rustup expects to find itself at $CARGO_HOME/bin/rustup to manage proxy\n // binaries there. At runtime CARGO_HOME points to /cache/cargo (volume),\n // so we symlink the image-installed rustup binary into the volume.\n const script = [\n 'mkdir -p $CARGO_HOME/bin',\n 'ln -sf /usr/local/cargo/bin/rustup $CARGO_HOME/bin/rustup',\n installCmd,\n ].join(' && ');\n console.info(`🔧 Syncing Rust toolchain: ${installCmd}`);\n\n // Mark as synced before executeToolCommand to prevent recursive preExecute calls\n syncedCwds.add(options.cwd);\n\n await executeToolCommand(context, 'stellar', [], {\n ...options,\n script,\n volumes: [\n ...options.volumes,\n {\n type: 'isolate',\n containerPath: '/cache/rustup',\n name: 'stellar-rustup',\n shared: true,\n locked: true,\n },\n ],\n });\n}\n"]}