Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refactor rollup bundling #11

Closed
wants to merge 20 commits into from

Conversation

Mohammad-Dwairi
Copy link
Contributor

Summary

Refactored Rollup configuration to generate "moduled" entries for each client in the SDK. This enables users to import clients and types from a scoped subpackges.

Import from supply module

import { SupplyClient } from '@expediagroup/lodging-connectivity-sdk/supply';

Import from sandbox module

import { SandboxClient } from '@expediagroup/lodging-connectivity-sdk/sandbox';

Import from payment module

import { PaymentClient } from '@expediagroup/lodging-connectivity-sdk/payment';

In addition, users still able to import from the root package, but modules are aliased due to types conflicts. Importing from the root package is done as the following:

import { SupplyAPI, SandboxAPI, PaymentAPI } from '@expediagroup/lodging-connectivity-sdk';

Additional Improvements

  1. Optimized the bundle for Rollup's treeshaking
  2. Marked some dependencies as external in rollup config, these will be automatically installed with the SDK by npm instead pf bundling them with the package.
  3. Marked the root project and the examples module as private: true to prevent unintended publish.
  4. Added entries mappings in the code module pacakge.json to enable host apps resolve the types and main entries.

@Mohammad-Dwairi Mohammad-Dwairi requested a review from a team as a code owner September 19, 2024 10:42
@Mohammad-Dwairi Mohammad-Dwairi removed the request for review from a team September 20, 2024 22:53
@Mohammad-Dwairi Mohammad-Dwairi marked this pull request as draft September 20, 2024 22:53
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.

1 participant