Skip to content

Commit 5f4a728

Browse files
committed
fix(marketing): use namespace node imports in the screenshot script
1 parent 15a2136 commit 5f4a728

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

scripts/marketing-screenshot-capture.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
//
1010
// Pairing tokens are single-use, so this mints a fresh one per run. Never put a
1111
// pairing URL in a committed file or a screenshot.
12-
import { createRequire } from "node:module";
12+
import * as NodeModule from "node:module";
1313
import * as NodeChildProcess from "node:child_process";
1414
import * as NodeFSP from "node:fs/promises";
1515
import * as NodePath from "node:path";
16-
import * as NodeUrl from "node:url";
16+
import * as NodeURL from "node:url";
1717
import * as NodeUtil from "node:util";
1818

1919
const execFile = NodeUtil.promisify(NodeChildProcess.execFile);
20-
const repoRoot = NodePath.resolve(NodePath.dirname(NodeUrl.fileURLToPath(import.meta.url)), "..");
20+
const repoRoot = NodePath.resolve(NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)), "..");
2121

2222
// playwright-core is a direct dependency of apps/desktop, not of the root, so
2323
// resolve it from that package rather than guessing a pnpm store path.
24-
const require = createRequire(NodePath.join(repoRoot, "apps/desktop/package.json"));
24+
const require = NodeModule.createRequire(NodePath.join(repoRoot, "apps/desktop/package.json"));
2525
const { chromium } = require("playwright-core");
26-
const sharp = createRequire(NodePath.join(repoRoot, "package.json"))("sharp");
26+
const sharp = NodeModule.createRequire(NodePath.join(repoRoot, "package.json"))("sharp");
2727

2828
// 1254x841 CSS at deviceScaleFactor 2 lands exactly on the 2508x1682 the hero
2929
// <img> declares. Capturing at 1x and upscaling visibly softens the type.

0 commit comments

Comments
 (0)