remove gzip dependency and support for gzip files as that was an unused code path
BREAKING CHANGE: Gzipped files are no longer supported as input to the parser.
Uses a pattern to find the sprite or project json in a zipped folder or flat list of files.
Added tests for
* loading a sprite or project with a nested folder
* loading a file without a json
Fixes#42
A comment's x and y can be null. This will occur if a project is imported from 2.0, a sprite that is
not currently selected has comments, and that project is immediately saved in 3.0 without switching
to the other sprite that has comments.
refactor schemas to support sprite2 and sprite3 files, while reusing rules in common with sb2 and
sb3 files
BREAKING CHANGE: Change to main API which now takes an additional boolean argument indicating
whether a sprite or project is being validated
Update validation of sb3 projects to account for new block serialization that includes
precompression of primitives like the math_number or text blocks.
BREAKING CHANGE: Changes to the unzip library function. It takes an extra argument describing
whether the given input should be unpacked as a gzip file. Otherwise unpacks as a zip file.
Merges in changes from upstream and resolves issues with both the removal of the analysis library as
well as issues with lint rules and integration tests.
Removes the ./lib/analysis module from the scope of this project along with all related
documentation and test coverage.
BREAKING CHANGE: Module no longer provides a _meta object with returned project object.
Refactors library to use latest scratch eslint rules. Updates all dependencies to latest versions
which requires minor changes to the JSON schema, tests, and supported engine (8+)
BREAKING CHANGE: Module no longer supports less than Node 8
Recorded sounds were not being validated properly in sb3 because they were missing previously
required properties like 'rate' and 'sampleCount'. Removing these requirements.
Added unit tests for unzip and added a user-friendly error message for unzip being unable to perform
its duties of extracting a project.json from the given input (zip).
Field and input values can be strings or numbers. TopLevel property is not required of blocks. VM
version property should be more permissive and follow semantic release convention.
Refactor unpack and main exported function to return optional zip, if originally provided, in
addition to the validated project.
BREAKING CHANGE: Change to main api to return originally provided zip (or null if string was
provided) along with validated project, in a 2-element array.
Added sb3 schema, renamed sb2 schema, and updated validate to check given input against both sb2 and
sb3 schemas. Validate appends a projectVersion to the given project with 2 or 3 if the given project
is valid against the corresponding schema. Validate now returns an object containing an error
message and both the sb2 and sb3 validation errors upon failure to validate against both schemas.
BREAKING CHANGE: Changes to validate API and what it returns (namely, error returned by validate is
no longer a string, but is now an object which contains an error message string as well as the sb2
errors and the sb3 errors). Users of this library function should expect to parse the given error to
figure out why validation failed.
Resolves issue where sprite counts were inflated due to global variables and lists as well as an
issue where block counts were deflated due to improper handling of nested block structures
GH-10