From 0855d64d535b0094b2b47bf06abef3355c1957cf Mon Sep 17 00:00:00 2001 From: callumalpass Date: Sun, 2 Aug 2026 18:46:13 +1000 Subject: [PATCH] Package attachment helpers in model rc.8 --- package-lock.json | 4 ++-- package.json | 2 +- scripts/build.mjs | 1 + scripts/smoke-package.mjs | 10 ++++++++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 222a970..4770cce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tasknotes/model", - "version": "0.3.0-rc.7", + "version": "0.3.0-rc.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@tasknotes/model", - "version": "0.3.0-rc.7", + "version": "0.3.0-rc.8", "license": "MIT", "dependencies": { "rrule": "^2.8.1", diff --git a/package.json b/package.json index 63eb66f..033e159 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tasknotes/model", - "version": "0.3.0-rc.7", + "version": "0.3.0-rc.8", "description": "TaskNotes model, mapping, validation, recurrence, and operation-planning reference implementation.", "license": "MIT", "type": "module", diff --git a/scripts/build.mjs b/scripts/build.mjs index 3ed60b7..3455f9f 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -7,6 +7,7 @@ const entries = [ "defaults", "config", "date", + "attachments", "mapping", "schema", "recurrence", diff --git a/scripts/smoke-package.mjs b/scripts/smoke-package.mjs index 8d7b4e3..507cc44 100644 --- a/scripts/smoke-package.mjs +++ b/scripts/smoke-package.mjs @@ -36,6 +36,14 @@ try { join(tempRoot, "cjs.cjs"), 'const model = require("@tasknotes/model");\nif (Object.keys(model).length === 0) throw new Error("CJS export is empty");\n', ); + writeFileSync( + join(tempRoot, "attachments.mjs"), + 'import { canonicalAttachmentReference } from "@tasknotes/model/attachments";\nif (canonicalAttachmentReference("Attachments/image.png") !== "[[Attachments/image.png]]") throw new Error("ESM attachment export is unavailable");\n', + ); + writeFileSync( + join(tempRoot, "attachments.cjs"), + 'const { canonicalAttachmentReference } = require("@tasknotes/model/attachments");\nif (canonicalAttachmentReference("Attachments/image.png") !== "[[Attachments/image.png]]") throw new Error("CJS attachment export is unavailable");\n', + ); runNpm(["install", "--ignore-scripts", tarball], { cwd: tempRoot, @@ -43,6 +51,8 @@ try { }); execFileSync(process.execPath, ["esm.mjs"], { cwd: tempRoot, stdio: "inherit" }); execFileSync(process.execPath, ["cjs.cjs"], { cwd: tempRoot, stdio: "inherit" }); + execFileSync(process.execPath, ["attachments.mjs"], { cwd: tempRoot, stdio: "inherit" }); + execFileSync(process.execPath, ["attachments.cjs"], { cwd: tempRoot, stdio: "inherit" }); } finally { if (tarball) rmSync(tarball, { force: true }); rmSync(tempRoot, { recursive: true, force: true });