Commit graph

77 commits

Author SHA1 Message Date
kchadha
5daad968a4
Merge pull request #36 from kchadha/escape-dot
fix(schema): escape '.' in regex patterns
2018-04-12 10:07:45 -04:00
Karishma Chadha
705d806e9c fix(schema): escape '.' in regex patterns 2018-04-11 19:03:56 -04:00
Karishma Chadha
c36b30c14a chore(semver): bump major version
Bump a major version change to reflect recent unreleased changes

BREAKING CHANGE: version bump
2018-04-11 18:42:51 -04:00
kchadha
b8830be63e
Merge pull request #35 from kchadha/semantic-release-config
chore(semantic-release): reconfigure semantic-release
2018-04-11 18:29:48 -04:00
Karishma Chadha
5a4939dfb8 chore(config): update travis.yml and package.json 2018-04-11 18:21:22 -04:00
Karishma Chadha
79215ba323 chore(semantic-release): reconfigure semantic-release
use semantic-release-cli to set up semantic-release package properly
2018-04-11 18:04:29 -04:00
kchadha
ee75d3cbad
Merge pull request #34 from kchadha/commit-fix
fix(commits): issue new commit with correct style for semantic release
2018-04-11 17:26:32 -04:00
Karishma Chadha
b6ee0f7500 fix(commits): issue new commit with correct style for semantic release
This change is marked as containing breaking changes because prior commits did not get parsed
correctly with semantic-release. This change should issue a new version of scratch-parser containing
changes to the sb2 and sb3 schemas, added support for gzipped file, and corresponding tests.

BREAKING CHANGE: changes to sb2 validation, sb3 validation (block serialization is more compact),
added support for gzipped json files
2018-04-11 17:21:37 -04:00
Ray Schamp
7745539a13
Merge pull request #33 from rschamp/commit-lint
chore(semver): add commit-lint
2018-04-11 16:52:31 -04:00
Ray Schamp
4cb940a65b chore(semver): add commit-lint
Use commit-lint commit hooks so that our commits will work with semver.  Also works with Travis so PRs containing invalid commits will fail tests.
2018-04-11 15:19:30 -04:00
kchadha
79d5b8f89e
Merge pull request #32 from kchadha/block-serialization-compression
Block serialization compression
2018-04-11 14:48:43 -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
kchadha
225d9a60c1
Merge pull request #29 from kchadha/sb2-validation-fixes
Sb2 validation fixes
2018-04-06 14:53:26 -04:00
Karishma Chadha
efbe1e4550 fix($schema): Fix another validation error with 2.0 projects. 'videoAlpha' is not always available b
#27
2018-04-06 14:41:58 -04:00
Karishma Chadha
77b9bec8f8 fix($schema): Fix #27. 'penLayerMd5' can be null, and 'swfVersion' is not always provided in the inf
fix #27
2018-04-06 13:50:33 -04:00
kchadha
3f06d046e0
Merge pull request #28 from kchadha/gzip-support
Gzip support
2018-04-05 17:18:19 -04:00
Karishma Chadha
36b90ce8c6 test($test): Add tests for new gzip support. 2018-04-05 13:34:56 -04:00
Karishma Chadha
9cf4d13ba8 feat($lib): Add support for gzipped inputs.
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.
2018-04-05 13:32:06 -04:00
Andrew Sliwinski
ce9c5ff58a
Merge pull request #24 from thisandagain/feature/refactor
Refactor and remove analysis functionality
2018-03-24 13:32:51 -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
Andrew Sliwinski
f7cb29dff6 refactor: Extricates analysis from the scope of this project
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.
2018-03-24 11:19:01 -04:00
Andrew Sliwinski
e8369be7f5 refactor: Refactor library to use latest scratch eslint rules and update all dependencies
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
2018-03-24 11:09:43 -04:00
Andrew Sliwinski
7e53f43e24
Merge pull request #23 from kchadha/validator-fixes
SB3 Schema fixes
2018-03-24 10:59:21 -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
663d6ee8e6 test($test): Rename zip to unzip for clarity. Add descriptive error message to
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).
2018-03-23 09:38:14 -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
f767d6d4cb test($test): Fix up and add to existing tests.
Fixed up existing test coverage to accommodate the recent breaking changes.
2018-03-23 09:38:14 -04:00
Karishma Chadha
9e45007e7e refactor($index): Selectively call analyze on 2.0 projects only. 2018-03-23 09:38:14 -04:00
Karishma Chadha
b7c1cfd347 docs($index): Documentation for new zip returning functionality of main api function. 2018-03-23 09:38:14 -04:00
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
Ray Schamp
f6421729a7
Merge pull request #19 from LLK/develop
Merge branch 'develop'
2018-03-01 14:33:28 -05:00
kchadha
ac57b1c749
Merge pull request #18 from LLK/revert-17-configure-release
Revert "build(package.json): Configure release branch to be develop"
2018-03-01 14:23:13 -05:00
kchadha
82d9857323
Revert "build(package.json): Configure release branch to be develop" 2018-03-01 14:18:28 -05:00
kchadha
888d7b2d80
Merge pull request #17 from kchadha/configure-release
build(package.json): Configure release branch to be develop
2018-03-01 13:51:25 -05:00
Karishma Chadha
7e6ff6e04c build(package.json): Configure release branch to be develop 2018-03-01 13:46:50 -05:00
kchadha
e9cf4958b8
Merge pull request #16 from kchadha/allowing-json-strings
Allow unpacker to handle JSON strings.
2018-02-27 11:54:06 -05:00