Skip to content

Commit 25d889f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix/nullish-resolved
2 parents ccbd40d + 3980e6f commit 25d889f

Some content is hidden

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

41 files changed

+9917
-4956
lines changed

.eslintrc.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
# ESLint config
22
# http://eslint.org/docs/user-guide/configuring
3-
# https://jstools.dev/eslint-config-modular/
3+
# https://jstools.dev/eslint-config/
44

55
root: true
6-
7-
extends:
8-
- "@jsdevtools/modular/best-practices"
9-
- "@jsdevtools/modular/style"
10-
- "@jsdevtools/modular/browser"
11-
- "@jsdevtools/modular/node"
12-
- "@jsdevtools/modular/es6"
13-
14-
rules:
15-
# This rule erroneously flags functions that use the `arguments` object
16-
no-unused-vars: off
6+
extends: "@jsdevtools"
7+
env:
8+
node: true
9+
browser: true

.github/workflows/CI-CD.yaml

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions
33
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
44
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions
5+
# https://www.npmjs.com/package/@amanda-mitchell/semantic-release-npm-multiple
56

67
name: CI-CD
78

@@ -30,6 +31,7 @@ jobs:
3031
node:
3132
- 10
3233
- 12
34+
- 14
3335

3436
steps:
3537
- name: Checkout source
@@ -53,7 +55,7 @@ jobs:
5355
run: npm run coverage:node
5456

5557
- name: Send code coverage results to Coveralls
56-
uses: coverallsapp/github-action@v1.0.1
58+
uses: coverallsapp/github-action@v1.1.0
5759
with:
5860
github-token: ${{ secrets.GITHUB_TOKEN }}
5961
parallel: true
@@ -94,7 +96,7 @@ jobs:
9496
cat coverage/*/lcov.info > ./coverage/lcov.info
9597
9698
- name: Send code coverage results to Coveralls
97-
uses: coverallsapp/github-action@v1.0.1
99+
uses: coverallsapp/github-action@v1.1.0
98100
with:
99101
github-token: ${{ secrets.GITHUB_TOKEN }}
100102
parallel: true
@@ -108,43 +110,34 @@ jobs:
108110
- browser_tests
109111
steps:
110112
- name: Let Coveralls know that all tests have finished
111-
uses: coverallsapp/github-action@v1.0.1
113+
uses: coverallsapp/github-action@v1.1.0
112114
with:
113115
github-token: ${{ secrets.GITHUB_TOKEN }}
114116
parallel-finished: true
115117

116-
deploy:
117-
name: Publish to NPM
118-
if: github.ref == 'refs/heads/master'
118+
release:
119+
name: Release
120+
# removed to test beta branch.
121+
# if: github.ref == 'refs/heads/master'
119122
runs-on: ubuntu-latest
120123
timeout-minutes: 10
121124
needs:
122125
- node_tests
123126
- browser_tests
124-
125127
steps:
126-
- name: Checkout source
127-
uses: actions/checkout@v2
128-
129-
- name: Install Node
130-
uses: actions/setup-node@v1
128+
- uses: actions/checkout@v2
129+
- uses: actions/setup-node@v1
130+
with:
131+
node-version: 12
131132

132133
- name: Install dependencies
133134
run: npm ci
134135

135-
- name: Publish to NPM
136-
uses: JS-DevTools/npm-publish@v1
137-
with:
138-
token: ${{ secrets.NPM_TOKEN }}
139-
140-
- name: Prepare the non-scoped packaged
141-
run: |
142-
cp LICENSE *.md dist
143-
VERSION=$(node -e "console.log(require('./package.json').version)")
144-
sed -i "s/X.X.X/${VERSION}/g" dist/package.json
136+
- name: Prepare Unscoped Package
137+
run: npm run build --if-present
145138

146-
- name: Publish the non-scoped package to NPM
147-
uses: JS-DevTools/npm-publish@v1
148-
with:
149-
token: ${{ secrets.NPM_TOKEN }}
150-
package: dist/package.json
139+
- name: Publish to NPM
140+
run: npx semantic-release
141+
env:
142+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.vscode/tasks.json

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// VSCode Tasks
2+
// https://code.visualstudio.com/docs/editor/tasks
3+
14
// Available variables which can be used inside of strings.
25
// ${workspaceRoot}: the root folder of the team
36
// ${file}: the current opened file
@@ -7,23 +10,25 @@
710
// ${cwd}: the current working directory of the spawned process
811

912
{
10-
"version": "0.1.0",
13+
"version": "2.0.0",
1114
"command": "npm",
12-
"isShellCommand": true,
13-
"suppressTaskName": true,
1415
"tasks": [
1516
{
16-
"taskName": "lint",
17-
"args": ["run", "lint"],
18-
"showOutput": "always",
19-
"problemMatcher": "$eslint-stylish",
20-
"isBuildCommand": true
17+
"type": "npm",
18+
"script": "lint",
19+
"group": {
20+
"kind": "build",
21+
"isDefault": true
22+
},
23+
"problemMatcher": "$tsc",
2124
},
2225
{
23-
"taskName": "test",
24-
"args": ["run", "mocha"],
25-
"showOutput": "always",
26-
"isTestCommand": true
27-
}
26+
"type": "npm",
27+
"script": "test:node",
28+
"group": {
29+
"kind": "test",
30+
"isDefault": true
31+
},
32+
},
2833
]
2934
}

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ JSON Schema $Ref Parser
22
============================
33
#### Parse, Resolve, and Dereference JSON Schema $ref pointers
44

5-
[![Build Status](https://github.com/APIDevTools/json-schema-ref-parser/workflows/CI-CD/badge.svg?branch=master)](https://github.com/APIDevTools/json-schema-ref-parser/blob/master/.github/workflows/CI-CD.yaml)
5+
[![Build Status](https://github.com/APIDevTools/json-schema-ref-parser/workflows/CI-CD/badge.svg?branch=master)](https://github.com/APIDevTools/json-schema-ref-parser/actions)
66
[![Coverage Status](https://coveralls.io/repos/github/APIDevTools/json-schema-ref-parser/badge.svg?branch=master)](https://coveralls.io/github/APIDevTools/json-schema-ref-parser)
77

88
[![npm](https://img.shields.io/npm/v/@apidevtools/json-schema-ref-parser.svg)](https://www.npmjs.com/package/@apidevtools/json-schema-ref-parser)
@@ -11,7 +11,7 @@ JSON Schema $Ref Parser
1111
[![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/APIDevTools/json-schema-ref-parser)
1212

1313

14-
[![OS and Browser Compatibility](https://apitools.dev/img/badges/ci-badges-with-ie.svg)](https://github.com/APIDevTools/json-schema-ref-parser/blob/master/.github/workflows/CI-CD.yaml)
14+
[![OS and Browser Compatibility](https://apitools.dev/img/badges/ci-badges-with-ie.svg)](https://github.com/APIDevTools/json-schema-ref-parser/actions)
1515

1616

1717
The Problem:
@@ -52,7 +52,7 @@ JSON Schema $Ref Parser is a full [JSON Reference](https://tools.ietf.org/html/d
5252
- Can [dereference](https://apitools.dev/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
5353
- Supports [circular references](https://apitools.dev/json-schema-ref-parser/docs/#circular-refs), nested references, back-references, and cross-references between files
5454
- Maintains object reference equality — `$ref` pointers to the same value always resolve to the same object instance
55-
- Tested in Node and all major web browsers on Windows, Mac, and Linux
55+
- Tested in Node v10, v12, & v14, and all major web browsers on Windows, Mac, and Linux
5656

5757

5858
Example
@@ -129,7 +129,7 @@ Full API documentation is available [right here](https://apitools.dev/json-schem
129129

130130
Contributing
131131
--------------------------
132-
I welcome any contributions, enhancements, and bug-fixes. [File an issue](https://github.com/APIDevTools/json-schema-ref-parser/issues) on GitHub and [submit a pull request](https://github.com/APIDevTools/json-schema-ref-parser/pulls).
132+
I welcome any contributions, enhancements, and bug-fixes. [Open an issue](https://github.com/APIDevTools/json-schema-ref-parser/issues) on GitHub and [submit a pull request](https://github.com/APIDevTools/json-schema-ref-parser/pulls).
133133

134134
#### Building/Testing
135135
To build/test the project locally on your computer:
@@ -157,6 +157,6 @@ Big Thanks To
157157
--------------------------
158158
Thanks to these awesome companies for their support of Open Source developers ❤
159159

160-
[![Travis CI](https://jstools.dev/img/badges/travis-ci.svg)](https://travis-ci.com)
160+
[![Stoplight](https://svgshare.com/i/TK5.svg)](https://stoplight.io/?utm_source=github&utm_medium=readme&utm_campaign=json_schema_ref_parser)
161161
[![SauceLabs](https://jstools.dev/img/badges/sauce-labs.svg)](https://saucelabs.com)
162162
[![Coveralls](https://jstools.dev/img/badges/coveralls.svg)](https://coveralls.io)

docs/options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Example
1010

1111
```javascript
1212
$RefParser.dereference("my-schema.yaml", {
13+
continueOnError: true, // Don't throw on the first error
1314
parse: {
1415
json: false, // Disable the JSON parser
1516
yaml: {
@@ -27,7 +28,6 @@ $RefParser.dereference("my-schema.yaml", {
2728
withCredentials: true, // Include auth credentials when resolving HTTP references
2829
}
2930
},
30-
continueOnError: true, // Don't throw on the first error
3131
dereference: {
3232
circular: false // Don't allow circular $refs
3333
}

karma.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ module.exports = karmaConfig({
1313
browsers: {
1414
chrome: host.ci ? host.os.linux : true,
1515
firefox: host.ci ? host.os.linux : true,
16-
safari: host.ci ? host.os.linux : host.os.mac,
17-
edge: host.ci ? host.os.linux : host.os.windows,
18-
ie: host.os.windows,
16+
safari: host.ci ? host.os.linux : host.os.mac, // SauceLabs in CI
17+
edge: host.ci ? host.os.linux : host.os.windows, // SauceLabs in CI
18+
ie: host.ci ? host.os.windows : false, // IE needs to run by itself, due to Babel transforms
1919
},
2020
});

lib/bundle.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function bundle (parser, options) {
3939
function crawl (parent, key, path, pathFromRoot, indirections, inventory, $refs, options) {
4040
let obj = key === null ? parent : parent[key];
4141

42-
if (obj && typeof obj === "object") {
42+
if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj)) {
4343
if ($Ref.isAllowed$Ref(obj)) {
4444
inventory$Ref(parent, key, path, pathFromRoot, indirections, inventory, $refs, options);
4545
}
@@ -135,7 +135,9 @@ function inventory$Ref ($refParent, $refKey, path, pathFromRoot, indirections, i
135135
});
136136

137137
// Recursively crawl the resolved value
138-
crawl(pointer.value, null, pointer.path, pathFromRoot, indirections + 1, inventory, $refs, options);
138+
if (!existingEntry) {
139+
crawl(pointer.value, null, pointer.path, pathFromRoot, indirections + 1, inventory, $refs, options);
140+
}
139141
}
140142

141143
/**

0 commit comments

Comments
 (0)