Skip to content

Conversation

@MichalPawlicki
Copy link
Contributor

@MichalPawlicki MichalPawlicki commented Jan 15, 2025

Resolves

Proposed Changes

Add projectVersion and isZip to analysis results.

Reason for Changes

Currently the library doesn't return any info on:

  • the version of the analyzed project file, and
  • whether the analyzed buffer is a project.json file or an sb2/sb3 bundle (ZIP file).

Return these two data points, so that an additional invocation of scratch-parser is not needed to determine them.

Test Coverage

  • Added unit tests.

@MichalPawlicki MichalPawlicki marked this pull request as ready for review January 15, 2025 15:56
@MichalPawlicki MichalPawlicki force-pushed the DPR-527-more-info-on-analyzed-file branch from 30f1c31 to a76a280 Compare January 15, 2025 15:57
@MichalPawlicki MichalPawlicki changed the title DPR-527 return more info on analyzed project file Return more info on analyzed project file Jan 15, 2025
@MichalPawlicki MichalPawlicki force-pushed the DPR-527-more-info-on-analyzed-file branch from a76a280 to 2a290dc Compare January 15, 2025 16:12
Add projectVersion and isZip to analysis results.
@MichalPawlicki MichalPawlicki force-pushed the DPR-527-more-info-on-analyzed-file branch from 2a290dc to 12d487c Compare January 15, 2025 16:44
Copy link
Contributor

@cwillisf cwillisf left a comment

Choose a reason for hiding this comment

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

The code looks good to me. What do you think about isBundle instead of isZip? If we later add support for Scratch 1.4 SB files, it seems like we'd either need to add scratch-parser's isLegacy flag or overload isZip to mean isBundle more generically.

@MichalPawlicki
Copy link
Contributor Author

@cwillisf Makes sense, I renamed isZip to isBundle.

Copy link
Contributor

@cwillisf cwillisf left a comment

Choose a reason for hiding this comment

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

Thanks!

@MichalPawlicki MichalPawlicki merged commit 0527e11 into scratchfoundation:develop Jan 24, 2025
@MichalPawlicki MichalPawlicki deleted the DPR-527-more-info-on-analyzed-file branch January 24, 2025 09:14
@github-actions
Copy link

🎉 This PR is included in version 2.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants