@renoxium/sdk 0.1.1 → 0.1.2

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/test.d.ts CHANGED
@@ -114,8 +114,9 @@ export declare function app(options?: {
114
114
  }): Promise<TestApp>;
115
115
  /**
116
116
  * The page's HTML without what changes per request (request id, deployment,
117
- * nonces, CSRF tokens, session ids), matched against the snapshot named by
118
- * `role`. Returns the normalized HTML.
117
+ * nonces, CSRF tokens, session ids, and the content hash `renox build` puts
118
+ * in the names of linked public files: `/app.<hash>.css`), matched against
119
+ * the snapshot named by `role`. Returns the normalized HTML.
119
120
  */
120
121
  export declare function snapshot(html: string, options: {
121
122
  role: string;
package/dist/test.js CHANGED
@@ -292,8 +292,9 @@ export async function app(options = {}) {
292
292
  }
293
293
  /**
294
294
  * The page's HTML without what changes per request (request id, deployment,
295
- * nonces, CSRF tokens, session ids), matched against the snapshot named by
296
- * `role`. Returns the normalized HTML.
295
+ * nonces, CSRF tokens, session ids, and the content hash `renox build` puts
296
+ * in the names of linked public files: `/app.<hash>.css`), matched against
297
+ * the snapshot named by `role`. Returns the normalized HTML.
297
298
  */
298
299
  export function snapshot(html, options) {
299
300
  const normalized = html
@@ -304,7 +305,8 @@ export function snapshot(html, options) {
304
305
  .replace(/(value=")[^"]*("[^>]*name="_csrf")/gu, "$1<csrf>$2")
305
306
  .replace(/("x-renox-csrf"\s*:\s*")[^"]*/gu, "$1<csrf>")
306
307
  .replace(/\b[0-9A-HJKMNP-TV-Z]{26}\b/gu, "<ulid>")
307
- .replace(/(\?v=)[0-9a-f]{16}/gu, "$1<version>");
308
+ .replace(/(\?v=)[0-9a-f]{16}/gu, "$1<version>")
309
+ .replace(/(["']\/[^"'\s]*\.)[0-9a-f]{16}(\.[A-Za-z0-9]+["'])/gu, "$1<hash>$2");
308
310
  expect(normalized).toMatchSnapshot(`role: ${options.role}`);
309
311
  return normalized;
310
312
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@renoxium/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Types and helpers for Renox tenant code: ctx (db, fetch, secrets, log, deadline), handlers, pages, modules, errors, test fakes",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/arif-rachim/renox.rs/tree/main/sdk",