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

Update ramda to 0.29 #654

Merged
merged 2 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
node-version: 10
- uses: actions/setup-python@v2
with:
python-version: 3.6
python-version: 3.8
Copy link
Member Author

@kylef kylef May 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.6 is no longer available on GitHub actions. 3.8 isn't the latest either but there are breaking changes in 3.9 which would mean we have to uptake other changes that I wanted to do right now to the way we build docs, Sphinx versions and the related toolchain.

- run: pip install -r docs/requirements.txt
- run: yarn --frozen-lockfile --ignore-optional
- run: env PATH="$(yarn bin):$PATH" make html
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,3 @@ jobs:
- uses: actions/checkout@v2
- run: yarn install --frozen-lockfile --ignore-optional
- run: ./scripts/smoke.sh

coverage:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: coverallsapp/github-action@master
Copy link
Member Author

@kylef kylef May 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GitHub org policies do not let us use external actions outside our space. Dropping coveralls reports (nice to have, and not fundamental).

with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
2 changes: 1 addition & 1 deletion packages/api-elements/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"dependencies": {
"minim": "^0.23.8",
"ramda": "^0.27.0"
"ramda": "^0.29.0"
},
"devDependencies": {
"chai": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/apiaryb-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"eslint": "^5.16.0",
"glob": "^7.1.2",
"mocha": "^7.1.1",
"pegjs": "git://github.com/dmajda/pegjs.git#02af83f9b416778878e52e2cbbc22d96e312164e"
"pegjs": "https://github.com/dmajda/pegjs.git#02af83f9b416778878e52e2cbbc22d96e312164e"
},
"engines": {
"node": ">=8"
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi3-parser/lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const deduplicateUnsupportedAnnotations = R.curry((namespace, parseResult) => {
},
R.T);

const result = new namespace.elements.ParseResult(R.filter(filterWarnings, parseResult));
const result = R.filter(filterWarnings, parseResult);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As fantasy land filter would result in the same type, we no longer need to wrap it back into a parse result.


// Update warning messages to include count
R.forEach(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ function parseOauthFlowsObject(context, object) {
authScheme.push(new namespace.elements.Member('grantType', grantTypes[member.key.toValue()]));
authScheme.push(member.value.getMember('scopes'));

R.filter(R.is(namespace.elements.Transition), member.value).forEach((item) => {
const isTransitionElement = R.is(namespace.elements.Transition);
member.value.filter(isTransitionElement).forEach((item) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was a little tricky to grapple with. member.value here is an ObjectElement. An object element is a series of key/value pairs called members.

ObjectElement's forEach has the signature of (value, key, item). Thus when filter returns an ObjectElement, the behaviour changed. I have switched to member.value.filter which is equivalent to the prior behaviour as it would call forEach on ArraySlice which iterates over each member element and doesn't have the forEach semantics of an object.

authScheme.push(item);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function parseOASObject(context, object) {
// Takes a parse result, and wraps all of the non annotations inside an array
const asArray = (parseResult) => {
const array = new namespace.elements.Array(R.reject(isAnnotation, parseResult));
return new namespace.elements.ParseResult([array].concat(parseResult.annotations.elements));
return new namespace.elements.ParseResult([array.content].concat(parseResult.annotations.elements));
};

const isOpenAPI31OrHigher = () => context.isOpenAPIVersionMoreThanOrEqual(3, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function parseType(context) {
}, types);

const parseResult = new namespace.elements.ParseResult();
parseResult.push(permittedTypes.elements);
parseResult.push(permittedTypes.content);

if (warnings.length > 0) {
parseResult.push(...warnings);
Expand Down
4 changes: 2 additions & 2 deletions packages/openapi3-parser/lib/parser/parseArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ function parseArray(context, name, parseValue) {
const convertParseResultMembersToArray = (parseResult) => {
const values = R.reject(isAnnotation, parseResult);
const annotations = R.filter(isAnnotation, parseResult);
const array = new namespace.elements.Array(values);
return new namespace.elements.ParseResult([array].concat(annotations.elements));
const array = new namespace.elements.Array(values.content);
return new namespace.elements.ParseResult([array].concat(annotations.content));
};

// Create a parse result from an array using all of the members
Expand Down
4 changes: 2 additions & 2 deletions packages/openapi3-parser/lib/parser/parseObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ function parseObject(context, name, parseMember, requiredKeys = [], orderedKeys
const convertParseResultMembersToObject = (parseResult) => {
const members = R.filter(isMember, parseResult);
const annotations = R.filter(isAnnotation, parseResult);
const object = new namespace.elements.Object(members);
return new namespace.elements.ParseResult([object].concat(annotations.elements));
const object = new namespace.elements.Object(members.content);
return new namespace.elements.ParseResult([object].concat(annotations.content));
};

// Create a parse result from an object using all of the members
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi3-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dependencies": {
"content-type": "^1.0.4",
"media-typer": "^1.0.1",
"ramda": "0.27.0",
"ramda": "^0.29.0",
"yaml-js": "^0.2.3"
},
"peerDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5249,9 +5249,9 @@ pathval@^1.1.0:
resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0"
integrity sha1-uULm1L3mUwBe9rcTYd74cn0GReA=

"pegjs@git://github.com/dmajda/pegjs.git#02af83f9b416778878e52e2cbbc22d96e312164e":
"pegjs@https://github.com/dmajda/pegjs.git#02af83f9b416778878e52e2cbbc22d96e312164e":
version "0.7.0"
resolved "git://github.com/dmajda/pegjs.git#02af83f9b416778878e52e2cbbc22d96e312164e"
resolved "https://github.com/dmajda/pegjs.git#02af83f9b416778878e52e2cbbc22d96e312164e"

performance-now@^2.1.0:
version "2.1.0"
Expand Down Expand Up @@ -5432,10 +5432,10 @@ quick-lru@^1.0.0:
resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8"
integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=

ramda@0.27.0, ramda@^0.27.0:
version "0.27.0"
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.0.tgz#915dc29865c0800bf3f69b8fd6c279898b59de43"
integrity sha512-pVzZdDpWwWqEVVLshWUHjNwuVP7SfcmPraYuqocJp1yo2U1R7P+5QAfDhdItkuoGqIBnBYrtPp7rEPqDn9HlZA==
ramda@^0.29.0:
version "0.29.0"
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.29.0.tgz#fbbb67a740a754c8a4cbb41e2a6e0eb8507f55fb"
integrity sha512-BBea6L67bYLtdbOqfp8f58fPMqEwx0doL+pAi8TZyp2YWz8R9G8z9x75CZI8W+ftqhFHCpEX2cRnUUXK130iKA==

randexp@^0.5.3:
version "0.5.3"
Expand Down