Unverified Commit dde9ad46 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Add experimental cra-to-next transform in codemod cli (#24969)

Co-authored-by: 's avatarTim Neutkens <tim@timneutkens.nl>
Co-authored-by: 's avatarkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
parent 7530865e
...@@ -8,18 +8,18 @@ ...@@ -8,18 +8,18 @@
// Based on https://github.com/reactjs/react-codemod/blob/dd8671c9a470a2c342b221ec903c574cf31e9f57/bin/cli.js // Based on https://github.com/reactjs/react-codemod/blob/dd8671c9a470a2c342b221ec903c574cf31e9f57/bin/cli.js
// @next/codemod optional-name-of-transform optional/path/to/src [...options] // @next/codemod optional-name-of-transform optional/path/to/src [...options]
const globby = require('globby') import globby from 'globby'
const inquirer = require('inquirer') import inquirer from 'inquirer'
const meow = require('meow') import meow from 'meow'
const path = require('path') import path from 'path'
const execa = require('execa') import execa from 'execa'
const chalk = require('chalk') import chalk from 'chalk'
const isGitClean = require('is-git-clean') import isGitClean from 'is-git-clean'
const transformerDirectory = path.join(__dirname, '../', 'transforms') export const jscodeshiftExecutable = require.resolve('.bin/jscodeshift')
const jscodeshiftExecutable = require.resolve('.bin/jscodeshift') export const transformerDirectory = path.join(__dirname, '../', 'transforms')
function checkGitStatus(force) { export function checkGitStatus(force) {
let clean = false let clean = false
let errorMessage = 'Unable to determine if git directory is clean' let errorMessage = 'Unable to determine if git directory is clean'
try { try {
...@@ -49,12 +49,17 @@ function checkGitStatus(force) { ...@@ -49,12 +49,17 @@ function checkGitStatus(force) {
} }
} }
function runTransform({ files, flags, transformer }) { export function runTransform({ files, flags, transformer }) {
const transformerPath = path.join(transformerDirectory, `${transformer}.js`) const transformerPath = path.join(transformerDirectory, `${transformer}.js`)
if (transformer === 'cra-to-next') {
// cra-to-next transform doesn't use jscodeshift directly
return require(transformerPath).default(files, flags)
}
let args = [] let args = []
const { dry, print } = flags const { dry, print, runInBand } = flags
if (dry) { if (dry) {
args.push('--dry') args.push('--dry')
...@@ -62,6 +67,9 @@ function runTransform({ files, flags, transformer }) { ...@@ -62,6 +67,9 @@ function runTransform({ files, flags, transformer }) {
if (print) { if (print) {
args.push('--print') args.push('--print')
} }
if (runInBand) {
args.push('--run-in-band')
}
args.push('--verbose=2') args.push('--verbose=2')
...@@ -83,11 +91,11 @@ function runTransform({ files, flags, transformer }) { ...@@ -83,11 +91,11 @@ function runTransform({ files, flags, transformer }) {
const result = execa.sync(jscodeshiftExecutable, args, { const result = execa.sync(jscodeshiftExecutable, args, {
stdio: 'inherit', stdio: 'inherit',
stripEof: false, stripFinalNewline: false,
}) })
if (result.error) { if (result.failed) {
throw result.error throw new Error(`jscodeshift exited with code ${result.exitCode}`)
} }
} }
...@@ -112,6 +120,11 @@ const TRANSFORMER_INQUIRER_CHOICES = [ ...@@ -112,6 +120,11 @@ const TRANSFORMER_INQUIRER_CHOICES = [
'url-to-withrouter: Transforms the deprecated automatically injected url property on top level pages to using withRouter', 'url-to-withrouter: Transforms the deprecated automatically injected url property on top level pages to using withRouter',
value: 'url-to-withrouter', value: 'url-to-withrouter',
}, },
{
name:
'cra-to-next (experimental): automatically migrates a Create React App project to Next.js',
value: 'cra-to-next',
},
] ]
function expandFilePathsIfNeeded(filesBeforeExpansion) { function expandFilePathsIfNeeded(filesBeforeExpansion) {
...@@ -123,11 +136,10 @@ function expandFilePathsIfNeeded(filesBeforeExpansion) { ...@@ -123,11 +136,10 @@ function expandFilePathsIfNeeded(filesBeforeExpansion) {
: filesBeforeExpansion : filesBeforeExpansion
} }
function run() { export function run() {
const cli = meow( const cli = meow({
{ description: 'Codemods for updating Next.js apps.',
description: 'Codemods for updating Next.js apps.', help: `
help: `
Usage Usage
$ npx @next/codemod <transform> <path> <...options> $ npx @next/codemod <transform> <path> <...options>
transform One of the choices from https://github.com/vercel/next.js/tree/canary/packages/next-codemod transform One of the choices from https://github.com/vercel/next.js/tree/canary/packages/next-codemod
...@@ -138,15 +150,14 @@ function run() { ...@@ -138,15 +150,14 @@ function run() {
--print Print transformed files to your terminal --print Print transformed files to your terminal
--jscodeshift (Advanced) Pass options directly to jscodeshift --jscodeshift (Advanced) Pass options directly to jscodeshift
`, `,
}, flags: {
{
boolean: ['force', 'dry', 'print', 'help'], boolean: ['force', 'dry', 'print', 'help'],
string: ['_'], string: ['_'],
alias: { alias: {
h: 'help', h: 'help',
}, },
} },
) } as meow.Options<meow.AnyFlags>)
if (!cli.flags.dry) { if (!cli.flags.dry) {
checkGitStatus(cli.flags.force) checkGitStatus(cli.flags.force)
...@@ -203,11 +214,3 @@ function run() { ...@@ -203,11 +214,3 @@ function run() {
}) })
}) })
} }
module.exports = {
run: run,
runTransform: runTransform,
checkGitStatus: checkGitStatus,
jscodeshiftExecutable: jscodeshiftExecutable,
transformerDirectory: transformerDirectory,
}
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
# vercel
.vercel
import nodePath from 'path'
import { API, FileInfo, Options } from 'jscodeshift'
export const globalCssContext = {
cssImports: new Set<string>(),
reactSvgImports: new Set<string>(),
}
const globalStylesRegex = /(?<!\.module)\.(css|scss|sass)$/i
export default function transformer(
file: FileInfo,
api: API,
options: Options
) {
const j = api.jscodeshift
const root = j(file.source)
let hasModifications = false
root
.find(j.ImportDeclaration)
.filter((path) => {
const {
node: {
source: { value },
},
} = path
if (typeof value === 'string') {
if (globalStylesRegex.test(value)) {
let resolvedPath = value
if (value.startsWith('.')) {
resolvedPath = nodePath.resolve(nodePath.dirname(file.path), value)
}
globalCssContext.cssImports.add(resolvedPath)
const { start, end } = path.node as any
if (!path.parentPath.node.comments) {
path.parentPath.node.comments = []
}
path.parentPath.node.comments = [
j.commentLine(' ' + file.source.substring(start, end)),
]
hasModifications = true
return true
} else if (value.endsWith('.svg')) {
const isComponentImport = path.node.specifiers.some((specifier) => {
return (specifier as any).imported?.name === 'ReactComponent'
})
if (isComponentImport) {
globalCssContext.reactSvgImports.add(file.path)
}
}
}
return false
})
.remove()
return hasModifications && globalCssContext.reactSvgImports.size === 0
? root.toSource(options)
: null
}
import { API, FileInfo, JSXElement, Options } from 'jscodeshift'
export const indexContext = {
multipleRenderRoots: false,
nestedRender: false,
}
export default function transformer(
file: FileInfo,
api: API,
options: Options
) {
const j = api.jscodeshift
const root = j(file.source)
let hasModifications = false
let foundReactRender = 0
let hasRenderImport = false
let defaultReactDomImport: string | undefined
root.find(j.ImportDeclaration).forEach((path) => {
if (path.node.source.value === 'react-dom') {
return path.node.specifiers.forEach((specifier) => {
if (specifier.local.name === 'render') {
hasRenderImport = true
}
if (specifier.type === 'ImportDefaultSpecifier') {
defaultReactDomImport = specifier.local.name
}
})
}
return false
})
root
.find(j.CallExpression)
.filter((path) => {
const { node } = path
let found = false
if (
defaultReactDomImport &&
node.callee.type === 'MemberExpression' &&
(node.callee.object as any).name === defaultReactDomImport &&
(node.callee.property as any).name === 'render'
) {
found = true
}
if (hasRenderImport && (node.callee as any).name === 'render') {
found = true
}
if (found) {
foundReactRender++
hasModifications = true
if (!Array.isArray(path.parentPath?.parentPath?.value)) {
indexContext.nestedRender = true
return false
}
const newNode = j.exportDefaultDeclaration(
j.functionDeclaration(
j.identifier('NextIndexWrapper'),
[],
j.blockStatement([
j.returnStatement(
// TODO: remove React.StrictMode wrapper and use
// next.config.js option instead?
path.node.arguments.find(
(a) => a.type === 'JSXElement'
) as JSXElement
),
])
)
)
path.parentPath.insertBefore(newNode)
return true
}
return false
})
.remove()
indexContext.multipleRenderRoots = foundReactRender > 1
hasModifications =
hasModifications &&
!indexContext.nestedRender &&
!indexContext.multipleRenderRoots
// TODO: move function passed to reportWebVitals if present to
// _app reportWebVitals and massage values to expected shape
// root.find(j.CallExpression, {
// callee: {
// name: 'reportWebVitals'
// }
// }).remove()
return hasModifications ? root.toSource(options) : null
}
This diff is collapsed.
/* eslint-disable import/no-extraneous-dependencies */
import chalk from 'chalk'
import spawn from 'cross-spawn'
interface InstallArgs {
/**
* Indicate whether to install packages using Yarn.
*/
useYarn: boolean
/**
* Indicate whether there is an active Internet connection.
*/
isOnline: boolean
/**
* Indicate whether the given dependencies are devDependencies.
*/
devDependencies?: boolean
}
/**
* Spawn a package manager installation with either Yarn or NPM.
*
* @returns A Promise that resolves once the installation is finished.
*/
export function install(
root: string,
dependencies: string[] | null,
{ useYarn, isOnline, devDependencies }: InstallArgs
): Promise<void> {
/**
* NPM-specific command-line flags.
*/
const npmFlags: string[] = ['--logLevel', 'error']
/**
* Yarn-specific command-line flags.
*/
const yarnFlags: string[] = []
/**
* Return a Promise that resolves once the installation is finished.
*/
return new Promise((resolve, reject) => {
let args: string[]
let command: string = useYarn ? 'yarnpkg' : 'npm'
if (dependencies && dependencies.length) {
/**
* If there are dependencies, run a variation of `{displayCommand} add`.
*/
if (useYarn) {
/**
* Call `yarn add --exact (--offline)? (-D)? ...`.
*/
args = ['add', '--exact']
if (!isOnline) args.push('--offline')
args.push('--cwd', root)
if (devDependencies) args.push('--dev')
args.push(...dependencies)
} else {
/**
* Call `npm install [--save|--save-dev] ...`.
*/
args = ['install', '--save-exact']
args.push(devDependencies ? '--save-dev' : '--save')
args.push(...dependencies)
}
} else {
/**
* If there are no dependencies, run a variation of `{displayCommand}
* install`.
*/
args = ['install']
if (useYarn) {
if (!isOnline) {
console.log(chalk.yellow('You appear to be offline.'))
console.log(chalk.yellow('Falling back to the local Yarn cache.'))
console.log()
args.push('--offline')
}
} else {
if (!isOnline) {
console.log(chalk.yellow('You appear to be offline.'))
console.log()
}
}
}
/**
* Add any package manager-specific flags.
*/
if (useYarn) {
args.push(...yarnFlags)
} else {
args.push(...npmFlags)
}
/**
* Spawn the installation process.
*/
const child = spawn(command, args, {
stdio: 'inherit',
env: { ...process.env, ADBLOCK: '1', DISABLE_OPENCOLLECTIVE: '1' },
})
child.on('close', (code) => {
if (code !== 0) {
reject({ command: `${command} ${args.join(' ')}` })
return
}
resolve()
})
})
}
// @ts-ignore internal module
import Runner from 'jscodeshift/src/runner'
export default function runJscodeshift(
transformerPath: string,
flags: { [key: string]: any },
files: string[]
) {
// we run jscodeshift in the same process to be able to
// share state between the main CRA transform and sub-transforms
return Runner.run(transformerPath, files, {
ignorePattern: ['**/node_modules/**', '**/.next/**', '**/build/**'],
extensions: 'tsx,ts,jsx,js',
parser: 'tsx',
verbose: 2,
runInBand: true,
...flags,
})
}
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"chalk": "4.1.0", "chalk": "4.1.0",
"cheerio": "1.0.0-rc.9",
"execa": "4.0.3", "execa": "4.0.3",
"globby": "11.0.1", "globby": "11.0.1",
"inquirer": "7.3.3", "inquirer": "7.3.3",
...@@ -20,5 +21,8 @@ ...@@ -20,5 +21,8 @@
"dev": "yarn tsc -d -w -p tsconfig.json", "dev": "yarn tsc -d -w -p tsconfig.json",
"test": "jest" "test": "jest"
}, },
"bin": "./bin/next-codemod.js" "bin": "./bin/next-codemod.js",
"devDependencies": {
"@types/jscodeshift": "0.11.0"
}
} }
function addReactImport(j, root) { import { API, Collection, FileInfo, JSCodeshift, Options } from 'jscodeshift'
function addReactImport(j: JSCodeshift, root: Collection) {
// We create an import specifier, this is the value of an import, eg: // We create an import specifier, this is the value of an import, eg:
// import React from 'react' // import React from 'react'
// The specifier would be `React` // The specifier would be `React`
...@@ -39,7 +41,11 @@ function addReactImport(j, root) { ...@@ -39,7 +41,11 @@ function addReactImport(j, root) {
}) })
} }
export default function transformer(file, api, options) { export default function transformer(
file: FileInfo,
api: API,
options: Options
) {
const j = api.jscodeshift const j = api.jscodeshift
const root = j(file.source) const root = j(file.source)
......
This diff is collapsed.
import {
API,
ArrowFunctionExpression,
ASTPath,
ExportDefaultDeclaration,
FileInfo,
FunctionDeclaration,
Options,
} from 'jscodeshift'
import { basename, extname } from 'path' import { basename, extname } from 'path'
const camelCase = (value: string): string => { const camelCase = (value: string): string => {
...@@ -10,16 +19,11 @@ const camelCase = (value: string): string => { ...@@ -10,16 +19,11 @@ const camelCase = (value: string): string => {
const isValidIdentifier = (value: string): boolean => const isValidIdentifier = (value: string): boolean =>
/^[a-zA-ZÀ-ÿ][0-9a-zA-ZÀ-ÿ]+$/.test(value) /^[a-zA-ZÀ-ÿ][0-9a-zA-ZÀ-ÿ]+$/.test(value)
type Node = { export default function transformer(
type: string file: FileInfo,
declaration: { api: API,
type: string options: Options
body: any ) {
id?: any
}
}
export default function transformer(file, api, options) {
const j = api.jscodeshift const j = api.jscodeshift
const root = j(file.source) const root = j(file.source)
...@@ -37,8 +41,10 @@ export default function transformer(file, api, options) { ...@@ -37,8 +41,10 @@ export default function transformer(file, api, options) {
return !program || program?.value?.type === 'Program' return !program || program?.value?.type === 'Program'
} }
const nameFunctionComponent = (path): void => { const nameFunctionComponent = (
const node: Node = path.value path: ASTPath<ExportDefaultDeclaration>
): void => {
const node = path.value
if (!node.declaration) { if (!node.declaration) {
return return
...@@ -77,14 +83,17 @@ export default function transformer(file, api, options) { ...@@ -77,14 +83,17 @@ export default function transformer(file, api, options) {
if (isArrowFunction) { if (isArrowFunction) {
path.insertBefore( path.insertBefore(
j.variableDeclaration('const', [ j.variableDeclaration('const', [
j.variableDeclarator(j.identifier(name), node.declaration), j.variableDeclarator(
j.identifier(name),
node.declaration as ArrowFunctionExpression
),
]) ])
) )
node.declaration = j.identifier(name) node.declaration = j.identifier(name)
} else { } else {
// Anonymous Function // Anonymous Function
node.declaration.id = j.identifier(name) ;(node.declaration as FunctionDeclaration).id = j.identifier(name)
} }
} }
......
...@@ -1419,6 +1419,7 @@ export default async function getBaseWebpackConfig( ...@@ -1419,6 +1419,7 @@ export default async function getBaseWebpackConfig(
sassOptions: config.sassOptions, sassOptions: config.sassOptions,
productionBrowserSourceMaps: config.productionBrowserSourceMaps, productionBrowserSourceMaps: config.productionBrowserSourceMaps,
future: config.future, future: config.future,
isCraCompat: config.experimental.craCompat,
}) })
let originalDevtool = webpackConfig.devtool let originalDevtool = webpackConfig.devtool
...@@ -1453,6 +1454,72 @@ export default async function getBaseWebpackConfig( ...@@ -1453,6 +1454,72 @@ export default async function getBaseWebpackConfig(
} }
} }
if (
config.experimental.craCompat &&
webpackConfig.module?.rules &&
webpackConfig.plugins
) {
// CRA prevents loading all locales by default
// https://github.com/facebook/create-react-app/blob/fddce8a9e21bf68f37054586deb0c8636a45f50b/packages/react-scripts/config/webpack.config.js#L721
webpackConfig.plugins.push(
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
)
// CRA allows importing non-webpack handled files with file-loader
// these need to be the last rule to prevent catching other items
// https://github.com/facebook/create-react-app/blob/fddce8a9e21bf68f37054586deb0c8636a45f50b/packages/react-scripts/config/webpack.config.js#L594
const fileLoaderExclude = [/\.(js|mjs|jsx|ts|tsx|json)$/]
const fileLoader = isWebpack5
? {
exclude: fileLoaderExclude,
issuer: fileLoaderExclude,
type: 'asset/resource',
generator: {
publicPath: '/_next/',
filename: 'static/media/[name].[hash:8].[ext]',
},
}
: {
loader: require.resolve('next/dist/compiled/file-loader'),
// Exclude `js` files to keep "css" loader working as it injects
// its runtime that would otherwise be processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: fileLoaderExclude,
issuer: fileLoaderExclude,
options: {
publicPath: '/_next/static/media',
outputPath: 'static/media',
name: '[name].[hash:8].[ext]',
},
}
const topRules = []
const innerRules = []
for (const rule of webpackConfig.module.rules) {
if (rule.resolve) {
topRules.push(rule)
} else {
if (
rule.oneOf &&
!(rule.test || rule.exclude || rule.resource || rule.issuer)
) {
rule.oneOf.forEach((r) => innerRules.push(r))
} else {
innerRules.push(rule)
}
}
}
webpackConfig.module.rules = [
...(topRules as any),
{
oneOf: [...innerRules, fileLoader],
},
]
}
// Backwards compat with webpack-dev-middleware options object // Backwards compat with webpack-dev-middleware options object
if (typeof config.webpackDevMiddleware === 'function') { if (typeof config.webpackDevMiddleware === 'function') {
const options = config.webpackDevMiddleware({ const options = config.webpackDevMiddleware({
......
...@@ -198,10 +198,12 @@ export const css = curry(async function css( ...@@ -198,10 +198,12 @@ export const css = curry(async function css(
include: { and: [/node_modules/] }, include: { and: [/node_modules/] },
// Global CSS is only supported in the user's application, not in // Global CSS is only supported in the user's application, not in
// node_modules. // node_modules.
issuer: { issuer: ctx.isCraCompat
and: [ctx.rootDirectory], ? undefined
not: [/node_modules/], : {
}, and: [ctx.rootDirectory],
not: [/node_modules/],
},
use: getGlobalCssLoader(ctx, postCssPlugins), use: getGlobalCssLoader(ctx, postCssPlugins),
}, },
], ],
...@@ -245,22 +247,24 @@ export const css = curry(async function css( ...@@ -245,22 +247,24 @@ export const css = curry(async function css(
} }
// Throw an error for Global CSS used inside of `node_modules` // Throw an error for Global CSS used inside of `node_modules`
fns.push( if (!ctx.isCraCompat) {
loader({ fns.push(
oneOf: [ loader({
{ oneOf: [
test: [regexCssGlobal, regexSassGlobal], {
issuer: { and: [/node_modules/] }, test: [regexCssGlobal, regexSassGlobal],
use: { issuer: { and: [/node_modules/] },
loader: 'error-loader', use: {
options: { loader: 'error-loader',
reason: getGlobalModuleImportError(), options: {
reason: getGlobalModuleImportError(),
},
}, },
}, },
}, ],
], })
}) )
) }
// Throw an error for Global CSS used outside of our custom <App> file // Throw an error for Global CSS used outside of our custom <App> file
fns.push( fns.push(
......
...@@ -15,6 +15,7 @@ export async function build( ...@@ -15,6 +15,7 @@ export async function build(
sassOptions, sassOptions,
productionBrowserSourceMaps, productionBrowserSourceMaps,
future, future,
isCraCompat,
}: { }: {
rootDirectory: string rootDirectory: string
customAppFile: string | null customAppFile: string | null
...@@ -24,6 +25,7 @@ export async function build( ...@@ -24,6 +25,7 @@ export async function build(
sassOptions: any sassOptions: any
productionBrowserSourceMaps: boolean productionBrowserSourceMaps: boolean
future: NextConfig['future'] future: NextConfig['future']
isCraCompat?: boolean
} }
): Promise<webpack.Configuration> { ): Promise<webpack.Configuration> {
const ctx: ConfigurationContext = { const ctx: ConfigurationContext = {
...@@ -41,6 +43,7 @@ export async function build( ...@@ -41,6 +43,7 @@ export async function build(
sassOptions, sassOptions,
productionBrowserSourceMaps, productionBrowserSourceMaps,
future, future,
isCraCompat,
} }
const fn = pipe(base(ctx), css(ctx)) const fn = pipe(base(ctx), css(ctx))
......
...@@ -17,6 +17,8 @@ export type ConfigurationContext = { ...@@ -17,6 +17,8 @@ export type ConfigurationContext = {
productionBrowserSourceMaps: boolean productionBrowserSourceMaps: boolean
future: NextConfig['future'] future: NextConfig['future']
isCraCompat?: boolean
} }
export type ConfigurationFn = ( export type ConfigurationFn = (
......
...@@ -60,6 +60,7 @@ export type NextConfig = { [key: string]: any } & { ...@@ -60,6 +60,7 @@ export type NextConfig = { [key: string]: any } & {
reactRoot?: boolean reactRoot?: boolean
disableOptimizedLoading?: boolean disableOptimizedLoading?: boolean
gzipSize?: boolean gzipSize?: boolean
craCompat?: boolean
} }
} }
...@@ -114,6 +115,7 @@ export const defaultConfig: NextConfig = { ...@@ -114,6 +115,7 @@ export const defaultConfig: NextConfig = {
reactRoot: Number(process.env.NEXT_PRIVATE_REACT_ROOT) > 0, reactRoot: Number(process.env.NEXT_PRIVATE_REACT_ROOT) > 0,
disableOptimizedLoading: true, disableOptimizedLoading: true,
gzipSize: true, gzipSize: true,
craCompat: false,
}, },
webpack5: webpack5:
Number(process.env.NEXT_PRIVATE_TEST_WEBPACK4_MODE) > 0 ? false : undefined, Number(process.env.NEXT_PRIVATE_TEST_WEBPACK4_MODE) > 0 ? false : undefined,
......
...@@ -3046,6 +3046,14 @@ ...@@ -3046,6 +3046,14 @@
dependencies: dependencies:
"@types/jest-diff" "*" "@types/jest-diff" "*"
"@types/jscodeshift@0.11.0":
version "0.11.0"
resolved "https://registry.yarnpkg.com/@types/jscodeshift/-/jscodeshift-0.11.0.tgz#7224cf1a4d0383b4fb2694ffed52f57b45c3325b"
integrity sha512-OcJgr5GznWCEx2Oeg4eMUZYwssTHFj/tU8grrNCKdFQtAEAa0ezDiPHbCdSkyWrRSurXrYbNbHdhxbbB76pXNg==
dependencies:
ast-types "^0.14.1"
recast "^0.20.3"
"@types/json-schema@*": "@types/json-schema@*":
version "7.0.7" version "7.0.7"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
...@@ -4158,6 +4166,13 @@ ast-types@0.13.2: ...@@ -4158,6 +4166,13 @@ ast-types@0.13.2:
version "0.13.2" version "0.13.2"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.2.tgz#df39b677a911a83f3a049644fb74fdded23cea48" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.2.tgz#df39b677a911a83f3a049644fb74fdded23cea48"
ast-types@0.14.2, ast-types@^0.14.1:
version "0.14.2"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.14.2.tgz#600b882df8583e3cd4f2df5fa20fa83759d4bdfd"
integrity sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA==
dependencies:
tslib "^2.0.1"
astral-regex@^2.0.0: astral-regex@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31"
...@@ -5029,6 +5044,17 @@ check-types@^11.1.1: ...@@ -5029,6 +5044,17 @@ check-types@^11.1.1:
resolved "https://registry.yarnpkg.com/check-types/-/check-types-11.1.2.tgz#86a7c12bf5539f6324eb0e70ca8896c0e38f3e2f" resolved "https://registry.yarnpkg.com/check-types/-/check-types-11.1.2.tgz#86a7c12bf5539f6324eb0e70ca8896c0e38f3e2f"
integrity sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ== integrity sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ==
cheerio-select@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/cheerio-select/-/cheerio-select-1.4.0.tgz#3a16f21e37a2ef0f211d6d1aa4eff054bb22cdc9"
integrity sha512-sobR3Yqz27L553Qa7cK6rtJlMDbiKPdNywtR95Sj/YgfpLfy0u6CGJuaBKe5YE/vTc23SCRKxWSdlon/w6I/Ew==
dependencies:
css-select "^4.1.2"
css-what "^5.0.0"
domelementtype "^2.2.0"
domhandler "^4.2.0"
domutils "^2.6.0"
cheerio@0.22.0: cheerio@0.22.0:
version "0.22.0" version "0.22.0"
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e" resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e"
...@@ -5050,6 +5076,19 @@ cheerio@0.22.0: ...@@ -5050,6 +5076,19 @@ cheerio@0.22.0:
lodash.reject "^4.4.0" lodash.reject "^4.4.0"
lodash.some "^4.4.0" lodash.some "^4.4.0"
cheerio@1.0.0-rc.9:
version "1.0.0-rc.9"
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.9.tgz#a3ae6b7ce7af80675302ff836f628e7cb786a67f"
integrity sha512-QF6XVdrLONO6DXRF5iaolY+odmhj2CLj+xzNod7INPWMi/x9X4SOylH0S/vaPpX+AUU6t04s34SQNh7DbkuCng==
dependencies:
cheerio-select "^1.4.0"
dom-serializer "^1.3.1"
domhandler "^4.2.0"
htmlparser2 "^6.1.0"
parse5 "^6.0.1"
parse5-htmlparser2-tree-adapter "^6.0.1"
tslib "^2.2.0"
child-process-promise@^2.1.3: child-process-promise@^2.1.3:
version "2.2.1" version "2.2.1"
resolved "https://registry.yarnpkg.com/child-process-promise/-/child-process-promise-2.2.1.tgz#4730a11ef610fad450b8f223c79d31d7bdad8074" resolved "https://registry.yarnpkg.com/child-process-promise/-/child-process-promise-2.2.1.tgz#4730a11ef610fad450b8f223c79d31d7bdad8074"
...@@ -5967,6 +6006,17 @@ css-select@^2.0.0: ...@@ -5967,6 +6006,17 @@ css-select@^2.0.0:
domutils "^1.7.0" domutils "^1.7.0"
nth-check "^1.0.2" nth-check "^1.0.2"
css-select@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.1.2.tgz#8b52b6714ed3a80d8221ec971c543f3b12653286"
integrity sha512-nu5ye2Hg/4ISq4XqdLY2bEatAcLIdt3OYGFc9Tm9n7VSlFBcfRv0gBNksHRgSdUDQGtN3XrZ94ztW+NfzkFSUw==
dependencies:
boolbase "^1.0.0"
css-what "^5.0.0"
domhandler "^4.2.0"
domutils "^2.6.0"
nth-check "^2.0.0"
css-select@~1.2.0: css-select@~1.2.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858"
...@@ -6011,6 +6061,11 @@ css-what@^3.2.1: ...@@ -6011,6 +6061,11 @@ css-what@^3.2.1:
version "3.2.1" version "3.2.1"
resolved "https://registry.yarnpkg.com/css-what/-/css-what-3.2.1.tgz#f4a8f12421064621b456755e34a03a2c22df5da1" resolved "https://registry.yarnpkg.com/css-what/-/css-what-3.2.1.tgz#f4a8f12421064621b456755e34a03a2c22df5da1"
css-what@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.0.0.tgz#f0bf4f8bac07582722346ab243f6a35b512cfc47"
integrity sha512-qxyKHQvgKwzwDWC/rGbT821eJalfupxYW2qbSJSAtdSTimsr/MlaGONoNLllaUPZWf8QnbcKM/kPVYUQuEKAFA==
css.escape@1.5.1: css.escape@1.5.1:
version "1.5.1" version "1.5.1"
resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb" resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb"
...@@ -6489,6 +6544,15 @@ dom-serializer@1.1.0, dom-serializer@^1.0.1: ...@@ -6489,6 +6544,15 @@ dom-serializer@1.1.0, dom-serializer@^1.0.1:
domhandler "^3.0.0" domhandler "^3.0.0"
entities "^2.0.0" entities "^2.0.0"
dom-serializer@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.1.tgz#d845a1565d7c041a95e5dab62184ab41e3a519be"
integrity sha512-Pv2ZluG5ife96udGgEDovOOOA5UELkltfJpnIExPrAk1LTvecolUGn6lIaoLh86d83GiB86CjzciMd9BuRB71Q==
dependencies:
domelementtype "^2.0.1"
domhandler "^4.0.0"
entities "^2.0.0"
dom-serializer@~0.1.0: dom-serializer@~0.1.0:
version "0.1.1" version "0.1.1"
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0"
...@@ -6518,6 +6582,11 @@ domelementtype@^2.0.1: ...@@ -6518,6 +6582,11 @@ domelementtype@^2.0.1:
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.0.1.tgz#1f8bdfe91f5a78063274e803b4bdcedf6e94f94d" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.0.1.tgz#1f8bdfe91f5a78063274e803b4bdcedf6e94f94d"
domelementtype@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.2.0.tgz#9a0b6c2782ed6a1c7323d42267183df9bd8b1d57"
integrity sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==
domexception@^2.0.1: domexception@^2.0.1:
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304" resolved "https://registry.yarnpkg.com/domexception/-/domexception-2.0.1.tgz#fb44aefba793e1574b0af6aed2801d057529f304"
...@@ -6537,6 +6606,13 @@ domhandler@^2.3.0: ...@@ -6537,6 +6606,13 @@ domhandler@^2.3.0:
dependencies: dependencies:
domelementtype "1" domelementtype "1"
domhandler@^4.0.0, domhandler@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.2.0.tgz#f9768a5f034be60a89a27c2e4d0f74eba0d8b059"
integrity sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==
dependencies:
domelementtype "^2.2.0"
domutils@1.5.1: domutils@1.5.1:
version "1.5.1" version "1.5.1"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
...@@ -6560,6 +6636,15 @@ domutils@^1.5.1, domutils@^1.7.0: ...@@ -6560,6 +6636,15 @@ domutils@^1.5.1, domutils@^1.7.0:
dom-serializer "0" dom-serializer "0"
domelementtype "1" domelementtype "1"
domutils@^2.5.2, domutils@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.6.0.tgz#2e15c04185d43fb16ae7057cb76433c6edb938b7"
integrity sha512-y0BezHuy4MDYxh6OvolXYsH+1EMGmFbwv5FKW7ovwMG6zTPWqNPq3WF9ayZssFq+UlKdffGLbOEaghNdaOm1WA==
dependencies:
dom-serializer "^1.0.1"
domelementtype "^2.2.0"
domhandler "^4.2.0"
dot-case@^2.1.0: dot-case@^2.1.0:
version "2.1.1" version "2.1.1"
resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-2.1.1.tgz#34dcf37f50a8e93c2b3bca8bb7fb9155c7da3bee" resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-2.1.1.tgz#34dcf37f50a8e93c2b3bca8bb7fb9155c7da3bee"
...@@ -8540,6 +8625,16 @@ htmlparser2@^3.9.1: ...@@ -8540,6 +8625,16 @@ htmlparser2@^3.9.1:
inherits "^2.0.1" inherits "^2.0.1"
readable-stream "^3.1.1" readable-stream "^3.1.1"
htmlparser2@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7"
integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==
dependencies:
domelementtype "^2.0.1"
domhandler "^4.0.0"
domutils "^2.5.2"
entities "^2.0.0"
http-cache-semantics@^4.0.0: http-cache-semantics@^4.0.0:
version "4.0.3" version "4.0.3"
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz#495704773277eeef6e43f9ab2c2c7d259dda25c5" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz#495704773277eeef6e43f9ab2c2c7d259dda25c5"
...@@ -11856,6 +11951,13 @@ nth-check@^1.0.2, nth-check@~1.0.1: ...@@ -11856,6 +11951,13 @@ nth-check@^1.0.2, nth-check@~1.0.1:
dependencies: dependencies:
boolbase "~1.0.0" boolbase "~1.0.0"
nth-check@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.0.0.tgz#1bb4f6dac70072fc313e8c9cd1417b5074c0a125"
integrity sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==
dependencies:
boolbase "^1.0.0"
num2fraction@^1.2.2: num2fraction@^1.2.2:
version "1.2.2" version "1.2.2"
resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede"
...@@ -14036,6 +14138,16 @@ recast@^0.16.1: ...@@ -14036,6 +14138,16 @@ recast@^0.16.1:
private "~0.1.5" private "~0.1.5"
source-map "~0.6.1" source-map "~0.6.1"
recast@^0.20.3:
version "0.20.4"
resolved "https://registry.yarnpkg.com/recast/-/recast-0.20.4.tgz#db55983eac70c46b3fff96c8e467d65ffb4a7abc"
integrity sha512-6qLIBGGRcwjrTZGIiBpJVC/NeuXpogXNyRQpqU1zWPUigCphvApoCs9KIwDYh1eDuJ6dAFlQoi/QUyE5KQ6RBQ==
dependencies:
ast-types "0.14.2"
esprima "~4.0.0"
source-map "~0.6.1"
tslib "^2.0.1"
rechoir@^0.6.2: rechoir@^0.6.2:
version "0.6.2" version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
...@@ -16214,6 +16326,11 @@ tslib@2.0.1: ...@@ -16214,6 +16326,11 @@ tslib@2.0.1:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e"
integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ== integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==
tslib@^2.0.1, tslib@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c"
integrity sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==
tslib@^2.0.3: tslib@^2.0.3:
version "2.0.3" version "2.0.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment