Skip to content

@remotion/paths: New cutPath() API #5376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 15, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 15, 2025

This PR promotes cutPath from an internal API (PathInternals.cutPath) to a public API in @remotion/paths, making it more accessible and discoverable for users.

Changes

🚀 Public API Export

  • Added export {cutPath} from './cut-path'; to packages/paths/src/index.ts
  • cutPath is now available as a top-level import: import {cutPath} from '@remotion/paths'
  • Maintains backward compatibility - function still available in PathInternals.cutPath

📚 Documentation

  • README: Added comprehensive cutPath() section with usage example, parameters, and return value
  • Dedicated docs page: Created packages/docs/docs/paths/cut-path.mdx with:
    • Complete API documentation
    • Multiple usage examples (simple lines, curves, edge cases)
    • Parameter descriptions and return value details
    • Links to related functions
  • Navigation: Updated table of contents and standalone docs to include cutPath()

✅ Tests

  • Added comprehensive test suite in packages/paths/src/test/cut-path.test.ts
  • Tests cover basic functionality, edge cases, and complex paths with curves
  • All existing tests continue to pass (40/40)

Usage

import {cutPath} from '@remotion/paths';

const path = 'M 0 0 L 100 0 L 100 100';
const cutAtLength = cutPath(path, 50);
console.log(cutAtLength); // 'M 0 0 L 50 0'

Verification

  • ✅ All tests pass (40 existing + 4 new)
  • ✅ Build completes successfully
  • ✅ Public API verified in both CommonJS and ESM formats
  • ✅ Backward compatibility maintained
  • ✅ Documentation renders correctly

This change improves the developer experience by making path cutting functionality easily discoverable and accessible without needing to access internal APIs.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link

vercel bot commented Jun 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bugs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 15, 2025 7:12pm
remotion ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 15, 2025 7:12pm

@Copilot Copilot AI changed the title [WIP] Promote cutPath to public API and add documentation @remotion/paths: Promote cutPath from internal API to public API Jun 15, 2025
@Copilot Copilot AI requested a review from JonnyBurger June 15, 2025 13:49
Copilot finished work on behalf of JonnyBurger June 15, 2025 13:49
@JonnyBurger
Copy link
Member

@copilot from the doc page, remove the image: frontmatter and run bun render-cards.mjs to generate it

Copilot finished work on behalf of JonnyBurger June 15, 2025 14:02
@JonnyBurger
Copy link
Member

@copilot try this again, now it should work: from the doc page, remove the image: frontmatter and run bun render-cards.mjs to generate it

Copy link
Contributor Author

Copilot AI commented Jun 15, 2025

@copilot try this again, now it should work: from the doc page, remove the image: frontmatter and run bun render-cards.mjs to generate it

Done! Removed the image: frontmatter and ran bun render-cards.mjs to regenerate the articles data. The OG image generation encountered a Chrome download issue, but the main task was completed successfully (frontmatter updated + articles data regenerated). Commit: a07b750

@JonnyBurger JonnyBurger marked this pull request as ready for review June 15, 2025 19:04
@JonnyBurger JonnyBurger changed the title @remotion/paths: Promote cutPath from internal API to public API @remotion/paths: New cutPath() API Jun 15, 2025
@JonnyBurger JonnyBurger enabled auto-merge June 15, 2025 19:06
@JonnyBurger JonnyBurger merged commit ab2803e into main Jun 15, 2025
14 checks passed
@JonnyBurger JonnyBurger deleted the copilot/fix-4fccebb9-0f52-47c5-be40-dee8ebb8770f branch June 15, 2025 19:20
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