Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 1 addition & 0 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const entries = [
"defaults",
"config",
"date",
"attachments",
"mapping",
"schema",
"recurrence",
Expand Down
10 changes: 10 additions & 0 deletions scripts/smoke-package.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,23 @@ 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,
stdio: "inherit",
});
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 });
Expand Down