Commit graph

151 commits

Author SHA1 Message Date
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
Karishma Chadha
2e1c7e96f0 docs(index): Update jsdocs for function exported by index.js. 2018-02-26 15:45:19 -05: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
kchadha
f738a89b67
Merge pull request #15 from kchadha/zip-refactor
build(unpack): Swap out 3rd party zip library
2018-02-26 13:19:37 -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
Matthew Taylor
6e8f55a01c Merge branch 'develop'
* develop:
  fix($schema): Removes 'sounds' from required array in JSON schema
2017-09-11 11:55:42 -04:00
Matthew Taylor
791bbab99b Merge pull request #14 from thisandagain/bugfix/13
Remove 'sounds' from required array in JSON schema
2017-09-11 11:48:50 -04: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
Matthew Taylor
ee28344ca3 Merge branch 'develop'
* develop:
  fix(analyze): Resolve issues with block and sprite counts
2017-05-26 10:34:38 -04:00
Andrew Sliwinski
040933fc56 Merge pull request #11 from thisandagain/bugfix/10
Resolve analysis issues with sprite and block counts
2017-05-24 09:46:27 -07: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
Matthew Taylor
492d420147 1.0.0 2017-03-22 15:14:25 -04:00
Matthew Taylor
99e48626e7 build(release): Configure semantic release
Use semantic release to publish to npm
2017-03-22 15:00:51 -04:00
Matthew Taylor
fafabe619d Merge pull request #9 from LLK/develop
build(release): Configure semantic release
2017-03-22 14:39:48 -04:00
Matthew Taylor
dd72cea18a build(release): Configure semantic release
Use semantic release to publish to npm
2017-03-22 14:37:29 -04:00
Matthew Taylor
e30a772c8a Merge pull request #8 from mewtaylor/feature/add-semver
Configure semantic-release
2017-03-22 14:12:25 -04:00
Matthew Taylor
79810ecd61 Remove linter working from copy/paste
thanks @rschamp :)
2017-03-21 16:24:45 -04:00
Matthew Taylor
ddac1fdc01 Configure semantic-release
This adds and sets up the `semantic-release` package to use commits and travis to do automated semantic versioning and publishing to npm for scratch-parser.

It also adds a readme section about committing, and using `git cz` to handle formatting of commits in a way that is parseable and deployable by `semantic-release`.

This setup is based on the existing release setup in `eslint-config-scratch`.
2017-03-21 15:42:32 -04:00
Andrew Sliwinski
cfb2b527c5 Update dependencies 2016-09-19 10:19:32 -04:00
Andrew Sliwinski
688c9800d4 Update david-dm badges 2016-09-19 10:19:24 -04:00
Andrew Sliwinski
b6479ca9cc Add license and trademark files for release 2016-09-19 10:16:16 -04:00
Andrew Sliwinski
3ebd5f662c Update README to track travis-ci.org 2016-09-19 10:12:04 -04:00
Andrew Sliwinski
b0720fae03 Update docs 2016-03-18 20:39:41 -04:00
Andrew Sliwinski
1e113bb75d Merge pull request #2 from thisandagain/develop
Initial version
2016-03-18 20:31:56 -04:00
Andrew Sliwinski
85c61c09e9 Drop support for Node 0.12 as per Buffer API 2016-03-18 20:30:11 -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