Skip to content

Commit 78d8553

Browse files
committed
fix: update sharp version references to 0.35.3 in tests and config
1 parent dda27b7 commit 78d8553

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

‎packages/vscode-ide-companion/src/tests/sharp-loader.test.ts‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { TENCENT_MIRROR_REGISTRY } from "@vegamo/deepcode-core";
88
import { buildSharpInstallArgs, createSharpLoader, type SharpInstallProgress } from "../sharp-loader.js";
99

1010
const tempDirs: string[] = [];
11+
const SHARP_VERSION = "0.35.3";
1112

1213
afterEach(() => {
1314
for (const dir of tempDirs.splice(0)) {
@@ -23,7 +24,7 @@ test("Sharp loader reuses a CLI installation without notifying or installing", a
2324
{
2425
workspaceRoot: storageRoot,
2526
storageRoot,
26-
sharpVersion: "0.34.5",
27+
sharpVersion: SHARP_VERSION,
2728
notifyInstalling: async (task) => {
2829
notificationCount += 1;
2930
return await task(() => {});
@@ -53,7 +54,7 @@ test("Sharp loader installs once for concurrent first calls and reuses the cache
5354
{
5455
workspaceRoot: storageRoot,
5556
storageRoot,
56-
sharpVersion: "0.34.5",
57+
sharpVersion: SHARP_VERSION,
5758
notifyInstalling: async (task) => {
5859
notificationCount += 1;
5960
return await task((progress) => progressUpdates.push(progress));
@@ -93,7 +94,7 @@ test("Sharp loader retries installation after a failure", async () => {
9394
{
9495
workspaceRoot: storageRoot,
9596
storageRoot,
96-
sharpVersion: "0.34.5",
97+
sharpVersion: SHARP_VERSION,
9798
notifyInstalling: async (task) => await task(() => {}),
9899
},
99100
{
@@ -115,9 +116,19 @@ test("Sharp loader retries installation after a failure", async () => {
115116
});
116117

117118
test("Sharp install uses the npm mirror", () => {
118-
const args = buildSharpInstallArgs("/tmp/sharp", "0.34.5");
119+
const args = buildSharpInstallArgs("/tmp/sharp", SHARP_VERSION);
119120

120-
assert.deepEqual(args.slice(-5), ["--registry", TENCENT_MIRROR_REGISTRY, "--prefix", "/tmp/sharp", "sharp@0.34.5"]);
121+
assert.deepEqual(args.slice(-5), [
122+
"--registry",
123+
TENCENT_MIRROR_REGISTRY,
124+
"--prefix",
125+
"/tmp/sharp",
126+
`sharp@${SHARP_VERSION}`,
127+
]);
128+
});
129+
130+
test("Sharp tests run against the declared dependency version", () => {
131+
assert.equal(sharp.versions.sharp, SHARP_VERSION);
121132
});
122133

123134
function createTempDir(prefix: string): string {

‎scripts/esbuild-vscode.config.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const entry = join(vscodeRoot, "src", "extension.ts");
1212
const outDir = join(vscodeRoot, "out");
1313
const outfile = join(outDir, "extension.js");
1414
const resolveFromExtension = createRequire(join(vscodeRoot, "package.json"));
15-
const sharpPackage = JSON.parse(readFileSync(resolveFromExtension.resolve("sharp/package.json"), "utf8"));
15+
const sharpEntry = resolveFromExtension.resolve("sharp");
16+
const sharpPackage = JSON.parse(readFileSync(join(dirname(sharpEntry), "..", "package.json"), "utf8"));
1617

1718
rmSync(outDir, { recursive: true, force: true });
1819

0 commit comments

Comments
 (0)