From b1fef8d59254d245ecb2bc8594d22501304606e5 Mon Sep 17 00:00:00 2001 From: implementer Date: Fri, 28 Aug 2026 08:13:00 +0000 Subject: [PATCH] feat: configure ESM package boundaries across the workspace (E00-S01-T03) Adds ESM boundary declarations to every workspace package manifest (apps/server, packages/core, extensions/example): "type": "module", "main"/"types" entry points and an "exports" map (types + import conditions) so each package exposes only its public root; adds "type": "module" to the workspace root package.json so the workspace is uniformly ESM. Placeholder src/index.ts files stay as empty ESM modules. Verified: each package compiles under tsconfig.base.json (NodeNext) with TypeScript 6.0.3 and emits ESM dist/index.js + dist/index.d.ts; Node imports each package by name through its exports map and rejects deep subpath imports (ERR_PACKAGE_PATH_NOT_EXPORTED); pnpm 11.23.0 install --frozen-lockfile passes with the lockfile unchanged. Closes #156 --- apps/server/package.json | 11 ++++++++++- extensions/example/package.json | 11 ++++++++++- package.json | 1 + packages/core/package.json | 11 ++++++++++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/apps/server/package.json b/apps/server/package.json index 1001a58..eda6b13 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -2,5 +2,14 @@ "name": "@personal-blog/server", "version": "0.0.0", "private": true, - "description": "EPPP public server application. Bootstrap placeholder — the Fastify 5 application shell lands in a later story." + "type": "module", + "description": "EPPP public server application. Bootstrap placeholder — the Fastify 5 application shell lands in a later story.", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + } } diff --git a/extensions/example/package.json b/extensions/example/package.json index da0975c..b81568b 100644 --- a/extensions/example/package.json +++ b/extensions/example/package.json @@ -2,5 +2,14 @@ "name": "@personal-blog/example-extension", "version": "0.0.0", "private": true, - "description": "Placeholder extension that exercises the extensions/ workspace group. Real extensions (e.g. theme-amber) replace it in later stories." + "type": "module", + "description": "Placeholder extension that exercises the extensions/ workspace group. Real extensions (e.g. theme-amber) replace it in later stories.", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + } } diff --git a/package.json b/package.json index 9f23a70..55bf2f8 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "personal-blog", "version": "0.0.0", "private": true, + "type": "module", "description": "EPPP — a modular personal blogging platform. Workspace bootstrap (E00-S01).", "packageManager": "pnpm@11.23.0" } diff --git a/packages/core/package.json b/packages/core/package.json index 7293fc5..14ad9df 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -2,5 +2,14 @@ "name": "@personal-blog/core", "version": "0.0.0", "private": true, - "description": "EPPP application core. Bootstrap placeholder — owns application lifecycle, site identity and content primitives in later stories." + "type": "module", + "description": "EPPP application core. Bootstrap placeholder — owns application lifecycle, site identity and content primitives in later stories.", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + } + } } -- 2.54.0