diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 97% rename from .eslintrc.js rename to .eslintrc.cjs index 091d3e9f0..b637d473c 100644 --- a/.eslintrc.js +++ b/.eslintrc.cjs @@ -1,4 +1,4 @@ -const prettierConfig = require('./.prettierrc'); +const prettierConfig = require('./.prettierrc.json'); module.exports = { root: true, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a336e02d..2b363951b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,6 @@ name: Build & Test -on: - push: - branches: [master, develop] - pull_request: - branches: [master, develop] +on: [push] jobs: lint: diff --git a/.npmignore b/.npmignore index 8a1f39cec..dcdbf32ac 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,4 @@ .eslintignore -.eslintrc +.eslintrc.cjs .github .gitignore -.travis.yml diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 08106b59e..000000000 --- a/.prettierrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - arrowParens: 'avoid', - singleQuote: true, -}; diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 000000000..1c71f6070 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "arrowParens": "avoid", + "singleQuote": true +} diff --git a/.vscode/launch.json b/.vscode/launch.json index fb00f67b6..c9611c096 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,18 +7,18 @@ { "type": "node", "request": "launch", - "name": "Run tests", + "name": "Run unit tests", "runtimeExecutable": "npm", - "runtimeArgs": ["run-script", "test"], + "runtimeArgs": ["test"], "console": "integratedTerminal" }, { "type": "node", "request": "launch", "name": "Run current test file", - "runtimeExecutable": "npm", - "runtimeArgs": ["run-script", "test"], - "args": ["--", "-i", "${relativeFile}", "--testPathIgnorePatterns"], + "runtimeExecutable": "npx", + "runtimeArgs": ["jest"], + "args": ["-i", "${relativeFile}", "--testPathIgnorePatterns"], "console": "integratedTerminal" }, { @@ -41,10 +41,9 @@ "type": "node", "request": "launch", "name": "Update current test file snapshot(s)", - "runtimeExecutable": "npm", - "runtimeArgs": ["run-script", "test"], + "runtimeExecutable": "npx", + "runtimeArgs": ["jest"], "args": [ - "--", "-i", "${relativeFile}", "--updateSnapshot", @@ -56,8 +55,8 @@ "type": "node", "request": "launch", "name": "Update selected test name snapshot(s)", - "runtimeExecutable": "npm", - "runtimeArgs": ["run-script", "test"], + "runtimeExecutable": "npx", + "runtimeArgs": ["jest"], "args": [ "--", "-i", diff --git a/README.md b/README.md index 45941bbd8..b6e6ab7f5 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,10 @@ - [`develop` branch preview](https://docsify-preview.vercel.app/) - [Documentation](https://docsify.js.org) - [CLI](https://github.com/docsifyjs/docsify-cli) -- CDN: [UNPKG](https://unpkg.com/docsify/) | [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/) | [cdnjs](https://cdnjs.com/libraries/docsify) +- CDN: + - [UNPKG](https://unpkg.com/docsify/) + - [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/) + - [cdnjs](https://cdnjs.com/libraries/docsify) - [Awesome docsify](https://github.com/docsifyjs/awesome-docsify) - [Community chat](https://discord.gg/3NwKFyR) diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index f037a1a2a..000000000 --- a/babel.config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - presets: [ - [ - '@babel/preset-env', - { - targets: { - node: 'current', - }, - }, - ], - ], -}; diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 000000000..394c5435b --- /dev/null +++ b/babel.config.json @@ -0,0 +1,12 @@ +{ + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "node": "current" + } + } + ] + ] +} diff --git a/build/build.js b/build/build.js index 4ba4ec41f..190efcbbc 100644 --- a/build/build.js +++ b/build/build.js @@ -1,13 +1,19 @@ -const rollup = require('rollup') -const buble = require('rollup-plugin-buble') -const commonjs = require('rollup-plugin-commonjs') -const nodeResolve = require('rollup-plugin-node-resolve') -const { uglify } = require('rollup-plugin-uglify') -const replace = require('rollup-plugin-replace') -const isProd = process.env.NODE_ENV === 'production' -const version = process.env.VERSION || require('../package.json').version -const chokidar = require('chokidar') -const path = require('path') +import rollup from 'rollup'; +import buble from 'rollup-plugin-buble'; +import commonjs from 'rollup-plugin-commonjs'; +import nodeResolve from 'rollup-plugin-node-resolve'; +import { uglify } from 'rollup-plugin-uglify'; +import replace from 'rollup-plugin-replace'; +import chokidar from 'chokidar'; +import path from 'path'; +import { relative } from './util.js'; +import { promises as fs } from 'fs'; + +const pkgPath = relative(import.meta, '..', 'package.json'); +const pkgString = (await fs.readFile(pkgPath)).toString(); +const pkg = JSON.parse(pkgString); +const isProd = process.env.NODE_ENV === 'production'; +const version = process.env.VERSION || pkg.version; /** * @param {{ diff --git a/build/cover.js b/build/cover.js index fbd27f742..996e52569 100644 --- a/build/cover.js +++ b/build/cover.js @@ -1,14 +1,17 @@ -var fs = require('fs') -var read = fs.readFileSync -var write = fs.writeFileSync -var version = process.env.VERSION || require('../package.json').version +import fs from 'fs'; +import { relative } from './util.js'; +var read = fs.readFileSync; +var write = fs.writeFileSync; +const pkgPath = relative(import.meta, '..', 'package.json'); +const pkg = JSON.parse(read(pkgPath).toString()); +var version = process.env.VERSION || pkg.version; -var file = __dirname + '/../docs/_coverpage.md' -var cover = read(file, 'utf8').toString() +var file = relative(import.meta, '..', 'docs', '_coverpage.md'); +var cover = read(file, 'utf8').toString(); -console.log('Replace version number in cover page...') +console.log('Replace version number in cover page...'); cover = cover.replace( /(\S+)?<\/small>/g, '' + version + '' -) -write(file, cover) +); +write(file, cover); diff --git a/build/css.js b/build/css.js index 2214f3fe4..baf981628 100644 --- a/build/css.js +++ b/build/css.js @@ -1,9 +1,10 @@ -const fs = require('fs') -const path = require('path') -const {spawn} = require('child_process') +import fs from 'fs' +import path from 'path' +import {spawn} from 'child_process' +const relative = path => new URL(path, import.meta.url); const args = process.argv.slice(2) -fs.readdir(path.join(__dirname, '../src/themes'), (err, files) => { +fs.readdir(relative('../src/themes'), (err, files) => { if (err) { console.error('err', err) process.exit(1) diff --git a/build/emoji.js b/build/emoji.js index c19b8e735..f9d5d0aa2 100644 --- a/build/emoji.js +++ b/build/emoji.js @@ -1,6 +1,6 @@ -const axios = require('axios'); -const fs = require('fs'); -const path = require('path'); +import axios from 'axios'; +import fs from 'fs'; +import path from 'path'; const filePaths = { emojiMarkdown: path.resolve(process.cwd(), 'docs', 'emoji.md'), diff --git a/build/mincss.js b/build/mincss.js index 0c9c72280..05b8d770e 100644 --- a/build/mincss.js +++ b/build/mincss.js @@ -1,12 +1,12 @@ -const cssnano = require('cssnano').process -const path = require('path') -const fs = require('fs') +import cssnano from 'cssnano'; +import path from 'path' +import fs from 'fs' -files = fs.readdirSync(path.resolve('lib/themes')) +const files = fs.readdirSync(path.resolve('lib/themes')) files.forEach(file => { file = path.resolve('lib/themes', file) - cssnano(fs.readFileSync(file)).then(result => { + cssnano.process(fs.readFileSync(file)).then(result => { fs.writeFileSync(file, result.css) }).catch(e => { console.error(e) diff --git a/build/util.js b/build/util.js new file mode 100644 index 000000000..0dad7d3a6 --- /dev/null +++ b/build/util.js @@ -0,0 +1,6 @@ +import url from 'url'; +import path from 'path'; + +/** Get a new path relative to the current module (pass import.meta). */ +export const relative = (meta, ...to) => + path.resolve(path.dirname(url.fileURLToPath(meta.url)), ...to); diff --git a/jest.config.js b/jest.config.js index 7d00317ee..e0f5de0aa 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,4 @@ -const { TEST_HOST } = require('./test/config/server.js'); +import { TEST_HOST } from './test/config/server.js'; const sharedConfig = { errorOnDeprecated: true, @@ -11,7 +11,8 @@ const sharedConfig = { testURL: `${TEST_HOST}/_blank.html`, }; -module.exports = { +export default { + transform: {}, projects: [ // Unit Tests { diff --git a/package-lock.json b/package-lock.json index afe358b4a..ebef8ca23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,9 @@ "@babel/core": "^7.11.6", "@babel/eslint-parser": "^7.16.5", "@babel/preset-env": "^7.11.5", + "@eslint/js": "^8.43.0", "@playwright/test": "^1.18.1", + "@types/eslint": "^8.40.2", "autoprefixer-stylus": "^1.0.0", "axios": "^0.21.1", "babel-jest": "^27.4.6", @@ -33,19 +35,20 @@ "copy-dir": "^1.2.0", "cross-env": "^7.0.3", "cssnano": "^4.1.10", - "eslint": "^8.7.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.20.1", - "eslint-plugin-jest": "^27.2.1", - "eslint-plugin-playwright": "^0.12.0", - "eslint-plugin-prettier": "^4.0.0", + "eslint": "^8.43.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-jest": "^27.2.2", + "eslint-plugin-playwright": "^0.15.1", + "eslint-plugin-prettier": "^4.2.1", + "globals": "^13.20.0", "husky": "^8.0.3", "jest": "^27.4.7", "lint-staged": "^13.2.2", "live-server": "^1.2.1", "mkdirp": "^3.0.0", "npm-run-all": "^4.1.5", - "prettier": "^2.5.1", + "prettier": "^2.8.8", "rimraf": "^3.0.0", "rollup": "^1.23.1", "rollup-plugin-async": "^1.2.0", @@ -1061,6 +1064,15 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-classes/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/plugin-transform-computed-properties": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz", @@ -1860,6 +1872,15 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/types": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", @@ -1933,21 +1954,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@eslint/eslintrc/node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -1985,18 +1991,6 @@ "node": ">=4" } }, - "node_modules/@eslint/eslintrc/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@eslint/js": { "version": "8.43.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.43.0.tgz", @@ -2898,6 +2892,16 @@ "@types/node": "*" } }, + "node_modules/@types/eslint": { + "version": "8.40.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.40.2.tgz", + "integrity": "sha512-PRVjQ4Eh9z9pmmtaq8nTjZjQwKFk7YIHIud3lRoKRBgUQjgjRmoGxxGEPXQkF+lH7QkHJRNr5F4aBgYCW0lqpQ==", + "dev": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, "node_modules/@types/estree": { "version": "0.0.50", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", @@ -3588,6 +3592,19 @@ "node": ">=0.10.0" } }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array-ify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", @@ -3595,15 +3612,15 @@ "dev": true }, "node_modules/array-includes": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", - "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", - "get-intrinsic": "^1.1.1", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", "is-string": "^1.0.7" }, "engines": { @@ -3632,14 +3649,33 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", - "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -3776,6 +3812,18 @@ "postcss": "7.0.17" } }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/axios": { "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", @@ -5717,15 +5765,19 @@ } }, "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", "dev": true, "dependencies": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-property": { @@ -6159,31 +6211,45 @@ } }, "node_modules/es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", + "version": "1.21.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", + "integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==", "dev": true, "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.2.0", "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", "has": "^1.0.3", - "has-symbols": "^1.0.2", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", + "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", + "is-typed-array": "^1.1.10", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.3", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.9" }, "engines": { "node": ">= 0.4" @@ -6192,6 +6258,29 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + } + }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -6334,13 +6423,14 @@ } }, "node_modules/eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", + "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", "dev": true, "dependencies": { "debug": "^3.2.7", - "resolve": "^1.20.0" + "is-core-module": "^2.11.0", + "resolve": "^1.22.1" } }, "node_modules/eslint-import-resolver-node/node_modules/debug": { @@ -6353,16 +6443,20 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.2.tgz", - "integrity": "sha512-zquepFnWCY2ISMFwD/DqzaM++H+7PDzOpUvotJWm/y1BAFt5R4oeULgdrTejKqLkz7MA/tgstsUMNYc7wNdTrg==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "dependencies": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "debug": "^3.2.7" }, "engines": { "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, "node_modules/eslint-module-utils/node_modules/debug": { @@ -6374,92 +6468,27 @@ "ms": "^2.1.1" } }, - "node_modules/eslint-module-utils/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-plugin-import": { - "version": "2.25.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", - "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", + "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", "dev": true, "dependencies": { - "array-includes": "^3.1.4", - "array.prototype.flat": "^1.2.5", - "debug": "^2.6.9", + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.2", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.7.4", "has": "^1.0.3", - "is-core-module": "^2.8.0", + "is-core-module": "^2.11.0", "is-glob": "^4.0.3", - "minimatch": "^3.0.4", - "object.values": "^1.1.5", - "resolve": "^1.20.0", - "tsconfig-paths": "^3.12.0" + "minimatch": "^3.1.2", + "object.values": "^1.1.6", + "resolve": "^1.22.1", + "semver": "^6.3.0", + "tsconfig-paths": "^3.14.1" }, "engines": { "node": ">=4" @@ -6469,12 +6498,12 @@ } }, "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "node_modules/eslint-plugin-import/node_modules/doctrine": { @@ -6489,12 +6518,6 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-import/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "node_modules/eslint-plugin-jest": { "version": "27.2.2", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.2.2.tgz", @@ -6521,13 +6544,13 @@ } }, "node_modules/eslint-plugin-playwright": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.12.0.tgz", - "integrity": "sha512-KXuzQjVzca5irMT/7rvzJKsVDGbQr43oQPc8i+SLEBqmfrTxlwMwRqfv9vtZqh4hpU0jmrnA/EOfwtls+5QC1w==", + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.15.1.tgz", + "integrity": "sha512-JyzskjLkCZqswRZ+ZZNH+jS8qnI/w0qTHOA2i5IJxXC+MfaKv03YqOFb+aoJukxTpOp0rOnm9FQ/jsF+lj/cBg==", "dev": true, "peerDependencies": { "eslint": ">=7", - "eslint-plugin-jest": ">=24" + "eslint-plugin-jest": ">=25" }, "peerDependenciesMeta": { "eslint-plugin-jest": { @@ -6728,21 +6751,6 @@ "node": ">=10.13.0" } }, - "node_modules/eslint/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eslint/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -6897,18 +6905,6 @@ "node": ">= 0.8.0" } }, - "node_modules/eslint/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/espree": { "version": "9.5.2", "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", @@ -7524,6 +7520,15 @@ } } }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -7611,6 +7616,33 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -7630,14 +7662,15 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1" + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -7834,12 +7867,45 @@ } }, "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/globby": { @@ -7862,6 +7928,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -7926,9 +8004,9 @@ } }, "node_modules/has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -7943,10 +8021,34 @@ "node": ">=4" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, "engines": { "node": ">= 0.4" @@ -8329,12 +8431,12 @@ "dev": true }, "node_modules/internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.0", + "get-intrinsic": "^1.2.0", "has": "^1.0.3", "side-channel": "^1.0.4" }, @@ -8363,6 +8465,20 @@ "node": ">=0.10.0" } }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -8416,9 +8532,9 @@ "dev": true }, "node_modules/is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { "node": ">= 0.4" @@ -8442,9 +8558,9 @@ } }, "node_modules/is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -8603,9 +8719,9 @@ } }, "node_modules/is-number-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", - "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" @@ -8682,10 +8798,13 @@ "dev": true }, "node_modules/is-shared-array-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", - "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -8744,6 +8863,25 @@ "node": ">=0.10.0" } }, + "node_modules/is-typed-array": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", + "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -12481,14 +12619,14 @@ } }, "node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, "engines": { @@ -12528,14 +12666,14 @@ } }, "node_modules/object.values": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", - "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "engines": { "node": ">= 0.4" @@ -13972,6 +14110,23 @@ "node": ">=0.10.0" } }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regexpu-core": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", @@ -14056,12 +14211,12 @@ "dev": true }, "node_modules/resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", "dev": true, "dependencies": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.11.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -14463,6 +14618,20 @@ "ret": "~0.1.10" } }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -15557,27 +15726,46 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -16166,6 +16354,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -16221,14 +16423,14 @@ } }, "node_modules/unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" }, "funding": { @@ -16731,6 +16933,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-typed-array": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -17668,6 +17890,14 @@ "@babel/helper-replace-supers": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.5", "globals": "^11.1.0" + }, + "dependencies": { + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + } } }, "@babel/plugin-transform-computed-properties": { @@ -18209,6 +18439,14 @@ "@babel/types": "^7.22.5", "debug": "^4.1.0", "globals": "^11.1.0" + }, + "dependencies": { + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + } } }, "@babel/types": { @@ -18263,17 +18501,8 @@ "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "import-fresh": { "version": "3.3.0", @@ -18299,12 +18528,6 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true } } }, @@ -19004,6 +19227,16 @@ "@types/node": "*" } }, + "@types/eslint": { + "version": "8.40.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.40.2.tgz", + "integrity": "sha512-PRVjQ4Eh9z9pmmtaq8nTjZjQwKFk7YIHIud3lRoKRBgUQjgjRmoGxxGEPXQkF+lH7QkHJRNr5F4aBgYCW0lqpQ==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, "@types/estree": { "version": "0.0.50", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", @@ -19567,6 +19800,16 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, + "array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + } + }, "array-ify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", @@ -19574,15 +19817,15 @@ "dev": true }, "array-includes": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", - "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", - "get-intrinsic": "^1.1.1", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", "is-string": "^1.0.7" } }, @@ -19599,14 +19842,27 @@ "dev": true }, "array.prototype.flat": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", - "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + } + }, + "array.prototype.flatmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" } }, "arrify": { @@ -19708,6 +19964,12 @@ "postcss": "7.0.17" } }, + "available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true + }, "axios": { "version": "0.21.4", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", @@ -21199,12 +21461,13 @@ "dev": true }, "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", "dev": true, "requires": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" } }, "define-property": { @@ -21530,31 +21793,65 @@ } }, "es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", + "version": "1.21.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", + "integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==", "dev": true, "requires": { + "array-buffer-byte-length": "^1.0.0", + "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.2.0", "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", "has": "^1.0.3", - "has-symbols": "^1.0.2", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", + "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", + "is-typed-array": "^1.1.10", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.3", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.9" + } + }, + "es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + } + }, + "es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "requires": { + "has": "^1.0.3" } }, "es-to-primitive": { @@ -21730,15 +22027,6 @@ "is-glob": "^4.0.3" } }, - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -21844,12 +22132,6 @@ "requires": { "prelude-ls": "^1.2.1" } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true } } }, @@ -21861,13 +22143,14 @@ "requires": {} }, "eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", + "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", "dev": true, "requires": { "debug": "^3.2.7", - "resolve": "^1.20.0" + "is-core-module": "^2.11.0", + "resolve": "^1.22.1" }, "dependencies": { "debug": { @@ -21882,13 +22165,12 @@ } }, "eslint-module-utils": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.2.tgz", - "integrity": "sha512-zquepFnWCY2ISMFwD/DqzaM++H+7PDzOpUvotJWm/y1BAFt5R4oeULgdrTejKqLkz7MA/tgstsUMNYc7wNdTrg==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "requires": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "debug": "^3.2.7" }, "dependencies": { "debug": { @@ -21899,86 +22181,39 @@ "requires": { "ms": "^2.1.1" } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true } } }, "eslint-plugin-import": { - "version": "2.25.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", - "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", + "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", "dev": true, "requires": { - "array-includes": "^3.1.4", - "array.prototype.flat": "^1.2.5", - "debug": "^2.6.9", + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.2", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.7.4", "has": "^1.0.3", - "is-core-module": "^2.8.0", + "is-core-module": "^2.11.0", "is-glob": "^4.0.3", - "minimatch": "^3.0.4", - "object.values": "^1.1.5", - "resolve": "^1.20.0", - "tsconfig-paths": "^3.12.0" + "minimatch": "^3.1.2", + "object.values": "^1.1.6", + "resolve": "^1.22.1", + "semver": "^6.3.0", + "tsconfig-paths": "^3.14.1" }, "dependencies": { "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "doctrine": { @@ -21989,12 +22224,6 @@ "requires": { "esutils": "^2.0.2" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true } } }, @@ -22008,9 +22237,9 @@ } }, "eslint-plugin-playwright": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.12.0.tgz", - "integrity": "sha512-KXuzQjVzca5irMT/7rvzJKsVDGbQr43oQPc8i+SLEBqmfrTxlwMwRqfv9vtZqh4hpU0jmrnA/EOfwtls+5QC1w==", + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.15.1.tgz", + "integrity": "sha512-JyzskjLkCZqswRZ+ZZNH+jS8qnI/w0qTHOA2i5IJxXC+MfaKv03YqOFb+aoJukxTpOp0rOnm9FQ/jsF+lj/cBg==", "dev": true, "requires": {} }, @@ -22548,6 +22777,15 @@ "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "dev": true }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -22616,6 +22854,24 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + } + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true + }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -22629,14 +22885,15 @@ "dev": true }, "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1" + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" } }, "get-package-type": { @@ -22781,10 +23038,30 @@ } }, "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + }, + "dependencies": { + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } + }, + "globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } }, "globby": { "version": "11.1.0", @@ -22800,6 +23077,15 @@ "slash": "^3.0.0" } }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -22849,9 +23135,9 @@ } }, "has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true }, "has-flag": { @@ -22860,10 +23146,25 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.1" + } + }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true + }, "has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true }, "has-tostringtag": { @@ -23156,12 +23457,12 @@ "dev": true }, "internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "requires": { - "get-intrinsic": "^1.1.0", + "get-intrinsic": "^1.2.0", "has": "^1.0.3", "side-channel": "^1.0.4" } @@ -23181,6 +23482,17 @@ "kind-of": "^6.0.0" } }, + "is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -23222,9 +23534,9 @@ "dev": true }, "is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true }, "is-color-stop": { @@ -23242,9 +23554,9 @@ } }, "is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "dev": true, "requires": { "has": "^1.0.3" @@ -23360,9 +23672,9 @@ } }, "is-number-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", - "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "requires": { "has-tostringtag": "^1.0.0" @@ -23418,10 +23730,13 @@ "dev": true }, "is-shared-array-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", - "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", - "dev": true + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } }, "is-stream": { "version": "3.0.0", @@ -23456,6 +23771,19 @@ "text-extensions": "^1.0.0" } }, + "is-typed-array": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", + "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -26306,14 +26634,14 @@ } }, "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", "object-keys": "^1.1.1" } }, @@ -26338,14 +26666,14 @@ } }, "object.values": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", - "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" } }, "on-finished": { @@ -27495,6 +27823,17 @@ "safe-regex": "^1.1.0" } }, + "regexp.prototype.flags": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" + } + }, "regexpu-core": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", @@ -27563,12 +27902,12 @@ "dev": true }, "resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", "dev": true, "requires": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.11.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -27911,6 +28250,17 @@ "ret": "~0.1.10" } }, + "safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + } + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -28801,24 +29151,37 @@ "es-abstract": "^1.19.1" } }, + "string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + } + }, "string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" } }, "string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" } }, "strip-ansi": { @@ -29275,6 +29638,17 @@ "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true }, + "typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + } + }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -29304,14 +29678,14 @@ "dev": true }, "unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" } }, @@ -29714,6 +30088,20 @@ "is-symbol": "^1.0.3" } }, + "which-typed-array": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.10" + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", diff --git a/package.json b/package.json index 0ac35b5b0..661223f77 100644 --- a/package.json +++ b/package.json @@ -2,19 +2,22 @@ "name": "docsify", "version": "4.13.0", "description": "A magical documentation generator.", - "author": { - "name": "qingwei-li", - "email": "cinwell.li@gmail.com", - "url": "https://github.com/QingWei-Li" - }, "homepage": "https://docsify.js.org", + "repository": "github:docsifyjs/docsify", + "authors": "https://github.com/docsifyjs/docsify/graphs/contributors", "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/docsifyjs/docsify.git" + "collective": { + "url": "https://opencollective.com/docsify" }, + "type": "module", + "// The 'main' and 'unpkg' fields will remain as legacy for backwards compatbility for now. We will add deprectaion warnings to these outputs to give people time to see the warnings in their apps in a non-breaking way, and eventually we can remove the legacy stuff.": "", "main": "lib/docsify.js", "unpkg": "lib/docsify.min.js", + "// We're using the 'exports' field as an override of the 'main' field to provide the new ESM setup. Once we remove legacy 'main', we will remove the 'exports' field and have a simple ESM setup with only a 'main' field.": "", + "exports": { + ".": "./src/Docsify.js", + "./*": "./*" + }, "files": [ "lib", "themes" @@ -46,9 +49,10 @@ "pub": "sh build/release.sh", "serve": "node server", "test:e2e": "playwright test", - "test:integration": "jest --selectProjects integration", - "test:unit": "jest --selectProjects unit", - "test": "jest && run-s test:e2e", + "test:integration": "npm run jest -- --selectProjects integration", + "test:unit": "npm run jest -- --selectProjects unit", + "test": "npm run jest && run-s test:e2e", + "jest": "cross-env NODE_OPTIONS=--experimental-vm-modules jest", "watch:css": "npm run css -- -o themes -w", "watch:js": "node build/build.js" }, @@ -73,7 +77,9 @@ "@babel/core": "^7.11.6", "@babel/eslint-parser": "^7.16.5", "@babel/preset-env": "^7.11.5", + "@eslint/js": "^8.43.0", "@playwright/test": "^1.18.1", + "@types/eslint": "^8.40.2", "autoprefixer-stylus": "^1.0.0", "axios": "^0.21.1", "babel-jest": "^27.4.6", @@ -84,19 +90,20 @@ "copy-dir": "^1.2.0", "cross-env": "^7.0.3", "cssnano": "^4.1.10", - "eslint": "^8.7.0", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.20.1", - "eslint-plugin-jest": "^27.2.1", - "eslint-plugin-playwright": "^0.12.0", - "eslint-plugin-prettier": "^4.0.0", + "eslint": "^8.43.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-jest": "^27.2.2", + "eslint-plugin-playwright": "^0.15.1", + "eslint-plugin-prettier": "^4.2.1", + "globals": "^13.20.0", "husky": "^8.0.3", "jest": "^27.4.7", "lint-staged": "^13.2.2", "live-server": "^1.2.1", "mkdirp": "^3.0.0", "npm-run-all": "^4.1.5", - "prettier": "^2.5.1", + "prettier": "^2.8.8", "rimraf": "^3.0.0", "rollup": "^1.23.1", "rollup-plugin-async": "^1.2.0", @@ -117,8 +124,5 @@ "documentation", "creator", "generator" - ], - "collective": { - "url": "https://opencollective.com/docsify" - } + ] } diff --git a/playwright.config.js b/playwright.config.js index 7759bfd52..a0fb595fb 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -1,4 +1,4 @@ -const { devices } = require('@playwright/test'); +import { devices } from '@playwright/test'; /** * @see https://playwright.dev/docs/test-configuration @@ -61,4 +61,4 @@ const config = { ], }; -module.exports = config; +export default config; diff --git a/server.js b/server.js index f592598ef..00a863fe4 100644 --- a/server.js +++ b/server.js @@ -1,10 +1,10 @@ -const liveServer = require('live-server') -const middleware = [] +import liveServer from 'live-server'; +const middleware = []; const params = { port: 3000, watch: ['lib', 'docs', 'themes'], - middleware -} + middleware, +}; -liveServer.start(params) +liveServer.start(params); diff --git a/src/core/Docsify.js b/src/core/Docsify.js index 7ea7efa77..06f584335 100644 --- a/src/core/Docsify.js +++ b/src/core/Docsify.js @@ -6,8 +6,8 @@ import { VirtualRoutes } from './virtual-routes/index.js'; import initGlobalAPI from './global-api.js'; import config from './config.js'; -import { isFn } from './util/core'; -import { Lifecycle } from './init/lifecycle'; +import { isFn } from './util/core.js'; +import { Lifecycle } from './init/lifecycle.js'; /** @typedef {new (...args: any[]) => any} Constructor */ diff --git a/src/core/config.js b/src/core/config.js index 9a8bdb2f8..7d77c0383 100644 --- a/src/core/config.js +++ b/src/core/config.js @@ -1,4 +1,4 @@ -import { merge, hyphenate, isPrimitive, hasOwn } from './util/core'; +import { merge, hyphenate, isPrimitive, hasOwn } from './util/core.js'; const currentScript = document.currentScript; diff --git a/src/core/event/index.js b/src/core/event/index.js index 11c02f975..a56daf3d1 100644 --- a/src/core/event/index.js +++ b/src/core/event/index.js @@ -1,7 +1,7 @@ -import { isMobile } from '../util/env'; -import { body, on } from '../util/dom'; -import * as sidebar from './sidebar'; -import { scrollIntoView, scroll2Top } from './scroll'; +import { isMobile } from '../util/env.js'; +import { body, on } from '../util/dom.js'; +import * as sidebar from './sidebar.js'; +import { scrollIntoView, scroll2Top } from './scroll.js'; /** @typedef {import('../Docsify').Constructor} Constructor */ diff --git a/src/core/event/scroll.js b/src/core/event/scroll.js index d46447b7f..f01f01ba2 100644 --- a/src/core/event/scroll.js +++ b/src/core/event/scroll.js @@ -1,8 +1,8 @@ import Tweezer from 'tweezer.js'; -import { isMobile } from '../util/env'; -import * as dom from '../util/dom'; -import { removeParams } from '../router/util'; -import config from '../config'; +import { isMobile } from '../util/env.js'; +import * as dom from '../util/dom.js'; +import { removeParams } from '../router/util.js'; +import config from '../config.js'; const nav = {}; let hoverOver = false; diff --git a/src/core/event/sidebar.js b/src/core/event/sidebar.js index c142529ef..0e8442914 100644 --- a/src/core/event/sidebar.js +++ b/src/core/event/sidebar.js @@ -1,6 +1,6 @@ /* eslint-disable no-unused-vars */ -import { isMobile } from '../util/env'; -import * as dom from '../util/dom'; +import { isMobile } from '../util/env.js'; +import * as dom from '../util/dom.js'; const title = dom.$.title; /** diff --git a/src/core/fetch/ajax.js b/src/core/fetch/ajax.js index a7896b0e2..fc18ba909 100644 --- a/src/core/fetch/ajax.js +++ b/src/core/fetch/ajax.js @@ -1,6 +1,6 @@ /* eslint-disable no-unused-vars */ -import progressbar from '../render/progressbar'; -import { noop, hasOwn } from '../util/core'; +import progressbar from '../render/progressbar.js'; +import { noop, hasOwn } from '../util/core.js'; const cache = {}; diff --git a/src/core/fetch/index.js b/src/core/fetch/index.js index cb363bdb7..be6319db1 100644 --- a/src/core/fetch/index.js +++ b/src/core/fetch/index.js @@ -1,8 +1,8 @@ /* eslint-disable no-unused-vars */ -import { getParentPath, stringifyQuery } from '../router/util'; -import { noop, isExternal } from '../util/core'; -import { getAndActive } from '../event/sidebar'; -import { get } from './ajax'; +import { getParentPath, stringifyQuery } from '../router/util.js'; +import { noop, isExternal } from '../util/core.js'; +import { getAndActive } from '../event/sidebar.js'; +import { get } from './ajax.js'; function loadNested(path, qs, file, next, vm, first) { path = first ? path : path.replace(/\/$/, ''); diff --git a/src/core/global-api.js b/src/core/global-api.js index cb89e2bee..1673f0f92 100644 --- a/src/core/global-api.js +++ b/src/core/global-api.js @@ -1,10 +1,10 @@ import prism from 'prismjs'; import { marked } from 'marked'; -import * as util from './util'; -import * as dom from './util/dom'; -import { Compiler } from './render/compiler'; -import { slugify } from './render/slugify'; -import { get } from './fetch/ajax'; +import * as util from './util/index.js'; +import * as dom from './util/dom.js'; +import { Compiler } from './render/compiler.js'; +import { slugify } from './render/slugify.js'; +import { get } from './fetch/ajax.js'; // TODO This is deprecated, kept for backwards compatibility. Remove in next // major release. We'll tell people to get everything from the DOCSIFY global diff --git a/src/core/index.js b/src/core/index.js index 6e6164186..7074b3b73 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -1,5 +1,5 @@ -import { documentReady } from './util/dom'; -import { Docsify } from './Docsify'; +import { documentReady } from './util/dom.js'; +import { Docsify } from './Docsify.js'; /** * Run Docsify diff --git a/src/core/init/lifecycle.js b/src/core/init/lifecycle.js index 94a3981fe..531ef354d 100644 --- a/src/core/init/lifecycle.js +++ b/src/core/init/lifecycle.js @@ -1,4 +1,4 @@ -import { noop } from '../util/core'; +import { noop } from '../util/core.js'; /** @typedef {import('../Docsify').Constructor} Constructor */ diff --git a/src/core/render/compiler.js b/src/core/render/compiler.js index 91764643a..b68881485 100644 --- a/src/core/render/compiler.js +++ b/src/core/render/compiler.js @@ -1,21 +1,21 @@ import { marked } from 'marked'; -import { isAbsolutePath, getPath, getParentPath } from '../router/util'; -import { isFn, merge, cached, isPrimitive } from '../util/core'; -import { tree as treeTpl } from './tpl'; -import { genTree } from './gen-tree'; -import { slugify } from './slugify'; -import { emojify } from './emojify'; +import { isAbsolutePath, getPath, getParentPath } from '../router/util.js'; +import { isFn, merge, cached, isPrimitive } from '../util/core.js'; +import { tree as treeTpl } from './tpl.js'; +import { genTree } from './gen-tree.js'; +import { slugify } from './slugify.js'; +import { emojify } from './emojify.js'; import { getAndRemoveConfig, removeAtag, getAndRemoveDocisfyIgnorConfig, -} from './utils'; -import { imageCompiler } from './compiler/image'; -import { highlightCodeCompiler } from './compiler/code'; -import { paragraphCompiler } from './compiler/paragraph'; -import { taskListCompiler } from './compiler/taskList'; -import { taskListItemCompiler } from './compiler/taskListItem'; -import { linkCompiler } from './compiler/link'; +} from './utils.js'; +import { imageCompiler } from './compiler/image.js'; +import { highlightCodeCompiler } from './compiler/code.js'; +import { paragraphCompiler } from './compiler/paragraph.js'; +import { taskListCompiler } from './compiler/taskList.js'; +import { taskListItemCompiler } from './compiler/taskListItem.js'; +import { linkCompiler } from './compiler/link.js'; const cachedLinks = {}; diff --git a/src/core/render/compiler/code.js b/src/core/render/compiler/code.js index b7fb060d6..a6abb0f1c 100644 --- a/src/core/render/compiler/code.js +++ b/src/core/render/compiler/code.js @@ -1,6 +1,6 @@ import Prism from 'prismjs'; // See https://github.com/PrismJS/prism/pull/1367 -import 'prismjs/components/prism-markup-templating'; +import 'prismjs/components/prism-markup-templating.js'; export const highlightCodeCompiler = ({ renderer }) => (renderer.code = function (code, lang = 'markup') { diff --git a/src/core/render/compiler/headline.js b/src/core/render/compiler/headline.js index dafc2c98f..c656f715c 100644 --- a/src/core/render/compiler/headline.js +++ b/src/core/render/compiler/headline.js @@ -2,8 +2,8 @@ import { getAndRemoveConfig, removeAtag, getAndRemoveDocisfyIgnorConfig, -} from '../utils'; -import { slugify } from './slugify'; +} from '../utils.js'; +import { slugify } from './slugify.js'; export const headingCompiler = ({ renderer, router, _self }) => (renderer.code = (text, level) => { diff --git a/src/core/render/compiler/image.js b/src/core/render/compiler/image.js index 982e5e55e..0e74645ac 100644 --- a/src/core/render/compiler/image.js +++ b/src/core/render/compiler/image.js @@ -1,5 +1,5 @@ -import { getAndRemoveConfig } from '../utils'; -import { isAbsolutePath, getPath, getParentPath } from '../../router/util'; +import { getAndRemoveConfig } from '../utils.js'; +import { isAbsolutePath, getPath, getParentPath } from '../../router/util.js'; export const imageCompiler = ({ renderer, contentBase, router }) => (renderer.image = (href, title, text) => { diff --git a/src/core/render/compiler/link.js b/src/core/render/compiler/link.js index 613101000..47684c814 100644 --- a/src/core/render/compiler/link.js +++ b/src/core/render/compiler/link.js @@ -1,5 +1,5 @@ -import { getAndRemoveConfig } from '../utils'; -import { isAbsolutePath } from '../../router/util'; +import { getAndRemoveConfig } from '../utils.js'; +import { isAbsolutePath } from '../../router/util.js'; export const linkCompiler = ({ renderer, diff --git a/src/core/render/compiler/paragraph.js b/src/core/render/compiler/paragraph.js index e166bf91e..19a2f3fef 100644 --- a/src/core/render/compiler/paragraph.js +++ b/src/core/render/compiler/paragraph.js @@ -1,4 +1,4 @@ -import { helper as helperTpl } from '../tpl'; +import { helper as helperTpl } from '../tpl.js'; export const paragraphCompiler = ({ renderer }) => (renderer.paragraph = text => { diff --git a/src/core/render/embed.js b/src/core/render/embed.js index 22d58c8f2..1e2ffdb91 100644 --- a/src/core/render/embed.js +++ b/src/core/render/embed.js @@ -1,6 +1,6 @@ import stripIndent from 'strip-indent'; -import { get } from '../fetch/ajax'; -import { merge } from '../util/core'; +import { get } from '../fetch/ajax.js'; +import { merge } from '../util/core.js'; const cached = {}; diff --git a/src/core/render/index.js b/src/core/render/index.js index 9b40939ed..56ec1c267 100644 --- a/src/core/render/index.js +++ b/src/core/render/index.js @@ -1,15 +1,15 @@ /* eslint-disable no-unused-vars */ import tinydate from 'tinydate'; -import * as dom from '../util/dom'; -import cssVars from '../util/polyfill/css-vars'; -import { getAndActive, sticky } from '../event/sidebar'; -import { getPath, isAbsolutePath } from '../router/util'; -import { isMobile, inBrowser } from '../util/env'; -import { isPrimitive, merge } from '../util/core'; -import { scrollActiveSidebar } from '../event/scroll'; -import { Compiler } from './compiler'; -import * as tpl from './tpl'; -import { prerenderEmbed } from './embed'; +import * as dom from '../util/dom.js'; +import cssVars from '../util/polyfill/css-vars.js'; +import { getAndActive, sticky } from '../event/sidebar.js'; +import { getPath, isAbsolutePath } from '../router/util.js'; +import { isMobile, inBrowser } from '../util/env.js'; +import { isPrimitive, merge } from '../util/core.js'; +import { scrollActiveSidebar } from '../event/scroll.js'; +import { Compiler } from './compiler.js'; +import * as tpl from './tpl.js'; +import { prerenderEmbed } from './embed.js'; let vueGlobalData; diff --git a/src/core/render/progressbar.js b/src/core/render/progressbar.js index c48b9619e..caa69459c 100644 --- a/src/core/render/progressbar.js +++ b/src/core/render/progressbar.js @@ -1,4 +1,4 @@ -import * as dom from '../util/dom'; +import * as dom from '../util/dom.js'; let barEl; let timeId; diff --git a/src/core/render/slugify.js b/src/core/render/slugify.js index f585d0290..a605f1765 100644 --- a/src/core/render/slugify.js +++ b/src/core/render/slugify.js @@ -1,4 +1,4 @@ -import { hasOwn } from '../util/core'; +import { hasOwn } from '../util/core.js'; let cache = {}; const re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g; diff --git a/src/core/router/history/base.js b/src/core/router/history/base.js index 68c98b7f5..d628c58ec 100644 --- a/src/core/router/history/base.js +++ b/src/core/router/history/base.js @@ -5,8 +5,8 @@ import { cleanPath, replaceSlug, resolvePath, -} from '../util'; -import { noop, merge } from '../../util/core'; +} from '../util.js'; +import { noop, merge } from '../../util/core.js'; const cached = {}; diff --git a/src/core/router/history/hash.js b/src/core/router/history/hash.js index 05435d2c9..2475c5c5a 100644 --- a/src/core/router/history/hash.js +++ b/src/core/router/history/hash.js @@ -1,8 +1,8 @@ -import { isExternal, noop } from '../../util/core'; -import { on } from '../../util/dom'; -import { endsWith } from '../../util/str'; -import { parseQuery, cleanPath, replaceSlug } from '../util'; -import { History } from './base'; +import { isExternal, noop } from '../../util/core.js'; +import { on } from '../../util/dom.js'; +import { endsWith } from '../../util/str.js'; +import { parseQuery, cleanPath, replaceSlug } from '../util.js'; +import { History } from './base.js'; function replaceHash(path) { const i = location.href.indexOf('#'); diff --git a/src/core/router/history/html5.js b/src/core/router/history/html5.js index 1304d0628..c5a89a168 100644 --- a/src/core/router/history/html5.js +++ b/src/core/router/history/html5.js @@ -1,7 +1,7 @@ -import { isExternal, noop } from '../../util/core'; -import { on } from '../../util/dom'; -import { parseQuery, getPath } from '../util'; -import { History } from './base'; +import { isExternal, noop } from '../../util/core.js'; +import { on } from '../../util/dom.js'; +import { parseQuery, getPath } from '../util.js'; +import { History } from './base.js'; export class HTML5History extends History { constructor(config) { diff --git a/src/core/router/index.js b/src/core/router/index.js index 6bbd395b8..0a409846a 100644 --- a/src/core/router/index.js +++ b/src/core/router/index.js @@ -1,8 +1,8 @@ -import { supportsPushState } from '../util/env'; -import * as dom from '../util/dom'; -import { noop } from '../util/core'; -import { HashHistory } from './history/hash'; -import { HTML5History } from './history/html5'; +import { supportsPushState } from '../util/env.js'; +import * as dom from '../util/dom.js'; +import { noop } from '../util/core.js'; +import { HashHistory } from './history/hash.js'; +import { HTML5History } from './history/html5.js'; /** * @typedef {{ diff --git a/src/core/router/util.js b/src/core/router/util.js index b4a85d89e..1a764fa31 100644 --- a/src/core/router/util.js +++ b/src/core/router/util.js @@ -1,4 +1,4 @@ -import { cached } from '../util/core'; +import { cached } from '../util/core.js'; const decode = decodeURIComponent; const encode = encodeURIComponent; diff --git a/src/core/util/dom.js b/src/core/util/dom.js index c0eb9831e..cd5db6d79 100644 --- a/src/core/util/dom.js +++ b/src/core/util/dom.js @@ -1,5 +1,5 @@ -import { isFn } from '../util/core'; -import { inBrowser } from './env'; +import { isFn } from '../util/core.js'; +import { inBrowser } from './env.js'; const cacheNode = {}; diff --git a/src/core/util/index.js b/src/core/util/index.js index 444ea9d47..841af1f71 100644 --- a/src/core/util/index.js +++ b/src/core/util/index.js @@ -1,3 +1,3 @@ -export * from './core'; -export * from './env'; -export * from '../router/util'; +export * from './core.js'; +export * from './env.js'; +export * from '../router/util.js'; diff --git a/src/core/util/polyfill/css-vars.js b/src/core/util/polyfill/css-vars.js index 6c9ef2a3f..872eeba94 100644 --- a/src/core/util/polyfill/css-vars.js +++ b/src/core/util/polyfill/css-vars.js @@ -1,5 +1,5 @@ -import * as dom from '../dom'; -import { get } from '../../fetch/ajax'; +import * as dom from '../dom.js'; +import { get } from '../../fetch/ajax.js'; function replaceVar(block, color) { block.innerHTML = block.innerHTML.replace( diff --git a/src/core/virtual-routes/exact-match.js b/src/core/virtual-routes/exact-match.js index 2304a7eb0..b825741e4 100644 --- a/src/core/virtual-routes/exact-match.js +++ b/src/core/virtual-routes/exact-match.js @@ -1,4 +1,4 @@ -import { startsWith, endsWith } from '../util/str'; +import { startsWith, endsWith } from '../util/str.js'; /** * Adds beginning of input (^) and end of input ($) assertions if needed into a regex string diff --git a/src/core/virtual-routes/index.js b/src/core/virtual-routes/index.js index bc4eaa647..9c8f5fd56 100644 --- a/src/core/virtual-routes/index.js +++ b/src/core/virtual-routes/index.js @@ -1,5 +1,5 @@ -import { makeExactMatcher } from './exact-match'; -import { createNextFunction } from './next'; +import { makeExactMatcher } from './exact-match.js'; +import { createNextFunction } from './next.js'; /** @typedef {import('../Docsify').Constructor} Constructor */ diff --git a/src/plugins/front-matter/index.js b/src/plugins/front-matter/index.js index f47340129..e98245a7a 100644 --- a/src/plugins/front-matter/index.js +++ b/src/plugins/front-matter/index.js @@ -1,4 +1,4 @@ -import parser from './parser'; +import parser from './parser.js'; const install = function (hook, vm) { // Used to remove front matter from embedded pages if installed. diff --git a/src/plugins/front-matter/parser.js b/src/plugins/front-matter/parser.js index f0ae37773..629f10412 100644 --- a/src/plugins/front-matter/parser.js +++ b/src/plugins/front-matter/parser.js @@ -2,7 +2,7 @@ * Fork https://github.com/egoist/docute/blob/master/src/utils/front-matter.js */ /* eslint-disable */ -import parser from './yaml' +import parser from './yaml.js' var optionalByteOrderMark = '\\ufeff?' var pattern = diff --git a/src/plugins/search/component.js b/src/plugins/search/component.js index 946cc015e..f184c5837 100644 --- a/src/plugins/search/component.js +++ b/src/plugins/search/component.js @@ -1,5 +1,5 @@ /* eslint-disable no-unused-vars */ -import { search } from './search'; +import { search } from './search.js'; let NO_DATA_TEXT = ''; let options; diff --git a/src/plugins/search/index.js b/src/plugins/search/index.js index c3bdab96e..1e97200b5 100644 --- a/src/plugins/search/index.js +++ b/src/plugins/search/index.js @@ -1,6 +1,9 @@ /* eslint-disable no-unused-vars */ -import { init as initComponent, update as updateComponent } from './component'; -import { init as initSearch } from './search'; +import { + init as initComponent, + update as updateComponent, +} from './component.js'; +import { init as initSearch } from './search.js'; const CONFIG = { placeholder: 'Type to search', diff --git a/src/plugins/search/search.js b/src/plugins/search/search.js index 88f9f1a4e..c3af63706 100644 --- a/src/plugins/search/search.js +++ b/src/plugins/search/search.js @@ -1,6 +1,6 @@ /* eslint-disable no-unused-vars */ -import { getAndRemoveConfig } from '../../core/render/utils'; -import { removeDocsifyIgnoreTag } from '../../core/util/str'; +import { getAndRemoveConfig } from '../../core/render/utils.js'; +import { removeDocsifyIgnoreTag } from '../../core/util/str.js'; let INDEXS = {}; diff --git a/test/config/jest.setup-tests.js b/test/config/jest.setup-tests.js index f14340ecc..3fbeaaa99 100644 --- a/test/config/jest.setup-tests.js +++ b/test/config/jest.setup-tests.js @@ -1,6 +1,8 @@ /* global afterEach, beforeAll, beforeEach */ -import mock from 'xhr-mock'; +import _mock from 'xhr-mock'; + +const mock = _mock.default; const sideEffects = { document: { diff --git a/test/config/jest.setup.js b/test/config/jest.setup.js index 42f922180..cb70e5dd9 100644 --- a/test/config/jest.setup.js +++ b/test/config/jest.setup.js @@ -1,5 +1,5 @@ -const server = require('./server.js'); +import server from './server.js'; -module.exports = async () => { +export default async () => { await server.startAsync(); }; diff --git a/test/config/jest.teardown.js b/test/config/jest.teardown.js index 647b2cea9..e08dc6ff6 100644 --- a/test/config/jest.teardown.js +++ b/test/config/jest.teardown.js @@ -1,5 +1,5 @@ -const server = require('./server.js'); +import server from './server.js'; -module.exports = async () => { +export default async () => { server.stop(); }; diff --git a/test/config/playwright.setup.js b/test/config/playwright.setup.js index 30c6c6df5..92bb776f1 100644 --- a/test/config/playwright.setup.js +++ b/test/config/playwright.setup.js @@ -1,5 +1,5 @@ -const server = require('./server.js'); +import server from './server.js'; -module.exports = async config => { +export default async config => { await server.startAsync(); }; diff --git a/test/config/playwright.teardown.js b/test/config/playwright.teardown.js index 988daa036..16292c49e 100644 --- a/test/config/playwright.teardown.js +++ b/test/config/playwright.teardown.js @@ -1,5 +1,5 @@ -const server = require('./server.js'); +import server from './server.js'; -module.exports = async config => { +export default async config => { server.stop(); }; diff --git a/test/config/server.js b/test/config/server.js index e1181dbcc..c066ebd17 100644 --- a/test/config/server.js +++ b/test/config/server.js @@ -1,5 +1,8 @@ -const browserSync = require('browser-sync').create(); -const path = require('path'); +import { create } from 'browser-sync'; +import path from 'path'; +import url from 'url'; + +const browserSync = create(); const hasStartArg = process.argv.includes('--start'); const serverConfig = { @@ -7,6 +10,11 @@ const serverConfig = { port: hasStartArg ? 3002 : 3001, }; +const __filename = url.fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +export const TEST_HOST = `http://${serverConfig.hostname}:${serverConfig.port}`; + function startServer(options = {}, cb = Function.prototype) { const defaults = { ...serverConfig, @@ -73,7 +81,7 @@ function startServer(options = {}, cb = Function.prototype) { console.log('\n'); // Set TEST_HOST environment variable - process.env.TEST_HOST = `http://${serverConfig.hostname}:${serverConfig.port}`; + process.env.TEST_HOST = TEST_HOST; // Start server browserSync.init( @@ -111,13 +119,20 @@ if (hasStartArg) { }); } // Display friendly message about manually starting a server instance -else if (require.main === module) { +else if (isMain(import.meta)) { console.info('Use --start argument to manually start server instance'); } -module.exports = { +// Replacement for CommonJS `require.main === module`. https://2ality.com/2022/07/nodejs-esm-main.html +function isMain(meta) { + if (meta.url.startsWith('file:')) { + if (process.argv[1] === __filename) return true; + } + return false; +} + +export default { start: startServer, startAsync: startServerAsync, stop: stopServer, - TEST_HOST: `http://${serverConfig.hostname}:${serverConfig.port}`, }; diff --git a/test/e2e/.eslintrc.js b/test/e2e/.eslintrc.cjs similarity index 100% rename from test/e2e/.eslintrc.js rename to test/e2e/.eslintrc.cjs diff --git a/test/e2e/configuration.test.js b/test/e2e/configuration.test.js index 8aa3c5f08..f54c0dede 100644 --- a/test/e2e/configuration.test.js +++ b/test/e2e/configuration.test.js @@ -1,5 +1,5 @@ -const docsifyInit = require('../helpers/docsify-init'); -const { test, expect } = require('./fixtures/docsify-init-fixture'); +import docsifyInit from '../helpers/docsify-init.js'; +import { test, expect } from './fixtures/docsify-init-fixture.js'; test.describe('Configuration options', () => { test('catchPluginErrors:true (handles uncaught errors)', async ({ page }) => { diff --git a/test/e2e/example.test.js b/test/e2e/example.test.js index 17ff99a22..d75071573 100644 --- a/test/e2e/example.test.js +++ b/test/e2e/example.test.js @@ -1,81 +1,7 @@ -// Modules, constants, and variables -// ----------------------------------------------------------------------------- -const docsifyInit = require('../helpers/docsify-init'); -const { test, expect } = require('./fixtures/docsify-init-fixture'); - -// Suite -// ----------------------------------------------------------------------------- -test.describe('Example Tests', () => { - // Tests - // --------------------------------------------------------------------------- - test('dom manipulation', async ({ page }) => { - const testText = 'This is a test'; - const testHTML = `

Test

${testText}

`; - - // Inject HTML - await page.setContent(testHTML); - - // Get reference to page element - const bodyElm = page.locator('body'); - const pElm = page.locator('body > p'); - - // Add class to element and test - await bodyElm.evaluate(elm => elm.classList.add('foo')); - - // Tests - await expect(bodyElm).toHaveClass('foo'); - await expect(bodyElm).toContainText('Test'); - await expect(pElm).toHaveCount(1); - await expect(pElm).toHaveText(testText); - await expect(pElm).not.toHaveText('NOPE'); - }); - - test('javascript in browser context', async ({ page }) => { - // Get native DOM values - const clientDimensions = await page.evaluate(() => { - return { - width: document.documentElement.clientWidth, - height: document.documentElement.clientHeight, - }; - }); - - expect(clientDimensions).toHaveProperty('width'); - expect(typeof clientDimensions.width).toBe('number'); - expect(clientDimensions).toHaveProperty('height'); - expect(typeof clientDimensions.height).toBe('number'); - - // Get result of script executed in browser context - const scriptResult = await page.evaluate( - numbers => { - const result = numbers.reduce( - (accumulator, currentValue) => accumulator + currentValue - ); - - return Promise.resolve(result); - }, - [1, 2, 3] - ); - - expect(scriptResult).toBe(6); - - // Get result of local function executed in browser context - function add(...addends) { - return addends.reduce( - (accumulator, currentValue) => accumulator + currentValue - ); - } - - const functionResult = await page.evaluate(` - const add = ${add.toString()}; - - const result = add(1, 2, 3); - - Promise.resolve(result); - `); - - expect(functionResult).toBe(6); - }); +import docsifyInit from '../helpers/docsify-init.js'; +import { test, expect } from './fixtures/docsify-init-fixture.js'; +test.describe('Creating a Docsify site (e2e tests in Playwright)', () => { test('manual docsify site using playwright methods', async ({ page }) => { // Add docsify target element await page.setContent('
'); diff --git a/test/e2e/fixtures/docsify-init-fixture.js b/test/e2e/fixtures/docsify-init-fixture.js index e0d273ed7..1c4260b20 100644 --- a/test/e2e/fixtures/docsify-init-fixture.js +++ b/test/e2e/fixtures/docsify-init-fixture.js @@ -1,6 +1,6 @@ -const base = require('@playwright/test'); +import { test as _test, expect as _expect } from '@playwright/test'; -exports.test = base.test.extend({ +export const test = _test.extend({ page: async ({ page }, use) => { global.page = page; @@ -13,4 +13,5 @@ exports.test = base.test.extend({ await use(page); }, }); -exports.expect = base.expect; + +export const expect = _expect; diff --git a/test/e2e/gtag.test.js b/test/e2e/gtag.test.js index c3ebbcd18..1c6237089 100644 --- a/test/e2e/gtag.test.js +++ b/test/e2e/gtag.test.js @@ -1,8 +1,5 @@ -// Modules, constants, and variables -// npm run test:e2e gtag.test.js -// ----------------------------------------------------------------------------- -const docsifyInit = require('../helpers/docsify-init'); -const { test, expect } = require('./fixtures/docsify-init-fixture'); +import docsifyInit from '../helpers/docsify-init.js'; +import { test, expect } from './fixtures/docsify-init-fixture.js'; const gtagList = [ 'AW-YYYYYY', // Google Ads @@ -11,8 +8,6 @@ const gtagList = [ 'UA-XXXXXX', // Google Universal Analytics (GA3) ]; -// Suite -// ----------------------------------------------------------------------------- test.describe('Gtag Plugin Tests', () => { // page request listened, print collect url function pageRequestListened(page) { @@ -35,8 +30,6 @@ test.describe('Gtag Plugin Tests', () => { }); } - // Tests - // --------------------------------------------------------------------------- test('single gtag', async ({ page }) => { pageRequestListened(page); diff --git a/test/e2e/index-file.test.js b/test/e2e/index-file.test.js index ec8fe7000..8dfa39ca9 100644 --- a/test/e2e/index-file.test.js +++ b/test/e2e/index-file.test.js @@ -1,5 +1,5 @@ -const docsifyInit = require('../helpers/docsify-init'); -const { test, expect } = require('./fixtures/docsify-init-fixture'); +import docsifyInit from '../helpers/docsify-init.js'; +import { test, expect } from './fixtures/docsify-init-fixture.js'; test.describe('Index file hosting', () => { const sharedOptions = { diff --git a/test/e2e/plugins.test.js b/test/e2e/plugins.test.js index 2f3ff4b7e..8944462bc 100644 --- a/test/e2e/plugins.test.js +++ b/test/e2e/plugins.test.js @@ -1,5 +1,5 @@ -const docsifyInit = require('../helpers/docsify-init'); -const { test, expect } = require('./fixtures/docsify-init-fixture'); +import docsifyInit from '../helpers/docsify-init.js'; +import { test, expect } from './fixtures/docsify-init-fixture.js'; test.describe('Plugins', () => { test('Hook order', async ({ page }) => { diff --git a/test/e2e/search.test.js b/test/e2e/search.test.js index ed79f05f9..607f17f37 100644 --- a/test/e2e/search.test.js +++ b/test/e2e/search.test.js @@ -1,5 +1,5 @@ -const docsifyInit = require('../helpers/docsify-init'); -const { test, expect } = require('./fixtures/docsify-init-fixture'); +import docsifyInit from '../helpers/docsify-init.js'; +import { test, expect } from './fixtures/docsify-init-fixture.js'; test.describe('Search Plugin Tests', () => { test('search readme', async ({ page }) => { diff --git a/test/e2e/security.test.js b/test/e2e/security.test.js index 7d0c98830..c01d8716b 100644 --- a/test/e2e/security.test.js +++ b/test/e2e/security.test.js @@ -1,5 +1,5 @@ -const docsifyInit = require('../helpers/docsify-init'); -const { test, expect } = require('./fixtures/docsify-init-fixture'); +import docsifyInit from '../helpers/docsify-init.js'; +import { test, expect } from './fixtures/docsify-init-fixture.js'; test.describe('Security - Cross Site Scripting (XSS)', () => { const sharedOptions = { diff --git a/test/e2e/sidebar.test.js b/test/e2e/sidebar.test.js index e29fba075..077826f54 100644 --- a/test/e2e/sidebar.test.js +++ b/test/e2e/sidebar.test.js @@ -1,5 +1,5 @@ -const docsifyInit = require('../helpers/docsify-init'); -const { test, expect } = require('./fixtures/docsify-init-fixture'); +import docsifyInit from '../helpers/docsify-init.js'; +import { test, expect } from './fixtures/docsify-init-fixture.js'; // Suite // ----------------------------------------------------------------------------- diff --git a/test/e2e/virtual-routes.test.js b/test/e2e/virtual-routes.test.js index 21636d159..ba31adcb0 100644 --- a/test/e2e/virtual-routes.test.js +++ b/test/e2e/virtual-routes.test.js @@ -1,5 +1,5 @@ -const docsifyInit = require('../helpers/docsify-init'); -const { test, expect } = require('./fixtures/docsify-init-fixture'); +import docsifyInit from '../helpers/docsify-init.js'; +import { test, expect } from './fixtures/docsify-init-fixture.js'; /** * Navigate to a specific route in the site @@ -8,6 +8,8 @@ const { test, expect } = require('./fixtures/docsify-init-fixture'); */ async function navigateToRoute(page, route) { await page.evaluate(r => (window.location.hash = r), route); + // TODO: playwright eslint now recommends not using networkidle + // eslint-disable-next-line await page.waitForLoadState('networkidle'); } diff --git a/test/e2e/vue.test.js b/test/e2e/vue.test.js index 299b85a8d..fde2dcd8c 100644 --- a/test/e2e/vue.test.js +++ b/test/e2e/vue.test.js @@ -1,6 +1,6 @@ -const stripIndent = require('common-tags/lib/stripIndent'); -const docsifyInit = require('../helpers/docsify-init'); -const { test, expect } = require('./fixtures/docsify-init-fixture'); +import stripIndent from 'common-tags/lib/stripIndent/index.js'; +import docsifyInit from '../helpers/docsify-init.js'; +import { test, expect } from './fixtures/docsify-init-fixture.js'; const vueURLs = [ '/node_modules/vue2/dist/vue.js', @@ -179,6 +179,7 @@ test.describe('Vue.js Compatibility', () => { await expect(page.locator('#vuefor')).toHaveText('12345'); await expect(page.locator('#vuecomponent')).toHaveText('0'); await expect(page.locator('#vuecomponent')).toHaveText('0'); + // eslint-disable-next-line playwright/prefer-web-first-assertions expect(await page.locator('#vueglobaloptions p').innerText()).toBe(''); await expect(page.locator('#vuemounts p')).toHaveText('vuemounts'); await expect(page.locator('#vuescript p')).toHaveText('vuescript'); diff --git a/test/helpers/docsify-init.js b/test/helpers/docsify-init.js index 95d928f2b..a64585691 100644 --- a/test/helpers/docsify-init.js +++ b/test/helpers/docsify-init.js @@ -1,12 +1,13 @@ /* globals page */ +import _mock, { proxy } from 'xhr-mock'; -const axios = require('axios'); -const mock = require('xhr-mock').default; -const prettier = require('prettier'); -const stripIndent = require('common-tags/lib/stripIndent'); -const { proxy } = require('xhr-mock'); -const { waitForSelector } = require('./wait-for'); +import axios from 'axios'; +import prettier from 'prettier'; +import stripIndent from 'common-tags/lib/stripIndent/index.js'; +// import { TEST_HOST } from '../config/server.js'; +import { waitForSelector } from './wait-for.js'; +const mock = _mock.default; const docsifyPATH = '../../lib/docsify.js'; // JSDOM const docsifyURL = '/lib/docsify.js'; // Playwright @@ -262,7 +263,7 @@ async function docsifyInit(options = {}) { const isDocsifyLoaded = 'Docsify' in window; if (!isDocsifyLoaded) { - require(docsifyPATH); + await import(docsifyPATH); } } else if (isPlaywright) { for (const url of settings.scriptURLs) { @@ -358,4 +359,4 @@ async function docsifyInit(options = {}) { return Promise.resolve(); } -module.exports = docsifyInit; +export default docsifyInit; diff --git a/test/helpers/wait-for.js b/test/helpers/wait-for.js index 64fb20f35..b9328fc6c 100644 --- a/test/helpers/wait-for.js +++ b/test/helpers/wait-for.js @@ -125,8 +125,4 @@ function waitForText(cssSelector, text, options = {}) { }); } -module.exports = { - waitForFunction, - waitForSelector, - waitForText, -}; +export { waitForFunction, waitForSelector, waitForText }; diff --git a/test/integration/.eslintrc.cjs b/test/integration/.eslintrc.cjs new file mode 100644 index 000000000..2768b9e62 --- /dev/null +++ b/test/integration/.eslintrc.cjs @@ -0,0 +1 @@ +module.exports = require('../unit/.eslintrc.cjs'); diff --git a/test/integration/.eslintrc.js b/test/integration/.eslintrc.js deleted file mode 100644 index e94f775f5..000000000 --- a/test/integration/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../unit/.eslintrc'); diff --git a/test/integration/docs.test.js b/test/integration/docs.test.js index c3921c3e2..0940ff195 100644 --- a/test/integration/docs.test.js +++ b/test/integration/docs.test.js @@ -1,4 +1,5 @@ -const docsifyInit = require('../helpers/docsify-init'); +import { jest } from '@jest/globals'; +import docsifyInit from '../helpers/docsify-init.js'; // Suite // ----------------------------------------------------------------------------- diff --git a/test/integration/docsify.test.js b/test/integration/docsify.test.js index b766aae7d..06d32d2ba 100644 --- a/test/integration/docsify.test.js +++ b/test/integration/docsify.test.js @@ -1,4 +1,5 @@ -const docsifyInit = require('../helpers/docsify-init'); +import { jest } from '@jest/globals'; +import docsifyInit from '../helpers/docsify-init.js'; // Suite // ----------------------------------------------------------------------------- diff --git a/test/integration/emoji.test.js b/test/integration/emoji.test.js index dfd8516ac..b448347ca 100644 --- a/test/integration/emoji.test.js +++ b/test/integration/emoji.test.js @@ -1,4 +1,4 @@ -const docsifyInit = require('../helpers/docsify-init'); +import docsifyInit from '../helpers/docsify-init.js'; // Suite // ----------------------------------------------------------------------------- diff --git a/test/integration/example.test.js b/test/integration/example.test.js index 7365a1459..912036f32 100644 --- a/test/integration/example.test.js +++ b/test/integration/example.test.js @@ -1,12 +1,7 @@ -const { waitForFunction, waitForText } = require('../helpers/wait-for'); +import { waitForFunction, waitForText } from '../helpers/wait-for.js'; +import docsifyInit from '../helpers/docsify-init.js'; -const docsifyInit = require('../helpers/docsify-init'); - -// Suite -// ----------------------------------------------------------------------------- -describe('Example Tests', function () { - // Tests - // --------------------------------------------------------------------------- +describe('Creating a Docsify site (integration tests in Jest)', function () { test('Docsify /docs/ site using docsifyInit()', async () => { await docsifyInit({ config: { diff --git a/test/integration/render.test.js b/test/integration/render.test.js index f1335a064..d2b12527e 100644 --- a/test/integration/render.test.js +++ b/test/integration/render.test.js @@ -1,5 +1,5 @@ -const stripIndent = require('common-tags/lib/stripIndent'); -const docsifyInit = require('../helpers/docsify-init'); +import stripIndent from 'common-tags/lib/stripIndent/index.js'; +import docsifyInit from '../helpers/docsify-init.js'; // Suite // ----------------------------------------------------------------------------- diff --git a/test/unit/.eslintrc.js b/test/unit/.eslintrc.cjs similarity index 100% rename from test/unit/.eslintrc.js rename to test/unit/.eslintrc.cjs diff --git a/test/unit/__snapshots__/example.test.js.snap b/test/unit/__snapshots__/example.test.js.snap deleted file mode 100644 index 18eab05ec..000000000 --- a/test/unit/__snapshots__/example.test.js.snap +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Example Tests Jest & JSDOM basics snapshot (jsdom) 1`] = `"

Test

This is a test

"`; diff --git a/test/unit/core-util.test.js b/test/unit/core-util.test.js index a6ff7d3ef..a71d84208 100644 --- a/test/unit/core-util.test.js +++ b/test/unit/core-util.test.js @@ -1,4 +1,4 @@ -const { isExternal } = require('../../src/core/util'); +import { isExternal } from '../../src/core/util/index.js'; // Core util // ----------------------------------------------------------------------------- diff --git a/test/unit/example.test.js b/test/unit/example.test.js deleted file mode 100644 index 584c55fb7..000000000 --- a/test/unit/example.test.js +++ /dev/null @@ -1,134 +0,0 @@ -// -import { greet } from './fixtures/greet.js'; -import { getTimeOfDay } from './fixtures/get-time-of-day.js'; -import * as getTimeOfDayModule from './fixtures/get-time-of-day.js'; - -// const greet = require('./fixtures/greet'); -// const getTimeOfDay = require('./fixtures/get-time-of-day'); -// const getTimeOfDayModule = { getTimeOfDay: getTimeOfDay }; - -// Suite -// ----------------------------------------------------------------------------- -describe(`Example Tests`, function () { - // Tests - // --------------------------------------------------------------------------- - describe('Jest & JSDOM basics', function () { - test('dom manipulation (jsdom)', () => { - const testText = 'This is a test'; - const testHTML = `

Test

${testText}

`; - - // Inject HTML - document.body.innerHTML = testHTML; - - // Add class to element and verify - document.body.classList.add('foo'); - - // Test HTML - expect(document.body.getAttribute('class')).toBe('foo'); - expect(document.body.textContent).toMatch(/Test/); - expect(document.querySelectorAll('p')).toHaveLength(1); - expect(document.querySelector('p').textContent).toBe(testText); - expect(document.querySelector('table')).toBeNull(); - }); - - // Snapshot Testing - // https://jestjs.io/docs/en/snapshot-testing - test('snapshot (jsdom)', () => { - const testText = 'This is a test'; - const testHTML = `

Test

${testText}

`; - - // Inject HTML - document.body.innerHTML = testHTML; - - // Add class to element and verify - document.body.classList.add('foo'); - - const documentHTML = document.documentElement.outerHTML; - - // Test snapshots - expect(documentHTML).toMatchSnapshot(); // See __snapshots__ - expect(documentHTML).toMatchInlineSnapshot( - `"

Test

This is a test

"` - ); - }); - }); - - describe('Fake Timers', function () { - // jest version issue - // test('data & time', () => { - // jest.useFakeTimers(); - // jest.setSystemTime(fakeDate); - // const timeOfDay = getTimeOfDay(); - // expect(timeOfDay).toContain; - // }); - }); - - describe('Mocks & Spies', function () { - test('mock import/require dependency using jest.fn()', () => { - const testModule = require('./fixtures/get-time-of-day.js'); - const { greet: testGreet } = require('./fixtures/greet.js'); - - testModule.getTimeOfDay = jest.fn(() => 'day'); - - const timeOfDay = testModule.getTimeOfDay(); - const greeting = testGreet('John'); - - expect(timeOfDay).toBe('day'); - expect(greeting).toBe(`Good day, John!`); - }); - - test('mock import/require dependency using jest.doMock()', () => { - const mockModulePath = './fixtures/get-time-of-day.js'; - - jest.doMock(mockModulePath, () => ({ - __esModule: true, - getTimeOfDay: jest.fn(() => 'night'), - })); - - const mockGetTimeOfDay = require(mockModulePath).getTimeOfDay; - const { greet: testGreet } = require('./fixtures/greet.js'); - - const timeOfDay = mockGetTimeOfDay(); - const greeting = testGreet('John'); - - expect(timeOfDay).toBe('night'); - expect(greeting).toBe(`Good night, John!`); - }); - - test('spy on native method using jest.spyOn()', () => { - // Replace Math.random() implementation to return fixed value - jest.spyOn(Math, 'random').mockImplementation(() => 0.1); - - expect(Math.random()).toBe(0.1); - expect(Math.random()).toBe(0.1); - expect(Math.random()).toBe(0.1); - }); - - test('spy on import/require dependency using jest.spyOn()', () => { - jest - .spyOn(getTimeOfDayModule, 'getTimeOfDay') - .mockImplementation(() => 'night'); - - const timeOfDay = getTimeOfDay(); - const greeting = greet('John'); - - expect(timeOfDay).toBe('night'); - expect(greeting).toBe(`Good night, John!`); - }); - }); - - describe('Verify Special Changes Test Case', function () { - test('document.querySelector with id=pure number', () => { - const testText = 'This is a test'; - const testHTML = `

${testText}

`; - - // Inject HTML - document.body.innerHTML = testHTML; - expect(() => { - document.querySelector('#24'); - }).toThrow(DOMException); - - expect(document.querySelector("[id='24']").textContent).toBe(testText); - }); - }); -}); diff --git a/test/unit/fixtures/get-time-of-day.js b/test/unit/fixtures/get-time-of-day.js deleted file mode 100644 index 2381e8836..000000000 --- a/test/unit/fixtures/get-time-of-day.js +++ /dev/null @@ -1,6 +0,0 @@ -export function getTimeOfDay(hours = new Date().getHours()) { - const timeOfDay = - hours < 12 ? 'morning' : hours < 17 ? 'afternoon' : 'evening'; - - return timeOfDay; -} diff --git a/test/unit/fixtures/greet.js b/test/unit/fixtures/greet.js deleted file mode 100644 index 61c58edda..000000000 --- a/test/unit/fixtures/greet.js +++ /dev/null @@ -1,7 +0,0 @@ -import { getTimeOfDay } from './get-time-of-day'; - -export function greet(name = 'friend') { - const timeOfDay = getTimeOfDay(); - - return `Good ${timeOfDay}, ${name}!`; -} diff --git a/test/unit/render-util.test.js b/test/unit/render-util.test.js index ff3377932..d416079ce 100644 --- a/test/unit/render-util.test.js +++ b/test/unit/render-util.test.js @@ -1,12 +1,10 @@ -const { +import { removeAtag, getAndRemoveConfig, getAndRemoveDocisfyIgnorConfig, -} = require('../../src/core/render/utils'); - -const { tree } = require(`../../src/core/render/tpl`); - -const { slugify } = require(`../../src/core/render/slugify`); +} from '../../src/core/render/utils.js'; +import { tree } from '../../src/core/render/tpl.js'; +import { slugify } from '../../src/core/render/slugify.js'; // Suite // ----------------------------------------------------------------------------- diff --git a/test/unit/router-history-base.test.js b/test/unit/router-history-base.test.js index e296fb8b3..a486ed2db 100644 --- a/test/unit/router-history-base.test.js +++ b/test/unit/router-history-base.test.js @@ -1,4 +1,4 @@ -const { History } = require('../../src/core/router/history/base'); +import { History } from '../../src/core/router/history/base.js'; class MockHistory extends History { parse(path) { diff --git a/test/unit/router-util.test.js b/test/unit/router-util.test.js index 769d871ab..82973fa3a 100644 --- a/test/unit/router-util.test.js +++ b/test/unit/router-util.test.js @@ -1,4 +1,4 @@ -const { resolvePath } = require('../../src/core/util'); +import { resolvePath } from '../../src/core/util/index.js'; // Suite // -----------------------------------------------------------------------------