From 3cc9edf644c5c96ed23aedeeadb9ec7ca0580577 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Aug 2026 18:41:40 +0000 Subject: [PATCH] fix(cli,create-plugin): drop the `templates` files entry neither package has ever had (#3665) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `@object-ui/cli` and `@object-ui/create-plugin` both list `templates` in package.json `files`, but neither directory exists on disk and neither has ever existed anywhere in this repo's git history. Both packages inline their templates instead: the cli as an object literal in `src/commands/init.ts`, create-plugin by constructing the generated package.json field by field in code. npm skips a missing `files` entry silently, so the published tarballs were already correct — only the manifests said otherwise. Also removes create-plugin's write-only `templateDir` and the `fileURLToPath`/`__filename`/`__dirname` chain that existed solely to compute it. The `__dirname` that remains at src/index.ts:201 is literal text inside the generated vite.config.ts template string, not a reference to the module's. Clears both `KNOWN_MISSING` entries from the objectui#3663 ratchet, which the deletions turn stale. Deleting a declaration retires a baseline line exactly as creating the file would; the doc comment above the map now records both routes. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt --- packages/cli/package.json | 1 - packages/create-plugin/package.json | 1 - packages/create-plugin/src/index.ts | 7 ------ scripts/__tests__/package-files-exist.test.ts | 25 ++++++++----------- 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 9db12381b7..d340fa89fb 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -24,7 +24,6 @@ }, "files": [ "dist", - "templates", "README.md", "CHANGELOG.md", "LICENSE" diff --git a/packages/create-plugin/package.json b/packages/create-plugin/package.json index d13a6ddbb0..1162139f89 100644 --- a/packages/create-plugin/package.json +++ b/packages/create-plugin/package.json @@ -9,7 +9,6 @@ }, "files": [ "dist", - "templates", "README.md", "CHANGELOG.md", "LICENSE" diff --git a/packages/create-plugin/src/index.ts b/packages/create-plugin/src/index.ts index 16031e6c6b..3f532d9d48 100644 --- a/packages/create-plugin/src/index.ts +++ b/packages/create-plugin/src/index.ts @@ -12,10 +12,6 @@ import chalk from 'chalk'; import prompts from 'prompts'; import * as path from 'path'; import fs from 'fs-extra'; -import { fileURLToPath } from 'url'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); const program = new Command(); @@ -111,9 +107,6 @@ async function createPlugin(pluginName?: string, options: PluginOptions = {}) { fs.mkdirpSync(targetDir); fs.mkdirpSync(path.join(targetDir, 'src')); - // Get template directory - const templateDir = path.join(__dirname, '..', 'templates', 'plugin'); - // Template variables const vars = { PACKAGE_NAME: `@object-ui/${fullPackageName}`, diff --git a/scripts/__tests__/package-files-exist.test.ts b/scripts/__tests__/package-files-exist.test.ts index f4bf9e708e..e593bad681 100644 --- a/scripts/__tests__/package-files-exist.test.ts +++ b/scripts/__tests__/package-files-exist.test.ts @@ -67,22 +67,17 @@ const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../ * can only shrink. Fix one by deleting the stale `files` entry from the * package's `package.json` and deleting its line here. * - * Both current entries are vestigial declarations, measured on - * main@dae1ac41e: neither `templates` directory exists on disk, neither has - * EVER existed in this repo's git history (an all-branch `git log - * --diff-filter=A` over both paths returns nothing), and no build step or - * workflow creates one. Both packages inline their templates instead — - * `@object-ui/cli` as an - * object literal in `src/commands/init.ts`, and `@object-ui/create-plugin` by - * constructing the generated `package.json` in code, leaving - * `src/index.ts`'s `templateDir` assigned and never read. So nothing is broken - * for a user today; the manifests simply state something untrue, which is the - * defect objectui#3663 is about. + * Currently empty, which is the intended resting state — the ratchet still + * fails on any NEW violation. It landed carrying two entries measured on + * main@dae1ac41e, `packages/cli/templates` and + * `packages/create-plugin/templates`: vestigial declarations for directories + * that never existed on disk, never existed anywhere in this repo's git + * history, and that no build step or workflow creates. Both packages inline + * their templates instead. objectui#3665 banked both by deleting the two + * `files` entries, and deleting a declaration retires a baseline line exactly + * as creating the file would. */ -const KNOWN_MISSING: Record = { - 'packages/cli/templates': { issue: 'objectui#3665' }, - 'packages/create-plugin/templates': { issue: 'objectui#3665' }, -}; +const KNOWN_MISSING: Record = {}; interface WorkspacePackage { name: string;