mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-30 06:22:04 +00:00
fix: Add library export fields to npm package (main, types, exports)
## Problem PR #309 added `main`, `types`, and `exports` fields to package.json for library usage, but v2.18.9 was published without these fields. The publish scripts (both local and CI/CD) use package.runtime.json as the base and didn't copy these critical fields. Result: npm package broke library usage for multi-tenant backends. ## Root Cause Both scripts/publish-npm.sh and .github/workflows/release.yml: - Copy package.runtime.json as base package.json - Add metadata fields (name, bin, repository, etc.) - Missing: main, types, exports fields ## Changes ### 1. scripts/publish-npm.sh - Added main, types, exports fields to package.json generation - Removed test suite execution (already runs in CI) ### 2. .github/workflows/release.yml - Added main, types, exports fields to CI publish step ### 3. Version bump - Bumped to v2.18.10 to republish with correct fields ## Verification ✅ Local publish preparation tested ✅ Generated package.json has all required fields: - main: "dist/index.js" - types: "dist/index.d.ts" - exports: { "." : { types, require, import } } ✅ TypeScript compilation passes ✅ All library export paths validated ## Impact - Fixes library usage for multi-tenant deployments - Enables downstream n8n-mcp-backend project - Maintains backward compatibility (CLI/Docker unchanged) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
@@ -334,6 +334,15 @@ jobs:
|
||||
const pkg = require('./package.json');
|
||||
pkg.name = 'n8n-mcp';
|
||||
pkg.description = 'Integration between n8n workflow automation and Model Context Protocol (MCP)';
|
||||
pkg.main = 'dist/index.js';
|
||||
pkg.types = 'dist/index.d.ts';
|
||||
pkg.exports = {
|
||||
'.': {
|
||||
types: './dist/index.d.ts',
|
||||
require: './dist/index.js',
|
||||
import: './dist/index.js'
|
||||
}
|
||||
};
|
||||
pkg.bin = { 'n8n-mcp': './dist/mcp/index.js' };
|
||||
pkg.repository = { type: 'git', url: 'git+https://github.com/czlonkowski/n8n-mcp.git' };
|
||||
pkg.keywords = ['n8n', 'mcp', 'model-context-protocol', 'ai', 'workflow', 'automation'];
|
||||
|
||||
Reference in New Issue
Block a user