mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-28 09:47:48 +02:00
chore: vendor MDX deps for Jest and the MDX 2 upgrade (#8515)
This commit is contained in:
parent
773529a3bc
commit
5a59378e11
10 changed files with 58495 additions and 1 deletions
|
@ -31,7 +31,8 @@
|
|||
"*.xyz",
|
||||
"*.docx",
|
||||
"versioned_docs",
|
||||
"*.min.*"
|
||||
"*.min.*",
|
||||
"jest/vendor"
|
||||
],
|
||||
"ignoreRegExpList": ["Email", "Urls", "#[\\w-]*"]
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ build
|
|||
coverage
|
||||
jest.config.js
|
||||
jest.transform.js
|
||||
jest/vendor
|
||||
examples/
|
||||
|
||||
packages/lqip-loader/lib/
|
||||
|
|
|
@ -4,6 +4,9 @@ node_modules
|
|||
build
|
||||
coverage
|
||||
.docusaurus
|
||||
|
||||
jest/vendor
|
||||
|
||||
packages/lqip-loader/lib/
|
||||
packages/docusaurus/lib/
|
||||
packages/docusaurus-*/lib/*
|
||||
|
|
25696
jest/vendor/@mdx-js__mdx@2.1.5.js
vendored
Normal file
25696
jest/vendor/@mdx-js__mdx@2.1.5.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
151
jest/vendor/estree-util-value-to-estree@2.1.0.js
vendored
Normal file
151
jest/vendor/estree-util-value-to-estree@2.1.0.js
vendored
Normal file
|
@ -0,0 +1,151 @@
|
|||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// node_modules/estree-util-value-to-estree/index.js
|
||||
var estree_util_value_to_estree_exports = {};
|
||||
__export(estree_util_value_to_estree_exports, {
|
||||
valueToEstree: () => valueToEstree
|
||||
});
|
||||
module.exports = __toCommonJS(estree_util_value_to_estree_exports);
|
||||
|
||||
// node_modules/estree-util-value-to-estree/node_modules/is-plain-obj/index.js
|
||||
function isPlainObject(value) {
|
||||
if (typeof value !== "object" || value === null) {
|
||||
return false;
|
||||
}
|
||||
const prototype = Object.getPrototypeOf(value);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
||||
}
|
||||
|
||||
// node_modules/estree-util-value-to-estree/index.js
|
||||
function valueToEstree(value, options = {}) {
|
||||
if (value === void 0 || value === Number.POSITIVE_INFINITY || Number.isNaN(value)) {
|
||||
return { type: "Identifier", name: String(value) };
|
||||
}
|
||||
if (value == null || typeof value === "string" || typeof value === "boolean") {
|
||||
return { type: "Literal", value };
|
||||
}
|
||||
if (typeof value === "bigint") {
|
||||
return value >= 0 ? { type: "Literal", value, bigint: String(value) } : {
|
||||
type: "UnaryExpression",
|
||||
operator: "-",
|
||||
prefix: true,
|
||||
argument: valueToEstree(-value, options)
|
||||
};
|
||||
}
|
||||
if (typeof value === "number") {
|
||||
return value >= 0 ? { type: "Literal", value } : {
|
||||
type: "UnaryExpression",
|
||||
operator: "-",
|
||||
prefix: true,
|
||||
argument: valueToEstree(-value, options)
|
||||
};
|
||||
}
|
||||
if (typeof value === "symbol") {
|
||||
if (value.description && value === Symbol.for(value.description)) {
|
||||
return {
|
||||
type: "CallExpression",
|
||||
optional: false,
|
||||
callee: {
|
||||
type: "MemberExpression",
|
||||
computed: false,
|
||||
optional: false,
|
||||
object: { type: "Identifier", name: "Symbol" },
|
||||
property: { type: "Identifier", name: "for" }
|
||||
},
|
||||
arguments: [valueToEstree(value.description, options)]
|
||||
};
|
||||
}
|
||||
throw new TypeError(`Only global symbols are supported, got: ${String(value)}`);
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
const elements = [];
|
||||
for (let i = 0; i < value.length; i += 1) {
|
||||
elements.push(i in value ? valueToEstree(value[i], options) : null);
|
||||
}
|
||||
return { type: "ArrayExpression", elements };
|
||||
}
|
||||
if (value instanceof Boolean || value instanceof Number || value instanceof String) {
|
||||
return {
|
||||
type: "NewExpression",
|
||||
callee: { type: "Identifier", name: value.constructor.name },
|
||||
arguments: [valueToEstree(value.valueOf())]
|
||||
};
|
||||
}
|
||||
if (value instanceof RegExp) {
|
||||
return {
|
||||
type: "Literal",
|
||||
value,
|
||||
regex: { pattern: value.source, flags: value.flags }
|
||||
};
|
||||
}
|
||||
if (value instanceof Date) {
|
||||
return {
|
||||
type: "NewExpression",
|
||||
callee: { type: "Identifier", name: "Date" },
|
||||
arguments: [valueToEstree(value.getTime(), options)]
|
||||
};
|
||||
}
|
||||
if (typeof Buffer !== "undefined" && Buffer.isBuffer(value)) {
|
||||
return {
|
||||
type: "CallExpression",
|
||||
optional: false,
|
||||
callee: {
|
||||
type: "MemberExpression",
|
||||
computed: false,
|
||||
optional: false,
|
||||
object: { type: "Identifier", name: "Buffer" },
|
||||
property: { type: "Identifier", name: "from" }
|
||||
},
|
||||
arguments: [valueToEstree([...value])]
|
||||
};
|
||||
}
|
||||
if (value instanceof BigInt64Array || value instanceof BigUint64Array || value instanceof Float32Array || value instanceof Float64Array || value instanceof Int8Array || value instanceof Int16Array || value instanceof Int32Array || value instanceof Map || value instanceof Set || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Uint16Array || value instanceof Uint32Array) {
|
||||
return {
|
||||
type: "NewExpression",
|
||||
callee: { type: "Identifier", name: value.constructor.name },
|
||||
arguments: [valueToEstree([...value], options)]
|
||||
};
|
||||
}
|
||||
if (value instanceof URL || value instanceof URLSearchParams) {
|
||||
return {
|
||||
type: "NewExpression",
|
||||
callee: { type: "Identifier", name: value.constructor.name },
|
||||
arguments: [valueToEstree(String(value), options)]
|
||||
};
|
||||
}
|
||||
if (options.instanceAsObject || isPlainObject(value)) {
|
||||
return {
|
||||
type: "ObjectExpression",
|
||||
properties: Reflect.ownKeys(value).map((key) => ({
|
||||
type: "Property",
|
||||
method: false,
|
||||
shorthand: false,
|
||||
computed: typeof key !== "string",
|
||||
kind: "init",
|
||||
key: valueToEstree(key, options),
|
||||
value: valueToEstree(value[key], options)
|
||||
}))
|
||||
};
|
||||
}
|
||||
throw new TypeError(`Unsupported value: ${String(value)}`);
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
valueToEstree
|
||||
});
|
43
jest/vendor/mdast-util-to-string@3.1.0.js
vendored
Normal file
43
jest/vendor/mdast-util-to-string@3.1.0.js
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all2) => {
|
||||
for (var name in all2)
|
||||
__defProp(target, name, { get: all2[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// node_modules/mdast-util-to-string/index.js
|
||||
var mdast_util_to_string_exports = {};
|
||||
__export(mdast_util_to_string_exports, {
|
||||
toString: () => toString
|
||||
});
|
||||
module.exports = __toCommonJS(mdast_util_to_string_exports);
|
||||
function toString(node, options) {
|
||||
var { includeImageAlt = true } = options || {};
|
||||
return one(node, includeImageAlt);
|
||||
}
|
||||
function one(node, includeImageAlt) {
|
||||
return node && typeof node === "object" && (node.value || (includeImageAlt ? node.alt : "") || "children" in node && all(node.children, includeImageAlt) || Array.isArray(node) && all(node, includeImageAlt)) || "";
|
||||
}
|
||||
function all(values, includeImageAlt) {
|
||||
var result = [];
|
||||
var index = -1;
|
||||
while (++index < values.length) {
|
||||
result[index] = one(values[index], includeImageAlt);
|
||||
}
|
||||
return result.join("");
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
toString
|
||||
});
|
3846
jest/vendor/remark-directive@2.0.1.js
vendored
Normal file
3846
jest/vendor/remark-directive@2.0.1.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
4907
jest/vendor/remark-gfm@3.0.1.js
vendored
Normal file
4907
jest/vendor/remark-gfm@3.0.1.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
14938
jest/vendor/remark-mdx@2.1.5.js
vendored
Normal file
14938
jest/vendor/remark-mdx@2.1.5.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
8908
jest/vendor/remark@14.0.2.js
vendored
Normal file
8908
jest/vendor/remark@14.0.2.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue