Skip to content

Share IMAGES_PLACEHOLDERS from @weaverse/schema - #527

Merged
hta218 merged 3 commits into
mainfrom
update/move-images-placeholders-to-schema
Sep 15, 2026
Merged

hta218 merged 3 commits into
mainfrom
update/move-images-placeholders-to-schema

Conversation

@hta218

@hta218 hta218 commented Sep 15, 2026

Copy link
Copy Markdown
Member

Summary

IMAGES_PLACEHOLDERS was defined only in @weaverse/hydrogen, so @weaverse/next storefronts could not import it. This PR moves the constant into @weaverse/schema. Both adapters already export * from '@weaverse/schema', so each now exposes it with no extra re-export. The values and their docs are unchanged, and import { IMAGES_PLACEHOLDERS } from '@weaverse/hydrogen' still works.

Changes

  • Move IMAGES_PLACEHOLDERS from packages/hydrogen/src/index.ts to packages/schema/src/images-placeholders.ts and export it from @weaverse/schema
  • Pin @weaverse/schema to 0.15.0 (was 0.14.0) in @weaverse/hydrogen and @weaverse/next, and refresh pnpm-lock.yaml
  • Regenerate api-reports/: the constant moves from hydrogen.api.md to schema.api.md, and the runtime export report adds it to @weaverse/schema and @weaverse/next
  • Add spec .specs/2026-09-15--images-placeholders-in-schema/

Why the pins move to 0.15.0

Internal @weaverse/* dependencies resolve from npm. scripts/check-packed-packages.mjs only uses the packed schema tarball when a package's pin equals the workspace schema version. With the old 0.14.0 pins, packed hydrogen and next would install a registry schema without the constant, and their runtime exports would no longer match the report. 0.15.0 is the current workspace version and is already on npm, so pnpm install --frozen-lockfile keeps working.

Release order (required)

A published @weaverse/hydrogen pinned to a schema without the constant would drop IMAGES_PLACEHOLDERS from its public API. Publish in this order:

  1. @weaverse/schema 0.15.0 -> 0.16.0
  2. Re-pin @weaverse/schema to 0.16.0 in packages/hydrogen/package.json and packages/next/package.json before building them
  3. Fixed group (core, react, hydrogen), then the next @weaverse/next prerelease
  4. pnpm install once the new versions are on npm, then commit the lockfile

Verification

biome ci ., pnpm run typecheck, pnpm run test and pnpm run package:check pass locally.

@claude

claude Bot commented Sep 15, 2026

Copy link
Copy Markdown

Claude finished @hta218's task in 1m 40s —— View job


Claude finished reviewing this PR

Todo list

Review

This is a clean, well-scoped move. I verified the diff against origin/main matches the PR description exactly (11 files, +202/-133).

Verified correct:

  • IMAGES_PLACEHOLDERS (packages/schema/src/images-placeholders.ts) is a byte-for-byte relocation of the constant and its TSDoc from packages/hydrogen/src/index.ts — values and comments unchanged.
  • packages/schema/src/index.ts:388 re-exports it with the .js extension, consistent with the existing ./validation.js / ./page-seo.js convention in that file.
  • Since packages/hydrogen/src/index.ts and packages/next already do export * from '@weaverse/schema', both adapters keep exposing the constant with zero extra code — confirmed in api-reports/runtime-exports.api.md: the @weaverse/hydrogen export list still contains IMAGES_PLACEHOLDERS unchanged (flows through the wildcard re-export), while @weaverse/schema and @weaverse/next gained the new entry, matching the stated rationale.
  • The @weaverse/schema pin bump 0.14.00.15.0 in packages/hydrogen/package.json and packages/next/package.json is justified: scripts/check-packed-packages.mjs's acceptsPackedVersion(range, packedVersion) (line ~90) does a strict range === packedVersion equality check, so a stale 0.14.0 pin would have caused the packed-package check to install the real npm-published schema (without the constant) instead of the packed workspace tarball — exactly as described.
  • pnpm-lock.yaml and api-reports/schema.api.md / runtime-exports.api.md regenerations are consistent with the source change (no stray diffs).
  • Spec at .specs/2026-09-15--images-placeholders-in-schema/ follows the required template (Status/Owner/Created/Last Updated table, self-contained Initiating Requirement, plan.md under 500 lines with a "Files touched" list, release-order section called out explicitly).

Minor, non-blocking nits:

  • The spec's Status field is in-progress even though the PR appears feature-complete and ready for review/merge — consider updating to completed (or the appropriate status) once merged, per the SDD convention.
  • The PR body's "Release order" section is a good callout, but since it's operationally important (skipping it would silently drop IMAGES_PLACEHOLDERS from a published @weaverse/hydrogen), it may be worth also noting it in work-logs.md or as a comment near the pinned version fields so it isn't lost outside the PR description.

No correctness, security, or style issues found. I was unable to execute pnpm/biome/turbo commands directly in this sandboxed environment (commands required interactive approval that isn't available here), so I relied on static diff review plus the PR author's reported local verification (biome ci ., typecheck, test, package:check all passing).
· Branch: update/move-images-placeholders-to-schema

@hta218
hta218 merged commit 798365d into main Sep 15, 2026
12 checks passed
@hta218
hta218 deleted the update/move-images-placeholders-to-schema branch September 15, 2026 07:36
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