From bc9e36d024c90a53c515a5bbb9c4760dcc8118bc Mon Sep 17 00:00:00 2001 From: Ryan Ramage Date: Sun, 24 Aug 2025 10:31:49 -0600 Subject: [PATCH] FIX: Hyperdispath.from in normal rebuild does not set offset in opts --- .gitignore | 3 +++ builder.cjs | 2 +- package.json | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c6bba59..ee50711 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,6 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* + +# example.js spec folder +/spec diff --git a/builder.cjs b/builder.cjs index 91911a5..22234c4 100644 --- a/builder.cjs +++ b/builder.cjs @@ -22,7 +22,7 @@ class HyperdispatchNamespace { module.exports = class Hyperdispatch { constructor (schema, dispatchJson, { offset, dispatchDir = null, schemaDir = null } = {}) { - if (dispatchJson && dispatchJson.offset !== offset) { + if (dispatchJson && offset && dispatchJson.offset !== offset) { throw new Error('Cannot change the hyperdispatch offset once it has been defined once') } this.schema = schema diff --git a/package.json b/package.json index afe99d6..874e0a0 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ } }, "scripts": { - "test": "standard && brittle test/index.js" + "test": "standard && brittle test/index.js && npm run example:rebuild", + "example:rebuild": "node example.js && node example.js" }, "repository": { "type": "git",