From 5a03c821e38b791248c2ab8d96c54b84a3171b68 Mon Sep 17 00:00:00 2001 From: Ayush Jain Date: Thu, 6 Aug 2020 00:39:14 +0530 Subject: [PATCH 1/5] Prior art synced with upstream (#35) * Add experimental script to sync API docs from code * sync-api-docs: Support methods * [remove before merging] Sync some API docs * [remove before merging] Netlify fix * sync-api-docs: add docs extraction script * sync-api-docs: Improvements to method docs * sync-api-docs: update docgen fork to 0.0.1 * [remove before merging] write extracted.json * sync-api-docs: pass filename into react-docgen * sync-api-docs: don't use PropTypes composition handler We have Flow types for this. * sync-api-docs: remove unused comment-parser * sync-api-docs: bump docgen fork to 0.0.2 * [remove before merging] update Markdown files * Sync docs with upstream Co-authored-by: Moti Zilberman Co-authored-by: Aniket Kumar --- .gitignore | 2 + website/package.json | 8 +- .../sync-api-docs/extractDocsFromRN.js | 72 +++ .../scripts/sync-api-docs/generateMarkdown.js | 235 +++++++++ website/scripts/sync-api-docs/magic.js | 25 + website/scripts/sync-api-docs/platforms.js | 22 + .../preprocessGeneratedApiDocs.js | 58 +++ .../scripts/sync-api-docs/sync-api-docs.js | 51 ++ website/scripts/sync-api-docs/titleToId.js | 12 + website/yarn.lock | 455 +++++++++++++----- 10 files changed, 827 insertions(+), 113 deletions(-) create mode 100644 website/scripts/sync-api-docs/extractDocsFromRN.js create mode 100644 website/scripts/sync-api-docs/generateMarkdown.js create mode 100644 website/scripts/sync-api-docs/magic.js create mode 100644 website/scripts/sync-api-docs/platforms.js create mode 100644 website/scripts/sync-api-docs/preprocessGeneratedApiDocs.js create mode 100644 website/scripts/sync-api-docs/sync-api-docs.js create mode 100644 website/scripts/sync-api-docs/titleToId.js diff --git a/.gitignore b/.gitignore index 659430d31dd..5d4acae64f8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ website/i18n/* !website/i18n/en.json .nvmrc +website/scripts/sync-api-docs/generatedComponentApiDocs.js +website/scripts/sync-api-docs/extracted.json diff --git a/website/package.json b/website/package.json index 3a15c6772bc..28d06011576 100644 --- a/website/package.json +++ b/website/package.json @@ -41,17 +41,21 @@ "alex": "^8.0.0", "docusaurus": "1.14.5", "highlight.js": "^9.15.10", - "remarkable": "^2.0.0" + "remarkable": "^2.0.0", + "tokenize-comment": "^3.0.1" }, "devDependencies": { + "@motiz88/react-native-docgen": "0.0.2", "front-matter": "^2.3.0", "fs-extra": "^5.0.0", "glob": "^7.1.2", "glob-promise": "^3.3.0", + "he": "^1.2.0", "husky": "^1.3.1", "node-fetch": "^2.3.0", "path": "^0.12.7", "prettier": "1.16.4", - "pretty-quick": "^1.10.0" + "pretty-quick": "^1.10.0", + "react-docgen-markdown-renderer": "^2.1.3" } } diff --git a/website/scripts/sync-api-docs/extractDocsFromRN.js b/website/scripts/sync-api-docs/extractDocsFromRN.js new file mode 100644 index 00000000000..f55543ba44e --- /dev/null +++ b/website/scripts/sync-api-docs/extractDocsFromRN.js @@ -0,0 +1,72 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +'use strict'; + +const fs = require('fs-extra'); +const glob = require('glob'); +const path = require('path'); +const reactDocs = require('@motiz88/react-native-docgen'); + +const GENERATE_ANNOTATION = '@' + 'generate-docs'; + +module.exports = extractDocsFromRN; + +async function extractDocsFromRN(rnRoot) { + // TODO: make implementation async + + const allComponentFiles = glob.sync( + path.join(rnRoot, '/Libraries/{Components,Image,}/**/*.js'), + { + nodir: true, + absolute: true, + } + ); + + const docs = []; + + for (const file of allComponentFiles) { + const contents = fs.readFileSync(file, {encoding: 'utf-8'}); + if (!contents.includes(GENERATE_ANNOTATION)) { + continue; + } + + console.log(file); + + const result = reactDocs.parse( + contents, + reactDocs.resolver.findExportedComponentDefinition, + reactDocs.defaultHandlers.filter( + handler => handler !== reactDocs.handlers.propTypeCompositionHandler + ), + {filename: file} + ); + + docs.push({ + file, + component: cleanComponentResult(result), + }); + } + + // Make sure output is JSON-safe + const docsSerialized = JSON.parse(JSON.stringify(docs)); + await fs.writeFile( + path.join(__dirname, 'extracted.json'), + JSON.stringify(docsSerialized, null, 2), + 'utf8' + ); + return docsSerialized; +} + +function cleanComponentResult(component) { + return { + ...component, + methods: component.methods.filter(method => !method.name.startsWith('_')), + }; +} diff --git a/website/scripts/sync-api-docs/generateMarkdown.js b/website/scripts/sync-api-docs/generateMarkdown.js new file mode 100644 index 00000000000..4b16464b307 --- /dev/null +++ b/website/scripts/sync-api-docs/generateMarkdown.js @@ -0,0 +1,235 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const he = require('he'); +const magic = require('./magic'); +const {formatPlatformName} = require('./platforms'); + +// Formats an array of rows as a Markdown table +function generateTable(rows) { + const colWidths = new Map(); + for (const row of rows) { + for (const col of Object.keys(row)) { + colWidths.set( + col, + Math.max(colWidths.get(col) || col.length, String(row[col]).length) + ); + } + } + if (!colWidths.size) { + return ''; + } + let header = '|', + divider = '|'; + for (const [col, width] of colWidths) { + header += ' ' + col.padEnd(width + 1) + '|'; + divider += ' ' + '-'.repeat(width) + ' ' + '|'; + } + + let result = header + '\n' + divider + '\n'; + for (const row of rows) { + result += '|'; + for (const [col, width] of colWidths) { + result += ' ' + String(row[col] || '').padEnd(width + 1) + '|'; + } + result += '\n'; + } + return result; +} + +// Wraps a string in an inline code block in a way that is safe to include in a +// table cell, by wrapping it as HTML if necessary. +function stringToInlineCodeForTable(str) { + let useHtml = /[`|]/.test(str); + str = str.replace(/\n/g, ' '); + if (useHtml) { + return '' + he.encode(str).replace(/\|/g, '|') + ''; + } + return '`' + str + '`'; +} + +// Formats information about a prop +function generateProp(propName, prop) { + const infoTable = generateTable([ + { + Type: prop.flowType ? maybeLinkifyType(prop.flowType) : '', + Required: prop.required ? 'Yes' : 'No', + ...(prop.rnTags && prop.rnTags.platform + ? {Platform: formatPlatformName(prop.rnTags.platform)} + : {}), + }, + ]); + + return ( + '### `' + + propName + + '`' + + '\n' + + '\n' + + (prop.description ? prop.description + '\n\n' : '') + + infoTable + ); +} + +// Formats information about a prop +function generateMethod(method, component) { + const infoTable = generateTable([ + { + ...(method.rnTags && method.rnTags.platform + ? {Platform: formatPlatformName(method.rnTags.platform)} + : {}), + }, + ]); + + return ( + '### `' + + method.name + + '()`' + + '\n' + + '\n' + + generateMethodSignatureBlock(method, component) + + (method.description ? method.description + '\n\n' : '') + + generateMethodSignatureTable(method, component) + + infoTable + ).trim(); +} + +function lowerFirst(s) { + return s[0].toLowerCase() + s.slice(1); +} + +function generateMethodSignatureBlock(method, component) { + return ( + '```jsx\n' + + (method.modifiers.includes('static') + ? component.displayName + '.' + : lowerFirst(component.displayName + '.')) + + method.name + + '(' + + method.params + .map(param => (param.optional ? `[${param.name}]` : param.name)) + .join(', ') + + ');' + + '\n' + + '```\n\n' + ); +} + +function generateMethodSignatureTable(method, component) { + if (!method.params.length) { + return ''; + } + return ( + '**Parameters:**\n\n' + + generateTable( + method.params.map(param => ({ + Name: param.name, + Type: param.type ? maybeLinkifyType(param.type) : '', + Required: param.optional ? 'No' : 'Yes', + Description: param.description, + })) + ) + ); +} + +function maybeLinkifyType(flowType) { + let url, text; + if (Object.hasOwnProperty.call(magic.linkableTypeAliases, flowType.name)) { + ({url, text} = magic.linkableTypeAliases[flowType.name]); + } + if (!text) { + text = stringToInlineCodeForTable(flowType.raw || flowType.name); + } + if (url) { + return `[${text}](${url})`; + } + return text; +} + +function maybeLinkifyTypeName(name) { + let url, text; + if (Object.hasOwnProperty.call(magic.linkableTypeAliases, name)) { + ({url, text} = magic.linkableTypeAliases[name]); + } + if (!text) { + text = stringToInlineCodeForTable(name); + } + if (url) { + return `[${text}](${url})`; + } + return text; +} + +// Formats information about props +function generateProps({props, composes}) { + if (!props || !Object.keys(props).length) { + return ''; + } + + return ( + '## Props' + + '\n' + + '\n' + + (composes && composes.length + ? composes + .map(parent => 'Inherits ' + maybeLinkifyTypeName(parent) + '.') + .join('\n\n') + '\n\n' + : '') + + Object.keys(props) + .sort() + .map(function(propName) { + return generateProp(propName, props[propName]); + }) + .join('\n\n---\n\n') + ); +} + +function generateMethods(component) { + const {methods} = component; + if (!methods || !methods.length) { + return ''; + } + + return ( + '## Methods' + + '\n' + + '\n' + + [...methods] + .sort((a, b) => + a.name.localeCompare( + b.name /* TODO @nocommit what's a neutral locale */ + ) + ) + .map(function(method) { + return generateMethod(method, component); + }) + .join('\n\n---\n\n') + ); +} + +// Generates a Docusaurus header for a component page +function generateHeader({id, title}) { + return ( + '---' + '\n' + 'id: ' + id + '\n' + 'title: ' + title + '\n' + '---' + '\n' + ); +} + +function generateMarkdown({id, title}, component) { + const markdownString = + generateHeader({id, title}) + + '\n' + + component.description + + '\n\n' + + '---\n\n' + + '# Reference\n\n' + + generateProps(component) + + generateMethods(component); + + return markdownString.replace(/\n{3,}/g, '\n\n'); +} + +module.exports = generateMarkdown; diff --git a/website/scripts/sync-api-docs/magic.js b/website/scripts/sync-api-docs/magic.js new file mode 100644 index 00000000000..fb0d0694be5 --- /dev/null +++ b/website/scripts/sync-api-docs/magic.js @@ -0,0 +1,25 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Hard-coded knowledge about the React Native codebase and how to document it, +// beyond what is explicitly encoded in the react-docgen artifact +// (generatedComponentApiDocs.js) + +// Ideally this file should go away. + +module.exports = { + linkableTypeAliases: { + ColorValue: { + text: 'color', + url: 'colors.md', + }, + ViewProps: { + text: 'View Props', + url: 'view.md#props', + }, + }, +}; diff --git a/website/scripts/sync-api-docs/platforms.js b/website/scripts/sync-api-docs/platforms.js new file mode 100644 index 00000000000..462ef947b45 --- /dev/null +++ b/website/scripts/sync-api-docs/platforms.js @@ -0,0 +1,22 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +function formatPlatformName(platform) { + switch (platform.toLowerCase()) { + case 'ios': + return 'iOS'; + case 'android': + return 'Android'; + } + return platform; +} + +module.exports = { + formatPlatformName, +}; diff --git a/website/scripts/sync-api-docs/preprocessGeneratedApiDocs.js b/website/scripts/sync-api-docs/preprocessGeneratedApiDocs.js new file mode 100644 index 00000000000..3732e45fa0e --- /dev/null +++ b/website/scripts/sync-api-docs/preprocessGeneratedApiDocs.js @@ -0,0 +1,58 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +// Preprocess the react-docgen artifact before rendering it to Markdown. +// This file may end up in the React Native repo, as part of the +// `generate-api-docs` script. + +const tokenizeComment = require('tokenize-comment'); + +function joinDescriptionAndExamples(tokenized) { + let sections = []; + if (tokenized.description) { + sections.push(tokenized.description); + } + for (const {raw} of tokenized.examples) { + sections.push(raw); + } + if (tokenized.footer) { + sections.push(tokenized.footer); + } + return sections.join('\n\n'); +} + +function preprocessTagsInDescription(obj) { + if (obj && obj.description) { + const descriptionTokenized = tokenizeComment(obj.description); + obj.description = joinDescriptionAndExamples(descriptionTokenized); + obj.rnTags = {}; + const platformTag = descriptionTokenized.tags.find( + ({key}) => key === 'platform' + ); + if (platformTag) { + obj.rnTags.platform = platformTag.value; + } + } +} + +// NOTE: This function mutates `docs`. +function preprocessGeneratedApiDocs(docs) { + for (const {component} of docs) { + if (component.props) { + for (const prop of Object.values(component.props)) { + preprocessTagsInDescription(prop); + } + for (const prop of component.methods) { + preprocessTagsInDescription(prop); + } + } + } +} + +module.exports = preprocessGeneratedApiDocs; diff --git a/website/scripts/sync-api-docs/sync-api-docs.js b/website/scripts/sync-api-docs/sync-api-docs.js new file mode 100644 index 00000000000..ec3a4dae50c --- /dev/null +++ b/website/scripts/sync-api-docs/sync-api-docs.js @@ -0,0 +1,51 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// ***** EXPERIMENTAL ***** +// Updates the API docs from the React Native source code. + +'use strict'; + +const process = require('process'); +const fs = require('fs-extra'); +const path = require('path'); + +const extractDocsFromRN = require('./extractDocsFromRN'); +const preprocessGeneratedApiDocs = require('./preprocessGeneratedApiDocs'); +const generateMarkdown = require('./generateMarkdown'); +const titleToId = require('./titleToId'); + +const DOCS_ROOT_DIR = path.resolve(__dirname, '..', '..', '..', 'docs'); + +async function generateApiDocs(rnPath) { + const apiDocs = await extractDocsFromRN(rnPath); + preprocessGeneratedApiDocs(apiDocs); + await Promise.all( + apiDocs.map(async ({component, file}, index) => { + if (!component.displayName) { + console.log( + `react-docgen data for ${path.basename(file)} was malformed, skipping` + ); + return; + } + const id = titleToId(component.displayName); + const componentMarkdown = generateMarkdown( + {title: component.displayName, id: id}, + component + ); + const outFile = path.join(DOCS_ROOT_DIR, id + '.md'); + console.log('Generated ' + outFile); + await fs.writeFile(outFile, componentMarkdown, 'utf8'); + }) + ); +} + +async function main(args) { + await generateApiDocs(args[0]); +} + +main(process.argv.slice(2)); diff --git a/website/scripts/sync-api-docs/titleToId.js b/website/scripts/sync-api-docs/titleToId.js new file mode 100644 index 00000000000..254bc16e335 --- /dev/null +++ b/website/scripts/sync-api-docs/titleToId.js @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function titleToId(title) { + return title.toLowerCase().replace(/[^a-z]+/g, '-'); +} + +module.exports = titleToId; diff --git a/website/yarn.lock b/website/yarn.lock index 0992b4a13f8..c8a9754377c 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -9,35 +9,25 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/code-frame@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" - integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== - dependencies: - "@babel/highlight" "^7.10.4" - -"@babel/compat-data@^7.10.4", "@babel/compat-data@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.11.0.tgz#e9f73efe09af1355b723a7f39b11bad637d7c99c" - integrity sha512-TPSvJfv73ng0pfnEOh17bYMPQbI95+nGWc71Ss4vZdRBHTDqmM9Z8ZV4rYz8Ks7sfzc95n30k6ODIq5UGnXcYQ== - dependencies: - browserslist "^4.12.0" - invariant "^2.2.4" - semver "^5.5.0" - -"@babel/core@^7.9.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.11.0.tgz#73b9c33f1658506887f767c26dae07798b30df76" - integrity sha512-mkLq8nwaXmDtFmRkQ8ED/eA2CnVw4zr7dCztKalZXBvdK5EeNUAesrrwUqjQEzFgomJssayzB0aqlOsP1vGLqg== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.11.0" - "@babel/helper-module-transforms" "^7.11.0" - "@babel/helpers" "^7.10.4" - "@babel/parser" "^7.11.0" - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.11.0" - "@babel/types" "^7.11.0" +"@babel/code-frame@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" + integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== + dependencies: + "@babel/highlight" "^7.8.3" + +"@babel/core@^7.7.4": + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.7.5.tgz#ae1323cd035b5160293307f50647e83f8ba62f7e" + integrity sha512-M42+ScN4+1S9iB6f+TL7QBpoQETxbclx+KNoKJABghnKYE+fMzSGqst0BZJc8CpI625bwPwYgUyRvxZ+0mZzpw== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.7.4" + "@babel/helpers" "^7.7.4" + "@babel/parser" "^7.7.5" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.1" @@ -47,19 +37,50 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.11.0.tgz#4b90c78d8c12825024568cbe83ee6c9af193585c" - integrity sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ== +"@babel/core@^7.7.5": + version "7.8.4" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.8.4.tgz#d496799e5c12195b3602d0fddd77294e3e38e80e" + integrity sha512-0LiLrB2PwrVI+a2/IEskBopDYSd8BCb3rOvH7D5tzoWd696TBEduBvuLVm4Nx6rltrLZqvI3MCalB2K2aVzQjA== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/generator" "^7.8.4" + "@babel/helpers" "^7.8.4" + "@babel/parser" "^7.8.4" + "@babel/template" "^7.8.3" + "@babel/traverse" "^7.8.4" + "@babel/types" "^7.8.3" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.1" + json5 "^2.1.0" + lodash "^4.17.13" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.4.tgz#db651e2840ca9aa66f327dcec1dc5f5fa9611369" + integrity sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg== dependencies: "@babel/types" "^7.11.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz#5bf0d495a3f757ac3bda48b5bf3b3ba309c72ba3" - integrity sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA== +"@babel/generator@^7.8.4": + version "7.8.4" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.8.4.tgz#35bbc74486956fe4251829f9f6c48330e8d0985e" + integrity sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA== + dependencies: + "@babel/types" "^7.8.3" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + +"@babel/helper-annotate-as-pure@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.4.tgz#bb3faf1e74b74bd547e867e48f551fa6b098b6ce" + integrity sha512-2BQmQgECKzYKFPpiycoF9tlb5HA4lrVyAmLLVK177EcQAqjVLciUb2/R+n1boQ9y5ENV3uz2ZqiNw7QMBBw1Og== dependencies: "@babel/types" "^7.10.4" @@ -318,18 +339,34 @@ "@babel/helper-create-class-features-plugin" "^7.10.4" "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-proposal-dynamic-import@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.10.4.tgz#ba57a26cb98b37741e9d5bca1b8b0ddf8291f17e" - integrity sha512-up6oID1LeidOOASNXgv/CFbgBqTuKJ0cJjz6An5tWD+NVBNlp3VNSBxv2ZdU7SYl3NxJC7agAQDApZusV6uFwQ== +"@babel/helper-function-name@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz#eeeb665a01b1f11068e9fb86ad56a1cb1a824cca" + integrity sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA== + dependencies: + "@babel/helper-get-function-arity" "^7.8.3" + "@babel/template" "^7.8.3" + "@babel/types" "^7.8.3" + +"@babel/helper-get-function-arity@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz#cb46348d2f8808e632f0ab048172130e636005f0" + integrity sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-dynamic-import" "^7.8.0" -"@babel/plugin-proposal-export-namespace-from@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.10.4.tgz#570d883b91031637b3e2958eea3c438e62c05f54" - integrity sha512-aNdf0LY6/3WXkhh0Fdb6Zk9j1NMD8ovj3F6r0+3j837Pn1S1PdNtcwJ5EG9WkVPNHPxyJDaxMaAOVq4eki0qbg== +"@babel/helper-get-function-arity@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" + integrity sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA== + dependencies: + "@babel/types" "^7.8.3" + +"@babel/helper-hoist-variables@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.4.tgz#612384e3d823fdfaaf9fce31550fe5d4db0f3d12" + integrity sha512-wQC4xyvc1Jo/FnLirL6CEgPgPCa8M74tOdjWpRhQYapz5JC7u3NYU1zCVoVAGCE3EaIP9T1A3iW0WLJ+reZlpQ== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" @@ -375,35 +412,116 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.0" "@babel/plugin-transform-parameters" "^7.10.4" -"@babel/plugin-proposal-optional-catch-binding@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.4.tgz#31c938309d24a78a49d68fdabffaa863758554dd" - integrity sha512-LflT6nPh+GK2MnFiKDyLiqSqVHkQnVf7hdoAvyTnnKj9xB3docGRsdPuxp6qqqW19ifK3xgc9U5/FwrSaCNX5g== +"@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.5.5.tgz#0aa6824f7100a2e0e89c1527c23936c152cab351" + integrity sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" + lodash "^4.17.13" -"@babel/plugin-proposal-optional-chaining@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.11.0.tgz#de5866d0646f6afdaab8a566382fe3a221755076" - integrity sha512-v9fZIu3Y8562RRwhm1BbMRxtqZNFmFA2EG+pT2diuU8PT3H6T/KXoZ54KgYisfOFZHV6PfvAiBIZ9Rcz+/JCxA== +"@babel/helper-remap-async-to-generator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.4.tgz#c68c2407350d9af0e061ed6726afb4fff16d0234" + integrity sha512-Sk4xmtVdM9sA/jCI80f+KS+Md+ZHIpjuqmYPk1M7F/upHou5e4ReYmExAiu6PVe65BhJPZA2CY9x9k4BqE5klw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.7.4" + "@babel/helper-wrap-function" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helper-replace-supers@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.7.4.tgz#3c881a6a6a7571275a72d82e6107126ec9e2cdd2" + integrity sha512-pP0tfgg9hsZWo5ZboYGuBn/bbYT/hdLPVSS4NMmiRJdwWhP0IznPwN9AE1JwyGsjSPLC364I0Qh5p+EPkGPNpg== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.7.4" + "@babel/helper-optimise-call-expression" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helper-simple-access@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.7.4.tgz#a169a0adb1b5f418cfc19f22586b2ebf58a9a294" + integrity sha512-zK7THeEXfan7UlWsG2A6CI/L9jVnI5+xxKZOdej39Y0YtDYKx9raHk5F2EtK9K8DHRTihYwg20ADt9S36GR78A== + dependencies: + "@babel/template" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helper-split-export-declaration@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz#57292af60443c4a3622cf74040ddc28e68336fd8" + integrity sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug== + dependencies: + "@babel/types" "^7.7.4" + +"@babel/helper-split-export-declaration@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9" + integrity sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA== + dependencies: + "@babel/types" "^7.8.3" + +"@babel/helper-wrap-function@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.7.4.tgz#37ab7fed5150e22d9d7266e830072c0cdd8baace" + integrity sha512-VsfzZt6wmsocOaVU0OokwrIytHND55yvyT4BPB9AIIgwr8+x7617hetdJTsuGwygN5RC6mxA9EJztTjuwm2ofg== + dependencies: + "@babel/helper-function-name" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helpers@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.7.4.tgz#62c215b9e6c712dadc15a9a0dcab76c92a940302" + integrity sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg== + dependencies: + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helpers@^7.8.4": + version "7.8.4" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz#754eb3ee727c165e0a240d6c207de7c455f36f73" + integrity sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w== + dependencies: + "@babel/template" "^7.8.3" + "@babel/traverse" "^7.8.4" + "@babel/types" "^7.8.3" + +"@babel/highlight@^7.0.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" + integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/helper-skip-transparent-expression-wrappers" "^7.11.0" "@babel/plugin-syntax-optional-chaining" "^7.8.0" -"@babel/plugin-proposal-private-methods@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.10.4.tgz#b160d972b8fdba5c7d111a145fc8c421fc2a6909" - integrity sha512-wh5GJleuI8k3emgTg5KkJK6kHNsGEr0uBTDBuQUBJwckk9xs1ez79ioheEVVxMLyPscB0LfkbVHslQqIzWV6Bw== +"@babel/highlight@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797" + integrity sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" -"@babel/plugin-proposal-unicode-property-regex@^7.10.4", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.10.4.tgz#4483cda53041ce3413b7fe2f00022665ddfaa75d" - integrity sha512-H+3fOgPnEXFL9zGYtKQe4IDOPKYlZdF1kqFDQRRb8PK4B8af1vAGK04tF5iQAAsui+mHNBQSAtd2/ndEDe9wuA== +"@babel/parser@^7.7.4", "@babel/parser@^7.7.5": + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.5.tgz#cbf45321619ac12d83363fcf9c94bb67fa646d71" + integrity sha512-KNlOe9+/nk4i29g0VXgl8PEXIRms5xKLJeuZ6UptN0fHv+jDiriG+y94X6qAgWTR0h3KaoM1wK5G5h7MHFRSig== + +"@babel/parser@^7.8.3", "@babel/parser@^7.8.4": + version "7.8.4" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz#d1dbe64691d60358a974295fa53da074dd2ce8e8" + integrity sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw== + +"@babel/plugin-proposal-async-generator-functions@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.4.tgz#0351c5ac0a9e927845fffd5b82af476947b7ce6d" + integrity sha512-1ypyZvGRXriY/QP668+s8sFr2mqinhkRDMPSQLNghCQE+GAkFtp+wkHVvg2+Hdki8gwP+NFzJBJ/N1BfzCCDEw== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.10.4" "@babel/helper-plugin-utils" "^7.10.4" @@ -917,46 +1035,99 @@ pirates "^4.0.0" source-map-support "^0.5.16" -"@babel/runtime@^7.8.4": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.0.tgz#f10245877042a815e07f7e693faff0ae9d3a2aac" - integrity sha512-qArkXsjJq7H+T86WrIFV0Fnu/tNOkZ4cgXmjkzAu3b/58D5mFIO8JH/y77t7C9q0OdDRdh9s7Ue5GasYssxtXw== +"@babel/runtime@^7.7.6": + version "7.8.4" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.4.tgz#d79f5a2040f7caa24d53e563aad49cbc05581308" + integrity sha512-neAp3zt80trRVBI1x0azq6c57aNBqYZH8KhMm3TaB7wEI5Q4A2SHfBHE8w9gOhI/lrqxtEbXZgQIrHP+wvSGwQ== dependencies: - regenerator-runtime "^0.13.4" + regenerator-runtime "^0.13.2" -"@babel/template@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278" - integrity sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA== +"@babel/template@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.4.tgz#428a7d9eecffe27deac0a98e23bf8e3675d2a77b" + integrity sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw== dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/parser" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/traverse@^7.10.4", "@babel/traverse@^7.11.0", "@babel/traverse@^7.9.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.11.0.tgz#9b996ce1b98f53f7c3e4175115605d56ed07dd24" - integrity sha512-ZB2V+LskoWKNpMq6E5UUCrjtDUh5IOTAyIl0dTjIEoXum/iKWkoIEKIRDnUucO6f+2FzNkE0oD4RLKoPIufDtg== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.11.0" - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-split-export-declaration" "^7.11.0" - "@babel/parser" "^7.11.0" - "@babel/types" "^7.11.0" +"@babel/template@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.8.3.tgz#e02ad04fe262a657809327f578056ca15fd4d1b8" + integrity sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/parser" "^7.8.3" + "@babel/types" "^7.8.3" + +"@babel/traverse@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.4.tgz#9c1e7c60fb679fe4fcfaa42500833333c2058558" + integrity sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.7.4" + "@babel/helper-function-name" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" + "@babel/parser" "^7.7.4" + "@babel/types" "^7.7.4" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.19" -"@babel/types@^7.10.4", "@babel/types@^7.10.5", "@babel/types@^7.11.0", "@babel/types@^7.4.4", "@babel/types@^7.9.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.11.0.tgz#2ae6bf1ba9ae8c3c43824e5861269871b206e90d" - integrity sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA== +"@babel/traverse@^7.8.4": + version "7.8.4" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.8.4.tgz#f0845822365f9d5b0e312ed3959d3f827f869e3c" + integrity sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/generator" "^7.8.4" + "@babel/helper-function-name" "^7.8.3" + "@babel/helper-split-export-declaration" "^7.8.3" + "@babel/parser" "^7.8.4" + "@babel/types" "^7.8.3" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + +"@babel/types@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.4.tgz#516570d539e44ddf308c07569c258ff94fde9193" + integrity sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA== dependencies: "@babel/helper-validator-identifier" "^7.10.4" lodash "^4.17.19" to-fast-properties "^2.0.0" +"@babel/types@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.8.3.tgz#5a383dffa5416db1b73dedffd311ffd0788fb31c" + integrity sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg== + dependencies: + esutils "^2.0.2" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + +"@motiz88/ast-types@^0.13.3": + version "0.13.3" + resolved "https://registry.npmjs.org/@motiz88/ast-types/-/ast-types-0.13.3.tgz#0630c411325b145a7ad5632adf8d8d40d28e07d0" + integrity sha512-OzqnfkQv2JjhRqZ0BeuJRuU6rx47LqBYeirDOUfb5C5fFFtpOh0AHTlQRifG4a5kir/OwjWW+x4HlViYxVko/Q== + +"@motiz88/react-native-docgen@0.0.2": + version "0.0.2" + resolved "https://registry.npmjs.org/@motiz88/react-native-docgen/-/react-native-docgen-0.0.2.tgz#0da1170dc601bddb28e255194b480e9dc6e7acd5" + integrity sha512-5knOlVOnHDUZRx6KCE94yGJYuevnckb+Q/+TL2mG9SEqAlDEh/4bMRyZMxcaoKOi/MIj1ZUQlbXVYoUlDAW5Tw== + dependencies: + "@babel/core" "^7.7.5" + "@babel/runtime" "^7.7.6" + "@motiz88/ast-types" "^0.13.3" + commander "^2.19.0" + doctrine "^3.0.0" + neo-async "^2.6.1" + node-dir "^0.1.10" + resolve "^1.10.1" + strip-indent "^3.0.0" + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -1962,7 +2133,7 @@ comma-separated-tokens@^1.0.0: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.7.tgz#419cd7fb3258b1ed838dc0953167a25e152f5b59" integrity sha512-Jrx3xsP4pPv4AwJUDWY9wOXGtwPXARej6Xd99h4TUGotmf8APuquKMpK+dnD3UgyxK7OEWaisjZz+3b5jtL6xQ== -commander@^2.15.1, commander@~2.20.3: +commander@^2.15.1, commander@^2.19.0, commander@~2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -2528,21 +2699,28 @@ dir-glob@2.0.0: arrify "^1.0.1" path-type "^3.0.0" -docusaurus@1.14.5: - version "1.14.5" - resolved "https://registry.yarnpkg.com/docusaurus/-/docusaurus-1.14.5.tgz#70f78627e7d58763c754de1339bceae8896ef9eb" - integrity sha512-VEOet+AcpTID4Co9goiBgAuubSaH+13GNHq6PilKaUAuFHHfEmyLkvQKJFMg4J9xTC83bmFiUkl708ycjr0p9w== - dependencies: - "@babel/core" "^7.9.0" - "@babel/plugin-proposal-class-properties" "^7.8.3" - "@babel/plugin-proposal-object-rest-spread" "^7.9.0" - "@babel/polyfill" "^7.8.7" - "@babel/preset-env" "^7.9.0" - "@babel/preset-react" "^7.9.4" - "@babel/register" "^7.9.0" - "@babel/traverse" "^7.9.0" - "@babel/types" "^7.9.0" - autoprefixer "^9.7.5" +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +docusaurus@1.14.4: + version "1.14.4" + resolved "https://registry.yarnpkg.com/docusaurus/-/docusaurus-1.14.4.tgz#1ef3ebe8c2aaaf1dec6c2e0e177e83be78aeaca3" + integrity sha512-KALmrlZBc0E+AB0ITR4POGKv8WcrcSSxvmgq7nC3TdpS+S2hrlXN/2tV3tVOZ8q8m+zhcMs7l9mAIhGFQyQwIw== + dependencies: + "@babel/core" "^7.7.4" + "@babel/plugin-proposal-class-properties" "^7.7.4" + "@babel/plugin-proposal-object-rest-spread" "^7.7.4" + "@babel/polyfill" "^7.7.0" + "@babel/preset-env" "^7.7.4" + "@babel/preset-react" "^7.7.4" + "@babel/register" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + autoprefixer "^9.7.2" babylon "^6.18.0" chalk "^3.0.0" classnames "^2.2.6" @@ -3372,7 +3550,7 @@ gaze@^1.1.3: gensync@^1.0.0-beta.1: version "1.0.0-beta.1" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" + resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== get-proxy@^2.0.0: @@ -3866,6 +4044,11 @@ hastscript@^5.0.0: property-information "^5.0.1" space-separated-tokens "^1.0.0" +he@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + hex-color-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" @@ -5225,7 +5408,12 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== -minimatch@3.0.4, minimatch@^3.0.4, minimatch@~3.0.2: +min-indent@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.0.tgz#cfc45c37e9ec0d8f0a0ec3dd4ef7f7c3abe39256" + integrity sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY= + +minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -5361,7 +5549,7 @@ negotiator@0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== -neo-async@^2.6.0: +neo-async@^2.6.0, neo-async@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== @@ -5399,6 +5587,13 @@ nlcst-to-string@^2.0.0: resolved "https://registry.yarnpkg.com/nlcst-to-string/-/nlcst-to-string-2.0.3.tgz#b7913bb1305263b0561a86de68e179f17f7febe3" integrity sha512-OY2QhGdf6jpYfHqS4vJwqF7aIBZkaMjMUkcHcskMPitvXLuYNGdQvgVWI/5yKwkmIdmhft3ounSJv+Re2yydng== +node-dir@^0.1.10: + version "0.1.17" + resolved "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz#5f5665d93351335caabef8f1c554516cf5f1e4e5" + integrity sha1-X1Zl2TNRM1yqvvjxxVRRbPXx5OU= + dependencies: + minimatch "^3.0.2" + node-fetch@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" @@ -6580,6 +6775,18 @@ react-dev-utils@^9.1.0: strip-ansi "5.2.0" text-table "0.2.0" +react-docgen-markdown-renderer@^2.1.3: + version "2.1.3" + resolved "https://registry.npmjs.org/react-docgen-markdown-renderer/-/react-docgen-markdown-renderer-2.1.3.tgz#b9278c0a288e46bf682cc53b6a4e5464789600d0" + integrity sha512-583Phg6Pep09XwklAVEf/+v4XrohYfjFMHA5XXmT2Bm+Xao+46ECkJl3pJb+K0GZN5oaxZcGis2cgQpaKqmd2A== + dependencies: + react-docgen-renderer-template "^0.1.0" + +react-docgen-renderer-template@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/react-docgen-renderer-template/-/react-docgen-renderer-template-0.1.0.tgz#29340c947ab42b0060aa8e1c64e379a822e2733e" + integrity sha512-3GyuFI9pBf3E2lW6oX6j3DvTQv55Wc9pWNKwDVcUFf8kDfpDyWmTeAYWPxoSEhSZxhEP+LV/1Tr4DLwE4CULQQ== + react-dom@^16.8.4: version "16.12.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.12.0.tgz#0da4b714b8d13c2038c9396b54a92baea633fe11" @@ -6951,6 +7158,13 @@ resolve@^1.1.6, resolve@^1.10.0, resolve@^1.3.2: dependencies: path-parse "^1.0.6" +resolve@^1.10.1: + version "1.15.1" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" + integrity sha512-84oo6ZTtoTUpjgNEr5SJyzQhzL72gaRodsSfyxC/AXRvwu0Yse9H8eF9IpGo7b8YetZhlI6v7ZQ6bKBFV/6S7w== + dependencies: + path-parse "^1.0.6" + responselike@1.0.2, responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" @@ -7259,6 +7473,11 @@ sliced@^1.0.1: resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41" integrity sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E= +snapdragon-lexer@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/snapdragon-lexer/-/snapdragon-lexer-4.0.0.tgz#86e2fb96931e12060839000995b00d3551658292" + integrity sha512-ddXT9cpKI0PUrs3xeoQVKEjequr0UyW9w281dzu8RTgWtqdIGZSvoWDsnIMPCc8Fupk4dByatSodhwYEGgrdSg== + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -7619,6 +7838,13 @@ strip-indent@^2.0.0: resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= +strip-indent@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" + integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== + dependencies: + min-indent "^1.0.0" + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -7857,6 +8083,13 @@ toidentifier@1.0.0: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +tokenize-comment@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/tokenize-comment/-/tokenize-comment-3.0.1.tgz#deeffcd57714e6097182a39e032e4ff861c60a1a" + integrity sha512-of5j9zCooBZxcE1EQ9PCjXcuFUPU/h8GxhWqF86cQ3muHQQreIWgY40ZNfuPQUSXyTa6i7oAWqWX4QivzZh26Q== + dependencies: + snapdragon-lexer "^4.0.0" + toml@^2.3.2: version "2.3.6" resolved "https://registry.yarnpkg.com/toml/-/toml-2.3.6.tgz#25b0866483a9722474895559088b436fd11f861b" From e25c57bc729e2f4b3e731f267b60e64247c12641 Mon Sep 17 00:00:00 2001 From: Aniket Kumar Date: Thu, 6 Aug 2020 01:12:38 +0530 Subject: [PATCH 2/5] Add mlh-fellowship work Co-authored-by: Aniket Kumar Co-authored-by: Ayush Jain --- website/package.json | 5 +- .../scripts/sync-api-docs/generateMarkdown.js | 136 ++++++---- website/scripts/sync-api-docs/magic.js | 10 +- website/scripts/sync-api-docs/platforms.js | 22 -- .../preprocessGeneratedApiDocs.js | 33 ++- .../scripts/sync-api-docs/propFormatter.js | 237 ++++++++++++++++++ 6 files changed, 364 insertions(+), 79 deletions(-) delete mode 100644 website/scripts/sync-api-docs/platforms.js create mode 100644 website/scripts/sync-api-docs/propFormatter.js diff --git a/website/package.json b/website/package.json index 28d06011576..955c1232ce9 100644 --- a/website/package.json +++ b/website/package.json @@ -30,7 +30,8 @@ "sync-guides": "node sync-guides.js", "test": "yarn build", "lint": "cd ../ && alex .", - "lintv": "cd ../ && alex" + "lintv": "cd ../ && alex", + "sync:docs": "node scripts/sync-api-docs/sync-api-docs ../../react-native" }, "husky": { "hooks": { @@ -45,7 +46,7 @@ "tokenize-comment": "^3.0.1" }, "devDependencies": { - "@motiz88/react-native-docgen": "0.0.2", + "@motiz88/react-native-docgen": "0.0.3", "front-matter": "^2.3.0", "fs-extra": "^5.0.0", "glob": "^7.1.2", diff --git a/website/scripts/sync-api-docs/generateMarkdown.js b/website/scripts/sync-api-docs/generateMarkdown.js index 4b16464b307..e62948e27bf 100644 --- a/website/scripts/sync-api-docs/generateMarkdown.js +++ b/website/scripts/sync-api-docs/generateMarkdown.js @@ -4,10 +4,14 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ - -const he = require('he'); -const magic = require('./magic'); -const {formatPlatformName} = require('./platforms'); +const tokenizeComment = require('tokenize-comment'); +const { + formatMultiplePlatform, + maybeLinkifyType, + maybeLinkifyTypeName, + formatTypeColumn, + formatDefaultColumn, +} = require('./propFormatter'); // Formats an array of rows as a Markdown table function generateTable(rows) { @@ -41,33 +45,24 @@ function generateTable(rows) { return result; } -// Wraps a string in an inline code block in a way that is safe to include in a -// table cell, by wrapping it as HTML if necessary. -function stringToInlineCodeForTable(str) { - let useHtml = /[`|]/.test(str); - str = str.replace(/\n/g, ' '); - if (useHtml) { - return '' + he.encode(str).replace(/\|/g, '|') + ''; - } - return '`' + str + '`'; -} - // Formats information about a prop function generateProp(propName, prop) { const infoTable = generateTable([ { - Type: prop.flowType ? maybeLinkifyType(prop.flowType) : '', - Required: prop.required ? 'Yes' : 'No', - ...(prop.rnTags && prop.rnTags.platform - ? {Platform: formatPlatformName(prop.rnTags.platform)} - : {}), + Type: formatTypeColumn(prop), + ...formatDefaultColumn(prop), }, ]); return ( - '### `' + + '### ' + + (prop.required ? '
Required
' : '') + + '`' + propName + '`' + + (prop.rnTags && prop.rnTags.platform + ? formatMultiplePlatform(prop.rnTags.platform) + : '') + '\n' + '\n' + (prop.description ? prop.description + '\n\n' : '') + @@ -136,34 +131,6 @@ function generateMethodSignatureTable(method, component) { ); } -function maybeLinkifyType(flowType) { - let url, text; - if (Object.hasOwnProperty.call(magic.linkableTypeAliases, flowType.name)) { - ({url, text} = magic.linkableTypeAliases[flowType.name]); - } - if (!text) { - text = stringToInlineCodeForTable(flowType.raw || flowType.name); - } - if (url) { - return `[${text}](${url})`; - } - return text; -} - -function maybeLinkifyTypeName(name) { - let url, text; - if (Object.hasOwnProperty.call(magic.linkableTypeAliases, name)) { - ({url, text} = magic.linkableTypeAliases[name]); - } - if (!text) { - text = stringToInlineCodeForTable(name); - } - if (url) { - return `[${text}](${url})`; - } - return text; -} - // Formats information about props function generateProps({props, composes}) { if (!props || !Object.keys(props).length) { @@ -180,7 +147,8 @@ function generateProps({props, composes}) { .join('\n\n') + '\n\n' : '') + Object.keys(props) - .sort() + .sort((a, b) => a.localeCompare(b)) + .sort((a, b) => props[b].required - props[a].required) .map(function(propName) { return generateProp(propName, props[propName]); }) @@ -218,11 +186,77 @@ function generateHeader({id, title}) { ); } +// Function to process example contained description +function preprocessDescription(desc) { + // Playground tabs for the class and functional components + const playgroundTab = `
+
    + + +
+
`; + + //Blocks for different syntax sections + const functionalBlock = ``; + const classBlock = ``; + const endBlock = ``; + + desc = desc + .split('\n') + .map(line => { + return line.replace(/ /, ''); + }) + .join('\n'); + + const descriptionTokenized = tokenizeComment(desc); + // Tabs counter for examples + let tabs = 0; + descriptionTokenized.examples.map(item => { + const matchSnackPlayer = item.language.match(/(SnackPlayer name=).*/g); + if (matchSnackPlayer) { + const matchClassComp = matchSnackPlayer[0].match( + /Class%20Component%20Example/ + ); + const matchFuncComp = matchSnackPlayer[0].match( + /Function%20Component%20Example/ + ); + if (matchClassComp || matchFuncComp) tabs++; + } + }); + + if (tabs === 2) { + const wrapper = `${playgroundTab}\n\n${functionalBlock}\n\n${ + descriptionTokenized.examples[0].raw + }\n\n${classBlock}\n\n${ + descriptionTokenized.examples[1].raw + }\n\n${endBlock}`; + return ( + descriptionTokenized.description + + `\n## Example\n` + + wrapper + + '\n' + + descriptionTokenized?.footer + ); + } else { + return ( + desc.substr(0, desc.search('```SnackPlayer')) + + '\n' + + '\n## Example\n' + + '\n' + + desc.substr(desc.search('```SnackPlayer')) + ); + } +} + function generateMarkdown({id, title}, component) { const markdownString = generateHeader({id, title}) + '\n' + - component.description + + preprocessDescription(component.description) + '\n\n' + '---\n\n' + '# Reference\n\n' + diff --git a/website/scripts/sync-api-docs/magic.js b/website/scripts/sync-api-docs/magic.js index fb0d0694be5..e40137628e1 100644 --- a/website/scripts/sync-api-docs/magic.js +++ b/website/scripts/sync-api-docs/magic.js @@ -13,7 +13,7 @@ module.exports = { linkableTypeAliases: { - ColorValue: { + NativeColorValue: { text: 'color', url: 'colors.md', }, @@ -21,5 +21,13 @@ module.exports = { text: 'View Props', url: 'view.md#props', }, + PressEvent: { + text: 'PressEvent', + url: 'pressevent.md', + }, + 'RefreshLayoutConsts.SIZE.DEFAULT': { + text: 'RefreshControl.SIZE', + url: 'refreshcontrol.md#refreshlayoutconstssize', + }, }, }; diff --git a/website/scripts/sync-api-docs/platforms.js b/website/scripts/sync-api-docs/platforms.js deleted file mode 100644 index 462ef947b45..00000000000 --- a/website/scripts/sync-api-docs/platforms.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -function formatPlatformName(platform) { - switch (platform.toLowerCase()) { - case 'ios': - return 'iOS'; - case 'android': - return 'Android'; - } - return platform; -} - -module.exports = { - formatPlatformName, -}; diff --git a/website/scripts/sync-api-docs/preprocessGeneratedApiDocs.js b/website/scripts/sync-api-docs/preprocessGeneratedApiDocs.js index 3732e45fa0e..46f52bba8e5 100644 --- a/website/scripts/sync-api-docs/preprocessGeneratedApiDocs.js +++ b/website/scripts/sync-api-docs/preprocessGeneratedApiDocs.js @@ -12,6 +12,7 @@ // `generate-api-docs` script. const tokenizeComment = require('tokenize-comment'); +const {typeOf} = require('tokenize-comment/lib/utils'); function joinDescriptionAndExamples(tokenized) { let sections = []; @@ -29,14 +30,40 @@ function joinDescriptionAndExamples(tokenized) { function preprocessTagsInDescription(obj) { if (obj && obj.description) { + obj.description = obj.description + .split('\n') + .map(line => { + return line.replace(/ /, ''); + }) + .join('\n'); const descriptionTokenized = tokenizeComment(obj.description); - obj.description = joinDescriptionAndExamples(descriptionTokenized); + obj.description = obj.description.replace( + /@platform .*|@default .*|@type .*/g, + '' + ); obj.rnTags = {}; const platformTag = descriptionTokenized.tags.find( ({key}) => key === 'platform' ); + const defaultTag = descriptionTokenized.tags.filter( + tag => tag.key === 'default' + ); + const typeTag = descriptionTokenized.tags.filter(tag => tag.key === 'type'); + if (platformTag) { - obj.rnTags.platform = platformTag.value; + obj.rnTags.platform = platformTag.value.split(','); + } + if (defaultTag.length) { + obj.rnTags.default = []; + defaultTag.forEach(tag => { + obj.rnTags.default.push(tag.value); + }); + } + if (typeTag.length) { + obj.rnTags.type = []; + typeTag.forEach(tag => { + obj.rnTags.type.push(tag.value); + }); } } } @@ -44,7 +71,7 @@ function preprocessTagsInDescription(obj) { // NOTE: This function mutates `docs`. function preprocessGeneratedApiDocs(docs) { for (const {component} of docs) { - if (component.props) { + if (component.props && component.description) { for (const prop of Object.values(component.props)) { preprocessTagsInDescription(prop); } diff --git a/website/scripts/sync-api-docs/propFormatter.js b/website/scripts/sync-api-docs/propFormatter.js new file mode 100644 index 00000000000..42de69ce4e5 --- /dev/null +++ b/website/scripts/sync-api-docs/propFormatter.js @@ -0,0 +1,237 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +const {typeOf} = require('tokenize-comment/lib/utils'); +const he = require('he'); +const magic = require('./magic'); + +// Adds multiple platform tags for prop name +function formatMultiplePlatform(platforms) { + let platformString = ''; + platforms.forEach(platform => { + switch (platform.trim()) { + case 'ios': + platformString += '
' + 'iOS' + '
'; + break; + case 'android': + platformString += '
' + 'Android' + '
'; + break; + case 'tv': + platformString += '
' + 'TV' + '
'; + } + }); + return platformString; +} + +// Wraps a string in an inline code block in a way that is safe to include in a +// table cell, by wrapping it as HTML if necessary. +function stringToInlineCodeForTable(str) { + let useHtml = /[`|]/.test(str); + str = str.replace(/\n/g, ' '); + if (useHtml) { + return '' + he.encode(str).replace(/\|/g, '|') + ''; + } + return '`' + str + '`'; +} + +function maybeLinkifyType(flowType) { + let url, text; + flowType.elements?.forEach(elem => { + if (Object.hasOwnProperty.call(magic.linkableTypeAliases, elem.name)) { + ({url, text} = magic.linkableTypeAliases[elem.name]); + } + }); + if (!text) { + text = stringToInlineCodeForTable( + flowType.raw || formatType(flowType.name) + ); + } + if (url) { + return `[${text}](${url})`; + } + return text; +} + +function formatType(name) { + if (name.toLowerCase() === 'boolean') return 'bool'; + if (name.toLowerCase() === 'stringish') return 'string'; + if (name === '$ReadOnlyArray') return 'array'; + return name; +} + +function maybeLinkifyTypeName(name) { + let url, text; + if (Object.hasOwnProperty.call(magic.linkableTypeAliases, name)) { + ({url, text} = magic.linkableTypeAliases[name]); + } + if (!text) { + text = stringToInlineCodeForTable(name); + } + if (url) { + return `[${text}](${url})`; + } + return text; +} + +// Adds proper markdown formatting to component's prop type. +function formatTypeColumn(prop) { + // Checks for @type pragma comment + if (prop.rnTags && prop.rnTags.type) { + let tableRows = ''; + const typeTags = prop.rnTags.type; + + typeTags.forEach(tag => { + // Checks for @platform pragma in @type string + const isMatch = tag.match(/{@platform [a-z ,]*}/); + if (isMatch) { + // Extracts platforms from matched regex + const platform = isMatch[0].match(/ [a-z ,]*/); + + // Replaces @platform strings with empty string + // and appends type with formatted platform + tag = tag.replace(/{@platform [a-z ,]*}/g, ''); + tag = tag + formatMultiplePlatform(platform[0].split(',')); + } + tableRows = tableRows + tag + '
'; + }); + tableRows = tableRows.replace(/$/, ''); + return tableRows; + } + + // To extract type from prop flowType + else if (prop.flowType && Object.keys(prop.flowType).length >= 1) { + let text, url; + + // Handles flowtype name for signatures + if (prop.flowType.name === 'signature') { + // Handles flowtype for function signature + if (prop.flowType.type === 'function') { + // Extracts EventType from the raw value + const isMatch = prop.flowType.raw.match(/: [a-zA-Z]*/); + if (isMatch) { + // Formats EventType + const eventType = isMatch[0].substr(2); + // Checks for aliases in magic and generates md url + if ( + Object.hasOwnProperty.call(magic.linkableTypeAliases, eventType) + ) { + ({url, text} = magic.linkableTypeAliases[eventType]); + return `${prop.flowType.type}([${text}](${url}))`; + } + // TODO: Handling unknown function params + return `${prop.flowType.type}`; + } else { + return prop.flowType.type; + } + } + } else if (prop.flowType.name.includes('$ReadOnlyArray')) { + prop?.flowType?.elements[0]?.elements && + prop?.flowType?.elements[0]?.elements.forEach(elem => { + if ( + Object.hasOwnProperty.call(magic.linkableTypeAliases, elem.name) + ) { + ({url, text} = magic.linkableTypeAliases[elem.name]); + } + }); + if (url) return `array of [${text}](${url})`; + } else if (prop.flowType.name === '$ReadOnly') { + // Special Case: switch#trackcolor + let markdown = ''; + if (prop.flowType.elements[0]?.type === 'object') { + prop?.flowType?.elements[0]?.signature?.properties.forEach( + ({key, value}) => { + value?.elements?.forEach(elem => { + if ( + Object.hasOwnProperty.call(magic.linkableTypeAliases, elem.name) + ) { + ({url, text} = magic.linkableTypeAliases[elem.name]); + markdown += `${key}: [${text}](${url})` + ', '; + } + }); + } + ); + if (markdown.match(/, $/)) markdown = markdown.replace(/, $/, ''); + return `${prop.flowType.elements[0]?.type}: {${markdown}}`; + } + } else { + // Get text and url from magic aliases + prop?.flowType?.elements?.forEach(elem => { + if (Object.hasOwnProperty.call(magic.linkableTypeAliases, elem.name)) { + ({url, text} = magic.linkableTypeAliases[elem.name]); + } + }); + } + + // If no text is found, get raw values as text + if (!text) { + // TO BE FIXED + text = + (prop.flowType.raw && stringToInlineCodeForTable(prop.flowType.raw)) || + formatType(prop.flowType.name); + } + + // If URL is found, return text and link in markdown format + if (url) { + return `[${text}](${url})`; + } + + return text; + } +} + +// Adds proper markdown formatting to component's default value. +function formatDefaultColumn(prop) { + if (prop?.rnTags?.default) { + // Parse from @default annotation + let tableRows = ''; + prop.rnTags.default.forEach(tag => { + const isMatch = tag.match(/{@platform [a-z]*}/); + + if (isMatch) { + const platform = isMatch[0].match(/ [a-z]*/); + tag = tag.replace(/{@platform [a-z]*}/g, ''); + + // Checks component for NativeColorValue in default + let colorBlock = ''; + prop?.flowType?.elements.some(elem => { + if (elem.name === 'NativeColorValue' && !tag.includes('null')) { + colorBlock = + ''; + return true; + } + }); + + tag = + (!tag.includes('null') ? '`' + tag + '`' : tag) + + colorBlock + + formatMultiplePlatform(platform[0].split(',')); + } else { + tag = '`' + tag + '`'; + } + tableRows = tableRows + tag + '
'; + }); + tableRows = tableRows.replace(/$/, ''); + return {Default: tableRows}; + } else { + // Parse defaultValue if @default annotation not provided + return prop?.defaultValue?.value + ? {Default: stringToInlineCodeForTable(prop?.defaultValue?.value)} + : ''; + } +} + +module.exports = { + formatMultiplePlatform, + maybeLinkifyType, + maybeLinkifyTypeName, + formatTypeColumn, + formatDefaultColumn, +}; From d0068f762b6d23df58f84c0e47e065a9271243b9 Mon Sep 17 00:00:00 2001 From: Bartosz Kaszubowski Date: Thu, 13 Aug 2020 14:50:22 +0200 Subject: [PATCH 3/5] update Prettier paths, move tokenize-comment --- website/package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/website/package.json b/website/package.json index 955c1232ce9..2d901a90fdc 100644 --- a/website/package.json +++ b/website/package.json @@ -20,9 +20,9 @@ "version": "docusaurus-version", "rename-version": "docusaurus-rename-version", "ci-check": "yarn prettier:diff && node image-check.js", - "format:source": "prettier --write \"{core/**/*.js,static/js/**/*.js}\"", + "format:source": "prettier --write \"{core/**/*.js,scripts/**/*.js,static/js/**/*.js}\"", "format:markdown": "prettier --write \"{../docs/*.md,versioned_docs/**/*.md,blog/**/*.md}\"", - "nit:source": "prettier --list-different \"{core/**/*.js,static/js/**/*.js}\"", + "nit:source": "prettier --list-different \"{core/**/*.js,scripts/**/*.js,static/js/**/*.js}\"", "nit:markdown": "prettier --list-different \"{../docs/*.md,versioned_docs/**/*.md,blog/**/*.md}\"", "prettier": "yarn format:source && yarn format:markdown", "prettier:diff": "yarn nit:source", @@ -42,8 +42,7 @@ "alex": "^8.0.0", "docusaurus": "1.14.5", "highlight.js": "^9.15.10", - "remarkable": "^2.0.0", - "tokenize-comment": "^3.0.1" + "remarkable": "^2.0.0" }, "devDependencies": { "@motiz88/react-native-docgen": "0.0.3", @@ -57,6 +56,7 @@ "path": "^0.12.7", "prettier": "1.16.4", "pretty-quick": "^1.10.0", - "react-docgen-markdown-renderer": "^2.1.3" + "react-docgen-markdown-renderer": "^2.1.3", + "tokenize-comment": "^3.0.1" } } From d8edd6dbbe6288dcba60c0d33eaccd6830d2226a Mon Sep 17 00:00:00 2001 From: Bartosz Kaszubowski Date: Thu, 13 Aug 2020 15:42:21 +0200 Subject: [PATCH 4/5] attempt to fix Yarn lock file --- website/yarn.lock | 372 ++++++++++++++++++++++------------------------ 1 file changed, 175 insertions(+), 197 deletions(-) diff --git a/website/yarn.lock b/website/yarn.lock index c8a9754377c..18ec2a00cdf 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -9,6 +9,13 @@ dependencies: "@babel/highlight" "^7.0.0" +"@babel/code-frame@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" + integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== + dependencies: + "@babel/highlight" "^7.10.4" + "@babel/code-frame@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" @@ -16,26 +23,14 @@ dependencies: "@babel/highlight" "^7.8.3" -"@babel/core@^7.7.4": - version "7.7.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.7.5.tgz#ae1323cd035b5160293307f50647e83f8ba62f7e" - integrity sha512-M42+ScN4+1S9iB6f+TL7QBpoQETxbclx+KNoKJABghnKYE+fMzSGqst0BZJc8CpI625bwPwYgUyRvxZ+0mZzpw== - dependencies: - "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.7.4" - "@babel/helpers" "^7.7.4" - "@babel/parser" "^7.7.5" - "@babel/template" "^7.7.4" - "@babel/traverse" "^7.7.4" - "@babel/types" "^7.7.4" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.1" - json5 "^2.1.2" - lodash "^4.17.19" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" +"@babel/compat-data@^7.10.4", "@babel/compat-data@^7.11.0": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.11.0.tgz#e9f73efe09af1355b723a7f39b11bad637d7c99c" + integrity sha512-TPSvJfv73ng0pfnEOh17bYMPQbI95+nGWc71Ss4vZdRBHTDqmM9Z8ZV4rYz8Ks7sfzc95n30k6ODIq5UGnXcYQ== + dependencies: + browserslist "^4.12.0" + invariant "^2.2.4" + semver "^5.5.0" "@babel/core@^7.7.5": version "7.8.4" @@ -58,10 +53,32 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.4.tgz#db651e2840ca9aa66f327dcec1dc5f5fa9611369" - integrity sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg== +"@babel/core@^7.9.0": + version "7.11.1" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.11.1.tgz#2c55b604e73a40dc21b0e52650b11c65cf276643" + integrity sha512-XqF7F6FWQdKGGWAzGELL+aCO1p+lRY5Tj5/tbT3St1G8NaH70jhhDIKknIZaDans0OQBG5wRAldROLHSt44BgQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.11.0" + "@babel/helper-module-transforms" "^7.11.0" + "@babel/helpers" "^7.10.4" + "@babel/parser" "^7.11.1" + "@babel/template" "^7.10.4" + "@babel/traverse" "^7.11.0" + "@babel/types" "^7.11.0" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.1" + json5 "^2.1.2" + lodash "^4.17.19" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@^7.11.0": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.11.0.tgz#4b90c78d8c12825024568cbe83ee6c9af193585c" + integrity sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ== dependencies: "@babel/types" "^7.11.0" jsesc "^2.5.1" @@ -77,10 +94,10 @@ lodash "^4.17.13" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.4.tgz#bb3faf1e74b74bd547e867e48f551fa6b098b6ce" - integrity sha512-2BQmQgECKzYKFPpiycoF9tlb5HA4lrVyAmLLVK177EcQAqjVLciUb2/R+n1boQ9y5ENV3uz2ZqiNw7QMBBw1Og== +"@babel/helper-annotate-as-pure@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz#5bf0d495a3f757ac3bda48b5bf3b3ba309c72ba3" + integrity sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA== dependencies: "@babel/types" "^7.10.4" @@ -167,6 +184,15 @@ "@babel/template" "^7.10.4" "@babel/types" "^7.10.4" +"@babel/helper-function-name@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz#eeeb665a01b1f11068e9fb86ad56a1cb1a824cca" + integrity sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA== + dependencies: + "@babel/helper-get-function-arity" "^7.8.3" + "@babel/template" "^7.8.3" + "@babel/types" "^7.8.3" + "@babel/helper-get-function-arity@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2" @@ -174,6 +200,13 @@ dependencies: "@babel/types" "^7.10.4" +"@babel/helper-get-function-arity@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" + integrity sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA== + dependencies: + "@babel/types" "^7.8.3" + "@babel/helper-hoist-variables@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz#d49b001d1d5a68ca5e6604dda01a6297f7c9381e" @@ -275,6 +308,13 @@ dependencies: "@babel/types" "^7.11.0" +"@babel/helper-split-export-declaration@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9" + integrity sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA== + dependencies: + "@babel/types" "^7.8.3" + "@babel/helper-validator-identifier@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" @@ -299,6 +339,15 @@ "@babel/traverse" "^7.10.4" "@babel/types" "^7.10.4" +"@babel/helpers@^7.8.4": + version "7.8.4" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz#754eb3ee727c165e0a240d6c207de7c455f36f73" + integrity sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w== + dependencies: + "@babel/template" "^7.8.3" + "@babel/traverse" "^7.8.4" + "@babel/types" "^7.8.3" + "@babel/highlight@^7.0.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" @@ -317,11 +366,30 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797" + integrity sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + "@babel/parser@^7.10.4", "@babel/parser@^7.11.0": version "7.11.0" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.0.tgz#a9d7e11aead25d3b422d17b2c6502c8dddef6a5d" integrity sha512-qvRvi4oI8xii8NllyEc4MDJjuZiNaRzyb7Y7lup1NqJV8TZHF4O27CcP+72WPn/k1zkgJ6WJfnIbk4jTsVAZHw== +"@babel/parser@^7.11.1": + version "7.11.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.3.tgz#9e1eae46738bcd08e23e867bab43e7b95299a8f9" + integrity sha512-REo8xv7+sDxkKvoxEywIdsNFiZLybwdI7hcT5uEPyQrSMB4YQ973BfC9OOrD/81MaIjh6UxdulIQXkjmiH3PcA== + +"@babel/parser@^7.8.3", "@babel/parser@^7.8.4": + version "7.8.4" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz#d1dbe64691d60358a974295fa53da074dd2ce8e8" + integrity sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw== + "@babel/plugin-proposal-async-generator-functions@^7.10.4": version "7.10.5" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.5.tgz#3491cabf2f7c179ab820606cec27fed15e0e8558" @@ -339,34 +407,18 @@ "@babel/helper-create-class-features-plugin" "^7.10.4" "@babel/helper-plugin-utils" "^7.10.4" -"@babel/helper-function-name@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.8.3.tgz#eeeb665a01b1f11068e9fb86ad56a1cb1a824cca" - integrity sha512-BCxgX1BC2hD/oBlIFUgOCQDOPV8nSINxCwM3o93xP4P9Fq6aV5sgv2cOOITDMtCfQ+3PvHp3l689XZvAM9QyOA== - dependencies: - "@babel/helper-get-function-arity" "^7.8.3" - "@babel/template" "^7.8.3" - "@babel/types" "^7.8.3" - -"@babel/helper-get-function-arity@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz#cb46348d2f8808e632f0ab048172130e636005f0" - integrity sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA== +"@babel/plugin-proposal-dynamic-import@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.10.4.tgz#ba57a26cb98b37741e9d5bca1b8b0ddf8291f17e" + integrity sha512-up6oID1LeidOOASNXgv/CFbgBqTuKJ0cJjz6An5tWD+NVBNlp3VNSBxv2ZdU7SYl3NxJC7agAQDApZusV6uFwQ== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-dynamic-import" "^7.8.0" -"@babel/helper-get-function-arity@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" - integrity sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA== - dependencies: - "@babel/types" "^7.8.3" - -"@babel/helper-hoist-variables@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.4.tgz#612384e3d823fdfaaf9fce31550fe5d4db0f3d12" - integrity sha512-wQC4xyvc1Jo/FnLirL6CEgPgPCa8M74tOdjWpRhQYapz5JC7u3NYU1zCVoVAGCE3EaIP9T1A3iW0WLJ+reZlpQ== +"@babel/plugin-proposal-export-namespace-from@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.10.4.tgz#570d883b91031637b3e2958eea3c438e62c05f54" + integrity sha512-aNdf0LY6/3WXkhh0Fdb6Zk9j1NMD8ovj3F6r0+3j837Pn1S1PdNtcwJ5EG9WkVPNHPxyJDaxMaAOVq4eki0qbg== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" @@ -412,116 +464,35 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.0" "@babel/plugin-transform-parameters" "^7.10.4" -"@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.5.5.tgz#0aa6824f7100a2e0e89c1527c23936c152cab351" - integrity sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw== - dependencies: - lodash "^4.17.13" - -"@babel/helper-remap-async-to-generator@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.4.tgz#c68c2407350d9af0e061ed6726afb4fff16d0234" - integrity sha512-Sk4xmtVdM9sA/jCI80f+KS+Md+ZHIpjuqmYPk1M7F/upHou5e4ReYmExAiu6PVe65BhJPZA2CY9x9k4BqE5klw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.7.4" - "@babel/helper-wrap-function" "^7.7.4" - "@babel/template" "^7.7.4" - "@babel/traverse" "^7.7.4" - "@babel/types" "^7.7.4" - -"@babel/helper-replace-supers@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.7.4.tgz#3c881a6a6a7571275a72d82e6107126ec9e2cdd2" - integrity sha512-pP0tfgg9hsZWo5ZboYGuBn/bbYT/hdLPVSS4NMmiRJdwWhP0IznPwN9AE1JwyGsjSPLC364I0Qh5p+EPkGPNpg== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.7.4" - "@babel/helper-optimise-call-expression" "^7.7.4" - "@babel/traverse" "^7.7.4" - "@babel/types" "^7.7.4" - -"@babel/helper-simple-access@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.7.4.tgz#a169a0adb1b5f418cfc19f22586b2ebf58a9a294" - integrity sha512-zK7THeEXfan7UlWsG2A6CI/L9jVnI5+xxKZOdej39Y0YtDYKx9raHk5F2EtK9K8DHRTihYwg20ADt9S36GR78A== - dependencies: - "@babel/template" "^7.7.4" - "@babel/types" "^7.7.4" - -"@babel/helper-split-export-declaration@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz#57292af60443c4a3622cf74040ddc28e68336fd8" - integrity sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug== - dependencies: - "@babel/types" "^7.7.4" - -"@babel/helper-split-export-declaration@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9" - integrity sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA== - dependencies: - "@babel/types" "^7.8.3" - -"@babel/helper-wrap-function@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.7.4.tgz#37ab7fed5150e22d9d7266e830072c0cdd8baace" - integrity sha512-VsfzZt6wmsocOaVU0OokwrIytHND55yvyT4BPB9AIIgwr8+x7617hetdJTsuGwygN5RC6mxA9EJztTjuwm2ofg== - dependencies: - "@babel/helper-function-name" "^7.7.4" - "@babel/template" "^7.7.4" - "@babel/traverse" "^7.7.4" - "@babel/types" "^7.7.4" - -"@babel/helpers@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.7.4.tgz#62c215b9e6c712dadc15a9a0dcab76c92a940302" - integrity sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg== - dependencies: - "@babel/template" "^7.7.4" - "@babel/traverse" "^7.7.4" - "@babel/types" "^7.7.4" - -"@babel/helpers@^7.8.4": - version "7.8.4" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.8.4.tgz#754eb3ee727c165e0a240d6c207de7c455f36f73" - integrity sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w== +"@babel/plugin-proposal-optional-catch-binding@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.4.tgz#31c938309d24a78a49d68fdabffaa863758554dd" + integrity sha512-LflT6nPh+GK2MnFiKDyLiqSqVHkQnVf7hdoAvyTnnKj9xB3docGRsdPuxp6qqqW19ifK3xgc9U5/FwrSaCNX5g== dependencies: - "@babel/template" "^7.8.3" - "@babel/traverse" "^7.8.4" - "@babel/types" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" -"@babel/highlight@^7.0.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" - integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== +"@babel/plugin-proposal-optional-chaining@^7.11.0": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.11.0.tgz#de5866d0646f6afdaab8a566382fe3a221755076" + integrity sha512-v9fZIu3Y8562RRwhm1BbMRxtqZNFmFA2EG+pT2diuU8PT3H6T/KXoZ54KgYisfOFZHV6PfvAiBIZ9Rcz+/JCxA== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/helper-skip-transparent-expression-wrappers" "^7.11.0" "@babel/plugin-syntax-optional-chaining" "^7.8.0" -"@babel/highlight@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797" - integrity sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg== +"@babel/plugin-proposal-private-methods@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.10.4.tgz#b160d972b8fdba5c7d111a145fc8c421fc2a6909" + integrity sha512-wh5GJleuI8k3emgTg5KkJK6kHNsGEr0uBTDBuQUBJwckk9xs1ez79ioheEVVxMLyPscB0LfkbVHslQqIzWV6Bw== dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^4.0.0" - -"@babel/parser@^7.7.4", "@babel/parser@^7.7.5": - version "7.7.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.5.tgz#cbf45321619ac12d83363fcf9c94bb67fa646d71" - integrity sha512-KNlOe9+/nk4i29g0VXgl8PEXIRms5xKLJeuZ6UptN0fHv+jDiriG+y94X6qAgWTR0h3KaoM1wK5G5h7MHFRSig== - -"@babel/parser@^7.8.3", "@babel/parser@^7.8.4": - version "7.8.4" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.8.4.tgz#d1dbe64691d60358a974295fa53da074dd2ce8e8" - integrity sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw== + "@babel/helper-create-class-features-plugin" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-proposal-async-generator-functions@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.4.tgz#0351c5ac0a9e927845fffd5b82af476947b7ce6d" - integrity sha512-1ypyZvGRXriY/QP668+s8sFr2mqinhkRDMPSQLNghCQE+GAkFtp+wkHVvg2+Hdki8gwP+NFzJBJ/N1BfzCCDEw== +"@babel/plugin-proposal-unicode-property-regex@^7.10.4", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.10.4.tgz#4483cda53041ce3413b7fe2f00022665ddfaa75d" + integrity sha512-H+3fOgPnEXFL9zGYtKQe4IDOPKYlZdF1kqFDQRRb8PK4B8af1vAGK04tF5iQAAsui+mHNBQSAtd2/ndEDe9wuA== dependencies: "@babel/helper-create-regexp-features-plugin" "^7.10.4" "@babel/helper-plugin-utils" "^7.10.4" @@ -1042,14 +1013,21 @@ dependencies: regenerator-runtime "^0.13.2" -"@babel/template@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.4.tgz#428a7d9eecffe27deac0a98e23bf8e3675d2a77b" - integrity sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw== +"@babel/runtime@^7.8.4": + version "7.11.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.2.tgz#f549c13c754cc40b87644b9fa9f09a6a95fe0736" + integrity sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw== + dependencies: + regenerator-runtime "^0.13.4" + +"@babel/template@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278" + integrity sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA== dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.4" - "@babel/types" "^7.7.4" + "@babel/code-frame" "^7.10.4" + "@babel/parser" "^7.10.4" + "@babel/types" "^7.10.4" "@babel/template@^7.8.3": version "7.8.3" @@ -1060,17 +1038,17 @@ "@babel/parser" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/traverse@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.4.tgz#9c1e7c60fb679fe4fcfaa42500833333c2058558" - integrity sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw== - dependencies: - "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.7.4" - "@babel/helper-function-name" "^7.7.4" - "@babel/helper-split-export-declaration" "^7.7.4" - "@babel/parser" "^7.7.4" - "@babel/types" "^7.7.4" +"@babel/traverse@^7.10.4", "@babel/traverse@^7.11.0", "@babel/traverse@^7.9.0": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.11.0.tgz#9b996ce1b98f53f7c3e4175115605d56ed07dd24" + integrity sha512-ZB2V+LskoWKNpMq6E5UUCrjtDUh5IOTAyIl0dTjIEoXum/iKWkoIEKIRDnUucO6f+2FzNkE0oD4RLKoPIufDtg== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.11.0" + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.11.0" + "@babel/parser" "^7.11.0" + "@babel/types" "^7.11.0" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.19" @@ -1090,10 +1068,10 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.7.4": - version "7.7.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.4.tgz#516570d539e44ddf308c07569c258ff94fde9193" - integrity sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA== +"@babel/types@^7.10.4", "@babel/types@^7.10.5", "@babel/types@^7.11.0", "@babel/types@^7.4.4", "@babel/types@^7.9.0": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.11.0.tgz#2ae6bf1ba9ae8c3c43824e5861269871b206e90d" + integrity sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA== dependencies: "@babel/helper-validator-identifier" "^7.10.4" lodash "^4.17.19" @@ -1113,10 +1091,10 @@ resolved "https://registry.npmjs.org/@motiz88/ast-types/-/ast-types-0.13.3.tgz#0630c411325b145a7ad5632adf8d8d40d28e07d0" integrity sha512-OzqnfkQv2JjhRqZ0BeuJRuU6rx47LqBYeirDOUfb5C5fFFtpOh0AHTlQRifG4a5kir/OwjWW+x4HlViYxVko/Q== -"@motiz88/react-native-docgen@0.0.2": - version "0.0.2" - resolved "https://registry.npmjs.org/@motiz88/react-native-docgen/-/react-native-docgen-0.0.2.tgz#0da1170dc601bddb28e255194b480e9dc6e7acd5" - integrity sha512-5knOlVOnHDUZRx6KCE94yGJYuevnckb+Q/+TL2mG9SEqAlDEh/4bMRyZMxcaoKOi/MIj1ZUQlbXVYoUlDAW5Tw== +"@motiz88/react-native-docgen@0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@motiz88/react-native-docgen/-/react-native-docgen-0.0.3.tgz#7c08566fdc4ab1e5fba55860e7aa5e832025d61f" + integrity sha512-mSxa1nLGHmtEA9/EYZqwddYFxDH/F135CEEh2x7OhIGvTJu47E37qcXz83fDWL1KgZnpVHUAvMxAsmH4Npcw/A== dependencies: "@babel/core" "^7.7.5" "@babel/runtime" "^7.7.6" @@ -2706,21 +2684,21 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -docusaurus@1.14.4: - version "1.14.4" - resolved "https://registry.yarnpkg.com/docusaurus/-/docusaurus-1.14.4.tgz#1ef3ebe8c2aaaf1dec6c2e0e177e83be78aeaca3" - integrity sha512-KALmrlZBc0E+AB0ITR4POGKv8WcrcSSxvmgq7nC3TdpS+S2hrlXN/2tV3tVOZ8q8m+zhcMs7l9mAIhGFQyQwIw== - dependencies: - "@babel/core" "^7.7.4" - "@babel/plugin-proposal-class-properties" "^7.7.4" - "@babel/plugin-proposal-object-rest-spread" "^7.7.4" - "@babel/polyfill" "^7.7.0" - "@babel/preset-env" "^7.7.4" - "@babel/preset-react" "^7.7.4" - "@babel/register" "^7.7.4" - "@babel/traverse" "^7.7.4" - "@babel/types" "^7.7.4" - autoprefixer "^9.7.2" +docusaurus@1.14.5: + version "1.14.5" + resolved "https://registry.yarnpkg.com/docusaurus/-/docusaurus-1.14.5.tgz#70f78627e7d58763c754de1339bceae8896ef9eb" + integrity sha512-VEOet+AcpTID4Co9goiBgAuubSaH+13GNHq6PilKaUAuFHHfEmyLkvQKJFMg4J9xTC83bmFiUkl708ycjr0p9w== + dependencies: + "@babel/core" "^7.9.0" + "@babel/plugin-proposal-class-properties" "^7.8.3" + "@babel/plugin-proposal-object-rest-spread" "^7.9.0" + "@babel/polyfill" "^7.8.7" + "@babel/preset-env" "^7.9.0" + "@babel/preset-react" "^7.9.4" + "@babel/register" "^7.9.0" + "@babel/traverse" "^7.9.0" + "@babel/types" "^7.9.0" + autoprefixer "^9.7.5" babylon "^6.18.0" chalk "^3.0.0" classnames "^2.2.6" @@ -4868,7 +4846,7 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.2: +json5@^2.1.0, json5@^2.1.2: version "2.1.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43" integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA== @@ -5145,7 +5123,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@~4.17.10: +lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@~4.17.10: version "4.17.19" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== @@ -6942,7 +6920,7 @@ regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== -regenerator-runtime@^0.13.4: +regenerator-runtime@^0.13.2, regenerator-runtime@^0.13.4: version "0.13.7" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== From b25f2b102223c6506a807a3f227e1ad402ae15b0 Mon Sep 17 00:00:00 2001 From: Bartosz Kaszubowski Date: Thu, 13 Aug 2020 17:47:57 +0200 Subject: [PATCH 5/5] clean up the lock file after the conflicts resolution --- website/yarn.lock | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/website/yarn.lock b/website/yarn.lock index 9696662e381..892de0bd194 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -343,15 +343,6 @@ "@babel/traverse" "^7.8.4" "@babel/types" "^7.8.3" -"@babel/highlight@^7.0.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" - integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^4.0.0" - "@babel/highlight@^7.0.0", "@babel/highlight@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" @@ -4011,11 +4002,6 @@ hastscript@^5.0.0: property-information "^5.0.1" space-separated-tokens "^1.0.0" -he@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - hex-color-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" @@ -7794,13 +7780,6 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-indent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" - integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== - dependencies: - min-indent "^1.0.0" - strip-indent@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001"