Skip to content

Fix preact entry points; validate package.json integrity in CI (publint + attw) - #4645

Open
henryStelle wants to merge 1 commit into
2026-10-rcfrom
henry/preact-typesversions-2026-10-rc
Open

Fix preact entry points; validate package.json integrity in CI (publint + attw)#4645
henryStelle wants to merge 1 commit into
2026-10-rcfrom
henry/preact-typesversions-2026-10-rc

Conversation

@henryStelle

@henryStelle henryStelle commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Problem

The storage.current subscribable API for POS UI extensions shipped in API version 2026-10 (types: #4235, runtime: shop/world#554969), but has no public docs, so partners can't discover or correctly use it.

Closes: https://github.com/shop/issues-retail/issues/33718

Solution

  • Synced db/data/docs/templated_apis/pos_ui_extensions/2026-10-rc/ generated JSON from Shopify/ui-extensions@2026-10-rc (adds Storage.current as a required property, SubscribableStorage, ReadonlySignalLike). The current property row on the Storage API page carries the reference detail (cross-target reactivity, async-hydration undefined caveat, subscribe() semantics).
  • target-apis/platform-apis/storage-api.mdx: reactive access mentioned in the intro, cross-target communication use case, and a single-writer-per-key best practice.
  • targets/app-background.mdx: "Share data with render targets" example.
  • Two new examples forming one flow: the background target owns a loyaltyPoints key (single writer, customer-change triggered, stale-response guard) and a tile renders it reactively via shopify.storage.current.loyaltyPoints.value (with the @shopify/ui-extensions/preact import, matching cart/locale examples).

Risk

  1. Visibility: Changes to existing reference pages for the 2026-10-rc API version only.
  2. Impact: No nav changes. The JSON sync also carries unrelated upstream changes (validation events, removal of pos.cart.line-item-details.action.render), confirmed expected.
  3. Type: New feature docs on existing pages.
  4. Unknowns: None outstanding.

Follow-up

  • Developer changelog entry (published through the changelog system, not this repo).
  • Broader treatment of signal reactivity across POS target API docs (cart, connectivity, locale, session all expose ReadonlySignalLike values); deliberately kept out of this PR.

Top-hatting

Preview: https://pr-1007240.shopify-dev.shopify.io / comment shell

Forward port of: #4646, #4647, #4648, #4649

- Add a typesVersions entry for ./preact so its types resolve under
  moduleResolution 'node' (node10), matching checkout/preact and
  customer-account/preact. Without it, import '@shopify/ui-extensions/preact'
  fails to resolve types in node10 projects (including the generated
  extension templates).
- Remove the dead ./point-of-sale/preact exports entry. Its source file
  was deliberately deleted in 75cf356 ('Remove preact file to fix
  build') along with its typesVersions entry, but the exports entry was
  left behind pointing at files that are never built or published. The
  import has never resolved in any released version.
- Add publint and @arethetypeswrong/cli (both already used elsewhere at
  Shopify, e.g. Shopify/worldwide and checkout-kit) as devDependencies
  with package:publint / package:attw scripts, and run them in CI after
  the build so both classes of regression fail the PR:
  - publint: exports entries must point at files that ship in the tarball
  - attw: types must resolve under every moduleResolution mode,
    including node10 (typesVersions parity with exports)
  attw runs with --ignore-rules false-cjs: the pre-existing lack of
  .d.mts type splits is harmless for bundled extension code.
@henryStelle
henryStelle marked this pull request as ready for review August 21, 2026 16:47
henryStelle added a commit that referenced this pull request Aug 21, 2026
- Add a typesVersions entry for ./preact so its types resolve under
  moduleResolution 'node' (node10), matching checkout/preact and
  customer-account/preact.
- Remove the dead ./point-of-sale/preact exports entry, which points at
  files that are never built or published.
- Add publint and @arethetypeswrong/cli as devDependencies with
  package:publint / package:attw scripts.
- Run both tools in CI after a package build so entry-point regressions
  fail the PR (attw ignores the pre-existing, harmless false-cjs rule).

Backport of e62b515 (#4645) to 2025-10.

Assisted-By: devx/7ecfa2dd-8bc7-47b2-a5ad-0ec47a969483
henryStelle added a commit that referenced this pull request Aug 21, 2026
- Add a typesVersions entry for ./preact so its types resolve under
  moduleResolution 'node' (node10), matching checkout/preact and
  customer-account/preact.
- Remove the dead ./point-of-sale/preact exports entry, which points at
  files that are never built or published.
- Add publint and @arethetypeswrong/cli as devDependencies with
  package:publint / package:attw scripts.
- Run both tools in CI after a package build so entry-point regressions
  fail the PR (attw ignores false-cjs, which is pre-existing and
  harmless for bundled extension code).

Backport of e62b515 (#4645) to 2026-01.

Assisted-By: devx/ffe30952-4960-4347-b0e5-48d8697405ff
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.

2 participants