chore(v2): migrate hapi/joi to joi (#3638)

This commit is contained in:
Alexey Pyltsyn 2020-10-26 17:18:51 +03:00 committed by GitHub
parent a64a34f077
commit 69bf68ae57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 58 additions and 79 deletions

View file

@ -21,8 +21,7 @@
"@docusaurus/types": "2.0.0-alpha.66",
"@docusaurus/utils": "2.0.0-alpha.66",
"@docusaurus/utils-validation": "2.0.0-alpha.66",
"@hapi/joi": "^17.1.1",
"@types/hapi__joi": "^17.1.2",
"joi": "^17.2.1",
"chalk": "^3.0.0",
"eta": "^1.1.1",
"fs-extra": "^8.1.0",

View file

@ -6,7 +6,7 @@
*/
import {PluginOptions, RedirectOption, UserPluginOptions} from './types';
import * as Joi from '@hapi/joi';
import * as Joi from 'joi';
import {PathnameSchema} from '@docusaurus/utils-validation';
import {DEFAULT_PLUGIN_ID} from '@docusaurus/core/lib/constants';

View file

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import * as Joi from '@hapi/joi';
import * as Joi from 'joi';
import {RedirectMetadata} from './types';
import {PathnameSchema} from '@docusaurus/utils-validation';

View file

@ -17,16 +17,13 @@
"access": "public"
},
"license": "MIT",
"devDependencies": {
"@types/hapi__joi": "^17.1.2"
},
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.66",
"@docusaurus/mdx-loader": "2.0.0-alpha.66",
"@docusaurus/types": "2.0.0-alpha.66",
"@docusaurus/utils": "2.0.0-alpha.66",
"@docusaurus/utils-validation": "2.0.0-alpha.66",
"@hapi/joi": "^17.1.1",
"joi": "^17.2.1",
"chalk": "^3.0.0",
"feed": "^4.1.0",
"fs-extra": "^8.1.0",

View file

@ -2,4 +2,4 @@
exports[`should throw Error in case of invalid feedtype 1`] = `[ValidationError: "feedOptions.type" does not match any of the allowed types]`;
exports[`should throw Error in case of invalid options 1`] = `[ValidationError: "postsPerPage" must be larger than or equal to 1]`;
exports[`should throw Error in case of invalid options 1`] = `[ValidationError: "postsPerPage" must be greater than or equal to 1]`;

View file

@ -13,7 +13,7 @@ import {
STATIC_DIR_NAME,
DEFAULT_PLUGIN_ID,
} from '@docusaurus/core/lib/constants';
import {ValidationError} from '@hapi/joi';
import {ValidationError} from 'joi';
import {take, kebabCase} from 'lodash';
import {

View file

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import * as Joi from '@hapi/joi';
import * as Joi from 'joi';
import {
RemarkPluginsSchema,
RehypePluginsSchema,

View file

@ -19,7 +19,6 @@
"license": "MIT",
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-alpha.66",
"@types/hapi__joi": "^17.1.2",
"@types/picomatch": "^2.2.1",
"commander": "^5.0.0",
"picomatch": "^2.1.1"
@ -30,7 +29,7 @@
"@docusaurus/types": "2.0.0-alpha.66",
"@docusaurus/utils": "2.0.0-alpha.66",
"@docusaurus/utils-validation": "2.0.0-alpha.66",
"@hapi/joi": "17.1.1",
"joi": "^17.2.1",
"chalk": "^3.0.0",
"execa": "^3.4.0",
"fs-extra": "^8.1.0",

View file

@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import * as Joi from '@hapi/joi';
import * as Joi from 'joi';
import {PluginOptions} from './types';
import {
RemarkPluginsSchema,
@ -13,7 +13,7 @@ import {
URISchema,
} from '@docusaurus/utils-validation';
import {OptionValidationContext, ValidationResult} from '@docusaurus/types';
import {ValidationError} from '@hapi/joi';
import {ValidationError} from 'joi';
import chalk from 'chalk';
import admonitions from 'remark-admonitions';

View file

@ -17,16 +17,13 @@
"directory": "packages/docusaurus-plugin-content-pages"
},
"license": "MIT",
"devDependencies": {
"@types/hapi__joi": "^17.1.2"
},
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.66",
"@docusaurus/mdx-loader": "2.0.0-alpha.66",
"@docusaurus/types": "2.0.0-alpha.66",
"@docusaurus/utils": "2.0.0-alpha.66",
"@docusaurus/utils-validation": "2.0.0-alpha.66",
"@hapi/joi": "17.1.1",
"joi": "^17.2.1",
"globby": "^10.0.1",
"loader-utils": "^1.2.3",
"minimatch": "^3.0.4",

View file

@ -26,7 +26,7 @@ import {
import {Configuration, Loader} from 'webpack';
import admonitions from 'remark-admonitions';
import {PluginOptionSchema} from './pluginOptionSchema';
import {ValidationError} from '@hapi/joi';
import {ValidationError} from 'joi';
import {
DEFAULT_PLUGIN_ID,
STATIC_DIR_NAME,

View file

@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import * as Joi from '@hapi/joi';
import * as Joi from 'joi';
import {PluginOptions} from './types';
import {
RemarkPluginsSchema,

View file

@ -17,7 +17,7 @@
"@babel/plugin-proposal-optional-chaining": "^7.10.3",
"@babel/preset-env": "^7.9.0",
"@docusaurus/core": "2.0.0-alpha.66",
"@hapi/joi": "^17.1.1",
"joi": "^17.2.1",
"babel-loader": "^8.1.0",
"clsx": "^1.1.1",
"core-js": "^2.6.5",

View file

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
const Joi = require('@hapi/joi');
const Joi = require('joi');
const path = require('path');
const DEFAULT_OPTIONS = {

View file

@ -16,13 +16,10 @@
"directory": "packages/docusaurus-plugin-sitemap"
},
"license": "MIT",
"devDependencies": {
"@types/hapi__joi": "^17.1.2"
},
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.66",
"@docusaurus/types": "2.0.0-alpha.66",
"@hapi/joi": "17.1.1",
"joi": "^17.2.1",
"fs-extra": "^8.1.0",
"sitemap": "^3.2.2"
},

View file

@ -17,7 +17,7 @@ import {
Plugin,
} from '@docusaurus/types';
import {PluginOptionSchema} from './pluginOptionSchema';
import {ValidationError} from '@hapi/joi';
import {ValidationError} from 'joi';
export default function pluginSitemap(
_context: LoadContext,

View file

@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import * as Joi from '@hapi/joi';
import * as Joi from 'joi';
import {PluginOptions} from './types';
export const DEFAULT_OPTIONS: Required<PluginOptions> = {

View file

@ -26,7 +26,7 @@
"@docusaurus/plugin-content-pages": "2.0.0-alpha.66",
"@docusaurus/types": "2.0.0-alpha.66",
"@docusaurus/utils-validation": "2.0.0-alpha.66",
"@hapi/joi": "^17.1.1",
"joi": "^17.2.1",
"@mdx-js/mdx": "^1.5.8",
"@mdx-js/react": "^1.5.8",
"@types/react-toggle": "^4.0.2",
@ -42,8 +42,7 @@
"react-toggle": "^4.1.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-alpha.66",
"@types/hapi__joi": "^17.1.2"
"@docusaurus/module-type-aliases": "2.0.0-alpha.66"
},
"peerDependencies": {
"react": "^16.8.4",

View file

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
const Joi = require('@hapi/joi');
const Joi = require('joi');
const {URISchema} = require('@docusaurus/utils-validation');
const DEFAULT_DOCS_CONFIG = {

View file

@ -16,7 +16,7 @@
"@docsearch/react": "^1.0.0-alpha.27",
"@docusaurus/core": "2.0.0-alpha.66",
"@docusaurus/utils": "2.0.0-alpha.66",
"@hapi/joi": "^17.1.1",
"joi": "^17.2.1",
"algoliasearch": "^4.0.0",
"algoliasearch-helper": "^3.1.1",
"clsx": "^1.1.1",

View file

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
const Joi = require('@hapi/joi');
const Joi = require('joi');
const DEFAULT_CONFIG = {
contextualSearch: false, // future: maybe we want to enable this by default

View file

@ -17,12 +17,9 @@
"directory": "packages/docusaurus-utils-validation"
},
"license": "MIT",
"devDependencies": {
"@types/hapi__joi": "^17.1.2"
},
"dependencies": {
"@docusaurus/utils": "2.0.0-alpha.66",
"@hapi/joi": "17.1.1",
"joi": "^17.2.1",
"chalk": "^3.0.0"
},
"engines": {

View file

@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import * as Joi from '@hapi/joi';
import * as Joi from 'joi';
import {
AdmonitionsSchema,

View file

@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import * as Joi from '@hapi/joi';
import * as Joi from 'joi';
import {isValidPathname} from '@docusaurus/utils';
export const PluginIdSchema = Joi.string()

View file

@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import * as Joi from '@hapi/joi';
import * as Joi from 'joi';
import chalk from 'chalk';
import {PluginIdSchema} from './validationSchemas';

View file

@ -32,8 +32,7 @@
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-alpha.66",
"@types/detect-port": "^1.3.0",
"@types/hapi__joi": "^17.1.2"
"@types/detect-port": "^1.3.0"
},
"dependencies": {
"@babel/core": "^7.9.0",
@ -50,7 +49,7 @@
"@docusaurus/utils": "2.0.0-alpha.66",
"@docusaurus/utils-validation": "2.0.0-alpha.66",
"@endiliey/static-site-generator-webpack-plugin": "^4.0.0",
"@hapi/joi": "^17.1.1",
"joi": "^17.2.1",
"@svgr/webpack": "^5.4.0",
"babel-loader": "^8.1.0",
"babel-plugin-dynamic-import-node": "^2.3.0",

View file

@ -7,7 +7,7 @@
import {DocusaurusConfig} from '@docusaurus/types';
import {CONFIG_FILE_NAME} from '../constants';
import Joi from '@hapi/joi';
import Joi from 'joi';
import {
logValidationBugReportHint,
isValidationDisabledEscapeHatch,

View file

@ -1898,23 +1898,11 @@
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5"
integrity sha512-QD1PhQk+s31P1ixsX0H0Suoupp3VMXzIVMSwobR3F3MSUO2YCV0B7xqLcUw/Bh8yuvd3LhpyqLQWTNcRmp6IdQ==
"@hapi/address@^4.0.1":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-4.0.1.tgz#267301ddf7bc453718377a6fb3832a2f04a721dd"
integrity sha512-0oEP5UiyV4f3d6cBL8F3Z5S7iWSX39Knnl0lY8i+6gfmmIBj44JCBNtcMgwyS+5v7j3VYavNay0NFHDS+UGQcw==
dependencies:
"@hapi/hoek" "^9.0.0"
"@hapi/bourne@1.x.x":
version "1.3.2"
resolved "https://registry.yarnpkg.com/@hapi/bourne/-/bourne-1.3.2.tgz#0a7095adea067243ce3283e1b56b8a8f453b242a"
integrity sha512-1dVNHT76Uu5N3eJNTYcvxee+jzX4Z9lfciqRRHCU27ihbUcYi+iSc2iml5Ke1LXe1SyJCLA0+14Jh4tXJgOppA==
"@hapi/formula@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@hapi/formula/-/formula-2.0.0.tgz#edade0619ed58c8e4f164f233cda70211e787128"
integrity sha512-V87P8fv7PI0LH7LiVi8Lkf3x+KCO7pQozXRssAHNXXL9L1K+uyu4XypLXwxqVDKgyQai6qj3/KteNlrqDx4W5A==
"@hapi/hoek@8.x.x", "@hapi/hoek@^8.3.0":
version "8.5.0"
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.5.0.tgz#2f9ce301c8898e1c3248b0a8564696b24d1a9a5a"
@ -1925,17 +1913,6 @@
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.0.4.tgz#e80ad4e8e8d2adc6c77d985f698447e8628b6010"
integrity sha512-EwaJS7RjoXUZ2cXXKZZxZqieGtc7RbvQhUy8FwDoMQtxWVi14tFjeFCYPZAM1mBCpOpiBpyaZbb9NeHc7eGKgw==
"@hapi/joi@17.1.1", "@hapi/joi@^17.1.1":
version "17.1.1"
resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-17.1.1.tgz#9cc8d7e2c2213d1e46708c6260184b447c661350"
integrity sha512-p4DKeZAoeZW4g3u7ZeRo+vCDuSDgSvtsB/NpfjXEHTUjSeINAi/RrVOWiVQ1isaoLzMvFEhe8n5065mQq1AdQg==
dependencies:
"@hapi/address" "^4.0.1"
"@hapi/formula" "^2.0.0"
"@hapi/hoek" "^9.0.0"
"@hapi/pinpoint" "^2.0.0"
"@hapi/topo" "^5.0.0"
"@hapi/joi@^15.1.0":
version "15.1.1"
resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-15.1.1.tgz#c675b8a71296f02833f8d6d243b34c57b8ce19d7"
@ -1946,11 +1923,6 @@
"@hapi/hoek" "8.x.x"
"@hapi/topo" "3.x.x"
"@hapi/pinpoint@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@hapi/pinpoint/-/pinpoint-2.0.0.tgz#805b40d4dbec04fc116a73089494e00f073de8df"
integrity sha512-vzXR5MY7n4XeIvLpfl3HtE3coZYO4raKXW766R6DZw/6aLqR26iuZ109K7a0NtF2Db0jxqh7xz2AxkUwpUFybw==
"@hapi/topo@3.x.x":
version "3.1.6"
resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-3.1.6.tgz#68d935fa3eae7fdd5ab0d7f953f3205d8b2bfc29"
@ -3506,6 +3478,23 @@
dependencies:
any-observable "^0.3.0"
"@sideway/address@^4.1.0":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.0.tgz#0b301ada10ac4e0e3fa525c90615e0b61a72b78d"
integrity sha512-wAH/JYRXeIFQRsxerIuLjgUu2Xszam+O5xKeatJ4oudShOOirfmsQ1D6LL54XOU2tizpCYku+s1wmU0SYdpoSA==
dependencies:
"@hapi/hoek" "^9.0.0"
"@sideway/formula@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.0.tgz#fe158aee32e6bd5de85044be615bc08478a0a13c"
integrity sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==
"@sideway/pinpoint@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df"
integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==
"@sindresorhus/is@^0.14.0":
version "0.14.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
@ -3828,11 +3817,6 @@
dependencies:
"@types/node" "*"
"@types/hapi__joi@^17.1.2":
version "17.1.2"
resolved "https://registry.yarnpkg.com/@types/hapi__joi/-/hapi__joi-17.1.2.tgz#f547d45b5d33677d1807ec217aeee832dc7e6334"
integrity sha512-2S6+hBISRQ5Ca6/9zfQi7zPueWMGyZxox6xicqJuW1/aC/6ambLyh+gDqY5fi8JBuHmGKMHldSfEpIXJtTmGKQ==
"@types/history@*":
version "4.7.6"
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.6.tgz#ed8fc802c45b8e8f54419c2d054e55c9ea344356"
@ -12951,6 +12935,17 @@ jmespath@0.15.0:
resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217"
integrity sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=
joi@^17.2.1:
version "17.3.0"
resolved "https://registry.yarnpkg.com/joi/-/joi-17.3.0.tgz#f1be4a6ce29bc1716665819ac361dfa139fff5d2"
integrity sha512-Qh5gdU6niuYbUIUV5ejbsMiiFmBdw8Kcp8Buj2JntszCkCfxJ9Cz76OtHxOZMPXrt5810iDIXs+n1nNVoquHgg==
dependencies:
"@hapi/hoek" "^9.0.0"
"@hapi/topo" "^5.0.0"
"@sideway/address" "^4.1.0"
"@sideway/formula" "^3.0.0"
"@sideway/pinpoint" "^2.0.0"
jpeg-js@^0.3.4:
version "0.3.6"
resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.3.6.tgz#c40382aac9506e7d1f2d856eb02f6c7b2a98b37c"