@layerzerolabs/vm-tooling 0.2.103 → 0.2.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{P4BHRQMD.js → 2MO4PR4P.js} +2 -2
- package/dist/2MO4PR4P.js.map +1 -0
- package/dist/{ZSOVVFOM.js → 3IQB2ZZF.js} +3 -3
- package/dist/{ZSOVVFOM.js.map → 3IQB2ZZF.js.map} +1 -1
- package/dist/5PWUQUE5.js +18363 -0
- package/dist/5PWUQUE5.js.map +1 -0
- package/dist/HC7LYTHL.js +53 -0
- package/dist/HC7LYTHL.js.map +1 -0
- package/dist/{BJUOU4DR.js → HOFCGMNS.js} +2 -2
- package/dist/{BJUOU4DR.js.map → HOFCGMNS.js.map} +1 -1
- package/dist/{JYJBE36S.js → INYD2E56.js} +26 -17
- package/dist/INYD2E56.js.map +1 -0
- package/dist/{AXL4SBDJ.js → RVVZQC34.js} +3 -3
- package/dist/{AXL4SBDJ.js.map → RVVZQC34.js.map} +1 -1
- package/dist/{6V27P6AU.js → SQYDOF2V.js} +3 -3
- package/dist/{6V27P6AU.js.map → SQYDOF2V.js.map} +1 -1
- package/dist/{BTPRTHPR.js → TMKE5ARZ.js} +3 -3
- package/dist/{BTPRTHPR.js.map → TMKE5ARZ.js.map} +1 -1
- package/dist/{UQGPF6NC.js → TSEHDOF7.js} +5 -5
- package/dist/TSEHDOF7.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +7 -6
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +6 -5
- package/dist/core/local-executor.d.ts +11 -0
- package/dist/core/local-executor.d.ts.map +1 -0
- package/dist/core/local-executor.js +4 -0
- package/dist/core/local-executor.js.map +1 -0
- package/dist/core/local-executor.test.js +110 -0
- package/dist/core/local-executor.test.js.map +1 -0
- package/dist/core/lock.test.js +2 -18360
- package/dist/core/lock.test.js.map +1 -1
- package/dist/core/tool-executor.d.ts +2 -1
- package/dist/core/tool-executor.d.ts.map +1 -1
- package/dist/core/tool-executor.js +5 -4
- package/dist/github/index.js +4 -4
- package/dist/github/matrix.js +3 -3
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/test.js +3 -3
- package/dist/utils/docker.js +2 -2
- package/package.json +5 -5
- package/dist/JYJBE36S.js.map +0 -1
- package/dist/P4BHRQMD.js.map +0 -1
- package/dist/UQGPF6NC.js.map +0 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { describe, it, globalExpect } from '../5PWUQUE5.js';
|
|
2
|
+
import { executeLocally } from '../HC7LYTHL.js';
|
|
3
|
+
import { init_esm_shims, __name } from '../CWKWODSW.js';
|
|
4
|
+
import process from 'process';
|
|
5
|
+
|
|
6
|
+
// src/core/local-executor.test.ts
|
|
7
|
+
init_esm_shims();
|
|
8
|
+
describe(executeLocally, () => {
|
|
9
|
+
const cwd = process.cwd();
|
|
10
|
+
it("throws when the tool does not support local execution", async () => {
|
|
11
|
+
const tool = {
|
|
12
|
+
name: "forge"
|
|
13
|
+
};
|
|
14
|
+
await globalExpect(executeLocally(tool, "1.0.0", {
|
|
15
|
+
cwd,
|
|
16
|
+
args: [],
|
|
17
|
+
env: []
|
|
18
|
+
})).rejects.toThrowError(/not supported/);
|
|
19
|
+
});
|
|
20
|
+
it("throws when the local version does not match", async () => {
|
|
21
|
+
const tool = {
|
|
22
|
+
name: "forge",
|
|
23
|
+
getLocalVersion: /* @__PURE__ */ __name(async () => "1.0.0", "getLocalVersion")
|
|
24
|
+
};
|
|
25
|
+
await globalExpect(executeLocally(tool, "2.0.0", {
|
|
26
|
+
cwd,
|
|
27
|
+
args: [],
|
|
28
|
+
env: []
|
|
29
|
+
})).rejects.toThrowError(/does not match the required version/);
|
|
30
|
+
});
|
|
31
|
+
it("propagates the error raised while probing the local version", async () => {
|
|
32
|
+
const tool = {
|
|
33
|
+
name: "forge",
|
|
34
|
+
getLocalVersion: /* @__PURE__ */ __name(async () => {
|
|
35
|
+
throw new Error("forge is not installed locally");
|
|
36
|
+
}, "getLocalVersion")
|
|
37
|
+
};
|
|
38
|
+
await globalExpect(executeLocally(tool, "1.0.0", {
|
|
39
|
+
cwd,
|
|
40
|
+
args: [],
|
|
41
|
+
env: []
|
|
42
|
+
})).rejects.toThrowError(/not installed locally/);
|
|
43
|
+
});
|
|
44
|
+
it("runs the host tool when the version matches", async () => {
|
|
45
|
+
const tool = {
|
|
46
|
+
name: "node",
|
|
47
|
+
getLocalVersion: /* @__PURE__ */ __name(async () => "1.0.0", "getLocalVersion")
|
|
48
|
+
};
|
|
49
|
+
const output = await executeLocally(tool, "1.0.0", {
|
|
50
|
+
cwd,
|
|
51
|
+
args: [
|
|
52
|
+
"-e",
|
|
53
|
+
'process.stdout.write("ran")'
|
|
54
|
+
],
|
|
55
|
+
env: []
|
|
56
|
+
});
|
|
57
|
+
globalExpect(output.exitCode).toBe(0);
|
|
58
|
+
globalExpect(output.stdout).toContain("ran");
|
|
59
|
+
});
|
|
60
|
+
it("passes custom environment variables to the host tool", async () => {
|
|
61
|
+
const tool = {
|
|
62
|
+
name: "node",
|
|
63
|
+
getLocalVersion: /* @__PURE__ */ __name(async () => "1.0.0", "getLocalVersion")
|
|
64
|
+
};
|
|
65
|
+
const output = await executeLocally(tool, "1.0.0", {
|
|
66
|
+
cwd,
|
|
67
|
+
args: [
|
|
68
|
+
"-e",
|
|
69
|
+
'process.stdout.write(process.env.LZ_LOCAL_TEST ?? "")'
|
|
70
|
+
],
|
|
71
|
+
env: [
|
|
72
|
+
{
|
|
73
|
+
name: "LZ_LOCAL_TEST",
|
|
74
|
+
value: "present"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
globalExpect(output.stdout).toContain("present");
|
|
79
|
+
});
|
|
80
|
+
it("runs a custom script via bash without prefixing the tool name", async () => {
|
|
81
|
+
const tool = {
|
|
82
|
+
name: "node",
|
|
83
|
+
getLocalVersion: /* @__PURE__ */ __name(async () => "1.0.0", "getLocalVersion")
|
|
84
|
+
};
|
|
85
|
+
const output = await executeLocally(tool, "1.0.0", {
|
|
86
|
+
cwd,
|
|
87
|
+
args: [],
|
|
88
|
+
env: [],
|
|
89
|
+
script: "printf scripted"
|
|
90
|
+
});
|
|
91
|
+
globalExpect(output.exitCode).toBe(0);
|
|
92
|
+
globalExpect(output.stdout).toContain("scripted");
|
|
93
|
+
});
|
|
94
|
+
it("throws when the host tool exits with a non-zero code", async () => {
|
|
95
|
+
const tool = {
|
|
96
|
+
name: "node",
|
|
97
|
+
getLocalVersion: /* @__PURE__ */ __name(async () => "1.0.0", "getLocalVersion")
|
|
98
|
+
};
|
|
99
|
+
await globalExpect(executeLocally(tool, "1.0.0", {
|
|
100
|
+
cwd,
|
|
101
|
+
args: [
|
|
102
|
+
"-e",
|
|
103
|
+
"process.exit(2)"
|
|
104
|
+
],
|
|
105
|
+
env: []
|
|
106
|
+
})).rejects.toThrowError(/exit code: 2/);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=local-executor.test.js.map
|
|
110
|
+
//# sourceMappingURL=local-executor.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/local-executor.test.ts"],"names":["describe","executeLocally","cwd","process","it","tool","name","expect","args","env","rejects","toThrowError","getLocalVersion","Error","output","exitCode","toBe","stdout","toContain","value","script"],"mappings":";;;;;;AAAA,cAAA,EAAA;AAMAA,QAAAA,CAASC,gBAAgB,MAAA;AACrB,EAAA,MAAMC,GAAAA,GAAMC,QAAQD,GAAAA,EAAG;AAEvBE,EAAAA,EAAAA,CAAG,yDAAyD,YAAA;AACxD,IAAA,MAAMC,IAAAA,GAAa;MAAEC,IAAAA,EAAM;AAAQ,KAAA;AAEnC,IAAA,MAAMC,YAAAA,CACFN,cAAAA,CAAeI,IAAAA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A,GAAAA,EAAK,EAAA;MACLW,MAAAA,EAAQ;KACZ,CAAA;AAEAb,IAAAA,YAAAA,CAAOO,MAAAA,CAAOC,QAAQ,CAAA,CAAEC,IAAAA,CAAK,CAAA,CAAA;AAC7BT,IAAAA,YAAAA,CAAOO,MAAAA,CAAOG,MAAM,CAAA,CAAEC,SAAAA,CAAU,UAAA,CAAA;EACpC,CAAA,CAAA;AAEAd,EAAAA,EAAAA,CAAG,wDAAwD,YAAA;AACvD,IAAA,MAAMC,IAAAA,GAAa;MAAEC,IAAAA,EAAM,MAAA;AAAQM,MAAAA,eAAAA,qCAA6B,OAAA,EAAZ,iBAAA;AAAoB,KAAA;AAExE,IAAA,MAAML,YAAAA,CACFN,cAAAA,CAAeI,IAAAA,EAAM,OAAA,EAAS;AAC1BH,MAAAA,GAAAA;MACAM,IAAAA,EAAM;AAAC,QAAA,IAAA;AAAM,QAAA;;AACbC,MAAAA,GAAAA,EAAK;AACT,KAAA,CAAA,CAAA,CACFC,OAAAA,CAAQC,YAAAA,CAAa,cAAA,CAAA;EAC3B,CAAA,CAAA;AACJ,CAAA,CAAA","file":"local-executor.test.js","sourcesContent":["import process from 'node:process';\nimport { describe, expect, it } from 'vitest';\n\nimport type { Tool } from '../config';\nimport { executeLocally } from './local-executor';\n\ndescribe(executeLocally, () => {\n const cwd = process.cwd();\n\n it('throws when the tool does not support local execution', async () => {\n const tool: Tool = { name: 'forge' };\n\n await expect(\n executeLocally(tool, '1.0.0', { cwd, args: [], env: [] }),\n ).rejects.toThrowError(/not supported/);\n });\n\n it('throws when the local version does not match', async () => {\n const tool: Tool = { name: 'forge', getLocalVersion: async () => '1.0.0' };\n\n await expect(\n executeLocally(tool, '2.0.0', { cwd, args: [], env: [] }),\n ).rejects.toThrowError(/does not match the required version/);\n });\n\n it('propagates the error raised while probing the local version', async () => {\n const tool: Tool = {\n name: 'forge',\n getLocalVersion: async () => {\n throw new Error('forge is not installed locally');\n },\n };\n\n await expect(\n executeLocally(tool, '1.0.0', { cwd, args: [], env: [] }),\n ).rejects.toThrowError(/not installed locally/);\n });\n\n it('runs the host tool when the version matches', async () => {\n const tool: Tool = { name: 'node', getLocalVersion: async () => '1.0.0' };\n\n const output = await executeLocally(tool, '1.0.0', {\n cwd,\n args: ['-e', 'process.stdout.write(\"ran\")'],\n env: [],\n });\n\n expect(output.exitCode).toBe(0);\n expect(output.stdout).toContain('ran');\n });\n\n it('passes custom environment variables to the host tool', async () => {\n const tool: Tool = { name: 'node', getLocalVersion: async () => '1.0.0' };\n\n const output = await executeLocally(tool, '1.0.0', {\n cwd,\n args: ['-e', 'process.stdout.write(process.env.LZ_LOCAL_TEST ?? \"\")'],\n env: [{ name: 'LZ_LOCAL_TEST', value: 'present' }],\n });\n\n expect(output.stdout).toContain('present');\n });\n\n it('runs a custom script via bash without prefixing the tool name', async () => {\n const tool: Tool = { name: 'node', getLocalVersion: async () => '1.0.0' };\n\n const output = await executeLocally(tool, '1.0.0', {\n cwd,\n args: [],\n env: [],\n script: 'printf scripted',\n });\n\n expect(output.exitCode).toBe(0);\n expect(output.stdout).toContain('scripted');\n });\n\n it('throws when the host tool exits with a non-zero code', async () => {\n const tool: Tool = { name: 'node', getLocalVersion: async () => '1.0.0' };\n\n await expect(\n executeLocally(tool, '1.0.0', {\n cwd,\n args: ['-e', 'process.exit(2)'],\n env: [],\n }),\n ).rejects.toThrowError(/exit code: 2/);\n });\n});\n"]}
|