Skip to content

Commit fafabe6

Browse files
authored
Merge pull request #9 from LLK/develop
build(release): Configure semantic release
2 parents 1e113bb + dd72cea commit fafabe6

File tree

5 files changed

+105
-19
lines changed

5 files changed

+105
-19
lines changed

.travis.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
language: node_js
2-
node_js:
3-
- "4"
4-
- "stable"
51
sudo: false
2+
language: node_js
63
cache:
74
directories:
8-
- node_modules
5+
- node_modules
6+
notifications:
7+
email: false
8+
node_js:
9+
- '4'
10+
before_install:
11+
- npm i -g npm@^2.0.0
12+
before_script:
13+
- npm prune
14+
after_success:
15+
- npm run semantic-release
16+
branches:
17+
except:
18+
- /^v\d+\.\d+\.\d+$/

LICENSE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyright (c) 2016, Massachusetts Institute of Technology
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# scratch-parser
22
#### Parser for Scratch projects
33

4-
[![Build Status](https://travis-ci.com/LLK/scratch-parser.svg?token=xzzHj4ct3SyBTpeqxnx1&branch=master)](https://travis-ci.com/LLK/scratch-parser)
5-
[![Dependency Status](https://david-dm.org/llk/scratch-parser.svg)](https://david-dm.org/llk/scratch-parser)
6-
[![devDependency Status](https://david-dm.org/llk/scratch-parser/dev-status.svg)](https://david-dm.org/llk/scratch-parser#info=devDependencies)
4+
[![Build Status](https://travis-ci.org/LLK/scratch-parser.svg?branch=develop)](https://travis-ci.org/LLK/scratch-parser)
5+
[![dependencies Status](https://david-dm.org/llk/scratch-parser/status.svg)](https://david-dm.org/llk/scratch-parser)
6+
[![devDependencies Status](https://david-dm.org/llk/scratch-parser/dev-status.svg)](https://david-dm.org/llk/scratch-parser?type=dev)
77

88
## Overview
99
The Scratch Parser is a [Node.js](https://nodejs.org) module that parses and validates [Scratch](https://scratch.mit.edu) projects. Internally, this utility is used for validation of Scratch projects as well as for extracting metadata from projects for research and search purposes.
@@ -18,16 +18,18 @@ npm install scratch-parser
1818
#### Basic Use
1919
```js
2020
var fs = require('fs');
21-
var scratchp = require('scratch-parser');
21+
var parser = require('scratch-parser');
2222

2323
var buffer = fs.readFileSync('/path/to/project.sb2');
24-
scratchp(buffer, function (err, project) {
24+
parser(buffer, function (err, project) {
2525
if (err) // handle the error
2626
// do something interesting
2727
});
2828
```
2929

3030
## Metadata
31+
The `scratch-parser` module will append metadata about the project should validation and parsing be successful. The `_meta` object includes:
32+
3133
| Key | Attributes |
3234
| ----------------- | -------------------------------------------------------- |
3335
| `scripts` | `count` |
@@ -66,3 +68,51 @@ make coverage
6668
```bash
6769
make benchmark
6870
```
71+
72+
## Committing
73+
This project uses [semantic release](https://github.com/semantic-release/semantic-release)
74+
to ensure version bumps follow semver so that projects using the config don't
75+
break unexpectedly.
76+
77+
In order to automatically determine the type of version bump necessary, semantic
78+
release expects commit messages to be formatted following
79+
[conventional-changelog](https://github.com/bcoe/conventional-changelog-standard/blob/master/convention.md).
80+
```
81+
<type>(<scope>): <subject>
82+
<BLANK LINE>
83+
<body>
84+
<BLANK LINE>
85+
<footer>
86+
```
87+
88+
`subject` and `body` are your familiar commit subject and body. `footer` is
89+
where you would include `BREAKING CHANGE` and `ISSUES FIXED` sections if
90+
applicable.
91+
92+
`type` is one of:
93+
* `fix`: A bug fix **Causes a patch release (0.0.x)**
94+
* `feat`: A new feature **Causes a minor release (0.x.0)**
95+
* `docs`: Documentation only changes
96+
* `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
97+
* `refactor`: A code change that neither fixes a bug nor adds a feature
98+
* `perf`: A code change that improves performance **May or may not cause a minor release. It's not clear.**
99+
* `test`: Adding missing tests or correcting existing tests
100+
* `ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
101+
* `chore`: Other changes that don't modify src or test files
102+
* `revert`: Reverts a previous commit
103+
104+
Use the [commitizen CLI](https://github.com/commitizen/cz-cli) to make commits
105+
formatted in this way:
106+
107+
```bash
108+
npm install -g commitizen
109+
npm install
110+
```
111+
112+
Now you're ready to make commits using `git cz`.
113+
114+
## Breaking changes
115+
If you're committing a change that will require changes to existing code, ensure
116+
your commit specifies a breaking change. In your commit body, prefix the changes with "BREAKING CHANGE: "
117+
This will cause a major version bump so downstream projects must choose to upgrade
118+
the config and will not break the build unexpectedly.

TRADEMARK

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The Scratch trademarks, including the Scratch name, logo, the Scratch Cat, Gobo, Pico, Nano, Tera and Giga graphics (the "Marks"), are property of the Massachusetts Institute of Technology (MIT), and the use of the Marks is governed by this policy.
2+
3+
You may use the Marks to refer to Scratch in Substantially Unmodified form.
4+
5+
"Substantially Unmodified" means the source code provided by MIT, possibly with minor modifications including but not limited to: bug fixes (including security), changing the locations of files for better integration with the host operating system, adding documentation, and changes to the dynamic linking of libraries.
6+
7+
A version is not "Substantially Unmodified" if it incorporates features not present in a release of Scratch by MIT. If you do make a substantial modification, to avoid confusion with versions of Scratch produced by MIT you must remove all Marks from your version of the software and refrain from using any of the Marks to refer to your version.

package.json

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
11
{
22
"name": "scratch-parser",
3-
"version": "1.0.0",
43
"description": "Parser for Scratch projects",
54
"author": "MIT Media Lab",
65
"license": "BSD-3-Clause",
76
"homepage": "https://github.com/LLK/scratch-parser#readme",
87
"main": "index.js",
98
"repository": {
109
"type": "git",
11-
"url": "git+ssh://git@github.com/LLK/scratch-parser.git"
10+
"url": "https://github.com/LLK/scratch-parser.git"
1211
},
1312
"scripts": {
14-
"test": "make test"
13+
"test": "make test",
14+
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
1515
},
1616
"dependencies": {
1717
"adm-zip": "0.4.7",
18-
"ajv": "3.4.0",
19-
"async": "1.5.2"
18+
"ajv": "4.7.0",
19+
"async": "2.0.1"
2020
},
2121
"devDependencies": {
22-
"benchmark": "^2.0.0",
23-
"eslint": "^1.10.3",
24-
"glob": "^6.0.4",
25-
"tap": "^5.1.1"
22+
"benchmark": "^2.1.1",
23+
"cz-conventional-changelog": "2.0.0",
24+
"eslint": "^3.5.0",
25+
"glob": "^7.0.6",
26+
"tap": "^7.1.2",
27+
"semantic-release": "^6.3.2"
2628
},
2729
"engines": {
2830
"node": ">=4.0"
31+
},
32+
"config": {
33+
"commitizen": {
34+
"path": "./node_modules/cz-conventional-changelog"
35+
}
2936
}
3037
}

0 commit comments

Comments
 (0)