Skip to content

Commit d7e540a

Browse files
sergicalclaude
andcommitted
fix(deno): Use npm: specifiers in deno.json instead of relative paths
Switches from relative file paths to npm: specifiers so Deno resolves @sentry/deno and @sentry/core via verdaccio (configured in .npmrc). Uses nodeModulesDir: "manual" so Deno shares pnpm's node_modules, avoiding duplicate OTel API instances and Playwright version conflicts. Removes the fixDenoJson() path-rewriting helper from copyToTemp.ts as it is no longer needed. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 90ad535 commit d7e540a

2 files changed

Lines changed: 4 additions & 39 deletions

File tree

dev-packages/e2e-tests/lib/copyToTemp.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export async function copyToTemp(originalPath: string, tmpDirPath: string): Prom
88
await cp(originalPath, tmpDirPath, { recursive: true });
99

1010
fixPackageJson(tmpDirPath);
11-
fixDenoJson(tmpDirPath);
1211
}
1312

1413
function fixPackageJson(cwd: string): void {
@@ -60,38 +59,3 @@ function fixFileLinkDependencies(dependencyObj: Record<string, string>): void {
6059
}
6160
}
6261
}
63-
64-
function fixDenoJson(cwd: string): void {
65-
const denoJsonPath = join(cwd, 'deno.json');
66-
67-
let raw: string;
68-
try {
69-
raw = readFileSync(denoJsonPath, 'utf8');
70-
} catch {
71-
return;
72-
}
73-
74-
const denoJson = JSON.parse(raw) as {
75-
imports?: Record<string, string>;
76-
};
77-
78-
if (!denoJson.imports) {
79-
return;
80-
}
81-
82-
let changed = false;
83-
for (const [key, value] of Object.entries(denoJson.imports)) {
84-
// Fix relative paths (not npm: or https: specifiers)
85-
if (value.startsWith('.') || value.startsWith('/')) {
86-
// Same virtual-dir trick as link: deps to get consistent relative depth
87-
const newPath = join(__dirname, 'virtual-dir/', value);
88-
denoJson.imports[key] = newPath;
89-
console.log(`Fixed deno.json import ${key} to ${newPath}`);
90-
changed = true;
91-
}
92-
}
93-
94-
if (changed) {
95-
writeFileSync(denoJsonPath, JSON.stringify(denoJson, null, 2));
96-
}
97-
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"imports": {
3-
"@sentry/deno": "../../../../packages/deno/build/esm/index.js",
4-
"@sentry/core": "../../../../packages/core/build/esm/index.js",
3+
"@sentry/deno": "npm:@sentry/deno",
4+
"@sentry/core": "npm:@sentry/core",
55
"@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0"
6-
}
6+
},
7+
"nodeModulesDir": "manual"
78
}

0 commit comments

Comments
 (0)