v3.0.0: ESM migration and FRED API v2 support#113
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the node-fred library from CommonJS to native ES modules (ESM) with dual CJS/ESM support, modernizes the build toolchain, and adds FRED API v2 support with Bearer token authentication.
Changes:
- Migrated to native ES modules with dual package support (ESM/CJS) using tsup bundler
- Added FRED API v2 endpoints for release observations with pagination support
- Updated minimum Node.js version to 18+ and GitHub Actions to test against Node 18/20/22
Reviewed changes
Copilot reviewed 37 out of 40 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated version to 3.0.0, configured dual ESM/CJS exports, upgraded dependencies to ESM-native versions |
| webpack.config.js | Removed webpack configuration as part of migration to tsup |
| tsup.config.js | Added tsup configuration for dual ESM/CJS bundling |
| src/Api/releases.js | Added v2 API methods for release observations with pagination |
| src/Api/Builders/releaseBuilder.js | Added v2-specific builder methods for format, cursor, and limit validation |
| src/Api/Builders/builder.js | Added endpoint-specific limit validation methods |
| src/Api/Builders/seriesBuilder.js | Added start_time and end_time parameter support |
| src/Api/series.js | Updated to use endpoint-specific limit methods |
| All test files | Updated imports to use .js extensions for ESM compatibility |
| .github/workflows/*.yml | Updated to Node 18/20/22 and actions v4 |
| LICENSE | Updated copyright year to 2026 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## Test Tooling | ||
|
|
||
| Upgrade to ESM-native versions: | ||
| - mocha ^11.1.0 |
There was a problem hiding this comment.
Documentation specifies mocha ^11.1.0, but package.json uses ^11.3.0. These versions should be consistent.
| - mocha ^11.1.0 | |
| - mocha ^11.3.0 |
|
|
||
| Upgrade to ESM-native versions: | ||
| - mocha ^11.1.0 | ||
| - chai ^5.2.0 |
There was a problem hiding this comment.
Documentation specifies chai ^5.2.0, but package.json uses ^5.3.3. These versions should be consistent.
| - chai ^5.2.0 | |
| - chai ^5.3.3 |
| Upgrade to ESM-native versions: | ||
| - mocha ^11.1.0 | ||
| - chai ^5.2.0 | ||
| - sinon ^21.0.0 |
There was a problem hiding this comment.
Documentation specifies sinon ^21.0.0, but package.json uses ^21.0.1. These versions should be consistent.
| - sinon ^21.0.0 | |
| - sinon ^21.0.1 |
Major release with breaking changes: ESM Migration: - Convert to native ES modules with dual CJS/ESM package support - Use tsup for building both formats FRED API v2 Support: - Add getObservationsForRelease() for v2/release/observations endpoint - Add getAllObservationsForRelease() with automatic pagination - v2 API uses Bearer token authentication via Authorization header New Features: - Add start_time and end_time parameters to series/updates endpoint - Add endpoint-specific limit validation (100k observations, 10k dates, 500k v2) - Add exponential backoff with automatic retry for all endpoints - Retries on 429 (rate limit) and 503 (service unavailable) - Configurable: maxRetries, initialDelayMs, maxDelayMs, backoffMultiplier TypeScript: - Update type definitions for v2 API types Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1915547 to
05bf637
Compare
BREAKING CHANGES:
New Features:
Build: