From e10eb52e6c6256b03918d5ba8aaaa2c2d94bd54c Mon Sep 17 00:00:00 2001 From: spacedevin Date: Mon, 31 Aug 2026 23:33:09 -0700 Subject: [PATCH] fix: declare @spacedevin/deck as a peer of both packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gen_block dialect registry is module-level mutable state (`let dialects = {}` in GenBlock.tish). A package that bundles its own copy of the language gives its consumer a second registry, so a dialect registered against one is invisible to the other — and because tish build inlines each import graph, it also collides every top-level symbol in the parser. That is not theoretical. Deckard's main went red with "Identifier 'normalizeGeneratorId' has already been declared" the moment it consumed the published synths package: its lockfile held deck 1.6.2 while deck-synths declared ^1.8.0, so pnpm kept both. Peer, so the consumer supplies the single instance. Kept as a devDependency (file:../..) so the workspace still links locally, and both CI pack steps now stamp the peer range and drop the dev link. Verified against a consumer pinned to the OLD range that caused the collision: one copy of the language on disk instead of two, and pnpm reports the skew as "unmet peer" at install rather than a duplicate that explodes at build. On the correct range: one copy, 968 assertions, 0 failures. Both suites here unchanged (8 language, 46 player). --- .github/workflows/ci.yml | 6 ++++-- package-lock.json | 6 ++++-- packages/player/package.json | 11 ++++++----- packages/synths/package.json | 9 +++++---- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9124cd..3837d96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -228,7 +228,8 @@ jobs: const fs = require("fs"), p = "./packages/synths/package.json"; const j = JSON.parse(fs.readFileSync(p, "utf8")); j.version = process.argv[1]; - j.dependencies["@spacedevin/deck"] = "^" + process.argv[1]; + j.peerDependencies["@spacedevin/deck"] = "^" + process.argv[1]; + delete j.devDependencies["@spacedevin/deck"]; fs.writeFileSync(p, JSON.stringify(j, null, 2) + "\n"); ' "${{ steps.gate.outputs.version }}" npm pack -w @spacedevin/deck-synths @@ -249,7 +250,8 @@ jobs: const fs = require("fs"), p = "./packages/player/package.json"; const j = JSON.parse(fs.readFileSync(p, "utf8")); j.version = process.argv[1]; - j.dependencies["@spacedevin/deck"] = "^" + process.argv[1]; + j.peerDependencies["@spacedevin/deck"] = "^" + process.argv[1]; + delete j.devDependencies["@spacedevin/deck"]; fs.writeFileSync(p, JSON.stringify(j, null, 2) + "\n"); ' "${{ steps.gate.outputs.version }}" npm pack -w @spacedevin/deck-player diff --git a/package-lock.json b/package-lock.json index 70fb51c..d5c9b38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1030,13 +1030,14 @@ "name": "@spacedevin/deck-player", "version": "0.1.0", "license": "MIT", - "dependencies": { + "devDependencies": { "@spacedevin/deck": "file:../.." }, "engines": { "node": ">=22" }, "peerDependencies": { + "@spacedevin/deck": "^1.8.0", "@tishlang/tish": ">=3.2.2" }, "peerDependenciesMeta": { @@ -1049,13 +1050,14 @@ "name": "@spacedevin/deck-synths", "version": "0.1.0", "license": "MIT", - "dependencies": { + "devDependencies": { "@spacedevin/deck": "file:../.." }, "engines": { "node": ">=22" }, "peerDependencies": { + "@spacedevin/deck": "^1.8.0", "@tishlang/tish": ">=3.2.2" }, "peerDependenciesMeta": { diff --git a/packages/player/package.json b/packages/player/package.json index 7f627da..653d243 100644 --- a/packages/player/package.json +++ b/packages/player/package.json @@ -2,7 +2,7 @@ "name": "@spacedevin/deck-player", "version": "0.1.0", "type": "module", - "description": "Web Audio player for the .deck language — chip-tune synths, transport, and a element", + "description": "Web Audio player for the .deck language \u2014 chip-tune synths, transport, and a element", "license": "MIT", "author": "spacedevin", "repository": { @@ -61,15 +61,16 @@ "gameboy", "gba" ], - "dependencies": { - "@spacedevin/deck": "file:../.." - }, "peerDependencies": { - "@tishlang/tish": ">=3.2.2" + "@tishlang/tish": ">=3.2.2", + "@spacedevin/deck": "^1.8.0" }, "peerDependenciesMeta": { "@tishlang/tish": { "optional": true } + }, + "devDependencies": { + "@spacedevin/deck": "file:../.." } } diff --git a/packages/synths/package.json b/packages/synths/package.json index aa6a8f4..1f12214 100644 --- a/packages/synths/package.json +++ b/packages/synths/package.json @@ -39,15 +39,16 @@ }, "main": "./dist/deck-synths.js", "module": "./dist/deck-synths.js", - "dependencies": { - "@spacedevin/deck": "file:../.." - }, "peerDependencies": { - "@tishlang/tish": ">=3.2.2" + "@tishlang/tish": ">=3.2.2", + "@spacedevin/deck": "^1.8.0" }, "peerDependenciesMeta": { "@tishlang/tish": { "optional": true } + }, + "devDependencies": { + "@spacedevin/deck": "file:../.." } }