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
7 changes: 7 additions & 0 deletions packages/console-engine/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
7 changes: 7 additions & 0 deletions packages/console-vfs/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions packages/content-model/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions packages/dev-api/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions packages/edit-protocol/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions packages/look/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions packages/site/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
79 changes: 79 additions & 0 deletions scripts/check-pack.mjs
Original file line number Diff line number Diff line change
@@ -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");
Loading