AI-native design editor. Open-source Figma alternative.
fix: let Playwright load the app constants and refresh two stale canvas baselines (#1418)
Danila Poyarkovffce1fc13757
diff --git a/src/constants.ts b/src/constants.tsindex 0eb0c29a8..4af52c124 100644--- a/src/constants.ts+++ b/src/constants.ts@@ -87,7 +87,8 @@ export const CLOUD_WAITLIST_URL = 'https://openpencil.dev/#cloud'* editor build names that deployment, such as staging.*/export const OFFICIAL_CLOUD_URL =- import.meta.env.VITE_OPENPENCIL_OFFICIAL_CLOUD_URL || 'https://cloud.openpencil.dev'+ (typeof __OPENPENCIL_OFFICIAL_CLOUD_URL__ === 'string' && __OPENPENCIL_OFFICIAL_CLOUD_URL__) ||+ 'https://cloud.openpencil.dev'/** Whether this is the editor a Cloud server serves on its own address (`bun run build:cloud`). */export const IS_CLOUD_SITE =typeof __OPENPENCIL_CLOUD_SITE__ === 'boolean' && __OPENPENCIL_CLOUD_SITE__diff --git a/src/env.d.ts b/src/env.d.tsindex 2d23bc072..8befd4c2a 100644--- a/src/env.d.ts+++ b/src/env.d.ts@@ -5,13 +5,13 @@interface ImportMetaEnv {/** `on` only in official release builds; without it the app sends no pings or usage stats. */readonly VITE_OPENPENCIL_FEEDBACK?: string- /** The official Cloud server's address, set by the build an official deployment serves. */- readonly VITE_OPENPENCIL_OFFICIAL_CLOUD_URL?: string}declare const __OPENPENCIL_APP_VERSION__: string/** Whether this is the editor a Cloud server serves on its own address (`bun run build:cloud`). */declare const __OPENPENCIL_CLOUD_SITE__: boolean+/** `VITE_OPENPENCIL_OFFICIAL_CLOUD_URL`: the official Cloud server an official deployment's build names. */+declare const __OPENPENCIL_OFFICIAL_CLOUD_URL__: string | nulldeclare const __OPENPENCIL_LOCAL_AUTOMATION_TOKEN__: string | nulldeclare const __OPENPENCIL_LOCAL_AUTOMATION_URL__: stringdeclare const __OPENPENCIL_LOCAL_AUTOMATION_HTTP_URL__: stringdiff --git a/tests/e2e/canvas/arrow-caps-visual.spec.ts-snapshots/arrow-stroke-caps-openpencil-darwin.png b/tests/e2e/canvas/arrow-caps-visual.spec.ts-snapshots/arrow-stroke-caps-openpencil-darwin.pngindex ba5350010..73db8426a 100644Binary files a/tests/e2e/canvas/arrow-caps-visual.spec.ts-snapshots/arrow-stroke-caps-openpencil-darwin.png and b/tests/e2e/canvas/arrow-caps-visual.spec.ts-snapshots/arrow-stroke-caps-openpencil-darwin.png differdiff --git a/tests/e2e/canvas/pattern-mask-visual.spec.ts-snapshots/luminance-masks-and-transformed-tile-fills-openpencil-darwin.png b/tests/e2e/canvas/pattern-mask-visual.spec.ts-snapshots/luminance-masks-and-transformed-tile-fills-openpencil-darwin.pngindex 275d16e21..de4b805b8 100644Binary files a/tests/e2e/canvas/pattern-mask-visual.spec.ts-snapshots/luminance-masks-and-transformed-tile-fills-openpencil-darwin.png and b/tests/e2e/canvas/pattern-mask-visual.spec.ts-snapshots/luminance-masks-and-transformed-tile-fills-openpencil-darwin.png differdiff --git a/vite.config.ts b/vite.config.tsindex ce8336fdd..8158488e5 100644--- a/vite.config.ts+++ b/vite.config.ts@@ -36,8 +36,9 @@ export default defineConfig(async ({ command, mode }) => {// `--mode metrics` builds only the metrics dashboard (`metrics.html`) for the feedback Worker,// which serves it under /admin behind Cloudflare Access.const metrics = mode === 'metrics'+ const env = loadEnv(mode, __dirname, 'VITE_')// `VITE_OPENPENCIL_CLOUD=off` builds the editor without OpenPencil Cloud.- const cloud = loadEnv(mode, __dirname, 'VITE_').VITE_OPENPENCIL_CLOUD !== 'off'+ const cloud = env.VITE_OPENPENCIL_CLOUD !== 'off'await Promise.all([ensureBrandAssets(['web']), metrics ? undefined : ensureDemoDocument()])return {resolve: {@@ -46,6 +47,9 @@ export default defineConfig(async ({ command, mode }) => {define: {__OPENPENCIL_APP_VERSION__: JSON.stringify(packageJson.version),__OPENPENCIL_CLOUD_SITE__: JSON.stringify(cloudSite),+ __OPENPENCIL_OFFICIAL_CLOUD_URL__: JSON.stringify(+ env.VITE_OPENPENCIL_OFFICIAL_CLOUD_URL ?? null+ ),__OPENPENCIL_LOCAL_AUTOMATION_TOKEN__: JSON.stringify(localAutomationToken(command)),__OPENPENCIL_LOCAL_AUTOMATION_URL__: JSON.stringify(automationRoute.browserURL),__OPENPENCIL_LOCAL_AUTOMATION_HTTP_URL__: JSON.stringify(