From a090b5dec638fe7ee79fc87cfd3c4fd1d65de1d9 Mon Sep 17 00:00:00 2001 From: lizhixuan Date: Fri, 23 Oct 2026 00:24:46 +0800 Subject: [PATCH] build: keep pnpm-workspace.yaml to the workspace list Anthropic's plugin directory blocks plugins/refkit ("Package registry redirected") because pnpm-workspace.yaml above it carried a pnpm setting (onlyBuiltDependencies: esbuild). esbuild resolves its platform binary from its optional dependency, so its install script isn't needed. plugin-manifest pins that nothing between the repo root and the plugin configures a package manager. --- .../mcp/src/__tests__/plugin-manifest.test.ts | 18 ++++++++++++++++++ pnpm-workspace.yaml | 3 --- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/mcp/src/__tests__/plugin-manifest.test.ts b/packages/mcp/src/__tests__/plugin-manifest.test.ts index d60d7f6..32fa5cc 100644 --- a/packages/mcp/src/__tests__/plugin-manifest.test.ts +++ b/packages/mcp/src/__tests__/plugin-manifest.test.ts @@ -291,3 +291,21 @@ describe('directory listing fields', () => { expect(existsSync(join(PLUGIN, codexManifest.interface.composerIcon))).toBe(true) }) }) + +// Anthropic's directory blocks a plugin whose npx launcher could be steered by a +// package-manager config in the plugin or in any folder above it ("Package registry +// redirected"), and it counts every pnpm setting in pnpm-workspace.yaml, not only +// registry keys. +describe('package-manager config above the plugin', () => { + it('pnpm-workspace.yaml declares only the workspace packages', () => { + const text = readFileSync(join(ROOT, 'pnpm-workspace.yaml'), 'utf8') + const keys = text.split('\n').filter(line => /^[A-Za-z]/.test(line)).map(line => line.slice(0, line.indexOf(':'))) + expect(keys).toEqual(['packages']) + }) + + it('has no .npmrc, bunfig.toml or uv.toml between the repository root and the plugin', () => { + for (const dir of [ROOT, join(ROOT, 'plugins')]) { + for (const name of ['.npmrc', 'bunfig.toml', 'uv.toml']) expect(existsSync(join(dir, name)), join(dir, name)).toBe(false) + } + }) +}) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 31709b4..18ec407 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,2 @@ packages: - 'packages/*' - -onlyBuiltDependencies: - - esbuild