Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -1,9 +1,10 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "vitest";
|
||||
|
||||
const scriptSource = fs.readFileSync(path.join(path.dirname(new URL(import.meta.url).pathname), "build-web-server.mjs"), "utf8");
|
||||
const scriptSource = fs.readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), "build-web-server.mjs"), "utf8");
|
||||
|
||||
describe("build-web-server", () => {
|
||||
it("bundles the server entrypoint into the production runtime artifact", () => {
|
||||
@@ -11,10 +12,18 @@ describe("build-web-server", () => {
|
||||
assert.match(scriptSource, /build\/server-runtime\/server\.js/);
|
||||
});
|
||||
|
||||
it("precompresses emitted client assets at build time", () => {
|
||||
assert.match(scriptSource, /precompressWebAssets/);
|
||||
assert.match(scriptSource, /pruneUnreferencedDuplicateCss/);
|
||||
assert.match(scriptSource, /clientBuildDirectory,\s*["']assets["']/);
|
||||
assert.match(scriptSource, /\["build", "build-portal"\]/);
|
||||
assert.match(scriptSource, /apps["'],\s*["']web["'],\s*buildDirectory,\s*["']client/);
|
||||
});
|
||||
|
||||
it("pins a Node ESM esbuild output instead of a runtime tsx command", () => {
|
||||
assert.match(scriptSource, /platform:\s*"node"/);
|
||||
assert.match(scriptSource, /format:\s*"esm"/);
|
||||
assert.match(scriptSource, /target:\s*"node20"/);
|
||||
assert.match(scriptSource, /target:\s*"node24"/);
|
||||
assert.match(scriptSource, /sourcemap:\s*buildSourcemapsEnabled/);
|
||||
assert.match(scriptSource, /logLevel:\s*"warning"/);
|
||||
assert.doesNotMatch(scriptSource, /tsx/);
|
||||
@@ -28,11 +37,20 @@ describe("build-web-server", () => {
|
||||
assert.doesNotMatch(scriptSource, /sourcemap:\s*true/);
|
||||
});
|
||||
|
||||
it("embeds the public browser endpoints used by the authenticated CSP", () => {
|
||||
assert.match(scriptSource, /VITE_SENTRY_DSN_WEB/);
|
||||
assert.match(scriptSource, /VITE_OTEL_EXPORTER_OTLP_ENDPOINT/);
|
||||
assert.match(scriptSource, /VITE_HOCUSPOCUS_URL/);
|
||||
assert.match(scriptSource, /define:\s*browserCspBuildEnvDefines/);
|
||||
});
|
||||
|
||||
it("keeps runtime packages external to avoid bundling browser or native assets", () => {
|
||||
assert.match(scriptSource, /externalizeRuntimeDependencies/);
|
||||
assert.match(scriptSource, /plugins:\s*\[externalizeRuntimeDependencies\]/);
|
||||
assert.match(scriptSource, /function isExternalRuntimePackage/);
|
||||
assert.match(scriptSource, /specifier === "react-router"/);
|
||||
assert.match(scriptSource, /specifier === "@prisma\/adapter-pg"/);
|
||||
assert.match(scriptSource, /specifier === "pg"/);
|
||||
assert.doesNotMatch(scriptSource, /packages:\s*"external"/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user