Skip to content

Fix/sanitize play exports#1679

Open
aniketmishra-0 wants to merge 4 commits intoreactplay:mainfrom
aniketmishra-0:fix/sanitize-play-exports
Open

Fix/sanitize play exports#1679
aniketmishra-0 wants to merge 4 commits intoreactplay:mainfrom
aniketmishra-0:fix/sanitize-play-exports

Conversation

@aniketmishra-0
Copy link
Contributor

Before creating this PR, please confirm the following:


First thing, PLEASE READ THIS: ReactPlay Code Review Checklist

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots or example output

aniket and others added 3 commits February 10, 2026 20:35
…y#1667)

- Add touchEventsTarget='container' to Swiper so touch listeners attach to container instead of wrapper
- Add grabCursor for visual drag feedback on desktop
- Fix className bug: home && 'h-32' → home ? 'h-32' : '' to prevent 'false' string in DOM
- Add touchAction: 'pan-y' on blockquote to allow horizontal swipes to pass through to Swiper

Closes reactplay#1667
…rboard UI

- Fix mobile drawer not closing on outside click (useRef + click-outside listener)
- Fix CSS transform creating containing block issue (translateY(0) → none)
- Add global padding-top for fixed navbar offset (64px, excluding footer)
- Add extra home hero padding for activity banner
- Add try/catch error handling in testimonial fetches
- Fix ESLint jsx-sort-props (shorthand booleans first)
- Center leaderboard loading spinner
- Remove overflow-hidden from leaderboard page
- Import leaderBoard.css in LeaderBoard component
Adds a sanitize-play-exports script that converts invalid JavaScript
identifiers (e.g. Bmr-TdeeCalculator) to valid PascalCase identifiers.
The script runs automatically as part of start, start:nolint, and build
commands, fixing the SyntaxError that caused Netlify deploy failures.
Copilot AI review requested due to automatic review settings February 15, 2026 18:09
@netlify
Copy link

netlify bot commented Feb 15, 2026

Deploy Preview for reactplayio ready!

Name Link
🔨 Latest commit 84f2d3f
🔍 Latest deploy log https://app.netlify.com/projects/reactplayio/deploys/69920bfb3284220008d9fe84
😎 Deploy Preview https://deploy-preview-1679--reactplayio.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hey! contributor, thank you for opening a Pull Request 🎉.

@reactplay/maintainers will review your submission soon and give you helpful feedback. If you're interested in continuing your contributions to open source and want to be a part of a welcoming and fantastic community, we invite you to join our ReactPlay Discord Community.
Show your support by starring ⭐ this repository. Thank you and we appreciate your contribution to open source!
Stale Marking : After 30 days of inactivity this issue/PR will be marked as stale issue/PR and it will be closed and locked in 7 days if no further activity occurs.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a build/start-time sanitation step for src/plays/index.js exports (generated by create-react-play), and includes several UI/UX adjustments across header spacing, leaderboard loading layout, and testimonials fetching/interaction.

Changes:

  • Add a sanitize-play-exports node script and run it during start, start:nolint, and build.
  • Adjust fixed-header layout behavior and page top offsets.
  • Improve testimonials fetching resilience and tweak Swiper/touch scrolling behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/common/playleaderboard/leaderBoard.css Adds a centered loader layout for the leaderboard loading state.
src/common/playleaderboard/LeaderBoard.jsx Imports leaderboard CSS locally and adjusts main container class usage.
src/common/home/home.css Adds a fixed top padding intended to offset an activity banner on the home page.
src/common/header/header.css Changes visible transform behavior and adds a global padding rule to offset fixed header.
src/common/header/HeaderNav.jsx Adds click-outside handling to close the mobile drawer menu.
src/common/Testimonial/Testimonials.jsx Wraps testimonial fetch in try/catch and normalizes empty results.
src/common/Testimonial/TestimonialSection.jsx Wraps fetch in try/catch and adjusts Swiper interaction props.
src/common/Testimonial/TestimonialCard.jsx Tweaks blockquote class construction and adds touchAction to improve scrolling.
scripts/sanitize-play-exports.cjs New script to sanitize/uniquify play export aliases in src/plays/index.js.
package.json Runs the sanitize script as part of start/build flows and bumps TypeScript version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +76 to +79
let nextSource = nextLines.join(newline);
if (hasTrailingNewline) {
nextSource += newline;
}
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

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

This block will append an extra newline every time the script runs (because join(newline) already retains the trailing newline from the split). Suggest removing this conditional append, or trimming the trailing empty line before join and then re-adding exactly one newline.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +17
const source = fs.readFileSync(indexPath, 'utf8');
const newline = source.includes('\r\n') ? '\r\n' : '\n';
const hasTrailingNewline = source.endsWith('\n');
const lines = source.split(/\r?\n/);
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

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

source.split(/\r?\n/) preserves a trailing empty string when the file ends with a newline. Combined with later join(newline), this already reproduces the trailing newline, so any separate “re-add trailing newline” step will introduce an extra blank line each run.

Copilot uses AI. Check for mistakes.
Copy link
Member

@priyankarpal priyankarpal left a comment

Choose a reason for hiding this comment

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

can you mention issue number?

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