@csszyx/runtime 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -111,7 +111,7 @@ function isValidManifest(manifest) {
111
111
  return false;
112
112
  }
113
113
  const m = manifest;
114
- return typeof m.buildId === "string" && typeof m.checksum === "string" && typeof m.tokens === "object" && m.tokens !== null;
114
+ return typeof m.buildId === "string" && typeof m.checksum === "string" && typeof m.mangleChecksum === "string" && typeof m.tokens === "object" && m.tokens !== null;
115
115
  }
116
116
  function verifyAllTokens(root, manifest) {
117
117
  const elements = root.querySelectorAll("[data-sz-recovery-token]");
@@ -228,7 +228,7 @@ function guardHydration(manifest) {
228
228
  if (typeof document === "undefined") {
229
229
  return true;
230
230
  }
231
- if (!verifyMangleChecksum(manifest.checksum)) {
231
+ if (!verifyMangleChecksum(manifest.mangleChecksum)) {
232
232
  const error = {
233
233
  type: "checksum_mismatch",
234
234
  message: "Mangle map checksum mismatch detected",
package/dist/index.d.cts CHANGED
@@ -235,6 +235,7 @@ interface TokenData {
235
235
  interface RecoveryManifest {
236
236
  buildId: string;
237
237
  checksum: string;
238
+ mangleChecksum: string;
238
239
  tokens: Record<string, TokenData>;
239
240
  }
240
241
  /**
@@ -449,7 +450,7 @@ declare function loadMangleMapFromDOM(): MangleMap | null;
449
450
  *
450
451
  * @example
451
452
  * ```typescript
452
- * if (!verifyMangleChecksum(manifest.checksum)) {
453
+ * if (!verifyMangleChecksum(manifest.mangleChecksum)) {
453
454
  * console.error('Checksum mismatch detected');
454
455
  * }
455
456
  * ```
package/dist/index.d.ts CHANGED
@@ -235,6 +235,7 @@ interface TokenData {
235
235
  interface RecoveryManifest {
236
236
  buildId: string;
237
237
  checksum: string;
238
+ mangleChecksum: string;
238
239
  tokens: Record<string, TokenData>;
239
240
  }
240
241
  /**
@@ -449,7 +450,7 @@ declare function loadMangleMapFromDOM(): MangleMap | null;
449
450
  *
450
451
  * @example
451
452
  * ```typescript
452
- * if (!verifyMangleChecksum(manifest.checksum)) {
453
+ * if (!verifyMangleChecksum(manifest.mangleChecksum)) {
453
454
  * console.error('Checksum mismatch detected');
454
455
  * }
455
456
  * ```
package/dist/index.js CHANGED
@@ -47,7 +47,7 @@ function isValidManifest(manifest) {
47
47
  return false;
48
48
  }
49
49
  const m = manifest;
50
- return typeof m.buildId === "string" && typeof m.checksum === "string" && typeof m.tokens === "object" && m.tokens !== null;
50
+ return typeof m.buildId === "string" && typeof m.checksum === "string" && typeof m.mangleChecksum === "string" && typeof m.tokens === "object" && m.tokens !== null;
51
51
  }
52
52
  function verifyAllTokens(root, manifest) {
53
53
  const elements = root.querySelectorAll("[data-sz-recovery-token]");
@@ -164,7 +164,7 @@ function guardHydration(manifest) {
164
164
  if (typeof document === "undefined") {
165
165
  return true;
166
166
  }
167
- if (!verifyMangleChecksum(manifest.checksum)) {
167
+ if (!verifyMangleChecksum(manifest.mangleChecksum)) {
168
168
  const error = {
169
169
  type: "checksum_mismatch",
170
170
  message: "Mangle map checksum mismatch detected",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/runtime",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Runtime helpers and hydration guards for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -39,8 +39,8 @@
39
39
  "dist"
40
40
  ],
41
41
  "dependencies": {
42
- "@csszyx/compiler": "0.6.0",
43
- "@csszyx/core": "0.6.0"
42
+ "@csszyx/compiler": "0.7.0",
43
+ "@csszyx/core": "0.7.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^20.11.0",