Skip to content

Commit 28b06aa

Browse files
Merge branch 'master' into feature/98-pass_refs_to_resolvers
2 parents 3eebea7 + e048c84 commit 28b06aa

File tree

135 files changed

+10720
-30297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+10720
-30297
lines changed

.eslintrc.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ extends:
99
- modular/style
1010
- modular/browser
1111
- modular/node
12-
- modular/es5
13-
14-
globals:
15-
Promise: false
16-
Symbol: false
12+
- modular/es6
1713

1814
rules:
1915
# This rule erroneously flags functions that use the `arguments` object

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ node_modules
3838
# Test output
3939
/.nyc_output
4040
/coverage
41-
/dist/*.coverage.js

.mocharc.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,7 @@
22
# https://mochajs.org/#configuring-mocha-nodejs
33
# https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.yml
44

5-
spec:
6-
- test/fixtures
7-
- test/specs/**/*.parsed.js
8-
- test/specs/**/*.dereferenced.js
9-
- test/specs/**/*.bundled.js
10-
- test/specs/**/*.spec.js
11-
12-
require: karma-host-environment
5+
spec: test/specs/**/*.spec.js
136

147
bail: true
158
recursive: true

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ filter_secrets: false
77
language: node_js
88

99
node_js:
10-
- 10
1110
- 8
12-
- 6
11+
- 10
12+
- 12
1313

1414
os:
1515
- linux
@@ -54,7 +54,7 @@ jobs:
5454

5555
- stage: Deploy
5656
name: Publish to npm
57-
script: npm run build
57+
script: true
5858
after_success: true
5959
deploy:
6060
provider: npm

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ All notable changes will be documented in this file.
33
JSON Schema $Ref Parser adheres to [Semantic Versioning](http://semver.org/).
44

55

6+
## [v7.0.0](https://github.com/APIDevTools/json-schema-ref-parser/tree/v7.0.0) (2019-06-11)
7+
8+
- Dropped support for Node 6
9+
- Updated all code to ES6+ syntax (async/await, template literals, arrow functions, etc.)
10+
- No longer including a pre-built bundle in the package. such as [Webpack](https://webpack.js.org/), [Rollup](https://rollupjs.org/), [Parcel](https://parceljs.org/), or [Browserify](http://browserify.org/) to include JSON Schema $Ref Parser in your app
11+
12+
[Full Changelog](https://github.com/APIDevTools/json-schema-ref-parser/compare/v6.1.0...v7.0.0)
13+
14+
615
## [v6.0.0](https://github.com/APIDevTools/json-schema-ref-parser/tree/v6.0.0) (2018-10-04)
716

817
- Dropped support for [Bower](https://www.npmjs.com/package/bower), since it has been deprecated

README.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ JSON Schema $Ref Parser is a full [JSON Reference](https://tools.ietf.org/html/d
5151
- Can [dereference](https://apidevtools.org/json-schema-ref-parser/docs/ref-parser.html#dereferencepath-options-callback) your schema, producing a plain-old JavaScript object that's easy to work with
5252
- Supports [circular references](https://apidevtools.org/json-schema-ref-parser/docs/#circular-refs), nested references, back-references, and cross-references between files
5353
- Maintains object reference equality — `$ref` pointers to the same value always resolve to the same object instance
54-
- [Tested](https://apidevtools.org/json-schema-ref-parser/test/) in Node, io.js, and all major web browsers on Windows, Mac, and Linux
54+
- [Tested](https://travis-ci.com/APIDevTools/json-schema-ref-parser) in Node and all major web browsers on Windows, Mac, and Linux
5555

5656

5757
Example
5858
--------------------------
5959

6060
```javascript
61-
$RefParser.dereference(mySchema, function(err, schema) {
61+
$RefParser.dereference(mySchema, (err, schema) => {
6262
if (err) {
6363
console.error(err);
6464
}
@@ -67,56 +67,59 @@ $RefParser.dereference(mySchema, function(err, schema) {
6767
// including referenced files, combined into a single object
6868
console.log(schema.definitions.person.properties.firstName);
6969
}
70-
});
70+
}
7171
```
7272
73-
Or use [Promises syntax](http://javascriptplayground.com/blog/2015/02/promises/) instead. The following example is the same as above:
73+
Or use `async`/`await` syntax instead. The following example is the same as above:
7474
7575
```javascript
76-
$RefParser.dereference(mySchema)
77-
.then(function(schema) {
78-
console.log(schema.definitions.person.properties.firstName);
79-
})
80-
.catch(function(err) {
81-
console.error(err);
82-
});
76+
try {
77+
let schema = await $RefParser.dereference(mySchema);
78+
console.log(schema.definitions.person.properties.firstName);
79+
}
80+
catch(err) {
81+
console.error(err);
82+
}
8383
```
8484
8585
For more detailed examples, please see the [API Documentation](https://apidevtools.org/json-schema-ref-parser/docs/)
8686
8787
88+
8889
Installation
8990
--------------------------
90-
#### Node
9191
Install using [npm](https://docs.npmjs.com/about-npm/):
9292
9393
```bash
9494
npm install json-schema-ref-parser
9595
```
9696
97-
Then require it in your code:
97+
98+
99+
Usage
100+
--------------------------
101+
When using Json-Schema-Ref-Parser in Node.js apps, you'll probably want to use **CommonJS** syntax:
98102
99103
```javascript
100-
var $RefParser = require('json-schema-ref-parser');
104+
const $RefParser = require("json-schema-ref-parser");
101105
```
102106
103-
#### Web Browsers
104-
Reference [`ref-parser.js`](dist/ref-parser.js) or [`ref-parser.min.js`](dist/ref-parser.min.js) in your HTML:
105-
106-
```html
107-
<script src="https://unpkg.com/json-schema-ref-parser/dist/ref-parser.min.js"></script>
108-
<script>
109-
$RefParser.dereference(mySchema)
110-
.then(function(schema) {
111-
console.log(schema.definitions.person.properties.firstName);
112-
})
113-
.catch(function(err) {
114-
console.error(err);
115-
});
116-
</script>
107+
When using a transpiler such as [Babel](https://babeljs.io/) or [TypeScript](https://www.typescriptlang.org/), or a bundler such as [Webpack](https://webpack.js.org/) or [Rollup](https://rollupjs.org/), you can use **ECMAScript modules** syntax instead:
108+
109+
```javascript
110+
import $RefParser from "json-schema-ref-parser";
117111
```
118112
119113
114+
115+
Browser support
116+
--------------------------
117+
Json-Schema-Ref-Parser supports recent versions of every major web browser. Older browsers may require [Babel](https://babeljs.io/) and/or [polyfills](https://babeljs.io/docs/en/next/babel-polyfill).
118+
119+
To use Json-Schema-Ref-Parser in a browser, you'll need to use a bundling tool such as [Webpack](https://webpack.js.org/), [Rollup](https://rollupjs.org/), [Parcel](https://parceljs.org/), or [Browserify](http://browserify.org/). Some bundlers may require a bit of configuration, such as setting `browser: true` in [rollup-plugin-resolve](https://github.com/rollup/rollup-plugin-node-resolve).
120+
121+
122+
120123
API Documentation
121124
--------------------------
122125
Full API documentation is available [right here](https://apidevtools.org/json-schema-ref-parser/docs/)
@@ -141,9 +144,6 @@ To build/test the project locally on your computer:
141144
4. __Run the tests__<br>
142145
`npm test`
143146

144-
5. __Start the local web server__<br>
145-
`npm start` (then browse to [http://localhost:8080/test/](http://localhost:8080/test/))
146-
147147

148148
License
149149
--------------------------

banner.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)