Moved to kebab-case formatting signup-form#16
Conversation
- renamed files to kebab-case Changelog for v0.3.2 -> 0.3.3:
WalkthroughThe PR refactors the signup-form app to use kebab-case filename conventions, updating all corresponding import paths throughout the codebase. Additionally, it introduces an ESLint rule enforcing this naming convention, increments the package version, and makes minor functional adjustments to email handling and URL history logic. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
apps/signup-form/src/components/pages/form-page.tsx (1)
27-30: Reset loading state on minimal success.In minimal mode,
setLoading(true)is never cleared, so the UI can stay stuck in a loading state (Line 27–Line 30).✅ Proposed fix
if (minimal) { // Don't go to the success page, but show the success state in the form setSuccess(true); + setLoading(false); } else { setPage('SuccessPage', { email }); }apps/signup-form/src/utils/helpers.tsx (1)
40-46: Avoid returningundefinedURL history and skipping fallback.
getDefaultUrlHistory()can returnundefined. Returning it unconditionally breaks theURLHistorycontract and bypasses the fallback history construction, which can break callers expecting an array. Return only when history is present or fall back to the constructed history.🛠️ Suggested fix
- if (window.location.host === new URL(siteUrl).host) { - const history = getDefaultUrlHistory(); - return history; - } + if (window.location.host === new URL(siteUrl).host) { + const history = getDefaultUrlHistory(); + if (history && Array.isArray(history)) { + return history; + } + // fall through to build a minimal history entry + }
🧹 Nitpick comments (1)
apps/signup-form/.eslintrc.cjs (1)
18-31: Verify filename regex scope and align comment with behavior.The regex assumes basename-only matching and allows dots/flat lowercase, which doesn’t strictly equal “kebab-case.” Please confirm
ghost/filenames/match-regexmatches the basename (not the full path) and decide whether to tighten the regex or update the comment for clarity.♻️ Optional comment tweak to match current regex
- // Enforce kebab-case (lowercase with hyphens) for all filenames + // Enforce lowercase filenames; hyphens and dots (extensions) allowed 'ghost/filenames/match-regex': ['error', '^[a-z0-9.-]+$', false],
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
apps/signup-form/.eslintrc.cjsapps/signup-form/.storybook/preview.tsxapps/signup-form/README.mdapps/signup-form/package.jsonapps/signup-form/src/app-context.tsapps/signup-form/src/app.tsxapps/signup-form/src/components/content-box.tsxapps/signup-form/src/components/frame.tsxapps/signup-form/src/components/iframe.tsxapps/signup-form/src/components/pages/form-page.tsxapps/signup-form/src/components/pages/form-view.stories.tsapps/signup-form/src/components/pages/form-view.tsxapps/signup-form/src/components/pages/success-page.tsxapps/signup-form/src/components/pages/success-view.stories.tsapps/signup-form/src/components/pages/success-view.tsxapps/signup-form/src/index.tsxapps/signup-form/src/pages.tsxapps/signup-form/src/preview.stories.tsxapps/signup-form/src/utils/helpers.tsxapps/signup-form/src/utils/options.tsxapps/signup-form/test/utils/is-test-env.jsghost/core/core/shared/config/defaults.json
🔇 Additional comments (12)
ghost/core/core/shared/config/defaults.json (1)
305-305: No functional impact here.
Whitespace-only change; looks safe.apps/signup-form/package.json (1)
3-3: Version bump looks consistent with the refactor.apps/signup-form/.storybook/preview.tsx (1)
6-6: Import path update aligns with kebab-case rename.apps/signup-form/src/index.tsx (1)
1-1: Import path update is consistent with the rename.apps/signup-form/src/components/pages/form-view.tsx (2)
3-3: Import path update is consistent with kebab-case renames.
56-56: Nice touch trimming email before submit.apps/signup-form/src/components/pages/success-view.tsx (1)
3-3: Import path update aligns with the rename.apps/signup-form/src/components/pages/success-view.stories.ts (1)
3-3: Import casing update looks good.Keeps module resolution consistent on case-sensitive filesystems (Line 3).
apps/signup-form/src/components/pages/success-page.tsx (1)
2-3: Import casing update looks good.No behavioral impact; aligns with kebab-case rename (Line 2–Line 3).
apps/signup-form/README.md (1)
45-62: Release documentation addition is clear.Nice to have explicit patch vs. minor/major steps and Ghost core update note (Line 45–Line 62).
apps/signup-form/src/components/frame.tsx (1)
1-5: Import casing update looks good.No runtime impact; aligns with kebab-case paths (Line 1, Line 5).
apps/signup-form/src/app.tsx (1)
4-6: Import casing update looks good.Consistent with repo-wide kebab-case migration (Line 4–Line 6).
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Benchmark PR from qodo-benchmark#250
Summary by CodeRabbit
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.