From ce4d7dd7621a10fe29a6cc70070e6663bae6bf1a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 12 Nov 2026 01:58:00 +0000 Subject: [PATCH] chore(packages): add publish metadata and npm pack lint Add license, repository, and description to all seven package manifests without touching versions. scripts/check-pack.mjs runs npm pack --dry-run on each package and asserts LICENSE, README.md, dist/index.js, plus pages/ and components/ for @shellside/site. Co-authored-by: Charles Berret --- packages/console-engine/package.json | 7 +++ packages/console-vfs/package.json | 7 +++ packages/content-model/package.json | 7 +++ packages/dev-api/package.json | 7 +++ packages/edit-protocol/package.json | 7 +++ packages/look/package.json | 7 +++ packages/site/package.json | 7 +++ scripts/check-pack.mjs | 79 ++++++++++++++++++++++++++++ 8 files changed, 128 insertions(+) create mode 100644 scripts/check-pack.mjs diff --git a/packages/console-engine/package.json b/packages/console-engine/package.json index 2c65a80..7002e75 100644 --- a/packages/console-engine/package.json +++ b/packages/console-engine/package.json @@ -1,6 +1,13 @@ { "name": "@shellside/console-engine", "version": "0.1.0", + "description": "Console terminal runner with filesystem and filter commands.", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/charlesberret/shellside.git", + "directory": "packages/console-engine" + }, "private": true, "type": "module", "exports": { diff --git a/packages/console-vfs/package.json b/packages/console-vfs/package.json index e48a6b8..8902836 100644 --- a/packages/console-vfs/package.json +++ b/packages/console-vfs/package.json @@ -1,6 +1,13 @@ { "name": "@shellside/console-vfs", "version": "0.1.0", + "description": "Project public collections into a virtual filesystem for the console.", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/charlesberret/shellside.git", + "directory": "packages/console-vfs" + }, "private": true, "type": "module", "main": "./dist/index.js", diff --git a/packages/content-model/package.json b/packages/content-model/package.json index e9aef3b..e41e34c 100644 --- a/packages/content-model/package.json +++ b/packages/content-model/package.json @@ -1,6 +1,13 @@ { "name": "@shellside/content-model", "version": "0.1.0", + "description": "Visibility contract and shared schemas for Shellside content collections.", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/charlesberret/shellside.git", + "directory": "packages/content-model" + }, "private": true, "type": "module", "main": "./dist/index.js", diff --git a/packages/dev-api/package.json b/packages/dev-api/package.json index cdff59a..2d1bf6e 100644 --- a/packages/dev-api/package.json +++ b/packages/dev-api/package.json @@ -1,6 +1,13 @@ { "name": "@shellside/dev-api", "version": "0.1.0", + "description": "DEV-only editorial desk write API and content persistence layer.", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/charlesberret/shellside.git", + "directory": "packages/dev-api" + }, "private": true, "type": "module", "main": "./dist/index.js", diff --git a/packages/edit-protocol/package.json b/packages/edit-protocol/package.json index 2de91dc..8a1ee1e 100644 --- a/packages/edit-protocol/package.json +++ b/packages/edit-protocol/package.json @@ -1,6 +1,13 @@ { "name": "@shellside/edit-protocol", "version": "0.1.0", + "description": "Editorial desk path grammar, field kinds, and preview-bridge contract.", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/charlesberret/shellside.git", + "directory": "packages/edit-protocol" + }, "private": true, "type": "module", "main": "./dist/index.js", diff --git a/packages/look/package.json b/packages/look/package.json index 7ea6050..b6310da 100644 --- a/packages/look/package.json +++ b/packages/look/package.json @@ -1,6 +1,13 @@ { "name": "@shellside/look", "version": "0.1.0", + "description": "Look roles, field-style maps, and filesystem design-token factories.", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/charlesberret/shellside.git", + "directory": "packages/look" + }, "private": true, "type": "module", "main": "./dist/index.js", diff --git a/packages/site/package.json b/packages/site/package.json index a18709f..00b9eab 100644 --- a/packages/site/package.json +++ b/packages/site/package.json @@ -1,6 +1,13 @@ { "name": "@shellside/site", "version": "0.1.0", + "description": "Config-driven Astro integration for dual-surface portfolio sites.", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/charlesberret/shellside.git", + "directory": "packages/site" + }, "private": true, "type": "module", "exports": { diff --git a/scripts/check-pack.mjs b/scripts/check-pack.mjs new file mode 100644 index 0000000..62a1281 --- /dev/null +++ b/scripts/check-pack.mjs @@ -0,0 +1,79 @@ +/** + * npm pack dry-run lint for all @shellside/* workspace packages. + * Run after `npm run build` so dist/ is present in each tarball. + */ +import { spawnSync } from "node:child_process"; +import { readFileSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); + +const PACKAGES = [ + "content-model", + "look", + "edit-protocol", + "dev-api", + "console-vfs", + "console-engine", + "site", +]; + +const REQUIRED_PATHS = ["LICENSE", "README.md", "dist/index.js"]; + +function fail(message) { + throw new Error(message); +} + +for (const dir of PACKAGES) { + const pkgRoot = path.join(root, "packages", dir); + const manifest = JSON.parse( + readFileSync(path.join(pkgRoot, "package.json"), "utf8"), + ); + + if (!manifest.license) fail(`${manifest.name}: missing license`); + if (!manifest.description) fail(`${manifest.name}: missing description`); + if (!manifest.repository) fail(`${manifest.name}: missing repository`); + + const repo = manifest.repository; + if (typeof repo !== "object" || repo === null) { + fail(`${manifest.name}: repository must be an object`); + } + if (repo.type !== "git") { + fail(`${manifest.name}: repository.type must be "git"`); + } + if (!String(repo.url).includes("github.com/charlesberret/shellside")) { + fail(`${manifest.name}: repository.url must point at charlesberret/shellside`); + } + if (repo.directory !== `packages/${dir}`) { + fail(`${manifest.name}: repository.directory must be packages/${dir}`); + } + + const pack = spawnSync("npm", ["pack", "--dry-run", "--json"], { + cwd: pkgRoot, + encoding: "utf8", + }); + if (pack.status !== 0) { + fail(`${manifest.name}: npm pack failed\n${pack.stderr || pack.stdout}`); + } + + const entry = JSON.parse(pack.stdout.trim())[0]; + const paths = new Set(entry.files.map((f) => f.path)); + + for (const need of REQUIRED_PATHS) { + if (!paths.has(need)) { + fail(`${manifest.name}: pack tarball missing ${need}`); + } + } + + if (dir === "site") { + const hasPages = [...paths].some((p) => p.startsWith("pages/")); + const hasComponents = [...paths].some((p) => p.startsWith("components/")); + if (!hasPages) fail(`${manifest.name}: pack tarball missing pages/`); + if (!hasComponents) fail(`${manifest.name}: pack tarball missing components/`); + } + + console.log(`check-pack: ${manifest.name} ok (${entry.entryCount} files)`); +} + +console.log("check-pack: ok");