Commit graph

21 commits

Author SHA1 Message Date
Eric Rosenbaum
6dadf4c32a feat(sb3_schema.json): add origin field to meta info 2021-04-29 11:52:35 -04:00
Karishma Chadha
b808e7447f feat(schemas): add support for sprite files for 2.0 and 3.0
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
2018-05-02 23:46:26 -04:00
Karishma Chadha
705d806e9c fix(schema): escape '.' in regex patterns 2018-04-11 19:03:56 -04:00
Karishma Chadha
61a0694c70 style($schema): Remove extra new line 2018-04-11 09:12:43 -04:00
Karishma Chadha
06352bb11e refactor($schema): Account for mp3 sounds when considering pattern for 'md5ext' property. 2018-04-10 17:02:50 -04:00
Karishma Chadha
6b002ec49a refactor($schema): Uhdoing validation workaround for orphan shadow issue in scratch-blocks and scrat
Variables and lists are the only primitives that should exist at the top level.
2018-04-10 16:46:37 -04:00
Karishma Chadha
6427bb242b refactor($schema): Replace underscore with hyphen in video state enum. 2018-04-10 16:41:28 -04:00
Karishma Chadha
cc8ca6181b refactor($schema): Fix minor issues with schema
Only accept lowercase file extensions (serialization should ensure that these are saved lowercase),
add description for some constants.
2018-04-10 16:39:12 -04:00
Karishma Chadha
4918c08049 refactor($schema): Update video state enum replacing hyphen with underscore. 2018-04-06 16:53:12 -04:00
Karishma Chadha
4ced34a70f refactor($schema): Update validation of variables now that default project has been updated to use n 2018-04-06 14:53:56 -04:00
Karishma Chadha
ede7cc8864 refactor($schema): Add tempo, volume, and video related state to sb3 schema. 2018-04-06 14:53:56 -04:00
Karishma Chadha
3e9a4cd788 refactor($schema): Fix some validation issues. 2018-04-06 14:53:56 -04:00
Karishma Chadha
7bd778d6b5 refactor($schema): Handle new block serialization compression of primitives.
Update validation of sb3 projects to account for new block serialization that includes
precompression of primitives like the math_number or text blocks.
2018-04-06 14:53:56 -04:00
Andrew Sliwinski
0fe264a05b refactor: Merge changes from upstream and resolve issues with interface and test coverage
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.
2018-03-24 11:36:17 -04:00
Karishma Chadha
f9e47d2e29 fix($lib): Fix validator issues related to sb2 to sb3 conversion. 2018-03-23 17:48:29 -04:00
Karishma Chadha
a9c809ea4c fix($lib): Fix recorded sounds not being validated properly in sb3.
Recorded sounds were not being validated properly in sb3 because they were missing previously
required properties like 'rate' and 'sampleCount'. Removing these requirements.
2018-03-23 11:42:48 -04:00
Karishma Chadha
7dbc23c118 refactor($lib): Replace 'md5' property name with 'md5ext' in sb3 schema to reflect the ac 2018-03-23 09:38:57 -04:00
Karishma Chadha
faa0cdd30c refactor($lib): Remove runtime properties from sb3 schema that aren't ne 2018-03-23 09:38:34 -04:00
Karishma Chadha
1501c957c7 refactor($sb3_schema): Fix up schema to be more permissive.
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.
2018-03-23 09:38:14 -04:00
Karishma Chadha
e577e1caa3 refactor($sb3_schema): Allow capital letters in asset id ane md5 2018-03-23 09:38:14 -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