💡 refactor(deps): Optimizing dependencies and reorganizing package exports#163
Merged
Charles Hudson (phobetron) merged 1 commit intomainfrom Mar 3, 2026
Merged
Conversation
…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 Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lib/loggerinto@contentful/optimization-api-client/logger, and removediaryplus legacy logger workspace references/aliases../logger,./core-sdk,./api-client,./api-schemas, and./web-sdkfor react-web), including build/export config updates.indexentrypoints; migrate implementations/docs/tests to the new subpaths and top-level core helpers (getMergeTagValue,getCustomFlags,personalizeEntry, etc.).api-schemas/contentful/typeGuardsand re-export them from the contentful barrel..husky/pre-pushto run typecheck and unit tests for changed implementations in addition to changed workspaces, and add theimplementation:typecheckscript.sdk.personalizationsandsdk.analyticsinternal-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-sdkand@contentful/optimization-web/logger).BREAKING CHANGE: Optimization SDK instances no longer have separate accessible
personalizationoranalyticsproperties; they are instead delegated from the SDK instance itself.[NT-2544]