Skip to content
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

Update to allow commas #1023

Merged
merged 2 commits into from
Feb 23, 2025
Merged

Update to allow commas #1023

merged 2 commits into from
Feb 23, 2025

Conversation

jfhenon
Copy link
Collaborator

@jfhenon jfhenon commented Feb 23, 2025

PR description

Checklist

Note that we require UI tests to ensure that the added feature will not be
nixed by some future fix and that there is at least some test-as-documentation
to indicate how the fix or enhancement is expected to behave.

  • - Added Cypress UI tests
  • - Ran npm test, ensuring linting passes and that Cypress UI tests keep
    coverage to at least the same percent (reflected in the coverage badge
    that should be updated after the tests run)
  • - Added any user documentation. Though not required, this can be a big
    help both for future users and for the PR reviewer.

Summary by Sourcery

Updates the application to allow commas as separators in viewbox and transform attributes, and updates dependencies.

Bug Fixes:

  • Fixes an issue where the application could not parse viewbox attributes and transform attributes when they contained commas as separators.

Enhancements:

  • Updates multiple dependencies to their latest versions.

Copy link

sourcery-ai bot commented Feb 23, 2025

Reviewer's Guide by Sourcery

This pull request updates several dependencies in package.json and modifies the regular expression used to split the viewBox attribute in multiple files to include commas as delimiters, allowing for more flexible parsing of SVG data.

Sequence diagram for parsing viewBox attribute

sequenceDiagram
    participant SVGParser
    participant String

    SVGParser->>String: getAttribute("viewBox")
    String-->>SVGParser: viewBoxValue
    SVGParser->>SVGParser: split(/[ ,]+/)
    SVGParser-->>SVGParser: vbArray
Loading

Updated class diagram for SVG parsing

classDiagram
    class SVGParser {
      - viewBox: string
      + parseViewBox(viewBox: string): number[]
    }

    SVGParser : + Uses comma or space as delimiter
Loading

File-Level Changes

Change Details Files
Updated dependencies in package.json to their latest versions.
  • Updated core-js from 3.39.0 to 3.40.0
  • Updated i18next from 24.0.5 to 24.2.2
  • Updated jspdf from 2.5.2 to 3.0.0
  • Updated replace-in-file from ^8.2.0 to ^8.3.0
  • Updated svg2pdf.js from 2.2.4 to 2.4.0
  • Updated @babel/core from 7.26.0 to 7.26.9
  • Updated @babel/preset-env from 7.26.0 to 7.26.9
  • Updated @babel/runtime-corejs3 from 7.26.0 to 7.26.9
  • Updated @cypress/code-coverage from 3.13.8 to 3.13.11
  • Updated @rollup/plugin-node-resolve from 15.3.0 to 16.0.0
  • Updated @rollup/plugin-replace from 6.0.1 to 6.0.2
  • Updated core-js-bundle from 3.39.0 to 3.40.0
  • Updated cypress from 13.16.1 to 14.0.3
  • Updated cypress-multi-reporters from 2.0.4 to 2.0.5
  • Updated remark-lint-ordered-list-marker-value from 4.0.0 to 4.0.1
  • Updated rollup from 4.28.1 to 4.34.8
  • Updated start-server-and-test from 2.0.8 to 2.0.10
  • Updated @rollup/rollup-linux-x64-gnu from 4.28.1 to 4.34.8
package.json
Modified the regular expression used to split the viewBox attribute to include commas as delimiters.
  • Updated the regex in setSvgString to /[ ,]+/
  • Updated the regex in importSvgString to /[ ,]+/
  • Updated the regex in convertToGroup to /[ ,]+/
  • Updated the regex in setRotationAngle to /[ ,]+/
packages/svgcanvas/core/svg-exec.js
packages/svgcanvas/core/selected-elem.js
packages/svgcanvas/core/selection.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai 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 @jfhenon - I've reviewed your changes - here's some feedback:

Overall Comments:

  • This change introduces a regular expression to split the viewBox attribute, which is a good way to handle both spaces and commas as separators.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jfhenon jfhenon merged commit 42840d5 into master Feb 23, 2025
6 checks passed
@jfhenon jfhenon deleted the updates branch February 23, 2025 13:21
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