Skip to content

Commit

Permalink
pin cheerio dep and fix deprecatd css warning (#980)
Browse files Browse the repository at this point in the history
* update cheerio dep to 1.0.0. fix deprecatd css warning

* lets not break much

* change engine. added changelog
  • Loading branch information
newhouse authored Aug 12, 2024
1 parent 475584d commit 9f38a4e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 38 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 3.0.2
- Pinned `[email protected]`
- Fixed SCSS deprecation warning

### 3.0.1
- Added `ensure-npm` developer script
- Dependency updates
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spectaql",
"version": "3.0.1",
"version": "3.0.2",
"description": "A powerful library for autogenerating static GraphQL API documentation",
"author": "Anvil Foundry Inc. <[email protected]>",
"homepage": "https://github.com/anvilco/spectaql",
Expand All @@ -23,7 +23,7 @@
"generator"
],
"engines": {
"node": ">=14",
"node": ">=16",
"npm": ">=7"
},
"main": "index.js",
Expand Down Expand Up @@ -88,7 +88,7 @@
"@graphql-tools/merge": "^8.1.2",
"@graphql-tools/schema": "^9.0.1",
"@graphql-tools/utils": "^9.1.1",
"cheerio": "^1.0.0-rc.10",
"cheerio": "1.0.0-rc.12",
"coffeescript": "^2.6.1",
"commander": "^10.0.0",
"fast-glob": "^3.2.12",
Expand Down
8 changes: 4 additions & 4 deletions src/lib/common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import JSON5 from 'json5'
// https://www.npmjs.com/package/json-stringify-pretty-compact
import stringify from 'json-stringify-pretty-compact'
import cheerio from 'cheerio'
import { load as cheerioLoad } from 'cheerio'
import { marked } from 'marked'
import hljs from 'highlight.js'
import {
Expand Down Expand Up @@ -148,15 +148,15 @@ export function markdown(
let html = marked.parse(value)
// We strip the surrounding <p>-tag, if
if (stripParagraph) {
let $ = cheerio.load('<root>' + html + '</root>')('root')
let $ = cheerioLoad('<root>' + html + '</root>')('root')
// Only strip <p>-tags and only if there is just one of them.
if ($.children().length === 1 && $.children('p').length === 1) {
html = $.children('p').html()
}
}

if (addClass) {
let $ = cheerio.load('<root>' + html + '</root>')('root')
let $ = cheerioLoad('<root>' + html + '</root>')('root')
if ($.children().length === 1) {
$.children().first().addClass(addClass)
html = $.html()
Expand Down Expand Up @@ -473,5 +473,5 @@ export function printSchema(value, _root) {
// There is an issue with `marked` not formatting a leading quote in a single,
// quoted string value. By unwinding the special tags after converting to markdown
// we can avoid that issue.
return cheerio.load(unwindTags(quoted)).html()
return cheerioLoad(unwindTags(quoted)).html()
}
4 changes: 2 additions & 2 deletions src/themes/spectaql/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,12 @@ $background-sidebar: $background-subtle;
margin-bottom: $container-padding-desktop;
font-weight: normal;

@include containerPaddingHorizontal();

background: $background-sidebar;
border-top: 1px solid $border-color-subtle;
border-bottom: 1px solid $border-color-subtle;

@include containerPaddingHorizontal();

@media (min-width: $size-content-break) {
width: 50%;
}
Expand Down
33 changes: 4 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ cheerio-select@^2.1.0:
domhandler "^5.0.3"
domutils "^3.0.1"

cheerio@^1.0.0-rc.10:
[email protected].12:
version "1.0.0-rc.12"
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.12.tgz#788bf7466506b1c6bf5fae51d24a2c4d62e47683"
integrity sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==
Expand Down Expand Up @@ -4809,16 +4809,7 @@ string-template@~0.2.1:
resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add"
integrity sha512-Yptehjogou2xm4UJbxJ4CxgZx12HBfeystp0y3x7s4Dj32ltVVG1Gg8YhKjHZkHicuKpZX/ffilA8505VbUbpw==

"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -4848,7 +4839,7 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -4862,13 +4853,6 @@ strip-ansi@^3.0.0:
dependencies:
ansi-regex "^2.0.0"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2"
Expand Down Expand Up @@ -5189,7 +5173,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343"
integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -5207,15 +5191,6 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit 9f38a4e

Please sign in to comment.