mirror of
https://github.com/scratchfoundation/scratch-parser.git
synced 2025-07-03 01:50:40 -04:00
Merge branch 'master' into backspace
This commit is contained in:
commit
41d1119728
4 changed files with 137 additions and 38 deletions
105
.circleci/config.yml
Normal file
105
.circleci/config.yml
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
|
||||||
|
version: 2.1
|
||||||
|
orbs:
|
||||||
|
commitlint: conventional-changelog/commitlint@1.0.0
|
||||||
|
|
||||||
|
executors:
|
||||||
|
default-executor:
|
||||||
|
docker:
|
||||||
|
- image: "cimg/node:lts"
|
||||||
|
working_directory: ~/project
|
||||||
|
resource_class: medium
|
||||||
|
|
||||||
|
commands:
|
||||||
|
restore_test_cache:
|
||||||
|
steps:
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- v1-deps-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }}
|
||||||
|
- v1-deps-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
|
||||||
|
- v1-deps-
|
||||||
|
save_test_cache:
|
||||||
|
steps:
|
||||||
|
- save_cache:
|
||||||
|
key: v1-deps-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }}
|
||||||
|
paths:
|
||||||
|
- node_modules
|
||||||
|
- ~/.npm
|
||||||
|
setup:
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Setup
|
||||||
|
command: |
|
||||||
|
npm prune
|
||||||
|
test:
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Test
|
||||||
|
command: |
|
||||||
|
npm run test
|
||||||
|
deploy:
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Deploy
|
||||||
|
command: |
|
||||||
|
npm run semantic-release
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-test:
|
||||||
|
executor: default-executor
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- restore_test_cache
|
||||||
|
- setup
|
||||||
|
- save_test_cache
|
||||||
|
- test
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: ~/project
|
||||||
|
paths: .
|
||||||
|
deploy:
|
||||||
|
executor: default-executor
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: ~/project
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
commitlint:
|
||||||
|
when:
|
||||||
|
not:
|
||||||
|
or:
|
||||||
|
- equal: [ master, <<pipeline.git.branch>> ]
|
||||||
|
- equal: [ develop, <<pipeline.git.branch>> ]
|
||||||
|
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
|
||||||
|
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
|
||||||
|
jobs:
|
||||||
|
- commitlint/lint:
|
||||||
|
target-branch: master
|
||||||
|
|
||||||
|
build-and-test-workflow:
|
||||||
|
when:
|
||||||
|
not:
|
||||||
|
or:
|
||||||
|
- equal: [ master, <<pipeline.git.branch>> ]
|
||||||
|
- equal: [ develop, <<pipeline.git.branch>> ]
|
||||||
|
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
|
||||||
|
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
|
||||||
|
jobs:
|
||||||
|
- build-and-test
|
||||||
|
|
||||||
|
deploy-workflow:
|
||||||
|
when:
|
||||||
|
or:
|
||||||
|
- equal: [ master, <<pipeline.git.branch>> ]
|
||||||
|
- equal: [ develop, <<pipeline.git.branch>> ]
|
||||||
|
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
|
||||||
|
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
|
||||||
|
- matches: { pattern: "^v[0-9]*.[0-9]*.[0-9]*$", value: <<pipeline.git.branch>> }
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
- build-and-test
|
||||||
|
- deploy:
|
||||||
|
context:
|
||||||
|
- scratch-npm-creds
|
||||||
|
requires:
|
||||||
|
- build-and-test
|
20
.travis.yml
20
.travis.yml
|
@ -1,20 +0,0 @@
|
||||||
sudo: false
|
|
||||||
language: node_js
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- node_modules
|
|
||||||
- ~/.npm
|
|
||||||
notifications:
|
|
||||||
email: false
|
|
||||||
node_js:
|
|
||||||
- 'node'
|
|
||||||
before_script:
|
|
||||||
- npm prune
|
|
||||||
script:
|
|
||||||
- commitlint-travis
|
|
||||||
- npm test
|
|
||||||
after_success:
|
|
||||||
- npm run semantic-release
|
|
||||||
branches:
|
|
||||||
except:
|
|
||||||
- /^v\d+\.\d+\.\d+$/
|
|
47
README.md
47
README.md
|
@ -1,22 +1,24 @@
|
||||||
# scratch-parser
|
# scratch-parser
|
||||||
|
|
||||||
#### Parser for Scratch projects
|
Parser for Scratch projects
|
||||||
|
|
||||||
[](https://travis-ci.org/LLK/scratch-parser)
|
[](https://app.circleci.com/pipelines/github/LLK/scratch-parser?branch=master)
|
||||||
[](https://david-dm.org/llk/scratch-parser)
|
|
||||||
[](https://david-dm.org/llk/scratch-parser?type=dev)
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
The Scratch Parser is a [Node.js](https://nodejs.org) module that parses and validates [Scratch](https://scratch.mit.edu) projects.
|
|
||||||
|
The Scratch Parser is a [Node.js](https://nodejs.org) module that parses and validates
|
||||||
|
[Scratch](https://scratch.mit.edu) projects.
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
#### Installation
|
### Installation
|
||||||
```bash
|
|
||||||
|
```sh
|
||||||
npm install scratch-parser
|
npm install scratch-parser
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Basic Use
|
### Basic Use
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var parser = require('scratch-parser');
|
var parser = require('scratch-parser');
|
||||||
|
@ -28,8 +30,10 @@ parser(buffer, function (err, project) {
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
#### "Info"
|
### "Info"
|
||||||
In addition to the `_meta` data described above, Scratch projects include an attribute called `info` that *may* include the following:
|
|
||||||
|
In addition to the `_meta` data described above, Scratch projects include an attribute called `info` that *may*
|
||||||
|
include the following:
|
||||||
|
|
||||||
| Key | Description |
|
| Key | Description |
|
||||||
| ----------------- | -------------------------------------------------------- |
|
| ----------------- | -------------------------------------------------------- |
|
||||||
|
@ -40,22 +44,26 @@ In addition to the `_meta` data described above, Scratch projects include an att
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
#### Running the Test Suite
|
### Running the Test Suite
|
||||||
```bash
|
|
||||||
|
```sh
|
||||||
npm test
|
npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Code Coverage Report
|
### Code Coverage Report
|
||||||
```bash
|
|
||||||
|
```sh
|
||||||
make coverage
|
make coverage
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Performance Benchmarks / Stress Testing
|
### Performance Benchmarks / Stress Testing
|
||||||
```bash
|
|
||||||
|
```sh
|
||||||
make benchmark
|
make benchmark
|
||||||
```
|
```
|
||||||
|
|
||||||
## Committing
|
## Committing
|
||||||
|
|
||||||
This project uses [semantic release](https://github.com/semantic-release/semantic-release)
|
This project uses [semantic release](https://github.com/semantic-release/semantic-release)
|
||||||
to ensure version bumps follow semver so that projects using the config don't
|
to ensure version bumps follow semver so that projects using the config don't
|
||||||
break unexpectedly.
|
break unexpectedly.
|
||||||
|
@ -63,7 +71,8 @@ break unexpectedly.
|
||||||
In order to automatically determine the type of version bump necessary, semantic
|
In order to automatically determine the type of version bump necessary, semantic
|
||||||
release expects commit messages to be formatted following
|
release expects commit messages to be formatted following
|
||||||
[conventional-changelog](https://github.com/bcoe/conventional-changelog-standard/blob/master/convention.md).
|
[conventional-changelog](https://github.com/bcoe/conventional-changelog-standard/blob/master/convention.md).
|
||||||
```
|
|
||||||
|
```text
|
||||||
<type>(<scope>): <subject>
|
<type>(<scope>): <subject>
|
||||||
<BLANK LINE>
|
<BLANK LINE>
|
||||||
<body>
|
<body>
|
||||||
|
@ -76,6 +85,7 @@ where you would include `BREAKING CHANGE` and `ISSUES FIXED` sections if
|
||||||
applicable.
|
applicable.
|
||||||
|
|
||||||
`type` is one of:
|
`type` is one of:
|
||||||
|
|
||||||
* `fix`: A bug fix **Causes a patch release (0.0.x)**
|
* `fix`: A bug fix **Causes a patch release (0.0.x)**
|
||||||
* `feat`: A new feature **Causes a minor release (0.x.0)**
|
* `feat`: A new feature **Causes a minor release (0.x.0)**
|
||||||
* `docs`: Documentation only changes
|
* `docs`: Documentation only changes
|
||||||
|
@ -90,7 +100,7 @@ applicable.
|
||||||
Use the [commitizen CLI](https://github.com/commitizen/cz-cli) to make commits
|
Use the [commitizen CLI](https://github.com/commitizen/cz-cli) to make commits
|
||||||
formatted in this way:
|
formatted in this way:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
npm install -g commitizen
|
npm install -g commitizen
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
@ -98,6 +108,7 @@ npm install
|
||||||
Now you're ready to make commits using `git cz`.
|
Now you're ready to make commits using `git cz`.
|
||||||
|
|
||||||
## Breaking changes
|
## Breaking changes
|
||||||
|
|
||||||
If you're committing a change that will require changes to existing code, ensure
|
If you're committing a change that will require changes to existing code, ensure
|
||||||
your commit specifies a breaking change. In your commit body, prefix the changes with "BREAKING CHANGE: "
|
your commit specifies a breaking change. In your commit body, prefix the changes with "BREAKING CHANGE: "
|
||||||
This will cause a major version bump so downstream projects must choose to upgrade
|
This will cause a major version bump so downstream projects must choose to upgrade
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
},
|
},
|
||||||
"agent": {
|
"agent": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue