Skip to content

💡 refactor(deps): Optimizing dependencies and reorganizing package exports#163

Merged
Charles Hudson (phobetron) merged 1 commit intomainfrom
NT-2544_optimize-deps-and-exports
Mar 3, 2026
Merged

💡 refactor(deps): Optimizing dependencies and reorganizing package exports#163
Charles Hudson (phobetron) merged 1 commit intomainfrom
NT-2544_optimize-deps-and-exports

Conversation

@phobetron
Copy link
Copy Markdown
Collaborator

@phobetron Charles Hudson (phobetron) commented Mar 3, 2026

  • Move the logger implementation from lib/logger into @contentful/optimization-api-client/logger, and remove diary plus legacy logger workspace references/aliases.
  • Introduce explicit package subpath entrypoints across core/platform SDKs (./logger, ./core-sdk, ./api-client, ./api-schemas, and ./web-sdk for react-web), including build/export config updates.
  • Stop transitive root re-exports from SDK index entrypoints; migrate implementations/docs/tests to the new subpaths and top-level core helpers (getMergeTagValue, getCustomFlags, personalizeEntry, etc.).
  • Centralize Contentful schema type guards under api-schemas/contentful/typeGuards and re-export them from the contentful barrel.
  • Strengthen guard/queue-policy/custom-flag coverage in core and web tests, and update runtime call sites to align with the refined public API surface.
  • Extend .husky/pre-push to run typecheck and unit tests for changed implementations in addition to changed workspaces, and add the implementation:typecheck script.
  • Make sdk.personalizations and sdk.analytics internal-only in favor of Core methods.

BREAKING CHANGE: root SDK entrypoints no longer re-export core/api-client/api-schemas APIs; consumers must import from dedicated subpaths (for example, @contentful/optimization-web/core-sdk and @contentful/optimization-web/logger).

BREAKING CHANGE: Optimization SDK instances no longer have separate accessible personalization or analytics properties; they are instead delegated from the SDK instance itself.

[NT-2544]

…ports

- Move the logger implementation from `lib/logger` into `@contentful/optimization-api-client/logger`, and remove `diary` plus legacy logger workspace references/aliases.
- Introduce explicit package subpath entrypoints across core/platform SDKs (`./logger`, `./core-sdk`, `./api-client`, `./api-schemas`, and `./web-sdk` for react-web), including build/export config updates.
- Stop transitive root re-exports from SDK `index` entrypoints; migrate implementations/docs/tests to the new subpaths and top-level core helpers (`getMergeTagValue`, `getCustomFlags`, `personalizeEntry`, etc.).
- Centralize Contentful schema type guards under `api-schemas/contentful/typeGuards` and re-export them from the contentful barrel.
- Strengthen guard/queue-policy/custom-flag coverage in core and web tests, and update runtime call sites to align with the refined public API surface.
- Extend `.husky/pre-push` to run typecheck and unit tests for changed implementations in addition to changed workspaces, and add the `implementation:typecheck` script.
- Make `sdk.personalizations` and `sdk.analytics` internal-only in favor of Core methods.

BREAKING CHANGE: root SDK entrypoints no longer re-export core/api-client/api-schemas APIs; consumers must import from dedicated subpaths (for example, `@contentful/optimization-web/core-sdk` and `@contentful/optimization-web/logger`).

BREAKING CHANGE: Optimization SDK instances no longer have separate accessible `personalization` or `analytics` properties; they are instead delegated from the SDK instance itself.

[[NT-2544](https://contentful.atlassian.net/browse/NT-2544)]
@wiz-inc-38d59fb8d7
Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings 5 Low
Software Management Finding Software Management Findings -
Total 5 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@phobetron Charles Hudson (phobetron) merged commit a018054 into main Mar 3, 2026
30 checks passed
@phobetron Charles Hudson (phobetron) deleted the NT-2544_optimize-deps-and-exports branch March 3, 2026 18:40
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