Skip to content

Commit

Permalink
Update dependencies (github#19408)
Browse files Browse the repository at this point in the history
* Update dependencies 2

* Lint fixes

* Update graphql packages

* Update changelog-entry.json

* Update @octokit/rest

* Update commander with help from @rachmari

@rachmari

* Upgrade helmet

* Upgrade js-yaml

* Update server.js

* Update cheerio

* Revert "Update cheerio"

This reverts commit 8aa17c39fbf564ee554037d89e7a473027d16984.
  • Loading branch information
heiskr committed May 19, 2021
1 parent dcd72d1 commit f6acb1f
Show file tree
Hide file tree
Showing 29 changed files with 3,540 additions and 4,368 deletions.
2 changes: 1 addition & 1 deletion lib/data-directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = function dataDirectory (dir, opts = {}) {
break
case '.yaml':
case '.yml':
set(data, key, yaml.safeLoad(fileContent, { filename }))
set(data, key, yaml.load(fileContent, { filename }))
break
case '.md':
case '.markdown':
Expand Down
8 changes: 4 additions & 4 deletions lib/redis-accessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class RedisAccessor {
} = {}) {
const redisClient = useRealRedis
? createRedisClient({
url: REDIS_URL,
db: databaseNumber,
name: name || 'redis-accessor'
})
url: REDIS_URL,
db: databaseNumber,
name: name || 'redis-accessor'
})
: InMemoryRedis.createClient()

this._client = redisClient
Expand Down
2 changes: 1 addition & 1 deletion middleware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ module.exports = function (app) {

// *** Security ***
app.use(require('./cors'))
app.use(require('./csp')) // Must come before helmet
app.use(require('helmet')())
app.use(require('./csp')) // Must come after helmet
app.use(require('./cookie-parser')) // Must come before csrf
app.use(express.json()) // Must come before csrf
app.use(require('./csrf'))
Expand Down
7,592 changes: 3,380 additions & 4,212 deletions package-lock.json

Large diffs are not rendered by default.

174 changes: 87 additions & 87 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,80 +9,80 @@
},
"license": "(MIT AND CC-BY-4.0)",
"dependencies": {
"@babel/core": "^7.12.9",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/core": "^7.14.3",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-syntax-class-properties": "^7.12.1",
"@babel/plugin-transform-modules-amd": "^7.12.1",
"@babel/plugin-transform-modules-commonjs": "^7.12.1",
"@babel/plugin-transform-react-jsx": "^7.12.7",
"@babel/plugin-transform-runtime": "^7.11.0",
"@babel/preset-env": "^7.12.7",
"@babel/preset-react": "^7.12.7",
"@babel/runtime": "^7.11.2",
"@graphql-inspector/core": "^2.3.0",
"@graphql-tools/load": "^6.2.5",
"@primer/components": "^28.0.1",
"@babel/plugin-transform-modules-amd": "^7.14.2",
"@babel/plugin-transform-modules-commonjs": "^7.14.0",
"@babel/plugin-transform-react-jsx": "^7.14.3",
"@babel/plugin-transform-runtime": "^7.14.3",
"@babel/preset-env": "^7.14.2",
"@babel/preset-react": "^7.13.13",
"@babel/runtime": "^7.14.0",
"@graphql-inspector/core": "^2.5.0",
"@graphql-tools/load": "^6.2.8",
"@primer/components": "^28.0.4",
"@primer/css": "^16.2.0",
"@primer/octicons": "^13.0.0",
"@primer/octicons-react": "^13.0.0",
"@primer/octicons": "^14.1.0",
"@primer/octicons-react": "^14.1.0",
"ajv": "^6.11.0",
"algoliasearch": "^3.35.1",
"algoliasearch": "^4.9.1",
"assert": "^2.0.0",
"babel-loader": "^8.1.0",
"babel-loader": "^8.2.2",
"babel-preset-env": "^1.7.0",
"browser-date-formatter": "^3.0.3",
"change-case": "^3.1.0",
"change-case": "^4.1.2",
"cheerio": "^1.0.0-rc.3",
"classnames": "^2.3.1",
"compression": "^1.7.4",
"connect-datadog": "0.0.9",
"connect-slashes": "^1.4.0",
"cookie-parser": "^1.4.5",
"copy-webpack-plugin": "^6.0.3",
"copy-webpack-plugin": "^8.1.1",
"cors": "^2.8.5",
"cross-env": "^7.0.2",
"css-loader": "^4.3.0",
"cross-env": "^7.0.3",
"css-loader": "^5.2.4",
"csurf": "^1.11.0",
"date-fns": "^2.21.3",
"directory-tree": "^2.2.5",
"dotenv": "^8.2.0",
"directory-tree": "^2.2.9",
"dotenv": "^9.0.2",
"express": "^4.17.1",
"express-rate-limit": "^5.1.3",
"express-rate-limit": "^5.2.6",
"express-timeout-handler": "^2.2.0",
"flat": "^5.0.0",
"github-slugger": "^1.2.1",
"got": "^9.6.0",
"gray-matter": "^4.0.2",
"flat": "^5.0.2",
"github-slugger": "^1.3.0",
"got": "^11.8.2",
"gray-matter": "^4.0.3",
"hast-util-from-parse5": "^6.0.1",
"hast-util-parse-selector": "^2.2.5",
"hast-util-select": "^4.0.2",
"hast-util-to-string": "^1.0.4",
"hastscript": "^6.0.0",
"helmet": "^3.21.2",
"helmet": "^4.6.0",
"highlightjs-graphql": "^1.0.2",
"hot-shots": "^8.2.0",
"hot-shots": "^8.3.1",
"html-entities": "^1.2.1",
"imurmurhash": "^0.1.4",
"is-url": "^1.2.4",
"js-cookie": "^2.2.1",
"js-yaml": "^3.14.0",
"js-yaml": "^4.1.0",
"linkinator": "^2.13.6",
"liquidjs": "^9.22.1",
"lodash": "^4.17.21",
"lunr": "^2.3.9",
"lunr-languages": "^1.4.0",
"mdast-util-from-markdown": "^0.8.4",
"mini-css-extract-plugin": "^1.4.1",
"mkdirp": "^1.0.3",
"morgan": "^1.9.1",
"mini-css-extract-plugin": "^1.6.0",
"mkdirp": "^1.0.4",
"morgan": "^1.10.0",
"next": "^10.2.0",
"node-fetch": "^2.6.1",
"parse5": "^6.0.1",
"port-used": "^2.0.8",
"rate-limit-redis": "^2.1.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"redis": "^3.1.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"redis": "^3.1.2",
"redis-mock": "^0.56.3",
"rehype-autolink-headings": "^2.0.5",
"rehype-highlight": "^4.1.0",
Expand All @@ -93,89 +93,89 @@
"remark-gemoji-to-emoji": "^1.1.0",
"remark-parse": "^7.0.2",
"remark-rehype": "^5.0.0",
"resolve-url-loader": "^3.1.2",
"resolve-url-loader": "^4.0.0",
"revalidator": "^0.3.1",
"rimraf": "^3.0.0",
"rimraf": "^3.0.2",
"rss-parser": "^3.12.0",
"sass": "^1.26.3",
"sass-loader": "^9.0.2",
"sass": "^1.32.13",
"sass-loader": "^11.1.1",
"search-with-your-keyboard": "1.1.0",
"semver": "^5.7.1",
"semver": "^7.3.5",
"slash": "^3.0.0",
"strip-html-comments": "^1.0.0",
"style-loader": "^1.2.1",
"style-loader": "^2.0.0",
"styled-components": "^5.3.0",
"throng": "^5.0.0",
"unified": "^8.4.2",
"unist-util-visit": "^2.0.3",
"uuid": "^8.3.0",
"walk-sync": "^1.1.4",
"webpack": "^5.30.0",
"webpack-cli": "^4.6.0"
"uuid": "^8.3.2",
"walk-sync": "^2.2.0",
"webpack": "^5.37.0",
"webpack-cli": "^4.7.0"
},
"devDependencies": {
"@actions/core": "^1.2.6",
"@actions/github": "^4.0.0",
"@octokit/rest": "^16.43.2",
"@types/lodash": "^4.14.168",
"@types/react": "^17.0.4",
"@types/react-dom": "^17.0.3",
"@actions/core": "^1.2.7",
"@actions/github": "^5.0.0",
"@octokit/rest": "^18.5.3",
"@types/lodash": "^4.14.169",
"@types/react": "^17.0.6",
"@types/react-dom": "^17.0.5",
"async": "^3.2.0",
"await-sleep": "0.0.1",
"aws-sdk": "^2.610.0",
"aws-sdk": "^2.909.0",
"babel-eslint": "^10.1.0",
"babel-plugin-styled-components": "^1.12.0",
"chalk": "^4.0.0",
"commander": "^6.2.0",
"chalk": "^4.1.1",
"commander": "^7.2.0",
"count-array-values": "^1.2.1",
"csp-parse": "0.0.2",
"csv-parse": "^4.8.8",
"csv-parser": "^2.3.3",
"csv-parse": "^4.15.4",
"csv-parser": "^3.0.0",
"dedent": "^0.7.0",
"del": "^4.1.1",
"domwaiter": "^1.1.0",
"eslint": "^7.13.0",
"eslint-config-standard": "^16.0.1",
"eslint-plugin-import": "^2.22.1",
"del": "^6.0.0",
"domwaiter": "^1.3.0",
"eslint": "^7.26.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.23.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-promise": "^5.1.0",
"event-to-promise": "^0.8.0",
"glob": "^7.1.6",
"graphql": "^14.5.8",
"glob": "^7.1.7",
"graphql": "^15.5.0",
"heroku-client": "^3.1.0",
"http-status-code": "^2.1.0",
"husky": "^4.2.1",
"image-size": "^0.7.4",
"husky": "^6.0.0",
"image-size": "^1.0.0",
"japanese-characters": "^1.1.0",
"javascript-stringify": "^2.0.1",
"javascript-stringify": "^2.1.0",
"jest": "^26.6.3",
"jest-expect-message": "^1.0.2",
"jest-github-actions-reporter": "^1.0.2",
"jest-puppeteer": "^4.4.0",
"jest-silent-reporter": "^0.2.1",
"jest-github-actions-reporter": "^1.0.3",
"jest-puppeteer": "^5.0.3",
"jest-silent-reporter": "^0.5.0",
"jest-slow-test-reporter": "^1.0.0",
"jimp": "^0.16.1",
"make-promises-safe": "^5.1.0",
"mime": "^2.4.4",
"mock-express-response": "^0.2.2",
"mockdate": "^3.0.2",
"nock": "^13.0.4",
"nodemon": "^2.0.4",
"npm-merge-driver-install": "^2.0.0",
"object-hash": "^2.0.1",
"pa11y-ci": "^2.4.0",
"prettier": "^2.1.2",
"mock-express-response": "^0.3.0",
"mockdate": "^3.0.5",
"nock": "^13.0.11",
"nodemon": "^2.0.7",
"npm-merge-driver-install": "^2.0.1",
"object-hash": "^2.1.1",
"pa11y-ci": "^2.4.1",
"prettier": "^2.3.0",
"process": "^0.11.10",
"puppeteer": "^5.5.0",
"replace": "^1.2.0",
"robots-parser": "^2.1.1",
"start-server-and-test": "^1.12.0",
"strip-ansi": "^6.0.0",
"supertest": "^4.0.2",
"puppeteer": "^9.1.1",
"replace": "^1.2.1",
"robots-parser": "^2.3.0",
"start-server-and-test": "^1.12.2",
"strip-ansi": "^7.0.0",
"supertest": "^6.1.3",
"typescript": "^4.2.4",
"url-template": "^2.0.8",
"webpack-dev-middleware": "^4.1.0",
"website-scraper": "^4.2.0",
"webpack-dev-middleware": "^4.2.0",
"website-scraper": "^4.2.3",
"xlsx-populate": "^1.21.0"
},
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions script/check-english-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ const languagesToSkip = Object.keys(require('../lib/languages'))
const enterpriseReleasesToSkip = new RegExp(`${root}.+?[/@](${deprecated.join('|')})(/|$)`)

const config = {
path: program.path || englishRoot,
path: program.opts().path || englishRoot,
concurrency: 300,
// If this is a dry run, turn off recursion.
recurse: !program.dryRun,
recurse: !program.opts().dryRun,
silent: true,
// The values in this array are treated as regexes.
linksToSkip: [
Expand Down Expand Up @@ -86,7 +86,7 @@ async function main () {
// Without this, undefined codes get JSON.stringified as `0`, which is not useful output.
.map(link => { link.status = link.status || 'Invalid'; return link })

if (!program.doNotRetry) {
if (!program.opts().doNotRetry) {
// Links to retry individually.
const linksToRetry = brokenLinks
.filter(link => retryStatusCodes.includes(link.status))
Expand Down
2 changes: 1 addition & 1 deletion script/create-glossary-from-spreadsheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const path = require('path')
const yaml = require('js-yaml')
const inputFile = path.join(__dirname, '../data/glossary.yml')

const glossary = yaml.safeLoad(fs.readFileSync(inputFile, 'utf8'))
const glossary = yaml.load(fs.readFileSync(inputFile, 'utf8'))

console.log(glossary)
const external = []
Expand Down
2 changes: 1 addition & 1 deletion script/early-access/symlink-from-local-repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ program
.option('-u, --unlink', 'remove the symlinks')
.parse(process.argv)

const { pathToEarlyAccessRepo, unlink } = program
const { pathToEarlyAccessRepo, unlink } = program.opts()

if (!pathToEarlyAccessRepo && !unlink) {
throw new Error('Must provide either `--path-to-early-access-repo <PATH>` or `--unlink`')
Expand Down
16 changes: 9 additions & 7 deletions script/early-access/update-data-and-image-paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ program
.option('-r, --remove', 'Remove "early-access" from data and image paths.')
.parse(process.argv)

if (!(program.add || program.remove)) {
const { add, remove, pathToEarlyAccessContentFile } = program.opts()

if (!(add || remove)) {
console.error('Error! Must specify either `--add` or `--remove`.')
process.exit(1)
}

let earlyAccessContentAndDataFiles
if (program.pathToEarlyAccessContentFile) {
earlyAccessContentAndDataFiles = path.posix.join(process.cwd(), program.pathToEarlyAccessContentFile)
if (pathToEarlyAccessContentFile) {
earlyAccessContentAndDataFiles = path.posix.join(process.cwd(), pathToEarlyAccessContentFile)

if (!fs.existsSync(earlyAccessContentAndDataFiles)) {
console.error(`Error! ${program.pathToEarlyAccessContentFile} can't be found. Make sure the path starts with 'content/early-access'.`)
console.error(`Error! ${pathToEarlyAccessContentFile} can't be found. Make sure the path starts with 'content/early-access'.`)
process.exit(1)
}
earlyAccessContentAndDataFiles = [earlyAccessContentAndDataFiles]
Expand All @@ -60,7 +62,7 @@ earlyAccessContentAndDataFiles

const replacements = {}

if (program.add) {
if (add) {
dataRefs
// Since we're adding early-access to the path, filter for those that do not already include it
.filter(dataRef => !dataRef.includes('data early-access.'))
Expand All @@ -78,7 +80,7 @@ earlyAccessContentAndDataFiles
})
}

if (program.remove) {
if (remove) {
dataRefs
// Since we're removing early-access from the path, filter for those that include it
.filter(dataRef => dataRef.includes('{% data early-access.'))
Expand Down Expand Up @@ -131,7 +133,7 @@ function checkVariable (dataRef) {
if (!fs.existsSync(variablePath)) return false

// If the variable file exists but doesn't have the referenced key, exclude it
const variableFileContent = yaml.safeLoad(fs.readFileSync(variablePath, 'utf8'))
const variableFileContent = yaml.load(fs.readFileSync(variablePath, 'utf8'))
return variableFileContent[variableKey]
}

Expand Down
4 changes: 2 additions & 2 deletions script/enterprise-server-deprecations/archive-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ program
.option('-d, --dry-run', 'only scrape the first 10 pages for testing purposes')
.parse(process.argv)

const pathToArchivalRepo = program.pathToArchivalRepo
const dryRun = program.dryRun
const pathToArchivalRepo = program.opts().pathToArchivalRepo
const dryRun = program.opts().dryRun

main()

Expand Down
Loading

0 comments on commit f6acb1f

Please sign in to comment.