Skip to content

Improve npm package: keywords, tree-shaking, package size reduction, release workflow fix#945

Merged
pethers merged 1 commit intomainfrom
copilot/improve-npm-package-details
Apr 5, 2026
Merged

Improve npm package: keywords, tree-shaking, package size reduction, release workflow fix#945
pethers merged 1 commit intomainfrom
copilot/improve-npm-package-details

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 5, 2026

npm package had limited discoverability keywords, shipped unnecessary source maps (152 .map files), release zip was missing .d.ts files, and README lacked npm install/usage examples visible on the npmjs.com listing.

package.json

  • keywords: 11 → 22 strategic terms (eu, mep, european-union, democracy, civic-tech, political-analysis, legislative, voting, monitoring, news-generation, multilingual, i18n)
  • sideEffects: false — enables tree-shaking in bundlers
  • funding — GitHub Sponsors link (renders on npm page)
  • filesscripts/scripts/**/*.js + scripts/**/*.d.ts globs, excluding .js.map and .d.ts.map
Metric Before After
Package size 701 kB 521 kB (−26%)
File count 308 156 (−49%)

release.yml

Added missing npm run build in the build job before zip artifact creation. The .d.ts files are gitignored and only exist after tsc — without this step the release zip had no type declarations.

README.md

Added Quick Start section near top (what npm renders on package page):

import {
  EuropeanParliamentMCPClient,
  generateArticleHTML,
  scoreArticleQuality,
  ALL_LANGUAGES,
} from 'euparliamentmonitor';

// Subpath imports for tree-shaking
import { EuropeanParliamentMCPClient } from 'euparliamentmonitor/mcp/ep-mcp-client';
import type { ArticleCategory, LanguageCode } from 'euparliamentmonitor/types';

Restructured Installation: npm-first, git clone under "From Source (Development)".

.github/FUNDING.yml

New file — GitHub Sponsors config for Hack23 org.

Dependency review

Runtime deps are correct: 1 required (european-parliament-mcp-server), 1 optional (worldbank-mcp). All others correctly in devDependencies.

@github-actions github-actions bot added documentation Documentation updates infrastructure CI/CD and build infrastructure github_actions GitHub Actions updates config Configuration changes dependencies Dependency updates javascript JavaScript dependencies workflows GitHub workflows labels Apr 5, 2026
@pethers pethers marked this pull request as ready for review April 5, 2026 01:00
@pethers pethers requested a review from Copilot April 5, 2026 01:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the published npm package’s discoverability and consumer experience while reducing package size and fixing the GitHub Release artifact so it includes generated TypeScript declarations.

Changes:

  • Expanded package.json metadata (keywords, funding) and improved tree-shaking support (sideEffects: false) while reducing published file set by excluding source maps.
  • Fixed the release workflow to run npm run build before creating the release zip so generated .d.ts files are included.
  • Added a prominent “Quick Start” + clearer npm-first installation/usage examples in README.md for the npmjs.com listing.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
README.md Adds npm install + ESM/TypeScript usage examples near the top and restructures installation guidance.
package.json Improves npm metadata, enables tree-shaking, adds funding, and narrows published files to reduce package size.
.github/workflows/release.yml Ensures TypeScript build runs before zipping release artifacts so generated declaration files are present.
.github/FUNDING.yml Adds GitHub Sponsors configuration for the org.

@pethers pethers merged commit fec5b2e into main Apr 5, 2026
18 checks passed
@pethers pethers deleted the copilot/improve-npm-package-details branch April 5, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration changes dependencies Dependency updates documentation Documentation updates github_actions GitHub Actions updates infrastructure CI/CD and build infrastructure javascript JavaScript dependencies workflows GitHub workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants