Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/fix-preact-entry-points.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@shopify/ui-extensions': patch
---

Fix the preact entry points in package.json:

- Add a `typesVersions` entry for `@shopify/ui-extensions/preact` so its types resolve under TypeScript's legacy `moduleResolution: "node"` (node10), matching the existing entries for `checkout/preact` and `customer-account/preact`.
- Remove the dead `./point-of-sale/preact` entry from `exports`. Its source file was intentionally deleted right after it was introduced, 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. POS extensions should use the generic `@shopify/ui-extensions/preact` entry point.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ jobs:
- name: Build packages
run: yarn build

# publint checks that every package.json entry point resolves to files
# that actually ship in the npm tarball; attw checks that types resolve
# under every TypeScript moduleResolution mode (including node10, which
# needs typesVersions entries mirroring exports). false-cjs is ignored:
# the package's ESM types are declared with .d.ts instead of .d.mts,
# which is pre-existing and harmless for bundled extension code.
- name: Validate ui-extensions package entry points
run: |
yarn workspace @shopify/ui-extensions package:publint
yarn workspace @shopify/ui-extensions package:attw

- name: Typecheck ui-extensions-tester (including tests)
run: npx tsc --project packages/ui-extensions-tester/tsconfig.typecheck.json

Expand Down
25 changes: 13 additions & 12 deletions packages/ui-extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"scripts": {
"docs:admin": "node ./docs/surfaces/admin/build-docs.mjs",
"docs:checkout": "bash ./docs/surfaces/checkout/build-docs.sh",
"package:publint": "publint --pack npm",
"package:attw": "attw --pack . --ignore-rules false-cjs",
"docs:point-of-sale": "node ./docs/surfaces/point-of-sale/build-docs.mjs",
"docs:customer-account": "node ./docs/surfaces/customer-account/build-docs.mjs"
},
Expand Down Expand Up @@ -45,6 +47,9 @@
],
"pos.*": [
"./build/ts/surfaces/point-of-sale/targets/pos.*.d.ts"
],
"preact": [
"./build/ts/preact.d.ts"
]
}
},
Expand Down Expand Up @@ -106,12 +111,6 @@
"./pos.*": {
"default": "./build/ts/surfaces/point-of-sale/targets/pos.*.d.ts"
},
"./point-of-sale/preact": {
"types": "./build/ts/surfaces/point-of-sale/preact.d.ts",
"esnext": "./build/esnext/surfaces/point-of-sale/preact.esnext",
"import": "./build/esm/surfaces/point-of-sale/preact.mjs",
"require": "./build/cjs/surfaces/point-of-sale/preact.js"
},
"./preact": {
"types": "./build/ts/preact.d.ts",
"esnext": "./build/esnext/preact.esnext",
Expand All @@ -126,17 +125,19 @@
"./build/cjs/preact.js"
],
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.5",
"@faker-js/faker": "^8.4.1",
"@preact/signals": "^2.3.x",
"@quilted/react-testing": "^0.6.11",
"@remote-ui/async-subscription": "^2.1.16",
"@shopify/generate-docs": "1.2.2",
"@quilted/react-testing": "^0.6.11",
"typescript": "^4.9.0",
"@faker-js/faker": "^8.4.1",
"preact": "^10.10.x",
"@preact/signals": "^2.3.x"
"publint": "^0.3.23",
"typescript": "^4.9.0"
},
"peerDependencies": {
"preact": "*",
"@preact/signals": "*"
"@preact/signals": "*",
"preact": "*"
},
"peerDependenciesMeta": {
"preact": {
Expand Down
Loading
Loading