Skip to content

feat: Modernize ryuu-proxy to v5.0.0 - Fix axios compatibility with modern tooling#63

Merged
jontiritilli merged 4 commits intomasterfrom
upgrade/revamp
Oct 28, 2025
Merged

feat: Modernize ryuu-proxy to v5.0.0 - Fix axios compatibility with modern tooling#63
jontiritilli merged 4 commits intomasterfrom
upgrade/revamp

Conversation

@jontiritilli
Copy link
Copy Markdown
Contributor

Summary

Complete modernization of @domoinc/ryuu-proxy to v5.0.0, fixing critical compatibility issues with modern Node.js build tools and updating all dependencies to current versions.

Primary Issue Fixed

Resolves the Package subpath './lib/defaults' is not defined by "exports" error that prevented the package from working with modern bundlers and Node.js versions. This was caused by using an outdated version of axios (0.27.2) that wasn't compatible with Node.js module resolution.

Major Changes

Breaking Changes

  • axios: 0.27.2 → 1.13.0 (fixes module exports issue)
  • TypeScript: 4.7.4 → 5.9.3 with strict mode enabled
  • Target: ES5 → ES2020 (requires Node.js 14+)
  • tough-cookie: 4.x → 5.x
  • axios-cookiejar-support: 1.x → 6.x
  • configstore: 5.x → 7.x
  • glob: 8.x → 10.x
  • fs-extra: 10.x → 11.x
  • https-proxy-agent: 5.x → 7.x
  • Added express as peer dependency (^4.17.0 || ^5.0.0)

Infrastructure Improvements

  • ✅ Migrated from npm/yarn to pnpm for better dependency management
  • ✅ Replaced deprecated tslint with ESLint + Airbnb config
  • ✅ Added comprehensive linting rules and auto-fix capability
  • ✅ TypeScript strict mode with improved type safety throughout
  • ✅ Removed most @ts-ignore comments with proper typing
  • ✅ Added separate tsconfig.test.json for test files
  • ✅ Enhanced error handling with optional chaining and nullish coalescing

Code Quality

  • ✅ All 23 tests passing
  • ✅ No TypeScript errors
  • ✅ Linting passes (only warnings for intentional any types at library boundaries)
  • ✅ Proper type definitions and source maps generated
  • ✅ Modern import/export patterns throughout

Build & Release

  • ✅ Added prepublishOnly hook for safety (runs lint, test, build)
  • ✅ Updated all build scripts to use pnpm
  • ✅ Created comprehensive CHANGELOG.md with migration guide
  • ✅ Added .npmrc for pnpm configuration

API Compatibility

No breaking changes to the public API - existing code using this package should continue to work without modifications.

The only requirements for consumers:

  • Node.js 14+ (for ES2020 support)
  • Express 4.17+ or 5.x

Files Changed

  • Updated all source files in src/ with modern TypeScript patterns
  • Modernized import statements (axios, glob, configstore, etc.)
  • Fixed cookie handling to avoid parameter reassignment
  • Improved null/undefined checks throughout
  • Added comprehensive CHANGELOG.md

Testing

  • ✅ All unit tests pass (23/23)
  • ✅ Build succeeds with no errors
  • ✅ Type checking passes in strict mode
  • ✅ Tested in consuming applications on Node.js v20

Migration Notes

Consuming applications should:

  1. Ensure Node.js 14+ (recommend v18 or v20 LTS)
  2. Have express as a dependency (already a peer dep requirement)
  3. Reinstall dependencies to get the clean dependency tree

Jon Tiritilli added 4 commits October 27, 2025 09:39
docs: add CLAUDE.md for guidance on using Claude Code with the project

build: update package version to 4.5.0-beta.0 and ryuu-client dependency

test: update tests to use require for ryuu-client and adjust stubs

refactor: replace getDomoDomain with getDomainPromise in Transport tests

style: fix typos and improve consistency in test descriptions and assertions

refactor: re-export Manifest type from ryuu-client in models.ts
…nting

build: switch package manager to pnpm for improved dependency management
chore: update CHANGELOG.md with detailed release notes for version 5.0.0
chore: update package.json scripts and dependencies for modern tooling
refactor: improve type safety and modernize codebase with TypeScript strict mode
refactor: update import statements to use ES6 module syntax
refactor: enhance error handling and code readability throughout the codebase
refactor: update axios and related dependencies for compatibility with modern Node.js
refactor: improve cookie handling and proxy agent initialization logic
refactor: update tsconfig.json to target ES2020 and enable strict mode
test: add type annotations to test files for better type safety
test: create tsconfig.test.json for test-specific TypeScript configuration
@jontiritilli jontiritilli merged commit ed34e3d into master Oct 28, 2025
@jontiritilli jontiritilli deleted the upgrade/revamp branch October 28, 2025 17:36
Copy link
Copy Markdown

@mbrnak mbrnak left a comment

Choose a reason for hiding this comment

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

Fine by me. Feel free to ignore my comments if you feel like it.

port: proxyPort,
},
recentLogin.devToken,
) as any;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This feels like something we should fix instead of casting it to any?

Comment thread src/lib/errors.ts
Comment on lines +3 to 8

url: string;

error: string;

proxy: string;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why new lines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants