Merge branch 'master' into backspace

This commit is contained in:
Andy O'Neill 2022-12-12 11:13:11 -05:00 committed by GitHub
commit 41d1119728
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 137 additions and 38 deletions

105
.circleci/config.yml Normal file
View 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

View file

@ -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+$/

View file

@ -1,22 +1,24 @@
# scratch-parser # scratch-parser
#### Parser for Scratch projects Parser for Scratch projects
[![Build Status](https://travis-ci.org/LLK/scratch-parser.svg?branch=develop)](https://travis-ci.org/LLK/scratch-parser) [![CircleCI](https://circleci.com/gh/LLK/scratch-parser.svg?style=shield)](https://app.circleci.com/pipelines/github/LLK/scratch-parser?branch=master)
[![dependencies Status](https://david-dm.org/llk/scratch-parser/status.svg)](https://david-dm.org/llk/scratch-parser)
[![devDependencies Status](https://david-dm.org/llk/scratch-parser/dev-status.svg)](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

View file

@ -17,6 +17,9 @@
}, },
"agent": { "agent": {
"type": "string" "type": "string"
},
"origin": {
"type": "string"
} }
}, },
"required": [ "required": [