Commit graph

8 commits

Author SHA1 Message Date
Karishma Chadha
7f8672dfbc refactor($lib): Add callback wrapper around JSZip promise-based interface. Refactor m
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.
2018-03-23 09:37:48 -04:00
Karishma Chadha
a74a97a906 feat($lib): Add sb3 schema for validation of Scratch 3.0 projects.
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.
2018-03-23 09:37:24 -04:00
Karishma Chadha
7e6cb8327a feat(unpack): Unpacker can now take string as input.
Allow unpacker to properly handle string as input, so that project json string (loaded from
scratch-storage) can be fed into scratch-parser.
2018-02-26 15:42:12 -05:00
Karishma Chadha
103db490a3 build(unpack): Swap out 3rd party zip library
Swapping out adm-zip dependency with jszip for use with the browser.
2018-02-25 21:19:51 -05:00
Andrew Sliwinski
9322967b5c fix($schema): Removes 'sounds' from required array in JSON schema
Removes 'sounds' from required array in JSON schema as to resolve edge case discovered in GH-13

GH-13
2017-09-01 19:53:17 -03:00
Andrew Sliwinski
bf56efd280 fix(analyze): Resolve issues with block and sprite counts
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
2017-05-12 16:31:33 -04:00
Andrew Sliwinski
a0a03ef679 Initial functioning parser 2016-03-18 19:51:40 -04:00
Andrew Sliwinski
4642c66e08 Initial WIP commit with streaming parser 2016-03-15 10:31:35 -04:00