Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: apiaryio/protagonist
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.17.0
Choose a base ref
...
head repository: apiaryio/protagonist
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 7,277 additions and 2,544 deletions.
  1. +2 −0 .gitattributes
  2. +33 −0 .github/workflows/main.yaml
  3. +36 −0 .gitignore
  4. +3 −3 .gitmodules
  5. +0 −16 .travis.yml
  6. +253 −0 CHANGELOG.md
  7. +0 −5 Makefile
  8. +248 −114 README.md
  9. +0 −20 Vagrantfile
  10. +29 −0 appveyor.yml
  11. +15 −13 binding.gyp
  12. +0 −156 common.gypi
  13. +1 −0 drafter
  14. +64 −8 package.json
  15. +0 −6 provisioning.sh
  16. +0 −1 snowcrash
  17. +0 −71 src/annotation.cc
  18. +0 −356 src/blueprint.cc
  19. +65 −0 src/options.cc
  20. +37 −0 src/options.h
  21. +65 −0 src/options_parser.cc
  22. +0 −164 src/parse.cc
  23. +203 −0 src/parse_async.cc
  24. +66 −0 src/parse_sync.cc
  25. +10 −16 src/protagonist.cc
  26. +17 −88 src/protagonist.h
  27. +325 −0 src/refractToV8.cc
  28. +12 −0 src/refractToV8.h
  29. +0 −78 src/result.cc
  30. +0 −334 src/sourcemap.cc
  31. +191 −0 src/validate_async.cc
  32. +63 −0 src/validate_sync.cc
  33. +0 −34 test/ast-test.coffee
  34. +4 −0 test/await-test.js
  35. +4 −0 test/callback-test.js
  36. +41 −0 test/fixtures-test.js
  37. +2 −0 test/fixtures/error.apib
  38. +69 −0 test/fixtures/error.json
  39. +310 −0 test/fixtures/generate-body-schema.parse.json
  40. +956 −0 test/fixtures/generate-body-schema.parse.sourcemap.json
  41. +310 −0 test/fixtures/generate-body.parse.json
  42. +956 −0 test/fixtures/generate-body.parse.sourcemap.json
  43. +69 −0 test/fixtures/require-name.json
  44. +0 −97 test/fixtures/sample-api-ast.json
  45. +0 −169 test/fixtures/sample-api-sourcemap.json
  46. +6 −3 test/fixtures/{sample-api.apib → valid.apib}
  47. +331 −0 test/fixtures/valid.parse.json
  48. +977 −0 test/fixtures/valid.parse.sourcemap.json
  49. +3 −0 test/fixtures/warning.apib
  50. +116 −0 test/fixtures/warning.parse.json
  51. +69 −0 test/fixtures/warning.validate.json
  52. +59 −0 test/helpers/await.js
  53. +83 −0 test/helpers/callback.js
  54. +122 −0 test/helpers/options.js
  55. +131 −0 test/helpers/params.js
  56. +91 −0 test/helpers/promise.js
  57. +15 −0 test/helpers/protagonist.js
  58. +59 −0 test/helpers/sync.js
  59. +4 −0 test/options-test.js
  60. +4 −0 test/params-test.js
  61. +0 −415 test/parser-test.coffee
  62. +0 −265 test/performance/fixtures/fixture-1-ast.json
  63. +545 −0 test/performance/fixtures/fixture-1.json
  64. +0 −75 test/performance/fixtures/fixture-2-ast.json
  65. +124 −0 test/performance/fixtures/fixture-2.json
  66. +1 −1 test/performance/perf-protagonist.js
  67. +4 −0 test/promise-test.js
  68. +15 −0 test/protagonist-options-crash-test.js
  69. +0 −33 test/sourcemap-test.coffee
  70. +4 −0 test/sync-test.js
  71. +46 −0 test/timeline-test.js
  72. +9 −3 tools/protagonist.js
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Blueprints line endings MUST be LF-only (unix)
*.apib text eol=lf
33 changes: 33 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on: push
jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
node: ['18', '16', '14', '12']
name: Node ${{ matrix.node }} on ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm test

smoke-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
path: protagonist
- uses: actions/setup-node@v1
with:
node-version: 18
- run: npm pack
working-directory: protagonist
- run: npm install ./protagonist/protagonist-*.tgz
- run: node -e "assert(require('protagonist').parseSync('# My API').element === 'parseResult')"
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -16,8 +16,44 @@ npm-debug.log
build/
node_modules/

.cproject
.project
.settings

# OS X and Xcode specific
.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcodeproj/*.xcworkspace
xcuserdata
xcshareddata
profile
*.moved-aside
DerivedData
.idea/

# Generated files
config.mk
config.gypi
bin/
vendor/
.vagrant/
tmp/

# Ruby
.bundle/
features/support/env-win.rb

# Eclipse specific
.cproject
.project
.settings

THIRD_PARTY_LICENSES.txt
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "snowcrash"]
path = snowcrash
url = https://github.com/apiaryio/snowcrash.git
[submodule "drafter"]
path = drafter
url = https://github.com/apiaryio/drafter.git
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

253 changes: 253 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
# Protagonist Changelog

## 2.3.0 (2023-05-18)

This update now uses Drafter 5.1.0. Please see [Drafter
5.1.0](https://github.com/apiaryio/drafter/releases/tag/v5.1.0) for
the list of changes.

### Breaking

- Drop support for node.js versions < 12.

### Enhancements

* Added support for building Protagonist with Node 16, and 18.

## 2.2.1 (2020-06-10)

### Enhancements

* Added support for building Protagonist with Node 13/14.

## 2.2.0 (2020-04-20)

### Enhancements

* Drafter contains two new options for disabling messageBody and
messageBodySchema generation from MSON. `generateMessageBody` and
`generatedMessageBodySchema` respectively.

## 2.1.0 (2020-03-17)

This update now uses Drafter 5.0.0-rc.1. Please see [Drafter
5.0.0-rc.1](https://github.com/apiaryio/drafter/releases/tag/v-5.0.0-rc.1) for
the list of changes.

## 2.0.2 (2019-10-29)

This update now uses Drafter 4.0.2. Please see [Drafter
4.0.2](https://github.com/apiaryio/drafter/releases/tag/v4.0.2) for the list of
changes.

## 2.0.1 (2019-09-17)

This update now uses Drafter 4.0.1. Please see [Drafter
4.0.1](https://github.com/apiaryio/drafter/releases/tag/v4.0.1) for the list of
changes.

### Enhancements

- The Protagonist NPM package now contains a `THIRD_PARTY_LICENSES.txt` file
which contains the licenses of the vendored C++ dependencies of the library.

## 2.0.0 (2019-07-02)

This update now uses Drafter 4.0.0-pre.8. Please see [Drafter
4.0.0-pre.8](https://github.com/apiaryio/drafter/releases/tag/v4.0.0-pre.8) for
the list of changes.

## 2.0.0-pre.10 (2019-05-31)

This update now uses Drafter 4.0.0-pre.7. Please see [Drafter
4.0.0-pre.7](https://github.com/apiaryio/drafter/releases/tag/v4.0.0-pre.7) for
the list of changes.

## 2.0.0-pre.9 (2019-05-20)

This update now uses Drafter 4.0.0-pre.6. Please see [Drafter
4.0.0-pre.6](https://github.com/apiaryio/drafter/releases/tag/v4.0.0-pre.6) for
the list of changes.

### Enhancements

- Added support for Node 12.

## 2.0.0-pre.8 (2019-05-09)

This is a re-release of Protagonist 2.0.0-pre.7 due to problems with NPM
preventing the release of 2.0.0-pre.7.

## 2.0.0-pre.7 (2019-05-07)

This update now uses Drafter 4.0.0-pre.5. Please see [Drafter
4.0.0-pre.5](https://github.com/apiaryio/drafter/releases/tag/v4.0.0-pre.5) for
the list of changes.

## 2.0.0-pre.6 (2019-04-26)

This update now uses Drafter 4.0.0-pre.4. Please see [Drafter
4.0.0-pre.4](https://github.com/apiaryio/drafter/releases/tag/v4.0.0-pre.4) for
the list of changes.

## 2.0.0-pre.5 (2019-04-08)

This update now uses Drafter 4.0.0-pre.3. Please see [Drafter
4.0.0-pre.3](https://github.com/apiaryio/drafter/releases/tag/v4.0.0-pre.3) for
the list of changes.

## 2.0.0-pre.4

### Enhancements

* Added support for node 11.

## 2.0.0-pre.3

### Bug Fixes

* Fixed a segfault while handling invalid options that contains unsupported
properties with unsupported types.

## 2.0.0-pre.2

This update now uses Drafter 4.0.0-pre.2. Please see [Drafter
4.0.0-pre.2](https://github.com/apiaryio/drafter/releases/tag/v4.0.0-pre.2) for
the list of changes.

## 2.0.0-pre.1

This update now uses Drafter 4.0.0-pre.1. Please see [Drafter
4.0.0-pre.1](https://github.com/apiaryio/drafter/releases/tag/v4.0.0-pre.1) for
the list of changes.

## 2.0.0-pre.0

This update now uses Drafter 4.0.0-pre.0. Please see [Drafter
4.0.0-pre.0](https://github.com/apiaryio/drafter/releases/tag/v4.0.0-pre.0) for
the list of changes.

- updated Async call to use Nan::AsyncQueue instead of node v8 functionality directly

### Breaking

- Removed the option to select AST Type. The ouput will be only refract

- Drop support for node.js versions 0.10 and 0.12

## 1.6.8

This update now uses Drafter 3.2.7. Please see [Drafter
3.2.7](https://github.com/apiaryio/drafter/releases/tag/v3.2.7) for
the list of changes.

### Bug Fixes

* Fixed a bug where an option when set to false overrides the previous options.

## 1.6.7

This update now uses Drafter 3.2.6. Please see [Drafter
3.2.6](https://github.com/apiaryio/drafter/releases/tag/v3.2.6) for
the list of changes.

## 1.6.6

This update now uses Drafter 3.2.5. Please see [Drafter
3.2.5](https://github.com/apiaryio/drafter/releases/tag/v3.2.5) for
the list of changes.

## 1.6.5

This update now uses Drafter 3.2.4. Please see [Drafter
3.2.4](https://github.com/apiaryio/drafter/releases/tag/v3.2.4) for
the list of changes.

## 1.6.4

This update now uses Drafter 3.2.3. Please see [Drafter
3.2.3](https://github.com/apiaryio/drafter/releases/tag/v3.2.3) for
the list of changes.

## 1.6.3

This update now uses Drafter 3.2.2. Please see [Drafter
3.2.2](https://github.com/apiaryio/drafter/releases/tag/v3.2.2) for
the list of changes.

## 1.6.2

This update now uses Drafter 3.2.1. Please see [Drafter
3.2.1](https://github.com/apiaryio/drafter/releases/tag/v3.2.1) for
the list of changes.

## 1.6.1

This update now uses Drafter 3.2.0. Please see [Drafter
3.2.0](https://github.com/apiaryio/drafter/releases/tag/v3.2.0) for
the list of changes.

## 1.6.0

### Enhancements

* Added `validate` and `validateSync` to just return the warnings and errors
after parsing a blueprint.

## 1.5.2

This update now uses Drafter 3.1.3. Please see [Drafter
3.1.3](https://github.com/apiaryio/drafter/releases/tag/v3.1.3) for
the list of changes.

## 1.5.1

This update now uses Drafter 3.1.2. Please see [Drafter
3.1.2](https://github.com/apiaryio/drafter/releases/tag/v3.1.2) for
the list of changes.

## 1.5.0

This update now uses Drafter 3.1.1. Please see [Drafter
3.1.1](https://github.com/apiaryio/drafter/releases/tag/v3.1.1) for
the list of changes.

## 1.5.0-pre.0

This update now uses Drafter 3.1.0-pre.0. Please see [Drafter
3.1.0-pre.0](https://github.com/apiaryio/drafter/releases/tag/v3.1.0-pre.0) for
the list of changes.

## 1.4.1

### Bug Fixes

- Fixes a problem when installing Protagonist on macOS.


## 1.4.0

This update now uses Drafter 3.0.0 Please see [Drafter
3.0.0](https://github.com/apiaryio/drafter/releases/tag/v3.0.0) for the list of
changes.

### Breaking

* Protagonist now uses C++11.

The following compiler versions are supported:

* Microsoft Visual C++ 2013 or higher
* GCC 4.8 or higher
* Clang 3.5 or higher


## 1.3.3

This update now uses Drafter 2.3.1 Please see [Drafter
2.3.1](https://github.com/apiaryio/drafter/releases/tag/v2.3.1) for the list of
changes.

## 1.3.2

This update adds support for node.js 5 and 6.
5 changes: 0 additions & 5 deletions Makefile

This file was deleted.

Loading