Skip to content

chore: stater updates to integrate with skill#1154

Merged
benlife5 merged 8 commits into2026-custom-components-templatesfrom
starter-codex-updates
Apr 14, 2026
Merged

chore: stater updates to integrate with skill#1154
benlife5 merged 8 commits into2026-custom-components-templatesfrom
starter-codex-updates

Conversation

@benlife5
Copy link
Copy Markdown
Contributor

@benlife5 benlife5 commented Apr 10, 2026

Various updates for the starter to integrate better with the skill

  • TS config + easy typecheck commmand
  • ReactEmail, Mantine, Radix library support
  • localDev "view preview" button that uses <Render>

@benlife5 benlife5 changed the title updates to work with skill chore: stater updates to integrate with skill Apr 10, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c85e4b5c-7031-41e4-b80b-9e655c649f2c

📥 Commits

Reviewing files that changed from the base of the PR and between 24b0a57 and 50d1089.

⛔ Files ignored due to path filters (1)
  • packages/visual-editor/src/components/testing/screenshots/StaticMapSection/[desktop] default props with coordinate - with api key.png is excluded by !**/*.png, !packages/visual-editor/src/components/testing/screenshots/**
📒 Files selected for processing (3)
  • starter/src/index.css
  • starter/src/templates/dev.tsx
  • starter/tsconfig.json
✅ Files skipped from review due to trivial changes (1)
  • starter/tsconfig.json

Walkthrough

This PR adds Mantine integration and a Puck preview mode to the starter: updates dependencies (React, Mantine, Radix consolidation), adds a typecheck npm script, adds PostCSS plugins and Mantine CSS import, introduces tsconfig.json, updates UI/CSS for a floating control, and enhances starter/src/templates/dev.tsx to detect preview=true in the URL, hydrate/decompress preview state from localStorage (lz-string), listen for cross-tab storage changes, and switch between the Editor and Puck <Render /> accordingly.

Sequence Diagram

sequenceDiagram
    actor User
    participant Browser as "Browser / URL"
    participant DevTemplate as "Dev Template (dev.tsx)"
    participant LocalStorage as "localStorage"
    participant PuckRender as "@puckeditor/core Render"
    participant Editor as "Yext Editor"

    User->>Browser: Open page (may include preview=true)
    Browser->>DevTemplate: Mount with query params
    DevTemplate->>DevTemplate: Check URL for preview=true
    alt Preview Mode
        DevTemplate->>LocalStorage: Read preview key (computed hash)
        LocalStorage-->>DevTemplate: Return compressed history
        DevTemplate->>DevTemplate: Decompress (lz-string) & parse, extract latest state.data
        DevTemplate->>PuckRender: Render with currentPuckData
        DevTemplate->>DevTemplate: Register window storage listener
        User->>LocalStorage: Update preview data in another tab
        LocalStorage-->>DevTemplate: storage event fired
        DevTemplate->>DevTemplate: Refresh currentPuckData
        DevTemplate->>PuckRender: Re-render with updated data
    else Normal Mode
        DevTemplate->>Editor: Render Editor UI (VisualEditorProvider)
        User->>DevTemplate: Click "Open Preview"
        DevTemplate->>Browser: Append preview=true to URL and navigate
    end
Loading

Possibly related PRs

Suggested labels

create-dev-release

Suggested reviewers

  • briantstephan
  • jwartofsky-yext
🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'chore: stater updates to integrate with skill' is partially related but contains a typo ('stater' should be 'starter') and is somewhat generic; it describes the overall intent rather than the main technical change. Clarify the title to be more specific about the primary change (e.g., 'chore: add TypeScript config and preview mode to starter') and fix the typo 'stater' to 'starter'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description is well-related to the changeset, clearly outlining the main additions: TypeScript configuration, library support, and the preview button feature with supporting documentation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch starter-codex-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
starter/src/templates/dev.tsx (1)

45-53: Consider documenting the hash function's collision tolerance.

The hashCode function uses a simple string hash that can produce collisions for different URLs. For local dev storage keys this is likely acceptable, but a brief comment would clarify the intent and acceptable collision risk.

📝 Optional: Add clarifying comment
+/**
+ * Simple string hash for generating localStorage keys.
+ * Collisions are acceptable for local dev preview storage.
+ */
 const hashCode = (value: string): number => {
   let hash = 0;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@starter/src/templates/dev.tsx` around lines 45 - 53, The hashCode function
uses a simple non-cryptographic string hash that can produce collisions; add a
brief clarifying comment above the hashCode definition stating that this
function is intentionally lightweight for local dev storage keys, that
occasional collisions are acceptable for this use-case, and note any
implications (e.g., not suitable for security or uniqueness guarantees) so
future readers understand the risk and intent when using hashCode.
starter/tsconfig.json (1)

14-15: Consider simplifying the exclude array.

The ../node_modules path is unusual since tsconfig.json is at the starter/ root. TypeScript's default behavior already excludes node_modules from compilation. The relative parent path may be a remnant from a different directory structure.

🧹 Suggested simplification
-  "exclude": ["../node_modules", "node_modules"]
+  "exclude": ["node_modules"]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@starter/tsconfig.json` around lines 14 - 15, Remove the unnecessary
"../node_modules" entry from the tsconfig.json "exclude" array (and optionally
remove the entire "exclude" array since TypeScript excludes "node_modules" by
default); edit the "exclude" array that currently contains "../node_modules" and
"node_modules" so it only contains "node_modules" or delete it entirely to
simplify the config and avoid referencing an incorrect parent path.
starter/package.json (1)

49-49: Minor version format inconsistency for react-is.

The dependency uses an exact version (18.3.1) while the override uses a caret (^18.3.1). Consider aligning them for consistency—either both exact or both with caret range.

🧹 Suggested alignment (prefer exact to match dependency)
   "overrides": {
     "vite": {
       "rollup": "npm:`@rollup/wasm-node`@^4.59.0"
     },
-    "react-is": "^18.3.1"
+    "react-is": "18.3.1"
   }

Also applies to: 74-76

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@starter/package.json` at line 49, Dependency version for react-is is
inconsistent between the main dependency and overrides — change the package
entry "react-is": "18.3.1" to match the override format (or vice versa) so both
use the same semantic form; identify the package.json entries named "react-is"
in dependencies and in overrides and update them to the same format (prefer
exact version "18.3.1" to match the dependency, or change both to "^18.3.1" if
you prefer range) and apply the same normalization to the other affected entries
referenced in the comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@starter/src/templates/dev.tsx`:
- Around line 225-231: isPreviewMode is being read during render from
window.location which causes SSR/client hydration mismatch; change the
implementation to compute isPreviewMode on the client after mount (e.g.
initialize a React state like [isPreviewMode, setIsPreviewMode] via useState
with a safe default false and then set it inside useEffect by reading new
URLSearchParams(window.location.search).get("vePreview") === "1"), and keep
previewStorageKey as a useMemo or compute it similarly on the client if it
depends on window; update any code using isPreviewMode to rely on the state
variable instead of the current top-level const to avoid hydration mismatches
(references: isPreviewMode, previewStorageKey,
getVisualConfigLocalStorageKeyForDev).

---

Nitpick comments:
In `@starter/package.json`:
- Line 49: Dependency version for react-is is inconsistent between the main
dependency and overrides — change the package entry "react-is": "18.3.1" to
match the override format (or vice versa) so both use the same semantic form;
identify the package.json entries named "react-is" in dependencies and in
overrides and update them to the same format (prefer exact version "18.3.1" to
match the dependency, or change both to "^18.3.1" if you prefer range) and apply
the same normalization to the other affected entries referenced in the comment.

In `@starter/src/templates/dev.tsx`:
- Around line 45-53: The hashCode function uses a simple non-cryptographic
string hash that can produce collisions; add a brief clarifying comment above
the hashCode definition stating that this function is intentionally lightweight
for local dev storage keys, that occasional collisions are acceptable for this
use-case, and note any implications (e.g., not suitable for security or
uniqueness guarantees) so future readers understand the risk and intent when
using hashCode.

In `@starter/tsconfig.json`:
- Around line 14-15: Remove the unnecessary "../node_modules" entry from the
tsconfig.json "exclude" array (and optionally remove the entire "exclude" array
since TypeScript excludes "node_modules" by default); edit the "exclude" array
that currently contains "../node_modules" and "node_modules" so it only contains
"node_modules" or delete it entirely to simplify the config and avoid
referencing an incorrect parent path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 982101be-5162-46d9-944c-135fbc21df26

📥 Commits

Reviewing files that changed from the base of the PR and between a2c6e9a and ad7d58e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • starter/package.json
  • starter/postcss.config.mjs
  • starter/src/templates/dev.tsx
  • starter/src/ve.config.tsx
  • starter/tsconfig.json

Comment thread starter/src/templates/dev.tsx Outdated
asanehisa
asanehisa previously approved these changes Apr 13, 2026
asanehisa
asanehisa previously approved these changes Apr 13, 2026
mkilpatrick
mkilpatrick previously approved these changes Apr 13, 2026
@yext-bot yext-bot dismissed stale reviews from mkilpatrick and asanehisa via 9d79618 April 13, 2026 16:14
asanehisa
asanehisa previously approved these changes Apr 13, 2026
@jwartofsky-yext
Copy link
Copy Markdown
Contributor

Various updates for the starter to integrate better with the skill

  • TS config + easy typecheck commmand
  • ReactEmail, Mantine, Radix library support
  • localDev "view preview" button that uses <Render>

Can you explain why we need the localDev preview? Is it just previewing how the live page looks outside of the editor?

Comment thread starter/src/templates/dev.tsx Outdated
Comment thread starter/src/templates/dev.tsx
Comment thread starter/src/templates/dev.tsx
Comment thread starter/src/templates/dev.tsx
@benlife5
Copy link
Copy Markdown
Contributor Author

Oops sorry @jwartofsky-yext, I thought I had pushed my changes

Copy link
Copy Markdown
Contributor

@jwartofsky-yext jwartofsky-yext left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@benlife5 benlife5 merged commit bcca752 into 2026-custom-components-templates Apr 14, 2026
17 checks passed
@benlife5 benlife5 deleted the starter-codex-updates branch April 14, 2026 17:58
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.

4 participants