diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d5d82b12..f39d98e2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,7 @@ on: push: tags: - "json-document-v*-rc.*" + - "json-document-extensions-v*-rc.*" permissions: contents: read @@ -30,7 +31,8 @@ jobs: node-version: "24" registry-url: "https://registry.npmjs.org" package-manager-cache: false - - name: Verify prerelease identity + - name: Verify core prerelease identity + if: startsWith(github.ref_name, 'json-document-v') env: RELEASE_TAG: ${{ github.ref_name }} run: | @@ -48,7 +50,81 @@ jobs: throw new Error("publishConfig.tag must remain next for prereleases"); } ' + - name: Verify extension prerelease identity + if: startsWith(github.ref_name, 'json-document-extensions-v') + env: + RELEASE_TAG: ${{ github.ref_name }} + run: | + node --input-type=module --eval ' + import { readFileSync } from "node:fs"; + const packagePaths = [ + "packages/grouping/package.json", + "packages/patch-preview/package.json", + "packages/search-replace/package.json", + ]; + const expectedNames = [ + "@interactive-os/json-document-grouping", + "@interactive-os/json-document-patch-preview", + "@interactive-os/json-document-search-replace", + ]; + const packages = packagePaths.map((path) => + JSON.parse(readFileSync(path, "utf8")) + ); + const versions = new Set(packages.map((pkg) => pkg.version)); + if (versions.size !== 1) { + throw new Error("extension prerelease versions must match"); + } + const [version] = versions; + const expectedTag = `json-document-extensions-v${version}`; + if (process.env.RELEASE_TAG !== expectedTag) { + throw new Error(`release tag ${process.env.RELEASE_TAG} does not match ${expectedTag}`); + } + if (!/^\d+\.\d+\.\d+-rc\.\d+$/.test(version)) { + throw new Error(`extension version is not an rc prerelease: ${version}`); + } + for (const [index, pkg] of packages.entries()) { + if (pkg.name !== expectedNames[index]) { + throw new Error(`${packagePaths[index]} has unexpected name ${pkg.name}`); + } + if (pkg.publishConfig?.tag !== "next") { + throw new Error(`${pkg.name} publishConfig.tag must remain next`); + } + if (pkg.publishConfig?.access !== "public" || pkg.publishConfig?.provenance !== true) { + throw new Error(`${pkg.name} must publish publicly with provenance`); + } + if (pkg.peerDependencies?.["@interactive-os/json-document"] !== "^1.0.1 || ^1.1.0-rc.0") { + throw new Error(`${pkg.name} does not accept the core integration RC`); + } + } + ' - name: Install dependencies run: npm ci --no-audit --no-fund - - name: Publish prerelease + - name: Verify extension prereleases + if: startsWith(github.ref_name, 'json-document-extensions-v') + run: | + version=$(node -p 'require("./packages/grouping/package.json").version') + for package in \ + @interactive-os/json-document-grouping \ + @interactive-os/json-document-patch-preview \ + @interactive-os/json-document-search-replace + do + if npm view "$package@$version" version >/dev/null 2>&1; then + echo "::error::$package@$version is already published" + exit 1 + fi + npm run verify -w "$package" + npm pack -w "$package" --dry-run --cache "${RUNNER_TEMP}/npm-cache" + done + - name: Publish core prerelease + if: startsWith(github.ref_name, 'json-document-v') run: npm publish -w @interactive-os/json-document --tag next --provenance + - name: Publish extension prereleases + if: startsWith(github.ref_name, 'json-document-extensions-v') + run: | + for package in \ + @interactive-os/json-document-grouping \ + @interactive-os/json-document-patch-preview \ + @interactive-os/json-document-search-replace + do + npm publish -w "$package" --tag next --provenance + done diff --git a/apps/site/src/generated/repo-catalog.ts b/apps/site/src/generated/repo-catalog.ts index 32b5f26a..dccd4156 100644 --- a/apps/site/src/generated/repo-catalog.ts +++ b/apps/site/src/generated/repo-catalog.ts @@ -310,7 +310,7 @@ export const repoCatalog = { "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official structural group and ungroup extension functions for json-document documents.", "license": "MIT", "summary": "Official extension for structural `group` and `ungroup`.", @@ -628,7 +628,7 @@ export const repoCatalog = { "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official patch preview extension functions for dry-running json-document document patches.", "license": "MIT", "summary": "Official headless patch preview extension for `@interactive-os/json-document` documents.", @@ -835,7 +835,7 @@ export const repoCatalog = { "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official search and replace extension functions for text fields in json-document documents.", "license": "MIT", "summary": "Official headless search and replace extension for text fields in `@interactive-os/json-document`\ndocuments.", @@ -1219,7 +1219,7 @@ export const repoCatalog = { "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official structural group and ungroup extension functions for json-document documents.", "license": "MIT", "summary": "Official extension for structural `group` and `ungroup`.", @@ -1372,7 +1372,7 @@ export const repoCatalog = { "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official patch preview extension functions for dry-running json-document document patches.", "license": "MIT", "summary": "Official headless patch preview extension for `@interactive-os/json-document` documents.", @@ -1579,7 +1579,7 @@ export const repoCatalog = { "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official search and replace extension functions for text fields in json-document documents.", "license": "MIT", "summary": "Official headless search and replace extension for text fields in `@interactive-os/json-document`\ndocuments.", diff --git a/docs/changelog.md b/docs/changelog.md index b5162498..ea42b915 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -17,6 +17,16 @@ The unified mutation success result described below changes the runtime shape published in `1.0.1`. Treat it as an integration experiment, not a stable 1.x compatibility promise. Its final shape must be decided before a stable release. +Companion integration prereleases are published under the `next` dist-tag for +`@interactive-os/json-document-grouping`, +`@interactive-os/json-document-patch-preview`, and +`@interactive-os/json-document-search-replace` at `0.1.1-rc.0`. They keep their +stable `0.1.0` APIs and expand the core peer range to +`^1.0.1 || ^1.1.0-rc.0`, allowing `canvas` to exercise a registry-only RC graph. +The grouping RC also commits its documented `selectionAfter` atomically with +the structural patch, so undo and redo restore the matching selection state. +Each companion RC tarball now includes the repository MIT license text. + ### Added - Added `doc.query(jsonpath)` and `doc.canQuery(jsonpath)` as the canonical diff --git a/docs/generated/repo-catalog.json b/docs/generated/repo-catalog.json index 110c01fb..e4f32cc3 100644 --- a/docs/generated/repo-catalog.json +++ b/docs/generated/repo-catalog.json @@ -309,7 +309,7 @@ "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official structural group and ungroup extension functions for json-document documents.", "license": "MIT", "summary": "Official extension for structural `group` and `ungroup`.", @@ -627,7 +627,7 @@ "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official patch preview extension functions for dry-running json-document document patches.", "license": "MIT", "summary": "Official headless patch preview extension for `@interactive-os/json-document` documents.", @@ -834,7 +834,7 @@ "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official search and replace extension functions for text fields in json-document documents.", "license": "MIT", "summary": "Official headless search and replace extension for text fields in `@interactive-os/json-document`\ndocuments.", @@ -1218,7 +1218,7 @@ "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official structural group and ungroup extension functions for json-document documents.", "license": "MIT", "summary": "Official extension for structural `group` and `ungroup`.", @@ -1371,7 +1371,7 @@ "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official patch preview extension functions for dry-running json-document document patches.", "license": "MIT", "summary": "Official headless patch preview extension for `@interactive-os/json-document` documents.", @@ -1578,7 +1578,7 @@ "status": "official-extension", "private": false, "publishable": true, - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official search and replace extension functions for text fields in json-document documents.", "license": "MIT", "summary": "Official headless search and replace extension for text fields in `@interactive-os/json-document`\ndocuments.", diff --git a/docs/public/extensions.md b/docs/public/extensions.md index 75225ba3..7158829a 100644 --- a/docs/public/extensions.md +++ b/docs/public/extensions.md @@ -12,6 +12,20 @@ Extension은 core에 plugin으로 등록하지 않습니다. public `JSONDocumen npm install @interactive-os/json-document @interactive-os/json-document-collection ``` +`1.1.0-rc.0` integration testing uses exact versions and the `next` dist-tag. +The companion RC set for `canvas` is: + +```sh +npm install --save-exact \ + @interactive-os/json-document@1.1.0-rc.0 \ + @interactive-os/json-document-grouping@0.1.1-rc.0 \ + @interactive-os/json-document-patch-preview@0.1.1-rc.0 \ + @interactive-os/json-document-search-replace@0.1.1-rc.0 +``` + +This RC set is an opt-in integration graph. Stable consumers continue to use +the packages' `latest` dist-tags. + ## 공식 extension 공식 extension 목록과 lab 후보 목록은 repo catalog에서 생성됩니다. `packages/*`에 있는 publishable `@interactive-os/json-document-*` package가 공식 extension이고, `labs/extensions/*`는 후보입니다. public 문서에서 lab package를 공식 extension이라고 부르지 않습니다. diff --git a/package-lock.json b/package-lock.json index a0af3e31..268db736 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6529,7 +6529,7 @@ }, "packages/grouping": { "name": "@interactive-os/json-document-grouping", - "version": "0.1.0", + "version": "0.1.1-rc.0", "license": "MIT", "devDependencies": { "@interactive-os/json-document": "*", @@ -6538,7 +6538,7 @@ "zod": "^4.0.0" }, "peerDependencies": { - "@interactive-os/json-document": "^1.0.0" + "@interactive-os/json-document": "^1.0.1 || ^1.1.0-rc.0" } }, "packages/id-resolver": { @@ -6609,7 +6609,7 @@ }, "packages/patch-preview": { "name": "@interactive-os/json-document-patch-preview", - "version": "0.1.0", + "version": "0.1.1-rc.0", "license": "MIT", "devDependencies": { "@interactive-os/json-document": "*", @@ -6618,7 +6618,7 @@ "zod": "^4.0.0" }, "peerDependencies": { - "@interactive-os/json-document": "^1.0.0" + "@interactive-os/json-document": "^1.0.1 || ^1.1.0-rc.0" } }, "packages/persist-web": { @@ -6679,7 +6679,7 @@ }, "packages/search-replace": { "name": "@interactive-os/json-document-search-replace", - "version": "0.1.0", + "version": "0.1.1-rc.0", "license": "MIT", "devDependencies": { "@interactive-os/json-document": "*", @@ -6688,7 +6688,7 @@ "zod": "^4.0.0" }, "peerDependencies": { - "@interactive-os/json-document": "^1.0.0" + "@interactive-os/json-document": "^1.0.1 || ^1.1.0-rc.0" } }, "packages/snippets": { diff --git a/packages/grouping/LICENSE b/packages/grouping/LICENSE new file mode 100644 index 00000000..334271fb --- /dev/null +++ b/packages/grouping/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 json-document contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/grouping/README.md b/packages/grouping/README.md index 917e0d7d..347bd0cd 100644 --- a/packages/grouping/README.md +++ b/packages/grouping/README.md @@ -2,6 +2,10 @@ Official extension for structural `group` and `ungroup`. +> `0.1.1-rc.0` is a companion prerelease for +> `@interactive-os/json-document@1.1.0-rc.0`. Pin both versions exactly while +> the core mutation result contract is under integration testing. + ## Scope - select contiguous sibling JSON array items diff --git a/packages/grouping/package.json b/packages/grouping/package.json index c8eeb946..402eb279 100644 --- a/packages/grouping/package.json +++ b/packages/grouping/package.json @@ -1,6 +1,6 @@ { "name": "@interactive-os/json-document-grouping", - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official structural group and ungroup extension functions for json-document documents.", "type": "module", "license": "MIT", @@ -15,7 +15,8 @@ "publishConfig": { "access": "public", "provenance": true, - "registry": "https://registry.npmjs.org/" + "registry": "https://registry.npmjs.org/", + "tag": "next" }, "keywords": [ "@interactive-os/json-document", @@ -42,7 +43,7 @@ "verify": "npm run typecheck && npm test && npm run build" }, "peerDependencies": { - "@interactive-os/json-document": "^1.0.0" + "@interactive-os/json-document": "^1.0.1 || ^1.1.0-rc.0" }, "devDependencies": { "typescript": "^5.0.0", diff --git a/packages/grouping/tests/grouping.test.ts b/packages/grouping/tests/grouping.test.ts index 34b4951d..9ba9f0e0 100644 --- a/packages/grouping/tests/grouping.test.ts +++ b/packages/grouping/tests/grouping.test.ts @@ -60,6 +60,22 @@ function createBoard() { }); } +function createSelectableBoard() { + return createJSONDocument(BoardSchema, { + nodes: [ + { id: "a", kind: "item", title: "Alpha" }, + { id: "b", kind: "item", title: "Beta" }, + { id: "c", kind: "item", title: "Gamma" }, + ], + }, { + history: 10, + selection: { + mode: "multiple", + initial: ["/nodes/0", "/nodes/1"], + }, + }); +} + describe("@interactive-os/json-document-grouping", () => { test("groups selected sibling items into one schema-valid group", () => { const doc = createBoard(); @@ -108,6 +124,51 @@ describe("@interactive-os/json-document-grouping", () => { expect(doc.value.nodes.map((node) => node.id)).toEqual(["a", "b", "c"]); }); + test("commits grouped selection atomically through undo and redo", () => { + const doc = createSelectableBoard(); + + expect(groupSelection(doc, groupingAdapter, ["/nodes/0", "/nodes/1"])).toMatchObject({ + ok: true, + selectionAfter: ["/nodes/0"], + }); + expect(doc.value.nodes.map((node) => node.id)).toEqual(["group-0", "c"]); + expect(doc.selection?.selectedPointers).toEqual(["/nodes/0"]); + expect(doc.selection?.primaryPointer).toBe("/nodes/0"); + + expect(doc.undo()).toEqual({ ok: true }); + expect(doc.value.nodes.map((node) => node.id)).toEqual(["a", "b", "c"]); + expect(doc.selection?.selectedPointers).toEqual(["/nodes/0", "/nodes/1"]); + expect(doc.selection?.primaryPointer).toBe("/nodes/1"); + + expect(doc.redo()).toEqual({ ok: true }); + expect(doc.value.nodes.map((node) => node.id)).toEqual(["group-0", "c"]); + expect(doc.selection?.selectedPointers).toEqual(["/nodes/0"]); + expect(doc.selection?.primaryPointer).toBe("/nodes/0"); + }); + + test("commits ungrouped child selection atomically through undo and redo", () => { + const doc = createSelectableBoard(); + expect(groupSelection(doc, groupingAdapter, ["/nodes/0", "/nodes/1"])).toMatchObject({ ok: true }); + + expect(ungroupSelection(doc, groupingAdapter, "/nodes/0")).toMatchObject({ + ok: true, + selectionAfter: ["/nodes/0", "/nodes/1"], + }); + expect(doc.value.nodes.map((node) => node.id)).toEqual(["a", "b", "c"]); + expect(doc.selection?.selectedPointers).toEqual(["/nodes/0", "/nodes/1"]); + expect(doc.selection?.primaryPointer).toBe("/nodes/1"); + + expect(doc.undo()).toEqual({ ok: true }); + expect(doc.value.nodes.map((node) => node.id)).toEqual(["group-0", "c"]); + expect(doc.selection?.selectedPointers).toEqual(["/nodes/0"]); + expect(doc.selection?.primaryPointer).toBe("/nodes/0"); + + expect(doc.redo()).toEqual({ ok: true }); + expect(doc.value.nodes.map((node) => node.id)).toEqual(["a", "b", "c"]); + expect(doc.selection?.selectedPointers).toEqual(["/nodes/0", "/nodes/1"]); + expect(doc.selection?.primaryPointer).toBe("/nodes/1"); + }); + test("deduplicates selected pointers and prunes nested descendants before grouping", () => { const doc = createJSONDocument(BoardSchema, { nodes: [ diff --git a/packages/patch-preview/LICENSE b/packages/patch-preview/LICENSE new file mode 100644 index 00000000..334271fb --- /dev/null +++ b/packages/patch-preview/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 json-document contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/patch-preview/README.md b/packages/patch-preview/README.md index a9d7f080..c1510a6f 100644 --- a/packages/patch-preview/README.md +++ b/packages/patch-preview/README.md @@ -2,6 +2,10 @@ Official headless patch preview extension for `@interactive-os/json-document` documents. +> `0.1.1-rc.0` is a companion prerelease for +> `@interactive-os/json-document@1.1.0-rc.0`. Pin both versions exactly while +> the core mutation result contract is under integration testing. + Use it when a product needs to preview schema-safe JSON Patch changes before applying them: import review, find/replace confirmation, AI proposed changes, bulk cleanup, dry-run save checks, or admin moderation. diff --git a/packages/patch-preview/package.json b/packages/patch-preview/package.json index 343117f6..c79e2662 100644 --- a/packages/patch-preview/package.json +++ b/packages/patch-preview/package.json @@ -1,6 +1,6 @@ { "name": "@interactive-os/json-document-patch-preview", - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official patch preview extension functions for dry-running json-document document patches.", "type": "module", "license": "MIT", @@ -14,7 +14,8 @@ }, "publishConfig": { "access": "public", - "provenance": true + "provenance": true, + "tag": "next" }, "keywords": [ "@interactive-os/json-document", @@ -41,7 +42,7 @@ "verify": "npm run typecheck && npm test && npm run build" }, "peerDependencies": { - "@interactive-os/json-document": "^1.0.0" + "@interactive-os/json-document": "^1.0.1 || ^1.1.0-rc.0" }, "devDependencies": { "typescript": "^5.0.0", diff --git a/packages/search-replace/LICENSE b/packages/search-replace/LICENSE new file mode 100644 index 00000000..334271fb --- /dev/null +++ b/packages/search-replace/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 json-document contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/search-replace/README.md b/packages/search-replace/README.md index 75519291..5e66e985 100644 --- a/packages/search-replace/README.md +++ b/packages/search-replace/README.md @@ -3,6 +3,10 @@ Official headless search and replace extension for text fields in `@interactive-os/json-document` documents. +> `0.1.1-rc.0` is a companion prerelease for +> `@interactive-os/json-document@1.1.0-rc.0`. Pin both versions exactly while +> the core mutation result contract is under integration testing. + Use it when a product needs document-wide or subtree text search over JSON string fields: block documents, CMS copy review, generated admin editors, slide notes, import cleanup, or settings search. diff --git a/packages/search-replace/package.json b/packages/search-replace/package.json index 78715745..7354bf9f 100644 --- a/packages/search-replace/package.json +++ b/packages/search-replace/package.json @@ -1,6 +1,6 @@ { "name": "@interactive-os/json-document-search-replace", - "version": "0.1.0", + "version": "0.1.1-rc.0", "description": "Official search and replace extension functions for text fields in json-document documents.", "type": "module", "license": "MIT", @@ -15,7 +15,8 @@ "publishConfig": { "access": "public", "provenance": true, - "registry": "https://registry.npmjs.org/" + "registry": "https://registry.npmjs.org/", + "tag": "next" }, "keywords": [ "@interactive-os/json-document", @@ -42,7 +43,7 @@ "verify": "npm run typecheck && npm test && npm run build" }, "peerDependencies": { - "@interactive-os/json-document": "^1.0.0" + "@interactive-os/json-document": "^1.0.1 || ^1.1.0-rc.0" }, "devDependencies": { "typescript": "^5.0.0", diff --git a/scripts/evaluate-extensions.mjs b/scripts/evaluate-extensions.mjs index b9f965f9..026d47f6 100644 --- a/scripts/evaluate-extensions.mjs +++ b/scripts/evaluate-extensions.mjs @@ -2,6 +2,10 @@ import { existsSync, readdirSync, readFileSync } from "node:fs"; import { join } from "node:path"; const root = new URL("..", import.meta.url).pathname; +const corePeerRanges = new Set([ + "^1.0.0", + "^1.0.1 || ^1.1.0-rc.0", +]); const officialExtensions = [ { root: "packages/clipboard-web", @@ -303,8 +307,8 @@ for (const extension of officialExtensions) { if (pkg.private === true) { fail(`${label}: official extension packages must be publishable.`); } - if (pkg.peerDependencies?.["@interactive-os/json-document"] !== "^1.0.0") { - fail(`${label}: json-document must stay a peer dependency.`); + if (!corePeerRanges.has(pkg.peerDependencies?.["@interactive-os/json-document"])) { + fail(`${label}: json-document must stay an approved peer dependency range.`); } if (pkg.dependencies?.["@interactive-os/json-document"]) { fail(`${label}: json-document must not be a runtime dependency.`);