Skip to content

Upgrade to ES2025/NodeNext, expand npm package exports, enhance typedoc config#887

Merged
pethers merged 4 commits intomainfrom
copilot/update-to-es2025-configs
Apr 1, 2026
Merged

Upgrade to ES2025/NodeNext, expand npm package exports, enhance typedoc config#887
pethers merged 4 commits intomainfrom
copilot/update-to-es2025-configs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Project was targeting ES2024 with deprecated moduleResolution: "node" (requiring ignoreDeprecations: "6.0"). npm package only exported ~40% of src modules. TypeDoc config missing ISMS policy links and future architecture docs.

ES2025 + NodeNext module resolution

  • tsconfig.json: target: ES2025, module: NodeNext, moduleResolution: NodeNext
  • Removed deprecated ignoreDeprecations: "6.0" and unnecessary baseUrl: "."
  • eslint.config.js: ecmaVersion: 2025 (both src/test sections)
  • Updated ARCHITECTURE.md and SWOT.md references

NodeNext over Node16: forward-tracks latest Node.js module semantics rather than being frozen at v16 behavior. Both support ESM + .js extensions which the codebase already uses.

Expanded npm package surface

src/index.ts expanded from ~40% → ~90% of modules exported:

  • All constants (config, analysis-constants, language-ui, language-articles)
  • Templates (section-builders)
  • Utilities (content-metadata, news-metadata, metadata-utils)
  • All 4 pipeline stages (fetch, transform, generate, output)
  • All 11 content generators
  • All 9 article strategies
  • Index/sitemap generators

Added subpath exports in package.json:

"exports": {
  ".": { "import": "./scripts/index.js", "types": "./scripts/index.d.ts" },
  "./types": { /* ... */ },
  "./mcp/*": { /* ... */ },
  "./constants/*": { /* ... */ },
  "./utils/*": { /* ... */ },
  "./generators/pipeline/*": { /* ... */ },
  "./generators/strategies/*": { /* ... */ }
}

TypeDoc enhancements

  • 13 additional projectDocuments (all FUTURE_* docs, WORKFLOWS, CLASSIFICATION, CONTRIBUTING, SECURITY)
  • 7 ISMS policy sidebar links (Information Security, Open Source, Classification, AI, Access Control, Cryptography)
  • New block tags: @isms, @framework, @classification

…ge exports, enhance typedoc config

- tsconfig.json: target ES2025, module/moduleResolution NodeNext, remove deprecated options
- eslint.config.js: ecmaVersion 2025
- src/index.ts: expand from ~40% to ~90% of src modules exported
- package.json: add subpath exports for direct module access
- typedoc.json: add ISMS policy links, future architecture docs, extra blockTags
- ARCHITECTURE.md: update ES2024→ES2025, ESNext→NodeNext references
- SWOT.md: update ES2024→ES2025 reference

Agent-Logs-Url: https://github.com/Hack23/euparliamentmonitor/sessions/6da7d820-bdd3-4d92-960c-ab637f5cb7a7

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions bot added documentation Documentation updates infrastructure CI/CD and build infrastructure config Configuration changes dependencies Dependency updates javascript JavaScript dependencies needs-tests Needs test coverage scripts Scripts and automation labels Mar 31, 2026
Copilot AI changed the title [WIP] Update project configurations and documentation to ES2025 Upgrade to ES2025/NodeNext, expand npm package exports, enhance typedoc config Mar 31, 2026
Copilot AI requested a review from pethers March 31, 2026 23:20
@pethers
Copy link
Copy Markdown
Member

pethers commented Mar 31, 2026

@copilot analyse and fix issues in failing checks
Test and Report / Validate Code (pull_request)
Test and Report / Validate Code (pull_request)Failing after 53s

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 31, 2026

@copilot analyse and fix issues in failing checks
[Test and Report / Validate Code (pull_request)](https://github.com/Hack23/euparliamentmonitor/actions/runs/23823869186/job/694423895...

The CI failure was a Prettier formatting issue in src/index.ts — small exports with only 2 items needed to be on single lines per Prettier's style rules. Fixed in f71bc74.

@pethers pethers marked this pull request as ready for review March 31, 2026 23:31
@pethers pethers requested a review from Copilot March 31, 2026 23:32
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 updates the project’s TypeScript/ESM configuration to ES2025 + NodeNext semantics, expands the npm package’s exported surface (both via the root barrel and package.json subpath exports), and enhances TypeDoc navigation/docs to include ISMS policy links and future-architecture documentation.

Changes:

  • Updated TypeScript + ESLint configuration to target ES2025 and use NodeNext module/moduleResolution.
  • Expanded the public package API via src/index.ts/scripts/index.js re-exports and added subpath exports mappings in package.json.
  • Enhanced TypeDoc configuration with additional block tags, navigation links, and project documents (including ISMS and FUTURE_* docs).

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
typedoc.json Adds ISMS-related block tags, sidebar links, and includes additional project documents in generated docs.
tsconfig.json Moves compilation target to ES2025 and switches module/moduleResolution to NodeNext.
eslint.config.js Aligns ESLint parsing with ES2025 (ecmaVersion: 2025).
package.json Adds subpath export maps for types, mcp, constants, utils, templates, generators, pipeline, and strategies.
src/index.ts Expands the root barrel exports to cover most modules (constants, utils, pipeline, generators, strategies).
scripts/index.js Updates the compiled/published entrypoint to reflect the expanded barrel exports.
ARCHITECTURE.md Updates documentation references from ES2024 to ES2025 and reflects NodeNext module usage.
SWOT.md Updates build tooling reference from ES2024 to ES2025.
Comments suppressed due to low confidence (1)

src/index.ts:305

  • The root entrypoint now re-exports a very large set of modules (pipeline stages, strategies, generators). In ESM, importing euparliamentmonitor will eagerly load/instantiate all these dependency modules even if a consumer only needs a small subset, which can increase startup time and makes the package more sensitive to any import-time side effects in those modules. Consider keeping the root entrypoint smaller and relying on the new subpath exports (e.g. euparliamentmonitor/generators/..., euparliamentmonitor/utils/...) for the expanded surface, or split exports into multiple entrypoints (e.g. ./pipeline, ./strategies) to avoid eagerly loading everything on import 'euparliamentmonitor'.
// ─── Analysis Pipeline Stages ─────────────────────────────────────────────────
export {
  ALL_ANALYSIS_METHODS,
  VALID_ANALYSIS_METHODS,
  runAnalysisStage,
} from './generators/pipeline/analysis-stage.js';

src/index.ts Outdated
} from './utils/news-metadata.js';

// ─── Metadata Utilities ──────────────────────────────────────────────────────
export { pl } from './utils/metadata-utils.js';
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

pl is exported from the package root, but the abbreviated name is unclear for external consumers and is easy to miss in autocomplete. Consider re-exporting it under a more descriptive public name (e.g. pluralize / pluralizeCount) and/or keeping pl only as an internal alias.

Suggested change
export { pl } from './utils/metadata-utils.js';
export { pl, pl as pluralizeCount } from './utils/metadata-utils.js';

Copilot uses AI. Check for mistakes.
@pethers
Copy link
Copy Markdown
Member

pethers commented Mar 31, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 31, 2026

@copilot apply changes based on the comments in this thread

Applied the reviewer's suggestion — pl is now also exported as pluralizeCount for better discoverability by external consumers. Fixed in b442a56.

@pethers pethers merged commit b644ead into main Apr 1, 2026
14 checks passed
@pethers pethers deleted the copilot/update-to-es2025-configs branch April 1, 2026 00:06
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 infrastructure CI/CD and build infrastructure javascript JavaScript dependencies needs-tests Needs test coverage scripts Scripts and automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants