From 77301405398127e5705a4078e2f19803a4334e88 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2019 17:10:11 +0800 Subject: [PATCH 001/194] chore(deps): bump postcss-modules-local-by-default from 1.2.0 to 3.0.2 (#3638) Bumps [postcss-modules-local-by-default](https://github.com/css-modules/postcss-modules-local-by-default) from 1.2.0 to 3.0.2. - [Release notes](https://github.com/css-modules/postcss-modules-local-by-default/releases) - [Changelog](https://github.com/css-modules/postcss-modules-local-by-default/blob/master/CHANGELOG.md) - [Commits](https://github.com/css-modules/postcss-modules-local-by-default/commits/v3.0.2) Signed-off-by: dependabot-preview[bot] --- packages/taro-cli/yarn.lock | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/taro-cli/yarn.lock b/packages/taro-cli/yarn.lock index c76174b9edb2..9a94f4477938 100644 --- a/packages/taro-cli/yarn.lock +++ b/packages/taro-cli/yarn.lock @@ -8348,7 +8348,12 @@ postcss-value-parser@^3.2.3, postcss-value-parser@^3.3.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== -postcss@7.x.x, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.6, postcss@^7.0.7: +postcss-value-parser@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.0.2.tgz#482282c09a42706d1fc9a069b73f44ec08391dc9" + integrity sha512-LmeoohTpp/K4UiyQCwuGWlONxXamGzCMtFxLq4W1nZVGIQLYvMCJx3yAF9qyyuFpflABI9yVdtJAqbihOsCsJQ== + +postcss@7.x.x, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.6, postcss@^7.0.7: version "7.0.24" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.24.tgz#972c3c5be431b32e40caefe6c81b5a19117704c2" integrity sha512-Xl0XvdNWg+CblAXzNvbSOUvgJXwSjmbAKORqyw9V2AlHrm1js2gFw9y3jibBAhpKZi8b5JzJCVh/FyzPsTtgTA== From ac039e8d5e6bc350cd9ab4cf3d41709b8584954e Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 12 Dec 2019 21:59:51 +0800 Subject: [PATCH 002/194] =?UTF-8?q?fix(components):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=20Image=20=E7=BB=84=E4=BB=B6=E5=9C=A8=20react=20=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-components/src/components/image/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/taro-components/src/components/image/index.js b/packages/taro-components/src/components/image/index.js index 18dc247af194..d4b90cd15121 100644 --- a/packages/taro-components/src/components/image/index.js +++ b/packages/taro-components/src/components/image/index.js @@ -22,6 +22,7 @@ class Image extends Nerv.Component { // 异步 api 关系 if (entries[entries.length - 1].isIntersecting) { this.setState({ isLoaded: true }, () => { + this.observer.unobserve(this.imgRef) Nerv.findDOMNode(this).children[0].src = this.props.src }) } From 1d172699cad628cd6f4a201cf7574110f6aa1301 Mon Sep 17 00:00:00 2001 From: Lostsory <34388618+Lostsory@users.noreply.github.com> Date: Fri, 13 Dec 2019 13:13:26 +0800 Subject: [PATCH 003/194] =?UTF-8?q?fix(components):=20h5=20image=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E5=85=B3=E4=BB=A3=E7=A0=81=20(#4998?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * h5 image在unmount时取消IntersectionObserver监听 * 删除无用代码 --- packages/taro-components/src/components/image/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/taro-components/src/components/image/index.js b/packages/taro-components/src/components/image/index.js index d4b90cd15121..18dc247af194 100644 --- a/packages/taro-components/src/components/image/index.js +++ b/packages/taro-components/src/components/image/index.js @@ -22,7 +22,6 @@ class Image extends Nerv.Component { // 异步 api 关系 if (entries[entries.length - 1].isIntersecting) { this.setState({ isLoaded: true }, () => { - this.observer.unobserve(this.imgRef) Nerv.findDOMNode(this).children[0].src = this.props.src }) } From b0ec706fcbecedf65a2767876475a4671bea4a3f Mon Sep 17 00:00:00 2001 From: ZakaryCode Date: Sun, 15 Dec 2019 21:28:12 +0800 Subject: [PATCH 004/194] feat: checkout from auto-docs --- scripts/docs-api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/docs-api.ts b/scripts/docs-api.ts index affae4ae4caa..61961e600845 100644 --- a/scripts/docs-api.ts +++ b/scripts/docs-api.ts @@ -55,7 +55,7 @@ export default function docsAPI ( if (diff) { const canges = spawn('git', ['status', '-z']) - + canges.stdout.on('data', (data) => { const ss = data.toString().trim().split(/\u0000|\s+/ig) ss.forEach(s => { @@ -443,4 +443,4 @@ function isFunction (flags?: ts.SymbolFlags) { function isOptional (flags?: ts.SymbolFlags) { return SymbolFlags.includes((flags || -1) - ts.SymbolFlags.Optional) -} \ No newline at end of file +} From 338650a7838e586af69054e98a9f413c52819380 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 13 May 2019 20:47:09 +0800 Subject: [PATCH 005/194] =?UTF-8?q?feat(cli):=20=E5=B0=9D=E8=AF=95?= =?UTF-8?q?=E6=8E=A5=E5=85=A5=20webpack=20=E6=9D=A5=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E5=90=84=E7=AB=AF=E5=B0=8F=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/mini/webpack.ts | 40 + packages/taro-mini-runner/index.js | 2 + packages/taro-mini-runner/jest.config.js | 4 + packages/taro-mini-runner/package.json | 53 + packages/taro-mini-runner/src/index.ts | 28 + .../src/plugins/miniPlugin.ts | 60 + .../taro-mini-runner/src/utils/logHelper.ts | 165 + packages/taro-mini-runner/src/utils/types.ts | 72 + packages/taro-mini-runner/tsconfig.json | 29 + packages/taro-mini-runner/tslint.json | 31 + packages/taro-mini-runner/yarn.lock | 4535 +++++++++++++++++ 11 files changed, 5019 insertions(+) create mode 100644 packages/taro-cli/src/mini/webpack.ts create mode 100644 packages/taro-mini-runner/index.js create mode 100644 packages/taro-mini-runner/jest.config.js create mode 100644 packages/taro-mini-runner/package.json create mode 100644 packages/taro-mini-runner/src/index.ts create mode 100644 packages/taro-mini-runner/src/plugins/miniPlugin.ts create mode 100644 packages/taro-mini-runner/src/utils/logHelper.ts create mode 100644 packages/taro-mini-runner/src/utils/types.ts create mode 100644 packages/taro-mini-runner/tsconfig.json create mode 100644 packages/taro-mini-runner/tslint.json create mode 100644 packages/taro-mini-runner/yarn.lock diff --git a/packages/taro-cli/src/mini/webpack.ts b/packages/taro-cli/src/mini/webpack.ts new file mode 100644 index 000000000000..9b6e45dbab7e --- /dev/null +++ b/packages/taro-cli/src/mini/webpack.ts @@ -0,0 +1,40 @@ +import * as fs from 'fs-extra' +import * as path from 'path' + +import { IMiniAppBuildConfig } from '../util/types' +import { BUILD_TYPES } from '../util/constants' +import * as npmProcess from '../util/npm' + +import { + setBuildData, + setIsProduction, + getBuildData +} from './helper' + +export async function build (appPath: string, { watch, adapter = BUILD_TYPES.WEAPP, envHasBeenSet = false, port, release }: IMiniAppBuildConfig) { + const buildData = setBuildData(appPath, adapter) + const isQuickApp = adapter === BUILD_TYPES.QUICKAPP + process.env.TARO_ENV = adapter + if (!envHasBeenSet) { + setIsProduction(process.env.NODE_ENV === 'production' || !watch) + } + fs.ensureDirSync(buildData.outputDir) + + await buildWithWebpack({ + appPath + }) + +} + +async function buildWithWebpack ({ appPath }: { appPath: string }) { + const { entryFilePath, outputDir, sourceDir } = getBuildData() + console.log(entryFilePath, outputDir) + const miniRunner = await npmProcess.getNpmPkg('@tarojs/mini-runner', appPath) + const miniRunnerOpts = { + entry: { + app: entryFilePath + }, + outputDir + } + miniRunner(miniRunnerOpts) +} diff --git a/packages/taro-mini-runner/index.js b/packages/taro-mini-runner/index.js new file mode 100644 index 000000000000..437a6d4788f4 --- /dev/null +++ b/packages/taro-mini-runner/index.js @@ -0,0 +1,2 @@ +module.exports = require('./dist/index.js').default +module.exports.default = module.exports diff --git a/packages/taro-mini-runner/jest.config.js b/packages/taro-mini-runner/jest.config.js new file mode 100644 index 000000000000..758fa1330e87 --- /dev/null +++ b/packages/taro-mini-runner/jest.config.js @@ -0,0 +1,4 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node' +} diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json new file mode 100644 index 000000000000..ad8c5b5a9d5a --- /dev/null +++ b/packages/taro-mini-runner/package.json @@ -0,0 +1,53 @@ +{ + "name": "@tarojs/mini-runner", + "version": "1.3.0-beta.2", + "description": "Mini app runner for taro", + "main": "index.js", + "scripts": { + "build": "run-s clean prod", + "dev": "tsc -w", + "prod": "tsc", + "clean": "rimraf dist", + "lint": "tslint src/**/*.ts --fix", + "lint:typecheck": "tslint -p tsconfig.json src/**/*.ts --fix", + "prepack": "npm run build", + "test": "jest", + "test:dev": "jest --watch" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/NervJS/taro.git" + }, + "files": [ + "index.js", + "dist" + ], + "keywords": [ + "taro" + ], + "author": "luckyadam", + "license": "MIT", + "bugs": { + "url": "https://github.com/NervJS/taro/issues" + }, + "homepage": "https://github.com/NervJS/taro#readme", + "devDependencies": { + "@types/node": "^12.0.0", + "jest": "^24.8.0", + "npm-run-all": "^4.1.5", + "ts-jest": "^24.0.2", + "typescript": "^3.4.5" + }, + "dependencies": { + "@types/lodash": "^4.14.126", + "@types/webpack": "^4.4.31", + "babel-core": "^6.26.3", + "babel-loader": "^8.0.6", + "chalk": "^2.4.2", + "lodash": "^4.17.11", + "ora": "^3.4.0", + "webpack": "^4.31.0", + "webpack-chain": "^6.0.0", + "webpack-format-messages": "^2.0.5" + } +} diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts new file mode 100644 index 000000000000..cc5dcf44a4d3 --- /dev/null +++ b/packages/taro-mini-runner/src/index.ts @@ -0,0 +1,28 @@ +import * as webpack from 'webpack' + +import { IBuildConfig } from './utils/types' +import { printBuildError, bindProdLogger } from './utils/logHelper' +import MiniPlugin from './plugins/miniPlugin' + +export default function build (config: IBuildConfig) { + const webpackConfig = { + entry: config.entry, + output: { + filename: '[name].js', + publicPath: '/', + path: config.outputDir, + }, + plugins: [ + new MiniPlugin() + ] + } + + const compiler = webpack(webpackConfig) + bindProdLogger(compiler) + + compiler.run((err) => { + if (err) { + printBuildError(err) + } + }) +} diff --git a/packages/taro-mini-runner/src/plugins/miniPlugin.ts b/packages/taro-mini-runner/src/plugins/miniPlugin.ts new file mode 100644 index 000000000000..5d5faa62fbed --- /dev/null +++ b/packages/taro-mini-runner/src/plugins/miniPlugin.ts @@ -0,0 +1,60 @@ +import * as path from 'path' + +import * as webpack from 'webpack' +import { defaults } from 'lodash' + +interface IMiniPluginOptions { + appEntry?: string +} + +export default class MiniPlugin { + options: IMiniPluginOptions + appEntry: string + + constructor (options = {}) { + this.options = defaults(options || {}, { + + }) + } + + try = handler => async (arg, callback) => { + try { + await handler(arg) + callback() + } catch (err) { + callback(err) + } + } + + apply (compiler: webpack.Compiler) { + compiler.hooks.run.tapAsync( + 'MiniPlugin run', + this.try(async (compiler: webpack.Compiler) => { + await this.run(compiler) + }) + ) + } + + getAppEntry (compiler) { + if (this.options.appEntry) { + return this.options.appEntry + } + const { entry } = compiler.options + function getEntryPath (entry) { + if (Array.isArray(entry)) { + return entry.map(item => getEntryPath[item]).find(item => item) + } + if (typeof entry === 'object') { + return entry['app'] + } + return entry + } + const appEntryPath = getEntryPath(entry) + return appEntryPath + } + + run (compiler) { + this.appEntry = this.getAppEntry(compiler) + console.log(this.appEntry) + } +} diff --git a/packages/taro-mini-runner/src/utils/logHelper.ts b/packages/taro-mini-runner/src/utils/logHelper.ts new file mode 100644 index 000000000000..7bc978a10b4a --- /dev/null +++ b/packages/taro-mini-runner/src/utils/logHelper.ts @@ -0,0 +1,165 @@ +import chalk from 'chalk'; +import * as ora from 'ora'; +import { partial, pipe } from 'lodash/fp'; +import * as formatMessages from 'webpack-format-messages'; + +// const syntaxErrorLabel = 'Syntax error:'; + +const getServeSpinner = (() => { + let spinner + return () => { + if (!spinner) spinner = ora(`Starting development server, please wait~`) + return spinner + } +})() + +const printCompiling = () => { + getServeSpinner().text = 'Compiling...' + getServeSpinner().start() +} + +const printBuildError = (err: Error): void => { + const message = err.message + const stack = err.stack + if (stack && message.indexOf('from UglifyJs') !== -1) { + try { + const matched = /(.+)\[(.+):(.+),(.+)\]\[.+\]/.exec(stack) + if (!matched) { + throw new Error('Using errors for control flow is bad.') + } + const problemPath = matched[2] + const line = matched[3] + const column = matched[4] + console.log('Failed to minify the code from this file: \n\n', chalk.yellow(`\t${problemPath}:${line}${column !== '0' ? ':' + column : ''}`), '\n') + } catch (ignored) { + console.log('Failed to minify the bundle.', err) + } + } else { + console.log((message || err) + '\n') + } + console.log() +} + +const printSuccess = () => { + getServeSpinner().stopAndPersist({ + symbol: '✅ ', + text: chalk.green('Compiled successfully!\n') + }) +} + +const printWarning = () => { + getServeSpinner().stopAndPersist({ + symbol: '⚠️ ', + text: chalk.yellow('Compiled with warnings.\n') + }) +} + +const printFailed = () => { + getServeSpinner().stopAndPersist({ + symbol: '🙅 ', + text: chalk.red('Failed to compile.\n') + }) +} + +const printWhenBeforeCompile = compiler => { + compiler.hooks.beforeCompile.tap('taroBeforeCompile', filepath => { + printCompiling() + }) + return compiler +} + +const printWhenInvalid = compiler => { + compiler.hooks.invalid.tap('taroInvalid', filepath => { + printCompiling() + }) + return compiler +} + +const printWhenFailed = compiler => { + compiler.hooks.failed.tap('taroFailed', error => { + printBuildError(error) + }) + return compiler +} + +let isFirst = true +const printWhenFirstDone = (devUrl, compiler) => { + compiler.hooks.done.tap('taroDone', stats => { + if (isFirst) { + isFirst = false + getServeSpinner().clear() + console.log() + console.log(chalk.cyan(`ℹ️ Listening at ${devUrl}`)) + console.log(chalk.gray('\n监听文件修改中...\n')) + } + }) + return compiler +} + +const _printWhenDone = ({ + verbose = false +}, compiler) => { + compiler.hooks.done.tap('taroDone', stats => { + const { errors, warnings } = formatMessages(stats) + + if (!stats.hasErrors() && !stats.hasWarnings()) { + printSuccess() + } + + if (stats.hasErrors()) { + printFailed() + errors.forEach(e => console.log(e + '\n')); + verbose && process.exit(1) + return; + } + + if (stats.hasWarnings()) { + printWarning() + warnings.forEach(w => console.log(w + '\n')); + } + + verbose && console.log(stats.toString({ + colors: true, + modules: false, + children: false, + chunks: false, + chunkModules: false, + warnings: verbose + }) + '\n') + }) + return compiler +} + +const printWhenDone = partial(_printWhenDone, [{ verbose: false }]) + +const printWhenDoneVerbosely = partial(_printWhenDone, [{ verbose: true }]) + +const bindDevLogger = (devUrl, compiler) => { + console.log() + pipe( + printWhenBeforeCompile, + partial(printWhenFirstDone, [devUrl]), + printWhenDone, + printWhenFailed, + printWhenInvalid + )(compiler) + return compiler +} + +const bindProdLogger = (compiler) => { + console.log() + pipe( + printWhenBeforeCompile, + printWhenDoneVerbosely, + printWhenFailed + )(compiler) + return compiler +} + +export { + printBuildError, + printCompiling, + getServeSpinner, + bindDevLogger, + bindProdLogger +} diff --git a/packages/taro-mini-runner/src/utils/types.ts b/packages/taro-mini-runner/src/utils/types.ts new file mode 100644 index 000000000000..33690d4db507 --- /dev/null +++ b/packages/taro-mini-runner/src/utils/types.ts @@ -0,0 +1,72 @@ +import * as webpack from 'webpack' + +type FunctionLikeCustomWebpackConfig = (webpackConfig: webpack.Configuration, webpack) => webpack.Configuration + +export type CustomWebpackConfig = FunctionLikeCustomWebpackConfig | webpack.Configuration +export interface IOption { + [key: string]: any +} + +type TogglableOptions = { + enable?: boolean + config?: T +} + +export namespace PostcssOption { + export type cssModules = TogglableOptions<{ + namingPattern: 'global' | string + generateScopedName: string | ((localName: string, absoluteFilePath: string) => string) + }> +} + +export interface IPostcssOption { + autoprefixer?: TogglableOptions + pxtransform?: TogglableOptions + cssModules?: PostcssOption.cssModules +} + + +export interface IChain { + [key: string]: any +} + +export interface ITaroMiniConfig { + entry: webpack.Entry + output: webpack.Output +} + +export interface ITaroPlugins { + babel: IOption + csso?: TogglableOptions + uglify?: TogglableOptions +} + +export interface ICopyOptions { + patterns: { + from: string + to: string + ignore: string[] + }[] + options: { + ignore: string[] + } +} + +export interface ITaroBaseConfig { + outputDir: string + staticDirectory: string + chunkDirectory: string + copy: ICopyOptions + + designWidth: number + deviceRatio?: number + + defineConstants?: IOption + env?: IOption + + plugins: ITaroPlugins +} + +export interface IBuildConfig extends ITaroBaseConfig, ITaroMiniConfig { + isWatch: boolean +} diff --git a/packages/taro-mini-runner/tsconfig.json b/packages/taro-mini-runner/tsconfig.json new file mode 100644 index 000000000000..522fe3c86d15 --- /dev/null +++ b/packages/taro-mini-runner/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "allowJs": true, + "baseUrl": ".", + "experimentalDecorators": true, + "lib": ["esnext", "dom"], + "module": "commonjs", + "moduleResolution": "node", + "noImplicitAny": false, + "noUnusedLocals": true, + "outDir": "dist/", + "preserveConstEnums": true, + "removeComments": false, + "rootDir": "./src", + "skipLibCheck": true, + "sourceMap": false, + "strictNullChecks": true, + "target": "es2015", + "traceResolution": false, + "types": ["jest"] + }, + "include": [ + "./src" + ], + "exclude": [ + "./src/__tests__" + ] +} diff --git a/packages/taro-mini-runner/tslint.json b/packages/taro-mini-runner/tslint.json new file mode 100644 index 000000000000..fa1c9fc90ffb --- /dev/null +++ b/packages/taro-mini-runner/tslint.json @@ -0,0 +1,31 @@ +{ + "extends": [ + "tslint-config-standard", + "tslint-config-prettier" + ], + "defaultSeverity": "error", + "rules": { + "ban-types": false, + "forin": false, + "interface-name": false, + "member-access": false, + "no-bitwise": false, + "no-conditional-assignment": false, + "no-console": false, + "no-empty": false, + "no-object-literal-type-assertion": false, + "no-string-literal": false, + "no-var-keyword": true, + "object-literal-key-quotes": [ false, "as-needed" ], + "object-literal-sort-keys": false, + "one-variable-per-declaration": false, + "ordered-imports": false, + "prefer-for-of": false, + "quotemark": [ true, "single", "avoid-escape", "jsx-double" ], + "semicolon": [ false, "never" ], + "space-before-function-paren": false, + "trailing-comma": [ true, { "multiline": "never", "singleline": "never" } ], + "variable-name": [ true, "allow-leading-underscore", "ban-keywords" ], + "prefer-const": true + } +} diff --git a/packages/taro-mini-runner/yarn.lock b/packages/taro-mini-runner/yarn.lock new file mode 100644 index 000000000000..6e926bf55aee --- /dev/null +++ b/packages/taro-mini-runner/yarn.lock @@ -0,0 +1,4535 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/core@^7.1.0": + version "7.4.4" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.4.4.tgz#84055750b05fcd50f9915a826b44fa347a825250" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helpers" "^7.4.4" + "@babel/parser" "^7.4.4" + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.11" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@^7.4.0", "@babel/generator@^7.4.4": + version "7.4.4" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" + dependencies: + "@babel/types" "^7.4.4" + jsesc "^2.5.1" + lodash "^4.17.11" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-plugin-utils@^7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" + +"@babel/helper-split-export-declaration@^7.4.4": + version "7.4.4" + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" + dependencies: + "@babel/types" "^7.4.4" + +"@babel/helpers@^7.4.4": + version "7.4.4" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5" + dependencies: + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4": + version "7.4.4" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz#5977129431b8fe33471730d255ce8654ae1250b6" + +"@babel/plugin-syntax-object-rest-spread@^7.0.0": + version "7.2.0" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": + version "7.4.4" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4": + version "7.4.4" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz#0776f038f6d78361860b6823887d4f3937133fe8" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.11" + +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4": + version "7.4.4" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" + dependencies: + esutils "^2.0.2" + lodash "^4.17.11" + to-fast-properties "^2.0.0" + +"@cnakazawa/watch@^1.0.3": + version "1.0.3" + resolved "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + +"@jest/console@^24.7.1": + version "24.7.1" + resolved "https://registry.npmjs.org/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" + dependencies: + "@jest/source-map" "^24.3.0" + chalk "^2.0.1" + slash "^2.0.0" + +"@jest/core@^24.8.0": + version "24.8.0" + resolved "https://registry.npmjs.org/@jest/core/-/core-24.8.0.tgz#fbbdcd42a41d0d39cddbc9f520c8bab0c33eed5b" + dependencies: + "@jest/console" "^24.7.1" + "@jest/reporters" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-changed-files "^24.8.0" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve-dependencies "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + jest-watcher "^24.8.0" + micromatch "^3.1.10" + p-each-series "^1.0.0" + pirates "^4.0.1" + realpath-native "^1.1.0" + rimraf "^2.5.4" + strip-ansi "^5.0.0" + +"@jest/environment@^24.8.0": + version "24.8.0" + resolved "https://registry.npmjs.org/@jest/environment/-/environment-24.8.0.tgz#0342261383c776bdd652168f68065ef144af0eac" + dependencies: + "@jest/fake-timers" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + +"@jest/fake-timers@^24.8.0": + version "24.8.0" + resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.8.0.tgz#2e5b80a4f78f284bcb4bd5714b8e10dd36a8d3d1" + dependencies: + "@jest/types" "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" + +"@jest/reporters@^24.8.0": + version "24.8.0" + resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-24.8.0.tgz#075169cd029bddec54b8f2c0fc489fd0b9e05729" + dependencies: + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + istanbul-lib-coverage "^2.0.2" + istanbul-lib-instrument "^3.0.1" + istanbul-lib-report "^2.0.4" + istanbul-lib-source-maps "^3.0.1" + istanbul-reports "^2.1.1" + jest-haste-map "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + node-notifier "^5.2.1" + slash "^2.0.0" + source-map "^0.6.0" + string-length "^2.0.0" + +"@jest/source-map@^24.3.0": + version "24.3.0" + resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28" + dependencies: + callsites "^3.0.0" + graceful-fs "^4.1.15" + source-map "^0.6.0" + +"@jest/test-result@^24.8.0": + version "24.8.0" + resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-24.8.0.tgz#7675d0aaf9d2484caa65e048d9b467d160f8e9d3" + dependencies: + "@jest/console" "^24.7.1" + "@jest/types" "^24.8.0" + "@types/istanbul-lib-coverage" "^2.0.0" + +"@jest/test-sequencer@^24.8.0": + version "24.8.0" + resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz#2f993bcf6ef5eb4e65e8233a95a3320248cf994b" + dependencies: + "@jest/test-result" "^24.8.0" + jest-haste-map "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" + +"@jest/transform@^24.8.0": + version "24.8.0" + resolved "https://registry.npmjs.org/@jest/transform/-/transform-24.8.0.tgz#628fb99dce4f9d254c6fd9341e3eea262e06fef5" + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^24.8.0" + babel-plugin-istanbul "^5.1.0" + chalk "^2.0.1" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.15" + jest-haste-map "^24.8.0" + jest-regex-util "^24.3.0" + jest-util "^24.8.0" + micromatch "^3.1.10" + realpath-native "^1.1.0" + slash "^2.0.0" + source-map "^0.6.1" + write-file-atomic "2.4.1" + +"@jest/types@^24.8.0": + version "24.8.0" + resolved "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad" + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^12.0.9" + +"@types/anymatch@*": + version "1.3.1" + resolved "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" + +"@types/babel__core@^7.1.0": + version "7.1.1" + resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.1.tgz#ce9a9e5d92b7031421e1d0d74ae59f572ba48be6" + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.0.2" + resolved "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.0.2" + resolved "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.0.6" + resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2" + dependencies: + "@babel/types" "^7.3.0" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.1" + resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" + +"@types/istanbul-lib-report@*": + version "1.1.1" + resolved "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c" + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^1.1.1": + version "1.1.1" + resolved "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a" + dependencies: + "@types/istanbul-lib-coverage" "*" + "@types/istanbul-lib-report" "*" + +"@types/lodash@^4.14.126": + version "4.14.126" + resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.126.tgz#47cff3ea014aa083194f8ca3ec351136c3786613" + +"@types/node@*", "@types/node@^12.0.0": + version "12.0.0" + resolved "https://registry.npmjs.org/@types/node/-/node-12.0.0.tgz#d11813b9c0ff8aaca29f04cbc12817f4c7d656e5" + +"@types/stack-utils@^1.0.1": + version "1.0.1" + resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" + +"@types/tapable@*": + version "1.0.4" + resolved "https://registry.npmjs.org/@types/tapable/-/tapable-1.0.4.tgz#b4ffc7dc97b498c969b360a41eee247f82616370" + +"@types/uglify-js@*": + version "3.0.4" + resolved "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.0.4.tgz#96beae23df6f561862a830b4288a49e86baac082" + dependencies: + source-map "^0.6.1" + +"@types/webpack@^4.4.31": + version "4.4.31" + resolved "https://registry.npmjs.org/@types/webpack/-/webpack-4.4.31.tgz#f59b9d8210cf4d2fd254fe6d1f5ba86e557867f5" + dependencies: + "@types/anymatch" "*" + "@types/node" "*" + "@types/tapable" "*" + "@types/uglify-js" "*" + source-map "^0.6.0" + +"@types/yargs@^12.0.2", "@types/yargs@^12.0.9": + version "12.0.12" + resolved "https://registry.npmjs.org/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" + +"@webassemblyjs/ast@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" + dependencies: + "@webassemblyjs/helper-module-context" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/wast-parser" "1.8.5" + +"@webassemblyjs/floating-point-hex-parser@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz#1ba926a2923613edce496fd5b02e8ce8a5f49721" + +"@webassemblyjs/helper-api-error@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz#c49dad22f645227c5edb610bdb9697f1aab721f7" + +"@webassemblyjs/helper-buffer@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz#fea93e429863dd5e4338555f42292385a653f204" + +"@webassemblyjs/helper-code-frame@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz#9a740ff48e3faa3022b1dff54423df9aa293c25e" + dependencies: + "@webassemblyjs/wast-printer" "1.8.5" + +"@webassemblyjs/helper-fsm@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz#ba0b7d3b3f7e4733da6059c9332275d860702452" + +"@webassemblyjs/helper-module-context@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz#def4b9927b0101dc8cbbd8d1edb5b7b9c82eb245" + dependencies: + "@webassemblyjs/ast" "1.8.5" + mamacro "^0.0.3" + +"@webassemblyjs/helper-wasm-bytecode@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz#537a750eddf5c1e932f3744206551c91c1b93e61" + +"@webassemblyjs/helper-wasm-section@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz#74ca6a6bcbe19e50a3b6b462847e69503e6bfcbf" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + +"@webassemblyjs/ieee754@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz#712329dbef240f36bf57bd2f7b8fb9bf4154421e" + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.8.5.tgz#044edeb34ea679f3e04cd4fd9824d5e35767ae10" + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.8.5.tgz#a8bf3b5d8ffe986c7c1e373ccbdc2a0915f0cedc" + +"@webassemblyjs/wasm-edit@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz#962da12aa5acc1c131c81c4232991c82ce56e01a" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/helper-wasm-section" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + "@webassemblyjs/wasm-opt" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + "@webassemblyjs/wast-printer" "1.8.5" + +"@webassemblyjs/wasm-gen@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz#54840766c2c1002eb64ed1abe720aded714f98bc" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/ieee754" "1.8.5" + "@webassemblyjs/leb128" "1.8.5" + "@webassemblyjs/utf8" "1.8.5" + +"@webassemblyjs/wasm-opt@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz#b24d9f6ba50394af1349f510afa8ffcb8a63d264" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + +"@webassemblyjs/wasm-parser@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz#21576f0ec88b91427357b8536383668ef7c66b8d" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-api-error" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/ieee754" "1.8.5" + "@webassemblyjs/leb128" "1.8.5" + "@webassemblyjs/utf8" "1.8.5" + +"@webassemblyjs/wast-parser@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz#e10eecd542d0e7bd394f6827c49f3df6d4eefb8c" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/floating-point-hex-parser" "1.8.5" + "@webassemblyjs/helper-api-error" "1.8.5" + "@webassemblyjs/helper-code-frame" "1.8.5" + "@webassemblyjs/helper-fsm" "1.8.5" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/wast-printer@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz#114bbc481fd10ca0e23b3560fa812748b0bae5bc" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/wast-parser" "1.8.5" + "@xtuc/long" "4.2.2" + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + +abbrev@1: + version "1.1.1" + resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + +acorn-dynamic-import@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" + +acorn-globals@^4.1.0: + version "4.3.2" + resolved "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.2.tgz#4e2c2313a597fd589720395f6354b41cd5ec8006" + dependencies: + acorn "^6.0.1" + acorn-walk "^6.0.1" + +acorn-walk@^6.0.1: + version "6.1.1" + resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" + +acorn@^5.5.3: + version "5.7.3" + resolved "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + +acorn@^6.0.1, acorn@^6.0.5: + version "6.1.1" + resolved "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + +ajv-errors@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" + +ajv-keywords@^3.1.0: + version "3.4.0" + resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.0.tgz#4b831e7b531415a7cc518cd404e73f6193c6349d" + +ajv@^6.1.0, ajv@^6.5.5: + version "6.10.0" + resolved "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^3.0.0: + version "3.2.0" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-regex@^4.0.0, ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +aproba@^1.0.3, aproba@^1.1.1: + version "1.2.0" + resolved "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + +array-filter@~0.0.0: + version "0.0.1" + resolved "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" + +array-map@~0.0.0: + version "0.0.0" + resolved "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" + +array-reduce@~0.0.0: + version "0.0.0" + resolved "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + +asn1.js@^4.0.0: + version "4.10.1" + resolved "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert@^1.1.1: + version "1.5.0" + resolved "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" + dependencies: + object-assign "^4.1.1" + util "0.10.3" + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + +async-each@^1.0.1: + version "1.0.3" + resolved "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@^6.26.0, babel-core@^6.26.3: + version "6.26.3" + resolved "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-jest@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-24.8.0.tgz#5c15ff2b28e20b0f45df43fe6b7f2aae93dba589" + dependencies: + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/babel__core" "^7.1.0" + babel-plugin-istanbul "^5.1.0" + babel-preset-jest "^24.6.0" + chalk "^2.4.2" + slash "^2.0.0" + +babel-loader@^8.0.6: + version "8.0.6" + resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.6.tgz#e33bdb6f362b03f4bb141a0c21ab87c501b70dfb" + dependencies: + find-cache-dir "^2.0.0" + loader-utils "^1.0.2" + mkdirp "^0.5.1" + pify "^4.0.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-istanbul@^5.1.0: + version "5.1.4" + resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" + dependencies: + find-up "^3.0.0" + istanbul-lib-instrument "^3.3.0" + test-exclude "^5.2.3" + +babel-plugin-jest-hoist@^24.6.0: + version "24.6.0" + resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz#f7f7f7ad150ee96d7a5e8e2c5da8319579e78019" + dependencies: + "@types/babel__traverse" "^7.0.6" + +babel-preset-jest@^24.6.0: + version "24.6.0" + resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz#66f06136eefce87797539c0d63f1769cc3915984" + dependencies: + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + babel-plugin-jest-hoist "^24.6.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +base64-js@^1.0.2: + version "1.3.0" + resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.npmjs.org/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + dependencies: + tweetnacl "^0.14.3" + +big.js@^5.2.2: + version "5.2.2" + resolved "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + +binary-extensions@^1.0.0: + version "1.13.1" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + +bluebird@^3.5.3: + version "3.5.4" + resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz#d6cc661595de30d5b3af5fcedd3c0b3ef6ec5714" + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: + version "4.11.8" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1, braces@^2.3.2: + version "2.3.2" + resolved "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + +browser-process-hrtime@^0.1.2: + version "0.1.3" + resolved "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" + +browser-resolve@^1.11.3: + version "1.11.3" + resolved "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + dependencies: + resolve "1.1.7" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.2.0" + resolved "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.4" + resolved "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + +browserify-zlib@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + dependencies: + pako "~1.0.5" + +bs-logger@0.x: + version "0.2.6" + resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" + dependencies: + fast-json-stable-stringify "2.x" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + +buffer-from@1.x, buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + +buffer@^4.3.0: + version "4.9.1" + resolved "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + +cacache@^11.0.2: + version "11.3.2" + resolved "https://registry.npmjs.org/cacache/-/cacache-11.3.2.tgz#2d81e308e3d258ca38125b676b98b2ac9ce69bfa" + dependencies: + bluebird "^3.5.3" + chownr "^1.1.1" + figgy-pudding "^3.5.1" + glob "^7.1.3" + graceful-fs "^4.1.15" + lru-cache "^5.1.1" + mississippi "^3.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.2" + ssri "^6.0.1" + unique-filename "^1.1.1" + y18n "^4.0.0" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + dependencies: + rsvp "^4.8.4" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chokidar@^2.0.2: + version "2.1.5" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz#0ae8434d962281a5f56c72869e79cb6d9d86ad4d" + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.1" + optionalDependencies: + fsevents "^1.2.7" + +chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + +chrome-trace-event@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz#45a91bd2c20c9411f0963b5aaeb9a1b95e09cc48" + dependencies: + tslib "^1.9.0" + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + dependencies: + restore-cursor "^2.0.0" + +cli-spinners@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.1.0.tgz#22c34b4d51f573240885b201efda4e4ec9fff3c7" + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + dependencies: + delayed-stream "~1.0.0" + +commander@^2.19.0, commander@~2.20.0: + version "2.20.0" + resolved "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.5.0: + version "1.6.2" + resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + dependencies: + date-now "^0.1.4" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +constants-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + +convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.1: + version "1.6.0" + resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + dependencies: + safe-buffer "~5.1.1" + +copy-concurrently@^1.0.0: + version "1.0.5" + resolved "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" + dependencies: + aproba "^1.1.1" + fs-write-stream-atomic "^1.0.8" + iferr "^0.1.5" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.0" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + +core-js@^2.4.0, core-js@^2.5.0: + version "2.6.5" + resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +create-ecdh@^4.0.0: + version "4.0.3" + resolved "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.2.0" + resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: + version "1.1.7" + resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-spawn@^6.0.0, cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +crypto-browserify@^3.11.0: + version "3.12.0" + resolved "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.6" + resolved "https://registry.npmjs.org/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad" + +cssstyle@^1.0.0: + version "1.2.2" + resolved "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.2.tgz#427ea4d585b18624f6fdbf9de7a2a1a3ba713077" + dependencies: + cssom "0.3.x" + +cyclist@~0.2.2: + version "0.2.2" + resolved "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +data-urls@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +debug@^4.1.0, debug@^4.1.1: + version "4.1.1" + resolved "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + dependencies: + ms "^2.1.1" + +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +deepmerge@^1.5.2: + version "1.5.2" + resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-1.5.2.tgz#10499d868844cdad4fee0842df8c7f6f0c95a753" + +defaults@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + dependencies: + clone "^1.0.2" + +define-properties@^1.1.2: + version "1.1.3" + resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + dependencies: + object-keys "^1.0.12" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + +diff-sequences@^24.3.0: + version "24.3.0" + resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975" + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +domain-browser@^1.1.1: + version "1.2.0" + resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + dependencies: + webidl-conversions "^4.0.2" + +duplexify@^3.4.2, duplexify@^3.6.0: + version "3.7.1" + resolved "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +elliptic@^6.0.0: + version "6.4.1" + resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +emojis-list@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.1" + resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + dependencies: + once "^1.4.0" + +enhanced-resolve@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.4.0" + tapable "^1.0.0" + +errno@^0.1.3, errno@~0.1.7: + version "0.1.7" + resolved "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + dependencies: + prr "~1.0.1" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.4.3, es-abstract@^1.5.1: + version "1.13.0" + resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-keys "^1.0.12" + +es-to-primitive@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escodegen@^1.9.1: + version "1.11.1" + resolved "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510" + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +eslint-scope@^4.0.0: + version "4.0.3" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + dependencies: + estraverse "^4.1.0" + +estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +events@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +exec-sh@^0.3.2: + version "0.3.2" + resolved "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expect@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/expect/-/expect-24.8.0.tgz#471f8ec256b7b6129ca2524b2a62f030df38718d" + dependencies: + "@jest/types" "^24.8.0" + ansi-styles "^3.2.0" + jest-get-type "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-regex-util "^24.3.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + +fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + +figgy-pudding@^3.5.1: + version "3.5.1" + resolved "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +find-cache-dir@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" + dependencies: + commondir "^1.0.1" + make-dir "^2.0.0" + pkg-dir "^3.0.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + dependencies: + locate-path "^3.0.0" + +flush-write-stream@^1.0.0: + version "1.1.1" + resolved "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" + dependencies: + inherits "^2.0.3" + readable-stream "^2.3.6" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + dependencies: + map-cache "^0.2.2" + +from2@^2.1.0: + version "2.3.0" + resolved "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.0" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + dependencies: + minipass "^2.2.1" + +fs-write-stream-atomic@^1.0.8: + version "1.0.10" + resolved "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" + dependencies: + graceful-fs "^4.1.2" + iferr "^0.1.5" + imurmurhash "^0.1.4" + readable-stream "1 || 2" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.2.7: + version "1.2.9" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" + dependencies: + nan "^2.12.1" + node-pre-gyp "^0.12.0" + +function-bind@^1.0.2, function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + dependencies: + pump "^3.0.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: + version "7.1.4" + resolved "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2: + version "4.1.15" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + +handlebars@^4.1.2: + version "4.1.2" + resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + dependencies: + neo-async "^2.6.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.1, has@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + dependencies: + function-bind "^1.1.1" + +hash-base@^3.0.0: + version "3.0.4" + resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + dependencies: + whatwg-encoding "^1.0.1" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + +iconv-lite@0.4.24, iconv-lite@^0.4.4: + version "0.4.24" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ieee754@^1.1.4: + version "1.1.13" + resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" + +iferr@^0.1.5: + version "0.1.5" + resolved "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" + +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + dependencies: + minimatch "^3.0.4" + +import-local@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" + dependencies: + pkg-dir "^3.0.0" + resolve-cwd "^2.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + +invariant@^2.2.2, invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + dependencies: + kind-of "^6.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-callable@^1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + dependencies: + ci-info "^2.0.0" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + dependencies: + is-extglob "^2.1.1" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + dependencies: + isobject "^3.0.1" + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + dependencies: + has-symbols "^1.0.0" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: + version "2.0.5" + resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" + +istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: + version "3.3.0" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" + dependencies: + "@babel/generator" "^7.4.0" + "@babel/parser" "^7.4.3" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.3" + "@babel/types" "^7.4.0" + istanbul-lib-coverage "^2.0.5" + semver "^6.0.0" + +istanbul-lib-report@^2.0.4: + version "2.0.8" + resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" + dependencies: + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + supports-color "^6.1.0" + +istanbul-lib-source-maps@^3.0.1: + version "3.0.6" + resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + rimraf "^2.6.3" + source-map "^0.6.1" + +istanbul-reports@^2.1.1: + version "2.2.4" + resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.4.tgz#4e0d0ddf0f0ad5b49a314069d31b4f06afe49ad3" + dependencies: + handlebars "^4.1.2" + +javascript-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.0.0.tgz#ef750216ae66504ffd670b68c8b8aa07bdf7b588" + +jest-changed-files@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.8.0.tgz#7e7eb21cf687587a85e50f3d249d1327e15b157b" + dependencies: + "@jest/types" "^24.8.0" + execa "^1.0.0" + throat "^4.0.0" + +jest-cli@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-24.8.0.tgz#b075ac914492ed114fa338ade7362a301693e989" + dependencies: + "@jest/core" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + exit "^0.1.2" + import-local "^2.0.0" + is-ci "^2.0.0" + jest-config "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + prompts "^2.0.1" + realpath-native "^1.1.0" + yargs "^12.0.2" + +jest-config@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-config/-/jest-config-24.8.0.tgz#77db3d265a6f726294687cbbccc36f8a76ee0f4f" + dependencies: + "@babel/core" "^7.1.0" + "@jest/test-sequencer" "^24.8.0" + "@jest/types" "^24.8.0" + babel-jest "^24.8.0" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^24.8.0" + jest-environment-node "^24.8.0" + jest-get-type "^24.8.0" + jest-jasmine2 "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + micromatch "^3.1.10" + pretty-format "^24.8.0" + realpath-native "^1.1.0" + +jest-diff@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172" + dependencies: + chalk "^2.0.1" + diff-sequences "^24.3.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" + +jest-docblock@^24.3.0: + version "24.3.0" + resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd" + dependencies: + detect-newline "^2.1.0" + +jest-each@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-each/-/jest-each-24.8.0.tgz#a05fd2bf94ddc0b1da66c6d13ec2457f35e52775" + dependencies: + "@jest/types" "^24.8.0" + chalk "^2.0.1" + jest-get-type "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" + +jest-environment-jsdom@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz#300f6949a146cabe1c9357ad9e9ecf9f43f38857" + dependencies: + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" + jsdom "^11.5.1" + +jest-environment-node@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.8.0.tgz#d3f726ba8bc53087a60e7a84ca08883a4c892231" + dependencies: + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" + +jest-get-type@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc" + +jest-haste-map@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.8.0.tgz#51794182d877b3ddfd6e6d23920e3fe72f305800" + dependencies: + "@jest/types" "^24.8.0" + anymatch "^2.0.0" + fb-watchman "^2.0.0" + graceful-fs "^4.1.15" + invariant "^2.2.4" + jest-serializer "^24.4.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + micromatch "^3.1.10" + sane "^4.0.3" + walker "^1.0.7" + optionalDependencies: + fsevents "^1.2.7" + +jest-jasmine2@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz#a9c7e14c83dd77d8b15e820549ce8987cc8cd898" + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + co "^4.6.0" + expect "^24.8.0" + is-generator-fn "^2.0.0" + jest-each "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" + throat "^4.0.0" + +jest-leak-detector@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980" + dependencies: + pretty-format "^24.8.0" + +jest-matcher-utils@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz#2bce42204c9af12bde46f83dc839efe8be832495" + dependencies: + chalk "^2.0.1" + jest-diff "^24.8.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" + +jest-message-util@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.8.0.tgz#0d6891e72a4beacc0292b638685df42e28d6218b" + dependencies: + "@babel/code-frame" "^7.0.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/stack-utils" "^1.0.1" + chalk "^2.0.1" + micromatch "^3.1.10" + slash "^2.0.0" + stack-utils "^1.0.1" + +jest-mock@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-24.8.0.tgz#2f9d14d37699e863f1febf4e4d5a33b7fdbbde56" + dependencies: + "@jest/types" "^24.8.0" + +jest-pnp-resolver@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" + +jest-regex-util@^24.3.0: + version "24.3.0" + resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" + +jest-resolve-dependencies@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz#19eec3241f2045d3f990dba331d0d7526acff8e0" + dependencies: + "@jest/types" "^24.8.0" + jest-regex-util "^24.3.0" + jest-snapshot "^24.8.0" + +jest-resolve@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.8.0.tgz#84b8e5408c1f6a11539793e2b5feb1b6e722439f" + dependencies: + "@jest/types" "^24.8.0" + browser-resolve "^1.11.3" + chalk "^2.0.1" + jest-pnp-resolver "^1.2.1" + realpath-native "^1.1.0" + +jest-runner@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-24.8.0.tgz#4f9ae07b767db27b740d7deffad0cf67ccb4c5bb" + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.4.2" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-config "^24.8.0" + jest-docblock "^24.3.0" + jest-haste-map "^24.8.0" + jest-jasmine2 "^24.8.0" + jest-leak-detector "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + source-map-support "^0.5.6" + throat "^4.0.0" + +jest-runtime@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.8.0.tgz#05f94d5b05c21f6dc54e427cd2e4980923350620" + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.8.0" + "@jest/source-map" "^24.3.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/yargs" "^12.0.2" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.1.15" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + realpath-native "^1.1.0" + slash "^2.0.0" + strip-bom "^3.0.0" + yargs "^12.0.2" + +jest-serializer@^24.4.0: + version "24.4.0" + resolved "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" + +jest-snapshot@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.8.0.tgz#3bec6a59da2ff7bc7d097a853fb67f9d415cb7c6" + dependencies: + "@babel/types" "^7.0.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + expect "^24.8.0" + jest-diff "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^24.8.0" + semver "^5.5.0" + +jest-util@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-util/-/jest-util-24.8.0.tgz#41f0e945da11df44cc76d64ffb915d0716f46cd1" + dependencies: + "@jest/console" "^24.7.1" + "@jest/fake-timers" "^24.8.0" + "@jest/source-map" "^24.3.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + callsites "^3.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.15" + is-ci "^2.0.0" + mkdirp "^0.5.1" + slash "^2.0.0" + source-map "^0.6.0" + +jest-validate@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849" + dependencies: + "@jest/types" "^24.8.0" + camelcase "^5.0.0" + chalk "^2.0.1" + jest-get-type "^24.8.0" + leven "^2.1.0" + pretty-format "^24.8.0" + +jest-watcher@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.8.0.tgz#58d49915ceddd2de85e238f6213cef1c93715de4" + dependencies: + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/yargs" "^12.0.9" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + jest-util "^24.8.0" + string-length "^2.0.0" + +jest-worker@^24.6.0: + version "24.6.0" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3" + dependencies: + merge-stream "^1.0.1" + supports-color "^6.1.0" + +jest@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/jest/-/jest-24.8.0.tgz#d5dff1984d0d1002196e9b7f12f75af1b2809081" + dependencies: + import-local "^2.0.0" + jest-cli "^24.8.0" + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jsdom@^11.5.1: + version "11.12.0" + resolved "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + dependencies: + abab "^2.0.0" + acorn "^5.5.3" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" + html-encoding-sniffer "^1.0.2" + left-pad "^1.3.0" + nwsapi "^2.0.7" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.87.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.4" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" + xml-name-validator "^3.0.0" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + +json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +json5@2.x, json5@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" + dependencies: + minimist "^1.2.0" + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + dependencies: + minimist "^1.2.0" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + +kleur@^3.0.0, kleur@^3.0.2: + version "3.0.3" + resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + dependencies: + invert-kv "^2.0.0" + +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +loader-runner@^2.3.0: + version "2.4.0" + resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" + +loader-utils@^1.0.2, loader-utils@^1.1.0: + version "1.2.3" + resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" + dependencies: + big.js "^5.2.2" + emojis-list "^2.0.0" + json5 "^1.0.1" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + +lodash@^4.17.11, lodash@^4.17.4: + version "4.17.11" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + +log-symbols@^2.2.0: + version "2.2.0" + resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + dependencies: + chalk "^2.0.1" + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + dependencies: + yallist "^3.0.2" + +make-dir@^2.0.0, make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + dependencies: + pify "^4.0.1" + semver "^5.6.0" + +make-error@1.x: + version "1.3.5" + resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + +mamacro@^0.0.3: + version "0.0.3" + resolved "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4" + +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + dependencies: + p-defer "^1.0.0" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + dependencies: + object-visit "^1.0.0" + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +mem@^4.0.0: + version "4.3.0" + resolved "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" + +memory-fs@^0.4.0, memory-fs@~0.4.1: + version "0.4.1" + resolved "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + dependencies: + readable-stream "^2.0.1" + +micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: + version "3.1.10" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +mime-db@1.40.0: + version "1.40.0" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.24" + resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" + dependencies: + mime-db "1.40.0" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + +mimic-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.1.1, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + +minipass@^2.2.1, minipass@^2.3.4: + version "2.3.5" + resolved "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.1: + version "1.2.1" + resolved "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + dependencies: + minipass "^2.2.1" + +mississippi@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^3.0.0" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: + version "0.5.1" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +move-concurrently@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" + dependencies: + aproba "^1.1.1" + copy-concurrently "^1.0.0" + fs-write-stream-atomic "^1.0.8" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.3" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + +nan@^2.12.1: + version "2.13.2" + resolved "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +needle@^2.2.1: + version "2.3.1" + resolved "https://registry.npmjs.org/needle/-/needle-2.3.1.tgz#d272f2f4034afb9c4c9ab1379aabc17fc85c9388" + dependencies: + debug "^4.1.0" + iconv-lite "^0.4.4" + sax "^1.2.4" + +neo-async@^2.5.0, neo-async@^2.6.0: + version "2.6.1" + resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +node-libs-browser@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.0.tgz#c72f60d9d46de08a940dedbb25f3ffa2f9bbaa77" + dependencies: + assert "^1.1.1" + browserify-zlib "^0.2.0" + buffer "^4.3.0" + console-browserify "^1.1.0" + constants-browserify "^1.0.0" + crypto-browserify "^3.11.0" + domain-browser "^1.1.1" + events "^3.0.0" + https-browserify "^1.0.0" + os-browserify "^0.3.0" + path-browserify "0.0.0" + process "^0.11.10" + punycode "^1.2.4" + querystring-es3 "^0.2.0" + readable-stream "^2.3.3" + stream-browserify "^2.0.1" + stream-http "^2.7.2" + string_decoder "^1.0.0" + timers-browserify "^2.0.4" + tty-browserify "0.0.0" + url "^0.11.0" + util "^0.11.0" + vm-browserify "0.0.4" + +node-modules-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + +node-notifier@^5.2.1: + version "5.4.0" + resolved "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a" + dependencies: + growly "^1.3.0" + is-wsl "^1.1.0" + semver "^5.5.0" + shellwords "^0.1.1" + which "^1.3.0" + +node-pre-gyp@^0.12.0: + version "0.12.0" + resolved "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + +npm-bundled@^1.0.1: + version "1.0.6" + resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" + +npm-packlist@^1.1.6: + version "1.4.1" + resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-run-all@^4.1.5: + version "4.1.5" + resolved "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz#04476202a15ee0e2e214080861bff12a51d98fba" + dependencies: + ansi-styles "^3.2.1" + chalk "^2.4.1" + cross-spawn "^6.0.5" + memorystream "^0.3.1" + minimatch "^3.0.4" + pidtree "^0.3.0" + read-pkg "^3.0.0" + shell-quote "^1.6.1" + string.prototype.padend "^3.0.0" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +nwsapi@^2.0.7: + version "2.1.4" + resolved "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz#e006a878db23636f8e8a67d33ca0e4edf61a842f" + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + +object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-keys@^1.0.12: + version "1.1.1" + resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + dependencies: + isobject "^3.0.0" + +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + dependencies: + isobject "^3.0.1" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1: + version "0.8.2" + resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +ora@^3.4.0: + version "3.4.0" + resolved "https://registry.npmjs.org/ora/-/ora-3.4.0.tgz#bf0752491059a3ef3ed4c85097531de9fdbcd318" + dependencies: + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-spinners "^2.0.0" + log-symbols "^2.2.0" + strip-ansi "^5.2.0" + wcwidth "^1.0.1" + +os-browserify@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + dependencies: + execa "^1.0.0" + lcid "^2.0.0" + mem "^4.0.0" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + +p-each-series@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" + dependencies: + p-reduce "^1.0.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + +p-limit@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" + dependencies: + p-try "^2.0.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + dependencies: + p-limit "^2.0.0" + +p-reduce@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + +pako@~1.0.5: + version "1.0.10" + resolved "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732" + +parallel-transform@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" + dependencies: + cyclist "~0.2.2" + inherits "^2.0.3" + readable-stream "^2.1.5" + +parse-asn1@^5.0.0: + version "5.1.4" + resolved "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + safe-buffer "^5.1.1" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + +path-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + dependencies: + pify "^3.0.0" + +pbkdf2@^3.0.3: + version "3.0.17" + resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + +pidtree@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/pidtree/-/pidtree-0.3.0.tgz#f6fada10fccc9f99bf50e90d0b23d72c9ebc2e6b" + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + +pirates@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" + dependencies: + node-modules-regexp "^1.0.0" + +pkg-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + dependencies: + find-up "^3.0.0" + +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +pretty-format@^24.8.0: + version "24.8.0" + resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2" + dependencies: + "@jest/types" "^24.8.0" + ansi-regex "^4.0.0" + ansi-styles "^3.2.0" + react-is "^16.8.4" + +private@^0.1.8: + version "0.1.8" + resolved "https://registry.npmjs.org/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + +promise-inflight@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + +prompts@^2.0.1: + version "2.0.4" + resolved "https://registry.npmjs.org/prompts/-/prompts-2.0.4.tgz#179f9d4db3128b9933aa35f93a800d8fce76a682" + dependencies: + kleur "^3.0.2" + sisteransi "^1.0.0" + +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + +psl@^1.1.24, psl@^1.1.28: + version "1.1.31" + resolved "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + +public-encrypt@^4.0.0: + version "4.0.3" + resolved "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + safe-buffer "^5.1.2" + +pump@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pumpify@^1.3.3: + version "1.5.1" + resolved "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" + dependencies: + duplexify "^3.6.0" + inherits "^2.0.3" + pump "^2.0.0" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + +punycode@^1.2.4, punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +punycode@^2.1.0, punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + +querystring-es3@^0.2.0: + version "0.2.1" + resolved "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: + version "2.1.0" + resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +react-is@^16.8.4: + version "16.8.6" + resolved "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + +read-pkg-up@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + dependencies: + find-up "^3.0.0" + read-pkg "^3.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: + version "2.3.6" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readdirp@^2.2.1: + version "2.2.1" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +realpath-native@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" + dependencies: + util.promisify "^1.0.0" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +request-promise-core@1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346" + dependencies: + lodash "^4.17.11" + +request-promise-native@^1.0.5: + version "1.0.7" + resolved "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59" + dependencies: + request-promise-core "1.1.2" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" + +request@^2.87.0: + version "2.88.0" + resolved "https://registry.npmjs.org/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + dependencies: + resolve-from "^3.0.0" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@1.x, resolve@^1.10.0, resolve@^1.3.2: + version "1.10.1" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz#664842ac960795bbe758221cdccda61fb64b5f18" + dependencies: + path-parse "^1.0.6" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + +rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: + version "2.6.3" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rsvp@^4.8.4: + version "4.8.4" + resolved "https://registry.npmjs.org/rsvp/-/rsvp-4.8.4.tgz#b50e6b34583f3dd89329a2f23a8a2be072845911" + +run-queue@^1.0.0, run-queue@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" + dependencies: + aproba "^1.1.1" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + +sane@^4.0.3: + version "4.1.0" + resolved "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + dependencies: + "@cnakazawa/watch" "^1.0.3" + anymatch "^2.0.0" + capture-exit "^2.0.0" + exec-sh "^0.3.2" + execa "^1.0.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + +schema-utils@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" + dependencies: + ajv "^6.1.0" + ajv-errors "^1.0.0" + ajv-keywords "^3.1.0" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.6.0: + version "5.7.0" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + +semver@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65" + +serialize-javascript@^1.4.0: + version "1.7.0" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65" + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setimmediate@^1.0.4: + version "1.0.5" + resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +shell-quote@^1.6.1: + version "1.6.1" + resolved "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" + dependencies: + array-filter "~0.0.0" + array-map "~0.0.0" + array-reduce "~0.0.0" + jsonify "~0.0.0" + +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +sisteransi@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +source-list-map@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map-support@^0.5.6, source-map-support@~0.5.10: + version "0.5.12" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + +source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.4" + resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + dependencies: + extend-shallow "^3.0.0" + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +ssri@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" + dependencies: + figgy-pudding "^3.5.1" + +stack-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +stealthy-require@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + +stream-browserify@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-each@^1.1.0: + version "1.2.3" + resolved "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" + dependencies: + end-of-stream "^1.1.0" + stream-shift "^1.0.0" + +stream-http@^2.7.2: + version "2.8.3" + resolved "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.3.6" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string.prototype.padend@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.4.3" + function-bind "^1.0.2" + +string_decoder@^1.0.0: + version "1.2.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + dependencies: + safe-buffer "~5.1.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + dependencies: + ansi-regex "^4.1.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + dependencies: + has-flag "^3.0.0" + +supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + dependencies: + has-flag "^3.0.0" + +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + +tapable@^1.0.0, tapable@^1.1.0: + version "1.1.3" + resolved "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" + +tar@^4: + version "4.4.8" + resolved "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.3.4" + minizlib "^1.1.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +terser-webpack-plugin@^1.1.0: + version "1.2.3" + resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.2.3.tgz#3f98bc902fac3e5d0de730869f50668561262ec8" + dependencies: + cacache "^11.0.2" + find-cache-dir "^2.0.0" + schema-utils "^1.0.0" + serialize-javascript "^1.4.0" + source-map "^0.6.1" + terser "^3.16.1" + webpack-sources "^1.1.0" + worker-farm "^1.5.2" + +terser@^3.16.1: + version "3.17.0" + resolved "https://registry.npmjs.org/terser/-/terser-3.17.0.tgz#f88ffbeda0deb5637f9d24b0da66f4e15ab10cb2" + dependencies: + commander "^2.19.0" + source-map "~0.6.1" + source-map-support "~0.5.10" + +test-exclude@^5.2.3: + version "5.2.3" + resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" + dependencies: + glob "^7.1.3" + minimatch "^3.0.4" + read-pkg-up "^4.0.0" + require-main-filename "^2.0.0" + +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + +through2@^2.0.0: + version "2.0.5" + resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +timers-browserify@^2.0.4: + version "2.0.10" + resolved "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" + dependencies: + setimmediate "^1.0.4" + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@^2.3.3, tough-cookie@^2.3.4: + version "2.5.0" + resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + dependencies: + punycode "^2.1.0" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +ts-jest@^24.0.2: + version "24.0.2" + resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.2.tgz#8dde6cece97c31c03e80e474c749753ffd27194d" + dependencies: + bs-logger "0.x" + buffer-from "1.x" + fast-json-stable-stringify "2.x" + json5 "2.x" + make-error "1.x" + mkdirp "0.x" + resolve "1.x" + semver "^5.5" + yargs-parser "10.x" + +tslib@^1.9.0: + version "1.9.3" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + +tty-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +typescript@^3.4.5: + version "3.4.5" + resolved "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99" + +uglify-js@^3.1.4: + version "3.5.12" + resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.12.tgz#6b759cabc08c3e91fe82323d6387019f0c5864cd" + dependencies: + commander "~2.20.0" + source-map "~0.6.1" + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unique-filename@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" + dependencies: + unique-slug "^2.0.0" + +unique-slug@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.1.tgz#5e9edc6d1ce8fb264db18a507ef9bd8544451ca6" + dependencies: + imurmurhash "^0.1.4" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +upath@^1.1.1: + version "1.1.2" + resolved "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz#3db658600edaeeccbe6db5e684d67ee8c2acd068" + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + +url@^0.11.0: + version "0.11.0" + resolved "https://registry.npmjs.org/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.npmjs.org/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +util.promisify@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + +util@0.10.3: + version "0.10.3" + resolved "https://registry.npmjs.org/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + dependencies: + inherits "2.0.1" + +util@^0.11.0: + version "0.11.1" + resolved "https://registry.npmjs.org/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" + dependencies: + inherits "2.0.3" + +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +vm-browserify@0.0.4: + version "0.0.4" + resolved "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" + dependencies: + indexof "0.0.1" + +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + dependencies: + browser-process-hrtime "^0.1.2" + +walker@^1.0.7, walker@~1.0.5: + version "1.0.7" + resolved "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watchpack@^1.5.0: + version "1.6.0" + resolved "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" + dependencies: + chokidar "^2.0.2" + graceful-fs "^4.1.2" + neo-async "^2.5.0" + +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + dependencies: + defaults "^1.0.3" + +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + +webpack-chain@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/webpack-chain/-/webpack-chain-6.0.0.tgz#9c36525a1271a54e7bfd1791199b395f400ae4f1" + dependencies: + deepmerge "^1.5.2" + javascript-stringify "^2.0.0" + +webpack-format-messages@^2.0.5: + version "2.0.5" + resolved "https://registry.npmjs.org/webpack-format-messages/-/webpack-format-messages-2.0.5.tgz#399d0e3b774892ec03a51f09ff5e00e8a25aef18" + dependencies: + kleur "^3.0.0" + +webpack-sources@^1.1.0, webpack-sources@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" + dependencies: + source-list-map "^2.0.0" + source-map "~0.6.1" + +webpack@^4.31.0: + version "4.31.0" + resolved "https://registry.npmjs.org/webpack/-/webpack-4.31.0.tgz#ae201d45f0571336e42d1c2b5c8ab56c4d3b0c63" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-module-context" "1.8.5" + "@webassemblyjs/wasm-edit" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + acorn "^6.0.5" + acorn-dynamic-import "^4.0.0" + ajv "^6.1.0" + ajv-keywords "^3.1.0" + chrome-trace-event "^1.0.0" + enhanced-resolve "^4.1.0" + eslint-scope "^4.0.0" + json-parse-better-errors "^1.0.2" + loader-runner "^2.3.0" + loader-utils "^1.1.0" + memory-fs "~0.4.1" + micromatch "^3.1.8" + mkdirp "~0.5.0" + neo-async "^2.5.0" + node-libs-browser "^2.0.0" + schema-utils "^1.0.0" + tapable "^1.1.0" + terser-webpack-plugin "^1.1.0" + watchpack "^1.5.0" + webpack-sources "^1.3.0" + +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: + version "1.0.5" + resolved "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + dependencies: + iconv-lite "0.4.24" + +whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: + version "2.3.0" + resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +whatwg-url@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@^1.2.9, which@^1.3.0: + version "1.3.1" + resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + dependencies: + string-width "^1.0.2 || 2" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +worker-farm@^1.5.2: + version "1.7.0" + resolved "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" + dependencies: + errno "~0.1.7" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write-file-atomic@2.4.1: + version "2.4.1" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + dependencies: + async-limiter "~1.0.0" + +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + +xtend@^4.0.0, xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +"y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.3" + resolved "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + +yargs-parser@10.x: + version "10.1.0" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" + dependencies: + camelcase "^4.1.0" + +yargs-parser@^11.1.1: + version "11.1.1" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@^12.0.2: + version "12.0.5" + resolved "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + dependencies: + cliui "^4.0.0" + decamelize "^1.2.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^3.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^11.1.1" From e5a9fcab6d45a7761e9a0434120983b8e65ca351 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 15 May 2019 22:27:57 +0800 Subject: [PATCH 006/194] =?UTF-8?q?feat(cli):=20=E6=8B=86=E5=88=86?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=88=B0=20loader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/mini/webpack.ts | 11 +- packages/taro-mini-runner/package.json | 30 +- packages/taro-mini-runner/src/index.ts | 28 +- .../src/loaders/fileParseLoader.ts | 9 + .../src/loaders/wxTransformerLoader.ts | 19 + .../src/plugins/miniPlugin.ts | 138 ++- .../taro-mini-runner/src/utils/constants.ts | 86 ++ packages/taro-mini-runner/src/utils/index.ts | 73 ++ packages/taro-mini-runner/src/utils/types.ts | 4 +- packages/taro-mini-runner/yarn.lock | 812 +++++++++++++++++- 10 files changed, 1151 insertions(+), 59 deletions(-) create mode 100644 packages/taro-mini-runner/src/loaders/fileParseLoader.ts create mode 100644 packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts create mode 100644 packages/taro-mini-runner/src/utils/constants.ts create mode 100644 packages/taro-mini-runner/src/utils/index.ts diff --git a/packages/taro-cli/src/mini/webpack.ts b/packages/taro-cli/src/mini/webpack.ts index 9b6e45dbab7e..7f2366f1df54 100644 --- a/packages/taro-cli/src/mini/webpack.ts +++ b/packages/taro-cli/src/mini/webpack.ts @@ -4,6 +4,7 @@ import * as path from 'path' import { IMiniAppBuildConfig } from '../util/types' import { BUILD_TYPES } from '../util/constants' import * as npmProcess from '../util/npm' +import { getBabelConfig } from '../util' import { setBuildData, @@ -27,14 +28,20 @@ export async function build (appPath: string, { watch, adapter = BUILD_TYPES.WEA } async function buildWithWebpack ({ appPath }: { appPath: string }) { - const { entryFilePath, outputDir, sourceDir } = getBuildData() + const { entryFilePath, outputDir, sourceDir, buildAdapter, projectConfig, isProduction } = getBuildData() console.log(entryFilePath, outputDir) const miniRunner = await npmProcess.getNpmPkg('@tarojs/mini-runner', appPath) + const babelConfig = getBabelConfig(projectConfig!.plugins!.babel) const miniRunnerOpts = { entry: { app: entryFilePath }, - outputDir + outputDir, + buildAdapter, + plugins: { + babel: babelConfig + }, + isWatch: !isProduction } miniRunner(miniRunnerOpts) } diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index ad8c5b5a9d5a..1ea2a4650d7f 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -31,23 +31,35 @@ "url": "https://github.com/NervJS/taro/issues" }, "homepage": "https://github.com/NervJS/taro#readme", - "devDependencies": { - "@types/node": "^12.0.0", - "jest": "^24.8.0", - "npm-run-all": "^4.1.5", - "ts-jest": "^24.0.2", - "typescript": "^3.4.5" - }, "dependencies": { - "@types/lodash": "^4.14.126", - "@types/webpack": "^4.4.31", + "@tarojs/taro": "1.3.0-beta.2", + "@tarojs/transformer-wx": "1.3.0-beta.2", "babel-core": "^6.26.3", + "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", "chalk": "^2.4.2", + "fs-extra": "^8.0.1", + "loader-utils": "^1.2.3", "lodash": "^4.17.11", "ora": "^3.4.0", "webpack": "^4.31.0", "webpack-chain": "^6.0.0", "webpack-format-messages": "^2.0.5" + }, + "devDependencies": { + "@types/babel-core": "^6.25.6", + "@types/babel-generator": "^6.25.3", + "@types/babel-traverse": "^6.25.5", + "@types/babel-types": "^7.0.7", + "@types/loader-utils": "^1.1.3", + "@types/lodash": "^4.14.126", + "@types/node": "^12.0.0", + "@types/webpack": "^4.4.31", + "jest": "^24.8.0", + "npm-run-all": "^4.1.5", + "ts-jest": "^24.0.2", + "typescript": "^3.4.5" } } diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index cc5dcf44a4d3..10db81ebb290 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -1,3 +1,4 @@ +import * as path from 'path' import * as webpack from 'webpack' import { IBuildConfig } from './utils/types' @@ -5,15 +6,40 @@ import { printBuildError, bindProdLogger } from './utils/logHelper' import MiniPlugin from './plugins/miniPlugin' export default function build (config: IBuildConfig) { + const compilePlugins = config.plugins + const { babel } = compilePlugins const webpackConfig = { + mode: config.isWatch ? 'development' : 'production', entry: config.entry, output: { filename: '[name].js', publicPath: '/', path: config.outputDir, }, + module: { + rules: [ + { + test: /\.(tsx?|jsx?)$/, + include: /src/, + exclude: /node_modules/, + use: [{ + loader: path.resolve(__dirname, './loaders/fileParseLoader'), + options: { + babel + } + }, { + loader: path.resolve(__dirname, './loaders/wxTransformerLoader'), + options: { + buildAdapter: config.buildAdapter + } + }] + } + ] + }, plugins: [ - new MiniPlugin() + new MiniPlugin({ + buildAdapter: config.buildAdapter + }) ] } diff --git a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts new file mode 100644 index 000000000000..eba1b6996290 --- /dev/null +++ b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts @@ -0,0 +1,9 @@ +import { getOptions } from 'loader-utils' +import { transform } from 'babel-core' + +export default function fileParseLoader (source, ast) { + const options = getOptions(this) + const babelConfig = options.babel + const res = transform(source, babelConfig) + return res.code +} diff --git a/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts b/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts new file mode 100644 index 000000000000..493c03537973 --- /dev/null +++ b/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts @@ -0,0 +1,19 @@ +import { getOptions } from 'loader-utils' +import * as wxTransformer from '@tarojs/transformer-wx' + +import { REG_TYPESCRIPT } from '../utils/constants' + +export default function wxTransformerLoader (source) { + const options = getOptions(this) + const filePath = this.resourcePath + const { buildAdapter } = options + const transformResult = wxTransformer({ + code: source, + sourcePath: filePath, + isTyped: REG_TYPESCRIPT.test(filePath), + adapter: buildAdapter + }) + this.callback(null, transformResult.code, transformResult.ast) + console.log('wxTransformerLoader') + return transformResult.code +} diff --git a/packages/taro-mini-runner/src/plugins/miniPlugin.ts b/packages/taro-mini-runner/src/plugins/miniPlugin.ts index 5d5faa62fbed..ce4d329b3ed8 100644 --- a/packages/taro-mini-runner/src/plugins/miniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/miniPlugin.ts @@ -1,25 +1,42 @@ import * as path from 'path' +import * as fs from 'fs-extra' +import * as wxTransformer from '@tarojs/transformer-wx' import * as webpack from 'webpack' import { defaults } from 'lodash' +import * as t from 'babel-types' +import traverse from 'babel-traverse' +import { Config as IConfig } from '@tarojs/taro' + +import { REG_TYPESCRIPT, BUILD_TYPES } from '../utils/constants' +import { traverseObjectNode, resolveScriptPath } from '../utils' interface IMiniPluginOptions { - appEntry?: string + appEntry?: string, + buildAdapter: BUILD_TYPES } +const PLUGIN_NAME = 'MiniPlugin' + export default class MiniPlugin { options: IMiniPluginOptions appEntry: string + pages: Set + components: Set + sourceDir: string constructor (options = {}) { this.options = defaults(options || {}, { - + buildAdapter: BUILD_TYPES.WEAPP }) + + this.pages = new Set() + this.components = new Set() } - try = handler => async (arg, callback) => { + tryAsync = fn => async (arg, callback) => { try { - await handler(arg) + await fn(arg) callback() } catch (err) { callback(err) @@ -28,8 +45,8 @@ export default class MiniPlugin { apply (compiler: webpack.Compiler) { compiler.hooks.run.tapAsync( - 'MiniPlugin run', - this.try(async (compiler: webpack.Compiler) => { + PLUGIN_NAME, + this.tryAsync(async (compiler: webpack.Compiler) => { await this.run(compiler) }) ) @@ -50,11 +67,116 @@ export default class MiniPlugin { return entry } const appEntryPath = getEntryPath(entry) + this.sourceDir = path.dirname(appEntryPath) return appEntryPath } - run (compiler) { + parseAst ( + ast: t.File, + buildAdapter: BUILD_TYPES + ): { + configObj: IConfig + } { + let configObj = {} + traverse(ast, { + ClassDeclaration (astPath) { + const node = astPath.node + let hasCreateData = false + if (node.superClass) { + astPath.traverse({ + ClassMethod (astPath) { + if (astPath.get('key').isIdentifier({ name: '_createData' })) { + hasCreateData = true + } + } + }) + if (hasCreateData) { + astPath.traverse({ + ClassMethod (astPath) { + const node = astPath.node + if (node.kind === 'constructor') { + astPath.traverse({ + ExpressionStatement (astPath) { + const node = astPath.node + if (node.expression && + node.expression.type === 'AssignmentExpression' && + node.expression.operator === '=') { + const left = node.expression.left + if (left.type === 'MemberExpression' && + left.object.type === 'ThisExpression' && + left.property.type === 'Identifier' && + left.property.name === 'config') { + configObj = traverseObjectNode(node.expression.right, buildAdapter) + } + } + } + }) + } + } + }) + } + } + }, + ClassProperty (astPath) { + const node = astPath.node + const keyName = node.key.name + if (keyName === 'config') { + configObj = traverseObjectNode(node, buildAdapter) + } + } + }) + + return { + configObj + } + } + + getPages () { + const { buildAdapter } = this.options + const appEntry = this.appEntry + const code = fs.readFileSync(appEntry).toString() + const transformResult = wxTransformer({ + code, + sourcePath: appEntry, + isTyped: REG_TYPESCRIPT.test(appEntry), + isApp: true, + adapter: buildAdapter + }) + const { configObj } = this.parseAst(transformResult.ast, buildAdapter) + const appPages = configObj.pages + if (!appPages || appPages.length === 0) { + throw new Error('缺少页面') + } + this.pages = new Set([...appPages.map(item => resolveScriptPath(path.join(this.sourceDir, item)))]) + } + + getComponents (fileList: Set, isRoot: boolean) { + const { buildAdapter } = this.options + fileList.forEach(file => { + const code = fs.readFileSync(file).toString() + const transformResult = wxTransformer({ + code, + sourcePath: file, + isTyped: REG_TYPESCRIPT.test(file), + isRoot, + adapter: buildAdapter + }) + let depComponents = transformResult.components + if (depComponents && depComponents.length) { + depComponents.forEach(item => { + const componentPath = resolveScriptPath(path.resolve(path.dirname(file), item.path)) + if (fs.existsSync(componentPath)) { + this.components.add(componentPath) + this.getComponents(new Set([componentPath]), false) + } + }) + } + }) + } + + run (compiler: webpack.Compiler) { this.appEntry = this.getAppEntry(compiler) - console.log(this.appEntry) + this.getPages() + this.getComponents(this.pages, true) } } diff --git a/packages/taro-mini-runner/src/utils/constants.ts b/packages/taro-mini-runner/src/utils/constants.ts new file mode 100644 index 000000000000..b52397e6f3a8 --- /dev/null +++ b/packages/taro-mini-runner/src/utils/constants.ts @@ -0,0 +1,86 @@ +export const CSS_EXT: string[] = ['.css', '.scss', '.sass', '.less', '.styl', '.wxss', '.acss'] +export const SCSS_EXT: string[] = ['.scss'] +export const JS_EXT: string[] = ['.js', '.jsx'] +export const TS_EXT: string[] = ['.ts', '.tsx'] + +export const REG_SCRIPT: RegExp = /\.(js|jsx)(\?.*)?$/ +export const REG_TYPESCRIPT: RegExp = /\.(tsx|ts)(\?.*)?$/ +export const REG_SCRIPTS: RegExp = /\.[tj]sx?$/i + +export const enum BUILD_TYPES { + WEAPP = 'weapp', + SWAN ='swan', + ALIPAY ='alipay', + TT ='tt', + UI ='ui', + PLUGIN = 'plugin', + QUICKAPP = 'quickapp', + QQ = 'qq' +} + +export const CONFIG_MAP = { + [BUILD_TYPES.WEAPP]: { + navigationBarTitleText: 'navigationBarTitleText', + navigationBarBackgroundColor: 'navigationBarBackgroundColor', + enablePullDownRefresh: 'enablePullDownRefresh', + list: 'list', + text: 'text', + iconPath: 'iconPath', + selectedIconPath: 'selectedIconPath', + color: 'color' + }, + [BUILD_TYPES.SWAN]: { + navigationBarTitleText: 'navigationBarTitleText', + navigationBarBackgroundColor: 'navigationBarBackgroundColor', + enablePullDownRefresh: 'enablePullDownRefresh', + list: 'list', + text: 'text', + iconPath: 'iconPath', + selectedIconPath: 'selectedIconPath', + color: 'color' + }, + [BUILD_TYPES.TT]: { + navigationBarTitleText: 'navigationBarTitleText', + navigationBarBackgroundColor: 'navigationBarBackgroundColor', + enablePullDownRefresh: 'enablePullDownRefresh', + list: 'list', + text: 'text', + iconPath: 'iconPath', + selectedIconPath: 'selectedIconPath', + color: 'color' + }, + [BUILD_TYPES.ALIPAY]: { + navigationBarTitleText: 'defaultTitle', + navigationBarBackgroundColor: 'titleBarColor', + enablePullDownRefresh: 'pullRefresh', + list: 'items', + text: 'name', + iconPath: 'icon', + selectedIconPath: 'activeIcon', + color: 'textColor' + }, + [BUILD_TYPES.QUICKAPP]: { + navigationBarTitleText: 'titleBarText', + navigationBarBackgroundColor: 'titleBarBackgroundColor', + navigationBarTextStyle: 'titleBarTextColor', + pageOrientation: 'orientation', + backgroundTextStyle: false, + list: false, + text: false, + iconPath: false, + selectedIconPath: false, + onReachBottomDistance: false, + backgroundColorBottom: false, + backgroundColorTop: false, + navigationStyle: false + }, + [BUILD_TYPES.QQ]: { + navigationBarTitleText: 'navigationBarTitleText', + navigationBarBackgroundColor: 'navigationBarBackgroundColor', + enablePullDownRefresh: 'enablePullDownRefresh', + list: 'list', + text: 'text', + iconPath: 'iconPath', + selectedIconPath: 'selectedIconPath' + } +} diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts new file mode 100644 index 000000000000..850fea41a783 --- /dev/null +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -0,0 +1,73 @@ +import * as path from 'path' +import * as fs from 'fs-extra' + +import * as t from 'babel-types' + +import { CONFIG_MAP, JS_EXT, TS_EXT } from './constants' + +export function traverseObjectNode (node, buildAdapter: string, parentKey?: string) { + if (node.type === 'ClassProperty' || node.type === 'ObjectProperty') { + const properties = node.value.properties + const obj = {} + properties.forEach(p => { + let key = t.isIdentifier(p.key) ? p.key.name : p.key.value + if (CONFIG_MAP[buildAdapter][key] === false) { + return + } + if (parentKey !== 'usingComponents' && CONFIG_MAP[buildAdapter][key]) { + key = CONFIG_MAP[buildAdapter][key] + } + obj[key] = traverseObjectNode(p.value, buildAdapter, key) + }) + return obj + } + if (node.type === 'ObjectExpression') { + const properties = node.properties + const obj= {} + properties.forEach(p => { + let key = t.isIdentifier(p.key) ? p.key.name : p.key.value + if (CONFIG_MAP[buildAdapter][key] === false) { + return + } + if (parentKey !== 'usingComponents' && CONFIG_MAP[buildAdapter][key]) { + key = CONFIG_MAP[buildAdapter][key] + } + obj[key] = traverseObjectNode(p.value, buildAdapter, key) + }) + return obj + } + if (node.type === 'ArrayExpression') { + return node.elements.map(item => traverseObjectNode(item, buildAdapter)) + } + if (node.type === 'NullLiteral') { + return null + } + return node.value +} + +export function resolveScriptPath (p: string): string { + const realPath = p + const taroEnv = process.env.TARO_ENV + const SCRIPT_EXT = JS_EXT.concat(TS_EXT) + for (let i = 0; i < SCRIPT_EXT.length; i++) { + const item = SCRIPT_EXT[i] + if (taroEnv) { + if (fs.existsSync(`${p}.${taroEnv}${item}`)) { + return `${p}.${taroEnv}${item}` + } + if (fs.existsSync(`${p}${path.sep}index.${taroEnv}${item}`)) { + return `${p}${path.sep}index.${taroEnv}${item}` + } + if (fs.existsSync(`${p.replace(/\/index$/, `.${taroEnv}/index`)}${item}`)) { + return `${p.replace(/\/index$/, `.${taroEnv}/index`)}${item}` + } + } + if (fs.existsSync(`${p}${item}`)) { + return `${p}${item}` + } + if (fs.existsSync(`${p}${path.sep}index${item}`)) { + return `${p}${path.sep}index${item}` + } + } + return realPath +} diff --git a/packages/taro-mini-runner/src/utils/types.ts b/packages/taro-mini-runner/src/utils/types.ts index 33690d4db507..7739cd568b86 100644 --- a/packages/taro-mini-runner/src/utils/types.ts +++ b/packages/taro-mini-runner/src/utils/types.ts @@ -1,4 +1,5 @@ import * as webpack from 'webpack' +import { BUILD_TYPES } from './constants' type FunctionLikeCustomWebpackConfig = (webpackConfig: webpack.Configuration, webpack) => webpack.Configuration @@ -32,7 +33,8 @@ export interface IChain { export interface ITaroMiniConfig { entry: webpack.Entry - output: webpack.Output + output: webpack.Output, + buildAdapter: BUILD_TYPES } export interface ITaroPlugins { diff --git a/packages/taro-mini-runner/yarn.lock b/packages/taro-mini-runner/yarn.lock index 6e926bf55aee..5d319039567b 100644 --- a/packages/taro-mini-runner/yarn.lock +++ b/packages/taro-mini-runner/yarn.lock @@ -2,7 +2,13 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0": +"@babel/code-frame@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9" + dependencies: + "@babel/highlight" "7.0.0-beta.44" + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.0.0-beta.44": version "7.0.0" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" dependencies: @@ -27,6 +33,16 @@ semver "^5.4.1" source-map "^0.5.0" +"@babel/generator@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42" + dependencies: + "@babel/types" "7.0.0-beta.44" + jsesc "^2.5.1" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + "@babel/generator@^7.4.0", "@babel/generator@^7.4.4": version "7.4.4" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" @@ -37,6 +53,14 @@ source-map "^0.5.0" trim-right "^1.0.1" +"@babel/helper-function-name@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz#e18552aaae2231100a6e485e03854bc3532d44dd" + dependencies: + "@babel/helper-get-function-arity" "7.0.0-beta.44" + "@babel/template" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" + "@babel/helper-function-name@^7.1.0": version "7.1.0" resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" @@ -45,6 +69,12 @@ "@babel/template" "^7.1.0" "@babel/types" "^7.0.0" +"@babel/helper-get-function-arity@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15" + dependencies: + "@babel/types" "7.0.0-beta.44" + "@babel/helper-get-function-arity@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" @@ -55,6 +85,12 @@ version "7.0.0" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" +"@babel/helper-split-export-declaration@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz#c0b351735e0fbcb3822c8ad8db4e583b05ebd9dc" + dependencies: + "@babel/types" "7.0.0-beta.44" + "@babel/helper-split-export-declaration@^7.4.4": version "7.4.4" resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" @@ -69,6 +105,14 @@ "@babel/traverse" "^7.4.4" "@babel/types" "^7.4.4" +"@babel/highlight@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + "@babel/highlight@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" @@ -87,6 +131,15 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/template@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.44.tgz#f8832f4fdcee5d59bf515e595fc5106c529b394f" + dependencies: + "@babel/code-frame" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" + babylon "7.0.0-beta.44" + lodash "^4.2.0" + "@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": version "7.4.4" resolved "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" @@ -95,6 +148,21 @@ "@babel/parser" "^7.4.4" "@babel/types" "^7.4.4" +"@babel/traverse@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966" + dependencies: + "@babel/code-frame" "7.0.0-beta.44" + "@babel/generator" "7.0.0-beta.44" + "@babel/helper-function-name" "7.0.0-beta.44" + "@babel/helper-split-export-declaration" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" + babylon "7.0.0-beta.44" + debug "^3.1.0" + globals "^11.1.0" + invariant "^2.2.0" + lodash "^4.2.0" + "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4": version "7.4.4" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz#0776f038f6d78361860b6823887d4f3937133fe8" @@ -109,6 +177,14 @@ globals "^11.1.0" lodash "^4.17.11" +"@babel/types@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^2.0.0" + "@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4": version "7.4.4" resolved "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" @@ -260,10 +336,77 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^12.0.9" +"@tarojs/taro@1.3.0-beta.2": + version "1.3.0-beta.2" + resolved "https://registry.npmjs.org/@tarojs/taro/-/taro-1.3.0-beta.2.tgz#3b681fc99b768b5248c2ac1505744909a654450b" + +"@tarojs/transformer-wx@1.3.0-beta.2": + version "1.3.0-beta.2" + resolved "https://registry.npmjs.org/@tarojs/transformer-wx/-/transformer-wx-1.3.0-beta.2.tgz#a9ab0ec859c397ffce2f49778b8b8c717dc5b3af" + dependencies: + "@babel/code-frame" "^7.0.0-beta.44" + babel-core "^6.26.3" + babel-eslint "^8.2.3" + babel-helper-evaluate-path "^0.5.0" + babel-helper-mark-eval-scopes "^0.4.3" + babel-helper-remove-or-void "^0.4.3" + babel-plugin-danger-remove-unused-import "^1.1.1" + babel-plugin-minify-dead-code "^0.5.2" + babel-plugin-remove-dead-code "^1.3.2" + babel-plugin-syntax-dynamic-import "^6.18.0" + babel-plugin-transform-class-properties "^6.24.1" + babel-plugin-transform-define "^1.3.0" + babel-plugin-transform-do-expressions "^6.22.0" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-export-extensions "^6.22.0" + babel-plugin-transform-flow-strip-types "^6.22.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + eslint "^4.15.0" + eslint-plugin-react "7.10.0" + eslint-plugin-taro "1.3.0-beta.2" + html "^1.0.0" + lodash "^4.17.5" + prettier "^1.14.2" + typescript "^3.2.2" + "@types/anymatch@*": version "1.3.1" resolved "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" +"@types/babel-core@^6.25.6": + version "6.25.6" + resolved "https://registry.npmjs.org/@types/babel-core/-/babel-core-6.25.6.tgz#9e4faefcb300fd3abf0d2c2d85c505071462c1e1" + dependencies: + "@types/babel-generator" "*" + "@types/babel-template" "*" + "@types/babel-traverse" "*" + "@types/babel-types" "*" + "@types/babylon" "*" + +"@types/babel-generator@*", "@types/babel-generator@^6.25.3": + version "6.25.3" + resolved "https://registry.npmjs.org/@types/babel-generator/-/babel-generator-6.25.3.tgz#8f06caa12d0595a0538560abe771966d77d29286" + dependencies: + "@types/babel-types" "*" + +"@types/babel-template@*": + version "6.25.2" + resolved "https://registry.npmjs.org/@types/babel-template/-/babel-template-6.25.2.tgz#3c4cde02dbcbbf461a58d095a9f69f35eabd5f06" + dependencies: + "@types/babel-types" "*" + "@types/babylon" "*" + +"@types/babel-traverse@*", "@types/babel-traverse@^6.25.5": + version "6.25.5" + resolved "https://registry.npmjs.org/@types/babel-traverse/-/babel-traverse-6.25.5.tgz#6d293cf7523e48b524faa7b86dc3c488191484e5" + dependencies: + "@types/babel-types" "*" + +"@types/babel-types@*", "@types/babel-types@^7.0.7": + version "7.0.7" + resolved "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.7.tgz#667eb1640e8039436028055737d2b9986ee336e3" + "@types/babel__core@^7.1.0": version "7.1.1" resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.1.tgz#ce9a9e5d92b7031421e1d0d74ae59f572ba48be6" @@ -293,6 +436,12 @@ dependencies: "@babel/types" "^7.3.0" +"@types/babylon@*": + version "6.16.5" + resolved "https://registry.npmjs.org/@types/babylon/-/babylon-6.16.5.tgz#1c5641db69eb8cdf378edd25b4be7754beeb48b4" + dependencies: + "@types/babel-types" "*" + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" @@ -310,6 +459,13 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" +"@types/loader-utils@^1.1.3": + version "1.1.3" + resolved "https://registry.npmjs.org/@types/loader-utils/-/loader-utils-1.1.3.tgz#82b9163f2ead596c68a8c03e450fbd6e089df401" + dependencies: + "@types/node" "*" + "@types/webpack" "*" + "@types/lodash@^4.14.126": version "4.14.126" resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.126.tgz#47cff3ea014aa083194f8ca3ec351136c3786613" @@ -332,7 +488,7 @@ dependencies: source-map "^0.6.1" -"@types/webpack@^4.4.31": +"@types/webpack@*", "@types/webpack@^4.4.31": version "4.4.31" resolved "https://registry.npmjs.org/@types/webpack/-/webpack-4.4.31.tgz#f59b9d8210cf4d2fd254fe6d1f5ba86e557867f5" dependencies: @@ -501,11 +657,21 @@ acorn-globals@^4.1.0: acorn "^6.0.1" acorn-walk "^6.0.1" +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + acorn-walk@^6.0.1: version "6.1.1" resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" -acorn@^5.5.3: +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^5.5.0, acorn@^5.5.3: version "5.7.3" resolved "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" @@ -517,10 +683,23 @@ ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" +ajv-keywords@^2.1.0: + version "2.1.1" + resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" + ajv-keywords@^3.1.0: version "3.4.0" resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.0.tgz#4b831e7b531415a7cc518cd404e73f6193c6349d" +ajv@^5.2.3, ajv@^5.3.0: + version "5.5.2" + resolved "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + ajv@^6.1.0, ajv@^6.5.5: version "6.10.0" resolved "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" @@ -574,6 +753,12 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + dependencies: + sprintf-js "~1.0.2" + arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" @@ -594,6 +779,13 @@ array-filter@~0.0.0: version "0.0.1" resolved "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" +array-includes@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.7.0" + array-map@~0.0.0: version "0.0.0" resolved "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" @@ -663,7 +855,7 @@ aws4@^1.8.0: version "1.8.0" resolved "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" -babel-code-frame@^6.26.0: +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0, babel-code-frame@^6.8.0: version "6.26.0" resolved "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: @@ -671,6 +863,32 @@ babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" +babel-core@6.10.4: + version "6.10.4" + resolved "https://registry.npmjs.org/babel-core/-/babel-core-6.10.4.tgz#283f2212bb03d4e5cd7498b9886efbf6fc2e238e" + dependencies: + babel-code-frame "^6.8.0" + babel-generator "^6.9.0" + babel-helpers "^6.8.0" + babel-messages "^6.8.0" + babel-register "^6.9.0" + babel-runtime "^6.9.1" + babel-template "^6.9.0" + babel-traverse "^6.10.4" + babel-types "^6.9.1" + babylon "^6.7.0" + convert-source-map "^1.1.0" + debug "^2.1.1" + json5 "^0.4.0" + lodash "^4.2.0" + minimatch "^3.0.2" + path-exists "^1.0.0" + path-is-absolute "^1.0.0" + private "^0.1.6" + shebang-regex "^1.0.0" + slash "^1.0.0" + source-map "^0.5.0" + babel-core@^6.26.0, babel-core@^6.26.3: version "6.26.3" resolved "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" @@ -695,7 +913,18 @@ babel-core@^6.26.0, babel-core@^6.26.3: slash "^1.0.0" source-map "^0.5.7" -babel-generator@^6.26.0: +babel-eslint@^8.2.3: + version "8.2.6" + resolved "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.6.tgz#6270d0c73205628067c0f7ae1693a9e797acefd9" + dependencies: + "@babel/code-frame" "7.0.0-beta.44" + "@babel/traverse" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" + babylon "7.0.0-beta.44" + eslint-scope "3.7.1" + eslint-visitor-keys "^1.0.0" + +babel-generator@^6.26.0, babel-generator@^6.26.1, babel-generator@^6.9.0: version "6.26.1" resolved "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" dependencies: @@ -708,7 +937,48 @@ babel-generator@^6.26.0: source-map "^0.5.7" trim-right "^1.0.1" -babel-helpers@^6.24.1: +babel-helper-evaluate-path@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.3.0.tgz#2439545e0b6eae5b7f49b790acbebd6b9a73df20" + +babel-helper-evaluate-path@^0.5.0: + version "0.5.0" + resolved "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz#a62fa9c4e64ff7ea5cea9353174ef023a900a67c" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-mark-eval-scopes@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.3.0.tgz#b4731314fdd7a89091271a5213b4e12d236e29e8" + +babel-helper-mark-eval-scopes@^0.4.3: + version "0.4.3" + resolved "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz#d244a3bef9844872603ffb46e22ce8acdf551562" + +babel-helper-remove-or-void@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.3.0.tgz#f43c86147c8fcc395a9528cbb31e7ff49d7e16e3" + +babel-helper-remove-or-void@^0.4.3: + version "0.4.3" + resolved "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz#a4f03b40077a0ffe88e45d07010dee241ff5ae60" + +babel-helpers@^6.24.1, babel-helpers@^6.8.0: version "6.24.1" resolved "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" dependencies: @@ -736,12 +1006,16 @@ babel-loader@^8.0.6: mkdirp "^0.5.1" pify "^4.0.1" -babel-messages@^6.23.0: +babel-messages@^6.23.0, babel-messages@^6.8.0: version "6.23.0" resolved "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" dependencies: babel-runtime "^6.22.0" +babel-plugin-danger-remove-unused-import@^1.1.1: + version "1.1.2" + resolved "https://registry.npmjs.org/babel-plugin-danger-remove-unused-import/-/babel-plugin-danger-remove-unused-import-1.1.2.tgz#ac39c30edfe524ef8cfc411fec5edc479d19e132" + babel-plugin-istanbul@^5.1.0: version "5.1.4" resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" @@ -756,6 +1030,84 @@ babel-plugin-jest-hoist@^24.6.0: dependencies: "@types/babel__traverse" "^7.0.6" +babel-plugin-minify-dead-code@^0.5.2: + version "0.5.2" + resolved "https://registry.npmjs.org/babel-plugin-minify-dead-code/-/babel-plugin-minify-dead-code-0.5.2.tgz#8babe8e5ef7c8a4a55bbe2e40f2f22db3ef4b1ad" + dependencies: + babel-helper-evaluate-path "^0.3.0" + babel-helper-mark-eval-scopes "^0.3.0" + babel-helper-remove-or-void "^0.3.0" + lodash.some "^4.6.0" + +babel-plugin-remove-dead-code@^1.3.2: + version "1.3.2" + resolved "https://registry.npmjs.org/babel-plugin-remove-dead-code/-/babel-plugin-remove-dead-code-1.3.2.tgz#e1a2cd9595bb2f767291f35cab4ec9b467ee62c6" + dependencies: + babel-core "6.10.4" + +babel-plugin-syntax-class-properties@^6.8.0: + version "6.13.0" + resolved "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" + +babel-plugin-syntax-do-expressions@^6.8.0: + version "6.13.0" + resolved "https://registry.npmjs.org/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz#5747756139aa26d390d09410b03744ba07e4796d" + +babel-plugin-syntax-dynamic-import@^6.18.0: + version "6.18.0" + resolved "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" + +babel-plugin-syntax-export-extensions@^6.8.0: + version "6.13.0" + resolved "https://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz#70a1484f0f9089a4e84ad44bac353c95b9b12721" + +babel-plugin-syntax-flow@^6.18.0: + version "6.18.0" + resolved "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" + +babel-plugin-transform-class-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" + dependencies: + babel-helper-function-name "^6.24.1" + babel-plugin-syntax-class-properties "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-define@^1.3.0: + version "1.3.1" + resolved "https://registry.npmjs.org/babel-plugin-transform-define/-/babel-plugin-transform-define-1.3.1.tgz#b21b7bad3b84cf8e3f07cdc8c660b99cbbc01213" + dependencies: + lodash "^4.17.11" + traverse "0.6.6" + +babel-plugin-transform-do-expressions@^6.22.0: + version "6.22.0" + resolved "https://registry.npmjs.org/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz#28ccaf92812d949c2cd1281f690c8fdc468ae9bb" + dependencies: + babel-plugin-syntax-do-expressions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-export-extensions@^6.22.0: + version "6.22.0" + resolved "https://registry.npmjs.org/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653" + dependencies: + babel-plugin-syntax-export-extensions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-flow-strip-types@^6.22.0: + version "6.22.0" + resolved "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" + dependencies: + babel-plugin-syntax-flow "^6.18.0" + babel-runtime "^6.22.0" + babel-preset-jest@^24.6.0: version "24.6.0" resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz#66f06136eefce87797539c0d63f1769cc3915984" @@ -763,7 +1115,7 @@ babel-preset-jest@^24.6.0: "@babel/plugin-syntax-object-rest-spread" "^7.0.0" babel-plugin-jest-hoist "^24.6.0" -babel-register@^6.26.0: +babel-register@^6.26.0, babel-register@^6.9.0: version "6.26.0" resolved "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" dependencies: @@ -775,14 +1127,14 @@ babel-register@^6.26.0: mkdirp "^0.5.1" source-map-support "^0.4.15" -babel-runtime@^6.22.0, babel-runtime@^6.26.0: +babel-runtime@^6.22.0, babel-runtime@^6.26.0, babel-runtime@^6.9.1: version "6.26.0" resolved "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" dependencies: core-js "^2.4.0" regenerator-runtime "^0.11.0" -babel-template@^6.24.1, babel-template@^6.26.0: +babel-template@^6.24.1, babel-template@^6.26.0, babel-template@^6.9.0: version "6.26.0" resolved "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" dependencies: @@ -792,7 +1144,7 @@ babel-template@^6.24.1, babel-template@^6.26.0: babylon "^6.18.0" lodash "^4.17.4" -babel-traverse@^6.26.0: +babel-traverse@^6.10.4, babel-traverse@^6.24.1, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" dependencies: @@ -806,7 +1158,7 @@ babel-traverse@^6.26.0: invariant "^2.2.2" lodash "^4.17.4" -babel-types@^6.26.0: +babel-types@^6.24.1, babel-types@^6.26.0, babel-types@^6.9.1: version "6.26.0" resolved "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" dependencies: @@ -815,7 +1167,11 @@ babel-types@^6.26.0: lodash "^4.17.4" to-fast-properties "^1.0.3" -babylon@^6.18.0: +babylon@7.0.0-beta.44: + version "7.0.0-beta.44" + resolved "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d" + +babylon@^6.18.0, babylon@^6.7.0: version "6.18.0" resolved "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" @@ -1015,6 +1371,16 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -1047,7 +1413,7 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" dependencies: @@ -1055,6 +1421,10 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chardet@^0.4.0: + version "0.4.2" + resolved "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" + chokidar@^2.0.2: version "2.1.5" resolved "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz#0ae8434d962281a5f56c72869e79cb6d9d86ad4d" @@ -1094,6 +1464,10 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + class-utils@^0.3.5: version "0.3.6" resolved "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -1113,6 +1487,10 @@ cli-spinners@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.1.0.tgz#22c34b4d51f573240885b201efda4e4ec9fff3c7" +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + cliui@^4.0.0: version "4.1.0" resolved "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" @@ -1172,7 +1550,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.5.0: +concat-stream@^1.4.7, concat-stream@^1.5.0, concat-stream@^1.6.0: version "1.6.2" resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" dependencies: @@ -1252,6 +1630,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" +cross-spawn@^5.1.0: + version "5.1.0" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -1310,12 +1696,18 @@ date-now@^0.1.4: version "0.1.4" resolved "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" -debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: ms "2.0.0" +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + dependencies: + ms "^2.1.1" + debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" @@ -1414,6 +1806,12 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + dependencies: + esutils "^2.0.2" + domain-browser@^1.1.1: version "1.2.0" resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" @@ -1482,7 +1880,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.4.3, es-abstract@^1.5.1: +es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.7.0: version "1.13.0" resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" dependencies: @@ -1516,6 +1914,35 @@ escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" +eslint-plugin-react@7.10.0: + version "7.10.0" + resolved "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.10.0.tgz#af5c1fef31c4704db02098f9be18202993828b50" + dependencies: + doctrine "^2.1.0" + has "^1.0.3" + jsx-ast-utils "^2.0.1" + prop-types "^15.6.2" + +eslint-plugin-taro@1.3.0-beta.2: + version "1.3.0-beta.2" + resolved "https://registry.npmjs.org/eslint-plugin-taro/-/eslint-plugin-taro-1.3.0-beta.2.tgz#e9a7c6bf29ef670305522bb61db35015b828d2d1" + dependencies: + has "^1.0.1" + +eslint-scope@3.7.1: + version "3.7.1" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-scope@^3.7.1: + version "3.7.3" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + eslint-scope@^4.0.0: version "4.0.3" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" @@ -1523,17 +1950,81 @@ eslint-scope@^4.0.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + +eslint@^4.15.0: + version "4.19.1" + resolved "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" + dependencies: + ajv "^5.3.0" + babel-code-frame "^6.22.0" + chalk "^2.1.0" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^3.1.0" + doctrine "^2.1.0" + eslint-scope "^3.7.1" + eslint-visitor-keys "^1.0.0" + espree "^3.5.4" + esquery "^1.0.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.0.1" + ignore "^3.3.3" + imurmurhash "^0.1.4" + inquirer "^3.0.6" + is-resolvable "^1.0.0" + js-yaml "^3.9.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + regexpp "^1.0.1" + require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" + strip-json-comments "~2.0.1" + table "4.0.2" + text-table "~0.2.0" + +espree@^3.5.4: + version "3.5.4" + resolved "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" + dependencies: + acorn "^5.5.0" + acorn-jsx "^3.0.0" + esprima@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + +esquery@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + dependencies: + estraverse "^4.0.0" + esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" dependencies: estraverse "^4.1.0" -estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -1612,6 +2103,14 @@ extend@~3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" +external-editor@^2.0.4: + version "2.2.0" + resolved "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" + dependencies: + chardet "^0.4.0" + iconv-lite "^0.4.17" + tmp "^0.0.33" + extglob@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -1633,6 +2132,10 @@ extsprintf@^1.2.0: version "1.4.0" resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" +fast-deep-equal@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" + fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" @@ -1655,6 +2158,19 @@ figgy-pudding@^3.5.1: version "3.5.1" resolved "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + fill-range@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -1678,6 +2194,15 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" +flat-cache@^1.2.1: + version "1.3.4" + resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f" + dependencies: + circular-json "^0.3.1" + graceful-fs "^4.1.2" + rimraf "~2.6.2" + write "^0.2.1" + flush-write-stream@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" @@ -1714,6 +2239,14 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" +fs-extra@^8.0.1: + version "8.0.1" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-8.0.1.tgz#90294081f978b1f182f347a440a209154344285b" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" @@ -1744,6 +2277,10 @@ function-bind@^1.0.2, function-bind@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -1795,7 +2332,7 @@ glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0: +globals@^11.0.1, globals@^11.1.0: version "11.12.0" resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" @@ -1803,7 +2340,7 @@ globals@^9.18.0: version "9.18.0" resolved "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.15" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" @@ -1922,6 +2459,12 @@ html-encoding-sniffer@^1.0.2: dependencies: whatwg-encoding "^1.0.1" +html@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/html/-/html-1.0.0.tgz#a544fa9ea5492bfb3a2cca8210a10be7b5af1f61" + dependencies: + concat-stream "^1.4.7" + http-signature@~1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" @@ -1934,7 +2477,7 @@ https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" -iconv-lite@0.4.24, iconv-lite@^0.4.4: +iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.4: version "0.4.24" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" dependencies: @@ -1954,6 +2497,10 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" +ignore@^3.3.3: + version "3.3.10" + resolved "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + import-local@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" @@ -1988,7 +2535,26 @@ ini@~1.3.0: version "1.3.5" resolved "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" -invariant@^2.2.2, invariant@^2.2.4: +inquirer@^3.0.6: + version "3.3.0" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^2.0.4" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + +invariant@^2.2.0, invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: @@ -2124,12 +2690,20 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + is-regex@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" dependencies: has "^1.0.1" +is-resolvable@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2542,13 +3116,20 @@ jest@^24.8.0: import-local "^2.0.0" jest-cli "^24.8.0" +js-tokens@^3.0.0, js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" +js-yaml@^3.9.1: + version "3.13.1" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" jsbn@~0.1.0: version "0.1.1" @@ -2597,6 +3178,10 @@ json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -2605,6 +3190,10 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -2615,6 +3204,10 @@ json5@2.x, json5@^2.1.0: dependencies: minimist "^1.2.0" +json5@^0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/json5/-/json5-0.4.0.tgz#054352e4c4c80c86c0923877d449de176a732c8d" + json5@^0.5.1: version "0.5.1" resolved "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -2625,6 +3218,12 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + optionalDependencies: + graceful-fs "^4.1.6" + jsonify@~0.0.0: version "0.0.0" resolved "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" @@ -2638,6 +3237,12 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +jsx-ast-utils@^2.0.1: + version "2.1.0" + resolved "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.1.0.tgz#0ee4e2c971fb9601c67b5641b71be80faecf0b36" + dependencies: + array-includes "^3.0.3" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -2676,7 +3281,7 @@ leven@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" -levn@~0.3.0: +levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" dependencies: @@ -2696,7 +3301,7 @@ loader-runner@^2.3.0: version "2.4.0" resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" -loader-utils@^1.0.2, loader-utils@^1.1.0: +loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" dependencies: @@ -2711,11 +3316,15 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" +lodash.some@^4.6.0: + version "4.6.0" + resolved "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" + lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" -lodash@^4.17.11, lodash@^4.17.4: +lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0: version "4.17.11" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" @@ -2725,12 +3334,19 @@ log-symbols@^2.2.0: dependencies: chalk "^2.0.1" -loose-envify@^1.0.0: +loose-envify@^1.0.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" dependencies: js-tokens "^3.0.0 || ^4.0.0" +lru-cache@^4.0.1: + version "4.1.5" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -2858,7 +3474,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -minimatch@^3.0.4: +minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -2936,6 +3552,10 @@ ms@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + nan@^2.12.1: version "2.13.2" resolved "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" @@ -3115,7 +3735,7 @@ oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" -object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -3169,7 +3789,7 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.1: +optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" dependencies: @@ -3207,7 +3827,7 @@ os-locale@^3.0.0: lcid "^2.0.0" mem "^4.0.0" -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -3302,6 +3922,10 @@ path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" +path-exists@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-1.0.0.tgz#d5a8998eb71ef37a74c34eb0d9eba6e878eea081" + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -3310,6 +3934,10 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" +path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -3362,6 +3990,10 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + pn@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" @@ -3374,6 +4006,10 @@ prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" +prettier@^1.14.2: + version "1.17.1" + resolved "https://registry.npmjs.org/prettier/-/prettier-1.17.1.tgz#ed64b4e93e370cb8a25b9ef7fef3e4fd1c0995db" + pretty-format@^24.8.0: version "24.8.0" resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2" @@ -3383,7 +4019,7 @@ pretty-format@^24.8.0: ansi-styles "^3.2.0" react-is "^16.8.4" -private@^0.1.8: +private@^0.1.6, private@^0.1.8: version "0.1.8" resolved "https://registry.npmjs.org/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -3395,6 +4031,10 @@ process@^0.11.10: version "0.11.10" resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" @@ -3406,10 +4046,22 @@ prompts@^2.0.1: kleur "^3.0.2" sisteransi "^1.0.0" +prop-types@^15.6.2: + version "15.7.2" + resolved "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + prr@~1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + psl@^1.1.24, psl@^1.1.28: version "1.1.31" resolved "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" @@ -3493,7 +4145,7 @@ rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-is@^16.8.4: +react-is@^16.8.1, react-is@^16.8.4: version "16.8.6" resolved "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" @@ -3549,6 +4201,10 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +regexpp@^1.0.1: + version "1.1.0" + resolved "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" + remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -3618,12 +4274,23 @@ require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" dependencies: resolve-from "^3.0.0" +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" @@ -3653,7 +4320,7 @@ ret@~0.1.10: version "0.1.15" resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" -rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: +rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@~2.6.2: version "2.6.3" resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" dependencies: @@ -3670,12 +4337,28 @@ rsvp@^4.8.4: version "4.8.4" resolved "https://registry.npmjs.org/rsvp/-/rsvp-4.8.4.tgz#b50e6b34583f3dd89329a2f23a8a2be072845911" +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + dependencies: + is-promise "^2.1.0" + run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" dependencies: aproba "^1.1.1" +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + dependencies: + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -3800,6 +4483,12 @@ slash@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + dependencies: + is-fullwidth-code-point "^2.0.0" + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -3894,6 +4583,10 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + sshpk@^1.7.0: version "1.16.1" resolved "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" @@ -3972,7 +4665,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: @@ -4049,6 +4742,17 @@ symbol-tree@^3.2.2: version "3.2.2" resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" +table@4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" + dependencies: + ajv "^5.2.3" + ajv-keywords "^2.1.0" + chalk "^2.1.0" + lodash "^4.17.4" + slice-ansi "1.0.0" + string-width "^2.1.1" + tapable@^1.0.0, tapable@^1.1.0: version "1.1.3" resolved "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" @@ -4095,6 +4799,10 @@ test-exclude@^5.2.3: read-pkg-up "^4.0.0" require-main-filename "^2.0.0" +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + throat@^4.0.0: version "4.1.0" resolved "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" @@ -4106,12 +4814,22 @@ through2@^2.0.0: readable-stream "~2.3.6" xtend "~4.0.1" +through@^2.3.6: + version "2.3.8" + resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + timers-browserify@^2.0.4: version "2.0.10" resolved "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" dependencies: setimmediate "^1.0.4" +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + dependencies: + os-tmpdir "~1.0.2" + tmpl@1.0.x: version "1.0.4" resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" @@ -4170,6 +4888,10 @@ tr46@^1.0.1: dependencies: punycode "^2.1.0" +traverse@0.6.6: + version "0.6.6" + resolved "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + trim-right@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" @@ -4216,7 +4938,7 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript@^3.4.5: +typescript@^3.2.2, typescript@^3.4.5: version "3.4.5" resolved "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99" @@ -4248,6 +4970,10 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + unset-value@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" @@ -4482,6 +5208,12 @@ write-file-atomic@2.4.1: imurmurhash "^0.1.4" signal-exit "^3.0.2" +write@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + ws@^5.2.0: version "5.2.2" resolved "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" @@ -4500,6 +5232,10 @@ xtend@^4.0.0, xtend@~4.0.1: version "4.0.0" resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + yallist@^3.0.0, yallist@^3.0.2: version "3.0.3" resolved "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" From 97cc0e1fea124eefdbf1041010c56519bca52d97 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 23 May 2019 17:37:56 +0800 Subject: [PATCH 007/194] =?UTF-8?q?feat(cli):=20=E5=B0=86=20app/=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2/=E7=BB=84=E4=BB=B6=20=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?=E5=85=A5=E5=8F=A3=E6=96=87=E4=BB=B6=E8=BF=9B=E8=A1=8C=E7=BC=96?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/mini/webpack.ts | 14 ++- packages/taro-mini-runner/package.json | 3 + packages/taro-mini-runner/src/index.ts | 9 +- .../src/loaders/fileParseLoader.ts | 14 ++- .../src/loaders/wxTransformerLoader.ts | 15 ++- .../src/plugins/miniPlugin.ts | 95 ++++++++++++++++--- packages/taro-mini-runner/src/utils/types.ts | 3 +- packages/taro-mini-runner/yarn.lock | 25 +++-- 8 files changed, 144 insertions(+), 34 deletions(-) diff --git a/packages/taro-cli/src/mini/webpack.ts b/packages/taro-cli/src/mini/webpack.ts index 7f2366f1df54..0c002258716f 100644 --- a/packages/taro-cli/src/mini/webpack.ts +++ b/packages/taro-cli/src/mini/webpack.ts @@ -28,8 +28,15 @@ export async function build (appPath: string, { watch, adapter = BUILD_TYPES.WEA } async function buildWithWebpack ({ appPath }: { appPath: string }) { - const { entryFilePath, outputDir, sourceDir, buildAdapter, projectConfig, isProduction } = getBuildData() - console.log(entryFilePath, outputDir) + const { + entryFilePath, + outputDir, + sourceDir, + buildAdapter, + projectConfig, + isProduction, + constantsReplaceList + } = getBuildData() const miniRunner = await npmProcess.getNpmPkg('@tarojs/mini-runner', appPath) const babelConfig = getBabelConfig(projectConfig!.plugins!.babel) const miniRunnerOpts = { @@ -41,7 +48,8 @@ async function buildWithWebpack ({ appPath }: { appPath: string }) { plugins: { babel: babelConfig }, - isWatch: !isProduction + isWatch: !isProduction, + constantsReplaceList } miniRunner(miniRunnerOpts) } diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index 1ea2a4650d7f..32eb4ac8d7f2 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -37,8 +37,11 @@ "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", + "babel-plugin-danger-remove-unused-import": "^1.1.2", + "babel-plugin-transform-define": "^1.3.1", "babel-traverse": "^6.26.0", "babel-types": "^6.26.0", + "better-babel-generator": "^6.26.1", "chalk": "^2.4.2", "fs-extra": "^8.0.1", "loader-utils": "^1.2.3", diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index 10db81ebb290..09a721802a9a 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -25,12 +25,14 @@ export default function build (config: IBuildConfig) { use: [{ loader: path.resolve(__dirname, './loaders/fileParseLoader'), options: { - babel + babel, + constantsReplaceList: config.constantsReplaceList } }, { loader: path.resolve(__dirname, './loaders/wxTransformerLoader'), options: { - buildAdapter: config.buildAdapter + buildAdapter: config.buildAdapter, + fileTypeMap: MiniPlugin.getTaroFileTypeMap() } }] } @@ -38,7 +40,8 @@ export default function build (config: IBuildConfig) { }, plugins: [ new MiniPlugin({ - buildAdapter: config.buildAdapter + buildAdapter: config.buildAdapter, + constantsReplaceList: config.constantsReplaceList }) ] } diff --git a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts index eba1b6996290..7c4c2921aa69 100644 --- a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts +++ b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts @@ -1,9 +1,15 @@ import { getOptions } from 'loader-utils' -import { transform } from 'babel-core' +import { transform, transformFromAst } from 'babel-core' + +const cannotRemoves = ['@tarojs/taro', 'react', 'nervjs'] export default function fileParseLoader (source, ast) { - const options = getOptions(this) - const babelConfig = options.babel - const res = transform(source, babelConfig) + const { babel: babelConfig, constantsReplaceList } = getOptions(this) + const newBabelConfig = Object.assign({}, babelConfig) + newBabelConfig.plugins = [ + [require('babel-plugin-danger-remove-unused-import'), { ignore: cannotRemoves }], + [require('babel-plugin-transform-define').default, constantsReplaceList] + ].concat(newBabelConfig.plugins) + const res = transformFromAst(ast, '', newBabelConfig) return res.code } diff --git a/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts b/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts index 493c03537973..7012f188e3bb 100644 --- a/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts +++ b/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts @@ -2,18 +2,23 @@ import { getOptions } from 'loader-utils' import * as wxTransformer from '@tarojs/transformer-wx' import { REG_TYPESCRIPT } from '../utils/constants' +import { TARO_FILE_TYPE } from '../plugins/miniPlugin' export default function wxTransformerLoader (source) { - const options = getOptions(this) + const { buildAdapter, fileTypeMap } = getOptions(this) const filePath = this.resourcePath - const { buildAdapter } = options - const transformResult = wxTransformer({ + const wxTransformerParams: any = { code: source, sourcePath: filePath, isTyped: REG_TYPESCRIPT.test(filePath), adapter: buildAdapter - }) + } + if (fileTypeMap[filePath] === TARO_FILE_TYPE.APP) { + wxTransformerParams.isApp = true + } else if (fileTypeMap[filePath] === TARO_FILE_TYPE.PAGE) { + wxTransformerParams.isRoot = true + } + const transformResult = wxTransformer(wxTransformerParams) this.callback(null, transformResult.code, transformResult.ast) - console.log('wxTransformerLoader') return transformResult.code } diff --git a/packages/taro-mini-runner/src/plugins/miniPlugin.ts b/packages/taro-mini-runner/src/plugins/miniPlugin.ts index ce4d329b3ed8..4c1fa2f0d14b 100644 --- a/packages/taro-mini-runner/src/plugins/miniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/miniPlugin.ts @@ -3,6 +3,11 @@ import * as fs from 'fs-extra' import * as wxTransformer from '@tarojs/transformer-wx' import * as webpack from 'webpack' +import * as SingleEntryPlugin from 'webpack/lib/SingleEntryPlugin' +import * as FunctionModulePlugin from 'webpack/lib/FunctionModulePlugin' +import * as NodeSourcePlugin from 'webpack/lib/node/NodeSourcePlugin' +import * as JsonpTemplatePlugin from 'webpack/lib/JsonpTemplatePlugin' +import * as LoaderTargetPlugin from 'webpack/lib/LoaderTargetPlugin' import { defaults } from 'lodash' import * as t from 'babel-types' import traverse from 'babel-traverse' @@ -16,18 +21,54 @@ interface IMiniPluginOptions { buildAdapter: BUILD_TYPES } +interface IComponent { name: string, path: string } + const PLUGIN_NAME = 'MiniPlugin' +const taroFileTypeMap = {} + +export enum TARO_FILE_TYPE { + APP = 'APP', + PAGE = 'PAGE', + COMPONENT = 'COMPONENT' +} + +export const createTarget = function createTarget(name) { + const target = compiler => { + const { options } = compiler + compiler.apply( + new JsonpTemplatePlugin(options.output), + new FunctionModulePlugin(options.output), + new NodeSourcePlugin(options.node), + new LoaderTargetPlugin('web') + ) + } + + const creater = new Function( + `var t = arguments[0]; return function ${name}(c) { return t(c); }` + ); + return creater(target) +} + +export const Targets = { + [BUILD_TYPES.WEAPP]: createTarget(BUILD_TYPES.WEAPP), + [BUILD_TYPES.ALIPAY]: createTarget(BUILD_TYPES.ALIPAY), + [BUILD_TYPES.SWAN]: createTarget(BUILD_TYPES.SWAN), + [BUILD_TYPES.TT]: createTarget(BUILD_TYPES.TT), + [BUILD_TYPES.QQ]: createTarget(BUILD_TYPES.QQ), +} + export default class MiniPlugin { options: IMiniPluginOptions appEntry: string - pages: Set - components: Set + pages: Set + components: Set sourceDir: string constructor (options = {}) { this.options = defaults(options || {}, { - buildAdapter: BUILD_TYPES.WEAPP + buildAdapter: BUILD_TYPES.WEAPP, + commonLibName: 'lib.js' }) this.pages = new Set() @@ -68,6 +109,7 @@ export default class MiniPlugin { } const appEntryPath = getEntryPath(entry) this.sourceDir = path.dirname(appEntryPath) + taroFileTypeMap[appEntryPath] = TARO_FILE_TYPE.APP return appEntryPath } @@ -147,36 +189,65 @@ export default class MiniPlugin { if (!appPages || appPages.length === 0) { throw new Error('缺少页面') } - this.pages = new Set([...appPages.map(item => resolveScriptPath(path.join(this.sourceDir, item)))]) + this.pages = new Set([ + ...appPages.map(item => { + const pagePath = resolveScriptPath(path.join(this.sourceDir, item)) + taroFileTypeMap[pagePath] = TARO_FILE_TYPE.PAGE + return { name: item, path: pagePath } + }) + ]) } - getComponents (fileList: Set, isRoot: boolean) { + getComponents (fileList: Set, isRoot: boolean) { const { buildAdapter } = this.options fileList.forEach(file => { - const code = fs.readFileSync(file).toString() + const code = fs.readFileSync(file.path).toString() const transformResult = wxTransformer({ code, - sourcePath: file, - isTyped: REG_TYPESCRIPT.test(file), + sourcePath: file.path, + isTyped: REG_TYPESCRIPT.test(file.path), isRoot, adapter: buildAdapter }) + let depComponents = transformResult.components if (depComponents && depComponents.length) { depComponents.forEach(item => { - const componentPath = resolveScriptPath(path.resolve(path.dirname(file), item.path)) - if (fs.existsSync(componentPath)) { - this.components.add(componentPath) - this.getComponents(new Set([componentPath]), false) + const componentPath = resolveScriptPath(path.resolve(path.dirname(file.path), item.path)) + if (fs.existsSync(componentPath) && !Array.from(this.components).some(item => item.path === componentPath)) { + taroFileTypeMap[componentPath] = TARO_FILE_TYPE.COMPONENT + const componentName = componentPath.replace(this.sourceDir, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') + const componentObj = { name: componentName, path: componentPath } + this.components.add(componentObj) + this.getComponents(new Set([componentObj]), false) } }) } }) } + addEntries (compiler: webpack.Compiler) { + const mainFiles = new Set([ ...this.pages, ...this.components ]) + mainFiles.add({ + name: 'app', + path: this.appEntry + }) + mainFiles.forEach(item => { + compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation: webpack.compilation.Compilation, callback) => { + const dep = SingleEntryPlugin.createDependency(item.path, item.name) + compilation.addEntry(this.sourceDir, dep, item.name, callback) + }) + }) + } + run (compiler: webpack.Compiler) { this.appEntry = this.getAppEntry(compiler) this.getPages() this.getComponents(this.pages, true) + this.addEntries(compiler) + } + + static getTaroFileTypeMap () { + return taroFileTypeMap } } diff --git a/packages/taro-mini-runner/src/utils/types.ts b/packages/taro-mini-runner/src/utils/types.ts index 7739cd568b86..ce7418cab98e 100644 --- a/packages/taro-mini-runner/src/utils/types.ts +++ b/packages/taro-mini-runner/src/utils/types.ts @@ -70,5 +70,6 @@ export interface ITaroBaseConfig { } export interface IBuildConfig extends ITaroBaseConfig, ITaroMiniConfig { - isWatch: boolean + isWatch: boolean, + constantsReplaceList: IOption } diff --git a/packages/taro-mini-runner/yarn.lock b/packages/taro-mini-runner/yarn.lock index 5d319039567b..ddee415eaea0 100644 --- a/packages/taro-mini-runner/yarn.lock +++ b/packages/taro-mini-runner/yarn.lock @@ -1012,7 +1012,7 @@ babel-messages@^6.23.0, babel-messages@^6.8.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-danger-remove-unused-import@^1.1.1: +babel-plugin-danger-remove-unused-import@^1.1.1, babel-plugin-danger-remove-unused-import@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/babel-plugin-danger-remove-unused-import/-/babel-plugin-danger-remove-unused-import-1.1.2.tgz#ac39c30edfe524ef8cfc411fec5edc479d19e132" @@ -1074,7 +1074,7 @@ babel-plugin-transform-class-properties@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-define@^1.3.0: +babel-plugin-transform-define@^1.3.0, babel-plugin-transform-define@^1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/babel-plugin-transform-define/-/babel-plugin-transform-define-1.3.1.tgz#b21b7bad3b84cf8e3f07cdc8c660b99cbbc01213" dependencies: @@ -1201,6 +1201,19 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" +better-babel-generator@^6.26.1: + version "6.26.1" + resolved "https://registry.npmjs.org/better-babel-generator/-/better-babel-generator-6.26.1.tgz#7c26035f32d8d55d06dbc81b410378a6230a515e" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "2" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + big.js@^5.2.2: version "5.2.2" resolved "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" @@ -3166,14 +3179,14 @@ jsdom@^11.5.1: ws "^5.2.0" xml-name-validator "^3.0.0" +jsesc@2, jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + jsesc@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" From 36d8ac9ec3723a5fa61f9d1cff8e1001420788f5 Mon Sep 17 00:00:00 2001 From: yuche Date: Tue, 28 May 2019 10:38:16 +0800 Subject: [PATCH 008/194] =?UTF-8?q?refactor(transformer):=20=E4=BB=BB?= =?UTF-8?q?=E4=BD=95=E6=83=85=E5=86=B5=E8=BF=94=E5=9B=9E=E9=83=BD=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=9B=B8=E5=90=8C=E7=9A=84=20result?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-transformer-wx/src/index.ts | 28 ++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/packages/taro-transformer-wx/src/index.ts b/packages/taro-transformer-wx/src/index.ts index dc9c4e93eedb..bbbe6c89c0a4 100644 --- a/packages/taro-transformer-wx/src/index.ts +++ b/packages/taro-transformer-wx/src/index.ts @@ -220,6 +220,13 @@ export default function transform (options: Options): TransformResult { setIsTaroReady('priTaroCompReady') setCompId('priCompid') } + const defaultResult: TransformResult = { + ast: {} as any, + code: '', + imageSrcs: '', + compressedTemplate: '', + components: [] + } THIRD_PARTY_COMPONENTS.clear() const code = options.isTyped ? ts.transpile(options.code, { @@ -247,7 +254,12 @@ export default function transform (options: Options): TransformResult { resetTSClassProperty(mainClassNode.body.body) } } - return { ast } as any + const code = generate(ast).code + return { + ...defaultResult, + ast, + code + } } // transformFromAst(ast, code) let result @@ -780,7 +792,12 @@ export default function transform (options: Options): TransformResult { } if (!mainClass) { - throw new Error('未找到 Taro.Component 的类定义') + const code = generate(ast).code + return { + ...defaultResult, + ast, + code + } } if (Adapter.type === Adapters.alipay) { @@ -837,7 +854,12 @@ export default function transform (options: Options): TransformResult { renderMethod.replaceWith( t.classMethod('method', t.identifier('_createData'), [], t.blockStatement([])) ) - return { ast } as TransformResult + const code = generate(ast).code + return { + ...defaultResult, + ast, + code + } } result = new Transformer(mainClass, options.sourcePath, componentProperies, options.sourceDir!, classMethods).result result.code = generate(ast).code From 5f78126bfa43a4584371a2c6b01e630c5d7b6c2f Mon Sep 17 00:00:00 2001 From: yuche Date: Tue, 28 May 2019 10:38:56 +0800 Subject: [PATCH 009/194] =?UTF-8?q?fix(transformer):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-transformer-wx/__tests__/base.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taro-transformer-wx/__tests__/base.spec.ts b/packages/taro-transformer-wx/__tests__/base.spec.ts index 943656f44fb9..158dd289712b 100644 --- a/packages/taro-transformer-wx/__tests__/base.spec.ts +++ b/packages/taro-transformer-wx/__tests__/base.spec.ts @@ -116,7 +116,7 @@ describe('基本功能', () => { expect(code.includes(INTERNAL_SAFE_GET)).toBeTruthy() }) - test('isApp 为 true 时只返回 ast', () => { + test.skip('isApp 为 true 时只返回 ast', () => { const { code, ast, template } = transform({ ...baseOptions, isApp: true, From d4b38be10fac0e518a7d3af3cb68f0c65a0407f5 Mon Sep 17 00:00:00 2001 From: yuche Date: Tue, 28 May 2019 11:02:19 +0800 Subject: [PATCH 010/194] =?UTF-8?q?refactor(transformer):=20isApp=20?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E6=98=AF=E5=BF=85=E5=A1=AB=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-transformer-wx/src/options.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/taro-transformer-wx/src/options.ts b/packages/taro-transformer-wx/src/options.ts index 28f068e8dcd4..79bd9d78d300 100644 --- a/packages/taro-transformer-wx/src/options.ts +++ b/packages/taro-transformer-wx/src/options.ts @@ -7,8 +7,8 @@ import { buildVistor } from './class-method-renamer' export interface Options { isRoot?: boolean, - isApp: boolean, - outputPath: string, + isApp?: boolean, + // outputPath: string, sourcePath: string, sourceDir?: string, code: string, From 62f71a5cc1f6d860e66a287a692db2a997954235 Mon Sep 17 00:00:00 2001 From: yuche Date: Tue, 28 May 2019 14:32:13 +0800 Subject: [PATCH 011/194] =?UTF-8?q?fix(transformer):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=20import=20=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-transformer-wx/index.js | 3 ++- packages/taro-transformer-wx/src/index.ts | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/taro-transformer-wx/index.js b/packages/taro-transformer-wx/index.js index 67f35bcdaad9..d1c32f064a94 100644 --- a/packages/taro-transformer-wx/index.js +++ b/packages/taro-transformer-wx/index.js @@ -1,2 +1,3 @@ var transform = require('./lib/src').default -module.exports = module.exports.default = transform +module.exports = transform +module.exports.default = transform diff --git a/packages/taro-transformer-wx/src/index.ts b/packages/taro-transformer-wx/src/index.ts index bbbe6c89c0a4..99513c9a2885 100644 --- a/packages/taro-transformer-wx/src/index.ts +++ b/packages/taro-transformer-wx/src/index.ts @@ -185,9 +185,17 @@ function findThirdPartyComponent (properties: (t.ObjectMethod | t.ObjectProperty } } } +interface Result { + template?: string + componentProperies?: string[] +} -export interface Result { - template: string +export interface TransformResult extends Result { + ast: t.File + code?: string + imageSrcs?: string + compressedTemplate?: string, + sourcemap?: object components: { name: string, path: string, @@ -196,12 +204,11 @@ export interface Result { componentProperies: string[] } -interface TransformResult extends Result { - code: string, - ast: t.File +export interface TransformOptions extends Options { + // } -export default function transform (options: Options): TransformResult { +export default function transform (options: TransformOptions): TransformResult { if (options.adapter) { setAdapter(options.adapter) if (Adapter.type === Adapters.quickapp) { From 4771c21e7894921344c8e053408787cc361f1156 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 28 May 2019 23:25:10 +0800 Subject: [PATCH 012/194] =?UTF-8?q?fix(cli):=20=E7=BC=96=E8=AF=91=E5=99=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/convertor/index.ts | 4 +- packages/taro-cli/src/h5/index.ts | 3 +- packages/taro-cli/src/mini/compileScript.ts | 5 +- packages/taro-cli/src/mini/component.ts | 9 +- packages/taro-cli/src/mini/entry.ts | 4 +- packages/taro-cli/src/mini/helper.ts | 5 +- packages/taro-cli/src/mini/page.ts | 4 +- packages/taro-cli/src/mini/webpack.ts | 3 +- packages/taro-cli/src/rn/transformJS.ts | 6 +- packages/taro-cli/src/ui/common.ts | 85 ++++++++++++++++++- .../taro-cli/src/util/resolve_npm_files.ts | 4 +- 11 files changed, 94 insertions(+), 38 deletions(-) diff --git a/packages/taro-cli/src/convertor/index.ts b/packages/taro-cli/src/convertor/index.ts index 0f55b6c1d1dc..68c22766c756 100644 --- a/packages/taro-cli/src/convertor/index.ts +++ b/packages/taro-cli/src/convertor/index.ts @@ -7,7 +7,7 @@ import * as prettier from 'prettier' import traverse, { NodePath } from 'babel-traverse' import * as t from 'babel-types' import * as taroize from '@tarojs/taroize' -import * as wxTransformer from '@tarojs/transformer-wx' +import wxTransformer from '@tarojs/transformer-wx' import * as postcss from 'postcss' import * as unitTransform from 'postcss-taro-unit-transform' @@ -407,8 +407,6 @@ export default class Convertor { const transformResult = wxTransformer({ code, sourcePath: file, - outputPath: outputFilePath, - isNormal: true, isTyped: REG_TYPESCRIPT.test(file) }) const { ast, scriptFiles } = this.parseAst({ diff --git a/packages/taro-cli/src/h5/index.ts b/packages/taro-cli/src/h5/index.ts index 92197c37f01e..e37935b6b688 100644 --- a/packages/taro-cli/src/h5/index.ts +++ b/packages/taro-cli/src/h5/index.ts @@ -1,5 +1,5 @@ import { PageConfig } from '@tarojs/taro' -import * as wxTransformer from '@tarojs/transformer-wx' +import wxTransformer from '@tarojs/transformer-wx' import * as babel from 'babel-core' import traverse, { NodePath, TraverseOptions } from 'babel-traverse' import * as t from 'babel-types' @@ -295,7 +295,6 @@ class Compiler { let ast = wxTransformer({ code, sourcePath: filePath, - isNormal: true, isTyped: REG_TYPESCRIPT.test(filePath), adapter: 'h5' }).ast diff --git a/packages/taro-cli/src/mini/compileScript.ts b/packages/taro-cli/src/mini/compileScript.ts index cc37c99a9293..95df8fe21e21 100644 --- a/packages/taro-cli/src/mini/compileScript.ts +++ b/packages/taro-cli/src/mini/compileScript.ts @@ -1,7 +1,7 @@ import * as fs from 'fs-extra' import * as path from 'path' -import * as wxTransformer from '@tarojs/transformer-wx' +import wxTransformer from '@tarojs/transformer-wx' import { printLog, @@ -83,9 +83,6 @@ export function compileDepScripts (scriptFiles: string[], needUseBabel?: boolean const transformResult = wxTransformer({ code, sourcePath: item, - sourceDir, - outputPath: outputItem, - isNormal: true, isTyped: REG_TYPESCRIPT.test(item), adapter: buildAdapter, env: constantsReplaceList, diff --git a/packages/taro-cli/src/mini/component.ts b/packages/taro-cli/src/mini/component.ts index 27f356461939..49e52b8e618a 100644 --- a/packages/taro-cli/src/mini/component.ts +++ b/packages/taro-cli/src/mini/component.ts @@ -2,7 +2,7 @@ import * as fs from 'fs-extra' import * as path from 'path' import { Config as IConfig } from '@tarojs/taro' -import * as wxTransformer from '@tarojs/transformer-wx' +import wxTransformer from '@tarojs/transformer-wx' import * as _ from 'lodash' import traverse from 'babel-traverse' @@ -55,12 +55,10 @@ export function getComponentsNamedMap () { export function isFileToBeTaroComponent ( code: string, - sourcePath: string, - outputPath: string + sourcePath: string ) { const { buildAdapter, - sourceDir, constantsReplaceList, jsxAttributeNameReplace, alias @@ -68,9 +66,6 @@ export function isFileToBeTaroComponent ( const transformResult: IWxTransformResult = wxTransformer({ code, sourcePath: sourcePath, - sourceDir, - outputPath: outputPath, - isNormal: true, isTyped: REG_TYPESCRIPT.test(sourcePath), adapter: buildAdapter, env: constantsReplaceList, diff --git a/packages/taro-cli/src/mini/entry.ts b/packages/taro-cli/src/mini/entry.ts index 980b85508757..4c7842cca495 100644 --- a/packages/taro-cli/src/mini/entry.ts +++ b/packages/taro-cli/src/mini/entry.ts @@ -2,7 +2,7 @@ import * as fs from 'fs-extra' import * as path from 'path' import { AppConfig } from '@tarojs/taro' -import * as wxTransformer from '@tarojs/transformer-wx' +import wxTransformer from '@tarojs/transformer-wx' import { REG_SCRIPTS, @@ -104,8 +104,6 @@ export async function buildEntry (): Promise { const transformResult: IWxTransformResult = wxTransformer({ code: entryFileCode, sourcePath: entryFilePath, - sourceDir, - outputPath: outputEntryFilePath, isApp: true, isTyped: REG_TYPESCRIPT.test(entryFilePath), adapter: buildAdapter, diff --git a/packages/taro-cli/src/mini/helper.ts b/packages/taro-cli/src/mini/helper.ts index de8f4f50dc26..4d998cd8dbb7 100644 --- a/packages/taro-cli/src/mini/helper.ts +++ b/packages/taro-cli/src/mini/helper.ts @@ -3,7 +3,7 @@ import * as path from 'path' import * as _ from 'lodash' import { Config } from '@tarojs/taro' -import * as wxTransformer from '@tarojs/transformer-wx' +import wxTransformer from '@tarojs/transformer-wx' import getHashName from '../util/hash' import { @@ -376,9 +376,6 @@ export function getImportTaroSelfComponents (filePath, taroSelfComponents) { const transformResult: IWxTransformResult = wxTransformer({ code: scriptContent, sourcePath: sourceFilePath, - sourceDir: getBuildData().sourceDir, - outputPath: outputFilePath, - isNormal: true, isTyped: false, adapter: BUILD_TYPES.QUICKAPP }) diff --git a/packages/taro-cli/src/mini/page.ts b/packages/taro-cli/src/mini/page.ts index e0846ac19ab3..845f2fa4494a 100644 --- a/packages/taro-cli/src/mini/page.ts +++ b/packages/taro-cli/src/mini/page.ts @@ -2,7 +2,7 @@ import * as fs from 'fs-extra' import * as path from 'path' import { Config as IConfig } from '@tarojs/taro' -import * as wxTransformer from '@tarojs/transformer-wx' +import wxTransformer from '@tarojs/transformer-wx' import * as _ from 'lodash' import { @@ -105,8 +105,6 @@ export async function buildSinglePage (page: string) { const aheadTransformResult: IWxTransformResult = wxTransformer({ code: pageJsContent, sourcePath: pageJs, - sourceDir, - outputPath: outputPageJSPath, isRoot: true, isTyped: REG_TYPESCRIPT.test(pageJs), adapter: buildAdapter, diff --git a/packages/taro-cli/src/mini/webpack.ts b/packages/taro-cli/src/mini/webpack.ts index 0c002258716f..551493052e81 100644 --- a/packages/taro-cli/src/mini/webpack.ts +++ b/packages/taro-cli/src/mini/webpack.ts @@ -49,7 +49,8 @@ async function buildWithWebpack ({ appPath }: { appPath: string }) { babel: babelConfig }, isWatch: !isProduction, - constantsReplaceList + designWidth: projectConfig.designWidth, + deviceRatio: projectConfig.deviceRatio } miniRunner(miniRunnerOpts) } diff --git a/packages/taro-cli/src/rn/transformJS.ts b/packages/taro-cli/src/rn/transformJS.ts index 52d2040085fc..ed19a7951b99 100644 --- a/packages/taro-cli/src/rn/transformJS.ts +++ b/packages/taro-cli/src/rn/transformJS.ts @@ -4,12 +4,11 @@ import traverse, { NodePath } from 'babel-traverse' import * as t from 'babel-types' import * as _ from 'lodash' import generate from 'babel-generator' -import * as wxTransformer from '@tarojs/transformer-wx' +import wxTransformer from '@tarojs/transformer-wx' import * as Util from '../util' import babylonConfig from '../config/babylon' -import { convertSourceStringToAstExpression as toAst } from '../util/astConvert' +import { convertSourceStringToAstExpression as toAst, convertAstExpressionToVariable as toVar } from '../util/astConvert' import { REG_STYLE, REG_TYPESCRIPT, BUILD_TYPES, REG_SCRIPTS } from '../util/constants' -import { convertAstExpressionToVariable as toVar } from '../util/astConvert' const template = require('babel-template') @@ -137,7 +136,6 @@ function getJSAst (code, filePath) { return wxTransformer({ code, sourcePath: filePath, - isNormal: true, isTyped: REG_TYPESCRIPT.test(filePath), adapter: 'rn' }).ast diff --git a/packages/taro-cli/src/ui/common.ts b/packages/taro-cli/src/ui/common.ts index 6ca2cb599757..a2f39a7f8172 100644 --- a/packages/taro-cli/src/ui/common.ts +++ b/packages/taro-cli/src/ui/common.ts @@ -5,11 +5,9 @@ import * as path from 'path' import * as wxTransformer from '@tarojs/transformer-wx' import generate from 'babel-generator' import * as fs from 'fs-extra' -import { parseAst } from '../mini/astProcess' import { IBuildData } from './ui.types' import { cssImports, printLog, resolveScriptPath, resolveStylePath, isNpmPkg } from '../util' -import { PARSE_AST_TYPE, processTypeEnum, REG_STYLE, REG_TYPESCRIPT, CSS_EXT } from '../util/constants' -import { IComponentObj } from '../mini/interface' +import { processTypeEnum, REG_STYLE, REG_TYPESCRIPT, REG_SCRIPT, REG_JSON, REG_FONT, REG_IMAGE, REG_MEDIA, CSS_EXT } from '../util/constants' let processedScriptFiles: Set = new Set() @@ -20,6 +18,85 @@ export const RN_OUTPUT_NAME = 'rn' export const TEMP_DIR = '.temp' export const RN_TEMP_DIR = 'rn_temp' +interface IComponentObj { + name?: string, + path: string | null, + type?: string +} + +interface IParseAstReturn { + styleFiles: string[], + scriptFiles: string[], + jsonFiles: string[], + mediaFiles: string[] +} + +function parseAst ( + ast: t.File, + sourceFilePath: string +): IParseAstReturn { + const styleFiles: string[] = [] + const scriptFiles: string[] = [] + const jsonFiles: string[] = [] + const mediaFiles: string[] = [] + + traverse(ast, { + Program: { + exit (astPath) { + astPath.traverse({ + ImportDeclaration (astPath) { + const node = astPath.node + const source = node.source + const value = source.value + const valueExtname = path.extname(value) + if (value.indexOf('.') === 0) { + let importPath = path.resolve(path.dirname(sourceFilePath), value) + importPath = resolveScriptPath(importPath) + if (REG_SCRIPT.test(valueExtname) || REG_TYPESCRIPT.test(valueExtname)) { + const vpath = path.resolve(sourceFilePath, '..', value) + let fPath = value + if (fs.existsSync(vpath) && vpath !== sourceFilePath) { + fPath = vpath + } + if (scriptFiles.indexOf(fPath) < 0) { + scriptFiles.push(fPath) + } + } else if (REG_JSON.test(valueExtname)) { + const vpath = path.resolve(sourceFilePath, '..', value) + if (fs.existsSync(vpath) && jsonFiles.indexOf(vpath) < 0) { + jsonFiles.push(vpath) + } + } else if (REG_FONT.test(valueExtname) || REG_IMAGE.test(valueExtname) || REG_MEDIA.test(valueExtname)) { + const vpath = path.resolve(sourceFilePath, '..', value) + if (fs.existsSync(vpath) && mediaFiles.indexOf(vpath) < 0) { + mediaFiles.push(vpath) + } + } else if (REG_STYLE.test(valueExtname)) { + const vpath = path.resolve(path.dirname(sourceFilePath), value) + if (fs.existsSync(vpath) && styleFiles.indexOf(vpath) < 0) { + styleFiles.push(vpath) + } + } else { + const vpath = resolveScriptPath(path.resolve(sourceFilePath, '..', value)) + if (fs.existsSync(vpath) && scriptFiles.indexOf(vpath) < 0) { + scriptFiles.push(vpath) + } + } + } + } + }) + } + } + }) + + return { + styleFiles, + scriptFiles, + jsonFiles, + mediaFiles + } +} + export function parseEntryAst (ast: t.File, relativeFile: string) { const styleFiles: string[] = [] const components: IComponentObj[] = [] @@ -157,7 +234,7 @@ export function analyzeFiles (files: string[], sourceDir: string, outputDir: str scriptFiles, jsonFiles, mediaFiles - } = parseAst(PARSE_AST_TYPE.NORMAL, transformResult.ast, [], file, file, true) + } = parseAst(transformResult.ast, file) const resFiles = styleFiles.concat(scriptFiles, jsonFiles, mediaFiles) diff --git a/packages/taro-cli/src/util/resolve_npm_files.ts b/packages/taro-cli/src/util/resolve_npm_files.ts index dd99b33ee1a0..355258ef73b1 100644 --- a/packages/taro-cli/src/util/resolve_npm_files.ts +++ b/packages/taro-cli/src/util/resolve_npm_files.ts @@ -1,7 +1,7 @@ import * as fs from 'fs-extra' import * as path from 'path' import * as resolvePath from 'resolve' -import * as wxTransformer from '@tarojs/transformer-wx' +import wxTransformer from '@tarojs/transformer-wx' import * as babel from 'babel-core' import * as t from 'babel-types' import traverse from 'babel-traverse' @@ -435,8 +435,6 @@ async function recursiveRequire ({ const transformResult = wxTransformer({ code: fileContent, sourcePath: filePath, - outputPath: outputNpmPath, - isNormal: true, adapter: buildAdapter, isTyped: REG_TYPESCRIPT.test(filePath), env: constantsReplaceList From ed9e755db18116642c02653d24ede23a33902b8f Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 28 May 2019 23:25:45 +0800 Subject: [PATCH 013/194] =?UTF-8?q?fix(cli):=20lerna=20=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=20taro-mini-runner=20&&=20=E6=8E=A5=E5=85=A5=20webpack=20?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lerna.json | 1 + packages/taro-mini-runner/src/config/babel.ts | 20 + .../taro-mini-runner/src/config/babylon.ts | 15 + .../src/config/browser_list.ts | 5 + packages/taro-mini-runner/src/config/index.ts | 7 + .../src/config/manifest.default.json | 21 + .../taro-mini-runner/src/config/tsconfig.json | 28 ++ .../taro-mini-runner/src/config/uglify.ts | 1 + packages/taro-mini-runner/src/index.ts | 11 +- .../src/loaders/fileParseLoader.ts | 467 +++++++++++++++++- .../src/loaders/wxTransformerLoader.ts | 16 +- .../src/plugins/miniPlugin.ts | 63 ++- .../taro-mini-runner/src/utils/astConvert.ts | 97 ++++ .../taro-mini-runner/src/utils/constants.ts | 23 + packages/taro-mini-runner/src/utils/index.ts | 11 + 15 files changed, 757 insertions(+), 29 deletions(-) create mode 100644 packages/taro-mini-runner/src/config/babel.ts create mode 100644 packages/taro-mini-runner/src/config/babylon.ts create mode 100644 packages/taro-mini-runner/src/config/browser_list.ts create mode 100644 packages/taro-mini-runner/src/config/index.ts create mode 100644 packages/taro-mini-runner/src/config/manifest.default.json create mode 100644 packages/taro-mini-runner/src/config/tsconfig.json create mode 100644 packages/taro-mini-runner/src/config/uglify.ts create mode 100644 packages/taro-mini-runner/src/utils/astConvert.ts diff --git a/lerna.json b/lerna.json index 94f49f1b165e..c78b3ca91696 100644 --- a/lerna.json +++ b/lerna.json @@ -31,6 +31,7 @@ "packages/taro-qq", "packages/taro-jd", "packages/taro-webpack-runner", + "packages/taro-mini-runner", "packages/postcss-plugin-constparse", "packages/eslint-config-taro", "packages/eslint-plugin-taro", diff --git a/packages/taro-mini-runner/src/config/babel.ts b/packages/taro-mini-runner/src/config/babel.ts new file mode 100644 index 000000000000..aba848350e57 --- /dev/null +++ b/packages/taro-mini-runner/src/config/babel.ts @@ -0,0 +1,20 @@ +const babelOptions: IBabelOptions = { + sourceMap: true, + presets: [ + 'env' + ], + plugins: [ + require('babel-plugin-transform-react-jsx'), + 'transform-decorators-legacy', + 'transform-class-properties', + 'transform-object-rest-spread' + ] +} + +export default babelOptions + +export interface IBabelOptions { + sourceMap: boolean, + presets: string[], + plugins: any[] +} diff --git a/packages/taro-mini-runner/src/config/babylon.ts b/packages/taro-mini-runner/src/config/babylon.ts new file mode 100644 index 000000000000..1c1e778de91d --- /dev/null +++ b/packages/taro-mini-runner/src/config/babylon.ts @@ -0,0 +1,15 @@ +export default { + sourceType: 'module', + plugins: [ + 'typescript', + 'classProperties', + 'jsx', + 'trailingFunctionCommas', + 'asyncFunctions', + 'exponentiationOperator', + 'asyncGenerators', + 'objectRestSpread', + 'decorators', + 'dynamicImport' + ] +} diff --git a/packages/taro-mini-runner/src/config/browser_list.ts b/packages/taro-mini-runner/src/config/browser_list.ts new file mode 100644 index 000000000000..cf45da8e1957 --- /dev/null +++ b/packages/taro-mini-runner/src/config/browser_list.ts @@ -0,0 +1,5 @@ +export default [ + 'last 3 versions', + 'Android >= 4.1', + 'ios >= 8' +] diff --git a/packages/taro-mini-runner/src/config/index.ts b/packages/taro-mini-runner/src/config/index.ts new file mode 100644 index 000000000000..677c1b768226 --- /dev/null +++ b/packages/taro-mini-runner/src/config/index.ts @@ -0,0 +1,7 @@ +export default { + OUTPUT_DIR: 'dist', + SOURCE_DIR: 'src', + TEMP_DIR: '.temp', + NPM_DIR: 'npm', + ENTRY: 'app' +} diff --git a/packages/taro-mini-runner/src/config/manifest.default.json b/packages/taro-mini-runner/src/config/manifest.default.json new file mode 100644 index 000000000000..660199e37ebc --- /dev/null +++ b/packages/taro-mini-runner/src/config/manifest.default.json @@ -0,0 +1,21 @@ +{ + "package": "com.application.demo", + "name": "TaroQuickApp", + "versionName": "1.0.0", + "versionCode": "1", + "minPlatformVersion": "101", + "features": [ + { "name": "system.prompt" }, + { "name": "system.router" }, + { "name": "system.shortcut" }, + { "name": "system.fetch" }, + { "name": "system.storage" }, + { "name": "system.barcode" } + ], + "permissions": [ + { "origin": "*" } + ], + "config": { + "logLevel": "debug" + } +} diff --git a/packages/taro-mini-runner/src/config/tsconfig.json b/packages/taro-mini-runner/src/config/tsconfig.json new file mode 100644 index 000000000000..7ecbfd0cf517 --- /dev/null +++ b/packages/taro-mini-runner/src/config/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "baseUrl": ".", + "declaration": false, + "experimentalDecorators": true, + "jsx": "react", + "jsxFactory": "Nerv.createElement", + "module": "commonjs", + "moduleResolution": "node", + "noImplicitAny": false, + "noUnusedLocals": true, + "outDir": "./dist/", + "preserveConstEnums": true, + "removeComments": false, + "rootDir": ".", + "sourceMap": true, + "strictNullChecks": true, + "target": "es6" + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules" + ], + "compileOnSave": false +} diff --git a/packages/taro-mini-runner/src/config/uglify.ts b/packages/taro-mini-runner/src/config/uglify.ts new file mode 100644 index 000000000000..43ea6b431bb8 --- /dev/null +++ b/packages/taro-mini-runner/src/config/uglify.ts @@ -0,0 +1 @@ +export default { } diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index 09a721802a9a..b4564b781348 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -10,23 +10,30 @@ export default function build (config: IBuildConfig) { const { babel } = compilePlugins const webpackConfig = { mode: config.isWatch ? 'development' : 'production', + devtool: "inline-source-map", entry: config.entry, output: { filename: '[name].js', publicPath: '/', path: config.outputDir, }, + resolve: { + extensions: ['.ts', '.tsx', '.js', '.jsx'] + }, module: { rules: [ { test: /\.(tsx?|jsx?)$/, - include: /src/, exclude: /node_modules/, use: [{ loader: path.resolve(__dirname, './loaders/fileParseLoader'), options: { babel, - constantsReplaceList: config.constantsReplaceList + designWidth: config.designWidth, + deviceRatio: config.deviceRatio, + buildAdapter: config.buildAdapter, + constantsReplaceList: config.constantsReplaceList, + fileTypeMap: MiniPlugin.getTaroFileTypeMap() } }, { loader: path.resolve(__dirname, './loaders/wxTransformerLoader'), diff --git a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts index 7c4c2921aa69..c7359c35242a 100644 --- a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts +++ b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts @@ -1,15 +1,468 @@ +import * as path from 'path' + import { getOptions } from 'loader-utils' import { transform, transformFromAst } from 'babel-core' +import * as t from 'babel-types' +import generate from 'better-babel-generator' +import traverse from 'babel-traverse' +import * as _ from 'lodash' + +import { + BUILD_TYPES, + taroJsFramework, + taroJsComponents, + taroJsRedux, + QUICKAPP_SPECIAL_COMPONENTS, + PARSE_AST_TYPE +} from '../utils/constants' +import { + isNpmPkg, + isQuickAppPkg +} from '../utils' +import { convertSourceStringToAstExpression } from '../utils/astConvert' +import babylonConfig from '../config/babylon' + +const template = require('babel-template') const cannotRemoves = ['@tarojs/taro', 'react', 'nervjs'] +function processAst ( + ast: t.File, + buildAdapter: BUILD_TYPES, + type: PARSE_AST_TYPE, + designWidth: number, + deviceRatio: number, + sourceFilePath: string, + sourceDir: string +) { + const taroMiniAppFramework = `@tarojs/taro-${buildAdapter}` + let componentClassName: string = '' + let taroJsReduxConnect: string = '' + let taroImportDefaultName + let needExportDefault = false + let exportTaroReduxConnected: string | null = null + const isQuickApp = buildAdapter === BUILD_TYPES.QUICKAPP + const cannotRemoves = [taroJsFramework, 'react', 'nervjs'] + let hasComponentDidHide + let hasComponentDidShow + let hasComponentWillMount + let hasEnablePageScroll + if (isQuickApp) { + cannotRemoves.push(taroJsComponents) + } + const taroSelfComponents = new Set() + + traverse(ast, { + ClassDeclaration (astPath) { + const node = astPath.node + let hasCreateData = false + if (node.superClass) { + astPath.traverse({ + ClassMethod (astPath) { + if (astPath.get('key').isIdentifier({ name: '_createData' })) { + hasCreateData = true + } + } + }) + if (hasCreateData) { + needExportDefault = true + if (node.id === null) { + componentClassName = '_TaroComponentClass' + astPath.replaceWith( + t.classDeclaration( + t.identifier(componentClassName), + node.superClass as t.Expression, + node.body as t.ClassBody, + node.decorators as t.Decorator[] || [] + ) + ) + } else if (node.id.name === 'App') { + componentClassName = '_App' + astPath.replaceWith( + t.classDeclaration( + t.identifier(componentClassName), + node.superClass as t.Expression, + node.body as t.ClassBody, + node.decorators as t.Decorator[] || [] + ) + ) + } else { + componentClassName = node.id.name + } + } + } + }, + + ClassExpression (astPath) { + const node = astPath.node + if (node.superClass) { + let hasCreateData = false + astPath.traverse({ + ClassMethod (astPath) { + if (astPath.get('key').isIdentifier({ name: '_createData' })) { + hasCreateData = true + } + } + }) + if (hasCreateData) { + needExportDefault = true + if (node.id === null) { + const parentNode = astPath.parentPath.node as any + if (t.isVariableDeclarator(astPath.parentPath)) { + componentClassName = parentNode.id.name + } else { + componentClassName = '_TaroComponentClass' + } + astPath.replaceWith( + t.classExpression( + t.identifier(componentClassName), + node.superClass as t.Expression, + node.body as t.ClassBody, + node.decorators as t.Decorator[] || [] + ) + ) + } else if (node.id.name === 'App') { + componentClassName = '_App' + astPath.replaceWith( + t.classExpression( + t.identifier(componentClassName), + node.superClass as t.Expression, + node.body as t.ClassBody, + node.decorators as t.Decorator[] || [] + ) + ) + } else { + componentClassName = node.id.name + } + } + } + }, + + ClassMethod (astPath) { + const keyName = (astPath.get('key').node as t.Identifier).name + if (keyName === 'componentWillMount') { + hasComponentWillMount = true + } else if (keyName === 'componentDidShow') { + hasComponentDidShow = true + } else if (keyName === 'componentDidHide') { + hasComponentDidHide = true + } else if (keyName === 'onPageScroll' || keyName === 'onReachBottom') { + hasEnablePageScroll = true + } + }, + + ClassProperty (astPath) { + const node = astPath.node + const keyName = node.key.name + const valuePath = astPath.get('value') + if (valuePath.isFunctionExpression() || valuePath.isArrowFunctionExpression()) { + if (keyName === 'componentWillMount') { + hasComponentWillMount = true + } else if (keyName === 'componentDidShow') { + hasComponentDidShow = true + } else if (keyName === 'componentDidHide') { + hasComponentDidHide = true + } + } + }, + + ImportDeclaration (astPath) { + const node = astPath.node + const source = node.source + let value = source.value + const specifiers = node.specifiers + if (isNpmPkg(value) && !isQuickAppPkg(value)) { + if (value === taroJsComponents) { + if (isQuickApp) { + specifiers.forEach(specifier => { + const name = specifier.local.name + if (!QUICKAPP_SPECIAL_COMPONENTS.has(name)) { + taroSelfComponents.add(_.kebabCase(name)) + } + }) + } + taroSelfComponents.add('taro-page') + astPath.remove() + } else { + const specifiers = node.specifiers + if (value === taroJsFramework) { + let defaultSpecifier: string | null = null + specifiers.forEach(item => { + if (item.type === 'ImportDefaultSpecifier') { + defaultSpecifier = item.local.name + } + }) + if (defaultSpecifier) { + taroImportDefaultName = defaultSpecifier + } + value = taroMiniAppFramework + } else if (value === taroJsRedux) { + specifiers.forEach(item => { + if (item.type === 'ImportSpecifier') { + const local = item.local + if (local.type === 'Identifier' && local.name === 'connect') { + taroJsReduxConnect = item.imported.name + } + } + }) + } + source.value = value + } + } + }, + + CallExpression (astPath) { + const node = astPath.node + const callee = node.callee as (t.Identifier | t.MemberExpression) + if (t.isMemberExpression(callee)) { + if (taroImportDefaultName && (callee.object as t.Identifier).name === taroImportDefaultName && (callee.property as t.Identifier).name === 'render') { + astPath.remove() + } + } else if (callee.name === 'require') { + const args = node.arguments as t.StringLiteral[] + let value = args[0].value + const parentNode = astPath.parentPath.parentPath.node as t.VariableDeclaration + if (isNpmPkg(value) && !isQuickAppPkg(value)) { + if (value === taroJsComponents) { + if (isQuickApp) { + if (parentNode.declarations.length === 1 && parentNode.declarations[0].init) { + const id = parentNode.declarations[0].id + if (id.type === 'ObjectPattern') { + const properties = id.properties as any + properties.forEach(p => { + if (p.type === 'ObjectProperty' && p.value.type === 'Identifier') { + taroSelfComponents.add(_.kebabCase(p.value.name)) + } + }) + } + } + } + astPath.remove() + } else { + if (t.isVariableDeclaration(astPath.parentPath.parentPath)) { + if (parentNode.declarations.length === 1 && parentNode.declarations[0].init) { + const id = parentNode.declarations[0].id + if (value === taroJsFramework && id.type === 'Identifier') { + taroImportDefaultName = id.name + value = taroMiniAppFramework + } else if (value === taroJsRedux) { + const declarations = parentNode.declarations + declarations.forEach(item => { + const id = item.id + if (id.type === 'ObjectPattern') { + const properties = id.properties as any + properties.forEach(p => { + if (p.type === 'ObjectProperty') { + if (p.value.type === 'Identifier' && p.value.name === 'connect') { + taroJsReduxConnect = p.key.name + } + } + }) + } + }) + } + } + } + args[0].value = value + } + } + } + }, + + ExportDefaultDeclaration (astPath) { + const node = astPath.node + const declaration = node.declaration + needExportDefault = false + if ( + declaration && + (declaration.type === 'ClassDeclaration' || declaration.type === 'ClassExpression') + ) { + const superClass = declaration.superClass + if (superClass) { + let hasCreateData = false + astPath.traverse({ + ClassMethod (astPath) { + if (astPath.get('key').isIdentifier({ name: '_createData' })) { + hasCreateData = true + } + } + }) + if (hasCreateData) { + needExportDefault = true + if (declaration.id === null) { + componentClassName = '_TaroComponentClass' + } else if (declaration.id.name === 'App') { + componentClassName = '_App' + } else { + componentClassName = declaration.id.name + } + const isClassDcl = declaration.type === 'ClassDeclaration' + const classDclProps = [t.identifier(componentClassName), superClass, declaration.body, declaration.decorators || []] + astPath.replaceWith(isClassDcl ? t.classDeclaration.apply(null, classDclProps) : t.classExpression.apply(null, classDclProps)) + } + } + } else if (declaration.type === 'CallExpression') { + const callee = declaration.callee + if (callee && callee.type === 'CallExpression') { + const subCallee = callee.callee + if (subCallee.type === 'Identifier' && subCallee.name === taroJsReduxConnect) { + const args = declaration.arguments as t.Identifier[] + if (args.length === 1 && args[0].name === componentClassName) { + needExportDefault = true + exportTaroReduxConnected = `${componentClassName}__Connected` + astPath.replaceWith(t.variableDeclaration('const', [t.variableDeclarator(t.identifier(`${componentClassName}__Connected`), t.callExpression(declaration.callee as t.Expression, declaration.arguments as Array))])) + } + } + } + } else if (declaration.type === 'Identifier') { + const name = declaration.name + if (name === componentClassName || name === exportTaroReduxConnected) { + needExportDefault = true + astPath.remove() + } + } + }, + + Program: { + exit (astPath) { + astPath.traverse({ + ClassBody (astPath) { + if (isQuickApp) { + const node = astPath.node + if (!hasComponentWillMount) { + node.body.push(t.classMethod( + 'method', t.identifier('componentWillMount'), [], + t.blockStatement([]), false, false)) + } + if (!hasComponentDidShow) { + node.body.push(t.classMethod( + 'method', t.identifier('componentDidShow'), [], + t.blockStatement([]), false, false)) + } + if (!hasComponentDidHide) { + node.body.push(t.classMethod( + 'method', t.identifier('componentDidHide'), [], + t.blockStatement([]), false, false)) + } + node.body.push(t.classMethod( + 'method', t.identifier('__listenToSetNavigationBarEvent'), [], + t.blockStatement([convertSourceStringToAstExpression( + `if (!Taro.eventCenter.callbacks['TaroEvent:setNavigationBar']) { + Taro.eventCenter.on('TaroEvent:setNavigationBar', params => { + if (params.title) { + this.$scope.$page.setTitleBar({ text: params.title }) + } + if (params.frontColor) { + this.$scope.$page.setTitleBar({ textColor: params.frontColor }) + } + if (params.backgroundColor) { + this.$scope.$page.setTitleBar({ backgroundColor: params.backgroundColor }) + } + }) + }` + )]), false, false)) + node.body.push(t.classMethod( + 'method', t.identifier('__offListenToSetNavigationBarEvent'), [], + t.blockStatement([convertSourceStringToAstExpression( + `Taro.eventCenter.off('TaroEvent:setNavigationBar')` + )]), false, false)) + } + }, + ClassMethod (astPath) { + if (isQuickApp) { + const node = astPath.node + const keyName = (node.key as t.Identifier).name + if (keyName === 'componentDidShow' || keyName === 'componentWillMount') { + node.body.body.unshift(convertSourceStringToAstExpression(`this.__listenToSetNavigationBarEvent()`)) + } else if (keyName === 'componentDidHide') { + node.body.body.unshift(convertSourceStringToAstExpression(`this.__offListenToSetNavigationBarEvent()`)) + } + } + } + }) + const node = astPath.node as t.Program + const exportVariableName = exportTaroReduxConnected || componentClassName + if (needExportDefault && !isQuickApp) { + const exportDefault = template(`export default ${exportVariableName}`, babylonConfig as any)() + node.body.push(exportDefault as any) + } + switch (type) { + case PARSE_AST_TYPE.ENTRY: + const pxTransformConfig = { + designWidth: designWidth || 750 + } + if (deviceRatio) { + pxTransformConfig['deviceRatio'] = deviceRatio + } + if (isQuickApp) { + if (!taroImportDefaultName) { + node.body.unshift( + template(`import Taro from '${taroMiniAppFramework}'`, babylonConfig as any)() as any + ) + } + node.body.push(template(`export default require('${taroMiniAppFramework}').default.createApp(${exportVariableName})`, babylonConfig as any)() as any) + } else { + node.body.push(template(`App(require('${taroMiniAppFramework}').default.createApp(${exportVariableName}))`, babylonConfig as any)() as any) + } + node.body.push(template(`Taro.initPxTransform(${JSON.stringify(pxTransformConfig)})`, babylonConfig as any)() as any) + break + case PARSE_AST_TYPE.PAGE: + if (buildAdapter === BUILD_TYPES.WEAPP || buildAdapter === BUILD_TYPES.QQ) { + node.body.push(template(`Component(require('${taroMiniAppFramework}').default.createComponent(${exportVariableName}, true))`, babylonConfig as any)() as any) + } else if (isQuickApp) { + const pagePath = sourceFilePath.replace(sourceDir, '').replace(/\\/, '/').replace(path.extname(sourceFilePath), '') + if (!taroImportDefaultName) { + node.body.unshift( + template(`import Taro from '${taroMiniAppFramework}'`, babylonConfig as any)() as any + ) + } + node.body.push(template(`export default require('${taroMiniAppFramework}').default.createComponent(${exportVariableName}, '${pagePath}')`, babylonConfig as any)() as any) + } else { + node.body.push(template(`Page(require('${taroMiniAppFramework}').default.createComponent(${exportVariableName}, true))`, babylonConfig as any)() as any) + } + break + case PARSE_AST_TYPE.COMPONENT: + if (isQuickApp) { + if (!taroImportDefaultName) { + node.body.unshift( + template(`import Taro from '${taroMiniAppFramework}'`, babylonConfig as any)() as any + ) + } + node.body.push(template(`export default require('${taroMiniAppFramework}').default.createComponent(${exportVariableName})`, babylonConfig as any)() as any) + } else { + node.body.push(template(`Component(require('${taroMiniAppFramework}').default.createComponent(${exportVariableName}))`, babylonConfig as any)() as any) + } + break + default: + break + } + } + } + }) + + return ast +} + export default function fileParseLoader (source, ast) { - const { babel: babelConfig, constantsReplaceList } = getOptions(this) - const newBabelConfig = Object.assign({}, babelConfig) - newBabelConfig.plugins = [ - [require('babel-plugin-danger-remove-unused-import'), { ignore: cannotRemoves }], - [require('babel-plugin-transform-define').default, constantsReplaceList] - ].concat(newBabelConfig.plugins) - const res = transformFromAst(ast, '', newBabelConfig) + const { + babel: babelConfig, + constantsReplaceList, + buildAdapter, + designWidth, + deviceRatio, + fileTypeMap + } = getOptions(this) + const filePath = this.resourcePath + const newAst = transformFromAst(ast, '', { + plugins: [ + [require('babel-plugin-danger-remove-unused-import'), { ignore: cannotRemoves }], + [require('babel-plugin-transform-define').default, constantsReplaceList] + ] + }).ast as t.File + const fileTypeInfo = fileTypeMap[filePath] || { type: PARSE_AST_TYPE.NORMAL, config: { } } + const configObj = fileTypeInfo.config + const result = processAst(newAst, buildAdapter, fileTypeInfo.type, designWidth, deviceRatio, filePath, this.context) + const code = generate(result).code + const res = transform(code, babelConfig) return res.code } diff --git a/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts b/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts index 7012f188e3bb..e69e623a81e5 100644 --- a/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts +++ b/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts @@ -1,8 +1,7 @@ import { getOptions } from 'loader-utils' -import * as wxTransformer from '@tarojs/transformer-wx' +import wxTransformer from '@tarojs/transformer-wx' -import { REG_TYPESCRIPT } from '../utils/constants' -import { TARO_FILE_TYPE } from '../plugins/miniPlugin' +import { REG_TYPESCRIPT, PARSE_AST_TYPE } from '../utils/constants' export default function wxTransformerLoader (source) { const { buildAdapter, fileTypeMap } = getOptions(this) @@ -13,10 +12,13 @@ export default function wxTransformerLoader (source) { isTyped: REG_TYPESCRIPT.test(filePath), adapter: buildAdapter } - if (fileTypeMap[filePath] === TARO_FILE_TYPE.APP) { - wxTransformerParams.isApp = true - } else if (fileTypeMap[filePath] === TARO_FILE_TYPE.PAGE) { - wxTransformerParams.isRoot = true + if (fileTypeMap[filePath]) { + const fileType = fileTypeMap[filePath].type + if (fileType === PARSE_AST_TYPE.ENTRY) { + wxTransformerParams.isApp = true + } else if (fileType === PARSE_AST_TYPE.PAGE) { + wxTransformerParams.isRoot = true + } } const transformResult = wxTransformer(wxTransformerParams) this.callback(null, transformResult.code, transformResult.ast) diff --git a/packages/taro-mini-runner/src/plugins/miniPlugin.ts b/packages/taro-mini-runner/src/plugins/miniPlugin.ts index 4c1fa2f0d14b..4f395413e204 100644 --- a/packages/taro-mini-runner/src/plugins/miniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/miniPlugin.ts @@ -1,7 +1,7 @@ import * as path from 'path' import * as fs from 'fs-extra' -import * as wxTransformer from '@tarojs/transformer-wx' +import wxTransformer from '@tarojs/transformer-wx' import * as webpack from 'webpack' import * as SingleEntryPlugin from 'webpack/lib/SingleEntryPlugin' import * as FunctionModulePlugin from 'webpack/lib/FunctionModulePlugin' @@ -13,7 +13,7 @@ import * as t from 'babel-types' import traverse from 'babel-traverse' import { Config as IConfig } from '@tarojs/taro' -import { REG_TYPESCRIPT, BUILD_TYPES } from '../utils/constants' +import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE } from '../utils/constants' import { traverseObjectNode, resolveScriptPath } from '../utils' interface IMiniPluginOptions { @@ -21,17 +21,19 @@ interface IMiniPluginOptions { buildAdapter: BUILD_TYPES } +interface ITaroFileInfo { + [key: string]: { + type: PARSE_AST_TYPE, + config: IConfig, + wxml?: string + } +} + interface IComponent { name: string, path: string } const PLUGIN_NAME = 'MiniPlugin' -const taroFileTypeMap = {} - -export enum TARO_FILE_TYPE { - APP = 'APP', - PAGE = 'PAGE', - COMPONENT = 'COMPONENT' -} +const taroFileTypeMap: ITaroFileInfo = {} export const createTarget = function createTarget(name) { const target = compiler => { @@ -91,6 +93,13 @@ export default class MiniPlugin { await this.run(compiler) }) ) + + compiler.hooks.emit.tapAsync( + PLUGIN_NAME, + this.tryAsync(async compilation => { + await this.generateMiniFiles(compilation) + }) + ) } getAppEntry (compiler) { @@ -109,7 +118,6 @@ export default class MiniPlugin { } const appEntryPath = getEntryPath(entry) this.sourceDir = path.dirname(appEntryPath) - taroFileTypeMap[appEntryPath] = TARO_FILE_TYPE.APP return appEntryPath } @@ -189,10 +197,14 @@ export default class MiniPlugin { if (!appPages || appPages.length === 0) { throw new Error('缺少页面') } + taroFileTypeMap[this.appEntry] = { + type: PARSE_AST_TYPE.ENTRY, + config: configObj, + wxml: transformResult.template + } this.pages = new Set([ ...appPages.map(item => { const pagePath = resolveScriptPath(path.join(this.sourceDir, item)) - taroFileTypeMap[pagePath] = TARO_FILE_TYPE.PAGE return { name: item, path: pagePath } }) ]) @@ -209,13 +221,17 @@ export default class MiniPlugin { isRoot, adapter: buildAdapter }) - + const { configObj } = this.parseAst(transformResult.ast, buildAdapter) + taroFileTypeMap[file.path] = { + type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, + config: configObj, + wxml: transformResult.template + } let depComponents = transformResult.components if (depComponents && depComponents.length) { depComponents.forEach(item => { const componentPath = resolveScriptPath(path.resolve(path.dirname(file.path), item.path)) if (fs.existsSync(componentPath) && !Array.from(this.components).some(item => item.path === componentPath)) { - taroFileTypeMap[componentPath] = TARO_FILE_TYPE.COMPONENT const componentName = componentPath.replace(this.sourceDir, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') const componentObj = { name: componentName, path: componentPath } this.components.add(componentObj) @@ -240,6 +256,27 @@ export default class MiniPlugin { }) } + generateMiniFiles (compilation: webpack.compilation.Compilation) { + Object.keys(taroFileTypeMap).forEach(item => { + const relativePath = item.replace(this.sourceDir, '') + const extname = path.extname(item) + const wxmlPath = relativePath.replace(extname, '.wxml') + const jsonPath = relativePath.replace(extname, '.json') + const itemInfo = taroFileTypeMap[item] + if (itemInfo.type !== PARSE_AST_TYPE.ENTRY) { + compilation.assets[wxmlPath] = { + size: () => itemInfo.wxml!.length, + source: () => itemInfo.wxml + } + } + const jsonStr = JSON.stringify(itemInfo.config) + compilation.assets[jsonPath] = { + size: () => jsonStr.length, + source: () => jsonStr + } + }) + } + run (compiler: webpack.Compiler) { this.appEntry = this.getAppEntry(compiler) this.getPages() diff --git a/packages/taro-mini-runner/src/utils/astConvert.ts b/packages/taro-mini-runner/src/utils/astConvert.ts new file mode 100644 index 000000000000..8aee0493b42f --- /dev/null +++ b/packages/taro-mini-runner/src/utils/astConvert.ts @@ -0,0 +1,97 @@ +import * as t from 'babel-types' +import generate from 'better-babel-generator' + +import babylonConfig from '../config/babylon' + +const template = require('babel-template') + +export function convertObjectToAstExpression (obj: object): t.ObjectProperty[] { + const objArr = Object.keys(obj).map(key => { + const value = obj[key] + if (typeof value === 'string') { + return t.objectProperty(t.stringLiteral(key), t.stringLiteral(value)) + } + if (typeof value === 'number') { + return t.objectProperty(t.stringLiteral(key), t.numericLiteral(value)) + } + if (typeof value === 'boolean') { + return t.objectProperty(t.stringLiteral(key), t.booleanLiteral(value)) + } + if (Array.isArray(value)) { + return t.objectProperty(t.stringLiteral(key), t.arrayExpression(convertArrayToAstExpression(value as []))) + } + if (typeof value === 'object') { + return t.objectProperty(t.stringLiteral(key), t.objectExpression(convertObjectToAstExpression(value))) + } + return t.objectProperty(t.stringLiteral(key), t.nullLiteral()) + }) + return objArr +} + +// 最低限度的转义: https://github.com/mathiasbynens/jsesc#minimal +export function generateMinimalEscapeCode (ast: t.File) { + return generate(ast, { + jsescOption: { + minimal: true + } + }).code +} + +export function convertArrayToAstExpression (arr: any[]): any[] { + return arr.map(value => { + if (typeof value === 'string') { + return t.stringLiteral(value) + } + if (typeof value === 'number') { + return t.numericLiteral(value) + } + if (typeof value === 'boolean') { + return t.booleanLiteral(value) + } + if (Array.isArray(value)) { + return convertArrayToAstExpression(value) + } + if (typeof value === 'object') { + return t.objectExpression(convertObjectToAstExpression(value)) + } + return t.nullLiteral() + }) +} + +export function convertSourceStringToAstExpression (str: string, opts: object = {}) { + return template(str, Object.assign({}, babylonConfig, opts))() +} + +export function convertAstExpressionToVariable (node) { + if (t.isObjectExpression(node)) { + const obj = {} + const properties = node.properties + properties.forEach(property => { + if (property.type === 'ObjectProperty' || property.type === 'ObjectMethod') { + const key = convertAstExpressionToVariable(property.key) + const value = convertAstExpressionToVariable(property.value) + obj[key] = value + } + }) + return obj + } else if (t.isArrayExpression(node)) { + return node.elements.map(convertAstExpressionToVariable) + } else if (t.isLiteral(node)) { + return node['value'] + } else if (t.isIdentifier(node) || t.isJSXIdentifier(node)) { + const name = node.name + return name === 'undefined' + ? undefined + : name + } else if (t.isJSXExpressionContainer(node)) { + return convertAstExpressionToVariable(node.expression) + } +} + +export const getObjKey = (node) => { + if (t.isIdentifier(node)) { + return node.name + } else { + return node.value + } +} diff --git a/packages/taro-mini-runner/src/utils/constants.ts b/packages/taro-mini-runner/src/utils/constants.ts index b52397e6f3a8..2e416f235903 100644 --- a/packages/taro-mini-runner/src/utils/constants.ts +++ b/packages/taro-mini-runner/src/utils/constants.ts @@ -1,3 +1,5 @@ +import * as os from 'os' + export const CSS_EXT: string[] = ['.css', '.scss', '.sass', '.less', '.styl', '.wxss', '.acss'] export const SCSS_EXT: string[] = ['.scss'] export const JS_EXT: string[] = ['.js', '.jsx'] @@ -84,3 +86,24 @@ export const CONFIG_MAP = { selectedIconPath: 'selectedIconPath' } } + + +export const taroJsComponents = '@tarojs/components' +export const taroJsQuickAppComponents = '@tarojs/components-qa' +export const taroJsFramework = '@tarojs/taro' +export const taroJsRedux = '@tarojs/redux' + +export const DEVICE_RATIO_NAME = 'deviceRatio' +export const isWindows = os.platform() === 'win32' + +export const QUICKAPP_SPECIAL_COMPONENTS = new Set([ + 'View', + 'Text' +]) + +export enum PARSE_AST_TYPE { + ENTRY = 'ENTRY', + PAGE = 'PAGE', + COMPONENT = 'COMPONENT', + NORMAL = 'NORMAL' +} diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index 850fea41a783..bcff6290cdec 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -5,6 +5,17 @@ import * as t from 'babel-types' import { CONFIG_MAP, JS_EXT, TS_EXT } from './constants' +export function isNpmPkg (name: string): boolean { + if (/^(\.|\/)/.test(name)) { + return false + } + return true +} + +export function isQuickAppPkg (name: string): boolean { + return /@system\./.test(name) +} + export function traverseObjectNode (node, buildAdapter: string, parentKey?: string) { if (node.type === 'ClassProperty' || node.type === 'ObjectProperty') { const properties = node.value.properties From f08eac96c1caa8cc84a7a9ae78a56562fcf2cd6f Mon Sep 17 00:00:00 2001 From: yuche Date: Wed, 29 May 2019 13:53:42 +0800 Subject: [PATCH 014/194] =?UTF-8?q?refactor(transformer):=20isNormal=20?= =?UTF-8?q?=E5=8F=98=E4=B8=BA=E5=8F=AF=E9=80=89=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-transformer-wx/src/index.ts | 15 +++++++++++++++ packages/taro-transformer-wx/src/options.ts | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/taro-transformer-wx/src/index.ts b/packages/taro-transformer-wx/src/index.ts index 99513c9a2885..f6cea4bae831 100644 --- a/packages/taro-transformer-wx/src/index.ts +++ b/packages/taro-transformer-wx/src/index.ts @@ -252,6 +252,21 @@ export default function transform (options: TransformOptions): TransformResult { // 原因大概是 babylon.parse 没有生成 File 实例导致 scope 和 path 原型上都没有 `file` // 将来升级到 babel@7 可以直接用 parse 而不是 transform const ast = parse(code, buildBabelTransformOptions()).ast as t.File + // traverse(ast, { + // JSXElement (p) { + // setIsNormal(false) + // p.stop() + // }, + // ImportDeclaration (path) { + // const { source, specifiers } = path.node + // if (source.value === TARO_PACKAGE_NAME) { + // if (specifiers.some(s => s.local.name === 'Component')) { + // setIsNormal(false) + // path.stop() + // } + // } + // } + // }) if (options.isNormal) { if (options.isTyped) { const mainClassNode = ast.program.body.find(v => { diff --git a/packages/taro-transformer-wx/src/options.ts b/packages/taro-transformer-wx/src/options.ts index 79bd9d78d300..4f2a486720f5 100644 --- a/packages/taro-transformer-wx/src/options.ts +++ b/packages/taro-transformer-wx/src/options.ts @@ -14,7 +14,7 @@ export interface Options { code: string, isTyped: boolean, isNormal?: boolean, - env?: object, + env?: Object, adapter?: Adapters, jsxAttributeNameReplace?: Object, rootProps?: object From 3bc5450cca32271ae491244d9c9a7f9f849c529f Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 29 May 2019 16:13:15 +0800 Subject: [PATCH 015/194] =?UTF-8?q?fix(cli):=20=E6=99=AE=E9=80=9A=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=BB=8F=E8=BF=87=E7=BC=96=E8=AF=91=E5=99=A8=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E5=BF=85=E9=A1=BB=E4=BC=A0=E5=85=A5=20isNormal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/convertor/index.ts | 1 + packages/taro-cli/src/h5/index.ts | 1 + packages/taro-cli/src/mini/compileScript.ts | 4 +--- packages/taro-cli/src/mini/component.ts | 3 ++- packages/taro-cli/src/mini/helper.ts | 1 + packages/taro-cli/src/rn/transformJS.ts | 1 + packages/taro-cli/src/ui/h5.ts | 1 - packages/taro-cli/src/util/resolve_npm_files.ts | 1 + 8 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/taro-cli/src/convertor/index.ts b/packages/taro-cli/src/convertor/index.ts index 68c22766c756..dc6d0147c07a 100644 --- a/packages/taro-cli/src/convertor/index.ts +++ b/packages/taro-cli/src/convertor/index.ts @@ -407,6 +407,7 @@ export default class Convertor { const transformResult = wxTransformer({ code, sourcePath: file, + isNormal: true, isTyped: REG_TYPESCRIPT.test(file) }) const { ast, scriptFiles } = this.parseAst({ diff --git a/packages/taro-cli/src/h5/index.ts b/packages/taro-cli/src/h5/index.ts index e37935b6b688..e0c5d3e253ec 100644 --- a/packages/taro-cli/src/h5/index.ts +++ b/packages/taro-cli/src/h5/index.ts @@ -295,6 +295,7 @@ class Compiler { let ast = wxTransformer({ code, sourcePath: filePath, + isNormal: true, isTyped: REG_TYPESCRIPT.test(filePath), adapter: 'h5' }).ast diff --git a/packages/taro-cli/src/mini/compileScript.ts b/packages/taro-cli/src/mini/compileScript.ts index 95df8fe21e21..c0b34d3d1276 100644 --- a/packages/taro-cli/src/mini/compileScript.ts +++ b/packages/taro-cli/src/mini/compileScript.ts @@ -85,6 +85,7 @@ export function compileDepScripts (scriptFiles: string[], needUseBabel?: boolean sourcePath: item, isTyped: REG_TYPESCRIPT.test(item), adapter: buildAdapter, + isNormal: true, env: constantsReplaceList, jsxAttributeNameReplace }) @@ -142,7 +143,6 @@ export async function compileScriptFile ( ): Promise { const { appPath, - sourceDir, constantsReplaceList, jsxAttributeNameReplace, projectConfig @@ -159,8 +159,6 @@ export async function compileScriptFile ( const transformResult: IWxTransformResult = wxTransformer({ code, sourcePath: sourceFilePath, - sourceDir, - outputPath: outputFilePath, isNormal: true, isTyped: false, adapter, diff --git a/packages/taro-cli/src/mini/component.ts b/packages/taro-cli/src/mini/component.ts index 49e52b8e618a..61fc5848ebca 100644 --- a/packages/taro-cli/src/mini/component.ts +++ b/packages/taro-cli/src/mini/component.ts @@ -68,6 +68,7 @@ export function isFileToBeTaroComponent ( sourcePath: sourcePath, isTyped: REG_TYPESCRIPT.test(sourcePath), adapter: buildAdapter, + isNormal: true, env: constantsReplaceList, jsxAttributeNameReplace, alias @@ -165,7 +166,7 @@ export async function buildSingleComponent ( const outputComponentJSONPath = outputComponentJSPath.replace(extnameExpRegOf(outputComponentJSPath), outputFilesTypes.CONFIG) try { - const isTaroComponentRes = isFileToBeTaroComponent(componentContent, component, outputComponentJSPath) + const isTaroComponentRes = isFileToBeTaroComponent(componentContent, component) const componentExportsMap = getComponentExportsMap() if (!isTaroComponentRes.isTaroComponent) { const transformResult = isTaroComponentRes.transformResult diff --git a/packages/taro-cli/src/mini/helper.ts b/packages/taro-cli/src/mini/helper.ts index 4d998cd8dbb7..f2ba9387a725 100644 --- a/packages/taro-cli/src/mini/helper.ts +++ b/packages/taro-cli/src/mini/helper.ts @@ -376,6 +376,7 @@ export function getImportTaroSelfComponents (filePath, taroSelfComponents) { const transformResult: IWxTransformResult = wxTransformer({ code: scriptContent, sourcePath: sourceFilePath, + isNormal: true, isTyped: false, adapter: BUILD_TYPES.QUICKAPP }) diff --git a/packages/taro-cli/src/rn/transformJS.ts b/packages/taro-cli/src/rn/transformJS.ts index ed19a7951b99..849c008a262d 100644 --- a/packages/taro-cli/src/rn/transformJS.ts +++ b/packages/taro-cli/src/rn/transformJS.ts @@ -136,6 +136,7 @@ function getJSAst (code, filePath) { return wxTransformer({ code, sourcePath: filePath, + isNormal: true, isTyped: REG_TYPESCRIPT.test(filePath), adapter: 'rn' }).ast diff --git a/packages/taro-cli/src/ui/h5.ts b/packages/taro-cli/src/ui/h5.ts index 3e3df61370cd..c80faa65b363 100644 --- a/packages/taro-cli/src/ui/h5.ts +++ b/packages/taro-cli/src/ui/h5.ts @@ -57,7 +57,6 @@ async function buildH5Lib (uiIndex, buildData: IBuildData) { const transformResult = wxTransformer({ code, sourcePath: tempEntryFilePath, - outputPath: outputEntryFilePath, isNormal: true, isTyped: REG_TYPESCRIPT.test(tempEntryFilePath) }) diff --git a/packages/taro-cli/src/util/resolve_npm_files.ts b/packages/taro-cli/src/util/resolve_npm_files.ts index 355258ef73b1..554905d7536f 100644 --- a/packages/taro-cli/src/util/resolve_npm_files.ts +++ b/packages/taro-cli/src/util/resolve_npm_files.ts @@ -436,6 +436,7 @@ async function recursiveRequire ({ code: fileContent, sourcePath: filePath, adapter: buildAdapter, + isNormal: true, isTyped: REG_TYPESCRIPT.test(filePath), env: constantsReplaceList }) From f209936de2fc5640e7f5af46b8d150d8b68268f3 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 29 May 2019 22:21:48 +0800 Subject: [PATCH 016/194] =?UTF-8?q?feat(cli):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/mini/webpack.ts | 2 + packages/taro-mini-runner/package.json | 4 + packages/taro-mini-runner/src/index.ts | 22 +- .../taro-mini-runner/src/loaders/loader.ts | 4 + .../src/loaders/wxTransformerLoader.ts | 15 +- .../src/plugins/miniPlugin.ts | 22 +- .../src/plugins/removeStyleImport.ts | 3 + packages/taro-mini-runner/yarn.lock | 453 +++++++++++++++++- 8 files changed, 492 insertions(+), 33 deletions(-) create mode 100644 packages/taro-mini-runner/src/loaders/loader.ts create mode 100644 packages/taro-mini-runner/src/plugins/removeStyleImport.ts diff --git a/packages/taro-cli/src/mini/webpack.ts b/packages/taro-cli/src/mini/webpack.ts index 551493052e81..35039c096136 100644 --- a/packages/taro-cli/src/mini/webpack.ts +++ b/packages/taro-cli/src/mini/webpack.ts @@ -43,12 +43,14 @@ async function buildWithWebpack ({ appPath }: { appPath: string }) { entry: { app: entryFilePath }, + sourceDir, outputDir, buildAdapter, plugins: { babel: babelConfig }, isWatch: !isProduction, + constantsReplaceList, designWidth: projectConfig.designWidth, deviceRatio: projectConfig.deviceRatio } diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index 32eb4ac8d7f2..1472a4007fbc 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -43,10 +43,14 @@ "babel-types": "^6.26.0", "better-babel-generator": "^6.26.1", "chalk": "^2.4.2", + "file-loader": "^3.0.1", "fs-extra": "^8.0.1", "loader-utils": "^1.2.3", "lodash": "^4.17.11", + "node-sass": "^4.12.0", "ora": "^3.4.0", + "sass-loader": "^7.1.0", + "virtual-module-webpack-plugin": "^0.4.1", "webpack": "^4.31.0", "webpack-chain": "^6.0.0", "webpack-format-messages": "^2.0.5" diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index b4564b781348..acfd823b6ee4 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -42,7 +42,27 @@ export default function build (config: IBuildConfig) { fileTypeMap: MiniPlugin.getTaroFileTypeMap() } }] - } + }, + { + test: /\.(scss|wxss|acss|)$/, + include: /src/, + use: [ + { + loader: require.resolve('file-loader'), + options: { + useRelativePath: true, + name: `[path][name].wxss`, + context: config.sourceDir + } + }, + { + loader: require.resolve('sass-loader'), + options: { + + }, + }, + ], + } ] }, plugins: [ diff --git a/packages/taro-mini-runner/src/loaders/loader.ts b/packages/taro-mini-runner/src/loaders/loader.ts new file mode 100644 index 000000000000..2837d6268e70 --- /dev/null +++ b/packages/taro-mini-runner/src/loaders/loader.ts @@ -0,0 +1,4 @@ +export default function (source) { + console.log(source) + return source +} diff --git a/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts b/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts index e69e623a81e5..9ac0404cf454 100644 --- a/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts +++ b/packages/taro-mini-runner/src/loaders/wxTransformerLoader.ts @@ -1,24 +1,17 @@ import { getOptions } from 'loader-utils' import wxTransformer from '@tarojs/transformer-wx' -import { REG_TYPESCRIPT, PARSE_AST_TYPE } from '../utils/constants' +import { REG_TYPESCRIPT } from '../utils/constants' export default function wxTransformerLoader (source) { - const { buildAdapter, fileTypeMap } = getOptions(this) + const { buildAdapter } = getOptions(this) const filePath = this.resourcePath const wxTransformerParams: any = { code: source, sourcePath: filePath, isTyped: REG_TYPESCRIPT.test(filePath), - adapter: buildAdapter - } - if (fileTypeMap[filePath]) { - const fileType = fileTypeMap[filePath].type - if (fileType === PARSE_AST_TYPE.ENTRY) { - wxTransformerParams.isApp = true - } else if (fileType === PARSE_AST_TYPE.PAGE) { - wxTransformerParams.isRoot = true - } + adapter: buildAdapter, + isNormal: true } const transformResult = wxTransformer(wxTransformerParams) this.callback(null, transformResult.code, transformResult.ast) diff --git a/packages/taro-mini-runner/src/plugins/miniPlugin.ts b/packages/taro-mini-runner/src/plugins/miniPlugin.ts index 4f395413e204..0a1c056da79d 100644 --- a/packages/taro-mini-runner/src/plugins/miniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/miniPlugin.ts @@ -8,6 +8,7 @@ import * as FunctionModulePlugin from 'webpack/lib/FunctionModulePlugin' import * as NodeSourcePlugin from 'webpack/lib/node/NodeSourcePlugin' import * as JsonpTemplatePlugin from 'webpack/lib/JsonpTemplatePlugin' import * as LoaderTargetPlugin from 'webpack/lib/LoaderTargetPlugin' +import * as VirtualModulePlugin from 'virtual-module-webpack-plugin' import { defaults } from 'lodash' import * as t from 'babel-types' import traverse from 'babel-traverse' @@ -25,7 +26,8 @@ interface ITaroFileInfo { [key: string]: { type: PARSE_AST_TYPE, config: IConfig, - wxml?: string + wxml?: string, + code?: string } } @@ -200,7 +202,8 @@ export default class MiniPlugin { taroFileTypeMap[this.appEntry] = { type: PARSE_AST_TYPE.ENTRY, config: configObj, - wxml: transformResult.template + wxml: transformResult.template, + code: transformResult.code } this.pages = new Set([ ...appPages.map(item => { @@ -225,7 +228,8 @@ export default class MiniPlugin { taroFileTypeMap[file.path] = { type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, config: configObj, - wxml: transformResult.template + wxml: transformResult.template, + code: transformResult.code } let depComponents = transformResult.components if (depComponents && depComponents.length) { @@ -277,11 +281,23 @@ export default class MiniPlugin { }) } + transferFileContent (compiler: webpack.Compiler) { + Object.keys(taroFileTypeMap).forEach(item => { + const relativePath = item.replace(compiler.context, '') + const itemInfo = taroFileTypeMap[item] + new VirtualModulePlugin({ + moduleName: relativePath, + contents: itemInfo.code + }).apply(compiler) + }) + } + run (compiler: webpack.Compiler) { this.appEntry = this.getAppEntry(compiler) this.getPages() this.getComponents(this.pages, true) this.addEntries(compiler) + this.transferFileContent(compiler) } static getTaroFileTypeMap () { diff --git a/packages/taro-mini-runner/src/plugins/removeStyleImport.ts b/packages/taro-mini-runner/src/plugins/removeStyleImport.ts new file mode 100644 index 000000000000..d64f0c68c051 --- /dev/null +++ b/packages/taro-mini-runner/src/plugins/removeStyleImport.ts @@ -0,0 +1,3 @@ +export default class RemoveStyleImportPlugin { + +} diff --git a/packages/taro-mini-runner/yarn.lock b/packages/taro-mini-runner/yarn.lock index ddee415eaea0..6c5798ac3df4 100644 --- a/packages/taro-mini-runner/yarn.lock +++ b/packages/taro-mini-runner/yarn.lock @@ -709,6 +709,10 @@ ajv@^6.1.0, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + ansi-escapes@^3.0.0: version "3.2.0" resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" @@ -779,6 +783,10 @@ array-filter@~0.0.0: version "0.0.1" resolved "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + array-includes@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" @@ -835,6 +843,10 @@ async-each@^1.0.1: version "1.0.3" resolved "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" +async-foreach@^0.1.3: + version "0.1.3" + resolved "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" + async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" @@ -1222,6 +1234,12 @@ binary-extensions@^1.0.0: version "1.13.1" resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" +block-stream@*: + version "0.0.9" + resolved "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" + bluebird@^3.5.3: version "3.5.4" resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz#d6cc661595de30d5b3af5fcedd3c0b3ef6ec5714" @@ -1398,6 +1416,21 @@ callsites@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" +camelcase-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + dependencies: + camelcase "^2.0.0" + map-obj "^1.0.0" + +camelcase@^2.0.0: + version "2.1.1" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + camelcase@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" @@ -1416,7 +1449,7 @@ caseless@~0.12.0: version "0.12.0" resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" -chalk@^1.1.3: +chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -1504,6 +1537,14 @@ cli-width@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + cliui@^4.0.0: version "4.1.0" resolved "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" @@ -1512,6 +1553,15 @@ cliui@^4.0.0: strip-ansi "^4.0.0" wrap-ansi "^2.0.0" +clone-deep@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-2.0.2.tgz#00db3a1e173656730d1188c3d6aced6d7ea97713" + dependencies: + for-own "^1.0.0" + is-plain-object "^2.0.4" + kind-of "^6.0.0" + shallow-clone "^1.0.0" + clone@^1.0.2: version "1.0.4" resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" @@ -1643,6 +1693,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" +cross-spawn@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -1687,6 +1744,12 @@ cssstyle@^1.0.0: dependencies: cssom "0.3.x" +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + dependencies: + array-find-index "^1.0.1" + cyclist@~0.2.2: version "0.2.2" resolved "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" @@ -1727,7 +1790,7 @@ debug@^4.1.0, debug@^4.1.1: dependencies: ms "^2.1.1" -decamelize@^1.2.0: +decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -1887,7 +1950,7 @@ errno@^0.1.3, errno@~0.1.7: dependencies: prr "~1.0.1" -error-ex@^1.3.1: +error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" dependencies: @@ -2184,6 +2247,13 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" +file-loader@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/file-loader/-/file-loader-3.0.1.tgz#f8e0ba0b599918b51adfe45d66d1e771ad560faa" + dependencies: + loader-utils "^1.0.2" + schema-utils "^1.0.0" + fill-range@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -2201,6 +2271,13 @@ find-cache-dir@^2.0.0: make-dir "^2.0.0" pkg-dir "^3.0.0" +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + find-up@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" @@ -2223,10 +2300,20 @@ flush-write-stream@^1.0.0: inherits "^2.0.3" readable-stream "^2.3.6" -for-in@^1.0.2: +for-in@^0.1.3: + version "0.1.8" + resolved "https://registry.npmjs.org/for-in/-/for-in-0.1.8.tgz#d8773908e31256109952b1fdb9b3fa867d2775e1" + +for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" +for-own@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" + dependencies: + for-in "^1.0.1" + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -2286,6 +2373,15 @@ fsevents@^1.2.7: nan "^2.12.1" node-pre-gyp "^0.12.0" +fstream@^1.0.0, fstream@^1.0.12: + version "1.0.12" + resolved "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + function-bind@^1.0.2, function-bind@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -2307,10 +2403,20 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" +gaze@^1.0.0: + version "1.1.3" + resolved "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz#c441733e13b927ac8c0ff0b4c3b033f28812924a" + dependencies: + globule "^1.0.0" + get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" +get-stdin@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + get-stream@^4.0.0: version "4.1.0" resolved "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -2334,7 +2440,7 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: +glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@~7.1.1: version "7.1.4" resolved "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" dependencies: @@ -2353,6 +2459,14 @@ globals@^9.18.0: version "9.18.0" resolved "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" +globule@^1.0.0: + version "1.2.1" + resolved "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz#5dffb1b191f22d20797a9369b49eab4e9839696d" + dependencies: + glob "~7.1.1" + lodash "~4.17.10" + minimatch "~3.0.2" + graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.15" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" @@ -2525,6 +2639,16 @@ imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" +in-publish@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz#e20ff5e3a2afc2690320b6dc552682a9c7fadf51" + +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + indexof@0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" @@ -2536,7 +2660,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -2573,6 +2697,10 @@ invariant@^2.2.0, invariant@^2.2.2, invariant@^2.2.4: dependencies: loose-envify "^1.0.0" +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + invert-kv@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" @@ -2731,6 +2859,10 @@ is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + is-windows@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -3129,6 +3261,10 @@ jest@^24.8.0: import-local "^2.0.0" jest-cli "^24.8.0" +js-base64@^2.1.8: + version "2.5.1" + resolved "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121" + js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" @@ -3280,6 +3416,12 @@ kleur@^3.0.0, kleur@^3.0.2: version "3.0.3" resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + lcid@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" @@ -3301,6 +3443,16 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" @@ -3314,7 +3466,7 @@ loader-runner@^2.3.0: version "2.4.0" resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" -loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: +loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" dependencies: @@ -3337,7 +3489,11 @@ lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" -lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0: +lodash.tail@^4.1.1: + version "4.1.1" + resolved "https://registry.npmjs.org/lodash.tail/-/lodash.tail-4.1.1.tgz#d2333a36d9e7717c8ad2f7cacafec7c32b444664" + +lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0, lodash@~4.17.10: version "4.17.11" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" @@ -3353,6 +3509,13 @@ loose-envify@^1.0.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" @@ -3397,6 +3560,10 @@ map-cache@^0.2.2: version "0.2.2" resolved "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" +map-obj@^1.0.0, map-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + map-visit@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" @@ -3430,6 +3597,21 @@ memorystream@^0.3.1: version "0.3.1" resolved "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" +meow@^3.7.0: + version "3.7.0" + resolved "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + dependencies: + camelcase-keys "^2.0.0" + decamelize "^1.1.2" + loud-rejection "^1.0.0" + map-obj "^1.0.1" + minimist "^1.1.3" + normalize-package-data "^2.3.4" + object-assign "^4.0.1" + read-pkg-up "^1.0.1" + redent "^1.0.0" + trim-newlines "^1.0.0" + merge-stream@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" @@ -3487,7 +3669,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" -minimatch@^3.0.2, minimatch@^3.0.4: +minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -3497,7 +3679,7 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.1.1, minimist@^1.2.0: +minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -3540,7 +3722,14 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +mixin-object@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/mixin-object/-/mixin-object-2.0.1.tgz#4fb949441dab182540f1fe035ba60e1947a5e57e" + dependencies: + for-in "^0.1.3" + is-extendable "^0.1.1" + +mkdirp@0.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -3573,6 +3762,10 @@ nan@^2.12.1: version "2.13.2" resolved "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" +nan@^2.13.2: + version "2.14.0" + resolved "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" + nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -3609,6 +3802,23 @@ nice-try@^1.0.4: version "1.0.5" resolved "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" +node-gyp@^3.8.0: + version "3.8.0" + resolved "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" + dependencies: + fstream "^1.0.0" + glob "^7.0.3" + graceful-fs "^4.1.2" + mkdirp "^0.5.0" + nopt "2 || 3" + npmlog "0 || 1 || 2 || 3 || 4" + osenv "0" + request "^2.87.0" + rimraf "2" + semver "~5.3.0" + tar "^2.0.0" + which "1" + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -3670,6 +3880,34 @@ node-pre-gyp@^0.12.0: semver "^5.3.0" tar "^4" +node-sass@^4.12.0: + version "4.12.0" + resolved "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz#0914f531932380114a30cc5fa4fa63233a25f017" + dependencies: + async-foreach "^0.1.3" + chalk "^1.1.1" + cross-spawn "^3.0.0" + gaze "^1.0.0" + get-stdin "^4.0.1" + glob "^7.0.3" + in-publish "^2.0.0" + lodash "^4.17.11" + meow "^3.7.0" + mkdirp "^0.5.1" + nan "^2.13.2" + node-gyp "^3.8.0" + npmlog "^4.0.0" + request "^2.88.0" + sass-graph "^2.2.4" + stdout-stream "^1.4.0" + "true-case-path" "^1.0.2" + +"nopt@2 || 3": + version "3.0.6" + resolved "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + dependencies: + abbrev "1" + nopt@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" @@ -3677,7 +3915,7 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -normalize-package-data@^2.3.2: +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.5.0" resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" dependencies: @@ -3727,7 +3965,7 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npmlog@^4.0.2: +"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0, npmlog@^4.0.2: version "4.1.2" resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" dependencies: @@ -3832,6 +4070,12 @@ os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + dependencies: + lcid "^1.0.0" + os-locale@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" @@ -3844,7 +4088,7 @@ os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -osenv@^0.1.4: +osenv@0, osenv@^0.1.4: version "0.1.5" resolved "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" dependencies: @@ -3912,6 +4156,12 @@ parse-asn1@^5.0.0: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + parse-json@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" @@ -3939,6 +4189,12 @@ path-exists@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-1.0.0.tgz#d5a8998eb71ef37a74c34eb0d9eba6e878eea081" +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -3959,6 +4215,14 @@ path-parse@^1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + path-type@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" @@ -3983,6 +4247,10 @@ pidtree@^0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/pidtree/-/pidtree-0.3.0.tgz#f6fada10fccc9f99bf50e90d0b23d72c9ebc2e6b" +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + pify@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" @@ -3991,6 +4259,16 @@ pify@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + pirates@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" @@ -4162,6 +4440,13 @@ react-is@^16.8.1, react-is@^16.8.4: version "16.8.6" resolved "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + read-pkg-up@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" @@ -4169,6 +4454,14 @@ read-pkg-up@^4.0.0: find-up "^3.0.0" read-pkg "^3.0.0" +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + read-pkg@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" @@ -4203,6 +4496,13 @@ realpath-native@^1.1.0: dependencies: util.promisify "^1.0.0" +redent@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + dependencies: + indent-string "^2.1.0" + strip-indent "^1.0.1" + regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" @@ -4250,7 +4550,7 @@ request-promise-native@^1.0.5: stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@^2.87.0: +request@^2.87.0, request@^2.88.0: version "2.88.0" resolved "https://registry.npmjs.org/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" dependencies: @@ -4333,7 +4633,7 @@ ret@~0.1.10: version "0.1.15" resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" -rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@~2.6.2: +rimraf@2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@~2.6.2: version "2.6.3" resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" dependencies: @@ -4400,6 +4700,26 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" +sass-graph@^2.2.4: + version "2.2.4" + resolved "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz#13fbd63cd1caf0908b9fd93476ad43a51d1e0b49" + dependencies: + glob "^7.0.0" + lodash "^4.0.0" + scss-tokenizer "^0.2.3" + yargs "^7.0.0" + +sass-loader@^7.1.0: + version "7.1.0" + resolved "https://registry.npmjs.org/sass-loader/-/sass-loader-7.1.0.tgz#16fd5138cb8b424bf8a759528a1972d72aad069d" + dependencies: + clone-deep "^2.0.1" + loader-utils "^1.0.1" + lodash.tail "^4.1.1" + neo-async "^2.5.0" + pify "^3.0.0" + semver "^5.5.0" + sax@^1.2.4: version "1.2.4" resolved "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -4412,6 +4732,13 @@ schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" +scss-tokenizer@^0.2.3: + version "0.2.3" + resolved "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1" + dependencies: + js-base64 "^2.1.8" + source-map "^0.4.2" + "semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5, semver@^5.5.0, semver@^5.6.0: version "5.7.0" resolved "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" @@ -4420,6 +4747,10 @@ semver@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65" +semver@~5.3.0: + version "5.3.0" + resolved "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + serialize-javascript@^1.4.0: version "1.7.0" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65" @@ -4457,6 +4788,14 @@ sha.js@^2.4.0, sha.js@^2.4.8: inherits "^2.0.1" safe-buffer "^5.0.1" +shallow-clone@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-1.0.0.tgz#4480cd06e882ef68b2ad88a3ea54832e2c48b571" + dependencies: + is-extendable "^0.1.1" + kind-of "^5.0.0" + mixin-object "^2.0.1" + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -4560,6 +4899,12 @@ source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" +source-map@^0.4.2: + version "0.4.4" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -4631,6 +4976,12 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" +stdout-stream@^1.4.0: + version "1.4.1" + resolved "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz#5ac174cdd5cd726104aa0c0b2bd83815d8d535de" + dependencies: + readable-stream "^2.0.1" + stealthy-require@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" @@ -4670,7 +5021,7 @@ string-length@^2.0.0: astral-regex "^1.0.0" strip-ansi "^4.0.0" -string-width@^1.0.1: +string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" dependencies: @@ -4723,6 +5074,12 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -4731,6 +5088,12 @@ strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" +strip-indent@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" + dependencies: + get-stdin "^4.0.1" + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -4770,6 +5133,14 @@ tapable@^1.0.0, tapable@^1.1.0: version "1.1.3" resolved "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" +tar@^2.0.0: + version "2.2.2" + resolved "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz#0ca8848562c7299b8b446ff6a4d60cdbb23edc40" + dependencies: + block-stream "*" + fstream "^1.0.12" + inherits "2" + tar@^4: version "4.4.8" resolved "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" @@ -4905,10 +5276,20 @@ traverse@0.6.6: version "0.6.6" resolved "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" +trim-newlines@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + trim-right@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" +"true-case-path@^1.0.2": + version "1.0.3" + resolved "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz#f813b5a8c86b40da59606722b144e3225799f47d" + dependencies: + glob "^7.1.2" + ts-jest@^24.0.2: version "24.0.2" resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.2.tgz#8dde6cece97c31c03e80e474c749753ffd27194d" @@ -5061,6 +5442,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +virtual-module-webpack-plugin@^0.4.1: + version "0.4.1" + resolved "https://registry.npmjs.org/virtual-module-webpack-plugin/-/virtual-module-webpack-plugin-0.4.1.tgz#42d644482add103e633b7deee830020be5d68953" + vm-browserify@0.0.4: version "0.0.4" resolved "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" @@ -5172,11 +5557,15 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" -which@^1.2.9, which@^1.3.0: +which@1, which@^1.2.9, which@^1.3.0: version "1.3.1" resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" dependencies: @@ -5241,6 +5630,10 @@ xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + "y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" @@ -5266,6 +5659,12 @@ yargs-parser@^11.1.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + dependencies: + camelcase "^3.0.0" + yargs@^12.0.2: version "12.0.5" resolved "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" @@ -5282,3 +5681,21 @@ yargs@^12.0.2: which-module "^2.0.0" y18n "^3.2.1 || ^4.0.0" yargs-parser "^11.1.1" + +yargs@^7.0.0: + version "7.1.0" + resolved "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^5.0.0" From 8eb3d4363b347e2caad0627dcb2b573b756b0f98 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 4 Jun 2019 17:40:36 +0800 Subject: [PATCH 017/194] =?UTF-8?q?feat(taro-mini-runner):=20=E6=8B=86?= =?UTF-8?q?=E5=88=86=E6=96=87=E4=BB=B6=E7=BC=96=E8=AF=91=E6=88=90=E4=B8=BA?= =?UTF-8?q?=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/miniPlugin.ts | 306 ------------------ 1 file changed, 306 deletions(-) delete mode 100644 packages/taro-mini-runner/src/plugins/miniPlugin.ts diff --git a/packages/taro-mini-runner/src/plugins/miniPlugin.ts b/packages/taro-mini-runner/src/plugins/miniPlugin.ts deleted file mode 100644 index 0a1c056da79d..000000000000 --- a/packages/taro-mini-runner/src/plugins/miniPlugin.ts +++ /dev/null @@ -1,306 +0,0 @@ -import * as path from 'path' -import * as fs from 'fs-extra' - -import wxTransformer from '@tarojs/transformer-wx' -import * as webpack from 'webpack' -import * as SingleEntryPlugin from 'webpack/lib/SingleEntryPlugin' -import * as FunctionModulePlugin from 'webpack/lib/FunctionModulePlugin' -import * as NodeSourcePlugin from 'webpack/lib/node/NodeSourcePlugin' -import * as JsonpTemplatePlugin from 'webpack/lib/JsonpTemplatePlugin' -import * as LoaderTargetPlugin from 'webpack/lib/LoaderTargetPlugin' -import * as VirtualModulePlugin from 'virtual-module-webpack-plugin' -import { defaults } from 'lodash' -import * as t from 'babel-types' -import traverse from 'babel-traverse' -import { Config as IConfig } from '@tarojs/taro' - -import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE } from '../utils/constants' -import { traverseObjectNode, resolveScriptPath } from '../utils' - -interface IMiniPluginOptions { - appEntry?: string, - buildAdapter: BUILD_TYPES -} - -interface ITaroFileInfo { - [key: string]: { - type: PARSE_AST_TYPE, - config: IConfig, - wxml?: string, - code?: string - } -} - -interface IComponent { name: string, path: string } - -const PLUGIN_NAME = 'MiniPlugin' - -const taroFileTypeMap: ITaroFileInfo = {} - -export const createTarget = function createTarget(name) { - const target = compiler => { - const { options } = compiler - compiler.apply( - new JsonpTemplatePlugin(options.output), - new FunctionModulePlugin(options.output), - new NodeSourcePlugin(options.node), - new LoaderTargetPlugin('web') - ) - } - - const creater = new Function( - `var t = arguments[0]; return function ${name}(c) { return t(c); }` - ); - return creater(target) -} - -export const Targets = { - [BUILD_TYPES.WEAPP]: createTarget(BUILD_TYPES.WEAPP), - [BUILD_TYPES.ALIPAY]: createTarget(BUILD_TYPES.ALIPAY), - [BUILD_TYPES.SWAN]: createTarget(BUILD_TYPES.SWAN), - [BUILD_TYPES.TT]: createTarget(BUILD_TYPES.TT), - [BUILD_TYPES.QQ]: createTarget(BUILD_TYPES.QQ), -} - -export default class MiniPlugin { - options: IMiniPluginOptions - appEntry: string - pages: Set - components: Set - sourceDir: string - - constructor (options = {}) { - this.options = defaults(options || {}, { - buildAdapter: BUILD_TYPES.WEAPP, - commonLibName: 'lib.js' - }) - - this.pages = new Set() - this.components = new Set() - } - - tryAsync = fn => async (arg, callback) => { - try { - await fn(arg) - callback() - } catch (err) { - callback(err) - } - } - - apply (compiler: webpack.Compiler) { - compiler.hooks.run.tapAsync( - PLUGIN_NAME, - this.tryAsync(async (compiler: webpack.Compiler) => { - await this.run(compiler) - }) - ) - - compiler.hooks.emit.tapAsync( - PLUGIN_NAME, - this.tryAsync(async compilation => { - await this.generateMiniFiles(compilation) - }) - ) - } - - getAppEntry (compiler) { - if (this.options.appEntry) { - return this.options.appEntry - } - const { entry } = compiler.options - function getEntryPath (entry) { - if (Array.isArray(entry)) { - return entry.map(item => getEntryPath[item]).find(item => item) - } - if (typeof entry === 'object') { - return entry['app'] - } - return entry - } - const appEntryPath = getEntryPath(entry) - this.sourceDir = path.dirname(appEntryPath) - return appEntryPath - } - - parseAst ( - ast: t.File, - buildAdapter: BUILD_TYPES - ): { - configObj: IConfig - } { - let configObj = {} - traverse(ast, { - ClassDeclaration (astPath) { - const node = astPath.node - let hasCreateData = false - if (node.superClass) { - astPath.traverse({ - ClassMethod (astPath) { - if (astPath.get('key').isIdentifier({ name: '_createData' })) { - hasCreateData = true - } - } - }) - if (hasCreateData) { - astPath.traverse({ - ClassMethod (astPath) { - const node = astPath.node - if (node.kind === 'constructor') { - astPath.traverse({ - ExpressionStatement (astPath) { - const node = astPath.node - if (node.expression && - node.expression.type === 'AssignmentExpression' && - node.expression.operator === '=') { - const left = node.expression.left - if (left.type === 'MemberExpression' && - left.object.type === 'ThisExpression' && - left.property.type === 'Identifier' && - left.property.name === 'config') { - configObj = traverseObjectNode(node.expression.right, buildAdapter) - } - } - } - }) - } - } - }) - } - } - }, - ClassProperty (astPath) { - const node = astPath.node - const keyName = node.key.name - if (keyName === 'config') { - configObj = traverseObjectNode(node, buildAdapter) - } - } - }) - - return { - configObj - } - } - - getPages () { - const { buildAdapter } = this.options - const appEntry = this.appEntry - const code = fs.readFileSync(appEntry).toString() - const transformResult = wxTransformer({ - code, - sourcePath: appEntry, - isTyped: REG_TYPESCRIPT.test(appEntry), - isApp: true, - adapter: buildAdapter - }) - const { configObj } = this.parseAst(transformResult.ast, buildAdapter) - const appPages = configObj.pages - if (!appPages || appPages.length === 0) { - throw new Error('缺少页面') - } - taroFileTypeMap[this.appEntry] = { - type: PARSE_AST_TYPE.ENTRY, - config: configObj, - wxml: transformResult.template, - code: transformResult.code - } - this.pages = new Set([ - ...appPages.map(item => { - const pagePath = resolveScriptPath(path.join(this.sourceDir, item)) - return { name: item, path: pagePath } - }) - ]) - } - - getComponents (fileList: Set, isRoot: boolean) { - const { buildAdapter } = this.options - fileList.forEach(file => { - const code = fs.readFileSync(file.path).toString() - const transformResult = wxTransformer({ - code, - sourcePath: file.path, - isTyped: REG_TYPESCRIPT.test(file.path), - isRoot, - adapter: buildAdapter - }) - const { configObj } = this.parseAst(transformResult.ast, buildAdapter) - taroFileTypeMap[file.path] = { - type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, - config: configObj, - wxml: transformResult.template, - code: transformResult.code - } - let depComponents = transformResult.components - if (depComponents && depComponents.length) { - depComponents.forEach(item => { - const componentPath = resolveScriptPath(path.resolve(path.dirname(file.path), item.path)) - if (fs.existsSync(componentPath) && !Array.from(this.components).some(item => item.path === componentPath)) { - const componentName = componentPath.replace(this.sourceDir, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') - const componentObj = { name: componentName, path: componentPath } - this.components.add(componentObj) - this.getComponents(new Set([componentObj]), false) - } - }) - } - }) - } - - addEntries (compiler: webpack.Compiler) { - const mainFiles = new Set([ ...this.pages, ...this.components ]) - mainFiles.add({ - name: 'app', - path: this.appEntry - }) - mainFiles.forEach(item => { - compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation: webpack.compilation.Compilation, callback) => { - const dep = SingleEntryPlugin.createDependency(item.path, item.name) - compilation.addEntry(this.sourceDir, dep, item.name, callback) - }) - }) - } - - generateMiniFiles (compilation: webpack.compilation.Compilation) { - Object.keys(taroFileTypeMap).forEach(item => { - const relativePath = item.replace(this.sourceDir, '') - const extname = path.extname(item) - const wxmlPath = relativePath.replace(extname, '.wxml') - const jsonPath = relativePath.replace(extname, '.json') - const itemInfo = taroFileTypeMap[item] - if (itemInfo.type !== PARSE_AST_TYPE.ENTRY) { - compilation.assets[wxmlPath] = { - size: () => itemInfo.wxml!.length, - source: () => itemInfo.wxml - } - } - const jsonStr = JSON.stringify(itemInfo.config) - compilation.assets[jsonPath] = { - size: () => jsonStr.length, - source: () => jsonStr - } - }) - } - - transferFileContent (compiler: webpack.Compiler) { - Object.keys(taroFileTypeMap).forEach(item => { - const relativePath = item.replace(compiler.context, '') - const itemInfo = taroFileTypeMap[item] - new VirtualModulePlugin({ - moduleName: relativePath, - contents: itemInfo.code - }).apply(compiler) - }) - } - - run (compiler: webpack.Compiler) { - this.appEntry = this.getAppEntry(compiler) - this.getPages() - this.getComponents(this.pages, true) - this.addEntries(compiler) - this.transferFileContent(compiler) - } - - static getTaroFileTypeMap () { - return taroFileTypeMap - } -} From 1041ffeeed9421eddd2a193ed3b8388b824bb72a Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 4 Jun 2019 22:54:55 +0800 Subject: [PATCH 018/194] =?UTF-8?q?feat(taro-mini-runner):=20=E5=BC=95?= =?UTF-8?q?=E5=85=A5=E6=8B=86=E5=88=86=E7=9A=84=E5=85=AC=E5=85=B1=20chunks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/MiniPlugin.ts | 313 ++++++++++++++++++ .../src/plugins/TaroLoadChunksPlugin.ts | 48 +++ 2 files changed, 361 insertions(+) create mode 100644 packages/taro-mini-runner/src/plugins/MiniPlugin.ts create mode 100644 packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts new file mode 100644 index 000000000000..3cb77791e08f --- /dev/null +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -0,0 +1,313 @@ + +import * as path from 'path' +import * as fs from 'fs-extra' + +import wxTransformer from '@tarojs/transformer-wx' +import * as webpack from 'webpack' +import * as SingleEntryPlugin from 'webpack/lib/SingleEntryPlugin' +import * as FunctionModulePlugin from 'webpack/lib/FunctionModulePlugin' +import * as NodeSourcePlugin from 'webpack/lib/node/NodeSourcePlugin' +import * as LoaderTargetPlugin from 'webpack/lib/LoaderTargetPlugin' +import * as VirtualModulePlugin from 'virtual-module-webpack-plugin' +import { defaults } from 'lodash' +import * as t from 'babel-types' +import traverse from 'babel-traverse' +import { Config as IConfig } from '@tarojs/taro' + +import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE } from '../utils/constants' +import { traverseObjectNode, resolveScriptPath } from '../utils' + +import TaroTemplatePlugin from './TaroTemplatePlugin' +import TaroLoadChunksPlugin from './TaroLoadChunksPlugin' + +interface IMiniPluginOptions { + appEntry?: string, + buildAdapter: BUILD_TYPES, + commonChunks?: string[] +} + +export interface ITaroFileInfo { + [key: string]: { + type: PARSE_AST_TYPE, + config: IConfig, + wxml?: string, + code?: string + } +} + +interface IComponent { name: string, path: string } + +const PLUGIN_NAME = 'MiniPlugin' + +const taroFileTypeMap: ITaroFileInfo = {} + +export const createTarget = function createTarget(name) { + const target = (compiler: webpack.compiler.Compiler) => { + const { options } = compiler + new TaroTemplatePlugin().apply(compiler) + new FunctionModulePlugin(options.output).apply(compiler) + new NodeSourcePlugin(options.node).apply(compiler) + new LoaderTargetPlugin('web').apply(compiler) + } + + const creater = new Function( + `var t = arguments[0]; return function ${name}(c) { return t(c); }` + ); + return creater(target) +} + +export const Targets = { + [BUILD_TYPES.WEAPP]: createTarget(BUILD_TYPES.WEAPP), + [BUILD_TYPES.ALIPAY]: createTarget(BUILD_TYPES.ALIPAY), + [BUILD_TYPES.SWAN]: createTarget(BUILD_TYPES.SWAN), + [BUILD_TYPES.TT]: createTarget(BUILD_TYPES.TT), + [BUILD_TYPES.QQ]: createTarget(BUILD_TYPES.QQ), +} + +export default class MiniPlugin { + options: IMiniPluginOptions + appEntry: string + pages: Set + components: Set + sourceDir: string + + constructor (options = {}) { + this.options = defaults(options || {}, { + buildAdapter: BUILD_TYPES.WEAPP, + commonChunks: ['runtime', 'vendors'] + }) + + this.pages = new Set() + this.components = new Set() + } + + tryAsync = fn => async (arg, callback) => { + try { + await fn(arg) + callback() + } catch (err) { + callback(err) + } + } + + apply (compiler: webpack.Compiler) { + compiler.hooks.run.tapAsync( + PLUGIN_NAME, + this.tryAsync(async (compiler: webpack.Compiler) => { + await this.run(compiler) + }) + ) + + compiler.hooks.emit.tapAsync( + PLUGIN_NAME, + this.tryAsync(async compilation => { + await this.generateMiniFiles(compilation) + }) + ) + + new TaroLoadChunksPlugin({ + commonChunks: this.options.commonChunks, + taroFileTypeMap + }).apply(compiler) + } + + getAppEntry (compiler) { + if (this.options.appEntry) { + return this.options.appEntry + } + const { entry } = compiler.options + function getEntryPath (entry) { + if (Array.isArray(entry)) { + return entry.map(item => getEntryPath[item]).find(item => item) + } + if (typeof entry === 'object') { + return entry['app'] + } + return entry + } + const appEntryPath = getEntryPath(entry) + this.sourceDir = path.dirname(appEntryPath) + return appEntryPath + } + + parseAst ( + ast: t.File, + buildAdapter: BUILD_TYPES + ): { + configObj: IConfig + } { + let configObj = {} + traverse(ast, { + ClassDeclaration (astPath) { + const node = astPath.node + let hasCreateData = false + if (node.superClass) { + astPath.traverse({ + ClassMethod (astPath) { + if (astPath.get('key').isIdentifier({ name: '_createData' })) { + hasCreateData = true + } + } + }) + if (hasCreateData) { + astPath.traverse({ + ClassMethod (astPath) { + const node = astPath.node + if (node.kind === 'constructor') { + astPath.traverse({ + ExpressionStatement (astPath) { + const node = astPath.node + if (node.expression && + node.expression.type === 'AssignmentExpression' && + node.expression.operator === '=') { + const left = node.expression.left + if (left.type === 'MemberExpression' && + left.object.type === 'ThisExpression' && + left.property.type === 'Identifier' && + left.property.name === 'config') { + configObj = traverseObjectNode(node.expression.right, buildAdapter) + } + } + } + }) + } + } + }) + } + } + }, + ClassProperty (astPath) { + const node = astPath.node + const keyName = node.key.name + if (keyName === 'config') { + configObj = traverseObjectNode(node, buildAdapter) + } + } + }) + + return { + configObj + } + } + + getPages () { + const { buildAdapter } = this.options + const appEntry = this.appEntry + const code = fs.readFileSync(appEntry).toString() + const transformResult = wxTransformer({ + code, + sourcePath: appEntry, + isTyped: REG_TYPESCRIPT.test(appEntry), + isApp: true, + adapter: buildAdapter + }) + const { configObj } = this.parseAst(transformResult.ast, buildAdapter) + const appPages = configObj.pages + if (!appPages || appPages.length === 0) { + throw new Error('缺少页面') + } + taroFileTypeMap[this.appEntry] = { + type: PARSE_AST_TYPE.ENTRY, + config: configObj, + wxml: transformResult.template, + code: transformResult.code + } + this.pages = new Set([ + ...appPages.map(item => { + const pagePath = resolveScriptPath(path.join(this.sourceDir, item)) + return { name: item, path: pagePath } + }) + ]) + } + + getComponents (fileList: Set, isRoot: boolean) { + const { buildAdapter } = this.options + fileList.forEach(file => { + const code = fs.readFileSync(file.path).toString() + const transformResult = wxTransformer({ + code, + sourcePath: file.path, + isTyped: REG_TYPESCRIPT.test(file.path), + isRoot, + adapter: buildAdapter + }) + const { configObj } = this.parseAst(transformResult.ast, buildAdapter) + taroFileTypeMap[file.path] = { + type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, + config: configObj, + wxml: transformResult.template, + code: transformResult.code + } + let depComponents = transformResult.components + if (depComponents && depComponents.length) { + depComponents.forEach(item => { + const componentPath = resolveScriptPath(path.resolve(path.dirname(file.path), item.path)) + if (fs.existsSync(componentPath) && !Array.from(this.components).some(item => item.path === componentPath)) { + const componentName = componentPath.replace(this.sourceDir, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') + const componentObj = { name: componentName, path: componentPath } + this.components.add(componentObj) + this.getComponents(new Set([componentObj]), false) + } + }) + } + }) + } + + addEntries (compiler: webpack.Compiler) { + const mainFiles = new Set([ ...this.pages, ...this.components ]) + mainFiles.add({ + name: 'app', + path: this.appEntry + }) + mainFiles.forEach(item => { + compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation: webpack.compilation.Compilation, callback) => { + const dep = SingleEntryPlugin.createDependency(item.path, item.name) + compilation.addEntry(this.sourceDir, dep, item.name, callback) + }) + }) + } + + generateMiniFiles (compilation: webpack.compilation.Compilation) { + Object.keys(taroFileTypeMap).forEach(item => { + const relativePath = item.replace(this.sourceDir, '') + const extname = path.extname(item) + const wxmlPath = relativePath.replace(extname, '.wxml') + const jsonPath = relativePath.replace(extname, '.json') + const itemInfo = taroFileTypeMap[item] + if (itemInfo.type !== PARSE_AST_TYPE.ENTRY) { + compilation.assets[wxmlPath] = { + size: () => itemInfo.wxml!.length, + source: () => itemInfo.wxml + } + } + const jsonStr = JSON.stringify(itemInfo.config) + compilation.assets[jsonPath] = { + size: () => jsonStr.length, + source: () => jsonStr + } + }) + } + + transferFileContent (compiler: webpack.Compiler) { + Object.keys(taroFileTypeMap).forEach(item => { + const relativePath = item.replace(compiler.context, '') + const itemInfo = taroFileTypeMap[item] + new VirtualModulePlugin({ + moduleName: relativePath, + contents: itemInfo.code + }).apply(compiler) + }) + } + + run (compiler: webpack.Compiler) { + this.appEntry = this.getAppEntry(compiler) + this.getPages() + this.getComponents(this.pages, true) + this.addEntries(compiler) + this.transferFileContent(compiler) + } + + static getTaroFileTypeMap () { + return taroFileTypeMap + } +} diff --git a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts new file mode 100644 index 000000000000..17350a670233 --- /dev/null +++ b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts @@ -0,0 +1,48 @@ +import webpack, { compilation } from 'webpack' +import { ConcatSource } from 'webpack-sources' +import { urlToRequest } from 'loader-utils' + +import { PARSE_AST_TYPE } from '../utils/constants' + +import { ITaroFileInfo } from './MiniPlugin' + +const PLUGIN_NAME = 'TaroLoadChunksPlugin' + +interface IOptions { + commonChunks: string[], + taroFileTypeMap: ITaroFileInfo +} + +export default class TaroLoadChunksPlugin { + commonChunks: string[] + taroFileTypeMap: ITaroFileInfo + + constructor (options: IOptions) { + this.commonChunks = options.commonChunks + this.taroFileTypeMap = options.taroFileTypeMap + } + + apply (compiler: webpack.Compiler) { + compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation: compilation.Compilation) => { + let commonChunks + compilation.hooks.afterOptimizeChunks.tap(PLUGIN_NAME, (chunks: compilation.Chunk[]) => { + commonChunks = chunks.filter(chunk => this.commonChunks.includes(chunk.name)) + }) + compilation.chunkTemplate.hooks.renderWithEntry.tap(PLUGIN_NAME, (modules, chunk) => { + if (chunk.entryModule + && chunk.entryModule + && this.taroFileTypeMap[chunk.entryModule.resource] + && this.taroFileTypeMap[chunk.entryModule.resource].type === PARSE_AST_TYPE.ENTRY) { + const source = new ConcatSource() + commonChunks.reverse().forEach(chunkItem => { + source.add(`require(${JSON.stringify(urlToRequest(chunkItem.name))});\n`) + }) + source.add('\n') + source.add(modules) + source.add(';') + return source + } + }) + }) + } +} From 15dede34f4a75595e5a8729b2a5e311646980ef2 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 4 Jun 2019 23:11:08 +0800 Subject: [PATCH 019/194] =?UTF-8?q?feat(taro-mini-runner):=20=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=A1=B5=E9=9D=A2=E4=BB=A5=E5=8F=8A=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=20usingComponents=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/MiniPlugin.ts | 6 +- packages/taro-mini-runner/src/utils/index.ts | 72 +++++++++++++++++++ packages/taro-mini-runner/src/utils/types.ts | 6 ++ 3 files changed, 81 insertions(+), 3 deletions(-) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 3cb77791e08f..352e84e0622f 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -9,13 +9,13 @@ import * as FunctionModulePlugin from 'webpack/lib/FunctionModulePlugin' import * as NodeSourcePlugin from 'webpack/lib/node/NodeSourcePlugin' import * as LoaderTargetPlugin from 'webpack/lib/LoaderTargetPlugin' import * as VirtualModulePlugin from 'virtual-module-webpack-plugin' -import { defaults } from 'lodash' +import { merge, defaults } from 'lodash' import * as t from 'babel-types' import traverse from 'babel-traverse' import { Config as IConfig } from '@tarojs/taro' import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE } from '../utils/constants' -import { traverseObjectNode, resolveScriptPath } from '../utils' +import { traverseObjectNode, resolveScriptPath, buildUsingComponents } from '../utils' import TaroTemplatePlugin from './TaroTemplatePlugin' import TaroLoadChunksPlugin from './TaroLoadChunksPlugin' @@ -234,7 +234,7 @@ export default class MiniPlugin { const { configObj } = this.parseAst(transformResult.ast, buildAdapter) taroFileTypeMap[file.path] = { type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, - config: configObj, + config: merge({}, buildUsingComponents(file.path, {}, transformResult.components),configObj), wxml: transformResult.template, code: transformResult.code } diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index bcff6290cdec..d839bfbdcba1 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -4,6 +4,7 @@ import * as fs from 'fs-extra' import * as t from 'babel-types' import { CONFIG_MAP, JS_EXT, TS_EXT } from './constants' +import { IOption, IComponentObj } from './types' export function isNpmPkg (name: string): boolean { if (/^(\.|\/)/.test(name)) { @@ -56,6 +57,50 @@ export function traverseObjectNode (node, buildAdapter: string, parentKey?: stri return node.value } +export function isAliasPath (name: string, pathAlias: object = {}): boolean { + const prefixs = Object.keys(pathAlias) + if (prefixs.length === 0) { + return false + } + return prefixs.includes(name) || (new RegExp(`^(${prefixs.join('|')})/`).test(name)) +} + +export function replaceAliasPath (filePath: string, name: string, pathAlias: object = {}) { + // 后续的 path.join 在遇到符号链接时将会解析为真实路径,如果 + // 这里的 filePath 没有做同样的处理,可能会导致 import 指向 + // 源代码文件,导致文件被意外修改 + filePath = fs.realpathSync(filePath) + + const prefixs = Object.keys(pathAlias) + if (prefixs.includes(name)) { + return promoteRelativePath(path.relative(filePath, fs.realpathSync(resolveScriptPath(pathAlias[name])))) + } + const reg = new RegExp(`^(${prefixs.join('|')})/(.*)`) + name = name.replace(reg, function (m, $1, $2) { + return promoteRelativePath(path.relative(filePath, path.join(pathAlias[$1], $2))) + }) + return name +} + +export function promoteRelativePath (fPath: string): string { + const fPathArr = fPath.split(path.sep) + let dotCount = 0 + fPathArr.forEach(item => { + if (item.indexOf('..') >= 0) { + dotCount++ + } + }) + if (dotCount === 1) { + fPathArr.splice(0, 1, '.') + return fPathArr.join('/') + } + if (dotCount > 1) { + fPathArr.splice(0, 1) + return fPathArr.join('/') + } + return fPath.replace(/\\/g, '/') +} + export function resolveScriptPath (p: string): string { const realPath = p const taroEnv = process.env.TARO_ENV @@ -82,3 +127,30 @@ export function resolveScriptPath (p: string): string { } return realPath } + +export function buildUsingComponents ( + filePath: string, + pathAlias: IOption, + components: IComponentObj[], + isComponent?: boolean +): IOption { + const usingComponents = Object.create(null) + for (const component of components) { + let componentPath = component.path + if (isAliasPath(componentPath as string, pathAlias)) { + componentPath = replaceAliasPath(filePath, componentPath as string, pathAlias) + } + componentPath = resolveScriptPath(path.resolve(filePath, '..', componentPath as string)) + if (fs.existsSync(componentPath)) { + componentPath = promoteRelativePath(path.relative(filePath, componentPath)) + } else { + componentPath = component.path + } + if (component.name) { + usingComponents[component.name] = (componentPath as string).replace(path.extname(componentPath as string), '') + } + } + return Object.assign({}, isComponent ? { component: true } : { usingComponents: {} }, components.length ? { + usingComponents + } : {}) +} diff --git a/packages/taro-mini-runner/src/utils/types.ts b/packages/taro-mini-runner/src/utils/types.ts index ce7418cab98e..85088955d277 100644 --- a/packages/taro-mini-runner/src/utils/types.ts +++ b/packages/taro-mini-runner/src/utils/types.ts @@ -8,6 +8,12 @@ export interface IOption { [key: string]: any } +export interface IComponentObj { + name?: string, + path: string | null, + type?: string +} + type TogglableOptions = { enable?: boolean config?: T From 9029d257c7d1b07bf1e3c0d5926639a3047b2d64 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 5 Jun 2019 16:42:23 +0800 Subject: [PATCH 020/194] =?UTF-8?q?feat(taro-mini-runner):=20=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=A4=9A=E7=AB=AF=E7=B1=BB=E5=9E=8B=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/index.ts | 9 +- .../src/plugins/MiniPlugin.ts | 32 +++---- .../taro-mini-runner/src/utils/constants.ts | 85 +++++++++++++++++++ 3 files changed, 105 insertions(+), 21 deletions(-) diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index acfd823b6ee4..52c2fc7998d3 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -3,7 +3,10 @@ import * as webpack from 'webpack' import { IBuildConfig } from './utils/types' import { printBuildError, bindProdLogger } from './utils/logHelper' -import MiniPlugin from './plugins/miniPlugin' +import MiniPlugin, { Targets } from './plugins/MiniPlugin' +import { MINI_APP_FILES } from './utils/constants' + +const extensions = ['.ts', '.tsx', '.js', '.jsx'] export default function build (config: IBuildConfig) { const compilePlugins = config.plugins @@ -44,14 +47,14 @@ export default function build (config: IBuildConfig) { }] }, { - test: /\.(scss|wxss|acss|)$/, + test: /\.(scss|wxss|acss|ttss|acss|)$/, include: /src/, use: [ { loader: require.resolve('file-loader'), options: { useRelativePath: true, - name: `[path][name].wxss`, + name: `[path][name]${MINI_APP_FILES[config.buildAdapter].STYLE}`, context: config.sourceDir } }, diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 352e84e0622f..10a829d2af72 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -14,7 +14,7 @@ import * as t from 'babel-types' import traverse from 'babel-traverse' import { Config as IConfig } from '@tarojs/taro' -import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE } from '../utils/constants' +import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES } from '../utils/constants' import { traverseObjectNode, resolveScriptPath, buildUsingComponents } from '../utils' import TaroTemplatePlugin from './TaroTemplatePlugin' @@ -23,14 +23,14 @@ import TaroLoadChunksPlugin from './TaroLoadChunksPlugin' interface IMiniPluginOptions { appEntry?: string, buildAdapter: BUILD_TYPES, - commonChunks?: string[] + commonChunks: string[] } export interface ITaroFileInfo { [key: string]: { type: PARSE_AST_TYPE, config: IConfig, - wxml?: string, + template?: string, code?: string } } @@ -41,19 +41,14 @@ const PLUGIN_NAME = 'MiniPlugin' const taroFileTypeMap: ITaroFileInfo = {} -export const createTarget = function createTarget(name) { - const target = (compiler: webpack.compiler.Compiler) => { +export const createTarget = function createTarget (name) { + return (compiler: webpack.compiler.Compiler) => { const { options } = compiler new TaroTemplatePlugin().apply(compiler) new FunctionModulePlugin(options.output).apply(compiler) new NodeSourcePlugin(options.node).apply(compiler) new LoaderTargetPlugin('web').apply(compiler) - } - - const creater = new Function( - `var t = arguments[0]; return function ${name}(c) { return t(c); }` - ); - return creater(target) + } } export const Targets = { @@ -209,7 +204,7 @@ export default class MiniPlugin { taroFileTypeMap[this.appEntry] = { type: PARSE_AST_TYPE.ENTRY, config: configObj, - wxml: transformResult.template, + template: transformResult.template, code: transformResult.code } this.pages = new Set([ @@ -235,7 +230,7 @@ export default class MiniPlugin { taroFileTypeMap[file.path] = { type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, config: merge({}, buildUsingComponents(file.path, {}, transformResult.components),configObj), - wxml: transformResult.template, + template: transformResult.template, code: transformResult.code } let depComponents = transformResult.components @@ -268,16 +263,17 @@ export default class MiniPlugin { } generateMiniFiles (compilation: webpack.compilation.Compilation) { + const { buildAdapter } = this.options Object.keys(taroFileTypeMap).forEach(item => { const relativePath = item.replace(this.sourceDir, '') const extname = path.extname(item) - const wxmlPath = relativePath.replace(extname, '.wxml') - const jsonPath = relativePath.replace(extname, '.json') + const templatePath = relativePath.replace(extname, MINI_APP_FILES[buildAdapter].TEMPL) + const jsonPath = relativePath.replace(extname, MINI_APP_FILES[buildAdapter].CONFIG) const itemInfo = taroFileTypeMap[item] if (itemInfo.type !== PARSE_AST_TYPE.ENTRY) { - compilation.assets[wxmlPath] = { - size: () => itemInfo.wxml!.length, - source: () => itemInfo.wxml + compilation.assets[templatePath] = { + size: () => itemInfo.template!.length, + source: () => itemInfo.template } } const jsonStr = JSON.stringify(itemInfo.config) diff --git a/packages/taro-mini-runner/src/utils/constants.ts b/packages/taro-mini-runner/src/utils/constants.ts index 2e416f235903..6c830787a890 100644 --- a/packages/taro-mini-runner/src/utils/constants.ts +++ b/packages/taro-mini-runner/src/utils/constants.ts @@ -20,6 +20,91 @@ export const enum BUILD_TYPES { QQ = 'qq' } +export const enum TEMPLATE_TYPES { + WEAPP = '.wxml', + SWAN = '.swan', + ALIPAY = '.axml', + TT = '.ttml', + QUICKAPP = '.ux', + QQ = '.qml' +} + +export const enum STYLE_TYPES { + WEAPP = '.wxss', + SWAN = '.css', + ALIPAY = '.acss', + TT = '.ttss', + QUICKAPP = '.css', + QQ = '.qss' +} + +export const enum SCRIPT_TYPES { + WEAPP = '.js', + SWAN = '.js', + ALIPAY = '.js', + TT = '.js', + QUICKAPP = '.js', + QQ = '.js' +} + +export const enum CONFIG_TYPES { + WEAPP = '.json', + SWAN = '.json', + ALIPAY = '.json', + TT = '.json', + QUICKAPP = '.json', + QQ = '.json' +} + +export type IMINI_APP_FILE_TYPE = { + TEMPL: TEMPLATE_TYPES, + STYLE: STYLE_TYPES, + SCRIPT: SCRIPT_TYPES, + CONFIG: CONFIG_TYPES +} + +export type IMINI_APP_FILES = { + [key: string]: IMINI_APP_FILE_TYPE +} +export const MINI_APP_FILES: IMINI_APP_FILES = { + [BUILD_TYPES.WEAPP]: { + TEMPL: TEMPLATE_TYPES.WEAPP, + STYLE: STYLE_TYPES.WEAPP, + SCRIPT: SCRIPT_TYPES.WEAPP, + CONFIG: CONFIG_TYPES.WEAPP + }, + [BUILD_TYPES.SWAN]: { + TEMPL: TEMPLATE_TYPES.SWAN, + STYLE: STYLE_TYPES.SWAN, + SCRIPT: SCRIPT_TYPES.SWAN, + CONFIG: CONFIG_TYPES.SWAN + }, + [BUILD_TYPES.ALIPAY]: { + TEMPL: TEMPLATE_TYPES.ALIPAY, + STYLE: STYLE_TYPES.ALIPAY, + SCRIPT: SCRIPT_TYPES.ALIPAY, + CONFIG: CONFIG_TYPES.ALIPAY + }, + [BUILD_TYPES.TT]: { + TEMPL: TEMPLATE_TYPES.TT, + STYLE: STYLE_TYPES.TT, + SCRIPT: SCRIPT_TYPES.TT, + CONFIG: CONFIG_TYPES.TT + }, + [BUILD_TYPES.QUICKAPP]: { + TEMPL: TEMPLATE_TYPES.QUICKAPP, + STYLE: STYLE_TYPES.QUICKAPP, + SCRIPT: SCRIPT_TYPES.QUICKAPP, + CONFIG: CONFIG_TYPES.QUICKAPP + }, + [BUILD_TYPES.QQ]: { + TEMPL: TEMPLATE_TYPES.QQ, + STYLE: STYLE_TYPES.QQ, + SCRIPT: SCRIPT_TYPES.QQ, + CONFIG: CONFIG_TYPES.QQ + } +} + export const CONFIG_MAP = { [BUILD_TYPES.WEAPP]: { navigationBarTitleText: 'navigationBarTitleText', From 65c699d31c67052dfd1a14cd66714a42cc363417 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 5 Jun 2019 17:53:46 +0800 Subject: [PATCH 021/194] =?UTF-8?q?feat(taro-mini-runner):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=96=87=E4=BB=B6=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/index.ts | 13 +++++++++++-- packages/taro-mini-runner/src/plugins/MiniPlugin.ts | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index 52c2fc7998d3..7cebfcabc2e3 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -4,10 +4,18 @@ import * as webpack from 'webpack' import { IBuildConfig } from './utils/types' import { printBuildError, bindProdLogger } from './utils/logHelper' import MiniPlugin, { Targets } from './plugins/MiniPlugin' -import { MINI_APP_FILES } from './utils/constants' +import { MINI_APP_FILES, BUILD_TYPES } from './utils/constants' const extensions = ['.ts', '.tsx', '.js', '.jsx'] +const globalObjectMap = { + [BUILD_TYPES.WEAPP]: 'wx', + [BUILD_TYPES.ALIPAY]: 'my', + [BUILD_TYPES.SWAN]: 'swan', + [BUILD_TYPES.QQ]: 'qq', + [BUILD_TYPES.TT]: 'tt' +} + export default function build (config: IBuildConfig) { const compilePlugins = config.plugins const { babel } = compilePlugins @@ -18,7 +26,8 @@ export default function build (config: IBuildConfig) { output: { filename: '[name].js', publicPath: '/', - path: config.outputDir, + path: config.outputDir, + globalObject: globalObjectMap[config.buildAdapter] }, resolve: { extensions: ['.ts', '.tsx', '.js', '.jsx'] diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 10a829d2af72..d170007f9f47 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -6,6 +6,7 @@ import wxTransformer from '@tarojs/transformer-wx' import * as webpack from 'webpack' import * as SingleEntryPlugin from 'webpack/lib/SingleEntryPlugin' import * as FunctionModulePlugin from 'webpack/lib/FunctionModulePlugin' +import * as JsonpTemplatePlugin from 'webpack/lib/web/JsonpTemplatePlugin' import * as NodeSourcePlugin from 'webpack/lib/node/NodeSourcePlugin' import * as LoaderTargetPlugin from 'webpack/lib/LoaderTargetPlugin' import * as VirtualModulePlugin from 'virtual-module-webpack-plugin' @@ -17,7 +18,6 @@ import { Config as IConfig } from '@tarojs/taro' import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES } from '../utils/constants' import { traverseObjectNode, resolveScriptPath, buildUsingComponents } from '../utils' -import TaroTemplatePlugin from './TaroTemplatePlugin' import TaroLoadChunksPlugin from './TaroLoadChunksPlugin' interface IMiniPluginOptions { @@ -44,7 +44,7 @@ const taroFileTypeMap: ITaroFileInfo = {} export const createTarget = function createTarget (name) { return (compiler: webpack.compiler.Compiler) => { const { options } = compiler - new TaroTemplatePlugin().apply(compiler) + new JsonpTemplatePlugin().apply(compiler) new FunctionModulePlugin(options.output).apply(compiler) new NodeSourcePlugin(options.node).apply(compiler) new LoaderTargetPlugin('web').apply(compiler) From 302e878f0a9c205119d3ec3f1f05c99614619871 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 5 Jun 2019 17:58:41 +0800 Subject: [PATCH 022/194] =?UTF-8?q?feat(taro-mini-runner):=20=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E6=98=AF=E7=BB=84=E4=BB=B6=E9=9C=80=E8=A6=81=E8=A1=A5?= =?UTF-8?q?=E5=85=85=20component:true=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/plugins/MiniPlugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index d170007f9f47..7f15613ab98a 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -227,9 +227,10 @@ export default class MiniPlugin { adapter: buildAdapter }) const { configObj } = this.parseAst(transformResult.ast, buildAdapter) + const isComponentConfig = isRoot ? {} : { component: true } taroFileTypeMap[file.path] = { type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, - config: merge({}, buildUsingComponents(file.path, {}, transformResult.components),configObj), + config: merge({}, isComponentConfig, buildUsingComponents(file.path, {}, transformResult.components),configObj), template: transformResult.template, code: transformResult.code } From 18bc2bc969324e46df8a6cfb547e12bfb989ef24 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Fri, 14 Jun 2019 11:03:07 +0800 Subject: [PATCH 023/194] =?UTF-8?q?fix(cli):=20=E6=94=AF=E6=8C=81=E5=BC=95?= =?UTF-8?q?=E7=94=A8=20node=5Fmodules=20=E4=B8=AD=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/package.json | 1 + .../dependencies/TaroSingleEntryDependency.ts | 17 ++ packages/taro-mini-runner/src/index.ts | 1 - .../src/loaders/fileParseLoader.ts | 8 +- .../src/plugins/MiniPlugin.ts | 232 ++++++++++++++++-- .../src/plugins/ResolverPlugin.ts | 28 +++ .../src/plugins/TaroLoadChunksPlugin.ts | 6 +- .../src/plugins/TaroNormalModule.ts | 12 + .../src/plugins/TaroNormalModulesPlugin.ts | 19 ++ .../taro-mini-runner/src/utils/constants.ts | 3 + packages/taro-mini-runner/src/utils/index.ts | 21 +- packages/taro-mini-runner/yarn.lock | 6 + 12 files changed, 324 insertions(+), 30 deletions(-) create mode 100644 packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts create mode 100644 packages/taro-mini-runner/src/plugins/ResolverPlugin.ts create mode 100644 packages/taro-mini-runner/src/plugins/TaroNormalModule.ts create mode 100644 packages/taro-mini-runner/src/plugins/TaroNormalModulesPlugin.ts diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index 1472a4007fbc..b3ef3b8d5102 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -49,6 +49,7 @@ "lodash": "^4.17.11", "node-sass": "^4.12.0", "ora": "^3.4.0", + "resolve": "^1.11.1", "sass-loader": "^7.1.0", "virtual-module-webpack-plugin": "^0.4.1", "webpack": "^4.31.0", diff --git a/packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts b/packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts new file mode 100644 index 000000000000..70e251a37ef2 --- /dev/null +++ b/packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts @@ -0,0 +1,17 @@ +import * as ModuleDependency from 'webpack/lib/dependencies/ModuleDependency' +import { PARSE_AST_TYPE } from '../utils/constants' + +export default class TaroSingleEntryDependency extends ModuleDependency { + name: string + miniType: PARSE_AST_TYPE + constructor (request, name, loc, miniType) { + super(request) + this.name = name + this.loc = loc + this.miniType = miniType + } + + get type () { + return 'single entry' + } +} diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index 7cebfcabc2e3..17a0b0c08f60 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -36,7 +36,6 @@ export default function build (config: IBuildConfig) { rules: [ { test: /\.(tsx?|jsx?)$/, - exclude: /node_modules/, use: [{ loader: path.resolve(__dirname, './loaders/fileParseLoader'), options: { diff --git a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts index c7359c35242a..cd333e12d3b6 100644 --- a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts +++ b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts @@ -449,8 +449,7 @@ export default function fileParseLoader (source, ast) { constantsReplaceList, buildAdapter, designWidth, - deviceRatio, - fileTypeMap + deviceRatio } = getOptions(this) const filePath = this.resourcePath const newAst = transformFromAst(ast, '', { @@ -459,9 +458,8 @@ export default function fileParseLoader (source, ast) { [require('babel-plugin-transform-define').default, constantsReplaceList] ] }).ast as t.File - const fileTypeInfo = fileTypeMap[filePath] || { type: PARSE_AST_TYPE.NORMAL, config: { } } - const configObj = fileTypeInfo.config - const result = processAst(newAst, buildAdapter, fileTypeInfo.type, designWidth, deviceRatio, filePath, this.context) + const miniType = this._module.miniType || PARSE_AST_TYPE.NORMAL + const result = processAst(newAst, buildAdapter, miniType, designWidth, deviceRatio, filePath, this.context) const code = generate(result).code const res = transform(code, babelConfig) return res.code diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 7f15613ab98a..0ac6a6bc0ad1 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -10,15 +10,19 @@ import * as JsonpTemplatePlugin from 'webpack/lib/web/JsonpTemplatePlugin' import * as NodeSourcePlugin from 'webpack/lib/node/NodeSourcePlugin' import * as LoaderTargetPlugin from 'webpack/lib/LoaderTargetPlugin' import * as VirtualModulePlugin from 'virtual-module-webpack-plugin' -import { merge, defaults } from 'lodash' +import { merge, defaults, kebabCase } from 'lodash' import * as t from 'babel-types' import traverse from 'babel-traverse' import { Config as IConfig } from '@tarojs/taro' -import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES } from '../utils/constants' -import { traverseObjectNode, resolveScriptPath, buildUsingComponents } from '../utils' +import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG } from '../utils/constants' +import { IComponentObj } from '../utils/types' +import { traverseObjectNode, resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync } from '../utils' +import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency' import TaroLoadChunksPlugin from './TaroLoadChunksPlugin' +import TaroNormalModulesPlugin from './TaroNormalModulesPlugin' +import ResolverPlugin from './ResolverPlugin' interface IMiniPluginOptions { appEntry?: string, @@ -59,12 +63,64 @@ export const Targets = { [BUILD_TYPES.QQ]: createTarget(BUILD_TYPES.QQ), } +export function isFileToBeTaroComponent ( + code: string, + sourcePath: string, + buildAdapter: BUILD_TYPES +) { + const transformResult = wxTransformer({ + code, + sourcePath: sourcePath, + isTyped: REG_TYPESCRIPT.test(sourcePath), + adapter: buildAdapter, + isNormal: true + }) + const { ast } = transformResult + let isTaroComponent = false + + traverse(ast, { + ClassDeclaration (astPath) { + astPath.traverse({ + ClassMethod (astPath) { + if (astPath.get('key').isIdentifier({ name: 'render' })) { + astPath.traverse({ + JSXElement () { + isTaroComponent = true + } + }) + } + } + }) + }, + + ClassExpression (astPath) { + astPath.traverse({ + ClassMethod (astPath) { + if (astPath.get('key').isIdentifier({ name: 'render' })) { + astPath.traverse({ + JSXElement () { + isTaroComponent = true + } + }) + } + } + }) + } + }) + + return { + isTaroComponent, + transformResult + } +} + export default class MiniPlugin { options: IMiniPluginOptions appEntry: string pages: Set components: Set sourceDir: string + context: string constructor (options = {}) { this.options = defaults(options || {}, { @@ -72,7 +128,7 @@ export default class MiniPlugin { commonChunks: ['runtime', 'vendors'] }) - this.pages = new Set() + this.pages = new Set() this.components = new Set() } @@ -86,6 +142,8 @@ export default class MiniPlugin { } apply (compiler: webpack.Compiler) { + this.context = compiler.context + compiler.hooks.run.tapAsync( PLUGIN_NAME, this.tryAsync(async (compiler: webpack.Compiler) => { @@ -93,17 +151,51 @@ export default class MiniPlugin { }) ) - compiler.hooks.emit.tapAsync( + compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set(TaroSingleEntryDependency, normalModuleFactory) + // compilation.hooks.afterOptimizeChunks.tap(PLUGIN_NAME, (modules) => { + // console.log(modules) + // // modules.forEach(mod => { + // // console.log(mod.name) + // // console.log(mod._source.source()) + // // }) + // // callback() + // }) + }) + + compiler.hooks.emit.tapAsync( PLUGIN_NAME, this.tryAsync(async compilation => { await this.generateMiniFiles(compilation) }) ) + // compiler.resolverFactory.hooks.resolver.for('normal').tap(PLUGIN_NAME, resolver => { + // console.log('sdsdsdsdsd') + // new ResolverPlugin('resolve', 'parsedResolve').apply(resolver) + // }) + // compiler.hooks.normalModuleFactory.tap(PLUGIN_NAME, nmf => { + // nmf.hooks.afterResolve.tapAsync(PLUGIN_NAME, (result, callback) => { + // // console.log(result) + // if (result.resource.indexOf('node_modules') >= 0) { + // const issuerArr = result.resource.split(path.sep) + // const lastNodeModulesIndex = issuerArr.lastIndexOf('node_modules') + // const pkgName = result.resourceResolveData.descriptionFileData.name + // issuerArr.splice(lastNodeModulesIndex + 1, pkgName.split('/').length, pkgName.replace(/\//g, path.sep)) + // const newIssuer = issuerArr.join(path.sep) + // result.userRequest = newIssuer + // result.resource = newIssuer + // } + // return callback(null, result) + // }) + // }) + new TaroLoadChunksPlugin({ commonChunks: this.options.commonChunks, taroFileTypeMap }).apply(compiler) + + new TaroNormalModulesPlugin().apply(compiler) } getAppEntry (compiler) { @@ -185,6 +277,95 @@ export default class MiniPlugin { } } + getNpmComponentRealPath (code: string, component: IComponentObj, adapter: BUILD_TYPES): string | null { + let componentRealPath: string | null = null + let importExportName + const { isTaroComponent, transformResult } = isFileToBeTaroComponent(code, component.path, adapter) + if (isTaroComponent) { + return component.path + } + const { ast } = transformResult + traverse(ast, { + ExportNamedDeclaration (astPath) { + const node = astPath.node + const specifiers = node.specifiers + const source = node.source + if (source && source.type === 'StringLiteral') { + specifiers.forEach(specifier => { + const exported = specifier.exported + if (kebabCase(exported.name) === component.name) { + componentRealPath = resolveScriptPath(path.resolve(path.dirname(component.path), source.value)) + } + }) + } else { + specifiers.forEach(specifier => { + const exported = specifier.exported + if (kebabCase(exported.name) === component.name) { + importExportName = exported.name + } + }) + } + }, + + ExportDefaultDeclaration (astPath) { + const node = astPath.node + const declaration = node.declaration as t.Identifier + if (component.type === 'default') { + importExportName = declaration.name + } + }, + + CallExpression (astPath) { + if (astPath.get('callee').isIdentifier({ name: 'require' })) { + const arg = astPath.get('arguments')[0] + if (t.isStringLiteral(arg.node)) { + componentRealPath = resolveScriptPath(path.resolve(path.dirname(component.path), arg.node.value)) + } + } + }, + + Program: { + exit (astPath) { + astPath.traverse({ + ImportDeclaration (astPath) { + const node = astPath.node + const specifiers = node.specifiers + const source = node.source + if (importExportName) { + specifiers.forEach(specifier => { + const local = specifier.local + if (local.name === importExportName) { + componentRealPath = resolveScriptPath(path.resolve(path.dirname(component.path), source.value)) + } + }) + } + } + }) + } + } + }) + if (componentRealPath) { + component.path = componentRealPath + code = fs.readFileSync(componentRealPath).toString() + componentRealPath = this.getNpmComponentRealPath(code, component, adapter) + } + return componentRealPath + } + + transfromComponentsPath (components: IComponentObj[]) { + const { buildAdapter } = this.options + components.forEach(component => { + const componentPath = component.path + if (componentPath && isNpmPkg(componentPath)) { + const res = resolveNpmSync(componentPath, this.context) + const code = fs.readFileSync(res).toString() + const newComponent = Object.assign({}, component, { path: res }) + const realComponentPath = this.getNpmComponentRealPath(code, newComponent, buildAdapter) + component.path = realComponentPath + } + }) + } + getPages () { const { buildAdapter } = this.options const appEntry = this.appEntry @@ -228,18 +409,25 @@ export default class MiniPlugin { }) const { configObj } = this.parseAst(transformResult.ast, buildAdapter) const isComponentConfig = isRoot ? {} : { component: true } + let depComponents = transformResult.components + this.transfromComponentsPath(depComponents) taroFileTypeMap[file.path] = { type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, - config: merge({}, isComponentConfig, buildUsingComponents(file.path, {}, transformResult.components),configObj), + config: merge({}, isComponentConfig, buildUsingComponents(file.path, this.sourceDir, {}, depComponents),configObj), template: transformResult.template, code: transformResult.code } - let depComponents = transformResult.components if (depComponents && depComponents.length) { depComponents.forEach(item => { const componentPath = resolveScriptPath(path.resolve(path.dirname(file.path), item.path)) if (fs.existsSync(componentPath) && !Array.from(this.components).some(item => item.path === componentPath)) { - const componentName = componentPath.replace(this.sourceDir, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') + let componentName + if (NODE_MODULES_REG.test(componentPath)) { + componentName = componentPath.replace(this.context, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') + componentName = componentName.replace(/node_modules/gi, 'npm') + } else { + componentName = componentPath.replace(this.sourceDir, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') + } const componentObj = { name: componentName, path: componentPath } this.components.add(componentObj) this.getComponents(new Set([componentObj]), false) @@ -249,24 +437,32 @@ export default class MiniPlugin { }) } + addEntry (compiler: webpack.Compiler, entryPath, entryName, entryType) { + compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation: webpack.compilation.Compilation, callback) => { + const dep = new TaroSingleEntryDependency(entryPath, entryName, { name: entryName }, entryType) + compilation.addEntry(this.sourceDir, dep, entryName, callback) + }) + } + addEntries (compiler: webpack.Compiler) { - const mainFiles = new Set([ ...this.pages, ...this.components ]) - mainFiles.add({ - name: 'app', - path: this.appEntry + this.addEntry(compiler, this.appEntry, 'app', PARSE_AST_TYPE.ENTRY) + this.pages.forEach(item => { + this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.PAGE) }) - mainFiles.forEach(item => { - compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation: webpack.compilation.Compilation, callback) => { - const dep = SingleEntryPlugin.createDependency(item.path, item.name) - compilation.addEntry(this.sourceDir, dep, item.name, callback) - }) + this.components.forEach(item => { + this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.COMPONENT) }) } generateMiniFiles (compilation: webpack.compilation.Compilation) { const { buildAdapter } = this.options Object.keys(taroFileTypeMap).forEach(item => { - const relativePath = item.replace(this.sourceDir, '') + let relativePath + if (NODE_MODULES_REG.test(item)) { + relativePath = item.replace(this.context, '').replace(/node_modules/gi, 'npm') + } else { + relativePath = item.replace(this.sourceDir, '') + } const extname = path.extname(item) const templatePath = relativePath.replace(extname, MINI_APP_FILES[buildAdapter].TEMPL) const jsonPath = relativePath.replace(extname, MINI_APP_FILES[buildAdapter].CONFIG) diff --git a/packages/taro-mini-runner/src/plugins/ResolverPlugin.ts b/packages/taro-mini-runner/src/plugins/ResolverPlugin.ts new file mode 100644 index 000000000000..4f5f7e6362d0 --- /dev/null +++ b/packages/taro-mini-runner/src/plugins/ResolverPlugin.ts @@ -0,0 +1,28 @@ +import * as path from 'path' +import { NODE_MODULES_REG } from '../utils/constants' + +const PLUGIN_NAME = 'ResolverPlugin' + +export default class ResolverPlugin { + constructor (source, target) { + this.source = source + this.target = target + } + + apply (resolver) { + const source = resolver.getHook(this.source) + const target = resolver.ensureHook(this.target) + source.tapAsync(PLUGIN_NAME, (request, resolveContext, callback) => { + const { issuer } = request.context + if (issuer && NODE_MODULES_REG.test(issuer)) { + const issuerArr = issuer.split(path.sep) + const lastNodeModulesIndex = issuerArr.lastIndexOf('node_modules') + const pkgName = request.descriptionFileData.name + issuerArr.splice(lastNodeModulesIndex + 1, pkgName.split('/').length, pkgName.replace(/\//g, path.sep)) + const newIssuer = issuerArr.join(path.sep) + request.context.issuer = newIssuer + } + resolver.doResolve(target, request, null, resolveContext, callback) + }) + } +} diff --git a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts index 17350a670233..b366ad93d2a6 100644 --- a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts @@ -19,7 +19,6 @@ export default class TaroLoadChunksPlugin { constructor (options: IOptions) { this.commonChunks = options.commonChunks - this.taroFileTypeMap = options.taroFileTypeMap } apply (compiler: webpack.Compiler) { @@ -29,10 +28,7 @@ export default class TaroLoadChunksPlugin { commonChunks = chunks.filter(chunk => this.commonChunks.includes(chunk.name)) }) compilation.chunkTemplate.hooks.renderWithEntry.tap(PLUGIN_NAME, (modules, chunk) => { - if (chunk.entryModule - && chunk.entryModule - && this.taroFileTypeMap[chunk.entryModule.resource] - && this.taroFileTypeMap[chunk.entryModule.resource].type === PARSE_AST_TYPE.ENTRY) { + if (chunk.entryModule && chunk.entryModule.miniType === PARSE_AST_TYPE.ENTRY) { const source = new ConcatSource() commonChunks.reverse().forEach(chunkItem => { source.add(`require(${JSON.stringify(urlToRequest(chunkItem.name))});\n`) diff --git a/packages/taro-mini-runner/src/plugins/TaroNormalModule.ts b/packages/taro-mini-runner/src/plugins/TaroNormalModule.ts new file mode 100644 index 000000000000..a5f327d7fd9e --- /dev/null +++ b/packages/taro-mini-runner/src/plugins/TaroNormalModule.ts @@ -0,0 +1,12 @@ +import * as NormalModule from 'webpack/lib/NormalModule' +import { PARSE_AST_TYPE } from '../utils/constants' + +export default class TaroNormalModule extends NormalModule { + name: string + miniType: PARSE_AST_TYPE + constructor (data) { + super(data) + this.name = data.name + this.miniType = data.miniType + } +} diff --git a/packages/taro-mini-runner/src/plugins/TaroNormalModulesPlugin.ts b/packages/taro-mini-runner/src/plugins/TaroNormalModulesPlugin.ts new file mode 100644 index 000000000000..7b99d237a959 --- /dev/null +++ b/packages/taro-mini-runner/src/plugins/TaroNormalModulesPlugin.ts @@ -0,0 +1,19 @@ +import webpack from 'webpack' + +import TaroNormalModule from './TaroNormalModule' +import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency' + +const PLUGIN_NAME = 'TaroNormalModulesPlugin' + +export default class TaroNormalModulesPlugin { + apply (compiler: webpack.Compiler) { + compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation, { normalModuleFactory }) => { + normalModuleFactory.hooks.createModule.tap(PLUGIN_NAME, data => { + const dependency = data.dependencies[0] + if (dependency.constructor === TaroSingleEntryDependency) { + return new TaroNormalModule(Object.assign(data, { miniType: dependency.miniType, name: dependency.name })) + } + }) + }) + } +} diff --git a/packages/taro-mini-runner/src/utils/constants.ts b/packages/taro-mini-runner/src/utils/constants.ts index 6c830787a890..2224d8cc9749 100644 --- a/packages/taro-mini-runner/src/utils/constants.ts +++ b/packages/taro-mini-runner/src/utils/constants.ts @@ -9,6 +9,9 @@ export const REG_SCRIPT: RegExp = /\.(js|jsx)(\?.*)?$/ export const REG_TYPESCRIPT: RegExp = /\.(tsx|ts)(\?.*)?$/ export const REG_SCRIPTS: RegExp = /\.[tj]sx?$/i +export const NODE_MODULES = 'node_modules' +export const NODE_MODULES_REG = /(.*)node_modules/ + export const enum BUILD_TYPES { WEAPP = 'weapp', SWAN ='swan', diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index d839bfbdcba1..8e12acf4cf68 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -1,9 +1,10 @@ import * as path from 'path' import * as fs from 'fs-extra' +import * as resolvePath from 'resolve' import * as t from 'babel-types' -import { CONFIG_MAP, JS_EXT, TS_EXT } from './constants' +import { CONFIG_MAP, JS_EXT, TS_EXT, NODE_MODULES_REG } from './constants' import { IOption, IComponentObj } from './types' export function isNpmPkg (name: string): boolean { @@ -130,6 +131,7 @@ export function resolveScriptPath (p: string): string { export function buildUsingComponents ( filePath: string, + sourceDir: string, pathAlias: IOption, components: IComponentObj[], isComponent?: boolean @@ -142,6 +144,9 @@ export function buildUsingComponents ( } componentPath = resolveScriptPath(path.resolve(filePath, '..', componentPath as string)) if (fs.existsSync(componentPath)) { + if (/node_modules/.test(componentPath)) { + componentPath = componentPath.replace(NODE_MODULES_REG, path.join(sourceDir, 'npm')) + } componentPath = promoteRelativePath(path.relative(filePath, componentPath)) } else { componentPath = component.path @@ -154,3 +159,17 @@ export function buildUsingComponents ( usingComponents } : {}) } +const npmCached = {} +export function resolveNpmSync (pkgName: string, root): string | null { + try { + if (!npmCached[pkgName]) { + return resolvePath.sync(pkgName, { basedir: root }) + } + return npmCached[pkgName] + } catch (err) { + if (err.code === 'MODULE_NOT_FOUND') { + throw new Error(`包 ${pkgName} 未安装`) + } + return null + } +} diff --git a/packages/taro-mini-runner/yarn.lock b/packages/taro-mini-runner/yarn.lock index 6c5798ac3df4..262bd904eee0 100644 --- a/packages/taro-mini-runner/yarn.lock +++ b/packages/taro-mini-runner/yarn.lock @@ -4622,6 +4622,12 @@ resolve@1.x, resolve@^1.10.0, resolve@^1.3.2: dependencies: path-parse "^1.0.6" +resolve@^1.11.1: + version "1.11.1" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" + dependencies: + path-parse "^1.0.6" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" From 2ea320574367ee2d77e24b62f31d221a1d54becf Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 17 Jun 2019 13:53:12 +0800 Subject: [PATCH 024/194] =?UTF-8?q?feat(mini-runner):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=20Taro=20=E6=A8=A1=E5=9D=97=E4=B8=93=E6=9C=89=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dependencies/TaroSingleEntryDependency.ts | 1 + packages/taro-mini-runner/src/index.ts | 6 ++-- .../src/plugins/MiniPlugin.ts | 36 +++---------------- .../src/plugins/ResolverPlugin.ts | 28 --------------- 4 files changed, 7 insertions(+), 64 deletions(-) delete mode 100644 packages/taro-mini-runner/src/plugins/ResolverPlugin.ts diff --git a/packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts b/packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts index 70e251a37ef2..95468aadecb5 100644 --- a/packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts +++ b/packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts @@ -4,6 +4,7 @@ import { PARSE_AST_TYPE } from '../utils/constants' export default class TaroSingleEntryDependency extends ModuleDependency { name: string miniType: PARSE_AST_TYPE + loc: any constructor (request, name, loc, miniType) { super(request) this.name = name diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index 17a0b0c08f60..c3438d259539 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -43,14 +43,12 @@ export default function build (config: IBuildConfig) { designWidth: config.designWidth, deviceRatio: config.deviceRatio, buildAdapter: config.buildAdapter, - constantsReplaceList: config.constantsReplaceList, - fileTypeMap: MiniPlugin.getTaroFileTypeMap() + constantsReplaceList: config.constantsReplaceList } }, { loader: path.resolve(__dirname, './loaders/wxTransformerLoader'), options: { - buildAdapter: config.buildAdapter, - fileTypeMap: MiniPlugin.getTaroFileTypeMap() + buildAdapter: config.buildAdapter } }] }, diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 0ac6a6bc0ad1..9b69760411fc 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -4,7 +4,7 @@ import * as fs from 'fs-extra' import wxTransformer from '@tarojs/transformer-wx' import * as webpack from 'webpack' -import * as SingleEntryPlugin from 'webpack/lib/SingleEntryPlugin' +import * as SingleEntryDependency from 'webpack/lib/dependencies/SingleEntryDependency' import * as FunctionModulePlugin from 'webpack/lib/FunctionModulePlugin' import * as JsonpTemplatePlugin from 'webpack/lib/web/JsonpTemplatePlugin' import * as NodeSourcePlugin from 'webpack/lib/node/NodeSourcePlugin' @@ -22,7 +22,6 @@ import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency import TaroLoadChunksPlugin from './TaroLoadChunksPlugin' import TaroNormalModulesPlugin from './TaroNormalModulesPlugin' -import ResolverPlugin from './ResolverPlugin' interface IMiniPluginOptions { appEntry?: string, @@ -143,7 +142,7 @@ export default class MiniPlugin { apply (compiler: webpack.Compiler) { this.context = compiler.context - + this.appEntry = this.getAppEntry(compiler) compiler.hooks.run.tapAsync( PLUGIN_NAME, this.tryAsync(async (compiler: webpack.Compiler) => { @@ -152,15 +151,8 @@ export default class MiniPlugin { ) compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation, { normalModuleFactory }) => { + compilation.dependencyFactories.set(SingleEntryDependency, normalModuleFactory) compilation.dependencyFactories.set(TaroSingleEntryDependency, normalModuleFactory) - // compilation.hooks.afterOptimizeChunks.tap(PLUGIN_NAME, (modules) => { - // console.log(modules) - // // modules.forEach(mod => { - // // console.log(mod.name) - // // console.log(mod._source.source()) - // // }) - // // callback() - // }) }) compiler.hooks.emit.tapAsync( @@ -170,26 +162,6 @@ export default class MiniPlugin { }) ) - // compiler.resolverFactory.hooks.resolver.for('normal').tap(PLUGIN_NAME, resolver => { - // console.log('sdsdsdsdsd') - // new ResolverPlugin('resolve', 'parsedResolve').apply(resolver) - // }) - // compiler.hooks.normalModuleFactory.tap(PLUGIN_NAME, nmf => { - // nmf.hooks.afterResolve.tapAsync(PLUGIN_NAME, (result, callback) => { - // // console.log(result) - // if (result.resource.indexOf('node_modules') >= 0) { - // const issuerArr = result.resource.split(path.sep) - // const lastNodeModulesIndex = issuerArr.lastIndexOf('node_modules') - // const pkgName = result.resourceResolveData.descriptionFileData.name - // issuerArr.splice(lastNodeModulesIndex + 1, pkgName.split('/').length, pkgName.replace(/\//g, path.sep)) - // const newIssuer = issuerArr.join(path.sep) - // result.userRequest = newIssuer - // result.resource = newIssuer - // } - // return callback(null, result) - // }) - // }) - new TaroLoadChunksPlugin({ commonChunks: this.options.commonChunks, taroFileTypeMap @@ -214,6 +186,7 @@ export default class MiniPlugin { } const appEntryPath = getEntryPath(entry) this.sourceDir = path.dirname(appEntryPath) + compiler.options.entry = {} return appEntryPath } @@ -493,7 +466,6 @@ export default class MiniPlugin { } run (compiler: webpack.Compiler) { - this.appEntry = this.getAppEntry(compiler) this.getPages() this.getComponents(this.pages, true) this.addEntries(compiler) diff --git a/packages/taro-mini-runner/src/plugins/ResolverPlugin.ts b/packages/taro-mini-runner/src/plugins/ResolverPlugin.ts deleted file mode 100644 index 4f5f7e6362d0..000000000000 --- a/packages/taro-mini-runner/src/plugins/ResolverPlugin.ts +++ /dev/null @@ -1,28 +0,0 @@ -import * as path from 'path' -import { NODE_MODULES_REG } from '../utils/constants' - -const PLUGIN_NAME = 'ResolverPlugin' - -export default class ResolverPlugin { - constructor (source, target) { - this.source = source - this.target = target - } - - apply (resolver) { - const source = resolver.getHook(this.source) - const target = resolver.ensureHook(this.target) - source.tapAsync(PLUGIN_NAME, (request, resolveContext, callback) => { - const { issuer } = request.context - if (issuer && NODE_MODULES_REG.test(issuer)) { - const issuerArr = issuer.split(path.sep) - const lastNodeModulesIndex = issuerArr.lastIndexOf('node_modules') - const pkgName = request.descriptionFileData.name - issuerArr.splice(lastNodeModulesIndex + 1, pkgName.split('/').length, pkgName.replace(/\//g, path.sep)) - const newIssuer = issuerArr.join(path.sep) - request.context.issuer = newIssuer - } - resolver.doResolve(target, request, null, resolveContext, callback) - }) - } -} From 413f9f7629678f90483e26bba357ea42c9228aba Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 17 Jun 2019 16:27:13 +0800 Subject: [PATCH 025/194] =?UTF-8?q?feat(cli):=20=E5=A2=9E=E5=8A=A0=20tapab?= =?UTF-8?q?le=20=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/taro-cli/package.json b/packages/taro-cli/package.json index e14b8e286a88..9f87a23bc899 100644 --- a/packages/taro-cli/package.json +++ b/packages/taro-cli/package.json @@ -114,6 +114,7 @@ "stylelint": "9.3.0", "stylelint-config-taro-rn": "1.3.34", "stylelint-taro-rn": "1.3.34", + "tapable": "^1.1.3", "taro-css-to-react-native": "1.3.34", "through2": "^2.0.3", "vinyl": "^2.1.0", @@ -136,6 +137,7 @@ "@types/lodash": "^4.14.119", "@types/node": "^10.12.18", "@types/shelljs": "^0.8.5", + "@types/tapable": "^1.0.4", "babel-jest": "^23.6.0", "babel-plugin-transform-class-properties": "^6.24.1", "babel-preset-env": "^1.7.0", From 1a5a903fd7063e301383df7dfd99b52da5f2bc45 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 17 Jun 2019 16:44:12 +0800 Subject: [PATCH 026/194] =?UTF-8?q?fix(cli):=20=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=90=88=E5=B9=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/index.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index c3438d259539..ea80a3e032e8 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -21,7 +21,7 @@ export default function build (config: IBuildConfig) { const { babel } = compilePlugins const webpackConfig = { mode: config.isWatch ? 'development' : 'production', - devtool: "inline-source-map", + devtool: false, entry: config.entry, output: { filename: '[name].js', @@ -30,7 +30,19 @@ export default function build (config: IBuildConfig) { globalObject: globalObjectMap[config.buildAdapter] }, resolve: { - extensions: ['.ts', '.tsx', '.js', '.jsx'] + extensions + }, + target: Targets[config.buildAdapter], + optimization: { + runtimeChunk: { + name: 'runtime' + }, + splitChunks: { + chunks: 'all', + maxInitialRequests: Infinity, + minSize: 0, + name: 'vendors' + } }, module: { rules: [ From f012d261aa2afd93efb448e214b52a315d85c56d Mon Sep 17 00:00:00 2001 From: yuche Date: Mon, 17 Jun 2019 19:06:50 +0800 Subject: [PATCH 027/194] =?UTF-8?q?fix(transformer):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-transformer-wx/src/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/taro-transformer-wx/src/index.ts b/packages/taro-transformer-wx/src/index.ts index f6cea4bae831..b0d10f199ea6 100644 --- a/packages/taro-transformer-wx/src/index.ts +++ b/packages/taro-transformer-wx/src/index.ts @@ -200,8 +200,7 @@ export interface TransformResult extends Result { name: string, path: string, type: string - }[], - componentProperies: string[] + }[] } export interface TransformOptions extends Options { @@ -371,9 +370,8 @@ export default function transform (options: TransformOptions): TransformResult { code: superClass.code, isTyped: true, sourcePath: superClass.sourcePath, - outputPath: superClass.sourcePath, sourceDir: options.sourceDir - }).componentProperies + }).componentProperies! } catch (error) { // } From b77f00aaf4aa616eed3f07e3bb4bd374dd96b7df Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 17 Jun 2019 22:13:01 +0800 Subject: [PATCH 028/194] =?UTF-8?q?feat(cli):=20=E5=80=9F=E5=8A=A9=20tapab?= =?UTF-8?q?le=20=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/bin/taro-build | 9 +- packages/taro-cli/src/build.ts | 210 ++++++++++++-------------- packages/taro-cli/src/index.ts | 6 +- packages/taro-cli/src/mini/webpack.ts | 11 +- packages/taro-cli/src/util/types.ts | 11 +- 5 files changed, 123 insertions(+), 124 deletions(-) diff --git a/packages/taro-cli/bin/taro-build b/packages/taro-cli/bin/taro-build index 08d2ea63afc2..e44bfb287db8 100755 --- a/packages/taro-cli/bin/taro-build +++ b/packages/taro-cli/bin/taro-build @@ -5,7 +5,7 @@ const program = require('commander') const chalk = require('chalk') const _ = require('lodash') -const build = require('../dist/build').default +const Builder = require('../dist/build').default const { PROJECT_CONFIG, BUILD_TYPES } = require('../dist/util/constants') const appPath = process.cwd() const projectConfPath = path.join(appPath, PROJECT_CONFIG) @@ -37,10 +37,11 @@ if (env) { process.env.NODE_ENV = 'production' } } +const builder = new Builder(appPath) if (ui) { console.log(chalk.green(`开始编译 UI 库`)) - build(appPath, { + builder.build({ type: 'ui', watch, uiIndex @@ -52,7 +53,7 @@ if (plugin) { if (typeof plugin === 'boolean') { plugin = BUILD_TYPES.WEAPP } - build(appPath, { + builder.build({ type: BUILD_TYPES.PLUGIN, platform: plugin, watch @@ -76,7 +77,7 @@ if (typeof page === 'string') { console.log(chalk.green(`开始编译项目 ${chalk.bold(projectConf.projectName)}`)) } -build(appPath, { +builder.build({ type, watch, port: typeof port === 'string' ? port: undefined, diff --git a/packages/taro-cli/src/build.ts b/packages/taro-cli/src/build.ts index a4b0bd36f0b0..96c57724b790 100644 --- a/packages/taro-cli/src/build.ts +++ b/packages/taro-cli/src/build.ts @@ -1,131 +1,121 @@ import * as path from 'path' import * as fs from 'fs-extra' -import chalk from 'chalk' +import { SyncHook, Hook } from 'tapable' import * as _ from 'lodash' +import chalk from 'chalk' -import * as Util from './util' -import CONFIG from './config' import { BUILD_TYPES, PROJECT_CONFIG } from './util/constants' -import { IBuildConfig } from './util/types' +import { IBuildOptions, IProjectConfig, ICommonPlugin } from './util/types' +import { emptyDirectory } from './util' +import CONFIG from './config' -export default async function build (appPath, buildConfig: IBuildConfig) { - const { type, watch, platform, port, release, page, component, uiIndex } = buildConfig - const configDir = require(path.join(appPath, PROJECT_CONFIG))(_.merge) - const outputPath = path.join(appPath, configDir.outputRoot || CONFIG.OUTPUT_DIR) - if (!fs.existsSync(outputPath)) { - fs.ensureDirSync(outputPath) - } else if (type !== BUILD_TYPES.H5 && (type !== BUILD_TYPES.QUICKAPP || !watch)) { - Util.emptyDirectory(outputPath) - } - switch (type) { - case BUILD_TYPES.H5: - buildForH5(appPath, { watch, port }) - break - case BUILD_TYPES.WEAPP: - buildForWeapp(appPath, { watch, page, component }) - break - case BUILD_TYPES.SWAN: - buildForSwan(appPath, { watch, page, component }) - break - case BUILD_TYPES.ALIPAY: - buildForAlipay(appPath, { watch, page, component }) - break - case BUILD_TYPES.TT: - buildForTt(appPath, { watch, page, component }) - break - case BUILD_TYPES.RN: - buildForRN(appPath, { watch }) - break - case BUILD_TYPES.QUICKAPP: - buildForQuickApp(appPath, { watch, port, release }) - break - case BUILD_TYPES.QQ: - buildForQQ(appPath, { watch, page, component }) - break - case BUILD_TYPES.JD: - buildForJD(appPath, { watch }) - break - case BUILD_TYPES.UI: - buildForUILibrary(appPath, { watch, uiIndex }) - break - case BUILD_TYPES.PLUGIN: - buildForPlugin(appPath, { - watch, - platform - }) - break - default: - console.log(chalk.red('输入类型错误,目前只支持 weapp/swan/alipay/tt/h5/quickapp/rn 七端类型')) - } +interface IBuilderHooks { + beforeBuild: Hook, + afterBuild: Hook } -function buildForWeapp (appPath: string, buildConfig: IBuildConfig) { - require('./mini').build(appPath, Object.assign({ - adapter: BUILD_TYPES.WEAPP - }, buildConfig)) -} +export default class Builder { + hooks: IBuilderHooks + appPath: string + config: IProjectConfig + constructor (appPath: string) { + this.hooks = { + beforeBuild: new SyncHook(['config']), + afterBuild: new SyncHook(['builder']) + } -function buildForSwan (appPath: string, buildConfig: IBuildConfig) { - require('./mini').build(appPath, Object.assign({ - adapter: BUILD_TYPES.SWAN - }, buildConfig)) -} + this.appPath = appPath + this.init() + } -function buildForAlipay (appPath: string, buildConfig: IBuildConfig) { - require('./mini').build(appPath, Object.assign({ - adapter: BUILD_TYPES.ALIPAY - }, buildConfig)) -} + init () { + this.resolveConfig() + this.applyPlugins() + } -function buildForTt (appPath: string, buildConfig: IBuildConfig) { - require('./mini').build(appPath, Object.assign({ - adapter: BUILD_TYPES.TT - }, buildConfig)) -} + resolveConfig () { + this.config = require(path.join(this.appPath, PROJECT_CONFIG))(_.merge) + } -function buildForH5 (appPath: string, buildConfig: IBuildConfig) { - require('./h5').build(appPath, buildConfig) -} + applyPlugins () { + const commonConfig = Object.assign({}, { plugins: [] }, this.config.common) + const plugins = commonConfig.plugins + if (plugins.length) { + plugins.forEach((plugin: ICommonPlugin) => { + plugin.apply(this) + }) + } + } -function buildForRN (appPath: string, { watch }: IBuildConfig) { - require('./rn').build(appPath, { watch }) -} + emptyFirst ({ watch, type }) { + const outputPath = path.join(this.appPath, `${this.config.outputRoot || CONFIG.OUTPUT_DIR}}`) + if (!fs.existsSync(outputPath)) { + fs.ensureDirSync(outputPath) + } else if (type !== BUILD_TYPES.H5 && (type !== BUILD_TYPES.QUICKAPP || !watch)) { + emptyDirectory(outputPath) + } + } -function buildForQuickApp (appPath: string, { watch, port, release }: IBuildConfig) { - require('./mini').build(appPath, { - watch, - adapter: BUILD_TYPES.QUICKAPP, - port, - release - }) -} + build (buildOptions: IBuildOptions) { + this.hooks.beforeBuild.call(this.config) + const { type, watch, platform, port, uiIndex } = buildOptions + this.emptyFirst({ type, watch }) + switch (type) { + case BUILD_TYPES.H5: + this.buildForH5(this.appPath, { watch, port }) + break + case BUILD_TYPES.WEAPP: + case BUILD_TYPES.SWAN: + case BUILD_TYPES.ALIPAY: + case BUILD_TYPES.TT: + case BUILD_TYPES.QUICKAPP: + case BUILD_TYPES.QQ: + case BUILD_TYPES.JD: + this.buildForMini(this.appPath, buildOptions) + break + case BUILD_TYPES.RN: + this.buildForRN(this.appPath, { watch }) + break + case BUILD_TYPES.UI: + this.buildForUILibrary(this.appPath, { watch, uiIndex }) + break + case BUILD_TYPES.PLUGIN: + this.buildForPlugin(this.appPath, { + watch, + platform + }) + break + default: + console.log(chalk.red('输入类型错误,目前只支持 weapp/swan/alipay/tt/h5/quickapp/rn 七端类型')) + } + } -function buildForQQ (appPath: string, buildConfig: IBuildConfig) { - require('./mini').build(appPath, Object.assign({ - adapter: BUILD_TYPES.QQ - }, buildConfig)) -} + buildForH5 (appPath: string, buildOptions: IBuildOptions) { + require('./h5').build(appPath, buildOptions) + } -function buildForJD (appPath: string, { watch }: IBuildConfig) { - require('./mini').build(appPath, { - watch, - adapter: BUILD_TYPES.JD - }) -} + buildForMini (appPath: string, buildOptions: IBuildOptions) { + require('./mini/webpack').build(appPath, buildOptions, this) + } -function buildForUILibrary (appPath: string, { watch, uiIndex }: IBuildConfig) { - require('./ui/index').build(appPath, { watch, uiIndex }) -} + buildForRN (appPath: string, { watch }) { + require('./rn').build(appPath, { watch }) + } -function buildForPlugin (appPath: string, { watch, platform }) { - const typeMap = { - [BUILD_TYPES.WEAPP]: '微信', - [BUILD_TYPES.ALIPAY]: '支付宝' + buildForUILibrary (appPath: string, { watch, uiIndex }) { + require('./ui/index').build(appPath, { watch, uiIndex }) } - if (platform !== BUILD_TYPES.WEAPP && platform !== BUILD_TYPES.ALIPAY) { - console.log(chalk.red('目前插件编译仅支持 微信/支付宝 小程序!')) - return + + buildForPlugin (appPath: string, { watch, platform }) { + const typeMap = { + [BUILD_TYPES.WEAPP]: '微信', + [BUILD_TYPES.ALIPAY]: '支付宝' + } + if (platform !== BUILD_TYPES.WEAPP && platform !== BUILD_TYPES.ALIPAY) { + console.log(chalk.red('目前插件编译仅支持 微信/支付宝 小程序!')) + return + } + console.log(chalk.green(`开始编译${typeMap[platform]}小程序插件`)) + require('./plugin').build(appPath, { watch, platform }) } - console.log(chalk.green(`开始编译${typeMap[platform]}小程序插件`)) - require('./plugin').build(appPath, { watch, platform }) } diff --git a/packages/taro-cli/src/index.ts b/packages/taro-cli/src/index.ts index 3073694620dc..b99811b576ec 100644 --- a/packages/taro-cli/src/index.ts +++ b/packages/taro-cli/src/index.ts @@ -1,12 +1,12 @@ import Convertor from './convertor' -import build from './build' +import Builder from './build' import doctor from './doctor' import Project from './create/project' import { Compiler as H5Compiler } from './h5/index' export default { Convertor, - build, + Builder, doctor, Project, H5Compiler @@ -14,7 +14,7 @@ export default { export { Convertor, - build, + Builder, doctor, Project, H5Compiler diff --git a/packages/taro-cli/src/mini/webpack.ts b/packages/taro-cli/src/mini/webpack.ts index 35039c096136..c880b35b0814 100644 --- a/packages/taro-cli/src/mini/webpack.ts +++ b/packages/taro-cli/src/mini/webpack.ts @@ -5,6 +5,7 @@ import { IMiniAppBuildConfig } from '../util/types' import { BUILD_TYPES } from '../util/constants' import * as npmProcess from '../util/npm' import { getBabelConfig } from '../util' +import Builder from '../build' import { setBuildData, @@ -12,9 +13,8 @@ import { getBuildData } from './helper' -export async function build (appPath: string, { watch, adapter = BUILD_TYPES.WEAPP, envHasBeenSet = false, port, release }: IMiniAppBuildConfig) { +export async function build (appPath: string, { watch, adapter = BUILD_TYPES.WEAPP, envHasBeenSet = false, port, release }: IMiniAppBuildConfig, builder: Builder) { const buildData = setBuildData(appPath, adapter) - const isQuickApp = adapter === BUILD_TYPES.QUICKAPP process.env.TARO_ENV = adapter if (!envHasBeenSet) { setIsProduction(process.env.NODE_ENV === 'production' || !watch) @@ -23,11 +23,10 @@ export async function build (appPath: string, { watch, adapter = BUILD_TYPES.WEA await buildWithWebpack({ appPath - }) - + }, builder) } -async function buildWithWebpack ({ appPath }: { appPath: string }) { +async function buildWithWebpack ({ appPath }: { appPath: string }, builder) { const { entryFilePath, outputDir, @@ -54,5 +53,5 @@ async function buildWithWebpack ({ appPath }: { appPath: string }) { designWidth: projectConfig.designWidth, deviceRatio: projectConfig.deviceRatio } - miniRunner(miniRunnerOpts) + miniRunner(miniRunnerOpts, builder) } diff --git a/packages/taro-cli/src/util/types.ts b/packages/taro-cli/src/util/types.ts index 2150a62092f0..de721caad5d8 100644 --- a/packages/taro-cli/src/util/types.ts +++ b/packages/taro-cli/src/util/types.ts @@ -44,7 +44,7 @@ export interface IPrettierConfig { endOfLine?: 'auto' | 'lf' | 'crlf' | 'cr' } -export interface IBuildConfig { +export interface IBuildOptions { type?: BUILD_TYPES, watch?: boolean, platform?: string, @@ -341,6 +341,9 @@ export interface IManifestConfig extends ITaroManifestConfig { export interface IDeviceRatio { [key: string]: number } +export interface ICommonPlugin { + apply: (obj: object) => any +} export interface IProjectConfig { projectName?: string, @@ -355,6 +358,12 @@ export interface IProjectConfig { csso?: TogglableOptions, uglify?: TogglableOptions }, + common?: { + plugins?: ICommonPlugin[], + babel?: IBabelOptions, + csso?: TogglableOptions, + uglify?: TogglableOptions + }, ui?: { extraWatchFiles?: any[] }, From 13ab8b0ac1c0026a6e1c903764dd50ea1923275a Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 19 Jun 2019 23:02:14 +0800 Subject: [PATCH 029/194] =?UTF-8?q?feat(cli):=20cli=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=20&&=20=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=85=8D=E7=BD=AE=E5=90=91=20H5=20=E7=9C=8B=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/mini/webpack.ts | 23 +- packages/taro-mini-runner/package.json | 18 +- packages/taro-mini-runner/src/index.ts | 113 +---- .../src/plugins/MiniPlugin.ts | 10 +- .../taro-mini-runner/src/utils/constants.ts | 10 +- packages/taro-mini-runner/src/utils/index.ts | 17 + packages/taro-mini-runner/src/utils/types.ts | 47 +- .../src/webpack/build.conf.ts | 143 ++++++ .../taro-mini-runner/src/webpack/chain.ts | 321 +++++++++++++ .../src/webpack/postcss.conf.ts | 74 +++ packages/taro-mini-runner/yarn.lock | 439 +++++++++++++++++- 11 files changed, 1069 insertions(+), 146 deletions(-) create mode 100644 packages/taro-mini-runner/src/webpack/build.conf.ts create mode 100644 packages/taro-mini-runner/src/webpack/chain.ts create mode 100644 packages/taro-mini-runner/src/webpack/postcss.conf.ts diff --git a/packages/taro-cli/src/mini/webpack.ts b/packages/taro-cli/src/mini/webpack.ts index c880b35b0814..a4f44f207bb5 100644 --- a/packages/taro-cli/src/mini/webpack.ts +++ b/packages/taro-cli/src/mini/webpack.ts @@ -29,29 +29,30 @@ export async function build (appPath: string, { watch, adapter = BUILD_TYPES.WEA async function buildWithWebpack ({ appPath }: { appPath: string }, builder) { const { entryFilePath, - outputDir, - sourceDir, buildAdapter, projectConfig, isProduction, - constantsReplaceList + alias } = getBuildData() const miniRunner = await npmProcess.getNpmPkg('@tarojs/mini-runner', appPath) - const babelConfig = getBabelConfig(projectConfig!.plugins!.babel) + const babelConfig = getBabelConfig(projectConfig.babel) const miniRunnerOpts = { entry: { app: entryFilePath }, - sourceDir, - outputDir, + alias, + copy: projectConfig.copy, + outputRoot: projectConfig.outputRoot, buildAdapter, - plugins: { - babel: babelConfig - }, + babel: babelConfig, + csso: projectConfig.csso, + sass: projectConfig.csso, + uglify: projectConfig.uglify, isWatch: !isProduction, - constantsReplaceList, + env: projectConfig.env, + defineConstants: projectConfig.defineConstants, designWidth: projectConfig.designWidth, deviceRatio: projectConfig.deviceRatio } - miniRunner(miniRunnerOpts, builder) + miniRunner(appPath, miniRunnerOpts, builder) } diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index b3ef3b8d5102..d02d84ed4f2c 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "1.3.0-beta.2", + "version": "1.3.1", "description": "Mini app runner for taro", "main": "index.js", "scripts": { @@ -32,8 +32,8 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/taro": "1.3.0-beta.2", - "@tarojs/transformer-wx": "1.3.0-beta.2", + "@tarojs/taro": "1.3.1", + "@tarojs/transformer-wx": "1.3.1", "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", @@ -43,14 +43,24 @@ "babel-types": "^6.26.0", "better-babel-generator": "^6.26.1", "chalk": "^2.4.2", - "file-loader": "^3.0.1", + "copy-webpack-plugin": "^5.0.3", + "css-loader": "^3.0.0", + "csso-webpack-plugin": "^1.0.0-beta.12", + "file-loader": "^4.0.0", "fs-extra": "^8.0.1", + "less-loader": "^5.0.0", "loader-utils": "^1.2.3", "lodash": "^4.17.11", + "mini-css-extract-plugin": "^0.7.0", "node-sass": "^4.12.0", "ora": "^3.4.0", + "postcss-loader": "^3.0.0", + "postcss-pxtransform": "^1.3.2", "resolve": "^1.11.1", "sass-loader": "^7.1.0", + "stylus-loader": "^3.0.2", + "uglifyjs-webpack-plugin": "^2.1.3", + "url-loader": "^2.0.0", "virtual-module-webpack-plugin": "^0.4.1", "webpack": "^4.31.0", "webpack-chain": "^6.0.0", diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index ea80a3e032e8..9ebb0feffc82 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -1,105 +1,32 @@ -import * as path from 'path' import * as webpack from 'webpack' import { IBuildConfig } from './utils/types' import { printBuildError, bindProdLogger } from './utils/logHelper' -import MiniPlugin, { Targets } from './plugins/MiniPlugin' -import { MINI_APP_FILES, BUILD_TYPES } from './utils/constants' +import buildConf from './webpack/build.conf' -const extensions = ['.ts', '.tsx', '.js', '.jsx'] - -const globalObjectMap = { - [BUILD_TYPES.WEAPP]: 'wx', - [BUILD_TYPES.ALIPAY]: 'my', - [BUILD_TYPES.SWAN]: 'swan', - [BUILD_TYPES.QQ]: 'qq', - [BUILD_TYPES.TT]: 'tt' +const customizeChain = (chain, customizeFunc: Function) => { + if (customizeFunc instanceof Function) { + customizeFunc(chain, webpack) + } } -export default function build (config: IBuildConfig) { - const compilePlugins = config.plugins - const { babel } = compilePlugins - const webpackConfig = { - mode: config.isWatch ? 'development' : 'production', - devtool: false, - entry: config.entry, - output: { - filename: '[name].js', - publicPath: '/', - path: config.outputDir, - globalObject: globalObjectMap[config.buildAdapter] - }, - resolve: { - extensions - }, - target: Targets[config.buildAdapter], - optimization: { - runtimeChunk: { - name: 'runtime' - }, - splitChunks: { - chunks: 'all', - maxInitialRequests: Infinity, - minSize: 0, - name: 'vendors' - } - }, - module: { - rules: [ - { - test: /\.(tsx?|jsx?)$/, - use: [{ - loader: path.resolve(__dirname, './loaders/fileParseLoader'), - options: { - babel, - designWidth: config.designWidth, - deviceRatio: config.deviceRatio, - buildAdapter: config.buildAdapter, - constantsReplaceList: config.constantsReplaceList - } - }, { - loader: path.resolve(__dirname, './loaders/wxTransformerLoader'), - options: { - buildAdapter: config.buildAdapter - } - }] - }, - { - test: /\.(scss|wxss|acss|ttss|acss|)$/, - include: /src/, - use: [ - { - loader: require.resolve('file-loader'), - options: { - useRelativePath: true, - name: `[path][name]${MINI_APP_FILES[config.buildAdapter].STYLE}`, - context: config.sourceDir - } - }, - { - loader: require.resolve('sass-loader'), - options: { +export default function build (appPath: string, config: IBuildConfig, mainBuilder) { + const mode = 'development' + return new Promise((resolve, reject) => { + const webpackChain = buildConf(appPath, mode, config) - }, - }, - ], - } - ] - }, - plugins: [ - new MiniPlugin({ - buildAdapter: config.buildAdapter, - constantsReplaceList: config.constantsReplaceList - }) - ] - } + customizeChain(webpackChain, config.webpackChain) + const webpackConfig = webpackChain.toConfig() - const compiler = webpack(webpackConfig) - bindProdLogger(compiler) + const compiler = webpack(webpackConfig) + bindProdLogger(compiler) - compiler.run((err) => { - if (err) { - printBuildError(err) - } + compiler.run((err) => { + if (err) { + printBuildError(err); + return reject(err) + } + resolve() + }) }) } diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 9b69760411fc..c7b93a1a6b02 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -176,13 +176,11 @@ export default class MiniPlugin { } const { entry } = compiler.options function getEntryPath (entry) { - if (Array.isArray(entry)) { - return entry.map(item => getEntryPath[item]).find(item => item) + const app = entry['app'] + if (Array.isArray(app)) { + return app[0] } - if (typeof entry === 'object') { - return entry['app'] - } - return entry + return app } const appEntryPath = getEntryPath(entry) this.sourceDir = path.dirname(appEntryPath) diff --git a/packages/taro-mini-runner/src/utils/constants.ts b/packages/taro-mini-runner/src/utils/constants.ts index 2224d8cc9749..2dcdedbba06e 100644 --- a/packages/taro-mini-runner/src/utils/constants.ts +++ b/packages/taro-mini-runner/src/utils/constants.ts @@ -7,7 +7,15 @@ export const TS_EXT: string[] = ['.ts', '.tsx'] export const REG_SCRIPT: RegExp = /\.(js|jsx)(\?.*)?$/ export const REG_TYPESCRIPT: RegExp = /\.(tsx|ts)(\?.*)?$/ -export const REG_SCRIPTS: RegExp = /\.[tj]sx?$/i +export const REG_SCRIPTS: RegExp = /\.[tj]sx?$/ +export const REG_SASS: RegExp = /\.(s[ac]ss)$/ +export const REG_LESS: RegExp = /\.less$/ +export const REG_STYLUS: RegExp = /\.styl$/ +export const REG_STYLE: RegExp = /\.(css|scss|sass|less|styl|wxss)(\?.*)?$/ +export const REG_MEDIA: RegExp = /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/ +export const REG_IMAGE: RegExp = /\.(png|jpe?g|gif|bpm|svg|webp)(\?.*)?$/ +export const REG_FONT: RegExp = /\.(woff2?|eot|ttf|otf)(\?.*)?$/ +export const REG_JSON: RegExp = /\.json(\?.*)?$/ export const NODE_MODULES = 'node_modules' export const NODE_MODULES_REG = /(.*)node_modules/ diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index 8e12acf4cf68..4f55a21a9b88 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -3,10 +3,13 @@ import * as fs from 'fs-extra' import * as resolvePath from 'resolve' import * as t from 'babel-types' +import { mergeWith } from 'lodash' import { CONFIG_MAP, JS_EXT, TS_EXT, NODE_MODULES_REG } from './constants' import { IOption, IComponentObj } from './types' +export const isNodeModule = (filename: string) => NODE_MODULES_REG.test(filename) + export function isNpmPkg (name: string): boolean { if (/^(\.|\/)/.test(name)) { return false @@ -173,3 +176,17 @@ export function resolveNpmSync (pkgName: string, root): string | null { return null } } + +export function recursiveMerge (src, ...args) { + return mergeWith(src, ...args, (value, srcValue) => { + const typeValue = typeof value + const typeSrcValue = typeof srcValue + if (typeValue !== typeSrcValue) return + if (Array.isArray(value) && Array.isArray(srcValue)) { + return value.concat(srcValue) + } + if (typeValue === 'object') { + return recursiveMerge(value, srcValue) + } + }) +} diff --git a/packages/taro-mini-runner/src/utils/types.ts b/packages/taro-mini-runner/src/utils/types.ts index 85088955d277..3877945c277a 100644 --- a/packages/taro-mini-runner/src/utils/types.ts +++ b/packages/taro-mini-runner/src/utils/types.ts @@ -37,16 +37,35 @@ export interface IChain { [key: string]: any } -export interface ITaroMiniConfig { - entry: webpack.Entry - output: webpack.Output, - buildAdapter: BUILD_TYPES +export interface ICopyOptions { + patterns: { + from: string + to: string + ignore: string[] + }[] + options: { + ignore: string[] + } } -export interface ITaroPlugins { - babel: IOption - csso?: TogglableOptions - uglify?: TogglableOptions +export interface ITaroMiniConfig { + webpackChain: (chain: any, webpack: any) => void + alias: IOption + entry: webpack.Entry + output: webpack.Output + enableSourceMap: boolean + + cssLoaderOption: IOption + styleLoaderOption: IOption + sassLoaderOption: IOption + lessLoaderOption: IOption + stylusLoaderOption: IOption + mediaUrlLoaderOption: IOption + fontUrlLoaderOption: IOption + imageUrlLoaderOption: IOption + esnextModules: string[] + + postcss?: IPostcssOption } export interface ICopyOptions { @@ -61,9 +80,7 @@ export interface ICopyOptions { } export interface ITaroBaseConfig { - outputDir: string - staticDirectory: string - chunkDirectory: string + outputRoot: string copy: ICopyOptions designWidth: number @@ -72,10 +89,14 @@ export interface ITaroBaseConfig { defineConstants?: IOption env?: IOption - plugins: ITaroPlugins + babel: IOption + csso?: TogglableOptions + uglify?: TogglableOptions, + sass?: IOption } export interface IBuildConfig extends ITaroBaseConfig, ITaroMiniConfig { isWatch: boolean, - constantsReplaceList: IOption + port?: number, + buildAdapter: BUILD_TYPES } diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts new file mode 100644 index 000000000000..469f19d12f33 --- /dev/null +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -0,0 +1,143 @@ +import * as path from 'path' +import * as Chain from 'webpack-chain' + +import { IBuildConfig } from '../utils/types' +import { + getCopyWebpackPlugin, + getDefinePlugin, + processEnvOption, + getCssoWebpackPlugin, + getUglifyPlugin, + getDevtool, + getOutput, + getModule, + mergeOption, + getMiniPlugin +} from './chain' +import { BUILD_TYPES } from '../utils/constants' +import { Targets } from '../plugins/MiniPlugin' + +const emptyObj = {} + +export default (appPath: string, mode, config: Partial): any => { + const chain = new Chain() + const { + buildAdapter = BUILD_TYPES.WEAPP, + alias = emptyObj, + copy, + entry = emptyObj, + output = emptyObj, + outputRoot = 'dist', + + designWidth = 750, + deviceRatio, + enableSourceMap = false, + + defineConstants = emptyObj, + env = emptyObj, + cssLoaderOption = emptyObj, + sassLoaderOption = emptyObj, + lessLoaderOption = emptyObj, + stylusLoaderOption = emptyObj, + mediaUrlLoaderOption = emptyObj, + fontUrlLoaderOption = emptyObj, + imageUrlLoaderOption = emptyObj, + + postcss = emptyObj, + + babel, + csso, + uglify + } = config + + const plugin: any = {} + const minimizer: any[] = [] + + if (copy) { + plugin.copyWebpackPlugin = getCopyWebpackPlugin({ copy, appPath }) + } + const constantsReplaceList = mergeOption([processEnvOption(env), defineConstants]) + plugin.definePlugin = getDefinePlugin([constantsReplaceList]) + plugin.miniPlugin = getMiniPlugin({ buildAdapter, constantsReplaceList }) + + const isCssoEnabled = (csso && csso.enable === false) + ? false + : true + + + const isUglifyEnabled = (uglify && uglify.enable === false) + ? false + : true + + if (mode === 'production') { + if (isUglifyEnabled) { + minimizer.push(getUglifyPlugin([ + enableSourceMap, + uglify ? uglify.config : {} + ])) + } + + if (isCssoEnabled) { + plugin.cssoWebpackPlugin = getCssoWebpackPlugin([csso ? csso.config : {}]) + } + } + + chain.merge({ + mode, + devtool: getDevtool(enableSourceMap), + entry, + output: getOutput(appPath, [{ + outputRoot, + publicPath: '/', + buildAdapter + }, output]), + target: Targets[buildAdapter], + resolve: { + alias, + extensions: ['.js', '.jsx', '.ts', '.tsx'], + mainFields: ['main', 'module'], + symlinks: true, + modules: [ + path.join(appPath, 'node_modules'), + 'node_modules' + ] + }, + resolveLoader: { + modules: [ + 'node_modules' + ] + }, + module: getModule(appPath, { + buildAdapter, + constantsReplaceList, + designWidth, + deviceRatio, + enableSourceMap, + + cssLoaderOption, + lessLoaderOption, + sassLoaderOption, + stylusLoaderOption, + fontUrlLoaderOption, + imageUrlLoaderOption, + mediaUrlLoaderOption, + + postcss, + babel + }), + plugin, + optimization: { + minimizer, + runtimeChunk: { + name: 'runtime' + }, + splitChunks: { + chunks: 'all', + maxInitialRequests: Infinity, + minSize: 0, + name: 'vendors' + } + } + }) + return chain +} diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts new file mode 100644 index 000000000000..d438c7b398d3 --- /dev/null +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -0,0 +1,321 @@ +import * as path from 'path' + +import * as CopyWebpackPlugin from 'copy-webpack-plugin' +import CssoWebpackPlugin from 'csso-webpack-plugin' +import * as sass from 'node-sass' +import { partial } from 'lodash' +import { mapKeys, pipe } from 'lodash/fp' +import * as UglifyJsPlugin from 'uglifyjs-webpack-plugin' +import * as webpack from 'webpack' + +import { getPostcssPlugins } from './postcss.conf' + +import MiniPlugin from '../plugins/MiniPlugin' +import { PostcssOption, IOption, ICopyOptions, IPostcssOption } from '../utils/types' +import { recursiveMerge, isNodeModule } from '../utils' +import { REG_SASS, REG_LESS, REG_STYLUS, REG_STYLE, REG_MEDIA, REG_FONT, REG_IMAGE, BUILD_TYPES, REG_SCRIPTS, MINI_APP_FILES } from '../utils/constants' + +const globalObjectMap = { + [BUILD_TYPES.WEAPP]: 'wx', + [BUILD_TYPES.ALIPAY]: 'my', + [BUILD_TYPES.SWAN]: 'swan', + [BUILD_TYPES.QQ]: 'qq', + [BUILD_TYPES.TT]: 'tt' +} + +const defaultUglifyJsOption = { + keep_fnames: true, + output: { + comments: false, + keep_quoted_props: true, + quote_keys: true, + beautify: false + }, + warnings: false +} +const defaultCSSCompressOption = { + mergeRules: false, + mergeIdents: false, + reduceIdents: false, + discardUnused: false, + minifySelectors: false +} + +const defaultMediaUrlLoaderOption = { + limit: 10240 +} +const defaultFontUrlLoaderOption = { + limit: 10240 +} +const defaultImageUrlLoaderOption = { + limit: 10240 +} +const defaultCssModuleOption: PostcssOption.cssModules = { + enable: false, + config: { + namingPattern: 'global', + generateScopedName: '[name]__[local]___[hash:base64:5]' + } +} + +const getLoader = (loaderName: string, options: IOption) => { + return { + loader: require.resolve(loaderName), + options: options || {} + } +} + +const listify = listOrItem => { + if (Array.isArray(listOrItem)) { + return listOrItem + } + return [listOrItem] +} + +const getPlugin = (plugin: any, args: IOption[]) => { + return { + plugin, + args + } +} + +export const mergeOption = ([...options]: IOption[]): IOption => { + return recursiveMerge({}, ...options) +} + +const styleModuleReg = /(.*\.module).*\.(css|s[ac]ss|less|styl)\b/ +const styleGlobalReg = /(.*\.global).*\.(css|s[ac]ss|less|styl)\b/ + +export const processEnvOption = partial(mapKeys, (key: string) => `process.env.${key}`) + +export const getCssLoader = pipe(mergeOption, partial(getLoader, 'css-loader')) +export const getPostcssLoader = pipe(mergeOption, partial(getLoader, 'postcss-loader')) +export const getSassLoader = pipe(mergeOption, partial(getLoader, 'sass-loader')) +export const getLessLoader = pipe(mergeOption, partial(getLoader, 'less-loader')) +export const getStylusLoader = pipe(mergeOption, partial(getLoader, 'stylus-loader')) +export const getUrlLoader = pipe(mergeOption, partial(getLoader, 'url-loader')) +export const getFileLoader = pipe(mergeOption, partial(getLoader, 'file-loader')) +export const getFileParseLoader = pipe(mergeOption, partial(getLoader, path.resolve(__dirname, '../loaders/fileParseLoader'))) +export const getWxTransformerLoader = pipe(mergeOption, partial(getLoader, path.resolve(__dirname, '../loaders/wxTransformerLoader'))) + +export const getDefinePlugin = pipe(mergeOption, listify, partial(getPlugin, webpack.DefinePlugin)) +export const getUglifyPlugin = ([enableSourceMap, uglifyOptions]) => { + return new UglifyJsPlugin({ + cache: true, + parallel: true, + sourceMap: enableSourceMap, + uglifyOptions: recursiveMerge({}, defaultUglifyJsOption, uglifyOptions) + }) +} +export const getCssoWebpackPlugin = ([cssoOption]) => { + return pipe(mergeOption, listify, partial(getPlugin, CssoWebpackPlugin))([defaultCSSCompressOption, cssoOption]) +} +export const getCopyWebpackPlugin = ({ copy, appPath }: { + copy: ICopyOptions, + appPath: string +}) => { + const args = [ + copy.patterns.map(({ from, to }) => { + return { + from, + to: path.resolve(appPath, to), + context: appPath + } + }), + copy.options + ] + return partial(getPlugin, CopyWebpackPlugin)(args) +} + +export const getMiniPlugin = (args) => { + return partial(getPlugin, MiniPlugin)([args]) +} + +export const getModule = (appPath: string, { + designWidth, + deviceRatio, + buildAdapter, + constantsReplaceList, + enableSourceMap, + + cssLoaderOption, + lessLoaderOption, + sassLoaderOption, + stylusLoaderOption, + fontUrlLoaderOption, + imageUrlLoaderOption, + mediaUrlLoaderOption, + postcss, + + babel +}) => { + const postcssOption: IPostcssOption = postcss || {} + + const cssModuleOptions: PostcssOption.cssModules = recursiveMerge({}, defaultCssModuleOption, postcssOption.cssModules) + + const { namingPattern, generateScopedName } = cssModuleOptions.config! + + const cssOptions = [ + { + importLoaders: 1, + sourceMap: enableSourceMap, + modules: false + }, + cssLoaderOption + ] + const cssOptionsWithModule = [ + Object.assign( + { + importLoaders: 1, + sourceMap: enableSourceMap, + modules: namingPattern === 'module' ? true : 'global' + }, + typeof generateScopedName === 'function' + ? { getLocalIdent: (context, _, localName) => generateScopedName(localName, context.resourcePath) } + : { localIdentName: generateScopedName } + ), + cssLoaderOption + ] + + const cssLoader = getCssLoader(cssOptions) + const cssLoaders: { + include?; + use; + }[] = [{ + use: [cssLoader] + }] + + if (cssModuleOptions.enable) { + const cssLoaderWithModule = getCssLoader(cssOptionsWithModule) + let cssModuleCondition + + if (cssModuleOptions.config!.namingPattern === 'module') { + /* 不排除 node_modules 内的样式 */ + cssModuleCondition = styleModuleReg + } else { + cssModuleCondition = { + and: [ + { exclude: styleGlobalReg }, + { exclude: [isNodeModule] } + ] + } + } + cssLoaders.unshift({ + include: [cssModuleCondition], + use: [cssLoaderWithModule] + }) + } + + const postcssLoader = getPostcssLoader([ + { sourceMap: enableSourceMap }, + { + ident: 'postcss', + plugins: getPostcssPlugins(appPath, { + designWidth, + deviceRatio, + postcssOption + }) + } + ]) + const sassLoader = getSassLoader([{ + sourceMap: true, + implementation: sass + }, sassLoaderOption]) + const lessLoader = getLessLoader([{ sourceMap: enableSourceMap }, lessLoaderOption]) + + const stylusLoader = getStylusLoader([{ sourceMap: enableSourceMap }, stylusLoaderOption]) + + const fileLoader = getFileLoader([{ + useRelativePath: true, + name: `[path][name]${MINI_APP_FILES[buildAdapter].STYLE}` + }]) + + const fileParseLoader = getFileParseLoader([{ + babel, + designWidth, + deviceRatio, + buildAdapter, + constantsReplaceList + }]) + + const wxTransformerLoader = getWxTransformerLoader([{ + buildAdapter + }]) + + const rule = { + sass: { + test: REG_SASS, + enforce: 'pre', + use: [sassLoader] + }, + less: { + test: REG_LESS, + enforce: 'pre', + use: [lessLoader] + }, + stylus: { + test: REG_STYLUS, + enforce: 'pre', + use: [stylusLoader] + }, + // css: { + // test: REG_STYLE, + // oneOf: cssLoaders + // }, + styleFiles: { + test: REG_STYLE, + use: [fileLoader] + }, + postcss: { + test: REG_STYLE, + use: [postcssLoader] + }, + script: { + test: REG_SCRIPTS, + use: [fileParseLoader, wxTransformerLoader], + }, + media: { + test: REG_MEDIA, + use: { + urlLoader: getUrlLoader([defaultMediaUrlLoaderOption, { + name: `[path][name].[ext]`, + ...mediaUrlLoaderOption + }]) + } + }, + font: { + test: REG_FONT, + use: { + urlLoader: getUrlLoader([defaultFontUrlLoaderOption, { + name: `[path][name].[ext]`, + ...fontUrlLoaderOption + }]) + } + }, + image: { + test: REG_IMAGE, + use: { + urlLoader: getUrlLoader([defaultImageUrlLoaderOption, { + name: `[path][name].[ext]`, + ...imageUrlLoaderOption + }]) + } + } + } + + return { rule } +} + +export function getOutput (appPath: string, [{ outputRoot, publicPath, buildAdapter }, customOutput]) { + return { + path: path.join(appPath, outputRoot), + publicPath, + filename: '[name].js', + globalObject: globalObjectMap[buildAdapter], + ...customOutput + } +} + +export function getDevtool (enableSourceMap) { + return enableSourceMap ? 'cheap-module-eval-source-map' : 'none' +} diff --git a/packages/taro-mini-runner/src/webpack/postcss.conf.ts b/packages/taro-mini-runner/src/webpack/postcss.conf.ts new file mode 100644 index 000000000000..6ae056e0ba55 --- /dev/null +++ b/packages/taro-mini-runner/src/webpack/postcss.conf.ts @@ -0,0 +1,74 @@ +import * as path from 'path' + +import * as autoprefixer from 'autoprefixer' +import * as pxtransform from 'postcss-pxtransform' +import { sync as resolveSync } from 'resolve' + +import { isNpmPkg, recursiveMerge } from '../utils' +import { IPostcssOption } from '../utils/types' +import browserList from '../config/browser_list' + +const defaultAutoprefixerOption = { + enable: true, + config: { + browsers: browserList, + flexbox: 'no-2009' + } +} +const defaultPxtransformOption: { + [key: string]: any +} = { + enable: true, + config: { + platform: 'weapp' + } +} + +const optionsWithDefaults = ['autoprefixer', 'pxtransform', 'cssModules'] + +const plugins = [] as any[] + +export const getPostcssPlugins = function (appPath: string, { + designWidth, + deviceRatio, + postcssOption = {} as IPostcssOption +}) { + + if (designWidth) { + defaultPxtransformOption.config.designWidth = designWidth + } + + if (deviceRatio) { + defaultPxtransformOption.config.deviceRatio = deviceRatio + } + + const autoprefixerOption = recursiveMerge({}, defaultAutoprefixerOption, postcssOption.autoprefixer) + const pxtransformOption = recursiveMerge({}, defaultPxtransformOption, postcssOption.pxtransform) + + if (autoprefixerOption.enable) { + plugins.push(autoprefixer(autoprefixerOption.config)) + } + + if (pxtransformOption.enable) { + plugins.push(pxtransform(pxtransformOption.config)) + } + + Object.entries(postcssOption).forEach(([pluginName, pluginOption]) => { + if (optionsWithDefaults.indexOf(pluginName) > -1) return + if (!pluginOption || !pluginOption.enable) return + + if (!isNpmPkg(pluginName)) { // local plugin + pluginName = path.join(appPath, pluginName) + } + + try { + const pluginPath = resolveSync(pluginName, { basedir: appPath }) + plugins.push(require(pluginPath)(pluginOption.config || {})) + } catch (e) { + const msg = e.code === 'MODULE_NOT_FOUND' ? `缺少postcss插件${pluginName}, 已忽略` : e + console.log(msg) + } + }) + + return plugins +} diff --git a/packages/taro-mini-runner/yarn.lock b/packages/taro-mini-runner/yarn.lock index 262bd904eee0..b5d99f892ca8 100644 --- a/packages/taro-mini-runner/yarn.lock +++ b/packages/taro-mini-runner/yarn.lock @@ -713,6 +713,10 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" +ansi-colors@^3.0.0: + version "3.2.4" + resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" + ansi-escapes@^3.0.0: version "3.2.0" resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" @@ -802,6 +806,16 @@ array-reduce@~0.0.0: version "0.0.0" resolved "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + array-unique@^0.3.2: version "0.3.2" resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" @@ -851,6 +865,12 @@ async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" +async@^2.5.0: + version "2.6.2" + resolved "https://registry.npmjs.org/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" + dependencies: + lodash "^4.17.11" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1244,6 +1264,10 @@ bluebird@^3.5.3: version "3.5.4" resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz#d6cc661595de30d5b3af5fcedd3c0b3ef6ec5714" +bluebird@^3.5.5: + version "3.5.5" + resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f" + bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" @@ -1388,6 +1412,25 @@ cacache@^11.0.2: unique-filename "^1.1.1" y18n "^4.0.0" +cacache@^11.3.2: + version "11.3.3" + resolved "https://registry.npmjs.org/cacache/-/cacache-11.3.3.tgz#8bd29df8c6a718a6ebd2d010da4d7972ae3bbadc" + dependencies: + bluebird "^3.5.5" + chownr "^1.1.1" + figgy-pudding "^3.5.1" + glob "^7.1.4" + graceful-fs "^4.1.15" + lru-cache "^5.1.1" + mississippi "^3.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.3" + ssri "^6.0.1" + unique-filename "^1.1.1" + y18n "^4.0.0" + cache-base@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" @@ -1402,16 +1445,32 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +caller-callsite@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" + dependencies: + callsites "^2.0.0" + caller-path@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" dependencies: callsites "^0.2.0" +caller-path@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" + dependencies: + caller-callsite "^2.0.0" + callsites@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -1435,7 +1494,7 @@ camelcase@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" -camelcase@^5.0.0: +camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" @@ -1566,6 +1625,10 @@ clone@^1.0.2: version "1.0.4" resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" +clone@^2.1.1: + version "2.1.2" + resolved "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + co@^4.6.0: version "4.6.0" resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1657,6 +1720,23 @@ copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" +copy-webpack-plugin@^5.0.3: + version "5.0.3" + resolved "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-5.0.3.tgz#2179e3c8fd69f13afe74da338896f1f01a875b5c" + dependencies: + cacache "^11.3.2" + find-cache-dir "^2.1.0" + glob-parent "^3.1.0" + globby "^7.1.1" + is-glob "^4.0.1" + loader-utils "^1.2.3" + minimatch "^3.0.4" + normalize-path "^3.0.0" + p-limit "^2.2.0" + schema-utils "^1.0.0" + serialize-javascript "^1.7.0" + webpack-log "^2.0.0" + core-js@^2.4.0, core-js@^2.5.0: version "2.6.5" resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895" @@ -1665,6 +1745,15 @@ core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" +cosmiconfig@^5.0.0: + version "5.2.1" + resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" + dependencies: + import-fresh "^2.0.0" + is-directory "^0.3.1" + js-yaml "^3.13.1" + parse-json "^4.0.0" + create-ecdh@^4.0.0: version "4.0.3" resolved "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" @@ -1734,6 +1823,49 @@ crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" +css-loader@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/css-loader/-/css-loader-3.0.0.tgz#bdd48a4921eefedf1f0a55266585944d4e5efc63" + dependencies: + camelcase "^5.3.1" + cssesc "^3.0.0" + icss-utils "^4.1.1" + loader-utils "^1.2.3" + normalize-path "^3.0.0" + postcss "^7.0.17" + postcss-modules-extract-imports "^2.0.0" + postcss-modules-local-by-default "^3.0.2" + postcss-modules-scope "^2.1.0" + postcss-modules-values "^3.0.0" + postcss-value-parser "^4.0.0" + schema-utils "^1.0.0" + +css-tree@1.0.0-alpha.29: + version "1.0.0-alpha.29" + resolved "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.29.tgz#3fa9d4ef3142cbd1c301e7664c1f352bd82f5a39" + dependencies: + mdn-data "~1.1.0" + source-map "^0.5.3" + +cssesc@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" + +csso-webpack-plugin@^1.0.0-beta.12: + version "1.0.0-beta.12" + resolved "https://registry.npmjs.org/csso-webpack-plugin/-/csso-webpack-plugin-1.0.0-beta.12.tgz#a42d02f74043eb8e7f303c9ba27bbb65c78972b8" + dependencies: + async "^2.5.0" + csso "^3.4.0" + source-map "^0.6.1" + webpack-sources "^1.0.1" + +csso@^3.4.0: + version "3.5.1" + resolved "https://registry.npmjs.org/csso/-/csso-3.5.1.tgz#7b9eb8be61628973c1b261e169d2f024008e758b" + dependencies: + css-tree "1.0.0-alpha.29" + cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.6" resolved "https://registry.npmjs.org/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad" @@ -1882,6 +2014,12 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +dir-glob@^2.0.0: + version "2.2.2" + resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4" + dependencies: + path-type "^3.0.0" + doctrine@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" @@ -2247,11 +2385,11 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" -file-loader@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/file-loader/-/file-loader-3.0.1.tgz#f8e0ba0b599918b51adfe45d66d1e771ad560faa" +file-loader@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/file-loader/-/file-loader-4.0.0.tgz#c3570783fefb6e1bc0978a856f4bf5825b966c2a" dependencies: - loader-utils "^1.0.2" + loader-utils "^1.2.2" schema-utils "^1.0.0" fill-range@^4.0.0: @@ -2263,7 +2401,7 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" -find-cache-dir@^2.0.0: +find-cache-dir@^2.0.0, find-cache-dir@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" dependencies: @@ -2440,7 +2578,7 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@~7.1.1: +glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@~7.1.1: version "7.1.4" resolved "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" dependencies: @@ -2459,6 +2597,17 @@ globals@^9.18.0: version "9.18.0" resolved "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" +globby@^7.1.1: + version "7.1.1" + resolved "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680" + dependencies: + array-union "^1.0.1" + dir-glob "^2.0.0" + glob "^7.1.2" + ignore "^3.3.5" + pify "^3.0.0" + slash "^1.0.0" + globule@^1.0.0: version "1.2.1" resolved "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz#5dffb1b191f22d20797a9369b49eab4e9839696d" @@ -2502,6 +2651,10 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -2610,6 +2763,12 @@ iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.4: dependencies: safer-buffer ">= 2.1.2 < 3" +icss-utils@^4.0.0, icss-utils@^4.1.1: + version "4.1.1" + resolved "https://registry.npmjs.org/icss-utils/-/icss-utils-4.1.1.tgz#21170b53789ee27447c2f47dd683081403f9a467" + dependencies: + postcss "^7.0.14" + ieee754@^1.1.4: version "1.1.13" resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" @@ -2624,10 +2783,29 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^3.3.3: +ignore@^3.3.3, ignore@^3.3.5: version "3.3.10" resolved "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" +import-cwd@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" + dependencies: + import-from "^2.1.0" + +import-fresh@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" + dependencies: + caller-path "^2.0.0" + resolve-from "^3.0.0" + +import-from@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" + dependencies: + resolve-from "^3.0.0" + import-local@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" @@ -2649,6 +2827,10 @@ indent-string@^2.1.0: dependencies: repeating "^2.0.0" +indexes-of@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" + indexof@0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" @@ -2773,6 +2955,10 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-data-descriptor "^1.0.0" kind-of "^6.0.2" +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -2813,7 +2999,7 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-glob@^4.0.0: +is-glob@^4.0.0, is-glob@^4.0.1: version "4.0.1" resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" dependencies: @@ -2825,6 +3011,10 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" +is-plain-obj@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -3261,7 +3451,7 @@ jest@^24.8.0: import-local "^2.0.0" jest-cli "^24.8.0" -js-base64@^2.1.8: +js-base64@^2.1.8, js-base64@^2.1.9: version "2.5.1" resolved "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121" @@ -3273,7 +3463,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" -js-yaml@^3.9.1: +js-yaml@^3.13.1, js-yaml@^3.9.1: version "3.13.1" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" dependencies: @@ -3432,6 +3622,14 @@ left-pad@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" +less-loader@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/less-loader/-/less-loader-5.0.0.tgz#498dde3a6c6c4f887458ee9ed3f086a12ad1b466" + dependencies: + clone "^2.1.1" + loader-utils "^1.1.0" + pify "^4.0.1" + leven@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -3466,7 +3664,7 @@ loader-runner@^2.3.0: version "2.4.0" resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" -loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3: +loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.2, loader-utils@^1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" dependencies: @@ -3481,6 +3679,10 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + lodash.some@^4.6.0: version "4.6.0" resolved "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" @@ -3578,6 +3780,10 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" +mdn-data@~1.1.0: + version "1.1.4" + resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" + mem@^4.0.0: version "4.3.0" resolved "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" @@ -3653,6 +3859,10 @@ mime-types@^2.1.12, mime-types@~2.1.19: dependencies: mime-db "1.40.0" +mime@^2.0.3: + version "2.4.4" + resolved "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" + mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" @@ -3661,6 +3871,15 @@ mimic-fn@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" +mini-css-extract-plugin@^0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.7.0.tgz#5ba8290fbb4179a43dd27cca444ba150bee743a0" + dependencies: + loader-utils "^1.1.0" + normalize-url "1.9.1" + schema-utils "^1.0.0" + webpack-sources "^1.1.0" + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -3934,6 +4153,15 @@ normalize-path@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" +normalize-url@1.9.1: + version "1.9.1" + resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c" + dependencies: + object-assign "^4.0.1" + prepend-http "^1.0.0" + query-string "^4.1.0" + sort-keys "^1.0.0" + npm-bundled@^1.0.1: version "1.0.6" resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" @@ -4113,7 +4341,7 @@ p-is-promise@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" -p-limit@^2.0.0: +p-limit@^2.0.0, p-limit@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" dependencies: @@ -4293,10 +4521,110 @@ posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" +postcss-load-config@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-2.1.0.tgz#c84d692b7bb7b41ddced94ee62e8ab31b417b003" + dependencies: + cosmiconfig "^5.0.0" + import-cwd "^2.0.0" + +postcss-loader@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/postcss-loader/-/postcss-loader-3.0.0.tgz#6b97943e47c72d845fa9e03f273773d4e8dd6c2d" + dependencies: + loader-utils "^1.1.0" + postcss "^7.0.0" + postcss-load-config "^2.0.0" + schema-utils "^1.0.0" + +postcss-modules-extract-imports@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz#818719a1ae1da325f9832446b01136eeb493cd7e" + dependencies: + postcss "^7.0.5" + +postcss-modules-local-by-default@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.2.tgz#e8a6561be914aaf3c052876377524ca90dbb7915" + dependencies: + icss-utils "^4.1.1" + postcss "^7.0.16" + postcss-selector-parser "^6.0.2" + postcss-value-parser "^4.0.0" + +postcss-modules-scope@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.1.0.tgz#ad3f5bf7856114f6fcab901b0502e2a2bc39d4eb" + dependencies: + postcss "^7.0.6" + postcss-selector-parser "^6.0.0" + +postcss-modules-values@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz#5b5000d6ebae29b4255301b4a3a54574423e7f10" + dependencies: + icss-utils "^4.0.0" + postcss "^7.0.6" + +postcss-pxtorem@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/postcss-pxtorem/-/postcss-pxtorem-4.0.1.tgz#9c64d0efe4885473cc1cb0305c6ffc3ebb45b1cd" + dependencies: + object-assign "^4.1.0" + postcss "^5.2.10" + +postcss-pxtransform@^1.3.2: + version "1.3.2" + resolved "https://registry.npmjs.org/postcss-pxtransform/-/postcss-pxtransform-1.3.2.tgz#73615a1a102938902363f4e18d4e860695f49fa5" + dependencies: + postcss "^6.0.16" + postcss-pxtorem "^4.0.1" + +postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.2: + version "6.0.2" + resolved "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz#934cf799d016c83411859e09dcecade01286ec5c" + dependencies: + cssesc "^3.0.0" + indexes-of "^1.0.1" + uniq "^1.0.1" + +postcss-value-parser@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.0.tgz#99a983d365f7b2ad8d0f9b8c3094926eab4b936d" + +postcss@^5.2.10: + version "5.2.18" + resolved "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz#badfa1497d46244f6390f58b319830d9107853c5" + dependencies: + chalk "^1.1.3" + js-base64 "^2.1.9" + source-map "^0.5.6" + supports-color "^3.2.3" + +postcss@^6.0.16: + version "6.0.23" + resolved "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324" + dependencies: + chalk "^2.4.1" + source-map "^0.6.1" + supports-color "^5.4.0" + +postcss@^7.0.0, postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.17, postcss@^7.0.5, postcss@^7.0.6: + version "7.0.17" + resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.17.tgz#4da1bdff5322d4a0acaab4d87f3e782436bad31f" + dependencies: + chalk "^2.4.2" + source-map "^0.6.1" + supports-color "^6.1.0" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" +prepend-http@^1.0.0: + version "1.0.4" + resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + prettier@^1.14.2: version "1.17.1" resolved "https://registry.npmjs.org/prettier/-/prettier-1.17.1.tgz#ed64b4e93e370cb8a25b9ef7fef3e4fd1c0995db" @@ -4406,6 +4734,13 @@ qs@~6.5.2: version "6.5.2" resolved "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" +query-string@^4.1.0: + version "4.3.4" + resolved "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" + dependencies: + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" @@ -4757,7 +5092,7 @@ semver@~5.3.0: version "5.3.0" resolved "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" -serialize-javascript@^1.4.0: +serialize-javascript@^1.4.0, serialize-javascript@^1.7.0: version "1.7.0" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65" @@ -4874,6 +5209,12 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" +sort-keys@^1.0.0: + version "1.1.2" + resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" + dependencies: + is-plain-obj "^1.0.0" + source-list-map@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" @@ -4911,7 +5252,7 @@ source-map@^0.4.2: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -5020,6 +5361,10 @@ stream-shift@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + string-length@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" @@ -5104,11 +5449,25 @@ strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" +stylus-loader@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/stylus-loader/-/stylus-loader-3.0.2.tgz#27a706420b05a38e038e7cacb153578d450513c6" + dependencies: + loader-utils "^1.0.2" + lodash.clonedeep "^4.5.0" + when "~3.6.x" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^5.3.0: +supports-color@^3.2.3: + version "3.2.3" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + +supports-color@^5.3.0, supports-color@^5.4.0: version "5.5.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" dependencies: @@ -5349,6 +5708,27 @@ uglify-js@^3.1.4: commander "~2.20.0" source-map "~0.6.1" +uglify-js@^3.5.12: + version "3.6.0" + resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5" + dependencies: + commander "~2.20.0" + source-map "~0.6.1" + +uglifyjs-webpack-plugin@^2.1.3: + version "2.1.3" + resolved "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-2.1.3.tgz#b00a18d1acda271deb755c99ba0d93568156eb76" + dependencies: + cacache "^11.3.2" + find-cache-dir "^2.1.0" + is-wsl "^1.1.0" + schema-utils "^1.0.0" + serialize-javascript "^1.7.0" + source-map "^0.6.1" + uglify-js "^3.5.12" + webpack-sources "^1.3.0" + worker-farm "^1.7.0" + union-value@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" @@ -5358,6 +5738,10 @@ union-value@^1.0.0: is-extendable "^0.1.1" set-value "^0.4.3" +uniq@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" + unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" @@ -5395,6 +5779,14 @@ urix@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" +url-loader@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/url-loader/-/url-loader-2.0.0.tgz#600ef36f463e21bd673ad70156d850619d9cd092" + dependencies: + loader-utils "^1.1.0" + mime "^2.0.3" + schema-utils "^1.0.0" + url@^0.11.0: version "0.11.0" resolved "https://registry.npmjs.org/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" @@ -5501,7 +5893,14 @@ webpack-format-messages@^2.0.5: dependencies: kleur "^3.0.0" -webpack-sources@^1.1.0, webpack-sources@^1.3.0: +webpack-log@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f" + dependencies: + ansi-colors "^3.0.0" + uuid "^3.3.2" + +webpack-sources@^1.0.1, webpack-sources@^1.1.0, webpack-sources@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" dependencies: @@ -5563,6 +5962,10 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" +when@~3.6.x: + version "3.6.4" + resolved "https://registry.npmjs.org/when/-/when-3.6.4.tgz#473b517ec159e2b85005497a13983f095412e34e" + which-module@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" @@ -5591,7 +5994,7 @@ wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" -worker-farm@^1.5.2: +worker-farm@^1.5.2, worker-farm@^1.7.0: version "1.7.0" resolved "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" dependencies: From 9f193729b050be820815b0418e3f21d0189df29f Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 24 Jun 2019 16:29:11 +0800 Subject: [PATCH 030/194] =?UTF-8?q?fix(cli):=20=E4=BF=AE=E5=A4=8D=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taro-cli/src/build.ts b/packages/taro-cli/src/build.ts index 96c57724b790..766aa1c9293b 100644 --- a/packages/taro-cli/src/build.ts +++ b/packages/taro-cli/src/build.ts @@ -48,7 +48,7 @@ export default class Builder { } emptyFirst ({ watch, type }) { - const outputPath = path.join(this.appPath, `${this.config.outputRoot || CONFIG.OUTPUT_DIR}}`) + const outputPath = path.join(this.appPath, `${this.config.outputRoot || CONFIG.OUTPUT_DIR}`) if (!fs.existsSync(outputPath)) { fs.ensureDirSync(outputPath) } else if (type !== BUILD_TYPES.H5 && (type !== BUILD_TYPES.QUICKAPP || !watch)) { From 0b47af5754af04f09e131bdcc76a07519782631e Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 25 Jun 2019 17:12:49 +0800 Subject: [PATCH 031/194] =?UTF-8?q?feat(taro):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=92=8C=20H5=20=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/build.ts | 6 +- packages/taro-cli/src/h5/index.ts | 11 +- packages/taro-cli/src/mini/astProcess.ts | 1085 ------ packages/taro-cli/src/mini/compileScript.ts | 170 - packages/taro-cli/src/mini/compileStyle.ts | 324 -- packages/taro-cli/src/mini/component.ts | 372 -- packages/taro-cli/src/mini/constants.ts | 6 - packages/taro-cli/src/mini/entry.ts | 198 -- packages/taro-cli/src/mini/helper.ts | 7 +- packages/taro-cli/src/mini/interface.ts | 25 - packages/taro-cli/src/mini/native.ts | 144 - packages/taro-cli/src/mini/page.ts | 305 -- packages/taro-cli/src/mini/watch.ts | 207 -- packages/taro-cli/src/mini/webpack.ts | 58 - packages/taro-cli/src/util/index.ts | 6 +- packages/taro-cli/src/util/npmExact.ts | 92 - .../taro-cli/src/util/resolve_npm_files.ts | 549 --- packages/taro-cli/src/util/types.ts | 315 +- packages/taro-mini-runner/src/utils/types.ts | 80 +- .../taro-mini-runner/src/webpack/chain.ts | 3 +- .../src/webpack/postcss.conf.ts | 4 +- packages/taro-webpack-runner/package.json | 1 + .../src/__tests__/index-test.ts | 8 +- .../src/config/build.conf.ts | 4 +- .../src/config/dev.conf.ts | 10 +- .../src/config/postcss.conf.ts | 16 +- .../src/config/prod.conf.ts | 22 +- .../taro-webpack-runner/src/util/chain.ts | 50 +- .../taro-webpack-runner/src/util/types.ts | 100 +- packages/taro/package.json | 8 +- packages/taro/types/compile.ts | 368 ++ packages/taro/yarn.lock | 3164 +++++++++++++++++ 32 files changed, 3617 insertions(+), 4101 deletions(-) delete mode 100644 packages/taro-cli/src/mini/astProcess.ts delete mode 100644 packages/taro-cli/src/mini/compileScript.ts delete mode 100644 packages/taro-cli/src/mini/compileStyle.ts delete mode 100644 packages/taro-cli/src/mini/component.ts delete mode 100644 packages/taro-cli/src/mini/constants.ts delete mode 100644 packages/taro-cli/src/mini/entry.ts delete mode 100644 packages/taro-cli/src/mini/interface.ts delete mode 100644 packages/taro-cli/src/mini/native.ts delete mode 100644 packages/taro-cli/src/mini/page.ts delete mode 100644 packages/taro-cli/src/mini/watch.ts delete mode 100644 packages/taro-cli/src/mini/webpack.ts delete mode 100644 packages/taro-cli/src/util/npmExact.ts delete mode 100644 packages/taro-cli/src/util/resolve_npm_files.ts create mode 100644 packages/taro/types/compile.ts create mode 100644 packages/taro/yarn.lock diff --git a/packages/taro-cli/src/build.ts b/packages/taro-cli/src/build.ts index 766aa1c9293b..3eecf8b21efc 100644 --- a/packages/taro-cli/src/build.ts +++ b/packages/taro-cli/src/build.ts @@ -3,9 +3,10 @@ import * as fs from 'fs-extra' import { SyncHook, Hook } from 'tapable' import * as _ from 'lodash' import chalk from 'chalk' +import { IProjectConfig, ICommonPlugin } from '@tarojs/taro/types/compile' import { BUILD_TYPES, PROJECT_CONFIG } from './util/constants' -import { IBuildOptions, IProjectConfig, ICommonPlugin } from './util/types' +import { IBuildOptions } from './util/types' import { emptyDirectory } from './util' import CONFIG from './config' @@ -38,8 +39,7 @@ export default class Builder { } applyPlugins () { - const commonConfig = Object.assign({}, { plugins: [] }, this.config.common) - const plugins = commonConfig.plugins + const plugins = this.config.plugins || [] if (plugins.length) { plugins.forEach((plugin: ICommonPlugin) => { plugin.apply(this) diff --git a/packages/taro-cli/src/h5/index.ts b/packages/taro-cli/src/h5/index.ts index e0c5d3e253ec..3345e89a0de1 100644 --- a/packages/taro-cli/src/h5/index.ts +++ b/packages/taro-cli/src/h5/index.ts @@ -1,4 +1,5 @@ import { PageConfig } from '@tarojs/taro' +import { IProjectConfig, IH5Config, IH5RouterConfig, IDeviceRatio } from '@tarojs/taro/types/compile' import wxTransformer from '@tarojs/transformer-wx' import * as babel from 'babel-core' import traverse, { NodePath, TraverseOptions } from 'babel-traverse' @@ -31,7 +32,7 @@ import { } from '../util/astConvert' import { BUILD_TYPES, processTypeEnum, PROJECT_CONFIG, REG_SCRIPTS, REG_TYPESCRIPT } from '../util/constants' import * as npmProcess from '../util/npm' -import { IBuildConfig, IDeviceRatio, IH5Config, IH5RouterConfig, IOption, IProjectConfig } from '../util/types' +import { IBuildOptions, IOption } from '../util/types' import { APIS_NEED_TO_APPEND_THIS, deviceRatioConfigName, @@ -189,7 +190,7 @@ class Compiler { return Promise.all(readPromises) } - async buildDist ({ watch, port }: IBuildConfig) { + async buildDist ({ watch, port }: IBuildOptions) { const isMultiRouterMode = get(this.h5Config, 'router.mode') === 'multi' const entryFileName = this.entryFileName const projectConfig = this.projectConfig @@ -233,6 +234,10 @@ class Compiler { }, isWatch: !!watch, outputRoot: outputDir, + babel: projectConfig.babel, + csso: projectConfig.csso, + uglify: projectConfig.uglify, + sass: projectConfig.sass, plugins: projectConfig.plugins, port, sourceRoot @@ -1451,7 +1456,7 @@ class Compiler { export { Compiler } -export async function build (appPath: string, buildConfig: IBuildConfig) { +export async function build (appPath: string, buildConfig: IBuildOptions) { process.env.TARO_ENV = BUILD_TYPES.H5 await checkCliAndFrameworkVersion(appPath, BUILD_TYPES.H5) const compiler = new Compiler(appPath) diff --git a/packages/taro-cli/src/mini/astProcess.ts b/packages/taro-cli/src/mini/astProcess.ts deleted file mode 100644 index 5f91df8f3fc5..000000000000 --- a/packages/taro-cli/src/mini/astProcess.ts +++ /dev/null @@ -1,1085 +0,0 @@ -import * as fs from 'fs-extra' -import * as path from 'path' - -import * as babel from 'babel-core' -import * as t from 'babel-types' -import generate from 'babel-generator' -import traverse, { NodePath } from 'babel-traverse' -import * as _ from 'lodash' -import { Config as IConfig } from '@tarojs/taro' -import getHashName from '../util/hash' - -const template = require('babel-template') - -import { - REG_SCRIPT, - REG_TYPESCRIPT, - REG_JSON, - REG_FONT, - REG_IMAGE, - REG_MEDIA, - REG_STYLE, - CSS_EXT, - processTypeEnum, - BUILD_TYPES, - NODE_MODULES_REG, - PARSE_AST_TYPE, - taroJsComponents, - taroJsRedux, - taroJsFramework, - DEVICE_RATIO_NAME -} from '../util/constants' -import { - resolveScriptPath, - printLog, - promoteRelativePath, - isNpmPkg, - isAliasPath, - replaceAliasPath, - traverseObjectNode, - isQuickappPkg, - getBabelConfig, - extnameExpRegOf, - generateAlipayPath -} from '../util' -import { - convertObjectToAstExpression, - convertArrayToAstExpression, - convertSourceStringToAstExpression -} from '../util/astConvert' -import babylonConfig from '../config/babylon' -import { getExactedNpmFilePath, getNotExistNpmList } from '../util/npmExact' -import { excludeReplaceTaroFrameworkPkgs } from '../util/resolve_npm_files' - -import { IComponentObj } from './interface' -import { - getBuildData, - isFileToBePage -} from './helper' -import { processStyleUseCssModule } from './compileStyle' -import { QUICKAPP_SPECIAL_COMPONENTS } from './constants' - -function generateCssModuleMapFilename (styleFilePath) { - const { - sourceDir, - outputDir, - nodeModulesPath, - npmOutputDir - } = getBuildData() - const cssModuleMapFilename = path.basename(styleFilePath) + '.map.js' - let cssModuleMapFile - if (NODE_MODULES_REG.test(styleFilePath)) { - cssModuleMapFile = path.join(path.dirname(styleFilePath), cssModuleMapFilename).replace(nodeModulesPath, npmOutputDir) - } else { - cssModuleMapFile = path.join(path.dirname(styleFilePath), cssModuleMapFilename).replace(sourceDir, outputDir) - } - return cssModuleMapFile -} - -function createCssModuleMap (styleFilePath, tokens) { - const cssModuleMapFile = generateCssModuleMapFilename(styleFilePath) - printLog(processTypeEnum.GENERATE, 'CSS Modules map', cssModuleMapFile) - fs.ensureDirSync(path.dirname(cssModuleMapFile)) - fs.writeFileSync(cssModuleMapFile, `module.exports = ${JSON.stringify(tokens, null, 2)};\n`) -} - -interface IAnalyzeImportUrlOptions { - astPath: any, - value: string, - sourceFilePath: string, - filePath: string, - styleFiles: string[], - scriptFiles: string[], - jsonFiles: string[], - mediaFiles: string[] -} - -function analyzeImportUrl ({ - astPath, - value, - sourceFilePath, - filePath, - styleFiles, - scriptFiles, - jsonFiles, - mediaFiles -}: IAnalyzeImportUrlOptions): void { - const valueExtname = path.extname(value) - const node = astPath.node - const { - nodeModulesPath, - npmOutputDir, - sourceDir, - outputDir, - npmConfig, - projectConfig, - buildAdapter - } = getBuildData() - const publicPath = (projectConfig.weapp || ({} as any)).publicPath - if (value.indexOf('.') === 0) { - let importPath = path.resolve(path.dirname(sourceFilePath), value) - importPath = resolveScriptPath(importPath) - if (isFileToBePage(importPath)) { - astPath.remove() - } else { - if (REG_SCRIPT.test(valueExtname) || REG_TYPESCRIPT.test(valueExtname)) { - const vpath = path.resolve(sourceFilePath, '..', value) - let fPath = value - if (fs.existsSync(vpath) && vpath !== sourceFilePath) { - fPath = vpath - } - if (scriptFiles.indexOf(fPath) < 0) { - scriptFiles.push(fPath) - } - node.source.value = value.replace(valueExtname, '.js') - } else if (REG_JSON.test(valueExtname)) { - const vpath = path.resolve(sourceFilePath, '..', value) - if (jsonFiles.indexOf(vpath) < 0) { - jsonFiles.push(vpath) - } - if (fs.existsSync(vpath)) { - const obj = JSON.parse(fs.readFileSync(vpath).toString()) - const specifiers = node.specifiers - let defaultSpecifier = null - specifiers.forEach(item => { - if (item.type === 'ImportDefaultSpecifier') { - defaultSpecifier = item.local.name - } - }) - if (defaultSpecifier) { - let objArr: t.NullLiteral | t.Expression = t.nullLiteral() - if (Array.isArray(obj)) { - objArr = t.arrayExpression(convertArrayToAstExpression(obj)) - } else { - objArr = t.objectExpression(convertObjectToAstExpression(obj)) - } - astPath.replaceWith(t.variableDeclaration('const', [t.variableDeclarator(t.identifier(defaultSpecifier), objArr)])) - } - } - } else if (REG_FONT.test(valueExtname) || REG_IMAGE.test(valueExtname) || REG_MEDIA.test(valueExtname)) { - const vpath = path.resolve(sourceFilePath, '..', value) - if (!fs.existsSync(vpath)) { - printLog(processTypeEnum.ERROR, '引用文件', `文件 ${sourceFilePath} 中引用 ${value} 不存在!`) - return - } - if (mediaFiles.indexOf(vpath) < 0) { - mediaFiles.push(vpath) - } - const specifiers = node.specifiers - let defaultSpecifier = null - specifiers.forEach(item => { - if (item.type === 'ImportDefaultSpecifier') { - defaultSpecifier = item.local.name - } - }) - let showPath - if (NODE_MODULES_REG.test(vpath)) { - showPath = vpath.replace(nodeModulesPath, `/${npmConfig.name}`) - } else { - showPath = vpath.replace(sourceDir, '') - if (publicPath) { - const hashName = getHashName(vpath) - showPath = (/\/$/.test(publicPath) ? publicPath : publicPath + '/') + hashName - } - } - if (defaultSpecifier) { - astPath.replaceWith(t.variableDeclaration('const', [t.variableDeclarator(t.identifier(defaultSpecifier), t.stringLiteral(showPath.replace(/\\/g, '/')))])) - } else { - astPath.remove() - } - } else if (REG_STYLE.test(valueExtname)) { - const stylePath = path.resolve(path.dirname(sourceFilePath), value) - if (styleFiles.indexOf(stylePath) < 0) { - styleFiles.push(stylePath) - } - astPath.remove() - } else { - let vpath = resolveScriptPath(path.resolve(sourceFilePath, '..', value)) - let outputVpath - if (NODE_MODULES_REG.test(vpath)) { - outputVpath = vpath.replace(nodeModulesPath, npmOutputDir) - } else { - outputVpath = vpath.replace(sourceDir, outputDir) - } - if (buildAdapter === BUILD_TYPES.ALIPAY) { - outputVpath = generateAlipayPath(outputVpath) - } - let relativePath = path.relative(filePath, outputVpath) - if (vpath && vpath !== sourceFilePath) { - if (!fs.existsSync(vpath)) { - printLog(processTypeEnum.ERROR, '引用文件', `文件 ${sourceFilePath} 中引用 ${value} 不存在!`) - } else { - if (fs.lstatSync(vpath).isDirectory()) { - if (fs.existsSync(path.join(vpath, 'index.js'))) { - vpath = path.join(vpath, 'index.js') - relativePath = path.join(relativePath, 'index.js') - } else { - printLog(processTypeEnum.ERROR, '引用目录', `文件 ${sourceFilePath} 中引用了目录 ${value}!`) - return - } - } - if (scriptFiles.indexOf(vpath) < 0) { - scriptFiles.push(vpath) - } - relativePath = promoteRelativePath(relativePath) - relativePath = relativePath.replace(extnameExpRegOf(relativePath), '.js') - node.source.value = relativePath - } - } - } - } - } -} - -export interface IParseAstReturn { - code: string, - styleFiles: string[], - scriptFiles: string[], - jsonFiles: string[], - mediaFiles: string[] - configObj: IConfig, - componentClassName: string, - taroSelfComponents: Set, - hasEnablePageScroll: boolean -} - -export function parseAst ( - type: PARSE_AST_TYPE, - ast: t.File, - depComponents: IComponentObj[], - sourceFilePath: string, - filePath: string, - npmSkip: boolean = false -): IParseAstReturn { - const styleFiles: string[] = [] - const scriptFiles: string[] = [] - const jsonFiles: string[] = [] - const mediaFiles: string[] = [] - - const { - appPath, - nodeModulesPath, - npmOutputDir, - sourceDir, - outputDir, - buildAdapter, - constantsReplaceList, - isProduction, - npmConfig, - alias: pathAlias, - compileConfig, - projectConfig, - quickappManifest - } = getBuildData() - const publicPath = (projectConfig.weapp || {} as any).publicPath - const notExistNpmList = getNotExistNpmList() - const taroMiniAppFramework = `@tarojs/taro-${buildAdapter}` - let configObj: IConfig = {} - let componentClassName: string = '' - let taroJsReduxConnect: string = '' - let taroImportDefaultName - let needExportDefault = false - let exportTaroReduxConnected: string | null = null - const isQuickApp = buildAdapter === BUILD_TYPES.QUICKAPP - const cannotRemoves = [taroJsFramework, 'react', 'nervjs'] - let hasComponentDidHide - let hasComponentDidShow - let hasComponentWillMount - let hasEnablePageScroll - let needSetConfigFromHooks = false - let configFromHooks - if (isQuickApp) { - cannotRemoves.push(taroJsComponents) - } - const taroSelfComponents = new Set() - ast = babel.transformFromAst(ast, '', { - plugins: [ - [require('babel-plugin-preval')], - [require('babel-plugin-danger-remove-unused-import'), { ignore: cannotRemoves }], - [require('babel-plugin-transform-define').default, constantsReplaceList] - ] - }).ast as t.File - traverse(ast, { - ClassDeclaration (astPath) { - const node = astPath.node - let hasCreateData = false - if (node.superClass) { - astPath.traverse({ - ClassMethod (astPath) { - if (astPath.get('key').isIdentifier({ name: '_createData' })) { - hasCreateData = true - } - } - }) - if (hasCreateData) { - needExportDefault = true - astPath.traverse({ - ClassMethod (astPath) { - const node = astPath.node - if (node.kind === 'constructor') { - astPath.traverse({ - ExpressionStatement (astPath) { - const node = astPath.node - if (node.expression && - node.expression.type === 'AssignmentExpression' && - node.expression.operator === '=') { - const left = node.expression.left - if (left.type === 'MemberExpression' && - left.object.type === 'ThisExpression' && - left.property.type === 'Identifier' && - left.property.name === 'config') { - configObj = traverseObjectNode(node.expression.right, buildAdapter) - } - } - } - }) - } - } - }) - if (node.id === null) { - componentClassName = '_TaroComponentClass' - astPath.replaceWith( - t.classDeclaration( - t.identifier(componentClassName), - node.superClass as t.Expression, - node.body as t.ClassBody, - node.decorators as t.Decorator[] || [] - ) - ) - } else if (node.id.name === 'App') { - componentClassName = '_App' - astPath.replaceWith( - t.classDeclaration( - t.identifier(componentClassName), - node.superClass as t.Expression, - node.body as t.ClassBody, - node.decorators as t.Decorator[] || [] - ) - ) - } else { - componentClassName = node.id.name - } - } - } - }, - - ClassExpression (astPath) { - const node = astPath.node - if (node.superClass) { - let hasCreateData = false - astPath.traverse({ - ClassMethod (astPath) { - if (astPath.get('key').isIdentifier({ name: '_createData' })) { - hasCreateData = true - } - } - }) - if (hasCreateData) { - needExportDefault = true - if (node.id === null) { - const parentNode = astPath.parentPath.node as any - if (t.isVariableDeclarator(astPath.parentPath)) { - componentClassName = parentNode.id.name - } else { - componentClassName = '_TaroComponentClass' - } - astPath.replaceWith( - t.classExpression( - t.identifier(componentClassName), - node.superClass as t.Expression, - node.body as t.ClassBody, - node.decorators as t.Decorator[] || [] - ) - ) - } else if (node.id.name === 'App') { - componentClassName = '_App' - astPath.replaceWith( - t.classExpression( - t.identifier(componentClassName), - node.superClass as t.Expression, - node.body as t.ClassBody, - node.decorators as t.Decorator[] || [] - ) - ) - } else { - componentClassName = node.id.name - } - } - } - }, - - AssignmentExpression (astPath) { - const node = astPath.node - const left = node.left - if (t.isMemberExpression(left) && t.isIdentifier(left.object)) { - if (left.object.name === componentClassName - && t.isIdentifier(left.property) - && left.property.name === 'config') { - needSetConfigFromHooks = true - configFromHooks = node.right - configObj = traverseObjectNode(node.right, buildAdapter) - } - } - }, - - ClassMethod (astPath) { - const keyName = (astPath.get('key').node as t.Identifier).name - if (keyName === 'componentWillMount') { - hasComponentWillMount = true - } else if (keyName === 'componentDidShow') { - hasComponentDidShow = true - } else if (keyName === 'componentDidHide') { - hasComponentDidHide = true - } else if (keyName === 'onPageScroll' || keyName === 'onReachBottom') { - hasEnablePageScroll = true - } - }, - - ClassProperty (astPath) { - const node = astPath.node - const keyName = node.key.name - const valuePath = astPath.get('value') - if (keyName === 'config') { - configObj = traverseObjectNode(node, buildAdapter) - } else if (valuePath.isFunctionExpression() || valuePath.isArrowFunctionExpression()) { - if (keyName === 'componentWillMount') { - hasComponentWillMount = true - } else if (keyName === 'componentDidShow') { - hasComponentDidShow = true - } else if (keyName === 'componentDidHide') { - hasComponentDidHide = true - } - } - }, - - ImportDeclaration (astPath) { - const node = astPath.node - const source = node.source - let value = source.value - const specifiers = node.specifiers - // alias 替换 - if (isAliasPath(value, pathAlias)) { - value = replaceAliasPath(sourceFilePath, value, pathAlias) - source.value = value - } - - const quickappPkgs = quickappManifest ? quickappManifest.features : [] - if (isNpmPkg(value) && !(isQuickApp && isQuickappPkg(value, quickappPkgs)) && !notExistNpmList.has(value)) { - if (value === taroJsComponents) { - if (isQuickApp) { - specifiers.forEach(specifier => { - const name = specifier.local.name - if (!QUICKAPP_SPECIAL_COMPONENTS.has(name)) { - taroSelfComponents.add(_.kebabCase(name)) - } - }) - } - astPath.remove() - } else { - let isDepComponent = false - if (depComponents && depComponents.length) { - depComponents.forEach(item => { - if (item.path === value) { - isDepComponent = true - } - }) - } - if (isDepComponent) { - astPath.remove() - } else { - const specifiers = node.specifiers - if (value === taroJsFramework) { - let defaultSpecifier: string | null = null - specifiers.forEach(item => { - if (item.type === 'ImportDefaultSpecifier') { - defaultSpecifier = item.local.name - } - }) - if (defaultSpecifier) { - taroImportDefaultName = defaultSpecifier - } - excludeReplaceTaroFrameworkPkgs.add(taroMiniAppFramework) - if (!Array.from(excludeReplaceTaroFrameworkPkgs).some(item => sourceFilePath.replace(/\\/g, '/').indexOf(item) >= 0)) { - value = taroMiniAppFramework - } - } else if (value === taroJsRedux) { - specifiers.forEach(item => { - if (item.type === 'ImportSpecifier') { - const local = item.local - if (local.type === 'Identifier' && local.name === 'connect') { - taroJsReduxConnect = item.imported.name - } - } - }) - } - if (!npmSkip) { - source.value = getExactedNpmFilePath({ - npmName: value, - sourceFilePath, - filePath, - isProduction, - npmConfig, - buildAdapter, - root: appPath, - npmOutputDir, - compileConfig, - env: projectConfig.env || {}, - uglify: projectConfig!.plugins!.uglify || { enable: true }, - babelConfig: getBabelConfig(projectConfig!.plugins!.babel) || {}, - quickappManifest - }) - } else { - source.value = value - } - } - } - } else if (CSS_EXT.indexOf(path.extname(value)) !== -1 && specifiers.length > 0) { // 对 使用 import style from './style.css' 语法引入的做转化处理 - printLog(processTypeEnum.GENERATE, '替换代码', `为文件 ${sourceFilePath} 生成 css modules`) - const styleFilePath = path.join(path.dirname(sourceFilePath), value) - const styleCode = fs.readFileSync(styleFilePath).toString() - processStyleUseCssModule({ - css: styleCode, - filePath: styleFilePath - }).then(result => { - const tokens = result.root.exports || {} - createCssModuleMap(styleFilePath, tokens) - }) - const cssModuleMapFile = generateCssModuleMapFilename(styleFilePath) - astPath.node.source = t.stringLiteral(astPath.node.source.value.replace(path.basename(styleFilePath), path.basename(cssModuleMapFile))) - if (styleFiles.indexOf(styleFilePath) < 0) { // add this css file to queue - styleFiles.push(styleFilePath) - } - } else if (path.isAbsolute(value)) { - printLog(processTypeEnum.ERROR, '引用文件', `文件 ${sourceFilePath} 中引用 ${value} 是绝对路径!`) - } - }, - - CallExpression (astPath) { - const node = astPath.node - const callee = node.callee as (t.Identifier | t.MemberExpression) - if (t.isMemberExpression(callee)) { - if (taroImportDefaultName && (callee.object as t.Identifier).name === taroImportDefaultName && (callee.property as t.Identifier).name === 'render') { - astPath.remove() - } - } else if (callee.name === 'require') { - const args = node.arguments as t.StringLiteral[] - let value = args[0].value - const parentNode = astPath.parentPath.parentPath.node as t.VariableDeclaration - if (isAliasPath(value, pathAlias)) { - value = replaceAliasPath(sourceFilePath, value, pathAlias) - args[0].value = value - } - const quickappPkgs = quickappManifest ? quickappManifest.features : [] - if (isNpmPkg(value) && !(isQuickApp && isQuickappPkg(value, quickappPkgs)) && !notExistNpmList.has(value)) { - if (value === taroJsComponents) { - if (isQuickApp) { - if (parentNode.declarations.length === 1 && parentNode.declarations[0].init) { - const id = parentNode.declarations[0].id - if (id.type === 'ObjectPattern') { - const properties = id.properties as any - properties.forEach(p => { - if (p.type === 'ObjectProperty' && p.value.type === 'Identifier') { - taroSelfComponents.add(_.kebabCase(p.value.name)) - } - }) - } - } - } - astPath.remove() - } else { - let isDepComponent = false - if (depComponents && depComponents.length) { - depComponents.forEach(item => { - if (item.path === value) { - isDepComponent = true - } - }) - } - if (isDepComponent) { - astPath.remove() - } else { - if (t.isVariableDeclaration(astPath.parentPath.parentPath)) { - if (parentNode.declarations.length === 1 && parentNode.declarations[0].init) { - const id = parentNode.declarations[0].id - if (value === taroJsFramework && id.type === 'Identifier') { - taroImportDefaultName = id.name - excludeReplaceTaroFrameworkPkgs.add(taroMiniAppFramework) - if (!Array.from(excludeReplaceTaroFrameworkPkgs).some(item => sourceFilePath.replace(/\\/g, '/').indexOf(item) >= 0)) { - value = taroMiniAppFramework - } - } else if (value === taroJsRedux) { - const declarations = parentNode.declarations - declarations.forEach(item => { - const id = item.id - if (id.type === 'ObjectPattern') { - const properties = id.properties as any - properties.forEach(p => { - if (p.type === 'ObjectProperty') { - if (p.value.type === 'Identifier' && p.value.name === 'connect') { - taroJsReduxConnect = p.key.name - } - } - }) - } - }) - } - } - } - if (!npmSkip) { - args[0].value = getExactedNpmFilePath({ - npmName: value, - sourceFilePath, - filePath, - isProduction, - npmConfig, - buildAdapter, - root: appPath, - npmOutputDir, - compileConfig, - env: projectConfig.env || {}, - uglify: projectConfig!.plugins!.uglify || { enable: true }, - babelConfig: getBabelConfig(projectConfig!.plugins!.babel) || {}, - quickappManifest - }) - } else { - args[0].value = value - } - } - } - } else if (CSS_EXT.indexOf(path.extname(value)) !== -1 && t.isVariableDeclarator(astPath.parentPath)) { // 对 使用 const style = require('./style.css') 语法引入的做转化处理 - printLog(processTypeEnum.GENERATE, '替换代码', `为文件 ${sourceFilePath} 生成 css modules`) - const styleFilePath = path.join(path.dirname(sourceFilePath), value) - const styleCode = fs.readFileSync(styleFilePath).toString() - processStyleUseCssModule({ - css: styleCode, - filePath: styleFilePath - }).then(result => { - const tokens = result.root.exports || {} - createCssModuleMap(styleFilePath, tokens) - }) - const cssModuleMapFile = generateCssModuleMapFilename(styleFilePath) - args[0].value = args[0].value.replace(path.basename(styleFilePath), path.basename(cssModuleMapFile)) - if (styleFiles.indexOf(styleFilePath) < 0) { // add this css file to queue - styleFiles.push(styleFilePath) - } - } else if (path.isAbsolute(value)) { - printLog(processTypeEnum.ERROR, '引用文件', `文件 ${sourceFilePath} 中引用 ${value} 是绝对路径!`) - } - } - }, - - ExportDefaultDeclaration (astPath) { - const node = astPath.node - const declaration = node.declaration - needExportDefault = false - if ( - declaration && - (declaration.type === 'ClassDeclaration' || declaration.type === 'ClassExpression') - ) { - const superClass = declaration.superClass - if (superClass) { - let hasCreateData = false - astPath.traverse({ - ClassMethod (astPath) { - if (astPath.get('key').isIdentifier({ name: '_createData' })) { - hasCreateData = true - } - } - }) - if (hasCreateData) { - needExportDefault = true - if (declaration.id === null) { - componentClassName = '_TaroComponentClass' - } else if (declaration.id.name === 'App') { - componentClassName = '_App' - } else { - componentClassName = declaration.id.name - } - const isClassDcl = declaration.type === 'ClassDeclaration' - const classDclProps = [t.identifier(componentClassName), superClass, declaration.body, declaration.decorators || []] - astPath.replaceWith(isClassDcl ? t.classDeclaration.apply(null, classDclProps) : t.classExpression.apply(null, classDclProps)) - } - } - } else if (declaration.type === 'CallExpression') { - const callee = declaration.callee - if (callee && callee.type === 'CallExpression') { - const subCallee = callee.callee - if (subCallee.type === 'Identifier' && subCallee.name === taroJsReduxConnect) { - const args = declaration.arguments as t.Identifier[] - if (args.length === 1 && args[0].name === componentClassName) { - needExportDefault = true - exportTaroReduxConnected = `${componentClassName}__Connected` - astPath.replaceWith(t.variableDeclaration('const', [t.variableDeclarator(t.identifier(`${componentClassName}__Connected`), t.callExpression(declaration.callee as t.Expression, declaration.arguments as Array))])) - } - } - } - } else if (declaration.type === 'Identifier') { - const name = declaration.name - if (name === componentClassName || name === exportTaroReduxConnected) { - needExportDefault = true - astPath.remove() - } - } - }, - - ExportNamedDeclaration (astPath) { - const node = astPath.node - const source = node.source - if (source && source.type === 'StringLiteral') { - const value = source.value - analyzeImportUrl({ astPath, value, sourceFilePath, filePath, styleFiles, scriptFiles, jsonFiles, mediaFiles }) - } - }, - - ExportAllDeclaration (astPath) { - const node = astPath.node - const source = node.source - if (source && source.type === 'StringLiteral') { - const value = source.value - analyzeImportUrl({ astPath, value, sourceFilePath, filePath, styleFiles, scriptFiles, jsonFiles, mediaFiles }) - } - }, - - Program: { - exit (astPath) { - astPath.traverse({ - ClassBody (astPath) { - if (isQuickApp) { - const node = astPath.node - if (!hasComponentWillMount) { - node.body.push(t.classMethod( - 'method', t.identifier('hasComponentWillMount'), [], - t.blockStatement([]), false, false)) - } - if (!hasComponentDidShow) { - node.body.push(t.classMethod( - 'method', t.identifier('componentDidShow'), [], - t.blockStatement([]), false, false)) - } - if (!hasComponentDidHide) { - node.body.push(t.classMethod( - 'method', t.identifier('componentDidHide'), [], - t.blockStatement([]), false, false)) - } - node.body.push(t.classMethod( - 'method', t.identifier('__listenToSetNavigationBarEvent'), [], - t.blockStatement([convertSourceStringToAstExpression( - `if (!Taro.eventCenter.callbacks['TaroEvent:setNavigationBar']) { - Taro.eventCenter.on('TaroEvent:setNavigationBar', params => { - if (params.title) { - this.$scope.$page.setTitleBar({ text: params.title }) - } - if (params.frontColor) { - this.$scope.$page.setTitleBar({ textColor: params.frontColor }) - } - if (params.backgroundColor) { - this.$scope.$page.setTitleBar({ backgroundColor: params.backgroundColor }) - } - }) - }` - )]), false, false)) - node.body.push(t.classMethod( - 'method', t.identifier('__offListenToSetNavigationBarEvent'), [], - t.blockStatement([convertSourceStringToAstExpression( - `Taro.eventCenter.off('TaroEvent:setNavigationBar')` - )]), false, false)) - } - if (needSetConfigFromHooks) { - const classPath = astPath.findParent((p: NodePath) => p.isClassExpression() || p.isClassDeclaration()) as NodePath - classPath.node.body.body.unshift( - t.classProperty( - t.identifier('config'), - configFromHooks as t.ObjectExpression - ) - ) - } - }, - ClassMethod (astPath) { - if (isQuickApp) { - const node = astPath.node - const keyName = (node.key as t.Identifier).name - if (keyName === 'componentDidShow' || keyName === 'componentWillMount') { - node.body.body.unshift(convertSourceStringToAstExpression(`this.__listenToSetNavigationBarEvent()`)) - } else if (keyName === 'componentDidHide') { - node.body.body.unshift(convertSourceStringToAstExpression(`this.__offListenToSetNavigationBarEvent()`)) - } - } - }, - ImportDeclaration (astPath) { - const node = astPath.node - const source = node.source - const value = source.value - analyzeImportUrl({ astPath, value, sourceFilePath, filePath, styleFiles, scriptFiles, jsonFiles, mediaFiles }) - }, - CallExpression (astPath) { - const node = astPath.node - const callee = node.callee as t.Identifier - if (callee.name === 'require') { - const args = node.arguments as t.StringLiteral[] - const value = args[0].value - const valueExtname = path.extname(value) - if (value.indexOf('.') === 0) { - let importPath = path.resolve(path.dirname(sourceFilePath), value) - importPath = resolveScriptPath(importPath) - if (isFileToBePage(importPath)) { - if (astPath.parent.type === 'AssignmentExpression' || 'ExpressionStatement') { - astPath.parentPath.remove() - } else if (astPath.parent.type === 'VariableDeclarator') { - astPath.parentPath.parentPath.remove() - } else { - astPath.remove() - } - } else { - if (REG_STYLE.test(valueExtname)) { - const stylePath = path.resolve(path.dirname(sourceFilePath), value) - if (styleFiles.indexOf(stylePath) < 0) { - styleFiles.push(stylePath) - } - if (astPath.parent.type === 'AssignmentExpression' || 'ExpressionStatement') { - astPath.parentPath.remove() - } else if (astPath.parent.type === 'VariableDeclarator') { - astPath.parentPath.parentPath.remove() - } else { - astPath.remove() - } - } else if (REG_JSON.test(valueExtname)) { - const vpath = path.resolve(sourceFilePath, '..', value) - if (jsonFiles.indexOf(vpath) < 0) { - jsonFiles.push(vpath) - } - if (fs.existsSync(vpath)) { - const obj = JSON.parse(fs.readFileSync(vpath).toString()) - let objArr: t.NullLiteral | t.Expression | t.ObjectProperty[] = t.nullLiteral() - if (Array.isArray(obj)) { - objArr = t.arrayExpression(convertArrayToAstExpression(obj)) - } else { - objArr = convertObjectToAstExpression(obj) - } - astPath.replaceWith(t.objectExpression(objArr as any)) - } - } else if (REG_SCRIPT.test(valueExtname) || REG_TYPESCRIPT.test(valueExtname)) { - const vpath = path.resolve(sourceFilePath, '..', value) - let fPath = value - if (fs.existsSync(vpath) && vpath !== sourceFilePath) { - fPath = vpath - } - if (scriptFiles.indexOf(fPath) < 0) { - scriptFiles.push(fPath) - } - } else if (REG_FONT.test(valueExtname) || REG_IMAGE.test(valueExtname) || REG_MEDIA.test(valueExtname)) { - const vpath = path.resolve(sourceFilePath, '..', value) - if (mediaFiles.indexOf(vpath) < 0) { - mediaFiles.push(vpath) - } - let showPath - if (NODE_MODULES_REG.test(vpath)) { - showPath = vpath.replace(nodeModulesPath, `/${npmConfig.name}`) - } else { - showPath = vpath.replace(sourceDir, '') - if (publicPath) { - const hashName = getHashName(vpath) - showPath = (/\/$/.test(publicPath) ? publicPath : publicPath + '/') + hashName - } - } - astPath.replaceWith(t.stringLiteral(showPath.replace(/\\/g, '/'))) - } else { - let vpath = resolveScriptPath(path.resolve(sourceFilePath, '..', value)) - let outputVpath - if (NODE_MODULES_REG.test(vpath)) { - outputVpath = vpath.replace(nodeModulesPath, npmOutputDir) - } else { - outputVpath = vpath.replace(sourceDir, outputDir) - } - let relativePath = path.relative(filePath, outputVpath) - if (vpath) { - if (!fs.existsSync(vpath)) { - printLog(processTypeEnum.ERROR, '引用文件', `文件 ${sourceFilePath} 中引用 ${value} 不存在!`) - } else { - if (fs.lstatSync(vpath).isDirectory()) { - if (fs.existsSync(path.join(vpath, 'index.js'))) { - vpath = path.join(vpath, 'index.js') - relativePath = path.join(relativePath, 'index.js') - } else { - printLog(processTypeEnum.ERROR, '引用目录', `文件 ${sourceFilePath} 中引用了目录 ${value}!`) - return - } - } - if (scriptFiles.indexOf(vpath) < 0) { - scriptFiles.push(vpath) - } - relativePath = promoteRelativePath(relativePath) - relativePath = relativePath.replace(extnameExpRegOf(relativePath), '.js') - args[0].value = relativePath - } - } - } - } - } - } - } - }) - const node = astPath.node as t.Program - const exportVariableName = exportTaroReduxConnected || componentClassName - if (needExportDefault && !isQuickApp) { - const exportDefault = template(`export default ${exportVariableName}`, babylonConfig as any)() - node.body.push(exportDefault as any) - } - const taroMiniAppFrameworkPath = !npmSkip ? getExactedNpmFilePath({ - npmName: taroMiniAppFramework, - sourceFilePath, - filePath, - isProduction, - npmConfig, - buildAdapter, - root: appPath, - npmOutputDir, - compileConfig, - env: projectConfig.env || {}, - uglify: projectConfig!.plugins!.uglify || { enable: true }, - babelConfig: getBabelConfig(projectConfig!.plugins!.babel) || {}, - quickappManifest - }) : taroMiniAppFramework - switch (type) { - case PARSE_AST_TYPE.ENTRY: - const pxTransformConfig = { - designWidth: projectConfig.designWidth || 750 - } - if (projectConfig.hasOwnProperty(DEVICE_RATIO_NAME)) { - pxTransformConfig[DEVICE_RATIO_NAME] = projectConfig.deviceRatio - } - if (isQuickApp) { - if (!taroImportDefaultName) { - node.body.unshift( - template(`import Taro from '${taroMiniAppFrameworkPath}'`, babylonConfig as any)() as any - ) - } - node.body.push(template(`export default require('${taroMiniAppFrameworkPath}').default.createApp(${exportVariableName})`, babylonConfig as any)() as any) - } else { - node.body.push(template(`App(require('${taroMiniAppFrameworkPath}').default.createApp(${exportVariableName}))`, babylonConfig as any)() as any) - } - node.body.push(template(`Taro.initPxTransform(${JSON.stringify(pxTransformConfig)})`, babylonConfig as any)() as any) - break - case PARSE_AST_TYPE.PAGE: - if (buildAdapter === BUILD_TYPES.WEAPP || buildAdapter === BUILD_TYPES.QQ) { - node.body.push(template(`Component(require('${taroMiniAppFrameworkPath}').default.createComponent(${exportVariableName}, true))`, babylonConfig as any)() as any) - } else if (isQuickApp) { - const pagePath = sourceFilePath.replace(sourceDir, '').replace(/\\/g, '/').replace(extnameExpRegOf(sourceFilePath), '') - if (!taroImportDefaultName) { - node.body.unshift( - template(`import Taro from '${taroMiniAppFrameworkPath}'`, babylonConfig as any)() as any - ) - } - node.body.push(template(`export default require('${taroMiniAppFrameworkPath}').default.createComponent(${exportVariableName}, '${pagePath}')`, babylonConfig as any)() as any) - } else { - node.body.push(template(`Page(require('${taroMiniAppFrameworkPath}').default.createComponent(${exportVariableName}, true))`, babylonConfig as any)() as any) - } - break - case PARSE_AST_TYPE.COMPONENT: - if (isQuickApp) { - if (!taroImportDefaultName) { - node.body.unshift( - template(`import Taro from '${taroMiniAppFrameworkPath}'`, babylonConfig as any)() as any - ) - } - node.body.push(template(`export default require('${taroMiniAppFrameworkPath}').default.createComponent(${exportVariableName})`, babylonConfig as any)() as any) - } else { - node.body.push(template(`Component(require('${taroMiniAppFrameworkPath}').default.createComponent(${exportVariableName}))`, babylonConfig as any)() as any) - } - break - default: - break - } - } - } - }) - - if (isQuickApp && type === PARSE_AST_TYPE.PAGE) { - taroSelfComponents.add('taro-page') - } - - return { - code: generate(ast).code, - styleFiles, - scriptFiles, - jsonFiles, - configObj, - mediaFiles, - componentClassName, - taroSelfComponents, - hasEnablePageScroll - } -} - -export function parseComponentExportAst (ast: t.File, componentName: string, componentPath: string, componentType: string): string | null { - const { - constantsReplaceList - } = getBuildData() - let componentRealPath: string | null = null - let importExportName - ast = babel.transformFromAst(ast, '', { - plugins: [ - [require('babel-plugin-transform-define').default, constantsReplaceList] - ] - }).ast as t.File - componentName = componentName.split('|')[1] || componentName - traverse(ast, { - ExportNamedDeclaration (astPath) { - const node = astPath.node - const specifiers = node.specifiers - const source = node.source - if (source && source.type === 'StringLiteral') { - specifiers.forEach(specifier => { - const exported = specifier.exported - if (_.kebabCase(exported.name) === componentName) { - componentRealPath = resolveScriptPath(path.resolve(path.dirname(componentPath), source.value)) - } - }) - } else { - specifiers.forEach(specifier => { - const exported = specifier.exported - if (_.kebabCase(exported.name) === componentName) { - importExportName = exported.name - } - }) - } - }, - - ExportDefaultDeclaration (astPath) { - const node = astPath.node - const declaration = node.declaration as t.Identifier - if (componentType === 'default') { - importExportName = declaration.name - } - }, - - CallExpression (astPath) { - if (astPath.get('callee').isIdentifier({ name: 'require' })) { - const arg = astPath.get('arguments')[0] - if (t.isStringLiteral(arg.node)) { - componentRealPath = resolveScriptPath(path.resolve(path.dirname(componentPath), arg.node.value)) - } - } - }, - - Program: { - exit (astPath) { - astPath.traverse({ - ImportDeclaration (astPath) { - const node = astPath.node - const specifiers = node.specifiers - const source = node.source - if (importExportName) { - specifiers.forEach(specifier => { - const local = specifier.local - if (local.name === importExportName) { - componentRealPath = resolveScriptPath(path.resolve(path.dirname(componentPath), source.value)) - } - }) - } - } - }) - } - } - }) - return componentRealPath -} diff --git a/packages/taro-cli/src/mini/compileScript.ts b/packages/taro-cli/src/mini/compileScript.ts deleted file mode 100644 index c0b34d3d1276..000000000000 --- a/packages/taro-cli/src/mini/compileScript.ts +++ /dev/null @@ -1,170 +0,0 @@ -import * as fs from 'fs-extra' -import * as path from 'path' - -import wxTransformer from '@tarojs/transformer-wx' - -import { - printLog, - isDifferentArray, - copyFileSync, - getBabelConfig, - uglifyJS, - extnameExpRegOf, - generateAlipayPath -} from '../util' -import { - BUILD_TYPES, - processTypeEnum, - REG_TYPESCRIPT, - NODE_MODULES_REG, - PARSE_AST_TYPE -} from '../util/constants' -import { callPlugin } from '../util/npm' -import { npmCodeHack } from '../util/resolve_npm_files' -import { IWxTransformResult, TogglableOptions } from '../util/types' - -import { - shouldTransformAgain, - getBuildData, - copyFilesFromSrcToOutput, - getDependencyTree -} from './helper' -import { parseAst } from './astProcess' -import { IDependency } from './interface' - -const isBuildingScripts: Map = new Map() - -export function initCompileScripts () { - isBuildingScripts.clear() -} - -export function compileDepScripts (scriptFiles: string[], needUseBabel?: boolean, buildDepSync?: boolean) { - const { - nodeModulesPath, - npmOutputDir, - projectConfig, - sourceDir, - outputDir, - appPath, - buildAdapter, - constantsReplaceList, - isProduction, - jsxAttributeNameReplace - } = getBuildData() - const dependencyTree = getDependencyTree() - return scriptFiles.map(async item => { - if (path.isAbsolute(item)) { - let outputItem - if (NODE_MODULES_REG.test(item)) { - outputItem = item.replace(nodeModulesPath, npmOutputDir).replace(extnameExpRegOf(item), '.js') - } else { - outputItem = item.replace(path.join(sourceDir), path.join(outputDir)).replace(extnameExpRegOf(item), '.js') - } - if (buildAdapter === BUILD_TYPES.ALIPAY) { - outputItem = generateAlipayPath(outputItem) - } - const weappConf = Object.assign({}, projectConfig.weapp) - const useCompileConf = Object.assign({}, weappConf.compile) - const compileExclude = (useCompileConf.exclude || []).filter(item => !/(?:\/|^)node_modules(\/|$)/.test(item)) - let isInCompileExclude = false - compileExclude.forEach(excludeItem => { - if (item.indexOf(path.join(appPath, excludeItem)) >= 0) { - isInCompileExclude = true - } - }) - if (isInCompileExclude) { - copyFileSync(item, outputItem) - return - } - if (!isBuildingScripts.get(outputItem)) { - isBuildingScripts.set(outputItem, true) - try { - const code = fs.readFileSync(item).toString() - const transformResult = wxTransformer({ - code, - sourcePath: item, - isTyped: REG_TYPESCRIPT.test(item), - adapter: buildAdapter, - isNormal: true, - env: constantsReplaceList, - jsxAttributeNameReplace - }) - const ast = transformResult.ast - const res = parseAst(PARSE_AST_TYPE.NORMAL, ast, [], item, outputItem) - const fileDep = dependencyTree.get(item) || {} as IDependency - let resCode = res.code - if (needUseBabel) { - resCode = await compileScriptFile(res.code, item, outputItem, buildAdapter) - } - fs.ensureDirSync(path.dirname(outputItem)) - if (isProduction && needUseBabel) { - resCode = uglifyJS(resCode, item, appPath, projectConfig!.plugins!.uglify as TogglableOptions) - } - if (NODE_MODULES_REG.test(item)) { - resCode = npmCodeHack(outputItem, resCode, buildAdapter) - } - fs.writeFileSync(outputItem, resCode) - let modifyOutput = outputItem.replace(appPath + path.sep, '') - modifyOutput = modifyOutput.split(path.sep).join('/') - printLog(processTypeEnum.GENERATE, '依赖文件', modifyOutput) - // 编译依赖的脚本文件 - if (isDifferentArray(fileDep['script'], res.scriptFiles)) { - if (buildDepSync) { - await Promise.all(compileDepScripts(res.scriptFiles, needUseBabel, buildDepSync)) - } else { - compileDepScripts(res.scriptFiles, needUseBabel, buildDepSync) - } - } - // 拷贝依赖文件 - if (isDifferentArray(fileDep['json'], res.jsonFiles)) { - copyFilesFromSrcToOutput(res.jsonFiles) - } - if (isDifferentArray(fileDep['media'], res.mediaFiles)) { - copyFilesFromSrcToOutput(res.mediaFiles) - } - fileDep['script'] = res.scriptFiles - fileDep['json'] = res.jsonFiles - fileDep['media'] = res.mediaFiles - dependencyTree.set(item, fileDep) - } catch (err) { - printLog(processTypeEnum.ERROR, '编译失败', item.replace(appPath + path.sep, '')) - console.log(err) - } - } - } - }) -} - -export async function compileScriptFile ( - content: string, - sourceFilePath: string, - outputFilePath: string, - adapter: BUILD_TYPES -): Promise { - const { - appPath, - constantsReplaceList, - jsxAttributeNameReplace, - projectConfig - } = getBuildData() - if (NODE_MODULES_REG.test(sourceFilePath) && fs.existsSync(outputFilePath)) { - return fs.readFileSync(outputFilePath).toString() - } - const babelConfig = getBabelConfig(projectConfig!.plugins!.babel) - const compileScriptRes = await callPlugin('babel', content, sourceFilePath, babelConfig, appPath) - const code = compileScriptRes.code - if (!shouldTransformAgain()) { - return code - } - const transformResult: IWxTransformResult = wxTransformer({ - code, - sourcePath: sourceFilePath, - isNormal: true, - isTyped: false, - adapter, - env: constantsReplaceList, - jsxAttributeNameReplace - }) - const res = parseAst(PARSE_AST_TYPE.NORMAL, transformResult.ast, [], sourceFilePath, outputFilePath) - return res.code -} diff --git a/packages/taro-cli/src/mini/compileStyle.ts b/packages/taro-cli/src/mini/compileStyle.ts deleted file mode 100644 index 2b859e8a9fee..000000000000 --- a/packages/taro-cli/src/mini/compileStyle.ts +++ /dev/null @@ -1,324 +0,0 @@ -import * as fs from 'fs-extra' -import * as path from 'path' - -import * as autoprefixer from 'autoprefixer' -import * as postcss from 'postcss' -import * as pxtransform from 'postcss-pxtransform' -import rewriter from '../quickapp/style-rewriter' -import getHashName from '../util/hash' -import browserList from '../config/browser_list' -import { - resolveNpmPkgMainPath, - resolveNpmFilesPath -} from '../util/resolve_npm_files' -import { - callPlugin, callPluginSync -} from '../util/npm' -import { - isNpmPkg, - processStyleImports, - promoteRelativePath, - getBabelConfig -} from '../util' -import { CSS_EXT, FILE_PROCESSOR_MAP, DEVICE_RATIO_NAME, BUILD_TYPES } from '../util/constants' -import { IMiniAppConfig } from '../util/types' - -import { - getBuildData -} from './helper' - -const cssUrlParse = require('postcss-url') -const genericNames = require('generic-names') -const Scope = require('postcss-modules-scope') -const Values = require('postcss-modules-values') -const LocalByDefault = require('postcss-modules-local-by-default') -const ExtractImports = require('postcss-modules-extract-imports') -const ResolveImports = require('postcss-modules-resolve-imports') -interface IStyleObj { - css: string, - filePath: string -} - -const isBuildingStyles: Map = new Map() - -export function initCompileStyles () { - isBuildingStyles.clear() -} - -export interface ICSSModulesConf { - enable: boolean, - config: { - generateScopedName: string | ((localName: string, absoluteFilePath: string) => string), - namingPattern: 'global' | 'module' - } -} - -/** - * css module processor - * @param styleObj { css: string, filePath: '' } - * @returns postcss.process() - */ -export async function processStyleUseCssModule (styleObj: IStyleObj): Promise { - const { projectConfig, appPath } = getBuildData() - const weappConf = Object.assign({}, projectConfig.weapp) - const useModuleConf = weappConf.module || {} - const customPostcssConf = useModuleConf.postcss || {} - const customCssModulesConf = Object.assign({ - enable: false, - config: { - generateScopedName: '[name]__[local]___[hash:base64:5]', - namingPattern: 'global' - } - }, customPostcssConf.cssModules || {}) as ICSSModulesConf - if (!customCssModulesConf.enable) { - return styleObj - } - const namingPattern = customCssModulesConf.config.namingPattern - if (namingPattern === 'module') { - // 只对 xxx.module.[css|scss|less|styl] 等样式文件做处理 - const DO_USE_CSS_MODULE_REGEX = /^(.*\.module).*\.(css|scss|less|styl)$/ - if (!DO_USE_CSS_MODULE_REGEX.test(styleObj.filePath)) return styleObj - } else { - // 对 xxx.global.[css|scss|less|styl] 等样式文件不做处理 - const DO_NOT_USE_CSS_MODULE_REGEX = /^(.*\.global).*\.(css|scss|less|styl)$/ - if (DO_NOT_USE_CSS_MODULE_REGEX.test(styleObj.filePath)) return styleObj - } - const generateScopedName = customCssModulesConf.config.generateScopedName - const context = appPath - let scopedName - if (generateScopedName) { - scopedName = typeof generateScopedName === 'function' - ? (local, filename) => generateScopedName(local, filename) - : genericNames(generateScopedName, { context }) - } else { - scopedName = (local, filename) => Scope.generateScopedName(local, path.relative(context, filename)) - } - const postcssPlugins = [ - Values, - LocalByDefault, - ExtractImports, - new Scope({ generateScopedName: scopedName }), - new ResolveImports({ resolve: Object.assign({}, { extensions: CSS_EXT }) }) - ] - const runner = postcss(postcssPlugins) - const cssText = (await compileStyleWithPlugin(styleObj.filePath)).css - const result = runner.process(cssText, Object.assign({}, { from: styleObj.filePath })) - return result -} - -async function processStyleWithPostCSS (styleObj: IStyleObj): Promise { - const { appPath, outputDir,projectConfig, npmConfig, isProduction, buildAdapter } = getBuildData() - const weappConf = Object.assign({}, projectConfig.weapp) - const publicPath = weappConf.publicPath - const useModuleConf = weappConf.module || {} - const customPostcssConf = useModuleConf.postcss || {} - const customCssModulesConf = Object.assign({ - enable: false, - config: { - generateScopedName: '[name]__[local]___[hash:base64:5]' - } - }, customPostcssConf.cssModules || {}) - const customPxtransformConf = Object.assign({ - enable: true, - config: {} - }, customPostcssConf.pxtransform || {}) - const customUrlConf = { - enable: true, - config: { - limit: 10240 - } as any, - ...customPostcssConf.url - } - const customAutoprefixerConf = Object.assign({ - enable: true, - config: { - browsers: browserList - } - }, customPostcssConf.autoprefixer || {}) - const postcssPxtransformOption = { - designWidth: projectConfig.designWidth || 750, - platform: 'weapp' - } - - if (projectConfig.hasOwnProperty(DEVICE_RATIO_NAME)) { - postcssPxtransformOption[DEVICE_RATIO_NAME] = projectConfig.deviceRatio - } - - const maxSize = (customUrlConf.config.limit || 1024) / 1024 - const postcssPxtransformConf = Object.assign({}, postcssPxtransformOption, customPxtransformConf, customPxtransformConf.config) - const processors: any[] = [] - if (customAutoprefixerConf.enable) { - processors.push(autoprefixer(customAutoprefixerConf.config)) - } - if (customPxtransformConf.enable && buildAdapter !== BUILD_TYPES.QUICKAPP) { - processors.push(pxtransform(postcssPxtransformConf)) - } - if (customUrlConf.enable) { - let inlineOpts = {} - const url = customUrlConf.config.url || 'inline' - if (url === 'inline' && !publicPath) { - inlineOpts = { - encodeType: 'base64', - maxSize, - url - } - } - - - - /*** - * 修复小程序下css没有正确引用样式 - * 当前位置只进行了文件hash转换并没有做文件copy操作 - */ - if (publicPath && typeof url !== 'function') { - customUrlConf.config.url = (assets) => { - - // 本地文件路径 - if (/\./.test(assets.url)) { - const hashName = getHashName(assets.absolutePath); - assets.url = (/\/$/.test(publicPath) ? publicPath : publicPath + '/') + hashName; - - // 目前只在头条小程序复现,避免影响,只针对头条处理 - if(buildAdapter === BUILD_TYPES.TT){ - const outputFile = path.resolve(outputDir,`./${assets.url}`); - fs.ensureDirSync(path.dirname(outputFile)); - fs.copySync(assets.absolutePath,outputFile); - // 头条下不支持 / ,修正头条css background路径 - assets.url = assets.url.replace(/^[\/]/,''); - } - } - - return assets.url - } - - } - - const cssUrlParseConf = { - ...inlineOpts, - ...customUrlConf.config - } - processors.push(cssUrlParse(cssUrlParseConf)) - } - - const defaultPostCSSPluginNames = ['autoprefixer', 'pxtransform', 'url', 'cssModules'] - Object.keys(customPostcssConf).forEach(pluginName => { - if (defaultPostCSSPluginNames.indexOf(pluginName) < 0) { - const pluginConf = customPostcssConf[pluginName] - if (pluginConf && pluginConf.enable) { - if (!isNpmPkg(pluginName)) { // local plugin - pluginName = path.join(appPath, pluginName) - } - processors.push(require(resolveNpmPkgMainPath(pluginName, isProduction, npmConfig, buildAdapter, appPath))(pluginConf.config || {})) - } - } - }) - let css = styleObj.css - if (customCssModulesConf.enable) { - css = (await processStyleUseCssModule(styleObj)).css - } - const postcssResult = await postcss(processors).process(css, { - from: styleObj.filePath - }) - return postcssResult.css -} - -function compileImportStyles (filePath: string, importStyles: string[]) { - const { sourceDir, outputDir } = getBuildData() - if (importStyles.length) { - importStyles.forEach(async importItem => { - const importFilePath = path.resolve(filePath, '..', importItem) - if (fs.existsSync(importFilePath)) { - await compileDepStyles(importFilePath.replace(sourceDir, outputDir), [importFilePath]) - } - }) - } -} - -function compileStyleWithPlugin (filePath) { - const { appPath, npmOutputDir, nodeModulesPath, projectConfig, npmConfig, isProduction, buildAdapter, quickappManifest } = getBuildData() - const fileExt = path.extname(filePath) - const pluginName = FILE_PROCESSOR_MAP[fileExt] - const fileContent = fs.readFileSync(filePath).toString() - const pluginsConfig = projectConfig.plugins || {} - const weappConf = projectConfig.weapp || {} as IMiniAppConfig - const useCompileConf = Object.assign({}, weappConf.compile) - const cssImportsRes = processStyleImports(fileContent, buildAdapter, (str, stylePath) => { - if (stylePath.indexOf('~') === 0) { - let newStylePath = stylePath - newStylePath = stylePath.replace('~', '') - const npmInfo = resolveNpmFilesPath({ - pkgName: newStylePath, - isProduction, - npmConfig, - buildAdapter, - root: appPath, - rootNpm: nodeModulesPath, - npmOutputDir, - compileConfig: useCompileConf, - env: projectConfig.env || {}, - uglify: projectConfig!.plugins!.uglify || { enable: true }, - babelConfig: getBabelConfig(projectConfig!.plugins!.babel) || {}, - quickappManifest - }) - const importRelativePath = promoteRelativePath(path.relative(filePath, npmInfo.main)) - return str.replace(stylePath, importRelativePath) - } - return str - }) - compileImportStyles(filePath, cssImportsRes.imports) - if (pluginName) { - return callPlugin(pluginName, cssImportsRes.content, filePath, pluginsConfig[pluginName] || {}, appPath) - .then(res => ({ - css: cssImportsRes.style.join('\n') + '\n' + res.css, - filePath - })).catch(err => { - if (err) { - console.log(err) - if (isProduction) { - process.exit(0) - } - } - }) - } - return new Promise(resolve => { - resolve({ - css: cssImportsRes.style.join('\n') + '\n' + cssImportsRes.content, - filePath - }) - }) -} - -export function compileDepStyles (outputFilePath: string, styleFiles: string[]) { - if (isBuildingStyles.get(outputFilePath)) { - return Promise.resolve({}) - } - const { appPath, projectConfig, isProduction, buildAdapter } = getBuildData() - const isQuickApp = buildAdapter === BUILD_TYPES.QUICKAPP - const pluginsConfig = projectConfig.plugins || {} - isBuildingStyles.set(outputFilePath, true) - return Promise.all(styleFiles.map(async p => compileStyleWithPlugin(p))).then(async resList => { - await Promise.all(resList.map(res => processStyleWithPostCSS(res))) - .then(cssList => { - let resContent = cssList.map(res => res).join('\n') - // 非生产模式下用户 csso 配置不存在则默认 csso 为禁用 - let cssoPuginConfig = pluginsConfig.csso || { enable: false } - if (isProduction) { - cssoPuginConfig = pluginsConfig.csso || { enable: true } - } - if (cssoPuginConfig.enable) { - const cssoConfig = cssoPuginConfig.config || {} - const cssoResult = callPluginSync('csso', resContent, outputFilePath, cssoConfig, appPath) - resContent = cssoResult.css - } - if (isQuickApp) { - const transformStyle = rewriter(resContent, isProduction) - if(transformStyle) { - resContent = transformStyle - } - } - - fs.ensureDirSync(path.dirname(outputFilePath)) - fs.writeFileSync(outputFilePath, resContent) - }) - }) -} diff --git a/packages/taro-cli/src/mini/component.ts b/packages/taro-cli/src/mini/component.ts deleted file mode 100644 index 61fc5848ebca..000000000000 --- a/packages/taro-cli/src/mini/component.ts +++ /dev/null @@ -1,372 +0,0 @@ -import * as fs from 'fs-extra' -import * as path from 'path' - -import { Config as IConfig } from '@tarojs/taro' -import wxTransformer from '@tarojs/transformer-wx' -import * as _ from 'lodash' -import traverse from 'babel-traverse' - -import { IWxTransformResult, TogglableOptions } from '../util/types' -import { - REG_TYPESCRIPT, - processTypeEnum, - NODE_MODULES_REG, - NODE_MODULES, - PARSE_AST_TYPE, - BUILD_TYPES -} from '../util/constants' -import { - printLog, - isEmptyObject, - promoteRelativePath, - isDifferentArray, - generateQuickAppUx, - uglifyJS, - extnameExpRegOf, - generateAlipayPath -} from '../util' - -import { parseComponentExportAst, parseAst } from './astProcess' -import { IComponentObj, IBuildResult } from './interface' -import { - setHasBeenBuiltComponents, - isComponentHasBeenBuilt, - getBuildData, - setComponentExportsMap, - getComponentExportsMap, - getRealComponentsPathList, - copyFilesFromSrcToOutput, - getDependencyTree, - buildUsingComponents, - getDepComponents, - getImportTaroSelfComponents -} from './helper' -import { compileScriptFile, compileDepScripts } from './compileScript' -import { compileDepStyles } from './compileStyle' -import { transfromNativeComponents, processNativeWxml } from './native' - -const notTaroComponents = new Set() -const componentsNamedMap = new Map() -const componentsBuildResult = new Map() - -export function getComponentsNamedMap () { - return componentsNamedMap -} - -export function isFileToBeTaroComponent ( - code: string, - sourcePath: string -) { - const { - buildAdapter, - constantsReplaceList, - jsxAttributeNameReplace, - alias - } = getBuildData() - const transformResult: IWxTransformResult = wxTransformer({ - code, - sourcePath: sourcePath, - isTyped: REG_TYPESCRIPT.test(sourcePath), - adapter: buildAdapter, - isNormal: true, - env: constantsReplaceList, - jsxAttributeNameReplace, - alias - }) - const { ast }: IWxTransformResult = transformResult - let isTaroComponent = false - - traverse(ast, { - JSXElement () { - isTaroComponent = true - } - }) - - return { - isTaroComponent, - transformResult - } -} - -export interface IComponentBuildConfig { - outputDir?: string, - outputDirName?: string, - npmSkip?: boolean -} - -export function buildDepComponents ( - componentPathList: IComponentObj[], - buildConfig?: IComponentBuildConfig -): Promise { - return Promise.all(componentPathList.map(componentObj => buildSingleComponent(componentObj, buildConfig))) -} - -export async function buildSingleComponent ( - componentObj: IComponentObj, - buildConfig: IComponentBuildConfig = {} -): Promise { - - const { - appPath, - buildAdapter, - constantsReplaceList, - sourceDir, - outputDir, - sourceDirName, - outputDirName, - npmOutputDir, - nodeModulesPath, - outputFilesTypes, - isProduction, - jsxAttributeNameReplace, - projectConfig, - alias - } = getBuildData() - const isQuickApp = buildAdapter === BUILD_TYPES.QUICKAPP - - if (componentObj.path) { - componentsNamedMap.set(componentObj.path, { - name: componentObj.name, - type: componentObj.type - }) - } - const component = componentObj.path - if (!component) { - printLog(processTypeEnum.ERROR, '组件错误', `组件${_.upperFirst(_.camelCase(componentObj.name))}路径错误,请检查!(可能原因是导出的组件名不正确)`) - return { - js: '', - wxss: '', - wxml: '' - } - } - let componentShowPath = component.replace(appPath + path.sep, '') - componentShowPath = componentShowPath.split(path.sep).join('/') - if (buildAdapter === BUILD_TYPES.ALIPAY) { - componentShowPath = generateAlipayPath(componentShowPath) - } - let isComponentFromNodeModules = false - let sourceDirPath = sourceDir - let buildOutputDir = outputDir - // 来自 node_modules 的组件 - if (NODE_MODULES_REG.test(componentShowPath)) { - isComponentFromNodeModules = true - sourceDirPath = nodeModulesPath - buildOutputDir = npmOutputDir - } - let outputComponentShowPath = componentShowPath.replace(isComponentFromNodeModules ? NODE_MODULES : sourceDirName, buildConfig.outputDirName || outputDirName) - outputComponentShowPath = outputComponentShowPath.replace(extnameExpRegOf(outputComponentShowPath), '') - printLog(processTypeEnum.COMPILE, '组件文件', componentShowPath) - const componentContent = fs.readFileSync(component).toString() - let outputComponentJSPath = component.replace(sourceDirPath, buildConfig.outputDir || buildOutputDir).replace(extnameExpRegOf(component), outputFilesTypes.SCRIPT) - if (buildAdapter === BUILD_TYPES.ALIPAY) { - outputComponentJSPath = generateAlipayPath(outputComponentJSPath) - } - const outputComponentWXMLPath = outputComponentJSPath.replace(extnameExpRegOf(outputComponentJSPath), outputFilesTypes.TEMPL) - const outputComponentWXSSPath = outputComponentJSPath.replace(extnameExpRegOf(outputComponentJSPath), outputFilesTypes.STYLE) - const outputComponentJSONPath = outputComponentJSPath.replace(extnameExpRegOf(outputComponentJSPath), outputFilesTypes.CONFIG) - - try { - const isTaroComponentRes = isFileToBeTaroComponent(componentContent, component) - const componentExportsMap = getComponentExportsMap() - if (!isTaroComponentRes.isTaroComponent) { - const transformResult = isTaroComponentRes.transformResult - const componentRealPath = parseComponentExportAst(transformResult.ast, componentObj.name as string, component, componentObj.type as string) - const realComponentObj: IComponentObj = { - path: componentRealPath, - name: componentObj.name, - type: componentObj.type - } - let isInMap = false - notTaroComponents.add(component) - if (componentExportsMap.size) { - componentExportsMap.forEach(componentExports => { - componentExports.forEach(item => { - if (item.path === component) { - isInMap = true - item.path = componentRealPath - } - }) - }) - } - if (!isInMap) { - const componentExportsMapItem = componentExportsMap.get(component) || [] - componentExportsMapItem.push(realComponentObj) - setComponentExportsMap(component, componentExportsMapItem) - } - return await buildSingleComponent(realComponentObj, buildConfig) - } - if (isComponentHasBeenBuilt(componentObj.path as string) && componentsBuildResult.get(componentObj.path as string)) { - return componentsBuildResult.get(componentObj.path as string) as IBuildResult - } - const buildResult = { - js: outputComponentJSPath, - wxss: outputComponentWXSSPath, - wxml: outputComponentWXMLPath - } - componentsBuildResult.set(component, buildResult) - const transformResult: IWxTransformResult = wxTransformer({ - code: componentContent, - sourcePath: component, - sourceDir, - outputPath: outputComponentJSPath, - isRoot: false, - isTyped: REG_TYPESCRIPT.test(component), - isNormal: false, - adapter: buildAdapter, - env: constantsReplaceList, - jsxAttributeNameReplace, - alias - }) - const componentWXMLContent = isProduction ? transformResult.compressedTemplate : transformResult.template - const componentDepComponents = transformResult.components - const res = parseAst(PARSE_AST_TYPE.COMPONENT, transformResult.ast, componentDepComponents, component, outputComponentJSPath, buildConfig.npmSkip) - let resCode = res.code - fs.ensureDirSync(path.dirname(outputComponentJSPath)) - if (!isComponentHasBeenBuilt(component)) { - setHasBeenBuiltComponents(component) - } - // 解析原生组件 - const { usingComponents = {} }: IConfig = res.configObj - if (usingComponents && !isEmptyObject(usingComponents)) { - const keys = Object.keys(usingComponents) - keys.forEach(item => { - componentDepComponents.forEach(component => { - if (_.camelCase(item) === _.camelCase(component.name)) { - delete usingComponents[item] - } - }) - }) - transfromNativeComponents(outputComponentJSONPath.replace(buildConfig.outputDir || buildOutputDir, sourceDirPath), res.configObj) - } - let realComponentsPathList: IComponentObj[] = [] - realComponentsPathList = getRealComponentsPathList(component, componentDepComponents) - - if (!isQuickApp) { - resCode = await compileScriptFile(resCode, component, outputComponentJSPath, buildAdapter) - if (isProduction) { - resCode = uglifyJS(resCode, component, appPath, projectConfig!.plugins!.uglify as TogglableOptions) - } - } else { - // 快应用编译,搜集创建组件 ux 文件 - const importTaroSelfComponents = getImportTaroSelfComponents(outputComponentJSPath, res.taroSelfComponents) - const importCustomComponents = new Set(realComponentsPathList.map(item => { - return { - path: promoteRelativePath(path.relative(component, item.path as string)).replace(extnameExpRegOf(item.path as string), ''), - name: item.name as string - } - })) - const usingComponents = res.configObj.usingComponents - let importUsingComponent: any = new Set([]) - if (usingComponents) { - importUsingComponent = new Set(Object.keys(usingComponents).map(item => { - return { - name: item, - path: usingComponents[item] - } - })) - } - let styleRelativePath - if (res.styleFiles.length) { - styleRelativePath = promoteRelativePath(path.relative(outputComponentJSPath, outputComponentWXSSPath)) - } - const uxTxt = generateQuickAppUx({ - script: resCode, - style: styleRelativePath, - imports: new Set([...importTaroSelfComponents, ...importCustomComponents, ...importUsingComponent]), - template: componentWXMLContent - }) - fs.writeFileSync(outputComponentWXMLPath, uxTxt) - printLog(processTypeEnum.GENERATE, '组件文件', `${outputComponentShowPath}${outputFilesTypes.TEMPL}`) - } - - const dependencyTree = getDependencyTree() - const fileDep = dependencyTree.get(component) || { - style: [], - script: [], - json: [], - media: [] - } - // 编译依赖的组件文件 - if (realComponentsPathList.length) { - res.scriptFiles = res.scriptFiles.map(item => { - for (let i = 0; i < realComponentsPathList.length; i++) { - const componentObj = realComponentsPathList[i] - const componentPath = componentObj.path - if (item === componentPath) { - return '' - } - } - return item - }).filter(item => item) - realComponentsPathList = realComponentsPathList.filter(item => !isComponentHasBeenBuilt(item.path as string) || notTaroComponents.has(item.path as string)) - await buildDepComponents(realComponentsPathList, buildConfig) - } - if (componentExportsMap.size && realComponentsPathList.length) { - realComponentsPathList.forEach(componentObj => { - if (componentExportsMap.has(componentObj.path as string)) { - const componentMap = componentExportsMap.get(componentObj.path as string) - componentMap && componentMap.forEach(componentObj => { - componentDepComponents.forEach(depComponent => { - if (depComponent.name === componentObj.name) { - let componentPath = componentObj.path - let realPath - if (NODE_MODULES_REG.test(componentPath as string)) { - componentPath = (componentPath as string).replace(nodeModulesPath, npmOutputDir) - realPath = promoteRelativePath(path.relative(outputComponentJSPath, componentPath)) - } else { - realPath = promoteRelativePath(path.relative(component, (componentPath as string))) - } - depComponent.path = realPath.replace(extnameExpRegOf(realPath), '') - } - }) - }) - } - }) - } - if (!isQuickApp) { - fs.writeFileSync(outputComponentJSONPath, JSON.stringify(_.merge({}, buildUsingComponents(component, componentDepComponents, true), res.configObj), null, 2)) - printLog(processTypeEnum.GENERATE, '组件配置', `${outputDirName}/${outputComponentShowPath}${outputFilesTypes.CONFIG}`) - fs.writeFileSync(outputComponentJSPath, resCode) - printLog(processTypeEnum.GENERATE, '组件逻辑', `${outputDirName}/${outputComponentShowPath}${outputFilesTypes.SCRIPT}`) - fs.writeFileSync(outputComponentWXMLPath, componentWXMLContent) - processNativeWxml(outputComponentWXMLPath.replace(outputDir, sourceDir), componentWXMLContent, outputComponentWXMLPath) - printLog(processTypeEnum.GENERATE, '组件模板', `${outputDirName}/${outputComponentShowPath}${outputFilesTypes.TEMPL}`) - } - // 编译依赖的脚本文件 - if (isDifferentArray(fileDep['script'], res.scriptFiles)) { - await compileDepScripts(res.scriptFiles, !isQuickApp) - } - const depComponents = getDepComponents() - // 编译样式文件 - if (isDifferentArray(fileDep['style'], res.styleFiles) || isDifferentArray(depComponents.get(component) || [], componentDepComponents)) { - printLog(processTypeEnum.GENERATE, '组件样式', `${outputDirName}/${outputComponentShowPath}${outputFilesTypes.STYLE}`) - await compileDepStyles(outputComponentWXSSPath, res.styleFiles) - } - // 拷贝依赖文件 - if (isDifferentArray(fileDep['json'], res.jsonFiles)) { - copyFilesFromSrcToOutput(res.jsonFiles) - } - if (isDifferentArray(fileDep['media'], res.mediaFiles)) { - copyFilesFromSrcToOutput(res.mediaFiles) - } - fileDep['style'] = res.styleFiles - fileDep['script'] = res.scriptFiles - fileDep['json'] = res.jsonFiles - fileDep['media'] = res.mediaFiles - dependencyTree.set(component, fileDep) - depComponents.set(component, componentDepComponents) - - return buildResult - } catch (err) { - printLog(processTypeEnum.ERROR, '组件编译', `组件${componentShowPath}编译失败!`) - if (!isComponentHasBeenBuilt(component)) { - setHasBeenBuiltComponents(component) - } - console.log(err) - return { - js: '', - wxss: '', - wxml: '' - } - } -} diff --git a/packages/taro-cli/src/mini/constants.ts b/packages/taro-cli/src/mini/constants.ts deleted file mode 100644 index 572b8a827ed4..000000000000 --- a/packages/taro-cli/src/mini/constants.ts +++ /dev/null @@ -1,6 +0,0 @@ - -export const QUICKAPP_SPECIAL_COMPONENTS = new Set([ - 'View', - 'Text', - 'Block' -]) diff --git a/packages/taro-cli/src/mini/entry.ts b/packages/taro-cli/src/mini/entry.ts deleted file mode 100644 index 4c7842cca495..000000000000 --- a/packages/taro-cli/src/mini/entry.ts +++ /dev/null @@ -1,198 +0,0 @@ -import * as fs from 'fs-extra' -import * as path from 'path' - -import { AppConfig } from '@tarojs/taro' -import wxTransformer from '@tarojs/transformer-wx' - -import { - REG_SCRIPTS, - REG_TYPESCRIPT, - CONFIG_MAP, - processTypeEnum, - PARSE_AST_TYPE, - BUILD_TYPES -} from '../util/constants' -import { - isDifferentArray, - printLog, - isEmptyObject, - resolveScriptPath, - promoteRelativePath, - generateQuickAppUx, - uglifyJS -} from '../util' -import { IWxTransformResult, TogglableOptions } from '../util/types' - -import { getBuildData, copyFilesFromSrcToOutput, getDependencyTree } from './helper' -import { compileDepScripts, compileScriptFile } from './compileScript' -import { compileDepStyles } from './compileStyle' -import { parseAst } from './astProcess' -import { buildSingleComponent } from './component' - -async function buildCustomTabbar () { - const { - sourceDir - } = getBuildData() - const customTabbarPath = path.join(sourceDir, 'custom-tab-bar') - const customTabbarJSPath = resolveScriptPath(customTabbarPath) - await buildSingleComponent({ - path: customTabbarJSPath, - name: 'custom-tab-bar' - }) -} - -function buildWorkers (worker: string) { - const { - sourceDir - } = getBuildData() - printLog(processTypeEnum.COMPILE, 'Workers', '编译 worker 相关文件') - const workerDir = path.join(sourceDir, worker) - function fileRecursiveSearch (fileDir) { - fs.readdir(fileDir, (err, files) => { - if (err) { - console.warn(err) - } else { - files.forEach(filename => { - const filePath = path.join(fileDir, filename) - fs.stat(filePath, async (err, stats) => { - if (err) { - console.warn(err) - } else { - const isFile = stats.isFile() - const isDir = stats.isDirectory() - if (isFile) { - if (REG_SCRIPTS.test(filePath)) { - await compileDepScripts([filePath], true) - } else { - copyFilesFromSrcToOutput([filePath]) - } - } else if (isDir) { - fileRecursiveSearch(filePath) - } - } - }) - }) - } - }) - } - fileRecursiveSearch(workerDir) -} - -export async function buildEntry (): Promise { - const { - appPath, - buildAdapter, - constantsReplaceList, - entryFilePath, - sourceDir, - outputDir, - entryFileName, - sourceDirName, - outputDirName, - projectConfig, - outputFilesTypes, - isProduction, - jsxAttributeNameReplace - } = getBuildData() - const weappConf = projectConfig.weapp || { appOutput: true} - const appOutput = typeof weappConf.appOutput === 'boolean' ? weappConf.appOutput : true - const entryFileCode = fs.readFileSync(entryFilePath).toString() - const outputEntryFilePath = path.join(outputDir, entryFileName) - - printLog(processTypeEnum.COMPILE, '入口文件', `${sourceDirName}/${entryFileName}`) - try { - const transformResult: IWxTransformResult = wxTransformer({ - code: entryFileCode, - sourcePath: entryFilePath, - isApp: true, - isTyped: REG_TYPESCRIPT.test(entryFilePath), - adapter: buildAdapter, - env: constantsReplaceList, - jsxAttributeNameReplace - }) - // app.js的template忽略 - const res = parseAst(PARSE_AST_TYPE.ENTRY, transformResult.ast, [], entryFilePath, outputEntryFilePath) - let resCode = res.code - if (buildAdapter !== BUILD_TYPES.QUICKAPP) { - resCode = await compileScriptFile(resCode, entryFilePath, outputEntryFilePath, buildAdapter) - if (isProduction) { - resCode = uglifyJS(resCode, entryFilePath, appPath, projectConfig!.plugins!.uglify as TogglableOptions) - } - } - // 处理res.configObj 中的tabBar配置 - const tabBar = res.configObj.tabBar - if (tabBar && typeof tabBar === 'object' && !isEmptyObject(tabBar)) { - const { - list: listConfig, - iconPath: pathConfig, - selectedIconPath: selectedPathConfig - } = CONFIG_MAP[buildAdapter] - const list = tabBar[listConfig] || [] - let tabBarIcons: string[] = [] - list.forEach(item => { - item[pathConfig] && tabBarIcons.push(item[pathConfig]) - item[selectedPathConfig] && tabBarIcons.push(item[selectedPathConfig]) - }) - tabBarIcons = tabBarIcons.map(item => path.resolve(sourceDir, item)) - if (tabBarIcons && tabBarIcons.length) { - res.mediaFiles = res.mediaFiles.concat(tabBarIcons) - } - } - if (buildAdapter === BUILD_TYPES.QUICKAPP) { - // 生成 快应用 ux 文件 - const styleRelativePath = promoteRelativePath(path.relative(outputEntryFilePath, path.join(outputDir, `app${outputFilesTypes.STYLE}`))) - const uxTxt = generateQuickAppUx({ - script: resCode, - style: styleRelativePath - }) - fs.writeFileSync(path.join(outputDir, `app${outputFilesTypes.TEMPL}`), uxTxt) - printLog(processTypeEnum.GENERATE, '入口文件', `${outputDirName}/app${outputFilesTypes.TEMPL}`) - } else { - if (res.configObj.workers) { - buildWorkers(res.configObj.workers) - } - if (res.configObj.tabBar && res.configObj.tabBar.custom) { - await buildCustomTabbar() - } - if (appOutput) { - fs.writeFileSync(path.join(outputDir, 'app.json'), JSON.stringify(res.configObj, null, 2)) - printLog(processTypeEnum.GENERATE, '入口配置', `${outputDirName}/app.json`) - fs.writeFileSync(path.join(outputDir, 'app.js'), resCode) - printLog(processTypeEnum.GENERATE, '入口文件', `${outputDirName}/app.js`) - } - } - const dependencyTree = getDependencyTree() - const fileDep = dependencyTree.get(entryFilePath) || { - style: [], - script: [], - json: [], - media: [] - } - // 编译依赖的脚本文件 - if (isDifferentArray(fileDep['script'], res.scriptFiles)) { - await compileDepScripts(res.scriptFiles, buildAdapter !== BUILD_TYPES.QUICKAPP) - } - // 编译样式文件 - if (isDifferentArray(fileDep['style'], res.styleFiles) && appOutput) { - await compileDepStyles(path.join(outputDir, `app${outputFilesTypes.STYLE}`), res.styleFiles) - printLog(processTypeEnum.GENERATE, '入口样式', `${outputDirName}/app${outputFilesTypes.STYLE}`) - } - // 拷贝依赖文件 - if (isDifferentArray(fileDep['json'], res.jsonFiles)) { - copyFilesFromSrcToOutput(res.jsonFiles) - } - - if (isDifferentArray(fileDep['media'], res.mediaFiles)) { - copyFilesFromSrcToOutput(res.mediaFiles) - } - fileDep['style'] = res.styleFiles - fileDep['script'] = res.scriptFiles - fileDep['json'] = res.jsonFiles - fileDep['media'] = res.mediaFiles - dependencyTree.set(entryFilePath, fileDep) - return res.configObj - } catch (err) { - console.log(err) - return {} - } -} diff --git a/packages/taro-cli/src/mini/helper.ts b/packages/taro-cli/src/mini/helper.ts index f2ba9387a725..e99a5f5aa708 100644 --- a/packages/taro-cli/src/mini/helper.ts +++ b/packages/taro-cli/src/mini/helper.ts @@ -3,6 +3,7 @@ import * as path from 'path' import * as _ from 'lodash' import { Config } from '@tarojs/taro' +import { IProjectConfig } from '@tarojs/taro/types/compile' import wxTransformer from '@tarojs/transformer-wx' import getHashName from '../util/hash' @@ -37,10 +38,8 @@ import { resolveNpmPkgMainPath } from '../util/resolve_npm_files' import { resolveNpmSync } from '../util/npm' import { - IProjectConfig, IOption, INpmConfig, - IWxTransformResult, ITaroManifestConfig } from '../util/types' import CONFIG from '../config' @@ -90,7 +89,7 @@ export interface IBuildData { let BuildData: IBuildData export const shouldTransformAgain = function () { - const babelConfig = getBabelConfig(BuildData.projectConfig!.plugins!.babel) + const babelConfig = getBabelConfig(BuildData.projectConfig!.babel) const pluginsStr = JSON.stringify(babelConfig.plugins) if (/transform-runtime/.test(pluginsStr)) { return true @@ -373,7 +372,7 @@ export function getImportTaroSelfComponents (filePath, taroSelfComponents) { const match = SCRIPT_CONTENT_REG.exec(fileContent) if (match) { const scriptContent = match[1] - const transformResult: IWxTransformResult = wxTransformer({ + const transformResult = wxTransformer({ code: scriptContent, sourcePath: sourceFilePath, isNormal: true, diff --git a/packages/taro-cli/src/mini/interface.ts b/packages/taro-cli/src/mini/interface.ts deleted file mode 100644 index 54d9505bd70d..000000000000 --- a/packages/taro-cli/src/mini/interface.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IWxTransformResult } from '../util/types' - -export interface IComponentObj { - name?: string, - path: string | null, - type?: string -} - -export interface IIsFileToBeTaroComponentReturn { - isTaroComponent: boolean, - transformResult: IWxTransformResult -} - -export interface IBuildResult { - js: string, - wxss: string, - wxml: string -} - -export interface IDependency { - style: string[], - script: string[], - json: string[], - media: string[] -} diff --git a/packages/taro-cli/src/mini/native.ts b/packages/taro-cli/src/mini/native.ts deleted file mode 100644 index 992eb567b9ae..000000000000 --- a/packages/taro-cli/src/mini/native.ts +++ /dev/null @@ -1,144 +0,0 @@ -import * as fs from 'fs-extra' -import * as path from 'path' - -import { Config as IConfig } from '@tarojs/taro' -import chalk from 'chalk' - -import { REG_WXML_IMPORT, processTypeEnum, taroJsFramework, BUILD_TYPES, REG_SCRIPT, REG_STYLE, REG_UX, NODE_MODULES_REG } from '../util/constants' -import { isEmptyObject, printLog, resolveScriptPath, copyFileSync, extnameExpRegOf, resolveQuickappFilePath, processUxContent } from '../util' -import CONFIG from '../config'; - -import { buildDepComponents } from './component' -import { compileDepScripts } from './compileScript' -import { compileDepStyles } from './compileStyle' -import { getBuildData } from './helper' - -export function processNativeWxml ( - componentWXMLPath: string, - componentWXMLContent: string | null, - outputComponentWXMLPath: string -) { - let wxmlContent - let needCopy = true - const { sourceDir, outputDir } = getBuildData() - if (componentWXMLPath && fs.existsSync(componentWXMLPath)) { - wxmlContent = fs.readFileSync(componentWXMLPath).toString() - } else { - needCopy = false - wxmlContent = componentWXMLContent - } - const importWxmlPathList: string[] = [] - let regResult - while ((regResult = REG_WXML_IMPORT.exec(wxmlContent)) != null) { - importWxmlPathList.push(regResult[2] || regResult[3]) - } - if (importWxmlPathList.length) { - importWxmlPathList.forEach(item => { - const itemPath = path.resolve(componentWXMLPath, '..', item) - if (fs.existsSync(itemPath)) { - const outputItemPath = itemPath.replace(sourceDir, outputDir) - processNativeWxml(itemPath, null, outputItemPath) - } - }) - } - if (componentWXMLPath === outputComponentWXMLPath || !needCopy) { - return - } - copyFileSync(componentWXMLPath, outputComponentWXMLPath) -} - -function transformNativeQuickappComponent (configFile, componentPath) { - const { sourceDir, outputDir } = getBuildData() - - let componentUxPath = resolveQuickappFilePath(path.resolve(path.dirname(configFile), componentPath)) - if (!fs.existsSync(componentUxPath)) { - componentUxPath = resolveQuickappFilePath(path.join(sourceDir, componentPath)) - } - if (!fs.existsSync(componentUxPath)) { - return printLog(processTypeEnum.ERROR, '编译错误', `原生组件文件 ${componentUxPath} 不存在!`) - } - let componentStr = fs.readFileSync(componentUxPath).toString() - componentStr = processUxContent(componentStr, value => { - value = value.replace(/\'?\"?/ig, '') - if (REG_SCRIPT.test(value) || REG_STYLE.test(value)) { - const filePath = path.resolve(componentUxPath, '..', value) - const outputFilePath = filePath.replace(sourceDir, outputDir) - copyFileSync(filePath, outputFilePath) - } else if (REG_UX.test(value)) { - const importComponentPath = path.resolve(componentUxPath, '..', value) - transformNativeQuickappComponent(configFile, importComponentPath) - } - return value - }) - const outputComponentUxPath = componentUxPath.replace(sourceDir, outputDir) - copyFileSync(componentUxPath, outputComponentUxPath) -} - -export function transfromNativeComponents (configFile: string, componentConfig: IConfig) { - const { sourceDir, outputDir, outputFilesTypes, buildAdapter } = getBuildData() - const usingComponents = componentConfig.usingComponents - if (usingComponents && !isEmptyObject(usingComponents)) { - if (buildAdapter === BUILD_TYPES.QUICKAPP) { - Object.keys(usingComponents).map(async item => { - const componentPath = usingComponents[item] - transformNativeQuickappComponent(configFile, componentPath) - }) - } else { - Object.keys(usingComponents).map(async item => { - const componentPath = usingComponents[item] - if (/^plugin:\/\//.test(componentPath)) { - // 小程序 plugin - printLog(processTypeEnum.REFERENCE, '插件引用', `使用了插件 ${chalk.bold(componentPath)}`) - return - } - let componentJSPath = resolveScriptPath(path.resolve(path.dirname(configFile), componentPath)) - if (!fs.existsSync(componentJSPath)) { - componentJSPath = resolveScriptPath(path.join(sourceDir, componentPath)) - } - const componentJSONPath = componentJSPath.replace(extnameExpRegOf(componentJSPath), outputFilesTypes.CONFIG) - const componentWXMLPath = componentJSPath.replace(extnameExpRegOf(componentJSPath), outputFilesTypes.TEMPL) - const componentWXSSPath = componentJSPath.replace(extnameExpRegOf(componentJSPath), outputFilesTypes.STYLE) - let outputComponentJSPath = ''; - if (NODE_MODULES_REG.test(outputComponentJSPath)) { - outputComponentJSPath = componentJSPath.replace(NODE_MODULES_REG, path.resolve(outputDir, CONFIG.NPM_DIR)).replace(extnameExpRegOf(componentJSPath), outputFilesTypes.SCRIPT) - } else { - outputComponentJSPath = componentJSPath.replace(sourceDir, outputDir).replace(extnameExpRegOf(componentJSPath), outputFilesTypes.SCRIPT) - } - if (fs.existsSync(componentJSPath)) { - const componentJSContent = fs.readFileSync(componentJSPath).toString() - if (componentJSContent.indexOf(taroJsFramework) >= 0 && !fs.existsSync(componentWXMLPath)) { - const buildDepComponentsRes = await buildDepComponents([{ path: componentJSPath, name: item, type: 'default' }]) - return buildDepComponentsRes - } - await compileDepScripts([componentJSPath], true) - } else { - return printLog(processTypeEnum.ERROR, '编译错误', `原生组件文件 ${componentJSPath} 不存在!`) - } - if (fs.existsSync(componentWXMLPath)) { - const outputComponentWXMLPath = outputComponentJSPath.replace(extnameExpRegOf(outputComponentJSPath), outputFilesTypes.TEMPL) - processNativeWxml(componentWXMLPath, null, outputComponentWXMLPath) - } - if (fs.existsSync(componentWXSSPath)) { - const outputComponentWXSSPath = outputComponentJSPath.replace(extnameExpRegOf(outputComponentJSPath), outputFilesTypes.STYLE) - await compileDepStyles(outputComponentWXSSPath, [componentWXSSPath]) - } - if (fs.existsSync(componentJSONPath)) { - const componentJSON = require(componentJSONPath) - const outputComponentJSONPath = outputComponentJSPath.replace(extnameExpRegOf(outputComponentJSPath), outputFilesTypes.CONFIG) - copyFileSync(componentJSONPath, outputComponentJSONPath) - - // 解决组件循环依赖不断编译爆栈的问题 - if (componentJSON && componentJSON.usingComponents) { - Object.keys(componentJSON.usingComponents).forEach(key => { - if (key === item) { - delete componentJSON.usingComponents[key] - } - }) - } - - transfromNativeComponents(componentJSONPath, componentJSON) - } - }) - } - } -} diff --git a/packages/taro-cli/src/mini/page.ts b/packages/taro-cli/src/mini/page.ts deleted file mode 100644 index 845f2fa4494a..000000000000 --- a/packages/taro-cli/src/mini/page.ts +++ /dev/null @@ -1,305 +0,0 @@ -import * as fs from 'fs-extra' -import * as path from 'path' - -import { Config as IConfig } from '@tarojs/taro' -import wxTransformer from '@tarojs/transformer-wx' -import * as _ from 'lodash' - -import { - REG_TYPESCRIPT, - processTypeEnum, - NODE_MODULES_REG, - PARSE_AST_TYPE, - taroJsFramework, - BUILD_TYPES -} from '../util/constants' -import { - resolveScriptPath, - printLog, - isEmptyObject, - promoteRelativePath, - isDifferentArray, - copyFileSync, - generateQuickAppUx, - uglifyJS, - extnameExpRegOf -} from '../util' -import { IWxTransformResult, TogglableOptions } from '../util/types' - -import { IComponentObj } from './interface' -import { - getBuildData, - getRealComponentsPathList, - buildUsingComponents, - copyFilesFromSrcToOutput, - getDependencyTree, - getComponentExportsMap, - getDepComponents, - getImportTaroSelfComponents -} from './helper' -import { compileDepScripts, compileScriptFile } from './compileScript' -import { compileDepStyles } from './compileStyle' -import { transfromNativeComponents, processNativeWxml } from './native' -import { buildDepComponents } from './component' -import { parseAst } from './astProcess' -import rewriterTemplate from '../quickapp/template-rewriter' - -// 小程序页面编译 -export async function buildSinglePage (page: string) { - const { - appPath, - buildAdapter, - constantsReplaceList, - outputDir, - sourceDirName, - outputDirName, - sourceDir, - isProduction, - outputFilesTypes, - nodeModulesPath, - npmOutputDir, - jsxAttributeNameReplace, - pageConfigs, - appConfig, - projectConfig, - alias - } = getBuildData() - const pagePath = path.join(sourceDir, `${page}`) - const pageJs = resolveScriptPath(pagePath) - const dependencyTree = getDependencyTree() - const depComponents = getDepComponents() - const isQuickApp = buildAdapter === BUILD_TYPES.QUICKAPP - - printLog(processTypeEnum.COMPILE, '页面文件', `${sourceDirName}/${page}`) - if (!fs.existsSync(pageJs) || !fs.statSync(pageJs).isFile()) { - printLog(processTypeEnum.ERROR, '页面文件', `${sourceDirName}/${page} 不存在!`) - return - } - const pageJsContent = fs.readFileSync(pageJs).toString() - const outputPageJSPath = pageJs.replace(sourceDir, outputDir).replace(extnameExpRegOf(pageJs), outputFilesTypes.SCRIPT) - const outputPagePath = path.dirname(outputPageJSPath) - const outputPageJSONPath = outputPageJSPath.replace(extnameExpRegOf(outputPageJSPath), outputFilesTypes.CONFIG) - const outputPageWXMLPath = outputPageJSPath.replace(extnameExpRegOf(outputPageJSPath), outputFilesTypes.TEMPL) - const outputPageWXSSPath = outputPageJSPath.replace(extnameExpRegOf(outputPageJSPath), outputFilesTypes.STYLE) - // 判断是不是小程序原生代码页面 - const pageWXMLPath = pageJs.replace(extnameExpRegOf(pageJs), outputFilesTypes.TEMPL) - if (fs.existsSync(pageWXMLPath) && pageJsContent.indexOf(taroJsFramework) < 0) { - const pageJSONPath = pageJs.replace(extnameExpRegOf(pageJs), outputFilesTypes.CONFIG) - const pageWXSSPath = pageJs.replace(extnameExpRegOf(pageJs), outputFilesTypes.STYLE) - if (fs.existsSync(pageJSONPath)) { - const pageJSON = require(pageJSONPath) - copyFileSync(pageJSONPath, outputPageJSONPath) - transfromNativeComponents(pageJSONPath, pageJSON) - } - await compileDepScripts([pageJs], true) - copyFileSync(pageWXMLPath, outputPageWXMLPath) - if (fs.existsSync(pageWXSSPath)) { - await compileDepStyles(outputPageWXSSPath, [pageWXSSPath]) - } - return - } - try { - const rootProps: { [key: string]: any } = {} - if (isQuickApp) { - // 如果是快应用,需要提前解析一次 ast,获取 config - const aheadTransformResult: IWxTransformResult = wxTransformer({ - code: pageJsContent, - sourcePath: pageJs, - isRoot: true, - isTyped: REG_TYPESCRIPT.test(pageJs), - adapter: buildAdapter, - env: constantsReplaceList, - alias - }) - const res = parseAst(PARSE_AST_TYPE.PAGE, aheadTransformResult.ast, [], pageJs, outputPageJSPath) - if (res.configObj.enablePullDownRefresh || (appConfig.window && appConfig.window.enablePullDownRefresh)) { - rootProps.enablePullDownRefresh = true - } - if (appConfig.tabBar) { - rootProps.tabBar = appConfig.tabBar - } - rootProps.pagePath = /^\//.test(page) ? page : `/${page}` - if (res.hasEnablePageScroll) { - rootProps.enablePageScroll = true - } - } - const transformResult: IWxTransformResult = wxTransformer({ - code: pageJsContent, - sourcePath: pageJs, - sourceDir, - outputPath: outputPageJSPath, - isRoot: true, - isTyped: REG_TYPESCRIPT.test(pageJs), - adapter: buildAdapter, - env: constantsReplaceList, - rootProps, - jsxAttributeNameReplace, - alias - }) - const pageDepComponents = transformResult.components - const pageWXMLContent = isProduction ? transformResult.compressedTemplate : transformResult.template - const res = parseAst(PARSE_AST_TYPE.PAGE, transformResult.ast, pageDepComponents, pageJs, outputPageJSPath) - let resCode = res.code - fs.ensureDirSync(outputPagePath) - pageConfigs.set(page, res.configObj) - // 解析原生组件 - const { usingComponents = {} }: IConfig = res.configObj - if (usingComponents && !isEmptyObject(usingComponents)) { - const keys = Object.keys(usingComponents) - keys.forEach(item => { - pageDepComponents.forEach(component => { - if (_.camelCase(item) === _.camelCase(component.name)) { - delete usingComponents[item] - } - }) - }) - transfromNativeComponents(outputPageJSONPath.replace(outputDir, sourceDir), res.configObj) - } - - let realComponentsPathList: IComponentObj[] = [] - realComponentsPathList = getRealComponentsPathList(pageJs, pageDepComponents) - - if (!isQuickApp) { - resCode = await compileScriptFile(resCode, pageJs, outputPageJSPath, buildAdapter) - if (isProduction) { - resCode = uglifyJS(resCode, pageJs, appPath, projectConfig!.plugins!.uglify as TogglableOptions) - } - } - // 编译依赖的组件文件 - if (realComponentsPathList.length) { - res.scriptFiles = res.scriptFiles.map(item => { - for (let i = 0; i < realComponentsPathList.length; i++) { - const componentObj = realComponentsPathList[i] - const componentPath = componentObj.path - if (item === componentPath) { - return '' - } - } - return item - }).filter(item => item) - await buildDepComponents(realComponentsPathList) - } - const componentExportsMap = getComponentExportsMap() - if (componentExportsMap.size && realComponentsPathList.length) { - realComponentsPathList.forEach(component => { - if (componentExportsMap.has(component.path as string)) { - const componentMap = componentExportsMap.get(component.path as string) - componentMap && componentMap.forEach(component => { - pageDepComponents.forEach(depComponent => { - if (depComponent.name === component.name) { - let componentPath = component.path - let realPath - if (NODE_MODULES_REG.test(componentPath as string)) { - componentPath = (componentPath as string).replace(nodeModulesPath, npmOutputDir) - realPath = promoteRelativePath(path.relative(outputPageJSPath, componentPath)) - } else { - realPath = promoteRelativePath(path.relative(pageJs, componentPath as string)) - } - depComponent.path = realPath.replace(extnameExpRegOf(realPath), '') - } - }) - }) - } - }) - } - if (isQuickApp) { - // 快应用编译,搜集创建页面 ux 文件 - const importTaroSelfComponents = getImportTaroSelfComponents(outputPageJSPath, res.taroSelfComponents) - const importCustomComponents = new Set(pageDepComponents.map(item => { - return { - path: item.path, - name: item.name as string - } - })) - const usingComponents = res.configObj.usingComponents - let importUsingComponent: any = new Set([]) - if (usingComponents) { - importUsingComponent = new Set(Object.keys(usingComponents).map(item => { - return { - name: item, - path: usingComponents[item] - } - })) - } - // 生成页面 ux 文件 - let styleRelativePath - if (res.styleFiles.length) { - styleRelativePath = promoteRelativePath(path.relative(outputPageJSPath, outputPageWXSSPath)) - } - const uxTxt = generateQuickAppUx({ - script: resCode, - style: styleRelativePath, - imports: new Set([...importTaroSelfComponents, ...importCustomComponents, ...importUsingComponent]), - template: rewriterTemplate(pageWXMLContent) - }) - fs.writeFileSync(outputPageWXMLPath, uxTxt) - printLog(processTypeEnum.GENERATE, '页面文件', `${outputDirName}/${page}${outputFilesTypes.TEMPL}`) - } - const fileDep = dependencyTree.get(pageJs) || { - style: [], - script: [], - json: [], - media: [] - } - if (!isQuickApp) { - fs.writeFileSync(outputPageJSONPath, JSON.stringify(_.merge({}, buildUsingComponents(pageJs, pageDepComponents), res.configObj), null, 2)) - printLog(processTypeEnum.GENERATE, '页面配置', `${outputDirName}/${page}${outputFilesTypes.CONFIG}`) - fs.writeFileSync(outputPageJSPath, resCode) - printLog(processTypeEnum.GENERATE, '页面逻辑', `${outputDirName}/${page}${outputFilesTypes.SCRIPT}`) - fs.writeFileSync(outputPageWXMLPath, pageWXMLContent) - processNativeWxml(outputPageWXMLPath.replace(outputDir, sourceDir), pageWXMLContent, outputPageWXMLPath) - printLog(processTypeEnum.GENERATE, '页面模板', `${outputDirName}/${page}${outputFilesTypes.TEMPL}`) - } - // 编译依赖的脚本文件 - if (isDifferentArray(fileDep['script'], res.scriptFiles)) { - await compileDepScripts(res.scriptFiles, !isQuickApp) - } - // 编译样式文件 - if (isDifferentArray(fileDep['style'], res.styleFiles) || isDifferentArray(depComponents.get(pageJs) || [], pageDepComponents)) { - printLog(processTypeEnum.GENERATE, '页面样式', `${outputDirName}/${page}${outputFilesTypes.STYLE}`) - await compileDepStyles(outputPageWXSSPath, res.styleFiles) - } - // 拷贝依赖文件 - if (isDifferentArray(fileDep['json'], res.jsonFiles)) { - copyFilesFromSrcToOutput(res.jsonFiles) - } - if (isDifferentArray(fileDep['media'], res.mediaFiles)) { - copyFilesFromSrcToOutput(res.mediaFiles) - } - depComponents.set(pageJs, pageDepComponents) - fileDep['style'] = res.styleFiles - fileDep['script'] = res.scriptFiles - fileDep['json'] = res.jsonFiles - fileDep['media'] = res.mediaFiles - dependencyTree.set(pageJs, fileDep) - } catch (err) { - printLog(processTypeEnum.ERROR, '页面编译', `页面${pagePath}编译失败!`) - console.log(err) - } -} - -export async function buildPages () { - printLog(processTypeEnum.COMPILE, '所有页面') - const { appConfig } = getBuildData() - // 支持分包,解析子包页面 - const pages = appConfig.pages || [] - const subPackages = appConfig.subPackages || appConfig['subpackages'] - if (subPackages && subPackages.length) { - subPackages.forEach(item => { - if (item.pages && item.pages.length) { - const root = item.root - item.pages.forEach(page => { - let pagePath = `${root}/${page}` - pagePath = pagePath.replace(/\/{2,}/g, '/') - if (pages.indexOf(pagePath) < 0) { - pages.push(pagePath) - } - }) - } - }) - } - const pagesPromises = pages.map(async page => { - return buildSinglePage(page) - }) - await Promise.all(pagesPromises) -} diff --git a/packages/taro-cli/src/mini/watch.ts b/packages/taro-cli/src/mini/watch.ts deleted file mode 100644 index 756ede467c9c..000000000000 --- a/packages/taro-cli/src/mini/watch.ts +++ /dev/null @@ -1,207 +0,0 @@ -import * as path from 'path' - -import * as chokidar from 'chokidar' -import chalk from 'chalk' - -import { - REG_TYPESCRIPT, - REG_SCRIPT, - REG_STYLE, - processTypeEnum, - NODE_MODULES_REG, - isWindows, - BUILD_TYPES -} from '../util/constants' -import { - printLog, - checksum, - extnameExpRegOf -} from '../util' - -import { initCompileStyles, compileDepStyles } from './compileStyle' -import { initCompileScripts, compileDepScripts } from './compileScript' -import { - initCopyFiles, - getBuildData, - setAppConfig, - isComponentHasBeenBuilt, - deleteHasBeenBuiltComponent, - copyFilesFromSrcToOutput, - getDependencyTree, - isFileToBePage -} from './helper' -import { buildEntry } from './entry' -import { buildPages, buildSinglePage } from './page' -import { buildSingleComponent, getComponentsNamedMap } from './component' - -export function watchFiles () { - console.log() - console.log(chalk.gray('监听文件修改中...')) - console.log() - initCompileStyles() - initCompileScripts() - initCopyFiles() - const { - sourceDir, - outputDir, - sourceDirName, - projectConfig, - outputFilesTypes, - appConfig, - nodeModulesPath, - npmOutputDir, - entryFileName, - entryFilePath, - buildAdapter, - appPath - } = getBuildData() - const dependencyTree = getDependencyTree() - const isQuickApp = buildAdapter === BUILD_TYPES.QUICKAPP - const watcherPaths = [path.join(sourceDir)].concat(projectConfig.watcher || []) - const watcher = chokidar.watch(watcherPaths, { - ignored: /(^|[/\\])\../, - persistent: true, - ignoreInitial: true - }) - watcher - .on('addDir', dirPath => { - console.log(dirPath) - }) - .on('add', filePath => { - console.log(filePath) - }) - .on('change', async filePath => { - const extname = path.extname(filePath) - const componentsNamedMap = getComponentsNamedMap() - // 编译JS文件 - if (REG_SCRIPT.test(extname) || REG_TYPESCRIPT.test(extname)) { - if (entryFilePath === filePath) { - printLog(processTypeEnum.MODIFY, '入口文件', `${sourceDirName}/${entryFileName}.js`) - const config = await buildEntry() - // TODO 此处待优化 - if ((checksum(JSON.stringify(config.pages)) !== checksum(JSON.stringify(appConfig.pages))) || - (checksum(JSON.stringify(config.subPackages || config['subpackages'] || {})) !== checksum(JSON.stringify(appConfig.subPackages || appConfig['subpackages'] || {})))) { - setAppConfig(config) - await buildPages() - } - } else { - const filePathWithoutExt = filePath.replace(extname, '') - if (isFileToBePage(filePath)) { // 编译页面 - filePath = filePathWithoutExt - filePath = filePath.replace(path.join(sourceDir) + path.sep, '') - filePath = filePath.split(path.sep).join('/') - printLog(processTypeEnum.MODIFY, '页面文件', `${sourceDirName}/${filePath}`) - await buildSinglePage(filePath) - } else if (isComponentHasBeenBuilt(filePath)) { // 编译组件 - let outoutShowFilePath = filePath.replace(appPath + path.sep, '') - outoutShowFilePath = outoutShowFilePath.split(path.sep).join('/') - printLog(processTypeEnum.MODIFY, '组件文件', outoutShowFilePath) - deleteHasBeenBuiltComponent(filePath) - - if (isWindows) { - await new Promise((resolve, reject) => { - setTimeout(async () => { - await buildSingleComponent(Object.assign({ - path: filePath - }, componentsNamedMap.get(filePath))) - resolve() - }, 300) - }) - } else { - await buildSingleComponent(Object.assign({ - path: filePath - }, componentsNamedMap.get(filePath))) - } - } else { - let isImported = false - dependencyTree.forEach((dependencyTreeItem) => { - if (dependencyTreeItem) { - const scripts = dependencyTreeItem.script - if (scripts.indexOf(filePath) >= 0) { - isImported = true - } - } - }) - let modifySource = filePath.replace(appPath + path.sep, '') - modifySource = modifySource.split(path.sep).join('/') - if (isImported) { - printLog(processTypeEnum.MODIFY, 'JS文件', modifySource) - await compileDepScripts([filePath], !isQuickApp) - } else { - printLog(processTypeEnum.WARNING, 'JS文件', `${modifySource} 没有被引用到,不会被编译`) - } - } - } - } else if (REG_STYLE.test(extname)) { - const includeStyleJSPath: any[] = [] - dependencyTree.forEach((dependencyTreeItem, key) => { - const styles = dependencyTreeItem['style'] || [] - styles.forEach(item => { - if (item === filePath) { - includeStyleJSPath.push({ - filePath: key, - styles - }) - } - }) - }) - if (includeStyleJSPath.length) { - includeStyleJSPath.forEach(async item => { - let outputWXSSPath = item.filePath.replace(extnameExpRegOf(item.filePath), outputFilesTypes.STYLE) - let modifySource = outputWXSSPath.replace(appPath + path.sep, '') - modifySource = modifySource.split(path.sep).join('/') - printLog(processTypeEnum.MODIFY, '样式文件', modifySource) - if (NODE_MODULES_REG.test(outputWXSSPath)) { - outputWXSSPath = outputWXSSPath.replace(nodeModulesPath, npmOutputDir) - } else { - outputWXSSPath = outputWXSSPath.replace(sourceDir, outputDir) - } - let modifyOutput = outputWXSSPath.replace(appPath + path.sep, '') - modifyOutput = modifyOutput.split(path.sep).join('/') - if (isWindows) { - await new Promise((resolve, reject) => { - setTimeout(async () => { - await compileDepStyles(outputWXSSPath, item.styles) - resolve() - }, 300) - }) - } else { - await compileDepStyles(outputWXSSPath, item.styles) - } - printLog(processTypeEnum.GENERATE, '样式文件', modifyOutput) - }) - } else { - let outputWXSSPath = filePath.replace(extnameExpRegOf(filePath), outputFilesTypes.STYLE) - let modifySource = outputWXSSPath.replace(appPath + path.sep, '') - modifySource = modifySource.split(path.sep).join('/') - printLog(processTypeEnum.MODIFY, '样式文件', modifySource) - if (NODE_MODULES_REG.test(outputWXSSPath)) { - outputWXSSPath = outputWXSSPath.replace(nodeModulesPath, npmOutputDir) - } else { - outputWXSSPath = outputWXSSPath.replace(sourceDir, outputDir) - } - let modifyOutput = outputWXSSPath.replace(appPath + path.sep, '') - modifyOutput = modifyOutput.split(path.sep).join('/') - if (isWindows) { - await new Promise((resolve, reject) => { - setTimeout(async () => { - await compileDepStyles(outputWXSSPath, [filePath]) - resolve() - }, 300) - }) - } else { - await compileDepStyles(outputWXSSPath, [filePath]) - } - printLog(processTypeEnum.GENERATE, '样式文件', modifyOutput) - } - } else { - let modifySource = filePath.replace(appPath + path.sep, '') - modifySource = modifySource.split(path.sep).join('/') - printLog(processTypeEnum.MODIFY, '文件', modifySource) - copyFilesFromSrcToOutput([filePath]) - } - initCompileStyles() - initCompileScripts() - initCopyFiles() - }) -} diff --git a/packages/taro-cli/src/mini/webpack.ts b/packages/taro-cli/src/mini/webpack.ts deleted file mode 100644 index a4f44f207bb5..000000000000 --- a/packages/taro-cli/src/mini/webpack.ts +++ /dev/null @@ -1,58 +0,0 @@ -import * as fs from 'fs-extra' -import * as path from 'path' - -import { IMiniAppBuildConfig } from '../util/types' -import { BUILD_TYPES } from '../util/constants' -import * as npmProcess from '../util/npm' -import { getBabelConfig } from '../util' -import Builder from '../build' - -import { - setBuildData, - setIsProduction, - getBuildData -} from './helper' - -export async function build (appPath: string, { watch, adapter = BUILD_TYPES.WEAPP, envHasBeenSet = false, port, release }: IMiniAppBuildConfig, builder: Builder) { - const buildData = setBuildData(appPath, adapter) - process.env.TARO_ENV = adapter - if (!envHasBeenSet) { - setIsProduction(process.env.NODE_ENV === 'production' || !watch) - } - fs.ensureDirSync(buildData.outputDir) - - await buildWithWebpack({ - appPath - }, builder) -} - -async function buildWithWebpack ({ appPath }: { appPath: string }, builder) { - const { - entryFilePath, - buildAdapter, - projectConfig, - isProduction, - alias - } = getBuildData() - const miniRunner = await npmProcess.getNpmPkg('@tarojs/mini-runner', appPath) - const babelConfig = getBabelConfig(projectConfig.babel) - const miniRunnerOpts = { - entry: { - app: entryFilePath - }, - alias, - copy: projectConfig.copy, - outputRoot: projectConfig.outputRoot, - buildAdapter, - babel: babelConfig, - csso: projectConfig.csso, - sass: projectConfig.csso, - uglify: projectConfig.uglify, - isWatch: !isProduction, - env: projectConfig.env, - defineConstants: projectConfig.defineConstants, - designWidth: projectConfig.designWidth, - deviceRatio: projectConfig.deviceRatio - } - miniRunner(appPath, miniRunnerOpts, builder) -} diff --git a/packages/taro-cli/src/util/index.ts b/packages/taro-cli/src/util/index.ts index 0c6ccf955432..556c7ba14a19 100644 --- a/packages/taro-cli/src/util/index.ts +++ b/packages/taro-cli/src/util/index.ts @@ -11,7 +11,8 @@ import * as minimatch from 'minimatch' import * as t from 'babel-types' import * as yauzl from 'yauzl' import * as findWorkspaceRoot from 'find-yarn-workspace-root' -import * as chokidar from 'chokidar'; +import * as chokidar from 'chokidar' +import { ICopyArgOptions, ICopyOptions, TogglableOptions } from '@tarojs/taro/types/compile' import defaultBabelConfig from '../config/babel' import defaultUglifyConfig from '../config/uglify' @@ -30,7 +31,6 @@ import { UX_EXT, NODE_MODULES } from './constants' -import { ICopyArgOptions, ICopyOptions, TogglableOptions } from './types' import { callPluginSync } from './npm' const execSync = child_process.execSync @@ -585,7 +585,7 @@ export function copyFiles (appPath: string, copyConfig: ICopyOptions | void) { } } copyFileSync(from, to, copyOptions) - if (pattern.watch){ + if (pattern.watch) { const watcher = chokidar.watch(from,{ persistent: true, ignoreInitial: true diff --git a/packages/taro-cli/src/util/npmExact.ts b/packages/taro-cli/src/util/npmExact.ts deleted file mode 100644 index a47bc72bc153..000000000000 --- a/packages/taro-cli/src/util/npmExact.ts +++ /dev/null @@ -1,92 +0,0 @@ -import * as path from 'path' - -import { resolveNpmFilesPath } from './resolve_npm_files' -import { INpmConfig, TogglableOptions, ITaroManifestConfig } from './types' -import { BUILD_TYPES, REG_STYLE, NODE_MODULES, REG_FONT, REG_MEDIA, REG_IMAGE } from './constants' -import { promoteRelativePath, recursiveFindNodeModules, generateAlipayPath } from './index' - -interface IArgs { - npmName: string, - sourceFilePath: string, - filePath: string, - isProduction: boolean, - npmConfig: INpmConfig, - buildAdapter: BUILD_TYPES, - root: string, - npmOutputDir: string, - compileConfig: {[k: string]: any}, - env: object, - uglify: TogglableOptions, - babelConfig: object, - quickappManifest?: ITaroManifestConfig -} - -const notExistNpmList: Set = new Set() - -export function getNpmOutputDir (outputDir: string, configDir: string, npmConfig: INpmConfig): string { - let npmOutputDir - if (!npmConfig.dir) { - npmOutputDir = path.join(outputDir, npmConfig.name) - } else { - npmOutputDir = path.join(path.resolve(configDir, '..', npmConfig.dir), npmConfig.name) - } - return npmOutputDir -} - -export function getExactedNpmFilePath ({ - npmName, - sourceFilePath, - filePath, - isProduction, - npmConfig, - buildAdapter, - root, - npmOutputDir, - compileConfig, - env, - uglify, - babelConfig, - quickappManifest -}: IArgs) { - try { - const nodeModulesPath = recursiveFindNodeModules(path.join(root, NODE_MODULES)) - const npmInfo = resolveNpmFilesPath({ - pkgName: npmName, - isProduction, - npmConfig, - buildAdapter, - root, - rootNpm: nodeModulesPath, - npmOutputDir, - compileConfig, - env, - uglify, - babelConfig, - quickappManifest - }) - const npmInfoMainPath = npmInfo.main - let outputNpmPath - if (REG_STYLE.test(npmInfoMainPath) - || REG_FONT.test(npmInfoMainPath) - || REG_MEDIA.test(npmInfoMainPath) - || REG_IMAGE.test(npmInfoMainPath)) { - outputNpmPath = npmInfoMainPath - filePath = sourceFilePath - } else { - outputNpmPath = npmInfoMainPath.replace(nodeModulesPath, npmOutputDir) - } - if (buildAdapter === BUILD_TYPES.ALIPAY) { - outputNpmPath = generateAlipayPath(outputNpmPath) - } - const relativePath = path.relative(filePath, outputNpmPath) - return promoteRelativePath(relativePath) - } catch (err) { - console.log(err) - notExistNpmList.add(npmName) - return npmName - } -} - -export function getNotExistNpmList () { - return notExistNpmList -} diff --git a/packages/taro-cli/src/util/resolve_npm_files.ts b/packages/taro-cli/src/util/resolve_npm_files.ts deleted file mode 100644 index 554905d7536f..000000000000 --- a/packages/taro-cli/src/util/resolve_npm_files.ts +++ /dev/null @@ -1,549 +0,0 @@ -import * as fs from 'fs-extra' -import * as path from 'path' -import * as resolvePath from 'resolve' -import wxTransformer from '@tarojs/transformer-wx' -import * as babel from 'babel-core' -import * as t from 'babel-types' -import traverse from 'babel-traverse' -import generate from 'babel-generator' -import * as _ from 'lodash' - -import { - isNpmPkg, - promoteRelativePath, - printLog, - recursiveFindNodeModules, - generateEnvList, - isQuickappPkg, - generateAlipayPath -} from './index' - -import { - processTypeEnum, - REG_TYPESCRIPT, - BUILD_TYPES, - REG_STYLE, - REG_FONT, - REG_IMAGE, - REG_MEDIA, - REG_JSON, - taroJsFramework, - NODE_MODULES_REG, - taroJsRedux, - taroJsMobxCommon, - taroJsMobx -} from './constants' - -import defaultUglifyConfig from '../config/uglify' - -import * as npmProcess from './npm' -import { IInstallOptions, INpmConfig, IResolvedCache, TogglableOptions, ITaroManifestConfig } from './types' -import { convertArrayToAstExpression, convertObjectToAstExpression } from './astConvert' - -const excludeNpmPkgs = ['ReactPropTypes'] - -const resolvedCache: IResolvedCache = {} -const copyedFiles = {} -export const excludeReplaceTaroFrameworkPkgs = new Set([taroJsRedux, taroJsMobx, taroJsMobxCommon]) - -export function resolveNpmPkgMainPath ( - pkgName: string, - isProduction: boolean, - npmConfig: INpmConfig, - buildAdapter: BUILD_TYPES = BUILD_TYPES.WEAPP, - root: string -) { - try { - return resolvePath.sync(pkgName, { basedir: root }) - } catch (err) { - if (err.code === 'MODULE_NOT_FOUND') { - console.log(`缺少npm包${pkgName},开始安装...`) - const installOptions: IInstallOptions = { - dev: false - } - if (pkgName.indexOf(npmProcess.taroPluginPrefix) >= 0) { - installOptions.dev = true - } - npmProcess.installNpmPkg(pkgName, installOptions) - return resolveNpmPkgMainPath(pkgName, isProduction, npmConfig, buildAdapter, root) - } - } -} - -export function resolveNpmFilesPath ({ - pkgName, - isProduction, - npmConfig, - buildAdapter, - root, - rootNpm, - npmOutputDir, - compileConfig = {}, - env, - uglify, - babelConfig, - quickappManifest -}: { - pkgName: string, - isProduction: boolean, - npmConfig: INpmConfig, - buildAdapter: BUILD_TYPES, - root: string, - rootNpm: string, - npmOutputDir: string, - compileConfig: {[k: string]: any}, - env: object, - uglify: TogglableOptions, - babelConfig: object, - quickappManifest?: ITaroManifestConfig -}) { - if (!resolvedCache[pkgName]) { - const res = resolveNpmPkgMainPath(pkgName, isProduction, npmConfig, buildAdapter, root) - resolvedCache[pkgName] = { - main: res, - files: [] - } - resolvedCache[pkgName].files.push(res) - recursiveRequire({ - filePath: res, - files: resolvedCache[pkgName].files, - isProduction, - npmConfig, - buildAdapter, - rootNpm, - npmOutputDir: npmOutputDir, - compileConfig, - env, - uglify, - babelConfig, - quickappManifest - }) - } - return resolvedCache[pkgName] -} - -function analyzeImportUrl ({ - requirePath, - excludeRequire, - source, - filePath, - files, - isProduction, - npmConfig, - rootNpm, - npmOutputDir, - buildAdapter, - compileConfig = [], - env, - uglify, - babelConfig, - quickappManifest -}: { - requirePath: string, - excludeRequire: string[], - source: any, - filePath: string, - files: string[], - isProduction: boolean, - npmConfig: INpmConfig, - rootNpm: string, - npmOutputDir: string, - buildAdapter: BUILD_TYPES, - compileConfig: {[k: string]: any}, - env: object, - uglify: TogglableOptions, - babelConfig: object, - quickappManifest?: ITaroManifestConfig -}) { - if (excludeRequire.indexOf(requirePath) < 0) { - const quickappPkgs = quickappManifest ? quickappManifest.features : [] - if (buildAdapter === BUILD_TYPES.QUICKAPP && isQuickappPkg(requirePath, quickappPkgs)) { - return - } - if (isNpmPkg(requirePath)) { - if (excludeNpmPkgs.indexOf(requirePath) < 0) { - const taroMiniAppFramework = `@tarojs/taro-${buildAdapter}` - excludeReplaceTaroFrameworkPkgs.add(taroMiniAppFramework) - if (requirePath === taroJsFramework - && (!NODE_MODULES_REG.test(filePath) || !Array.from(excludeReplaceTaroFrameworkPkgs).some(item => filePath.replace(/\\/g, '/').indexOf(item) >= 0))) { - requirePath = taroMiniAppFramework - } - const res = resolveNpmFilesPath({ - pkgName: requirePath, - isProduction, - npmConfig, - buildAdapter, - root: path.dirname(recursiveFindNodeModules(filePath)), - rootNpm, - npmOutputDir, - compileConfig, - env, - uglify, - babelConfig, - quickappManifest - }) - let relativeRequirePath = promoteRelativePath(path.relative(filePath, res.main)) - relativeRequirePath = relativeRequirePath.replace(/node_modules/g, npmConfig.name) - if (buildAdapter === BUILD_TYPES.ALIPAY) { - relativeRequirePath = generateAlipayPath(relativeRequirePath) - } - source.value = relativeRequirePath - } - } else { - let realRequirePath = path.resolve(path.dirname(filePath), requirePath) - const tempPathWithJS = `${realRequirePath}.js` - const tempPathWithIndexJS = `${realRequirePath}${path.sep}index.js` - if (fs.existsSync(tempPathWithJS)) { - realRequirePath = tempPathWithJS - requirePath += '.js' - } else if (fs.existsSync(tempPathWithIndexJS)) { - realRequirePath = tempPathWithIndexJS - requirePath += '/index.js' - } - if (files.indexOf(realRequirePath) < 0) { - files.push(realRequirePath) - recursiveRequire({ - filePath: realRequirePath, - files, - isProduction, - npmConfig, - buildAdapter, - rootNpm, - npmOutputDir, - compileConfig, - env, - uglify, - babelConfig, - quickappManifest - }) - } - source.value = requirePath - } - } -} - -function parseAst ({ - ast, - filePath, - files, - isProduction, - npmConfig, - rootNpm, - npmOutputDir, - buildAdapter, - compileConfig = [], - env, - uglify, - babelConfig, - quickappManifest -}: { - ast: t.File, - filePath: string, - files: string[], - isProduction: boolean, - npmConfig: INpmConfig, - rootNpm: string, - npmOutputDir: string, - buildAdapter: BUILD_TYPES, - compileConfig: {[k: string]: any}, - env: object, - uglify: TogglableOptions, - babelConfig: object, - quickappManifest?: ITaroManifestConfig -}) { - const excludeRequire: string[] = [] - - traverse(ast, { - IfStatement (astPath) { - astPath.traverse({ - BinaryExpression (astPath) { - const node = astPath.node - const left = node.left - const right = node.right - if (t.isMemberExpression(left) && t.isStringLiteral(right)) { - if (generate(left).code === 'process.env.TARO_ENV' && - (node.right as t.StringLiteral).value !== buildAdapter) { - const consequentSibling = astPath.getSibling('consequent') - consequentSibling.traverse({ - CallExpression (astPath) { - if (astPath.get('callee').isIdentifier({ name: 'require' })) { - const arg = astPath.get('arguments')[0] - if (t.isStringLiteral(arg.node)) { - excludeRequire.push(arg.node.value) - } - } - } - }) - } - } - } - }) - }, - Program: { - exit (astPath) { - astPath.traverse({ - ImportDeclaration (astPath) { - const node = astPath.node - const source = node.source - const value = source.value - if (REG_JSON.test(value)) { - const realRequirePath = path.resolve(path.dirname(filePath), value) - if (fs.existsSync(realRequirePath)) { - const obj = JSON.parse(fs.readFileSync(realRequirePath).toString()) - const specifiers = node.specifiers - let defaultSpecifier - specifiers.forEach(item => { - if (item.type === 'ImportDefaultSpecifier') { - defaultSpecifier = item.local.name - } - }) - if (defaultSpecifier) { - let objArr: t.NullLiteral | t.Expression = t.nullLiteral() - if (Array.isArray(obj)) { - objArr = t.arrayExpression(convertArrayToAstExpression(obj)) - } else { - objArr = t.objectExpression(convertObjectToAstExpression(obj)) - } - astPath.replaceWith(t.variableDeclaration('const', [t.variableDeclarator(t.identifier(defaultSpecifier), objArr)])) - } - } - return - } - analyzeImportUrl({ - requirePath: value, - excludeRequire, - source, - filePath, - files, - isProduction, - npmConfig, - rootNpm, - npmOutputDir, - buildAdapter, - compileConfig, - env, - uglify, - babelConfig, - quickappManifest - }) - }, - CallExpression (astPath) { - const node = astPath.node - const callee = node.callee as t.Identifier - if (callee.name === 'require') { - const args = node.arguments as Array - const requirePath = args[0].value - if (REG_JSON.test(requirePath)) { - const realRequirePath = path.resolve(path.dirname(filePath), requirePath) - if (fs.existsSync(realRequirePath)) { - const obj = JSON.parse(fs.readFileSync(realRequirePath).toString()) - let objArr: t.NullLiteral | t.Expression | t.ObjectProperty[] = t.nullLiteral() - if (Array.isArray(obj)) { - objArr = t.arrayExpression(convertArrayToAstExpression(obj)) - } else { - objArr = convertObjectToAstExpression(obj) - } - astPath.replaceWith(t.objectExpression(objArr as any)) - } - return - } - analyzeImportUrl({ - requirePath, - excludeRequire, - source: args[0], - filePath, - files, - isProduction, - npmConfig, - rootNpm, - npmOutputDir, - buildAdapter, - compileConfig, - env, - uglify, - babelConfig, - quickappManifest - }) - } - } - }) - } - } - }) - - return generate(ast).code -} - -async function recursiveRequire ({ - filePath, - files, - isProduction, - npmConfig, - buildAdapter, - npmOutputDir, - rootNpm, - compileConfig = {}, - env, - uglify, - babelConfig, - quickappManifest -}: { - filePath: string, - files: string[], - isProduction: boolean, - npmConfig: INpmConfig, - buildAdapter: BUILD_TYPES, - rootNpm: string, - npmOutputDir: string, - compileConfig: {[k: string]: any}, - env: object, - uglify: TogglableOptions, - babelConfig: object, - quickappManifest?: ITaroManifestConfig -}) { - let fileContent = fs.readFileSync(filePath).toString() - let outputNpmPath = filePath.replace(rootNpm, npmOutputDir).replace(/node_modules/g, npmConfig.name) - if (buildAdapter === BUILD_TYPES.ALIPAY) { - outputNpmPath = generateAlipayPath(outputNpmPath) - } - if (REG_STYLE.test(path.basename(filePath))) { - return - } - if (REG_FONT.test(filePath) || REG_IMAGE.test(filePath) || REG_MEDIA.test(filePath)) { - fs.ensureDirSync(path.dirname(outputNpmPath)) - fs.writeFileSync(outputNpmPath, fileContent) - let modifyOutput = outputNpmPath.replace(path.dirname(rootNpm) + path.sep, '') - modifyOutput = modifyOutput.split(path.sep).join('/') - printLog(processTypeEnum.COPY, 'NPM文件', modifyOutput) - return - } - fileContent = npmCodeHack(filePath, fileContent, buildAdapter) - - const npmExclude = (compileConfig.exclude || []).filter(item => /(?:\/|^)node_modules(\/|$)/.test(item)) - let isNpmInCompileExclude = false - for (const item of npmExclude) { - isNpmInCompileExclude = filePath.indexOf(item) !== -1 - if (isNpmInCompileExclude) { - break - } - } - if (!isNpmInCompileExclude) { - try { - const constantsReplaceList = Object.assign({ - 'process.env.TARO_ENV': buildAdapter - }, generateEnvList(env || {})) - const transformResult = wxTransformer({ - code: fileContent, - sourcePath: filePath, - adapter: buildAdapter, - isNormal: true, - isTyped: REG_TYPESCRIPT.test(filePath), - env: constantsReplaceList - }) - const ast = babel.transformFromAst(transformResult.ast, '', { - plugins: [ - [require('babel-plugin-transform-define').default, constantsReplaceList] - ] - }).ast as t.File - fileContent = parseAst({ - ast, - filePath, - files, - isProduction, - npmConfig, - rootNpm, - buildAdapter, - compileConfig, - npmOutputDir, - env, - uglify, - babelConfig, - quickappManifest - }) - } catch (err) { - console.log(err) - } - } - - if (!copyedFiles[outputNpmPath]) { - const compileInclude = compileConfig.include - if (compileInclude && compileInclude.length) { - const filePathArr = filePath.split(path.sep) - const nodeModulesIndex = filePathArr.indexOf('node_modules') - if (nodeModulesIndex >= 0) { - const npmFilePath = filePathArr.slice(nodeModulesIndex + 1).join('/') - let needCompile = false - compileInclude.forEach(item => { - if (npmFilePath.indexOf(item) >= 0) { - needCompile = true - } - }) - if (needCompile) { - const compileScriptRes = await npmProcess.callPlugin('babel', fileContent, filePath, babelConfig, rootNpm) - fileContent = compileScriptRes.code - } - } - } - if (isProduction && buildAdapter !== BUILD_TYPES.QUICKAPP) { - const uglifyPluginConfig = uglify || { enable: true } - if (uglifyPluginConfig.enable) { - const uglifyConfig = Object.assign(defaultUglifyConfig, uglifyPluginConfig.config || {}) - const uglifyResult = npmProcess.callPluginSync('uglifyjs', fileContent, outputNpmPath, uglifyConfig, rootNpm) - if (uglifyResult.error) { - printLog(processTypeEnum.ERROR, '压缩错误', `文件${filePath}`) - console.log(uglifyResult.error) - } else { - fileContent = uglifyResult.code - } - } - } - outputNpmPath = outputNpmPath.replace(path.extname(outputNpmPath), '.js') - fs.ensureDirSync(path.dirname(outputNpmPath)) - fs.writeFileSync(outputNpmPath, fileContent) - let modifyOutput = outputNpmPath.replace(path.dirname(rootNpm) + path.sep, '') - modifyOutput = modifyOutput.split(path.sep).join('/') - printLog(processTypeEnum.COPY, 'NPM文件', modifyOutput) - copyedFiles[outputNpmPath] = true - } -} - -export function npmCodeHack (filePath: string, content: string, buildAdapter: BUILD_TYPES): string { - const basename = path.basename(filePath) - switch (basename) { - case 'lodash.js': - case '_global.js': - case 'lodash.min.js': - if (buildAdapter === BUILD_TYPES.ALIPAY || buildAdapter === BUILD_TYPES.SWAN || buildAdapter === BUILD_TYPES.JD) { - content = content.replace(/Function\(['"]return this['"]\)\(\)/, '{}') - } else { - content = content.replace(/Function\(['"]return this['"]\)\(\)/, 'this') - } - break - case 'mobx.js': - // 解决支付宝小程序全局window或global不存在的问题 - content = content.replace( - /typeof window\s{0,}!==\s{0,}['"]undefined['"]\s{0,}\?\s{0,}window\s{0,}:\s{0,}global/, - 'typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}' - ) - break - case '_html.js': - content = 'module.exports = false;' - break - case '_microtask.js': - content = content.replace('if(Observer)', 'if(false && Observer)') - // IOS 1.10.2 Promise BUG - content = content.replace('Promise && Promise.resolve', 'false && Promise && Promise.resolve') - break - case '_freeGlobal.js': - content = content.replace('module.exports = freeGlobal;', 'module.exports = freeGlobal || this || global || {};') - break - } - if (buildAdapter === BUILD_TYPES.ALIPAY && content.replace(/\s\r\n/g, '').length <= 0) { - content = '// Empty file' - } - return content -} - -export function getResolvedCache (): IResolvedCache { - return resolvedCache -} diff --git a/packages/taro-cli/src/util/types.ts b/packages/taro-cli/src/util/types.ts index de721caad5d8..e2b64b2d3b13 100644 --- a/packages/taro-cli/src/util/types.ts +++ b/packages/taro-cli/src/util/types.ts @@ -1,9 +1,4 @@ -import * as webpack from 'webpack' -import * as webpackDevServer from 'webpack-dev-server' -import * as t from 'babel-types' - -import { BUILD_TYPES, IMINI_APP_FILE_TYPE } from './constants' -import { IBabelOptions } from '../config/babel' +import { BUILD_TYPES } from './constants' export interface IInstallOptions { dev: boolean, @@ -50,6 +45,7 @@ export interface IBuildOptions { platform?: string, port?: number, release?: boolean, + envHasBeenSet?: boolean, page?: string, component?: string, uiIndex?: string @@ -68,310 +64,3 @@ export interface IMiniAppBuildConfig { export interface IOption { [key: string]: any } - -export interface ICopyOptions { - patterns: { - from: string, - to: string, - ignore?: string[], - watch?: boolean - }[], - options: { - ignore?: string[] - } -} - -export interface ICopyArgOptions { - filter?: (src: string) => boolean -} - -export interface IWxTransformResult { - code: string, - ast: t.File, - template: string, - compressedTemplate: string, - components: { - name: string, - path: string, - type: string - }[], - componentProperies: string[] -} - -export namespace PostcssOption { - export type cssModules = TogglableOptions<{ - namingPattern: 'global' | string - generateScopedName: string - }> - export type url = TogglableOptions<{ - limit: number, - basePath?: string | string[] - }> -} - -export interface IPostcssOption { - autoprefixer?: TogglableOptions, - pxtransform?: TogglableOptions, - cssModules?: PostcssOption.cssModules, - url?: PostcssOption.url, - [key: string]: any -} - -export interface ICompileOption { - exclude?: string[], - include?: string[] -} - -export interface IMiniAppConfig { - appOutput?: boolean, - npm?: INpmConfig, - module?: { - postcss?: IPostcssOption - }, - compile?: ICompileOption, - customFilesTypes: IMINI_APP_FILE_TYPE, - publicPath?: string, - staticDirectory?: string -} - -export type TogglableOptions = { - enable?: boolean, - config?: T -} - -export interface IH5RouterConfig { - mode?: 'hash' | 'browser' | 'multi', - customRoutes?: IOption, - basename?: string, - lazyload?: boolean | ((pagename: string) => boolean) - renamePagename?: (pagename: string) => string -} - -export interface IH5Config { - webpack: ((webpackConfig: webpack.Configuration, webpack) => webpack.Configuration) | webpack.Configuration, - webpackChain: (chain: any, webpack: any) => void, - dllWebpackChain: (chain: any, webpack: any) => void, - - alias: IOption, - entry: webpack.Entry, - output: webpack.Output, - router?: IH5RouterConfig, - devServer: webpackDevServer.Configuration, - enableSourceMap: boolean, - enableExtract: boolean, - enableDll: boolean, - transformOnly: boolean, - - cssLoaderOption: IOption, - styleLoaderOption: IOption, - sassLoaderOption: IOption, - lessLoaderOption: IOption, - stylusLoaderOption: IOption, - mediaUrlLoaderOption: IOption, - fontUrlLoaderOption: IOption, - imageUrlLoaderOption: IOption, - miniCssExtractPluginOption: IOption, - dllDirectory: string, - dllFilename: string, - dllEntry: { - [key: string]: string[] - }, - esnextModules: string[], - - module?: { - postcss?: IPostcssOption - } -} - -type FeatureItem = { - name: string -} - -const enum LogLevel { - OFF = 'off', - ERROR = 'error', - WARN = 'warn', - INFO = 'info', - LOG = 'log', - DEBUG = 'debug' -} - -export type SystemConfig = { - /** - * 打印日志等级,分为 off,error,warn,info,log,debug - */ - logLevel?: LogLevel, - /** - * 页面设计基准宽度,根据实际设备宽度来缩放元素大小 - */ - designWidth?: number, - /** - * 全局数据对象,属性名不能以$或_开头,在页面中可通过 this 进行访问;如果全局数据属性与页面的数据属性重名,则页面初始化时,全局数据会覆盖页面中对应的属性值 - */ - data?: IOption -} - -type RouterConfig = { - /** - * 首页名称 - */ - entry: string, - /** - * 页面配置列表,key 值为页面名称(对应页面目录名,例如 Hello 对应'Hello'目录),value 为页面详细配置 page - */ - pages: RouterPage[] -} -type RouterPage = { - /** - * 页面对应的组件名,与 ux 文件名保持一致,例如'hello' 对应 'hello.ux' - */ - component: string, - /** - * 页面路径,例如“/user”,不填则默认为/<页面名称>。 - * path 必须唯一,不能和其他 page 的 path 相同。 - * 下面 page 的 path 因为缺失,会被设置为“/Index”: - * "Index": {"component": "index"} - */ - path?: string, - /** - * 声明页面可以处理某种请求 - */ - filter: { - [key: string]: { - uri: string - } - } -} - -interface IDefaultDisplayConfig { - /** - * 窗口背景颜色 - */ - backgroundColor?: string, - /** - * 是否是全屏模式,默认不会同时作用于 titleBar,titleBar 需要继续通过 titleBar 控制 - */ - fullScreen?: boolean, - /** - * 是否显示 titleBar - */ - titleBar?: boolean, - /** - * 标题栏背景色 - */ - titleBarBackgroundColor?: string, - /** - * 标题栏文字颜色 - */ - titleBarTextColor?: string, - /** - * 标题栏文字(也可通过页面跳转传递参数(titleBarText)设置) - */ - titleBarText?: string, - /** - * 是否显示标题栏右上角菜单按钮,点击菜单按钮调用页面生命周期 onMenuPress 方法,如果该方法未实现则显示系统默认菜单 - */ - menu?: boolean, - /** - * 软键盘弹出时为保证输入框可见,页面的调整方式。 adjustPan:上移页面; adjustResize:压缩页面显示区域,当页面全屏时,此设置不生效 - */ - windowSoftInputMode?: 'adjustPan' | 'adjustResize' -} - -interface IDisplayConfig extends IDefaultDisplayConfig { - /** - * 各个页面的显示样式,key 为页面名(与路由中的页面名保持一致),value 为窗口显示样式,页面样式覆盖 default 样式 - */ - pages?: { - [key: string]: IDefaultDisplayConfig - } -} - -export interface ITaroManifestConfig { - npm?: INpmConfig, - /** - * 应用包名,确认与原生应用的包名不一致,推荐采用 com.company.module 的格式,如:com.example.demo - */ - package: string, - /** - * 应用名称,6 个汉字以内,与应用商店保存的名称一致,用于在桌面图标、弹窗等处显示应用名称 - */ - name: string, - /** - * 应用图标,提供 192x192 大小的即可 - */ - icon: string, - /** - * 应用版本名称,如:"1.0" - */ - versionName?: string, - /** - * 应用版本号,从1自增,推荐每次重新上传包时versionCode+1 - */ - versionCode: number, - /** - * 支持的最小平台版本号,兼容性检查,避免上线后在低版本平台运行并导致不兼容;如果不填按照内测版本处理 - */ - minPlatformVersion?: string, - /** - * 接口列表,绝大部分接口都需要在这里声明,否则不能调用,详见每个接口的文档说明 - */ - features?: FeatureItem[], - /** - * - */ - logLevel?: LogLevel -} - -export interface IManifestConfig extends ITaroManifestConfig { - /** - * 系统配置信息 - */ - config: SystemConfig, - /** - * 路由信息 - */ - router: RouterConfig, - /** - * UI 显示相关配置 - */ - display?: IDisplayConfig -} - -export interface IDeviceRatio { - [key: string]: number -} -export interface ICommonPlugin { - apply: (obj: object) => any -} - -export interface IProjectConfig { - projectName?: string, - date?: string, - designWidth?: number, - watcher?: [], - deviceRatio?: IDeviceRatio, - sourceRoot?: string, - outputRoot?: string, - plugins?: { - babel?: IBabelOptions, - csso?: TogglableOptions, - uglify?: TogglableOptions - }, - common?: { - plugins?: ICommonPlugin[], - babel?: IBabelOptions, - csso?: TogglableOptions, - uglify?: TogglableOptions - }, - ui?: { - extraWatchFiles?: any[] - }, - env?: IOption, - alias?: IOption, - defineConstants?: IOption, - copy?: ICopyOptions, - weapp?: IMiniAppConfig, - h5?: IH5Config, - quickApp?: ITaroManifestConfig -} diff --git a/packages/taro-mini-runner/src/utils/types.ts b/packages/taro-mini-runner/src/utils/types.ts index 3877945c277a..e5060d7ef4c6 100644 --- a/packages/taro-mini-runner/src/utils/types.ts +++ b/packages/taro-mini-runner/src/utils/types.ts @@ -1,4 +1,5 @@ import * as webpack from 'webpack' +import { IProjectBaseConfig, IMiniAppConfig } from '@tarojs/taro/types/compile' import { BUILD_TYPES } from './constants' type FunctionLikeCustomWebpackConfig = (webpackConfig: webpack.Configuration, webpack) => webpack.Configuration @@ -14,88 +15,11 @@ export interface IComponentObj { type?: string } -type TogglableOptions = { - enable?: boolean - config?: T -} - -export namespace PostcssOption { - export type cssModules = TogglableOptions<{ - namingPattern: 'global' | string - generateScopedName: string | ((localName: string, absoluteFilePath: string) => string) - }> -} - -export interface IPostcssOption { - autoprefixer?: TogglableOptions - pxtransform?: TogglableOptions - cssModules?: PostcssOption.cssModules -} - - export interface IChain { [key: string]: any } -export interface ICopyOptions { - patterns: { - from: string - to: string - ignore: string[] - }[] - options: { - ignore: string[] - } -} - -export interface ITaroMiniConfig { - webpackChain: (chain: any, webpack: any) => void - alias: IOption - entry: webpack.Entry - output: webpack.Output - enableSourceMap: boolean - - cssLoaderOption: IOption - styleLoaderOption: IOption - sassLoaderOption: IOption - lessLoaderOption: IOption - stylusLoaderOption: IOption - mediaUrlLoaderOption: IOption - fontUrlLoaderOption: IOption - imageUrlLoaderOption: IOption - esnextModules: string[] - - postcss?: IPostcssOption -} - -export interface ICopyOptions { - patterns: { - from: string - to: string - ignore: string[] - }[] - options: { - ignore: string[] - } -} - -export interface ITaroBaseConfig { - outputRoot: string - copy: ICopyOptions - - designWidth: number - deviceRatio?: number - - defineConstants?: IOption - env?: IOption - - babel: IOption - csso?: TogglableOptions - uglify?: TogglableOptions, - sass?: IOption -} - -export interface IBuildConfig extends ITaroBaseConfig, ITaroMiniConfig { +export interface IBuildConfig extends IProjectBaseConfig, IMiniAppConfig { isWatch: boolean, port?: number, buildAdapter: BUILD_TYPES diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index d438c7b398d3..3ffa259262a0 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -7,11 +7,12 @@ import { partial } from 'lodash' import { mapKeys, pipe } from 'lodash/fp' import * as UglifyJsPlugin from 'uglifyjs-webpack-plugin' import * as webpack from 'webpack' +import { PostcssOption, ICopyOptions, IPostcssOption } from '@tarojs/taro/types/compile' import { getPostcssPlugins } from './postcss.conf' import MiniPlugin from '../plugins/MiniPlugin' -import { PostcssOption, IOption, ICopyOptions, IPostcssOption } from '../utils/types' +import { IOption } from '../utils/types' import { recursiveMerge, isNodeModule } from '../utils' import { REG_SASS, REG_LESS, REG_STYLUS, REG_STYLE, REG_MEDIA, REG_FONT, REG_IMAGE, BUILD_TYPES, REG_SCRIPTS, MINI_APP_FILES } from '../utils/constants' diff --git a/packages/taro-mini-runner/src/webpack/postcss.conf.ts b/packages/taro-mini-runner/src/webpack/postcss.conf.ts index 6ae056e0ba55..4f682ea90cc5 100644 --- a/packages/taro-mini-runner/src/webpack/postcss.conf.ts +++ b/packages/taro-mini-runner/src/webpack/postcss.conf.ts @@ -3,9 +3,9 @@ import * as path from 'path' import * as autoprefixer from 'autoprefixer' import * as pxtransform from 'postcss-pxtransform' import { sync as resolveSync } from 'resolve' +import { IPostcssOption } from '@tarojs/taro/types/compile' import { isNpmPkg, recursiveMerge } from '../utils' -import { IPostcssOption } from '../utils/types' import browserList from '../config/browser_list' const defaultAutoprefixerOption = { @@ -24,7 +24,7 @@ const defaultPxtransformOption: { } } -const optionsWithDefaults = ['autoprefixer', 'pxtransform', 'cssModules'] +const optionsWithDefaults = ['autoprefixer', 'pxtransform', 'cssModules', 'url'] const plugins = [] as any[] diff --git a/packages/taro-webpack-runner/package.json b/packages/taro-webpack-runner/package.json index 6b578ca66512..4634251390a9 100644 --- a/packages/taro-webpack-runner/package.json +++ b/packages/taro-webpack-runner/package.json @@ -33,6 +33,7 @@ "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { "@tarojs/plugin-sass": "1.3.34", + "@tarojs/taro": "1.3.34", "@tarojs/taro-h5": "1.3.34", "autoprefixer": "8.6.4", "babel-core": "6.26.0", diff --git a/packages/taro-webpack-runner/src/__tests__/index-test.ts b/packages/taro-webpack-runner/src/__tests__/index-test.ts index dddf90a389c8..d1de21d74e89 100644 --- a/packages/taro-webpack-runner/src/__tests__/index-test.ts +++ b/packages/taro-webpack-runner/src/__tests__/index-test.ts @@ -46,12 +46,8 @@ describe('Regs', () => { mediaUrlLoaderOption: {}, esnextModules: [], - module: { - postcss: {} - }, - plugins: { - babel: {} - } + postcss: {}, + babel: {} }) expect(rule.sass).toMatchObject({ test: /\.(s[ac]ss)\b/, diff --git a/packages/taro-webpack-runner/src/config/build.conf.ts b/packages/taro-webpack-runner/src/config/build.conf.ts index a429cfecdfb8..6d8f520e997b 100644 --- a/packages/taro-webpack-runner/src/config/build.conf.ts +++ b/packages/taro-webpack-runner/src/config/build.conf.ts @@ -1,4 +1,4 @@ -import { BuildConfig, TaroBaseConfig } from '../util/types'; +import { BuildConfig } from '../util/types'; export default ({ sourceRoot = 'src', @@ -7,7 +7,7 @@ export default ({ staticDirectory = 'static', chunkDirectory = 'chunk', designWidth = 750 -}: BuildConfig): Partial => { +}: BuildConfig): Partial => { return { sourceRoot, outputRoot, diff --git a/packages/taro-webpack-runner/src/config/dev.conf.ts b/packages/taro-webpack-runner/src/config/dev.conf.ts index b940873b31fa..a46afa62f259 100644 --- a/packages/taro-webpack-runner/src/config/dev.conf.ts +++ b/packages/taro-webpack-runner/src/config/dev.conf.ts @@ -52,10 +52,8 @@ export default function (appPath: string, config: Partial): any { miniCssExtractPluginOption = emptyObj, esnextModules = [], - module = { - postcss: emptyObj - }, - plugins + postcss = emptyObj, + babel } = config const plugin = {} as any @@ -118,8 +116,8 @@ export default function (appPath: string, config: Partial): any { mediaUrlLoaderOption, esnextModules, - module, - plugins, + postcss, + babel, staticDirectory }), plugin, diff --git a/packages/taro-webpack-runner/src/config/postcss.conf.ts b/packages/taro-webpack-runner/src/config/postcss.conf.ts index 235894d84e6b..68d7ec3e08aa 100644 --- a/packages/taro-webpack-runner/src/config/postcss.conf.ts +++ b/packages/taro-webpack-runner/src/config/postcss.conf.ts @@ -1,11 +1,11 @@ -import * as autoprefixer from 'autoprefixer'; -import * as path from 'path'; -import * as constparse from 'postcss-plugin-constparse'; -import * as pxtransform from 'postcss-pxtransform'; -import { sync as resolveSync } from 'resolve'; -import { isNpmPackage, recursiveMerge } from '../util'; +import * as autoprefixer from 'autoprefixer' +import * as path from 'path' +import * as constparse from 'postcss-plugin-constparse' +import * as pxtransform from 'postcss-pxtransform' +import { sync as resolveSync } from 'resolve' +import { IPostcssOption, TogglableOptions } from '@tarojs/taro/types/compile' -import { PostcssOption, TogglableOptions } from '../util/types' +import { isNpmPackage, recursiveMerge } from '../util' const defaultAutoprefixerOption = { enable: true, @@ -44,7 +44,7 @@ const plugins = [] as any[] export const getPostcssPlugins = function (appPath: string, { designWidth, deviceRatio, - postcssOption = {} as PostcssOption + postcssOption = {} as IPostcssOption }) { if (designWidth) { diff --git a/packages/taro-webpack-runner/src/config/prod.conf.ts b/packages/taro-webpack-runner/src/config/prod.conf.ts index 24fe7b77bd0e..5e565d505f9b 100644 --- a/packages/taro-webpack-runner/src/config/prod.conf.ts +++ b/packages/taro-webpack-runner/src/config/prod.conf.ts @@ -51,12 +51,10 @@ export default function (appPath: string, config: Partial): any { miniCssExtractPluginOption = emptyObj, esnextModules = [], - module = { - postcss: emptyObj - }, - plugins = { - babel: {} - } + postcss, + babel, + csso, + uglify } = config const isMultiRouterMode = get(router, 'mode') === 'multi' @@ -91,25 +89,25 @@ export default function (appPath: string, config: Partial): any { plugin.definePlugin = getDefinePlugin([processEnvOption(env), defineConstants]) - const isCssoEnabled = (plugins.csso && plugins.csso.enable === false) + const isCssoEnabled = (csso && csso.enable === false) ? false : true if (isCssoEnabled) { - plugin.cssoWebpackPlugin = getCssoWebpackPlugin([plugins.csso ? plugins.csso.config : {}]) + plugin.cssoWebpackPlugin = getCssoWebpackPlugin([csso ? csso.config : {}]) } const mode = 'production' const minimizer: any[] = [] - const isUglifyEnabled = (plugins.uglify && plugins.uglify.enable === false) + const isUglifyEnabled = (uglify && uglify.enable === false) ? false : true if (isUglifyEnabled) { minimizer.push(getUglifyPlugin([ enableSourceMap, - plugins.uglify ? plugins.uglify.config : {} + uglify ? uglify.config : {} ])) } @@ -139,8 +137,8 @@ export default function (appPath: string, config: Partial): any { mediaUrlLoaderOption, esnextModules, - module, - plugins, + postcss, + babel, staticDirectory }), plugin, diff --git a/packages/taro-webpack-runner/src/util/chain.ts b/packages/taro-webpack-runner/src/util/chain.ts index c0dfcd686b74..26ca34d576a3 100644 --- a/packages/taro-webpack-runner/src/util/chain.ts +++ b/packages/taro-webpack-runner/src/util/chain.ts @@ -10,29 +10,28 @@ import * as MiniCssExtractPlugin from 'mini-css-extract-plugin' import { join, resolve } from 'path' import * as UglifyJsPlugin from 'uglifyjs-webpack-plugin' import * as webpack from 'webpack' +import { PostcssOption, IPostcssOption, ICopyOptions } from '@tarojs/taro/types/compile' import { recursiveMerge } from '.' import { getPostcssPlugins } from '../config/postcss.conf' -import { BuildConfig, CopyOptions, Option, PostcssOption } from './types' - -const makeConfig = async (config: BuildConfig) => { - const plugins = config.plugins || {} - const sassLoaderOption = config.sassLoaderOption || {} - const sass = plugins.sass || {} +import { Option, BuildConfig } from './types' +const getSassLoaderOption = async ({ sass, sassLoaderOption }: BuildConfig) => { let bundledContent = '' - // when plugins.sass only configured resource property + if (!sass) { + return sassLoaderOption + } if (sass.resource && !sass.projectDirectory) { const { resource } = sass try { if (typeof resource === 'string') { const res = await Bundler(resource) bundledContent += res.bundledContent - } - if (Array.isArray(resource)) { - for (const url of resource) { - const res = await Bundler(url) - bundledContent += res.bundledContent + if (Array.isArray(resource)) { + for (const url of resource) { + const res = await Bundler(url) + bundledContent += res.bundledContent + } } } } catch (e) { @@ -63,12 +62,16 @@ const makeConfig = async (config: BuildConfig) => { bundledContent += sass.data } return { - ...config, - plugins, - sassLoaderOption: { - ...sassLoaderOption, - data: sassLoaderOption.data ? `${sassLoaderOption.data}${bundledContent}` : bundledContent - } + ...sassLoaderOption, + data: sassLoaderOption.data ? `${sassLoaderOption.data}${bundledContent}` : bundledContent + } +} + +const makeConfig = async (buildConfig: BuildConfig) => { + const sassLoaderOption = await getSassLoaderOption(buildConfig) + return { + ...buildConfig, + sassLoaderOption } } @@ -183,7 +186,7 @@ const getCssoWebpackPlugin = ([cssoOption]) => { return pipe(mergeOption, listify, partial(getPlugin, CssoWebpackPlugin))([defaultCSSCompressOption, cssoOption]) } const getCopyWebpackPlugin = ({ copy, appPath }: { - copy: CopyOptions, + copy: ICopyOptions, appPath: string }) => { const args = [ @@ -247,11 +250,10 @@ const getModule = (appPath: string, { mediaUrlLoaderOption, esnextModules = [] as (string | RegExp)[], - module, - plugins + postcss, + babel }) => { - - const postcssOption: PostcssOption = module.postcss || {} + const postcssOption: IPostcssOption = postcss || {} const defaultStyleLoaderOption = { sourceMap: enableSourceMap @@ -287,7 +289,7 @@ const getModule = (appPath: string, { cssLoaderOption ] const additionalBabelOptions = { - ...plugins.babel, + ...babel, sourceMap: enableSourceMap } const esnextModuleRules = getEsnextModuleRules(esnextModules) diff --git a/packages/taro-webpack-runner/src/util/types.ts b/packages/taro-webpack-runner/src/util/types.ts index ee0f5a4e2899..ce04a8b3b322 100644 --- a/packages/taro-webpack-runner/src/util/types.ts +++ b/packages/taro-webpack-runner/src/util/types.ts @@ -1,5 +1,5 @@ import * as webpack from 'webpack' -import * as webpackDevServer from 'webpack-dev-server' +import { IProjectBaseConfig, IH5Config } from '@tarojs/taro/types/compile' type FunctionLikeCustomWebpackConfig = (webpackConfig: webpack.Configuration, webpack) => webpack.Configuration; @@ -8,108 +8,12 @@ export interface Option { [key: string]: any; }; -export type TogglableOptions = { - enable?: boolean; - config?: T; -} - -export namespace PostcssOption { - export type cssModules = TogglableOptions<{ - namingPattern: 'global' | string; - generateScopedName: string | ((localName: string, absoluteFilePath: string) => string); - }>; -} - -export interface PostcssOption { - autoprefixer?: TogglableOptions; - pxtransform?: TogglableOptions; - cssModules?: PostcssOption.cssModules; -} - export interface Chain { [key: string]: any; } -export interface IOption { - [key: string]: any -} - -export interface IH5RouterConfig { - mode?: 'hash' | 'browser' | 'multi', - customRoutes?: IOption, - basename?: string, - lazyload?: boolean | ((pagename: string) => boolean) - renamePagename?: (pagename: string) => string -} - -export interface TaroH5Config { - - webpack: ((webpackConfig: webpack.Configuration, webpack) => webpack.Configuration) | webpack.Configuration - - webpackChain: (chain: any, webpack: any) => void; - - alias: Option; - entry: webpack.Entry; - output: webpack.Output; - router?: IH5RouterConfig; - devServer: webpackDevServer.Configuration; - enableSourceMap: boolean; - sourceMapType?: 'none' | 'eval' | 'cheap-eval-source-map' | 'cheap-module-eval-source-map' | 'eval-source-map' | 'cheap-source-map' | 'cheap-module-source-map' | 'inline-cheap-source-map' | 'inline-cheap-module-source-map' | 'source-map' | 'inline-source-map' | 'hidden-source-map' | 'nosources-source-map'; - enableExtract: boolean; - - cssLoaderOption: Option; - styleLoaderOption: Option; - sassLoaderOption: Option; - lessLoaderOption: Option; - stylusLoaderOption: Option; - mediaUrlLoaderOption: Option; - fontUrlLoaderOption: Option; - imageUrlLoaderOption: Option; - miniCssExtractPluginOption: Option; - esnextModules: string[]; - - module?: { - postcss?: PostcssOption; - }; -} - -export interface TaroPlugins { - babel: Option; - csso?: TogglableOptions; - uglify?: TogglableOptions; - sass?: Option; -} - -export interface CopyOptions { - patterns: { - from: string; - to: string; - ignore: string[] - }[]; - options: { - ignore: string[]; - }; -} - -export interface TaroBaseConfig { - sourceRoot: string; - outputRoot: string; - publicPath: string; - staticDirectory: string; - chunkDirectory: string; - copy: CopyOptions; - - designWidth: number; - deviceRatio?: number; - - defineConstants?: Option; - env?: Option; - - plugins: TaroPlugins; -} - -export interface BuildConfig extends TaroBaseConfig, TaroH5Config { +export interface BuildConfig extends IProjectBaseConfig, IH5Config { isWatch: boolean; port?: number; homePage?: [string, string] diff --git a/packages/taro/package.json b/packages/taro/package.json index 391d2eeb307c..91721fc4ac55 100644 --- a/packages/taro/package.json +++ b/packages/taro/package.json @@ -23,15 +23,17 @@ "keywords": [ "taro" ], + "author": "O2Team", + "license": "MIT", "peerDependencies": { "nervjs": "^1.5.0" }, - "author": "O2Team", - "license": "MIT", "dependencies": { "@tarojs/utils": "1.3.34" }, "devDependencies": { - "@types/react": "^16.9.4" + "@types/react": "^16.9.4", + "webpack": "^4.35.0", + "webpack-dev-server": "^3.7.2" } } diff --git a/packages/taro/types/compile.ts b/packages/taro/types/compile.ts new file mode 100644 index 000000000000..30e4b9afd088 --- /dev/null +++ b/packages/taro/types/compile.ts @@ -0,0 +1,368 @@ +import * as webpack from 'webpack' +import * as webpackDevServer from 'webpack-dev-server' + +export const enum TEMPLATE_TYPES { + WEAPP = '.wxml', + SWAN = '.swan', + ALIPAY = '.axml', + TT = '.ttml', + QUICKAPP = '.ux', + QQ = '.qml' +} + +export const enum STYLE_TYPES { + WEAPP = '.wxss', + SWAN = '.css', + ALIPAY = '.acss', + TT = '.ttss', + QUICKAPP = '.css', + QQ = '.qss' +} + +export const enum SCRIPT_TYPES { + WEAPP = '.js', + SWAN = '.js', + ALIPAY = '.js', + TT = '.js', + QUICKAPP = '.js', + QQ = '.js' +} + +export const enum CONFIG_TYPES { + WEAPP = '.json', + SWAN = '.json', + ALIPAY = '.json', + TT = '.json', + QUICKAPP = '.json', + QQ = '.json' +} + +export type IMINI_APP_FILE_TYPE = { + TEMPL: TEMPLATE_TYPES, + STYLE: STYLE_TYPES, + SCRIPT: SCRIPT_TYPES, + CONFIG: CONFIG_TYPES +} + +export type IMINI_APP_FILES = { + [key: string]: IMINI_APP_FILE_TYPE +} + +export interface IOption { + [key: string]: any +} + +export interface ICopyOptions { + patterns: { + from: string, + to: string, + ignore?: string[], + watch?: boolean + }[], + options: { + ignore?: string[] + } +} + +interface IBabelOptions { + sourceMap: boolean, + presets: string[], + plugins: any[] +} + +interface ISassOptions { + /** + * 引入的全局 sass 文件,如果要引入多个文件,支持数组形式传入 + */ + resource?: string | string[], + /** + * 项目根目录的绝对地址(若为小程序云开发模板,则应该是client目录) + */ + projectDirectory?: string, + /** + * 全局 scss 变量,若 data 与 resource 中设置了同样的变量,则 data 的优先级高于 resource + */ + data?: string +} + +export interface ICopyArgOptions { + filter?: (src: string) => boolean +} + +export namespace PostcssOption { + export type cssModules = TogglableOptions<{ + namingPattern: 'global' | string + generateScopedName: string | ((localName: string, absoluteFilePath: string) => string) + }> + export type url = TogglableOptions<{ + limit: number, + basePath?: string | string[] + }> +} + +export interface IPostcssOption { + autoprefixer?: TogglableOptions, + pxtransform?: TogglableOptions, + cssModules?: PostcssOption.cssModules, + url?: PostcssOption.url, + [key: string]: any +} + +export interface ICompileOption { + exclude?: string[], + include?: string[] +} + +export interface IMiniAppConfig { + appOutput?: boolean, + enableSourceMap: boolean, + + webpackChain: (chain: any, webpack: any) => void, + entry: webpack.Entry, + output: webpack.Output, + postcss?: IPostcssOption, + cssLoaderOption: IOption, + sassLoaderOption: IOption, + lessLoaderOption: IOption, + stylusLoaderOption: IOption, + mediaUrlLoaderOption: IOption, + fontUrlLoaderOption: IOption, + imageUrlLoaderOption: IOption, + + customFilesTypes: IMINI_APP_FILE_TYPE +} + +export type TogglableOptions = { + enable?: boolean, + config?: T +} + +export interface IH5RouterConfig { + mode?: 'hash' | 'browser' | 'multi', + customRoutes?: IOption, + basename?: string, + lazyload?: boolean | ((pagename: string) => boolean), + renamePagename?: (pagename: string) => string +} + +export interface IH5Config { + publicPath: string, + staticDirectory: string, + chunkDirectory: string, + + webpack: ((webpackConfig: webpack.Configuration, webpack) => webpack.Configuration) | webpack.Configuration + + webpackChain: (chain: any, webpack: any) => void, + + entry: webpack.Entry, + output: webpack.Output, + router?: IH5RouterConfig, + devServer: webpackDevServer.Configuration, + enableSourceMap: boolean, + sourceMapType?: 'none' | 'eval' | 'cheap-eval-source-map' | 'cheap-module-eval-source-map' | 'eval-source-map' | 'cheap-source-map' | 'cheap-module-source-map' | 'inline-cheap-source-map' | 'inline-cheap-module-source-map' | 'source-map' | 'inline-source-map' | 'hidden-source-map' | 'nosources-source-map', + enableExtract: boolean, + transformOnly: boolean, + + cssLoaderOption: IOption, + styleLoaderOption: IOption, + sassLoaderOption: IOption, + lessLoaderOption: IOption, + stylusLoaderOption: IOption, + mediaUrlLoaderOption: IOption, + fontUrlLoaderOption: IOption, + imageUrlLoaderOption: IOption, + miniCssExtractPluginOption: IOption, + esnextModules: string[], + + postcss?: IPostcssOption +} + +type FeatureItem = { + name: string +} + +declare enum LogLevel { + OFF = 'off', + ERROR = 'error', + WARN = 'warn', + INFO = 'info', + LOG = 'log', + DEBUG = 'debug' +} + +export interface IDeviceRatio { + [key: string]: number +} + +export type SystemConfig = { + /** + * 打印日志等级,分为 off,error,warn,info,log,debug + */ + logLevel?: LogLevel, + /** + * 页面设计基准宽度,根据实际设备宽度来缩放元素大小 + */ + designWidth?: number, + /** + * 全局数据对象,属性名不能以$或_开头,在页面中可通过 this 进行访问;如果全局数据属性与页面的数据属性重名,则页面初始化时,全局数据会覆盖页面中对应的属性值 + */ + data?: IOption +} + +type RouterConfig = { + /** + * 首页名称 + */ + entry: string, + /** + * 页面配置列表,key 值为页面名称(对应页面目录名,例如 Hello 对应'Hello'目录),value 为页面详细配置 page + */ + pages: RouterPage[] +} +type RouterPage = { + /** + * 页面对应的组件名,与 ux 文件名保持一致,例如'hello' 对应 'hello.ux' + */ + component: string, + /** + * 页面路径,例如“/user”,不填则默认为/<页面名称>。 + * path 必须唯一,不能和其他 page 的 path 相同。 + * 下面 page 的 path 因为缺失,会被设置为“/Index”: + * "Index": {"component": "index"} + */ + path?: string, + /** + * 声明页面可以处理某种请求 + */ + filter: { + [key: string]: { + uri: string + } + } +} + +interface IDefaultDisplayConfig { + /** + * 窗口背景颜色 + */ + backgroundColor?: string, + /** + * 是否是全屏模式,默认不会同时作用于 titleBar,titleBar 需要继续通过 titleBar 控制 + */ + fullScreen?: boolean, + /** + * 是否显示 titleBar + */ + titleBar?: boolean, + /** + * 标题栏背景色 + */ + titleBarBackgroundColor?: string, + /** + * 标题栏文字颜色 + */ + titleBarTextColor?: string, + /** + * 标题栏文字(也可通过页面跳转传递参数(titleBarText)设置) + */ + titleBarText?: string, + /** + * 是否显示标题栏右上角菜单按钮,点击菜单按钮调用页面生命周期 onMenuPress 方法,如果该方法未实现则显示系统默认菜单 + */ + menu?: boolean, + /** + * 软键盘弹出时为保证输入框可见,页面的调整方式。 adjustPan:上移页面; adjustResize:压缩页面显示区域,当页面全屏时,此设置不生效 + */ + windowSoftInputMode?: 'adjustPan' | 'adjustResize' +} + +interface IDisplayConfig extends IDefaultDisplayConfig { + /** + * 各个页面的显示样式,key 为页面名(与路由中的页面名保持一致),value 为窗口显示样式,页面样式覆盖 default 样式 + */ + pages?: { + [key: string]: IDefaultDisplayConfig + } +} + +export interface ITaroManifestConfig { + /** + * 应用包名,确认与原生应用的包名不一致,推荐采用 com.company.module 的格式,如:com.example.demo + */ + package: string, + /** + * 应用名称,6 个汉字以内,与应用商店保存的名称一致,用于在桌面图标、弹窗等处显示应用名称 + */ + name: string, + /** + * 应用图标,提供 192x192 大小的即可 + */ + icon: string, + /** + * 应用版本名称,如:"1.0" + */ + versionName?: string, + /** + * 应用版本号,从1自增,推荐每次重新上传包时versionCode+1 + */ + versionCode: number, + /** + * 支持的最小平台版本号,兼容性检查,避免上线后在低版本平台运行并导致不兼容;如果不填按照内测版本处理 + */ + minPlatformVersion?: string, + /** + * 接口列表,绝大部分接口都需要在这里声明,否则不能调用,详见每个接口的文档说明 + */ + features?: FeatureItem[], + /** + * + */ + logLevel?: LogLevel +} + +export interface IManifestConfig extends ITaroManifestConfig { + /** + * 系统配置信息 + */ + config: SystemConfig, + /** + * 路由信息 + */ + router: RouterConfig, + /** + * UI 显示相关配置 + */ + display?: IDisplayConfig +} + +export interface ICommonPlugin { + apply: (obj: object) => any +} + +export interface IProjectBaseConfig { + projectName?: string, + date?: string, + designWidth?: number, + watcher?: any[], + deviceRatio?: IDeviceRatio, + sourceRoot?: string, + outputRoot?: string, + env?: IOption, + alias?: IOption, + defineConstants?: IOption, + copy?: ICopyOptions, + babel?: IBabelOptions, + csso?: TogglableOptions, + uglify?: TogglableOptions, + sass?: ISassOptions, + plugins?: ICommonPlugin[], +} + +export interface IProjectConfig extends IProjectBaseConfig { + ui?: { + extraWatchFiles?: any[] + }, + mini?: IMiniAppConfig, + h5?: IH5Config, + quickApp?: ITaroManifestConfig +} diff --git a/packages/taro/yarn.lock b/packages/taro/yarn.lock new file mode 100644 index 000000000000..ae7f5d62492e --- /dev/null +++ b/packages/taro/yarn.lock @@ -0,0 +1,3164 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/events@*": + version "3.0.0" + resolved "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" + +"@types/glob@^7.1.1": + version "7.1.1" + resolved "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" + dependencies: + "@types/events" "*" + "@types/minimatch" "*" + "@types/node" "*" + +"@types/minimatch@*": + version "3.0.3" + resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" + +"@types/node@*": + version "12.0.10" + resolved "https://registry.npmjs.org/@types/node/-/node-12.0.10.tgz#51babf9c7deadd5343620055fc8aff7995c8b031" + +"@webassemblyjs/ast@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" + dependencies: + "@webassemblyjs/helper-module-context" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/wast-parser" "1.8.5" + +"@webassemblyjs/floating-point-hex-parser@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz#1ba926a2923613edce496fd5b02e8ce8a5f49721" + +"@webassemblyjs/helper-api-error@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz#c49dad22f645227c5edb610bdb9697f1aab721f7" + +"@webassemblyjs/helper-buffer@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz#fea93e429863dd5e4338555f42292385a653f204" + +"@webassemblyjs/helper-code-frame@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz#9a740ff48e3faa3022b1dff54423df9aa293c25e" + dependencies: + "@webassemblyjs/wast-printer" "1.8.5" + +"@webassemblyjs/helper-fsm@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz#ba0b7d3b3f7e4733da6059c9332275d860702452" + +"@webassemblyjs/helper-module-context@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz#def4b9927b0101dc8cbbd8d1edb5b7b9c82eb245" + dependencies: + "@webassemblyjs/ast" "1.8.5" + mamacro "^0.0.3" + +"@webassemblyjs/helper-wasm-bytecode@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz#537a750eddf5c1e932f3744206551c91c1b93e61" + +"@webassemblyjs/helper-wasm-section@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz#74ca6a6bcbe19e50a3b6b462847e69503e6bfcbf" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + +"@webassemblyjs/ieee754@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz#712329dbef240f36bf57bd2f7b8fb9bf4154421e" + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.8.5.tgz#044edeb34ea679f3e04cd4fd9824d5e35767ae10" + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.8.5.tgz#a8bf3b5d8ffe986c7c1e373ccbdc2a0915f0cedc" + +"@webassemblyjs/wasm-edit@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz#962da12aa5acc1c131c81c4232991c82ce56e01a" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/helper-wasm-section" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + "@webassemblyjs/wasm-opt" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + "@webassemblyjs/wast-printer" "1.8.5" + +"@webassemblyjs/wasm-gen@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz#54840766c2c1002eb64ed1abe720aded714f98bc" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/ieee754" "1.8.5" + "@webassemblyjs/leb128" "1.8.5" + "@webassemblyjs/utf8" "1.8.5" + +"@webassemblyjs/wasm-opt@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz#b24d9f6ba50394af1349f510afa8ffcb8a63d264" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-buffer" "1.8.5" + "@webassemblyjs/wasm-gen" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + +"@webassemblyjs/wasm-parser@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz#21576f0ec88b91427357b8536383668ef7c66b8d" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-api-error" "1.8.5" + "@webassemblyjs/helper-wasm-bytecode" "1.8.5" + "@webassemblyjs/ieee754" "1.8.5" + "@webassemblyjs/leb128" "1.8.5" + "@webassemblyjs/utf8" "1.8.5" + +"@webassemblyjs/wast-parser@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz#e10eecd542d0e7bd394f6827c49f3df6d4eefb8c" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/floating-point-hex-parser" "1.8.5" + "@webassemblyjs/helper-api-error" "1.8.5" + "@webassemblyjs/helper-code-frame" "1.8.5" + "@webassemblyjs/helper-fsm" "1.8.5" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/wast-printer@1.8.5": + version "1.8.5" + resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz#114bbc481fd10ca0e23b3560fa812748b0bae5bc" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/wast-parser" "1.8.5" + "@xtuc/long" "4.2.2" + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + +abbrev@1: + version "1.1.1" + resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + +accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: + version "1.3.7" + resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + dependencies: + mime-types "~2.1.24" + negotiator "0.6.2" + +acorn-dynamic-import@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" + +acorn@^6.0.5: + version "6.1.1" + resolved "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + +ajv-errors@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" + +ajv-keywords@^3.1.0: + version "3.4.0" + resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.0.tgz#4b831e7b531415a7cc518cd404e73f6193c6349d" + +ajv@^6.1.0: + version "6.10.0" + resolved "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-colors@^3.0.0: + version "3.2.4" + resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" + +ansi-html@0.0.7: + version "0.0.7" + resolved "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +aproba@^1.0.3, aproba@^1.1.1: + version "1.2.0" + resolved "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + +array-flatten@^2.1.0: + version "2.1.2" + resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + +asn1.js@^4.0.0: + version "4.10.1" + resolved "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +assert@^1.1.1: + version "1.5.0" + resolved "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" + dependencies: + object-assign "^4.1.1" + util "0.10.3" + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + +async-each@^1.0.1: + version "1.0.3" + resolved "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + +async@^1.5.2: + version "1.5.2" + resolved "https://registry.npmjs.org/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +base64-js@^1.0.2: + version "1.3.0" + resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.npmjs.org/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +batch@0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" + +big.js@^5.2.2: + version "5.2.2" + resolved "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + +binary-extensions@^1.0.0: + version "1.13.1" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + +bluebird@^3.5.5: + version "3.5.5" + resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f" + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: + version "4.11.8" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + +body-parser@1.19.0: + version "1.19.0" + resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" + dependencies: + bytes "3.1.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "1.7.2" + iconv-lite "0.4.24" + on-finished "~2.3.0" + qs "6.7.0" + raw-body "2.4.0" + type-is "~1.6.17" + +bonjour@^3.5.0: + version "3.5.0" + resolved "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz#8e890a183d8ee9a2393b3844c691a42bcf7bc9f5" + dependencies: + array-flatten "^2.1.0" + deep-equal "^1.0.1" + dns-equal "^1.0.0" + dns-txt "^2.0.2" + multicast-dns "^6.0.1" + multicast-dns-service-types "^1.1.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1, braces@^2.3.2: + version "2.3.2" + resolved "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.2.0" + resolved "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.4" + resolved "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + +browserify-zlib@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + dependencies: + pako "~1.0.5" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + +buffer-indexof@^1.0.0: + version "1.1.1" + resolved "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c" + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + +buffer@^4.3.0: + version "4.9.1" + resolved "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + +bytes@3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + +bytes@3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" + +cacache@^11.3.2: + version "11.3.3" + resolved "https://registry.npmjs.org/cacache/-/cacache-11.3.3.tgz#8bd29df8c6a718a6ebd2d010da4d7972ae3bbadc" + dependencies: + bluebird "^3.5.5" + chownr "^1.1.1" + figgy-pudding "^3.5.1" + glob "^7.1.4" + graceful-fs "^4.1.15" + lru-cache "^5.1.1" + mississippi "^3.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.3" + ssri "^6.0.1" + unique-filename "^1.1.1" + y18n "^4.0.0" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + +chokidar@^2.0.2, chokidar@^2.1.6: + version "2.1.6" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz#b6cad653a929e244ce8a834244164d241fa954c5" + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.1" + optionalDependencies: + fsevents "^1.2.7" + +chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + +chrome-trace-event@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz#234090ee97c7d4ad1a2c4beae27505deffc608a4" + dependencies: + tslib "^1.9.0" + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +commander@^2.19.0: + version "2.20.0" + resolved "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + +compressible@~2.0.16: + version "2.0.17" + resolved "https://registry.npmjs.org/compressible/-/compressible-2.0.17.tgz#6e8c108a16ad58384a977f3a482ca20bff2f38c1" + dependencies: + mime-db ">= 1.40.0 < 2" + +compression@^1.7.4: + version "1.7.4" + resolved "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f" + dependencies: + accepts "~1.3.5" + bytes "3.0.0" + compressible "~2.0.16" + debug "2.6.9" + on-headers "~1.0.2" + safe-buffer "5.1.2" + vary "~1.1.2" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.5.0: + version "1.6.2" + resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +connect-history-api-fallback@^1.6.0: + version "1.6.0" + resolved "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" + +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + dependencies: + date-now "^0.1.4" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +constants-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + +content-disposition@0.5.3: + version "0.5.3" + resolved "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + dependencies: + safe-buffer "5.1.2" + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + +cookie@0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + +copy-concurrently@^1.0.0: + version "1.0.5" + resolved "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" + dependencies: + aproba "^1.1.1" + fs-write-stream-atomic "^1.0.8" + iferr "^0.1.5" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.0" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +create-ecdh@^4.0.0: + version "4.0.3" + resolved "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.2.0" + resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: + version "1.1.7" + resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-spawn@^6.0.0: + version "6.0.5" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +crypto-browserify@^3.11.0: + version "3.12.0" + resolved "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +cyclist@~0.2.2: + version "0.2.2" + resolved "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + +debug@2.6.9, debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +debug@^3.2.5, debug@^3.2.6: + version "3.2.6" + resolved "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + dependencies: + ms "^2.1.1" + +debug@^4.1.0, debug@^4.1.1: + version "4.1.1" + resolved "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + dependencies: + ms "^2.1.1" + +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + +deep-equal@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + +default-gateway@^4.2.0: + version "4.2.0" + resolved "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz#167104c7500c2115f6dd69b0a536bb8ed720552b" + dependencies: + execa "^1.0.0" + ip-regex "^2.1.0" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +del@^4.1.1: + version "4.1.1" + resolved "https://registry.npmjs.org/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4" + dependencies: + "@types/glob" "^7.1.1" + globby "^6.1.0" + is-path-cwd "^2.0.0" + is-path-in-cwd "^2.0.0" + p-map "^2.0.0" + pify "^4.0.1" + rimraf "^2.6.3" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +detect-node@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz#014ee8f8f669c5c58023da64b8179c083a28c46c" + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +dns-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" + +dns-packet@^1.3.1: + version "1.3.1" + resolved "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz#12aa426981075be500b910eedcd0b47dd7deda5a" + dependencies: + ip "^1.1.0" + safe-buffer "^5.0.1" + +dns-txt@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/dns-txt/-/dns-txt-2.0.2.tgz#b91d806f5d27188e4ab3e7d107d881a1cc4642b6" + dependencies: + buffer-indexof "^1.0.0" + +domain-browser@^1.1.1: + version "1.2.0" + resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + +duplexify@^3.4.2, duplexify@^3.6.0: + version "3.7.1" + resolved "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + +elliptic@^6.0.0: + version "6.4.1" + resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +emojis-list@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.1" + resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + dependencies: + once "^1.4.0" + +enhanced-resolve@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.4.0" + tapable "^1.0.0" + +errno@^0.1.3, errno@~0.1.7: + version "0.1.7" + resolved "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + dependencies: + prr "~1.0.1" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + +eslint-scope@^4.0.0: + version "4.0.3" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + dependencies: + estraverse "^4.1.0" + +estraverse@^4.1.0, estraverse@^4.1.1: + version "4.2.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + +eventemitter3@^3.0.0: + version "3.1.2" + resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" + +events@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" + +eventsource@^1.0.7: + version "1.0.7" + resolved "https://registry.npmjs.org/eventsource/-/eventsource-1.0.7.tgz#8fbc72c93fcd34088090bc0a4e64f4b5cee6d8d0" + dependencies: + original "^1.0.0" + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +express@^4.17.1: + version "4.17.1" + resolved "https://registry.npmjs.org/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" + dependencies: + accepts "~1.3.7" + array-flatten "1.1.1" + body-parser "1.19.0" + content-disposition "0.5.3" + content-type "~1.0.4" + cookie "0.4.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "~1.1.2" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.5" + qs "6.7.0" + range-parser "~1.2.1" + safe-buffer "5.1.2" + send "0.17.1" + serve-static "1.14.1" + setprototypeof "1.1.1" + statuses "~1.5.0" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + +faye-websocket@^0.10.0: + version "0.10.0" + resolved "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" + dependencies: + websocket-driver ">=0.5.1" + +faye-websocket@~0.11.1: + version "0.11.3" + resolved "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz#5c0e9a8968e8912c286639fde977a8b209f2508e" + dependencies: + websocket-driver ">=0.5.1" + +figgy-pudding@^3.5.1: + version "3.5.1" + resolved "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.3" + statuses "~1.5.0" + unpipe "~1.0.0" + +find-cache-dir@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" + dependencies: + commondir "^1.0.1" + make-dir "^2.0.0" + pkg-dir "^3.0.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + dependencies: + locate-path "^3.0.0" + +flush-write-stream@^1.0.0: + version "1.1.1" + resolved "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" + dependencies: + inherits "^2.0.3" + readable-stream "^2.3.6" + +follow-redirects@^1.0.0: + version "1.7.0" + resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.7.0.tgz#489ebc198dc0e7f64167bd23b03c4c19b5784c76" + dependencies: + debug "^3.2.6" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +forwarded@~0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + dependencies: + map-cache "^0.2.2" + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + +from2@^2.1.0: + version "2.3.0" + resolved "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.0" + +fs-minipass@^1.2.5: + version "1.2.6" + resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz#2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07" + dependencies: + minipass "^2.2.1" + +fs-write-stream-atomic@^1.0.8: + version "1.0.10" + resolved "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" + dependencies: + graceful-fs "^4.1.2" + iferr "^0.1.5" + imurmurhash "^0.1.4" + readable-stream "1 || 2" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.2.7: + version "1.2.9" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" + dependencies: + nan "^2.12.1" + node-pre-gyp "^0.12.0" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + dependencies: + pump "^3.0.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob@^7.0.3, glob@^7.1.3, glob@^7.1.4: + version "7.1.4" + resolved "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globby@^6.1.0: + version "6.1.0" + resolved "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" + dependencies: + array-union "^1.0.1" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2: + version "4.1.15" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + +handle-thing@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.0.tgz#0e039695ff50c93fc288557d696f3c1dc6776754" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +hash-base@^3.0.0: + version "3.0.4" + resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +hpack.js@^2.1.6: + version "2.1.6" + resolved "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" + dependencies: + inherits "^2.0.1" + obuf "^1.0.0" + readable-stream "^2.0.1" + wbuf "^1.1.0" + +html-entities@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz#0df29351f0721163515dfb9e5543e5f6eed5162f" + +http-deceiver@^1.2.7: + version "1.2.7" + resolved "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" + +http-errors@1.7.2: + version "1.7.2" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-errors@~1.6.2: + version "1.6.3" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.4.0 < 2" + +http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +"http-parser-js@>=0.4.0 <0.4.11": + version "0.4.10" + resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz#92c9c1374c35085f75db359ec56cc257cbb93fa4" + +http-proxy-middleware@^0.19.1: + version "0.19.1" + resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz#183c7dc4aa1479150306498c210cdaf96080a43a" + dependencies: + http-proxy "^1.17.0" + is-glob "^4.0.0" + lodash "^4.17.11" + micromatch "^3.1.10" + +http-proxy@^1.17.0: + version "1.17.0" + resolved "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" + dependencies: + eventemitter3 "^3.0.0" + follow-redirects "^1.0.0" + requires-port "^1.0.0" + +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + +iconv-lite@0.4.24, iconv-lite@^0.4.4: + version "0.4.24" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ieee754@^1.1.4: + version "1.1.13" + resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" + +iferr@^0.1.5: + version "0.1.5" + resolved "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" + +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + dependencies: + minimatch "^3.0.4" + +import-local@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" + dependencies: + pkg-dir "^3.0.0" + resolve-cwd "^2.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + +internal-ip@^4.3.0: + version "4.3.0" + resolved "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907" + dependencies: + default-gateway "^4.2.0" + ipaddr.js "^1.9.0" + +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + +ip-regex@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" + +ip@^1.1.0, ip@^1.1.5: + version "1.1.5" + resolved "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + +ipaddr.js@1.9.0, ipaddr.js@^1.9.0: + version "1.9.0" + resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + dependencies: + kind-of "^6.0.0" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.0, is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + dependencies: + is-extglob "^2.1.0" + +is-glob@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + dependencies: + is-extglob "^2.1.1" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-path-cwd@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.1.0.tgz#2e0c7e463ff5b7a0eb60852d851a6809347a124c" + +is-path-in-cwd@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz#bfe2dca26c69f397265a4009963602935a053acb" + dependencies: + is-path-inside "^2.1.0" + +is-path-inside@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz#7c9810587d659a40d27bcdb4d5616eab059494b2" + dependencies: + path-is-inside "^1.0.2" + +is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + dependencies: + isobject "^3.0.1" + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + +json-parse-better-errors@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + +json3@^3.3.2: + version "3.3.3" + resolved "https://registry.npmjs.org/json3/-/json3-3.3.3.tgz#7fc10e375fc5ae42c4705a5cc0aa6f62be305b81" + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + dependencies: + minimist "^1.2.0" + +killable@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + dependencies: + invert-kv "^2.0.0" + +loader-runner@^2.3.0: + version "2.4.0" + resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" + +loader-utils@^1.1.0, loader-utils@^1.2.3: + version "1.2.3" + resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" + dependencies: + big.js "^5.2.2" + emojis-list "^2.0.0" + json5 "^1.0.1" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +lodash@^4.17.11: + version "4.17.11" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + +loglevel@^1.6.3: + version "1.6.3" + resolved "https://registry.npmjs.org/loglevel/-/loglevel-1.6.3.tgz#77f2eb64be55a404c9fd04ad16d57c1d6d6b1280" + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + dependencies: + yallist "^3.0.2" + +make-dir@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + dependencies: + pify "^4.0.1" + semver "^5.6.0" + +mamacro@^0.0.3: + version "0.0.3" + resolved "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4" + +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + dependencies: + p-defer "^1.0.0" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + dependencies: + object-visit "^1.0.0" + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + +mem@^4.0.0: + version "4.3.0" + resolved "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" + +memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1: + version "0.4.1" + resolved "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + +micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: + version "3.1.10" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +mime-db@1.40.0, "mime-db@>= 1.40.0 < 2": + version "1.40.0" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" + +mime-types@~2.1.17, mime-types@~2.1.24: + version "2.1.24" + resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" + dependencies: + mime-db "1.40.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + +mime@^2.4.2: + version "2.4.4" + resolved "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" + +mimic-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +minipass@^2.2.1, minipass@^2.3.5: + version "2.3.5" + resolved "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + dependencies: + minipass "^2.2.1" + +mississippi@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^3.0.0" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: + version "0.5.1" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +move-concurrently@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" + dependencies: + aproba "^1.1.1" + copy-concurrently "^1.0.0" + fs-write-stream-atomic "^1.0.8" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.3" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +ms@2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + +ms@^2.1.1: + version "2.1.2" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + +multicast-dns-service-types@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901" + +multicast-dns@^6.0.1: + version "6.2.3" + resolved "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.2.3.tgz#a0ec7bd9055c4282f790c3c82f4e28db3b31b229" + dependencies: + dns-packet "^1.3.1" + thunky "^1.0.2" + +nan@^2.12.1: + version "2.14.0" + resolved "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +needle@^2.2.1: + version "2.4.0" + resolved "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" + dependencies: + debug "^3.2.6" + iconv-lite "^0.4.4" + sax "^1.2.4" + +negotiator@0.6.2: + version "0.6.2" + resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" + +neo-async@^2.5.0: + version "2.6.1" + resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + +node-forge@0.7.5: + version "0.7.5" + resolved "https://registry.npmjs.org/node-forge/-/node-forge-0.7.5.tgz#6c152c345ce11c52f465c2abd957e8639cd674df" + +node-libs-browser@^2.0.0: + version "2.2.1" + resolved "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" + dependencies: + assert "^1.1.1" + browserify-zlib "^0.2.0" + buffer "^4.3.0" + console-browserify "^1.1.0" + constants-browserify "^1.0.0" + crypto-browserify "^3.11.0" + domain-browser "^1.1.1" + events "^3.0.0" + https-browserify "^1.0.0" + os-browserify "^0.3.0" + path-browserify "0.0.1" + process "^0.11.10" + punycode "^1.2.4" + querystring-es3 "^0.2.0" + readable-stream "^2.3.3" + stream-browserify "^2.0.1" + stream-http "^2.7.2" + string_decoder "^1.0.0" + timers-browserify "^2.0.4" + tty-browserify "0.0.0" + url "^0.11.0" + util "^0.11.0" + vm-browserify "^1.0.1" + +node-pre-gyp@^0.12.0: + version "0.12.0" + resolved "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + +npm-bundled@^1.0.1: + version "1.0.6" + resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" + +npm-packlist@^1.1.6: + version "1.4.1" + resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + dependencies: + isobject "^3.0.0" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + dependencies: + isobject "^3.0.1" + +obuf@^1.0.0, obuf@^1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + dependencies: + ee-first "1.1.1" + +on-headers@~1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +opn@^5.5.0: + version "5.5.0" + resolved "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc" + dependencies: + is-wsl "^1.1.0" + +original@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" + dependencies: + url-parse "^1.4.3" + +os-browserify@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-locale@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + dependencies: + execa "^1.0.0" + lcid "^2.0.0" + mem "^4.0.0" + +os-tmpdir@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + +p-limit@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" + dependencies: + p-try "^2.0.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + dependencies: + p-limit "^2.0.0" + +p-map@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" + +p-retry@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/p-retry/-/p-retry-3.0.1.tgz#316b4c8893e2c8dc1cfa891f406c4b422bebf328" + dependencies: + retry "^0.12.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + +pako@~1.0.5: + version "1.0.10" + resolved "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732" + +parallel-transform@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" + dependencies: + cyclist "~0.2.2" + inherits "^2.0.3" + readable-stream "^2.1.5" + +parse-asn1@^5.0.0: + version "5.1.4" + resolved "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + safe-buffer "^5.1.1" + +parseurl@~1.3.2, parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + +path-browserify@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + +pbkdf2@^3.0.3: + version "3.0.17" + resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pkg-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + dependencies: + find-up "^3.0.0" + +portfinder@^1.0.20: + version "1.0.20" + resolved "https://registry.npmjs.org/portfinder/-/portfinder-1.0.20.tgz#bea68632e54b2e13ab7b0c4775e9b41bf270e44a" + dependencies: + async "^1.5.2" + debug "^2.2.0" + mkdirp "0.5.x" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + +promise-inflight@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + +proxy-addr@~2.0.5: + version "2.0.5" + resolved "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" + dependencies: + forwarded "~0.1.2" + ipaddr.js "1.9.0" + +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + +public-encrypt@^4.0.0: + version "4.0.3" + resolved "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + safe-buffer "^5.1.2" + +pump@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pumpify@^1.3.3: + version "1.5.1" + resolved "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" + dependencies: + duplexify "^3.6.0" + inherits "^2.0.3" + pump "^2.0.0" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + +punycode@^1.2.4: + version "1.4.1" + resolved "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + +qs@6.7.0: + version "6.7.0" + resolved "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + +querystring-es3@^0.2.0: + version "0.2.1" + resolved "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + +querystringify@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: + version "2.1.0" + resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +range-parser@^1.2.1, range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + +raw-body@2.4.0: + version "2.4.0" + resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" + dependencies: + bytes "3.1.0" + http-errors "1.7.2" + iconv-lite "0.4.24" + unpipe "1.0.0" + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: + version "2.3.6" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.0.6: + version "3.4.0" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readdirp@^2.2.1: + version "2.2.1" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + dependencies: + resolve-from "^3.0.0" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + +retry@^0.12.0: + version "0.12.0" + resolved "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + +rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3: + version "2.6.3" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +run-queue@^1.0.0, run-queue@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" + dependencies: + aproba "^1.1.1" + +safe-buffer@5.1.2, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + +schema-utils@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" + dependencies: + ajv "^6.1.0" + ajv-errors "^1.0.0" + ajv-keywords "^3.1.0" + +select-hose@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" + +selfsigned@^1.10.4: + version "1.10.4" + resolved "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.4.tgz#cdd7eccfca4ed7635d47a08bf2d5d3074092e2cd" + dependencies: + node-forge "0.7.5" + +semver@^5.3.0, semver@^5.5.0, semver@^5.6.0: + version "5.7.0" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + +semver@^6.1.1: + version "6.1.2" + resolved "https://registry.npmjs.org/semver/-/semver-6.1.2.tgz#079960381376a3db62eb2edc8a3bfb10c7cfe318" + +send@0.17.1: + version "0.17.1" + resolved "https://registry.npmjs.org/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" + dependencies: + debug "2.6.9" + depd "~1.1.2" + destroy "~1.0.4" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "~1.7.2" + mime "1.6.0" + ms "2.1.1" + on-finished "~2.3.0" + range-parser "~1.2.1" + statuses "~1.5.0" + +serialize-javascript@^1.7.0: + version "1.7.0" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65" + +serve-index@^1.9.1: + version "1.9.1" + resolved "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" + dependencies: + accepts "~1.3.4" + batch "0.6.1" + debug "2.6.9" + escape-html "~1.0.3" + http-errors "~1.6.2" + mime-types "~2.1.17" + parseurl "~1.3.2" + +serve-static@1.14.1: + version "1.14.1" + resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.17.1" + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setimmediate@^1.0.4: + version "1.0.5" + resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + +setprototypeof@1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +sockjs-client@1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.3.0.tgz#12fc9d6cb663da5739d3dc5fb6e8687da95cb177" + dependencies: + debug "^3.2.5" + eventsource "^1.0.7" + faye-websocket "~0.11.1" + inherits "^2.0.3" + json3 "^3.3.2" + url-parse "^1.4.3" + +sockjs@0.3.19: + version "0.3.19" + resolved "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz#d976bbe800af7bd20ae08598d582393508993c0d" + dependencies: + faye-websocket "^0.10.0" + uuid "^3.0.1" + +source-list-map@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@~0.5.10: + version "0.5.12" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + +source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +spdy-transport@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz#00d4863a6400ad75df93361a1608605e5dcdcf31" + dependencies: + debug "^4.1.0" + detect-node "^2.0.4" + hpack.js "^2.1.6" + obuf "^1.1.2" + readable-stream "^3.0.6" + wbuf "^1.7.3" + +spdy@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/spdy/-/spdy-4.0.0.tgz#81f222b5a743a329aa12cea6a390e60e9b613c52" + dependencies: + debug "^4.1.0" + handle-thing "^2.0.0" + http-deceiver "^1.2.7" + select-hose "^2.0.0" + spdy-transport "^3.0.0" + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + dependencies: + extend-shallow "^3.0.0" + +ssri@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" + dependencies: + figgy-pudding "^3.5.1" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@~1.5.0: + version "1.5.0" + resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + +stream-browserify@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-each@^1.1.0: + version "1.2.3" + resolved "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" + dependencies: + end-of-stream "^1.1.0" + stream-shift "^1.0.0" + +stream-http@^2.7.2: + version "2.8.3" + resolved "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.3.6" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@^1.0.0, string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + dependencies: + safe-buffer "~5.1.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + dependencies: + has-flag "^3.0.0" + +tapable@^1.0.0, tapable@^1.1.0: + version "1.1.3" + resolved "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" + +tar@^4: + version "4.4.10" + resolved "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz#946b2810b9a5e0b26140cf78bea6b0b0d689eba1" + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.3.5" + minizlib "^1.2.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.3" + +terser-webpack-plugin@^1.1.0: + version "1.3.0" + resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.3.0.tgz#69aa22426299f4b5b3775cbed8cb2c5d419aa1d4" + dependencies: + cacache "^11.3.2" + find-cache-dir "^2.0.0" + is-wsl "^1.1.0" + loader-utils "^1.2.3" + schema-utils "^1.0.0" + serialize-javascript "^1.7.0" + source-map "^0.6.1" + terser "^4.0.0" + webpack-sources "^1.3.0" + worker-farm "^1.7.0" + +terser@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/terser/-/terser-4.0.0.tgz#ef356f6f359a963e2cc675517f21c1c382877374" + dependencies: + commander "^2.19.0" + source-map "~0.6.1" + source-map-support "~0.5.10" + +through2@^2.0.0: + version "2.0.5" + resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +thunky@^1.0.2: + version "1.0.3" + resolved "https://registry.npmjs.org/thunky/-/thunky-1.0.3.tgz#f5df732453407b09191dae73e2a8cc73f381a826" + +timers-browserify@^2.0.4: + version "2.0.10" + resolved "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" + dependencies: + setimmediate "^1.0.4" + +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + +tslib@^1.9.0: + version "1.10.0" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + +tty-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + +type-is@~1.6.17, type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + +unique-filename@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" + dependencies: + unique-slug "^2.0.0" + +unique-slug@^2.0.0: + version "2.0.2" + resolved "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" + dependencies: + imurmurhash "^0.1.4" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +upath@^1.1.1: + version "1.1.2" + resolved "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz#3db658600edaeeccbe6db5e684d67ee8c2acd068" + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + +url-parse@^1.4.3: + version "1.4.7" + resolved "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + +url@^0.11.0: + version "0.11.0" + resolved "https://registry.npmjs.org/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.npmjs.org/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +util@0.10.3: + version "0.10.3" + resolved "https://registry.npmjs.org/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + dependencies: + inherits "2.0.1" + +util@^0.11.0: + version "0.11.1" + resolved "https://registry.npmjs.org/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" + dependencies: + inherits "2.0.3" + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + +uuid@^3.0.1, uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + +vary@~1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + +vm-browserify@^1.0.1: + version "1.1.0" + resolved "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" + +watchpack@^1.5.0: + version "1.6.0" + resolved "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" + dependencies: + chokidar "^2.0.2" + graceful-fs "^4.1.2" + neo-async "^2.5.0" + +wbuf@^1.1.0, wbuf@^1.7.3: + version "1.7.3" + resolved "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df" + dependencies: + minimalistic-assert "^1.0.0" + +webpack-dev-middleware@^3.7.0: + version "3.7.0" + resolved "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.0.tgz#ef751d25f4e9a5c8a35da600c5fda3582b5c6cff" + dependencies: + memory-fs "^0.4.1" + mime "^2.4.2" + range-parser "^1.2.1" + webpack-log "^2.0.0" + +webpack-dev-server@^3.7.2: + version "3.7.2" + resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.7.2.tgz#f79caa5974b7f8b63268ef5421222a8486d792f5" + dependencies: + ansi-html "0.0.7" + bonjour "^3.5.0" + chokidar "^2.1.6" + compression "^1.7.4" + connect-history-api-fallback "^1.6.0" + debug "^4.1.1" + del "^4.1.1" + express "^4.17.1" + html-entities "^1.2.1" + http-proxy-middleware "^0.19.1" + import-local "^2.0.0" + internal-ip "^4.3.0" + ip "^1.1.5" + killable "^1.0.1" + loglevel "^1.6.3" + opn "^5.5.0" + p-retry "^3.0.1" + portfinder "^1.0.20" + schema-utils "^1.0.0" + selfsigned "^1.10.4" + semver "^6.1.1" + serve-index "^1.9.1" + sockjs "0.3.19" + sockjs-client "1.3.0" + spdy "^4.0.0" + strip-ansi "^3.0.1" + supports-color "^6.1.0" + url "^0.11.0" + webpack-dev-middleware "^3.7.0" + webpack-log "^2.0.0" + yargs "12.0.5" + +webpack-log@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f" + dependencies: + ansi-colors "^3.0.0" + uuid "^3.3.2" + +webpack-sources@^1.3.0: + version "1.3.0" + resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" + dependencies: + source-list-map "^2.0.0" + source-map "~0.6.1" + +webpack@^4.35.0: + version "4.35.0" + resolved "https://registry.npmjs.org/webpack/-/webpack-4.35.0.tgz#ad3f0f8190876328806ccb7a36f3ce6e764b8378" + dependencies: + "@webassemblyjs/ast" "1.8.5" + "@webassemblyjs/helper-module-context" "1.8.5" + "@webassemblyjs/wasm-edit" "1.8.5" + "@webassemblyjs/wasm-parser" "1.8.5" + acorn "^6.0.5" + acorn-dynamic-import "^4.0.0" + ajv "^6.1.0" + ajv-keywords "^3.1.0" + chrome-trace-event "^1.0.0" + enhanced-resolve "^4.1.0" + eslint-scope "^4.0.0" + json-parse-better-errors "^1.0.2" + loader-runner "^2.3.0" + loader-utils "^1.1.0" + memory-fs "~0.4.1" + micromatch "^3.1.8" + mkdirp "~0.5.0" + neo-async "^2.5.0" + node-libs-browser "^2.0.0" + schema-utils "^1.0.0" + tapable "^1.1.0" + terser-webpack-plugin "^1.1.0" + watchpack "^1.5.0" + webpack-sources "^1.3.0" + +websocket-driver@>=0.5.1: + version "0.7.3" + resolved "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.3.tgz#a2d4e0d4f4f116f1e6297eba58b05d430100e9f9" + dependencies: + http-parser-js ">=0.4.0 <0.4.11" + safe-buffer ">=5.1.0" + websocket-extensions ">=0.1.1" + +websocket-extensions@>=0.1.1: + version "0.1.3" + resolved "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + dependencies: + string-width "^1.0.2 || 2" + +worker-farm@^1.7.0: + version "1.7.0" + resolved "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" + dependencies: + errno "~0.1.7" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +xtend@^4.0.0, xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +"y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + +yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + +yargs-parser@^11.1.1: + version "11.1.1" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@12.0.5: + version "12.0.5" + resolved "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + dependencies: + cliui "^4.0.0" + decamelize "^1.2.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^3.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^11.1.1" From 8578d17ef1900eac9ba4e6b21c00ad77bd24a21a Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 25 Jun 2019 17:31:54 +0800 Subject: [PATCH 032/194] =?UTF-8?q?feat(taro-cli):=20=E8=B0=83=E6=95=B4=20?= =?UTF-8?q?rn=20=E7=BC=96=E8=AF=91=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/plugin.ts | 4 ++-- packages/taro-cli/src/rn.ts | 30 +++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/packages/taro-cli/src/plugin.ts b/packages/taro-cli/src/plugin.ts index 6bcae14f9d2f..6417060322c2 100644 --- a/packages/taro-cli/src/plugin.ts +++ b/packages/taro-cli/src/plugin.ts @@ -35,7 +35,7 @@ import { import { buildDepComponents, buildSingleComponent, getComponentsNamedMap } from './mini/component' import { compileDepScripts, initCompileScripts } from './mini/compileScript' import { compileDepStyles, initCompileStyles } from './mini/compileStyle' -import { IBuildConfig } from './util/types' +import { IBuildOptions } from './util/types' const PLUGIN_ROOT = 'plugin/' const DOC_ROOT = 'doc/' @@ -45,7 +45,7 @@ const PLUGIN_MOCK_JSON = 'plugin-mock.json' let isCopyingFiles = {} -export async function build (appPath: string, { watch, platform }: IBuildConfig) { +export async function build (appPath: string, { watch, platform }: IBuildOptions) { switch (platform) { case BUILD_TYPES.WEAPP: buildWxPlugin(appPath, { watch }) diff --git a/packages/taro-cli/src/rn.ts b/packages/taro-cli/src/rn.ts index 158da7e2ebd6..c0a1b618d838 100644 --- a/packages/taro-cli/src/rn.ts +++ b/packages/taro-cli/src/rn.ts @@ -6,6 +6,7 @@ import * as chokidar from 'chokidar' import chalk from 'chalk' import * as _ from 'lodash' import * as klaw from 'klaw' +import { TogglableOptions, ICommonPlugin, IOption } from '@tarojs/taro/types/compile' import * as Util from './util' import CONFIG from './config' @@ -13,7 +14,7 @@ import * as StyleProcess from './rn/styleProcess' import { parseJSCode as transformJSCode } from './rn/transformJS' import { PROJECT_CONFIG, processTypeEnum, REG_STYLE, REG_SCRIPTS, REG_TYPESCRIPT, BUILD_TYPES } from './util/constants' import { convertToJDReact } from './jdreact/convert_to_jdreact' -import { IBuildConfig } from './util/types' +import { IBuildOptions } from './util/types' // import { Error } from 'tslint/lib/error' let isBuildingStyles = {} @@ -44,7 +45,13 @@ class Compiler { entryFilePath: string entryFileName: string entryBaseName: string - pluginsConfig + babel: TogglableOptions + csso: TogglableOptions + uglify: TogglableOptions + sass: IOption + less: IOption + stylus: IOption + plugins: ICommonPlugin[] rnConfig hasJDReactOutput: boolean babelConfig: any @@ -59,7 +66,13 @@ class Compiler { this.entryFilePath = Util.resolveScriptPath(path.join(this.sourceDir, CONFIG.ENTRY)) this.entryFileName = path.basename(this.entryFilePath) this.entryBaseName = path.basename(this.entryFilePath, path.extname(this.entryFileName)) - this.pluginsConfig = this.projectConfig.plugins || {} + this.babel = this.projectConfig.babel + this.csso = this.projectConfig.csso + this.uglify = this.projectConfig.uglify + this.plugins = this.projectConfig.plugins + this.sass = this.projectConfig.sass + this.stylus = this.projectConfig.stylus + this.less = this.projectConfig.less this.rnConfig = this.projectConfig.rn || {} this.babelConfig = this.projectConfig.plugins.babel // 用来配置 babel @@ -89,7 +102,14 @@ class Compiler { const filePath = path.join(p) const fileExt = path.extname(filePath) Util.printLog(processTypeEnum.COMPILE, _.camelCase(fileExt).toUpperCase(), filePath) - return StyleProcess.loadStyle({filePath, pluginsConfig: this.pluginsConfig}, this.appPath) + return StyleProcess.loadStyle({ + filePath, + pluginsConfig: { + sass: this.sass, + less: this.less, + stylus: this.stylus + } + }, this.appPath) })).then(resList => { // postcss return Promise.all(resList.map(item => { return StyleProcess.postCSS({...item as { css: string, filePath: string }, projectConfig: this.projectConfig}) @@ -345,7 +365,7 @@ function installDep (path: string) { export { Compiler } -export async function build (appPath: string, buildConfig: IBuildConfig) { +export async function build (appPath: string, buildConfig: IBuildOptions) { const { watch } = buildConfig process.env.TARO_ENV = BUILD_TYPES.RN await Util.checkCliAndFrameworkVersion(appPath, BUILD_TYPES.RN) From 6abb72b60ceadd1550840ddda3c5af3820ef5e49 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 26 Jun 2019 10:42:14 +0800 Subject: [PATCH 033/194] =?UTF-8?q?feat(mini-runner):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=88=86=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taro-mini-runner/src/loaders/loader.ts | 4 --- .../src/plugins/MiniPlugin.ts | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) delete mode 100644 packages/taro-mini-runner/src/loaders/loader.ts diff --git a/packages/taro-mini-runner/src/loaders/loader.ts b/packages/taro-mini-runner/src/loaders/loader.ts deleted file mode 100644 index 2837d6268e70..000000000000 --- a/packages/taro-mini-runner/src/loaders/loader.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default function (source) { - console.log(source) - return source -} diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index c7b93a1a6b02..07d367e84f10 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -337,6 +337,33 @@ export default class MiniPlugin { }) } + getSubPackages (appConfig) { + const subPackages = appConfig.subPackages || appConfig['subpackages'] + if (subPackages && subPackages.length) { + subPackages.forEach(item => { + if (item.pages && item.pages.length) { + const root = item.root + item.pages.forEach(page => { + let pageItem = `${root}/${page}` + pageItem = pageItem.replace(/\/{2,}/g, '/') + let hasPageIn = false + this.pages.forEach(({ name }) => { + if (name === pageItem) { + hasPageIn = true + } + }) + if (!hasPageIn) { + this.pages.add({ + name: pageItem, + path: resolveScriptPath(path.join(this.sourceDir, pageItem)) + }) + } + }) + } + }) + } + } + getPages () { const { buildAdapter } = this.options const appEntry = this.appEntry @@ -353,6 +380,7 @@ export default class MiniPlugin { if (!appPages || appPages.length === 0) { throw new Error('缺少页面') } + this.getSubPackages(configObj) taroFileTypeMap[this.appEntry] = { type: PARSE_AST_TYPE.ENTRY, config: configObj, From 975efa20be72fd25753217dd516b5a595202344c Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 26 Jun 2019 21:34:32 +0800 Subject: [PATCH 034/194] =?UTF-8?q?fix(mini-runner):=20npm=20=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8D=E4=BC=9A=E7=BB=8F=E8=BF=87=20taro?= =?UTF-8?q?=20=E5=8C=85=E6=9B=BF=E6=8D=A2=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/loaders/fileParseLoader.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts index cd333e12d3b6..d4303fca3310 100644 --- a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts +++ b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts @@ -171,6 +171,9 @@ function processAst ( const source = node.source let value = source.value const specifiers = node.specifiers + if (type === PARSE_AST_TYPE.NORMAL) { + return + } if (isNpmPkg(value) && !isQuickAppPkg(value)) { if (value === taroJsComponents) { if (isQuickApp) { @@ -180,8 +183,8 @@ function processAst ( taroSelfComponents.add(_.kebabCase(name)) } }) + taroSelfComponents.add('taro-page') } - taroSelfComponents.add('taro-page') astPath.remove() } else { const specifiers = node.specifiers @@ -222,6 +225,9 @@ function processAst ( const args = node.arguments as t.StringLiteral[] let value = args[0].value const parentNode = astPath.parentPath.parentPath.node as t.VariableDeclaration + if (type === PARSE_AST_TYPE.NORMAL) { + return + } if (isNpmPkg(value) && !isQuickAppPkg(value)) { if (value === taroJsComponents) { if (isQuickApp) { From 43a129a942aefa36b712fea57f01016a4056706c Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 26 Jun 2019 21:35:08 +0800 Subject: [PATCH 035/194] =?UTF-8?q?feat(mini-runner):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=BC=96=E8=AF=91=20tabBar=20=E4=B8=8A=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E8=B5=84=E6=BA=90=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/MiniPlugin.ts | 42 +++++++++++++++---- .../src/plugins/removeStyleImport.ts | 3 -- .../taro-mini-runner/src/utils/constants.ts | 3 +- packages/taro-mini-runner/src/utils/index.ts | 12 ++++++ 4 files changed, 47 insertions(+), 13 deletions(-) delete mode 100644 packages/taro-mini-runner/src/plugins/removeStyleImport.ts diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 07d367e84f10..ea5a68930da8 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -15,9 +15,9 @@ import * as t from 'babel-types' import traverse from 'babel-traverse' import { Config as IConfig } from '@tarojs/taro' -import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG } from '../utils/constants' +import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP } from '../utils/constants' import { IComponentObj } from '../utils/types' -import { traverseObjectNode, resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync } from '../utils' +import { traverseObjectNode, resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync, isEmptyObject } from '../utils' import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency' import TaroLoadChunksPlugin from './TaroLoadChunksPlugin' @@ -140,7 +140,7 @@ export default class MiniPlugin { } } - apply (compiler: webpack.Compiler) { + apply (compiler) { this.context = compiler.context this.appEntry = this.getAppEntry(compiler) compiler.hooks.run.tapAsync( @@ -251,7 +251,7 @@ export default class MiniPlugin { getNpmComponentRealPath (code: string, component: IComponentObj, adapter: BUILD_TYPES): string | null { let componentRealPath: string | null = null let importExportName - const { isTaroComponent, transformResult } = isFileToBeTaroComponent(code, component.path, adapter) + const { isTaroComponent, transformResult } = isFileToBeTaroComponent(code, component.path as string, adapter) if (isTaroComponent) { return component.path } @@ -265,7 +265,7 @@ export default class MiniPlugin { specifiers.forEach(specifier => { const exported = specifier.exported if (kebabCase(exported.name) === component.name) { - componentRealPath = resolveScriptPath(path.resolve(path.dirname(component.path), source.value)) + componentRealPath = resolveScriptPath(path.resolve(path.dirname(component.path as string), source.value)) } }) } else { @@ -290,7 +290,7 @@ export default class MiniPlugin { if (astPath.get('callee').isIdentifier({ name: 'require' })) { const arg = astPath.get('arguments')[0] if (t.isStringLiteral(arg.node)) { - componentRealPath = resolveScriptPath(path.resolve(path.dirname(component.path), arg.node.value)) + componentRealPath = resolveScriptPath(path.resolve(path.dirname(component.path as string), arg.node.value)) } } }, @@ -306,7 +306,7 @@ export default class MiniPlugin { specifiers.forEach(specifier => { const local = specifier.local if (local.name === importExportName) { - componentRealPath = resolveScriptPath(path.resolve(path.dirname(component.path), source.value)) + componentRealPath = resolveScriptPath(path.resolve(path.dirname(component.path as string), source.value)) } }) } @@ -337,6 +337,29 @@ export default class MiniPlugin { }) } + generateTabBarFiles (compiler, appConfig) { + const tabBar = appConfig.tabBar + const { buildAdapter } = this.options + if (tabBar && typeof tabBar === 'object' && !isEmptyObject(tabBar)) { + const { + list: listConfig, + iconPath: pathConfig, + selectedIconPath: selectedPathConfig + } = CONFIG_MAP[buildAdapter] + + const list = tabBar[listConfig] || [] + let tabBarIcons: string[] = [] + list.forEach(item => { + item[pathConfig] && tabBarIcons.push(item[pathConfig]) + item[selectedPathConfig] && tabBarIcons.push(item[selectedPathConfig]) + }) + tabBarIcons.map(item => { + const itemPath = path.resolve(this.sourceDir, item) + this.addEntry(compiler, itemPath, item, PARSE_AST_TYPE.STATIC) + }) + } + } + getSubPackages (appConfig) { const subPackages = appConfig.subPackages || appConfig['subpackages'] if (subPackages && subPackages.length) { @@ -364,7 +387,7 @@ export default class MiniPlugin { } } - getPages () { + getPages (compiler) { const { buildAdapter } = this.options const appEntry = this.appEntry const code = fs.readFileSync(appEntry).toString() @@ -381,6 +404,7 @@ export default class MiniPlugin { throw new Error('缺少页面') } this.getSubPackages(configObj) + this.generateTabBarFiles(compiler, configObj) taroFileTypeMap[this.appEntry] = { type: PARSE_AST_TYPE.ENTRY, config: configObj, @@ -492,7 +516,7 @@ export default class MiniPlugin { } run (compiler: webpack.Compiler) { - this.getPages() + this.getPages(compiler) this.getComponents(this.pages, true) this.addEntries(compiler) this.transferFileContent(compiler) diff --git a/packages/taro-mini-runner/src/plugins/removeStyleImport.ts b/packages/taro-mini-runner/src/plugins/removeStyleImport.ts deleted file mode 100644 index d64f0c68c051..000000000000 --- a/packages/taro-mini-runner/src/plugins/removeStyleImport.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default class RemoveStyleImportPlugin { - -} diff --git a/packages/taro-mini-runner/src/utils/constants.ts b/packages/taro-mini-runner/src/utils/constants.ts index 2dcdedbba06e..093dd79a439d 100644 --- a/packages/taro-mini-runner/src/utils/constants.ts +++ b/packages/taro-mini-runner/src/utils/constants.ts @@ -201,5 +201,6 @@ export enum PARSE_AST_TYPE { ENTRY = 'ENTRY', PAGE = 'PAGE', COMPONENT = 'COMPONENT', - NORMAL = 'NORMAL' + NORMAL = 'NORMAL', + STATIC = 'STATIC' } diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index 4f55a21a9b88..3bc7ffe8d849 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -21,6 +21,18 @@ export function isQuickAppPkg (name: string): boolean { return /@system\./.test(name) } +export function isEmptyObject (obj: any): boolean { + if (obj == null) { + return true + } + for (const key in obj) { + if (obj.hasOwnProperty(key)) { + return false + } + } + return true +} + export function traverseObjectNode (node, buildAdapter: string, parentKey?: string) { if (node.type === 'ClassProperty' || node.type === 'ObjectProperty') { const properties = node.value.properties From 56369d42b223f264f6ba02ef7a36c4b62ad8324b Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 26 Jun 2019 23:35:47 +0800 Subject: [PATCH 036/194] =?UTF-8?q?feat(mini-runner):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=B8=8E=E5=8E=9F=E7=94=9F=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=B7=B7=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/MiniPlugin.ts | 114 +++++++++++++++--- .../src/webpack/build.conf.ts | 4 + .../taro-mini-runner/src/webpack/chain.ts | 5 +- 3 files changed, 102 insertions(+), 21 deletions(-) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index ea5a68930da8..4f4b22ee25fe 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -15,7 +15,7 @@ import * as t from 'babel-types' import traverse from 'babel-traverse' import { Config as IConfig } from '@tarojs/taro' -import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP } from '../utils/constants' +import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP, taroJsFramework } from '../utils/constants' import { IComponentObj } from '../utils/types' import { traverseObjectNode, resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync, isEmptyObject } from '../utils' import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency' @@ -38,7 +38,7 @@ export interface ITaroFileInfo { } } -interface IComponent { name: string, path: string } +interface IComponent { name: string, path: string, isNative: boolean } const PLUGIN_NAME = 'MiniPlugin' @@ -376,9 +376,13 @@ export default class MiniPlugin { } }) if (!hasPageIn) { + const pagePath = resolveScriptPath(path.join(this.sourceDir, pageItem)) + const templatePath = this.getTemplatePath(pagePath) + const isNative = this.isNativePageORComponent(templatePath, fs.readFileSync(pagePath).toString()) this.pages.add({ name: pageItem, - path: resolveScriptPath(path.join(this.sourceDir, pageItem)) + path: pagePath, + isNative }) } }) @@ -414,32 +418,72 @@ export default class MiniPlugin { this.pages = new Set([ ...appPages.map(item => { const pagePath = resolveScriptPath(path.join(this.sourceDir, item)) - return { name: item, path: pagePath } + const pageTemplatePath = this.getTemplatePath(pagePath) + const isNative = this.isNativePageORComponent(pageTemplatePath, fs.readFileSync(pagePath).toString()) + return { name: item, path: pagePath, isNative } }) ]) } + isNativePageORComponent (templatePath, jsContent) { + return fs.existsSync(templatePath) && jsContent.indexOf(taroJsFramework) < 0 + } + getComponents (fileList: Set, isRoot: boolean) { const { buildAdapter } = this.options fileList.forEach(file => { - const code = fs.readFileSync(file.path).toString() - const transformResult = wxTransformer({ - code, - sourcePath: file.path, - isTyped: REG_TYPESCRIPT.test(file.path), - isRoot, - adapter: buildAdapter - }) - const { configObj } = this.parseAst(transformResult.ast, buildAdapter) + const isNative = file.isNative const isComponentConfig = isRoot ? {} : { component: true } - let depComponents = transformResult.components + + let configObj + let depComponents + let template + let code = fs.readFileSync(file.path).toString() + if (isNative) { + const templatePath = this.getTemplatePath(file.path) + const configPath = this.getConfigPath(file.path) + if (fs.existsSync(templatePath)) { + template = fs.readFileSync(templatePath).toString() + } + if (fs.existsSync(configPath)) { + configObj = JSON.parse(fs.readFileSync(configPath).toString()) + const usingComponents = configObj.usingComponents + depComponents = usingComponents ? Object.keys(usingComponents).map(item => ({ + name: item, + path: usingComponents[item] + })) : [] + } + } else { + const transformResult = wxTransformer({ + code, + sourcePath: file.path, + isTyped: REG_TYPESCRIPT.test(file.path), + isRoot, + adapter: buildAdapter + }) + configObj = this.parseAst(transformResult.ast, buildAdapter).configObj + const usingComponents = configObj.usingComponents + if (usingComponents) { + Object.keys(usingComponents).forEach(item => { + transformResult.components.push({ + name: item, + path: usingComponents[item] + }) + }) + } + depComponents = transformResult.components + template = transformResult.template + code = transformResult.code + } + depComponents = depComponents.filter(item => !/^plugin:\/\//.test(item.path)) this.transfromComponentsPath(depComponents) taroFileTypeMap[file.path] = { type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, - config: merge({}, isComponentConfig, buildUsingComponents(file.path, this.sourceDir, {}, depComponents),configObj), - template: transformResult.template, - code: transformResult.code + config: merge({}, isComponentConfig, buildUsingComponents(file.path, this.sourceDir, {}, depComponents), configObj), + template, + code } + if (depComponents && depComponents.length) { depComponents.forEach(item => { const componentPath = resolveScriptPath(path.resolve(path.dirname(file.path), item.path)) @@ -451,7 +495,9 @@ export default class MiniPlugin { } else { componentName = componentPath.replace(this.sourceDir, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') } - const componentObj = { name: componentName, path: componentPath } + const componentTempPath = this.getTemplatePath(componentPath) + const isNative = this.isNativePageORComponent(componentTempPath, fs.readFileSync(componentPath).toString()) + const componentObj = { name: componentName, path: componentPath, isNative } this.components.add(componentObj) this.getComponents(new Set([componentObj]), false) } @@ -470,10 +516,18 @@ export default class MiniPlugin { addEntries (compiler: webpack.Compiler) { this.addEntry(compiler, this.appEntry, 'app', PARSE_AST_TYPE.ENTRY) this.pages.forEach(item => { - this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.PAGE) + if (item.isNative) { + this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.NORMAL) + } else { + this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.PAGE) + } }) this.components.forEach(item => { - this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.COMPONENT) + if (item.isNative) { + this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.NORMAL) + } else { + this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.COMPONENT) + } }) } @@ -522,6 +576,26 @@ export default class MiniPlugin { this.transferFileContent(compiler) } + getTargetFilePath (filePath, targetExtname) { + const extname = path.extname(filePath) + if (extname) { + return filePath.replace(extname, targetExtname) + } + return filePath + targetExtname + } + + getTemplatePath (filePath) { + return this.getTargetFilePath(filePath, MINI_APP_FILES[this.options.buildAdapter].TEMPL) + } + + getConfigPath (filePath) { + return this.getTargetFilePath(filePath, MINI_APP_FILES[this.options.buildAdapter].CONFIG) + } + + getStylePath (filePath) { + return this.getTargetFilePath(filePath, MINI_APP_FILES[this.options.buildAdapter].STYLE) + } + static getTaroFileTypeMap () { return taroFileTypeMap } diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts index 469f19d12f33..cc414dee640e 100644 --- a/packages/taro-mini-runner/src/webpack/build.conf.ts +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -28,6 +28,7 @@ export default (appPath: string, mode, config: Partial): any => { entry = emptyObj, output = emptyObj, outputRoot = 'dist', + sourceRoot = 'src', designWidth = 750, deviceRatio, @@ -52,6 +53,7 @@ export default (appPath: string, mode, config: Partial): any => { const plugin: any = {} const minimizer: any[] = [] + const sourceDir = path.join(appPath, sourceRoot) if (copy) { plugin.copyWebpackPlugin = getCopyWebpackPlugin({ copy, appPath }) @@ -108,6 +110,8 @@ export default (appPath: string, mode, config: Partial): any => { ] }, module: getModule(appPath, { + sourceDir, + buildAdapter, constantsReplaceList, designWidth, diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index 3ffa259262a0..6351127ad4ac 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -133,6 +133,8 @@ export const getMiniPlugin = (args) => { } export const getModule = (appPath: string, { + sourceDir, + designWidth, deviceRatio, buildAdapter, @@ -228,7 +230,8 @@ export const getModule = (appPath: string, { const fileLoader = getFileLoader([{ useRelativePath: true, - name: `[path][name]${MINI_APP_FILES[buildAdapter].STYLE}` + name: `[path][name]${MINI_APP_FILES[buildAdapter].STYLE}`, + context: sourceDir }]) const fileParseLoader = getFileParseLoader([{ From c8618723fb8ea519de108ba97015c4b7fd39771e Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 4 Jul 2019 20:49:30 +0800 Subject: [PATCH 037/194] =?UTF-8?q?fix(mini-runner):=20=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=20taro=20=E7=9A=84=E5=8C=85=E4=B8=8D=E8=83=BD=E7=BB=8F?= =?UTF-8?q?=E8=BF=87=E4=BE=9D=E8=B5=96=E5=8C=85=E5=90=8D=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/loaders/fileParseLoader.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts index d4303fca3310..2ef31580e042 100644 --- a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts +++ b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts @@ -13,7 +13,8 @@ import { taroJsComponents, taroJsRedux, QUICKAPP_SPECIAL_COMPONENTS, - PARSE_AST_TYPE + PARSE_AST_TYPE, + NODE_MODULES_REG } from '../utils/constants' import { isNpmPkg, @@ -171,7 +172,7 @@ function processAst ( const source = node.source let value = source.value const specifiers = node.specifiers - if (type === PARSE_AST_TYPE.NORMAL) { + if (NODE_MODULES_REG.test(sourceFilePath) && sourceFilePath.indexOf(taroMiniAppFramework) >= 0) { return } if (isNpmPkg(value) && !isQuickAppPkg(value)) { @@ -225,7 +226,7 @@ function processAst ( const args = node.arguments as t.StringLiteral[] let value = args[0].value const parentNode = astPath.parentPath.parentPath.node as t.VariableDeclaration - if (type === PARSE_AST_TYPE.NORMAL) { + if (NODE_MODULES_REG.test(sourceFilePath) && sourceFilePath.indexOf(taroMiniAppFramework) >= 0) { return } if (isNpmPkg(value) && !isQuickAppPkg(value)) { From 27612a3c2826c55d2340be61449a73f1fd131460 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 10 Jul 2019 21:55:18 +0800 Subject: [PATCH 038/194] =?UTF-8?q?fix(mini-runner):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=BC=95=E7=94=A8=20npm=20=E4=B8=AD=E7=BB=84=E4=BB=B6=E9=97=B4?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E4=BE=9D=E8=B5=96=E6=97=B6=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=A7=A3=E6=9E=90=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/index.ts | 2 +- packages/taro-mini-runner/src/utils/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index 9ebb0feffc82..04bcf05a9fb6 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -11,7 +11,7 @@ const customizeChain = (chain, customizeFunc: Function) => { } export default function build (appPath: string, config: IBuildConfig, mainBuilder) { - const mode = 'development' + const mode = config.isWatch ? 'development' : 'production' return new Promise((resolve, reject) => { const webpackChain = buildConf(appPath, mode, config) diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index 3bc7ffe8d849..2c7d899b96a9 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -159,7 +159,7 @@ export function buildUsingComponents ( } componentPath = resolveScriptPath(path.resolve(filePath, '..', componentPath as string)) if (fs.existsSync(componentPath)) { - if (/node_modules/.test(componentPath)) { + if (NODE_MODULES_REG.test(componentPath) && !NODE_MODULES_REG.test(filePath)) { componentPath = componentPath.replace(NODE_MODULES_REG, path.join(sourceDir, 'npm')) } componentPath = promoteRelativePath(path.relative(filePath, componentPath)) From 6e8a4ff2979e14238b347a7f0ca168b8e106ba16 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 10 Jul 2019 22:20:25 +0800 Subject: [PATCH 039/194] =?UTF-8?q?fix(mini-runner):=20=E6=89=93=E5=8C=85?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E5=BC=95=E7=94=A8=E8=87=AA=20npm=20?= =?UTF-8?q?=E5=8C=85=E4=B8=AD=E7=9A=84=E7=BB=84=E4=BB=B6=E4=B8=8D=E6=8A=BD?= =?UTF-8?q?=E7=A6=BB=E8=87=B3=20vendors=20=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/webpack/build.conf.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts index cc414dee640e..a43540262bd8 100644 --- a/packages/taro-mini-runner/src/webpack/build.conf.ts +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -14,7 +14,7 @@ import { mergeOption, getMiniPlugin } from './chain' -import { BUILD_TYPES } from '../utils/constants' +import { BUILD_TYPES, PARSE_AST_TYPE } from '../utils/constants' import { Targets } from '../plugins/MiniPlugin' const emptyObj = {} @@ -139,7 +139,14 @@ export default (appPath: string, mode, config: Partial): any => { chunks: 'all', maxInitialRequests: Infinity, minSize: 0, - name: 'vendors' + name: 'vendors', + cacheGroups: { + vendors: { + test (module) { + return /[\\/]node_modules[\\/]/.test(module.resource) && module.miniType !== PARSE_AST_TYPE.COMPONENT + } + } + } } } }) From 0ee1a7f9b1fe8034c26a9e9f070b466df596b65c Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 20 Aug 2019 16:10:54 +0800 Subject: [PATCH 040/194] chore: merge master --- packages/taro-cli/src/mini/helper.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/taro-cli/src/mini/helper.ts b/packages/taro-cli/src/mini/helper.ts index e99a5f5aa708..5cb749ef92a3 100644 --- a/packages/taro-cli/src/mini/helper.ts +++ b/packages/taro-cli/src/mini/helper.ts @@ -3,7 +3,7 @@ import * as path from 'path' import * as _ from 'lodash' import { Config } from '@tarojs/taro' -import { IProjectConfig } from '@tarojs/taro/types/compile' +import { IProjectConfig, ITaroManifestConfig } from '@tarojs/taro/types/compile' import wxTransformer from '@tarojs/transformer-wx' import getHashName from '../util/hash' @@ -39,8 +39,7 @@ import { resolveNpmSync } from '../util/npm' import { IOption, - INpmConfig, - ITaroManifestConfig + INpmConfig } from '../util/types' import CONFIG from '../config' From 2e131738f0dbfadf943a5b90ef3c8ae1df67ccbf Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 26 Aug 2019 14:20:19 +0800 Subject: [PATCH 041/194] =?UTF-8?q?fix(taro):=20=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=20webpack=20=E7=BC=96=E8=AF=91=E9=9D=99=E6=80=81?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/package.json | 6 +++--- packages/taro-mini-runner/src/webpack/chain.ts | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index d02d84ed4f2c..1fba690426b5 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "1.3.1", + "version": "1.3.14", "description": "Mini app runner for taro", "main": "index.js", "scripts": { @@ -32,8 +32,8 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/taro": "1.3.1", - "@tarojs/transformer-wx": "1.3.1", + "@tarojs/taro": "1.3.14", + "@tarojs/transformer-wx": "1.3.14", "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index 6351127ad4ac..3a1a7403ff34 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -59,6 +59,8 @@ const defaultCssModuleOption: PostcssOption.cssModules = { } } +const staticDirectory = 'static' + const getLoader = (loaderName: string, options: IOption) => { return { loader: require.resolve(loaderName), @@ -282,7 +284,7 @@ export const getModule = (appPath: string, { test: REG_MEDIA, use: { urlLoader: getUrlLoader([defaultMediaUrlLoaderOption, { - name: `[path][name].[ext]`, + name: `${staticDirectory}/media/[name].[ext]`, ...mediaUrlLoaderOption }]) } @@ -291,7 +293,7 @@ export const getModule = (appPath: string, { test: REG_FONT, use: { urlLoader: getUrlLoader([defaultFontUrlLoaderOption, { - name: `[path][name].[ext]`, + name: `${staticDirectory}/fonts/[name].[ext]`, ...fontUrlLoaderOption }]) } @@ -300,7 +302,7 @@ export const getModule = (appPath: string, { test: REG_IMAGE, use: { urlLoader: getUrlLoader([defaultImageUrlLoaderOption, { - name: `[path][name].[ext]`, + name: `${staticDirectory}/images/[name].[ext]`, ...imageUrlLoaderOption }]) } From 48ba4d8570fed586d1fc5b5db988ed089272d3f9 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 26 Aug 2019 19:18:48 +0800 Subject: [PATCH 042/194] =?UTF-8?q?fix(mini-runner):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20webpack=20=E7=BC=96=E8=AF=91=E6=97=B6=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/loaders/fileParseLoader.ts | 3 +- .../src/plugins/TaroLoadChunksPlugin.ts | 22 +++++++++++- .../taro-mini-runner/src/utils/constants.ts | 8 ++++- packages/taro-mini-runner/src/utils/index.ts | 2 +- .../src/webpack/build.conf.ts | 11 ++++-- .../taro-mini-runner/src/webpack/chain.ts | 36 +++++++++++++------ packages/taro/types/compile.ts | 1 + 7 files changed, 66 insertions(+), 17 deletions(-) diff --git a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts index 2ef31580e042..ac4fd54c4a9a 100644 --- a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts +++ b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts @@ -14,7 +14,8 @@ import { taroJsRedux, QUICKAPP_SPECIAL_COMPONENTS, PARSE_AST_TYPE, - NODE_MODULES_REG + NODE_MODULES_REG, + REG_STYLE } from '../utils/constants' import { isNpmPkg, diff --git a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts index b366ad93d2a6..9b549f88018a 100644 --- a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts @@ -1,8 +1,10 @@ +import * as path from 'path' + import webpack, { compilation } from 'webpack' import { ConcatSource } from 'webpack-sources' import { urlToRequest } from 'loader-utils' -import { PARSE_AST_TYPE } from '../utils/constants' +import { PARSE_AST_TYPE, REG_STYLE } from '../utils/constants' import { ITaroFileInfo } from './MiniPlugin' @@ -29,6 +31,24 @@ export default class TaroLoadChunksPlugin { }) compilation.chunkTemplate.hooks.renderWithEntry.tap(PLUGIN_NAME, (modules, chunk) => { if (chunk.entryModule && chunk.entryModule.miniType === PARSE_AST_TYPE.ENTRY) { + compilation.hooks.afterOptimizeAssets.tap(PLUGIN_NAME, assets => { + const files = chunk.files + files.forEach(item => { + if (REG_STYLE.test(item)) { + const source = new ConcatSource() + const _source = assets[item]._source + Object.keys(assets).forEach(assetName => { + const fileName = path.basename(assetName, path.extname(assetName)) + if (REG_STYLE.test(assetName) && this.commonChunks.includes(fileName)) { + source.add(`@import ${JSON.stringify(urlToRequest(assetName))}`) + source.add('\n') + source.add(_source) + assets[item]._source = source + } + }) + } + }) + }) const source = new ConcatSource() commonChunks.reverse().forEach(chunkItem => { source.add(`require(${JSON.stringify(urlToRequest(chunkItem.name))});\n`) diff --git a/packages/taro-mini-runner/src/utils/constants.ts b/packages/taro-mini-runner/src/utils/constants.ts index 093dd79a439d..4981bf593835 100644 --- a/packages/taro-mini-runner/src/utils/constants.ts +++ b/packages/taro-mini-runner/src/utils/constants.ts @@ -4,10 +4,12 @@ export const CSS_EXT: string[] = ['.css', '.scss', '.sass', '.less', '.styl', '. export const SCSS_EXT: string[] = ['.scss'] export const JS_EXT: string[] = ['.js', '.jsx'] export const TS_EXT: string[] = ['.ts', '.tsx'] +export const UX_EXT: string[] = ['.ux'] +export const REG_JS: RegExp = /\.js(\?.*)?$/ export const REG_SCRIPT: RegExp = /\.(js|jsx)(\?.*)?$/ export const REG_TYPESCRIPT: RegExp = /\.(tsx|ts)(\?.*)?$/ -export const REG_SCRIPTS: RegExp = /\.[tj]sx?$/ +export const REG_SCRIPTS: RegExp = /\.[tj]sx?$/i export const REG_SASS: RegExp = /\.(s[ac]ss)$/ export const REG_LESS: RegExp = /\.less$/ export const REG_STYLUS: RegExp = /\.styl$/ @@ -16,6 +18,10 @@ export const REG_MEDIA: RegExp = /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/ export const REG_IMAGE: RegExp = /\.(png|jpe?g|gif|bpm|svg|webp)(\?.*)?$/ export const REG_FONT: RegExp = /\.(woff2?|eot|ttf|otf)(\?.*)?$/ export const REG_JSON: RegExp = /\.json(\?.*)?$/ +export const REG_UX: RegExp = /\.ux(\?.*)?$/ +export const REG_WXML_IMPORT: RegExp = / NODE_MODULES_REG.test(filename) diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts index a43540262bd8..e599a0c675f6 100644 --- a/packages/taro-mini-runner/src/webpack/build.conf.ts +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -12,9 +12,10 @@ import { getOutput, getModule, mergeOption, - getMiniPlugin + getMiniPlugin, + getMiniCssExtractPlugin } from './chain' -import { BUILD_TYPES, PARSE_AST_TYPE } from '../utils/constants' +import { BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, REG_STYLE } from '../utils/constants' import { Targets } from '../plugins/MiniPlugin' const emptyObj = {} @@ -43,6 +44,7 @@ export default (appPath: string, mode, config: Partial): any => { mediaUrlLoaderOption = emptyObj, fontUrlLoaderOption = emptyObj, imageUrlLoaderOption = emptyObj, + miniCssExtractPluginOption = emptyObj, postcss = emptyObj, @@ -62,6 +64,11 @@ export default (appPath: string, mode, config: Partial): any => { plugin.definePlugin = getDefinePlugin([constantsReplaceList]) plugin.miniPlugin = getMiniPlugin({ buildAdapter, constantsReplaceList }) + plugin.miniCssExtractPlugin = getMiniCssExtractPlugin([{ + filename: `[name]${MINI_APP_FILES[buildAdapter].STYLE}`, + chunkFilename: `[id]${MINI_APP_FILES[buildAdapter].STYLE}` + }, miniCssExtractPluginOption]) + const isCssoEnabled = (csso && csso.enable === false) ? false : true diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index 3a1a7403ff34..75592f6c8657 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -2,6 +2,7 @@ import * as path from 'path' import * as CopyWebpackPlugin from 'copy-webpack-plugin' import CssoWebpackPlugin from 'csso-webpack-plugin' +import * as MiniCssExtractPlugin from 'mini-css-extract-plugin' import * as sass from 'node-sass' import { partial } from 'lodash' import { mapKeys, pipe } from 'lodash/fp' @@ -101,6 +102,12 @@ export const getFileLoader = pipe(mergeOption, partial(getLoader, 'file-loader') export const getFileParseLoader = pipe(mergeOption, partial(getLoader, path.resolve(__dirname, '../loaders/fileParseLoader'))) export const getWxTransformerLoader = pipe(mergeOption, partial(getLoader, path.resolve(__dirname, '../loaders/wxTransformerLoader'))) +const getExtractCssLoader = () => { + return { + loader: MiniCssExtractPlugin.loader + } +} +export const getMiniCssExtractPlugin = pipe(mergeOption, listify, partial(getPlugin, MiniCssExtractPlugin)) export const getDefinePlugin = pipe(mergeOption, listify, partial(getPlugin, webpack.DefinePlugin)) export const getUglifyPlugin = ([enableSourceMap, uglifyOptions]) => { return new UglifyJsPlugin({ @@ -182,6 +189,8 @@ export const getModule = (appPath: string, { cssLoaderOption ] + const extractCssLoader = getExtractCssLoader() + const cssLoader = getCssLoader(cssOptions) const cssLoaders: { include?; @@ -230,11 +239,11 @@ export const getModule = (appPath: string, { const stylusLoader = getStylusLoader([{ sourceMap: enableSourceMap }, stylusLoaderOption]) - const fileLoader = getFileLoader([{ - useRelativePath: true, - name: `[path][name]${MINI_APP_FILES[buildAdapter].STYLE}`, - context: sourceDir - }]) + // const fileLoader = getFileLoader([{ + // useRelativePath: true, + // name: `[path][name]${MINI_APP_FILES[buildAdapter].STYLE}`, + // context: sourceDir + // }]) const fileParseLoader = getFileParseLoader([{ babel, @@ -264,18 +273,23 @@ export const getModule = (appPath: string, { enforce: 'pre', use: [stylusLoader] }, - // css: { - // test: REG_STYLE, - // oneOf: cssLoaders - // }, - styleFiles: { + css: { test: REG_STYLE, - use: [fileLoader] + oneOf: cssLoaders }, + // styleFiles: { + // test: REG_STYLE, + // use: [fileLoader] + // }, postcss: { test: REG_STYLE, use: [postcssLoader] }, + customStyle: { + test: REG_STYLE, + enforce: 'post', + use: [extractCssLoader] + }, script: { test: REG_SCRIPTS, use: [fileParseLoader, wxTransformerLoader], diff --git a/packages/taro/types/compile.ts b/packages/taro/types/compile.ts index 30e4b9afd088..b70af352929a 100644 --- a/packages/taro/types/compile.ts +++ b/packages/taro/types/compile.ts @@ -128,6 +128,7 @@ export interface IMiniAppConfig { mediaUrlLoaderOption: IOption, fontUrlLoaderOption: IOption, imageUrlLoaderOption: IOption, + miniCssExtractPluginOption: IOption, customFilesTypes: IMINI_APP_FILE_TYPE } From 678ddd40c76494eb6057ec65bf334e686a88d1c4 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 27 Aug 2019 09:48:21 +0800 Subject: [PATCH 043/194] =?UTF-8?q?feat(mini-runner):=20=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=20watch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/index.ts | 33 ++++++--- .../src/plugins/MiniPlugin.ts | 17 ++++- .../taro-mini-runner/src/utils/logHelper.ts | 70 ++++++++++++------- .../src/webpack/build.conf.ts | 2 +- 4 files changed, 85 insertions(+), 37 deletions(-) diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index 04bcf05a9fb6..feb45ea71f84 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -1,7 +1,7 @@ import * as webpack from 'webpack' import { IBuildConfig } from './utils/types' -import { printBuildError, bindProdLogger } from './utils/logHelper' +import { printBuildError, bindProdLogger, bindDevLogger } from './utils/logHelper' import buildConf from './webpack/build.conf' const customizeChain = (chain, customizeFunc: Function) => { @@ -19,14 +19,27 @@ export default function build (appPath: string, config: IBuildConfig, mainBuilde const webpackConfig = webpackChain.toConfig() const compiler = webpack(webpackConfig) - bindProdLogger(compiler) - - compiler.run((err) => { - if (err) { - printBuildError(err); - return reject(err) - } - resolve() - }) + if (config.isWatch) { + bindDevLogger(compiler, config.buildAdapter) + compiler.watch({ + aggregateTimeout: 300, + poll: undefined + }, (err, stats) => { + if (err) { + printBuildError(err) + return reject(err) + } + resolve() + }) + } else { + bindProdLogger(compiler, config.buildAdapter) + compiler.run((err) => { + if (err) { + printBuildError(err) + return reject(err) + } + resolve() + }) + } }) } diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 4f4b22ee25fe..1b6338e7cc47 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -150,6 +150,21 @@ export default class MiniPlugin { }) ) + compiler.hooks.watchRun.tapAsync( + PLUGIN_NAME, + this.tryAsync(async (compiler: webpack.Compiler) => { + const changedTimes = compiler.watchFileSystem.watcher.mtimes + const changedFiles = Object.keys(changedTimes) + .map(file => `\n ${file}`) + .join('') + if (changedFiles.length) { + console.log(changedFiles) + } else { + await this.run(compiler) + } + }) + ) + compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set(SingleEntryDependency, normalModuleFactory) compilation.dependencyFactories.set(TaroSingleEntryDependency, normalModuleFactory) @@ -243,7 +258,7 @@ export default class MiniPlugin { } }) - return { + return { configObj } } diff --git a/packages/taro-mini-runner/src/utils/logHelper.ts b/packages/taro-mini-runner/src/utils/logHelper.ts index 7bc978a10b4a..2326ce4f7cc2 100644 --- a/packages/taro-mini-runner/src/utils/logHelper.ts +++ b/packages/taro-mini-runner/src/utils/logHelper.ts @@ -1,9 +1,31 @@ -import chalk from 'chalk'; -import * as ora from 'ora'; -import { partial, pipe } from 'lodash/fp'; -import * as formatMessages from 'webpack-format-messages'; - -// const syntaxErrorLabel = 'Syntax error:'; +import chalk from 'chalk' +import * as ora from 'ora' +import { partial, pipe } from 'lodash/fp' +import * as formatMessages from 'webpack-format-messages' +import { BUILD_TYPES } from './constants' + +// const syntaxErrorLabel = 'Syntax error:' + +const LOG_MAP = { + [BUILD_TYPES.WEAPP]: { + OPEN: '请打开微信小程序开发者工具进行查看' + }, + [BUILD_TYPES.ALIPAY]: { + OPEN: '请打开支付宝小程序开发者工具进行查看' + }, + [BUILD_TYPES.QQ]: { + OPEN: '请打开QQ 小程序开发者工具进行查看' + }, + [BUILD_TYPES.SWAN]: { + OPEN: '请打开百度智能小程序开发者工具进行查看' + }, + [BUILD_TYPES.TT]: { + OPEN: '请打开字节跳动小程序开发者工具进行查看' + }, + [BUILD_TYPES.QUICKAPP]: { + OPEN: '请按快应用端开发流程 https://taro-docs.jd.com/taro/docs/quick-app.html 进行查看' + } +} const getServeSpinner = (() => { let spinner @@ -14,7 +36,7 @@ const getServeSpinner = (() => { })() const printCompiling = () => { - getServeSpinner().text = 'Compiling...' + getServeSpinner().text = '正在编译...' getServeSpinner().start() } @@ -40,24 +62,24 @@ const printBuildError = (err: Error): void => { console.log() } -const printSuccess = () => { +const printSuccess = (buildAdapter: BUILD_TYPES) => { getServeSpinner().stopAndPersist({ symbol: '✅ ', - text: chalk.green('Compiled successfully!\n') + text: isFirst ? chalk.green(`编译成功,${LOG_MAP[buildAdapter].OPEN}\n`) : chalk.green(`编译成功\n`) }) } const printWarning = () => { getServeSpinner().stopAndPersist({ symbol: '⚠️ ', - text: chalk.yellow('Compiled with warnings.\n') + text: chalk.yellow('编译警告.\n') }) } const printFailed = () => { getServeSpinner().stopAndPersist({ symbol: '🙅 ', - text: chalk.red('Failed to compile.\n') + text: chalk.red('编译失败.\n') }) } @@ -83,13 +105,11 @@ const printWhenFailed = compiler => { } let isFirst = true -const printWhenFirstDone = (devUrl, compiler) => { +const printWhenFirstDone = (compiler) => { compiler.hooks.done.tap('taroDone', stats => { if (isFirst) { isFirst = false getServeSpinner().clear() - console.log() - console.log(chalk.cyan(`ℹ️ Listening at ${devUrl}`)) console.log(chalk.gray('\n监听文件修改中...\n')) } }) @@ -98,24 +118,24 @@ const printWhenFirstDone = (devUrl, compiler) => { const _printWhenDone = ({ verbose = false -}, compiler) => { +}, buildAdapter, compiler) => { compiler.hooks.done.tap('taroDone', stats => { const { errors, warnings } = formatMessages(stats) if (!stats.hasErrors() && !stats.hasWarnings()) { - printSuccess() + printSuccess(buildAdapter) } if (stats.hasErrors()) { printFailed() - errors.forEach(e => console.log(e + '\n')); + errors.forEach(e => console.log(e + '\n')) verbose && process.exit(1) - return; + return } if (stats.hasWarnings()) { printWarning() - warnings.forEach(w => console.log(w + '\n')); + warnings.forEach(w => console.log(w + '\n')) } verbose && console.log(stats.toString({ @@ -134,23 +154,23 @@ const printWhenDone = partial(_printWhenDone, [{ verbose: false }]) const printWhenDoneVerbosely = partial(_printWhenDone, [{ verbose: true }]) -const bindDevLogger = (devUrl, compiler) => { +const bindDevLogger = (compiler, buildAdapter: BUILD_TYPES) => { console.log() pipe( printWhenBeforeCompile, - partial(printWhenFirstDone, [devUrl]), - printWhenDone, + partial(printWhenDone, [buildAdapter]), printWhenFailed, - printWhenInvalid + printWhenInvalid, + printWhenFirstDone )(compiler) return compiler } -const bindProdLogger = (compiler) => { +const bindProdLogger = (compiler, buildAdapter: BUILD_TYPES) => { console.log() pipe( printWhenBeforeCompile, - printWhenDoneVerbosely, + partial(printWhenDoneVerbosely, [buildAdapter]), printWhenFailed )(compiler) return compiler diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts index e599a0c675f6..cbdeeecc2228 100644 --- a/packages/taro-mini-runner/src/webpack/build.conf.ts +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -15,7 +15,7 @@ import { getMiniPlugin, getMiniCssExtractPlugin } from './chain' -import { BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, REG_STYLE } from '../utils/constants' +import { BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES } from '../utils/constants' import { Targets } from '../plugins/MiniPlugin' const emptyObj = {} From aa9f99e384d92175de1cdfb9676f665728478b50 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 3 Sep 2019 14:33:12 +0800 Subject: [PATCH 044/194] =?UTF-8?q?fix(cli):=20=E4=BF=AE=E5=A4=8D=20watch?= =?UTF-8?q?=20=E6=97=B6=E6=96=87=E4=BB=B6=E4=BF=AE=E6=94=B9=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/MiniPlugin.ts | 12 +- .../VirtualModulePlugin.ts | 126 ++++++++++++++++++ .../VirtualModulePlugin/virtualStats.ts | 92 +++++++++++++ 3 files changed, 220 insertions(+), 10 deletions(-) create mode 100644 packages/taro-mini-runner/src/plugins/VirtualModulePlugin/VirtualModulePlugin.ts create mode 100644 packages/taro-mini-runner/src/plugins/VirtualModulePlugin/virtualStats.ts diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 1b6338e7cc47..705fbba1deae 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -9,7 +9,6 @@ import * as FunctionModulePlugin from 'webpack/lib/FunctionModulePlugin' import * as JsonpTemplatePlugin from 'webpack/lib/web/JsonpTemplatePlugin' import * as NodeSourcePlugin from 'webpack/lib/node/NodeSourcePlugin' import * as LoaderTargetPlugin from 'webpack/lib/LoaderTargetPlugin' -import * as VirtualModulePlugin from 'virtual-module-webpack-plugin' import { merge, defaults, kebabCase } from 'lodash' import * as t from 'babel-types' import traverse from 'babel-traverse' @@ -22,6 +21,7 @@ import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency import TaroLoadChunksPlugin from './TaroLoadChunksPlugin' import TaroNormalModulesPlugin from './TaroNormalModulesPlugin' +import VirtualModulePlugin from './VirtualModulePlugin/VirtualModulePlugin' interface IMiniPluginOptions { appEntry?: string, @@ -153,15 +153,7 @@ export default class MiniPlugin { compiler.hooks.watchRun.tapAsync( PLUGIN_NAME, this.tryAsync(async (compiler: webpack.Compiler) => { - const changedTimes = compiler.watchFileSystem.watcher.mtimes - const changedFiles = Object.keys(changedTimes) - .map(file => `\n ${file}`) - .join('') - if (changedFiles.length) { - console.log(changedFiles) - } else { - await this.run(compiler) - } + this.run(compiler) }) ) diff --git a/packages/taro-mini-runner/src/plugins/VirtualModulePlugin/VirtualModulePlugin.ts b/packages/taro-mini-runner/src/plugins/VirtualModulePlugin/VirtualModulePlugin.ts new file mode 100644 index 000000000000..e385d78561d3 --- /dev/null +++ b/packages/taro-mini-runner/src/plugins/VirtualModulePlugin/VirtualModulePlugin.ts @@ -0,0 +1,126 @@ +import * as path from 'path' +import VirtualStats from './virtualStats' + +export default class VirtualModulePlugin { + options: { + moduleName: string + contents: any + path?: string + } + constructor (options) { + this.options = options + } + + apply(compiler) { + const moduleName = this.options.moduleName + const ctime = VirtualModulePlugin.statsDate() + let modulePath = this.options.path + + let contents + if (typeof this.options.contents === 'string') { + contents = this.options.contents + } + if (typeof this.options.contents === 'object') { + if (typeof this.options.contents.then !== 'function') { + contents = JSON.stringify(this.options.contents) + } + } + if (typeof this.options.contents === 'function') { + contents = this.options.contents() + } + if (typeof contents === 'string') { + contents = Promise.resolve(contents) + } + + function resolverPlugin(request, cb) { + // populate the file system cache with the virtual module + const fs = (this && this.fileSystem) || compiler.inputFileSystem + const join = (this && this.join) || path.join + + if (typeof request === 'string') { + request = cb + cb = null + } + + if (!modulePath) { + modulePath = join(compiler.context, moduleName) + } + + const resolve = (data) => { + VirtualModulePlugin.populateFilesystem({ fs, modulePath, contents: data, ctime }) + } + + const resolved = contents.then(resolve) + if (!cb) { + return + } + + resolved.then(() => cb()) + } + + compiler.hooks.normalModuleFactory.tap('VirtualModulePlugin', (nmf) => { + nmf.hooks.beforeResolve.tap('VirtualModulePlugin', resolverPlugin) + }) + } + + static populateFilesystem(options) { + const fs = options.fs + const modulePath = options.modulePath + const contents = options.contents + const mapIsAvailable = typeof Map !== 'undefined' + const statStorageIsMap = mapIsAvailable && fs._statStorage.data instanceof Map + const readFileStorageIsMap = mapIsAvailable && fs._readFileStorage.data instanceof Map + + const stats = VirtualModulePlugin.createStats(options) + if (statStorageIsMap) { // enhanced-resolve@3.4.0 or greater + fs._statStorage.data.set(modulePath, [null, stats]) + } else { // enhanced-resolve@3.3.0 or lower + fs._statStorage.data[modulePath] = [null, stats] + } + if (readFileStorageIsMap) { // enhanced-resolve@3.4.0 or greater + fs._readFileStorage.data.set(modulePath, [null, contents]) + } else { // enhanced-resolve@3.3.0 or lower + fs._readFileStorage.data[modulePath] = [null, contents] + } + } + + static statsDate (inputDate?) { + if (!inputDate) { + inputDate = new Date() + } + return inputDate.toString() + } + + static createStats(options) { + if (!options) { + options = {} + } + if (!options.ctime) { + options.ctime = VirtualModulePlugin.statsDate() + } + if (!options.mtime) { + options.mtime = VirtualModulePlugin.statsDate() + } + if (!options.size) { + options.size = 0 + } + if (!options.size && options.contents) { + options.size = options.contents.length + } + return new VirtualStats({ + dev: 8675309, + nlink: 1, + uid: 501, + gid: 20, + rdev: 0, + blksize: 4096, + ino: 44700000, + mode: 33188, + size: options.size, + atime: options.mtime, + mtime: options.mtime, + ctime: options.ctime, + birthtime: options.ctime, + }) + } +} diff --git a/packages/taro-mini-runner/src/plugins/VirtualModulePlugin/virtualStats.ts b/packages/taro-mini-runner/src/plugins/VirtualModulePlugin/virtualStats.ts new file mode 100644 index 000000000000..459dbbfa74b0 --- /dev/null +++ b/packages/taro-mini-runner/src/plugins/VirtualModulePlugin/virtualStats.ts @@ -0,0 +1,92 @@ +/** + * Used to cache a stats object for the virtual file. + * Extracted from the `mock-fs` package. + * + * @author Tim Schaub http://tschaub.net/ + * @link https://github.com/tschaub/mock-fs/blob/master/lib/binding.js + * @link https://github.com/tschaub/mock-fs/blob/master/license.md + */ + +import * as constants from 'constants' + +export default class VirtualStats { + mode: number + /** + * Create a new stats object. + * @param {Object} config Stats properties. + * @constructor + */ + constructor (config) { + for (const key in config) { + if (!config.hasOwnProperty(key)) { + continue + } + this[key] = config[key] + } + } + + /** + * Check if mode indicates property. + * @param {number} property Property to check. + * @return {boolean} Property matches mode. + */ + _checkModeProperty(property) { + return ((this.mode & constants.S_IFMT) === property) + } + + + /** + * @return {Boolean} Is a directory. + */ + isDirectory() { + return this._checkModeProperty(constants.S_IFDIR) + } + + + /** + * @return {Boolean} Is a regular file. + */ + isFile() { + return this._checkModeProperty(constants.S_IFREG) + } + + + /** + * @return {Boolean} Is a block device. + */ + isBlockDevice() { + return this._checkModeProperty(constants.S_IFBLK) + } + + + /** + * @return {Boolean} Is a character device. + */ + isCharacterDevice() { + return this._checkModeProperty(constants.S_IFCHR) + } + + + /** + * @return {Boolean} Is a symbolic link. + */ + isSymbolicLink() { + return this._checkModeProperty(constants.S_IFLNK) + } + + + /** + * @return {Boolean} Is a named pipe. + */ + isFIFO() { + return this._checkModeProperty(constants.S_IFIFO) + } + + + /** + * @return {Boolean} Is a socket. + */ + isSocket() { + return this._checkModeProperty(constants.S_IFSOCK) + } +} From ddf21991b458b8839e285a3142d59b774cce7dd7 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 4 Sep 2019 14:34:57 +0800 Subject: [PATCH 045/194] chore: merge master --- packages/taro-cli/src/build.ts | 2 +- packages/taro-mini-runner/package.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/taro-cli/src/build.ts b/packages/taro-cli/src/build.ts index 3eecf8b21efc..b63c4ddeed71 100644 --- a/packages/taro-cli/src/build.ts +++ b/packages/taro-cli/src/build.ts @@ -86,7 +86,7 @@ export default class Builder { }) break default: - console.log(chalk.red('输入类型错误,目前只支持 weapp/swan/alipay/tt/h5/quickapp/rn 七端类型')) + console.log(chalk.red('输入类型错误,目前只支持 weapp/swan/alipay/tt/qq/h5/quickapp/rn 八端类型')) } } diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index 1fba690426b5..da9169188524 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "1.3.14", + "version": "1.3.17", "description": "Mini app runner for taro", "main": "index.js", "scripts": { @@ -32,8 +32,8 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/taro": "1.3.14", - "@tarojs/transformer-wx": "1.3.14", + "@tarojs/taro": "1.3.17", + "@tarojs/transformer-wx": "1.3.17", "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", From 0d7e5c84025cbc9913806a4e46c4d0a23ce934c2 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 5 Sep 2019 20:26:32 +0800 Subject: [PATCH 046/194] =?UTF-8?q?feat(taro):=20=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=BF=AB=E5=BA=94=E7=94=A8=E7=BC=96=E8=AF=91=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/loaders/fileParseLoader.ts | 31 +++++++++++++++++-- .../src/plugins/MiniPlugin.ts | 1 + packages/taro-mini-runner/src/utils/helper.ts | 18 +++++++++++ packages/taro-mini-runner/src/utils/index.ts | 2 +- .../src/webpack/build.conf.ts | 24 +++++++++++--- 5 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 packages/taro-mini-runner/src/utils/helper.ts diff --git a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts index ac4fd54c4a9a..5b8f9b33f1f9 100644 --- a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts +++ b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts @@ -28,6 +28,8 @@ const template = require('babel-template') const cannotRemoves = ['@tarojs/taro', 'react', 'nervjs'] +const NON_WEBPACK_REQUIRE = '__non_webpack_require__' + function processAst ( ast: t.File, buildAdapter: BUILD_TYPES, @@ -173,10 +175,31 @@ function processAst ( const source = node.source let value = source.value const specifiers = node.specifiers + if (isQuickApp && isQuickAppPkg(value)) { + let defaultSpecifier: string = 'LOCAL' + specifiers.forEach(item => { + if (item.type === 'ImportDefaultSpecifier') { + defaultSpecifier = item.local.name + } + }) + astPath.replaceWith( + t.variableDeclaration('const', [ + t.variableDeclarator( + t.identifier(defaultSpecifier), + t.callExpression( + t.identifier(NON_WEBPACK_REQUIRE),[ + t.stringLiteral(value) + ] + ) + ) + ]) + ) + return + } if (NODE_MODULES_REG.test(sourceFilePath) && sourceFilePath.indexOf(taroMiniAppFramework) >= 0) { return } - if (isNpmPkg(value) && !isQuickAppPkg(value)) { + if (isNpmPkg(value)) { if (value === taroJsComponents) { if (isQuickApp) { specifiers.forEach(specifier => { @@ -227,10 +250,14 @@ function processAst ( const args = node.arguments as t.StringLiteral[] let value = args[0].value const parentNode = astPath.parentPath.parentPath.node as t.VariableDeclaration + if (isQuickApp && isQuickAppPkg(value)) { + callee.name = NON_WEBPACK_REQUIRE + return + } if (NODE_MODULES_REG.test(sourceFilePath) && sourceFilePath.indexOf(taroMiniAppFramework) >= 0) { return } - if (isNpmPkg(value) && !isQuickAppPkg(value)) { + if (isNpmPkg(value)) { if (value === taroJsComponents) { if (isQuickApp) { if (parentNode.declarations.length === 1 && parentNode.declarations[0].init) { diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 705fbba1deae..13c559b0ec37 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -60,6 +60,7 @@ export const Targets = { [BUILD_TYPES.SWAN]: createTarget(BUILD_TYPES.SWAN), [BUILD_TYPES.TT]: createTarget(BUILD_TYPES.TT), [BUILD_TYPES.QQ]: createTarget(BUILD_TYPES.QQ), + [BUILD_TYPES.QUICKAPP]: createTarget(BUILD_TYPES.QUICKAPP) } export function isFileToBeTaroComponent ( diff --git a/packages/taro-mini-runner/src/utils/helper.ts b/packages/taro-mini-runner/src/utils/helper.ts new file mode 100644 index 000000000000..b8c3f4bfb016 --- /dev/null +++ b/packages/taro-mini-runner/src/utils/helper.ts @@ -0,0 +1,18 @@ +import * as path from 'path' +import * as fs from 'fs' +import { isEmptyObject } from '.' + +let quickappConfig = {} + +export function getQuickappConfig (appPath) { + if (!isEmptyObject(quickappConfig)) { + return quickappConfig + } + const configPath = path.join(appPath, 'project.quickapp.json') + if (!fs.existsSync(configPath)) { + quickappConfig = require('../config/manifest.default.json') + } else { + quickappConfig = JSON.parse(fs.readFileSync(configPath).toString()) + } + return quickappConfig +} diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index d944d600b075..1b3b5cdf8964 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -18,7 +18,7 @@ export function isNpmPkg (name: string): boolean { } export function isQuickAppPkg (name: string): boolean { - return /@system\./.test(name) + return /^@(system|service)\.[a-zA-Z]{1,}/.test(name) } export function isEmptyObject (obj: any): boolean { diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts index cbdeeecc2228..48478f9f9d8d 100644 --- a/packages/taro-mini-runner/src/webpack/build.conf.ts +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -13,10 +13,11 @@ import { getModule, mergeOption, getMiniPlugin, - getMiniCssExtractPlugin + getMiniCssExtractPlugin, } from './chain' import { BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES } from '../utils/constants' import { Targets } from '../plugins/MiniPlugin' +import { getQuickappConfig } from '../utils/helper' const emptyObj = {} @@ -56,6 +57,7 @@ export default (appPath: string, mode, config: Partial): any => { const plugin: any = {} const minimizer: any[] = [] const sourceDir = path.join(appPath, sourceRoot) + const isQuickapp = buildAdapter === BUILD_TYPES.QUICKAPP if (copy) { plugin.copyWebpackPlugin = getCopyWebpackPlugin({ copy, appPath }) @@ -90,8 +92,7 @@ export default (appPath: string, mode, config: Partial): any => { plugin.cssoWebpackPlugin = getCssoWebpackPlugin([csso ? csso.config : {}]) } } - - chain.merge({ + const mainConfig = { mode, devtool: getDevtool(enableSourceMap), entry, @@ -156,6 +157,21 @@ export default (appPath: string, mode, config: Partial): any => { } } } - }) + } + + // if (isQuickapp) { + // const quickappConfig = getQuickappConfig(appPath) + // const features = quickappConfig['features'] + // if (features && features.length) { + // const externals = {} + // features.forEach(item => { + // externals[`@${item.name}`] = { + // root: `@${item.name}` + // } + // }) + // mainConfig['externals'] = externals + // } + // } + chain.merge(mainConfig) return chain } From d469c842fee0ab729ad61b98d842c4d54922d786 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Sun, 8 Sep 2019 17:58:12 +0800 Subject: [PATCH 047/194] =?UTF-8?q?fix(mini-runner):=20=E6=8F=90=E5=89=8D?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E5=BF=AB=E5=BA=94=E7=94=A8=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/MiniPlugin.ts | 50 ++++++++++++++++--- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 13c559b0ec37..406080113965 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -121,6 +121,7 @@ export default class MiniPlugin { components: Set sourceDir: string context: string + appConfig: IConfig constructor (options = {}) { this.options = defaults(options || {}, { @@ -200,9 +201,11 @@ export default class MiniPlugin { ast: t.File, buildAdapter: BUILD_TYPES ): { - configObj: IConfig + configObj: IConfig, + hasEnablePageScroll: boolean } { let configObj = {} + let hasEnablePageScroll traverse(ast, { ClassDeclaration (astPath) { const node = astPath.node @@ -242,6 +245,12 @@ export default class MiniPlugin { } } }, + ClassMethod (astPath) { + const keyName = (astPath.get('key').node as t.Identifier).name + if (keyName === 'onPageScroll' || keyName === 'onReachBottom') { + hasEnablePageScroll = true + } + }, ClassProperty (astPath) { const node = astPath.node const keyName = node.key.name @@ -252,7 +261,8 @@ export default class MiniPlugin { }) return { - configObj + configObj, + hasEnablePageScroll } } @@ -412,6 +422,7 @@ export default class MiniPlugin { }) const { configObj } = this.parseAst(transformResult.ast, buildAdapter) const appPages = configObj.pages + this.appConfig = configObj if (!appPages || appPages.length === 0) { throw new Error('缺少页面') } @@ -439,6 +450,7 @@ export default class MiniPlugin { getComponents (fileList: Set, isRoot: boolean) { const { buildAdapter } = this.options + const isQuickApp = buildAdapter === BUILD_TYPES.QUICKAPP fileList.forEach(file => { const isNative = file.isNative const isComponentConfig = isRoot ? {} : { component: true } @@ -462,11 +474,34 @@ export default class MiniPlugin { })) : [] } } else { + const rootProps: { [key: string]: any } = {} + if (isQuickApp && isRoot) { + // 如果是快应用,需要提前解析一次 ast,获取 config + const aheadTransformResult = wxTransformer({ + code, + sourcePath: file.path, + isRoot, + isTyped: REG_TYPESCRIPT.test(file.path), + adapter: buildAdapter + }) + const res = this.parseAst(aheadTransformResult.ast, buildAdapter) + if (res.configObj.enablePullDownRefresh || (this.appConfig.window && this.appConfig.window.enablePullDownRefresh)) { + rootProps.enablePullDownRefresh = true + } + if (this.appConfig.tabBar) { + rootProps.tabBar = this.appConfig.tabBar + } + rootProps.pagePath = file.path.replace(this.sourceDir, '').replace(path.extname(file.path), '') + if (res.hasEnablePageScroll) { + rootProps.enablePageScroll = true + } + } const transformResult = wxTransformer({ code, sourcePath: file.path, isTyped: REG_TYPESCRIPT.test(file.path), isRoot, + rootProps: isEmptyObject(rootProps) || rootProps, adapter: buildAdapter }) configObj = this.parseAst(transformResult.ast, buildAdapter).configObj @@ -541,6 +576,7 @@ export default class MiniPlugin { generateMiniFiles (compilation: webpack.compilation.Compilation) { const { buildAdapter } = this.options + const isQuickApp = buildAdapter === BUILD_TYPES.QUICKAPP Object.keys(taroFileTypeMap).forEach(item => { let relativePath if (NODE_MODULES_REG.test(item)) { @@ -558,10 +594,12 @@ export default class MiniPlugin { source: () => itemInfo.template } } - const jsonStr = JSON.stringify(itemInfo.config) - compilation.assets[jsonPath] = { - size: () => jsonStr.length, - source: () => jsonStr + if (!isQuickApp) { + const jsonStr = JSON.stringify(itemInfo.config) + compilation.assets[jsonPath] = { + size: () => jsonStr.length, + source: () => jsonStr + } } }) } From 4fd3152dac3ea43b4e82296acbfe1159a196580f Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 9 Sep 2019 22:28:53 +0800 Subject: [PATCH 048/194] =?UTF-8?q?feat(mini-runner):=20=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=BF=AB=E5=BA=94=E7=94=A8=E9=A1=B5=E9=9D=A2=E5=8F=8A=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/MiniPlugin.ts | 182 ++++++++++-------- packages/taro-mini-runner/src/utils/helper.ts | 67 ++++++- packages/taro-mini-runner/src/utils/index.ts | 9 + .../taro-mini-runner/src/utils/parseAst.ts | 119 ++++++++++++ packages/taro-mini-runner/src/utils/types.ts | 3 +- .../src/webpack/build.conf.ts | 4 +- .../taro-mini-runner/src/webpack/chain.ts | 4 +- 7 files changed, 300 insertions(+), 88 deletions(-) create mode 100644 packages/taro-mini-runner/src/utils/parseAst.ts diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 406080113965..12172380577a 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -13,11 +13,14 @@ import { merge, defaults, kebabCase } from 'lodash' import * as t from 'babel-types' import traverse from 'babel-traverse' import { Config as IConfig } from '@tarojs/taro' +import * as _ from 'lodash' -import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP, taroJsFramework } from '../utils/constants' +import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP, taroJsFramework, taroJsComponents, QUICKAPP_SPECIAL_COMPONENTS, taroJsQuickAppComponents } from '../utils/constants' import { IComponentObj } from '../utils/types' -import { traverseObjectNode, resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync, isEmptyObject } from '../utils' +import { resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync, isEmptyObject, promoteRelativePath } from '../utils' import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency' +import { getTaroJsQuickAppComponentsPath, generateQuickAppUx, getImportTaroSelfComponents } from '../utils/helper' +import parseAst from '../utils/parseAst' import TaroLoadChunksPlugin from './TaroLoadChunksPlugin' import TaroNormalModulesPlugin from './TaroNormalModulesPlugin' @@ -26,6 +29,9 @@ import VirtualModulePlugin from './VirtualModulePlugin/VirtualModulePlugin' interface IMiniPluginOptions { appEntry?: string, buildAdapter: BUILD_TYPES, + nodeModulesPath: string, + sourceDir: string, + outputDir: string, commonChunks: string[] } @@ -34,7 +40,11 @@ export interface ITaroFileInfo { type: PARSE_AST_TYPE, config: IConfig, template?: string, - code?: string + code?: string, + taroSelfComponents?: Set<{ + name: string, + path: string + }> } } @@ -120,14 +130,20 @@ export default class MiniPlugin { pages: Set components: Set sourceDir: string + outputDir: string context: string appConfig: IConfig constructor (options = {}) { this.options = defaults(options || {}, { buildAdapter: BUILD_TYPES.WEAPP, + nodeModulesPath: '', + sourceDir: '', + outputDir: '', commonChunks: ['runtime', 'vendors'] }) + this.sourceDir = this.options.sourceDir + this.outputDir = this.options.outputDir this.pages = new Set() this.components = new Set() @@ -192,80 +208,10 @@ export default class MiniPlugin { return app } const appEntryPath = getEntryPath(entry) - this.sourceDir = path.dirname(appEntryPath) compiler.options.entry = {} return appEntryPath } - parseAst ( - ast: t.File, - buildAdapter: BUILD_TYPES - ): { - configObj: IConfig, - hasEnablePageScroll: boolean - } { - let configObj = {} - let hasEnablePageScroll - traverse(ast, { - ClassDeclaration (astPath) { - const node = astPath.node - let hasCreateData = false - if (node.superClass) { - astPath.traverse({ - ClassMethod (astPath) { - if (astPath.get('key').isIdentifier({ name: '_createData' })) { - hasCreateData = true - } - } - }) - if (hasCreateData) { - astPath.traverse({ - ClassMethod (astPath) { - const node = astPath.node - if (node.kind === 'constructor') { - astPath.traverse({ - ExpressionStatement (astPath) { - const node = astPath.node - if (node.expression && - node.expression.type === 'AssignmentExpression' && - node.expression.operator === '=') { - const left = node.expression.left - if (left.type === 'MemberExpression' && - left.object.type === 'ThisExpression' && - left.property.type === 'Identifier' && - left.property.name === 'config') { - configObj = traverseObjectNode(node.expression.right, buildAdapter) - } - } - } - }) - } - } - }) - } - } - }, - ClassMethod (astPath) { - const keyName = (astPath.get('key').node as t.Identifier).name - if (keyName === 'onPageScroll' || keyName === 'onReachBottom') { - hasEnablePageScroll = true - } - }, - ClassProperty (astPath) { - const node = astPath.node - const keyName = node.key.name - if (keyName === 'config') { - configObj = traverseObjectNode(node, buildAdapter) - } - } - }) - - return { - configObj, - hasEnablePageScroll - } - } - getNpmComponentRealPath (code: string, component: IComponentObj, adapter: BUILD_TYPES): string | null { let componentRealPath: string | null = null let importExportName @@ -420,7 +366,7 @@ export default class MiniPlugin { isApp: true, adapter: buildAdapter }) - const { configObj } = this.parseAst(transformResult.ast, buildAdapter) + const { configObj } = parseAst(transformResult.ast, buildAdapter) const appPages = configObj.pages this.appConfig = configObj if (!appPages || appPages.length === 0) { @@ -448,6 +394,18 @@ export default class MiniPlugin { return fs.existsSync(templatePath) && jsContent.indexOf(taroJsFramework) < 0 } + getComponentName (componentPath) { + let componentName + if (NODE_MODULES_REG.test(componentPath)) { + componentName = componentPath.replace(this.context, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') + componentName = componentName.replace(/node_modules/gi, 'npm') + } else { + componentName = componentPath.replace(this.sourceDir, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') + } + + return componentName + } + getComponents (fileList: Set, isRoot: boolean) { const { buildAdapter } = this.options const isQuickApp = buildAdapter === BUILD_TYPES.QUICKAPP @@ -456,6 +414,7 @@ export default class MiniPlugin { const isComponentConfig = isRoot ? {} : { component: true } let configObj + let taroSelfComponents let depComponents let template let code = fs.readFileSync(file.path).toString() @@ -484,7 +443,7 @@ export default class MiniPlugin { isTyped: REG_TYPESCRIPT.test(file.path), adapter: buildAdapter }) - const res = this.parseAst(aheadTransformResult.ast, buildAdapter) + const res = parseAst(aheadTransformResult.ast, buildAdapter) if (res.configObj.enablePullDownRefresh || (this.appConfig.window && this.appConfig.window.enablePullDownRefresh)) { rootProps.enablePullDownRefresh = true } @@ -504,7 +463,9 @@ export default class MiniPlugin { rootProps: isEmptyObject(rootProps) || rootProps, adapter: buildAdapter }) - configObj = this.parseAst(transformResult.ast, buildAdapter).configObj + let parseAstRes = parseAst(transformResult.ast, buildAdapter) + configObj = parseAstRes.configObj + taroSelfComponents = parseAstRes.taroSelfComponents const usingComponents = configObj.usingComponents if (usingComponents) { Object.keys(usingComponents).forEach(item => { @@ -514,30 +475,68 @@ export default class MiniPlugin { }) }) } + if (isRoot) { + taroSelfComponents.add('taro-page') + } depComponents = transformResult.components template = transformResult.template code = transformResult.code } depComponents = depComponents.filter(item => !/^plugin:\/\//.test(item.path)) this.transfromComponentsPath(depComponents) + if (isQuickApp) { + const scriptPath = file.path + const outputScriptPath = scriptPath.replace(this.sourceDir, this.outputDir).replace(path.extname(scriptPath), MINI_APP_FILES[buildAdapter].SCRIPT) + const stylePath = outputScriptPath.replace(path.extname(outputScriptPath), MINI_APP_FILES[buildAdapter].STYLE) + const templPath = outputScriptPath.replace(path.extname(outputScriptPath), MINI_APP_FILES[buildAdapter].TEMPL) + const styleRelativePath = promoteRelativePath(path.relative(outputScriptPath, stylePath)) + const scriptRelativePath = promoteRelativePath(path.relative(templPath, outputScriptPath)) + const importTaroSelfComponents = getImportTaroSelfComponents(outputScriptPath, this.options.nodeModulesPath, taroSelfComponents) + const usingComponents = configObj.usingComponents + let importUsingComponent: any = new Set([]) + if (usingComponents) { + importUsingComponent = new Set(Object.keys(usingComponents).map(item => { + return { + name: item, + path: usingComponents[item] + } + })) + } + const importCustomComponents = new Set(depComponents.map(item => { + return { + path: item.path, + name: item.name as string + } + })) + template = generateQuickAppUx({ + template, + script: scriptRelativePath, + style: styleRelativePath, + imports: new Set([...importTaroSelfComponents, ...importUsingComponent, ...importCustomComponents]) + }) + } taroFileTypeMap[file.path] = { type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, config: merge({}, isComponentConfig, buildUsingComponents(file.path, this.sourceDir, {}, depComponents), configObj), template, code } + if (taroSelfComponents) { + taroFileTypeMap[file.path].taroSelfComponents = new Set(Array.from(taroSelfComponents).map(item => { + const taroJsQuickAppComponentsPath = getTaroJsQuickAppComponentsPath(this.options.nodeModulesPath) + const componentPath = path.join(taroJsQuickAppComponentsPath, item as string, `index${MINI_APP_FILES[buildAdapter].TEMPL}`) + return { + name: item as string, + path: componentPath + } + })) + } if (depComponents && depComponents.length) { depComponents.forEach(item => { const componentPath = resolveScriptPath(path.resolve(path.dirname(file.path), item.path)) if (fs.existsSync(componentPath) && !Array.from(this.components).some(item => item.path === componentPath)) { - let componentName - if (NODE_MODULES_REG.test(componentPath)) { - componentName = componentPath.replace(this.context, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') - componentName = componentName.replace(/node_modules/gi, 'npm') - } else { - componentName = componentPath.replace(this.sourceDir, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') - } + const componentName = this.getComponentName(componentPath) const componentTempPath = this.getTemplatePath(componentPath) const isNative = this.isNativePageORComponent(componentTempPath, fs.readFileSync(componentPath).toString()) const componentObj = { name: componentName, path: componentPath, isNative } @@ -601,6 +600,23 @@ export default class MiniPlugin { source: () => jsonStr } } + if (itemInfo.taroSelfComponents) { + itemInfo.taroSelfComponents.forEach(item => { + if (fs.existsSync(item.path)) { + const content = fs.readFileSync(item.path).toString() + let relativePath + if (NODE_MODULES_REG.test(item.path)) { + relativePath = item.path.replace(this.context, '').replace(/node_modules/gi, 'npm') + } else { + relativePath = item.path.replace(this.sourceDir, '') + } + compilation.assets[relativePath] = { + size: () => content.length, + source: () => content + } + } + }) + } }) } diff --git a/packages/taro-mini-runner/src/utils/helper.ts b/packages/taro-mini-runner/src/utils/helper.ts index b8c3f4bfb016..c58c3419bc76 100644 --- a/packages/taro-mini-runner/src/utils/helper.ts +++ b/packages/taro-mini-runner/src/utils/helper.ts @@ -1,6 +1,7 @@ import * as path from 'path' import * as fs from 'fs' -import { isEmptyObject } from '.' +import { isEmptyObject, getInstalledNpmPkgPath, promoteRelativePath } from '.' +import { taroJsQuickAppComponents, REG_STYLE, REG_SCRIPT } from './constants' let quickappConfig = {} @@ -16,3 +17,67 @@ export function getQuickappConfig (appPath) { } return quickappConfig } + +export function getTaroJsQuickAppComponentsPath (nodeModulesPath: string): string { + const taroJsQuickAppComponentsPkg = getInstalledNpmPkgPath(taroJsQuickAppComponents, nodeModulesPath) + if (!taroJsQuickAppComponentsPkg) { + // printLog(processTypeEnum.ERROR, '包安装', `缺少包 ${taroJsQuickAppComponents},请安装!`) + process.exit(0) + } + return path.join(path.dirname(taroJsQuickAppComponentsPkg as string), 'src/components') +} + +export function getImportTaroSelfComponents (filePath, nodeModulesPath, taroSelfComponents) { + const importTaroSelfComponents = new Set<{ path: string, name: string }>() + const taroJsQuickAppComponentsPath = getTaroJsQuickAppComponentsPath(nodeModulesPath) + taroSelfComponents.forEach(c => { + const cPath = path.join(taroJsQuickAppComponentsPath, c) + const cMainPath = path.join(cPath, 'index') + const cRelativePath = promoteRelativePath(path.relative(filePath, cMainPath.replace(nodeModulesPath, 'npm'))) + importTaroSelfComponents.add({ + path: cRelativePath, + name: c + }) + }) + return importTaroSelfComponents +} + +export function generateQuickAppUx ({ + script, + template, + style, + imports +}: { + script?: string, + template?: string, + style?: string, + imports?: Set<{ + path: string, + name: string + }> +}) { + let uxTxt = '' + if (imports && imports.size) { + imports.forEach(item => { + uxTxt += `\n` + }) + } + if (style) { + if (REG_STYLE.test(style)) { + uxTxt += `\n` + } else { + uxTxt += `\n` + } + } + if (template) { + uxTxt += `\n` + } + if (script) { + if (REG_SCRIPT.test(script)) { + uxTxt += `\n` + } else { + uxTxt += `\n` + } + } + return uxTxt +} diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index 1b3b5cdf8964..b5d40c4ad190 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -202,3 +202,12 @@ export function recursiveMerge (src, ...args) { } }) } + +export function getInstalledNpmPkgPath (pkgName: string, basedir: string): string | null { + const resolvePath = require('resolve') + try { + return resolvePath.sync(`${pkgName}/package.json`, { basedir }) + } catch (err) { + return null + } +} diff --git a/packages/taro-mini-runner/src/utils/parseAst.ts b/packages/taro-mini-runner/src/utils/parseAst.ts new file mode 100644 index 000000000000..ce8a1bd9c8b6 --- /dev/null +++ b/packages/taro-mini-runner/src/utils/parseAst.ts @@ -0,0 +1,119 @@ +import { Config as IConfig } from '@tarojs/taro' +import * as t from 'babel-types' +import traverse from 'babel-traverse' + +import { BUILD_TYPES, taroJsComponents, QUICKAPP_SPECIAL_COMPONENTS } from './constants' +import { traverseObjectNode, isNpmPkg } from '../utils' +import * as _ from 'lodash' + +export default function parseAst ( + ast: t.File, + buildAdapter: BUILD_TYPES +): { + configObj: IConfig, + hasEnablePageScroll: boolean, + taroSelfComponents: Set, +} { + let configObj = {} + let hasEnablePageScroll + const taroSelfComponents = new Set() + const isQuickApp = buildAdapter === BUILD_TYPES.QUICKAPP + + traverse(ast, { + ClassDeclaration (astPath) { + const node = astPath.node + let hasCreateData = false + if (node.superClass) { + astPath.traverse({ + ClassMethod (astPath) { + if (astPath.get('key').isIdentifier({ name: '_createData' })) { + hasCreateData = true + } + } + }) + if (hasCreateData) { + astPath.traverse({ + ClassMethod (astPath) { + const node = astPath.node + if (node.kind === 'constructor') { + astPath.traverse({ + ExpressionStatement (astPath) { + const node = astPath.node + if (node.expression && + node.expression.type === 'AssignmentExpression' && + node.expression.operator === '=') { + const left = node.expression.left + if (left.type === 'MemberExpression' && + left.object.type === 'ThisExpression' && + left.property.type === 'Identifier' && + left.property.name === 'config') { + configObj = traverseObjectNode(node.expression.right, buildAdapter) + } + } + } + }) + } + } + }) + } + } + }, + ClassMethod (astPath) { + const keyName = (astPath.get('key').node as t.Identifier).name + if (keyName === 'onPageScroll' || keyName === 'onReachBottom') { + hasEnablePageScroll = true + } + }, + ClassProperty (astPath) { + const node = astPath.node + const keyName = node.key.name + if (keyName === 'config') { + configObj = traverseObjectNode(node, buildAdapter) + } + }, + ImportDeclaration (astPath) { + const node = astPath.node + const source = node.source + let value = source.value + const specifiers = node.specifiers + if (isNpmPkg(value) && isQuickApp && value === taroJsComponents) { + specifiers.forEach(specifier => { + const name = specifier.local.name + if (!QUICKAPP_SPECIAL_COMPONENTS.has(name)) { + taroSelfComponents.add(_.kebabCase(name)) + } + }) + astPath.remove() + } + }, + CallExpression (astPath) { + const node = astPath.node + const callee = node.callee as t.Identifier + if (callee.name === 'require') { + const args = node.arguments as t.StringLiteral[] + let value = args[0].value + const parentNode = astPath.parentPath.parentPath.node as t.VariableDeclaration + if (isNpmPkg(value) && isQuickApp && value === taroJsComponents) { + if (parentNode.declarations.length === 1 && parentNode.declarations[0].init) { + const id = parentNode.declarations[0].id + if (id.type === 'ObjectPattern') { + const properties = id.properties as any + properties.forEach(p => { + if (p.type === 'ObjectProperty' && p.value.type === 'Identifier') { + taroSelfComponents.add(_.kebabCase(p.value.name)) + } + }) + } + } + astPath.remove() + } + } + } + }) + + return { + configObj, + hasEnablePageScroll, + taroSelfComponents + } +} diff --git a/packages/taro-mini-runner/src/utils/types.ts b/packages/taro-mini-runner/src/utils/types.ts index e5060d7ef4c6..478eb3ad0ca9 100644 --- a/packages/taro-mini-runner/src/utils/types.ts +++ b/packages/taro-mini-runner/src/utils/types.ts @@ -22,5 +22,6 @@ export interface IChain { export interface IBuildConfig extends IProjectBaseConfig, IMiniAppConfig { isWatch: boolean, port?: number, - buildAdapter: BUILD_TYPES + buildAdapter: BUILD_TYPES, + nodeModulesPath: string } diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts index 48478f9f9d8d..6519ac3cda7d 100644 --- a/packages/taro-mini-runner/src/webpack/build.conf.ts +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -48,6 +48,7 @@ export default (appPath: string, mode, config: Partial): any => { miniCssExtractPluginOption = emptyObj, postcss = emptyObj, + nodeModulesPath, babel, csso, @@ -57,6 +58,7 @@ export default (appPath: string, mode, config: Partial): any => { const plugin: any = {} const minimizer: any[] = [] const sourceDir = path.join(appPath, sourceRoot) + const outputDir = path.join(appPath, outputRoot) const isQuickapp = buildAdapter === BUILD_TYPES.QUICKAPP if (copy) { @@ -64,7 +66,7 @@ export default (appPath: string, mode, config: Partial): any => { } const constantsReplaceList = mergeOption([processEnvOption(env), defineConstants]) plugin.definePlugin = getDefinePlugin([constantsReplaceList]) - plugin.miniPlugin = getMiniPlugin({ buildAdapter, constantsReplaceList }) + plugin.miniPlugin = getMiniPlugin({ sourceDir, outputDir, buildAdapter, constantsReplaceList, nodeModulesPath }) plugin.miniCssExtractPlugin = getMiniCssExtractPlugin([{ filename: `[name]${MINI_APP_FILES[buildAdapter].STYLE}`, diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index 75592f6c8657..5c2c13ff0d73 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -15,7 +15,7 @@ import { getPostcssPlugins } from './postcss.conf' import MiniPlugin from '../plugins/MiniPlugin' import { IOption } from '../utils/types' import { recursiveMerge, isNodeModule } from '../utils' -import { REG_SASS, REG_LESS, REG_STYLUS, REG_STYLE, REG_MEDIA, REG_FONT, REG_IMAGE, BUILD_TYPES, REG_SCRIPTS, MINI_APP_FILES } from '../utils/constants' +import { REG_SASS, REG_LESS, REG_STYLUS, REG_STYLE, REG_MEDIA, REG_FONT, REG_IMAGE, BUILD_TYPES, REG_SCRIPTS, MINI_APP_FILES, REG_UX } from '../utils/constants' const globalObjectMap = { [BUILD_TYPES.WEAPP]: 'wx', @@ -257,7 +257,7 @@ export const getModule = (appPath: string, { buildAdapter }]) - const rule = { + const rule: any = { sass: { test: REG_SASS, enforce: 'pre', From 236ebaadd3d686a190c9706ed6c184ce96a6c331 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 16 Sep 2019 20:02:47 +0800 Subject: [PATCH 049/194] =?UTF-8?q?feat(mini-runner):=20=E4=BF=9D=E8=AF=81?= =?UTF-8?q?=E5=BF=AB=E5=BA=94=E7=94=A8=E6=96=87=E4=BB=B6=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/mini/helper.ts | 85 ++++++++++++++++++- packages/taro-mini-runner/package.json | 4 +- .../src/loaders/fileParseLoader.ts | 14 +-- .../src/plugins/MiniPlugin.ts | 75 +++++++++++----- .../src/plugins/TaroLoadChunksPlugin.ts | 79 ++++++++++------- packages/taro-mini-runner/src/utils/helper.ts | 78 ++++++++++++----- packages/taro-mini-runner/src/utils/index.ts | 1 + packages/taro-mini-runner/src/utils/types.ts | 3 +- .../src/webpack/build.conf.ts | 28 +++--- .../taro-mini-runner/src/webpack/chain.ts | 6 +- 10 files changed, 275 insertions(+), 98 deletions(-) diff --git a/packages/taro-cli/src/mini/helper.ts b/packages/taro-cli/src/mini/helper.ts index 5cb749ef92a3..9e848742adb4 100644 --- a/packages/taro-cli/src/mini/helper.ts +++ b/packages/taro-cli/src/mini/helper.ts @@ -1,7 +1,10 @@ import * as fs from 'fs-extra' import * as path from 'path' +import { execSync } from 'child_process' +import chalk from 'chalk' import * as _ from 'lodash' +import * as ora from 'ora' import { Config } from '@tarojs/taro' import { IProjectConfig, ITaroManifestConfig } from '@tarojs/taro/types/compile' import wxTransformer from '@tarojs/transformer-wx' @@ -32,8 +35,12 @@ import { recursiveFindNodeModules, getBabelConfig, extnameExpRegOf, - generateAlipayPath + generateAlipayPath, + unzip, + shouldUseYarn, + shouldUseCnpm } from '../util' +import { downloadGithubRepoLatestRelease } from '../util/dowload' import { resolveNpmPkgMainPath } from '../util/resolve_npm_files' import { resolveNpmSync } from '../util/npm' @@ -393,3 +400,79 @@ export function getImportTaroSelfComponents (filePath, taroSelfComponents) { }) return importTaroSelfComponents } + +export async function prepareQuickAppEnvironment (buildData: IBuildData) { + let isReady = false + let needDownload = false + let needInstall = false + const originalOutputDir = buildData.originalOutputDir + console.log() + if (fs.existsSync(path.join(buildData.originalOutputDir, 'sign'))) { + needDownload = false + } else { + needDownload = true + } + if (needDownload) { + const getSpinner = ora('开始下载快应用运行容器...').start() + await downloadGithubRepoLatestRelease('NervJS/quickapp-container', buildData.appPath, originalOutputDir) + await unzip(path.join(originalOutputDir, 'download_temp.zip')) + getSpinner.succeed('快应用运行容器下载完成') + } else { + console.log(`${chalk.green('✔ ')} 快应用容器已经准备好`) + } + process.chdir(originalOutputDir) + console.log() + if (fs.existsSync(path.join(originalOutputDir, 'node_modules'))) { + needInstall = false + } else { + needInstall = true + } + if (needInstall) { + let command + if (shouldUseYarn()) { + command = 'NODE_ENV=development yarn install' + } else if (shouldUseCnpm()) { + command = 'NODE_ENV=development cnpm install' + } else { + command = 'NODE_ENV=development npm install' + } + const installSpinner = ora(`安装快应用依赖环境, 需要一会儿...`).start() + try { + const stdout = execSync(command) + installSpinner.color = 'green' + installSpinner.succeed('安装成功') + console.log(`${stdout}`) + isReady = true + } catch (error) { + installSpinner.color = 'red' + installSpinner.fail(chalk.red(`快应用依赖环境安装失败,请进入 ${path.basename(originalOutputDir)} 重新安装!`)) + console.log(`${error}`) + isReady = false + } + } else { + console.log(`${chalk.green('✔ ')} 快应用依赖已经安装好`) + isReady = true + } + return isReady +} + +export async function runQuickApp (isWatch: boolean | void, buildData: IBuildData, port?: number, release?: boolean) { + const originalOutputDir = buildData.originalOutputDir + const { compile } = require(require.resolve('hap-toolkit/lib/commands/compile', { paths: [originalOutputDir] })) + if (isWatch) { + const { launchServer } = require(require.resolve('@hap-toolkit/server', { paths: [originalOutputDir] })) + launchServer({ + port: port || 12306, + watch: isWatch, + clearRecords: false, + disableADB: false + }) + compile('native', 'dev', true) + } else { + if (!release) { + compile('native', 'dev', false) + } else { + compile('native', 'prod', false) + } + } +} diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index da9169188524..c8de00de343e 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -56,6 +56,7 @@ "ora": "^3.4.0", "postcss-loader": "^3.0.0", "postcss-pxtransform": "^1.3.2", + "request": "^2.88.0", "resolve": "^1.11.1", "sass-loader": "^7.1.0", "stylus-loader": "^3.0.2", @@ -64,7 +65,8 @@ "virtual-module-webpack-plugin": "^0.4.1", "webpack": "^4.31.0", "webpack-chain": "^6.0.0", - "webpack-format-messages": "^2.0.5" + "webpack-format-messages": "^2.0.5", + "yauzl": "2.10.0" }, "devDependencies": { "@types/babel-core": "^6.25.6", diff --git a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts index 5b8f9b33f1f9..c341baa6c463 100644 --- a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts +++ b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts @@ -435,7 +435,8 @@ function processAst ( template(`import Taro from '${taroMiniAppFramework}'`, babylonConfig as any)() as any ) } - node.body.push(template(`export default require('${taroMiniAppFramework}').default.createApp(${exportVariableName})`, babylonConfig as any)() as any) + node.body.push(template(`exportRes = require('${taroMiniAppFramework}').default.createApp(${exportVariableName})`, babylonConfig as any)() as any) + node.body.push(template(`export default exportRes`, babylonConfig as any)() as any) } else { node.body.push(template(`App(require('${taroMiniAppFramework}').default.createApp(${exportVariableName}))`, babylonConfig as any)() as any) } @@ -451,7 +452,8 @@ function processAst ( template(`import Taro from '${taroMiniAppFramework}'`, babylonConfig as any)() as any ) } - node.body.push(template(`export default require('${taroMiniAppFramework}').default.createComponent(${exportVariableName}, '${pagePath}')`, babylonConfig as any)() as any) + node.body.push(template(`exportRes = require('${taroMiniAppFramework}').default.createComponent(${exportVariableName}, '${pagePath}')`, babylonConfig as any)() as any) + node.body.push(template(`export default exportRes`, babylonConfig as any)() as any) } else { node.body.push(template(`Page(require('${taroMiniAppFramework}').default.createComponent(${exportVariableName}, true))`, babylonConfig as any)() as any) } @@ -463,7 +465,8 @@ function processAst ( template(`import Taro from '${taroMiniAppFramework}'`, babylonConfig as any)() as any ) } - node.body.push(template(`export default require('${taroMiniAppFramework}').default.createComponent(${exportVariableName})`, babylonConfig as any)() as any) + node.body.push(template(`exportRes = require('${taroMiniAppFramework}').default.createComponent(${exportVariableName})`, babylonConfig as any)() as any) + node.body.push(template(`export default exportRes`, babylonConfig as any)() as any) } else { node.body.push(template(`Component(require('${taroMiniAppFramework}').default.createComponent(${exportVariableName}))`, babylonConfig as any)() as any) } @@ -484,7 +487,8 @@ export default function fileParseLoader (source, ast) { constantsReplaceList, buildAdapter, designWidth, - deviceRatio + deviceRatio, + sourceDir } = getOptions(this) const filePath = this.resourcePath const newAst = transformFromAst(ast, '', { @@ -494,7 +498,7 @@ export default function fileParseLoader (source, ast) { ] }).ast as t.File const miniType = this._module.miniType || PARSE_AST_TYPE.NORMAL - const result = processAst(newAst, buildAdapter, miniType, designWidth, deviceRatio, filePath, this.context) + const result = processAst(newAst, buildAdapter, miniType, designWidth, deviceRatio, filePath, sourceDir) const code = generate(result).code const res = transform(code, babelConfig) return res.code diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 12172380577a..8b0b23e831fc 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -12,14 +12,14 @@ import * as LoaderTargetPlugin from 'webpack/lib/LoaderTargetPlugin' import { merge, defaults, kebabCase } from 'lodash' import * as t from 'babel-types' import traverse from 'babel-traverse' -import { Config as IConfig } from '@tarojs/taro' +import { Config as IConfig, PageConfig } from '@tarojs/taro' import * as _ from 'lodash' -import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP, taroJsFramework, taroJsComponents, QUICKAPP_SPECIAL_COMPONENTS, taroJsQuickAppComponents } from '../utils/constants' +import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP, taroJsFramework } from '../utils/constants' import { IComponentObj } from '../utils/types' import { resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync, isEmptyObject, promoteRelativePath } from '../utils' import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency' -import { getTaroJsQuickAppComponentsPath, generateQuickAppUx, getImportTaroSelfComponents } from '../utils/helper' +import { getTaroJsQuickAppComponentsPath, generateQuickAppUx, getImportTaroSelfComponents, generateQuickAppManifest } from '../utils/helper' import parseAst from '../utils/parseAst' import TaroLoadChunksPlugin from './TaroLoadChunksPlugin' @@ -32,6 +32,8 @@ interface IMiniPluginOptions { nodeModulesPath: string, sourceDir: string, outputDir: string, + quickappJSON?: any, + designWidth: number, commonChunks: string[] } @@ -60,7 +62,7 @@ export const createTarget = function createTarget (name) { new JsonpTemplatePlugin().apply(compiler) new FunctionModulePlugin(options.output).apply(compiler) new NodeSourcePlugin(options.node).apply(compiler) - new LoaderTargetPlugin('web').apply(compiler) + new LoaderTargetPlugin('node').apply(compiler) } } @@ -133,6 +135,7 @@ export default class MiniPlugin { outputDir: string context: string appConfig: IConfig + pageConfigs: Map constructor (options = {}) { this.options = defaults(options || {}, { @@ -140,6 +143,7 @@ export default class MiniPlugin { nodeModulesPath: '', sourceDir: '', outputDir: '', + designWidth: 750, commonChunks: ['runtime', 'vendors'] }) this.sourceDir = this.options.sourceDir @@ -147,6 +151,7 @@ export default class MiniPlugin { this.pages = new Set() this.components = new Set() + this.pageConfigs = new Map() } tryAsync = fn => async (arg, callback) => { @@ -189,7 +194,7 @@ export default class MiniPlugin { new TaroLoadChunksPlugin({ commonChunks: this.options.commonChunks, - taroFileTypeMap + buildAdapter: this.options.buildAdapter }).apply(compiler) new TaroNormalModulesPlugin().apply(compiler) @@ -374,10 +379,11 @@ export default class MiniPlugin { } this.getSubPackages(configObj) this.generateTabBarFiles(compiler, configObj) + const template = '' taroFileTypeMap[this.appEntry] = { type: PARSE_AST_TYPE.ENTRY, config: configObj, - template: transformResult.template, + template, code: transformResult.code } this.pages = new Set([ @@ -403,7 +409,7 @@ export default class MiniPlugin { componentName = componentPath.replace(this.sourceDir, '').replace(/\\/g, '/').replace(path.extname(componentPath), '') } - return componentName + return componentName.replace(/^(\/|\\)/, '') } getComponents (fileList: Set, isRoot: boolean) { @@ -465,6 +471,10 @@ export default class MiniPlugin { }) let parseAstRes = parseAst(transformResult.ast, buildAdapter) configObj = parseAstRes.configObj + if (isRoot) { + const showPath = file.path.replace(this.sourceDir, '').replace(path.extname(file.path), '') + this.pageConfigs.set(showPath, configObj) + } taroSelfComponents = parseAstRes.taroSelfComponents const usingComponents = configObj.usingComponents if (usingComponents) { @@ -487,11 +497,7 @@ export default class MiniPlugin { if (isQuickApp) { const scriptPath = file.path const outputScriptPath = scriptPath.replace(this.sourceDir, this.outputDir).replace(path.extname(scriptPath), MINI_APP_FILES[buildAdapter].SCRIPT) - const stylePath = outputScriptPath.replace(path.extname(outputScriptPath), MINI_APP_FILES[buildAdapter].STYLE) - const templPath = outputScriptPath.replace(path.extname(outputScriptPath), MINI_APP_FILES[buildAdapter].TEMPL) - const styleRelativePath = promoteRelativePath(path.relative(outputScriptPath, stylePath)) - const scriptRelativePath = promoteRelativePath(path.relative(templPath, outputScriptPath)) - const importTaroSelfComponents = getImportTaroSelfComponents(outputScriptPath, this.options.nodeModulesPath, taroSelfComponents) + const importTaroSelfComponents = getImportTaroSelfComponents(outputScriptPath, this.options.nodeModulesPath, this.outputDir, taroSelfComponents) const usingComponents = configObj.usingComponents let importUsingComponent: any = new Set([]) if (usingComponents) { @@ -510,8 +516,6 @@ export default class MiniPlugin { })) template = generateQuickAppUx({ template, - script: scriptRelativePath, - style: styleRelativePath, imports: new Set([...importTaroSelfComponents, ...importUsingComponent, ...importCustomComponents]) }) } @@ -586,19 +590,50 @@ export default class MiniPlugin { const extname = path.extname(item) const templatePath = relativePath.replace(extname, MINI_APP_FILES[buildAdapter].TEMPL) const jsonPath = relativePath.replace(extname, MINI_APP_FILES[buildAdapter].CONFIG) + const scriptPath = relativePath.replace(extname, MINI_APP_FILES[buildAdapter].SCRIPT) + const stylePath = relativePath.replace(extname, MINI_APP_FILES[buildAdapter].STYLE) const itemInfo = taroFileTypeMap[item] - if (itemInfo.type !== PARSE_AST_TYPE.ENTRY) { - compilation.assets[templatePath] = { - size: () => itemInfo.template!.length, - source: () => itemInfo.template - } - } + let template = itemInfo.template if (!isQuickApp) { const jsonStr = JSON.stringify(itemInfo.config) compilation.assets[jsonPath] = { size: () => jsonStr.length, source: () => jsonStr } + } else { + let hitScriptItem + Object.keys(compilation.assets).forEach(item => { + if (stylePath.indexOf(item) >= 0) { + const relativeStylePath = promoteRelativePath(path.relative(scriptPath, stylePath)) + template = `\n` + template + } + if (scriptPath.indexOf(item) >= 0) { + let scriptContent = compilation.assets[item]._source.source() + scriptContent = `let exportRes;\n${scriptContent}\nexport default exportRes;` + hitScriptItem = item + template += `\n` + } + }) + if (hitScriptItem) { + delete compilation.assets[hitScriptItem] + } + const quickappJSON = generateQuickAppManifest({ + appConfig: this.appConfig, + designWidth: this.options.designWidth, + pageConfigs: this.pageConfigs, + quickappJSON: this.options.quickappJSON + }) + const quickappJSONStr = JSON.stringify(quickappJSON) + compilation.assets['./manifest.json'] = { + size: () => quickappJSONStr.length, + source: () => quickappJSONStr + } + } + if (template) { + compilation.assets[templatePath] = { + size: () => template!.length, + source: () => template + } } if (itemInfo.taroSelfComponents) { itemInfo.taroSelfComponents.forEach(item => { diff --git a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts index 9b549f88018a..d0f51b0f4054 100644 --- a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts @@ -4,59 +4,74 @@ import webpack, { compilation } from 'webpack' import { ConcatSource } from 'webpack-sources' import { urlToRequest } from 'loader-utils' -import { PARSE_AST_TYPE, REG_STYLE } from '../utils/constants' - -import { ITaroFileInfo } from './MiniPlugin' +import { PARSE_AST_TYPE, REG_STYLE, BUILD_TYPES } from '../utils/constants' +import { promoteRelativePath } from '../utils' const PLUGIN_NAME = 'TaroLoadChunksPlugin' interface IOptions { commonChunks: string[], - taroFileTypeMap: ITaroFileInfo + buildAdapter: BUILD_TYPES } export default class TaroLoadChunksPlugin { commonChunks: string[] - taroFileTypeMap: ITaroFileInfo + buildAdapter: BUILD_TYPES constructor (options: IOptions) { this.commonChunks = options.commonChunks + this.buildAdapter = options.buildAdapter } apply (compiler: webpack.Compiler) { compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation: compilation.Compilation) => { let commonChunks compilation.hooks.afterOptimizeChunks.tap(PLUGIN_NAME, (chunks: compilation.Chunk[]) => { - commonChunks = chunks.filter(chunk => this.commonChunks.includes(chunk.name)) + commonChunks = chunks.filter(chunk => this.commonChunks.includes(chunk.name)).reverse() }) compilation.chunkTemplate.hooks.renderWithEntry.tap(PLUGIN_NAME, (modules, chunk) => { - if (chunk.entryModule && chunk.entryModule.miniType === PARSE_AST_TYPE.ENTRY) { - compilation.hooks.afterOptimizeAssets.tap(PLUGIN_NAME, assets => { - const files = chunk.files - files.forEach(item => { - if (REG_STYLE.test(item)) { - const source = new ConcatSource() - const _source = assets[item]._source - Object.keys(assets).forEach(assetName => { - const fileName = path.basename(assetName, path.extname(assetName)) - if (REG_STYLE.test(assetName) && this.commonChunks.includes(fileName)) { - source.add(`@import ${JSON.stringify(urlToRequest(assetName))}`) - source.add('\n') - source.add(_source) - assets[item]._source = source - } - }) - } + if (chunk.entryModule) { + if (chunk.entryModule.miniType === PARSE_AST_TYPE.ENTRY) { + compilation.hooks.afterOptimizeAssets.tap(PLUGIN_NAME, assets => { + const files = chunk.files + files.forEach(item => { + if (REG_STYLE.test(item)) { + const source = new ConcatSource() + const _source = assets[item]._source + Object.keys(assets).forEach(assetName => { + const fileName = path.basename(assetName, path.extname(assetName)) + if (REG_STYLE.test(assetName) && this.commonChunks.includes(fileName)) { + source.add(`@import ${JSON.stringify(urlToRequest(assetName))}`) + source.add('\n') + source.add(_source) + assets[item]._source = source + } + }) + } + }) + }) + const source = new ConcatSource() + const id = chunk.id + commonChunks.forEach(chunkItem => { + source.add(`require(${JSON.stringify(promoteRelativePath(path.relative(id, chunkItem.name)))});\n`) + }) + source.add('\n') + source.add(modules) + source.add(';') + return source + } else if (this.buildAdapter === BUILD_TYPES.QUICKAPP && + (chunk.entryModule.miniType === PARSE_AST_TYPE.PAGE || + chunk.entryModule.miniType === PARSE_AST_TYPE.COMPONENT)) { + const source = new ConcatSource() + const id = chunk.id + commonChunks.forEach(chunkItem => { + source.add(`require(${JSON.stringify(promoteRelativePath(path.relative(id, chunkItem.name)))});\n`) }) - }) - const source = new ConcatSource() - commonChunks.reverse().forEach(chunkItem => { - source.add(`require(${JSON.stringify(urlToRequest(chunkItem.name))});\n`) - }) - source.add('\n') - source.add(modules) - source.add(';') - return source + source.add('\n') + source.add(modules) + source.add(';') + return source + } } }) }) diff --git a/packages/taro-mini-runner/src/utils/helper.ts b/packages/taro-mini-runner/src/utils/helper.ts index c58c3419bc76..f1375d7f2b9a 100644 --- a/packages/taro-mini-runner/src/utils/helper.ts +++ b/packages/taro-mini-runner/src/utils/helper.ts @@ -1,22 +1,8 @@ import * as path from 'path' -import * as fs from 'fs' -import { isEmptyObject, getInstalledNpmPkgPath, promoteRelativePath } from '.' -import { taroJsQuickAppComponents, REG_STYLE, REG_SCRIPT } from './constants' - -let quickappConfig = {} +import * as _ from 'lodash' -export function getQuickappConfig (appPath) { - if (!isEmptyObject(quickappConfig)) { - return quickappConfig - } - const configPath = path.join(appPath, 'project.quickapp.json') - if (!fs.existsSync(configPath)) { - quickappConfig = require('../config/manifest.default.json') - } else { - quickappConfig = JSON.parse(fs.readFileSync(configPath).toString()) - } - return quickappConfig -} +import { getInstalledNpmPkgPath, promoteRelativePath } from '.' +import { taroJsQuickAppComponents, REG_STYLE, REG_SCRIPT } from './constants' export function getTaroJsQuickAppComponentsPath (nodeModulesPath: string): string { const taroJsQuickAppComponentsPkg = getInstalledNpmPkgPath(taroJsQuickAppComponents, nodeModulesPath) @@ -27,13 +13,13 @@ export function getTaroJsQuickAppComponentsPath (nodeModulesPath: string): strin return path.join(path.dirname(taroJsQuickAppComponentsPkg as string), 'src/components') } -export function getImportTaroSelfComponents (filePath, nodeModulesPath, taroSelfComponents) { +export function getImportTaroSelfComponents (filePath, nodeModulesPath, outputDir, taroSelfComponents) { const importTaroSelfComponents = new Set<{ path: string, name: string }>() const taroJsQuickAppComponentsPath = getTaroJsQuickAppComponentsPath(nodeModulesPath) taroSelfComponents.forEach(c => { const cPath = path.join(taroJsQuickAppComponentsPath, c) const cMainPath = path.join(cPath, 'index') - const cRelativePath = promoteRelativePath(path.relative(filePath, cMainPath.replace(nodeModulesPath, 'npm'))) + const cRelativePath = promoteRelativePath(path.relative(filePath, cMainPath.replace(nodeModulesPath, path.join(outputDir, 'npm')))) importTaroSelfComponents.add({ path: cRelativePath, name: c @@ -81,3 +67,57 @@ export function generateQuickAppUx ({ } return uxTxt } + +export function generateQuickAppManifest ({ + appConfig, + quickappJSON, + pageConfigs, + designWidth +}) { + // 生成 router + const pages = (appConfig.pages as string[]).concat() + const routerPages = {} + const customPageConfig = quickappJSON.customPageConfig || {} + + pages.forEach(element => { + const customConfig = customPageConfig[element] + const pageConf: any = { + component: path.basename(element) + } + if (customConfig) { + const filter = customConfig.filter + const launchMode = customConfig.launchMode + if (filter) { + pageConf.filter = filter + } + if (launchMode) { + pageConf.launchMode = launchMode + } + } + routerPages[path.dirname(element)] = pageConf + }) + delete quickappJSON.customPageConfig + const routerEntry = pages.shift() + const router = { + entry: path.dirname(routerEntry as string), + pages: routerPages + } + // 生成 display + const display = JSON.parse(JSON.stringify(appConfig.window || {})) + display.pages = {} + pageConfigs.forEach((item, page) => { + if (item) { + display.pages[path.dirname(page)] = item + } + }) + quickappJSON.router = router + quickappJSON.display = display + quickappJSON.config = Object.assign({}, quickappJSON.config, { + designWidth: designWidth || 750 + }) + if (appConfig.window && appConfig.window.navigationStyle === 'custom') { + quickappJSON.display.titleBar = false + delete quickappJSON.display.navigationStyle + } + return quickappJSON +} diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index b5d40c4ad190..b3794a49e909 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -4,6 +4,7 @@ import * as fs from 'fs-extra' import * as resolvePath from 'resolve' import * as t from 'babel-types' import { mergeWith } from 'lodash' +import { Transform } from 'stream' import { CONFIG_MAP, JS_EXT, TS_EXT, NODE_MODULES_REG, MINI_APP_FILES, BUILD_TYPES, CSS_IMPORT_REG, REG_STYLE } from './constants' import { IOption, IComponentObj } from './types' diff --git a/packages/taro-mini-runner/src/utils/types.ts b/packages/taro-mini-runner/src/utils/types.ts index 478eb3ad0ca9..c4b5d8af72ee 100644 --- a/packages/taro-mini-runner/src/utils/types.ts +++ b/packages/taro-mini-runner/src/utils/types.ts @@ -23,5 +23,6 @@ export interface IBuildConfig extends IProjectBaseConfig, IMiniAppConfig { isWatch: boolean, port?: number, buildAdapter: BUILD_TYPES, - nodeModulesPath: string + nodeModulesPath: string, + quickappJSON: any } diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts index 6519ac3cda7d..7fee552031e6 100644 --- a/packages/taro-mini-runner/src/webpack/build.conf.ts +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -17,7 +17,6 @@ import { } from './chain' import { BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES } from '../utils/constants' import { Targets } from '../plugins/MiniPlugin' -import { getQuickappConfig } from '../utils/helper' const emptyObj = {} @@ -49,6 +48,7 @@ export default (appPath: string, mode, config: Partial): any => { postcss = emptyObj, nodeModulesPath, + quickappJSON, babel, csso, @@ -59,14 +59,21 @@ export default (appPath: string, mode, config: Partial): any => { const minimizer: any[] = [] const sourceDir = path.join(appPath, sourceRoot) const outputDir = path.join(appPath, outputRoot) - const isQuickapp = buildAdapter === BUILD_TYPES.QUICKAPP if (copy) { plugin.copyWebpackPlugin = getCopyWebpackPlugin({ copy, appPath }) } const constantsReplaceList = mergeOption([processEnvOption(env), defineConstants]) plugin.definePlugin = getDefinePlugin([constantsReplaceList]) - plugin.miniPlugin = getMiniPlugin({ sourceDir, outputDir, buildAdapter, constantsReplaceList, nodeModulesPath }) + plugin.miniPlugin = getMiniPlugin({ + sourceDir, + outputDir, + buildAdapter, + constantsReplaceList, + nodeModulesPath, + quickappJSON, + designWidth + }) plugin.miniCssExtractPlugin = getMiniCssExtractPlugin([{ filename: `[name]${MINI_APP_FILES[buildAdapter].STYLE}`, @@ -101,7 +108,7 @@ export default (appPath: string, mode, config: Partial): any => { output: getOutput(appPath, [{ outputRoot, publicPath: '/', - buildAdapter + buildAdapter, }, output]), target: Targets[buildAdapter], resolve: { @@ -161,19 +168,6 @@ export default (appPath: string, mode, config: Partial): any => { } } - // if (isQuickapp) { - // const quickappConfig = getQuickappConfig(appPath) - // const features = quickappConfig['features'] - // if (features && features.length) { - // const externals = {} - // features.forEach(item => { - // externals[`@${item.name}`] = { - // root: `@${item.name}` - // } - // }) - // mainConfig['externals'] = externals - // } - // } chain.merge(mainConfig) return chain } diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index 5c2c13ff0d73..4233441eb8fa 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -22,7 +22,8 @@ const globalObjectMap = { [BUILD_TYPES.ALIPAY]: 'my', [BUILD_TYPES.SWAN]: 'swan', [BUILD_TYPES.QQ]: 'qq', - [BUILD_TYPES.TT]: 'tt' + [BUILD_TYPES.TT]: 'tt', + [BUILD_TYPES.QUICKAPP]: 'global' } const defaultUglifyJsOption = { @@ -250,7 +251,8 @@ export const getModule = (appPath: string, { designWidth, deviceRatio, buildAdapter, - constantsReplaceList + constantsReplaceList, + sourceDir }]) const wxTransformerLoader = getWxTransformerLoader([{ From 07134d7bc5590e0980a25ff3ee8588ef105b3767 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 16 Sep 2019 21:24:07 +0800 Subject: [PATCH 050/194] =?UTF-8?q?feat(mini-runner):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20watch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taro-mini-runner/src/plugins/MiniPlugin.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 8b0b23e831fc..9697388bed82 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -176,7 +176,8 @@ export default class MiniPlugin { compiler.hooks.watchRun.tapAsync( PLUGIN_NAME, this.tryAsync(async (compiler: webpack.Compiler) => { - this.run(compiler) + const changedFile = this.getChangedFiles(compiler) + await this.watchRun(compiler, changedFile) }) ) @@ -200,6 +201,13 @@ export default class MiniPlugin { new TaroNormalModulesPlugin().apply(compiler) } + getChangedFiles (compiler) { + const { watchFileSystem } = compiler; + const watcher = watchFileSystem.watcher || watchFileSystem.wfs.watcher; + + return Object.keys(watcher.mtimes) + } + getAppEntry (compiler) { if (this.options.appEntry) { return this.options.appEntry @@ -673,6 +681,10 @@ export default class MiniPlugin { this.transferFileContent(compiler) } + watchRun (compiler: webpack.Compiler, changedFile: string[]) { + + } + getTargetFilePath (filePath, targetExtname) { const extname = path.extname(filePath) if (extname) { From c84b683313f589b934550bef5052db8149d6ac7b Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 18 Sep 2019 14:35:08 +0800 Subject: [PATCH 051/194] =?UTF-8?q?fix(mini-runner):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=20watch=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/MiniPlugin.ts | 21 +++++++++++++------ .../VirtualModulePlugin.ts | 5 +++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 9697388bed82..332d3ae7d4c9 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -15,7 +15,7 @@ import traverse from 'babel-traverse' import { Config as IConfig, PageConfig } from '@tarojs/taro' import * as _ from 'lodash' -import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP, taroJsFramework } from '../utils/constants' +import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP, taroJsFramework, REG_SCRIPTS } from '../utils/constants' import { IComponentObj } from '../utils/types' import { resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync, isEmptyObject, promoteRelativePath } from '../utils' import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency' @@ -136,6 +136,7 @@ export default class MiniPlugin { context: string appConfig: IConfig pageConfigs: Map + changedFile: string constructor (options = {}) { this.options = defaults(options || {}, { @@ -176,8 +177,12 @@ export default class MiniPlugin { compiler.hooks.watchRun.tapAsync( PLUGIN_NAME, this.tryAsync(async (compiler: webpack.Compiler) => { - const changedFile = this.getChangedFiles(compiler) - await this.watchRun(compiler, changedFile) + const changedFiles = this.getChangedFiles(compiler) + if (!changedFiles.length) { + await this.run(compiler) + } else { + await this.watchRun(compiler, changedFiles) + } }) ) @@ -637,7 +642,7 @@ export default class MiniPlugin { source: () => quickappJSONStr } } - if (template) { + if (template && (!this.changedFile || this.changedFile === item)) { compilation.assets[templatePath] = { size: () => template!.length, source: () => template @@ -681,8 +686,12 @@ export default class MiniPlugin { this.transferFileContent(compiler) } - watchRun (compiler: webpack.Compiler, changedFile: string[]) { - + watchRun (compiler: webpack.Compiler, changedFiles: string[]) { + const changedFile = changedFiles[0] + if (REG_SCRIPTS.test(changedFile)) { + this.changedFile = changedFile + this.run(compiler) + } } getTargetFilePath (filePath, targetExtname) { diff --git a/packages/taro-mini-runner/src/plugins/VirtualModulePlugin/VirtualModulePlugin.ts b/packages/taro-mini-runner/src/plugins/VirtualModulePlugin/VirtualModulePlugin.ts index e385d78561d3..45900d8a2423 100644 --- a/packages/taro-mini-runner/src/plugins/VirtualModulePlugin/VirtualModulePlugin.ts +++ b/packages/taro-mini-runner/src/plugins/VirtualModulePlugin/VirtualModulePlugin.ts @@ -1,5 +1,6 @@ import * as path from 'path' import VirtualStats from './virtualStats' +import webpack from 'webpack' export default class VirtualModulePlugin { options: { @@ -11,7 +12,7 @@ export default class VirtualModulePlugin { this.options = options } - apply(compiler) { + apply (compiler: webpack.Compiler) { const moduleName = this.options.moduleName const ctime = VirtualModulePlugin.statsDate() let modulePath = this.options.path @@ -63,7 +64,7 @@ export default class VirtualModulePlugin { }) } - static populateFilesystem(options) { + static populateFilesystem (options) { const fs = options.fs const modulePath = options.modulePath const contents = options.contents From e64e17777d4f0cf32cd8d025f26e4add497a2ab2 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 18 Sep 2019 20:54:32 +0800 Subject: [PATCH 052/194] chore: merge --- packages/taro-mini-runner/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index c8de00de343e..dfadb71f80ab 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "1.3.17", + "version": "1.3.18", "description": "Mini app runner for taro", "main": "index.js", "scripts": { @@ -32,8 +32,8 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/taro": "1.3.17", - "@tarojs/transformer-wx": "1.3.17", + "@tarojs/taro": "1.3.18", + "@tarojs/transformer-wx": "1.3.18", "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", From de78fe41e154f482523785047cbdefb7f6b0dade Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 18 Sep 2019 21:19:31 +0800 Subject: [PATCH 053/194] =?UTF-8?q?fix(jd):=20=E4=BF=AE=E5=A4=8D=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E4=BB=A3=E7=A0=81=E5=AF=BC=E8=87=B4=E7=9A=84=E4=BA=AC?= =?UTF-8?q?=E4=B8=9C=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=9A=84=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taro-mini-runner/src/utils/constants.ts | 54 +- .../taro-mini-runner/src/utils/logHelper.ts | 5 +- yarn.lock | 1255 +++++++---------- 3 files changed, 523 insertions(+), 791 deletions(-) diff --git a/packages/taro-mini-runner/src/utils/constants.ts b/packages/taro-mini-runner/src/utils/constants.ts index 4981bf593835..f741e35c38e0 100644 --- a/packages/taro-mini-runner/src/utils/constants.ts +++ b/packages/taro-mini-runner/src/utils/constants.ts @@ -28,13 +28,14 @@ export const NODE_MODULES_REG = /(.*)node_modules/ export const enum BUILD_TYPES { WEAPP = 'weapp', - SWAN ='swan', - ALIPAY ='alipay', - TT ='tt', - UI ='ui', + SWAN = 'swan', + ALIPAY = 'alipay', + TT = 'tt', + UI = 'ui', PLUGIN = 'plugin', QUICKAPP = 'quickapp', - QQ = 'qq' + QQ = 'qq', + JD = 'jd' } export const enum TEMPLATE_TYPES { @@ -43,7 +44,8 @@ export const enum TEMPLATE_TYPES { ALIPAY = '.axml', TT = '.ttml', QUICKAPP = '.ux', - QQ = '.qml' + QQ = '.qml', + JD = '.jxml' } export const enum STYLE_TYPES { @@ -52,7 +54,8 @@ export const enum STYLE_TYPES { ALIPAY = '.acss', TT = '.ttss', QUICKAPP = '.css', - QQ = '.qss' + QQ = '.qss', + JD = '.jxss' } export const enum SCRIPT_TYPES { @@ -61,7 +64,8 @@ export const enum SCRIPT_TYPES { ALIPAY = '.js', TT = '.js', QUICKAPP = '.js', - QQ = '.js' + QQ = '.js', + JD = '.js' } export const enum CONFIG_TYPES { @@ -70,7 +74,8 @@ export const enum CONFIG_TYPES { ALIPAY = '.json', TT = '.json', QUICKAPP = '.json', - QQ = '.json' + QQ = '.json', + JD = '.json' } export type IMINI_APP_FILE_TYPE = { @@ -119,6 +124,12 @@ export const MINI_APP_FILES: IMINI_APP_FILES = { STYLE: STYLE_TYPES.QQ, SCRIPT: SCRIPT_TYPES.QQ, CONFIG: CONFIG_TYPES.QQ + }, + [BUILD_TYPES.JD]: { + TEMPL: TEMPLATE_TYPES.JD, + STYLE: STYLE_TYPES.JD, + SCRIPT: SCRIPT_TYPES.JD, + CONFIG: CONFIG_TYPES.JD } } @@ -168,15 +179,16 @@ export const CONFIG_MAP = { navigationBarBackgroundColor: 'titleBarBackgroundColor', navigationBarTextStyle: 'titleBarTextColor', pageOrientation: 'orientation', + list: 'list', + text: 'text', + iconPath: 'iconPath', + selectedIconPath: 'selectedIconPath', backgroundTextStyle: false, - list: false, - text: false, - iconPath: false, - selectedIconPath: false, onReachBottomDistance: false, backgroundColorBottom: false, backgroundColorTop: false, - navigationStyle: false + enablePullDownRefresh: false, + navigationStyle: 'navigationStyle' }, [BUILD_TYPES.QQ]: { navigationBarTitleText: 'navigationBarTitleText', @@ -185,11 +197,21 @@ export const CONFIG_MAP = { list: 'list', text: 'text', iconPath: 'iconPath', - selectedIconPath: 'selectedIconPath' + selectedIconPath: 'selectedIconPath', + color: 'color' + }, + [BUILD_TYPES.JD]: { + navigationBarTitleText: 'navigationBarTitleText', + navigationBarBackgroundColor: 'navigationBarBackgroundColor', + enablePullDownRefresh: 'enablePullDownRefresh', + list: 'list', + text: 'text', + iconPath: 'iconPath', + selectedIconPath: 'selectedIconPath', + color: 'color' } } - export const taroJsComponents = '@tarojs/components' export const taroJsQuickAppComponents = '@tarojs/components-qa' export const taroJsFramework = '@tarojs/taro' diff --git a/packages/taro-mini-runner/src/utils/logHelper.ts b/packages/taro-mini-runner/src/utils/logHelper.ts index 2326ce4f7cc2..bbb3ab387399 100644 --- a/packages/taro-mini-runner/src/utils/logHelper.ts +++ b/packages/taro-mini-runner/src/utils/logHelper.ts @@ -14,7 +14,7 @@ const LOG_MAP = { OPEN: '请打开支付宝小程序开发者工具进行查看' }, [BUILD_TYPES.QQ]: { - OPEN: '请打开QQ 小程序开发者工具进行查看' + OPEN: '请打开 QQ 小程序开发者工具进行查看' }, [BUILD_TYPES.SWAN]: { OPEN: '请打开百度智能小程序开发者工具进行查看' @@ -22,6 +22,9 @@ const LOG_MAP = { [BUILD_TYPES.TT]: { OPEN: '请打开字节跳动小程序开发者工具进行查看' }, + [BUILD_TYPES.JD]: { + OPEN: '请打开京东小程序开发者工具进行查看' + }, [BUILD_TYPES.QUICKAPP]: { OPEN: '请按快应用端开发流程 https://taro-docs.jd.com/taro/docs/quick-app.html 进行查看' } diff --git a/yarn.lock b/yarn.lock index 1781806af3e5..e2fc09bead76 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,25 +2,48 @@ # yarn lockfile v1 -"@babel/code-frame@7.5.5", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5": +"@babel/code-frame@7.5.5", "@babel/code-frame@^7.5.5": version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" - integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@^7.0.0-beta.42", "@babel/core@^7.6.4": - version "7.6.4" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.6.4.tgz#6ebd9fe00925f6c3e177bb726a188b5f578088ff" - integrity sha512-Rm0HGw101GY8FTzpWSyRbki/jzq+/PkNQJ+nSulrdY6gFGOsNseCqD6KHRYe2E+EdzuBdr2pxCp6s4Uk6eJ+XQ== +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/core@^7.0.0-beta.42": + version "7.1.6" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.1.6.tgz#3733cbee4317429bc87c62b29cf8587dba7baeb3" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.1.6" + "@babel/helpers" "^7.1.5" + "@babel/parser" "^7.1.6" + "@babel/template" "^7.1.2" + "@babel/traverse" "^7.1.6" + "@babel/types" "^7.1.6" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.10" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/core@^7.5.5": + version "7.6.0" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.6.0.tgz#9b00f73554edd67bebc86df8303ef678be3d7b48" dependencies: "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.6.4" - "@babel/helpers" "^7.6.2" - "@babel/parser" "^7.6.4" + "@babel/generator" "^7.6.0" + "@babel/helpers" "^7.6.0" + "@babel/parser" "^7.6.0" "@babel/template" "^7.6.0" - "@babel/traverse" "^7.6.3" - "@babel/types" "^7.6.3" + "@babel/traverse" "^7.6.0" + "@babel/types" "^7.6.0" convert-source-map "^1.1.0" debug "^4.1.0" json5 "^2.1.0" @@ -29,10 +52,29 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.6.3", "@babel/generator@^7.6.4": +"@babel/generator@^7.1.6": + version "7.1.6" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.1.6.tgz#001303cf87a5b9d093494a4bf251d7b5d03d3999" + dependencies: + "@babel/types" "^7.1.6" + jsesc "^2.5.1" + lodash "^4.17.10" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/generator@^7.6.0": + version "7.6.0" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.6.0.tgz#e2c21efbfd3293ad819a2359b448f002bfdfda56" + dependencies: + "@babel/types" "^7.6.0" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/generator@^7.6.3": version "7.6.4" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.6.4.tgz#a4f8437287bf9671b07f483b76e3bb731bc97671" - integrity sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w== dependencies: "@babel/types" "^7.6.3" jsesc "^2.5.1" @@ -69,8 +111,7 @@ "@babel/helper-call-delegate@^7.4.4": version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz#87c1f8ca19ad552a736a7a27b1c1fcf8b1ff1f43" - integrity sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ== + resolved "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz#87c1f8ca19ad552a736a7a27b1c1fcf8b1ff1f43" dependencies: "@babel/helper-hoist-variables" "^7.4.4" "@babel/traverse" "^7.4.4" @@ -78,8 +119,7 @@ "@babel/helper-create-class-features-plugin@^7.5.5": version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.6.0.tgz#769711acca889be371e9bc2eb68641d55218021f" - integrity sha512-O1QWBko4fzGju6VoVvrZg0RROCVifcLxiApnGP3OWfWzvxRZFCoBD81K5ur5e3bVY2Vf/5rIJm8cqPKn8HUJng== + resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.6.0.tgz#769711acca889be371e9bc2eb68641d55218021f" dependencies: "@babel/helper-function-name" "^7.1.0" "@babel/helper-member-expression-to-functions" "^7.5.5" @@ -98,8 +138,7 @@ "@babel/helper-define-map@^7.5.5": version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz#3dec32c2046f37e09b28c93eb0b103fd2a25d369" - integrity sha512-fTfxx7i0B5NJqvUOBBGREnrqbTxRh7zinBANpZXAVDlsZxYdclDp467G1sQ8VZYMnAURY3RpBUAgOYT9GfzHBg== + resolved "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz#3dec32c2046f37e09b28c93eb0b103fd2a25d369" dependencies: "@babel/helper-function-name" "^7.1.0" "@babel/types" "^7.5.5" @@ -134,8 +173,7 @@ "@babel/helper-hoist-variables@^7.4.4": version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz#0298b5f25c8c09c53102d52ac4a98f773eb2850a" - integrity sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w== + resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz#0298b5f25c8c09c53102d52ac4a98f773eb2850a" dependencies: "@babel/types" "^7.4.4" @@ -147,8 +185,7 @@ "@babel/helper-member-expression-to-functions@^7.5.5": version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.5.5.tgz#1fb5b8ec4453a93c439ee9fe3aeea4a84b76b590" - integrity sha512-5qZ3D1uMclSNqYcXqiHoA0meVdv+xUEex9em2fqMnrk/scphGlGgg66zjMrPJESPwrFJ6sbfFQYUSa0Mz7FabA== + resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.5.5.tgz#1fb5b8ec4453a93c439ee9fe3aeea4a84b76b590" dependencies: "@babel/types" "^7.5.5" @@ -171,8 +208,7 @@ "@babel/helper-module-transforms@^7.4.4": version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.5.5.tgz#f84ff8a09038dcbca1fd4355661a500937165b4a" - integrity sha512-jBeCvETKuJqeiaCdyaheF40aXnnU1+wkSiUs/IQg3tB85up1LyL8x77ClY8qJpuRJUcXQo+ZtdNESmZl4j56Pw== + resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.5.5.tgz#f84ff8a09038dcbca1fd4355661a500937165b4a" dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-simple-access" "^7.1.0" @@ -199,8 +235,7 @@ "@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== + resolved "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.5.5.tgz#0aa6824f7100a2e0e89c1527c23936c152cab351" dependencies: lodash "^4.17.13" @@ -225,8 +260,7 @@ "@babel/helper-replace-supers@^7.5.5": version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz#f84ce43df031222d2bad068d2626cb5799c34bc2" - integrity sha512-XvRFWrNnlsow2u7jXDuH4jDDctkxbS7gXssrP4q2nUD606ukXHRvydj346wmNg+zAgpFx4MWf4+usfC93bElJg== + resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz#f84ce43df031222d2bad068d2626cb5799c34bc2" dependencies: "@babel/helper-member-expression-to-functions" "^7.5.5" "@babel/helper-optimise-call-expression" "^7.0.0" @@ -248,8 +282,7 @@ "@babel/helper-split-export-declaration@^7.4.4": version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" - integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" dependencies: "@babel/types" "^7.4.4" @@ -262,15 +295,22 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.0.0" -"@babel/helpers@^7.6.2": +"@babel/helpers@^7.1.5": version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.6.2.tgz#681ffe489ea4dcc55f23ce469e58e59c1c045153" - integrity sha512-3/bAUL8zZxYs1cdX2ilEE0WobqbCmKWr/889lf2SS0PpDcpEIY8pb1CCyz0pEcX3pEb+MCbks1jIokz2xLtGTA== + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.6.2.tgz#681ffe489ea4dcc55f23ce469e58e59c1c045153" dependencies: "@babel/template" "^7.6.0" "@babel/traverse" "^7.6.2" "@babel/types" "^7.6.0" +"@babel/helpers@^7.6.0": + version "7.6.0" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.6.0.tgz#21961d16c6a3c3ab597325c34c465c0887d31c6e" + dependencies: + "@babel/template" "^7.6.0" + "@babel/traverse" "^7.6.0" + "@babel/types" "^7.6.0" + "@babel/highlight@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" @@ -279,10 +319,13 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.6.0", "@babel/parser@^7.6.3", "@babel/parser@^7.6.4": +"@babel/parser@^7.0.0", "@babel/parser@^7.1.6", "@babel/parser@^7.6.3": version "7.6.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.6.4.tgz#cb9b36a7482110282d5cb6dd424ec9262b473d81" - integrity sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A== + +"@babel/parser@^7.6.0": + version "7.6.0" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.6.0.tgz#3e05d0647432a8326cb28d0de03895ae5a57f39b" "@babel/plugin-proposal-async-generator-functions@^7.1.0": version "7.1.0" @@ -294,8 +337,7 @@ "@babel/plugin-proposal-async-generator-functions@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" - integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ== + resolved "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-remap-async-to-generator" "^7.1.0" @@ -314,16 +356,14 @@ "@babel/plugin-proposal-class-properties@^7.5.5": version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.5.tgz#a974cfae1e37c3110e71f3c6a2e48b8e71958cd4" - integrity sha512-AF79FsnWFxjlaosgdi421vmYG6/jg79bVD0dpD44QdgobzHKuLZ6S3vl8la9qIeSwGi8i1fS0O1mfuDAAdo1/A== + resolved "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.5.tgz#a974cfae1e37c3110e71f3c6a2e48b8e71958cd4" dependencies: "@babel/helper-create-class-features-plugin" "^7.5.5" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-dynamic-import@^7.5.0": version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz#e532202db4838723691b10a67b8ce509e397c506" - integrity sha512-x/iMjggsKTFHYC6g11PL7Qy58IK8H5zqfm9e6hu4z1iH2IRyAp9u9dL80zA6R76yFovETFLKz2VJIC2iIPBuFw== + resolved "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz#e532202db4838723691b10a67b8ce509e397c506" dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-dynamic-import" "^7.2.0" @@ -337,8 +377,7 @@ "@babel/plugin-proposal-json-strings@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" - integrity sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg== + resolved "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-json-strings" "^7.2.0" @@ -350,10 +389,9 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.0.0" -"@babel/plugin-proposal-object-rest-spread@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.6.2.tgz#8ffccc8f3a6545e9f78988b6bf4fe881b88e8096" - integrity sha512-LDBXlmADCsMZV1Y9OQwMc0MyGZ8Ta/zlD9N67BfQT8uYwkRswiu2hU6nJKrjrt/58aH/vqfQlR/9yId/7A2gWw== +"@babel/plugin-proposal-object-rest-spread@^7.5.5": + version "7.5.5" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.5.tgz#61939744f71ba76a3ae46b5eea18a54c16d22e58" dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.2.0" @@ -367,8 +405,7 @@ "@babel/plugin-proposal-optional-catch-binding@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" - integrity sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g== + resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" @@ -381,14 +418,13 @@ "@babel/helper-regex" "^7.0.0" regexpu-core "^4.2.0" -"@babel/plugin-proposal-unicode-property-regex@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.6.2.tgz#05413762894f41bfe42b9a5e80919bd575dcc802" - integrity sha512-NxHETdmpeSCtiatMRYWVJo7266rrvAC3DTeG5exQBIH/fMIUK7ejDNznBbn3HQl/o9peymRRg7Yqkx6PdUXmMw== +"@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz#501ffd9826c0b91da22690720722ac7cb1ca9c78" dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.6.0" + regexpu-core "^4.5.4" "@babel/plugin-syntax-async-generators@^7.0.0": version "7.0.0" @@ -398,8 +434,7 @@ "@babel/plugin-syntax-async-generators@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" - integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== + resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -417,8 +452,7 @@ "@babel/plugin-syntax-dynamic-import@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" - integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== + resolved "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -430,8 +464,7 @@ "@babel/plugin-syntax-json-strings@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz#72bd13f6ffe1d25938129d2a186b11fd62951470" - integrity sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg== + resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz#72bd13f6ffe1d25938129d2a186b11fd62951470" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -449,8 +482,7 @@ "@babel/plugin-syntax-object-rest-spread@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" - integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== + resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -462,8 +494,7 @@ "@babel/plugin-syntax-optional-catch-binding@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" - integrity sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w== + resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -475,8 +506,7 @@ "@babel/plugin-transform-arrow-functions@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" - integrity sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg== + resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -490,8 +520,7 @@ "@babel/plugin-transform-async-to-generator@^7.5.0": version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz#89a3848a0166623b5bc481164b5936ab947e887e" - integrity sha512-mqvkzwIGkq0bEF1zLRRiTdjfomZJDV33AH3oQzHVGkI2VzEmXLpKKOBvEVaFZBJdN0XTyH38s9j/Kiqr68dggg== + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz#89a3848a0166623b5bc481164b5936ab947e887e" dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -505,8 +534,7 @@ "@babel/plugin-transform-block-scoped-functions@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" - integrity sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w== + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -517,10 +545,9 @@ "@babel/helper-plugin-utils" "^7.0.0" lodash "^4.17.10" -"@babel/plugin-transform-block-scoping@^7.6.3": - version "7.6.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.3.tgz#6e854e51fbbaa84351b15d4ddafe342f3a5d542a" - integrity sha512-7hvrg75dubcO3ZI2rjYTzUrEuh1E9IyDEhhB6qfcooxhDA33xx2MasuLVgdxzcP6R/lipAC6n9ub9maNW6RKdw== +"@babel/plugin-transform-block-scoping@^7.6.0": + version "7.6.0" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.0.tgz#c49e21228c4bbd4068a35667e6d951c75439b1dc" dependencies: "@babel/helper-plugin-utils" "^7.0.0" lodash "^4.17.13" @@ -540,8 +567,7 @@ "@babel/plugin-transform-classes@^7.5.5": version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.5.5.tgz#d094299d9bd680a14a2a0edae38305ad60fb4de9" - integrity sha512-U2htCNK/6e9K7jGyJ++1p5XRU+LJjrwtoiVn9SzRlDT2KubcZ11OOwy3s24TjHxPgxNwonCYP7U2K51uVYCMDg== + resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.5.5.tgz#d094299d9bd680a14a2a0edae38305ad60fb4de9" dependencies: "@babel/helper-annotate-as-pure" "^7.0.0" "@babel/helper-define-map" "^7.5.5" @@ -560,8 +586,7 @@ "@babel/plugin-transform-computed-properties@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" - integrity sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA== + resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -573,8 +598,7 @@ "@babel/plugin-transform-destructuring@^7.6.0": version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.6.0.tgz#44bbe08b57f4480094d57d9ffbcd96d309075ba6" - integrity sha512-2bGIS5P1v4+sWTCnKNDZDxbGvEqi0ijeqM/YqHtVGrvG2y0ySgnEEhXErvE9dA0bnIzY9bIzdFK0jFA46ASIIQ== + resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.6.0.tgz#44bbe08b57f4480094d57d9ffbcd96d309075ba6" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -586,14 +610,13 @@ "@babel/helper-regex" "^7.0.0" regexpu-core "^4.1.3" -"@babel/plugin-transform-dotall-regex@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.6.2.tgz#44abb948b88f0199a627024e1508acaf8dc9b2f9" - integrity sha512-KGKT9aqKV+9YMZSkowzYoYEiHqgaDhGmPNZlZxX6UeHC4z30nC1J9IrZuGqbYFB1jaIGdv91ujpze0exiVK8bA== +"@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz#361a148bc951444312c69446d76ed1ea8e4450c3" dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.6.0" + regexpu-core "^4.5.4" "@babel/plugin-transform-duplicate-keys@^7.0.0": version "7.0.0" @@ -603,8 +626,7 @@ "@babel/plugin-transform-duplicate-keys@^7.5.0": version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz#c5dbf5106bf84cdf691222c0974c12b1df931853" - integrity sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ== + resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz#c5dbf5106bf84cdf691222c0974c12b1df931853" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -617,8 +639,7 @@ "@babel/plugin-transform-exponentiation-operator@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" - integrity sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A== + resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" dependencies: "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -631,8 +652,7 @@ "@babel/plugin-transform-for-of@^7.4.4": version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz#0267fc735e24c808ba173866c6c4d1440fc3c556" - integrity sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ== + resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz#0267fc735e24c808ba173866c6c4d1440fc3c556" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -645,8 +665,7 @@ "@babel/plugin-transform-function-name@^7.4.4": version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz#e1436116abb0610c2259094848754ac5230922ad" - integrity sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA== + resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz#e1436116abb0610c2259094848754ac5230922ad" dependencies: "@babel/helper-function-name" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -659,15 +678,13 @@ "@babel/plugin-transform-literals@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" - integrity sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg== + resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-member-expression-literals@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz#fa10aa5c58a2cb6afcf2c9ffa8cb4d8b3d489a2d" - integrity sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA== + resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz#fa10aa5c58a2cb6afcf2c9ffa8cb4d8b3d489a2d" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -680,8 +697,7 @@ "@babel/plugin-transform-modules-amd@^7.5.0": version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz#ef00435d46da0a5961aa728a1d2ecff063e4fb91" - integrity sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg== + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz#ef00435d46da0a5961aa728a1d2ecff063e4fb91" dependencies: "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -697,8 +713,7 @@ "@babel/plugin-transform-modules-commonjs@^7.6.0": version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.6.0.tgz#39dfe957de4420445f1fcf88b68a2e4aa4515486" - integrity sha512-Ma93Ix95PNSEngqomy5LSBMAQvYKVe3dy+JlVJSHEXZR5ASL9lQBedMiCyVtmTLraIDVRE3ZjTZvmXXD2Ozw3g== + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.6.0.tgz#39dfe957de4420445f1fcf88b68a2e4aa4515486" dependencies: "@babel/helper-module-transforms" "^7.4.4" "@babel/helper-plugin-utils" "^7.0.0" @@ -714,8 +729,7 @@ "@babel/plugin-transform-modules-systemjs@^7.5.0": version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz#e75266a13ef94202db2a0620977756f51d52d249" - integrity sha512-Q2m56tyoQWmuNGxEtUyeEkm6qJYFqs4c+XyXH5RAuYxObRNz9Zgj/1g2GMnjYp2EUyEy7YTrxliGCXzecl/vJg== + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz#e75266a13ef94202db2a0620977756f51d52d249" dependencies: "@babel/helper-hoist-variables" "^7.4.4" "@babel/helper-plugin-utils" "^7.0.0" @@ -730,18 +744,16 @@ "@babel/plugin-transform-modules-umd@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" - integrity sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw== + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" dependencies: "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-named-capturing-groups-regex@^7.6.3": - version "7.6.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.6.3.tgz#aaa6e409dd4fb2e50b6e2a91f7e3a3149dbce0cf" - integrity sha512-jTkk7/uE6H2s5w6VlMHeWuH+Pcy2lmdwFoeWCVnvIrDUnB5gQqTVI8WfmEAhF2CDEarGrknZcmSFg1+bkfCoSw== +"@babel/plugin-transform-named-capturing-groups-regex@^7.6.0": + version "7.6.0" + resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.6.0.tgz#1e6e663097813bb4f53d42df0750cf28ad3bb3f1" dependencies: - regexpu-core "^4.6.0" + regexp-tree "^0.1.13" "@babel/plugin-transform-new-target@^7.0.0": version "7.0.0" @@ -751,8 +763,7 @@ "@babel/plugin-transform-new-target@^7.4.4": version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz#18d120438b0cc9ee95a47f2c72bc9768fbed60a5" - integrity sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA== + resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz#18d120438b0cc9ee95a47f2c72bc9768fbed60a5" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -765,8 +776,7 @@ "@babel/plugin-transform-object-super@^7.5.5": version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz#c70021df834073c65eb613b8679cc4a381d1a9f9" - integrity sha512-un1zJQAhSosGFBduPgN/YFNvWVpRuHKU7IHBglLoLZsGmruJPOo6pbInneflUdmq7YvSVqhpPs5zdBvLnteltQ== + resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz#c70021df834073c65eb613b8679cc4a381d1a9f9" dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-replace-supers" "^7.5.5" @@ -781,8 +791,7 @@ "@babel/plugin-transform-parameters@^7.4.4": version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz#7556cf03f318bd2719fe4c922d2d808be5571e16" - integrity sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw== + resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz#7556cf03f318bd2719fe4c922d2d808be5571e16" dependencies: "@babel/helper-call-delegate" "^7.4.4" "@babel/helper-get-function-arity" "^7.0.0" @@ -790,8 +799,7 @@ "@babel/plugin-transform-property-literals@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz#03e33f653f5b25c4eb572c98b9485055b389e905" - integrity sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ== + resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz#03e33f653f5b25c4eb572c98b9485055b389e905" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -831,15 +839,13 @@ "@babel/plugin-transform-regenerator@^7.4.5": version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz#629dc82512c55cee01341fb27bdfcb210354680f" - integrity sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA== + resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz#629dc82512c55cee01341fb27bdfcb210354680f" dependencies: regenerator-transform "^0.14.0" "@babel/plugin-transform-reserved-words@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz#4792af87c998a49367597d07fedf02636d2e1634" - integrity sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw== + resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz#4792af87c998a49367597d07fedf02636d2e1634" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -851,8 +857,7 @@ "@babel/plugin-transform-shorthand-properties@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" - integrity sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg== + resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -862,10 +867,9 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-spread@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.6.2.tgz#fc77cf798b24b10c46e1b51b1b88c2bf661bb8dd" - integrity sha512-DpSvPFryKdK1x+EDJYCy28nmAaIMdxmhot62jAXF/o99iA33Zj2Lmcp3vDmz+MUh0LNYVPvfj5iC3feb3/+PFg== +"@babel/plugin-transform-spread@^7.2.0": + version "7.2.2" + resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz#3103a9abe22f742b6d406ecd3cd49b774919b406" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -878,8 +882,7 @@ "@babel/plugin-transform-sticky-regex@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" - integrity sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw== + resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" @@ -893,8 +896,7 @@ "@babel/plugin-transform-template-literals@^7.4.4": version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz#9d28fea7bbce637fb7612a0750989d8321d4bcb0" - integrity sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g== + resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz#9d28fea7bbce637fb7612a0750989d8321d4bcb0" dependencies: "@babel/helper-annotate-as-pure" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -907,8 +909,7 @@ "@babel/plugin-transform-typeof-symbol@^7.2.0": version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz#117d2bcec2fbf64b4b59d1f9819894682d29f2b2" - integrity sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw== + resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz#117d2bcec2fbf64b4b59d1f9819894682d29f2b2" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -920,19 +921,17 @@ "@babel/helper-regex" "^7.0.0" regexpu-core "^4.1.3" -"@babel/plugin-transform-unicode-regex@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.6.2.tgz#b692aad888a7e8d8b1b214be6b9dc03d5031f698" - integrity sha512-orZI6cWlR3nk2YmYdb0gImrgCUwb5cBUwjf6Ks6dvNVvXERkwtJWOQaEOjPiu0Gu1Tq6Yq/hruCZZOOi9F34Dw== +"@babel/plugin-transform-unicode-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f" dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.6.0" + regexpu-core "^4.5.4" -"@babel/polyfill@^7.6.0": +"@babel/polyfill@^7.4.4": version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.6.0.tgz#6d89203f8b6cd323e8d946e47774ea35dc0619cc" - integrity sha512-q5BZJI0n/B10VaQQvln1IlDK3BTBJFbADx7tv+oXDPIDZuTo37H5Adb9jhlXm/fEN4Y7/64qD9mnrJJG7rmaTw== + resolved "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.6.0.tgz#6d89203f8b6cd323e8d946e47774ea35dc0619cc" dependencies: core-js "^2.6.5" regenerator-runtime "^0.13.2" @@ -983,19 +982,18 @@ js-levenshtein "^1.1.3" semver "^5.3.0" -"@babel/preset-env@^7.6.3": - version "7.6.3" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.6.3.tgz#9e1bf05a2e2d687036d24c40e4639dc46cef2271" - integrity sha512-CWQkn7EVnwzlOdR5NOm2+pfgSNEZmvGjOhlCHBDq0J8/EStr+G+FvPEiz9B56dR6MoiUFjXhfE4hjLoAKKJtIQ== +"@babel/preset-env@^7.5.5": + version "7.6.0" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.6.0.tgz#aae4141c506100bb2bfaa4ac2a5c12b395619e50" dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-async-generator-functions" "^7.2.0" "@babel/plugin-proposal-dynamic-import" "^7.5.0" "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.6.2" + "@babel/plugin-proposal-object-rest-spread" "^7.5.5" "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.6.2" + "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" "@babel/plugin-syntax-async-generators" "^7.2.0" "@babel/plugin-syntax-dynamic-import" "^7.2.0" "@babel/plugin-syntax-json-strings" "^7.2.0" @@ -1004,11 +1002,11 @@ "@babel/plugin-transform-arrow-functions" "^7.2.0" "@babel/plugin-transform-async-to-generator" "^7.5.0" "@babel/plugin-transform-block-scoped-functions" "^7.2.0" - "@babel/plugin-transform-block-scoping" "^7.6.3" + "@babel/plugin-transform-block-scoping" "^7.6.0" "@babel/plugin-transform-classes" "^7.5.5" "@babel/plugin-transform-computed-properties" "^7.2.0" "@babel/plugin-transform-destructuring" "^7.6.0" - "@babel/plugin-transform-dotall-regex" "^7.6.2" + "@babel/plugin-transform-dotall-regex" "^7.4.4" "@babel/plugin-transform-duplicate-keys" "^7.5.0" "@babel/plugin-transform-exponentiation-operator" "^7.2.0" "@babel/plugin-transform-for-of" "^7.4.4" @@ -1019,7 +1017,7 @@ "@babel/plugin-transform-modules-commonjs" "^7.6.0" "@babel/plugin-transform-modules-systemjs" "^7.5.0" "@babel/plugin-transform-modules-umd" "^7.2.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.6.3" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.6.0" "@babel/plugin-transform-new-target" "^7.4.4" "@babel/plugin-transform-object-super" "^7.5.5" "@babel/plugin-transform-parameters" "^7.4.4" @@ -1027,12 +1025,12 @@ "@babel/plugin-transform-regenerator" "^7.4.5" "@babel/plugin-transform-reserved-words" "^7.2.0" "@babel/plugin-transform-shorthand-properties" "^7.2.0" - "@babel/plugin-transform-spread" "^7.6.2" + "@babel/plugin-transform-spread" "^7.2.0" "@babel/plugin-transform-sticky-regex" "^7.2.0" "@babel/plugin-transform-template-literals" "^7.4.4" "@babel/plugin-transform-typeof-symbol" "^7.2.0" - "@babel/plugin-transform-unicode-regex" "^7.6.2" - "@babel/types" "^7.6.3" + "@babel/plugin-transform-unicode-regex" "^7.4.4" + "@babel/types" "^7.6.0" browserslist "^4.6.0" core-js-compat "^3.1.1" invariant "^2.2.2" @@ -1049,21 +1047,9 @@ "@babel/plugin-transform-react-jsx-self" "^7.0.0" "@babel/plugin-transform-react-jsx-source" "^7.0.0" -"@babel/preset-react@^7.6.3": - version "7.6.3" - resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.6.3.tgz#d5242c828322520205ae4eda5d4f4f618964e2f6" - integrity sha512-07yQhmkZmRAfwREYIQgW0HEwMY9GBJVuPY4Q12UC72AbfaawuupVWa8zQs2tlL+yun45Nv/1KreII/0PLfEsgA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-react-display-name" "^7.0.0" - "@babel/plugin-transform-react-jsx" "^7.0.0" - "@babel/plugin-transform-react-jsx-self" "^7.0.0" - "@babel/plugin-transform-react-jsx-source" "^7.0.0" - -"@babel/register@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.6.2.tgz#25765a922202cb06f8bdac5a3b1e70cd6bf3dd45" - integrity sha512-xgZk2LRZvt6i2SAUWxc7ellk4+OYRgS3Zpsnr13nMS1Qo25w21Uu8o6vTOAqNaxiqrnv30KTYzh9YWY2k21CeQ== +"@babel/register@^7.5.5": + version "7.6.0" + resolved "https://registry.npmjs.org/@babel/register/-/register-7.6.0.tgz#76b6f466714680f4becafd45beeb2a7b87431abf" dependencies: find-cache-dir "^2.0.0" lodash "^4.17.13" @@ -1071,19 +1057,45 @@ pirates "^4.0.0" source-map-support "^0.5.9" -"@babel/template@^7.1.0", "@babel/template@^7.4.4", "@babel/template@^7.6.0": +"@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.4.4", "@babel/template@^7.6.0": version "7.6.0" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.6.0.tgz#7f0159c7f5012230dad64cca42ec9bdb5c9536e6" - integrity sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ== dependencies: "@babel/code-frame" "^7.0.0" "@babel/parser" "^7.6.0" "@babel/types" "^7.6.0" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.5", "@babel/traverse@^7.6.2", "@babel/traverse@^7.6.3": +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.6": + version "7.1.6" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.1.6.tgz#c8db9963ab4ce5b894222435482bd8ea854b7b5c" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.1.6" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/parser" "^7.1.6" + "@babel/types" "^7.1.6" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.10" + +"@babel/traverse@^7.4.4", "@babel/traverse@^7.5.5", "@babel/traverse@^7.6.0": + version "7.6.0" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.0.tgz#389391d510f79be7ce2ddd6717be66d3fed4b516" + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.6.0" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.6.0" + "@babel/types" "^7.6.0" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + +"@babel/traverse@^7.6.2": version "7.6.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.6.3.tgz#66d7dba146b086703c0fb10dd588b7364cec47f9" - integrity sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw== dependencies: "@babel/code-frame" "^7.5.5" "@babel/generator" "^7.6.3" @@ -1095,10 +1107,25 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.4.4", "@babel/types@^7.5.5", "@babel/types@^7.6.0", "@babel/types@^7.6.3": +"@babel/types@^7.0.0", "@babel/types@^7.1.6": + version "7.1.6" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.1.6.tgz#0adb330c3a281348a190263aceb540e10f04bcce" + dependencies: + esutils "^2.0.2" + lodash "^4.17.10" + to-fast-properties "^2.0.0" + +"@babel/types@^7.4.4", "@babel/types@^7.5.5", "@babel/types@^7.6.0": + version "7.6.1" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz#53abf3308add3ac2a2884d539151c57c4b3ac648" + dependencies: + esutils "^2.0.2" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + +"@babel/types@^7.6.3": version "7.6.3" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.6.3.tgz#3f07d96f854f98e2fbd45c64b0cb942d11e8ba09" - integrity sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA== dependencies: esutils "^2.0.2" lodash "^4.17.13" @@ -1269,7 +1296,6 @@ "@sindresorhus/is@^0.7.0": version "0.7.0" resolved "https://registry.npm.taobao.org/@sindresorhus/is/download/@sindresorhus/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" - integrity sha1-mgb08TfuhNffBGDB/bETX/psUP0= "@types/acorn@^4.0.3": version "4.0.3" @@ -1297,7 +1323,6 @@ "@types/q@^1.5.1": version "1.5.2" resolved "https://registry.npm.taobao.org/@types/q/download/@types/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8" - integrity sha1-aQoUdbhPKohP0HzXl8APXzE1bqg= JSONStream@^1.0.4: version "1.3.5" @@ -1319,8 +1344,7 @@ accepts@~1.3.4, accepts@~1.3.5: accepts@~1.3.7: version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" dependencies: mime-types "~2.1.24" negotiator "0.6.2" @@ -1374,10 +1398,9 @@ add-stream@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" -address@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6" - integrity sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA== +address@1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/address/-/address-1.1.0.tgz#ef8e047847fcd2c5b6f50c16965f924fd99fe709" address@^1.0.1: version "1.0.3" @@ -1443,8 +1466,7 @@ ansi-escapes@^3.0.0: ansi-escapes@^3.2.0: version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" ansi-html@0.0.7: version "0.0.7" @@ -1466,8 +1488,7 @@ ansi-regex@^3.0.0: ansi-regex@^4.1.0: version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" ansi-styles@^2.2.1: version "2.2.1" @@ -1498,10 +1519,9 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -anymatch@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" - integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== +anymatch@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.0.tgz#e609350e50a9313b472789b2f14ef35808ee14d6" dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" @@ -1513,12 +1533,10 @@ aproba@^1.0.3: arch@^2.1.0: version "2.1.1" resolved "https://registry.npm.taobao.org/arch/download/arch-2.1.1.tgz#8f5c2731aa35a30929221bb0640eed65175ec84e" - integrity sha1-j1wnMao1owkpIhuwZA7tZRdeyE4= archive-type@^4.0.0: version "4.0.0" resolved "https://registry.npm.taobao.org/archive-type/download/archive-type-4.0.0.tgz#f92e72233056dfc6969472749c267bdb046b1d70" - integrity sha1-+S5yIzBW38aWlHJ0nCZ72wRrHXA= dependencies: file-type "^4.2.0" @@ -1610,7 +1628,6 @@ array-uniq@^1.0.1: array-uniq@^2.1.0: version "2.1.0" resolved "https://registry.npm.taobao.org/array-uniq/download/array-uniq-2.1.0.tgz#46603d5e28e79bfd02b046fcc1d77c6820bd8e98" - integrity sha1-RmA9Xijnm/0CsEb8wdd8aCC9jpg= array-unique@^0.2.1: version "0.2.1" @@ -1666,8 +1683,7 @@ async-each@^1.0.0: async-each@^1.0.1: version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + resolved "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" async-foreach@^0.1.3: version "0.1.3" @@ -1683,13 +1699,6 @@ async@^1.5.0, async@^1.5.2: version "1.5.2" resolved "https://registry.npmjs.org/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" -async@^2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== - dependencies: - lodash "^4.17.14" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -1701,7 +1710,6 @@ atob@^2.1.1: autolinker@~0.28.0: version "0.28.1" resolved "https://registry.yarnpkg.com/autolinker/-/autolinker-0.28.1.tgz#0652b491881879f0775dace0cdca3233942a4e47" - integrity sha1-BlK0kYgYefB3XazgzcoyM5QqTkc= dependencies: gulp-header "^1.7.1" @@ -1716,18 +1724,17 @@ autoprefixer@^6.3.1: postcss "^5.2.16" postcss-value-parser "^3.2.3" -autoprefixer@^9.6.1: - version "9.7.0" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.7.0.tgz#905ec19e50f04545fe9ff131182cc9ab25246901" - integrity sha512-j2IRvaCfrUxIiZun9ba4mhJ2omhw4OY88/yVzLO+lHhGBumAAK72PgM6gkbSN8iregPOn1ZlxGkmZh2CQ7X4AQ== +autoprefixer@^9.6.0: + version "9.6.1" + resolved "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.6.1.tgz#51967a02d2d2300bb01866c1611ec8348d355a47" dependencies: - browserslist "^4.7.2" - caniuse-lite "^1.0.30001004" + browserslist "^4.6.3" + caniuse-lite "^1.0.30000980" chalk "^2.4.2" normalize-range "^0.1.2" num2fraction "^1.2.2" - postcss "^7.0.19" - postcss-value-parser "^4.0.2" + postcss "^7.0.17" + postcss-value-parser "^4.0.0" aws-sign2@~0.7.0: version "0.7.0" @@ -1934,8 +1941,7 @@ babel-plugin-check-es2015-constants@^6.22.0: babel-plugin-dynamic-import-node@^2.3.0: version "2.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f" - integrity sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ== + resolved "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f" dependencies: object.assign "^4.1.0" @@ -2363,7 +2369,6 @@ balanced-match@^0.4.2: balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base64-js@^1.0.2: version "1.3.0" @@ -2397,13 +2402,11 @@ big.js@^3.1.3: big.js@^5.2.2: version "5.2.2" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" - integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== + resolved "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" bin-build@^3.0.0: version "3.0.0" resolved "https://registry.npm.taobao.org/bin-build/download/bin-build-3.0.0.tgz#c5780a25a8a9f966d8244217e6c1f5082a143861" - integrity sha1-xXgKJaip+WbYJEIX5sH1CCoUOGE= dependencies: decompress "^4.0.0" download "^6.2.2" @@ -2414,7 +2417,6 @@ bin-build@^3.0.0: bin-check@^4.1.0: version "4.1.0" resolved "https://registry.npm.taobao.org/bin-check/download/bin-check-4.1.0.tgz#fc495970bdc88bb1d5a35fc17e65c4a149fc4a49" - integrity sha1-/ElZcL3Ii7HVo1/BfmXEoUn8Skk= dependencies: execa "^0.7.0" executable "^4.1.0" @@ -2422,7 +2424,6 @@ bin-check@^4.1.0: bin-version-check@^4.0.0: version "4.0.0" resolved "https://registry.npm.taobao.org/bin-version-check/download/bin-version-check-4.0.0.tgz#7d819c62496991f80d893e6e02a3032361608f71" - integrity sha1-fYGcYklpkfgNiT5uAqMDI2Fgj3E= dependencies: bin-version "^3.0.0" semver "^5.6.0" @@ -2431,7 +2432,6 @@ bin-version-check@^4.0.0: bin-version@^3.0.0: version "3.1.0" resolved "https://registry.npm.taobao.org/bin-version/download/bin-version-3.1.0.tgz#5b09eb280752b1bd28f0c9db3f96f2f43b6c0839" - integrity sha1-WwnrKAdSsb0o8MnbP5by9DtsCDk= dependencies: execa "^1.0.0" find-versions "^3.0.0" @@ -2439,7 +2439,6 @@ bin-version@^3.0.0: bin-wrapper@^4.0.0: version "4.1.0" resolved "https://registry.npm.taobao.org/bin-wrapper/download/bin-wrapper-4.1.0.tgz#99348f2cf85031e3ef7efce7e5300aeaae960605" - integrity sha1-mTSPLPhQMePvfvzn5TAK6q6WBgU= dependencies: bin-check "^4.1.0" bin-version-check "^4.0.0" @@ -2454,8 +2453,7 @@ binary-extensions@^1.0.0: binary-extensions@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.0.0.tgz#23c0df14f6a88077f5f986c0d167ec03c3d5537c" - integrity sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow== + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz#23c0df14f6a88077f5f986c0d167ec03c3d5537c" binaryextensions@^2.1.2: version "2.1.2" @@ -2495,8 +2493,7 @@ body-parser@1.18.3: body-parser@1.19.0: version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== + resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" dependencies: bytes "3.1.0" content-type "~1.0.4" @@ -2536,7 +2533,6 @@ boolbase@^1.0.0, boolbase@~1.0.0: brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -2564,10 +2560,9 @@ braces@^2.3.0, braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" -braces@~3.0.2: +braces@^3.0.2: version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" dependencies: fill-range "^7.0.1" @@ -2628,14 +2623,13 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.0.tgz#9ee89225ffc07db03409f2fee524dc8227458a17" - integrity sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA== +browserslist@4.6.6: + version "4.6.6" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.6.6.tgz#6e4bf467cde520bc9dbdf3747dafa03531cec453" dependencies: - caniuse-lite "^1.0.30000989" - electron-to-chromium "^1.3.247" - node-releases "^1.1.29" + caniuse-lite "^1.0.30000984" + electron-to-chromium "^1.3.191" + node-releases "^1.1.25" browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: version "1.7.7" @@ -2644,14 +2638,13 @@ browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: caniuse-db "^1.0.30000639" electron-to-chromium "^1.2.7" -browserslist@^4.0.0, browserslist@^4.6.0, browserslist@^4.7.1, browserslist@^4.7.2: - version "4.7.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.2.tgz#1bb984531a476b5d389cedecb195b2cd69fb1348" - integrity sha512-uZavT/gZXJd2UTi9Ov7/Z340WOSQ3+m1iBVRUknf+okKxonL9P83S3ctiBDtuRmRu8PiCHjqyueqQ9HYlJhxiw== +browserslist@^4.0.0, browserslist@^4.6.0, browserslist@^4.6.3, browserslist@^4.6.6: + version "4.7.0" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.7.0.tgz#9ee89225ffc07db03409f2fee524dc8227458a17" dependencies: - caniuse-lite "^1.0.30001004" - electron-to-chromium "^1.3.295" - node-releases "^1.1.38" + caniuse-lite "^1.0.30000989" + electron-to-chromium "^1.3.247" + node-releases "^1.1.29" browserslist@^4.1.0: version "4.3.4" @@ -2717,7 +2710,6 @@ buffer@^4.3.0: buffer@^5.2.1: version "5.2.1" resolved "https://registry.npm.taobao.org/buffer/download/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" - integrity sha1-3Vf6DxCaxZxgJHkETcp7iz0LcdY= dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -2748,8 +2740,7 @@ bytes@3.0.0: bytes@3.1.0: version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" cache-base@^1.0.1: version "1.0.1" @@ -2768,7 +2759,6 @@ cache-base@^1.0.1: cacheable-request@^2.1.1: version "2.1.4" resolved "https://registry.npm.taobao.org/cacheable-request/download/cacheable-request-2.1.4.tgz#0d808801b6342ad33c91df9d0b44dc09b91e5c3d" - integrity sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0= dependencies: clone-response "1.0.2" get-stream "3.0.0" @@ -2861,8 +2851,7 @@ caniuse-api@^1.5.2: caniuse-api@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0" - integrity sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw== + resolved "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0" dependencies: browserslist "^4.0.0" caniuse-lite "^1.0.0" @@ -2873,10 +2862,9 @@ caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: version "1.0.30000910" resolved "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000910.tgz#58cca84780223291c28e92d97a9b1512260a9a8e" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30001004: - version "1.0.30001004" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001004.tgz#d879b73981b255488316da946c39327d8c00a586" - integrity sha512-3nfOR4O8Wa2RWoYfJkMtwRVOsK96TQ+eq57wd0iKaEWl8dwG4hKZ/g0MVBfCvysFvMLi9fQGR/DvozMdkEPl3g== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000980, caniuse-lite@^1.0.30000984, caniuse-lite@^1.0.30000989: + version "1.0.30000989" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000989.tgz#b9193e293ccf7e4426c5245134b8f2a56c0ac4b9" caniuse-lite@^1.0.30000899: version "1.0.30000910" @@ -2893,7 +2881,6 @@ caseless@~0.12.0: caw@^2.0.0, caw@^2.0.1: version "2.0.1" resolved "https://registry.npm.taobao.org/caw/download/caw-2.0.1.tgz#6c3ca071fc194720883c2dc5da9b074bfc7e9e95" - integrity sha1-bDygcfwZRyCIPC3F2psHS/x+npU= dependencies: get-proxy "^2.0.0" isurl "^1.0.0-alpha5" @@ -2909,7 +2896,7 @@ center-align@^0.1.1: chalk@2.3.1: version "2.3.1" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" + resolved "http://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" dependencies: ansi-styles "^3.2.0" escape-string-regexp "^1.0.5" @@ -2917,8 +2904,7 @@ chalk@2.3.1: chalk@2.4.2, chalk@^2.4.2: version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" @@ -3000,8 +2986,7 @@ chokidar@^2.0.0, chokidar@^2.0.2: chokidar@^2.0.4: version "2.1.8" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" - integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== + resolved "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" dependencies: anymatch "^2.0.0" async-each "^1.0.1" @@ -3018,19 +3003,18 @@ chokidar@^2.0.4: fsevents "^1.2.7" chokidar@^3.0.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.2.2.tgz#a433973350021e09f2b853a2287781022c0dc935" - integrity sha512-bw3pm7kZ2Wa6+jQWYP/c7bAZy3i4GwiIiMO2EeRjrE48l8vBqC/WvFhSF0xyM8fQiPEGvwMY/5bqDG7sSEOuhg== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.2.0" + version "3.1.0" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.1.0.tgz#ff23d077682a90eadd209bfa76eb10ed6d359668" + dependencies: + anymatch "^3.1.0" + braces "^3.0.2" + glob-parent "^5.0.0" + is-binary-path "^2.1.0" + is-glob "^4.0.1" + normalize-path "^3.0.0" + readdirp "^3.1.1" optionalDependencies: - fsevents "~2.1.1" + fsevents "^2.0.6" chownr@^1.1.1: version "1.1.1" @@ -3169,7 +3153,6 @@ clone-deep@^2.0.1: clone-response@1.0.2: version "1.0.2" resolved "https://registry.npm.taobao.org/clone-response/download/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= dependencies: mimic-response "^1.0.0" @@ -3211,7 +3194,6 @@ co@^4.6.0: coa@^2.0.2: version "2.0.2" resolved "https://registry.npm.taobao.org/coa/download/coa-2.0.2.tgz#43f6c21151b4ef2bf57187db0d73de229e3e7ec3" - integrity sha1-Q/bCEVG07yv1cYfbDXPeIp4+fsM= dependencies: "@types/q" "^1.5.1" chalk "^2.4.1" @@ -3282,8 +3264,7 @@ color@^2.0.1: color@^3.0.0: version "3.1.2" - resolved "https://registry.yarnpkg.com/color/-/color-3.1.2.tgz#68148e7f85d41ad7649c5fa8c8106f098d229e10" - integrity sha512-vXTJhHebByxZn3lDvDJYw4lR5+uB3vuoHsuYA5AKuxRVn5wzzIfQKGLBmgdVRHKTJYeK5rvJcHnrd0Li49CFpg== + resolved "https://registry.npmjs.org/color/-/color-3.1.2.tgz#68148e7f85d41ad7649c5fa8c8106f098d229e10" dependencies: color-convert "^1.9.1" color-string "^1.5.2" @@ -3338,9 +3319,8 @@ commander@^2.14.1, commander@^2.15.1, commander@^2.9.0: resolved "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" commander@^2.20.0: - 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== + version "2.20.0" + resolved "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" commander@~2.8.1: version "2.8.1" @@ -3384,7 +3364,6 @@ compression@^1.5.2: concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= concat-stream@^1.4.10, concat-stream@^1.4.7, concat-stream@^1.5.2, concat-stream@^1.6.0: version "1.6.2" @@ -3398,14 +3377,12 @@ concat-stream@^1.4.10, concat-stream@^1.4.7, concat-stream@^1.5.2, concat-stream concat-with-sourcemaps@*, concat-with-sourcemaps@^1.0.5: version "1.1.0" resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e" - integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg== dependencies: source-map "^0.6.1" config-chain@^1.1.11: version "1.1.12" resolved "https://registry.npm.taobao.org/config-chain/download/config-chain-1.1.12.tgz#0fde8d091200eb5e808caf25fe618c02f48e4efa" - integrity sha1-D96NCRIA616AjK8l/mGMAvSOTvo= dependencies: ini "^1.3.4" proto-list "~1.2.1" @@ -3443,7 +3420,6 @@ content-disposition@0.5.2: content-disposition@0.5.3, content-disposition@^0.5.2: version "0.5.3" resolved "https://registry.npm.taobao.org/content-disposition/download/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha1-4TDK9+cnkIfFYWwgB9BIVpiYT70= dependencies: safe-buffer "5.1.2" @@ -3752,19 +3728,17 @@ cookie@0.3.1: cookie@0.4.0: version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" core-js-compat@^3.1.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.3.3.tgz#82642808cf484a35292b2f8e83ef9376884e760f" - integrity sha512-GNZkENsx5pMnS7Inwv7ZO/s3B68a9WU5kIjxqrD/tkNR8mtfXJRk8fAKRlbvWZSGPc59/TkiOBDYl5Cb65pTVA== + version "3.2.1" + resolved "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.2.1.tgz#0cbdbc2e386e8e00d3b85dc81c848effec5b8150" dependencies: - browserslist "^4.7.1" + browserslist "^4.6.6" semver "^6.3.0" core-js@^2.4.0, core-js@^2.4.1, core-js@^2.5.0: @@ -3772,14 +3746,12 @@ core-js@^2.4.0, core-js@^2.4.1, core-js@^2.5.0: resolved "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" core-js@^2.6.5: - version "2.6.10" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.10.tgz#8a5b8391f8cc7013da703411ce5b585706300d7f" - integrity sha512-I39t74+4t+zau64EN1fE5v2W31Adtc/REhzWN+gWRRXg6WH5qAsZm62DHpQ1+Yhe4047T55jvzz7MUqF/dBBlA== + version "2.6.9" + resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= cosmiconfig@5.0.6: version "5.0.6" @@ -3812,8 +3784,7 @@ cosmiconfig@^4.0.0: cosmiconfig@^5.0.0: version "5.2.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" - integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== + resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" dependencies: import-fresh "^2.0.0" is-directory "^0.3.1" @@ -3918,8 +3889,7 @@ css-color-names@0.0.4, css-color-names@^0.0.4: css-declaration-sorter@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz#c198940f63a76d7e36c1e71018b001721054cb22" - integrity sha512-BcxQSKTSEEQUftYpBVnsH4SF05NTuBokb19/sBt6asXGKZ/6VP7PLG1CBCkFDYOnhXhPh0jMhO6xZ71oYHXHBA== + resolved "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz#c198940f63a76d7e36c1e71018b001721054cb22" dependencies: postcss "^7.0.1" timsort "^0.3.0" @@ -3957,7 +3927,6 @@ css-modules-loader-core@^1.1.0: css-select-base-adapter@^0.1.1: version "0.1.1" resolved "https://registry.npm.taobao.org/css-select-base-adapter/download/css-select-base-adapter-0.1.1.tgz#3b2ff4972cc362ab88561507a95408a1432135d7" - integrity sha1-Oy/0lyzDYquIVhUHqVQIoUMhNdc= css-select@^1.1.0, css-select@~1.2.0: version "1.2.0" @@ -4001,16 +3970,14 @@ css-tree@1.0.0-alpha.29: css-tree@1.0.0-alpha.33: version "1.0.0-alpha.33" - resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.33.tgz#970e20e5a91f7a378ddd0fc58d0b6c8d4f3be93e" - integrity sha512-SPt57bh5nQnpsTBsx/IXbO14sRc9xXu5MtMAVuo0BaQQmyf0NupNPPSoMaqiAF5tDFafYsTkfeH4Q/HCKXkg4w== + resolved "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.33.tgz#970e20e5a91f7a378ddd0fc58d0b6c8d4f3be93e" dependencies: mdn-data "2.0.4" source-map "^0.5.3" css-unit-converter@^1.1.1: version "1.1.1" - resolved "https://registry.yarnpkg.com/css-unit-converter/-/css-unit-converter-1.1.1.tgz#d9b9281adcfd8ced935bdbaba83786897f64e996" - integrity sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY= + resolved "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.1.tgz#d9b9281adcfd8ced935bdbaba83786897f64e996" css-url-regex@^1.1.0: version "1.1.0" @@ -4035,13 +4002,11 @@ cssesc@^0.1.0: cssesc@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-2.0.0.tgz#3b13bd1bb1cb36e1bcb5a4dcd27f54c5dcb35703" - integrity sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg== + resolved "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz#3b13bd1bb1cb36e1bcb5a4dcd27f54c5dcb35703" cssnano-preset-default@^4.0.7: version "4.0.7" - resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz#51ec662ccfca0f88b396dcd9679cdb931be17f76" - integrity sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA== + resolved "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz#51ec662ccfca0f88b396dcd9679cdb931be17f76" dependencies: css-declaration-sorter "^4.0.1" cssnano-util-raw-cache "^4.0.1" @@ -4076,25 +4041,21 @@ cssnano-preset-default@^4.0.7: cssnano-util-get-arguments@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz#ed3a08299f21d75741b20f3b81f194ed49cc150f" - integrity sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8= + resolved "https://registry.npmjs.org/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz#ed3a08299f21d75741b20f3b81f194ed49cc150f" cssnano-util-get-match@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz#c0e4ca07f5386bb17ec5e52250b4f5961365156d" - integrity sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0= + resolved "https://registry.npmjs.org/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz#c0e4ca07f5386bb17ec5e52250b4f5961365156d" cssnano-util-raw-cache@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz#b26d5fd5f72a11dfe7a7846fb4c67260f96bf282" - integrity sha512-qLuYtWK2b2Dy55I8ZX3ky1Z16WYsx544Q0UWViebptpwn/xDBmog2TLg4f+DBMg1rJ6JDWtn96WHbOKDWt1WQA== + resolved "https://registry.npmjs.org/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz#b26d5fd5f72a11dfe7a7846fb4c67260f96bf282" dependencies: postcss "^7.0.0" cssnano-util-same-parent@^4.0.0: version "4.0.1" - resolved "https://registry.yarnpkg.com/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz#574082fb2859d2db433855835d9a8456ea18bbf3" - integrity sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q== + resolved "https://registry.npmjs.org/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz#574082fb2859d2db433855835d9a8456ea18bbf3" cssnano@^3.10.0: version "3.10.0" @@ -4133,10 +4094,9 @@ cssnano@^3.10.0: postcss-value-parser "^3.2.3" postcss-zindex "^2.0.1" -cssnano@^4.1.10: +cssnano@^4.1.0: version "4.1.10" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-4.1.10.tgz#0ac41f0b13d13d465487e111b778d42da631b8b2" - integrity sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ== + resolved "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz#0ac41f0b13d13d465487e111b778d42da631b8b2" dependencies: cosmiconfig "^5.0.0" cssnano-preset-default "^4.0.7" @@ -4146,7 +4106,6 @@ cssnano@^4.1.10: csso@^3.5.1: version "3.5.1" resolved "https://registry.npm.taobao.org/csso/download/csso-3.5.1.tgz#7b9eb8be61628973c1b261e169d2f024008e758b" - integrity sha1-e564vmFiiXPBsmHhadLwJACOdYs= dependencies: css-tree "1.0.0-alpha.29" @@ -4225,7 +4184,7 @@ debug@=3.1.0: dependencies: ms "2.0.0" -debug@^3.1.0, debug@^3.1.1, debug@^3.2.5: +debug@^3.1.0, debug@^3.2.5: version "3.2.6" resolved "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" dependencies: @@ -4261,7 +4220,6 @@ decompress-response@^3.2.0, decompress-response@^3.3.0: decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: version "4.1.1" resolved "https://registry.npm.taobao.org/decompress-tar/download/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1" - integrity sha1-cYy9P8sWIJcW5womuE57pFkuWvE= dependencies: file-type "^5.2.0" is-stream "^1.1.0" @@ -4270,7 +4228,6 @@ decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: decompress-tarbz2@^4.0.0: version "4.1.1" resolved "https://registry.npm.taobao.org/decompress-tarbz2/download/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b" - integrity sha1-MIKluIDqQEOBY0nzeLVsUWvho5s= dependencies: decompress-tar "^4.1.0" file-type "^6.1.0" @@ -4281,7 +4238,6 @@ decompress-tarbz2@^4.0.0: decompress-targz@^4.0.0: version "4.1.1" resolved "https://registry.npm.taobao.org/decompress-targz/download/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee" - integrity sha1-wJvDXE0R894J8tLaU+neI+fOHu4= dependencies: decompress-tar "^4.1.1" file-type "^5.2.0" @@ -4290,7 +4246,6 @@ decompress-targz@^4.0.0: decompress-unzip@^4.0.1: version "4.0.1" resolved "https://registry.npm.taobao.org/decompress-unzip/download/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69" - integrity sha1-3qrM39FK6vhVePczroIQ+bSEj2k= dependencies: file-type "^3.8.0" get-stream "^2.2.0" @@ -4300,7 +4255,6 @@ decompress-unzip@^4.0.1: decompress@^4.0.0, decompress@^4.2.0: version "4.2.0" resolved "https://registry.npm.taobao.org/decompress/download/decompress-4.2.0.tgz#7aedd85427e5a92dacfe55674a7c505e96d01f9d" - integrity sha1-eu3YVCflqS2s/lVnSnxQXpbQH50= dependencies: decompress-tar "^4.0.0" decompress-tarbz2 "^4.0.0" @@ -4330,7 +4284,6 @@ deep-extend@^0.6.0: deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= default-gateway@^2.6.0: version "2.7.2" @@ -4504,20 +4457,19 @@ doctrine@^2.1.0: esutils "^2.0.2" docusaurus@^2.0.0-alpha.23: - version "2.0.0-alpha.30" - resolved "https://registry.yarnpkg.com/docusaurus/-/docusaurus-2.0.0-alpha.30.tgz#88c1763c5106f29dae1b1783b5c89b03ab4d236e" - integrity sha512-iSGSeZ8YnsUfU/sW7FlyTHT+9yRvRlkxWv61fS1li8Qng6ftovdCHYe0z8/R3nz0MsGw41Nx5T6GpmIRWc033Q== + version "2.0.0-alpha.24" + resolved "https://registry.npmjs.org/docusaurus/-/docusaurus-2.0.0-alpha.24.tgz#cf3d29bfefec178fbf385471566aa7587432bc12" dependencies: - "@babel/core" "^7.6.4" + "@babel/core" "^7.5.5" "@babel/plugin-proposal-class-properties" "^7.5.5" - "@babel/plugin-proposal-object-rest-spread" "^7.6.2" - "@babel/polyfill" "^7.6.0" - "@babel/preset-env" "^7.6.3" - "@babel/preset-react" "^7.6.3" - "@babel/register" "^7.6.2" - "@babel/traverse" "^7.6.3" - "@babel/types" "^7.6.3" - autoprefixer "^9.6.1" + "@babel/plugin-proposal-object-rest-spread" "^7.5.5" + "@babel/polyfill" "^7.4.4" + "@babel/preset-env" "^7.5.5" + "@babel/preset-react" "^7.0.0" + "@babel/register" "^7.5.5" + "@babel/traverse" "^7.5.5" + "@babel/types" "^7.5.5" + autoprefixer "^9.6.0" babylon "^6.18.0" chalk "^2.4.2" chokidar "^3.0.2" @@ -4526,7 +4478,7 @@ docusaurus@^2.0.0-alpha.23: commander "^2.20.0" cross-spawn "^6.0.5" crowdin-cli "^0.3.0" - cssnano "^4.1.10" + cssnano "^4.1.0" escape-string-regexp "^2.0.0" express "^4.17.1" feed "^1.1.0" @@ -4539,24 +4491,23 @@ docusaurus@^2.0.0-alpha.23: imagemin-jpegtran "^6.0.0" imagemin-optipng "^6.0.0" imagemin-svgo "^7.0.0" - lodash "^4.17.15" + lodash "^4.17.14" markdown-toc "^1.2.0" mkdirp "^0.5.1" portfinder "^1.0.21" postcss "^7.0.17" - prismjs "^1.17.1" + prismjs "^1.16.0" react "^16.8.4" react-dev-utils "^9.0.1" react-dom "^16.8.4" - remarkable "^1.7.4" + remarkable "^1.7.1" request "^2.88.0" shelljs "^0.8.3" sitemap "^3.2.2" - striptags "^3.1.1" tcp-port-used "^1.0.1" tiny-lr "^1.1.1" tree-node-cli "^1.2.5" - truncate-html "^1.0.2" + truncate-html "^1.0.1" dom-converter@~0.2: version "0.2.0" @@ -4627,15 +4578,13 @@ dot-prop@^3.0.0: dot-prop@^4.1.1: version "4.2.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" - integrity sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ== + resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" dependencies: is-obj "^1.0.0" download@^6.2.2: version "6.2.5" resolved "https://registry.npm.taobao.org/download/download/download-6.2.5.tgz#acd6a542e4cd0bb42ca70cfc98c9e43b07039714" - integrity sha1-rNalQuTNC7Qspwz8mMnkOwcDlxQ= dependencies: caw "^2.0.0" content-disposition "^0.5.2" @@ -4652,7 +4601,6 @@ download@^6.2.2: download@^7.1.0: version "7.1.0" resolved "https://registry.npm.taobao.org/download/download/download-7.1.0.tgz#9059aa9d70b503ee76a132897be6dec8e5587233" - integrity sha1-kFmqnXC1A+52oTKJe+beyOVYcjM= dependencies: archive-type "^4.0.0" caw "^2.0.1" @@ -4705,10 +4653,9 @@ electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.82: version "1.3.84" resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.84.tgz#2e55df59e818f150a9f61b53471ebf4f0feecc65" -electron-to-chromium@^1.3.247, electron-to-chromium@^1.3.295: - version "1.3.296" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.296.tgz#a1d4322d742317945285d3ba88966561b67f3ac8" - integrity sha512-s5hv+TSJSVRsxH190De66YHb50pBGTweT9XGWYu/LMR20KX6TsjFzObo36CjVAzM+PUeeKSBRtm/mISlCzeojQ== +electron-to-chromium@^1.3.191, electron-to-chromium@^1.3.247: + version "1.3.261" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.261.tgz#51b35a3126fb09b6852f24e907a6d3bd01c67724" elegant-spinner@^1.0.1: version "1.0.1" @@ -4781,7 +4728,6 @@ error@^7.0.0, error@^7.0.2: es-abstract@^1.12.0: version "1.13.0" resolved "https://registry.npm.taobao.org/es-abstract/download/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" - integrity sha1-rIYUX91QmdjdSVWMy6Lq+biOJOk= dependencies: es-to-primitive "^1.2.0" function-bind "^1.1.1" @@ -4871,8 +4817,7 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1 escape-string-regexp@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" escope@^3.6.0: version "3.6.0" @@ -5088,7 +5033,7 @@ eventemitter3@^3.0.0: events@^1.0.0: version "1.1.1" - resolved "https://registry.npmjs.org/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + resolved "http://registry.npmjs.org/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" eventsource@^1.0.7: version "1.0.7" @@ -5170,7 +5115,6 @@ execa@^1.0.0: executable@^4.1.0: version "4.1.1" resolved "https://registry.npm.taobao.org/executable/download/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c" - integrity sha1-QVMr/zYdPlevTXY7cFgtsY9dEzw= dependencies: pify "^2.2.0" @@ -5245,8 +5189,7 @@ express@^4.16.2: express@^4.17.1: version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + resolved "https://registry.npmjs.org/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" dependencies: accepts "~1.3.7" array-flatten "1.1.1" @@ -5282,14 +5225,12 @@ express@^4.17.1: ext-list@^2.0.0: version "2.2.2" resolved "https://registry.npm.taobao.org/ext-list/download/ext-list-2.2.2.tgz#0b98e64ed82f5acf0f2931babf69212ef52ddd37" - integrity sha1-C5jmTtgvWs8PKTG6v2khLvUt3Tc= dependencies: mime-db "^1.28.0" ext-name@^5.0.0: version "5.0.0" resolved "https://registry.npm.taobao.org/ext-name/download/ext-name-5.0.0.tgz#70781981d183ee15d13993c8822045c506c8f0a6" - integrity sha1-cHgZgdGD7hXROZPIgiBFxQbI8KY= dependencies: ext-list "^2.0.0" sort-keys-length "^1.0.0" @@ -5337,8 +5278,7 @@ external-editor@^3.0.0: external-editor@^3.0.3: version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" dependencies: chardet "^0.7.0" iconv-lite "^0.4.24" @@ -5449,32 +5389,26 @@ file-entry-cache@^2.0.0: file-type@5.2.0, file-type@^5.2.0: version "5.2.0" resolved "https://registry.npm.taobao.org/file-type/download/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" - integrity sha1-LdvqfHP/42No365J3DOMBYwritY= file-type@^10.4.0, file-type@^10.7.0: version "10.11.0" resolved "https://registry.npm.taobao.org/file-type/download/file-type-10.11.0.tgz#2961d09e4675b9fb9a3ee6b69e9cd23f43fd1890" - integrity sha1-KWHQnkZ1ufuaPua2npzSP0P9GJA= file-type@^3.8.0: version "3.9.0" resolved "https://registry.npm.taobao.org/file-type/download/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" - integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek= file-type@^4.2.0: version "4.4.0" resolved "https://registry.npm.taobao.org/file-type/download/file-type-4.4.0.tgz#1b600e5fca1fbdc6e80c0a70c71c8dba5f7906c5" - integrity sha1-G2AOX8ofvcboDApwxxyNul95BsU= file-type@^6.1.0: version "6.2.0" resolved "https://registry.npm.taobao.org/file-type/download/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919" - integrity sha1-5QzXXTVv/tTjBtxPW89Sp5kDqRk= file-type@^8.1.0: version "8.1.0" resolved "https://registry.npm.taobao.org/file-type/download/file-type-8.1.0.tgz#244f3b7ef641bbe0cca196c7276e4b332399f68c" - integrity sha1-JE87fvZBu+DMoZbHJ25LMyOZ9ow= filename-regex@^2.0.0: version "2.0.1" @@ -5487,7 +5421,6 @@ filename-reserved-regex@^1.0.0: filename-reserved-regex@^2.0.0: version "2.0.0" resolved "https://registry.npm.taobao.org/filename-reserved-regex/download/filename-reserved-regex-2.0.0.tgz#abf73dfab735d045440abfea2d91f389ebbfa229" - integrity sha1-q/c9+rc10EVECr/qLZHzieu/oik= filenamify-url@^1.0.0: version "1.0.0" @@ -5507,7 +5440,6 @@ filenamify@^1.0.0: filenamify@^2.0.0: version "2.1.0" resolved "https://registry.npm.taobao.org/filenamify/download/filenamify-2.1.0.tgz#88faf495fb1b47abfd612300002a16228c677ee9" - integrity sha1-iPr0lfsbR6v9YSMAACoWIoxnfuk= dependencies: filename-reserved-regex "^2.0.0" strip-outer "^1.0.0" @@ -5515,8 +5447,7 @@ filenamify@^2.0.0: filesize@3.6.1: version "3.6.1" - resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.6.1.tgz#090bb3ee01b6f801a8a8be99d31710b3422bb317" - integrity sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg== + resolved "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz#090bb3ee01b6f801a8a8be99d31710b3422bb317" fill-range@^2.1.0: version "2.2.4" @@ -5539,8 +5470,7 @@ fill-range@^4.0.0: fill-range@^7.0.1: version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" dependencies: to-regex-range "^5.0.1" @@ -5558,8 +5488,7 @@ finalhandler@1.1.1: finalhandler@~1.1.2: version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== + resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" dependencies: debug "2.6.9" encodeurl "~1.0.2" @@ -5587,8 +5516,7 @@ find-cache-dir@^1.0.0: find-cache-dir@^2.0.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" - integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== + resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" dependencies: commondir "^1.0.1" make-dir "^2.0.0" @@ -5620,7 +5548,6 @@ find-up@^2.0.0, find-up@^2.1.0: find-versions@^3.0.0: version "3.1.0" resolved "https://registry.npm.taobao.org/find-versions/download/find-versions-3.1.0.tgz#10161f29cf3eb4350dec10a29bdde75bff0df32d" - integrity sha1-EBYfKc8+tDUN7BCim93nW/8N8y0= dependencies: array-uniq "^2.1.0" semver-regex "^2.0.0" @@ -5661,7 +5588,6 @@ for-in@^0.1.3: for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= for-own@^0.1.4: version "0.1.5" @@ -5681,8 +5607,7 @@ forever-agent@~0.6.1: fork-ts-checker-webpack-plugin@1.5.0: version "1.5.0" - resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-1.5.0.tgz#ce1d77190b44d81a761b10b6284a373795e41f0c" - integrity sha512-zEhg7Hz+KhZlBhILYpXy+Beu96gwvkROWJiTXOCyOOMMrdBIRPvsBpBqgTI4jfJGrJXcqGwJR8zsBGDmzY0jsA== + resolved "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-1.5.0.tgz#ce1d77190b44d81a761b10b6284a373795e41f0c" dependencies: babel-code-frame "^6.22.0" chalk "^2.4.1" @@ -5718,7 +5643,6 @@ fresh@0.5.2: from2@^2.1.1: version "2.3.0" resolved "https://registry.npm.taobao.org/from2/download/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" - integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= dependencies: inherits "^2.0.1" readable-stream "^2.0.0" @@ -5751,8 +5675,7 @@ fs-extra@^5.0.0: fs-extra@^8.1.0: version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" dependencies: graceful-fs "^4.2.0" jsonfile "^4.0.0" @@ -5767,7 +5690,6 @@ fs-minipass@^1.2.5: fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fsevents@^1.2.2: version "1.2.4" @@ -5778,21 +5700,18 @@ fsevents@^1.2.2: fsevents@^1.2.7: version "1.2.9" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" - integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw== + resolved "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" dependencies: nan "^2.12.1" node-pre-gyp "^0.12.0" -fsevents@~2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.1.tgz#74c64e21df71721845d0c44fe54b7f56b82995a9" - integrity sha512-4FRPXWETxtigtJW/gxzEDsX1LVbPAM93VleB83kZB+ellqbHMkyt2aJfuzNLRvFPnGi6bcE5SvfxgbXPeKteJw== +fsevents@^2.0.6: + version "2.0.7" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.0.7.tgz#382c9b443c6cbac4c57187cdda23aa3bf1ccfc2a" fstream@^1.0.0, fstream@^1.0.2: version "1.0.12" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045" - integrity sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg== dependencies: graceful-fs "^4.1.2" inherits "~2.0.0" @@ -5831,7 +5750,6 @@ gauge@~2.7.3: gaze@^1.0.0, gaze@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/gaze/-/gaze-1.1.3.tgz#c441733e13b927ac8c0ff0b4c3b033f28812924a" - integrity sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g== dependencies: globule "^1.0.0" @@ -5866,7 +5784,6 @@ get-port@^3.2.0: get-proxy@^2.0.0: version "2.1.0" resolved "https://registry.npm.taobao.org/get-proxy/download/get-proxy-2.1.0.tgz#349f2b4d91d44c4d4d4e9cba2ad90143fac5ef93" - integrity sha1-NJ8rTZHUTE1NTpy6KtkBQ/rF75M= dependencies: npm-conf "^1.1.0" @@ -5889,7 +5806,6 @@ get-stream@3.0.0, get-stream@^3.0.0: get-stream@^2.2.0: version "2.3.1" resolved "https://registry.npm.taobao.org/get-stream/download/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" - integrity sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4= dependencies: object-assign "^4.0.1" pinkie-promise "^2.0.0" @@ -5932,7 +5848,6 @@ gh-pages@^1.1.0: gifsicle@^4.0.0: version "4.0.1" resolved "https://registry.npm.taobao.org/gifsicle/download/gifsicle-4.0.1.tgz#30e1e61e3ee4884ef702641b2e98a15c2127b2e2" - integrity sha1-MOHmHj7kiE73AmQbLpihXCEnsuI= dependencies: bin-build "^3.0.0" bin-wrapper "^4.0.0" @@ -6012,10 +5927,9 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-parent@~5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" - integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== +glob-parent@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" dependencies: is-glob "^4.0.1" @@ -6047,7 +5961,6 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.1: glob@^7.1.3: version "7.1.5" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.5.tgz#6714c69bee20f3c3e64c4dd905553e532b40cdc0" - integrity sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -6064,8 +5977,7 @@ global-dirs@^0.1.0: global-modules@2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" - integrity sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A== + resolved "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" dependencies: global-prefix "^3.0.0" @@ -6089,8 +6001,7 @@ global-prefix@^1.0.1: global-prefix@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97" - integrity sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg== + resolved "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97" dependencies: ini "^1.3.5" kind-of "^6.0.2" @@ -6106,8 +6017,7 @@ globals@^9.18.0: globby@8.0.2: version "8.0.2" - resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" - integrity sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w== + resolved "https://registry.npmjs.org/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" dependencies: array-union "^1.0.1" dir-glob "2.0.0" @@ -6202,7 +6112,6 @@ got@^7.0.0, got@^7.1.0: got@^8.3.1: version "8.3.2" resolved "https://registry.npm.taobao.org/got/download/got-8.3.2.tgz#1d23f64390e97f776cac52e5b936e5f514d2e937" - integrity sha1-HSP2Q5Dpf3dsrFLluTbl9RTS6Tc= dependencies: "@sindresorhus/is" "^0.7.0" cacheable-request "^2.1.1" @@ -6226,10 +6135,13 @@ graceful-fs@4.1.11: version "4.1.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.2.0: +graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6: version "4.2.3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" - integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== + +graceful-fs@^4.2.0: + version "4.2.2" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02" "graceful-readlink@>= 1.0.0": version "1.0.1" @@ -6254,7 +6166,6 @@ grouped-queue@^0.3.0, grouped-queue@^0.3.3: gulp-header@^1.7.1: version "1.8.12" resolved "https://registry.yarnpkg.com/gulp-header/-/gulp-header-1.8.12.tgz#ad306be0066599127281c4f8786660e705080a84" - integrity sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ== dependencies: concat-with-sourcemaps "*" lodash.template "^4.4.0" @@ -6262,8 +6173,7 @@ gulp-header@^1.7.1: gzip-size@5.1.1: version "5.1.1" - resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.1.1.tgz#cb9bee692f87c0612b232840a873904e4c135274" - integrity sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA== + resolved "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz#cb9bee692f87c0612b232840a873904e4c135274" dependencies: duplexer "^0.1.1" pify "^4.0.1" @@ -6386,13 +6296,11 @@ he@1.2.x: 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" - integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== + resolved "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" highlight.js@^9.15.8: version "9.15.10" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.15.10.tgz#7b18ed75c90348c045eef9ed08ca1319a2219ad2" - integrity sha512-RoV7OkQm0T3os3Dd2VHLNMoaoDVx77Wygln3n9l5YV172XonWG6rgQD3XnF/BuFFZw9A0TJgmMSO8FEWQgvcXw== + resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.10.tgz#7b18ed75c90348c045eef9ed08ca1319a2219ad2" hmac-drbg@^1.0.0: version "1.0.1" @@ -6430,13 +6338,11 @@ hpack.js@^2.1.6: hsl-regex@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/hsl-regex/-/hsl-regex-1.0.0.tgz#d49330c789ed819e276a4c0d272dffa30b18fe6e" - integrity sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4= + resolved "https://registry.npmjs.org/hsl-regex/-/hsl-regex-1.0.0.tgz#d49330c789ed819e276a4c0d272dffa30b18fe6e" hsla-regex@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/hsla-regex/-/hsla-regex-1.0.0.tgz#c1ce7a3168c8c6614033a4b5f7877f3b225f9c38" - integrity sha1-wc56MWjIxmFAM6S194d/OyJfnDg= + resolved "https://registry.npmjs.org/hsla-regex/-/hsla-regex-1.0.0.tgz#c1ce7a3168c8c6614033a4b5f7877f3b225f9c38" html-comment-regex@^1.1.0: version "1.1.2" @@ -6493,7 +6399,6 @@ htmlparser2@~3.3.0: http-cache-semantics@3.8.1: version "3.8.1" resolved "https://registry.npm.taobao.org/http-cache-semantics/download/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" - integrity sha1-ObDhat2bYFvwqe89nar0hDtMrNI= http-deceiver@^1.2.7: version "1.2.7" @@ -6510,8 +6415,7 @@ http-errors@1.6.3, http-errors@~1.6.2, http-errors@~1.6.3: http-errors@1.7.2: version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" dependencies: depd "~1.1.2" inherits "2.0.3" @@ -6521,8 +6425,7 @@ http-errors@1.7.2: http-errors@~1.7.2: version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" dependencies: depd "~1.1.2" inherits "2.0.4" @@ -6594,7 +6497,6 @@ iconv-lite@0.4.23: iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" @@ -6625,7 +6527,6 @@ ignore@^3.3.3, ignore@^3.3.5, ignore@^3.3.6: imagemin-gifsicle@^6.0.1: version "6.0.1" resolved "https://registry.npm.taobao.org/imagemin-gifsicle/download/imagemin-gifsicle-6.0.1.tgz#6abad4e95566d52e5a104aba1c24b4f3b48581b3" - integrity sha1-arrU6VVm1S5aEEq6HCS087SFgbM= dependencies: exec-buffer "^3.0.0" gifsicle "^4.0.0" @@ -6634,7 +6535,6 @@ imagemin-gifsicle@^6.0.1: imagemin-jpegtran@^6.0.0: version "6.0.0" resolved "https://registry.npm.taobao.org/imagemin-jpegtran/download/imagemin-jpegtran-6.0.0.tgz#c8d3bcfb6ec9c561c20a987142854be70d90b04f" - integrity sha1-yNO8+27JxWHCCphxQoVL5w2QsE8= dependencies: exec-buffer "^3.0.0" is-jpg "^2.0.0" @@ -6643,7 +6543,6 @@ imagemin-jpegtran@^6.0.0: imagemin-optipng@^6.0.0: version "6.0.0" resolved "https://registry.npm.taobao.org/imagemin-optipng/download/imagemin-optipng-6.0.0.tgz#a6bfc7b542fc08fc687e83dfb131249179a51a68" - integrity sha1-pr/HtUL8CPxofoPfsTEkkXmlGmg= dependencies: exec-buffer "^3.0.0" is-png "^1.0.0" @@ -6652,7 +6551,6 @@ imagemin-optipng@^6.0.0: imagemin-svgo@^7.0.0: version "7.0.0" resolved "https://registry.npm.taobao.org/imagemin-svgo/download/imagemin-svgo-7.0.0.tgz#a22d0a5917a0d0f37e436932c30f5e000fa91b1c" - integrity sha1-oi0KWReg0PN+Q2kyww9eAA+pGxw= dependencies: is-svg "^3.0.0" svgo "^1.0.5" @@ -6660,7 +6558,6 @@ imagemin-svgo@^7.0.0: imagemin@^6.0.0: version "6.1.0" resolved "https://registry.npm.taobao.org/imagemin/download/imagemin-6.1.0.tgz#62508b465728fea36c03cdc07d915fe2d8cf9e13" - integrity sha1-YlCLRlco/qNsA83AfZFf4tjPnhM= dependencies: file-type "^10.7.0" globby "^8.0.1" @@ -6671,8 +6568,7 @@ imagemin@^6.0.0: immer@1.10.0: version "1.10.0" - resolved "https://registry.yarnpkg.com/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d" - integrity sha512-O3sR1/opvCDGLEVcvrGTMtLac8GJ5IwZC4puPrLuRj3l7ICKvkmA0vGuU9OW8mV9WIBRnaxp5GJh9IEAaNOoYg== + resolved "https://registry.npmjs.org/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d" import-cwd@^2.1.0: version "2.1.0" @@ -6696,7 +6592,6 @@ import-from@^2.1.0: import-lazy@^3.1.0: version "3.1.0" resolved "https://registry.npm.taobao.org/import-lazy/download/import-lazy-3.1.0.tgz#891279202c8a2280fdbd6674dbd8da1a1dfc67cc" - integrity sha1-iRJ5ICyKIoD9vWZ029jaGh38Z8w= import-local@^2.0.0: version "2.0.0" @@ -6734,7 +6629,6 @@ indexof@0.0.1: inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" @@ -6742,7 +6636,6 @@ inflight@^1.0.4: inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== inherits@2.0.1: version "2.0.1" @@ -6758,8 +6651,7 @@ ini@^1.3.2, ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: inquirer@6.5.0: version "6.5.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" - integrity sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA== + resolved "https://registry.npmjs.org/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" dependencies: ansi-escapes "^3.2.0" chalk "^2.4.2" @@ -6845,7 +6737,6 @@ interpret@^1.0.0, interpret@^1.0.4: into-stream@^3.1.0: version "3.1.0" resolved "https://registry.npm.taobao.org/into-stream/download/into-stream-3.1.0.tgz#96fb0a936c12babd6ff1752a17d05616abd094c6" - integrity sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY= dependencies: from2 "^2.1.1" p-is-promise "^1.1.0" @@ -6878,8 +6769,7 @@ ipaddr.js@1.8.0: ipaddr.js@1.9.0: version "1.9.0" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" - integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== + resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" ipaddr.js@^1.5.2: version "1.8.1" @@ -6915,10 +6805,9 @@ is-binary-path@^1.0.0: dependencies: binary-extensions "^1.0.0" -is-binary-path@~2.1.0: +is-binary-path@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" dependencies: binary-extensions "^2.0.0" @@ -6944,8 +6833,7 @@ is-ci@^1.0.10, is-ci@^1.2.1: is-color-stop@^1.0.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/is-color-stop/-/is-color-stop-1.1.0.tgz#cfff471aee4dd5c9e158598fbe12967b5cdad345" - integrity sha1-z/9HGu5N1cnhWFmPvhKWe1za00U= + resolved "https://registry.npmjs.org/is-color-stop/-/is-color-stop-1.1.0.tgz#cfff471aee4dd5c9e158598fbe12967b5cdad345" dependencies: css-color-names "^0.0.4" hex-color-regex "^1.1.0" @@ -7007,7 +6895,6 @@ is-extendable@^0.1.0, is-extendable@^0.1.1: is-extendable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== dependencies: is-plain-object "^2.0.4" @@ -7038,7 +6925,6 @@ is-fullwidth-code-point@^2.0.0: is-gif@^3.0.0: version "3.0.0" resolved "https://registry.npm.taobao.org/is-gif/download/is-gif-3.0.0.tgz#c4be60b26a301d695bb833b20d9b5d66c6cf83b1" - integrity sha1-xL5gsmowHWlbuDOyDZtdZsbPg7E= dependencies: file-type "^10.4.0" @@ -7060,17 +6946,15 @@ is-glob@^4.0.0: dependencies: is-extglob "^2.1.1" -is-glob@^4.0.1, is-glob@~4.0.1: +is-glob@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" dependencies: is-extglob "^2.1.1" is-jpg@^2.0.0: version "2.0.0" resolved "https://registry.npm.taobao.org/is-jpg/download/is-jpg-2.0.0.tgz#2e1997fa6e9166eaac0242daae443403e4ef1d97" - integrity sha1-LhmX+m6RZuqsAkLarkQ0A+TvHZc= is-module@^1.0.0: version "1.0.0" @@ -7079,7 +6963,6 @@ is-module@^1.0.0: is-natural-number@^4.0.1: version "4.0.1" resolved "https://registry.npm.taobao.org/is-natural-number/download/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" - integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= is-number@^2.1.0: version "2.1.0" @@ -7099,8 +6982,7 @@ is-number@^4.0.0: is-number@^7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" is-obj@^1.0.0, is-obj@^1.0.1: version "1.0.1" @@ -7139,7 +7021,6 @@ is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" @@ -7189,8 +7070,7 @@ is-retry-allowed@^1.0.0, is-retry-allowed@^1.1.0: is-root@2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/is-root/-/is-root-2.1.0.tgz#809e18129cf1129644302a4f8544035d51984a9c" - integrity sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg== + resolved "https://registry.npmjs.org/is-root/-/is-root-2.1.0.tgz#809e18129cf1129644302a4f8544035d51984a9c" is-scoped@^1.0.0: version "1.0.0" @@ -7215,7 +7095,6 @@ is-svg@^2.0.0: is-svg@^3.0.0: version "3.0.0" resolved "https://registry.npm.taobao.org/is-svg/download/is-svg-3.0.0.tgz#9321dbd29c212e5ca99c4fa9794c714bcafa2f75" - integrity sha1-kyHb0pwhLlypnE+peUxxS8r6L3U= dependencies: html-comment-regex "^1.1.0" @@ -7237,8 +7116,7 @@ is-typedarray@~1.0.0: is-url@^1.2.2: version "1.2.4" - resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" - integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== + resolved "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" is-utf8@^0.2.0: version "0.2.1" @@ -7254,8 +7132,7 @@ is-wsl@^1.1.0: is2@2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/is2/-/is2-2.0.1.tgz#8ac355644840921ce435d94f05d3a94634d3481a" - integrity sha512-+WaJvnaA7aJySz2q/8sLjMb2Mw14KTplHmSwcSpZ/fWJPkUmqw3YTzSWbPJ7OAwRvdYTWF2Wg+yYJ1AdP5Z8CA== + resolved "https://registry.npmjs.org/is2/-/is2-2.0.1.tgz#8ac355644840921ce435d94f05d3a94634d3481a" dependencies: deep-is "^0.1.3" ip-regex "^2.1.0" @@ -7268,7 +7145,6 @@ isarray@0.0.1: isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isexe@^2.0.0: version "2.0.0" @@ -7283,7 +7159,6 @@ isobject@^2.0.0: isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= isstream@~0.1.2: version "0.1.2" @@ -7348,7 +7223,6 @@ jest-validate@^23.5.0: jpegtran-bin@^4.0.0: version "4.0.0" resolved "https://registry.npm.taobao.org/jpegtran-bin/download/jpegtran-bin-4.0.0.tgz#d00aed809fba7aa6f30817e59eee4ddf198f8f10" - integrity sha1-0ArtgJ+6eqbzCBflnu5N3xmPjxA= dependencies: bin-build "^3.0.0" bin-wrapper "^4.0.0" @@ -7380,7 +7254,6 @@ js-yaml@^3.10.0, js-yaml@^3.4.3, js-yaml@^3.8.1, js-yaml@^3.9.0, js-yaml@^3.9.1: js-yaml@^3.13.1: version "3.13.1" resolved "https://registry.npm.taobao.org/js-yaml/download/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha1-r/FRswv9+o5J4F2iLnQV6d+jeEc= dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -7431,7 +7304,6 @@ jsesc@~0.5.0: json-buffer@3.0.0: version "3.0.0" resolved "https://registry.npm.taobao.org/json-buffer/download/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= json-loader@^0.5.4: version "0.5.7" @@ -7471,8 +7343,7 @@ json5@^0.5.0, json5@^0.5.1: json5@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + resolved "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" dependencies: minimist "^1.2.0" @@ -7514,7 +7385,6 @@ jsx-ast-utils@^2.0.1: keyv@3.0.0: version "3.0.0" resolved "https://registry.npm.taobao.org/keyv/download/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373" - integrity sha1-RJI7o55osSp87H32wyaMAx8u83M= dependencies: json-buffer "3.0.0" @@ -7786,8 +7656,7 @@ loader-runner@^2.3.0: loader-utils@1.2.3: version "1.2.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" - integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== + resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" dependencies: big.js "^5.2.2" emojis-list "^2.0.0" @@ -7831,7 +7700,6 @@ locate-path@^3.0.0: lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= lodash.assignin@^4.0.9: version "4.2.0" @@ -7847,8 +7715,7 @@ lodash.camelcase@4.3.0, lodash.camelcase@^4.3.0: lodash.chunk@^4.2.0: version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc" - integrity sha1-ZuXOH3btJ7QwPYxlEujRIW6BBrw= + resolved "https://registry.npmjs.org/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc" lodash.debounce@^4.0.8: version "4.0.8" @@ -7896,8 +7763,7 @@ lodash.omit@4.5.0: lodash.padstart@^4.6.1: version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.padstart/-/lodash.padstart-4.6.1.tgz#d2e3eebff0d9d39ad50f5cbd1b52a7bce6bb611b" - integrity sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs= + resolved "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.6.1.tgz#d2e3eebff0d9d39ad50f5cbd1b52a7bce6bb611b" lodash.pick@4.4.0, lodash.pick@^4.2.1: version "4.4.0" @@ -7921,8 +7787,7 @@ lodash.some@^4.4.0: lodash.sortby@^4.7.0: version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= + resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" lodash.startcase@4.4.0: version "4.4.0" @@ -7935,7 +7800,6 @@ lodash.tail@^4.1.1: lodash.template@^4.0.2, lodash.template@^4.4.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" - integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== dependencies: lodash._reinterpolate "^3.0.0" lodash.templatesettings "^4.0.0" @@ -7943,7 +7807,6 @@ lodash.template@^4.0.2, lodash.template@^4.4.0: lodash.templatesettings@^4.0.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" - integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== dependencies: lodash._reinterpolate "^3.0.0" @@ -7959,10 +7822,13 @@ lodash.upperfirst@4.3.1: version "4.3.1" resolved "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" -lodash@^4.0.0, lodash@^4.11.1, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.10: +lodash@^4.0.0, lodash@^4.11.1, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.10: + version "4.17.11" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + +lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15: version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" log-symbols@^1.0.1, log-symbols@^1.0.2: version "1.0.2" @@ -8026,7 +7892,6 @@ lower-case@^1.1.1: lowercase-keys@1.0.0: version "1.0.0" resolved "https://registry.npm.taobao.org/lowercase-keys/download/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" - integrity sha1-TjNms55/VFfjXxMkvfb4jQv8cwY= lowercase-keys@^1.0.0: version "1.0.1" @@ -8069,8 +7934,7 @@ make-dir@^1.0.0, make-dir@^1.2.0: make-dir@^2.0.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" - integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + resolved "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" dependencies: pify "^4.0.1" semver "^5.6.0" @@ -8149,8 +8013,7 @@ md5.js@^1.3.4: mdn-data@2.0.4: version "2.0.4" - resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" - integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== + resolved "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" mdn-data@~1.1.0: version "1.1.4" @@ -8265,8 +8128,7 @@ methods@~1.1.2: microevent.ts@~0.1.1: version "0.1.1" - resolved "https://registry.yarnpkg.com/microevent.ts/-/microevent.ts-0.1.1.tgz#70b09b83f43df5172d0205a63025bce0f7357fa0" - integrity sha512-jo1OfR4TaEwd5HOrt5+tAZ9mqT4jmpNAusXtyfNzqVm9uiSYFZlKM1wYL4oU7azZW/PxQW53wM0S6OR1JHNa2g== + resolved "https://registry.npmjs.org/microevent.ts/-/microevent.ts-0.1.1.tgz#70b09b83f43df5172d0205a63025bce0f7357fa0" micromatch@^2.3.11, micromatch@^2.3.7: version "2.3.11" @@ -8314,7 +8176,6 @@ miller-rabin@^4.0.0: mime-db@1.40.0, mime-db@^1.28.0: version "1.40.0" resolved "https://registry.npm.taobao.org/mime-db/download/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" - integrity sha1-plBX6ZjbCQ9zKmj2wnbTh9QSbDI= "mime-db@>= 1.36.0 < 2", mime-db@~1.37.0: version "1.37.0" @@ -8328,8 +8189,7 @@ mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.19: mime-types@~2.1.24: version "2.1.24" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" - integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== + resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" dependencies: mime-db "1.40.0" @@ -8339,8 +8199,7 @@ mime@1.4.1: mime@1.6.0: version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" mime@^2.3.1: version "2.4.0" @@ -8365,7 +8224,6 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: "minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, 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== dependencies: brace-expansion "^1.1.7" @@ -8379,7 +8237,6 @@ minimist-options@^3.0.1: minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= minimist@^0.1.0: version "0.1.0" @@ -8409,7 +8266,6 @@ minizlib@^1.1.1: mixin-deep@^1.1.3, mixin-deep@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" @@ -8473,8 +8329,7 @@ mute-stream@0.0.7: nan@^2.12.1, nan@^2.13.2: version "2.14.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" - integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== + resolved "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" nan@^2.9.2: version "2.11.1" @@ -8514,8 +8369,7 @@ negotiator@0.6.1: negotiator@0.6.2: version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" neo-async@^2.5.0: version "2.6.0" @@ -8619,8 +8473,7 @@ node-pre-gyp@^0.10.0: node-pre-gyp@^0.12.0: version "0.12.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" - integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A== + resolved "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" dependencies: detect-libc "^1.0.2" mkdirp "^0.5.1" @@ -8645,17 +8498,15 @@ node-releases@^1.0.1: dependencies: semver "^5.3.0" -node-releases@^1.1.29, node-releases@^1.1.38: - version "1.1.39" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.39.tgz#c1011f30343aff5b633153b10ff691d278d08e8d" - integrity sha512-8MRC/ErwNCHOlAFycy9OPca46fQYUjbJRDcZTHVWIGXIjYLM73k70vv3WkYutVnM4cCo4hE0MqBVVZjP6vjISA== +node-releases@^1.1.25, node-releases@^1.1.29: + version "1.1.32" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-1.1.32.tgz#485b35c1bf9b4d8baa105d782f8ca731e518276e" dependencies: - semver "^6.3.0" + semver "^5.3.0" node-sass@^4.12.0: version "4.13.0" resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.13.0.tgz#b647288babdd6a1cb726de4545516b31f90da066" - integrity sha512-W1XBrvoJ1dy7VsvTAS5q1V45lREbTlZQqFbiHb3R3OTTCma0XBtuG6xZ6Z4506nR4lmHPTqVRwxT6KgtWC97CA== dependencies: async-foreach "^0.1.3" chalk "^1.1.1" @@ -8710,10 +8561,9 @@ normalize-path@^2.0.1, normalize-path@^2.1.1: dependencies: remove-trailing-separator "^1.0.1" -normalize-path@^3.0.0, normalize-path@~3.0.0: +normalize-path@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" normalize-range@^0.1.2: version "0.1.2" @@ -8722,7 +8572,6 @@ normalize-range@^0.1.2: normalize-url@2.0.1: version "2.0.1" resolved "https://registry.npm.taobao.org/normalize-url/download/normalize-url-2.0.1.tgz#835a9da1551fa26f70e92329069a23aa6574d7e6" - integrity sha1-g1qdoVUfom9w6SMpBpojqmV01+Y= dependencies: prepend-http "^2.0.0" query-string "^5.0.1" @@ -8739,8 +8588,7 @@ normalize-url@^1.0.0, normalize-url@^1.4.0: normalize-url@^3.0.0: version "3.3.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" - integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== + resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" npm-bundled@^1.0.1: version "1.0.5" @@ -8749,7 +8597,6 @@ npm-bundled@^1.0.1: npm-conf@^1.1.0: version "1.1.3" resolved "https://registry.npm.taobao.org/npm-conf/download/npm-conf-1.1.3.tgz#256cc47bd0e218c259c4e9550bf413bc2192aff9" - integrity sha1-JWzEe9DiGMJZxOlVC/QTvCGSr/k= dependencies: config-chain "^1.1.11" pify "^3.0.0" @@ -8840,8 +8687,7 @@ object-hash@^1.1.4: object-keys@^1.0.11: version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" object-keys@^1.0.12: version "1.0.12" @@ -8855,8 +8701,7 @@ object-visit@^1.0.0: object.assign@^4.1.0: version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" dependencies: define-properties "^1.1.2" function-bind "^1.1.1" @@ -8886,7 +8731,6 @@ object.pick@^1.2.0, object.pick@^1.3.0: object.values@^1.1.0: version "1.1.0" resolved "https://registry.npm.taobao.org/object.values/download/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9" - integrity sha1-v2gQ712j5TJXkOqqK+IT6oRiTak= dependencies: define-properties "^1.1.3" es-abstract "^1.12.0" @@ -8910,7 +8754,6 @@ on-headers@~1.0.1: once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" @@ -8926,8 +8769,7 @@ onetime@^2.0.0: open@^6.3.0: version "6.4.0" - resolved "https://registry.yarnpkg.com/open/-/open-6.4.0.tgz#5c13e96d0dc894686164f18965ecfe889ecfc8a9" - integrity sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg== + resolved "https://registry.npmjs.org/open/-/open-6.4.0.tgz#5c13e96d0dc894686164f18965ecfe889ecfc8a9" dependencies: is-wsl "^1.1.0" @@ -8958,7 +8800,6 @@ optionator@^0.8.2: optipng-bin@^5.0.0: version "5.1.0" resolved "https://registry.npm.taobao.org/optipng-bin/download/optipng-bin-5.1.0.tgz#a7c7ab600a3ab5a177dae2f94c2d800aa386b5a9" - integrity sha1-p8erYAo6taF32uL5TC2ACqOGtak= dependencies: bin-build "^3.0.0" bin-wrapper "^4.0.0" @@ -8997,7 +8838,6 @@ os-browserify@^0.3.0: os-filter-obj@^2.0.0: version "2.0.0" resolved "https://registry.npm.taobao.org/os-filter-obj/download/os-filter-obj-2.0.0.tgz#1c0b62d5f3a2442749a2d139e6dddee6e81d8d16" - integrity sha1-HAti1fOiRCdJotE55t3e5ugdjRY= dependencies: arch "^2.1.0" @@ -9054,7 +8894,6 @@ p-cancelable@^0.3.0: p-cancelable@^0.4.0: version "0.4.1" resolved "https://registry.npm.taobao.org/p-cancelable/download/p-cancelable-0.4.1.tgz#35f363d67d52081c8d9585e37bcceb7e0bbcb2a0" - integrity sha1-NfNj1n1SCByNlYXje8zrfgu8sqA= p-defer@^1.0.0: version "1.0.0" @@ -9069,14 +8908,12 @@ p-each-series@^1.0.0: p-event@^1.0.0: version "1.3.0" resolved "https://registry.npm.taobao.org/p-event/download/p-event-1.3.0.tgz#8e6b4f4f65c72bc5b6fe28b75eda874f96a4a085" - integrity sha1-jmtPT2XHK8W2/ii3XtqHT5akoIU= dependencies: p-timeout "^1.1.1" p-event@^2.1.0: version "2.3.1" resolved "https://registry.npm.taobao.org/p-event/download/p-event-2.3.1.tgz#596279ef169ab2c3e0cae88c1cfbb08079993ef6" - integrity sha1-WWJ57xaassPgyuiMHPuwgHmZPvY= dependencies: p-timeout "^2.0.1" @@ -9119,7 +8956,6 @@ p-locate@^3.0.0: p-map-series@^1.0.0: version "1.0.0" resolved "https://registry.npm.taobao.org/p-map-series/download/p-map-series-1.0.0.tgz#bf98fe575705658a9e1351befb85ae4c1f07bdca" - integrity sha1-v5j+V1cFZYqeE1G++4WuTB8Hvco= dependencies: p-reduce "^1.0.0" @@ -9152,7 +8988,6 @@ p-timeout@^1.1.1: p-timeout@^2.0.1: version "2.0.1" resolved "https://registry.npm.taobao.org/p-timeout/download/p-timeout-2.0.1.tgz#d8dd1979595d2dc0139e1fe46b8b646cb3cdf038" - integrity sha1-2N0ZeVldLcATnh/ka4tkbLPN8Dg= dependencies: p-finally "^1.0.0" @@ -9233,8 +9068,7 @@ parseurl@~1.3.2: parseurl@~1.3.3: version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" pascalcase@^0.1.1: version "0.1.1" @@ -9261,7 +9095,6 @@ path-exists@^3.0.0: path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" @@ -9319,8 +9152,7 @@ performance-now@^2.1.0: picomatch@^2.0.4: version "2.0.7" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6" - integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA== + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6" pidtree@^0.3.0: version "0.3.0" @@ -9337,7 +9169,6 @@ pify@^3.0.0: pify@^4.0.1: version "4.0.1" resolved "https://registry.npm.taobao.org/pify/download/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" - integrity sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE= pinkie-promise@^2.0.0: version "2.0.1" @@ -9375,8 +9206,7 @@ pkg-dir@^3.0.0: pkg-up@2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" - integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= + resolved "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" dependencies: find-up "^2.1.0" @@ -9391,13 +9221,12 @@ pluralize@^7.0.0: resolved "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" portfinder@^1.0.21: - version "1.0.25" - resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.25.tgz#254fd337ffba869f4b9d37edc298059cb4d35eca" - integrity sha512-6ElJnHBbxVA1XSLgBp7G1FiCkQdlqGzuF7DswL5tcea+E8UpuvPU7beVAjjRwCioTS9ZluNbu+ZyRvgTsmqEBg== + version "1.0.24" + resolved "https://registry.npmjs.org/portfinder/-/portfinder-1.0.24.tgz#11efbc6865f12f37624b6531ead1d809ed965cfa" dependencies: - async "^2.6.2" - debug "^3.1.1" - mkdirp "^0.5.1" + async "^1.5.2" + debug "^2.2.0" + mkdirp "0.5.x" portfinder@^1.0.9: version "1.0.19" @@ -9421,8 +9250,7 @@ postcss-calc@^5.2.0: postcss-calc@^7.0.1: version "7.0.1" - resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-7.0.1.tgz#36d77bab023b0ecbb9789d84dcb23c4941145436" - integrity sha512-oXqx0m6tb4N3JGdmeMSc/i91KppbYsFZKdH0xMOqK8V1rJlzrKlTdokz8ozUXLVejydRN6u2IddxpcijRj2FqQ== + resolved "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.1.tgz#36d77bab023b0ecbb9789d84dcb23c4941145436" dependencies: css-unit-converter "^1.1.1" postcss "^7.0.5" @@ -9439,8 +9267,7 @@ postcss-colormin@^2.1.8: postcss-colormin@^4.0.3: version "4.0.3" - resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-4.0.3.tgz#ae060bce93ed794ac71264f08132d550956bd381" - integrity sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw== + resolved "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.3.tgz#ae060bce93ed794ac71264f08132d550956bd381" dependencies: browserslist "^4.0.0" color "^3.0.0" @@ -9457,8 +9284,7 @@ postcss-convert-values@^2.3.4: postcss-convert-values@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz#ca3813ed4da0f812f9d43703584e449ebe189a7f" - integrity sha512-Kisdo1y77KUC0Jmn0OXU/COOJbzM8cImvw1ZFsBgBgMgb1iL23Zs/LXRe3r+EZqM3vGYKdQ2YJVQ5VkJI+zEJQ== + resolved "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz#ca3813ed4da0f812f9d43703584e449ebe189a7f" dependencies: postcss "^7.0.0" postcss-value-parser "^3.0.0" @@ -9471,8 +9297,7 @@ postcss-discard-comments@^2.0.4: postcss-discard-comments@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz#1fbabd2c246bff6aaad7997b2b0918f4d7af4033" - integrity sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg== + resolved "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz#1fbabd2c246bff6aaad7997b2b0918f4d7af4033" dependencies: postcss "^7.0.0" @@ -9484,8 +9309,7 @@ postcss-discard-duplicates@^2.0.1: postcss-discard-duplicates@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz#3fe133cd3c82282e550fc9b239176a9207b784eb" - integrity sha512-ZNQfR1gPNAiXZhgENFfEglF93pciw0WxMkJeVmw8eF+JZBbMD7jp6C67GqJAXVZP2BWbOztKfbsdmMp/k8c6oQ== + resolved "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz#3fe133cd3c82282e550fc9b239176a9207b784eb" dependencies: postcss "^7.0.0" @@ -9497,8 +9321,7 @@ postcss-discard-empty@^2.0.1: postcss-discard-empty@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz#c8c951e9f73ed9428019458444a02ad90bb9f765" - integrity sha512-B9miTzbznhDjTfjvipfHoqbWKwd0Mj+/fL5s1QOz06wufguil+Xheo4XpOnc4NqKYBCNqqEzgPv2aPBIJLox0w== + resolved "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz#c8c951e9f73ed9428019458444a02ad90bb9f765" dependencies: postcss "^7.0.0" @@ -9510,8 +9333,7 @@ postcss-discard-overridden@^0.1.1: postcss-discard-overridden@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz#652aef8a96726f029f5e3e00146ee7a4e755ff57" - integrity sha512-IYY2bEDD7g1XM1IDEsUT4//iEYCxAmP5oDSFMVU/JVvT7gh+l4fmjciLqGgwjdWpQIdb0Che2VX00QObS5+cTg== + resolved "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz#652aef8a96726f029f5e3e00146ee7a4e755ff57" dependencies: postcss "^7.0.0" @@ -9567,8 +9389,7 @@ postcss-merge-longhand@^2.0.1: postcss-merge-longhand@^4.0.11: version "4.0.11" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz#62f49a13e4a0ee04e7b98f42bb16062ca2549e24" - integrity sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw== + resolved "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz#62f49a13e4a0ee04e7b98f42bb16062ca2549e24" dependencies: css-color-names "0.0.4" postcss "^7.0.0" @@ -9587,8 +9408,7 @@ postcss-merge-rules@^2.0.3: postcss-merge-rules@^4.0.3: version "4.0.3" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz#362bea4ff5a1f98e4075a713c6cb25aefef9a650" - integrity sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ== + resolved "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz#362bea4ff5a1f98e4075a713c6cb25aefef9a650" dependencies: browserslist "^4.0.0" caniuse-api "^3.0.0" @@ -9611,8 +9431,7 @@ postcss-minify-font-values@^1.0.2: postcss-minify-font-values@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz#cd4c344cce474343fac5d82206ab2cbcb8afd5a6" - integrity sha512-j85oO6OnRU9zPf04+PZv1LYIYOprWm6IA6zkXkrJXyRveDEuQggG6tvoy8ir8ZwjLxLuGfNkCZEQG7zan+Hbtg== + resolved "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz#cd4c344cce474343fac5d82206ab2cbcb8afd5a6" dependencies: postcss "^7.0.0" postcss-value-parser "^3.0.0" @@ -9626,8 +9445,7 @@ postcss-minify-gradients@^1.0.1: postcss-minify-gradients@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz#93b29c2ff5099c535eecda56c4aa6e665a663471" - integrity sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q== + resolved "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz#93b29c2ff5099c535eecda56c4aa6e665a663471" dependencies: cssnano-util-get-arguments "^4.0.0" is-color-stop "^1.0.0" @@ -9645,8 +9463,7 @@ postcss-minify-params@^1.0.4: postcss-minify-params@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz#6b9cef030c11e35261f95f618c90036d680db874" - integrity sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg== + resolved "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz#6b9cef030c11e35261f95f618c90036d680db874" dependencies: alphanum-sort "^1.0.0" browserslist "^4.0.0" @@ -9666,8 +9483,7 @@ postcss-minify-selectors@^2.0.4: postcss-minify-selectors@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz#e2e5eb40bfee500d0cd9243500f5f8ea4262fbd8" - integrity sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g== + resolved "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz#e2e5eb40bfee500d0cd9243500f5f8ea4262fbd8" dependencies: alphanum-sort "^1.0.0" has "^1.0.0" @@ -9725,15 +9541,13 @@ postcss-normalize-charset@^1.1.0: postcss-normalize-charset@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz#8b35add3aee83a136b0471e0d59be58a50285dd4" - integrity sha512-gMXCrrlWh6G27U0hF3vNvR3w8I1s2wOBILvA87iNXaPvSNo5uZAMYsZG7XjCUf1eVxuPfyL4TJ7++SGZLc9A3g== + resolved "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz#8b35add3aee83a136b0471e0d59be58a50285dd4" dependencies: postcss "^7.0.0" postcss-normalize-display-values@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz#0dbe04a4ce9063d4667ed2be476bb830c825935a" - integrity sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ== + resolved "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz#0dbe04a4ce9063d4667ed2be476bb830c825935a" dependencies: cssnano-util-get-match "^4.0.0" postcss "^7.0.0" @@ -9741,8 +9555,7 @@ postcss-normalize-display-values@^4.0.2: postcss-normalize-positions@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz#05f757f84f260437378368a91f8932d4b102917f" - integrity sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA== + resolved "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz#05f757f84f260437378368a91f8932d4b102917f" dependencies: cssnano-util-get-arguments "^4.0.0" has "^1.0.0" @@ -9751,8 +9564,7 @@ postcss-normalize-positions@^4.0.2: postcss-normalize-repeat-style@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz#c4ebbc289f3991a028d44751cbdd11918b17910c" - integrity sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q== + resolved "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz#c4ebbc289f3991a028d44751cbdd11918b17910c" dependencies: cssnano-util-get-arguments "^4.0.0" cssnano-util-get-match "^4.0.0" @@ -9761,8 +9573,7 @@ postcss-normalize-repeat-style@^4.0.2: postcss-normalize-string@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz#cd44c40ab07a0c7a36dc5e99aace1eca4ec2690c" - integrity sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA== + resolved "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz#cd44c40ab07a0c7a36dc5e99aace1eca4ec2690c" dependencies: has "^1.0.0" postcss "^7.0.0" @@ -9770,8 +9581,7 @@ postcss-normalize-string@^4.0.2: postcss-normalize-timing-functions@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz#8e009ca2a3949cdaf8ad23e6b6ab99cb5e7d28d9" - integrity sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A== + resolved "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz#8e009ca2a3949cdaf8ad23e6b6ab99cb5e7d28d9" dependencies: cssnano-util-get-match "^4.0.0" postcss "^7.0.0" @@ -9779,8 +9589,7 @@ postcss-normalize-timing-functions@^4.0.2: postcss-normalize-unicode@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz#841bd48fdcf3019ad4baa7493a3d363b52ae1cfb" - integrity sha512-od18Uq2wCYn+vZ/qCOeutvHjB5jm57ToxRaMeNuf0nWVHaP9Hua56QyMF6fs/4FSUnVIw0CBPsU0K4LnBPwYwg== + resolved "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz#841bd48fdcf3019ad4baa7493a3d363b52ae1cfb" dependencies: browserslist "^4.0.0" postcss "^7.0.0" @@ -9797,8 +9606,7 @@ postcss-normalize-url@^3.0.7: postcss-normalize-url@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz#10e437f86bc7c7e58f7b9652ed878daaa95faae1" - integrity sha512-p5oVaF4+IHwu7VpMan/SSpmpYxcJMtkGppYf0VbdH5B6hN8YNmVyJLuY9FmLQTzY3fag5ESUUHDqM+heid0UVA== + resolved "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz#10e437f86bc7c7e58f7b9652ed878daaa95faae1" dependencies: is-absolute-url "^2.0.0" normalize-url "^3.0.0" @@ -9807,8 +9615,7 @@ postcss-normalize-url@^4.0.1: postcss-normalize-whitespace@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz#bf1d4070fe4fcea87d1348e825d8cc0c5faa7d82" - integrity sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA== + resolved "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz#bf1d4070fe4fcea87d1348e825d8cc0c5faa7d82" dependencies: postcss "^7.0.0" postcss-value-parser "^3.0.0" @@ -9822,8 +9629,7 @@ postcss-ordered-values@^2.1.0: postcss-ordered-values@^4.1.2: version "4.1.2" - resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz#0cf75c820ec7d5c4d280189559e0b571ebac0eee" - integrity sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw== + resolved "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz#0cf75c820ec7d5c4d280189559e0b571ebac0eee" dependencies: cssnano-util-get-arguments "^4.0.0" postcss "^7.0.0" @@ -9844,8 +9650,7 @@ postcss-reduce-initial@^1.0.0: postcss-reduce-initial@^4.0.3: version "4.0.3" - resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz#7fd42ebea5e9c814609639e2c2e84ae270ba48df" - integrity sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA== + resolved "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz#7fd42ebea5e9c814609639e2c2e84ae270ba48df" dependencies: browserslist "^4.0.0" caniuse-api "^3.0.0" @@ -9862,8 +9667,7 @@ postcss-reduce-transforms@^1.0.3: postcss-reduce-transforms@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz#17efa405eacc6e07be3414a5ca2d1074681d4e29" - integrity sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg== + resolved "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz#17efa405eacc6e07be3414a5ca2d1074681d4e29" dependencies: cssnano-util-get-match "^4.0.0" has "^1.0.0" @@ -9880,8 +9684,7 @@ postcss-selector-parser@^2.0.0, postcss-selector-parser@^2.2.2: postcss-selector-parser@^3.0.0: version "3.1.1" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz#4f875f4afb0c96573d5cf4d74011aee250a7e865" - integrity sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU= + resolved "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz#4f875f4afb0c96573d5cf4d74011aee250a7e865" dependencies: dot-prop "^4.1.1" indexes-of "^1.0.1" @@ -9889,8 +9692,7 @@ postcss-selector-parser@^3.0.0: postcss-selector-parser@^5.0.0-rc.4: version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz#249044356697b33b64f1a8f7c80922dddee7195c" - integrity sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ== + resolved "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz#249044356697b33b64f1a8f7c80922dddee7195c" dependencies: cssesc "^2.0.0" indexes-of "^1.0.1" @@ -9907,8 +9709,7 @@ postcss-svgo@^2.1.1: postcss-svgo@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-4.0.2.tgz#17b997bc711b333bab143aaed3b8d3d6e3d38258" - integrity sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw== + resolved "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.2.tgz#17b997bc711b333bab143aaed3b8d3d6e3d38258" dependencies: is-svg "^3.0.0" postcss "^7.0.0" @@ -9925,8 +9726,7 @@ postcss-unique-selectors@^2.0.2: postcss-unique-selectors@^4.0.1: version "4.0.1" - resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz#9446911f3289bfd64c6d680f073c03b1f9ee4bac" - integrity sha512-+JanVaryLo9QwZjKrmJgkI4Fn8SBgRO6WXQBJi7KiAVPlmxikB5Jzc4EvXMT2H0/m0RjrVVm9rGNhZddm/8Spg== + resolved "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz#9446911f3289bfd64c6d680f073c03b1f9ee4bac" dependencies: alphanum-sort "^1.0.0" postcss "^7.0.0" @@ -9936,10 +9736,9 @@ postcss-value-parser@^3.0.0, postcss-value-parser@^3.0.1, postcss-value-parser@^ version "3.3.1" resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" -postcss-value-parser@^4.0.2: +postcss-value-parser@^4.0.0: version "4.0.2" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.0.2.tgz#482282c09a42706d1fc9a069b73f44ec08391dc9" - integrity sha512-LmeoohTpp/K4UiyQCwuGWlONxXamGzCMtFxLq4W1nZVGIQLYvMCJx3yAF9qyyuFpflABI9yVdtJAqbihOsCsJQ== + resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.2.tgz#482282c09a42706d1fc9a069b73f44ec08391dc9" postcss-zindex@^2.0.1: version "2.2.0" @@ -9974,10 +9773,9 @@ postcss@^6.0.1, postcss@^6.0.21: source-map "^0.6.1" supports-color "^5.4.0" -postcss@^7.0.0, postcss@^7.0.17, postcss@^7.0.19: - version "7.0.20" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.20.tgz#a107b68ef1ad1c5e6e214ebb3c5ede2799322837" - integrity sha512-VOdO3a5nHVftPSEbG1zaG320b4mH5KAflH+pIeVAF5/hlw6YumELSgHZQBekjg29Oj4qw7XAyp9tIEBpeNWcyg== +postcss@^7.0.0, postcss@^7.0.17: + version "7.0.18" + resolved "https://registry.npmjs.org/postcss/-/postcss-7.0.18.tgz#4b9cda95ae6c069c67a4d933029eddd4838ac233" dependencies: chalk "^2.4.2" source-map "^0.6.1" @@ -10002,7 +9800,6 @@ prepend-http@^1.0.0, prepend-http@^1.0.1: prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.npm.taobao.org/prepend-http/download/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= preserve@^0.2.0: version "0.2.0" @@ -10043,10 +9840,9 @@ pretty-ms@^3.1.0: dependencies: parse-ms "^1.0.0" -prismjs@^1.17.1: +prismjs@^1.16.0: version "1.17.1" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.17.1.tgz#e669fcbd4cdd873c35102881c33b14d0d68519be" - integrity sha512-PrEDJAFdUGbOP6xK/UsfkC5ghJsPJviKgnQOoxaDbBjwc8op68Quupwt1DeAFoG8GImPhiKXAvvsH7wDSLsu1Q== + resolved "https://registry.npmjs.org/prismjs/-/prismjs-1.17.1.tgz#e669fcbd4cdd873c35102881c33b14d0d68519be" optionalDependencies: clipboard "^2.0.0" @@ -10067,7 +9863,6 @@ process-nextick-args@^2.0.0: process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== process@^0.11.10: version "0.11.10" @@ -10091,7 +9886,6 @@ prop-types@^15.6.2: proto-list@~1.2.1: version "1.2.4" resolved "https://registry.npm.taobao.org/proto-list/download/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" - integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= proxy-addr@~2.0.4: version "2.0.4" @@ -10102,8 +9896,7 @@ proxy-addr@~2.0.4: proxy-addr@~2.0.5: version "2.0.5" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" - integrity sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ== + resolved "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" dependencies: forwarded "~0.1.2" ipaddr.js "1.9.0" @@ -10160,8 +9953,7 @@ qs@6.5.2, qs@~6.5.2: qs@6.7.0: version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + resolved "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" qs@^6.4.0: version "6.6.0" @@ -10177,7 +9969,6 @@ query-string@^4.1.0: query-string@^5.0.1: version "5.1.1" resolved "https://registry.npm.taobao.org/query-string/download/query-string-5.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fquery-string%2Fdownload%2Fquery-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" - integrity sha1-p4wBK3HBfgXy4/ojGd0zBoLvs8s= dependencies: decode-uri-component "^0.2.0" object-assign "^4.1.0" @@ -10226,8 +10017,7 @@ range-parser@^1.0.3, range-parser@~1.2.0: range-parser@~1.2.1: version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + resolved "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" raw-body@2.3.3: version "2.3.3" @@ -10240,8 +10030,7 @@ raw-body@2.3.3: raw-body@2.4.0: version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== + resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" dependencies: bytes "3.1.0" http-errors "1.7.2" @@ -10265,13 +10054,12 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7: strip-json-comments "~2.0.1" react-dev-utils@^9.0.1: - version "9.1.0" - resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-9.1.0.tgz#3ad2bb8848a32319d760d0a84c56c14bdaae5e81" - integrity sha512-X2KYF/lIGyGwP/F/oXgGDF24nxDA2KC4b7AFto+eqzc/t838gpSGiaU8trTqHXOohuLxxc5qi1eDzsl9ucPDpg== + version "9.0.3" + resolved "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-9.0.3.tgz#7607455587abb84599451460eb37cef0b684131a" dependencies: "@babel/code-frame" "7.5.5" - address "1.1.2" - browserslist "4.7.0" + address "1.1.0" + browserslist "4.6.6" chalk "2.4.2" cross-spawn "6.0.5" detect-port-alt "1.1.6" @@ -10288,32 +10076,29 @@ react-dev-utils@^9.0.1: loader-utils "1.2.3" open "^6.3.0" pkg-up "2.0.0" - react-error-overlay "^6.0.3" + react-error-overlay "^6.0.1" recursive-readdir "2.2.2" - shell-quote "1.7.2" - sockjs-client "1.4.0" + shell-quote "1.6.1" + sockjs-client "1.3.0" strip-ansi "5.2.0" text-table "0.2.0" react-dom@^16.8.4: - version "16.11.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.11.0.tgz#7e7c4a5a85a569d565c2462f5d345da2dd849af5" - integrity sha512-nrRyIUE1e7j8PaXSPtyRKtz+2y9ubW/ghNgqKFHHAHaeP0fpF5uXR+sq8IMRHC+ZUxw7W9NyCDTBtwWxvkb0iA== + version "16.9.0" + resolved "https://registry.npmjs.org/react-dom/-/react-dom-16.9.0.tgz#5e65527a5e26f22ae3701131bcccaee9fb0d3962" dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - scheduler "^0.17.0" + scheduler "^0.15.0" -react-error-overlay@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.3.tgz#c378c4b0a21e88b2e159a3e62b2f531fd63bf60d" - integrity sha512-bOUvMWFQVk5oz8Ded9Xb7WVdEi3QGLC8tH7HmYP0Fdp4Bn3qw0tRFmr5TW6mvahzvmrK4a6bqWGfCevBflP+Xw== +react-error-overlay@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.1.tgz#b8d3cf9bb991c02883225c48044cb3ee20413e0f" react@^16.8.4: - version "16.11.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.11.0.tgz#d294545fe62299ccee83363599bf904e4a07fdbb" - integrity sha512-M5Y8yITaLmU0ynd0r1Yvfq98Rmll6q8AxaEe88c8e7LxO8fZ2cNgmFt0aGAS9wzf1Ao32NKXtCl+/tVVtkxq6g== + version "16.9.0" + resolved "https://registry.npmjs.org/react/-/react-16.9.0.tgz#40ba2f9af13bc1a38d75dbf2f4359a5185c4f7aa" dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -10397,7 +10182,6 @@ readable-stream@1.0: readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -10418,16 +10202,14 @@ readable-stream@^3.0.6: readdirp@^2.0.0, readdirp@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== dependencies: graceful-fs "^4.1.11" micromatch "^3.1.10" readable-stream "^2.0.2" -readdirp@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" - integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== +readdirp@^3.1.1: + version "3.1.2" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.1.2.tgz#fa85d2d14d4289920e4671dead96431add2ee78a" dependencies: picomatch "^2.0.4" @@ -10458,8 +10240,7 @@ rechoir@^0.6.2: recursive-readdir@2.2.2: version "2.2.2" - resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" - integrity sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg== + resolved "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" dependencies: minimatch "3.0.4" @@ -10499,8 +10280,7 @@ regenerate-unicode-properties@^7.0.0: regenerate-unicode-properties@^8.1.0: version "8.1.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e" - integrity sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA== + resolved "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e" dependencies: regenerate "^1.4.0" @@ -10518,8 +10298,7 @@ regenerator-runtime@^0.11.0: regenerator-runtime@^0.13.2: version "0.13.3" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5" - integrity sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw== + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5" regenerator-transform@^0.10.0: version "0.10.1" @@ -10537,8 +10316,7 @@ regenerator-transform@^0.13.3: regenerator-transform@^0.14.0: version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.1.tgz#3b2fce4e1ab7732c08f665dfdb314749c7ddd2fb" - integrity sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ== + resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.1.tgz#3b2fce4e1ab7732c08f665dfdb314749c7ddd2fb" dependencies: private "^0.1.6" @@ -10555,6 +10333,10 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +regexp-tree@^0.1.13: + version "0.1.13" + resolved "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.13.tgz#5b19ab9377edc68bc3679256840bb29afc158d7f" + regexpp@^1.0.1: version "1.1.0" resolved "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" @@ -10588,8 +10370,7 @@ regexpu-core@^4.1.3, regexpu-core@^4.2.0: regexpu-core@^4.5.4, regexpu-core@^4.6.0: version "4.6.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.6.0.tgz#2037c18b327cfce8a6fea2a4ec441f2432afb8b6" - integrity sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg== + resolved "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.6.0.tgz#2037c18b327cfce8a6fea2a4ec441f2432afb8b6" dependencies: regenerate "^1.4.0" regenerate-unicode-properties "^8.1.0" @@ -10620,9 +10401,8 @@ regjsgen@^0.4.0: resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.4.0.tgz#c1eb4c89a209263f8717c782591523913ede2561" regjsgen@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.1.tgz#48f0bf1a5ea205196929c0d9798b42d1ed98443c" - integrity sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg== + version "0.5.0" + resolved "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz#a7634dc08f89209c2049adda3525711fb97265dd" regjsparser@^0.1.4: version "0.1.5" @@ -10638,8 +10418,7 @@ regjsparser@^0.3.0: regjsparser@^0.6.0: version "0.6.0" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.0.tgz#f1e6ae8b7da2bae96c99399b868cd6c933a2ba9c" - integrity sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ== + resolved "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz#f1e6ae8b7da2bae96c99399b868cd6c933a2ba9c" dependencies: jsesc "~0.5.0" @@ -10647,10 +10426,9 @@ relateurl@0.2.x: version "0.2.7" resolved "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" -remarkable@^1.7.1, remarkable@^1.7.4: +remarkable@^1.7.1: version "1.7.4" resolved "https://registry.yarnpkg.com/remarkable/-/remarkable-1.7.4.tgz#19073cb960398c87a7d6546eaa5e50d2022fcd00" - integrity sha512-e6NKUXgX95whv7IgddywbeN/ItCkWbISmc2DiqHJb0wTrqZIexqdco5b8Z3XZoo/48IdNVKM9ZCvTPJ4F5uvhg== dependencies: argparse "^1.0.10" autolinker "~0.28.0" @@ -10795,7 +10573,6 @@ resolve@^1.1.6, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.5.0, resolve@^1.6.0, responselike@1.0.2: version "1.0.2" resolved "https://registry.npm.taobao.org/responselike/download/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= dependencies: lowercase-keys "^1.0.0" @@ -10819,13 +10596,11 @@ ret@~0.1.10: rgb-regex@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1" - integrity sha1-wODWiC3w4jviVKR16O3UGRX+rrE= + resolved "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1" rgba-regex@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3" - integrity sha1-QzdOLiyglosO8VI0YLfXMP8i7rM= + resolved "https://registry.npmjs.org/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3" right-align@^0.1.1: version "0.1.3" @@ -10836,7 +10611,6 @@ right-align@^0.1.1: rimraf@2, rimraf@^2.2.0, rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== dependencies: glob "^7.1.3" @@ -10976,15 +10750,13 @@ rxjs@^6.1.0, rxjs@^6.3.3: rxjs@^6.4.0: version "6.5.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" - integrity sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA== + resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" dependencies: tslib "^1.9.0" safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== safe-json-parse@~1.0.1: version "1.0.1" @@ -11023,10 +10795,9 @@ sax@^1.2.4, sax@~1.2.1, sax@~1.2.4: version "1.2.4" resolved "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" -scheduler@^0.17.0: - version "0.17.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.17.0.tgz#7c9c673e4ec781fac853927916d1c426b6f3ddfe" - integrity sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA== +scheduler@^0.15.0: + version "0.15.0" + resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.15.0.tgz#6bfcf80ff850b280fed4aeecc6513bc0b4f17f8e" dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -11060,7 +10831,6 @@ scss-tokenizer@^0.2.3: seek-bzip@^1.0.5: version "1.0.5" resolved "https://registry.npm.taobao.org/seek-bzip/download/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc" - integrity sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w= dependencies: commander "~2.8.1" @@ -11085,12 +10855,10 @@ semver-compare@^1.0.0: semver-regex@^2.0.0: version "2.0.0" resolved "https://registry.npm.taobao.org/semver-regex/download/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338" - integrity sha1-qTwsWERTmncCMzeRB7OMe0rJ0zg= semver-truncate@^1.1.2: version "1.1.2" resolved "https://registry.npm.taobao.org/semver-truncate/download/semver-truncate-1.1.2.tgz#57f41de69707a62709a7e0104ba2117109ea47e8" - integrity sha1-V/Qd5pcHpicJp+AQS6IRcQnqR+g= dependencies: semver "^5.3.0" @@ -11100,8 +10868,7 @@ semver-truncate@^1.1.2: semver@^6.3.0: version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" semver@~5.3.0: version "5.3.0" @@ -11127,8 +10894,7 @@ send@0.16.2: send@0.17.1: version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== + resolved "https://registry.npmjs.org/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" dependencies: debug "2.6.9" depd "~1.1.2" @@ -11167,8 +10933,7 @@ serve-static@1.13.2: serve-static@1.14.1: version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== + resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" @@ -11213,8 +10978,7 @@ setprototypeof@1.1.0: setprototypeof@1.1.1: version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" @@ -11241,12 +11005,7 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" -shell-quote@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" - integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== - -shell-quote@^1.6.1: +shell-quote@1.6.1, shell-quote@^1.6.1: version "1.6.1" resolved "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" dependencies: @@ -11266,7 +11025,6 @@ shelljs@^0.7.0: shelljs@^0.8.1, shelljs@^0.8.3: version "0.8.3" resolved "https://registry.npm.taobao.org/shelljs/download/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097" - integrity sha1-p/MxlSDr8J7oEnWyNorbKGZZsJc= dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -11290,8 +11048,7 @@ simple-swizzle@^0.2.2: sitemap@^3.2.2: version "3.2.2" - resolved "https://registry.yarnpkg.com/sitemap/-/sitemap-3.2.2.tgz#3f77c358fa97b555c879e457098e39910095c62b" - integrity sha512-TModL/WU4m2q/mQcrDgNANn0P4LwprM9MMvG4hu5zP4c6IIKs2YLTu6nXXnNr8ODW/WFtxKggiJ1EGn2W0GNmg== + resolved "https://registry.npmjs.org/sitemap/-/sitemap-3.2.2.tgz#3f77c358fa97b555c879e457098e39910095c62b" dependencies: lodash.chunk "^4.2.0" lodash.padstart "^4.6.1" @@ -11358,18 +11115,6 @@ sockjs-client@1.3.0: json3 "^3.3.2" url-parse "^1.4.3" -sockjs-client@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.4.0.tgz#c9f2568e19c8fd8173b4997ea3420e0bb306c7d5" - integrity sha512-5zaLyO8/nri5cua0VtOrFXBPK1jbL4+1cebT/mmKA1E1ZXOvJrII75bPu0l0k843G/+iAbhEqzyKr0w/eCCj7g== - dependencies: - debug "^3.2.5" - eventsource "^1.0.7" - faye-websocket "~0.11.1" - inherits "^2.0.3" - json3 "^3.3.2" - url-parse "^1.4.3" - sockjs@0.3.19: version "0.3.19" resolved "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz#d976bbe800af7bd20ae08598d582393508993c0d" @@ -11380,7 +11125,6 @@ sockjs@0.3.19: sort-keys-length@^1.0.0: version "1.0.1" resolved "https://registry.npm.taobao.org/sort-keys-length/download/sort-keys-length-1.0.1.tgz#9cb6f4f4e9e48155a6aa0671edd336ff1479a188" - integrity sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg= dependencies: sort-keys "^1.0.0" @@ -11448,7 +11192,6 @@ source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, sour source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== sourcemap-codec@^1.4.1: version "1.4.4" @@ -11530,7 +11273,6 @@ split@^1.0.0: sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= squeak@^1.0.0: version "1.3.0" @@ -11557,7 +11299,6 @@ sshpk@^1.7.0: stable@^0.1.8: version "0.1.8" resolved "https://registry.npm.taobao.org/stable/download/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" - integrity sha1-g26zyDgv4pNv6vVEYxAXzn1Ho88= staged-git-files@1.1.2: version "1.1.2" @@ -11573,7 +11314,6 @@ static-extend@^0.1.1: "statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= statuses@~1.4.0: version "1.4.0" @@ -11652,7 +11392,6 @@ string_decoder@0.10, string_decoder@~0.10.x: string_decoder@^1.0.0, string_decoder@^1.1.1, string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: safe-buffer "~5.1.0" @@ -11666,8 +11405,7 @@ stringify-object@^3.2.2: strip-ansi@5.2.0, strip-ansi@^5.1.0: version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" dependencies: ansi-regex "^4.1.0" @@ -11711,7 +11449,6 @@ strip-color@^0.1.0: strip-dirs@^2.0.0: version "2.1.0" resolved "https://registry.npm.taobao.org/strip-dirs/download/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5" - integrity sha1-SYdzYmT8NEzyD2w0rKnRPR1O1sU= dependencies: is-natural-number "^4.0.1" @@ -11743,11 +11480,6 @@ strip-url-auth@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/strip-url-auth/-/strip-url-auth-1.0.1.tgz#22b0fa3a41385b33be3f331551bbb837fa0cd7ae" -striptags@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/striptags/-/striptags-3.1.1.tgz#c8c3e7fdd6fb4bb3a32a3b752e5b5e3e38093ebd" - integrity sha1-yMPn/db7S7OjKjt1LltePjgJPr0= - strong-log-transformer@^1.0.6: version "1.0.6" resolved "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-1.0.6.tgz#f7fb93758a69a571140181277eea0c2eb1301fa3" @@ -11771,8 +11503,7 @@ style-loader@^0.20.3: stylehacks@^4.0.0: version "4.0.3" - resolved "https://registry.yarnpkg.com/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5" - integrity sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g== + resolved "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz#6718fcaf4d1e07d8a1318690881e8d96726a71d5" dependencies: browserslist "^4.0.0" postcss "^7.0.0" @@ -11802,8 +11533,7 @@ supports-color@^5.1.0, supports-color@^5.2.0, supports-color@^5.3.0, supports-co supports-color@^6.1.0: version "6.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" - integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + resolved "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" dependencies: has-flag "^3.0.0" @@ -11821,8 +11551,7 @@ svgo@^0.7.0: svgo@^1.0.0: version "1.3.0" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.3.0.tgz#bae51ba95ded9a33a36b7c46ce9c359ae9154313" - integrity sha512-MLfUA6O+qauLDbym+mMZgtXCGRfIxyQoeH6IKVcFslyODEe/ElJNwr0FohQ3xG4C6HK6bk3KYPPXwHVJk3V5NQ== + resolved "https://registry.npmjs.org/svgo/-/svgo-1.3.0.tgz#bae51ba95ded9a33a36b7c46ce9c359ae9154313" dependencies: chalk "^2.4.1" coa "^2.0.2" @@ -11841,7 +11570,6 @@ svgo@^1.0.0: svgo@^1.0.5: version "1.2.2" resolved "https://registry.npm.taobao.org/svgo/download/svgo-1.2.2.tgz#0253d34eccf2aed4ad4f283e11ee75198f9d7316" - integrity sha1-AlPTTszyrtStTyg+Ee51GY+dcxY= dependencies: chalk "^2.4.1" coa "^2.0.2" @@ -11888,7 +11616,6 @@ tapable@^1.0.0: tar-stream@^1.5.2: version "1.6.2" resolved "https://registry.npm.taobao.org/tar-stream/download/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" - integrity sha1-jqVdqzeXIlPZqa+Q/c1VmuQ1xVU= dependencies: bl "^1.0.0" buffer-alloc "^1.2.0" @@ -11920,8 +11647,7 @@ tar@^4: tcp-port-used@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/tcp-port-used/-/tcp-port-used-1.0.1.tgz#46061078e2d38c73979a2c2c12b5a674e6689d70" - integrity sha512-rwi5xJeU6utXoEIiMvVBMc9eJ2/ofzB+7nLOdnZuFTmNCLqRiQh2sMG9MqCxHU/69VC/Fwp5dV9306Qd54ll1Q== + resolved "https://registry.npmjs.org/tcp-port-used/-/tcp-port-used-1.0.1.tgz#46061078e2d38c73979a2c2c12b5a674e6689d70" dependencies: debug "4.1.0" is2 "2.0.1" @@ -11977,7 +11703,6 @@ textextensions@^2.4.0: through2@^2.0.0, through2@^2.0.2: version "2.0.5" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== dependencies: readable-stream "~2.3.6" xtend "~4.0.1" @@ -12006,8 +11731,7 @@ timers-browserify@^2.0.4: timsort@^0.3.0: version "0.3.0" - resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" - integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= + resolved "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" tiny-emitter@^2.0.0: version "2.0.2" @@ -12067,8 +11791,7 @@ to-regex-range@^2.1.0: to-regex-range@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" dependencies: is-number "^7.0.0" @@ -12083,8 +11806,7 @@ to-regex@^3.0.1, to-regex@^3.0.2: toidentifier@1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" toml@^2.3.2: version "2.3.3" @@ -12103,8 +11825,7 @@ tough-cookie@~2.4.3: tr46@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= + resolved "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" dependencies: punycode "^2.1.0" @@ -12145,7 +11866,6 @@ trim-right@^1.0.1: truncate-html@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/truncate-html/-/truncate-html-1.0.3.tgz#0166dfc7890626130c2e4174c6b73d4d63993e5f" - integrity sha512-1o1prdRv+iehXcGwn29YgXU17DotHkr+OK3ijVEG7FGMwHNG9RyobXwimw6djDvbIc24rhmz3tjNNvNESjkNkQ== dependencies: "@types/cheerio" "^0.22.8" cheerio "0.22.0" @@ -12194,8 +11914,7 @@ type-is@~1.6.16: type-is@~1.6.17, type-is@~1.6.18: version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" dependencies: media-typer "0.3.0" mime-types "~2.1.24" @@ -12240,7 +11959,6 @@ uglifyjs-webpack-plugin@^0.4.6: unbzip2-stream@^1.0.9: version "1.3.3" resolved "https://registry.npm.taobao.org/unbzip2-stream/download/unbzip2-stream-1.3.3.tgz#d156d205e670d8d8c393e1c02ebd506422873f6a" - integrity sha1-0VbSBeZw2NjDk+HALr1QZCKHP2o= dependencies: buffer "^5.2.1" through "^2.3.8" @@ -12266,8 +11984,7 @@ unicode-match-property-value-ecmascript@^1.0.2: unicode-match-property-value-ecmascript@^1.1.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz#5b4b426e08d13a80365e0d657ac7a6c1ec46a277" - integrity sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g== + resolved "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz#5b4b426e08d13a80365e0d657ac7a6c1ec46a277" unicode-property-aliases-ecmascript@^1.0.4: version "1.0.4" @@ -12329,8 +12046,7 @@ upath@^1.0.5: upath@^1.1.1: version "1.2.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" - integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== + resolved "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" upper-case@^1.1.1: version "1.1.3" @@ -12355,7 +12071,6 @@ url-parse-lax@^1.0.0: url-parse-lax@^3.0.0: version "3.0.0" resolved "https://registry.npm.taobao.org/url-parse-lax/download/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= dependencies: prepend-http "^2.0.0" @@ -12384,7 +12099,6 @@ use@^3.1.0: util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= util.promisify@1.0.0, util.promisify@^1.0.0, util.promisify@~1.0.0: version "1.0.0" @@ -12502,8 +12216,7 @@ wcwidth@^1.0.0, wcwidth@^1.0.1: webidl-conversions@^4.0.2: version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" webpack-addons@^1.1.4: version "1.1.5" @@ -12641,9 +12354,8 @@ websocket-extensions@>=0.1.1: resolved "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" whatwg-url@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" - integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== + version "7.0.0" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" dependencies: lodash.sortby "^4.7.0" tr46 "^1.0.1" @@ -12691,8 +12403,7 @@ wordwrap@~1.0.0: worker-rpc@^0.1.0: version "0.1.1" - resolved "https://registry.yarnpkg.com/worker-rpc/-/worker-rpc-0.1.1.tgz#cb565bd6d7071a8f16660686051e969ad32f54d5" - integrity sha512-P1WjMrUB3qgJNI9jfmpZ/htmBEjFh//6l/5y8SD9hg1Ef5zTTVVoRjTrTEzPrNBQvmhMxkoTsjOXN10GWU7aCg== + resolved "https://registry.npmjs.org/worker-rpc/-/worker-rpc-0.1.1.tgz#cb565bd6d7071a8f16660686051e969ad32f54d5" dependencies: microevent.ts "~0.1.1" @@ -12713,7 +12424,6 @@ wrap-ansi@^3.0.1: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= write-file-atomic@^1.2.0: version "1.3.4" @@ -12761,8 +12471,7 @@ xml@^1.0.1: xmlbuilder@^13.0.0: version "13.0.2" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-13.0.2.tgz#02ae33614b6a047d1c32b5389c1fdacb2bce47a7" - integrity sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ== + resolved "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz#02ae33614b6a047d1c32b5389c1fdacb2bce47a7" xregexp@4.0.0: version "4.0.0" @@ -12775,7 +12484,6 @@ xtend@^4.0.0, xtend@~4.0.0: xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== y18n@^3.2.1: version "3.2.1" @@ -12903,7 +12611,6 @@ yargs@~3.10.0: yauzl@^2.4.2: version "2.10.0" resolved "https://registry.npm.taobao.org/yauzl/download/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= dependencies: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" From cac8473b205e5d26cd6f3c6641d496049d981b10 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 18 Sep 2019 21:25:41 +0800 Subject: [PATCH 054/194] =?UTF-8?q?chore:=20=E4=BF=AE=E5=A4=8D=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/loaders/fileParseLoader.ts | 3 +-- .../src/plugins/TaroLoadChunksPlugin.ts | 2 +- packages/taro-mini-runner/src/utils/index.ts | 3 +-- packages/taro-mini-runner/src/webpack/chain.ts | 15 +++++++++++++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts index c341baa6c463..ef8ac3a34ed3 100644 --- a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts +++ b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts @@ -14,8 +14,7 @@ import { taroJsRedux, QUICKAPP_SPECIAL_COMPONENTS, PARSE_AST_TYPE, - NODE_MODULES_REG, - REG_STYLE + NODE_MODULES_REG } from '../utils/constants' import { isNpmPkg, diff --git a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts index d0f51b0f4054..c31836b6c82d 100644 --- a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts @@ -24,7 +24,7 @@ export default class TaroLoadChunksPlugin { } apply (compiler: webpack.Compiler) { - compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation: compilation.Compilation) => { + compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation: any) => { let commonChunks compilation.hooks.afterOptimizeChunks.tap(PLUGIN_NAME, (chunks: compilation.Chunk[]) => { commonChunks = chunks.filter(chunk => this.commonChunks.includes(chunk.name)).reverse() diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index b3794a49e909..2f87f917f1ee 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -4,9 +4,8 @@ import * as fs from 'fs-extra' import * as resolvePath from 'resolve' import * as t from 'babel-types' import { mergeWith } from 'lodash' -import { Transform } from 'stream' -import { CONFIG_MAP, JS_EXT, TS_EXT, NODE_MODULES_REG, MINI_APP_FILES, BUILD_TYPES, CSS_IMPORT_REG, REG_STYLE } from './constants' +import { CONFIG_MAP, JS_EXT, TS_EXT, NODE_MODULES_REG } from './constants' import { IOption, IComponentObj } from './types' export const isNodeModule = (filename: string) => NODE_MODULES_REG.test(filename) diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index 4233441eb8fa..6aa00db8cc64 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -15,7 +15,17 @@ import { getPostcssPlugins } from './postcss.conf' import MiniPlugin from '../plugins/MiniPlugin' import { IOption } from '../utils/types' import { recursiveMerge, isNodeModule } from '../utils' -import { REG_SASS, REG_LESS, REG_STYLUS, REG_STYLE, REG_MEDIA, REG_FONT, REG_IMAGE, BUILD_TYPES, REG_SCRIPTS, MINI_APP_FILES, REG_UX } from '../utils/constants' +import { + REG_SASS, + REG_LESS, + REG_STYLUS, + REG_STYLE, + REG_MEDIA, + REG_FONT, + REG_IMAGE, + BUILD_TYPES, + REG_SCRIPTS +} from '../utils/constants' const globalObjectMap = { [BUILD_TYPES.WEAPP]: 'wx', @@ -23,6 +33,7 @@ const globalObjectMap = { [BUILD_TYPES.SWAN]: 'swan', [BUILD_TYPES.QQ]: 'qq', [BUILD_TYPES.TT]: 'tt', + [BUILD_TYPES.JD]: 'jd', [BUILD_TYPES.QUICKAPP]: 'global' } @@ -91,7 +102,7 @@ export const mergeOption = ([...options]: IOption[]): IOption => { const styleModuleReg = /(.*\.module).*\.(css|s[ac]ss|less|styl)\b/ const styleGlobalReg = /(.*\.global).*\.(css|s[ac]ss|less|styl)\b/ -export const processEnvOption = partial(mapKeys, (key: string) => `process.env.${key}`) +export const processEnvOption = partial(mapKeys as any, (key: string) => `process.env.${key}`) export const getCssLoader = pipe(mergeOption, partial(getLoader, 'css-loader')) export const getPostcssLoader = pipe(mergeOption, partial(getLoader, 'postcss-loader')) From 7251ea3b648b1654df3ecde42a242c1767d30d48 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 23 Sep 2019 20:28:48 +0800 Subject: [PATCH 055/194] =?UTF-8?q?fix(mini-runner):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=99=AE=E9=80=9A=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/plugins/MiniPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 332d3ae7d4c9..dceb7a3cdbac 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -538,7 +538,7 @@ export default class MiniPlugin { template, code } - if (taroSelfComponents) { + if (isQuickApp && taroSelfComponents) { taroFileTypeMap[file.path].taroSelfComponents = new Set(Array.from(taroSelfComponents).map(item => { const taroJsQuickAppComponentsPath = getTaroJsQuickAppComponentsPath(this.options.nodeModulesPath) const componentPath = path.join(taroJsQuickAppComponentsPath, item as string, `index${MINI_APP_FILES[buildAdapter].TEMPL}`) From a58909da9853357584b42b70217bd1bdd238dd8c Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 24 Sep 2019 19:07:29 +0800 Subject: [PATCH 056/194] =?UTF-8?q?fix(webpack):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=8E=8B=E7=BC=A9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/package.json | 2 +- .../src/plugins/TaroLoadChunksPlugin.ts | 4 +-- .../taro-mini-runner/src/utils/constants.ts | 2 +- .../taro-mini-runner/src/webpack/base.conf.ts | 24 ++++++++++++++ .../src/webpack/build.conf.ts | 31 +++++-------------- .../taro-mini-runner/src/webpack/chain.ts | 5 +-- packages/taro/types/compile.ts | 3 +- 7 files changed, 40 insertions(+), 31 deletions(-) create mode 100644 packages/taro-mini-runner/src/webpack/base.conf.ts diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index dfadb71f80ab..a5313131a103 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -64,7 +64,7 @@ "url-loader": "^2.0.0", "virtual-module-webpack-plugin": "^0.4.1", "webpack": "^4.31.0", - "webpack-chain": "^6.0.0", + "webpack-chain": "4.9.0", "webpack-format-messages": "^2.0.5", "yauzl": "2.10.0" }, diff --git a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts index c31836b6c82d..e7aa2eb57ee7 100644 --- a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts @@ -51,9 +51,9 @@ export default class TaroLoadChunksPlugin { }) }) const source = new ConcatSource() - const id = chunk.id + const name = chunk.name commonChunks.forEach(chunkItem => { - source.add(`require(${JSON.stringify(promoteRelativePath(path.relative(id, chunkItem.name)))});\n`) + source.add(`require(${JSON.stringify(promoteRelativePath(path.relative(name, chunkItem.name)))});\n`) }) source.add('\n') source.add(modules) diff --git a/packages/taro-mini-runner/src/utils/constants.ts b/packages/taro-mini-runner/src/utils/constants.ts index f741e35c38e0..093d1ef4e43b 100644 --- a/packages/taro-mini-runner/src/utils/constants.ts +++ b/packages/taro-mini-runner/src/utils/constants.ts @@ -13,7 +13,7 @@ export const REG_SCRIPTS: RegExp = /\.[tj]sx?$/i export const REG_SASS: RegExp = /\.(s[ac]ss)$/ export const REG_LESS: RegExp = /\.less$/ export const REG_STYLUS: RegExp = /\.styl$/ -export const REG_STYLE: RegExp = /\.(css|scss|sass|less|styl|wxss)(\?.*)?$/ +export const REG_STYLE: RegExp = /\.(css|scss|sass|less|styl|wxss|acss)(\?.*)?$/ export const REG_MEDIA: RegExp = /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/ export const REG_IMAGE: RegExp = /\.(png|jpe?g|gif|bpm|svg|webp)(\?.*)?$/ export const REG_FONT: RegExp = /\.(woff2?|eot|ttf|otf)(\?.*)?$/ diff --git a/packages/taro-mini-runner/src/webpack/base.conf.ts b/packages/taro-mini-runner/src/webpack/base.conf.ts new file mode 100644 index 000000000000..ef68095db015 --- /dev/null +++ b/packages/taro-mini-runner/src/webpack/base.conf.ts @@ -0,0 +1,24 @@ +import * as path from 'path' +import * as Chain from 'webpack-chain' + +export default (appPath: string) => { + const chain = new Chain() + chain.merge({ + resolve: { + extensions: ['.js', '.jsx', '.ts', '.tsx'], + mainFields: ['main', 'module'], + symlinks: true, + modules: [ + path.join(appPath, 'node_modules'), + 'node_modules' + ] + }, + resolveLoader: { + modules: [ + 'node_modules' + ] + } + }) + + return chain +} diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts index 7fee552031e6..11109bb13905 100644 --- a/packages/taro-mini-runner/src/webpack/build.conf.ts +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -1,5 +1,4 @@ import * as path from 'path' -import * as Chain from 'webpack-chain' import { IBuildConfig } from '../utils/types' import { @@ -15,13 +14,14 @@ import { getMiniPlugin, getMiniCssExtractPlugin, } from './chain' +import getBaseConf from './base.conf' import { BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES } from '../utils/constants' import { Targets } from '../plugins/MiniPlugin' const emptyObj = {} export default (appPath: string, mode, config: Partial): any => { - const chain = new Chain() + const chain = getBaseConf(appPath) const { buildAdapter = BUILD_TYPES.WEAPP, alias = emptyObj, @@ -77,7 +77,7 @@ export default (appPath: string, mode, config: Partial): any => { plugin.miniCssExtractPlugin = getMiniCssExtractPlugin([{ filename: `[name]${MINI_APP_FILES[buildAdapter].STYLE}`, - chunkFilename: `[id]${MINI_APP_FILES[buildAdapter].STYLE}` + chunkFilename: `[name]${MINI_APP_FILES[buildAdapter].STYLE}` }, miniCssExtractPluginOption]) const isCssoEnabled = (csso && csso.enable === false) @@ -98,10 +98,11 @@ export default (appPath: string, mode, config: Partial): any => { } if (isCssoEnabled) { - plugin.cssoWebpackPlugin = getCssoWebpackPlugin([csso ? csso.config : {}]) + const cssoConfig: any = csso ? csso.config : {} + plugin.cssoWebpackPlugin = getCssoWebpackPlugin([cssoConfig]) } } - const mainConfig = { + chain.merge({ mode, devtool: getDevtool(enableSourceMap), entry, @@ -111,21 +112,7 @@ export default (appPath: string, mode, config: Partial): any => { buildAdapter, }, output]), target: Targets[buildAdapter], - resolve: { - alias, - extensions: ['.js', '.jsx', '.ts', '.tsx'], - mainFields: ['main', 'module'], - symlinks: true, - modules: [ - path.join(appPath, 'node_modules'), - 'node_modules' - ] - }, - resolveLoader: { - modules: [ - 'node_modules' - ] - }, + resolve: { alias }, module: getModule(appPath, { sourceDir, @@ -166,8 +153,6 @@ export default (appPath: string, mode, config: Partial): any => { } } } - } - - chain.merge(mainConfig) + }) return chain } diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index 6aa00db8cc64..d6109337b519 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -102,7 +102,7 @@ export const mergeOption = ([...options]: IOption[]): IOption => { const styleModuleReg = /(.*\.module).*\.(css|s[ac]ss|less|styl)\b/ const styleGlobalReg = /(.*\.global).*\.(css|s[ac]ss|less|styl)\b/ -export const processEnvOption = partial(mapKeys as any, (key: string) => `process.env.${key}`) +export const processEnvOption = partial(mapKeys as any, (key: string) => `process.env.${key}`) as any export const getCssLoader = pipe(mergeOption, partial(getLoader, 'css-loader')) export const getPostcssLoader = pipe(mergeOption, partial(getLoader, 'postcss-loader')) @@ -130,7 +130,7 @@ export const getUglifyPlugin = ([enableSourceMap, uglifyOptions]) => { }) } export const getCssoWebpackPlugin = ([cssoOption]) => { - return pipe(mergeOption, listify, partial(getPlugin, CssoWebpackPlugin))([defaultCSSCompressOption, cssoOption]) + return pipe(listify, partial(getPlugin, CssoWebpackPlugin))([mergeOption([defaultCSSCompressOption, cssoOption]), REG_STYLE]) } export const getCopyWebpackPlugin = ({ copy, appPath }: { copy: ICopyOptions, @@ -344,6 +344,7 @@ export function getOutput (appPath: string, [{ outputRoot, publicPath, buildAdap path: path.join(appPath, outputRoot), publicPath, filename: '[name].js', + chunkFilename: '[name].js', globalObject: globalObjectMap[buildAdapter], ...customOutput } diff --git a/packages/taro/types/compile.ts b/packages/taro/types/compile.ts index b70af352929a..2d74d0dbdfa5 100644 --- a/packages/taro/types/compile.ts +++ b/packages/taro/types/compile.ts @@ -364,6 +364,5 @@ export interface IProjectConfig extends IProjectBaseConfig { extraWatchFiles?: any[] }, mini?: IMiniAppConfig, - h5?: IH5Config, - quickApp?: ITaroManifestConfig + h5?: IH5Config } From f80016fb12b2c46aa2e623f9f1d6d6c97cf7a7ec Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 8 Oct 2019 20:48:24 +0800 Subject: [PATCH 057/194] =?UTF-8?q?feat(taro):=20cli=20=E9=85=8D=E5=90=88?= =?UTF-8?q?=20mini-runner=20=E9=87=8D=E6=9E=84=20&&=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20mini-runner=20=E7=BC=96=E8=AF=91=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/build.ts | 4 +- packages/taro-cli/src/mini/helper.ts | 299 +------------ packages/taro-cli/src/mini/index.ts | 273 +++--------- packages/taro-cli/src/plugin.ts | 397 +----------------- .../src/quickapp/template-rewriter.ts | 13 - packages/taro-cli/src/ui/common.ts | 8 +- packages/taro-cli/src/ui/h5.ts | 4 +- packages/taro-cli/src/ui/index.ts | 4 +- packages/taro-cli/src/ui/rn.ts | 9 +- packages/taro-cli/src/ui/ui.types.ts | 2 +- packages/taro-cli/src/ui/weapp.ts | 2 +- packages/taro-mini-runner/package.json | 6 +- packages/taro-mini-runner/src/index.ts | 6 + .../src/plugins/MiniPlugin.ts | 103 ++++- .../src/plugins/TaroLoadChunksPlugin.ts | 41 +- .../src/quickapp/style-rewriter.ts | 0 .../style/declaration/animation/index.ts | 0 .../style/declaration/background/index.ts | 0 .../style/declaration/border/index.ts | 0 .../quickapp/style/declaration/box/index.ts | 0 .../quickapp/style/declaration/color/index.ts | 0 .../style/declaration/component/index.ts | 0 .../style/declaration/dimension/index.ts | 0 .../style/declaration/flexbox/index.ts | 0 .../quickapp/style/declaration/font/index.ts | 0 .../src/quickapp/style/declaration/index.ts | 0 .../quickapp/style/declaration/list/index.ts | 0 .../style/declaration/margin/index.ts | 0 .../style/declaration/padding/index.ts | 0 .../style/declaration/position/index.ts | 0 .../quickapp/style/declaration/text/index.ts | 0 .../style/declaration/transform/transform.ts | 0 .../style/declaration/transition/index.ts | 0 .../style/declaration/visibility/index.ts | 0 .../src/quickapp/style/index.ts | 0 .../src/quickapp/style/selector/index.ts | 0 .../src/quickapp/style/util.ts | 0 .../src/quickapp/template-rewriter.ts | 13 + .../src/quickapp/template/constant.ts | 0 .../src/quickapp/template/node.ts | 0 .../src/quickapp/template/parser.ts | 0 .../src/quickapp/template/serialize.ts | 0 .../src/quickapp/template/tag/index.ts | 0 .../src/quickapp/template/tag/span/index.ts | 0 .../template/tag/taro-camera/index.ts | 0 .../template/tag/taro-canvas/index.ts | 0 .../quickapp/template/tag/taro-image/index.ts | 0 .../quickapp/template/tag/taro-input/index.ts | 0 .../quickapp/template/tag/taro-label/index.ts | 0 .../quickapp/template/tag/taro-map/index.ts | 0 .../template/tag/taro-picker/index.ts | 0 .../template/tag/taro-textarea/index.ts | 0 .../quickapp/template/tag/taro-video/index.ts | 0 .../src/quickapp/template/tag/text/index.ts | 0 .../src/quickapp/template/utils.ts | 0 packages/taro-mini-runner/src/utils/types.ts | 3 +- .../src/webpack/build.conf.ts | 35 +- .../taro-mini-runner/src/webpack/chain.ts | 48 ++- packages/taro-webpack-runner/src/index.ts | 2 +- 59 files changed, 322 insertions(+), 950 deletions(-) delete mode 100644 packages/taro-cli/src/quickapp/template-rewriter.ts rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style-rewriter.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/animation/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/background/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/border/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/box/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/color/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/component/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/dimension/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/flexbox/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/font/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/list/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/margin/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/padding/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/position/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/text/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/transform/transform.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/transition/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/declaration/visibility/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/selector/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/style/util.ts (100%) create mode 100644 packages/taro-mini-runner/src/quickapp/template-rewriter.ts rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/constant.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/node.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/parser.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/serialize.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/span/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/taro-camera/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/taro-canvas/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/taro-image/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/taro-input/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/taro-label/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/taro-map/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/taro-picker/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/taro-textarea/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/taro-video/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/tag/text/index.ts (100%) rename packages/{taro-cli => taro-mini-runner}/src/quickapp/template/utils.ts (100%) diff --git a/packages/taro-cli/src/build.ts b/packages/taro-cli/src/build.ts index b63c4ddeed71..b6bdc57f7a55 100644 --- a/packages/taro-cli/src/build.ts +++ b/packages/taro-cli/src/build.ts @@ -95,7 +95,7 @@ export default class Builder { } buildForMini (appPath: string, buildOptions: IBuildOptions) { - require('./mini/webpack').build(appPath, buildOptions, this) + require('./mini').build(appPath, buildOptions, null, this) } buildForRN (appPath: string, { watch }) { @@ -116,6 +116,6 @@ export default class Builder { return } console.log(chalk.green(`开始编译${typeMap[platform]}小程序插件`)) - require('./plugin').build(appPath, { watch, platform }) + require('./plugin').build(appPath, { watch, platform }, this) } } diff --git a/packages/taro-cli/src/mini/helper.ts b/packages/taro-cli/src/mini/helper.ts index 9e848742adb4..42d3f244e13f 100644 --- a/packages/taro-cli/src/mini/helper.ts +++ b/packages/taro-cli/src/mini/helper.ts @@ -2,67 +2,32 @@ import * as fs from 'fs-extra' import * as path from 'path' import { execSync } from 'child_process' -import chalk from 'chalk' import * as _ from 'lodash' import * as ora from 'ora' -import { Config } from '@tarojs/taro' +import chalk from 'chalk' import { IProjectConfig, ITaroManifestConfig } from '@tarojs/taro/types/compile' -import wxTransformer from '@tarojs/transformer-wx' -import getHashName from '../util/hash' import { BUILD_TYPES, MINI_APP_FILES, IMINI_APP_FILE_TYPE, PROJECT_CONFIG, - processTypeEnum, - REG_SCRIPTS, - NODE_MODULES_REG, - taroJsQuickAppComponents, - PARSE_AST_TYPE, NODE_MODULES } from '../util/constants' import { resolveScriptPath, - isAliasPath, - replaceAliasPath, - promoteRelativePath, - isNpmPkg, - printLog, - generateEnvList, - generateConstantsList, isEmptyObject, recursiveFindNodeModules, - getBabelConfig, - extnameExpRegOf, - generateAlipayPath, - unzip, + shouldUseCnpm, shouldUseYarn, - shouldUseCnpm + unzip } from '../util' -import { downloadGithubRepoLatestRelease } from '../util/dowload' -import { resolveNpmPkgMainPath } from '../util/resolve_npm_files' -import { resolveNpmSync } from '../util/npm' - import { IOption, INpmConfig } from '../util/types' import CONFIG from '../config' - -import { - IComponentObj, - IBuildResult, - IDependency -} from './interface' -import { getNpmOutputDir } from '../util/npmExact' -import { parseAst } from './astProcess' - -const isCopyingFiles: Map = new Map() -const dependencyTree: Map = new Map() -const hasBeenBuiltComponents: Set = new Set() -const componentExportsMap = new Map() -const depComponents = new Map() +import { downloadGithubRepoLatestRelease } from '../util/dowload' export interface IBuildData { appPath: string, @@ -76,16 +41,12 @@ export interface IBuildData { entryFileName: string, projectConfig: IProjectConfig, npmConfig: INpmConfig, - appConfig: Config, - pageConfigs: Map, alias: IOption, compileConfig: {[k: string]: any}, isProduction: boolean, buildAdapter: BUILD_TYPES, outputFilesTypes: IMINI_APP_FILE_TYPE, - constantsReplaceList: IOption, nodeModulesPath: string, - npmOutputDir: string, jsxAttributeNameReplace?: { [key: string]: any }, @@ -94,19 +55,6 @@ export interface IBuildData { let BuildData: IBuildData -export const shouldTransformAgain = function () { - const babelConfig = getBabelConfig(BuildData.projectConfig!.babel) - const pluginsStr = JSON.stringify(babelConfig.plugins) - if (/transform-runtime/.test(pluginsStr)) { - return true - } - return false -} - -export function setAppConfig (appConfig: Config) { - BuildData.appConfig = appConfig -} - export function setIsProduction (isProduction: boolean) { BuildData.isProduction = isProduction } @@ -115,7 +63,7 @@ export function setQuickappManifest (quickappManifest: ITaroManifestConfig) { BuildData.quickappManifest = quickappManifest } -export function setBuildData (appPath: string, adapter: BUILD_TYPES): IBuildData { +export function setBuildData (appPath: string, adapter: BUILD_TYPES, options?: Partial | null): IBuildData { const configDir = path.join(appPath, PROJECT_CONFIG) const projectConfig = require(configDir)(_.merge) const sourceDirName = projectConfig.sourceRoot || CONFIG.SOURCE_DIR @@ -146,16 +94,10 @@ export function setBuildData (appPath: string, adapter: BUILD_TYPES): IBuildData npmConfig, alias: pathAlias, isProduction: false, - appConfig: {}, - pageConfigs: new Map(), compileConfig: useCompileConf, buildAdapter: adapter, outputFilesTypes: MINI_APP_FILES[adapter], - constantsReplaceList: Object.assign({}, generateEnvList(projectConfig.env || {}), generateConstantsList(projectConfig.defineConstants || {}), { - 'process.env.TARO_ENV': adapter - }), nodeModulesPath: recursiveFindNodeModules(path.join(appPath, NODE_MODULES)), - npmOutputDir: getNpmOutputDir(outputDir, configDir, npmConfig), jsxAttributeNameReplace: weappConf.jsxAttributeNameReplace || {} } // 可以自定义输出文件类型 @@ -166,7 +108,9 @@ export function setBuildData (appPath: string, adapter: BUILD_TYPES): IBuildData BuildData.originalOutputDir = BuildData.outputDir BuildData.outputDirName = `${BuildData.outputDirName}/src` BuildData.outputDir = path.join(BuildData.appPath, BuildData.outputDirName) - BuildData.npmOutputDir = getNpmOutputDir(BuildData.outputDir, BuildData.configDir, BuildData.npmConfig) + } + if (options) { + Object.assign(BuildData, options) } return BuildData @@ -176,229 +120,10 @@ export function getBuildData (): IBuildData { return BuildData } -export function getDependencyTree (): Map { - return dependencyTree -} - -export function setHasBeenBuiltComponents (componentPath: string) { - hasBeenBuiltComponents.add(componentPath) -} - -export function getHasBeenBuiltComponents () { - return hasBeenBuiltComponents -} - -export function isComponentHasBeenBuilt (componentPath: string): boolean { - return hasBeenBuiltComponents.has(componentPath) -} - -export function deleteHasBeenBuiltComponent (filePath) { - if (hasBeenBuiltComponents.has(filePath)) { - hasBeenBuiltComponents.delete(filePath) - } -} - -export function setComponentExportsMap (key: string, value: IComponentObj[]) { - componentExportsMap.set(key, value) -} - -export function getComponentExportsMapItem (key: string): IComponentObj[] | void { - return componentExportsMap.get(key) -} - -export function getComponentExportsMap (): Map { - return componentExportsMap -} - -export function getDepComponents (): Map { - return depComponents -} - -export function buildUsingComponents ( - filePath: string, - components: IComponentObj[], - isComponent?: boolean -): IOption { - const { buildAdapter } = getBuildData() - const usingComponents = Object.create(null) - const pathAlias = BuildData.projectConfig.alias || {} - for (const component of components) { - let componentPath = component.path - if (isAliasPath(componentPath as string, pathAlias)) { - componentPath = replaceAliasPath(filePath, componentPath as string, pathAlias) - } - componentPath = resolveScriptPath(path.resolve(filePath, '..', componentPath as string)) - if (fs.existsSync(componentPath)) { - componentPath = promoteRelativePath(path.relative(filePath, componentPath)) - } else { - componentPath = component.path - } - if (buildAdapter === BUILD_TYPES.ALIPAY) { - componentPath = generateAlipayPath(componentPath) - } - if (component.name) { - const componentName = component.name.split('|')[0] - usingComponents[componentName] = (componentPath as string).replace(extnameExpRegOf(componentPath as string), '') - } - } - return Object.assign({}, isComponent ? { component: true } : { usingComponents: {} }, components.length ? { - usingComponents - } : {}) -} - -export function getRealComponentsPathList ( - filePath: string, - components: IComponentObj[] -): IComponentObj[] { - const { appPath, isProduction, buildAdapter, projectConfig, npmConfig } = BuildData - const pathAlias = projectConfig.alias || {} - return components.length ? components.map(component => { - let componentPath = component.path - if (isAliasPath(componentPath as string, pathAlias)) { - componentPath = replaceAliasPath(filePath, componentPath as string, pathAlias) - } - if (isNpmPkg(componentPath as string)) { - try { - componentPath = resolveNpmPkgMainPath(componentPath as string, isProduction, npmConfig, buildAdapter, appPath) - } catch (err) { - console.log(err) - } - } else { - componentPath = path.resolve(path.dirname(filePath), componentPath as string) - componentPath = resolveScriptPath(componentPath) - } - if (componentPath && isFileToBePage(componentPath)) { - printLog(processTypeEnum.ERROR, '组件引用', `文件${component.path}已经在 app.js 中被指定为页面,不能再作为组件来引用!`) - } - return { - path: componentPath, - name: component.name, - type: component.type - } - }) : [] -} - -export function isFileToBePage (filePath: string): boolean { - let isPage = false - const { appConfig, sourceDir } = BuildData - const extname = path.extname(filePath) - const pages = appConfig.pages || [] - const filePathWithoutExt = filePath.replace(extname, '') - pages.forEach(page => { - if (filePathWithoutExt === path.join(sourceDir, page)) { - isPage = true - } - }) - return isPage && REG_SCRIPTS.test(extname) -} - -export function getDepStyleList ( - outputFilePath: string, - buildDepComponentsResult: IBuildResult[] -): string[] { - const { sourceDir, outputDir } = BuildData - let depWXSSList: string[] = [] - if (buildDepComponentsResult.length) { - depWXSSList = buildDepComponentsResult.map(item => { - let wxss = item.wxss - wxss = wxss.replace(sourceDir, outputDir) - wxss = promoteRelativePath(path.relative(outputFilePath, wxss)) - return wxss - }) - } - return depWXSSList -} - -export function initCopyFiles () { - isCopyingFiles.clear() -} - -export function copyFilesFromSrcToOutput (files: string[], cb?: (sourceFilePath: string, outputFilePath: string) => void) { - const { nodeModulesPath, npmOutputDir, sourceDir, outputDir, appPath, projectConfig } = BuildData - const adapterConfig = Object.assign({}, projectConfig.weapp) - files.forEach(file => { - let outputFilePath - if (NODE_MODULES_REG.test(file)) { - outputFilePath = file.replace(nodeModulesPath, npmOutputDir) - } else { - if (adapterConfig.publicPath && adapterConfig.staticDirectory) { - const hashName = getHashName(file) - const staticPath = path.join(appPath, adapterConfig.staticDirectory, projectConfig.projectName || '') - outputFilePath = `${staticPath}/${hashName}` - } else { - outputFilePath = file.replace(sourceDir, outputDir) - } - } - if (isCopyingFiles.get(outputFilePath)) { - return - } - isCopyingFiles.set(outputFilePath, true) - let modifySrc = file.replace(appPath + path.sep, '') - modifySrc = modifySrc.split(path.sep).join('/') - let modifyOutput = outputFilePath.replace(appPath + path.sep, '') - modifyOutput = modifyOutput.split(path.sep).join('/') - printLog(processTypeEnum.COPY, '文件', modifyOutput) - if (!fs.existsSync(file)) { - printLog(processTypeEnum.ERROR, '文件', `${modifySrc} 不存在`) - } else { - fs.ensureDir(path.dirname(outputFilePath)) - if (file === outputFilePath) { - return - } - if (cb) { - cb(file, outputFilePath) - } else { - fs.copySync(file, outputFilePath) - } - } - }) -} - -export function getTaroJsQuickAppComponentsPath () { - const taroJsQuickAppComponentsPkg = resolveNpmSync(taroJsQuickAppComponents, BuildData.nodeModulesPath) - if (!taroJsQuickAppComponentsPkg) { - printLog(processTypeEnum.ERROR, '包安装', `缺少包 ${taroJsQuickAppComponents},请安装!`) - process.exit(0) - } - return path.join(path.dirname(taroJsQuickAppComponentsPkg as string), 'src/components') -} - -const SCRIPT_CONTENT_REG = /]*>([\s\S]*?)<\/script>/gm - -export function getImportTaroSelfComponents (filePath, taroSelfComponents) { - const importTaroSelfComponents = new Set<{ path: string, name: string }>() - const taroJsQuickAppComponentsPath = getTaroJsQuickAppComponentsPath() - taroSelfComponents.forEach(c => { - const cPath = path.join(taroJsQuickAppComponentsPath, c) - const cMainPath = path.join(cPath, 'index') - const cFiles = fs.readdirSync(cPath).map(item => path.join(cPath, item)) - copyFilesFromSrcToOutput(cFiles, (sourceFilePath, outputFilePath) => { - if (fs.existsSync(sourceFilePath)) { - const fileContent = fs.readFileSync(sourceFilePath).toString() - const match = SCRIPT_CONTENT_REG.exec(fileContent) - if (match) { - const scriptContent = match[1] - const transformResult = wxTransformer({ - code: scriptContent, - sourcePath: sourceFilePath, - isNormal: true, - isTyped: false, - adapter: BUILD_TYPES.QUICKAPP - }) - const res = parseAst(PARSE_AST_TYPE.NORMAL, transformResult.ast, [], sourceFilePath, outputFilePath) - const newFileContent = fileContent.replace(SCRIPT_CONTENT_REG, ``) - fs.ensureDirSync(path.dirname(outputFilePath)) - fs.writeFileSync(outputFilePath, newFileContent) - } - } - }) - const cRelativePath = promoteRelativePath(path.relative(filePath, cMainPath.replace(BuildData.nodeModulesPath, BuildData.npmOutputDir))) - importTaroSelfComponents.add({ - path: cRelativePath, - name: c - }) - }) - return importTaroSelfComponents +export function setOutputDirName (outputDirName) { + BuildData.originalOutputDir = BuildData.outputDir + BuildData.outputDirName = outputDirName + BuildData.outputDir = path.join(BuildData.appPath, BuildData.outputDirName) } export async function prepareQuickAppEnvironment (buildData: IBuildData) { diff --git a/packages/taro-cli/src/mini/index.ts b/packages/taro-cli/src/mini/index.ts index 762b92173947..920423df1cb5 100644 --- a/packages/taro-cli/src/mini/index.ts +++ b/packages/taro-cli/src/mini/index.ts @@ -1,49 +1,26 @@ import * as fs from 'fs-extra' import * as path from 'path' -import * as os from 'os' - import chalk from 'chalk' -import * as _ from 'lodash' -import * as ora from 'ora' -import { execSync } from 'child_process' -import { - printLog, - getInstalledNpmPkgVersion, - getPkgVersion, - copyFiles, - unzip, - shouldUseYarn, - shouldUseCnpm, - resolvePureScriptPath, - checkCliAndFrameworkVersion -} from '../util' -import { processTypeEnum, BUILD_TYPES } from '../util/constants' -import { IMiniAppBuildConfig } from '../util/types' +import { IBuildOptions } from '../util/types' +import { BUILD_TYPES, processTypeEnum } from '../util/constants' +import * as npmProcess from '../util/npm' +import { getBabelConfig, getInstalledNpmPkgVersion, getPkgVersion, printLog, checkCliAndFrameworkVersion } from '../util' +import Builder from '../build' import * as defaultManifestJSON from '../config/manifest.default.json' import { setBuildData, - getBuildData, setIsProduction, - setAppConfig, - IBuildData, - setQuickappManifest + getBuildData, + setQuickappManifest, + prepareQuickAppEnvironment, + runQuickApp, + IBuildData } from './helper' -import { buildEntry } from './entry' -import { buildPages, buildSinglePage } from './page' -import { watchFiles } from './watch' -import { downloadGithubRepoLatestRelease } from '../util/dowload' -import { buildSingleComponent } from './component' function buildProjectConfig () { const { buildAdapter, sourceDir, outputDir, outputDirName, appPath } = getBuildData() - - if (buildAdapter === BUILD_TYPES.JD) { - // 京东小程序暂不支持 project.config.json - return - } - let projectConfigFileName = `project.${buildAdapter}.json` if (buildAdapter === BUILD_TYPES.WEAPP) { projectConfigFileName = 'project.config.json' @@ -112,166 +89,16 @@ function readQuickAppManifest () { return quickappJSON } -function generateQuickAppManifest (quickappJSON: any) { - const { appConfig, pageConfigs, outputDir, projectConfig } = getBuildData() - // 生成 router - const pages = (appConfig.pages as string[]).concat() - const routerPages = {} - const customPageConfig = quickappJSON.customPageConfig || {} - - pages.forEach(element => { - const customConfig = customPageConfig[element] - const pageConf: any = { - component: path.basename(element) - } - if (customConfig) { - const filter = customConfig.filter - const launchMode = customConfig.launchMode - if (filter) { - pageConf.filter = filter - } - if (launchMode) { - pageConf.launchMode = launchMode - } - } - routerPages[path.dirname(element)] = pageConf - }) - delete quickappJSON.customPageConfig - const routerEntry = pages.shift() - const router = { - entry: path.dirname(routerEntry as string), - pages: routerPages - } - // 生成 display - const display = JSON.parse(JSON.stringify(appConfig.window || {})) - display.pages = {} - pageConfigs.forEach((item, page) => { - if (item) { - display.pages[path.dirname(page)] = item - } - }) - quickappJSON.router = router - quickappJSON.display = display - quickappJSON.config = Object.assign({}, quickappJSON.config, { - designWidth: projectConfig.designWidth || 750 - }) - if (appConfig.window && appConfig.window.navigationStyle === 'custom') { - quickappJSON.display.titleBar = false - delete quickappJSON.display.navigationStyle - } - fs.writeFileSync(path.join(outputDir, 'manifest.json'), JSON.stringify(quickappJSON, null, 2)) -} - -async function prepareQuickAppEnvironment (buildData: IBuildData) { - let isReady = false - let needDownload = false - let needInstall = false - const originalOutputDir = buildData.originalOutputDir - console.log() - if (fs.existsSync(path.join(buildData.originalOutputDir, 'sign'))) { - needDownload = false - } else { - needDownload = true - } - if (needDownload) { - const getSpinner = ora('开始下载快应用运行容器...').start() - await downloadGithubRepoLatestRelease('NervJS/quickapp-container', buildData.appPath, originalOutputDir) - await unzip(path.join(originalOutputDir, 'download_temp.zip')) - getSpinner.succeed('快应用运行容器下载完成') - } else { - console.log(`${chalk.green('✔ ')} 快应用容器已经准备好`) - } - process.chdir(originalOutputDir) - console.log() - if (fs.existsSync(path.join(originalOutputDir, 'node_modules'))) { - needInstall = false - } else { - needInstall = true - } - if (needInstall) { - const isWindows = os.platform() === 'win32' - let command - if (shouldUseYarn()) { - if(!isWindows) { - command = 'NODE_ENV=development yarn install' - } else { - command = 'yarn install' - } - } else if (shouldUseCnpm()) { - if(!isWindows) { - command = 'NODE_ENV=development cnpm install' - } else { - command = 'cnpm install' - } - } else { - if(!isWindows) { - command = 'NODE_ENV=development npm install' - } else { - command = 'npm install' - } - } - const installSpinner = ora(`安装快应用依赖环境, 需要一会儿...`).start() - try { - const stdout = execSync(command) - installSpinner.color = 'green' - installSpinner.succeed('安装成功') - console.log(`${stdout}`) - isReady = true - } catch (error) { - installSpinner.color = 'red' - installSpinner.fail(chalk.red(`快应用依赖环境安装失败,请进入 ${path.basename(originalOutputDir)} 重新安装!`)) - console.log(`${error}`) - isReady = false - } - } else { - console.log(`${chalk.green('✔ ')} 快应用依赖已经安装好`) - isReady = true - } - return isReady -} - -async function runQuickApp (isWatch: boolean | void, buildData: IBuildData, port?: number, release?: boolean) { - const originalOutputDir = buildData.originalOutputDir - const { compile } = require(require.resolve('hap-toolkit/lib/commands/compile', { paths: [originalOutputDir] })) - if (isWatch) { - const { launchServer } = require(require.resolve('@hap-toolkit/server', { paths: [originalOutputDir] })) - launchServer({ - port: port || 12306, - watch: isWatch, - clearRecords: false, - disableADB: false - }) - compile('native', 'dev', true) - } else { - if (!release) { - compile('native', 'dev', false) - } else { - compile('native', 'prod', false) - } - } -} - -export async function build ( - appPath: string, - { - watch, - adapter = BUILD_TYPES.WEAPP, - envHasBeenSet = false, - port, - release, - page, - component - }: IMiniAppBuildConfig -) { - const buildData = envHasBeenSet ? getBuildData() : setBuildData(appPath, adapter) - const isQuickApp = adapter === BUILD_TYPES.QUICKAPP - let quickappJSON - await checkCliAndFrameworkVersion(appPath, adapter) - process.env.TARO_ENV = adapter +export async function build (appPath: string, { watch, type = BUILD_TYPES.WEAPP, envHasBeenSet = false, port, release }: IBuildOptions, customBuildData: Partial | null | undefined, builder: Builder) { + const buildData = setBuildData(appPath, type, customBuildData) + const isQuickApp = type === BUILD_TYPES.QUICKAPP + await checkCliAndFrameworkVersion(appPath, type) + process.env.TARO_ENV = type if (!envHasBeenSet) { setIsProduction(process.env.NODE_ENV === 'production' || !watch) } fs.ensureDirSync(buildData.outputDir) + let quickappJSON if (!isQuickApp) { buildProjectConfig() await buildFrameworkInfo() @@ -279,29 +106,11 @@ export async function build ( quickappJSON = readQuickAppManifest() setQuickappManifest(quickappJSON) } - if (!isQuickApp) { - copyFiles(appPath, buildData.projectConfig.copy) - } - if (page) { - const pagePath = path.resolve(appPath, page).replace(buildData.sourceDir, '') - await buildSinglePage(pagePath) - return - } - if (component) { - const componentPath = resolvePureScriptPath(path.resolve(appPath, component)) - await buildSingleComponent({ - path: componentPath - }) - return - } - const appConfig = await buildEntry() - setAppConfig(appConfig) - await buildPages() - if (watch) { - watchFiles() - } + + await buildWithWebpack({ + appPath + }, builder) if (isQuickApp) { - generateQuickAppManifest(quickappJSON) const isReady = await prepareQuickAppEnvironment(buildData) if (!isReady) { console.log() @@ -309,7 +118,47 @@ export async function build ( process.exit(0) return } - copyFiles(appPath, buildData.projectConfig.copy) await runQuickApp(watch, buildData, port, release) } } + +async function buildWithWebpack ({ appPath }: { appPath: string }, builder) { + const { + entryFilePath, + buildAdapter, + projectConfig, + isProduction, + alias, + sourceDirName, + outputDirName, + nodeModulesPath, + quickappManifest + } = getBuildData() + const miniRunner = await npmProcess.getNpmPkg('@tarojs/mini-runner', appPath) + const babelConfig = getBabelConfig(projectConfig.babel) + const miniRunnerOpts = { + entry: { + app: [entryFilePath] + }, + alias, + copy: projectConfig.copy, + sourceRoot: sourceDirName, + outputRoot: outputDirName, + buildAdapter, + babel: babelConfig, + csso: projectConfig.csso, + sass: projectConfig.sass, + uglify: projectConfig.uglify, + plugins: projectConfig.plugins, + projectName: projectConfig.projectName, + isWatch: !isProduction, + env: projectConfig.env, + defineConstants: projectConfig.defineConstants, + designWidth: projectConfig.designWidth, + deviceRatio: projectConfig.deviceRatio, + nodeModulesPath, + quickappJSON: quickappManifest, + ...projectConfig.mini + } + await miniRunner(appPath, miniRunnerOpts, builder) +} diff --git a/packages/taro-cli/src/plugin.ts b/packages/taro-cli/src/plugin.ts index 6417060322c2..c5c6a0739711 100644 --- a/packages/taro-cli/src/plugin.ts +++ b/packages/taro-cli/src/plugin.ts @@ -1,58 +1,29 @@ import * as fs from 'fs-extra' import * as path from 'path' -import * as glob from 'glob' import chalk from 'chalk' -import * as chokidar from 'chokidar' import * as _ from 'lodash' -import * as Util from './util' import { - BUILD_TYPES, - REG_SCRIPT, - REG_STYLE, - REG_FONT, - REG_IMAGE, - REG_MEDIA, - REG_TYPESCRIPT, - processTypeEnum, - isWindows + BUILD_TYPES } from './util/constants' -import { buildEntry } from './mini/entry' -import { buildPages, buildSinglePage } from './mini/page' -import { build as buildWeapp } from './mini' import { - getRealComponentsPathList, - isFileToBePage, - isComponentHasBeenBuilt, - deleteHasBeenBuiltComponent, - getDependencyTree, - getBuildData, - setAppConfig, - setIsProduction, - setBuildData + getBuildData } from './mini/helper' -import { buildDepComponents, buildSingleComponent, getComponentsNamedMap } from './mini/component' -import { compileDepScripts, initCompileScripts } from './mini/compileScript' -import { compileDepStyles, initCompileStyles } from './mini/compileStyle' +import { build as buildMini } from './mini' import { IBuildOptions } from './util/types' +import { Builder } from '.' -const PLUGIN_ROOT = 'plugin/' -const DOC_ROOT = 'doc/' -const NPM_DIR = 'npm/' const PLUGIN_JSON = 'plugin.json' const PLUGIN_MOCK_JSON = 'plugin-mock.json' -let isCopyingFiles = {} - -export async function build (appPath: string, { watch, platform }: IBuildOptions) { +export async function build (appPath: string, { watch, platform }: IBuildOptions, builder: Builder) { switch (platform) { case BUILD_TYPES.WEAPP: - buildWxPlugin(appPath, { watch }) + await buildWxPlugin(appPath, { watch, type: BUILD_TYPES.WEAPP }, builder) break case BUILD_TYPES.ALIPAY: - await buildWeapp(appPath, { watch, adapter: BUILD_TYPES.ALIPAY }) - buildAlipayPlugin() + await buildAlipayPlugin(appPath, { watch, type: BUILD_TYPES.ALIPAY }, builder) break default: console.log(chalk.red('输入插件类型错误,目前只支持 weapp/alipay 插件类型')) @@ -60,354 +31,16 @@ export async function build (appPath: string, { watch, platform }: IBuildOptions } } -function compilePluginJson (pluginJson, pluginPath) { - if (typeof pluginJson.main === 'string') { - pluginJson.main = pluginJson.main.replace(/\.tsx$|\.ts$/, '.js') - } - fs.writeJSONSync(pluginPath, pluginJson) -} - -function wxPluginWatchFiles () { - console.log() - console.log(chalk.gray('监听文件修改中...')) - console.log() - initCompileScripts() - initCompileStyles() - isCopyingFiles = {} - - const { - appPath, - sourceDirName, - sourceDir, - outputDir, - outputFilesTypes, - entryFilePath, - entryFileName, - appConfig - } = getBuildData() - const pluginDir = path.join(sourceDir, PLUGIN_ROOT) - const pluginPath = path.join(appPath, PLUGIN_ROOT) - const docDir = path.join(pluginDir, DOC_ROOT) - const docPath = path.join(appPath, DOC_ROOT) - - const watcher = chokidar.watch(sourceDir, { - ignored: /(^|[/\\])\../, - persistent: true, - ignoreInitial: true - }) - watcher - .on('addDir', dirPath => { - console.log(dirPath) - }) - .on('add', filePath => { - console.log(filePath) - }) - .on('change', async filePath => { - let outputFilePath - if (filePath.includes(docDir)) { - outputFilePath = filePath.replace(docDir, docPath) - } else if (filePath.includes(pluginDir)) { - outputFilePath = filePath.replace(pluginDir, pluginPath) - } else { - outputFilePath = filePath.replace(sourceDir, outputDir) - } - - const extname = path.extname(filePath) - if (REG_SCRIPT.test(extname) || REG_TYPESCRIPT.test(extname)) { - const pluginJsonPath = path.join(pluginDir, PLUGIN_JSON) - if (!fs.existsSync(pluginDir) || !fs.existsSync(pluginJsonPath)) { - return console.log(chalk.red('缺少 plugin.json!')) - } - const pluginJson = fs.readJSONSync(pluginJsonPath) - const pages = pluginJson.pages - const main = pluginJson.main || '' - - if (entryFilePath === filePath) { - Util.printLog(processTypeEnum.MODIFY, '入口文件', `${sourceDirName}/${entryFileName}.js`) - const config = await buildEntry() - // TODO 此处待优化 - if ((Util.checksum(JSON.stringify(config.pages)) !== Util.checksum(JSON.stringify(appConfig.pages))) || - (Util.checksum(JSON.stringify(config.subPackages || config['subpackages'] || {})) !== Util.checksum(JSON.stringify(appConfig.subPackages || appConfig['subpackages'] || {})))) { - setAppConfig(config) - await buildPages() - } - } else if (isWxPluginPage(Object.values(pages), filePath) || isFileToBePage(filePath)) { - filePath = filePath.replace(extname, '') - filePath = filePath.replace(path.join(sourceDir) + path.sep, '') - filePath = filePath.split(path.sep).join('/') - Util.printLog(processTypeEnum.MODIFY, '页面文件', `${sourceDirName}/${filePath}`) - await buildSinglePage(filePath) - } else if (isComponentHasBeenBuilt(filePath)) { - let outputShowFilePath = filePath.replace(appPath + path.sep, '') - outputShowFilePath = outputShowFilePath.split(path.sep).join('/') - Util.printLog(processTypeEnum.MODIFY, '组件文件', outputShowFilePath) - deleteHasBeenBuiltComponent(filePath) - const componentsNamedMap = getComponentsNamedMap() - if (isWindows) { - await new Promise((resolve, reject) => { - setTimeout(async () => { - await buildSingleComponent(Object.assign({ - path: filePath - }, componentsNamedMap[filePath])) - resolve() - }, 300) - }) - } else { - await buildSingleComponent(Object.assign({ - path: filePath - }, componentsNamedMap[filePath])) - } - } else { - const dependencyTree = getDependencyTree() - let isImported = false - dependencyTree.forEach(dependencyTreeItem => { - const scripts = dependencyTreeItem.script || [] - if (scripts.indexOf(filePath) >= 0) { - isImported = true - } - }) - - let modifySource = filePath.replace(appPath + path.sep, '') - modifySource = modifySource.split(path.sep).join('/') - - if (isImported || filePath.includes(path.join(pluginDir, main))) { - Util.printLog(processTypeEnum.MODIFY, 'JS文件', modifySource) - await Promise.all(compileDepScripts([filePath], true, true)) - } else { - Util.printLog(processTypeEnum.WARNING, 'JS文件', `${modifySource} 没有被引用到,不会被编译`) - } - } - } else if (REG_STYLE.test(extname)) { - const dependencyTree = getDependencyTree() - const includeStyleJSPath: { filePath: string, styles: any[] }[] = [] - dependencyTree.forEach((dependencyTreeItem, key) => { - const styles = dependencyTreeItem['style'] || [] - styles.forEach(item => { - if (item === filePath) { - includeStyleJSPath.push({ - filePath: key, - styles - }) - } - }) - }) - - if (includeStyleJSPath.length) { - await Promise.all(includeStyleJSPath.map(async item => { - let outputWXSSPath = item.filePath.replace(path.extname(item.filePath), outputFilesTypes.STYLE) - let modifySource = outputWXSSPath.replace(appPath + path.sep, '') - modifySource = modifySource.split(path.sep).join('/') - Util.printLog(processTypeEnum.MODIFY, '样式文件', modifySource) - - outputWXSSPath = outputWXSSPath.replace(sourceDir, outputDir) - if (isWindows) { - await new Promise((resolve, reject) => { - setTimeout(async () => { - await compileDepStyles(outputWXSSPath, item.styles) - resolve() - }, 300) - }) - } else { - await compileDepStyles(outputWXSSPath, item.styles) - } - - let modifyOutput = outputWXSSPath.replace(appPath + path.sep, '') - modifyOutput = modifyOutput.split(path.sep).join('/') - Util.printLog(processTypeEnum.GENERATE, '样式文件', modifyOutput) - })) - } else { - let outputWXSSPath = filePath.replace(path.extname(filePath), outputFilesTypes.STYLE) - let modifySource = outputWXSSPath.replace(appPath + path.sep, '') - modifySource = modifySource.split(path.sep).join('/') - Util.printLog(processTypeEnum.MODIFY, '样式文件', modifySource) - outputWXSSPath = outputWXSSPath.replace(sourceDir, outputDir) - if (isWindows) { - await new Promise((resolve, reject) => { - setTimeout(async () => { - await compileDepStyles(outputWXSSPath, [filePath]) - resolve() - }, 300) - }) - } else { - await compileDepStyles(outputWXSSPath, [filePath]) - } - let modifyOutput = outputWXSSPath.replace(appPath + path.sep, '') - modifyOutput = modifyOutput.split(path.sep).join('/') - Util.printLog(processTypeEnum.GENERATE, '样式文件', modifyOutput) - } - } else { - if (isCopyingFiles[outputFilePath]) return - isCopyingFiles[outputFilePath] = true - - let modifyOutput = outputFilePath.replace(appPath + path.sep, '') - modifyOutput = modifyOutput.split(path.sep).join('/') - Util.printLog(processTypeEnum.COPY, '文件', modifyOutput) - - if (!fs.existsSync(filePath)) { - let modifySrc = filePath.replace(appPath + path.sep, '') - modifySrc = modifySrc.split(path.sep).join('/') - Util.printLog(processTypeEnum.ERROR, '文件', `${modifySrc} 不存在`) - } else { - fs.ensureDir(path.dirname(outputFilePath)) - if (filePath === outputFilePath) { - return - } - const pluginJsonPath = path.join(sourceDir, PLUGIN_ROOT, PLUGIN_JSON) - if (filePath === pluginJsonPath) { - compilePluginJson(fs.readJSONSync(filePath), outputFilePath) - } else { - fs.copySync(filePath, outputFilePath) - } - } - } - - // 如果 output/plugin 里有新编译出的文件, - // 先把 js 里对 npm 的引用修改,然后把所有文件迁移到插件目录 - // 最后删除 output/plugin - const names = glob.sync(`${outputDir}/${PLUGIN_ROOT}/**/*`) - if (names.length) { - const jsNames = glob.sync(`${outputDir}/${PLUGIN_ROOT}/{,!(npm)/**/}?(*.js|*.json)`) - const ioPromises = jsNames.map(async name => { - const content = fs.readFileSync(name).toString() - - let isShouldBeWritten - let replacement = content.replace(/['|"]((\.\.\/)+)npm\/.+?['|"]/g, (str, $1) => { - isShouldBeWritten = true - return $1 === '../' ? str.replace('../', './') : str.replace('../', '') - }) - - const REG_PLUGIN_DEPS = RegExp(`['|"](/${PLUGIN_ROOT}.+)['|"]`, 'g') - replacement = replacement.replace(REG_PLUGIN_DEPS, (str, $1) => { - if (REG_FONT.test($1) || REG_IMAGE.test($1) || REG_MEDIA.test($1)) { - isShouldBeWritten = true - return str.replace(RegExp(`^['|"]/${PLUGIN_ROOT}`, 'g'), str => str.replace(`${PLUGIN_ROOT}`, '')) - } - return str - }) - - if (isShouldBeWritten) await fs.writeFile(name, replacement) - }) - await Promise.all(ioPromises) - - await Promise.all(names.map(async from => { - from = path.join(from) - if (fs.existsSync(from) && fs.statSync(from).isFile()) { - const to = from.replace(outputDir, appPath) - fs.ensureDirSync(path.dirname(to)) - await fs.copyFile(from, to) - } - })) - const tempPluginPath = path.join(outputDir, PLUGIN_ROOT) - Util.emptyDirectory(tempPluginPath) - fs.rmdirSync(tempPluginPath) - } - // 迁移 npm 到 plugin 目录 - Util.emptyDirectory(path.join(pluginPath, NPM_DIR)) - // fs.rmdirSync(tempPluginPath) - await fs.copy(path.join(outputDir, NPM_DIR), path.join(pluginPath, NPM_DIR)) - - initCompileScripts() - initCompileStyles() - isCopyingFiles = {} - }) -} - -function isWxPluginPage (pages, filePath) { - return pages.findIndex(page => filePath.includes(path.join(page))) >= 0 -} - -async function buildWxPlugin (appPath, { watch }) { - const { - sourceDir, - outputDir - } = setBuildData(appPath, BUILD_TYPES.WEAPP) - const pluginDir = path.join(sourceDir, PLUGIN_ROOT) - const pluginPath = path.join(appPath, PLUGIN_ROOT) - const docDir = path.join(pluginDir, DOC_ROOT) - const docPath = path.join(appPath, DOC_ROOT) - - setIsProduction(process.env.NODE_ENV === 'production' || !watch) - - fs.existsSync(pluginPath) && Util.emptyDirectory(pluginPath) - fs.existsSync(docPath) && Util.emptyDirectory(docPath) - // 编译调试项目 - await buildWeapp(appPath, { adapter: BUILD_TYPES.WEAPP, envHasBeenSet: true }) - - const pluginJsonPath = path.join(pluginDir, PLUGIN_JSON) - if (!fs.existsSync(pluginDir) || !fs.existsSync(pluginJsonPath)) { - return console.log(chalk.red('缺少 plugin.json!')) - } - const pluginJson = fs.readJSONSync(pluginJsonPath) - const components = pluginJson.publicComponents - const pages: { [key: string]: any } = pluginJson.pages - const main = pluginJson.main - - // 编译插件页面 - if (pages && Object.keys(pages).length) { - Util.printLog(processTypeEnum.COMPILE, '插件页面') - const pagesPromises = Object.values(pages).map(page => buildSinglePage(path.join(PLUGIN_ROOT, page))) - await Promise.all(pagesPromises) - } - - // 编译插件组件 - if (components && Object.keys(components).length) { - Util.printLog(processTypeEnum.COMPILE, '插件组件') - const componentList: any[] = [] - for (const component in components) { - const componentPath = components[component] - componentList.push({ - path: /^(\.|\/)/.test(componentPath) ? componentPath : '.' + path.sep + componentPath, - name: component, - type: 'default' - }) - } - const realComponentsPathList = getRealComponentsPathList(pluginJsonPath, componentList) - await buildDepComponents(realComponentsPathList) - } - - // 编译插件 main.js - if (main) { - Util.printLog(processTypeEnum.COMPILE, '插件 JS') - await Promise.all(compileDepScripts([path.join(pluginDir, main)], true, true)) - } - - // 把 plugin 目录挪到根目录 - await fs.move(path.join(outputDir, PLUGIN_ROOT), pluginPath) - // 把 npm 拷贝一份到 plugin 目录 - await fs.copy(path.join(outputDir, NPM_DIR), path.join(pluginPath, NPM_DIR)) - // 把 doc 目录拷贝到根目录 - fs.existsSync(docDir) && fs.copySync(docDir, docPath) - // 拷贝 plugin.json - compilePluginJson(pluginJson, path.join(pluginPath, PLUGIN_JSON)) - - // plugin 文件夹内对 npm 的引用路径修改 - const names = glob.sync('plugin/{,!(npm)/**/}?(*.js|*.json)') - const ioPromises = names.map(name => { - const content = fs.readFileSync(name).toString() - - let isShouldBeWritten - let replacement = content.replace(/['|"]((\.\.\/)+)npm\/.+?['|"]/g, (str, $1) => { - isShouldBeWritten = true - return $1 === '../' ? str.replace('../', './') : str.replace('../', '') - }) - - const REG_PLUGIN_DEPS = RegExp(`['|"](/${PLUGIN_ROOT}.+?)['|"]`, 'g') - replacement = replacement.replace(REG_PLUGIN_DEPS, (str, $1) => { - if (REG_FONT.test($1) || REG_IMAGE.test($1) || REG_MEDIA.test($1)) { - isShouldBeWritten = true - return str.replace(RegExp(`^['|"]/${PLUGIN_ROOT}`, 'g'), str => str.replace(`${PLUGIN_ROOT}`, '')) - } - return str - }) - - if (isShouldBeWritten) fs.writeFileSync(path.join(appPath, name), replacement) - }) - await Promise.all(ioPromises) - - watch && wxPluginWatchFiles() +async function buildWxPlugin (appPath, { watch, type }, builder) { + await buildMini(appPath, { watch, type: BUILD_TYPES.PLUGIN }, null, builder) + const { outputDirName } = getBuildData() + await buildMini(appPath, { watch, type }, { + outputDirName: `${outputDirName}/miniprogram` + }, builder) } -function buildAlipayPlugin () { +async function buildAlipayPlugin (appPath, { watch, type }, builder) { + await buildMini(appPath, { watch, type }, null, builder) const { sourceDir, outputDir diff --git a/packages/taro-cli/src/quickapp/template-rewriter.ts b/packages/taro-cli/src/quickapp/template-rewriter.ts deleted file mode 100644 index abc148762f47..000000000000 --- a/packages/taro-cli/src/quickapp/template-rewriter.ts +++ /dev/null @@ -1,13 +0,0 @@ -import parseXml from './template/parser' -import rewriteNode from './template/node' -import serialize from './template/serialize' - -export default function rewriterTemplate(code : string): string { - // 解析Code - const viewNodes = parseXml(`${code}`).children - // 解析视图组件 - const retNodes = rewriteNode(viewNodes) - // 生成xml代码 - const templateCode = serialize(retNodes) - return templateCode -} \ No newline at end of file diff --git a/packages/taro-cli/src/ui/common.ts b/packages/taro-cli/src/ui/common.ts index a2f39a7f8172..41f6e1b5a916 100644 --- a/packages/taro-cli/src/ui/common.ts +++ b/packages/taro-cli/src/ui/common.ts @@ -1,10 +1,12 @@ +import * as path from 'path' +import * as fs from 'fs-extra' + import * as t from 'babel-types' import * as glob from 'glob' import traverse from 'babel-traverse' -import * as path from 'path' -import * as wxTransformer from '@tarojs/transformer-wx' import generate from 'babel-generator' -import * as fs from 'fs-extra' +import * as wxTransformer from '@tarojs/transformer-wx' + import { IBuildData } from './ui.types' import { cssImports, printLog, resolveScriptPath, resolveStylePath, isNpmPkg } from '../util' import { processTypeEnum, REG_STYLE, REG_TYPESCRIPT, REG_SCRIPT, REG_JSON, REG_FONT, REG_IMAGE, REG_MEDIA, CSS_EXT } from '../util/constants' diff --git a/packages/taro-cli/src/ui/h5.ts b/packages/taro-cli/src/ui/h5.ts index c80faa65b363..e2fe99225246 100644 --- a/packages/taro-cli/src/ui/h5.ts +++ b/packages/taro-cli/src/ui/h5.ts @@ -25,8 +25,8 @@ async function buildForH5 (uiIndex = 'index', buildData: IBuildData) { } async function buildH5Script (buildData: IBuildData) { - const {appPath, projectConfig, entryFileName, sourceDirName, tempPath} = buildData - let {outputDirName} = buildData + const { appPath, projectConfig, entryFileName, sourceDirName, tempPath } = buildData + let { outputDirName } = buildData const h5Config: IH5BuildConfig = Object.assign({}, projectConfig.h5) const entryFile = path.basename(entryFileName, path.extname(entryFileName)) + '.js' outputDirName = `${outputDirName}/${H5_OUTPUT_NAME}` diff --git a/packages/taro-cli/src/ui/index.ts b/packages/taro-cli/src/ui/index.ts index 33d855ebe4b5..7b1651f4a8d3 100644 --- a/packages/taro-cli/src/ui/index.ts +++ b/packages/taro-cli/src/ui/index.ts @@ -17,7 +17,7 @@ import { BUILD_TYPES, REG_STYLE } from '../util/constants' -import { IBuildConfig } from '../util/types' +import { IBuildOptions } from '../util/types' import { setBuildData as setMiniBuildData } from '../mini/helper' import { IBuildData } from './ui.types' import { @@ -244,7 +244,7 @@ function watchFiles () { }) } -export async function build (appPath, {watch, uiIndex}: IBuildConfig) { +export async function build (appPath, {watch, uiIndex}: IBuildOptions) { setBuildData(appPath, uiIndex) setMiniBuildData(appPath, BUILD_TYPES.WEAPP) setMiniBuildData(appPath, BUILD_TYPES.QUICKAPP) diff --git a/packages/taro-cli/src/ui/rn.ts b/packages/taro-cli/src/ui/rn.ts index ca6bb0d801cc..c994e3e71b55 100644 --- a/packages/taro-cli/src/ui/rn.ts +++ b/packages/taro-cli/src/ui/rn.ts @@ -1,12 +1,13 @@ -import { IBuildData } from './ui.types' import * as path from 'path' -import { analyzeFiles, analyzeStyleFilesImport, copyFileToDist, RN_OUTPUT_NAME, parseEntryAst } from './common' -import { printLog, resolveScriptPath } from '../util' import * as fs from 'fs-extra' import * as wxTransformer from '@tarojs/transformer-wx' +import chalk from 'chalk' + import { processTypeEnum, REG_TYPESCRIPT } from '../util/constants' import { Compiler as RNCompiler } from '../rn' -import chalk from 'chalk' +import { analyzeFiles, analyzeStyleFilesImport, copyFileToDist, RN_OUTPUT_NAME, parseEntryAst } from './common' +import { printLog, resolveScriptPath } from '../util' +import { IBuildData } from './ui.types' export async function buildForRN (uiIndex = 'index', buildData) { const {appPath} = buildData diff --git a/packages/taro-cli/src/ui/ui.types.ts b/packages/taro-cli/src/ui/ui.types.ts index 3ab3cd7c407a..909e49815cdc 100644 --- a/packages/taro-cli/src/ui/ui.types.ts +++ b/packages/taro-cli/src/ui/ui.types.ts @@ -1,4 +1,4 @@ -import { IH5Config, IProjectConfig } from '../util/types' +import { IProjectConfig, IH5Config } from '@tarojs/taro/types/compile' export interface IBuildData { appPath: string, diff --git a/packages/taro-cli/src/ui/weapp.ts b/packages/taro-cli/src/ui/weapp.ts index 23575e6a2807..49cfde0b6cd2 100644 --- a/packages/taro-cli/src/ui/weapp.ts +++ b/packages/taro-cli/src/ui/weapp.ts @@ -1,9 +1,9 @@ import chalk from 'chalk' import * as fs from 'fs-extra' import * as path from 'path' +import * as wxTransformer from '@tarojs/transformer-wx' import { processTypeEnum, REG_TYPESCRIPT } from '../util/constants' -import * as wxTransformer from '@tarojs/transformer-wx' import { printLog } from '../util' import { analyzeFiles, parseEntryAst, WEAPP_OUTPUT_NAME, copyFileToDist, copyAllInterfaceFiles } from './common' import { IBuildData } from './ui.types' diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index a5313131a103..350355b94671 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "1.3.18", + "version": "1.3.19", "description": "Mini app runner for taro", "main": "index.js", "scripts": { @@ -32,8 +32,8 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/taro": "1.3.18", - "@tarojs/transformer-wx": "1.3.18", + "@tarojs/taro": "1.3.19", + "@tarojs/transformer-wx": "1.3.19", "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", diff --git a/packages/taro-mini-runner/src/index.ts b/packages/taro-mini-runner/src/index.ts index feb45ea71f84..57ac020bbba4 100644 --- a/packages/taro-mini-runner/src/index.ts +++ b/packages/taro-mini-runner/src/index.ts @@ -1,6 +1,7 @@ import * as webpack from 'webpack' import { IBuildConfig } from './utils/types' +import { BUILD_TYPES } from './utils/constants' import { printBuildError, bindProdLogger, bindDevLogger } from './utils/logHelper' import buildConf from './webpack/build.conf' @@ -13,6 +14,11 @@ const customizeChain = (chain, customizeFunc: Function) => { export default function build (appPath: string, config: IBuildConfig, mainBuilder) { const mode = config.isWatch ? 'development' : 'production' return new Promise((resolve, reject) => { + const { buildAdapter } = config + if (buildAdapter === BUILD_TYPES.PLUGIN) { + config.buildAdapter = BUILD_TYPES.WEAPP + config.isBuildPlugin = true + } const webpackChain = buildConf(appPath, mode, config) customizeChain(webpackChain, config.webpackChain) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index dceb7a3cdbac..0e4a46cc7205 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -34,7 +34,9 @@ interface IMiniPluginOptions { outputDir: string, quickappJSON?: any, designWidth: number, - commonChunks: string[] + commonChunks: string[], + pluginConfig?: object, + isBuildPlugin: boolean } export interface ITaroFileInfo { @@ -145,7 +147,8 @@ export default class MiniPlugin { sourceDir: '', outputDir: '', designWidth: 750, - commonChunks: ['runtime', 'vendors'] + commonChunks: ['runtime', 'vendors'], + isBuildPlugin: false }) this.sourceDir = this.options.sourceDir this.outputDir = this.options.outputDir @@ -200,7 +203,8 @@ export default class MiniPlugin { new TaroLoadChunksPlugin({ commonChunks: this.options.commonChunks, - buildAdapter: this.options.buildAdapter + buildAdapter: this.options.buildAdapter, + isBuildPlugin: this.options.isBuildPlugin }).apply(compiler) new TaroNormalModulesPlugin().apply(compiler) @@ -214,10 +218,16 @@ export default class MiniPlugin { } getAppEntry (compiler) { + const { entry } = compiler.options + if (this.options.isBuildPlugin) { + const entryCopy = Object.assign({}, entry) + compiler.options.entry = {} + return entryCopy + } if (this.options.appEntry) { + compiler.options.entry = {} return this.options.appEntry } - const { entry } = compiler.options function getEntryPath (entry) { const app = entry['app'] if (Array.isArray(app)) { @@ -409,6 +419,81 @@ export default class MiniPlugin { ]) } + getPluginFiles (compiler) { + const fileList = new Set() + const { pluginConfig, buildAdapter } = this.options + let normalFiles = new Set() + Object.keys(this.appEntry).forEach(key => { + const filePath = this.appEntry[key][0] + const code = fs.readFileSync(filePath).toString() + if (isFileToBeTaroComponent(code, filePath, buildAdapter)) { + if (pluginConfig) { + fileList.add({ + name: key, + path: filePath, + isNative: false + }) + let isPage = false + let isComponent = false + Object.keys(pluginConfig).forEach(pluginKey => { + if (pluginKey === 'pages') { + Object.keys(pluginConfig[pluginKey]).forEach(pageKey => { + if (`plugin/${pluginConfig[pluginKey][pageKey]}` === key) { + isPage = true + } + }) + } + if (pluginKey === 'publicComponents') { + Object.keys(pluginConfig[pluginKey]).forEach(pageKey => { + if (`plugin/${pluginConfig[pluginKey][pageKey]}` === key) { + isComponent = true + } + }) + } + }) + if (isPage) { + this.pages.add({ + name: key, + path: filePath, + isNative: false + }) + this.getComponents(fileList, isPage) + } else if (isComponent) { + this.components.add({ + name: key, + path: filePath, + isNative: false + }) + this.getComponents(fileList, false) + } else { + normalFiles.add({ + name: key, + path: filePath, + isNative: true + }) + } + } + } + }) + normalFiles.forEach(item => { + this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.NORMAL) + }) + this.pages.forEach(item => { + if (item.isNative) { + this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.NORMAL) + } else { + this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.PAGE) + } + }) + this.components.forEach(item => { + if (item.isNative) { + this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.NORMAL) + } else { + this.addEntry(compiler, item.path, item.name, PARSE_AST_TYPE.COMPONENT) + } + }) + } + isNativePageORComponent (templatePath, jsContent) { return fs.existsSync(templatePath) && jsContent.indexOf(taroJsFramework) < 0 } @@ -680,9 +765,13 @@ export default class MiniPlugin { } run (compiler: webpack.Compiler) { - this.getPages(compiler) - this.getComponents(this.pages, true) - this.addEntries(compiler) + if (!this.options.isBuildPlugin) { + this.getPages(compiler) + this.getComponents(this.pages, true) + this.addEntries(compiler) + } else { + this.getPluginFiles(compiler) + } this.transferFileContent(compiler) } diff --git a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts index e7aa2eb57ee7..d93dc4cc1caf 100644 --- a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts @@ -11,16 +11,19 @@ const PLUGIN_NAME = 'TaroLoadChunksPlugin' interface IOptions { commonChunks: string[], - buildAdapter: BUILD_TYPES + buildAdapter: BUILD_TYPES, + isBuildPlugin: boolean } export default class TaroLoadChunksPlugin { commonChunks: string[] buildAdapter: BUILD_TYPES + isBuildPlugin: boolean constructor (options: IOptions) { this.commonChunks = options.commonChunks this.buildAdapter = options.buildAdapter + this.isBuildPlugin = options.isBuildPlugin } apply (compiler: webpack.Compiler) { @@ -31,7 +34,10 @@ export default class TaroLoadChunksPlugin { }) compilation.chunkTemplate.hooks.renderWithEntry.tap(PLUGIN_NAME, (modules, chunk) => { if (chunk.entryModule) { - if (chunk.entryModule.miniType === PARSE_AST_TYPE.ENTRY) { + if (this.isBuildPlugin) { + const id = chunk.id + return addRequireToSource(id, modules, commonChunks) + } else if (chunk.entryModule.miniType === PARSE_AST_TYPE.ENTRY) { compilation.hooks.afterOptimizeAssets.tap(PLUGIN_NAME, assets => { const files = chunk.files files.forEach(item => { @@ -50,30 +56,27 @@ export default class TaroLoadChunksPlugin { } }) }) - const source = new ConcatSource() const name = chunk.name - commonChunks.forEach(chunkItem => { - source.add(`require(${JSON.stringify(promoteRelativePath(path.relative(name, chunkItem.name)))});\n`) - }) - source.add('\n') - source.add(modules) - source.add(';') - return source - } else if (this.buildAdapter === BUILD_TYPES.QUICKAPP && + return addRequireToSource(name, modules, commonChunks) + } else if ((this.buildAdapter === BUILD_TYPES.QUICKAPP) && (chunk.entryModule.miniType === PARSE_AST_TYPE.PAGE || chunk.entryModule.miniType === PARSE_AST_TYPE.COMPONENT)) { - const source = new ConcatSource() const id = chunk.id - commonChunks.forEach(chunkItem => { - source.add(`require(${JSON.stringify(promoteRelativePath(path.relative(id, chunkItem.name)))});\n`) - }) - source.add('\n') - source.add(modules) - source.add(';') - return source + return addRequireToSource(id, modules, commonChunks) } } }) }) } } + +function addRequireToSource (id, modules, commonChunks) { + const source = new ConcatSource() + commonChunks.forEach(chunkItem => { + source.add(`require(${JSON.stringify(promoteRelativePath(path.relative(id, chunkItem.name)))});\n`) + }) + source.add('\n') + source.add(modules) + source.add(';') + return source +} diff --git a/packages/taro-cli/src/quickapp/style-rewriter.ts b/packages/taro-mini-runner/src/quickapp/style-rewriter.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style-rewriter.ts rename to packages/taro-mini-runner/src/quickapp/style-rewriter.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/animation/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/animation/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/animation/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/animation/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/background/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/background/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/background/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/background/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/border/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/border/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/border/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/border/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/box/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/box/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/box/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/box/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/color/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/color/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/color/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/color/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/component/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/component/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/component/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/component/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/dimension/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/dimension/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/dimension/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/dimension/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/flexbox/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/flexbox/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/flexbox/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/flexbox/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/font/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/font/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/font/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/font/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/list/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/list/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/list/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/list/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/margin/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/margin/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/margin/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/margin/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/padding/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/padding/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/padding/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/padding/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/position/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/position/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/position/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/position/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/text/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/text/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/text/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/text/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/transform/transform.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/transform/transform.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/transform/transform.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/transform/transform.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/transition/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/transition/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/transition/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/transition/index.ts diff --git a/packages/taro-cli/src/quickapp/style/declaration/visibility/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/visibility/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/declaration/visibility/index.ts rename to packages/taro-mini-runner/src/quickapp/style/declaration/visibility/index.ts diff --git a/packages/taro-cli/src/quickapp/style/index.ts b/packages/taro-mini-runner/src/quickapp/style/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/index.ts rename to packages/taro-mini-runner/src/quickapp/style/index.ts diff --git a/packages/taro-cli/src/quickapp/style/selector/index.ts b/packages/taro-mini-runner/src/quickapp/style/selector/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/selector/index.ts rename to packages/taro-mini-runner/src/quickapp/style/selector/index.ts diff --git a/packages/taro-cli/src/quickapp/style/util.ts b/packages/taro-mini-runner/src/quickapp/style/util.ts similarity index 100% rename from packages/taro-cli/src/quickapp/style/util.ts rename to packages/taro-mini-runner/src/quickapp/style/util.ts diff --git a/packages/taro-mini-runner/src/quickapp/template-rewriter.ts b/packages/taro-mini-runner/src/quickapp/template-rewriter.ts new file mode 100644 index 000000000000..812410bae3bb --- /dev/null +++ b/packages/taro-mini-runner/src/quickapp/template-rewriter.ts @@ -0,0 +1,13 @@ +import parseXml from './template/parser' +import rewriteNode from './template/node' +import serialize from './template/serialize' + +export default function rewriterTemplate(code : string): string { + // 解析Code + const viewNodes = parseXml(`${code}`).children + // 解析视图组件 + const retNodes = rewriteNode(viewNodes) + // 生成xml代码 + const templateCode = serialize(retNodes) + return templateCode +} diff --git a/packages/taro-cli/src/quickapp/template/constant.ts b/packages/taro-mini-runner/src/quickapp/template/constant.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/constant.ts rename to packages/taro-mini-runner/src/quickapp/template/constant.ts diff --git a/packages/taro-cli/src/quickapp/template/node.ts b/packages/taro-mini-runner/src/quickapp/template/node.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/node.ts rename to packages/taro-mini-runner/src/quickapp/template/node.ts diff --git a/packages/taro-cli/src/quickapp/template/parser.ts b/packages/taro-mini-runner/src/quickapp/template/parser.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/parser.ts rename to packages/taro-mini-runner/src/quickapp/template/parser.ts diff --git a/packages/taro-cli/src/quickapp/template/serialize.ts b/packages/taro-mini-runner/src/quickapp/template/serialize.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/serialize.ts rename to packages/taro-mini-runner/src/quickapp/template/serialize.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/index.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/span/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/span/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/span/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/span/index.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/taro-camera/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/taro-camera/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/taro-camera/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/taro-camera/index.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/taro-canvas/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/taro-canvas/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/taro-canvas/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/taro-canvas/index.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/taro-image/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/taro-image/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/taro-image/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/taro-image/index.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/taro-input/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/taro-input/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/taro-input/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/taro-input/index.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/taro-label/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/taro-label/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/taro-label/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/taro-label/index.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/taro-map/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/taro-map/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/taro-map/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/taro-map/index.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/taro-picker/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/taro-picker/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/taro-picker/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/taro-picker/index.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/taro-textarea/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/taro-textarea/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/taro-textarea/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/taro-textarea/index.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/taro-video/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/taro-video/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/taro-video/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/taro-video/index.ts diff --git a/packages/taro-cli/src/quickapp/template/tag/text/index.ts b/packages/taro-mini-runner/src/quickapp/template/tag/text/index.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/tag/text/index.ts rename to packages/taro-mini-runner/src/quickapp/template/tag/text/index.ts diff --git a/packages/taro-cli/src/quickapp/template/utils.ts b/packages/taro-mini-runner/src/quickapp/template/utils.ts similarity index 100% rename from packages/taro-cli/src/quickapp/template/utils.ts rename to packages/taro-mini-runner/src/quickapp/template/utils.ts diff --git a/packages/taro-mini-runner/src/utils/types.ts b/packages/taro-mini-runner/src/utils/types.ts index c4b5d8af72ee..41183312bad9 100644 --- a/packages/taro-mini-runner/src/utils/types.ts +++ b/packages/taro-mini-runner/src/utils/types.ts @@ -24,5 +24,6 @@ export interface IBuildConfig extends IProjectBaseConfig, IMiniAppConfig { port?: number, buildAdapter: BUILD_TYPES, nodeModulesPath: string, - quickappJSON: any + quickappJSON: any, + isBuildPlugin: boolean } diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts index 11109bb13905..71d891cbfd3f 100644 --- a/packages/taro-mini-runner/src/webpack/build.conf.ts +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -13,6 +13,7 @@ import { mergeOption, getMiniPlugin, getMiniCssExtractPlugin, + getEntry, } from './chain' import getBaseConf from './base.conf' import { BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES } from '../utils/constants' @@ -25,7 +26,6 @@ export default (appPath: string, mode, config: Partial): any => { const { buildAdapter = BUILD_TYPES.WEAPP, alias = emptyObj, - copy, entry = emptyObj, output = emptyObj, outputRoot = 'dist', @@ -55,15 +55,33 @@ export default (appPath: string, mode, config: Partial): any => { uglify } = config + let { copy } = config + const plugin: any = {} const minimizer: any[] = [] const sourceDir = path.join(appPath, sourceRoot) const outputDir = path.join(appPath, outputRoot) - + if (config.isBuildPlugin) { + const patterns = copy ? copy.patterns : [] + patterns.push({ + from: path.join(sourceRoot, 'plugin', 'doc'), + to: path.join(outputRoot, 'doc') + }) + patterns.push({ + from: path.join(sourceRoot, 'plugin', 'plugin.json'), + to: path.join(outputRoot, 'plugin', 'plugin.json') + }) + copy = Object.assign({}, copy, { patterns }) + } if (copy) { plugin.copyWebpackPlugin = getCopyWebpackPlugin({ copy, appPath }) } const constantsReplaceList = mergeOption([processEnvOption(env), defineConstants]) + const entryRes = getEntry({ + sourceDir, + entry, + isBuildPlugin: config.isBuildPlugin + }) plugin.definePlugin = getDefinePlugin([constantsReplaceList]) plugin.miniPlugin = getMiniPlugin({ sourceDir, @@ -72,7 +90,10 @@ export default (appPath: string, mode, config: Partial): any => { constantsReplaceList, nodeModulesPath, quickappJSON, - designWidth + designWidth, + pluginConfig: entryRes!.pluginConfig, + isBuildPlugin: !!config.isBuildPlugin, + commonChunks: !!config.isBuildPlugin ? ['plugin/runtime', 'plugin/vendors'] : ['runtime', 'vendors'] }) plugin.miniCssExtractPlugin = getMiniCssExtractPlugin([{ @@ -84,7 +105,6 @@ export default (appPath: string, mode, config: Partial): any => { ? false : true - const isUglifyEnabled = (uglify && uglify.enable === false) ? false : true @@ -105,11 +125,12 @@ export default (appPath: string, mode, config: Partial): any => { chain.merge({ mode, devtool: getDevtool(enableSourceMap), - entry, + entry: entryRes!.entry, output: getOutput(appPath, [{ outputRoot, publicPath: '/', buildAdapter, + isBuildPlugin: config.isBuildPlugin }, output]), target: Targets[buildAdapter], resolve: { alias }, @@ -137,13 +158,13 @@ export default (appPath: string, mode, config: Partial): any => { optimization: { minimizer, runtimeChunk: { - name: 'runtime' + name: !!config.isBuildPlugin ? 'plugin/runtime' : 'runtime' }, splitChunks: { chunks: 'all', maxInitialRequests: Infinity, minSize: 0, - name: 'vendors', + name: !!config.isBuildPlugin ? 'plugin/vendors' : 'vendors', cacheGroups: { vendors: { test (module) { diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index d6109337b519..cb3d687bfa14 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -1,3 +1,4 @@ +import * as fs from 'fs-extra' import * as path from 'path' import * as CopyWebpackPlugin from 'copy-webpack-plugin' @@ -9,12 +10,13 @@ import { mapKeys, pipe } from 'lodash/fp' import * as UglifyJsPlugin from 'uglifyjs-webpack-plugin' import * as webpack from 'webpack' import { PostcssOption, ICopyOptions, IPostcssOption } from '@tarojs/taro/types/compile' +import chalk from 'chalk' import { getPostcssPlugins } from './postcss.conf' import MiniPlugin from '../plugins/MiniPlugin' import { IOption } from '../utils/types' -import { recursiveMerge, isNodeModule } from '../utils' +import { recursiveMerge, isNodeModule, resolveScriptPath } from '../utils' import { REG_SASS, REG_LESS, @@ -149,7 +151,7 @@ export const getCopyWebpackPlugin = ({ copy, appPath }: { return partial(getPlugin, CopyWebpackPlugin)(args) } -export const getMiniPlugin = (args) => { +export const getMiniPlugin = args => { return partial(getPlugin, MiniPlugin)([args]) } @@ -339,7 +341,47 @@ export const getModule = (appPath: string, { return { rule } } -export function getOutput (appPath: string, [{ outputRoot, publicPath, buildAdapter }, customOutput]) { +export const getEntry = ({ + sourceDir, + entry, + isBuildPlugin +}) => { + if (!isBuildPlugin) { + return { + entry + } + } + const pluginDir = path.join(sourceDir, 'plugin') + if (!fs.existsSync(pluginDir)) { + console.log(chalk.red('插件目录不存在,请检查!')) + return + } + const pluginConfigPath = path.join(pluginDir, 'plugin.json') + if (!fs.existsSync(pluginConfigPath)) { + console.log(chalk.red('缺少插件配置文件,请检查!')) + return + } + const pluginConfig = fs.readJSONSync(pluginConfigPath) + const entryObj = {} + Object.keys(pluginConfig).forEach(key => { + if (key === 'main') { + const filePath = path.join(pluginDir, pluginConfig[key]) + const fileName = path.basename(filePath).replace(path.extname(filePath), '') + entryObj[`plugin/${fileName}`] = [resolveScriptPath(filePath.replace(path.extname(filePath), ''))] + } else if (key === 'publicComponents' || key === 'pages') { + Object.keys(pluginConfig[key]).forEach(subKey => { + const filePath = path.join(pluginDir, pluginConfig[key][subKey]) + entryObj[`plugin/${pluginConfig[key][subKey]}`] = [resolveScriptPath(filePath.replace(path.extname(filePath), ''))] + }) + } + }) + return { + entry: entryObj, + pluginConfig + } +} + +export function getOutput (appPath: string, [{ outputRoot, publicPath, buildAdapter, isBuildPlugin }, customOutput]) { return { path: path.join(appPath, outputRoot), publicPath, diff --git a/packages/taro-webpack-runner/src/index.ts b/packages/taro-webpack-runner/src/index.ts index f55c0e1f2825..3e7bd7adb82e 100644 --- a/packages/taro-webpack-runner/src/index.ts +++ b/packages/taro-webpack-runner/src/index.ts @@ -134,7 +134,7 @@ const buildDev = async (appPath: string, config: BuildConfig): Promise => { } export default async (appPath: string, config: BuildConfig): Promise => { - const newConfig: BuildConfig = await makeConfig(config); + const newConfig: BuildConfig = await makeConfig(config) if (newConfig.isWatch) { try { await buildDev(appPath, newConfig) From 1e8aef1fe5c8c106000b78f0d30ef03b8e1421c6 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 15 Oct 2019 14:36:24 +0800 Subject: [PATCH 058/194] =?UTF-8?q?fix(mini-runner):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=BC=96=E8=AF=91=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/plugins/MiniPlugin.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 0e4a46cc7205..40d09b4cdf92 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -757,10 +757,12 @@ export default class MiniPlugin { Object.keys(taroFileTypeMap).forEach(item => { const relativePath = item.replace(compiler.context, '') const itemInfo = taroFileTypeMap[item] - new VirtualModulePlugin({ - moduleName: relativePath, - contents: itemInfo.code - }).apply(compiler) + if (typeof itemInfo.code !== 'string') { + new VirtualModulePlugin({ + moduleName: relativePath, + contents: itemInfo.code + }).apply(compiler) + } }) } From e38ebc7ccee3c99a71a09568fe8d72e997c93671 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 15 Oct 2019 15:17:13 +0800 Subject: [PATCH 059/194] =?UTF-8?q?fix(mini-runner):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=BF=AB=E5=BA=94=E7=94=A8=E7=BC=96=E8=AF=91=E5=90=8E=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=B8=8E=E6=A0=B7=E5=BC=8F=E7=9A=84=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/package.json | 2 ++ .../src/loaders/quickappStyleLoader.ts | 5 +++++ packages/taro-mini-runner/src/plugins/MiniPlugin.ts | 4 +++- .../taro-mini-runner/src/quickapp/style-rewriter.ts | 4 ++-- .../taro-mini-runner/src/quickapp/template-rewriter.ts | 2 +- packages/taro-mini-runner/src/webpack/chain.ts | 10 ++++++++-- 6 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 packages/taro-mini-runner/src/loaders/quickappStyleLoader.ts diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index 350355b94671..fbea11f745fb 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -44,8 +44,10 @@ "better-babel-generator": "^6.26.1", "chalk": "^2.4.2", "copy-webpack-plugin": "^5.0.3", + "css": "2.2.4", "css-loader": "^3.0.0", "csso-webpack-plugin": "^1.0.0-beta.12", + "css-what": "3.2.0", "file-loader": "^4.0.0", "fs-extra": "^8.0.1", "less-loader": "^5.0.0", diff --git a/packages/taro-mini-runner/src/loaders/quickappStyleLoader.ts b/packages/taro-mini-runner/src/loaders/quickappStyleLoader.ts new file mode 100644 index 000000000000..aab8c8eafb17 --- /dev/null +++ b/packages/taro-mini-runner/src/loaders/quickappStyleLoader.ts @@ -0,0 +1,5 @@ +import styleRewriter from '../quickapp/style-rewriter' + +export default function quickappStyleLoader (source) { + return styleRewriter(source) +} diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 40d09b4cdf92..0a9d79daf368 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -21,6 +21,7 @@ import { resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync, isEm import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency' import { getTaroJsQuickAppComponentsPath, generateQuickAppUx, getImportTaroSelfComponents, generateQuickAppManifest } from '../utils/helper' import parseAst from '../utils/parseAst' +import rewriterTemplate from '../quickapp/template-rewriter' import TaroLoadChunksPlugin from './TaroLoadChunksPlugin' import TaroNormalModulesPlugin from './TaroNormalModulesPlugin' @@ -700,6 +701,7 @@ export default class MiniPlugin { } } else { let hitScriptItem + template = template ? rewriterTemplate(template) : template Object.keys(compilation.assets).forEach(item => { if (stylePath.indexOf(item) >= 0) { const relativeStylePath = promoteRelativePath(path.relative(scriptPath, stylePath)) @@ -757,7 +759,7 @@ export default class MiniPlugin { Object.keys(taroFileTypeMap).forEach(item => { const relativePath = item.replace(compiler.context, '') const itemInfo = taroFileTypeMap[item] - if (typeof itemInfo.code !== 'string') { + if (typeof itemInfo.code === 'string') { new VirtualModulePlugin({ moduleName: relativePath, contents: itemInfo.code diff --git a/packages/taro-mini-runner/src/quickapp/style-rewriter.ts b/packages/taro-mini-runner/src/quickapp/style-rewriter.ts index 0d076b4e0956..f59ad6a2ab40 100644 --- a/packages/taro-mini-runner/src/quickapp/style-rewriter.ts +++ b/packages/taro-mini-runner/src/quickapp/style-rewriter.ts @@ -7,7 +7,7 @@ interface StyleLog { reason: string; } -export default function rewriter (code, isProduction) { +export default function rewriter (code, isProduction?) { const logs: StyleLog[] = [] const ast = css.parse(code, { silent: true @@ -47,7 +47,7 @@ export default function rewriter (code, isProduction) { // 输出转换结果 try { const resContent = css.stringify(ast, { - compress: isProduction + compress: !!isProduction }) return resContent } catch (e) { diff --git a/packages/taro-mini-runner/src/quickapp/template-rewriter.ts b/packages/taro-mini-runner/src/quickapp/template-rewriter.ts index 812410bae3bb..d9553a652971 100644 --- a/packages/taro-mini-runner/src/quickapp/template-rewriter.ts +++ b/packages/taro-mini-runner/src/quickapp/template-rewriter.ts @@ -2,7 +2,7 @@ import parseXml from './template/parser' import rewriteNode from './template/node' import serialize from './template/serialize' -export default function rewriterTemplate(code : string): string { +export default function rewriterTemplate (code : string): string { // 解析Code const viewNodes = parseXml(`${code}`).children // 解析视图组件 diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index cb3d687bfa14..99802d4ea880 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -115,12 +115,16 @@ export const getUrlLoader = pipe(mergeOption, partial(getLoader, 'url-loader')) export const getFileLoader = pipe(mergeOption, partial(getLoader, 'file-loader')) export const getFileParseLoader = pipe(mergeOption, partial(getLoader, path.resolve(__dirname, '../loaders/fileParseLoader'))) export const getWxTransformerLoader = pipe(mergeOption, partial(getLoader, path.resolve(__dirname, '../loaders/wxTransformerLoader'))) - const getExtractCssLoader = () => { return { loader: MiniCssExtractPlugin.loader } } +const getQuickappStyleLoader = () => { + return { + loader: require.resolve(path.resolve(__dirname, '../loaders/quickappStyleLoader')) + } +} export const getMiniCssExtractPlugin = pipe(mergeOption, listify, partial(getPlugin, MiniCssExtractPlugin)) export const getDefinePlugin = pipe(mergeOption, listify, partial(getPlugin, webpack.DefinePlugin)) export const getUglifyPlugin = ([enableSourceMap, uglifyOptions]) => { @@ -175,6 +179,7 @@ export const getModule = (appPath: string, { babel }) => { + const isQuickapp = buildAdapter === BUILD_TYPES.QUICKAPP const postcssOption: IPostcssOption = postcss || {} const cssModuleOptions: PostcssOption.cssModules = recursiveMerge({}, defaultCssModuleOption, postcssOption.cssModules) @@ -204,13 +209,14 @@ export const getModule = (appPath: string, { ] const extractCssLoader = getExtractCssLoader() + const quickappStyleLoader = getQuickappStyleLoader() const cssLoader = getCssLoader(cssOptions) const cssLoaders: { include?; use; }[] = [{ - use: [cssLoader] + use: isQuickapp ? [cssLoader, quickappStyleLoader] : [cssLoader] }] if (cssModuleOptions.enable) { From 5019023ec314dfe24a44c82006425bf9706b5ce3 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 15 Oct 2019 16:55:20 +0800 Subject: [PATCH 060/194] =?UTF-8?q?fix(mini-runner):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=AF=B9=20css=20modules=20=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/webpack/chain.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index 99802d4ea880..e276f58c8536 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -199,11 +199,15 @@ export const getModule = (appPath: string, { { importLoaders: 1, sourceMap: enableSourceMap, - modules: namingPattern === 'module' ? true : 'global' + modules: { + mode: namingPattern === 'module' ? 'local' : 'global' + } }, - typeof generateScopedName === 'function' + { + modules: typeof generateScopedName === 'function' ? { getLocalIdent: (context, _, localName) => generateScopedName(localName, context.resourcePath) } : { localIdentName: generateScopedName } + } ), cssLoaderOption ] From 2a26e203e6dd37c8705534d915041f7612b4d5bf Mon Sep 17 00:00:00 2001 From: zhutianjian Date: Thu, 17 Oct 2019 13:02:15 +0800 Subject: [PATCH 061/194] fix: pxtransform disable on quick-app --- packages/taro-mini-runner/src/webpack/chain.ts | 1 + packages/taro-mini-runner/src/webpack/postcss.conf.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index e276f58c8536..b4852fa565d7 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -249,6 +249,7 @@ export const getModule = (appPath: string, { { ident: 'postcss', plugins: getPostcssPlugins(appPath, { + isQuickapp, designWidth, deviceRatio, postcssOption diff --git a/packages/taro-mini-runner/src/webpack/postcss.conf.ts b/packages/taro-mini-runner/src/webpack/postcss.conf.ts index 4f682ea90cc5..80df8f124ee0 100644 --- a/packages/taro-mini-runner/src/webpack/postcss.conf.ts +++ b/packages/taro-mini-runner/src/webpack/postcss.conf.ts @@ -29,6 +29,7 @@ const optionsWithDefaults = ['autoprefixer', 'pxtransform', 'cssModules', 'url'] const plugins = [] as any[] export const getPostcssPlugins = function (appPath: string, { + isQuickapp = false, designWidth, deviceRatio, postcssOption = {} as IPostcssOption @@ -49,7 +50,7 @@ export const getPostcssPlugins = function (appPath: string, { plugins.push(autoprefixer(autoprefixerOption.config)) } - if (pxtransformOption.enable) { + if (pxtransformOption.enable && !isQuickapp) { plugins.push(pxtransform(pxtransformOption.config)) } From 127d6d2ea38f1268ccf00abdde7e275cbc573088 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 17 Oct 2019 13:54:34 +0800 Subject: [PATCH 062/194] =?UTF-8?q?fix(cli):=20=E4=BF=AE=E5=A4=8D=20doctor?= =?UTF-8?q?=20=E5=AF=B9=20config=20=E7=9A=84=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/doctor/configSchema.ts | 58 +++++++++++++++----- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/packages/taro-cli/src/doctor/configSchema.ts b/packages/taro-cli/src/doctor/configSchema.ts index c7575888d2e2..94b657dcccdf 100644 --- a/packages/taro-cli/src/doctor/configSchema.ts +++ b/packages/taro-cli/src/doctor/configSchema.ts @@ -10,10 +10,7 @@ const schema = Joi.object().keys({ 'sourceRoot': Joi.string().required(), 'outputRoot': Joi.string().required(), - // NOTE: 考虑是否增加第三方模块的配置检查 - 'plugins': Joi.object().pattern( - Joi.string(), Joi.object() - ), + 'plugins': Joi.array().items(Joi.object()), 'env': Joi.object().pattern( Joi.string(), Joi.string() @@ -35,12 +32,29 @@ const schema = Joi.object().keys({ }) }), - 'weapp': Joi.object().keys({ + 'mini': Joi.object().keys({ 'compile': Joi.object().keys({ 'exclude': Joi.array().items(Joi.string()), 'include': Joi.array().items(Joi.string()) }), - 'module': Joi.object(), // 第三方配置 + 'customFilesTypes': Joi.object().keys({ + 'TEMPL': Joi.string(), + 'STYLE': Joi.string(), + 'SCRIPT': Joi.string(), + 'CONFIG': Joi.string() + }), + 'webpackChain': Joi.func(), + 'output': Joi.object(), + 'postcss': Joi.object(), // 第三方配置 + 'cssLoaderOption': Joi.object(), // 第三方配置 + 'styleLoaderOption': Joi.object(), // 第三方配置 + 'sassLoaderOption': Joi.object(), // 第三方配置 + 'lessLoaderOption': Joi.object(), // 第三方配置 + 'stylusLoaderOption': Joi.object(), // 第三方配置 + 'mediaUrlLoaderOption': Joi.object(), // 第三方配置 + 'fontUrlLoaderOption': Joi.object(), // 第三方配置 + 'imageUrlLoaderOption': Joi.object(), // 第三方配置 + 'miniCssExtractPluginOption': Joi.object(), // 第三方配置 'jsxAttributeNameReplace': Joi.object().pattern( Joi.string(), Joi.string() ) @@ -50,12 +64,27 @@ const schema = Joi.object().keys({ Joi.string(), Joi.string() ), + 'babel': Joi.object(), + 'csso': Joi.object().keys({ + 'enable': Joi.bool(), + 'config': Joi.object() + }), + 'uglify': Joi.object().keys({ + 'enable': Joi.bool(), + 'config': Joi.object() + }), + 'sass': Joi.object().keys({ + 'enable': Joi.bool(), + 'config': Joi.object() + }), + 'h5': Joi.object().keys({ 'devServer': Joi.object(), // 第三方配置 'publicPath': Joi.string(), 'staticDirectory': Joi.string(), 'chunkDirectory': Joi.string(), 'webpackChain': Joi.func(), + 'output': Joi.object(), 'esnextModules': Joi.array().items(Joi.string()), @@ -84,6 +113,7 @@ const schema = Joi.object().keys({ ), 'enableSourceMap': Joi.bool(), 'enableExtract': Joi.bool(), + 'transformOnly': Joi.bool(), 'cssLoaderOption': Joi.object(), // 第三方配置 'styleLoaderOption': Joi.object(), // 第三方配置 'sassLoaderOption': Joi.object(), // 第三方配置 @@ -94,15 +124,13 @@ const schema = Joi.object().keys({ 'imageUrlLoaderOption': Joi.object(), // 第三方配置 'miniCssExtractPluginOption': Joi.object(), // 第三方配置 - 'module': Joi.object().keys({ - 'postcss': Joi.object().pattern( - Joi.string(), - Joi.object().keys({ - 'enable': Joi.bool(), - 'config': Joi.object() // 第三方配置 - }) - ) - }) + 'postcss': Joi.object().pattern( + Joi.string(), + Joi.object().keys({ + 'enable': Joi.bool(), + 'config': Joi.object() // 第三方配置 + }) + ) }) }) From 179be5cc53181c1024590d3f3887d3338a253786 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 17 Oct 2019 16:21:38 +0800 Subject: [PATCH 063/194] =?UTF-8?q?fix(cli):=20=E6=B8=85=E7=90=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/config/uglify.ts | 1 - packages/taro-cli/src/rn/transformJS.ts | 6 +- packages/taro-cli/src/util/index.ts | 291 +----------------------- 3 files changed, 5 insertions(+), 293 deletions(-) delete mode 100644 packages/taro-cli/src/config/uglify.ts diff --git a/packages/taro-cli/src/config/uglify.ts b/packages/taro-cli/src/config/uglify.ts deleted file mode 100644 index 43ea6b431bb8..000000000000 --- a/packages/taro-cli/src/config/uglify.ts +++ /dev/null @@ -1 +0,0 @@ -export default { } diff --git a/packages/taro-cli/src/rn/transformJS.ts b/packages/taro-cli/src/rn/transformJS.ts index 849c008a262d..24097c254d0c 100644 --- a/packages/taro-cli/src/rn/transformJS.ts +++ b/packages/taro-cli/src/rn/transformJS.ts @@ -274,7 +274,7 @@ export function parseJSCode ({code, filePath, isEntryFile, projectConfig}) { if (REG_STYLE.test(valueExtname)) { const stylePath = path.resolve(path.dirname(filePath), value) if (styleFiles.indexOf(stylePath) < 0) { - //样式条件文件编译 .rn.scss + // 样式条件文件编译 .rn.scss const realStylePath = Util.resolveStylePath(stylePath) styleFiles.push(realStylePath) } @@ -376,7 +376,7 @@ export function parseJSCode ({code, filePath, isEntryFile, projectConfig}) { hasComponentWillUnmount = true } // 获取 app.js 的 classRenderReturnJSX - if (keyName == 'render') { + if (keyName === 'render') { astPath.traverse({ BlockStatement (astPath) { if (astPath.parent === node) { @@ -450,7 +450,7 @@ export function parseJSCode ({code, filePath, isEntryFile, projectConfig}) { node.body.body.unshift(componentDidHideCallNode) } - if (key.name == 'render') { + if (key.name === 'render') { let funcBody = ` <${taroComponentsRNProviderName}> ${classRenderReturnJSX} diff --git a/packages/taro-cli/src/util/index.ts b/packages/taro-cli/src/util/index.ts index 556c7ba14a19..0a19f6953bf0 100644 --- a/packages/taro-cli/src/util/index.ts +++ b/packages/taro-cli/src/util/index.ts @@ -1,21 +1,15 @@ import * as fs from 'fs-extra' import * as path from 'path' import { Transform } from 'stream' -import * as crypto from 'crypto' import * as os from 'os' import * as child_process from 'child_process' import chalk from 'chalk' import { mergeWith, isPlainObject, camelCase, flatMap } from 'lodash' -import * as minimatch from 'minimatch' -import * as t from 'babel-types' import * as yauzl from 'yauzl' import * as findWorkspaceRoot from 'find-yarn-workspace-root' -import * as chokidar from 'chokidar' -import { ICopyArgOptions, ICopyOptions, TogglableOptions } from '@tarojs/taro/types/compile' import defaultBabelConfig from '../config/babel' -import defaultUglifyConfig from '../config/uglify' import { JS_EXT, @@ -25,13 +19,9 @@ import { processTypeMap, processTypeEnum, MINI_APP_FILES, - BUILD_TYPES, - CONFIG_MAP, - REG_STYLE, - UX_EXT, - NODE_MODULES + NODE_MODULES, + BUILD_TYPES } from './constants' -import { callPluginSync } from './npm' const execSync = child_process.execSync @@ -163,19 +153,6 @@ export function isEmptyObject (obj: any): boolean { return true } -export function urlJoin (...agrs: string[]): string { - function normalize (str) { - return str - .replace(/([/]+)/g, '/') - .replace(/\/\?(?!\?)/g, '?') - .replace(/\/#/g, '#') - .replace(/:\//g, '://') - } - - const joined = [].slice.call(agrs, 0).join('/') - return normalize(joined) -} - export function resolveScriptPath (p: string): string { const realPath = p const taroEnv = process.env.TARO_ENV @@ -203,74 +180,6 @@ export function resolveScriptPath (p: string): string { return realPath } -export function resolvePureScriptPath (p: string): string { - const realPath = p - const SCRIPT_EXT = JS_EXT.concat(TS_EXT) - for (let i = 0; i < SCRIPT_EXT.length; i++) { - const item = SCRIPT_EXT[i] - if (fs.existsSync(`${p}${item}`)) { - return `${p}${item}` - } - if (fs.existsSync(`${p}${path.sep}index${item}`)) { - return `${p}${path.sep}index${item}` - } - } - return realPath -} - -export function resolveQuickappFilePath (p: string): string { - for (let i = 0; i < UX_EXT.length; i++) { - const item = UX_EXT[i] - if (fs.existsSync(`${p}${item}`)) { - return `${p}${item}` - } - if (fs.existsSync(`${p}${path.sep}index${item}`)) { - return `${p}${path.sep}index${item}` - } - } - return p -} - -export function processUxContent (contents, cb) { - const reg = /(|>))([\s\S]*?)(?=<\/script\s*>|$)|(|>))([\s\S]*?)(?=<\/style\s*>|$)|<(image)\s+[\s\S]*?["'\s\w\/\-](?:>|$)|(|>))([\s\S]*?)(?=<\/import\s*>|$)/ig; - contents = contents.replace(reg, function (m, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) { - if ($1) { - $1 = $1.replace(/(\ssrc\s*=\s*)('[^']+'|"[^"]+"|[^\s\/>]+)/ig, function (m, prefix, value) { - if (typeof cb === 'function') { - value = cb(value) - } - return prefix + value - }) - m = $1 + $2 - } else if ($3) { - $3 = $3.replace(/(\ssrc\s*=\s*)('[^']+'|"[^"]+"|[^\s\/>]+)/ig, function (m, prefix, value) { - if (typeof cb === 'function') { - value = cb(value) - } - return prefix + value - }) - m = $3 + $4 - } else if ($5) { - m = m.replace(/(src\s*=\s*)('[^']+'|"[^"]+"|[^\s\/>]+)/ig, function (m, prefix, value) { - if (typeof cb === 'function') { - value = cb(value) - } - return prefix + value - }) - } else if ($6) { - $6 = $6.replace(/(\ssrc\s*=\s*)('[^']+'|"[^"]+"|[^\s\/>]+)/ig, function (m, prefix, value) { - if (typeof cb === 'function') { - value = cb(value) - } - return prefix + value - }) - m = $6 + $7 - } - return m - }) - return contents -} - export function resolveStylePath (p: string): string { const realPath = p const removeExtPath = p.replace(path.extname(p), '') @@ -289,30 +198,6 @@ export function resolveStylePath (p: string): string { return realPath } -export function isDifferentArray (a: any[], b: any[]): boolean { - if (!Array.isArray(a) || !Array.isArray(b)) { - return true - } - if (a.length !== b.length) { - return true - } - a = a.sort() - b = b.sort() - for (let i = 0; i < a.length; i++) { - if (a[i] !== b[i]) { - return true - } - } - return false -} - -export function checksum (buf: Buffer | string, length?): string { - if (!Buffer.isBuffer(buf)) { - buf = Buffer.from(buf) - } - return crypto.createHash('md5').update(buf).digest('hex').slice(0, length || 8) -} - export function printLog (type: processTypeEnum, tag: string, filePath?: string) { const typeShow = processTypeMap[type] const tagLen = tag.replace(/[\u0391-\uFFE5]/g, 'aa').length @@ -330,17 +215,6 @@ export function printLog (type: processTypeEnum, tag: string, filePath?: string) } } -export function replaceContentEnv (content: string, env: object): string { - if (env && !isEmptyObject(env)) { - for (const key in env) { - const reg = new RegExp(`process.env.${key}`, 'g') - content = content.replace(reg, env[key]) - } - return content - } - return content -} - export function generateEnvList (env: object): object { const res = { } if (env && !isEmptyObject(env)) { @@ -355,17 +229,6 @@ export function generateEnvList (env: object): object { return res } -export function replaceContentConstants (content: string, constants: object): string { - if (constants && !isEmptyObject(constants)) { - for (const key in constants) { - const reg = new RegExp(key, 'g') - content = content.replace(reg, constants[key]) - } - return content - } - return content -} - export function generateConstantsList (constants: object): object { const res = { } if (constants && !isEmptyObject(constants)) { @@ -503,105 +366,6 @@ export function getInstalledNpmPkgVersion (pkgName: string, basedir: string): st return fs.readJSONSync(pkgPath).version } -export function traverseObjectNode (node, buildAdapter: string, parentKey?: string) { - if (node.type === 'ClassProperty' || node.type === 'ObjectProperty') { - const properties = node.value.properties - const obj = {} - properties.forEach(p => { - let key = t.isIdentifier(p.key) ? p.key.name : p.key.value - if (CONFIG_MAP[buildAdapter][key] === false) { - return - } - if (parentKey !== 'usingComponents' && CONFIG_MAP[buildAdapter][key]) { - key = CONFIG_MAP[buildAdapter][key] - } - obj[key] = traverseObjectNode(p.value, buildAdapter, key) - }) - return obj - } - if (node.type === 'ObjectExpression') { - const properties = node.properties - const obj= {} - properties.forEach(p => { - let key = t.isIdentifier(p.key) ? p.key.name : p.key.value - if (CONFIG_MAP[buildAdapter][key] === false) { - return - } - if (parentKey !== 'usingComponents' && CONFIG_MAP[buildAdapter][key]) { - key = CONFIG_MAP[buildAdapter][key] - } - obj[key] = traverseObjectNode(p.value, buildAdapter, key) - }) - return obj - } - if (node.type === 'ArrayExpression') { - return node.elements.map(item => traverseObjectNode(item, buildAdapter)) - } - if (node.type === 'NullLiteral') { - return null - } - return node.value -} - -export function copyFileSync (from: string, to: string, options?: ICopyArgOptions) { - const filename = path.basename(from) - if (fs.statSync(from).isFile() && !path.extname(to)) { - fs.ensureDirSync(to) - if (from === path.join(to, filename)) { - return - } - return fs.copySync(from, path.join(to, filename), options) - } - if (from === to) { - return - } - fs.ensureDirSync(path.dirname(to)) - return fs.copySync(from, to, options) -} - -export function copyFiles (appPath: string, copyConfig: ICopyOptions | void) { - copyConfig = copyConfig || { patterns: [], options: {} } - if (copyConfig.patterns && copyConfig.patterns.length) { - copyConfig.options = copyConfig.options || {} - const globalIgnore = copyConfig.options.ignore - const projectDir = appPath - copyConfig.patterns.forEach(pattern => { - if (pattern.from && pattern.to) { - const from = path.join(projectDir, pattern.from) - const to = path.join(projectDir, pattern.to) - let ignore = pattern.ignore || globalIgnore - if (fs.existsSync(from)) { - const copyOptions: ICopyArgOptions = {} - if (ignore) { - ignore = Array.isArray(ignore) ? ignore : [ignore] - copyOptions.filter = src => { - let isMatch = false - ignore && ignore.forEach(iPa => { - if (minimatch(path.basename(src), iPa)) { - isMatch = true - } - }) - return !isMatch - } - } - copyFileSync(from, to, copyOptions) - if (pattern.watch) { - const watcher = chokidar.watch(from,{ - persistent: true, - ignoreInitial: true - }) - watcher.on('change',(res) => { - copyFileSync(from, to, copyOptions); - }) - } - } else { - printLog(processTypeEnum.ERROR, '拷贝失败', `${pattern.from} 文件不存在!`) - } - } - }) - } -} - export function isQuickappPkg (name: string, quickappPkgs: any[] = []): boolean { const isQuickappPkg = /^@(system|service)\.[a-zA-Z]{1,}/.test(name) let hasSetInManifest = false @@ -616,42 +380,6 @@ export function isQuickappPkg (name: string, quickappPkgs: any[] = []): boolean return isQuickappPkg } -export function generateQuickAppUx ({ - script, - template, - style, - imports -}: { - script?: string, - template?: string, - style?: string, - imports?: Set<{ - path: string, - name: string - }> -}) { - let uxTxt = '' - if (imports && imports.size) { - imports.forEach(item => { - uxTxt += `\n` - }) - } - if (style) { - if (REG_STYLE.test(style)) { - uxTxt += `\n` - } else { - uxTxt += `\n` - } - } - if (template) { - uxTxt += `\n` - } - if (script) { - uxTxt += `\n` - } - return uxTxt -} - export const recursiveMerge = (src, ...args) => { return mergeWith(src, ...args, (value, srcValue, key, obj, source) => { const typeValue = typeof value @@ -765,21 +493,6 @@ export function getBabelConfig (babel) { return babelConfig } -export function uglifyJS (resCode: string, filePath: string, root: string, uglify: TogglableOptions): string { - const uglifyPluginConfig = uglify || { enable: true } - if (uglifyPluginConfig.enable) { - const uglifyConfig = Object.assign(defaultUglifyConfig, uglifyPluginConfig.config || {}) - const uglifyResult = callPluginSync('uglifyjs', resCode, filePath, uglifyConfig, root) - if (uglifyResult.error) { - printLog(processTypeEnum.ERROR, '压缩错误', `文件${filePath}`) - console.log(uglifyResult.error) - return resCode - } - return uglifyResult.code - } - return resCode -} - export const getAllFilesInFloder = async ( floder: string, filter: string[] = [] From 4597d1a58dcf684171bf8202bc2549f2ab688fd2 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 22 Oct 2019 11:34:19 +0800 Subject: [PATCH 064/194] =?UTF-8?q?fix(mini-runner):=20=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=BC=96=E8=AF=91=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/package.json | 6 +- .../src/plugins/MiniPlugin.ts | 6 +- .../taro-mini-runner/src/utils/constants.ts | 70 +++++++++++++++++++ packages/taro-mini-runner/src/utils/index.ts | 27 ++++++- 4 files changed, 103 insertions(+), 6 deletions(-) diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index fbea11f745fb..8c2d7d4474eb 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "1.3.19", + "version": "1.3.21", "description": "Mini app runner for taro", "main": "index.js", "scripts": { @@ -32,8 +32,8 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/taro": "1.3.19", - "@tarojs/transformer-wx": "1.3.19", + "@tarojs/taro": "1.3.21", + "@tarojs/transformer-wx": "1.3.21", "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 0a9d79daf368..d2e49d3f1dbc 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -15,9 +15,9 @@ import traverse from 'babel-traverse' import { Config as IConfig, PageConfig } from '@tarojs/taro' import * as _ from 'lodash' -import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP, taroJsFramework, REG_SCRIPTS } from '../utils/constants' +import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP, taroJsFramework, REG_SCRIPTS, processTypeEnum } from '../utils/constants' import { IComponentObj } from '../utils/types' -import { resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync, isEmptyObject, promoteRelativePath } from '../utils' +import { resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync, isEmptyObject, promoteRelativePath, printLog } from '../utils' import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency' import { getTaroJsQuickAppComponentsPath, generateQuickAppUx, getImportTaroSelfComponents, generateQuickAppManifest } from '../utils/helper' import parseAst from '../utils/parseAst' @@ -401,6 +401,7 @@ export default class MiniPlugin { if (!appPages || appPages.length === 0) { throw new Error('缺少页面') } + printLog(processTypeEnum.COMPILE, '发现入口', appEntry) this.getSubPackages(configObj) this.generateTabBarFiles(compiler, configObj) const template = '' @@ -618,6 +619,7 @@ export default class MiniPlugin { imports: new Set([...importTaroSelfComponents, ...importUsingComponent, ...importCustomComponents]) }) } + printLog(processTypeEnum.COMPILE, isRoot ? '发现页面' : '发现组件', file.path) taroFileTypeMap[file.path] = { type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, config: merge({}, isComponentConfig, buildUsingComponents(file.path, this.sourceDir, {}, depComponents), configObj), diff --git a/packages/taro-mini-runner/src/utils/constants.ts b/packages/taro-mini-runner/src/utils/constants.ts index 093d1ef4e43b..2e4e927ed598 100644 --- a/packages/taro-mini-runner/src/utils/constants.ts +++ b/packages/taro-mini-runner/src/utils/constants.ts @@ -1,5 +1,7 @@ import * as os from 'os' +import chalk, { Chalk } from 'chalk' + export const CSS_EXT: string[] = ['.css', '.scss', '.sass', '.less', '.styl', '.wxss', '.acss'] export const SCSS_EXT: string[] = ['.scss'] export const JS_EXT: string[] = ['.js', '.jsx'] @@ -232,3 +234,71 @@ export enum PARSE_AST_TYPE { NORMAL = 'NORMAL', STATIC = 'STATIC' } + +export const enum processTypeEnum { + START = 'start', + CREATE = 'create', + COMPILE = 'compile', + CONVERT = 'convert', + COPY = 'copy', + GENERATE = 'generate', + MODIFY = 'modify', + ERROR = 'error', + WARNING = 'warning', + UNLINK = 'unlink', + REFERENCE = 'reference' +} + +export interface IProcessTypeMap { + [key: string] : { + name: string, + color: string | Chalk + } +} + +export const processTypeMap: IProcessTypeMap = { + [processTypeEnum.CREATE]: { + name: '创建', + color: 'cyan' + }, + [processTypeEnum.COMPILE]: { + name: '编译', + color: 'green' + }, + [processTypeEnum.CONVERT]: { + name: '转换', + color: chalk.rgb(255, 136, 0) + }, + [processTypeEnum.COPY]: { + name: '拷贝', + color: 'magenta' + }, + [processTypeEnum.GENERATE]: { + name: '生成', + color: 'blue' + }, + [processTypeEnum.MODIFY]: { + name: '修改', + color: 'yellow' + }, + [processTypeEnum.ERROR]: { + name: '错误', + color: 'red' + }, + [processTypeEnum.WARNING]: { + name: '警告', + color: 'yellowBright' + }, + [processTypeEnum.UNLINK]: { + name: '删除', + color: 'magenta' + }, + [processTypeEnum.START]: { + name: '启动', + color: 'green' + }, + [processTypeEnum.REFERENCE]: { + name: '引用', + color: 'blue' + } +} diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index 2f87f917f1ee..5680876036f7 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -4,8 +4,16 @@ import * as fs from 'fs-extra' import * as resolvePath from 'resolve' import * as t from 'babel-types' import { mergeWith } from 'lodash' +import chalk from 'chalk' -import { CONFIG_MAP, JS_EXT, TS_EXT, NODE_MODULES_REG } from './constants' +import { + CONFIG_MAP, + JS_EXT, + TS_EXT, + NODE_MODULES_REG, + processTypeMap, + processTypeEnum +} from './constants' import { IOption, IComponentObj } from './types' export const isNodeModule = (filename: string) => NODE_MODULES_REG.test(filename) @@ -211,3 +219,20 @@ export function getInstalledNpmPkgPath (pkgName: string, basedir: string): strin return null } } + +export function printLog (type: processTypeEnum, tag: string, filePath?: string) { + const typeShow = processTypeMap[type] + const tagLen = tag.replace(/[\u0391-\uFFE5]/g, 'aa').length + const tagFormatLen = 8 + if (tagLen < tagFormatLen) { + const rightPadding = new Array(tagFormatLen - tagLen + 1).join(' ') + tag += rightPadding + } + const padding = '' + filePath = filePath || '' + if (typeof typeShow.color === 'string') { + console.log(chalk[typeShow.color](typeShow.name), padding, tag, padding, filePath) + } else { + console.log(typeShow.color(typeShow.name), padding, tag, padding, filePath) + } +} From 121ba146305d2fa70b17a5b231b970363cce3038 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 22 Oct 2019 15:27:59 +0800 Subject: [PATCH 065/194] =?UTF-8?q?fix(cli):=20=E4=BF=AE=E5=A4=8D=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E4=B8=AD=E8=AF=BB=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=20process.env.TARO=5FENV=20=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/bin/taro-build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/taro-cli/bin/taro-build b/packages/taro-cli/bin/taro-build index e44bfb287db8..e08cc1e56841 100755 --- a/packages/taro-cli/bin/taro-build +++ b/packages/taro-cli/bin/taro-build @@ -37,6 +37,8 @@ if (env) { process.env.NODE_ENV = 'production' } } +process.env.TARO_ENV = type + const builder = new Builder(appPath) if (ui) { @@ -66,8 +68,6 @@ if (!fs.existsSync(projectConfPath)) { process.exit(1) } -process.env.TARO_ENV = type - const projectConf = require(projectConfPath)(_.merge) if (typeof page === 'string') { console.log(chalk.green(`开始编译页面 ${chalk.bold(page)}`)) From 3f1aa7df058cfa442dd6daf3a180a228b2547e83 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 22 Oct 2019 16:04:45 +0800 Subject: [PATCH 066/194] =?UTF-8?q?fix(taro-quickapp):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=BF=AB=E5=BA=94=E7=94=A8=E4=BA=8B=E4=BB=B6=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-quickapp/src/create-component.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/taro-quickapp/src/create-component.js b/packages/taro-quickapp/src/create-component.js index 509169036014..8465cb11f424 100644 --- a/packages/taro-quickapp/src/create-component.js +++ b/packages/taro-quickapp/src/create-component.js @@ -102,14 +102,18 @@ function processEvent (eventHandlerName, obj) { get () { return Object.assign(currentTarget || target || {}, event.detail) } - }, - stopPropagation: { - value: () => {} - }, - preventDefault: { - value: () => {} } }) + if (!event.stopPropagation) { + Object.defineProperty(event, 'stopPropagation', { + value: () => {} + }) + } + if (!event.preventDefault) { + Object.defineProperty(event, 'preventDefault', { + value: () => {} + }) + } } const scope = this.$component From 42eb4c47d816c83729e978fa83a7abe92e2ebefa Mon Sep 17 00:00:00 2001 From: ZakaryCode Date: Tue, 22 Oct 2019 16:26:20 +0800 Subject: [PATCH 067/194] fix: position linter for quickapp 1060+ --- .../src/quickapp/style/declaration/position/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/taro-mini-runner/src/quickapp/style/declaration/position/index.ts b/packages/taro-mini-runner/src/quickapp/style/declaration/position/index.ts index cfde8621812d..d195fa0e6cdd 100644 --- a/packages/taro-mini-runner/src/quickapp/style/declaration/position/index.ts +++ b/packages/taro-mini-runner/src/quickapp/style/declaration/position/index.ts @@ -30,8 +30,9 @@ export default { 'position': (value, declaration, addDeclaration) => { if (value === 'static') { declaration.value = 'none' - } else if (value === 'absolute') { - return 'E:' + } else if (value === 'absolute' || value === 'relative') { + // https://doc.quickapp.cn/widgets/common-styles.html?h=position + return '' // E: } else if (value !== 'fixed') { return 'I:' } From 55c4bed4128948809ada932fc95ddd07ad0d3fe4 Mon Sep 17 00:00:00 2001 From: Garfield Lee Date: Tue, 22 Oct 2019 16:59:12 +0800 Subject: [PATCH 068/194] =?UTF-8?q?chore(taro):=20=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89=E6=96=87=E4=BB=B6=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TypeScript 里 .ts 文件可以包含代码实现和类型定义,而 .d.ts 文件只可包含类型定义。 --- packages/taro/types/{compile.ts => compile.d.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/taro/types/{compile.ts => compile.d.ts} (100%) diff --git a/packages/taro/types/compile.ts b/packages/taro/types/compile.d.ts similarity index 100% rename from packages/taro/types/compile.ts rename to packages/taro/types/compile.d.ts From de5dc7b92e7302d3e431ea1f40f820b33d4fb0f2 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 22 Oct 2019 20:39:10 +0800 Subject: [PATCH 069/194] =?UTF-8?q?fix(mini-runner):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=BF=AB=E5=BA=94=E7=94=A8=E7=BC=96=E8=AF=91=E5=90=8E=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=87=E9=A2=98=E5=B1=95=E7=A4=BA=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/package.json | 1 + packages/taro-mini-runner/src/utils/helper.ts | 8 +- packages/taro-mini-runner/src/utils/index.ts | 4 + packages/taro-mini-runner/yarn.lock | 506 ++++++++++-------- 4 files changed, 281 insertions(+), 238 deletions(-) diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index 8c2d7d4474eb..1e5bbf91bc8f 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -50,6 +50,7 @@ "css-what": "3.2.0", "file-loader": "^4.0.0", "fs-extra": "^8.0.1", + "less": "^3.10.3", "less-loader": "^5.0.0", "loader-utils": "^1.2.3", "lodash": "^4.17.11", diff --git a/packages/taro-mini-runner/src/utils/helper.ts b/packages/taro-mini-runner/src/utils/helper.ts index f1375d7f2b9a..3f08ae8e39a4 100644 --- a/packages/taro-mini-runner/src/utils/helper.ts +++ b/packages/taro-mini-runner/src/utils/helper.ts @@ -1,7 +1,7 @@ import * as path from 'path' import * as _ from 'lodash' -import { getInstalledNpmPkgPath, promoteRelativePath } from '.' +import { getInstalledNpmPkgPath, promoteRelativePath, removeHeadSlash } from '.' import { taroJsQuickAppComponents, REG_STYLE, REG_SCRIPT } from './constants' export function getTaroJsQuickAppComponentsPath (nodeModulesPath: string): string { @@ -94,12 +94,12 @@ export function generateQuickAppManifest ({ pageConf.launchMode = launchMode } } - routerPages[path.dirname(element)] = pageConf + routerPages[removeHeadSlash(path.dirname(element))] = pageConf }) delete quickappJSON.customPageConfig const routerEntry = pages.shift() const router = { - entry: path.dirname(routerEntry as string), + entry: removeHeadSlash(path.dirname(routerEntry as string)), pages: routerPages } // 生成 display @@ -107,7 +107,7 @@ export function generateQuickAppManifest ({ display.pages = {} pageConfigs.forEach((item, page) => { if (item) { - display.pages[path.dirname(page)] = item + display.pages[removeHeadSlash(path.dirname(page))] = item } }) quickappJSON.router = router diff --git a/packages/taro-mini-runner/src/utils/index.ts b/packages/taro-mini-runner/src/utils/index.ts index 5680876036f7..92027e71c320 100644 --- a/packages/taro-mini-runner/src/utils/index.ts +++ b/packages/taro-mini-runner/src/utils/index.ts @@ -236,3 +236,7 @@ export function printLog (type: processTypeEnum, tag: string, filePath?: string) console.log(typeShow.color(typeShow.name), padding, tag, padding, filePath) } } + +export function removeHeadSlash (str: string) { + return str.replace(/^(\/|\\)/, '') +} diff --git a/packages/taro-mini-runner/yarn.lock b/packages/taro-mini-runner/yarn.lock index b5d99f892ca8..a53083a5ffe4 100644 --- a/packages/taro-mini-runner/yarn.lock +++ b/packages/taro-mini-runner/yarn.lock @@ -336,13 +336,15 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^12.0.9" -"@tarojs/taro@1.3.0-beta.2": - version "1.3.0-beta.2" - resolved "https://registry.npmjs.org/@tarojs/taro/-/taro-1.3.0-beta.2.tgz#3b681fc99b768b5248c2ac1505744909a654450b" +"@tarojs/taro@1.3.21": + version "1.3.21" + resolved "https://registry.npmjs.org/@tarojs/taro/-/taro-1.3.21.tgz#c69c5b6466e09412261ea83d10e5563f72c77902" + dependencies: + "@tarojs/utils" "1.3.21" -"@tarojs/transformer-wx@1.3.0-beta.2": - version "1.3.0-beta.2" - resolved "https://registry.npmjs.org/@tarojs/transformer-wx/-/transformer-wx-1.3.0-beta.2.tgz#a9ab0ec859c397ffce2f49778b8b8c717dc5b3af" +"@tarojs/transformer-wx@1.3.21": + version "1.3.21" + resolved "https://registry.npmjs.org/@tarojs/transformer-wx/-/transformer-wx-1.3.21.tgz#606a8b3c215e2dcf6c7c6247460c3648b3bd113b" dependencies: "@babel/code-frame" "^7.0.0-beta.44" babel-core "^6.26.3" @@ -351,8 +353,7 @@ babel-helper-mark-eval-scopes "^0.4.3" babel-helper-remove-or-void "^0.4.3" babel-plugin-danger-remove-unused-import "^1.1.1" - babel-plugin-minify-dead-code "^0.5.2" - babel-plugin-remove-dead-code "^1.3.2" + babel-plugin-minify-dead-code "^1.3.2" babel-plugin-syntax-dynamic-import "^6.18.0" babel-plugin-transform-class-properties "^6.24.1" babel-plugin-transform-define "^1.3.0" @@ -362,14 +363,18 @@ babel-plugin-transform-flow-strip-types "^6.22.0" babel-traverse "^6.26.0" babel-types "^6.26.0" - eslint "^4.15.0" + eslint "5.16.0" eslint-plugin-react "7.10.0" - eslint-plugin-taro "1.3.0-beta.2" + eslint-plugin-taro "1.3.21" html "^1.0.0" lodash "^4.17.5" prettier "^1.14.2" typescript "^3.2.2" +"@tarojs/utils@1.3.21": + version "1.3.21" + resolved "https://registry.npmjs.org/@tarojs/utils/-/utils-1.3.21.tgz#56b5820a14ffd70c4e0b2364799e26f10392b889" + "@types/anymatch@*": version "1.3.1" resolved "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" @@ -657,21 +662,15 @@ acorn-globals@^4.1.0: acorn "^6.0.1" acorn-walk "^6.0.1" -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - dependencies: - acorn "^3.0.4" +acorn-jsx@^5.0.0: + version "5.1.0" + resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" acorn-walk@^6.0.1: version "6.1.1" resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - -acorn@^5.5.0, acorn@^5.5.3: +acorn@^5.5.3: version "5.7.3" resolved "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" @@ -679,27 +678,18 @@ acorn@^6.0.1, acorn@^6.0.5: version "6.1.1" resolved "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" +acorn@^6.0.7: + version "6.3.0" + resolved "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz#0087509119ffa4fc0a0041d1e93a417e68cb856e" + ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" -ajv-keywords@^2.1.0: - version "2.1.1" - resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" - ajv-keywords@^3.1.0: version "3.4.0" resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.0.tgz#4b831e7b531415a7cc518cd404e73f6193c6349d" -ajv@^5.2.3, ajv@^5.3.0: - version "5.5.2" - resolved "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - ajv@^6.1.0, ajv@^6.5.5: version "6.10.0" resolved "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" @@ -709,6 +699,15 @@ ajv@^6.1.0, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^6.10.2, ajv@^6.9.1: + version "6.10.2" + resolved "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" @@ -717,7 +716,7 @@ ansi-colors@^3.0.0: version "3.2.4" resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" -ansi-escapes@^3.0.0: +ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" @@ -820,6 +819,10 @@ array-unique@^0.3.2: version "0.3.2" resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" +asap@~2.0.3: + version "2.0.6" + resolved "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" @@ -887,7 +890,7 @@ aws4@^1.8.0: version "1.8.0" resolved "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" -babel-code-frame@^6.22.0, babel-code-frame@^6.26.0, babel-code-frame@^6.8.0: +babel-code-frame@^6.26.0, babel-code-frame@^6.8.0: version "6.26.0" resolved "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: @@ -969,10 +972,6 @@ babel-generator@^6.26.0, babel-generator@^6.26.1, babel-generator@^6.9.0: source-map "^0.5.7" trim-right "^1.0.1" -babel-helper-evaluate-path@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.3.0.tgz#2439545e0b6eae5b7f49b790acbebd6b9a73df20" - babel-helper-evaluate-path@^0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz#a62fa9c4e64ff7ea5cea9353174ef023a900a67c" @@ -994,18 +993,10 @@ babel-helper-get-function-arity@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-helper-mark-eval-scopes@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.3.0.tgz#b4731314fdd7a89091271a5213b4e12d236e29e8" - babel-helper-mark-eval-scopes@^0.4.3: version "0.4.3" resolved "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz#d244a3bef9844872603ffb46e22ce8acdf551562" -babel-helper-remove-or-void@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.3.0.tgz#f43c86147c8fcc395a9528cbb31e7ff49d7e16e3" - babel-helper-remove-or-void@^0.4.3: version "0.4.3" resolved "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz#a4f03b40077a0ffe88e45d07010dee241ff5ae60" @@ -1062,18 +1053,9 @@ babel-plugin-jest-hoist@^24.6.0: dependencies: "@types/babel__traverse" "^7.0.6" -babel-plugin-minify-dead-code@^0.5.2: - version "0.5.2" - resolved "https://registry.npmjs.org/babel-plugin-minify-dead-code/-/babel-plugin-minify-dead-code-0.5.2.tgz#8babe8e5ef7c8a4a55bbe2e40f2f22db3ef4b1ad" - dependencies: - babel-helper-evaluate-path "^0.3.0" - babel-helper-mark-eval-scopes "^0.3.0" - babel-helper-remove-or-void "^0.3.0" - lodash.some "^4.6.0" - -babel-plugin-remove-dead-code@^1.3.2: +babel-plugin-minify-dead-code@^1.3.2: version "1.3.2" - resolved "https://registry.npmjs.org/babel-plugin-remove-dead-code/-/babel-plugin-remove-dead-code-1.3.2.tgz#e1a2cd9595bb2f767291f35cab4ec9b467ee62c6" + resolved "https://registry.npmjs.org/babel-plugin-minify-dead-code/-/babel-plugin-minify-dead-code-1.3.2.tgz#7cd45c95c52700f00680a37377e00accad45b188" dependencies: babel-core "6.10.4" @@ -1373,6 +1355,10 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" +buffer-crc32@~0.2.3: + version "0.2.13" + resolved "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + buffer-from@1.x, buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" @@ -1451,22 +1437,12 @@ caller-callsite@^2.0.0: dependencies: callsites "^2.0.0" -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - dependencies: - callsites "^0.2.0" - caller-path@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" dependencies: caller-callsite "^2.0.0" -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - callsites@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" @@ -1526,9 +1502,9 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chardet@^0.4.0: - version "0.4.2" - resolved "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" chokidar@^2.0.2: version "2.1.5" @@ -1569,10 +1545,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - class-utils@^0.3.5: version "0.3.6" resolved "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -1625,7 +1597,7 @@ clone@^1.0.2: version "1.0.4" resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" -clone@^2.1.1: +clone@^2.1.1, clone@^2.1.2: version "2.1.2" resolved "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" @@ -1676,7 +1648,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.4.7, concat-stream@^1.5.0, concat-stream@^1.6.0: +concat-stream@^1.4.7, concat-stream@^1.5.0: version "1.6.2" resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" dependencies: @@ -1789,14 +1761,6 @@ cross-spawn@^3.0.0: lru-cache "^4.0.1" which "^1.2.9" -cross-spawn@^5.1.0: - version "5.1.0" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -1847,6 +1811,19 @@ css-tree@1.0.0-alpha.29: mdn-data "~1.1.0" source-map "^0.5.3" +css-what@3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/css-what/-/css-what-3.2.0.tgz#0ce44ada45f97bcbbec450563a23ef04ee2572ef" + +css@2.2.4: + version "2.2.4" + resolved "https://registry.npmjs.org/css/-/css-2.2.4.tgz#c646755c73971f2bba6a601e2cf2fd71b1298929" + dependencies: + inherits "^2.0.3" + source-map "^0.6.1" + source-map-resolve "^0.5.2" + urix "^0.1.0" + cssesc@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" @@ -1916,7 +1893,7 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.1.1: +debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" dependencies: @@ -2026,6 +2003,12 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + dependencies: + esutils "^2.0.2" + domain-browser@^1.1.1: version "1.2.0" resolved "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" @@ -2064,6 +2047,10 @@ elliptic@^6.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.0" +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" @@ -2082,7 +2069,7 @@ enhanced-resolve@^4.1.0: memory-fs "^0.4.0" tapable "^1.0.0" -errno@^0.1.3, errno@~0.1.7: +errno@^0.1.1, errno@^0.1.3, errno@~0.1.7: version "0.1.7" resolved "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" dependencies: @@ -2137,9 +2124,9 @@ eslint-plugin-react@7.10.0: jsx-ast-utils "^2.0.1" prop-types "^15.6.2" -eslint-plugin-taro@1.3.0-beta.2: - version "1.3.0-beta.2" - resolved "https://registry.npmjs.org/eslint-plugin-taro/-/eslint-plugin-taro-1.3.0-beta.2.tgz#e9a7c6bf29ef670305522bb61db35015b828d2d1" +eslint-plugin-taro@1.3.21: + version "1.3.21" + resolved "https://registry.npmjs.org/eslint-plugin-taro/-/eslint-plugin-taro-1.3.21.tgz#ebed0f4450318dd474f179f6ba5dce47822bd0da" dependencies: has "^1.0.1" @@ -2150,73 +2137,75 @@ eslint-scope@3.7.1: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-scope@^3.7.1: - version "3.7.3" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535" - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-scope@^4.0.0: +eslint-scope@^4.0.0, eslint-scope@^4.0.3: version "4.0.3" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-utils@^1.3.1: + version "1.4.3" + resolved "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + dependencies: + eslint-visitor-keys "^1.1.0" + eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" -eslint@^4.15.0: - version "4.19.1" - resolved "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" +eslint-visitor-keys@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" + +eslint@5.16.0: + version "5.16.0" + resolved "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" dependencies: - ajv "^5.3.0" - babel-code-frame "^6.22.0" + "@babel/code-frame" "^7.0.0" + ajv "^6.9.1" chalk "^2.1.0" - concat-stream "^1.6.0" - cross-spawn "^5.1.0" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^3.7.1" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" + eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" - espree "^3.5.4" - esquery "^1.0.0" + espree "^5.0.1" + esquery "^1.0.1" esutils "^2.0.2" - file-entry-cache "^2.0.0" + file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" glob "^7.1.2" - globals "^11.0.1" - ignore "^3.3.3" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^3.0.6" - is-resolvable "^1.0.0" - js-yaml "^3.9.1" + inquirer "^6.2.2" + js-yaml "^3.13.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.4" - minimatch "^3.0.2" + lodash "^4.17.11" + minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" path-is-inside "^1.0.2" - pluralize "^7.0.0" progress "^2.0.0" - regexpp "^1.0.1" - require-uncached "^1.0.3" - semver "^5.3.0" + regexpp "^2.0.1" + semver "^5.5.1" strip-ansi "^4.0.0" - strip-json-comments "~2.0.1" - table "4.0.2" - text-table "~0.2.0" + strip-json-comments "^2.0.1" + table "^5.2.3" + text-table "^0.2.0" -espree@^3.5.4: - version "3.5.4" - resolved "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" dependencies: - acorn "^5.5.0" - acorn-jsx "^3.0.0" + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" esprima@^3.1.3: version "3.1.3" @@ -2226,7 +2215,7 @@ esprima@^4.0.0: version "4.0.1" resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" -esquery@^1.0.0: +esquery@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" dependencies: @@ -2317,12 +2306,12 @@ extend@~3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" -external-editor@^2.0.4: - version "2.2.0" - resolved "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" +external-editor@^3.0.3: + version "3.1.0" + resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" dependencies: - chardet "^0.4.0" - iconv-lite "^0.4.17" + chardet "^0.7.0" + iconv-lite "^0.4.24" tmp "^0.0.33" extglob@^2.0.4: @@ -2346,10 +2335,6 @@ extsprintf@^1.2.0: version "1.4.0" resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" @@ -2368,6 +2353,12 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" +fd-slicer@~1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" + dependencies: + pend "~1.2.0" + figgy-pudding@^3.5.1: version "3.5.1" resolved "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" @@ -2378,12 +2369,11 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" + flat-cache "^2.0.1" file-loader@^4.0.0: version "4.0.0" @@ -2422,14 +2412,17 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -flat-cache@^1.2.1: - version "1.3.4" - resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f" +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" dependencies: - circular-json "^0.3.1" - graceful-fs "^4.1.2" - rimraf "~2.6.2" - write "^0.2.1" + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flatted@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" flush-write-stream@^1.0.0: version "1.1.1" @@ -2589,7 +2582,7 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, gl once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.0.1, globals@^11.1.0: +globals@^11.1.0, globals@^11.7.0: version "11.12.0" resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" @@ -2757,7 +2750,7 @@ https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" -iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.4: +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: version "0.4.24" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" dependencies: @@ -2783,10 +2776,18 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^3.3.3, ignore@^3.3.5: +ignore@^3.3.5: version "3.3.10" resolved "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + +image-size@~0.5.0: + version "0.5.5" + resolved "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c" + import-cwd@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" @@ -2800,6 +2801,13 @@ import-fresh@^2.0.0: caller-path "^2.0.0" resolve-from "^3.0.0" +import-fresh@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz#6d33fa1dcef6df930fae003446f33415af905118" + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-from@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" @@ -2854,23 +2862,22 @@ ini@~1.3.0: version "1.3.5" resolved "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" -inquirer@^3.0.6: - version "3.3.0" - resolved "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" +inquirer@^6.2.2: + version "6.5.2" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.0" + ansi-escapes "^3.2.0" + chalk "^2.4.2" cli-cursor "^2.1.0" cli-width "^2.0.0" - external-editor "^2.0.4" + external-editor "^3.0.3" figures "^2.0.0" - lodash "^4.3.0" + lodash "^4.17.12" mute-stream "0.0.7" run-async "^2.2.0" - rx-lite "^4.0.8" - rx-lite-aggregates "^4.0.8" + rxjs "^6.4.0" string-width "^2.1.0" - strip-ansi "^4.0.0" + strip-ansi "^5.1.0" through "^2.3.6" invariant@^2.2.0, invariant@^2.2.2, invariant@^2.2.4: @@ -3031,10 +3038,6 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" -is-resolvable@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" - is-stream@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -3123,9 +3126,9 @@ istanbul-reports@^2.1.1: dependencies: handlebars "^4.1.2" -javascript-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.0.0.tgz#ef750216ae66504ffd670b68c8b8aa07bdf7b588" +javascript-stringify@^1.6.0: + version "1.6.0" + resolved "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-1.6.0.tgz#142d111f3a6e3dae8f4a9afd77d45855b5a9cce3" jest-changed-files@^24.8.0: version "24.8.0" @@ -3463,7 +3466,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" -js-yaml@^3.13.1, js-yaml@^3.9.1: +js-yaml@^3.13.0, js-yaml@^3.13.1: version "3.13.1" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" dependencies: @@ -3517,10 +3520,6 @@ json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -3630,6 +3629,21 @@ less-loader@^5.0.0: loader-utils "^1.1.0" pify "^4.0.1" +less@^3.10.3: + version "3.10.3" + resolved "https://registry.npmjs.org/less/-/less-3.10.3.tgz#417a0975d5eeecc52cff4bcfa3c09d35781e6792" + dependencies: + clone "^2.1.2" + optionalDependencies: + errno "^0.1.1" + graceful-fs "^4.1.2" + image-size "~0.5.0" + mime "^1.4.1" + mkdirp "^0.5.0" + promise "^7.1.1" + request "^2.83.0" + source-map "~0.6.0" + leven@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -3683,10 +3697,6 @@ lodash.clonedeep@^4.5.0: version "4.5.0" resolved "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" -lodash.some@^4.6.0: - version "4.6.0" - resolved "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -3695,10 +3705,14 @@ lodash.tail@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/lodash.tail/-/lodash.tail-4.1.1.tgz#d2333a36d9e7717c8ad2f7cacafec7c32b444664" -lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.3.0, lodash@~4.17.10: +lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@~4.17.10: version "4.17.11" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" +lodash@^4.17.12, lodash@^4.17.14: + version "4.17.15" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + log-symbols@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" @@ -3859,6 +3873,10 @@ mime-types@^2.1.12, mime-types@~2.1.19: dependencies: mime-db "1.40.0" +mime@^1.4.1: + version "1.6.0" + resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + mime@^2.0.3: version "2.4.4" resolved "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" @@ -4373,6 +4391,12 @@ parallel-transform@^1.1.0: inherits "^2.0.3" readable-stream "^2.1.5" +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.4" resolved "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" @@ -4467,6 +4491,10 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" +pend@~1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -4509,10 +4537,6 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - pn@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" @@ -4658,6 +4682,12 @@ promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" +promise@^7.1.1: + version "7.3.1" + resolved "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" + dependencies: + asap "~2.0.3" + prompts@^2.0.1: version "2.0.4" resolved "https://registry.npmjs.org/prompts/-/prompts-2.0.4.tgz#179f9d4db3128b9933aa35f93a800d8fce76a682" @@ -4849,9 +4879,9 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpp@^1.0.1: - version "1.1.0" - resolved "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" remove-trailing-separator@^1.0.1: version "1.1.0" @@ -4885,7 +4915,7 @@ request-promise-native@^1.0.5: stealthy-require "^1.1.1" tough-cookie "^2.3.3" -request@^2.87.0, request@^2.88.0: +request@^2.83.0, request@^2.87.0, request@^2.88.0: version "2.88.0" resolved "https://registry.npmjs.org/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" dependencies: @@ -4922,27 +4952,20 @@ require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" -require-uncached@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" dependencies: resolve-from "^3.0.0" -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -4974,7 +4997,7 @@ ret@~0.1.10: version "0.1.15" resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" -rimraf@2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@~2.6.2: +rimraf@2, rimraf@2.6.3, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: version "2.6.3" resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" dependencies: @@ -5003,15 +5026,11 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" -rx-lite-aggregates@^4.0.8: - version "4.0.8" - resolved "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" +rxjs@^6.4.0: + version "6.5.3" + resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" dependencies: - rx-lite "*" - -rx-lite@*, rx-lite@^4.0.8: - version "4.0.8" - resolved "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + tslib "^1.9.0" safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" @@ -5084,6 +5103,10 @@ scss-tokenizer@^0.2.3: version "5.7.0" resolved "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" +semver@^5.5.1: + version "5.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + semver@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65" @@ -5176,10 +5199,12 @@ slash@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" -slice-ansi@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" snapdragon-node@^2.0.1: @@ -5219,7 +5244,7 @@ source-list-map@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" -source-map-resolve@^0.5.0: +source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: version "0.5.2" resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" dependencies: @@ -5256,7 +5281,7 @@ source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: version "0.6.1" resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -5387,6 +5412,14 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + string.prototype.padend@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" @@ -5419,7 +5452,7 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.0.0, strip-ansi@^5.2.0: +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: version "5.2.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" dependencies: @@ -5445,7 +5478,7 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@~2.0.1: +strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -5483,16 +5516,14 @@ symbol-tree@^3.2.2: version "3.2.2" resolved "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" -table@4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" +table@^5.2.3: + version "5.4.6" + resolved "https://registry.npmjs.org/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" dependencies: - ajv "^5.2.3" - ajv-keywords "^2.1.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" + ajv "^6.10.2" + lodash "^4.17.14" + slice-ansi "^2.1.0" + string-width "^3.0.0" tapable@^1.0.0, tapable@^1.1.0: version "1.1.3" @@ -5548,7 +5579,7 @@ test-exclude@^5.2.3: read-pkg-up "^4.0.0" require-main-filename "^2.0.0" -text-table@~0.2.0: +text-table@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -5880,12 +5911,12 @@ webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" -webpack-chain@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/webpack-chain/-/webpack-chain-6.0.0.tgz#9c36525a1271a54e7bfd1791199b395f400ae4f1" +webpack-chain@4.9.0: + version "4.9.0" + resolved "https://registry.npmjs.org/webpack-chain/-/webpack-chain-4.9.0.tgz#2f0794d34d79a7cc5db1416f497b76ad33df30ee" dependencies: deepmerge "^1.5.2" - javascript-stringify "^2.0.0" + javascript-stringify "^1.6.0" webpack-format-messages@^2.0.5: version "2.0.5" @@ -6019,9 +6050,9 @@ write-file-atomic@2.4.1: imurmurhash "^0.1.4" signal-exit "^3.0.2" -write@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" +write@1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" dependencies: mkdirp "^0.5.1" @@ -6108,3 +6139,10 @@ yargs@^7.0.0: which-module "^1.0.0" y18n "^3.2.1" yargs-parser "^5.0.0" + +yauzl@2.10.0: + version "2.10.0" + resolved "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" + dependencies: + buffer-crc32 "~0.2.3" + fd-slicer "~1.1.0" From 5a7638e9e980deaceb783b35c18b0cb23d4a9a57 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 22 Oct 2019 22:22:54 +0800 Subject: [PATCH 070/194] =?UTF-8?q?fix(taro):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=BF=AB=E5=BA=94=E7=94=A8=E4=B8=8B=E6=8B=89=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/taro-page/index.ux | 11 +++++++++-- packages/taro-mini-runner/src/utils/constants.ts | 1 - packages/taro-quickapp/src/api/interactive/index.js | 11 +++++------ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/taro-components-qa/src/components/taro-page/index.ux b/packages/taro-components-qa/src/components/taro-page/index.ux index 3bd31bcc8cb0..47a0b3e4f790 100644 --- a/packages/taro-components-qa/src/components/taro-page/index.ux +++ b/packages/taro-components-qa/src/components/taro-page/index.ux @@ -64,6 +64,13 @@ ` diff --git a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts index d93dc4cc1caf..e4e99d302f87 100644 --- a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts @@ -35,9 +35,9 @@ export default class TaroLoadChunksPlugin { compilation.chunkTemplate.hooks.renderWithEntry.tap(PLUGIN_NAME, (modules, chunk) => { if (chunk.entryModule) { if (this.isBuildPlugin) { - const id = chunk.id - return addRequireToSource(id, modules, commonChunks) - } else if (chunk.entryModule.miniType === PARSE_AST_TYPE.ENTRY) { + return addRequireToSource(getIdOrName(chunk), modules, commonChunks) + } + if (chunk.entryModule.miniType === PARSE_AST_TYPE.ENTRY) { compilation.hooks.afterOptimizeAssets.tap(PLUGIN_NAME, assets => { const files = chunk.files files.forEach(item => { @@ -56,13 +56,12 @@ export default class TaroLoadChunksPlugin { } }) }) - const name = chunk.name - return addRequireToSource(name, modules, commonChunks) - } else if ((this.buildAdapter === BUILD_TYPES.QUICKAPP) && + return addRequireToSource(getIdOrName(chunk), modules, commonChunks) + } + if ((this.buildAdapter === BUILD_TYPES.QUICKAPP) && (chunk.entryModule.miniType === PARSE_AST_TYPE.PAGE || chunk.entryModule.miniType === PARSE_AST_TYPE.COMPONENT)) { - const id = chunk.id - return addRequireToSource(id, modules, commonChunks) + return addRequireToSource(getIdOrName(chunk), modules, commonChunks) } } }) @@ -70,6 +69,13 @@ export default class TaroLoadChunksPlugin { } } +function getIdOrName (chunk) { + if (typeof chunk.id === 'string') { + return chunk.id + } + return chunk.name + } + function addRequireToSource (id, modules, commonChunks) { const source = new ConcatSource() commonChunks.forEach(chunkItem => { From b3b21bf4639982652fae0be30ddda2901d68149a Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 29 Oct 2019 10:53:01 +0800 Subject: [PATCH 080/194] =?UTF-8?q?fix(components-qa):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=A1=B5=E9=9D=A2=20onReachBottom=20=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E4=B8=8D=E8=A7=A6=E5=8F=91=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taro-components-qa/src/components/taro-page/index.ux | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/taro-components-qa/src/components/taro-page/index.ux b/packages/taro-components-qa/src/components/taro-page/index.ux index 47a0b3e4f790..064b7e34678f 100644 --- a/packages/taro-components-qa/src/components/taro-page/index.ux +++ b/packages/taro-components-qa/src/components/taro-page/index.ux @@ -90,6 +90,11 @@ type: Boolean, required: false, default: false + }, + enablepagescroll: { + type: Boolean, + required: false, + default: false } }, data () { From 1c2fa60a73fa4a6197dd970b0a03af15ed7d8130 Mon Sep 17 00:00:00 2001 From: ZakaryCode Date: Thu, 31 Oct 2019 10:37:39 +0800 Subject: [PATCH 081/194] fix(quickapp): pull-down-refresh page-scroll --- .../src/components/taro-page/index.ux | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/taro-components-qa/src/components/taro-page/index.ux b/packages/taro-components-qa/src/components/taro-page/index.ux index 064b7e34678f..88a363c7061f 100644 --- a/packages/taro-components-qa/src/components/taro-page/index.ux +++ b/packages/taro-components-qa/src/components/taro-page/index.ux @@ -98,7 +98,10 @@ } }, data () { - let showTabBar = false + const pageInstance = this.$app.pageInstaceMap[this.pagepath] + let showTabBar = false, + enablepulldownrefresh = false, + enablepagescroll = false if (this.tabbar && this.tabbar.list.length) { this.tabbar.list.forEach(item => { if (addLeadingSlash(item.pagePath) === addLeadingSlash(this.pagepath)) { @@ -106,8 +109,17 @@ } }) } + if (pageInstance) { + if (pageInstance.onPullDownRefresh) { + onPullDownRefresh = true + } else if (pageInstance.onPageScroll || pageInstance.onReachBottom) { + enablepagescroll = true + } + } return { showTabBar, + enablepulldownrefresh, + enablepagescroll, isPageRefreshing: false, tabBarData: {} } From dbc27c510c6207c89258810cb97a588ad00ee8b6 Mon Sep 17 00:00:00 2001 From: ZakaryCode Date: Thu, 31 Oct 2019 14:31:30 +0800 Subject: [PATCH 082/194] feat: stop trans asset for quickapp --- packages/taro-mini-runner/src/webpack/chain.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index b4852fa565d7..f7c2955c6f72 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -325,7 +325,8 @@ export const getModule = (appPath: string, { use: { urlLoader: getUrlLoader([defaultMediaUrlLoaderOption, { name: `${staticDirectory}/media/[name].[ext]`, - ...mediaUrlLoaderOption + ...mediaUrlLoaderOption, + limit: isQuickapp ? false : mediaUrlLoaderOption.limit }]) } }, @@ -334,7 +335,8 @@ export const getModule = (appPath: string, { use: { urlLoader: getUrlLoader([defaultFontUrlLoaderOption, { name: `${staticDirectory}/fonts/[name].[ext]`, - ...fontUrlLoaderOption + ...fontUrlLoaderOption, + limit: isQuickapp ? false : fontUrlLoaderOption.limit }]) } }, @@ -343,7 +345,8 @@ export const getModule = (appPath: string, { use: { urlLoader: getUrlLoader([defaultImageUrlLoaderOption, { name: `${staticDirectory}/images/[name].[ext]`, - ...imageUrlLoaderOption + ...imageUrlLoaderOption, + limit: isQuickapp ? false : imageUrlLoaderOption.limit }]) } } From 0598df60e407469de9ddae4907c2c99b97611b00 Mon Sep 17 00:00:00 2001 From: ZakaryCode Date: Thu, 31 Oct 2019 15:19:31 +0800 Subject: [PATCH 083/194] fix: somethings no need --- .../src/components/taro-page/index.ux | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/taro-components-qa/src/components/taro-page/index.ux b/packages/taro-components-qa/src/components/taro-page/index.ux index 88a363c7061f..a0ba59ca9558 100644 --- a/packages/taro-components-qa/src/components/taro-page/index.ux +++ b/packages/taro-components-qa/src/components/taro-page/index.ux @@ -99,9 +99,7 @@ }, data () { const pageInstance = this.$app.pageInstaceMap[this.pagepath] - let showTabBar = false, - enablepulldownrefresh = false, - enablepagescroll = false + let showTabBar = false if (this.tabbar && this.tabbar.list.length) { this.tabbar.list.forEach(item => { if (addLeadingSlash(item.pagePath) === addLeadingSlash(this.pagepath)) { @@ -109,17 +107,8 @@ } }) } - if (pageInstance) { - if (pageInstance.onPullDownRefresh) { - onPullDownRefresh = true - } else if (pageInstance.onPageScroll || pageInstance.onReachBottom) { - enablepagescroll = true - } - } return { showTabBar, - enablepulldownrefresh, - enablepagescroll, isPageRefreshing: false, tabBarData: {} } From 931a20885749dd2f682cdc599eceab5a9bff4528 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 5 Nov 2019 15:19:42 +0800 Subject: [PATCH 084/194] =?UTF-8?q?fix(mini-runner):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/loaders/fileParseLoader.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts index ef8ac3a34ed3..d0f244e7f88d 100644 --- a/packages/taro-mini-runner/src/loaders/fileParseLoader.ts +++ b/packages/taro-mini-runner/src/loaders/fileParseLoader.ts @@ -49,7 +49,6 @@ function processAst ( let hasComponentDidHide let hasComponentDidShow let hasComponentWillMount - let hasEnablePageScroll if (isQuickApp) { cannotRemoves.push(taroJsComponents) } @@ -149,8 +148,6 @@ function processAst ( hasComponentDidShow = true } else if (keyName === 'componentDidHide') { hasComponentDidHide = true - } else if (keyName === 'onPageScroll' || keyName === 'onReachBottom') { - hasEnablePageScroll = true } }, From 5041342ff999e449cc68e39896404f5d324f23f0 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 5 Nov 2019 15:29:02 +0800 Subject: [PATCH 085/194] chore(release): publish v2.0.0-beta.0 --- lerna.json | 2 +- .../package.json | 2 +- .../package.json | 4 +-- packages/css-to-react-native/package.json | 2 +- packages/eslint-config-taro/package.json | 4 +-- packages/eslint-plugin-taro/package.json | 2 +- .../postcss-plugin-constparse/package.json | 2 +- packages/postcss-pxtransform/package.json | 2 +- packages/postcss-unit-transform/package.json | 2 +- .../stylelint-config-taro-rn/package.json | 4 +-- packages/stylelint-taro-rn/package.json | 2 +- packages/taro-alipay/package.json | 6 ++-- packages/taro-async-await/package.json | 2 +- packages/taro-cli/package.json | 30 +++++++++---------- packages/taro-components-qa/package.json | 2 +- packages/taro-components-rn/package.json | 2 +- packages/taro-components/package.json | 6 ++-- packages/taro-h5/package.json | 6 ++-- packages/taro-jd/package.json | 6 ++-- packages/taro-mini-runner/package.json | 10 +++---- .../taro-mini-runner/src/config/uglify.ts | 2 +- .../dependencies/TaroSingleEntryDependency.ts | 8 ++--- .../src/plugins/TaroLoadChunksPlugin.ts | 2 +- packages/taro-mobx-common/package.json | 2 +- packages/taro-mobx-h5/package.json | 6 ++-- packages/taro-mobx-rn/package.json | 6 ++-- packages/taro-mobx/package.json | 6 ++-- packages/taro-plugin-babel/package.json | 2 +- packages/taro-plugin-csso/package.json | 2 +- packages/taro-plugin-less/package.json | 4 +-- packages/taro-plugin-sass/package.json | 2 +- packages/taro-plugin-stylus/package.json | 2 +- packages/taro-plugin-typescript/package.json | 2 +- packages/taro-plugin-uglifyjs/package.json | 2 +- packages/taro-qq/package.json | 6 ++-- packages/taro-quickapp/package.json | 6 ++-- packages/taro-redux-h5/package.json | 4 +-- packages/taro-redux-rn/package.json | 2 +- packages/taro-redux/package.json | 6 ++-- packages/taro-rn-runner/package.json | 4 +-- packages/taro-rn/package.json | 4 +-- packages/taro-router-rn/package.json | 2 +- packages/taro-router/package.json | 4 +-- packages/taro-swan/package.json | 6 ++-- packages/taro-transformer-wx/package.json | 7 ++--- packages/taro-tt/package.json | 6 ++-- packages/taro-utils/package.json | 2 +- packages/taro-weapp/package.json | 6 ++-- packages/taro-webpack-runner/package.json | 14 ++++----- packages/taro-with-weapp/package.json | 4 +-- packages/taro/package.json | 4 +-- packages/taroize/package.json | 2 +- 52 files changed, 117 insertions(+), 118 deletions(-) diff --git a/lerna.json b/lerna.json index c78b3ca91696..f9cf7be5d9ea 100644 --- a/lerna.json +++ b/lerna.json @@ -55,6 +55,6 @@ "message": "chore(release): publish %s" } }, - "version": "1.3.34", + "version": "2.0.0-beta.0", "npmClient": "npm" } diff --git a/packages/babel-plugin-transform-jsx-to-stylesheet/package.json b/packages/babel-plugin-transform-jsx-to-stylesheet/package.json index e2e4cb8e2696..572f48a61a77 100644 --- a/packages/babel-plugin-transform-jsx-to-stylesheet/package.json +++ b/packages/babel-plugin-transform-jsx-to-stylesheet/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-jsx-to-stylesheet", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Transform stylesheet selector to style in JSX Elements.", "license": "MIT", "main": "src/index.js", diff --git a/packages/babel-plugin-transform-taroapi/package.json b/packages/babel-plugin-transform-taroapi/package.json index 16b5059b0bbd..3df11b1734a7 100644 --- a/packages/babel-plugin-transform-taroapi/package.json +++ b/packages/babel-plugin-transform-taroapi/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-taroapi", - "version": "1.3.34", + "version": "2.0.0-beta.0", "main": "dist/index.js", "license": "MIT", "scripts": { @@ -10,7 +10,7 @@ "test": "jest" }, "devDependencies": { - "@tarojs/taro-h5": "1.3.34", + "@tarojs/taro-h5": "2.0.0-beta.0", "@types/babel-core": "^6.25.5", "@types/babel-traverse": "^6.25.4", "@types/babel-types": "^7.0.4", diff --git a/packages/css-to-react-native/package.json b/packages/css-to-react-native/package.json index 2c3a954b2aad..0c5d12bd7df7 100644 --- a/packages/css-to-react-native/package.json +++ b/packages/css-to-react-native/package.json @@ -1,7 +1,7 @@ { "name": "taro-css-to-react-native", "description": "Convert CSS text to a React Native stylesheet object", - "version": "1.3.34", + "version": "2.0.0-beta.0", "main": "dist/index.js", "license": "MIT", "scripts": { diff --git a/packages/eslint-config-taro/package.json b/packages/eslint-config-taro/package.json index 450dedff6b49..558d1beb9e9f 100644 --- a/packages/eslint-config-taro/package.json +++ b/packages/eslint-config-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-taro", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro specific linting rules for ESLint", "main": "index.js", "files": [ @@ -28,6 +28,6 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "eslint-plugin-taro": "1.3.34" + "eslint-plugin-taro": "2.0.0-beta.0" } } diff --git a/packages/eslint-plugin-taro/package.json b/packages/eslint-plugin-taro/package.json index a5dca8573d70..8f087fff5ced 100644 --- a/packages/eslint-plugin-taro/package.json +++ b/packages/eslint-plugin-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-taro", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro specific linting plugin for ESLint", "main": "index.js", "files": [ diff --git a/packages/postcss-plugin-constparse/package.json b/packages/postcss-plugin-constparse/package.json index c61b7bc46a56..0acb656748c8 100644 --- a/packages/postcss-plugin-constparse/package.json +++ b/packages/postcss-plugin-constparse/package.json @@ -1,6 +1,6 @@ { "name": "postcss-plugin-constparse", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "parse constants defined in config", "main": "index.js", "author": "Simba", diff --git a/packages/postcss-pxtransform/package.json b/packages/postcss-pxtransform/package.json index e06a3971dad4..4854ba2c79b5 100644 --- a/packages/postcss-pxtransform/package.json +++ b/packages/postcss-pxtransform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-pxtransform", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位", "keywords": [ "postcss", diff --git a/packages/postcss-unit-transform/package.json b/packages/postcss-unit-transform/package.json index 74357f25e1d4..cbb975792999 100644 --- a/packages/postcss-unit-transform/package.json +++ b/packages/postcss-unit-transform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-taro-unit-transform", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "小程序单位转换", "main": "index.js", "scripts": { diff --git a/packages/stylelint-config-taro-rn/package.json b/packages/stylelint-config-taro-rn/package.json index 4342c8990010..349e210764e7 100644 --- a/packages/stylelint-config-taro-rn/package.json +++ b/packages/stylelint-config-taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "stylelint-config-taro-rn", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Shareable stylelint config for React Native CSS modules", "main": "index.js", "files": [ @@ -28,6 +28,6 @@ "jest": "^23.6.0", "npmpub": "^4.1.0", "stylelint": "9.3.0", - "stylelint-taro-rn": "1.3.34" + "stylelint-taro-rn": "2.0.0-beta.0" } } diff --git a/packages/stylelint-taro-rn/package.json b/packages/stylelint-taro-rn/package.json index 7a6d038da441..d20daf2b49a6 100644 --- a/packages/stylelint-taro-rn/package.json +++ b/packages/stylelint-taro-rn/package.json @@ -1,7 +1,7 @@ { "name": "stylelint-taro-rn", "description": "A collection of React Native specific rules for stylelint", - "version": "1.3.34", + "version": "2.0.0-beta.0", "main": "dist/index.js", "babel": { "presets": [ diff --git a/packages/taro-alipay/package.json b/packages/taro-alipay/package.json index 42b2d1684433..2a820f2b9009 100644 --- a/packages/taro-alipay/package.json +++ b/packages/taro-alipay/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-alipay", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro alipay framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "1.3.34", - "@tarojs/utils": "1.3.34", + "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/utils": "2.0.0-beta.0", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-async-await/package.json b/packages/taro-async-await/package.json index 523e17df6f84..6c19665435f2 100644 --- a/packages/taro-async-await/package.json +++ b/packages/taro-async-await/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/async-await", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "taro async await", "main": "index.js", "scripts": { diff --git a/packages/taro-cli/package.json b/packages/taro-cli/package.json index 9f87a23bc899..1cca67e74d8b 100644 --- a/packages/taro-cli/package.json +++ b/packages/taro-cli/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/cli", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "cli tool for taro", "main": "index.js", "scripts": { @@ -40,8 +40,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taroize": "1.3.34", - "@tarojs/transformer-wx": "1.3.34", + "@tarojs/taroize": "2.0.0-beta.0", + "@tarojs/transformer-wx": "2.0.0-beta.0", "@types/request": "^2.48.1", "@typescript-eslint/parser": "^2.0.0", "adm-zip": "^0.4.13", @@ -54,7 +54,7 @@ "babel-plugin-remove-dead-code": "^1.3.2", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-define": "^1.3.0", - "babel-plugin-transform-jsx-to-stylesheet": "1.3.34", + "babel-plugin-transform-jsx-to-stylesheet": "2.0.0-beta.0", "babel-plugin-transform-react-jsx": "^6.24.1", "babel-plugin-transform-taroapi": "1.3.15", "babel-template": "^6.26.0", @@ -73,20 +73,20 @@ "ejs": "^2.6.1", "envinfo": "^6.0.1", "eslint": "^6.1.0", - "eslint-config-taro": "1.3.34", + "eslint-config-taro": "2.0.0-beta.0", "eslint-plugin-import": "^2.8.0", "eslint-plugin-react": "^7.4.0", "eslint-plugin-react-hooks": "^1.6.1", - "eslint-plugin-taro": "1.3.34", + "eslint-plugin-taro": "2.0.0-beta.0", "eslint-plugin-typescript": "^0.12.0", "fbjs": "^1.0.0", "find-yarn-workspace-root": "1.2.1", "fs-extra": "^5.0.0", "generic-names": "^2.0.1", "glob": "^7.1.2", - "inquirer": "^7.0.0", + "inquirer": "^5.2.0", "joi": "^14.0.6", - "klaw": "^3.0.0", + "klaw": "^2.1.1", "latest-version": "^4.0.0", "lodash": "^4.17.5", "mem-fs": "^1.1.3", @@ -96,11 +96,11 @@ "ora": "^2.0.0", "postcss": "^6.0.22", "postcss-modules-extract-imports": "^1.1.0", - "postcss-modules-local-by-default": "^3.0.2", + "postcss-modules-local-by-default": "^1.2.0", "postcss-modules-resolve-imports": "^1.3.0", "postcss-modules-scope": "^1.1.0", - "postcss-modules-values": "^3.0.0", - "postcss-pxtransform": "1.3.34", + "postcss-modules-values": "^1.3.0", + "postcss-pxtransform": "2.0.0-beta.0", "postcss-reporter": "^6.0.1", "postcss-taro-unit-transform": "1.2.15", "postcss-url": "^7.3.2", @@ -112,10 +112,10 @@ "semver": "^5.5.0", "shelljs": "^0.8.1", "stylelint": "9.3.0", - "stylelint-config-taro-rn": "1.3.34", - "stylelint-taro-rn": "1.3.34", + "stylelint-config-taro-rn": "2.0.0-beta.0", + "stylelint-taro-rn": "2.0.0-beta.0", "tapable": "^1.1.3", - "taro-css-to-react-native": "1.3.34", + "taro-css-to-react-native": "2.0.0-beta.0", "through2": "^2.0.3", "vinyl": "^2.1.0", "vinyl-fs": "^3.0.2", @@ -124,7 +124,7 @@ "yauzl": "2.10.0" }, "devDependencies": { - "@tarojs/taro": "1.3.34", + "@tarojs/taro": "2.0.0-beta.0", "@types/autoprefixer": "^9.1.1", "@types/babel-core": "^6.25.5", "@types/babel-generator": "^6.25.2", diff --git a/packages/taro-components-qa/package.json b/packages/taro-components-qa/package.json index 65f136b8d23a..f21505ac001a 100644 --- a/packages/taro-components-qa/package.json +++ b/packages/taro-components-qa/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-qa", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "多端解决方案基础组件(快应用)", "main": "./index.js", "files": [ diff --git a/packages/taro-components-rn/package.json b/packages/taro-components-rn/package.json index 2d3e9d7d3e2c..8ced8a0851be 100644 --- a/packages/taro-components-rn/package.json +++ b/packages/taro-components-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-rn", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "多端解决方案基础组件(RN)", "main": "./dist/index.js", "scripts": { diff --git a/packages/taro-components/package.json b/packages/taro-components/package.json index a045beb397a2..28ec2a25686a 100644 --- a/packages/taro-components/package.json +++ b/packages/taro-components/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "", "main:h5": "src/index.js", "main": "dist/index.js", @@ -50,14 +50,14 @@ "@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/plugin-transform-react-jsx": "^7.0.0", "@babel/preset-env": "^7.1.5", - "@tarojs/taro-h5": "1.3.34", + "@tarojs/taro-h5": "2.0.0-beta.0", "@types/react": "^16.4.6", "@types/urijs": "^1.15.38", "babel-core": "^7.0.0-bridge.0", "babel-eslint": "10.0.1", "babel-jest": "^22.4.4", "babel-loader": "^8.0.5", - "babel-plugin-transform-taroapi": "1.3.34", + "babel-plugin-transform-taroapi": "2.0.0-beta.0", "css-loader": "^2.1.1", "file-loader": "^3.0.1", "jest": "^22.4.4", diff --git a/packages/taro-h5/package.json b/packages/taro-h5/package.json index 85ca308d0ad4..13d3c08124d4 100644 --- a/packages/taro-h5/package.json +++ b/packages/taro-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-h5", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro h5 framework", "main:h5": "src/index.js", "main": "dist/index.cjs.js", @@ -45,8 +45,8 @@ "@babel/plugin-proposal-object-rest-spread": "^7.3.4", "@babel/plugin-transform-react-jsx": "^7.2.2", "@babel/preset-env": "^7.3.4", - "@tarojs/components": "1.3.29", - "@tarojs/taro": "1.3.29", + "@tarojs/components": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.0", "babel-core": "7.0.0-bridge.0", "babel-jest": "24.4.0", "eslint": "^4.18.2", diff --git a/packages/taro-jd/package.json b/packages/taro-jd/package.json index 1e9be98be52e..86b84a21f0a7 100644 --- a/packages/taro-jd/package.json +++ b/packages/taro-jd/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-jd", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro jd framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "1.3.34", - "@tarojs/utils": "1.3.34", + "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/utils": "2.0.0-beta.0", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index 4686d8ee8326..5a8a03d42fd2 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "1.3.22", + "version": "2.0.0-beta.0", "description": "Mini app runner for taro", "main": "index.js", "scripts": { @@ -32,8 +32,8 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/taro": "1.3.22", - "@tarojs/transformer-wx": "1.3.22", + "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/transformer-wx": "2.0.0-beta.0", "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", @@ -46,8 +46,8 @@ "copy-webpack-plugin": "^5.0.3", "css": "2.2.4", "css-loader": "^3.0.0", - "csso-webpack-plugin": "^1.0.0-beta.12", "css-what": "3.2.0", + "csso-webpack-plugin": "^1.0.0-beta.12", "file-loader": "^4.0.0", "fs-extra": "^8.0.1", "less": "^3.10.3", @@ -58,7 +58,7 @@ "node-sass": "^4.12.0", "ora": "^3.4.0", "postcss-loader": "^3.0.0", - "postcss-pxtransform": "^1.3.2", + "postcss-pxtransform": "2.0.0-beta.0", "request": "^2.88.0", "resolve": "^1.11.1", "sass-loader": "^7.1.0", diff --git a/packages/taro-mini-runner/src/config/uglify.ts b/packages/taro-mini-runner/src/config/uglify.ts index 43ea6b431bb8..8e76a5e5c6d5 100644 --- a/packages/taro-mini-runner/src/config/uglify.ts +++ b/packages/taro-mini-runner/src/config/uglify.ts @@ -1 +1 @@ -export default { } +export default { } diff --git a/packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts b/packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts index 95468aadecb5..7f2f997c69f1 100644 --- a/packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts +++ b/packages/taro-mini-runner/src/dependencies/TaroSingleEntryDependency.ts @@ -10,9 +10,9 @@ export default class TaroSingleEntryDependency extends ModuleDependency { this.name = name this.loc = loc this.miniType = miniType - } + } - get type () { - return 'single entry' - } + get type () { + return 'single entry' + } } diff --git a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts index e4e99d302f87..7820c458afdb 100644 --- a/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/TaroLoadChunksPlugin.ts @@ -74,7 +74,7 @@ function getIdOrName (chunk) { return chunk.id } return chunk.name - } +} function addRequireToSource (id, modules, commonChunks) { const source = new ConcatSource() diff --git a/packages/taro-mobx-common/package.json b/packages/taro-mobx-common/package.json index b171f77ba1e8..d745fefc9384 100644 --- a/packages/taro-mobx-common/package.json +++ b/packages/taro-mobx-common/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-common", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "mobx library for taro", "keywords": [ "mobx", diff --git a/packages/taro-mobx-h5/package.json b/packages/taro-mobx-h5/package.json index 06a9269b67ad..8c354c5200de 100644 --- a/packages/taro-mobx-h5/package.json +++ b/packages/taro-mobx-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-h5", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "mobx-h5 for taro", "keywords": [ "mobx", @@ -28,8 +28,8 @@ "nervjs": "^1.5.0" }, "dependencies": { - "@tarojs/mobx-common": "1.3.34", - "@tarojs/taro-h5": "1.3.34" + "@tarojs/mobx-common": "2.0.0-beta.0", + "@tarojs/taro-h5": "2.0.0-beta.0" }, "devDependencies": { "rimraf": "^2.6.2", diff --git a/packages/taro-mobx-rn/package.json b/packages/taro-mobx-rn/package.json index 0d67894b1984..2870df0946f3 100644 --- a/packages/taro-mobx-rn/package.json +++ b/packages/taro-mobx-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-rn", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "mobx-rn for taro", "keywords": [ "mobx", @@ -18,7 +18,7 @@ "src" ], "dependencies": { - "@tarojs/mobx-common": "1.3.34", - "@tarojs/taro-rn": "1.3.34" + "@tarojs/mobx-common": "2.0.0-beta.0", + "@tarojs/taro-rn": "2.0.0-beta.0" } } diff --git a/packages/taro-mobx/package.json b/packages/taro-mobx/package.json index 87504df5bfaf..2577eb4d2449 100644 --- a/packages/taro-mobx/package.json +++ b/packages/taro-mobx/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "mobx for taro", "keywords": [ "mobx", @@ -24,8 +24,8 @@ "clear": "rimraf dist" }, "dependencies": { - "@tarojs/mobx-common": "1.3.34", - "@tarojs/taro": "1.3.34" + "@tarojs/mobx-common": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.0" }, "devDependencies": { "rimraf": "^2.6.2", diff --git a/packages/taro-plugin-babel/package.json b/packages/taro-plugin-babel/package.json index dd5f2e50ff54..95a57f30a7de 100644 --- a/packages/taro-plugin-babel/package.json +++ b/packages/taro-plugin-babel/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-babel", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro babel编译", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-csso/package.json b/packages/taro-plugin-csso/package.json index 84bf2befe356..3938d84a83c2 100644 --- a/packages/taro-plugin-csso/package.json +++ b/packages/taro-plugin-csso/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-csso", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro压缩CSS文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-less/package.json b/packages/taro-plugin-less/package.json index 7df195bfaecf..8e87ea2072b2 100644 --- a/packages/taro-plugin-less/package.json +++ b/packages/taro-plugin-less/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-less", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro 编译 less 文件", "main": "index.js", "scripts": { @@ -16,6 +16,6 @@ "author": "luckyadam", "license": "MIT", "dependencies": { - "less": "^3.10.3" + "less": "^3.0.4" } } diff --git a/packages/taro-plugin-sass/package.json b/packages/taro-plugin-sass/package.json index 4fa1f0b4a801..42e9c007643c 100644 --- a/packages/taro-plugin-sass/package.json +++ b/packages/taro-plugin-sass/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-sass", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro编译sass文件", "main": "index.js", "files": [ diff --git a/packages/taro-plugin-stylus/package.json b/packages/taro-plugin-stylus/package.json index 9c225e97eb0b..223ad1649f64 100644 --- a/packages/taro-plugin-stylus/package.json +++ b/packages/taro-plugin-stylus/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-stylus", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro 编译 stylus 文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-typescript/package.json b/packages/taro-plugin-typescript/package.json index 2f862dba2b77..d749dcc51c75 100644 --- a/packages/taro-plugin-typescript/package.json +++ b/packages/taro-plugin-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-typescript", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro TypeScript 编译插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-uglifyjs/package.json b/packages/taro-plugin-uglifyjs/package.json index adcc6ec9e790..191bb1fea7e2 100644 --- a/packages/taro-plugin-uglifyjs/package.json +++ b/packages/taro-plugin-uglifyjs/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-uglifyjs", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro压缩JS文件", "main": "index.js", "scripts": { diff --git a/packages/taro-qq/package.json b/packages/taro-qq/package.json index de356bac0cb2..1545d5e7f8a5 100644 --- a/packages/taro-qq/package.json +++ b/packages/taro-qq/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-qq", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro qq framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "1.3.34", - "@tarojs/utils": "1.3.34", + "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/utils": "2.0.0-beta.0", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-quickapp/package.json b/packages/taro-quickapp/package.json index bb49beaf1758..c54a836852c6 100644 --- a/packages/taro-quickapp/package.json +++ b/packages/taro-quickapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-quickapp", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro quickapp framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "1.3.34", - "@tarojs/utils": "1.3.34", + "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/utils": "2.0.0-beta.0", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-redux-h5/package.json b/packages/taro-redux-h5/package.json index 3f4c8187c1fb..3146f1ac9193 100644 --- a/packages/taro-redux-h5/package.json +++ b/packages/taro-redux-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/redux-h5", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Forked react-redux for taro", "keywords": [ "react", @@ -46,7 +46,7 @@ "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.49", "@babel/plugin-transform-react-jsx": "^7.0.0-beta.49", "@babel/preset-env": "^7.0.0-beta.49", - "@tarojs/taro-h5": "1.3.34", + "@tarojs/taro-h5": "2.0.0-beta.0", "babel-plugin-transform-react-remove-prop-types": "^0.4.13", "redux": "^4.0.0", "rimraf": "^2.6.2", diff --git a/packages/taro-redux-rn/package.json b/packages/taro-redux-rn/package.json index 292cdcd7a7a1..df91c5197223 100644 --- a/packages/taro-redux-rn/package.json +++ b/packages/taro-redux-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-redux-rn", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "taro-redux-rn", "main": "./src/index.js", "files": [ diff --git a/packages/taro-redux/package.json b/packages/taro-redux/package.json index 5fbf5c60c99d..fb94f118fea3 100644 --- a/packages/taro-redux/package.json +++ b/packages/taro-redux/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/redux", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Redux for Taro", "main": "index.js", "typings": "types/index.d.ts", @@ -32,7 +32,7 @@ "jest": "^23.1.0" }, "dependencies": { - "@tarojs/taro": "1.3.34", - "@tarojs/utils": "1.3.34" + "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/utils": "2.0.0-beta.0" } } diff --git a/packages/taro-rn-runner/package.json b/packages/taro-rn-runner/package.json index d41f388417d2..55400736c4fc 100644 --- a/packages/taro-rn-runner/package.json +++ b/packages/taro-rn-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-runner", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "ReactNative build tool for taro", "main": "index.js", "scripts": { @@ -26,7 +26,7 @@ "cross-spawn": "^5.0.1", "fs-extra": "^3.0.1", "indent-string": "^3.0.0", - "inquirer": "^7.0.0", + "inquirer": "^3.0.1", "lodash": "^4.17.4", "match-require": "^2.0.0", "minimist": "^1.2.0", diff --git a/packages/taro-rn/package.json b/packages/taro-rn/package.json index aa32fe0b1b7c..f18aac8fbd13 100644 --- a/packages/taro-rn/package.json +++ b/packages/taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-rn", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro RN framework", "main": "./index.js", "files": [ @@ -27,7 +27,7 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "1.3.34", + "@tarojs/taro": "2.0.0-beta.0", "babel-preset-expo": "^5.2.0", "base64-js": "^1.3.0", "expo-av": "^6.0.0", diff --git a/packages/taro-router-rn/package.json b/packages/taro-router-rn/package.json index af38b545585d..1db60135700b 100644 --- a/packages/taro-router-rn/package.json +++ b/packages/taro-router-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-router-rn", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "taro-router-rn", "main": "./index.js", "files": [ diff --git a/packages/taro-router/package.json b/packages/taro-router/package.json index 64f76273bb83..ec33946d77a3 100644 --- a/packages/taro-router/package.json +++ b/packages/taro-router/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/router", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro-router", "main:h5": "dist/index.esm.js", "main": "index.js", @@ -41,7 +41,7 @@ "@babel/plugin-syntax-dynamic-import": "7.0.0", "@babel/plugin-transform-react-jsx": "7.0.0", "@babel/preset-env": "7.1.5", - "@tarojs/taro-h5": "1.3.34", + "@tarojs/taro-h5": "2.0.0-beta.0", "@types/history": "4.7.2", "@types/jasmine": "2.8.11", "@types/jest": "23.3.9", diff --git a/packages/taro-swan/package.json b/packages/taro-swan/package.json index e52fe84f9d05..145fd3c1da3b 100644 --- a/packages/taro-swan/package.json +++ b/packages/taro-swan/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-swan", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro swan framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "1.3.34", - "@tarojs/utils": "1.3.34", + "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/utils": "2.0.0-beta.0", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-transformer-wx/package.json b/packages/taro-transformer-wx/package.json index 255999e07b07..237302948103 100644 --- a/packages/taro-transformer-wx/package.json +++ b/packages/taro-transformer-wx/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/transformer-wx", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Transfrom Nerv Component to Wechat mini program.", "repository": { "type": "git", @@ -50,7 +50,6 @@ "babel-helper-remove-or-void": "^0.4.3", "babel-plugin-danger-remove-unused-import": "^1.1.1", "babel-plugin-minify-dead-code": "^1.3.2", - "babel-plugin-preval": "^1.6.4", "babel-plugin-syntax-dynamic-import": "^6.18.0", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-define": "^1.3.0", @@ -62,14 +61,14 @@ "babel-types": "^6.26.0", "eslint": "5.16.0", "eslint-plugin-react": "7.10.0", - "eslint-plugin-taro": "1.3.34", + "eslint-plugin-taro": "2.0.0-beta.0", "html": "^1.0.0", "lodash": "^4.17.5", "prettier": "^1.14.2", "typescript": "^3.2.2" }, "devDependencies": { - "@tarojs/taro": "1.3.34", + "@tarojs/taro": "2.0.0-beta.0", "@types/babel-core": "^6.25.5", "@types/babel-generator": "^6.25.1", "@types/babel-template": "^6.25.0", diff --git a/packages/taro-tt/package.json b/packages/taro-tt/package.json index 50f83079e018..0f4ccca04b8e 100644 --- a/packages/taro-tt/package.json +++ b/packages/taro-tt/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-tt", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro toutiao framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "1.3.34", - "@tarojs/utils": "1.3.34", + "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/utils": "2.0.0-beta.0", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-utils/package.json b/packages/taro-utils/package.json index 62bcadb58763..3dc454683174 100644 --- a/packages/taro-utils/package.json +++ b/packages/taro-utils/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/utils", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Utils for Taro", "main": "index.js", "scripts": { diff --git a/packages/taro-weapp/package.json b/packages/taro-weapp/package.json index dd866caee02f..8dd02c07037c 100644 --- a/packages/taro-weapp/package.json +++ b/packages/taro-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-weapp", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro weapp framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "1.3.34", - "@tarojs/utils": "1.3.34", + "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/utils": "2.0.0-beta.0", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-webpack-runner/package.json b/packages/taro-webpack-runner/package.json index 4634251390a9..f54b041d4186 100644 --- a/packages/taro-webpack-runner/package.json +++ b/packages/taro-webpack-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack-runner", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "webpack runner for taro", "main": "index.js", "scripts": { @@ -32,15 +32,15 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/plugin-sass": "1.3.34", - "@tarojs/taro": "1.3.34", - "@tarojs/taro-h5": "1.3.34", + "@tarojs/plugin-sass": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/taro-h5": "2.0.0-beta.0", "autoprefixer": "8.6.4", "babel-core": "6.26.0", "babel-loader": "7.1.4", "babel-plugin-syntax-dynamic-import": "6.18.0", "babel-plugin-transform-react-jsx": "6.24.1", - "babel-plugin-transform-taroapi": "1.3.34", + "babel-plugin-transform-taroapi": "2.0.0-beta.0", "babel-types": "6.26.0", "chalk": "2.4.2", "copy-webpack-plugin": "^5.0.3", @@ -57,8 +57,8 @@ "opn": "5.3.0", "ora": "2.1.0", "postcss-loader": "2.1.6", - "postcss-plugin-constparse": "1.3.34", - "postcss-pxtransform": "1.3.34", + "postcss-plugin-constparse": "2.0.0-beta.0", + "postcss-pxtransform": "2.0.0-beta.0", "resolve": "1.8.1", "resolve-url-loader": "2.3.0", "sass": "^1.23.1", diff --git a/packages/taro-with-weapp/package.json b/packages/taro-with-weapp/package.json index 6d6d76d1a900..ce48f4c6da38 100644 --- a/packages/taro-with-weapp/package.json +++ b/packages/taro-with-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/with-weapp", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "taroize 之后的运行时", "main": "index.js", "scripts": { @@ -22,7 +22,7 @@ "author": "yuche", "license": "MIT", "dependencies": { - "@tarojs/taro": "1.3.34", + "@tarojs/taro": "2.0.0-beta.0", "lodash": "^4.17.11" }, "devDependencies": { diff --git a/packages/taro/package.json b/packages/taro/package.json index 91721fc4ac55..c9d6282f9b15 100644 --- a/packages/taro/package.json +++ b/packages/taro/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "Taro framework", "module": "dist/index.esm.js", "main": "index.js", @@ -29,7 +29,7 @@ "nervjs": "^1.5.0" }, "dependencies": { - "@tarojs/utils": "1.3.34" + "@tarojs/utils": "2.0.0-beta.0" }, "devDependencies": { "@types/react": "^16.9.4", diff --git a/packages/taroize/package.json b/packages/taroize/package.json index 9d78ce642644..d3e2e5580a42 100644 --- a/packages/taroize/package.json +++ b/packages/taroize/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taroize", - "version": "1.3.34", + "version": "2.0.0-beta.0", "description": "转换原生微信小程序代码为 Taro 代码", "main": "index.js", "files": [ From f928f513678cb570763662548f156c42afb56754 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 5 Nov 2019 15:37:27 +0800 Subject: [PATCH 086/194] chore: changelog --- CHANGELOG.md | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd7f8f77a68e..b0980fa2b431 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -230,6 +230,84 @@ * **weapp:** 修复微信小程序遗留代码:nextProps 初始化,引起的冲突 ([00cf71c](https://github.com/NervJS/taro/commit/00cf71c)) +### Bug Fixes + +* **mini-runner:** 移除无用代码 ([c58da6f](https://github.com/NervJS/taro/commit/c58da6f)) +* somethings no need ([17ca4ec](https://github.com/NervJS/taro/commit/17ca4ec)) +* **cli:** lerna 加入 taro-mini-runner && 接入 webpack 生成小程序文件 ([1a4e970](https://github.com/NervJS/taro/commit/1a4e970)) +* **cli:** 修复 doctor 对 config 的检测 ([81687a1](https://github.com/NervJS/taro/commit/81687a1)) +* **cli:** 修复 watch 时文件修改不对的问题 ([02371f7](https://github.com/NervJS/taro/commit/02371f7)) +* **cli:** 修复代码合并的问题 ([769a7b5](https://github.com/NervJS/taro/commit/769a7b5)) +* **cli:** 修复目录创建 ([8f7b306](https://github.com/NervJS/taro/commit/8f7b306)) +* **cli:** 修复配置文件中读取不到 process.env.TARO_ENV 的问题 ([1cdf4b2](https://github.com/NervJS/taro/commit/1cdf4b2)) +* **cli:** 支持引用 node_modules 中组件 ([c0c15ba](https://github.com/NervJS/taro/commit/c0c15ba)) +* **cli:** 普通文件经过编译器编译必须传入 isNormal ([bf9d83e](https://github.com/NervJS/taro/commit/bf9d83e)) +* **cli:** 更新默认模板 ([54781b6](https://github.com/NervJS/taro/commit/54781b6)) +* **cli:** 清理代码 ([d70d979](https://github.com/NervJS/taro/commit/d70d979)) +* **cli:** 编译器参数调整 ([5c5fe21](https://github.com/NervJS/taro/commit/5c5fe21)) +* **components-qa:** 修复页面 onReachBottom 事件不触发的问题 ([de9d2e4](https://github.com/NervJS/taro/commit/de9d2e4)) +* **jd:** 修复合并代码导致的京东小程序的编译问题 ([be186b8](https://github.com/NervJS/taro/commit/be186b8)) +* **mini-runner:** npm 中文件不会经过 taro 包替换操作 ([bbdef3d](https://github.com/NervJS/taro/commit/bbdef3d)) +* **mini-runner:** 优化 webpack 编译时样式处理 ([a89a07b](https://github.com/NervJS/taro/commit/a89a07b)) +* **mini-runner:** 修复 builder 的 hooks 调用 ([0c67b98](https://github.com/NervJS/taro/commit/0c67b98)) +* **mini-runner:** 修复 tabbar 编译及组件 watch 的问题 ([bbda89f](https://github.com/NervJS/taro/commit/bbda89f)) +* **mini-runner:** 修复 watch bug ([27aba0b](https://github.com/NervJS/taro/commit/27aba0b)) +* **mini-runner:** 修复对 css modules 的支持 ([204b5d6](https://github.com/NervJS/taro/commit/204b5d6)) +* **mini-runner:** 修复小程序编译报错 ([524d39f](https://github.com/NervJS/taro/commit/524d39f)) +* **mini-runner:** 修复引用 npm 中组件间存在依赖时依赖路径解析错误的问题 ([d49c1c5](https://github.com/NervJS/taro/commit/d49c1c5)) +* **mini-runner:** 修复快应用打包报错的问题 ([4da8758](https://github.com/NervJS/taro/commit/4da8758)) +* **quickapp:** pull-down-refresh page-scroll ([f15b3c9](https://github.com/NervJS/taro/commit/f15b3c9)) +* position linter for quickapp 1060+ ([6dfc046](https://github.com/NervJS/taro/commit/6dfc046)) +* quickapp api upload from docs ([76dff8a](https://github.com/NervJS/taro/commit/76dff8a)) +* **mini-runner:** 修复快应用编译后页面标题展示不正确的问题 ([49fe830](https://github.com/NervJS/taro/commit/49fe830)) +* **mini-runner:** 修复普通小程序编译的问题 ([0ebe956](https://github.com/NervJS/taro/commit/0ebe956)) +* **mini-runner:** 加上文件编译提示 ([3428780](https://github.com/NervJS/taro/commit/3428780)) +* **mini-runner:** 只有 taro 的包不能经过依赖包名替换 ([81e9b57](https://github.com/NervJS/taro/commit/81e9b57)) +* **mini-runner:** 打包优化,引用自 npm 包中的组件不抽离至 vendors 中 ([5f18cd3](https://github.com/NervJS/taro/commit/5f18cd3)) +* **mini-runner:** 提前解析快应用页面 ([134275f](https://github.com/NervJS/taro/commit/134275f)) +* **mini-runner:** 支持快应用编译后模板与样式的检测 ([650d904](https://github.com/NervJS/taro/commit/650d904)) +* **taro:** 修复快应用下拉刷新问题 ([39fbfb8](https://github.com/NervJS/taro/commit/39fbfb8)) +* **taro:** 小程序 webpack 编译静态文件路径 ([7ca2d07](https://github.com/NervJS/taro/commit/7ca2d07)) +* **taro-quickapp:** 修复快应用事件绑定异常问题 ([1038fc9](https://github.com/NervJS/taro/commit/1038fc9)) +* pxtransform disable on quick-app ([c364552](https://github.com/NervJS/taro/commit/c364552)) +* **transformer:** 修复测试用例 ([9dee55a](https://github.com/NervJS/taro/commit/9dee55a)) +* **transformer:** 修复错误类型 ([5ea3403](https://github.com/NervJS/taro/commit/5ea3403)) +* **transformer:** 支持直接 import default ([c298024](https://github.com/NervJS/taro/commit/c298024)) +* **webpack:** 修复文件压缩的问题 ([219c685](https://github.com/NervJS/taro/commit/219c685)) + + +### Features + +* audio context ([c9b8d98](https://github.com/NervJS/taro/commit/c9b8d98)) +* mock for quickapp ([6c504fc](https://github.com/NervJS/taro/commit/6c504fc)) +* stop trans asset for quickapp ([b9b6259](https://github.com/NervJS/taro/commit/b9b6259)) +* **cli:** cli 支持事件 && 小程序编译配置向 H5 看齐 ([04ea71a](https://github.com/NervJS/taro/commit/04ea71a)) +* **cli:** 借助 tapable 改造 ([a1bc605](https://github.com/NervJS/taro/commit/a1bc605)) +* **cli:** 增加 tapable 包 ([617e9bd](https://github.com/NervJS/taro/commit/617e9bd)) +* **cli:** 将 app/页面/组件 添加到入口文件进行编译 ([e937773](https://github.com/NervJS/taro/commit/e937773)) +* **cli:** 尝试接入 webpack 来编译各端小程序 ([9b80d1f](https://github.com/NervJS/taro/commit/9b80d1f)) +* **cli:** 拆分逻辑到 loader ([ad2abcb](https://github.com/NervJS/taro/commit/ad2abcb)) +* **cli:** 调整文件编译 ([a9a679a](https://github.com/NervJS/taro/commit/a9a679a)) +* **mini-runner:** 优化 watch ([d421214](https://github.com/NervJS/taro/commit/d421214)) +* **mini-runner:** 保证快应用文件生成正确 ([a241a31](https://github.com/NervJS/taro/commit/a241a31)) +* **mini-runner:** 加入 watch ([da49558](https://github.com/NervJS/taro/commit/da49558)) +* **mini-runner:** 增加 Taro 模块专有处理插件 ([445fbe3](https://github.com/NervJS/taro/commit/445fbe3)) +* **mini-runner:** 支持与原生小程序代码混写 ([3aaeb84](https://github.com/NervJS/taro/commit/3aaeb84)) +* **mini-runner:** 支持分包 ([c0c0b04](https://github.com/NervJS/taro/commit/c0c0b04)) +* **mini-runner:** 支持编译 tabBar 上引用的资源编译 ([2d8dae1](https://github.com/NervJS/taro/commit/2d8dae1)) +* **mini-runner:** 生成快应用页面及组件 ([c78df71](https://github.com/NervJS/taro/commit/c78df71)) +* **taro:** cli 配合 mini-runner 重构 && 支持使用 mini-runner 编译插件 ([e035bfc](https://github.com/NervJS/taro/commit/e035bfc)) +* **taro:** 加入快应用编译支持 ([afbc9a8](https://github.com/NervJS/taro/commit/afbc9a8)) +* **taro:** 调整小程序和 H5 的编译配置 ([9cec6ff](https://github.com/NervJS/taro/commit/9cec6ff)) +* **taro-cli:** 调整 rn 编译配置 ([377f4b5](https://github.com/NervJS/taro/commit/377f4b5)) +* **taro-mini-runner:** 优化文件生成 ([dc29f0b](https://github.com/NervJS/taro/commit/dc29f0b)) +* **taro-mini-runner:** 如果是组件需要补充 component:true 配置 ([9bd95d3](https://github.com/NervJS/taro/commit/9bd95d3)) +* **taro-mini-runner:** 引入拆分的公共 chunks ([5cd236f](https://github.com/NervJS/taro/commit/5cd236f)) +* **taro-mini-runner:** 拆分文件编译成为 plugin ([8c2648d](https://github.com/NervJS/taro/commit/8c2648d)) +* **taro-mini-runner:** 生成多端类型文件 ([20b7ae7](https://github.com/NervJS/taro/commit/20b7ae7)) +* **taro-mini-runner:** 生成页面以及组件的 usingComponents 配置 ([5ae4bac](https://github.com/NervJS/taro/commit/5ae4bac)) + + ## [1.3.23](https://github.com/NervJS/taro/compare/v1.3.21...v1.3.23) (2019-11-12) From 325758bfa3ed820dd7c86a2d56c8432382524cb6 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 12 Nov 2019 17:49:56 +0800 Subject: [PATCH 087/194] merge --- packages/taro-cli/src/ui/quickapp.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/taro-cli/src/ui/quickapp.ts b/packages/taro-cli/src/ui/quickapp.ts index 415b44aede90..95b0b46626aa 100644 --- a/packages/taro-cli/src/ui/quickapp.ts +++ b/packages/taro-cli/src/ui/quickapp.ts @@ -4,7 +4,6 @@ import * as path from 'path' import { processTypeEnum, REG_TYPESCRIPT } from '../util/constants' import * as wxTransformer from '@tarojs/transformer-wx' -import { compileDepStyles } from '../mini/compileStyle' import { printLog } from '../util' import { analyzeFiles, parseEntryAst, QUICKAPP_OUTPUT_NAME, copyFileToDist, copyAllInterfaceFiles } from './common' import { IBuildData } from './ui.types' @@ -28,11 +27,7 @@ export async function buildForQuickapp (buildData: IBuildData) { isNormal: true, isTyped: REG_TYPESCRIPT.test(entryFilePath) }) - const {styleFiles, components} = parseEntryAst(transformResult.ast, entryFilePath) - if (styleFiles.length) { - const outputStylePath = path.join(outputDir, 'css', 'index.css') - await compileDepStyles(outputStylePath, styleFiles) - } + const { components } = parseEntryAst(transformResult.ast, entryFilePath) const relativePath = path.relative(appPath, entryFilePath) printLog(processTypeEnum.COPY, '发现文件', relativePath) fs.ensureDirSync(path.dirname(outputEntryFilePath)) From 547085b46b657e004827dcbfba6b8b4f0769798a Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 13 Nov 2019 21:58:04 +0800 Subject: [PATCH 088/194] chore(release): publish v2.0.0-beta.1 --- lerna.json | 2 +- .../package.json | 2 +- .../package.json | 4 ++-- packages/css-to-react-native/package.json | 2 +- packages/eslint-config-taro/package.json | 4 ++-- packages/eslint-plugin-taro/package.json | 2 +- .../postcss-plugin-constparse/package.json | 2 +- packages/postcss-pxtransform/package.json | 2 +- packages/postcss-unit-transform/package.json | 2 +- .../stylelint-config-taro-rn/package.json | 4 ++-- packages/stylelint-taro-rn/package.json | 2 +- packages/taro-alipay/package.json | 6 ++--- packages/taro-async-await/package.json | 2 +- packages/taro-cli/package.json | 22 +++++++++---------- packages/taro-components-qa/package.json | 2 +- packages/taro-components-rn/package.json | 2 +- packages/taro-components/package.json | 6 ++--- packages/taro-h5/package.json | 6 ++--- packages/taro-jd/package.json | 6 ++--- packages/taro-mini-runner/package.json | 8 +++---- packages/taro-mobx-common/package.json | 2 +- packages/taro-mobx-h5/package.json | 6 ++--- packages/taro-mobx-rn/package.json | 6 ++--- packages/taro-mobx/package.json | 6 ++--- packages/taro-plugin-babel/package.json | 2 +- packages/taro-plugin-csso/package.json | 2 +- packages/taro-plugin-less/package.json | 2 +- packages/taro-plugin-sass/package.json | 2 +- packages/taro-plugin-stylus/package.json | 2 +- packages/taro-plugin-typescript/package.json | 2 +- packages/taro-plugin-uglifyjs/package.json | 2 +- packages/taro-qq/package.json | 6 ++--- packages/taro-quickapp/package.json | 6 ++--- packages/taro-redux-h5/package.json | 4 ++-- packages/taro-redux-rn/package.json | 2 +- packages/taro-redux/package.json | 6 ++--- packages/taro-rn-runner/package.json | 2 +- packages/taro-rn/package.json | 4 ++-- packages/taro-router-rn/package.json | 2 +- packages/taro-router/package.json | 4 ++-- packages/taro-swan/package.json | 6 ++--- packages/taro-transformer-wx/package.json | 6 ++--- packages/taro-tt/package.json | 6 ++--- packages/taro-utils/package.json | 2 +- packages/taro-weapp/package.json | 6 ++--- packages/taro-webpack-runner/package.json | 14 ++++++------ packages/taro-with-weapp/package.json | 4 ++-- packages/taro/package.json | 4 ++-- packages/taroize/package.json | 2 +- 49 files changed, 104 insertions(+), 104 deletions(-) diff --git a/lerna.json b/lerna.json index f9cf7be5d9ea..63c315766356 100644 --- a/lerna.json +++ b/lerna.json @@ -55,6 +55,6 @@ "message": "chore(release): publish %s" } }, - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "npmClient": "npm" } diff --git a/packages/babel-plugin-transform-jsx-to-stylesheet/package.json b/packages/babel-plugin-transform-jsx-to-stylesheet/package.json index 572f48a61a77..4b2ad99f1a49 100644 --- a/packages/babel-plugin-transform-jsx-to-stylesheet/package.json +++ b/packages/babel-plugin-transform-jsx-to-stylesheet/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-jsx-to-stylesheet", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Transform stylesheet selector to style in JSX Elements.", "license": "MIT", "main": "src/index.js", diff --git a/packages/babel-plugin-transform-taroapi/package.json b/packages/babel-plugin-transform-taroapi/package.json index 3df11b1734a7..9f7eb771d25d 100644 --- a/packages/babel-plugin-transform-taroapi/package.json +++ b/packages/babel-plugin-transform-taroapi/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-taroapi", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "main": "dist/index.js", "license": "MIT", "scripts": { @@ -10,7 +10,7 @@ "test": "jest" }, "devDependencies": { - "@tarojs/taro-h5": "2.0.0-beta.0", + "@tarojs/taro-h5": "2.0.0-beta.1", "@types/babel-core": "^6.25.5", "@types/babel-traverse": "^6.25.4", "@types/babel-types": "^7.0.4", diff --git a/packages/css-to-react-native/package.json b/packages/css-to-react-native/package.json index 0c5d12bd7df7..941bfdab1635 100644 --- a/packages/css-to-react-native/package.json +++ b/packages/css-to-react-native/package.json @@ -1,7 +1,7 @@ { "name": "taro-css-to-react-native", "description": "Convert CSS text to a React Native stylesheet object", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "main": "dist/index.js", "license": "MIT", "scripts": { diff --git a/packages/eslint-config-taro/package.json b/packages/eslint-config-taro/package.json index 558d1beb9e9f..6d785e330be6 100644 --- a/packages/eslint-config-taro/package.json +++ b/packages/eslint-config-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-taro", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro specific linting rules for ESLint", "main": "index.js", "files": [ @@ -28,6 +28,6 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "eslint-plugin-taro": "2.0.0-beta.0" + "eslint-plugin-taro": "2.0.0-beta.1" } } diff --git a/packages/eslint-plugin-taro/package.json b/packages/eslint-plugin-taro/package.json index 8f087fff5ced..36742b856a5d 100644 --- a/packages/eslint-plugin-taro/package.json +++ b/packages/eslint-plugin-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-taro", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro specific linting plugin for ESLint", "main": "index.js", "files": [ diff --git a/packages/postcss-plugin-constparse/package.json b/packages/postcss-plugin-constparse/package.json index 0acb656748c8..1eb21fd77234 100644 --- a/packages/postcss-plugin-constparse/package.json +++ b/packages/postcss-plugin-constparse/package.json @@ -1,6 +1,6 @@ { "name": "postcss-plugin-constparse", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "parse constants defined in config", "main": "index.js", "author": "Simba", diff --git a/packages/postcss-pxtransform/package.json b/packages/postcss-pxtransform/package.json index 4854ba2c79b5..8d0fd4e9aca9 100644 --- a/packages/postcss-pxtransform/package.json +++ b/packages/postcss-pxtransform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-pxtransform", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位", "keywords": [ "postcss", diff --git a/packages/postcss-unit-transform/package.json b/packages/postcss-unit-transform/package.json index cbb975792999..c871757711af 100644 --- a/packages/postcss-unit-transform/package.json +++ b/packages/postcss-unit-transform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-taro-unit-transform", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "小程序单位转换", "main": "index.js", "scripts": { diff --git a/packages/stylelint-config-taro-rn/package.json b/packages/stylelint-config-taro-rn/package.json index 349e210764e7..65dc147597d7 100644 --- a/packages/stylelint-config-taro-rn/package.json +++ b/packages/stylelint-config-taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "stylelint-config-taro-rn", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Shareable stylelint config for React Native CSS modules", "main": "index.js", "files": [ @@ -28,6 +28,6 @@ "jest": "^23.6.0", "npmpub": "^4.1.0", "stylelint": "9.3.0", - "stylelint-taro-rn": "2.0.0-beta.0" + "stylelint-taro-rn": "2.0.0-beta.1" } } diff --git a/packages/stylelint-taro-rn/package.json b/packages/stylelint-taro-rn/package.json index d20daf2b49a6..62a25567f7e3 100644 --- a/packages/stylelint-taro-rn/package.json +++ b/packages/stylelint-taro-rn/package.json @@ -1,7 +1,7 @@ { "name": "stylelint-taro-rn", "description": "A collection of React Native specific rules for stylelint", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "main": "dist/index.js", "babel": { "presets": [ diff --git a/packages/taro-alipay/package.json b/packages/taro-alipay/package.json index 2a820f2b9009..53f9eede1e19 100644 --- a/packages/taro-alipay/package.json +++ b/packages/taro-alipay/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-alipay", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro alipay framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.0", - "@tarojs/utils": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/utils": "2.0.0-beta.1", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-async-await/package.json b/packages/taro-async-await/package.json index 6c19665435f2..fd5082078a4f 100644 --- a/packages/taro-async-await/package.json +++ b/packages/taro-async-await/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/async-await", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "taro async await", "main": "index.js", "scripts": { diff --git a/packages/taro-cli/package.json b/packages/taro-cli/package.json index 1cca67e74d8b..b3dc987420c9 100644 --- a/packages/taro-cli/package.json +++ b/packages/taro-cli/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/cli", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "cli tool for taro", "main": "index.js", "scripts": { @@ -40,8 +40,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taroize": "2.0.0-beta.0", - "@tarojs/transformer-wx": "2.0.0-beta.0", + "@tarojs/taroize": "2.0.0-beta.1", + "@tarojs/transformer-wx": "2.0.0-beta.1", "@types/request": "^2.48.1", "@typescript-eslint/parser": "^2.0.0", "adm-zip": "^0.4.13", @@ -54,7 +54,7 @@ "babel-plugin-remove-dead-code": "^1.3.2", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-define": "^1.3.0", - "babel-plugin-transform-jsx-to-stylesheet": "2.0.0-beta.0", + "babel-plugin-transform-jsx-to-stylesheet": "2.0.0-beta.1", "babel-plugin-transform-react-jsx": "^6.24.1", "babel-plugin-transform-taroapi": "1.3.15", "babel-template": "^6.26.0", @@ -73,11 +73,11 @@ "ejs": "^2.6.1", "envinfo": "^6.0.1", "eslint": "^6.1.0", - "eslint-config-taro": "2.0.0-beta.0", + "eslint-config-taro": "2.0.0-beta.1", "eslint-plugin-import": "^2.8.0", "eslint-plugin-react": "^7.4.0", "eslint-plugin-react-hooks": "^1.6.1", - "eslint-plugin-taro": "2.0.0-beta.0", + "eslint-plugin-taro": "2.0.0-beta.1", "eslint-plugin-typescript": "^0.12.0", "fbjs": "^1.0.0", "find-yarn-workspace-root": "1.2.1", @@ -100,7 +100,7 @@ "postcss-modules-resolve-imports": "^1.3.0", "postcss-modules-scope": "^1.1.0", "postcss-modules-values": "^1.3.0", - "postcss-pxtransform": "2.0.0-beta.0", + "postcss-pxtransform": "2.0.0-beta.1", "postcss-reporter": "^6.0.1", "postcss-taro-unit-transform": "1.2.15", "postcss-url": "^7.3.2", @@ -112,10 +112,10 @@ "semver": "^5.5.0", "shelljs": "^0.8.1", "stylelint": "9.3.0", - "stylelint-config-taro-rn": "2.0.0-beta.0", - "stylelint-taro-rn": "2.0.0-beta.0", + "stylelint-config-taro-rn": "2.0.0-beta.1", + "stylelint-taro-rn": "2.0.0-beta.1", "tapable": "^1.1.3", - "taro-css-to-react-native": "2.0.0-beta.0", + "taro-css-to-react-native": "2.0.0-beta.1", "through2": "^2.0.3", "vinyl": "^2.1.0", "vinyl-fs": "^3.0.2", @@ -124,7 +124,7 @@ "yauzl": "2.10.0" }, "devDependencies": { - "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", "@types/autoprefixer": "^9.1.1", "@types/babel-core": "^6.25.5", "@types/babel-generator": "^6.25.2", diff --git a/packages/taro-components-qa/package.json b/packages/taro-components-qa/package.json index f21505ac001a..5001c99420e2 100644 --- a/packages/taro-components-qa/package.json +++ b/packages/taro-components-qa/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-qa", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "多端解决方案基础组件(快应用)", "main": "./index.js", "files": [ diff --git a/packages/taro-components-rn/package.json b/packages/taro-components-rn/package.json index 8ced8a0851be..c9ea9d61d14f 100644 --- a/packages/taro-components-rn/package.json +++ b/packages/taro-components-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-rn", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "多端解决方案基础组件(RN)", "main": "./dist/index.js", "scripts": { diff --git a/packages/taro-components/package.json b/packages/taro-components/package.json index 28ec2a25686a..067d70ae35d3 100644 --- a/packages/taro-components/package.json +++ b/packages/taro-components/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "", "main:h5": "src/index.js", "main": "dist/index.js", @@ -50,14 +50,14 @@ "@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/plugin-transform-react-jsx": "^7.0.0", "@babel/preset-env": "^7.1.5", - "@tarojs/taro-h5": "2.0.0-beta.0", + "@tarojs/taro-h5": "2.0.0-beta.1", "@types/react": "^16.4.6", "@types/urijs": "^1.15.38", "babel-core": "^7.0.0-bridge.0", "babel-eslint": "10.0.1", "babel-jest": "^22.4.4", "babel-loader": "^8.0.5", - "babel-plugin-transform-taroapi": "2.0.0-beta.0", + "babel-plugin-transform-taroapi": "2.0.0-beta.1", "css-loader": "^2.1.1", "file-loader": "^3.0.1", "jest": "^22.4.4", diff --git a/packages/taro-h5/package.json b/packages/taro-h5/package.json index 13d3c08124d4..6a12a2259694 100644 --- a/packages/taro-h5/package.json +++ b/packages/taro-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-h5", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro h5 framework", "main:h5": "src/index.js", "main": "dist/index.cjs.js", @@ -45,8 +45,8 @@ "@babel/plugin-proposal-object-rest-spread": "^7.3.4", "@babel/plugin-transform-react-jsx": "^7.2.2", "@babel/preset-env": "^7.3.4", - "@tarojs/components": "2.0.0-beta.0", - "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/components": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.1", "babel-core": "7.0.0-bridge.0", "babel-jest": "24.4.0", "eslint": "^4.18.2", diff --git a/packages/taro-jd/package.json b/packages/taro-jd/package.json index 86b84a21f0a7..fe666092b238 100644 --- a/packages/taro-jd/package.json +++ b/packages/taro-jd/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-jd", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro jd framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.0", - "@tarojs/utils": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/utils": "2.0.0-beta.1", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index 5a8a03d42fd2..b49f53fdcb11 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Mini app runner for taro", "main": "index.js", "scripts": { @@ -32,8 +32,8 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/taro": "2.0.0-beta.0", - "@tarojs/transformer-wx": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/transformer-wx": "2.0.0-beta.1", "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", @@ -58,7 +58,7 @@ "node-sass": "^4.12.0", "ora": "^3.4.0", "postcss-loader": "^3.0.0", - "postcss-pxtransform": "2.0.0-beta.0", + "postcss-pxtransform": "2.0.0-beta.1", "request": "^2.88.0", "resolve": "^1.11.1", "sass-loader": "^7.1.0", diff --git a/packages/taro-mobx-common/package.json b/packages/taro-mobx-common/package.json index d745fefc9384..6ca19f04674d 100644 --- a/packages/taro-mobx-common/package.json +++ b/packages/taro-mobx-common/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-common", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "mobx library for taro", "keywords": [ "mobx", diff --git a/packages/taro-mobx-h5/package.json b/packages/taro-mobx-h5/package.json index 8c354c5200de..4f8e86747366 100644 --- a/packages/taro-mobx-h5/package.json +++ b/packages/taro-mobx-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-h5", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "mobx-h5 for taro", "keywords": [ "mobx", @@ -28,8 +28,8 @@ "nervjs": "^1.5.0" }, "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.0", - "@tarojs/taro-h5": "2.0.0-beta.0" + "@tarojs/mobx-common": "2.0.0-beta.1", + "@tarojs/taro-h5": "2.0.0-beta.1" }, "devDependencies": { "rimraf": "^2.6.2", diff --git a/packages/taro-mobx-rn/package.json b/packages/taro-mobx-rn/package.json index 2870df0946f3..28557aaa7525 100644 --- a/packages/taro-mobx-rn/package.json +++ b/packages/taro-mobx-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-rn", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "mobx-rn for taro", "keywords": [ "mobx", @@ -18,7 +18,7 @@ "src" ], "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.0", - "@tarojs/taro-rn": "2.0.0-beta.0" + "@tarojs/mobx-common": "2.0.0-beta.1", + "@tarojs/taro-rn": "2.0.0-beta.1" } } diff --git a/packages/taro-mobx/package.json b/packages/taro-mobx/package.json index 2577eb4d2449..7e8be3860f79 100644 --- a/packages/taro-mobx/package.json +++ b/packages/taro-mobx/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "mobx for taro", "keywords": [ "mobx", @@ -24,8 +24,8 @@ "clear": "rimraf dist" }, "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.0", - "@tarojs/taro": "2.0.0-beta.0" + "@tarojs/mobx-common": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.1" }, "devDependencies": { "rimraf": "^2.6.2", diff --git a/packages/taro-plugin-babel/package.json b/packages/taro-plugin-babel/package.json index 95a57f30a7de..704ca06a8f26 100644 --- a/packages/taro-plugin-babel/package.json +++ b/packages/taro-plugin-babel/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-babel", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro babel编译", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-csso/package.json b/packages/taro-plugin-csso/package.json index 3938d84a83c2..f58ef2b09132 100644 --- a/packages/taro-plugin-csso/package.json +++ b/packages/taro-plugin-csso/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-csso", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro压缩CSS文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-less/package.json b/packages/taro-plugin-less/package.json index 8e87ea2072b2..842bbeefb853 100644 --- a/packages/taro-plugin-less/package.json +++ b/packages/taro-plugin-less/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-less", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro 编译 less 文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-sass/package.json b/packages/taro-plugin-sass/package.json index 42e9c007643c..2dcc383ef0a9 100644 --- a/packages/taro-plugin-sass/package.json +++ b/packages/taro-plugin-sass/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-sass", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro编译sass文件", "main": "index.js", "files": [ diff --git a/packages/taro-plugin-stylus/package.json b/packages/taro-plugin-stylus/package.json index 223ad1649f64..baadd0b200d0 100644 --- a/packages/taro-plugin-stylus/package.json +++ b/packages/taro-plugin-stylus/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-stylus", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro 编译 stylus 文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-typescript/package.json b/packages/taro-plugin-typescript/package.json index d749dcc51c75..9bdf51665476 100644 --- a/packages/taro-plugin-typescript/package.json +++ b/packages/taro-plugin-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-typescript", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro TypeScript 编译插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-uglifyjs/package.json b/packages/taro-plugin-uglifyjs/package.json index 191bb1fea7e2..841f4d12aafb 100644 --- a/packages/taro-plugin-uglifyjs/package.json +++ b/packages/taro-plugin-uglifyjs/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-uglifyjs", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro压缩JS文件", "main": "index.js", "scripts": { diff --git a/packages/taro-qq/package.json b/packages/taro-qq/package.json index 1545d5e7f8a5..e9d0008b38f8 100644 --- a/packages/taro-qq/package.json +++ b/packages/taro-qq/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-qq", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro qq framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.0", - "@tarojs/utils": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/utils": "2.0.0-beta.1", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-quickapp/package.json b/packages/taro-quickapp/package.json index c54a836852c6..c12d9070a856 100644 --- a/packages/taro-quickapp/package.json +++ b/packages/taro-quickapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-quickapp", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro quickapp framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.0", - "@tarojs/utils": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/utils": "2.0.0-beta.1", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-redux-h5/package.json b/packages/taro-redux-h5/package.json index 3146f1ac9193..4c3958cf42cb 100644 --- a/packages/taro-redux-h5/package.json +++ b/packages/taro-redux-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/redux-h5", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Forked react-redux for taro", "keywords": [ "react", @@ -46,7 +46,7 @@ "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.49", "@babel/plugin-transform-react-jsx": "^7.0.0-beta.49", "@babel/preset-env": "^7.0.0-beta.49", - "@tarojs/taro-h5": "2.0.0-beta.0", + "@tarojs/taro-h5": "2.0.0-beta.1", "babel-plugin-transform-react-remove-prop-types": "^0.4.13", "redux": "^4.0.0", "rimraf": "^2.6.2", diff --git a/packages/taro-redux-rn/package.json b/packages/taro-redux-rn/package.json index df91c5197223..27c29b2c9941 100644 --- a/packages/taro-redux-rn/package.json +++ b/packages/taro-redux-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-redux-rn", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "taro-redux-rn", "main": "./src/index.js", "files": [ diff --git a/packages/taro-redux/package.json b/packages/taro-redux/package.json index fb94f118fea3..d9cea2a4da00 100644 --- a/packages/taro-redux/package.json +++ b/packages/taro-redux/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/redux", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Redux for Taro", "main": "index.js", "typings": "types/index.d.ts", @@ -32,7 +32,7 @@ "jest": "^23.1.0" }, "dependencies": { - "@tarojs/taro": "2.0.0-beta.0", - "@tarojs/utils": "2.0.0-beta.0" + "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/utils": "2.0.0-beta.1" } } diff --git a/packages/taro-rn-runner/package.json b/packages/taro-rn-runner/package.json index 55400736c4fc..e657e75c97c4 100644 --- a/packages/taro-rn-runner/package.json +++ b/packages/taro-rn-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-runner", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "ReactNative build tool for taro", "main": "index.js", "scripts": { diff --git a/packages/taro-rn/package.json b/packages/taro-rn/package.json index f18aac8fbd13..c7432e9860d3 100644 --- a/packages/taro-rn/package.json +++ b/packages/taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-rn", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro RN framework", "main": "./index.js", "files": [ @@ -27,7 +27,7 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", "babel-preset-expo": "^5.2.0", "base64-js": "^1.3.0", "expo-av": "^6.0.0", diff --git a/packages/taro-router-rn/package.json b/packages/taro-router-rn/package.json index 1db60135700b..60aa056beb82 100644 --- a/packages/taro-router-rn/package.json +++ b/packages/taro-router-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-router-rn", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "taro-router-rn", "main": "./index.js", "files": [ diff --git a/packages/taro-router/package.json b/packages/taro-router/package.json index ec33946d77a3..d14ba97f3de6 100644 --- a/packages/taro-router/package.json +++ b/packages/taro-router/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/router", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro-router", "main:h5": "dist/index.esm.js", "main": "index.js", @@ -41,7 +41,7 @@ "@babel/plugin-syntax-dynamic-import": "7.0.0", "@babel/plugin-transform-react-jsx": "7.0.0", "@babel/preset-env": "7.1.5", - "@tarojs/taro-h5": "2.0.0-beta.0", + "@tarojs/taro-h5": "2.0.0-beta.1", "@types/history": "4.7.2", "@types/jasmine": "2.8.11", "@types/jest": "23.3.9", diff --git a/packages/taro-swan/package.json b/packages/taro-swan/package.json index 145fd3c1da3b..3be276e4634f 100644 --- a/packages/taro-swan/package.json +++ b/packages/taro-swan/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-swan", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro swan framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.0", - "@tarojs/utils": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/utils": "2.0.0-beta.1", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-transformer-wx/package.json b/packages/taro-transformer-wx/package.json index 237302948103..1fa1006dca0a 100644 --- a/packages/taro-transformer-wx/package.json +++ b/packages/taro-transformer-wx/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/transformer-wx", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Transfrom Nerv Component to Wechat mini program.", "repository": { "type": "git", @@ -61,14 +61,14 @@ "babel-types": "^6.26.0", "eslint": "5.16.0", "eslint-plugin-react": "7.10.0", - "eslint-plugin-taro": "2.0.0-beta.0", + "eslint-plugin-taro": "2.0.0-beta.1", "html": "^1.0.0", "lodash": "^4.17.5", "prettier": "^1.14.2", "typescript": "^3.2.2" }, "devDependencies": { - "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", "@types/babel-core": "^6.25.5", "@types/babel-generator": "^6.25.1", "@types/babel-template": "^6.25.0", diff --git a/packages/taro-tt/package.json b/packages/taro-tt/package.json index 0f4ccca04b8e..343c8a1479a6 100644 --- a/packages/taro-tt/package.json +++ b/packages/taro-tt/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-tt", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro toutiao framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.0", - "@tarojs/utils": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/utils": "2.0.0-beta.1", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-utils/package.json b/packages/taro-utils/package.json index 3dc454683174..6d45f93c9cd4 100644 --- a/packages/taro-utils/package.json +++ b/packages/taro-utils/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/utils", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Utils for Taro", "main": "index.js", "scripts": { diff --git a/packages/taro-weapp/package.json b/packages/taro-weapp/package.json index 8dd02c07037c..e47ed410713f 100644 --- a/packages/taro-weapp/package.json +++ b/packages/taro-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-weapp", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro weapp framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.0", - "@tarojs/utils": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/utils": "2.0.0-beta.1", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-webpack-runner/package.json b/packages/taro-webpack-runner/package.json index f54b041d4186..7b71fa2f6274 100644 --- a/packages/taro-webpack-runner/package.json +++ b/packages/taro-webpack-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack-runner", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "webpack runner for taro", "main": "index.js", "scripts": { @@ -32,15 +32,15 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/plugin-sass": "2.0.0-beta.0", - "@tarojs/taro": "2.0.0-beta.0", - "@tarojs/taro-h5": "2.0.0-beta.0", + "@tarojs/plugin-sass": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/taro-h5": "2.0.0-beta.1", "autoprefixer": "8.6.4", "babel-core": "6.26.0", "babel-loader": "7.1.4", "babel-plugin-syntax-dynamic-import": "6.18.0", "babel-plugin-transform-react-jsx": "6.24.1", - "babel-plugin-transform-taroapi": "2.0.0-beta.0", + "babel-plugin-transform-taroapi": "2.0.0-beta.1", "babel-types": "6.26.0", "chalk": "2.4.2", "copy-webpack-plugin": "^5.0.3", @@ -57,8 +57,8 @@ "opn": "5.3.0", "ora": "2.1.0", "postcss-loader": "2.1.6", - "postcss-plugin-constparse": "2.0.0-beta.0", - "postcss-pxtransform": "2.0.0-beta.0", + "postcss-plugin-constparse": "2.0.0-beta.1", + "postcss-pxtransform": "2.0.0-beta.1", "resolve": "1.8.1", "resolve-url-loader": "2.3.0", "sass": "^1.23.1", diff --git a/packages/taro-with-weapp/package.json b/packages/taro-with-weapp/package.json index ce48f4c6da38..5621c17a3ae1 100644 --- a/packages/taro-with-weapp/package.json +++ b/packages/taro-with-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/with-weapp", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "taroize 之后的运行时", "main": "index.js", "scripts": { @@ -22,7 +22,7 @@ "author": "yuche", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.0", + "@tarojs/taro": "2.0.0-beta.1", "lodash": "^4.17.11" }, "devDependencies": { diff --git a/packages/taro/package.json b/packages/taro/package.json index c9d6282f9b15..35bffab9efde 100644 --- a/packages/taro/package.json +++ b/packages/taro/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "Taro framework", "module": "dist/index.esm.js", "main": "index.js", @@ -29,7 +29,7 @@ "nervjs": "^1.5.0" }, "dependencies": { - "@tarojs/utils": "2.0.0-beta.0" + "@tarojs/utils": "2.0.0-beta.1" }, "devDependencies": { "@types/react": "^16.9.4", diff --git a/packages/taroize/package.json b/packages/taroize/package.json index d3e2e5580a42..0e03b3d496f3 100644 --- a/packages/taroize/package.json +++ b/packages/taroize/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taroize", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "description": "转换原生微信小程序代码为 Taro 代码", "main": "index.js", "files": [ From 2661430b61d189c7d50fac4d76194f279175f81f Mon Sep 17 00:00:00 2001 From: luckyadam Date: Wed, 13 Nov 2019 22:02:37 +0800 Subject: [PATCH 089/194] chore: changelog --- CHANGELOG.md | 156 +++++++++++++++++++++++++-------------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0980fa2b431..57cf1d097325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -140,6 +140,84 @@ * createSelectorQuery Method`scrollOffset` fix ([e8af0a8](https://github.com/NervJS/taro/commit/e8af0a8)) +### Bug Fixes + +* **mini-runner:** 移除无用代码 ([c1020b1](https://github.com/NervJS/taro/commit/c1020b1)) +* somethings no need ([2c2e503](https://github.com/NervJS/taro/commit/2c2e503)) +* **cli:** lerna 加入 taro-mini-runner && 接入 webpack 生成小程序文件 ([93d2970](https://github.com/NervJS/taro/commit/93d2970)) +* **cli:** 修复 doctor 对 config 的检测 ([3db882c](https://github.com/NervJS/taro/commit/3db882c)) +* **cli:** 修复 watch 时文件修改不对的问题 ([ce3c0de](https://github.com/NervJS/taro/commit/ce3c0de)) +* **cli:** 修复代码合并的问题 ([37c0525](https://github.com/NervJS/taro/commit/37c0525)) +* **cli:** 修复目录创建 ([05bdd8a](https://github.com/NervJS/taro/commit/05bdd8a)) +* **cli:** 修复配置文件中读取不到 process.env.TARO_ENV 的问题 ([b0b1f8f](https://github.com/NervJS/taro/commit/b0b1f8f)) +* **cli:** 支持引用 node_modules 中组件 ([d21eb65](https://github.com/NervJS/taro/commit/d21eb65)) +* **cli:** 普通文件经过编译器编译必须传入 isNormal ([4aed827](https://github.com/NervJS/taro/commit/4aed827)) +* **cli:** 更新默认模板 ([f9f80a3](https://github.com/NervJS/taro/commit/f9f80a3)) +* **cli:** 清理代码 ([91d35a2](https://github.com/NervJS/taro/commit/91d35a2)) +* **cli:** 编译器参数调整 ([c5f3025](https://github.com/NervJS/taro/commit/c5f3025)) +* **components-qa:** 修复页面 onReachBottom 事件不触发的问题 ([b13cc81](https://github.com/NervJS/taro/commit/b13cc81)) +* **jd:** 修复合并代码导致的京东小程序的编译问题 ([97e2cff](https://github.com/NervJS/taro/commit/97e2cff)) +* **mini-runner:** npm 中文件不会经过 taro 包替换操作 ([7bad73e](https://github.com/NervJS/taro/commit/7bad73e)) +* **mini-runner:** 优化 webpack 编译时样式处理 ([b53f71c](https://github.com/NervJS/taro/commit/b53f71c)) +* **mini-runner:** 修复 builder 的 hooks 调用 ([dd7ac8c](https://github.com/NervJS/taro/commit/dd7ac8c)) +* **mini-runner:** 修复 tabbar 编译及组件 watch 的问题 ([8f5fc79](https://github.com/NervJS/taro/commit/8f5fc79)) +* **mini-runner:** 修复 watch bug ([9afbed2](https://github.com/NervJS/taro/commit/9afbed2)) +* **mini-runner:** 修复对 css modules 的支持 ([22cd897](https://github.com/NervJS/taro/commit/22cd897)) +* **mini-runner:** 修复小程序编译报错 ([677bfba](https://github.com/NervJS/taro/commit/677bfba)) +* **mini-runner:** 修复引用 npm 中组件间存在依赖时依赖路径解析错误的问题 ([f2869f6](https://github.com/NervJS/taro/commit/f2869f6)) +* **mini-runner:** 修复快应用打包报错的问题 ([5e59963](https://github.com/NervJS/taro/commit/5e59963)) +* **quickapp:** pull-down-refresh page-scroll ([157da75](https://github.com/NervJS/taro/commit/157da75)) +* position linter for quickapp 1060+ ([fa8d91c](https://github.com/NervJS/taro/commit/fa8d91c)) +* quickapp api upload from docs ([20b681c](https://github.com/NervJS/taro/commit/20b681c)) +* **mini-runner:** 修复快应用编译后页面标题展示不正确的问题 ([b523f90](https://github.com/NervJS/taro/commit/b523f90)) +* **mini-runner:** 修复普通小程序编译的问题 ([f5a2bc2](https://github.com/NervJS/taro/commit/f5a2bc2)) +* **mini-runner:** 加上文件编译提示 ([61eef34](https://github.com/NervJS/taro/commit/61eef34)) +* **mini-runner:** 只有 taro 的包不能经过依赖包名替换 ([498cc7f](https://github.com/NervJS/taro/commit/498cc7f)) +* **mini-runner:** 打包优化,引用自 npm 包中的组件不抽离至 vendors 中 ([635f3e2](https://github.com/NervJS/taro/commit/635f3e2)) +* **mini-runner:** 提前解析快应用页面 ([d5f72b9](https://github.com/NervJS/taro/commit/d5f72b9)) +* **mini-runner:** 支持快应用编译后模板与样式的检测 ([2a8a681](https://github.com/NervJS/taro/commit/2a8a681)) +* **taro:** 修复快应用下拉刷新问题 ([e429e7d](https://github.com/NervJS/taro/commit/e429e7d)) +* **taro:** 小程序 webpack 编译静态文件路径 ([9806766](https://github.com/NervJS/taro/commit/9806766)) +* **taro-quickapp:** 修复快应用事件绑定异常问题 ([eb3d9e5](https://github.com/NervJS/taro/commit/eb3d9e5)) +* pxtransform disable on quick-app ([5ce3139](https://github.com/NervJS/taro/commit/5ce3139)) +* **transformer:** 修复测试用例 ([219f493](https://github.com/NervJS/taro/commit/219f493)) +* **transformer:** 修复错误类型 ([9d15238](https://github.com/NervJS/taro/commit/9d15238)) +* **transformer:** 支持直接 import default ([2aa7bd7](https://github.com/NervJS/taro/commit/2aa7bd7)) +* **webpack:** 修复文件压缩的问题 ([0398e85](https://github.com/NervJS/taro/commit/0398e85)) + + +### Features + +* audio context ([b73d25a](https://github.com/NervJS/taro/commit/b73d25a)) +* mock for quickapp ([d578cea](https://github.com/NervJS/taro/commit/d578cea)) +* stop trans asset for quickapp ([62df717](https://github.com/NervJS/taro/commit/62df717)) +* **cli:** cli 支持事件 && 小程序编译配置向 H5 看齐 ([b9e27cf](https://github.com/NervJS/taro/commit/b9e27cf)) +* **cli:** 借助 tapable 改造 ([bfcda73](https://github.com/NervJS/taro/commit/bfcda73)) +* **cli:** 增加 tapable 包 ([f6dae40](https://github.com/NervJS/taro/commit/f6dae40)) +* **cli:** 将 app/页面/组件 添加到入口文件进行编译 ([411911d](https://github.com/NervJS/taro/commit/411911d)) +* **cli:** 尝试接入 webpack 来编译各端小程序 ([3495bb6](https://github.com/NervJS/taro/commit/3495bb6)) +* **cli:** 拆分逻辑到 loader ([36190e9](https://github.com/NervJS/taro/commit/36190e9)) +* **cli:** 调整文件编译 ([2ba5f75](https://github.com/NervJS/taro/commit/2ba5f75)) +* **mini-runner:** 优化 watch ([f8769fc](https://github.com/NervJS/taro/commit/f8769fc)) +* **mini-runner:** 保证快应用文件生成正确 ([bdfe1a4](https://github.com/NervJS/taro/commit/bdfe1a4)) +* **mini-runner:** 加入 watch ([323deb8](https://github.com/NervJS/taro/commit/323deb8)) +* **mini-runner:** 增加 Taro 模块专有处理插件 ([9f7532b](https://github.com/NervJS/taro/commit/9f7532b)) +* **mini-runner:** 支持与原生小程序代码混写 ([c49722a](https://github.com/NervJS/taro/commit/c49722a)) +* **mini-runner:** 支持分包 ([a794eec](https://github.com/NervJS/taro/commit/a794eec)) +* **mini-runner:** 支持编译 tabBar 上引用的资源编译 ([8336e19](https://github.com/NervJS/taro/commit/8336e19)) +* **mini-runner:** 生成快应用页面及组件 ([4cc0599](https://github.com/NervJS/taro/commit/4cc0599)) +* **taro:** cli 配合 mini-runner 重构 && 支持使用 mini-runner 编译插件 ([be4aeab](https://github.com/NervJS/taro/commit/be4aeab)) +* **taro:** 加入快应用编译支持 ([2d3f27f](https://github.com/NervJS/taro/commit/2d3f27f)) +* **taro:** 调整小程序和 H5 的编译配置 ([ca0b1bd](https://github.com/NervJS/taro/commit/ca0b1bd)) +* **taro-cli:** 调整 rn 编译配置 ([1e6e9ba](https://github.com/NervJS/taro/commit/1e6e9ba)) +* **taro-mini-runner:** 优化文件生成 ([19cddf7](https://github.com/NervJS/taro/commit/19cddf7)) +* **taro-mini-runner:** 如果是组件需要补充 component:true 配置 ([13cb3a4](https://github.com/NervJS/taro/commit/13cb3a4)) +* **taro-mini-runner:** 引入拆分的公共 chunks ([672bbc7](https://github.com/NervJS/taro/commit/672bbc7)) +* **taro-mini-runner:** 拆分文件编译成为 plugin ([79a9008](https://github.com/NervJS/taro/commit/79a9008)) +* **taro-mini-runner:** 生成多端类型文件 ([12c2360](https://github.com/NervJS/taro/commit/12c2360)) +* **taro-mini-runner:** 生成页面以及组件的 usingComponents 配置 ([d4ec990](https://github.com/NervJS/taro/commit/d4ec990)) + + ## [1.3.27](https://github.com/NervJS/taro/compare/v1.3.26...v1.3.27) (2019-12-03) @@ -230,84 +308,6 @@ * **weapp:** 修复微信小程序遗留代码:nextProps 初始化,引起的冲突 ([00cf71c](https://github.com/NervJS/taro/commit/00cf71c)) -### Bug Fixes - -* **mini-runner:** 移除无用代码 ([c58da6f](https://github.com/NervJS/taro/commit/c58da6f)) -* somethings no need ([17ca4ec](https://github.com/NervJS/taro/commit/17ca4ec)) -* **cli:** lerna 加入 taro-mini-runner && 接入 webpack 生成小程序文件 ([1a4e970](https://github.com/NervJS/taro/commit/1a4e970)) -* **cli:** 修复 doctor 对 config 的检测 ([81687a1](https://github.com/NervJS/taro/commit/81687a1)) -* **cli:** 修复 watch 时文件修改不对的问题 ([02371f7](https://github.com/NervJS/taro/commit/02371f7)) -* **cli:** 修复代码合并的问题 ([769a7b5](https://github.com/NervJS/taro/commit/769a7b5)) -* **cli:** 修复目录创建 ([8f7b306](https://github.com/NervJS/taro/commit/8f7b306)) -* **cli:** 修复配置文件中读取不到 process.env.TARO_ENV 的问题 ([1cdf4b2](https://github.com/NervJS/taro/commit/1cdf4b2)) -* **cli:** 支持引用 node_modules 中组件 ([c0c15ba](https://github.com/NervJS/taro/commit/c0c15ba)) -* **cli:** 普通文件经过编译器编译必须传入 isNormal ([bf9d83e](https://github.com/NervJS/taro/commit/bf9d83e)) -* **cli:** 更新默认模板 ([54781b6](https://github.com/NervJS/taro/commit/54781b6)) -* **cli:** 清理代码 ([d70d979](https://github.com/NervJS/taro/commit/d70d979)) -* **cli:** 编译器参数调整 ([5c5fe21](https://github.com/NervJS/taro/commit/5c5fe21)) -* **components-qa:** 修复页面 onReachBottom 事件不触发的问题 ([de9d2e4](https://github.com/NervJS/taro/commit/de9d2e4)) -* **jd:** 修复合并代码导致的京东小程序的编译问题 ([be186b8](https://github.com/NervJS/taro/commit/be186b8)) -* **mini-runner:** npm 中文件不会经过 taro 包替换操作 ([bbdef3d](https://github.com/NervJS/taro/commit/bbdef3d)) -* **mini-runner:** 优化 webpack 编译时样式处理 ([a89a07b](https://github.com/NervJS/taro/commit/a89a07b)) -* **mini-runner:** 修复 builder 的 hooks 调用 ([0c67b98](https://github.com/NervJS/taro/commit/0c67b98)) -* **mini-runner:** 修复 tabbar 编译及组件 watch 的问题 ([bbda89f](https://github.com/NervJS/taro/commit/bbda89f)) -* **mini-runner:** 修复 watch bug ([27aba0b](https://github.com/NervJS/taro/commit/27aba0b)) -* **mini-runner:** 修复对 css modules 的支持 ([204b5d6](https://github.com/NervJS/taro/commit/204b5d6)) -* **mini-runner:** 修复小程序编译报错 ([524d39f](https://github.com/NervJS/taro/commit/524d39f)) -* **mini-runner:** 修复引用 npm 中组件间存在依赖时依赖路径解析错误的问题 ([d49c1c5](https://github.com/NervJS/taro/commit/d49c1c5)) -* **mini-runner:** 修复快应用打包报错的问题 ([4da8758](https://github.com/NervJS/taro/commit/4da8758)) -* **quickapp:** pull-down-refresh page-scroll ([f15b3c9](https://github.com/NervJS/taro/commit/f15b3c9)) -* position linter for quickapp 1060+ ([6dfc046](https://github.com/NervJS/taro/commit/6dfc046)) -* quickapp api upload from docs ([76dff8a](https://github.com/NervJS/taro/commit/76dff8a)) -* **mini-runner:** 修复快应用编译后页面标题展示不正确的问题 ([49fe830](https://github.com/NervJS/taro/commit/49fe830)) -* **mini-runner:** 修复普通小程序编译的问题 ([0ebe956](https://github.com/NervJS/taro/commit/0ebe956)) -* **mini-runner:** 加上文件编译提示 ([3428780](https://github.com/NervJS/taro/commit/3428780)) -* **mini-runner:** 只有 taro 的包不能经过依赖包名替换 ([81e9b57](https://github.com/NervJS/taro/commit/81e9b57)) -* **mini-runner:** 打包优化,引用自 npm 包中的组件不抽离至 vendors 中 ([5f18cd3](https://github.com/NervJS/taro/commit/5f18cd3)) -* **mini-runner:** 提前解析快应用页面 ([134275f](https://github.com/NervJS/taro/commit/134275f)) -* **mini-runner:** 支持快应用编译后模板与样式的检测 ([650d904](https://github.com/NervJS/taro/commit/650d904)) -* **taro:** 修复快应用下拉刷新问题 ([39fbfb8](https://github.com/NervJS/taro/commit/39fbfb8)) -* **taro:** 小程序 webpack 编译静态文件路径 ([7ca2d07](https://github.com/NervJS/taro/commit/7ca2d07)) -* **taro-quickapp:** 修复快应用事件绑定异常问题 ([1038fc9](https://github.com/NervJS/taro/commit/1038fc9)) -* pxtransform disable on quick-app ([c364552](https://github.com/NervJS/taro/commit/c364552)) -* **transformer:** 修复测试用例 ([9dee55a](https://github.com/NervJS/taro/commit/9dee55a)) -* **transformer:** 修复错误类型 ([5ea3403](https://github.com/NervJS/taro/commit/5ea3403)) -* **transformer:** 支持直接 import default ([c298024](https://github.com/NervJS/taro/commit/c298024)) -* **webpack:** 修复文件压缩的问题 ([219c685](https://github.com/NervJS/taro/commit/219c685)) - - -### Features - -* audio context ([c9b8d98](https://github.com/NervJS/taro/commit/c9b8d98)) -* mock for quickapp ([6c504fc](https://github.com/NervJS/taro/commit/6c504fc)) -* stop trans asset for quickapp ([b9b6259](https://github.com/NervJS/taro/commit/b9b6259)) -* **cli:** cli 支持事件 && 小程序编译配置向 H5 看齐 ([04ea71a](https://github.com/NervJS/taro/commit/04ea71a)) -* **cli:** 借助 tapable 改造 ([a1bc605](https://github.com/NervJS/taro/commit/a1bc605)) -* **cli:** 增加 tapable 包 ([617e9bd](https://github.com/NervJS/taro/commit/617e9bd)) -* **cli:** 将 app/页面/组件 添加到入口文件进行编译 ([e937773](https://github.com/NervJS/taro/commit/e937773)) -* **cli:** 尝试接入 webpack 来编译各端小程序 ([9b80d1f](https://github.com/NervJS/taro/commit/9b80d1f)) -* **cli:** 拆分逻辑到 loader ([ad2abcb](https://github.com/NervJS/taro/commit/ad2abcb)) -* **cli:** 调整文件编译 ([a9a679a](https://github.com/NervJS/taro/commit/a9a679a)) -* **mini-runner:** 优化 watch ([d421214](https://github.com/NervJS/taro/commit/d421214)) -* **mini-runner:** 保证快应用文件生成正确 ([a241a31](https://github.com/NervJS/taro/commit/a241a31)) -* **mini-runner:** 加入 watch ([da49558](https://github.com/NervJS/taro/commit/da49558)) -* **mini-runner:** 增加 Taro 模块专有处理插件 ([445fbe3](https://github.com/NervJS/taro/commit/445fbe3)) -* **mini-runner:** 支持与原生小程序代码混写 ([3aaeb84](https://github.com/NervJS/taro/commit/3aaeb84)) -* **mini-runner:** 支持分包 ([c0c0b04](https://github.com/NervJS/taro/commit/c0c0b04)) -* **mini-runner:** 支持编译 tabBar 上引用的资源编译 ([2d8dae1](https://github.com/NervJS/taro/commit/2d8dae1)) -* **mini-runner:** 生成快应用页面及组件 ([c78df71](https://github.com/NervJS/taro/commit/c78df71)) -* **taro:** cli 配合 mini-runner 重构 && 支持使用 mini-runner 编译插件 ([e035bfc](https://github.com/NervJS/taro/commit/e035bfc)) -* **taro:** 加入快应用编译支持 ([afbc9a8](https://github.com/NervJS/taro/commit/afbc9a8)) -* **taro:** 调整小程序和 H5 的编译配置 ([9cec6ff](https://github.com/NervJS/taro/commit/9cec6ff)) -* **taro-cli:** 调整 rn 编译配置 ([377f4b5](https://github.com/NervJS/taro/commit/377f4b5)) -* **taro-mini-runner:** 优化文件生成 ([dc29f0b](https://github.com/NervJS/taro/commit/dc29f0b)) -* **taro-mini-runner:** 如果是组件需要补充 component:true 配置 ([9bd95d3](https://github.com/NervJS/taro/commit/9bd95d3)) -* **taro-mini-runner:** 引入拆分的公共 chunks ([5cd236f](https://github.com/NervJS/taro/commit/5cd236f)) -* **taro-mini-runner:** 拆分文件编译成为 plugin ([8c2648d](https://github.com/NervJS/taro/commit/8c2648d)) -* **taro-mini-runner:** 生成多端类型文件 ([20b7ae7](https://github.com/NervJS/taro/commit/20b7ae7)) -* **taro-mini-runner:** 生成页面以及组件的 usingComponents 配置 ([5ae4bac](https://github.com/NervJS/taro/commit/5ae4bac)) - - ## [1.3.23](https://github.com/NervJS/taro/compare/v1.3.21...v1.3.23) (2019-11-12) From 2e095097a1c90c8b561d4824956d45201c964522 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 14 Nov 2019 16:12:46 +0800 Subject: [PATCH 090/194] =?UTF-8?q?fix(mini-runner):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=AF=B9=20alias=20=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/MiniPlugin.ts | 34 ++++++++++++------- .../src/webpack/build.conf.ts | 3 +- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 2c999a1f84f7..5ad4d3b56ae1 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -17,7 +17,7 @@ import * as _ from 'lodash' import { REG_TYPESCRIPT, BUILD_TYPES, PARSE_AST_TYPE, MINI_APP_FILES, NODE_MODULES_REG, CONFIG_MAP, taroJsFramework, REG_SCRIPTS, processTypeEnum } from '../utils/constants' import { IComponentObj } from '../utils/types' -import { resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync, isEmptyObject, promoteRelativePath, printLog } from '../utils' +import { resolveScriptPath, buildUsingComponents, isNpmPkg, resolveNpmSync, isEmptyObject, promoteRelativePath, printLog, isAliasPath, replaceAliasPath } from '../utils' import TaroSingleEntryDependency from '../dependencies/TaroSingleEntryDependency' import { getTaroJsQuickAppComponentsPath, generateQuickAppUx, getImportTaroSelfComponents, generateQuickAppManifest } from '../utils/helper' import parseAst from '../utils/parseAst' @@ -37,7 +37,8 @@ interface IMiniPluginOptions { designWidth: number, commonChunks: string[], pluginConfig?: object, - isBuildPlugin: boolean + isBuildPlugin: boolean, + alias: object } export interface ITaroFileInfo { @@ -150,7 +151,8 @@ export default class MiniPlugin { outputDir: '', designWidth: 750, commonChunks: ['runtime', 'vendors'], - isBuildPlugin: false + isBuildPlugin: false, + alias: {} }) this.sourceDir = this.options.sourceDir this.outputDir = this.options.outputDir @@ -325,15 +327,21 @@ export default class MiniPlugin { return componentRealPath } - transfromComponentsPath (components: IComponentObj[]) { - const { buildAdapter } = this.options + transfromComponentsPath (filePath, components: IComponentObj[]) { + const { buildAdapter, alias } = this.options components.forEach(component => { - const componentPath = component.path + let componentPath = component.path + let realComponentPath if (componentPath && isNpmPkg(componentPath)) { - const res = resolveNpmSync(componentPath, this.context) - const code = fs.readFileSync(res).toString() - const newComponent = Object.assign({}, component, { path: res }) - const realComponentPath = this.getNpmComponentRealPath(code, newComponent, buildAdapter) + if (isAliasPath(componentPath, alias)) { + componentPath = replaceAliasPath(filePath, componentPath, alias) + realComponentPath = resolveScriptPath(path.resolve(filePath, '..', componentPath as string)) + } else { + const res = resolveNpmSync(componentPath, this.context) + const code = fs.readFileSync(res).toString() + const newComponent = Object.assign({}, component, { path: res }) + realComponentPath = this.getNpmComponentRealPath(code, newComponent, buildAdapter) + } component.path = realComponentPath } }) @@ -517,7 +525,7 @@ export default class MiniPlugin { } getComponents (fileList: Set, isRoot: boolean) { - const { buildAdapter } = this.options + const { buildAdapter, alias } = this.options const isQuickApp = buildAdapter === BUILD_TYPES.QUICKAPP fileList.forEach(file => { const isNative = file.isNative @@ -597,7 +605,7 @@ export default class MiniPlugin { code = transformResult.code } depComponents = depComponents.filter(item => !/^plugin:\/\//.test(item.path)) - this.transfromComponentsPath(depComponents) + this.transfromComponentsPath(file.path, depComponents) if (isQuickApp) { const scriptPath = file.path const outputScriptPath = scriptPath.replace(this.sourceDir, this.outputDir).replace(path.extname(scriptPath), MINI_APP_FILES[buildAdapter].SCRIPT) @@ -626,7 +634,7 @@ export default class MiniPlugin { printLog(processTypeEnum.COMPILE, isRoot ? '发现页面' : '发现组件', file.path) taroFileTypeMap[file.path] = { type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, - config: merge({}, isComponentConfig, buildUsingComponents(file.path, this.sourceDir, {}, depComponents), configObj), + config: merge({}, isComponentConfig, buildUsingComponents(file.path, this.sourceDir, alias, depComponents), configObj), template, code } diff --git a/packages/taro-mini-runner/src/webpack/build.conf.ts b/packages/taro-mini-runner/src/webpack/build.conf.ts index 71d891cbfd3f..5c8099857638 100644 --- a/packages/taro-mini-runner/src/webpack/build.conf.ts +++ b/packages/taro-mini-runner/src/webpack/build.conf.ts @@ -93,7 +93,8 @@ export default (appPath: string, mode, config: Partial): any => { designWidth, pluginConfig: entryRes!.pluginConfig, isBuildPlugin: !!config.isBuildPlugin, - commonChunks: !!config.isBuildPlugin ? ['plugin/runtime', 'plugin/vendors'] : ['runtime', 'vendors'] + commonChunks: !!config.isBuildPlugin ? ['plugin/runtime', 'plugin/vendors'] : ['runtime', 'vendors'], + alias }) plugin.miniCssExtractPlugin = getMiniCssExtractPlugin([{ From e7dec0a2632fc09dee52d70c54036961f1c24bfc Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 14 Nov 2019 16:23:58 +0800 Subject: [PATCH 091/194] chore(release): publish v2.0.0-beta.2 --- lerna.json | 2 +- .../package.json | 2 +- .../package.json | 4 ++-- packages/css-to-react-native/package.json | 2 +- packages/eslint-config-taro/package.json | 4 ++-- packages/eslint-plugin-taro/package.json | 2 +- .../postcss-plugin-constparse/package.json | 2 +- packages/postcss-pxtransform/package.json | 2 +- packages/postcss-unit-transform/package.json | 2 +- .../stylelint-config-taro-rn/package.json | 4 ++-- packages/stylelint-taro-rn/package.json | 2 +- packages/taro-alipay/package.json | 6 ++--- packages/taro-async-await/package.json | 2 +- packages/taro-cli/package.json | 22 +++++++++---------- packages/taro-components-qa/package.json | 2 +- packages/taro-components-rn/package.json | 2 +- packages/taro-components/package.json | 6 ++--- packages/taro-h5/package.json | 6 ++--- packages/taro-jd/package.json | 6 ++--- packages/taro-mini-runner/package.json | 8 +++---- packages/taro-mobx-common/package.json | 2 +- packages/taro-mobx-h5/package.json | 6 ++--- packages/taro-mobx-rn/package.json | 6 ++--- packages/taro-mobx/package.json | 6 ++--- packages/taro-plugin-babel/package.json | 2 +- packages/taro-plugin-csso/package.json | 2 +- packages/taro-plugin-less/package.json | 2 +- packages/taro-plugin-sass/package.json | 2 +- packages/taro-plugin-stylus/package.json | 2 +- packages/taro-plugin-typescript/package.json | 2 +- packages/taro-plugin-uglifyjs/package.json | 2 +- packages/taro-qq/package.json | 6 ++--- packages/taro-quickapp/package.json | 6 ++--- packages/taro-redux-h5/package.json | 4 ++-- packages/taro-redux-rn/package.json | 2 +- packages/taro-redux/package.json | 6 ++--- packages/taro-rn-runner/package.json | 2 +- packages/taro-rn/package.json | 4 ++-- packages/taro-router-rn/package.json | 2 +- packages/taro-router/package.json | 4 ++-- packages/taro-swan/package.json | 6 ++--- packages/taro-transformer-wx/package.json | 6 ++--- packages/taro-tt/package.json | 6 ++--- packages/taro-utils/package.json | 2 +- packages/taro-weapp/package.json | 6 ++--- packages/taro-webpack-runner/package.json | 14 ++++++------ packages/taro-with-weapp/package.json | 4 ++-- packages/taro/package.json | 4 ++-- packages/taroize/package.json | 2 +- 49 files changed, 104 insertions(+), 104 deletions(-) diff --git a/lerna.json b/lerna.json index 63c315766356..07063e7976c9 100644 --- a/lerna.json +++ b/lerna.json @@ -55,6 +55,6 @@ "message": "chore(release): publish %s" } }, - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "npmClient": "npm" } diff --git a/packages/babel-plugin-transform-jsx-to-stylesheet/package.json b/packages/babel-plugin-transform-jsx-to-stylesheet/package.json index 4b2ad99f1a49..0b45f836d1e6 100644 --- a/packages/babel-plugin-transform-jsx-to-stylesheet/package.json +++ b/packages/babel-plugin-transform-jsx-to-stylesheet/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-jsx-to-stylesheet", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Transform stylesheet selector to style in JSX Elements.", "license": "MIT", "main": "src/index.js", diff --git a/packages/babel-plugin-transform-taroapi/package.json b/packages/babel-plugin-transform-taroapi/package.json index 9f7eb771d25d..e61534d91557 100644 --- a/packages/babel-plugin-transform-taroapi/package.json +++ b/packages/babel-plugin-transform-taroapi/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-taroapi", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "main": "dist/index.js", "license": "MIT", "scripts": { @@ -10,7 +10,7 @@ "test": "jest" }, "devDependencies": { - "@tarojs/taro-h5": "2.0.0-beta.1", + "@tarojs/taro-h5": "2.0.0-beta.2", "@types/babel-core": "^6.25.5", "@types/babel-traverse": "^6.25.4", "@types/babel-types": "^7.0.4", diff --git a/packages/css-to-react-native/package.json b/packages/css-to-react-native/package.json index 941bfdab1635..8659b5449776 100644 --- a/packages/css-to-react-native/package.json +++ b/packages/css-to-react-native/package.json @@ -1,7 +1,7 @@ { "name": "taro-css-to-react-native", "description": "Convert CSS text to a React Native stylesheet object", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "main": "dist/index.js", "license": "MIT", "scripts": { diff --git a/packages/eslint-config-taro/package.json b/packages/eslint-config-taro/package.json index 6d785e330be6..a2f5beda5564 100644 --- a/packages/eslint-config-taro/package.json +++ b/packages/eslint-config-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-taro", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro specific linting rules for ESLint", "main": "index.js", "files": [ @@ -28,6 +28,6 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "eslint-plugin-taro": "2.0.0-beta.1" + "eslint-plugin-taro": "2.0.0-beta.2" } } diff --git a/packages/eslint-plugin-taro/package.json b/packages/eslint-plugin-taro/package.json index 36742b856a5d..b80bf158ea7a 100644 --- a/packages/eslint-plugin-taro/package.json +++ b/packages/eslint-plugin-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-taro", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro specific linting plugin for ESLint", "main": "index.js", "files": [ diff --git a/packages/postcss-plugin-constparse/package.json b/packages/postcss-plugin-constparse/package.json index 1eb21fd77234..fa1d07c014ea 100644 --- a/packages/postcss-plugin-constparse/package.json +++ b/packages/postcss-plugin-constparse/package.json @@ -1,6 +1,6 @@ { "name": "postcss-plugin-constparse", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "parse constants defined in config", "main": "index.js", "author": "Simba", diff --git a/packages/postcss-pxtransform/package.json b/packages/postcss-pxtransform/package.json index 8d0fd4e9aca9..6038ea4ae79b 100644 --- a/packages/postcss-pxtransform/package.json +++ b/packages/postcss-pxtransform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-pxtransform", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位", "keywords": [ "postcss", diff --git a/packages/postcss-unit-transform/package.json b/packages/postcss-unit-transform/package.json index c871757711af..e7c668791777 100644 --- a/packages/postcss-unit-transform/package.json +++ b/packages/postcss-unit-transform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-taro-unit-transform", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "小程序单位转换", "main": "index.js", "scripts": { diff --git a/packages/stylelint-config-taro-rn/package.json b/packages/stylelint-config-taro-rn/package.json index 65dc147597d7..b5a04fa1df8f 100644 --- a/packages/stylelint-config-taro-rn/package.json +++ b/packages/stylelint-config-taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "stylelint-config-taro-rn", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Shareable stylelint config for React Native CSS modules", "main": "index.js", "files": [ @@ -28,6 +28,6 @@ "jest": "^23.6.0", "npmpub": "^4.1.0", "stylelint": "9.3.0", - "stylelint-taro-rn": "2.0.0-beta.1" + "stylelint-taro-rn": "2.0.0-beta.2" } } diff --git a/packages/stylelint-taro-rn/package.json b/packages/stylelint-taro-rn/package.json index 62a25567f7e3..27514878bfaf 100644 --- a/packages/stylelint-taro-rn/package.json +++ b/packages/stylelint-taro-rn/package.json @@ -1,7 +1,7 @@ { "name": "stylelint-taro-rn", "description": "A collection of React Native specific rules for stylelint", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "main": "dist/index.js", "babel": { "presets": [ diff --git a/packages/taro-alipay/package.json b/packages/taro-alipay/package.json index 53f9eede1e19..d53f1f44ffe3 100644 --- a/packages/taro-alipay/package.json +++ b/packages/taro-alipay/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-alipay", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro alipay framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.1", - "@tarojs/utils": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/utils": "2.0.0-beta.2", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-async-await/package.json b/packages/taro-async-await/package.json index fd5082078a4f..6af5942c19ac 100644 --- a/packages/taro-async-await/package.json +++ b/packages/taro-async-await/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/async-await", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "taro async await", "main": "index.js", "scripts": { diff --git a/packages/taro-cli/package.json b/packages/taro-cli/package.json index b3dc987420c9..b906426dd3b1 100644 --- a/packages/taro-cli/package.json +++ b/packages/taro-cli/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/cli", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "cli tool for taro", "main": "index.js", "scripts": { @@ -40,8 +40,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taroize": "2.0.0-beta.1", - "@tarojs/transformer-wx": "2.0.0-beta.1", + "@tarojs/taroize": "2.0.0-beta.2", + "@tarojs/transformer-wx": "2.0.0-beta.2", "@types/request": "^2.48.1", "@typescript-eslint/parser": "^2.0.0", "adm-zip": "^0.4.13", @@ -54,7 +54,7 @@ "babel-plugin-remove-dead-code": "^1.3.2", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-define": "^1.3.0", - "babel-plugin-transform-jsx-to-stylesheet": "2.0.0-beta.1", + "babel-plugin-transform-jsx-to-stylesheet": "2.0.0-beta.2", "babel-plugin-transform-react-jsx": "^6.24.1", "babel-plugin-transform-taroapi": "1.3.15", "babel-template": "^6.26.0", @@ -73,11 +73,11 @@ "ejs": "^2.6.1", "envinfo": "^6.0.1", "eslint": "^6.1.0", - "eslint-config-taro": "2.0.0-beta.1", + "eslint-config-taro": "2.0.0-beta.2", "eslint-plugin-import": "^2.8.0", "eslint-plugin-react": "^7.4.0", "eslint-plugin-react-hooks": "^1.6.1", - "eslint-plugin-taro": "2.0.0-beta.1", + "eslint-plugin-taro": "2.0.0-beta.2", "eslint-plugin-typescript": "^0.12.0", "fbjs": "^1.0.0", "find-yarn-workspace-root": "1.2.1", @@ -100,7 +100,7 @@ "postcss-modules-resolve-imports": "^1.3.0", "postcss-modules-scope": "^1.1.0", "postcss-modules-values": "^1.3.0", - "postcss-pxtransform": "2.0.0-beta.1", + "postcss-pxtransform": "2.0.0-beta.2", "postcss-reporter": "^6.0.1", "postcss-taro-unit-transform": "1.2.15", "postcss-url": "^7.3.2", @@ -112,10 +112,10 @@ "semver": "^5.5.0", "shelljs": "^0.8.1", "stylelint": "9.3.0", - "stylelint-config-taro-rn": "2.0.0-beta.1", - "stylelint-taro-rn": "2.0.0-beta.1", + "stylelint-config-taro-rn": "2.0.0-beta.2", + "stylelint-taro-rn": "2.0.0-beta.2", "tapable": "^1.1.3", - "taro-css-to-react-native": "2.0.0-beta.1", + "taro-css-to-react-native": "2.0.0-beta.2", "through2": "^2.0.3", "vinyl": "^2.1.0", "vinyl-fs": "^3.0.2", @@ -124,7 +124,7 @@ "yauzl": "2.10.0" }, "devDependencies": { - "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", "@types/autoprefixer": "^9.1.1", "@types/babel-core": "^6.25.5", "@types/babel-generator": "^6.25.2", diff --git a/packages/taro-components-qa/package.json b/packages/taro-components-qa/package.json index 5001c99420e2..95734eafbda1 100644 --- a/packages/taro-components-qa/package.json +++ b/packages/taro-components-qa/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-qa", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "多端解决方案基础组件(快应用)", "main": "./index.js", "files": [ diff --git a/packages/taro-components-rn/package.json b/packages/taro-components-rn/package.json index c9ea9d61d14f..401915cb8b0f 100644 --- a/packages/taro-components-rn/package.json +++ b/packages/taro-components-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-rn", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "多端解决方案基础组件(RN)", "main": "./dist/index.js", "scripts": { diff --git a/packages/taro-components/package.json b/packages/taro-components/package.json index 067d70ae35d3..571aa705a06a 100644 --- a/packages/taro-components/package.json +++ b/packages/taro-components/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "", "main:h5": "src/index.js", "main": "dist/index.js", @@ -50,14 +50,14 @@ "@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/plugin-transform-react-jsx": "^7.0.0", "@babel/preset-env": "^7.1.5", - "@tarojs/taro-h5": "2.0.0-beta.1", + "@tarojs/taro-h5": "2.0.0-beta.2", "@types/react": "^16.4.6", "@types/urijs": "^1.15.38", "babel-core": "^7.0.0-bridge.0", "babel-eslint": "10.0.1", "babel-jest": "^22.4.4", "babel-loader": "^8.0.5", - "babel-plugin-transform-taroapi": "2.0.0-beta.1", + "babel-plugin-transform-taroapi": "2.0.0-beta.2", "css-loader": "^2.1.1", "file-loader": "^3.0.1", "jest": "^22.4.4", diff --git a/packages/taro-h5/package.json b/packages/taro-h5/package.json index 6a12a2259694..9c865f5c31ec 100644 --- a/packages/taro-h5/package.json +++ b/packages/taro-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-h5", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro h5 framework", "main:h5": "src/index.js", "main": "dist/index.cjs.js", @@ -45,8 +45,8 @@ "@babel/plugin-proposal-object-rest-spread": "^7.3.4", "@babel/plugin-transform-react-jsx": "^7.2.2", "@babel/preset-env": "^7.3.4", - "@tarojs/components": "2.0.0-beta.1", - "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/components": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.2", "babel-core": "7.0.0-bridge.0", "babel-jest": "24.4.0", "eslint": "^4.18.2", diff --git a/packages/taro-jd/package.json b/packages/taro-jd/package.json index fe666092b238..ca34869bc9ba 100644 --- a/packages/taro-jd/package.json +++ b/packages/taro-jd/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-jd", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro jd framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.1", - "@tarojs/utils": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/utils": "2.0.0-beta.2", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index b49f53fdcb11..eb916a6db81f 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Mini app runner for taro", "main": "index.js", "scripts": { @@ -32,8 +32,8 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/taro": "2.0.0-beta.1", - "@tarojs/transformer-wx": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/transformer-wx": "2.0.0-beta.2", "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", @@ -58,7 +58,7 @@ "node-sass": "^4.12.0", "ora": "^3.4.0", "postcss-loader": "^3.0.0", - "postcss-pxtransform": "2.0.0-beta.1", + "postcss-pxtransform": "2.0.0-beta.2", "request": "^2.88.0", "resolve": "^1.11.1", "sass-loader": "^7.1.0", diff --git a/packages/taro-mobx-common/package.json b/packages/taro-mobx-common/package.json index 6ca19f04674d..e665e664efaa 100644 --- a/packages/taro-mobx-common/package.json +++ b/packages/taro-mobx-common/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-common", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "mobx library for taro", "keywords": [ "mobx", diff --git a/packages/taro-mobx-h5/package.json b/packages/taro-mobx-h5/package.json index 4f8e86747366..ebf6808adc34 100644 --- a/packages/taro-mobx-h5/package.json +++ b/packages/taro-mobx-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-h5", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "mobx-h5 for taro", "keywords": [ "mobx", @@ -28,8 +28,8 @@ "nervjs": "^1.5.0" }, "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.1", - "@tarojs/taro-h5": "2.0.0-beta.1" + "@tarojs/mobx-common": "2.0.0-beta.2", + "@tarojs/taro-h5": "2.0.0-beta.2" }, "devDependencies": { "rimraf": "^2.6.2", diff --git a/packages/taro-mobx-rn/package.json b/packages/taro-mobx-rn/package.json index 28557aaa7525..a6d56724e4e5 100644 --- a/packages/taro-mobx-rn/package.json +++ b/packages/taro-mobx-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-rn", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "mobx-rn for taro", "keywords": [ "mobx", @@ -18,7 +18,7 @@ "src" ], "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.1", - "@tarojs/taro-rn": "2.0.0-beta.1" + "@tarojs/mobx-common": "2.0.0-beta.2", + "@tarojs/taro-rn": "2.0.0-beta.2" } } diff --git a/packages/taro-mobx/package.json b/packages/taro-mobx/package.json index 7e8be3860f79..0286f2342414 100644 --- a/packages/taro-mobx/package.json +++ b/packages/taro-mobx/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "mobx for taro", "keywords": [ "mobx", @@ -24,8 +24,8 @@ "clear": "rimraf dist" }, "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.1", - "@tarojs/taro": "2.0.0-beta.1" + "@tarojs/mobx-common": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.2" }, "devDependencies": { "rimraf": "^2.6.2", diff --git a/packages/taro-plugin-babel/package.json b/packages/taro-plugin-babel/package.json index 704ca06a8f26..18b3a43b0e7b 100644 --- a/packages/taro-plugin-babel/package.json +++ b/packages/taro-plugin-babel/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-babel", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro babel编译", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-csso/package.json b/packages/taro-plugin-csso/package.json index f58ef2b09132..5486354596e7 100644 --- a/packages/taro-plugin-csso/package.json +++ b/packages/taro-plugin-csso/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-csso", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro压缩CSS文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-less/package.json b/packages/taro-plugin-less/package.json index 842bbeefb853..ee5a4de60773 100644 --- a/packages/taro-plugin-less/package.json +++ b/packages/taro-plugin-less/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-less", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro 编译 less 文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-sass/package.json b/packages/taro-plugin-sass/package.json index 2dcc383ef0a9..e452f254bcb7 100644 --- a/packages/taro-plugin-sass/package.json +++ b/packages/taro-plugin-sass/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-sass", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro编译sass文件", "main": "index.js", "files": [ diff --git a/packages/taro-plugin-stylus/package.json b/packages/taro-plugin-stylus/package.json index baadd0b200d0..1d64a0640f86 100644 --- a/packages/taro-plugin-stylus/package.json +++ b/packages/taro-plugin-stylus/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-stylus", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro 编译 stylus 文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-typescript/package.json b/packages/taro-plugin-typescript/package.json index 9bdf51665476..e638c40c9770 100644 --- a/packages/taro-plugin-typescript/package.json +++ b/packages/taro-plugin-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-typescript", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro TypeScript 编译插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-uglifyjs/package.json b/packages/taro-plugin-uglifyjs/package.json index 841f4d12aafb..d302350d3c3c 100644 --- a/packages/taro-plugin-uglifyjs/package.json +++ b/packages/taro-plugin-uglifyjs/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-uglifyjs", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro压缩JS文件", "main": "index.js", "scripts": { diff --git a/packages/taro-qq/package.json b/packages/taro-qq/package.json index e9d0008b38f8..85c61a01ec6e 100644 --- a/packages/taro-qq/package.json +++ b/packages/taro-qq/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-qq", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro qq framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.1", - "@tarojs/utils": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/utils": "2.0.0-beta.2", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-quickapp/package.json b/packages/taro-quickapp/package.json index c12d9070a856..f7c8af186875 100644 --- a/packages/taro-quickapp/package.json +++ b/packages/taro-quickapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-quickapp", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro quickapp framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.1", - "@tarojs/utils": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/utils": "2.0.0-beta.2", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-redux-h5/package.json b/packages/taro-redux-h5/package.json index 4c3958cf42cb..e3c67d0ba76d 100644 --- a/packages/taro-redux-h5/package.json +++ b/packages/taro-redux-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/redux-h5", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Forked react-redux for taro", "keywords": [ "react", @@ -46,7 +46,7 @@ "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.49", "@babel/plugin-transform-react-jsx": "^7.0.0-beta.49", "@babel/preset-env": "^7.0.0-beta.49", - "@tarojs/taro-h5": "2.0.0-beta.1", + "@tarojs/taro-h5": "2.0.0-beta.2", "babel-plugin-transform-react-remove-prop-types": "^0.4.13", "redux": "^4.0.0", "rimraf": "^2.6.2", diff --git a/packages/taro-redux-rn/package.json b/packages/taro-redux-rn/package.json index 27c29b2c9941..a21a50cce376 100644 --- a/packages/taro-redux-rn/package.json +++ b/packages/taro-redux-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-redux-rn", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "taro-redux-rn", "main": "./src/index.js", "files": [ diff --git a/packages/taro-redux/package.json b/packages/taro-redux/package.json index d9cea2a4da00..a3182dbe074a 100644 --- a/packages/taro-redux/package.json +++ b/packages/taro-redux/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/redux", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Redux for Taro", "main": "index.js", "typings": "types/index.d.ts", @@ -32,7 +32,7 @@ "jest": "^23.1.0" }, "dependencies": { - "@tarojs/taro": "2.0.0-beta.1", - "@tarojs/utils": "2.0.0-beta.1" + "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/utils": "2.0.0-beta.2" } } diff --git a/packages/taro-rn-runner/package.json b/packages/taro-rn-runner/package.json index e657e75c97c4..4b75039628f5 100644 --- a/packages/taro-rn-runner/package.json +++ b/packages/taro-rn-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-runner", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "ReactNative build tool for taro", "main": "index.js", "scripts": { diff --git a/packages/taro-rn/package.json b/packages/taro-rn/package.json index c7432e9860d3..dcc47cb6b473 100644 --- a/packages/taro-rn/package.json +++ b/packages/taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-rn", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro RN framework", "main": "./index.js", "files": [ @@ -27,7 +27,7 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", "babel-preset-expo": "^5.2.0", "base64-js": "^1.3.0", "expo-av": "^6.0.0", diff --git a/packages/taro-router-rn/package.json b/packages/taro-router-rn/package.json index 60aa056beb82..1e26302671c9 100644 --- a/packages/taro-router-rn/package.json +++ b/packages/taro-router-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-router-rn", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "taro-router-rn", "main": "./index.js", "files": [ diff --git a/packages/taro-router/package.json b/packages/taro-router/package.json index d14ba97f3de6..73ef3e35cd6e 100644 --- a/packages/taro-router/package.json +++ b/packages/taro-router/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/router", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro-router", "main:h5": "dist/index.esm.js", "main": "index.js", @@ -41,7 +41,7 @@ "@babel/plugin-syntax-dynamic-import": "7.0.0", "@babel/plugin-transform-react-jsx": "7.0.0", "@babel/preset-env": "7.1.5", - "@tarojs/taro-h5": "2.0.0-beta.1", + "@tarojs/taro-h5": "2.0.0-beta.2", "@types/history": "4.7.2", "@types/jasmine": "2.8.11", "@types/jest": "23.3.9", diff --git a/packages/taro-swan/package.json b/packages/taro-swan/package.json index 3be276e4634f..fca24c80f827 100644 --- a/packages/taro-swan/package.json +++ b/packages/taro-swan/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-swan", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro swan framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.1", - "@tarojs/utils": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/utils": "2.0.0-beta.2", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-transformer-wx/package.json b/packages/taro-transformer-wx/package.json index 1fa1006dca0a..cdf68fb45c05 100644 --- a/packages/taro-transformer-wx/package.json +++ b/packages/taro-transformer-wx/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/transformer-wx", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Transfrom Nerv Component to Wechat mini program.", "repository": { "type": "git", @@ -61,14 +61,14 @@ "babel-types": "^6.26.0", "eslint": "5.16.0", "eslint-plugin-react": "7.10.0", - "eslint-plugin-taro": "2.0.0-beta.1", + "eslint-plugin-taro": "2.0.0-beta.2", "html": "^1.0.0", "lodash": "^4.17.5", "prettier": "^1.14.2", "typescript": "^3.2.2" }, "devDependencies": { - "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", "@types/babel-core": "^6.25.5", "@types/babel-generator": "^6.25.1", "@types/babel-template": "^6.25.0", diff --git a/packages/taro-tt/package.json b/packages/taro-tt/package.json index 343c8a1479a6..3cc0589edc15 100644 --- a/packages/taro-tt/package.json +++ b/packages/taro-tt/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-tt", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro toutiao framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.1", - "@tarojs/utils": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/utils": "2.0.0-beta.2", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-utils/package.json b/packages/taro-utils/package.json index 6d45f93c9cd4..3d1812d8dbf4 100644 --- a/packages/taro-utils/package.json +++ b/packages/taro-utils/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/utils", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Utils for Taro", "main": "index.js", "scripts": { diff --git a/packages/taro-weapp/package.json b/packages/taro-weapp/package.json index e47ed410713f..d4d0e66f8302 100644 --- a/packages/taro-weapp/package.json +++ b/packages/taro-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-weapp", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro weapp framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.1", - "@tarojs/utils": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/utils": "2.0.0-beta.2", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-webpack-runner/package.json b/packages/taro-webpack-runner/package.json index 7b71fa2f6274..2db5434fa563 100644 --- a/packages/taro-webpack-runner/package.json +++ b/packages/taro-webpack-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack-runner", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "webpack runner for taro", "main": "index.js", "scripts": { @@ -32,15 +32,15 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/plugin-sass": "2.0.0-beta.1", - "@tarojs/taro": "2.0.0-beta.1", - "@tarojs/taro-h5": "2.0.0-beta.1", + "@tarojs/plugin-sass": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/taro-h5": "2.0.0-beta.2", "autoprefixer": "8.6.4", "babel-core": "6.26.0", "babel-loader": "7.1.4", "babel-plugin-syntax-dynamic-import": "6.18.0", "babel-plugin-transform-react-jsx": "6.24.1", - "babel-plugin-transform-taroapi": "2.0.0-beta.1", + "babel-plugin-transform-taroapi": "2.0.0-beta.2", "babel-types": "6.26.0", "chalk": "2.4.2", "copy-webpack-plugin": "^5.0.3", @@ -57,8 +57,8 @@ "opn": "5.3.0", "ora": "2.1.0", "postcss-loader": "2.1.6", - "postcss-plugin-constparse": "2.0.0-beta.1", - "postcss-pxtransform": "2.0.0-beta.1", + "postcss-plugin-constparse": "2.0.0-beta.2", + "postcss-pxtransform": "2.0.0-beta.2", "resolve": "1.8.1", "resolve-url-loader": "2.3.0", "sass": "^1.23.1", diff --git a/packages/taro-with-weapp/package.json b/packages/taro-with-weapp/package.json index 5621c17a3ae1..6a4971c14c2c 100644 --- a/packages/taro-with-weapp/package.json +++ b/packages/taro-with-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/with-weapp", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "taroize 之后的运行时", "main": "index.js", "scripts": { @@ -22,7 +22,7 @@ "author": "yuche", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.1", + "@tarojs/taro": "2.0.0-beta.2", "lodash": "^4.17.11" }, "devDependencies": { diff --git a/packages/taro/package.json b/packages/taro/package.json index 35bffab9efde..e8c767a04695 100644 --- a/packages/taro/package.json +++ b/packages/taro/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "Taro framework", "module": "dist/index.esm.js", "main": "index.js", @@ -29,7 +29,7 @@ "nervjs": "^1.5.0" }, "dependencies": { - "@tarojs/utils": "2.0.0-beta.1" + "@tarojs/utils": "2.0.0-beta.2" }, "devDependencies": { "@types/react": "^16.9.4", diff --git a/packages/taroize/package.json b/packages/taroize/package.json index 0e03b3d496f3..fa640f4a262a 100644 --- a/packages/taroize/package.json +++ b/packages/taroize/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taroize", - "version": "2.0.0-beta.1", + "version": "2.0.0-beta.2", "description": "转换原生微信小程序代码为 Taro 代码", "main": "index.js", "files": [ From 3ca1aa2e201746ef2809ee87f895fb7820402fb2 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 14 Nov 2019 16:30:31 +0800 Subject: [PATCH 092/194] chore: changelog && docs --- CHANGELOG.md | 15 +- docs/config-detail.md | 6 +- .../version-2.0.0-beta.2/config-detail.md | 853 ++++++++++++++++++ .../version-2.0.0-beta.2/config.md | 83 ++ website/versions.json | 1 + 5 files changed, 948 insertions(+), 10 deletions(-) create mode 100644 website/versioned_docs/version-2.0.0-beta.2/config-detail.md create mode 100644 website/versioned_docs/version-2.0.0-beta.2/config.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 57cf1d097325..a8b34367c778 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -142,14 +142,15 @@ ### Bug Fixes -* **mini-runner:** 移除无用代码 ([c1020b1](https://github.com/NervJS/taro/commit/c1020b1)) -* somethings no need ([2c2e503](https://github.com/NervJS/taro/commit/2c2e503)) * **cli:** lerna 加入 taro-mini-runner && 接入 webpack 生成小程序文件 ([93d2970](https://github.com/NervJS/taro/commit/93d2970)) * **cli:** 修复 doctor 对 config 的检测 ([3db882c](https://github.com/NervJS/taro/commit/3db882c)) * **cli:** 修复 watch 时文件修改不对的问题 ([ce3c0de](https://github.com/NervJS/taro/commit/ce3c0de)) * **cli:** 修复代码合并的问题 ([37c0525](https://github.com/NervJS/taro/commit/37c0525)) * **cli:** 修复目录创建 ([05bdd8a](https://github.com/NervJS/taro/commit/05bdd8a)) * **cli:** 修复配置文件中读取不到 process.env.TARO_ENV 的问题 ([b0b1f8f](https://github.com/NervJS/taro/commit/b0b1f8f)) +* **mini-runner:** 修复对 alias 的支持 ([d99bb47](https://github.com/NervJS/taro/commit/d99bb47)) +* **mini-runner:** 移除无用代码 ([c1020b1](https://github.com/NervJS/taro/commit/c1020b1)) +* somethings no need ([2c2e503](https://github.com/NervJS/taro/commit/2c2e503)) * **cli:** 支持引用 node_modules 中组件 ([d21eb65](https://github.com/NervJS/taro/commit/d21eb65)) * **cli:** 普通文件经过编译器编译必须传入 isNormal ([4aed827](https://github.com/NervJS/taro/commit/4aed827)) * **cli:** 更新默认模板 ([f9f80a3](https://github.com/NervJS/taro/commit/f9f80a3)) @@ -164,19 +165,19 @@ * **mini-runner:** 修复 watch bug ([9afbed2](https://github.com/NervJS/taro/commit/9afbed2)) * **mini-runner:** 修复对 css modules 的支持 ([22cd897](https://github.com/NervJS/taro/commit/22cd897)) * **mini-runner:** 修复小程序编译报错 ([677bfba](https://github.com/NervJS/taro/commit/677bfba)) -* **mini-runner:** 修复引用 npm 中组件间存在依赖时依赖路径解析错误的问题 ([f2869f6](https://github.com/NervJS/taro/commit/f2869f6)) * **mini-runner:** 修复快应用打包报错的问题 ([5e59963](https://github.com/NervJS/taro/commit/5e59963)) -* **quickapp:** pull-down-refresh page-scroll ([157da75](https://github.com/NervJS/taro/commit/157da75)) -* position linter for quickapp 1060+ ([fa8d91c](https://github.com/NervJS/taro/commit/fa8d91c)) -* quickapp api upload from docs ([20b681c](https://github.com/NervJS/taro/commit/20b681c)) * **mini-runner:** 修复快应用编译后页面标题展示不正确的问题 ([b523f90](https://github.com/NervJS/taro/commit/b523f90)) * **mini-runner:** 修复普通小程序编译的问题 ([f5a2bc2](https://github.com/NervJS/taro/commit/f5a2bc2)) -* **mini-runner:** 加上文件编译提示 ([61eef34](https://github.com/NervJS/taro/commit/61eef34)) * **mini-runner:** 只有 taro 的包不能经过依赖包名替换 ([498cc7f](https://github.com/NervJS/taro/commit/498cc7f)) * **mini-runner:** 打包优化,引用自 npm 包中的组件不抽离至 vendors 中 ([635f3e2](https://github.com/NervJS/taro/commit/635f3e2)) * **mini-runner:** 提前解析快应用页面 ([d5f72b9](https://github.com/NervJS/taro/commit/d5f72b9)) * **mini-runner:** 支持快应用编译后模板与样式的检测 ([2a8a681](https://github.com/NervJS/taro/commit/2a8a681)) +* **quickapp:** pull-down-refresh page-scroll ([157da75](https://github.com/NervJS/taro/commit/157da75)) +* quickapp api upload from docs ([20b681c](https://github.com/NervJS/taro/commit/20b681c)) * **taro:** 修复快应用下拉刷新问题 ([e429e7d](https://github.com/NervJS/taro/commit/e429e7d)) +* position linter for quickapp 1060+ ([fa8d91c](https://github.com/NervJS/taro/commit/fa8d91c)) +* **mini-runner:** 修复引用 npm 中组件间存在依赖时依赖路径解析错误的问题 ([f2869f6](https://github.com/NervJS/taro/commit/f2869f6)) +* **mini-runner:** 加上文件编译提示 ([61eef34](https://github.com/NervJS/taro/commit/61eef34)) * **taro:** 小程序 webpack 编译静态文件路径 ([9806766](https://github.com/NervJS/taro/commit/9806766)) * **taro-quickapp:** 修复快应用事件绑定异常问题 ([eb3d9e5](https://github.com/NervJS/taro/commit/eb3d9e5)) * pxtransform disable on quick-app ([5ce3139](https://github.com/NervJS/taro/commit/5ce3139)) diff --git a/docs/config-detail.md b/docs/config-detail.md index 308dd82930c2..e01597a7abd7 100644 --- a/docs/config-detail.md +++ b/docs/config-detail.md @@ -301,16 +301,16 @@ mini: { 这个函数会收到两个参数,第一个参数是 webpackChain 对象,可参考 [webpack-chain](https://github.com/neutrinojs/webpack-chain) 的 api 进行修改;第二个参数是 `webpack` 实例。例如: ```jsx -// 这是一个添加 ts-loader 的例子,但事实上 taro 是默认支持 ts 的,并不需要这样做。 +// 这是一个添加 raw-loader 的例子,用于在项目中直接引用 md 文件 { webpackChain (chain, webpack) { chain.merge({ module: { rule: { myloader: { - test: /.tsx?/, + test: /\.md$/, use: [{ - loader: 'ts-loader', + loader: 'raw-loader', options: {} }] } diff --git a/website/versioned_docs/version-2.0.0-beta.2/config-detail.md b/website/versioned_docs/version-2.0.0-beta.2/config-detail.md new file mode 100644 index 000000000000..ed9993f1c4cb --- /dev/null +++ b/website/versioned_docs/version-2.0.0-beta.2/config-detail.md @@ -0,0 +1,853 @@ +--- +title: 编译配置详情 +id: version-2.0.0-beta.2-config-detail +original_id: config-detail +--- + +## designWidth + +`designWidth` 用来设置设计稿尺寸,关于这一部分的配置说明请见[设计稿及尺寸单位](./size.md)这一章节。 + +## sourceRoot + +`sourceRoot` 用来设置源码存放目录,通过 Taro 开发工具初始化后的项目源码目录都是 `src`,你可以通过修改这一配置来重新指定源码目录。 + +## outputRoot + +`outputRoot` 用来设置代码编译后的生产目录,通过 Taro 开发工具初始化后的生产目录都是 `dist`,你可以通过修改这一配置来重新指定生产目录。 + +## plugins + +`plugins` 用来设置编译过程插件,插件机制基于 实现,目前暴露了两个钩子 `beforeBuild` 和 `afterBuild` + +其中,`beforeBuild` 将在整体编译前触发,可以获取到编译的相关配置,同时也能进行修改 + +`afterBuild` 将在 webpack 编译完后执行,可以获取到编译后的结果 + +具体使用方式如下: + +首先定义一个插件 + +```js +class BuildPlugin { + apply (builder) { + builder.hooks.beforeBuild.tap('BuildPlugin', (config) => { + console.log(config) + }) + + builder.hooks.afterBuild.tap('BuildPlugin', (stats) => { + console.log(stats) + }) + } +} +``` + +接下来在 `plugins` 字段中进行配置 + +```js +{ + plugins: [ + new BuildPlugin() + ] +} +``` + +## babel + +用来配置 `babel`,默认配置如下,可以自行添加自己需要的额外的 `presets` 及 `plugins`。 + +```jsx +babel: { + sourceMap: true, + presets: [ + 'env' + ], + plugins: [ + 'transform-class-properties', + 'transform-decorators-legacy', + 'transform-object-rest-spread' + ] +} +``` + +## uglify + +用来配置 `UgligyJS` 工具,设置打包过程中的 JS 代码压缩。可以通过 `uglify.enable` 来设置是否开启压缩,若设置开启,则可以通过 `uglify.config` 来设置 `UgligyJS` 的配置项,具体配置方式如下: + +```jsx +uglify: { + enable: true, + config: { + // 配置项同 https://github.com/mishoo/UglifyJS2#minify-options + } +} +``` + +## csso + +用来配置 `csso` 工具,设置打包过程中的 CSS 代码压缩。可以通过 `csso.enable` 来设置是否开启压缩,若设置开启,则可以通过 `csso.config` 来设置 `csso` 的配置项,具体配置方式如下: + +```jsx +csso: { + enable: true, + config: { + // 配置项同 https://github.com/css/csso#minifysource-options + } +} +``` + +## sass + +用来配置 `sass` 工具,设置打包过程中的 SCSS 代码编译。 +具体配置可以参考[node-sass](https://www.npmjs.com/package/node-sass) +当需要全局注入scss文件时,可以添加三个额外参数:`resource` 、 `projectDirectory` (v1.2.25开始支持)、`data`(v1.3.0开始支持),具体配置方式如下: + +#### 单文件路径形式 + +当只有 `resource` 字段时,可以传入 scss 文件的绝对路径。 + +```js +sass: { + resource: path.resolve(__dirname, '..', 'src/styles/variable.scss') +} +``` + +#### 多文件路径形式 + +此外,当只有 `resource` 字段时,也可以传入一个路径数组。 + +```js +sass: { + resource: [ + path.resolve(__dirname, '..', 'src/styles/variable.scss'), + path.resolve(__dirname, '..', 'src/styles/mixins.scss') + ] +} +``` + +#### 指定项目根目录路径形式 + +你可以额外配置 `projectDirectory` 字段,这样你就可以在 `resource` 里写相对路径了。 + +```js +sass: { + resource: [ + 'src/styles/variable.scss', + 'src/styles/mixins.scss' + ], + projectDirectory: path.resolve(__dirname, '..') +} +``` + +#### 传入 scss 变量字符串 + +```js +sass: { + resource: [ + 'src/styles/variable.scss', + 'src/styles/mixins.scss' + ], + projectDirectory: path.resolve(__dirname, '..'), + data: '$nav-height: 48px;' +} +``` + +* resource: 如果要引入多个文件,支持数组形式传入 +* projectDirectory: 项目根目录的绝对地址(若为小程序云开发模板,则应该是client目录) +* data: 全局 scss 变量,若 data 与 resource 中设置了同样的变量,则 data 的优先级高于 resource + +## env + +用来设置一些环境变量如 `process.env.NODE_ENV`,例如我们想设置区分预览、打包来做些不同的操作,可以如下配置: + +在 `config/dev.js` 中: + +```jsx +env: { + NODE_ENV: '"development"' // JSON.stringify('development') +} +``` + +在 `config/prod.js` 中: + +```jsx +env: { + NODE_ENV: '"production"' // JSON.stringify('production') +} +``` + +这样就能在代码中通过 `process.env.NODE_ENV === 'development'` 来判断环境。 + +## defineConstants + +用来配置一些全局变量供代码中进行使用,例如: + +```js +defineConstants: { + A: '"a"' // JSON.stringify('a') +} +``` + +## alias + +> `1.2.0` 开始支持。 + +用来配置目录别名,从而方便书写代码引用路径。例如,使用相对路径书写文件引用如下: + +```js +import A from '../../componnets/A' +import Utils from '../../utils' +import packageJson from '../../package.json' +import projectConfig from '../../project.config.json' +``` + +为了避免书写多级相对路径,我们可以如下配置 `alias`: + +```js +alias: { + '@/components': path.resolve(__dirname, '..', 'src/components'), + '@/utils': path.resolve(__dirname, '..', 'src/utils'), + '@/package': path.resolve(__dirname, '..', 'package.json'), + '@/project': path.resolve(__dirname, '..', 'project.config.json'), +} +``` + +通过上述配置,可以将 `src/components` 和 `src/utils` 目录配置成别名,将根目录下的 `package.json` 和 `project.config.json` 文件配置成别名,则代码中的引用改写如下: + +```js +import A from '@/components/A' +import Utils from '@/utils' +import packageJson from '@/package' +import projectConfig from '@/project' +``` + +为了让编辑器(VS Code)不报错,并继续使用自动路径补全的功能,需要在项目根目录下的 `jsconfig.json` 或者 `tsconfig.json` 中配置 `paths` 让编辑器认得我们的别名,形式如下: + +```json +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/components/*": ["./src/components/*"], + "@/utils/*": ["./src/utils/*"], + "@/package": ["./package.json"], + "@/project": ["./project.config.json"], + } + } +} +``` + +*建议别名使用 `@/` 开头而非仅用 `@` 开头,因为有小概率会与某些 `scoped` 形式的 `npm` 包(行如:[@tarojs/taro](https://npm.im/@tarojs/taro), [@babel/core](https://npm.im/@babel/core))产生命名冲突。* + +## copy + +文件 copy 配置,包含两个配置项 `patterns` 和 `options`。 + +### copy.patterns + +用来指定需要拷贝的文件或者目录,**数组类型**,每一项都必须包含 `from` 、`to` 的配置,分别代表来源和需要拷贝到的目录,同时可以设置 `ignore` 配置来指定需要忽略的文件, `ignore` 是指定的 [glob](https://github.com/isaacs/node-glob) 类型字符串,或者 glob 字符串数组。 + +值得注意的是,目前 `from` 必须指定存在的文件或者目录,暂不支持 glob 格式, `from` 和 `to` 直接置顶项目根目录下的文件目录,建议 `from` 以 `src` 目录开头,`to` 以 `dist` 目录开头。 + +一般有如下的使用形式: + +```jsx +copy: { + patterns: [ + { from: 'src/asset/tt/', to: 'dist/asset/tt/', ignore: '*.js' }, // 指定需要 copy 的目录 + { from: 'src/asset/tt/sd.jpg', to: 'dist/asset/tt/sd.jpg' } // 指定需要 copy 的文件 + ] +}, +``` + +### copy.options + +拷贝配置,目前可以指定全局的 ignore: + +```jsx +copy: { + options: { + ignore: ['*.js', '*.css'] // 全局的 ignore + } +} +``` + +## mini + +专属于小程序的配置。 + +### mini.compile + +小程序编译过程的相关配置。 + +#### mini.compile.compressTemplate + +决定小程序打包时是否需要压缩 wxml + +#### mini.compile.exclude + +配置小程序编译过程中排除不需要经过 Taro 编译的文件,数组类型,写文件路径,文件路径必须以源码所在 `src` 目录开头: + +```jsx +mini: { + compile: { + exclude: ['src/components/ec-canvas/echarts.js'] + } +} +``` + +### mini.webpackChain + +自定义 Webpack 配置,接受函数形式的配置。 + +这个函数会收到两个参数,第一个参数是 webpackChain 对象,可参考 [webpack-chain](https://github.com/neutrinojs/webpack-chain) 的 api 进行修改;第二个参数是 `webpack` 实例。例如: + +```jsx +// 这是一个添加 raw-loader 的例子,用于在项目中直接引用 md 文件 +{ + webpackChain (chain, webpack) { + chain.merge({ + module: { + rule: { + myloader: { + test: /\.md$/, + use: [{ + loader: 'raw-loader', + options: {} + }] + } + } + } + }) + } +} +``` + +```jsx +// 这是一个添加插件的例子 +{ + webpackChain (chain, webpack) { + chain.merge({ + plugin: { + install: { + plugin: require('npm-install-webpack-plugin'), + args: [{ + // Use --save or --save-dev + dev: false, + // Install missing peerDependencies + peerDependencies: true, + // Reduce amount of console logging + quiet: false, + // npm command used inside company, yarn is not supported yet + npm: 'cnpm' + }] + } + } + }) + } +} +``` + +### mini.cssLoaderOption + +css-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/css-loader),例如: + +```jsx +{ + cssLoaderOption: { + localIdentName: '[hash:base64]' + } +} +``` + +### mini.styleLoaderOption + +style-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/style-loader),例如: + +```jsx +{ + styleLoaderOption: { + insertAt: 'top' + } +} +``` + +### mini.sassLoaderOption + +sass-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/sass-loader),例如: + +```jsx +{ + sassLoaderOption: { + implementation: require("dart-sass") + } +} +``` + +### mini.lessLoaderOption + +less-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/less-loader),例如: + +```jsx +{ + lessLoaderOption: { + strictMath: true, + noIeCompat: true + } +} +``` + +### mini.stylusLoaderOption + +stylus-loader 的附加配置。配置项参考[官方文档](https://github.com/shama/stylus-loader)。 + +### mini.mediaUrlLoaderOption + +针对 `mp4 | webm | ogg | mp3 | wav | flac | aac` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader),例如: + +```jsx +{ + mediaUrlLoaderOption: { + limit: 8192 + } +} +``` + +### mini.fontUrlLoaderOption + +针对 `woff | woff2 | eot | ttf | otf` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader)。 + +### mini.imageUrlLoaderOption + +针对 `png | jpg | jpeg | gif | bpm | svg` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader)。 + +### mini.miniCssExtractPluginOption + +`mini-css-extract-plugin` 的附加配置,在 `enableExtract` 为 `true` 的情况下生效。 +配置项参考[官方文档](https://github.com/webpack-contrib/mini-css-extract-plugin),例如: + +```jsx +{ + miniCssExtractPluginOption: { + filename: '[name].css', + chunkFilename: '[name].css' + } +} +``` + +### mini.postcss + +配置 `postcss` 相关插件: + +```jsx +postcss: { + // 可以进行 autoprefixer 的配置。配置项参考官方文档 https://github.com/postcss/autoprefixer + autoprefixer: { + enable: true, + config: { + // autoprefixer 配置项 + } + }, + pxtransform: { + enable: true, + config: { + // pxtransform 配置项,参考尺寸章节 + selectorBlackList: ['body'] + } + }, + // 小程序端样式引用本地资源内联 + url: { + enable: true, + config: { + limit: 10240 // 设定转换尺寸上限 + } + }, + // css modules 功能开关与相关配置 + cssModules: { + enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true + config: { + generateScopedName: '[name]__[local]___[hash:base64:5]' + } + } +} +``` + +## h5 + +专属于 H5 的配置。 + +### h5.devServer + +预览服务的配置,可以更改端口等参数。具体配置参考 [webpack-dev-server](https://webpack.js.org/configuration/dev-server)。 + +```js +devServer: { + port: 10086 +} +``` + +默认是 `http` 服务,如果想开启 `https` 服务需要做如下配置。 + +```js +devServer: { + https: true +} +``` + +### h5.output + +输出配置 + +```js +output: { + filename: 'js/[name].[hash:8].js', + chunkFilename: 'js/[name].[chunkhash:8].js' +} +``` + +### h5.publicPath + +设置输出解析文件的目录。 + +### h5.staticDirectory + +h5 编译后的静态文件目录。 + +### h5.chunkDirectory + +编译后非 entry 的 js 文件的存放目录,主要影响动态引入的 `pages` 的存放路径。 + +### h5.webpackChain + +自定义 Webpack 配置,接受函数形式的配置。 + +这个函数会收到两个参数,第一个参数是 webpackChain 对象,可参考 [webpack-chain](https://github.com/neutrinojs/webpack-chain) 的 api 进行修改;第二个参数是 `webpack` 实例。例如: + +```jsx +// 这是一个添加 ts-loader 的例子,但事实上 taro 是默认支持 ts 的,并不需要这样做。 +{ + webpackChain (chain, webpack) { + chain.merge({ + module: { + rule: { + myloader: { + test: /.tsx?/, + use: [{ + loader: 'ts-loader', + options: {} + }] + } + } + } + }) + } +} +``` + +```jsx +// 这是一个添加插件的例子 +{ + webpackChain (chain, webpack) { + chain.merge({ + plugin: { + install: { + plugin: require('npm-install-webpack-plugin'), + args: [{ + // Use --save or --save-dev + dev: false, + // Install missing peerDependencies + peerDependencies: true, + // Reduce amount of console logging + quiet: false, + // npm command used inside company, yarn is not supported yet + npm: 'cnpm' + }] + } + } + }) + } +} +``` + +### [DEPRECATED]h5.webpack + +自定义 Webpack 配置。这个配置项支持两种形式的配置: + +1. 如果该配置项以**对象**的形态呈现,Taro 将会使用 `webpack-merge` 将这个对象合并到默认的配置项中。 +例子: + +```jsx +webpack: { + resolve: { + alias: { + 'test': './test' + } + } +} +``` + +2. 如果该配置以**函数**的形态呈现,那这个函数将会接收到两个参数:默认配置(defaultConfig)和 Webpack 实例(webpack)。Taro 将会以该函数的返回值作为最终的 Webpack 配置。 + +例子: + +```jsx +webpack (defaultConfig, webpack) { + defaultConfig.plugins.push( + new webpack.EnvironmentPlugin(['NODE_ENV']) + ) + return defaultConfig +} +``` + +### h5.router + +路由相关的配置,支持路由模式、路由基准路径以及自定义路由的配置。 + +#### h5.router.mode + +路由模式配置。配置值为 `hash`(默认值)或 `browser`,分别对应 hash 路由模式和浏览器 history 路由模式。例子: + +```js +h5: { + /* 其他配置 */ + ... , + router: { + mode: 'hash' // 或者是 'browser' + } +} +``` + +针对上面的配置,调用 `Taro.navigateTo({ url: '/pages/index/index' })` 后,浏览器地址栏将被变为 `http://{{domain}}/#/pages/index/index`(hash 模式)或者 `http://{{domain}}/pages/index/index`(browser 模式)。 + +#### h5.router.basename + +路由基准路径的配置,配置值为 `string` 类型。例子: + +```js +h5: { + /* 其他配置 */ + ... , + router: { + basename: '/myapp' + } +} +``` + +针对上面的配置,调用 `Taro.navigateTo({ url: '/pages/index/index' })` 后,浏览器地址栏将被变为 `http://{{domain}}/#/myapp/pages/index/index`(hash 模式)或者 `http://{{domain}}/myapp/pages/index/index`(browser 模式)。 + +#### h5.router.customRoutes + +自定义路由的配置,配置值为 `{ [key: string]: string }` 类型。例子: + +```js +h5: { + /* 其他配置 */ + ... , + router: { + customRoutes: { + '/pages/index/index': '/index' + } + } +} +``` + +针对上面的配置,调用 `Taro.navigateTo({ url: '/pages/index/index' })` 后,浏览器地址栏将被变为 `http://{{domain}}/#/index`(hash 模式)或者 `http://{{domain}}/myapp/index`(browser 模式)。 + +### h5.entry + +Taro app 的入口,同 [webpack.entry](https://webpack.js.org/configuration/entry-context/#entry)。 + +```jsx +{ + entry: { + home: ['./home.js'], + about: ['./about.js'], + contact: ['./contact.js'] + } +} +``` + +### h5.enableSourceMap + +sourceMap 开关,影响 js、css 的 sourceMap 配置。 +dev 状态默认 **开**,prod 状态默认 **关**。 + +### h5.enableDll + +dll 开关,开启后将使用 `dllPlugin` 把内置的部分依赖库打包为单独的 dll 文件, +某种程度上可以减少首屏单个文件体积。 +dev 状态默认 **关**,prod 状态默认 **开**。 + +### h5.dllWebpackChain + +同 `h5.webpackChain`,不过作用于 dll。 + +### h5.dllEntry + +dll编译过程的 `entry` 配置项,决定了 dll 文件的内容,可参考 [webpack.entry](https://webpack.js.org/configuration/entry-context/#entry)。默认值: + +```js +h5: { + /* 其他配置 */ + ..., + dllEntry: { + lib: ['nervjs', '@tarojs/taro-h5', '@tarojs/router', '@tarojs/components'] + } +} +``` + +### h5.enableExtract + +extract 功能开关,开启后将使用 `mini-css-extract-plugin` 分离 css 文件, +可通过 `h5.miniCssExtractPluginOption` 对插件进行配置。 +dev 状态默认 **关**,prod 状态默认 **开**。 + +### h5.esnextModules + +配置需要额外的编译的源码模块,比如 [taro-ui](https://github.com/NervJS/taro-ui): + +```javascript +h5: { + // 经过这一配置之后,代码中引入的处于 `node_modules/taro-ui/` 路径下的源码文件均会经过taro的编译处理。 + esnextModules: ['taro-ui'], + ... +} +``` + +### h5.cssLoaderOption + +css-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/css-loader),例如: + +```jsx +{ + cssLoaderOption: { + localIdentName: '[hash:base64]' + } +} +``` + +### h5.styleLoaderOption + +style-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/style-loader),例如: + +```jsx +{ + styleLoaderOption: { + insertAt: 'top' + } +} +``` + +### h5.sassLoaderOption + +sass-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/sass-loader),例如: + +```jsx +{ + sassLoaderOption: { + implementation: require("dart-sass") + } +} +``` + +### h5.lessLoaderOption + +less-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/less-loader),例如: + +```jsx +{ + lessLoaderOption: { + strictMath: true, + noIeCompat: true + } +} +``` + +### h5.stylusLoaderOption + +stylus-loader 的附加配置。配置项参考[官方文档](https://github.com/shama/stylus-loader)。 + +### h5.mediaUrlLoaderOption + +针对 `mp4 | webm | ogg | mp3 | wav | flac | aac` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader),例如: + +```jsx +{ + mediaUrlLoaderOption: { + limit: 8192 + } +} +``` + +### h5.fontUrlLoaderOption + +针对 `woff | woff2 | eot | ttf | otf` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader)。 + +### h5.imageUrlLoaderOption + +针对 `png | jpg | jpeg | gif | bpm | svg` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader)。 + +### h5.miniCssExtractPluginOption + +`mini-css-extract-plugin` 的附加配置,在 `enableExtract` 为 `true` 的情况下生效。 +配置项参考[官方文档](https://github.com/webpack-contrib/mini-css-extract-plugin),例如: + +```jsx +{ + miniCssExtractPluginOption: { + filename: 'css/[name].css', + chunkFilename: 'css/[id].css' + } +} +``` + +### h5.postcss + +配置 H5 的 `postcss` 插件。 + +#### h5.postcss.autoprefixer + +可以进行 `autoprefixer` 的配置。配置项参考[官方文档](https://github.com/postcss/autoprefixer),例如: + +```jsx +postcss: { + autoprefixer: { + enable: true, + config: { + /* autoprefixer 配置项 */ + } + } +} +``` + +#### h5.postcss.pxtransform + +可以进行 `pxtransform` 的配置。配置项参考[官方文档](https://github.com/Pines-Cheng/postcss-pxtransform/),例如: + +```jsx +postcss: { + pxtransform: { + enable: true, + config: { + /* pxtransform 配置项 */ + } + } +} +``` + +#### h5.postcss.cssModules + +可以进行 H5 端 CSS Modules 配置,配置如下: + +```js +postcss: { + // css modules 功能开关与相关配置 + cssModules: { + enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true + config: { + namingPattern: 'module', + generateScopedName: '[name]__[local]___[hash:base64:5]' + } + } +} +``` diff --git a/website/versioned_docs/version-2.0.0-beta.2/config.md b/website/versioned_docs/version-2.0.0-beta.2/config.md new file mode 100644 index 000000000000..175459ba268f --- /dev/null +++ b/website/versioned_docs/version-2.0.0-beta.2/config.md @@ -0,0 +1,83 @@ +--- +title: 编译配置 +id: version-2.0.0-beta.2-config +original_id: config +--- + +编译配置存放于项目根目录下 `config` 目录中,包含三个文件 + +- `index.js` 是通用配置 +- `dev.js` 是项目预览时的配置 +- `prod.js` 是项目打包时的配置 + +## index.js —— 通用配置 + +```js +const config = { + // 项目名称 + projectName: 'kj', + // 项目创建日期 + date: '2018-6-8', + // 设计稿尺寸 + designWidth: 750, + // 项目源码目录 + sourceRoot: 'src', + // 项目产出目录 + outputRoot: 'dist', + // babel 编译配置 + babel: { + sourceMap: true, + presets: ['env'], + plugins: ['transform-class-properties', 'transform-decorators-legacy', 'transform-object-rest-spread'] + }, + // 编译插件配置 + plugins: [], + // 全局变量设置 + defineConstants: {}, + // 文件 copy 配置 + copy: { + patterns: [ + ], + options: { + } + }, + // 小程序端专用配置 + weapp: { + postcss: { + autoprefixer: { + enable: true + }, + // 小程序端样式引用本地资源内联配置 + url: { + enable: true, + config: { + limit: 10240 + } + } + }, + // 替换 JSX 中的属性名,参考: + // https://github.com/NervJS/taro/issues/2077 + jsxAttributeNameReplace: {} + }, + // H5 端专用配置 + h5: { + publicPath: '/', + staticDirectory: 'static', + postcss: { + autoprefixer: { + enable: true + } + }, + // 自定义 Webpack 配置 + webpackChain: {}, + devServer: {} + } +}; + +module.exports = function(merge) { + if (process.env.NODE_ENV === 'development') { + return merge({}, config, require('./dev')); + } + return merge({}, config, require('./prod')); +}; +``` diff --git a/website/versions.json b/website/versions.json index 4a1cdd6cef67..072c90002d55 100644 --- a/website/versions.json +++ b/website/versions.json @@ -1,4 +1,5 @@ [ + "2.0.0-beta.2", "1.3.34", "1.3.33", "1.3.32", From cd264dd8e4234afaac013a4163edf0e2e77253ce Mon Sep 17 00:00:00 2001 From: Garfield Lee Date: Fri, 15 Nov 2019 11:40:04 +0800 Subject: [PATCH 093/194] =?UTF-8?q?fix(taro-cli):=20update=20package=20lis?= =?UTF-8?q?t=20=E6=96=B0=E5=A2=9E=20@tarojs/mini-runner=EF=BC=8C=E5=AF=B9?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/util/constants.ts | 51 +++++++++++++------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/packages/taro-cli/src/util/constants.ts b/packages/taro-cli/src/util/constants.ts index c63a44dc4ea0..3bf24c326629 100644 --- a/packages/taro-cli/src/util/constants.ts +++ b/packages/taro-cli/src/util/constants.ts @@ -302,48 +302,49 @@ export const FILE_PROCESSOR_MAP = { } export const UPDATE_PACKAGE_LIST = [ - '@tarojs/taro', '@tarojs/async-await', '@tarojs/cli', - '@tarojs/components', - '@tarojs/components-rn', '@tarojs/components-qa', - '@tarojs/taro-h5', - '@tarojs/taro-tt', - '@tarojs/taro-qq', - '@tarojs/taro-jd', - '@tarojs/taro-quickapp', - '@tarojs/taro-swan', - '@tarojs/taro-alipay', + '@tarojs/components-rn', + '@tarojs/components', + '@tarojs/mini-runner', + '@tarojs/mobx-common', + '@tarojs/mobx-h5', + '@tarojs/mobx-rn', + '@tarojs/mobx', '@tarojs/plugin-babel', '@tarojs/plugin-csso', - '@tarojs/plugin-sass', '@tarojs/plugin-less', + '@tarojs/plugin-sass', '@tarojs/plugin-stylus', '@tarojs/plugin-uglifyjs', - '@tarojs/redux', '@tarojs/redux-h5', - '@tarojs/taro-redux-rn', - '@tarojs/taro-router-rn', - '@tarojs/taro-rn', + '@tarojs/redux', '@tarojs/rn-runner', '@tarojs/router', + '@tarojs/taro-alipay', + '@tarojs/taro-h5', + '@tarojs/taro-jd', + '@tarojs/taro-qq', + '@tarojs/taro-quickapp', + '@tarojs/taro-redux-rn', + '@tarojs/taro-rn', + '@tarojs/taro-router-rn', + '@tarojs/taro-swan', + '@tarojs/taro-tt', '@tarojs/taro-weapp', + '@tarojs/taro', '@tarojs/webpack-runner', - 'postcss-plugin-constparse', + 'babel-plugin-transform-jsx-to-stylesheet', 'eslint-config-taro', 'eslint-plugin-taro', - 'taro-transformer-wx', - 'postcss-pxtransform', - 'babel-plugin-transform-jsx-to-stylesheet', - '@tarojs/mobx', - '@tarojs/mobx-h5', - '@tarojs/mobx-rn', - '@tarojs/mobx-common', - 'nervjs', 'nerv-devtools', + 'nervjs', + 'postcss-plugin-constparse', + 'postcss-pxtransform', 'stylelint-config-taro-rn', - 'stylelint-taro-rn' + 'stylelint-taro-rn', + 'taro-transformer-wx' ] export enum PARSE_AST_TYPE { From 2a4bd9867df8fced0bc289e01ed96754d5a43b3f Mon Sep 17 00:00:00 2001 From: luckyadam Date: Mon, 18 Nov 2019 22:14:48 +0800 Subject: [PATCH 094/194] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E7=BC=96=E7=A8=8B=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/async-await.md | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/docs/async-await.md b/docs/async-await.md index 35e29fb50858..62ec1140311a 100644 --- a/docs/async-await.md +++ b/docs/async-await.md @@ -2,19 +2,40 @@ title: 异步编程 --- -Taro 支持使用 `async functions` 来让开发者获得不错的异步编程体验,开启 `async functions` 支持需要安装包 `@tarojs/async-await` +Taro 支持使用 `async functions` 来让开发者获得不错的异步编程体验,开启 `async functions` 支持需要使用到 `babel-plugin-transform-runtime` 插件,请按如下操作 + +首先需要在项目中分别安装 `babel-plugin-transform-runtime` 和 `babel-runtime` 两个包 ```bash -$ yarn add @tarojs/async-await -# 或者使用 npm -$ npm install --save @tarojs/async-await +$ yarn add babel-plugin-transform-runtime --dev +$ yarn add babel-runtime ``` -随后在项目入口文件 `app.js` 中直接 `import` ,就可以开始使用 `async functions` 功能了 +随后修改项目 [`babel` 配置](./config-detail.md#babel),增加插件 `babel-plugin-transform-runtime` -```javascript -// src/app.js -import '@tarojs/async-await' +```js +babel: { + sourceMap: true, + presets: [ + [ + 'env', + { + modules: false + } + ] + ], + plugins: [ + 'transform-decorators-legacy', + 'transform-class-properties', + 'transform-object-rest-spread', + ['transform-runtime', { + "helpers": false, + "polyfill": false, + "regenerator": true, + "moduleName": 'babel-runtime' + }] + ] +} ``` -> 值得注意的事,使用 `@tarojs/async-await` 一定要记得按照[开发前注意](./before-dev-remind.md)中提示的内容进行操作,否则会出现报错 +这样就能直接在项目中使用 `async functions` 了。 From 6ccfe83fb882b08080776415ab570c801fb4d196 Mon Sep 17 00:00:00 2001 From: Garfield Lee Date: Tue, 19 Nov 2019 10:22:14 +0800 Subject: [PATCH 095/194] =?UTF-8?q?feat(docs):=20=E6=9B=B4=E6=96=B0=202.0?= =?UTF-8?q?=20=E7=89=88=E6=9C=AC=E4=BD=BF=E7=94=A8=20async-await=20?= =?UTF-8?q?=E7=9A=84=E6=96=87=E6=A1=A3=20#4837?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/async-await.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/async-await.md b/docs/async-await.md index 62ec1140311a..46df985322c6 100644 --- a/docs/async-await.md +++ b/docs/async-await.md @@ -2,16 +2,16 @@ title: 异步编程 --- -Taro 支持使用 `async functions` 来让开发者获得不错的异步编程体验,开启 `async functions` 支持需要使用到 `babel-plugin-transform-runtime` 插件,请按如下操作 +> Taro 2.x 版本中使用 `async-await` 不再需要 `@tarojs/async-await`。 -首先需要在项目中分别安装 `babel-plugin-transform-runtime` 和 `babel-runtime` 两个包 +Taro 支持使用 `async functions` 来让开发者获得不错的异步编程体验,开启 `async functions` 支持需要安装包 `babel-plugin-transform-runtime` 和 `babel-runtime`。 ```bash $ yarn add babel-plugin-transform-runtime --dev $ yarn add babel-runtime ``` -随后修改项目 [`babel` 配置](./config-detail.md#babel),增加插件 `babel-plugin-transform-runtime` +随后修改项目 [`babel` 配置](./config-detail.md#babel),增加插件 `babel-plugin-transform-runtime`。 ```js babel: { @@ -38,4 +38,4 @@ babel: { } ``` -这样就能直接在项目中使用 `async functions` 了。 +> 值得注意的事,使用 `async functions` 一定要记得按照[开发前注意](./before-dev-remind.md)中提示的内容进行操作,否则会出现报错 From d8898f1c5a52ea63f5853604fc3fbc43293db113 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 19 Nov 2019 16:56:24 +0800 Subject: [PATCH 096/194] =?UTF-8?q?fix(mini-runner):=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E6=94=AF=E6=8C=81=E7=BB=9F=E4=B8=80=E4=BB=8E?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=85=A5=E5=8F=A3=E6=96=87=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/MiniPlugin.ts | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 5ad4d3b56ae1..9781d817780a 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -331,17 +331,19 @@ export default class MiniPlugin { const { buildAdapter, alias } = this.options components.forEach(component => { let componentPath = component.path - let realComponentPath - if (componentPath && isNpmPkg(componentPath)) { - if (isAliasPath(componentPath, alias)) { - componentPath = replaceAliasPath(filePath, componentPath, alias) - realComponentPath = resolveScriptPath(path.resolve(filePath, '..', componentPath as string)) - } else { - const res = resolveNpmSync(componentPath, this.context) - const code = fs.readFileSync(res).toString() - const newComponent = Object.assign({}, component, { path: res }) - realComponentPath = this.getNpmComponentRealPath(code, newComponent, buildAdapter) + let realComponentPath = componentPath + if (componentPath) { + if (isNpmPkg(componentPath)) { + if (isAliasPath(componentPath, alias)) { + componentPath = replaceAliasPath(filePath, componentPath, alias) + realComponentPath = resolveScriptPath(path.resolve(filePath, '..', componentPath as string)) + } else { + realComponentPath = resolveNpmSync(componentPath, this.context) + } } + const code = fs.readFileSync(realComponentPath).toString() + const newComponent = Object.assign({}, component, { path: realComponentPath }) + realComponentPath = this.getNpmComponentRealPath(code, newComponent, buildAdapter) component.path = realComponentPath } }) From 174c7b23f17da0f40dc2d3c4058c94792d43ef43 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 19 Nov 2019 17:08:26 +0800 Subject: [PATCH 097/194] =?UTF-8?q?fix(mini-runner):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E6=97=B6=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/MiniPlugin.ts | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts index 9781d817780a..dea3979dec58 100644 --- a/packages/taro-mini-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-mini-runner/src/plugins/MiniPlugin.ts @@ -327,11 +327,11 @@ export default class MiniPlugin { return componentRealPath } - transfromComponentsPath (filePath, components: IComponentObj[]) { + transformComponentsPath (filePath, components: IComponentObj[]) { const { buildAdapter, alias } = this.options components.forEach(component => { let componentPath = component.path - let realComponentPath = componentPath + let realComponentPath if (componentPath) { if (isNpmPkg(componentPath)) { if (isAliasPath(componentPath, alias)) { @@ -340,6 +340,8 @@ export default class MiniPlugin { } else { realComponentPath = resolveNpmSync(componentPath, this.context) } + } else { + realComponentPath = resolveScriptPath(path.resolve(filePath, '..', componentPath as string)) } const code = fs.readFileSync(realComponentPath).toString() const newComponent = Object.assign({}, component, { path: realComponentPath }) @@ -398,7 +400,11 @@ export default class MiniPlugin { } } - getPages (compiler) { + getShowPath (filePath) { + return filePath.replace(this.context, '').replace(/\\/g, '/').replace(/^\//, '') + } + + getPages () { const { buildAdapter } = this.options const appEntry = this.appEntry const code = fs.readFileSync(appEntry).toString() @@ -415,7 +421,7 @@ export default class MiniPlugin { if (!appPages || appPages.length === 0) { throw new Error('缺少页面') } - printLog(processTypeEnum.COMPILE, '发现入口', appEntry) + printLog(processTypeEnum.COMPILE, '发现入口', this.getShowPath(appEntry)) this.getSubPackages(configObj) this.getTabBarFiles(configObj) const template = '' @@ -607,7 +613,7 @@ export default class MiniPlugin { code = transformResult.code } depComponents = depComponents.filter(item => !/^plugin:\/\//.test(item.path)) - this.transfromComponentsPath(file.path, depComponents) + this.transformComponentsPath(file.path, depComponents) if (isQuickApp) { const scriptPath = file.path const outputScriptPath = scriptPath.replace(this.sourceDir, this.outputDir).replace(path.extname(scriptPath), MINI_APP_FILES[buildAdapter].SCRIPT) @@ -633,7 +639,7 @@ export default class MiniPlugin { imports: new Set([...importTaroSelfComponents, ...importUsingComponent, ...importCustomComponents]) }) } - printLog(processTypeEnum.COMPILE, isRoot ? '发现页面' : '发现组件', file.path) + printLog(processTypeEnum.COMPILE, isRoot ? '发现页面' : '发现组件', this.getShowPath(file.path)) taroFileTypeMap[file.path] = { type: isRoot ? PARSE_AST_TYPE.PAGE : PARSE_AST_TYPE.COMPONENT, config: merge({}, isComponentConfig, buildUsingComponents(file.path, this.sourceDir, alias, depComponents), configObj), @@ -808,7 +814,7 @@ export default class MiniPlugin { run (compiler: webpack.Compiler) { if (!this.options.isBuildPlugin) { - this.getPages(compiler) + this.getPages() this.getComponents(this.pages, true) this.addEntries(compiler) } else { From ab1a9daf5e201e16ada19ea71eb21e2cd0814395 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 19 Nov 2019 17:17:09 +0800 Subject: [PATCH 098/194] chore(release): publish v2.0.0-beta.3 --- lerna.json | 2 +- .../package.json | 2 +- .../package.json | 4 ++-- packages/css-to-react-native/package.json | 2 +- packages/eslint-config-taro/package.json | 4 ++-- packages/eslint-plugin-taro/package.json | 2 +- .../postcss-plugin-constparse/package.json | 2 +- packages/postcss-pxtransform/package.json | 2 +- packages/postcss-unit-transform/package.json | 2 +- .../stylelint-config-taro-rn/package.json | 4 ++-- packages/stylelint-taro-rn/package.json | 2 +- packages/taro-alipay/package.json | 6 ++--- packages/taro-async-await/package.json | 2 +- packages/taro-cli/package.json | 22 +++++++++---------- packages/taro-components-qa/package.json | 2 +- packages/taro-components-rn/package.json | 2 +- packages/taro-components/package.json | 6 ++--- packages/taro-h5/package.json | 6 ++--- packages/taro-jd/package.json | 6 ++--- packages/taro-mini-runner/package.json | 8 +++---- packages/taro-mobx-common/package.json | 2 +- packages/taro-mobx-h5/package.json | 6 ++--- packages/taro-mobx-rn/package.json | 6 ++--- packages/taro-mobx/package.json | 6 ++--- packages/taro-plugin-babel/package.json | 2 +- packages/taro-plugin-csso/package.json | 2 +- packages/taro-plugin-less/package.json | 2 +- packages/taro-plugin-sass/package.json | 2 +- packages/taro-plugin-stylus/package.json | 2 +- packages/taro-plugin-typescript/package.json | 2 +- packages/taro-plugin-uglifyjs/package.json | 2 +- packages/taro-qq/package.json | 6 ++--- packages/taro-quickapp/package.json | 6 ++--- packages/taro-redux-h5/package.json | 4 ++-- packages/taro-redux-rn/package.json | 2 +- packages/taro-redux/package.json | 6 ++--- packages/taro-rn-runner/package.json | 2 +- packages/taro-rn/package.json | 4 ++-- packages/taro-router-rn/package.json | 2 +- packages/taro-router/package.json | 4 ++-- packages/taro-swan/package.json | 6 ++--- packages/taro-transformer-wx/package.json | 6 ++--- packages/taro-tt/package.json | 6 ++--- packages/taro-utils/package.json | 2 +- packages/taro-weapp/package.json | 6 ++--- packages/taro-webpack-runner/package.json | 14 ++++++------ packages/taro-with-weapp/package.json | 4 ++-- packages/taro/package.json | 4 ++-- packages/taroize/package.json | 2 +- 49 files changed, 104 insertions(+), 104 deletions(-) diff --git a/lerna.json b/lerna.json index 07063e7976c9..9f52549bfb81 100644 --- a/lerna.json +++ b/lerna.json @@ -55,6 +55,6 @@ "message": "chore(release): publish %s" } }, - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "npmClient": "npm" } diff --git a/packages/babel-plugin-transform-jsx-to-stylesheet/package.json b/packages/babel-plugin-transform-jsx-to-stylesheet/package.json index 0b45f836d1e6..51bae9912b7f 100644 --- a/packages/babel-plugin-transform-jsx-to-stylesheet/package.json +++ b/packages/babel-plugin-transform-jsx-to-stylesheet/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-jsx-to-stylesheet", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Transform stylesheet selector to style in JSX Elements.", "license": "MIT", "main": "src/index.js", diff --git a/packages/babel-plugin-transform-taroapi/package.json b/packages/babel-plugin-transform-taroapi/package.json index e61534d91557..21093eaebfdd 100644 --- a/packages/babel-plugin-transform-taroapi/package.json +++ b/packages/babel-plugin-transform-taroapi/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-taroapi", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "main": "dist/index.js", "license": "MIT", "scripts": { @@ -10,7 +10,7 @@ "test": "jest" }, "devDependencies": { - "@tarojs/taro-h5": "2.0.0-beta.2", + "@tarojs/taro-h5": "2.0.0-beta.3", "@types/babel-core": "^6.25.5", "@types/babel-traverse": "^6.25.4", "@types/babel-types": "^7.0.4", diff --git a/packages/css-to-react-native/package.json b/packages/css-to-react-native/package.json index 8659b5449776..a0ccee92ea4b 100644 --- a/packages/css-to-react-native/package.json +++ b/packages/css-to-react-native/package.json @@ -1,7 +1,7 @@ { "name": "taro-css-to-react-native", "description": "Convert CSS text to a React Native stylesheet object", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "main": "dist/index.js", "license": "MIT", "scripts": { diff --git a/packages/eslint-config-taro/package.json b/packages/eslint-config-taro/package.json index a2f5beda5564..2d38a0ccabf6 100644 --- a/packages/eslint-config-taro/package.json +++ b/packages/eslint-config-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-taro", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro specific linting rules for ESLint", "main": "index.js", "files": [ @@ -28,6 +28,6 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "eslint-plugin-taro": "2.0.0-beta.2" + "eslint-plugin-taro": "2.0.0-beta.3" } } diff --git a/packages/eslint-plugin-taro/package.json b/packages/eslint-plugin-taro/package.json index b80bf158ea7a..b92d336b2023 100644 --- a/packages/eslint-plugin-taro/package.json +++ b/packages/eslint-plugin-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-taro", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro specific linting plugin for ESLint", "main": "index.js", "files": [ diff --git a/packages/postcss-plugin-constparse/package.json b/packages/postcss-plugin-constparse/package.json index fa1d07c014ea..0896f0c8ad1b 100644 --- a/packages/postcss-plugin-constparse/package.json +++ b/packages/postcss-plugin-constparse/package.json @@ -1,6 +1,6 @@ { "name": "postcss-plugin-constparse", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "parse constants defined in config", "main": "index.js", "author": "Simba", diff --git a/packages/postcss-pxtransform/package.json b/packages/postcss-pxtransform/package.json index 6038ea4ae79b..e75b3f97cde3 100644 --- a/packages/postcss-pxtransform/package.json +++ b/packages/postcss-pxtransform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-pxtransform", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位", "keywords": [ "postcss", diff --git a/packages/postcss-unit-transform/package.json b/packages/postcss-unit-transform/package.json index e7c668791777..3b1fa99901c9 100644 --- a/packages/postcss-unit-transform/package.json +++ b/packages/postcss-unit-transform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-taro-unit-transform", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "小程序单位转换", "main": "index.js", "scripts": { diff --git a/packages/stylelint-config-taro-rn/package.json b/packages/stylelint-config-taro-rn/package.json index b5a04fa1df8f..28df1826a573 100644 --- a/packages/stylelint-config-taro-rn/package.json +++ b/packages/stylelint-config-taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "stylelint-config-taro-rn", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Shareable stylelint config for React Native CSS modules", "main": "index.js", "files": [ @@ -28,6 +28,6 @@ "jest": "^23.6.0", "npmpub": "^4.1.0", "stylelint": "9.3.0", - "stylelint-taro-rn": "2.0.0-beta.2" + "stylelint-taro-rn": "2.0.0-beta.3" } } diff --git a/packages/stylelint-taro-rn/package.json b/packages/stylelint-taro-rn/package.json index 27514878bfaf..87955036b9f7 100644 --- a/packages/stylelint-taro-rn/package.json +++ b/packages/stylelint-taro-rn/package.json @@ -1,7 +1,7 @@ { "name": "stylelint-taro-rn", "description": "A collection of React Native specific rules for stylelint", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "main": "dist/index.js", "babel": { "presets": [ diff --git a/packages/taro-alipay/package.json b/packages/taro-alipay/package.json index d53f1f44ffe3..ca2c7d79be39 100644 --- a/packages/taro-alipay/package.json +++ b/packages/taro-alipay/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-alipay", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro alipay framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.2", - "@tarojs/utils": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/utils": "2.0.0-beta.3", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-async-await/package.json b/packages/taro-async-await/package.json index 6af5942c19ac..4ec9082e7695 100644 --- a/packages/taro-async-await/package.json +++ b/packages/taro-async-await/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/async-await", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "taro async await", "main": "index.js", "scripts": { diff --git a/packages/taro-cli/package.json b/packages/taro-cli/package.json index b906426dd3b1..f1dd271ff9bb 100644 --- a/packages/taro-cli/package.json +++ b/packages/taro-cli/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/cli", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "cli tool for taro", "main": "index.js", "scripts": { @@ -40,8 +40,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taroize": "2.0.0-beta.2", - "@tarojs/transformer-wx": "2.0.0-beta.2", + "@tarojs/taroize": "2.0.0-beta.3", + "@tarojs/transformer-wx": "2.0.0-beta.3", "@types/request": "^2.48.1", "@typescript-eslint/parser": "^2.0.0", "adm-zip": "^0.4.13", @@ -54,7 +54,7 @@ "babel-plugin-remove-dead-code": "^1.3.2", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-define": "^1.3.0", - "babel-plugin-transform-jsx-to-stylesheet": "2.0.0-beta.2", + "babel-plugin-transform-jsx-to-stylesheet": "2.0.0-beta.3", "babel-plugin-transform-react-jsx": "^6.24.1", "babel-plugin-transform-taroapi": "1.3.15", "babel-template": "^6.26.0", @@ -73,11 +73,11 @@ "ejs": "^2.6.1", "envinfo": "^6.0.1", "eslint": "^6.1.0", - "eslint-config-taro": "2.0.0-beta.2", + "eslint-config-taro": "2.0.0-beta.3", "eslint-plugin-import": "^2.8.0", "eslint-plugin-react": "^7.4.0", "eslint-plugin-react-hooks": "^1.6.1", - "eslint-plugin-taro": "2.0.0-beta.2", + "eslint-plugin-taro": "2.0.0-beta.3", "eslint-plugin-typescript": "^0.12.0", "fbjs": "^1.0.0", "find-yarn-workspace-root": "1.2.1", @@ -100,7 +100,7 @@ "postcss-modules-resolve-imports": "^1.3.0", "postcss-modules-scope": "^1.1.0", "postcss-modules-values": "^1.3.0", - "postcss-pxtransform": "2.0.0-beta.2", + "postcss-pxtransform": "2.0.0-beta.3", "postcss-reporter": "^6.0.1", "postcss-taro-unit-transform": "1.2.15", "postcss-url": "^7.3.2", @@ -112,10 +112,10 @@ "semver": "^5.5.0", "shelljs": "^0.8.1", "stylelint": "9.3.0", - "stylelint-config-taro-rn": "2.0.0-beta.2", - "stylelint-taro-rn": "2.0.0-beta.2", + "stylelint-config-taro-rn": "2.0.0-beta.3", + "stylelint-taro-rn": "2.0.0-beta.3", "tapable": "^1.1.3", - "taro-css-to-react-native": "2.0.0-beta.2", + "taro-css-to-react-native": "2.0.0-beta.3", "through2": "^2.0.3", "vinyl": "^2.1.0", "vinyl-fs": "^3.0.2", @@ -124,7 +124,7 @@ "yauzl": "2.10.0" }, "devDependencies": { - "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", "@types/autoprefixer": "^9.1.1", "@types/babel-core": "^6.25.5", "@types/babel-generator": "^6.25.2", diff --git a/packages/taro-components-qa/package.json b/packages/taro-components-qa/package.json index 95734eafbda1..43a0ba707fef 100644 --- a/packages/taro-components-qa/package.json +++ b/packages/taro-components-qa/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-qa", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "多端解决方案基础组件(快应用)", "main": "./index.js", "files": [ diff --git a/packages/taro-components-rn/package.json b/packages/taro-components-rn/package.json index 401915cb8b0f..f20a2fa7d750 100644 --- a/packages/taro-components-rn/package.json +++ b/packages/taro-components-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-rn", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "多端解决方案基础组件(RN)", "main": "./dist/index.js", "scripts": { diff --git a/packages/taro-components/package.json b/packages/taro-components/package.json index 571aa705a06a..4c31aa58439c 100644 --- a/packages/taro-components/package.json +++ b/packages/taro-components/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "", "main:h5": "src/index.js", "main": "dist/index.js", @@ -50,14 +50,14 @@ "@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/plugin-transform-react-jsx": "^7.0.0", "@babel/preset-env": "^7.1.5", - "@tarojs/taro-h5": "2.0.0-beta.2", + "@tarojs/taro-h5": "2.0.0-beta.3", "@types/react": "^16.4.6", "@types/urijs": "^1.15.38", "babel-core": "^7.0.0-bridge.0", "babel-eslint": "10.0.1", "babel-jest": "^22.4.4", "babel-loader": "^8.0.5", - "babel-plugin-transform-taroapi": "2.0.0-beta.2", + "babel-plugin-transform-taroapi": "2.0.0-beta.3", "css-loader": "^2.1.1", "file-loader": "^3.0.1", "jest": "^22.4.4", diff --git a/packages/taro-h5/package.json b/packages/taro-h5/package.json index 9c865f5c31ec..7c659ccd22b4 100644 --- a/packages/taro-h5/package.json +++ b/packages/taro-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-h5", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro h5 framework", "main:h5": "src/index.js", "main": "dist/index.cjs.js", @@ -45,8 +45,8 @@ "@babel/plugin-proposal-object-rest-spread": "^7.3.4", "@babel/plugin-transform-react-jsx": "^7.2.2", "@babel/preset-env": "^7.3.4", - "@tarojs/components": "2.0.0-beta.2", - "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/components": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.3", "babel-core": "7.0.0-bridge.0", "babel-jest": "24.4.0", "eslint": "^4.18.2", diff --git a/packages/taro-jd/package.json b/packages/taro-jd/package.json index ca34869bc9ba..457a8013f953 100644 --- a/packages/taro-jd/package.json +++ b/packages/taro-jd/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-jd", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro jd framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.2", - "@tarojs/utils": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/utils": "2.0.0-beta.3", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index eb916a6db81f..4a9a0fb5a1fe 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Mini app runner for taro", "main": "index.js", "scripts": { @@ -32,8 +32,8 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/taro": "2.0.0-beta.2", - "@tarojs/transformer-wx": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/transformer-wx": "2.0.0-beta.3", "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", @@ -58,7 +58,7 @@ "node-sass": "^4.12.0", "ora": "^3.4.0", "postcss-loader": "^3.0.0", - "postcss-pxtransform": "2.0.0-beta.2", + "postcss-pxtransform": "2.0.0-beta.3", "request": "^2.88.0", "resolve": "^1.11.1", "sass-loader": "^7.1.0", diff --git a/packages/taro-mobx-common/package.json b/packages/taro-mobx-common/package.json index e665e664efaa..544809e249ad 100644 --- a/packages/taro-mobx-common/package.json +++ b/packages/taro-mobx-common/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-common", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "mobx library for taro", "keywords": [ "mobx", diff --git a/packages/taro-mobx-h5/package.json b/packages/taro-mobx-h5/package.json index ebf6808adc34..6c97785747b6 100644 --- a/packages/taro-mobx-h5/package.json +++ b/packages/taro-mobx-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-h5", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "mobx-h5 for taro", "keywords": [ "mobx", @@ -28,8 +28,8 @@ "nervjs": "^1.5.0" }, "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.2", - "@tarojs/taro-h5": "2.0.0-beta.2" + "@tarojs/mobx-common": "2.0.0-beta.3", + "@tarojs/taro-h5": "2.0.0-beta.3" }, "devDependencies": { "rimraf": "^2.6.2", diff --git a/packages/taro-mobx-rn/package.json b/packages/taro-mobx-rn/package.json index a6d56724e4e5..08f34d25fc28 100644 --- a/packages/taro-mobx-rn/package.json +++ b/packages/taro-mobx-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-rn", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "mobx-rn for taro", "keywords": [ "mobx", @@ -18,7 +18,7 @@ "src" ], "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.2", - "@tarojs/taro-rn": "2.0.0-beta.2" + "@tarojs/mobx-common": "2.0.0-beta.3", + "@tarojs/taro-rn": "2.0.0-beta.3" } } diff --git a/packages/taro-mobx/package.json b/packages/taro-mobx/package.json index 0286f2342414..aa1bea70007e 100644 --- a/packages/taro-mobx/package.json +++ b/packages/taro-mobx/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "mobx for taro", "keywords": [ "mobx", @@ -24,8 +24,8 @@ "clear": "rimraf dist" }, "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.2", - "@tarojs/taro": "2.0.0-beta.2" + "@tarojs/mobx-common": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.3" }, "devDependencies": { "rimraf": "^2.6.2", diff --git a/packages/taro-plugin-babel/package.json b/packages/taro-plugin-babel/package.json index 18b3a43b0e7b..540ffab1a091 100644 --- a/packages/taro-plugin-babel/package.json +++ b/packages/taro-plugin-babel/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-babel", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro babel编译", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-csso/package.json b/packages/taro-plugin-csso/package.json index 5486354596e7..d9fdc69461fc 100644 --- a/packages/taro-plugin-csso/package.json +++ b/packages/taro-plugin-csso/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-csso", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro压缩CSS文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-less/package.json b/packages/taro-plugin-less/package.json index ee5a4de60773..002fea485e07 100644 --- a/packages/taro-plugin-less/package.json +++ b/packages/taro-plugin-less/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-less", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro 编译 less 文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-sass/package.json b/packages/taro-plugin-sass/package.json index e452f254bcb7..b47983eac367 100644 --- a/packages/taro-plugin-sass/package.json +++ b/packages/taro-plugin-sass/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-sass", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro编译sass文件", "main": "index.js", "files": [ diff --git a/packages/taro-plugin-stylus/package.json b/packages/taro-plugin-stylus/package.json index 1d64a0640f86..7ca5c91ebb8f 100644 --- a/packages/taro-plugin-stylus/package.json +++ b/packages/taro-plugin-stylus/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-stylus", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro 编译 stylus 文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-typescript/package.json b/packages/taro-plugin-typescript/package.json index e638c40c9770..34ad927effdd 100644 --- a/packages/taro-plugin-typescript/package.json +++ b/packages/taro-plugin-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-typescript", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro TypeScript 编译插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-uglifyjs/package.json b/packages/taro-plugin-uglifyjs/package.json index d302350d3c3c..06ba8f25ea23 100644 --- a/packages/taro-plugin-uglifyjs/package.json +++ b/packages/taro-plugin-uglifyjs/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-uglifyjs", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro压缩JS文件", "main": "index.js", "scripts": { diff --git a/packages/taro-qq/package.json b/packages/taro-qq/package.json index 85c61a01ec6e..1f6cabe2c849 100644 --- a/packages/taro-qq/package.json +++ b/packages/taro-qq/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-qq", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro qq framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.2", - "@tarojs/utils": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/utils": "2.0.0-beta.3", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-quickapp/package.json b/packages/taro-quickapp/package.json index f7c8af186875..4aa90c17f2ed 100644 --- a/packages/taro-quickapp/package.json +++ b/packages/taro-quickapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-quickapp", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro quickapp framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.2", - "@tarojs/utils": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/utils": "2.0.0-beta.3", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-redux-h5/package.json b/packages/taro-redux-h5/package.json index e3c67d0ba76d..fc125bc715b2 100644 --- a/packages/taro-redux-h5/package.json +++ b/packages/taro-redux-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/redux-h5", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Forked react-redux for taro", "keywords": [ "react", @@ -46,7 +46,7 @@ "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.49", "@babel/plugin-transform-react-jsx": "^7.0.0-beta.49", "@babel/preset-env": "^7.0.0-beta.49", - "@tarojs/taro-h5": "2.0.0-beta.2", + "@tarojs/taro-h5": "2.0.0-beta.3", "babel-plugin-transform-react-remove-prop-types": "^0.4.13", "redux": "^4.0.0", "rimraf": "^2.6.2", diff --git a/packages/taro-redux-rn/package.json b/packages/taro-redux-rn/package.json index a21a50cce376..6c935f19238f 100644 --- a/packages/taro-redux-rn/package.json +++ b/packages/taro-redux-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-redux-rn", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "taro-redux-rn", "main": "./src/index.js", "files": [ diff --git a/packages/taro-redux/package.json b/packages/taro-redux/package.json index a3182dbe074a..d2b8b39c6c65 100644 --- a/packages/taro-redux/package.json +++ b/packages/taro-redux/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/redux", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Redux for Taro", "main": "index.js", "typings": "types/index.d.ts", @@ -32,7 +32,7 @@ "jest": "^23.1.0" }, "dependencies": { - "@tarojs/taro": "2.0.0-beta.2", - "@tarojs/utils": "2.0.0-beta.2" + "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/utils": "2.0.0-beta.3" } } diff --git a/packages/taro-rn-runner/package.json b/packages/taro-rn-runner/package.json index 4b75039628f5..c96b8c44d9df 100644 --- a/packages/taro-rn-runner/package.json +++ b/packages/taro-rn-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-runner", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "ReactNative build tool for taro", "main": "index.js", "scripts": { diff --git a/packages/taro-rn/package.json b/packages/taro-rn/package.json index dcc47cb6b473..dd090ef211ed 100644 --- a/packages/taro-rn/package.json +++ b/packages/taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-rn", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro RN framework", "main": "./index.js", "files": [ @@ -27,7 +27,7 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", "babel-preset-expo": "^5.2.0", "base64-js": "^1.3.0", "expo-av": "^6.0.0", diff --git a/packages/taro-router-rn/package.json b/packages/taro-router-rn/package.json index 1e26302671c9..c3e777519c80 100644 --- a/packages/taro-router-rn/package.json +++ b/packages/taro-router-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-router-rn", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "taro-router-rn", "main": "./index.js", "files": [ diff --git a/packages/taro-router/package.json b/packages/taro-router/package.json index 73ef3e35cd6e..de1ef8944a8c 100644 --- a/packages/taro-router/package.json +++ b/packages/taro-router/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/router", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro-router", "main:h5": "dist/index.esm.js", "main": "index.js", @@ -41,7 +41,7 @@ "@babel/plugin-syntax-dynamic-import": "7.0.0", "@babel/plugin-transform-react-jsx": "7.0.0", "@babel/preset-env": "7.1.5", - "@tarojs/taro-h5": "2.0.0-beta.2", + "@tarojs/taro-h5": "2.0.0-beta.3", "@types/history": "4.7.2", "@types/jasmine": "2.8.11", "@types/jest": "23.3.9", diff --git a/packages/taro-swan/package.json b/packages/taro-swan/package.json index fca24c80f827..a922f1cccb17 100644 --- a/packages/taro-swan/package.json +++ b/packages/taro-swan/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-swan", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro swan framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.2", - "@tarojs/utils": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/utils": "2.0.0-beta.3", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-transformer-wx/package.json b/packages/taro-transformer-wx/package.json index cdf68fb45c05..9760b2ed9b29 100644 --- a/packages/taro-transformer-wx/package.json +++ b/packages/taro-transformer-wx/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/transformer-wx", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Transfrom Nerv Component to Wechat mini program.", "repository": { "type": "git", @@ -61,14 +61,14 @@ "babel-types": "^6.26.0", "eslint": "5.16.0", "eslint-plugin-react": "7.10.0", - "eslint-plugin-taro": "2.0.0-beta.2", + "eslint-plugin-taro": "2.0.0-beta.3", "html": "^1.0.0", "lodash": "^4.17.5", "prettier": "^1.14.2", "typescript": "^3.2.2" }, "devDependencies": { - "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", "@types/babel-core": "^6.25.5", "@types/babel-generator": "^6.25.1", "@types/babel-template": "^6.25.0", diff --git a/packages/taro-tt/package.json b/packages/taro-tt/package.json index 3cc0589edc15..01f9a14193dc 100644 --- a/packages/taro-tt/package.json +++ b/packages/taro-tt/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-tt", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro toutiao framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.2", - "@tarojs/utils": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/utils": "2.0.0-beta.3", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-utils/package.json b/packages/taro-utils/package.json index 3d1812d8dbf4..427dab137060 100644 --- a/packages/taro-utils/package.json +++ b/packages/taro-utils/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/utils", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Utils for Taro", "main": "index.js", "scripts": { diff --git a/packages/taro-weapp/package.json b/packages/taro-weapp/package.json index d4d0e66f8302..f8117ef93094 100644 --- a/packages/taro-weapp/package.json +++ b/packages/taro-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-weapp", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro weapp framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.2", - "@tarojs/utils": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/utils": "2.0.0-beta.3", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-webpack-runner/package.json b/packages/taro-webpack-runner/package.json index 2db5434fa563..d027ff53e364 100644 --- a/packages/taro-webpack-runner/package.json +++ b/packages/taro-webpack-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack-runner", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "webpack runner for taro", "main": "index.js", "scripts": { @@ -32,15 +32,15 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/plugin-sass": "2.0.0-beta.2", - "@tarojs/taro": "2.0.0-beta.2", - "@tarojs/taro-h5": "2.0.0-beta.2", + "@tarojs/plugin-sass": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/taro-h5": "2.0.0-beta.3", "autoprefixer": "8.6.4", "babel-core": "6.26.0", "babel-loader": "7.1.4", "babel-plugin-syntax-dynamic-import": "6.18.0", "babel-plugin-transform-react-jsx": "6.24.1", - "babel-plugin-transform-taroapi": "2.0.0-beta.2", + "babel-plugin-transform-taroapi": "2.0.0-beta.3", "babel-types": "6.26.0", "chalk": "2.4.2", "copy-webpack-plugin": "^5.0.3", @@ -57,8 +57,8 @@ "opn": "5.3.0", "ora": "2.1.0", "postcss-loader": "2.1.6", - "postcss-plugin-constparse": "2.0.0-beta.2", - "postcss-pxtransform": "2.0.0-beta.2", + "postcss-plugin-constparse": "2.0.0-beta.3", + "postcss-pxtransform": "2.0.0-beta.3", "resolve": "1.8.1", "resolve-url-loader": "2.3.0", "sass": "^1.23.1", diff --git a/packages/taro-with-weapp/package.json b/packages/taro-with-weapp/package.json index 6a4971c14c2c..5a95851deb64 100644 --- a/packages/taro-with-weapp/package.json +++ b/packages/taro-with-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/with-weapp", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "taroize 之后的运行时", "main": "index.js", "scripts": { @@ -22,7 +22,7 @@ "author": "yuche", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.2", + "@tarojs/taro": "2.0.0-beta.3", "lodash": "^4.17.11" }, "devDependencies": { diff --git a/packages/taro/package.json b/packages/taro/package.json index e8c767a04695..2bea9ff99643 100644 --- a/packages/taro/package.json +++ b/packages/taro/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "Taro framework", "module": "dist/index.esm.js", "main": "index.js", @@ -29,7 +29,7 @@ "nervjs": "^1.5.0" }, "dependencies": { - "@tarojs/utils": "2.0.0-beta.2" + "@tarojs/utils": "2.0.0-beta.3" }, "devDependencies": { "@types/react": "^16.9.4", diff --git a/packages/taroize/package.json b/packages/taroize/package.json index fa640f4a262a..77f63b337d7b 100644 --- a/packages/taroize/package.json +++ b/packages/taroize/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taroize", - "version": "2.0.0-beta.2", + "version": "2.0.0-beta.3", "description": "转换原生微信小程序代码为 Taro 代码", "main": "index.js", "files": [ From fa35918bb7cbb9bba6a6bce8611fe63b584378ae Mon Sep 17 00:00:00 2001 From: luckyadam Date: Tue, 19 Nov 2019 17:22:21 +0800 Subject: [PATCH 099/194] chore: changelog --- CHANGELOG.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8b34367c778..270ee44c9c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -148,9 +148,6 @@ * **cli:** 修复代码合并的问题 ([37c0525](https://github.com/NervJS/taro/commit/37c0525)) * **cli:** 修复目录创建 ([05bdd8a](https://github.com/NervJS/taro/commit/05bdd8a)) * **cli:** 修复配置文件中读取不到 process.env.TARO_ENV 的问题 ([b0b1f8f](https://github.com/NervJS/taro/commit/b0b1f8f)) -* **mini-runner:** 修复对 alias 的支持 ([d99bb47](https://github.com/NervJS/taro/commit/d99bb47)) -* **mini-runner:** 移除无用代码 ([c1020b1](https://github.com/NervJS/taro/commit/c1020b1)) -* somethings no need ([2c2e503](https://github.com/NervJS/taro/commit/2c2e503)) * **cli:** 支持引用 node_modules 中组件 ([d21eb65](https://github.com/NervJS/taro/commit/d21eb65)) * **cli:** 普通文件经过编译器编译必须传入 isNormal ([4aed827](https://github.com/NervJS/taro/commit/4aed827)) * **cli:** 更新默认模板 ([f9f80a3](https://github.com/NervJS/taro/commit/f9f80a3)) @@ -163,24 +160,30 @@ * **mini-runner:** 修复 builder 的 hooks 调用 ([dd7ac8c](https://github.com/NervJS/taro/commit/dd7ac8c)) * **mini-runner:** 修复 tabbar 编译及组件 watch 的问题 ([8f5fc79](https://github.com/NervJS/taro/commit/8f5fc79)) * **mini-runner:** 修复 watch bug ([9afbed2](https://github.com/NervJS/taro/commit/9afbed2)) +* **mini-runner:** 修复对 alias 的支持 ([d99bb47](https://github.com/NervJS/taro/commit/d99bb47)) * **mini-runner:** 修复对 css modules 的支持 ([22cd897](https://github.com/NervJS/taro/commit/22cd897)) * **mini-runner:** 修复小程序编译报错 ([677bfba](https://github.com/NervJS/taro/commit/677bfba)) +* **mini-runner:** 修复引用 npm 中组件间存在依赖时依赖路径解析错误的问题 ([f2869f6](https://github.com/NervJS/taro/commit/f2869f6)) * **mini-runner:** 修复快应用打包报错的问题 ([5e59963](https://github.com/NervJS/taro/commit/5e59963)) * **mini-runner:** 修复快应用编译后页面标题展示不正确的问题 ([b523f90](https://github.com/NervJS/taro/commit/b523f90)) * **mini-runner:** 修复普通小程序编译的问题 ([f5a2bc2](https://github.com/NervJS/taro/commit/f5a2bc2)) +* **mini-runner:** 加上文件编译提示 ([61eef34](https://github.com/NervJS/taro/commit/61eef34)) +* **mini-runner:** 更新编译时提示 ([6448722](https://github.com/NervJS/taro/commit/6448722)) +* **mini-runner:** 移除无用代码 ([c1020b1](https://github.com/NervJS/taro/commit/c1020b1)) +* **mini-runner:** 组件引入支持统一从一个入口文件中引入 ([55f6800](https://github.com/NervJS/taro/commit/55f6800)) +* **taro-cli:** update package list 新增 [@tarojs](https://github.com/tarojs)/mini-runner,对列表排序 ([4661558](https://github.com/NervJS/taro/commit/4661558)) +* position linter for quickapp 1060+ ([fa8d91c](https://github.com/NervJS/taro/commit/fa8d91c)) +* pxtransform disable on quick-app ([5ce3139](https://github.com/NervJS/taro/commit/5ce3139)) +* quickapp api upload from docs ([20b681c](https://github.com/NervJS/taro/commit/20b681c)) +* somethings no need ([2c2e503](https://github.com/NervJS/taro/commit/2c2e503)) * **mini-runner:** 只有 taro 的包不能经过依赖包名替换 ([498cc7f](https://github.com/NervJS/taro/commit/498cc7f)) * **mini-runner:** 打包优化,引用自 npm 包中的组件不抽离至 vendors 中 ([635f3e2](https://github.com/NervJS/taro/commit/635f3e2)) * **mini-runner:** 提前解析快应用页面 ([d5f72b9](https://github.com/NervJS/taro/commit/d5f72b9)) * **mini-runner:** 支持快应用编译后模板与样式的检测 ([2a8a681](https://github.com/NervJS/taro/commit/2a8a681)) * **quickapp:** pull-down-refresh page-scroll ([157da75](https://github.com/NervJS/taro/commit/157da75)) -* quickapp api upload from docs ([20b681c](https://github.com/NervJS/taro/commit/20b681c)) * **taro:** 修复快应用下拉刷新问题 ([e429e7d](https://github.com/NervJS/taro/commit/e429e7d)) -* position linter for quickapp 1060+ ([fa8d91c](https://github.com/NervJS/taro/commit/fa8d91c)) -* **mini-runner:** 修复引用 npm 中组件间存在依赖时依赖路径解析错误的问题 ([f2869f6](https://github.com/NervJS/taro/commit/f2869f6)) -* **mini-runner:** 加上文件编译提示 ([61eef34](https://github.com/NervJS/taro/commit/61eef34)) * **taro:** 小程序 webpack 编译静态文件路径 ([9806766](https://github.com/NervJS/taro/commit/9806766)) * **taro-quickapp:** 修复快应用事件绑定异常问题 ([eb3d9e5](https://github.com/NervJS/taro/commit/eb3d9e5)) -* pxtransform disable on quick-app ([5ce3139](https://github.com/NervJS/taro/commit/5ce3139)) * **transformer:** 修复测试用例 ([219f493](https://github.com/NervJS/taro/commit/219f493)) * **transformer:** 修复错误类型 ([9d15238](https://github.com/NervJS/taro/commit/9d15238)) * **transformer:** 支持直接 import default ([2aa7bd7](https://github.com/NervJS/taro/commit/2aa7bd7)) @@ -189,6 +192,7 @@ ### Features +* **docs:** 更新 2.0 版本使用 async-await 的文档 [#4837](https://github.com/NervJS/taro/issues/4837) ([18b4487](https://github.com/NervJS/taro/commit/18b4487)) * audio context ([b73d25a](https://github.com/NervJS/taro/commit/b73d25a)) * mock for quickapp ([d578cea](https://github.com/NervJS/taro/commit/d578cea)) * stop trans asset for quickapp ([62df717](https://github.com/NervJS/taro/commit/62df717)) From 9647e8a15a81d6e72160e01dbbe7ac191306e158 Mon Sep 17 00:00:00 2001 From: Garfield Lee Date: Tue, 19 Nov 2019 18:12:01 +0800 Subject: [PATCH 100/194] =?UTF-8?q?docs(readme):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E9=80=89=E6=8B=A9=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/README.md b/docs/README.md index de3f9da5b5e4..5dff200eabbc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,6 +2,8 @@ title: Taro 介绍 --- +> 这是 Taro 2.x 版本的文档,若要查看 1.x 版本的文档,请[点击这里选择版本](/taro/versions.html)。 + ## 简介 **Taro** 是一套遵循 [React](https://reactjs.org/) 语法规范的 **多端开发** 解决方案。 From 48f34439b4dfa1fb694f14a5ef91afaa8f45321e Mon Sep 17 00:00:00 2001 From: Garfield Lee Date: Tue, 19 Nov 2019 18:12:28 +0800 Subject: [PATCH 101/194] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=20i18n=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/i18n/en.json | 24 +- .../version-2.0.0-beta.3/README.md | 144 +++ .../version-2.0.0-beta.3/async-await.md | 43 + .../version-2.0.0-beta.3/config-detail.md | 856 ++++++++++++++++++ website/versions.json | 1 + 5 files changed, 1066 insertions(+), 2 deletions(-) create mode 100644 website/versioned_docs/version-2.0.0-beta.3/README.md create mode 100644 website/versioned_docs/version-2.0.0-beta.3/async-await.md create mode 100644 website/versioned_docs/version-2.0.0-beta.3/config-detail.md diff --git a/website/i18n/en.json b/website/i18n/en.json index 22ed66ddffdd..93f523a3dcdd 100644 --- a/website/i18n/en.json +++ b/website/i18n/en.json @@ -2677,6 +2677,27 @@ }, "version-1.3.26/version-1.3.26-tutorial": { "title": "框架" + }, + "version-1.3.27/version-1.3.27-hooks": { + "title": "Hooks" + }, + "version-1.3.27/version-1.3.27-README": { + "title": "Taro 介绍" + }, + "version-2.0.0-beta.2/version-2.0.0-beta.2-config-detail": { + "title": "编译配置详情" + }, + "version-2.0.0-beta.2/version-2.0.0-beta.2-config": { + "title": "编译配置" + }, + "version-2.0.0-beta.3/version-2.0.0-beta.3-async-await": { + "title": "异步编程" + }, + "version-2.0.0-beta.3/version-2.0.0-beta.3-config-detail": { + "title": "编译配置详情" + }, + "version-2.0.0-beta.3/version-2.0.0-beta.3-README": { + "title": "Taro 介绍" } }, "links": { @@ -2685,8 +2706,7 @@ "API": "API", "Taro-UI": "Taro-UI", "物料市场": "物料市场", - "论坛": "论坛", - "GitHub": "GitHub" + "论坛": "论坛" }, "categories": { "关于Taro": "关于Taro", diff --git a/website/versioned_docs/version-2.0.0-beta.3/README.md b/website/versioned_docs/version-2.0.0-beta.3/README.md new file mode 100644 index 000000000000..0d322f137dcb --- /dev/null +++ b/website/versioned_docs/version-2.0.0-beta.3/README.md @@ -0,0 +1,144 @@ +--- +title: Taro 介绍 +id: version-2.0.0-beta.3-README +original_id: README +--- + +> 这是 Taro 2.x 版本的文档,若要查看 1.x 版本的文档,请[点击这里选择版本](/taro/versions.html)。 + +## 简介 + +**Taro** 是一套遵循 [React](https://reactjs.org/) 语法规范的 **多端开发** 解决方案。 + +现如今市面上端的形态多种多样,Web、React-Native、微信小程序等各种端大行其道,当业务要求同时在不同的端都要求有所表现的时候,针对不同的端去编写多套代码的成本显然非常高,这时候只编写一套代码就能够适配到多端的能力就显得极为需要。 + +使用 **Taro**,我们可以只书写一套代码,再通过 **Taro** 的编译工具,将源代码分别编译出可以在不同端(微信/百度/支付宝/字节跳动/QQ小程序、快应用、H5、React-Native 等)运行的代码。 + +## 特性 + +#### React 语法风格 + +**Taro** 遵循 [React](https://reactjs.org/) 语法规范,它采用与 React 一致的组件化思想,组件生命周期与 React 保持一致,同时支持使用 [JSX 语法](jsx.html),让代码具有更丰富的表现力,使用 **Taro** 进行开发可以获得和 React 一致的开发体验。 + +代码示例 + +```jsx +import Taro, { Component } from '@tarojs/taro' +import { View, Button } from '@tarojs/components' + +export default class Index extends Component { + constructor () { + super(...arguments) + this.state = { + title: '首页', + list: [1, 2, 3] + } + } + + componentWillMount () {} + + componentDidMount () {} + + componentWillUpdate (nextProps, nextState) {} + + componentDidUpdate (prevProps, prevState) {} + + shouldComponentUpdate (nextProps, nextState) { + return true + } + + add = (e) => { + // dosth + } + + render () { + return ( + + {this.state.title} + + {this.state.list.map(item => { + return ( + {item} + ) + })} + + + + ) + } +} +``` + +> 由于微信小程序端的限制,有极少数 JSX 的优秀用法暂时不能得到很好地支持,同时,为了遵循 React 语法,Taro 在写法上也有一些自己的规范,具体可以参考:[Taro 开发最佳实践](best-practice.html) 。 + +#### 快速开发微信小程序 + +Taro 立足于微信小程序开发,众所周知小程序的开发体验并不是非常友好,比如小程序中无法使用 npm 来进行第三方库的管理,无法使用一些比较新的 ES 规范等等,针对小程序端的开发弊端,Taro 具有以下的优秀特性 + +✅ 支持使用 npm/yarn 安装管理第三方依赖 + +✅ 支持使用 ES7/ES8 甚至更新的 ES 规范,一切都可自行配置 + +✅ 支持使用 CSS 预编译器,例如 Sass 等 + +✅ 支持使用 Redux 进行状态管理 + +✅ 支持使用 MobX 进行状态管理 + +✅ 小程序 API 优化,异步 API Promise 化等等 + +#### 支持多端开发转化 + +Taro 方案的初心就是为了打造一个多端开发的解决方案。目前 Taro 代码可以支持转换到 **微信/百度/支付宝/字节跳动/QQ小程序** 、**快应用**、 **H5 端** 以及 **移动端(React Native)**。 + +
+ +## 社区共享 + +[Taro 交流社区——让每一次交流都被沉淀](https://taro-club.jd.com/) 如果您在此文档没有找到想要的答案,请移步[社区](https://taro-club.jd.com)提问,我们会在看到的第一时间给予答复。 + +[Taro 物料市场——让每一个轮子产生价值](https://taro-ext.jd.com/) 如果您想找一些现成的物料,例如:模版、组件、SDK、UI,可以移步[物料市场](https://taro-ext.jd.com/)查找,也欢迎您发布物料与其他开发者共享。 + +## Taro UI + +一款基于 `Taro` 框架开发的多端 UI 组件库。 + +[Taro UI](https://taro-ui.jd.com) 特性: + +- 基于 `Taro` 开发 UI 组件 +- 一套组件可以在 `微信小程序`,`支付宝小程序`,`百度小程序`,`H5` 多端适配运行(`ReactNative` 端暂不支持) +- 提供友好的 API,可灵活的使用组件 + +## 使用案例 + +Taro 已经投入了我们的生产环境中使用,业界也在广泛地使用 Taro 开发多端应用。 + +> 社区案例仅收纳了开发者主动提交的案例 + +![image](https://raw.githubusercontent.com/NervJS/taro-user-cases/master/user-cases.jpg) + +## 学习资源 + +### 官方文章精选 +- [使用 React Hooks 重构你的小程序](https://aotu.io/notes/2019/07/10/taro-hooks/) +- [Taro 1.3 震撼发布:全面支持 JSX 语法和 HOOKS](https://aotu.io/notes/2019/06/13/taro-1-3/) +- [小程序框架全面测评](https://aotu.io/notes/2019/03/12/mini-program-framework-full-review/) +- [Taro 在京东购物小程序上的实践](https://aotu.io/notes/2018/09/11/taro-in-jd/) +- [用 React 开发小程序的探索之路 (演讲内容整理)| 掘金开发者大会](https://juejin.im/post/5ba346a7f265da0ad13b78bd) +- [为何我们要用 React 来写小程序 - Taro 诞生记](https://aotu.io/notes/2018/06/25/the-birth-of-taro/) +- [多端统一开发框架 - Taro介绍](https://aotu.io/notes/2018/06/07/Taro/) + +### 分享交流 +- [第十三届 D2 前端技术论坛——使用 Taro 快速构建多端应用](https://www.yuque.com/d2forum/content/d213#6a1363f4) +- [WeGeek直播课:从0到1快速开发电商小程序](https://link.juejin.im/?target=https%3A%2F%2Fcloud.tencent.com%2Fedu%2Flearning%2Flive-1497) +- [掘金开发者大会——用React开发小程序的探索之路](https://www.itdks.com/Course/detail?id=16289) + +### 其他 +更多文章教程、开源项目等,请参考:[awesome-taro](https://github.com/NervJS/awesome-taro) + +掘金小册:[Taro 多端开发实现原理与实战](https://juejin.im/book/5b73a131f265da28065fb1cd?referrer=5ba228f16fb9a05d3251492d) + +## 开发交流 +扫码添加 `凹凸实验室-小助手` ,回复 `Taro` 即可进群。(Taro 开发交流15群 已满) + +![image](https://user-images.githubusercontent.com/9441951/63744620-7994e800-c8d2-11e9-9e66-ab43d1d75fe8.png) diff --git a/website/versioned_docs/version-2.0.0-beta.3/async-await.md b/website/versioned_docs/version-2.0.0-beta.3/async-await.md new file mode 100644 index 000000000000..42083d1ed159 --- /dev/null +++ b/website/versioned_docs/version-2.0.0-beta.3/async-await.md @@ -0,0 +1,43 @@ +--- +title: 异步编程 +id: version-2.0.0-beta.3-async-await +original_id: async-await +--- + +> Taro 2.x 版本中使用 `async-await` 不再需要 `@tarojs/async-await`。 + +Taro 支持使用 `async functions` 来让开发者获得不错的异步编程体验,开启 `async functions` 支持需要安装包 `babel-plugin-transform-runtime` 和 `babel-runtime`。 + +```bash +$ yarn add babel-plugin-transform-runtime --dev +$ yarn add babel-runtime +``` + +随后修改项目 [`babel` 配置](./config-detail.md#babel),增加插件 `babel-plugin-transform-runtime`。 + +```js +babel: { + sourceMap: true, + presets: [ + [ + 'env', + { + modules: false + } + ] + ], + plugins: [ + 'transform-decorators-legacy', + 'transform-class-properties', + 'transform-object-rest-spread', + ['transform-runtime', { + "helpers": false, + "polyfill": false, + "regenerator": true, + "moduleName": 'babel-runtime' + }] + ] +} +``` + +> 值得注意的事,使用 `async functions` 一定要记得按照[开发前注意](./before-dev-remind.md)中提示的内容进行操作,否则会出现报错 diff --git a/website/versioned_docs/version-2.0.0-beta.3/config-detail.md b/website/versioned_docs/version-2.0.0-beta.3/config-detail.md new file mode 100644 index 000000000000..24c0c12fe726 --- /dev/null +++ b/website/versioned_docs/version-2.0.0-beta.3/config-detail.md @@ -0,0 +1,856 @@ +--- +title: 编译配置详情 +id: version-2.0.0-beta.3-config-detail +original_id: config-detail +--- + +## designWidth + +`designWidth` 用来设置设计稿尺寸,关于这一部分的配置说明请见[设计稿及尺寸单位](./size.md)这一章节。 + +## sourceRoot + +`sourceRoot` 用来设置源码存放目录,通过 Taro 开发工具初始化后的项目源码目录都是 `src`,你可以通过修改这一配置来重新指定源码目录。 + +## outputRoot + +`outputRoot` 用来设置代码编译后的生产目录,通过 Taro 开发工具初始化后的生产目录都是 `dist`,你可以通过修改这一配置来重新指定生产目录。 + +## plugins + +`plugins` 用来设置编译过程插件,插件机制基于 实现,目前暴露了两个钩子 `beforeBuild` 和 `afterBuild` + +其中,`beforeBuild` 将在整体编译前触发,可以获取到编译的相关配置,同时也能进行修改 + +`afterBuild` 将在 webpack 编译完后执行,可以获取到编译后的结果 + +具体使用方式如下: + +首先定义一个插件 + +```js +class BuildPlugin { + apply (builder) { + builder.hooks.beforeBuild.tap('BuildPlugin', (config) => { + console.log(config) + }) + + builder.hooks.afterBuild.tap('BuildPlugin', (stats) => { + console.log(stats) + }) + } +} +``` + +接下来在 `plugins` 字段中进行配置 + +```js +{ + plugins: [ + new BuildPlugin() + ] +} +``` + +## babel + +用来配置 `babel`,默认配置如下,可以自行添加自己需要的额外的 `presets` 及 `plugins`。 + +```jsx +babel: { + sourceMap: true, + presets: [ + 'env' + ], + plugins: [ + 'transform-class-properties', + 'transform-decorators-legacy', + 'transform-object-rest-spread' + ] +} +``` + +## uglify + +用来配置 `UgligyJS` 工具,设置打包过程中的 JS 代码压缩。可以通过 `uglify.enable` 来设置是否开启压缩,若设置开启,则可以通过 `uglify.config` 来设置 `UgligyJS` 的配置项,具体配置方式如下: + +```jsx +uglify: { + enable: true, + config: { + // 配置项同 https://github.com/mishoo/UglifyJS2#minify-options + } +} +``` + +## csso + +用来配置 `csso` 工具,设置打包过程中的 CSS 代码压缩。可以通过 `csso.enable` 来设置是否开启压缩,若设置开启,则可以通过 `csso.config` 来设置 `csso` 的配置项,具体配置方式如下: + +```jsx +csso: { + enable: true, + config: { + // 配置项同 https://github.com/css/csso#minifysource-options + } +} +``` + +## sass + +用来配置 `sass` 工具,设置打包过程中的 SCSS 代码编译。 +具体配置可以参考[node-sass](https://www.npmjs.com/package/node-sass) +当需要全局注入scss文件时,可以添加三个额外参数:`resource` 、 `projectDirectory` (v1.2.25开始支持)、`data`(v1.3.0开始支持),具体配置方式如下: + +#### 单文件路径形式 + +当只有 `resource` 字段时,可以传入 scss 文件的绝对路径。 + +```js +sass: { + resource: path.resolve(__dirname, '..', 'src/styles/variable.scss') +} +``` + +#### 多文件路径形式 + +此外,当只有 `resource` 字段时,也可以传入一个路径数组。 + +```js +sass: { + resource: [ + path.resolve(__dirname, '..', 'src/styles/variable.scss'), + path.resolve(__dirname, '..', 'src/styles/mixins.scss') + ] +} +``` + +#### 指定项目根目录路径形式 + +你可以额外配置 `projectDirectory` 字段,这样你就可以在 `resource` 里写相对路径了。 + +```js +sass: { + resource: [ + 'src/styles/variable.scss', + 'src/styles/mixins.scss' + ], + projectDirectory: path.resolve(__dirname, '..') +} +``` + +#### 传入 scss 变量字符串 + +```js +sass: { + resource: [ + 'src/styles/variable.scss', + 'src/styles/mixins.scss' + ], + projectDirectory: path.resolve(__dirname, '..'), + data: '$nav-height: 48px;' +} +``` + +* resource: 如果要引入多个文件,支持数组形式传入 +* projectDirectory: 项目根目录的绝对地址(若为小程序云开发模板,则应该是client目录) +* data: 全局 scss 变量,若 data 与 resource 中设置了同样的变量,则 data 的优先级高于 resource + +## env + +用来设置一些环境变量如 `process.env.NODE_ENV`,例如我们想设置区分预览、打包来做些不同的操作,可以如下配置: + +在 `config/dev.js` 中: + +```jsx +env: { + NODE_ENV: '"development"' // JSON.stringify('development') +} +``` + +在 `config/prod.js` 中: + +```jsx +env: { + NODE_ENV: '"production"' // JSON.stringify('production') +} +``` + +这样就能在代码中通过 `process.env.NODE_ENV === 'development'` 来判断环境。 + +## defineConstants + +用来配置一些全局变量供代码中进行使用,例如: + +```js +defineConstants: { + A: '"a"' // JSON.stringify('a') +} +``` + +## alias + +> `1.2.0` 开始支持。 + +用来配置目录别名,从而方便书写代码引用路径。例如,使用相对路径书写文件引用如下: + +```js +import A from '../../componnets/A' +import Utils from '../../utils' +import packageJson from '../../package.json' +import projectConfig from '../../project.config.json' +``` + +为了避免书写多级相对路径,我们可以如下配置 `alias`: + +```js +alias: { + '@/components': path.resolve(__dirname, '..', 'src/components'), + '@/utils': path.resolve(__dirname, '..', 'src/utils'), + '@/package': path.resolve(__dirname, '..', 'package.json'), + '@/project': path.resolve(__dirname, '..', 'project.config.json'), +} +``` + +通过上述配置,可以将 `src/components` 和 `src/utils` 目录配置成别名,将根目录下的 `package.json` 和 `project.config.json` 文件配置成别名,则代码中的引用改写如下: + +```js +import A from '@/components/A' +import Utils from '@/utils' +import packageJson from '@/package' +import projectConfig from '@/project' +``` + +为了让编辑器(VS Code)不报错,并继续使用自动路径补全的功能,需要在项目根目录下的 `jsconfig.json` 或者 `tsconfig.json` 中配置 `paths` 让编辑器认得我们的别名,形式如下: + +```json +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/components/*": ["./src/components/*"], + "@/utils/*": ["./src/utils/*"], + "@/package": ["./package.json"], + "@/project": ["./project.config.json"], + } + } +} +``` + +*建议别名使用 `@/` 开头而非仅用 `@` 开头,因为有小概率会与某些 `scoped` 形式的 `npm` 包(行如:[@tarojs/taro](https://npm.im/@tarojs/taro), [@babel/core](https://npm.im/@babel/core))产生命名冲突。* + +## copy + +文件 copy 配置,包含两个配置项 `patterns` 和 `options`。 + +### copy.patterns + +用来指定需要拷贝的文件或者目录,**数组类型**,每一项都必须包含 `from` 、`to` 的配置,分别代表来源和需要拷贝到的目录,同时可以设置 `ignore` 配置来指定需要忽略的文件, `ignore` 是指定的 [glob](https://github.com/isaacs/node-glob) 类型字符串,或者 glob 字符串数组。 + +值得注意的是,目前 `from` 必须指定存在的文件或者目录,暂不支持 glob 格式, `from` 和 `to` 直接置顶项目根目录下的文件目录,建议 `from` 以 `src` 目录开头,`to` 以 `dist` 目录开头。 + +一般有如下的使用形式: + +```jsx +copy: { + patterns: [ + { from: 'src/asset/tt/', to: 'dist/asset/tt/', ignore: '*.js' }, // 指定需要 copy 的目录 + { from: 'src/asset/tt/sd.jpg', to: 'dist/asset/tt/sd.jpg' } // 指定需要 copy 的文件 + ] +}, +``` + +### copy.options + +拷贝配置,目前可以指定全局的 ignore: + +```jsx +copy: { + options: { + ignore: ['*.js', '*.css'] // 全局的 ignore + } +} +``` + +## mini + +专属于小程序的配置。 + +### mini.compile + +小程序编译过程的相关配置。 + +#### mini.compile.compressTemplate + +决定小程序打包时是否需要压缩 wxml + +#### mini.compile.exclude + +配置小程序编译过程中排除不需要经过 Taro 编译的文件,数组类型,写文件路径,文件路径必须以源码所在 `src` 目录开头: + +```jsx +mini: { + compile: { + exclude: ['src/components/ec-canvas/echarts.js'] + } +} +``` + +### mini.webpackChain + +自定义 Webpack 配置,接受函数形式的配置。 + +这个函数会收到两个参数,第一个参数是 webpackChain 对象,可参考 [webpack-chain](https://github.com/neutrinojs/webpack-chain) 的 api 进行修改;第二个参数是 `webpack` 实例。例如: + +```jsx +// 这是一个添加 raw-loader 的例子,用于在项目中直接引用 md 文件 +{ + webpackChain (chain, webpack) { + chain.merge({ + module: { + rule: { + myloader: { + test: /\.md$/, + use: [{ + loader: 'raw-loader', + options: {} + }] + } + } + } + }) + } +} +``` + +```jsx +// 这是一个添加插件的例子 +{ + webpackChain (chain, webpack) { + chain.merge({ + plugin: { + install: { + plugin: require('npm-install-webpack-plugin'), + args: [{ + // Use --save or --save-dev + dev: false, + // Install missing peerDependencies + peerDependencies: true, + // Reduce amount of console logging + quiet: false, + // npm command used inside company, yarn is not supported yet + npm: 'cnpm' + }] + } + } + }) + } +} +``` + +### mini.cssLoaderOption + +css-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/css-loader),例如: + +```jsx +{ + cssLoaderOption: { + localIdentName: '[hash:base64]' + } +} +``` + +### mini.styleLoaderOption + +style-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/style-loader),例如: + +```jsx +{ + styleLoaderOption: { + insertAt: 'top' + } +} +``` + +### mini.sassLoaderOption + +sass-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/sass-loader),例如: + +```jsx +{ + sassLoaderOption: { + implementation: require("dart-sass") + } +} +``` + +### mini.lessLoaderOption + +less-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/less-loader),例如: + +```jsx +{ + lessLoaderOption: { + strictMath: true, + noIeCompat: true + } +} +``` + +### mini.stylusLoaderOption + +stylus-loader 的附加配置。配置项参考[官方文档](https://github.com/shama/stylus-loader)。 + +### mini.mediaUrlLoaderOption + +针对 `mp4 | webm | ogg | mp3 | wav | flac | aac` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader),例如: + +```jsx +{ + mediaUrlLoaderOption: { + limit: 8192 + } +} +``` + +### mini.fontUrlLoaderOption + +针对 `woff | woff2 | eot | ttf | otf` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader)。 + +### mini.imageUrlLoaderOption + +针对 `png | jpg | jpeg | gif | bpm | svg` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader)。 + +### mini.miniCssExtractPluginOption + +`mini-css-extract-plugin` 的附加配置,在 `enableExtract` 为 `true` 的情况下生效。 +配置项参考[官方文档](https://github.com/webpack-contrib/mini-css-extract-plugin),例如: + +```jsx +{ + miniCssExtractPluginOption: { + filename: '[name].css', + chunkFilename: '[name].css' + } +} +``` + +### mini.postcss + +配置 `postcss` 相关插件: + +```jsx +postcss: { + // 可以进行 autoprefixer 的配置。配置项参考官方文档 https://github.com/postcss/autoprefixer + autoprefixer: { + enable: true, + config: { + // autoprefixer 配置项 + } + }, + pxtransform: { + enable: true, + config: { + // pxtransform 配置项,参考尺寸章节 + selectorBlackList: ['body'] + } + }, + // 小程序端样式引用本地资源内联 + url: { + enable: true, + config: { + limit: 10240 // 设定转换尺寸上限 + } + }, + // css modules 功能开关与相关配置 + cssModules: { + enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true + config: { + generateScopedName: '[name]__[local]___[hash:base64:5]' + } + } +} +``` + +## h5 + +专属于 H5 的配置。 + +### h5.devServer + +预览服务的配置,可以更改端口等参数。具体配置参考 [webpack-dev-server](https://webpack.js.org/configuration/dev-server)。 + +```js +devServer: { + port: 10086 +} +``` + +默认是 `http` 服务,如果想开启 `https` 服务需要做如下配置。 + +```js +devServer: { + https: true +} +``` + +### h5.output + +输出配置 + +```js +output: { + filename: 'js/[name].[hash:8].js', + chunkFilename: 'js/[name].[chunkhash:8].js' +} +``` + +### h5.publicPath + +设置输出解析文件的目录。 + +### h5.staticDirectory + +h5 编译后的静态文件目录。 + +### h5.chunkDirectory + +编译后非 entry 的 js 文件的存放目录,主要影响动态引入的 `pages` 的存放路径。 + +### h5.webpackChain + +自定义 Webpack 配置,接受函数形式的配置。 + +这个函数会收到两个参数,第一个参数是 webpackChain 对象,可参考 [webpack-chain](https://github.com/neutrinojs/webpack-chain) 的 api 进行修改;第二个参数是 `webpack` 实例。例如: + +```jsx +// 这是一个添加 ts-loader 的例子,但事实上 taro 是默认支持 ts 的,并不需要这样做。 +{ + webpackChain (chain, webpack) { + chain.merge({ + module: { + rule: { + myloader: { + test: /.tsx?/, + use: [{ + loader: 'ts-loader', + options: {} + }] + } + } + } + }) + } +} +``` + +```jsx +// 这是一个添加插件的例子 +{ + webpackChain (chain, webpack) { + chain.merge({ + plugin: { + install: { + plugin: require('npm-install-webpack-plugin'), + args: [{ + // Use --save or --save-dev + dev: false, + // Install missing peerDependencies + peerDependencies: true, + // Reduce amount of console logging + quiet: false, + // npm command used inside company, yarn is not supported yet + npm: 'cnpm' + }] + } + } + }) + } +} +``` + +### [DEPRECATED]h5.webpack + +自定义 Webpack 配置。这个配置项支持两种形式的配置: + +1. 如果该配置项以**对象**的形态呈现,Taro 将会使用 `webpack-merge` 将这个对象合并到默认的配置项中。 +例子: + +```jsx +webpack: { + resolve: { + alias: { + 'test': './test' + } + } +} +``` + +2. 如果该配置以**函数**的形态呈现,那这个函数将会接收到两个参数:默认配置(defaultConfig)和 Webpack 实例(webpack)。Taro 将会以该函数的返回值作为最终的 Webpack 配置。 + +例子: + +```jsx +webpack (defaultConfig, webpack) { + defaultConfig.plugins.push( + new webpack.EnvironmentPlugin(['NODE_ENV']) + ) + return defaultConfig +} +``` + +### h5.router + +路由相关的配置,支持路由模式、路由基准路径以及自定义路由的配置。 + +#### h5.router.mode + +路由模式配置。配置值为 `hash`(默认值)或 `browser`,分别对应 hash 路由模式和浏览器 history 路由模式。例子: + +```js +h5: { + /* 其他配置 */ + ... , + router: { + mode: 'hash' // 或者是 'browser' + } +} +``` + +针对上面的配置,调用 `Taro.navigateTo({ url: '/pages/index/index' })` 后,浏览器地址栏将被变为 `http://{{domain}}/#/pages/index/index`(hash 模式)或者 `http://{{domain}}/pages/index/index`(browser 模式)。 + +#### h5.router.basename + +路由基准路径的配置,配置值为 `string` 类型。例子: + +```js +h5: { + /* 其他配置 */ + ... , + router: { + basename: '/myapp' + } +} +``` + +针对上面的配置,调用 `Taro.navigateTo({ url: '/pages/index/index' })` 后,浏览器地址栏将被变为 `http://{{domain}}/#/myapp/pages/index/index`(hash 模式)或者 `http://{{domain}}/myapp/pages/index/index`(browser 模式)。 + +#### h5.router.customRoutes + +自定义路由的配置,配置值为 `{ [key: string]: string }` 类型。例子: + +```js +h5: { + /* 其他配置 */ + ... , + router: { + customRoutes: { + '/pages/index/index': '/index' + } + } +} +``` + +针对上面的配置,调用 `Taro.navigateTo({ url: '/pages/index/index' })` 后,浏览器地址栏将被变为 `http://{{domain}}/#/index`(hash 模式)或者 `http://{{domain}}/myapp/index`(browser 模式)。 + +### h5.entry + +Taro app 的入口,同 [webpack.entry](https://webpack.js.org/configuration/entry-context/#entry)。 + +```jsx +{ + entry: { + home: ['./home.js'], + about: ['./about.js'], + contact: ['./contact.js'] + } +} +``` + +### h5.enableSourceMap + +sourceMap 开关,影响 js、css 的 sourceMap 配置。 +dev 状态默认 **开**,prod 状态默认 **关**。 + +### h5.sourceMapType +sourceMap格式, 默认cheap-module-eval-source-map。[具体配置](https://webpack.js.org/configuration/devtool/#devtool) + +### h5.enableDll + +dll 开关,开启后将使用 `dllPlugin` 把内置的部分依赖库打包为单独的 dll 文件, +某种程度上可以减少首屏单个文件体积。 +dev 状态默认 **关**,prod 状态默认 **开**。 + +### h5.dllWebpackChain + +同 `h5.webpackChain`,不过作用于 dll。 + +### h5.dllEntry + +dll编译过程的 `entry` 配置项,决定了 dll 文件的内容,可参考 [webpack.entry](https://webpack.js.org/configuration/entry-context/#entry)。默认值: + +```js +h5: { + /* 其他配置 */ + ..., + dllEntry: { + lib: ['nervjs', '@tarojs/taro-h5', '@tarojs/router', '@tarojs/components'] + } +} +``` + +### h5.enableExtract + +extract 功能开关,开启后将使用 `mini-css-extract-plugin` 分离 css 文件, +可通过 `h5.miniCssExtractPluginOption` 对插件进行配置。 +dev 状态默认 **关**,prod 状态默认 **开**。 + +### h5.esnextModules + +配置需要额外的编译的源码模块,比如 [taro-ui](https://github.com/NervJS/taro-ui): + +```javascript +h5: { + // 经过这一配置之后,代码中引入的处于 `node_modules/taro-ui/` 路径下的源码文件均会经过taro的编译处理。 + esnextModules: ['taro-ui'], + ... +} +``` + +### h5.cssLoaderOption + +css-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/css-loader),例如: + +```jsx +{ + cssLoaderOption: { + localIdentName: '[hash:base64]' + } +} +``` + +### h5.styleLoaderOption + +style-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/style-loader),例如: + +```jsx +{ + styleLoaderOption: { + insertAt: 'top' + } +} +``` + +### h5.sassLoaderOption + +sass-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/sass-loader),例如: + +```jsx +{ + sassLoaderOption: { + implementation: require("dart-sass") + } +} +``` + +### h5.lessLoaderOption + +less-loader 的附加配置。配置项参考[官方文档](https://github.com/webpack-contrib/less-loader),例如: + +```jsx +{ + lessLoaderOption: { + strictMath: true, + noIeCompat: true + } +} +``` + +### h5.stylusLoaderOption + +stylus-loader 的附加配置。配置项参考[官方文档](https://github.com/shama/stylus-loader)。 + +### h5.mediaUrlLoaderOption + +针对 `mp4 | webm | ogg | mp3 | wav | flac | aac` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader),例如: + +```jsx +{ + mediaUrlLoaderOption: { + limit: 8192 + } +} +``` + +### h5.fontUrlLoaderOption + +针对 `woff | woff2 | eot | ttf | otf` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader)。 + +### h5.imageUrlLoaderOption + +针对 `png | jpg | jpeg | gif | bpm | svg` 文件的 url-loader 配置。配置项参考[官方文档](https://github.com/webpack-contrib/url-loader)。 + +### h5.miniCssExtractPluginOption + +`mini-css-extract-plugin` 的附加配置,在 `enableExtract` 为 `true` 的情况下生效。 +配置项参考[官方文档](https://github.com/webpack-contrib/mini-css-extract-plugin),例如: + +```jsx +{ + miniCssExtractPluginOption: { + filename: 'css/[name].css', + chunkFilename: 'css/[id].css' + } +} +``` + +### h5.postcss + +配置 H5 的 `postcss` 插件。 + +#### h5.postcss.autoprefixer + +可以进行 `autoprefixer` 的配置。配置项参考[官方文档](https://github.com/postcss/autoprefixer),例如: + +```jsx +postcss: { + autoprefixer: { + enable: true, + config: { + /* autoprefixer 配置项 */ + } + } +} +``` + +#### h5.postcss.pxtransform + +可以进行 `pxtransform` 的配置。配置项参考[官方文档](https://github.com/Pines-Cheng/postcss-pxtransform/),例如: + +```jsx +postcss: { + pxtransform: { + enable: true, + config: { + /* pxtransform 配置项 */ + } + } +} +``` + +#### h5.postcss.cssModules + +可以进行 H5 端 CSS Modules 配置,配置如下: + +```js +postcss: { + // css modules 功能开关与相关配置 + cssModules: { + enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true + config: { + namingPattern: 'module', + generateScopedName: '[name]__[local]___[hash:base64:5]' + } + } +} +``` diff --git a/website/versions.json b/website/versions.json index 072c90002d55..d2b53090ee06 100644 --- a/website/versions.json +++ b/website/versions.json @@ -1,4 +1,5 @@ [ + "2.0.0-beta.3", "2.0.0-beta.2", "1.3.34", "1.3.33", From a5cbb9862be1d7c9e24d3b5dab80be0be27d3390 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 21 Nov 2019 10:44:54 +0800 Subject: [PATCH 102/194] =?UTF-8?q?fix(cli):=20=E6=9B=B4=E6=96=B0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/templates/default/config/index.js | 12 +----------- packages/taro-cli/templates/default/package.json | 5 +---- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/taro-cli/templates/default/config/index.js b/packages/taro-cli/templates/default/config/index.js index 03193f349f9c..fd001d9044ba 100644 --- a/packages/taro-cli/templates/default/config/index.js +++ b/packages/taro-cli/templates/default/config/index.js @@ -25,18 +25,8 @@ const config = { plugins: [], defineConstants: { }, - weapp: { + mini: { postcss: { - autoprefixer: { - enable: true, - config: { - browsers: [ - 'last 3 versions', - 'Android >= 4.1', - 'ios >= 8' - ] - } - }, pxtransform: { enable: true, config: { diff --git a/packages/taro-cli/templates/default/package.json b/packages/taro-cli/templates/default/package.json index 77854d11ecda..aecd09618a7e 100644 --- a/packages/taro-cli/templates/default/package.json +++ b/packages/taro-cli/templates/default/package.json @@ -47,10 +47,7 @@ "devDependencies": { "@types/react": "^16.4.6", "@types/webpack-env": "^1.13.6", - "@tarojs/plugin-babel": "<%= version %>", - "@tarojs/plugin-csso": "<%= version %>",<% if (css !== 'none') {%> - "@tarojs/plugin-<%= css %>": "<%= version %>",<%}%> - "@tarojs/plugin-uglifyjs": "<%= version %>", + "@tarojs/mini-runner": "<%= version %>", "@tarojs/webpack-runner": "<%= version %>", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", From 71b34ebbf0f0f22803232e36a0320617ed3cb948 Mon Sep 17 00:00:00 2001 From: Garfield Lee Date: Thu, 21 Nov 2019 11:03:19 +0800 Subject: [PATCH 103/194] =?UTF-8?q?fix(template):=20=E6=9B=B4=E6=96=B0=20T?= =?UTF-8?q?aro=202.0=20=E7=9A=84=E6=A8=A1=E7=89=88=E5=92=8C=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=9C=B0=E5=9D=80=20#4837?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/util/constants.ts | 2 +- packages/taro-cli/templates/default/config/dev.js | 5 ++--- packages/taro-cli/templates/default/config/index.js | 4 +--- packages/taro-cli/templates/default/config/prod.js | 5 ++--- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/taro-cli/src/util/constants.ts b/packages/taro-cli/src/util/constants.ts index 3bf24c326629..64819d0b745d 100644 --- a/packages/taro-cli/src/util/constants.ts +++ b/packages/taro-cli/src/util/constants.ts @@ -364,6 +364,6 @@ export const taroJsMobxCommon = '@tarojs/mobx-common' export const DEVICE_RATIO_NAME = 'deviceRatio' export const isWindows = os.platform() === 'win32' -export const DEFAULT_TEMPLATE_SRC = 'github:NervJS/taro-project-templates' +export const DEFAULT_TEMPLATE_SRC = 'github:NervJS/taro-project-templates#next' export const TARO_CONFIG_FLODER = '.taro' export const TARO_BASE_CONFIG = 'index.json' diff --git a/packages/taro-cli/templates/default/config/dev.js b/packages/taro-cli/templates/default/config/dev.js index 03776341d4a4..75ad98aeeb6f 100644 --- a/packages/taro-cli/templates/default/config/dev.js +++ b/packages/taro-cli/templates/default/config/dev.js @@ -2,8 +2,7 @@ module.exports = { env: { NODE_ENV: '"development"' }, - defineConstants: { - }, - weapp: {}, + defineConstants: {}, + mini: {}, h5: {} } diff --git a/packages/taro-cli/templates/default/config/index.js b/packages/taro-cli/templates/default/config/index.js index fd001d9044ba..77f7e92c5665 100644 --- a/packages/taro-cli/templates/default/config/index.js +++ b/packages/taro-cli/templates/default/config/index.js @@ -29,9 +29,7 @@ const config = { postcss: { pxtransform: { enable: true, - config: { - - } + config: {} }, url: { enable: true, diff --git a/packages/taro-cli/templates/default/config/prod.js b/packages/taro-cli/templates/default/config/prod.js index c6a1531337f2..fbd825bd81ea 100644 --- a/packages/taro-cli/templates/default/config/prod.js +++ b/packages/taro-cli/templates/default/config/prod.js @@ -2,9 +2,8 @@ module.exports = { env: { NODE_ENV: '"production"' }, - defineConstants: { - }, - weapp: {}, + defineConstants: {}, + mini: {}, h5: { /** * 如果h5端编译后体积过大,可以使用webpack-bundle-analyzer插件对打包体积进行分析。 From 860c3b91e18f4bb7c3a129e5d28e55506985ba21 Mon Sep 17 00:00:00 2001 From: Garfield Lee Date: Thu, 21 Nov 2019 12:37:03 +0800 Subject: [PATCH 104/194] =?UTF-8?q?feat(taro-cli):=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=88=86=E5=BC=80=E5=AD=98=E6=94=BE=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20taro=20config=20=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/bin/taro-config | 9 ++++++--- packages/taro-cli/src/taro-config/index.ts | 19 +++++++++++++++++-- packages/taro-cli/src/util/constants.ts | 2 +- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/packages/taro-cli/bin/taro-config b/packages/taro-cli/bin/taro-config index 79b19239901e..d81b6c0bf271 100755 --- a/packages/taro-cli/bin/taro-config +++ b/packages/taro-cli/bin/taro-config @@ -4,6 +4,8 @@ const program = require('commander') const helper = require('../dist/taro-config') program + .name('taro config') + .usage(' [options]') .option('--json', '以 JSON 形式输出') .on('--help', function () { console.log('') @@ -22,15 +24,15 @@ const [cmd, key, value] = args switch (cmd) { case 'get': - if (!key) return + if (!key) return console.log('Usage: taro config get foo') helper.get(key) break case 'set': - if (!key || !value) return + if (!key || !value) return console.log('Usage: taro config set foo bar') helper.set(key, value) break case 'delete': - if (!key) return + if (!key) return console.log('Usage: taro config delete foo') helper.deleteKey(key) break case 'list': @@ -38,5 +40,6 @@ switch (cmd) { helper.list(json) break default: + program.help() break } diff --git a/packages/taro-cli/src/taro-config/index.ts b/packages/taro-cli/src/taro-config/index.ts index 1ef7e2e6870e..7208c19ae508 100644 --- a/packages/taro-cli/src/taro-config/index.ts +++ b/packages/taro-cli/src/taro-config/index.ts @@ -1,15 +1,23 @@ import * as fs from 'fs-extra' import * as path from 'path' import { getUserHomeDir } from '../util' +import { TARO_CONFIG_FLODER, TARO_BASE_CONFIG } from '../util/constants' const homedir = getUserHomeDir() -const configPath = path.join(homedir, '.taro/index.json') +const configPath = path.join(homedir, `${TARO_CONFIG_FLODER}/${TARO_BASE_CONFIG}`) + +function displayConfigPath (configPath) { + console.log('Config path:', configPath) + console.log() +} export function get (key: string) { if (!homedir) return console.log('找不到用户根目录') + if (fs.existsSync(configPath)) { + displayConfigPath(configPath) const config = fs.readJSONSync(configPath) - console.log(config[key]) + console.log('Key:', key, ', value:', config[key]) } } @@ -17,6 +25,7 @@ export function set (key: string, value: string) { if (!homedir) return console.log('找不到用户根目录') if (fs.existsSync(configPath)) { + displayConfigPath(configPath) const config = fs.readJSONSync(configPath) config[key] = value fs.writeJSONSync(configPath, config) @@ -26,21 +35,27 @@ export function set (key: string, value: string) { [key]: value }) } + console.log('Set key:', key, ', value:', value) } export function deleteKey (key: string) { if (!homedir) return console.log('找不到用户根目录') if (fs.existsSync(configPath)) { + displayConfigPath(configPath) const config = fs.readJSONSync(configPath) delete config[key] fs.writeJSONSync(configPath, config) } + console.log('Deleted:', key) } export function list (isJSONFormat: boolean = false) { if (!homedir) return console.log('找不到用户根目录') + if (fs.existsSync(configPath)) { + displayConfigPath(configPath) + console.log('Config info:') const config = fs.readJSONSync(configPath) if (isJSONFormat) { console.log(JSON.stringify(config, null, 2)) diff --git a/packages/taro-cli/src/util/constants.ts b/packages/taro-cli/src/util/constants.ts index 64819d0b745d..766af71bfe92 100644 --- a/packages/taro-cli/src/util/constants.ts +++ b/packages/taro-cli/src/util/constants.ts @@ -365,5 +365,5 @@ export const DEVICE_RATIO_NAME = 'deviceRatio' export const isWindows = os.platform() === 'win32' export const DEFAULT_TEMPLATE_SRC = 'github:NervJS/taro-project-templates#next' -export const TARO_CONFIG_FLODER = '.taro' +export const TARO_CONFIG_FLODER = '.taro2' export const TARO_BASE_CONFIG = 'index.json' From 83322ec7d456fb31c794fbf4470d651a72c650c5 Mon Sep 17 00:00:00 2001 From: pengzhouhu Date: Thu, 21 Nov 2019 13:54:01 +0800 Subject: [PATCH 105/194] =?UTF-8?q?feat(components-qa):=20=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E5=BF=AB=E5=BA=94=E7=94=A8button=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=B1=9E=E6=80=A7=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=8F=8A=E7=82=B9=E5=87=BB=E5=8F=98=E8=89=B2=E7=AD=89=20(#4882?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/taro-button/index.ux | 193 +++++++++++------- 1 file changed, 115 insertions(+), 78 deletions(-) diff --git a/packages/taro-components-qa/src/components/taro-button/index.ux b/packages/taro-components-qa/src/components/taro-button/index.ux index b65dfb3edb07..787ca48b40b9 100644 --- a/packages/taro-components-qa/src/components/taro-button/index.ux +++ b/packages/taro-components-qa/src/components/taro-button/index.ux @@ -4,104 +4,141 @@ disabled="{{disabled}}" style="{{customstyle}}" > + +}; From 21c575426d78483f86602009430c1a2e586f493e Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 21 Nov 2019 14:10:31 +0800 Subject: [PATCH 106/194] chore(release): publish v2.0.0-beta.4 --- lerna.json | 2 +- .../package.json | 2 +- .../package.json | 4 ++-- packages/css-to-react-native/package.json | 2 +- packages/eslint-config-taro/package.json | 4 ++-- packages/eslint-plugin-taro/package.json | 2 +- .../postcss-plugin-constparse/package.json | 2 +- packages/postcss-pxtransform/package.json | 2 +- packages/postcss-unit-transform/package.json | 2 +- .../stylelint-config-taro-rn/package.json | 4 ++-- packages/stylelint-taro-rn/package.json | 2 +- packages/taro-alipay/package.json | 6 ++--- packages/taro-async-await/package.json | 2 +- packages/taro-cli/package.json | 22 +++++++++---------- packages/taro-components-qa/package.json | 2 +- packages/taro-components-rn/package.json | 2 +- packages/taro-components/package.json | 6 ++--- packages/taro-h5/package.json | 6 ++--- packages/taro-jd/package.json | 6 ++--- packages/taro-mini-runner/package.json | 8 +++---- packages/taro-mobx-common/package.json | 2 +- packages/taro-mobx-h5/package.json | 6 ++--- packages/taro-mobx-rn/package.json | 6 ++--- packages/taro-mobx/package.json | 6 ++--- packages/taro-plugin-babel/package.json | 2 +- packages/taro-plugin-csso/package.json | 2 +- packages/taro-plugin-less/package.json | 2 +- packages/taro-plugin-sass/package.json | 2 +- packages/taro-plugin-stylus/package.json | 2 +- packages/taro-plugin-typescript/package.json | 2 +- packages/taro-plugin-uglifyjs/package.json | 2 +- packages/taro-qq/package.json | 6 ++--- packages/taro-quickapp/package.json | 6 ++--- packages/taro-redux-h5/package.json | 4 ++-- packages/taro-redux-rn/package.json | 2 +- packages/taro-redux/package.json | 6 ++--- packages/taro-rn-runner/package.json | 2 +- packages/taro-rn/package.json | 4 ++-- packages/taro-router-rn/package.json | 2 +- packages/taro-router/package.json | 4 ++-- packages/taro-swan/package.json | 6 ++--- packages/taro-transformer-wx/package.json | 6 ++--- packages/taro-tt/package.json | 6 ++--- packages/taro-utils/package.json | 2 +- packages/taro-weapp/package.json | 6 ++--- packages/taro-webpack-runner/package.json | 14 ++++++------ packages/taro-with-weapp/package.json | 4 ++-- packages/taro/package.json | 4 ++-- packages/taroize/package.json | 2 +- 49 files changed, 104 insertions(+), 104 deletions(-) diff --git a/lerna.json b/lerna.json index 9f52549bfb81..cf69fea2d7db 100644 --- a/lerna.json +++ b/lerna.json @@ -55,6 +55,6 @@ "message": "chore(release): publish %s" } }, - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "npmClient": "npm" } diff --git a/packages/babel-plugin-transform-jsx-to-stylesheet/package.json b/packages/babel-plugin-transform-jsx-to-stylesheet/package.json index 51bae9912b7f..337b219a3c23 100644 --- a/packages/babel-plugin-transform-jsx-to-stylesheet/package.json +++ b/packages/babel-plugin-transform-jsx-to-stylesheet/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-jsx-to-stylesheet", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Transform stylesheet selector to style in JSX Elements.", "license": "MIT", "main": "src/index.js", diff --git a/packages/babel-plugin-transform-taroapi/package.json b/packages/babel-plugin-transform-taroapi/package.json index 21093eaebfdd..260ef266e684 100644 --- a/packages/babel-plugin-transform-taroapi/package.json +++ b/packages/babel-plugin-transform-taroapi/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-taroapi", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "main": "dist/index.js", "license": "MIT", "scripts": { @@ -10,7 +10,7 @@ "test": "jest" }, "devDependencies": { - "@tarojs/taro-h5": "2.0.0-beta.3", + "@tarojs/taro-h5": "2.0.0-beta.4", "@types/babel-core": "^6.25.5", "@types/babel-traverse": "^6.25.4", "@types/babel-types": "^7.0.4", diff --git a/packages/css-to-react-native/package.json b/packages/css-to-react-native/package.json index a0ccee92ea4b..ef22943200f9 100644 --- a/packages/css-to-react-native/package.json +++ b/packages/css-to-react-native/package.json @@ -1,7 +1,7 @@ { "name": "taro-css-to-react-native", "description": "Convert CSS text to a React Native stylesheet object", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "main": "dist/index.js", "license": "MIT", "scripts": { diff --git a/packages/eslint-config-taro/package.json b/packages/eslint-config-taro/package.json index 2d38a0ccabf6..9361b019b6ad 100644 --- a/packages/eslint-config-taro/package.json +++ b/packages/eslint-config-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-taro", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro specific linting rules for ESLint", "main": "index.js", "files": [ @@ -28,6 +28,6 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "eslint-plugin-taro": "2.0.0-beta.3" + "eslint-plugin-taro": "2.0.0-beta.4" } } diff --git a/packages/eslint-plugin-taro/package.json b/packages/eslint-plugin-taro/package.json index b92d336b2023..485af56eca68 100644 --- a/packages/eslint-plugin-taro/package.json +++ b/packages/eslint-plugin-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-taro", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro specific linting plugin for ESLint", "main": "index.js", "files": [ diff --git a/packages/postcss-plugin-constparse/package.json b/packages/postcss-plugin-constparse/package.json index 0896f0c8ad1b..c7d4c251b2d7 100644 --- a/packages/postcss-plugin-constparse/package.json +++ b/packages/postcss-plugin-constparse/package.json @@ -1,6 +1,6 @@ { "name": "postcss-plugin-constparse", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "parse constants defined in config", "main": "index.js", "author": "Simba", diff --git a/packages/postcss-pxtransform/package.json b/packages/postcss-pxtransform/package.json index e75b3f97cde3..9147cd1d2c8a 100644 --- a/packages/postcss-pxtransform/package.json +++ b/packages/postcss-pxtransform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-pxtransform", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位", "keywords": [ "postcss", diff --git a/packages/postcss-unit-transform/package.json b/packages/postcss-unit-transform/package.json index 3b1fa99901c9..bca900da40e2 100644 --- a/packages/postcss-unit-transform/package.json +++ b/packages/postcss-unit-transform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-taro-unit-transform", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "小程序单位转换", "main": "index.js", "scripts": { diff --git a/packages/stylelint-config-taro-rn/package.json b/packages/stylelint-config-taro-rn/package.json index 28df1826a573..f04f07145886 100644 --- a/packages/stylelint-config-taro-rn/package.json +++ b/packages/stylelint-config-taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "stylelint-config-taro-rn", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Shareable stylelint config for React Native CSS modules", "main": "index.js", "files": [ @@ -28,6 +28,6 @@ "jest": "^23.6.0", "npmpub": "^4.1.0", "stylelint": "9.3.0", - "stylelint-taro-rn": "2.0.0-beta.3" + "stylelint-taro-rn": "2.0.0-beta.4" } } diff --git a/packages/stylelint-taro-rn/package.json b/packages/stylelint-taro-rn/package.json index 87955036b9f7..cbd2824f0bad 100644 --- a/packages/stylelint-taro-rn/package.json +++ b/packages/stylelint-taro-rn/package.json @@ -1,7 +1,7 @@ { "name": "stylelint-taro-rn", "description": "A collection of React Native specific rules for stylelint", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "main": "dist/index.js", "babel": { "presets": [ diff --git a/packages/taro-alipay/package.json b/packages/taro-alipay/package.json index ca2c7d79be39..a4175bb397fc 100644 --- a/packages/taro-alipay/package.json +++ b/packages/taro-alipay/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-alipay", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro alipay framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.3", - "@tarojs/utils": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", + "@tarojs/utils": "2.0.0-beta.4", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-async-await/package.json b/packages/taro-async-await/package.json index 4ec9082e7695..e762e786d728 100644 --- a/packages/taro-async-await/package.json +++ b/packages/taro-async-await/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/async-await", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "taro async await", "main": "index.js", "scripts": { diff --git a/packages/taro-cli/package.json b/packages/taro-cli/package.json index f1dd271ff9bb..2b0488f03df4 100644 --- a/packages/taro-cli/package.json +++ b/packages/taro-cli/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/cli", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "cli tool for taro", "main": "index.js", "scripts": { @@ -40,8 +40,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taroize": "2.0.0-beta.3", - "@tarojs/transformer-wx": "2.0.0-beta.3", + "@tarojs/taroize": "2.0.0-beta.4", + "@tarojs/transformer-wx": "2.0.0-beta.4", "@types/request": "^2.48.1", "@typescript-eslint/parser": "^2.0.0", "adm-zip": "^0.4.13", @@ -54,7 +54,7 @@ "babel-plugin-remove-dead-code": "^1.3.2", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-define": "^1.3.0", - "babel-plugin-transform-jsx-to-stylesheet": "2.0.0-beta.3", + "babel-plugin-transform-jsx-to-stylesheet": "2.0.0-beta.4", "babel-plugin-transform-react-jsx": "^6.24.1", "babel-plugin-transform-taroapi": "1.3.15", "babel-template": "^6.26.0", @@ -73,11 +73,11 @@ "ejs": "^2.6.1", "envinfo": "^6.0.1", "eslint": "^6.1.0", - "eslint-config-taro": "2.0.0-beta.3", + "eslint-config-taro": "2.0.0-beta.4", "eslint-plugin-import": "^2.8.0", "eslint-plugin-react": "^7.4.0", "eslint-plugin-react-hooks": "^1.6.1", - "eslint-plugin-taro": "2.0.0-beta.3", + "eslint-plugin-taro": "2.0.0-beta.4", "eslint-plugin-typescript": "^0.12.0", "fbjs": "^1.0.0", "find-yarn-workspace-root": "1.2.1", @@ -100,7 +100,7 @@ "postcss-modules-resolve-imports": "^1.3.0", "postcss-modules-scope": "^1.1.0", "postcss-modules-values": "^1.3.0", - "postcss-pxtransform": "2.0.0-beta.3", + "postcss-pxtransform": "2.0.0-beta.4", "postcss-reporter": "^6.0.1", "postcss-taro-unit-transform": "1.2.15", "postcss-url": "^7.3.2", @@ -112,10 +112,10 @@ "semver": "^5.5.0", "shelljs": "^0.8.1", "stylelint": "9.3.0", - "stylelint-config-taro-rn": "2.0.0-beta.3", - "stylelint-taro-rn": "2.0.0-beta.3", + "stylelint-config-taro-rn": "2.0.0-beta.4", + "stylelint-taro-rn": "2.0.0-beta.4", "tapable": "^1.1.3", - "taro-css-to-react-native": "2.0.0-beta.3", + "taro-css-to-react-native": "2.0.0-beta.4", "through2": "^2.0.3", "vinyl": "^2.1.0", "vinyl-fs": "^3.0.2", @@ -124,7 +124,7 @@ "yauzl": "2.10.0" }, "devDependencies": { - "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", "@types/autoprefixer": "^9.1.1", "@types/babel-core": "^6.25.5", "@types/babel-generator": "^6.25.2", diff --git a/packages/taro-components-qa/package.json b/packages/taro-components-qa/package.json index 43a0ba707fef..b9ddbfeaea33 100644 --- a/packages/taro-components-qa/package.json +++ b/packages/taro-components-qa/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-qa", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "多端解决方案基础组件(快应用)", "main": "./index.js", "files": [ diff --git a/packages/taro-components-rn/package.json b/packages/taro-components-rn/package.json index f20a2fa7d750..7ea06ee1e49b 100644 --- a/packages/taro-components-rn/package.json +++ b/packages/taro-components-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-rn", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "多端解决方案基础组件(RN)", "main": "./dist/index.js", "scripts": { diff --git a/packages/taro-components/package.json b/packages/taro-components/package.json index 4c31aa58439c..9b32b6cb72db 100644 --- a/packages/taro-components/package.json +++ b/packages/taro-components/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "", "main:h5": "src/index.js", "main": "dist/index.js", @@ -50,14 +50,14 @@ "@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/plugin-transform-react-jsx": "^7.0.0", "@babel/preset-env": "^7.1.5", - "@tarojs/taro-h5": "2.0.0-beta.3", + "@tarojs/taro-h5": "2.0.0-beta.4", "@types/react": "^16.4.6", "@types/urijs": "^1.15.38", "babel-core": "^7.0.0-bridge.0", "babel-eslint": "10.0.1", "babel-jest": "^22.4.4", "babel-loader": "^8.0.5", - "babel-plugin-transform-taroapi": "2.0.0-beta.3", + "babel-plugin-transform-taroapi": "2.0.0-beta.4", "css-loader": "^2.1.1", "file-loader": "^3.0.1", "jest": "^22.4.4", diff --git a/packages/taro-h5/package.json b/packages/taro-h5/package.json index 7c659ccd22b4..c8b8b2457d02 100644 --- a/packages/taro-h5/package.json +++ b/packages/taro-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-h5", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro h5 framework", "main:h5": "src/index.js", "main": "dist/index.cjs.js", @@ -45,8 +45,8 @@ "@babel/plugin-proposal-object-rest-spread": "^7.3.4", "@babel/plugin-transform-react-jsx": "^7.2.2", "@babel/preset-env": "^7.3.4", - "@tarojs/components": "2.0.0-beta.3", - "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/components": "2.0.0-beta.4", + "@tarojs/taro": "2.0.0-beta.4", "babel-core": "7.0.0-bridge.0", "babel-jest": "24.4.0", "eslint": "^4.18.2", diff --git a/packages/taro-jd/package.json b/packages/taro-jd/package.json index 457a8013f953..847e34530d6c 100644 --- a/packages/taro-jd/package.json +++ b/packages/taro-jd/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-jd", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro jd framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.3", - "@tarojs/utils": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", + "@tarojs/utils": "2.0.0-beta.4", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index 4a9a0fb5a1fe..0e661c4200b0 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Mini app runner for taro", "main": "index.js", "scripts": { @@ -32,8 +32,8 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/taro": "2.0.0-beta.3", - "@tarojs/transformer-wx": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", + "@tarojs/transformer-wx": "2.0.0-beta.4", "babel-core": "^6.26.3", "babel-generator": "^6.26.1", "babel-loader": "^8.0.6", @@ -58,7 +58,7 @@ "node-sass": "^4.12.0", "ora": "^3.4.0", "postcss-loader": "^3.0.0", - "postcss-pxtransform": "2.0.0-beta.3", + "postcss-pxtransform": "2.0.0-beta.4", "request": "^2.88.0", "resolve": "^1.11.1", "sass-loader": "^7.1.0", diff --git a/packages/taro-mobx-common/package.json b/packages/taro-mobx-common/package.json index 544809e249ad..2a64ac669fc4 100644 --- a/packages/taro-mobx-common/package.json +++ b/packages/taro-mobx-common/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-common", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "mobx library for taro", "keywords": [ "mobx", diff --git a/packages/taro-mobx-h5/package.json b/packages/taro-mobx-h5/package.json index 6c97785747b6..1e83500f263d 100644 --- a/packages/taro-mobx-h5/package.json +++ b/packages/taro-mobx-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-h5", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "mobx-h5 for taro", "keywords": [ "mobx", @@ -28,8 +28,8 @@ "nervjs": "^1.5.0" }, "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.3", - "@tarojs/taro-h5": "2.0.0-beta.3" + "@tarojs/mobx-common": "2.0.0-beta.4", + "@tarojs/taro-h5": "2.0.0-beta.4" }, "devDependencies": { "rimraf": "^2.6.2", diff --git a/packages/taro-mobx-rn/package.json b/packages/taro-mobx-rn/package.json index 08f34d25fc28..a345e72dffa6 100644 --- a/packages/taro-mobx-rn/package.json +++ b/packages/taro-mobx-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx-rn", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "mobx-rn for taro", "keywords": [ "mobx", @@ -18,7 +18,7 @@ "src" ], "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.3", - "@tarojs/taro-rn": "2.0.0-beta.3" + "@tarojs/mobx-common": "2.0.0-beta.4", + "@tarojs/taro-rn": "2.0.0-beta.4" } } diff --git a/packages/taro-mobx/package.json b/packages/taro-mobx/package.json index aa1bea70007e..169802dedd9f 100644 --- a/packages/taro-mobx/package.json +++ b/packages/taro-mobx/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mobx", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "mobx for taro", "keywords": [ "mobx", @@ -24,8 +24,8 @@ "clear": "rimraf dist" }, "dependencies": { - "@tarojs/mobx-common": "2.0.0-beta.3", - "@tarojs/taro": "2.0.0-beta.3" + "@tarojs/mobx-common": "2.0.0-beta.4", + "@tarojs/taro": "2.0.0-beta.4" }, "devDependencies": { "rimraf": "^2.6.2", diff --git a/packages/taro-plugin-babel/package.json b/packages/taro-plugin-babel/package.json index 540ffab1a091..478f76d45a13 100644 --- a/packages/taro-plugin-babel/package.json +++ b/packages/taro-plugin-babel/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-babel", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro babel编译", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-csso/package.json b/packages/taro-plugin-csso/package.json index d9fdc69461fc..85264f819328 100644 --- a/packages/taro-plugin-csso/package.json +++ b/packages/taro-plugin-csso/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-csso", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro压缩CSS文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-less/package.json b/packages/taro-plugin-less/package.json index 002fea485e07..35d40b431486 100644 --- a/packages/taro-plugin-less/package.json +++ b/packages/taro-plugin-less/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-less", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro 编译 less 文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-sass/package.json b/packages/taro-plugin-sass/package.json index b47983eac367..55ff36d8f063 100644 --- a/packages/taro-plugin-sass/package.json +++ b/packages/taro-plugin-sass/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-sass", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro编译sass文件", "main": "index.js", "files": [ diff --git a/packages/taro-plugin-stylus/package.json b/packages/taro-plugin-stylus/package.json index 7ca5c91ebb8f..c4832b58bd7e 100644 --- a/packages/taro-plugin-stylus/package.json +++ b/packages/taro-plugin-stylus/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-stylus", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro 编译 stylus 文件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-typescript/package.json b/packages/taro-plugin-typescript/package.json index 34ad927effdd..afbf32cf056e 100644 --- a/packages/taro-plugin-typescript/package.json +++ b/packages/taro-plugin-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-typescript", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro TypeScript 编译插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-uglifyjs/package.json b/packages/taro-plugin-uglifyjs/package.json index 06ba8f25ea23..2d2e91ac4857 100644 --- a/packages/taro-plugin-uglifyjs/package.json +++ b/packages/taro-plugin-uglifyjs/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-uglifyjs", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro压缩JS文件", "main": "index.js", "scripts": { diff --git a/packages/taro-qq/package.json b/packages/taro-qq/package.json index 1f6cabe2c849..1253aa945fe0 100644 --- a/packages/taro-qq/package.json +++ b/packages/taro-qq/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-qq", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro qq framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.3", - "@tarojs/utils": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", + "@tarojs/utils": "2.0.0-beta.4", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-quickapp/package.json b/packages/taro-quickapp/package.json index 4aa90c17f2ed..01984fa9fedf 100644 --- a/packages/taro-quickapp/package.json +++ b/packages/taro-quickapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-quickapp", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro quickapp framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.3", - "@tarojs/utils": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", + "@tarojs/utils": "2.0.0-beta.4", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-redux-h5/package.json b/packages/taro-redux-h5/package.json index fc125bc715b2..15d7a359ebfc 100644 --- a/packages/taro-redux-h5/package.json +++ b/packages/taro-redux-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/redux-h5", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Forked react-redux for taro", "keywords": [ "react", @@ -46,7 +46,7 @@ "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.49", "@babel/plugin-transform-react-jsx": "^7.0.0-beta.49", "@babel/preset-env": "^7.0.0-beta.49", - "@tarojs/taro-h5": "2.0.0-beta.3", + "@tarojs/taro-h5": "2.0.0-beta.4", "babel-plugin-transform-react-remove-prop-types": "^0.4.13", "redux": "^4.0.0", "rimraf": "^2.6.2", diff --git a/packages/taro-redux-rn/package.json b/packages/taro-redux-rn/package.json index 6c935f19238f..389111569559 100644 --- a/packages/taro-redux-rn/package.json +++ b/packages/taro-redux-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-redux-rn", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "taro-redux-rn", "main": "./src/index.js", "files": [ diff --git a/packages/taro-redux/package.json b/packages/taro-redux/package.json index d2b8b39c6c65..2b47ad27e7ea 100644 --- a/packages/taro-redux/package.json +++ b/packages/taro-redux/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/redux", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Redux for Taro", "main": "index.js", "typings": "types/index.d.ts", @@ -32,7 +32,7 @@ "jest": "^23.1.0" }, "dependencies": { - "@tarojs/taro": "2.0.0-beta.3", - "@tarojs/utils": "2.0.0-beta.3" + "@tarojs/taro": "2.0.0-beta.4", + "@tarojs/utils": "2.0.0-beta.4" } } diff --git a/packages/taro-rn-runner/package.json b/packages/taro-rn-runner/package.json index c96b8c44d9df..cc52b836a4c1 100644 --- a/packages/taro-rn-runner/package.json +++ b/packages/taro-rn-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-runner", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "ReactNative build tool for taro", "main": "index.js", "scripts": { diff --git a/packages/taro-rn/package.json b/packages/taro-rn/package.json index dd090ef211ed..aaa18da18699 100644 --- a/packages/taro-rn/package.json +++ b/packages/taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-rn", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro RN framework", "main": "./index.js", "files": [ @@ -27,7 +27,7 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", "babel-preset-expo": "^5.2.0", "base64-js": "^1.3.0", "expo-av": "^6.0.0", diff --git a/packages/taro-router-rn/package.json b/packages/taro-router-rn/package.json index c3e777519c80..093d4297112c 100644 --- a/packages/taro-router-rn/package.json +++ b/packages/taro-router-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-router-rn", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "taro-router-rn", "main": "./index.js", "files": [ diff --git a/packages/taro-router/package.json b/packages/taro-router/package.json index de1ef8944a8c..99eb783f0fb2 100644 --- a/packages/taro-router/package.json +++ b/packages/taro-router/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/router", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro-router", "main:h5": "dist/index.esm.js", "main": "index.js", @@ -41,7 +41,7 @@ "@babel/plugin-syntax-dynamic-import": "7.0.0", "@babel/plugin-transform-react-jsx": "7.0.0", "@babel/preset-env": "7.1.5", - "@tarojs/taro-h5": "2.0.0-beta.3", + "@tarojs/taro-h5": "2.0.0-beta.4", "@types/history": "4.7.2", "@types/jasmine": "2.8.11", "@types/jest": "23.3.9", diff --git a/packages/taro-swan/package.json b/packages/taro-swan/package.json index a922f1cccb17..48607bbf357f 100644 --- a/packages/taro-swan/package.json +++ b/packages/taro-swan/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-swan", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro swan framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.3", - "@tarojs/utils": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", + "@tarojs/utils": "2.0.0-beta.4", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-transformer-wx/package.json b/packages/taro-transformer-wx/package.json index 9760b2ed9b29..4691657d6218 100644 --- a/packages/taro-transformer-wx/package.json +++ b/packages/taro-transformer-wx/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/transformer-wx", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Transfrom Nerv Component to Wechat mini program.", "repository": { "type": "git", @@ -61,14 +61,14 @@ "babel-types": "^6.26.0", "eslint": "5.16.0", "eslint-plugin-react": "7.10.0", - "eslint-plugin-taro": "2.0.0-beta.3", + "eslint-plugin-taro": "2.0.0-beta.4", "html": "^1.0.0", "lodash": "^4.17.5", "prettier": "^1.14.2", "typescript": "^3.2.2" }, "devDependencies": { - "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", "@types/babel-core": "^6.25.5", "@types/babel-generator": "^6.25.1", "@types/babel-template": "^6.25.0", diff --git a/packages/taro-tt/package.json b/packages/taro-tt/package.json index 01f9a14193dc..3eb5ed867690 100644 --- a/packages/taro-tt/package.json +++ b/packages/taro-tt/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-tt", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro toutiao framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.3", - "@tarojs/utils": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", + "@tarojs/utils": "2.0.0-beta.4", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-utils/package.json b/packages/taro-utils/package.json index 427dab137060..7eb2af5da8a4 100644 --- a/packages/taro-utils/package.json +++ b/packages/taro-utils/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/utils", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Utils for Taro", "main": "index.js", "scripts": { diff --git a/packages/taro-weapp/package.json b/packages/taro-weapp/package.json index f8117ef93094..d795caa0b226 100644 --- a/packages/taro-weapp/package.json +++ b/packages/taro-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-weapp", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro weapp framework", "main": "index.js", "files": [ @@ -24,8 +24,8 @@ "author": "O2Team", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.3", - "@tarojs/utils": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", + "@tarojs/utils": "2.0.0-beta.4", "lodash": "^4.17.10", "prop-types": "^15.6.1" } diff --git a/packages/taro-webpack-runner/package.json b/packages/taro-webpack-runner/package.json index d027ff53e364..f49c7e40f2b0 100644 --- a/packages/taro-webpack-runner/package.json +++ b/packages/taro-webpack-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack-runner", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "webpack runner for taro", "main": "index.js", "scripts": { @@ -32,15 +32,15 @@ }, "homepage": "https://github.com/NervJS/taro#readme", "dependencies": { - "@tarojs/plugin-sass": "2.0.0-beta.3", - "@tarojs/taro": "2.0.0-beta.3", - "@tarojs/taro-h5": "2.0.0-beta.3", + "@tarojs/plugin-sass": "2.0.0-beta.4", + "@tarojs/taro": "2.0.0-beta.4", + "@tarojs/taro-h5": "2.0.0-beta.4", "autoprefixer": "8.6.4", "babel-core": "6.26.0", "babel-loader": "7.1.4", "babel-plugin-syntax-dynamic-import": "6.18.0", "babel-plugin-transform-react-jsx": "6.24.1", - "babel-plugin-transform-taroapi": "2.0.0-beta.3", + "babel-plugin-transform-taroapi": "2.0.0-beta.4", "babel-types": "6.26.0", "chalk": "2.4.2", "copy-webpack-plugin": "^5.0.3", @@ -57,8 +57,8 @@ "opn": "5.3.0", "ora": "2.1.0", "postcss-loader": "2.1.6", - "postcss-plugin-constparse": "2.0.0-beta.3", - "postcss-pxtransform": "2.0.0-beta.3", + "postcss-plugin-constparse": "2.0.0-beta.4", + "postcss-pxtransform": "2.0.0-beta.4", "resolve": "1.8.1", "resolve-url-loader": "2.3.0", "sass": "^1.23.1", diff --git a/packages/taro-with-weapp/package.json b/packages/taro-with-weapp/package.json index 5a95851deb64..7f784688149b 100644 --- a/packages/taro-with-weapp/package.json +++ b/packages/taro-with-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/with-weapp", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "taroize 之后的运行时", "main": "index.js", "scripts": { @@ -22,7 +22,7 @@ "author": "yuche", "license": "MIT", "dependencies": { - "@tarojs/taro": "2.0.0-beta.3", + "@tarojs/taro": "2.0.0-beta.4", "lodash": "^4.17.11" }, "devDependencies": { diff --git a/packages/taro/package.json b/packages/taro/package.json index 2bea9ff99643..3938fb10165e 100644 --- a/packages/taro/package.json +++ b/packages/taro/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "Taro framework", "module": "dist/index.esm.js", "main": "index.js", @@ -29,7 +29,7 @@ "nervjs": "^1.5.0" }, "dependencies": { - "@tarojs/utils": "2.0.0-beta.3" + "@tarojs/utils": "2.0.0-beta.4" }, "devDependencies": { "@types/react": "^16.9.4", diff --git a/packages/taroize/package.json b/packages/taroize/package.json index 77f63b337d7b..c1c62eac8b7b 100644 --- a/packages/taroize/package.json +++ b/packages/taroize/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taroize", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "转换原生微信小程序代码为 Taro 代码", "main": "index.js", "files": [ From 6531a1f480d1511ba6f6bdf6d0f0c0f647892f35 Mon Sep 17 00:00:00 2001 From: luckyadam Date: Thu, 21 Nov 2019 14:18:26 +0800 Subject: [PATCH 107/194] chore: changelog && docs --- CHANGELOG.md | 20 +- .../version-2.0.0-beta.4/README.md | 144 ++++ .../version-2.0.0-beta.4/async-await.md | 43 + .../version-2.0.0-beta.4/react-native.md | 776 ++++++++++++++++++ .../version-2.0.0-beta.4/size.md | 172 ++++ .../version-2.0.0-beta.4/taroize.md | 253 ++++++ website/versions.json | 1 + 7 files changed, 1401 insertions(+), 8 deletions(-) create mode 100644 website/versioned_docs/version-2.0.0-beta.4/README.md create mode 100644 website/versioned_docs/version-2.0.0-beta.4/async-await.md create mode 100644 website/versioned_docs/version-2.0.0-beta.4/react-native.md create mode 100644 website/versioned_docs/version-2.0.0-beta.4/size.md create mode 100644 website/versioned_docs/version-2.0.0-beta.4/taroize.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 270ee44c9c02..d7ece4ae8870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -150,6 +150,7 @@ * **cli:** 修复配置文件中读取不到 process.env.TARO_ENV 的问题 ([b0b1f8f](https://github.com/NervJS/taro/commit/b0b1f8f)) * **cli:** 支持引用 node_modules 中组件 ([d21eb65](https://github.com/NervJS/taro/commit/d21eb65)) * **cli:** 普通文件经过编译器编译必须传入 isNormal ([4aed827](https://github.com/NervJS/taro/commit/4aed827)) +* **cli:** 更新默认模板 ([95645e7](https://github.com/NervJS/taro/commit/95645e7)) * **cli:** 更新默认模板 ([f9f80a3](https://github.com/NervJS/taro/commit/f9f80a3)) * **cli:** 清理代码 ([91d35a2](https://github.com/NervJS/taro/commit/91d35a2)) * **cli:** 编译器参数调整 ([c5f3025](https://github.com/NervJS/taro/commit/c5f3025)) @@ -168,22 +169,23 @@ * **mini-runner:** 修复快应用编译后页面标题展示不正确的问题 ([b523f90](https://github.com/NervJS/taro/commit/b523f90)) * **mini-runner:** 修复普通小程序编译的问题 ([f5a2bc2](https://github.com/NervJS/taro/commit/f5a2bc2)) * **mini-runner:** 加上文件编译提示 ([61eef34](https://github.com/NervJS/taro/commit/61eef34)) -* **mini-runner:** 更新编译时提示 ([6448722](https://github.com/NervJS/taro/commit/6448722)) -* **mini-runner:** 移除无用代码 ([c1020b1](https://github.com/NervJS/taro/commit/c1020b1)) -* **mini-runner:** 组件引入支持统一从一个入口文件中引入 ([55f6800](https://github.com/NervJS/taro/commit/55f6800)) -* **taro-cli:** update package list 新增 [@tarojs](https://github.com/tarojs)/mini-runner,对列表排序 ([4661558](https://github.com/NervJS/taro/commit/4661558)) -* position linter for quickapp 1060+ ([fa8d91c](https://github.com/NervJS/taro/commit/fa8d91c)) -* pxtransform disable on quick-app ([5ce3139](https://github.com/NervJS/taro/commit/5ce3139)) -* quickapp api upload from docs ([20b681c](https://github.com/NervJS/taro/commit/20b681c)) -* somethings no need ([2c2e503](https://github.com/NervJS/taro/commit/2c2e503)) * **mini-runner:** 只有 taro 的包不能经过依赖包名替换 ([498cc7f](https://github.com/NervJS/taro/commit/498cc7f)) * **mini-runner:** 打包优化,引用自 npm 包中的组件不抽离至 vendors 中 ([635f3e2](https://github.com/NervJS/taro/commit/635f3e2)) * **mini-runner:** 提前解析快应用页面 ([d5f72b9](https://github.com/NervJS/taro/commit/d5f72b9)) * **mini-runner:** 支持快应用编译后模板与样式的检测 ([2a8a681](https://github.com/NervJS/taro/commit/2a8a681)) +* **mini-runner:** 更新编译时提示 ([6448722](https://github.com/NervJS/taro/commit/6448722)) +* **mini-runner:** 移除无用代码 ([c1020b1](https://github.com/NervJS/taro/commit/c1020b1)) +* **mini-runner:** 组件引入支持统一从一个入口文件中引入 ([55f6800](https://github.com/NervJS/taro/commit/55f6800)) * **quickapp:** pull-down-refresh page-scroll ([157da75](https://github.com/NervJS/taro/commit/157da75)) * **taro:** 修复快应用下拉刷新问题 ([e429e7d](https://github.com/NervJS/taro/commit/e429e7d)) * **taro:** 小程序 webpack 编译静态文件路径 ([9806766](https://github.com/NervJS/taro/commit/9806766)) +* **taro-cli:** update package list 新增 [@tarojs](https://github.com/tarojs)/mini-runner,对列表排序 ([4661558](https://github.com/NervJS/taro/commit/4661558)) * **taro-quickapp:** 修复快应用事件绑定异常问题 ([eb3d9e5](https://github.com/NervJS/taro/commit/eb3d9e5)) +* **template:** 更新 Taro 2.0 的模版和下载地址 [#4837](https://github.com/NervJS/taro/issues/4837) ([6949636](https://github.com/NervJS/taro/commit/6949636)) +* position linter for quickapp 1060+ ([fa8d91c](https://github.com/NervJS/taro/commit/fa8d91c)) +* pxtransform disable on quick-app ([5ce3139](https://github.com/NervJS/taro/commit/5ce3139)) +* quickapp api upload from docs ([20b681c](https://github.com/NervJS/taro/commit/20b681c)) +* somethings no need ([2c2e503](https://github.com/NervJS/taro/commit/2c2e503)) * **transformer:** 修复测试用例 ([219f493](https://github.com/NervJS/taro/commit/219f493)) * **transformer:** 修复错误类型 ([9d15238](https://github.com/NervJS/taro/commit/9d15238)) * **transformer:** 支持直接 import default ([2aa7bd7](https://github.com/NervJS/taro/commit/2aa7bd7)) @@ -192,7 +194,9 @@ ### Features +* **components-qa:** 增强快应用button组件,增加属性判断及点击变色等 ([#4882](https://github.com/NervJS/taro/issues/4882)) ([fd982c5](https://github.com/NervJS/taro/commit/fd982c5)) * **docs:** 更新 2.0 版本使用 async-await 的文档 [#4837](https://github.com/NervJS/taro/issues/4837) ([18b4487](https://github.com/NervJS/taro/commit/18b4487)) +* **taro-cli:** 配置文件分开存放,优化 taro config 输出 ([2d3d96c](https://github.com/NervJS/taro/commit/2d3d96c)) * audio context ([b73d25a](https://github.com/NervJS/taro/commit/b73d25a)) * mock for quickapp ([d578cea](https://github.com/NervJS/taro/commit/d578cea)) * stop trans asset for quickapp ([62df717](https://github.com/NervJS/taro/commit/62df717)) diff --git a/website/versioned_docs/version-2.0.0-beta.4/README.md b/website/versioned_docs/version-2.0.0-beta.4/README.md new file mode 100644 index 000000000000..e89f7c58adc8 --- /dev/null +++ b/website/versioned_docs/version-2.0.0-beta.4/README.md @@ -0,0 +1,144 @@ +--- +title: Taro 介绍 +id: version-2.0.0-beta.4-README +original_id: README +--- + +> 这是 Taro 2.x 版本的文档,若要查看 1.x 版本的文档,请[点击这里选择版本](/taro/versions.html)。 + +## 简介 + +**Taro** 是一套遵循 [React](https://reactjs.org/) 语法规范的 **多端开发** 解决方案。 + +现如今市面上端的形态多种多样,Web、React-Native、微信小程序等各种端大行其道,当业务要求同时在不同的端都要求有所表现的时候,针对不同的端去编写多套代码的成本显然非常高,这时候只编写一套代码就能够适配到多端的能力就显得极为需要。 + +使用 **Taro**,我们可以只书写一套代码,再通过 **Taro** 的编译工具,将源代码分别编译出可以在不同端(微信/百度/支付宝/字节跳动/QQ小程序、快应用、H5、React-Native 等)运行的代码。 + +## 特性 + +#### React 语法风格 + +**Taro** 遵循 [React](https://reactjs.org/) 语法规范,它采用与 React 一致的组件化思想,组件生命周期与 React 保持一致,同时支持使用 [JSX 语法](jsx.html),让代码具有更丰富的表现力,使用 **Taro** 进行开发可以获得和 React 一致的开发体验。 + +代码示例 + +```jsx +import Taro, { Component } from '@tarojs/taro' +import { View, Button } from '@tarojs/components' + +export default class Index extends Component { + constructor () { + super(...arguments) + this.state = { + title: '首页', + list: [1, 2, 3] + } + } + + componentWillMount () {} + + componentDidMount () {} + + componentWillUpdate (nextProps, nextState) {} + + componentDidUpdate (prevProps, prevState) {} + + shouldComponentUpdate (nextProps, nextState) { + return true + } + + add = (e) => { + // dosth + } + + render () { + return ( + + {this.state.title} + + {this.state.list.map(item => { + return ( + {item} + ) + })} + + + + ) + } +} +``` + +> 由于微信小程序端的限制,有极少数 JSX 的优秀用法暂时不能得到很好地支持,同时,为了遵循 React 语法,Taro 在写法上也有一些自己的规范,具体可以参考:[Taro 开发最佳实践](best-practice.html) 。 + +#### 快速开发微信小程序 + +Taro 立足于微信小程序开发,众所周知小程序的开发体验并不是非常友好,比如小程序中无法使用 npm 来进行第三方库的管理,无法使用一些比较新的 ES 规范等等,针对小程序端的开发弊端,Taro 具有以下的优秀特性 + +✅ 支持使用 npm/yarn 安装管理第三方依赖 + +✅ 支持使用 ES7/ES8 甚至更新的 ES 规范,一切都可自行配置 + +✅ 支持使用 CSS 预编译器,例如 Sass 等 + +✅ 支持使用 Redux 进行状态管理 + +✅ 支持使用 MobX 进行状态管理 + +✅ 小程序 API 优化,异步 API Promise 化等等 + +#### 支持多端开发转化 + +Taro 方案的初心就是为了打造一个多端开发的解决方案。目前 Taro 代码可以支持转换到 **微信/百度/支付宝/字节跳动/QQ小程序** 、**快应用**、 **H5 端** 以及 **移动端(React Native)**。 + +
+ +## 社区共享 + +[Taro 交流社区——让每一次交流都被沉淀](https://taro-club.jd.com/) 如果您在此文档没有找到想要的答案,请移步[社区](https://taro-club.jd.com)提问,我们会在看到的第一时间给予答复。 + +[Taro 物料市场——让每一个轮子产生价值](https://taro-ext.jd.com/) 如果您想找一些现成的物料,例如:模版、组件、SDK、UI,可以移步[物料市场](https://taro-ext.jd.com/)查找,也欢迎您发布物料与其他开发者共享。 + +## Taro UI + +一款基于 `Taro` 框架开发的多端 UI 组件库。 + +[Taro UI](https://taro-ui.jd.com) 特性: + +- 基于 `Taro` 开发 UI 组件 +- 一套组件可以在 `微信小程序`,`支付宝小程序`,`百度小程序`,`H5` 多端适配运行(`ReactNative` 端暂不支持) +- 提供友好的 API,可灵活的使用组件 + +## 使用案例 + +Taro 已经投入了我们的生产环境中使用,业界也在广泛地使用 Taro 开发多端应用。 + +> 社区案例仅收纳了开发者主动提交的案例 + +![image](https://raw.githubusercontent.com/NervJS/taro-user-cases/master/user-cases.jpg) + +## 学习资源 + +### 官方文章精选 +- [使用 React Hooks 重构你的小程序](https://aotu.io/notes/2019/07/10/taro-hooks/) +- [Taro 1.3 震撼发布:全面支持 JSX 语法和 HOOKS](https://aotu.io/notes/2019/06/13/taro-1-3/) +- [小程序框架全面测评](https://aotu.io/notes/2019/03/12/mini-program-framework-full-review/) +- [Taro 在京东购物小程序上的实践](https://aotu.io/notes/2018/09/11/taro-in-jd/) +- [用 React 开发小程序的探索之路 (演讲内容整理)| 掘金开发者大会](https://juejin.im/post/5ba346a7f265da0ad13b78bd) +- [为何我们要用 React 来写小程序 - Taro 诞生记](https://aotu.io/notes/2018/06/25/the-birth-of-taro/) +- [多端统一开发框架 - Taro介绍](https://aotu.io/notes/2018/06/07/Taro/) + +### 分享交流 +- [第十三届 D2 前端技术论坛——使用 Taro 快速构建多端应用](https://www.yuque.com/d2forum/content/d213#6a1363f4) +- [WeGeek直播课:从0到1快速开发电商小程序](https://link.juejin.im/?target=https%3A%2F%2Fcloud.tencent.com%2Fedu%2Flearning%2Flive-1497) +- [掘金开发者大会——用React开发小程序的探索之路](https://www.itdks.com/Course/detail?id=16289) + +### 其他 +更多文章教程、开源项目等,请参考:[awesome-taro](https://github.com/NervJS/awesome-taro) + +掘金小册:[Taro 多端开发实现原理与实战](https://juejin.im/book/5b73a131f265da28065fb1cd?referrer=5ba228f16fb9a05d3251492d) + +## 开发交流 +扫码添加 `凹凸实验室-小助手` ,回复 `Taro` 即可进群。(Taro 开发交流14群 已满) + +![image](https://user-images.githubusercontent.com/9441951/63744620-7994e800-c8d2-11e9-9e66-ab43d1d75fe8.png) diff --git a/website/versioned_docs/version-2.0.0-beta.4/async-await.md b/website/versioned_docs/version-2.0.0-beta.4/async-await.md new file mode 100644 index 000000000000..9c2250d842e6 --- /dev/null +++ b/website/versioned_docs/version-2.0.0-beta.4/async-await.md @@ -0,0 +1,43 @@ +--- +title: 异步编程 +id: version-2.0.0-beta.4-async-await +original_id: async-await +--- + +> Taro 2.x 版本中使用 `async-await` 不再需要 `@tarojs/async-await`。 + +Taro 支持使用 `async functions` 来让开发者获得不错的异步编程体验,开启 `async functions` 支持需要安装包 `babel-plugin-transform-runtime` 和 `babel-runtime`。 + +```bash +$ yarn add babel-plugin-transform-runtime --dev +$ yarn add babel-runtime +``` + +随后修改项目 [`babel` 配置](./config-detail.md#babel),增加插件 `babel-plugin-transform-runtime`。 + +```js +babel: { + sourceMap: true, + presets: [ + [ + 'env', + { + modules: false + } + ] + ], + plugins: [ + 'transform-decorators-legacy', + 'transform-class-properties', + 'transform-object-rest-spread', + ['transform-runtime', { + "helpers": false, + "polyfill": false, + "regenerator": true, + "moduleName": 'babel-runtime' + }] + ] +} +``` + +> 值得注意的事,使用 `async functions` 一定要记得按照[开发前注意](./before-dev-remind.md)中提示的内容进行操作,否则会出现报错 diff --git a/website/versioned_docs/version-2.0.0-beta.4/react-native.md b/website/versioned_docs/version-2.0.0-beta.4/react-native.md new file mode 100644 index 000000000000..8fb20cf5c942 --- /dev/null +++ b/website/versioned_docs/version-2.0.0-beta.4/react-native.md @@ -0,0 +1,776 @@ +--- +title: React Native 端开发流程 +id: version-2.0.0-beta.4-react-native +original_id: react-native +--- + +> 本篇主要讲解 Taro React Native 端 环境安装-开发-调试-打包-发布 原理及流程,React Native 开发前注意事项请看 [开发前注意](./before-dev-remind.html) +> +> 适配 RN 端可参考项目:[首个 Taro 多端统一实例 - 网易严选(小程序 + H5 + React Native) - By 趣店 FED](https://github.com/js-newbee/taro-yanxuan) + +## 简介 + +Taro 移动端的开发基于 Facebook 的开源项目 [React Native](https://github.com/facebook/react-native),目前是项目依赖中固定 React Native 版本为 `0.55.4`。 + +整个 RN 端的开发流程如下: + +![image](http://assets.processon.com/chart_image/5c988481e4b01e76978bd6ab.png) + +首先在 Taro 项目里执行:`taro build --type rn --watch`,这个命令会将 Taro 代码编译为 React Native 代码(默认输出在 rn_temp 目录下),并启动 Metro Server(可以看成是 webpack run devserver --port 8081)打包 rn_temp 下的 js。 + +然后进入 `taro-native-shell` 目录(建议和 Taro 项目平级),通过 `react-native run-android|ios`启动,或者通过对应的 Android Studio / Xcode 启动应用,启动后应用可以看成是一个浏览器,会从 8081 端口加载 js 并渲染。 + +## 搭建 iOS 开发环境 + +必须安装的依赖有:Node、Watchman 和 React Native 命令行工具以及 Xcode。 + +虽然你可以使用任何编辑器来开发应用(编写 js 代码),但你仍然必须安装 Xcode 来获得编译 iOS 应用所需的工具和环境。 + +### Node, Watchman +我们推荐使用 [Homebrew](http://brew.sh/) 来安装 Node 和 Watchman。在命令行中执行下列命令安装: + +```sh +brew install node +brew install watchman +``` + +如果你已经安装了 Node,请检查其版本是否在 v8.3 以上。安装完 Node 后建议设置 npm 镜像以加速后面的过程(或使用科学上网工具)。 + +> 注意:不要使用 cnpm!cnpm 安装的模块路径比较奇怪,packager 不能正常识别! + +设置 npm 镜像: +``` +npm config set registry https://registry.npm.taobao.org --global +npm config set disturl https://npm.taobao.org/dist --global +``` + +或者使用 [nrm](https://github.com/Pana/nrm): + +```sh +$ nrm ls + +* npm ----- https://registry.npmjs.org/ + cnpm ---- http://r.cnpmjs.org/ + taobao -- https://registry.npm.taobao.org/ + nj ------ https://registry.nodejitsu.com/ + skimdb -- https://skimdb.npmjs.com/registry + +``` + +```sh +$ nrm use cnpm //switch registry to cnpm + + Registry has been set to: http://r.cnpmjs.org/ +``` + +[Watchman](https://facebook.github.io/watchman) 则是由 Facebook 提供的监视文件系统变更的工具。安装此工具可以提高开发时的性能(packager 可以快速捕捉文件的变化从而实现实时刷新)。 + +### Yarn、React Native 的命令行工具(react-native-cli) +Yarn 是 Facebook 提供的替代 npm 的工具,可以加速 node 模块的下载。React Native 的命令行工具用于执行创建、初始化、更新项目、运行打包服务(packager)等任务。 + +```sh +npm install -g yarn react-native-cli +``` + +安装完 yarn 后同理也要设置镜像源: + +```sh +yarn config set registry https://registry.npm.taobao.org --global +yarn config set disturl https://npm.taobao.org/dist --global +``` + +安装完 yarn 之后就可以用 yarn 代替 npm 了,例如用 yarn 代替 npm install 命令,用 yarn add 某第三方库名代替 npm install 某第三方库名。 + +### Xcode +React Native 目前需要 [Xcode](https://developer.apple.com/xcode/downloads/) 9.4 或更高版本。你可以通过 App Store 或是到 [Apple 开发者官网](https://developer.apple.com/xcode/downloads/) 上下载。这一步骤会同时安装 Xcode IDE、Xcode 的命令行工具和 iOS 模拟器。 + +Xcode 的命令行工具 + +启动 Xcode,并在 `Xcode | Preferences | Locations` 菜单中检查一下是否装有某个版本的 `Command Line Tools`。Xcode 的命令行工具中包含一些必须的工具,比如 `git` 等。 + +![image](https://reactnative.cn/docs/assets/GettingStartedXcodeCommandLineTools.png) + + +## 搭建 Android 开发环境 + +### 安装依赖 +必须安装的依赖有:Node、Watchman 和 React Native 命令行工具以及 JDK 和 Android Studio。 + +虽然你可以使用任何编辑器来开发应用(编写 js 代码),但你仍然必须安装 Android Studio 来获得编译 Android 应用所需的工具和环境。 + +### Java Development Kit +React Native 需要 Java Development Kit [JDK] 1.8(暂不支持 1.9 及更高版本)。你可以在命令行中输入 + +> javac -version来查看你当前安装的 JDK 版本。如果版本不合要求,则可以到 官网上下载。 + +### Android 开发环境 +如果你之前没有接触过 Android 的开发环境,那么请做好心理准备,这一过程相当繁琐。请 `万分仔细`地阅读下面的说明,严格对照文档进行配置操作。 + +> 注:请注意!!!国内用户必须必须必须有稳定的翻墙工具,否则在下载、安装、配置过程中会不断遭遇链接超时或断开,无法进行开发工作。某些翻墙工具可能只提供浏览器的代理功能,或只针对特定网站代理等等,请自行研究配置或更换其他软件。总之如果报错中出现有网址,那么 99% 就是无法正常翻墙。 + +> 如果是 socks5 代理 ,如下这样设置其实并没有什么卵用 + +``` +#systemProp.socks.proxyHost=127.0.0.1 +#systemProp.socks.proxyPort=8016 + +#systemProp.https.proxyHost=127.0.0.1 +#systemProp.https.proxyPort=8016 + +#systemProp.https.proxyHost=socks5://127.0.0.1 +#systemProp.https.proxyPort=8016 +``` + +> 正确设置方法应该是这样: +org.gradle.jvmargs=-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=8016 + +> 修改 $HOME/.gradle/gradle.properties 文件,加入上面那句,这样就可以全局开启 gradle 代理 + + +#### 1. 安装 Android Studio + +[首先下载和安装 Android Studio](https://developer.android.com/studio/index.html),国内用户可能无法打开官方链接,请自行使用搜索引擎搜索可用的下载链接。安装界面中选择"Custom"选项,确保选中了以下几项: + +- Android SDK +- Android SDK Platform +- Performance (Intel ® HAXM) ([AMD 处理器看这里](https://android-developers.googleblog.com/2018/07/android-emulator-amd-processor-hyper-v.html)) +- Android Virtual Device + +然后点击"Next"来安装选中的组件。 + +> 如果选择框是灰的,你也可以先跳过,稍后再来安装这些组件。 + +安装完成后,看到欢迎界面时,就可以进行下面的操作了。 + +#### 2. 安装 Android SDK +Android Studio 默认会安装最新版本的 Android SDK。目前编译 React Native 应用需要的是 `Android 6.0 (Marshmallow)` 版本的 SDK(注意 SDK 版本不等于终端系统版本,RN 目前支持 android 4.1 以上设备)。你可以在 Android Studio 的 SDK Manager 中选择安装各版本的 SDK。 + +你可以在 Android Studio 的欢迎界面中找到 SDK Manager。点击 "Configure",然后就能看到 "SDK Manager"。 + +![image](https://reactnative.cn/docs/assets/GettingStartedAndroidStudioWelcomeMacOS.png) + +> SDK Manager 还可以在 Android Studio 的 "Preferences" 菜单中找到。具体路径是 `Appearance & Behavior → System Settings → Android SDK`。 + +在 SDK Manager 中选择 "SDK Platforms"选项卡,然后在右下角勾选 "Show Package Details"。展开 `Android 6.0 (Marshmallow)` 选项,确保勾选了下面这些组件(重申你必须使用稳定的翻墙工具,否则可能都看不到这个界面): + +- `Android SDK Platform 28` +- `Intel x86 Atom_64 System Image`(官方模拟器镜像文件,使用非官方模拟器不需要安装此组件) + +然后点击"SDK Tools"选项卡,同样勾中右下角的"Show Package Details"。展开"Android SDK Build-Tools"选项,确保选中了 React Native 所必须的 `23.0.1` 版本。你可以同时安装多个其他版本,然后还要勾选最底部的 `Android Support Repository`。 + +![image](https://reactnative.cn/docs/assets/GettingStartedAndroidSDKManagerSDKToolsMacOS.png) + +最后点击"Apply"来下载和安装这些组件。 + +![image](https://reactnative.cn/docs/assets/GettingStartedAndroidSDKManagerInstallsMacOS.png) + +#### 3. 配置 ANDROID_HOME 环境变量 +React Native 需要通过环境变量来了解你的 Android SDK 装在什么路径,从而正常进行编译。 + +具体的做法是把下面的命令加入到 `~/.bash_profile` 文件中: + +> ~表示用户目录,即/Users/你的用户名/,而小数点开头的文件在 Finder 中是隐藏的,并且这个文件有可能并不存在。可在终端下使用vi ~/.bash_profile命令创建或编辑。如不熟悉 vi 操作,请点击 [这里](http://www.eepw.com.cn/article/48018.htm) 学习。 + +```sh +# 如果你不是通过Android Studio安装的sdk,则其路径可能不同,请自行确定清楚。 +export ANDROID_HOME=$HOME/Library/Android/sdk +export PATH=$PATH:$ANDROID_HOME/tools +export PATH=$PATH:$ANDROID_HOME/platform-tools +``` + +> 如果你的命令行不是 bash,而是例如 zsh 等其他,请使用对应的配置文件。 + +使用 `source $HOME/.bash_profile` 命令来使环境变量设置立即生效(否则重启后才生效)。可以使用 `echo $ANDROID_HOME` 检查此变量是否已正确设置。 + +> 请确保你正常指定了 Android SDK 路径。你可以在 Android Studio 的 "Preferences" 菜单中查看 SDK 的真实路径,具体是`Appearance & Behavior → System Settings → Android SDK`。 + + +### 准备 Android 设备 +你需要准备一台 Android 设备来运行 React Native Android 应用。这里所指的设备既可以是真机,也可以是模拟器。Android 官方提供了名为 Android Virtual Device(简称 AVD)的模拟器。此外还有很多第三方提供的模拟器如 [Genymotion](https://www.genymotion.com/download)、BlueStack 等。一般来说官方模拟器免费、功能完整,但性能较差。第三方模拟器性能较好,但可能需要付费,或带有广告。 + +#### 使用 Android 真机 +你也可以使用 Android 真机来代替模拟器进行开发,只需用 usb 数据线连接到电脑,然后遵照 [在设备上运行](https://reactnative.cn/docs/0.55/running-on-device) 这篇文档的说明操作即可。 + +#### 使用 Android 模拟器 +你可以在 Android Studi 打开 "AVD Manager" 来查看可用的虚拟设备,它的图标看起来像下面这样: + +![image](https://reactnative.cn/docs/assets/GettingStartedAndroidStudioAVD.png) + +如果你刚刚才安装 Android Studio,那么可能需要先 [创建一个虚拟设备](https://developer.android.com/studio/run/managing-avds.html)。点击"Create Virtual Device...",然后选择所需的设备类型并点击"Next"。 + +![image](https://reactnative.cn/docs/assets/GettingStartedCreateAVDMacOS.png) + +选择 "x86 Images" 选项卡,这里可以看到你之前已安装过的镜像文件。必须先安装镜像文件才能创建对应的虚拟设备。 + +![image](https://reactnative.cn/docs/assets/GettingStartedCreateAVDx86MacOS.png) + +> 如果你还没有安装 HAXM(Intel 虚拟硬件加速驱动),则先按 [这篇文档](https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-mac-os-x) 说明来进行安装。 + +![image](https://reactnative.cn/docs/assets/GettingStartedAVDManagerMacOS.png) + +然后点击 "Next" 和 "Finish" 来完成虚拟设备的创建。 + +## 开发 + +### 编译 + +RN 编译预览模式: + +```shell +# yarn +$ yarn dev:rn +# npm script +$ npm run dev:rn +# 仅限全局安装 +$ taro build --type rn --watch +# npx 用户也可以使用 +$ npx taro build --type rn --watch +``` + +Taro 将会开始编译文件: + +```sh +➜ taro-demo git:(master) ✗ taro build --type rn --watch +👽 Taro v1.2.20 + +开始编译项目 taro-demo +编译 JS /Users/chengshuai/Taro/taro-demo/src/app.js +编译 SCSS /Users/chengshuai/Taro/taro-demo/src/app.scss +拷贝 HTML /Users/chengshuai/Taro/taro-demo/src/index.html +生成 生成文件 /Users/chengshuai/Taro/taro-demo/rn_temp/app_styles.js +编译 JS /Users/chengshuai/Taro/taro-demo/src/pages/index/index.js +编译 SCSS /Users/chengshuai/Taro/taro-demo/src/pages/index/index.scss +生成 index.js /Users/chengshuai/Taro/taro-demo/rn_temp/index.js +生成 app.json /Users/chengshuai/Taro/taro-demo/rn_temp/app.json +生成 package.json /Users/chengshuai/Taro/taro-demo/rn_temp/package.json +编译 编译完成,花费2504 ms +生成 生成文件 /Users/chengshuai/Taro/taro-demo/rn_temp/pages/index/index_styles.js + +初始化完毕,监听文件修改中... + +``` + +编译后的代码及应用文件在根目录的 `rn_temp` 目录下,常见的工程目录结构如下: + +```shell +rn_temp +├── app.js +├── app.json +├── app_styles.js +├── index.html +├── index.js +├── package-lock.json +├── package.json +├── pages +│   └── index +│   ├── component.js +│   ├── index.js +│   └── index_styles.js +├── bundle +│   ├── assets +│   ├── index.bundle +│   └── index.bundle.meta +└── yarn.lock +``` +其中关键文件及目录如下: + +- app.json React Native 应用的配置,从 `config.rn.appJson` 中获取 +- bundle:实时编译的 jsbundle 临时文件 + +如果编译没有报错,会自动打开一个终端,并在 8081 端口启动 [Metro](https://github.com/facebook/metro) Bundler 负责打包 jsbundle: + +![image](https://user-images.githubusercontent.com/9441951/59322399-85780180-8d08-11e9-9ea7-b3e4b23c077c.png) + +> 注意:少数电脑上,可能不会 `自动打开一个终端`,这时你可以在项目根目录下运行:`react-native start` 手动启动。 + +这时,在浏览器输入 http://127.0.0.1:8081,可以看到如下页面: +![image](https://user-images.githubusercontent.com/9441951/55865494-13245d00-5bb1-11e9-9a97-8a785a83b584.png) + +输入 http://127.0.0.1:8081/rn_temp/index.bundle?platform=ios&dev=true 会触发对应终端平台的 js bundle 构建。 + +![image](https://user-images.githubusercontent.com/9441951/55865039-37336e80-5bb0-11e9-8aca-c121be4542f6.png) + +构建完成后,浏览器会显示构建后的 js 代码。 + +> Note:进入下一步之前请确保 Metro Bundler Server 正常启动,即浏览器能正常访问访问 jsbundle。 + + +### 启动应用 +如果上一步的编译和 Metro Bundler Server 启动没问题,接下来就可以启动应用了。 + +开发者可以自行[整合 React Native (0.55.4) 到原生应用](https://reactnative.cn/docs/0.55/integration-with-existing-apps/),同时为了方便大家开发和整合,Taro 将 React Native 工程中原生的部分剥离出来,单独放在一个工程里面 [NervJS/taro-native-shell](https://github.com/NervJS/taro-native-shell),你可以把它看成是 React Native iOS/Android 空应用的壳子。 + +首先将应用代码 clone 下来: + +``` +git clone git@github.com:NervJS/taro-native-shell.git +``` +然后 `cd taro-native-shell`,使用 yarn 或者 npm install 安装依赖。 + +> 注意 `taro-native-shell` 工程和 Taro 工程最好独立存放,不要嵌套,否则会报:`multi react-native ` 错误 + +工程目录如下: + +```sh +➜ taro-native-shell git:(master) ✗ tree -L 1 +. +├── LICENSE +├── README.md +├── android // Android 工程目录 +├── ios // iOS 工程目录 +├── node_modules +├── package.json +└── yarn.lock +``` + + +### iOS +#### 使用 React Native 命令启动 + +```sh +$ react-native run-ios +``` + +iOS 模拟器会自行启动,并访问 8081 端口获取 js bundle,这时 Metro Bundler 终端会打印以下内容: + +```sh + BUNDLE [ios, dev] ./index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (1/1), done. +``` + +#### 使用 Xcode 启动 +iOS 的启动比较简单,使用 Xcode 打开 ios 目录,然后点击 Run 按钮就行。 + +![image](https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/Art/XC_O_SchemeMenuWithCallouts_2x.png) + +这里需要注意的是 jsBundle 的 moduleName,默认的 moduleName 为 "taroDemo",需要和 `rn_temp/app.json` 里面的 name 字段保持一致。该配置在 `AppDelegate.m` 文件中。 + +```objc +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + NSURL *jsCodeLocation; + + jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"rn_temp/index" fallbackResource:nil]; + + RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation + moduleName:@"taroDemo" + initialProperties:nil + launchOptions:launchOptions]; + rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; + + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + UIViewController *rootViewController = [UIViewController new]; + rootViewController.view = rootView; + self.window.rootViewController = rootViewController; + [self.window makeKeyAndVisible]; + return YES; +} + +@end +``` + +app.json 字段的配置默认取自于 package.json 的 name 字段,除非你在 rn -> appJson 里面有配置。 + +更多资料,可以查看 Xcode 文档:[Building Your App](https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/BuildingYourApp.html) + +### Android +在 taro-native-shell/android 目录下,你就可以看到 React Native 的工程代码。 + +#### 使用 React Native 命令启动 + +```sh +$ react-native run-android +``` + +Android 模拟器会自行启动,并访问 8081 端口获取 js bundle,这时 Metro Bundler 终端会打印一下内容: + +```sh + BUNDLE [android, dev] ./index.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (1/1), done. +``` + + +#### 在真实设备上运行 + +按照以下步骤设置您的设备: + +1. 使用一根 USB 电缆将您的设备连接到您的开发机器。如果您是在 Windows 上开发,可能需要为您的设备 [安装相应的 USB 驱动程序](https://developer.android.com/studio/run/oem-usb.html?hl=zh-cn)。 +2. 按照以下步骤操作,在 Developer options 中启用 USB debugging。 +首先,您必须启用开发者选项: + + 1. 打开 Settings 应用。 + 2. (仅在 Android 8.0 或更高版本上)选择 System。 + 3. 滚动到底部,然后选择 About phone。 + 4. 滚动到底部,点按 Build number 7 次。 + 5. 返回上一屏幕,在底部附近可找到 Developer options。 +打开 Developer options,然后向下滚动以找到并启用 USB debugging。 + +按照以下步骤操作,在您的设备上运行应用: + +1. 在 Android Studio 中,点击 Project 窗口中的 app 模块,然后选择 Run > Run(或点击工具栏中的 Run )。 + +![image](https://sdtimes.com/wp-content/uploads/2016/04/0408.sdt-androidstudio.png) + +2. 在 Select Deployment Target 窗口中,选择您的设备,然后点击 OK。 + +![image](https://developer.android.com/training/basics/firstapp/images/run-device_2x.png?hl=zh-cn) + +Android Studio 会在您连接的设备上安装并启动应用。 + +### 在模拟器上运行 +按照以下步骤操作,在模拟器上运行应用: + +1. 在 Android Studio 中,点击 Project 窗口中的 app 模块,然后选择 Run > Run(或点击工具栏中的 Run )。 +2. 在 Select Deployment Target 窗口中,点击 Create New Virtual Device。 + +![image](https://developer.android.com/training/basics/firstapp/images/run-avd_2x.png?hl=zh-cn) + +3. 在 Select Hardware 屏幕中,选择电话设备(如 Pixel),然后点击 Next。 +4. 在 System Image 屏幕中,选择具有最高 API 级别的版本。如果您未安装该版本,将显示一个 Download 链接,因此,请点击该链接并完成下载。 +5. 点击 Next。 +6. 在 Android Virtual Device (AVD) 屏幕上,保留所有设置不变,然后点击 Finish。 +7. 返回到 Select Deployment Target 对话框中,选择您刚刚创建的设备,然后点击 OK。 + +Android Studio 会在模拟器上安装并启动应用。 + +#### Module Name + +同样,Android 这边默认的 jsBundle moduleName 也是 “taroDemo”,位于 `MainActivity.java` 的文件里面: + +```java +package com.tarodemo; + +import com.facebook.react.ReactActivity; + +public class MainActivity extends ReactActivity { + + /** + * Returns the name of the main component registered from JavaScript. + * This is used to schedule rendering of the component. + */ + @Override + protected String getMainComponentName() { + return "taroDemo"; + } +} + +``` + +你可以根据实际情况自行修改。 + +## 调试 + +更多资料可以查看 [React Native 调试](https://reactnative.cn/docs/debugging.html)。 + +### 开发者菜单 + +React Native 在 iOS 模拟器上支持一些快捷键操作,具体会在下文中描述。要使用快捷键请务必确保模拟器的 Hardware 菜单中,Keyboard 选项下的"Connect Hardware Keyboard"处于开启状态,否则按键是没有响应的。 + +你可以通过摇晃设备或是选择 iOS 模拟器的 "Hardware" 菜单中的 "Shake Gesture" 选项来打开开发菜单。另外,如果是在 iOS 模拟器中运行,还可以按下 `Command⌘ + D` 快捷键,Android 模拟器对应的则是 `Command⌘ + M`(windows 上可能是 F1 或者 F2),或是直接在命令行中运行 `adb shell input keyevent 82` 来发送菜单键命令。 + +![image](https://reactnative.cn/docs/assets/DeveloperMenu.png) + +> 在发布(production)版本中开发者菜单将无法使用。 + +### 刷新 JavaScript +传统的原生应用开发中,每一次修改都需要重新编译,但在 RN 中你只需要刷新一下 JavaScript 代码,就能立刻看到变化。具体的操作就是在开发菜单中点击 "Reload" 选项。也可以在 iOS 模拟器中按下 `Command⌘ + R `,Android 模拟器上对应的则是 `按两下R`。 + +#### 自动刷新 +选择开发菜单中的 "Enable Live Reload" 可以开启自动刷新,这样可以节省你开发中的时间。 + +更神奇的是,你还可以保持应用的当前运行状态,修改后的 JavaScript 文件会自动注入进来(就好比行驶中的汽车不用停下就能更换新的轮胎)。要实现这一特性只需开启开发菜单中的 [Hot Reloading](https://facebook.github.io/react-native/blog/2016/03/24/introducing-hot-reloading.html) 选项。 + +> 某些情况下 hot reload 并不能顺利实施。如果碰到任何界面刷新上的问题,请尝试手动完全刷新。 + +但有些时候你必须要重新编译应用才能使修改生效: + +- 增加了新的资源(比如给 iOS 的Images.xcassets或是 Andorid 的res/drawable文件夹添加了图片) +- 更改了任何的原生代码(objective-c/swift/java) + +### 应用内的错误与警告提示(红屏和黄屏) +红屏或黄屏提示都只会在开发版本中显示,正式的离线包中是不会显示的。 + +### 红屏错误 +应用内的报错会以全屏红色显示在应用中(调试模式下),我们称为红屏(red box)报错。你可以使用console.error()来手动触发红屏错误。 + +### 黄屏警告 +应用内的警告会以全屏黄色显示在应用中(调试模式下),我们称为黄屏(yellow box)报错。点击警告可以查看详情或是忽略掉。和红屏报警类似,你可以使用 `console.warn()` 来手动触发黄屏警告。在默认情况下,开发模式中启用了黄屏警告。可以通过以下代码关闭: + +```js +console.disableYellowBox = true; +console.warn('YellowBox is disabled.'); +``` + +你也可以通过代码屏蔽指定的警告,像下面这样调用 ignoreWarnings 方法,参数为一个数组: + +``` +import {YellowBox} from 'react-native'; +YellowBox.ignoreWarnings(['Warning: ...']); +``` + +在 CI/Xcode 中,黄屏警告还可以通过设置 `IS_TESTING` 环境变量来控制启用与否。 + +> 红屏错误和黄屏警告在发布版(release/production)中都是自动禁用的。 + +### Chrome 开发者工具 +在开发者菜单中选择 "Debug JS Remotely" 选项,即可以开始在 Chrome 中调试 JavaScript 代码。点击这个选项的同时会自动打开调试页面 http://localhost:8081/debugger-ui.(如果地址栏打开的是 ip 地址,则请自行改为 localhost) + +在 Chrome 的菜单中选择 `Tools → Developer Tools` 可以打开开发者工具,也可以通过键盘快捷键来打开(Mac 上是 `Command⌘ + Option⌥ + I`,Windows 上是 `Ctrl + Shift + I或是 F12`)。打开有 [异常时暂停(Pause On Caught Exceptions)](http://stackoverflow.com/questions/2233339/javascript-is-there-a-way-to-get-chrome-to-break-on-all-errors/17324511#17324511) 选项,能够获得更好的开发体验。 + +> 注意:Chrome 中并不能直接看到 App 的用户界面,而只能提供 console 的输出,以及在 sources 项中断点调试 js 脚本。一些老的教程和文章会提到 React 的 Chrome 插件,这一插件目前并不支持 React Native,而且调试本身并不需要这个插件。不过你可以安装独立(非插件)版本的 React Developer Tools 来辅助查看界面布局,下文会讲述具体安装方法。 + +> 注意:使用 Chrome 调试目前无法观测到 React Native 中的网络请求,你可以使用功能更强大的第三方的 [react-native-debugger](https://github.com/jhen0409/react-native-debugger)来进行观测。 + +### 使用自定义的 JavaScript 调试器来调试 +如果想用其他的 JavaScript 调试器来代替 Chrome,可以设置一个名为 `REACT_DEBUGGER` 的环境变量,其值为启动自定义调试器的命令。调试的流程依然是从开发者菜单中的 "Debug JS Remotely" 选项开始。 + +被指定的调试器需要知道项目所在的目录(可以一次传递多个目录参数,以空格隔开)。例如,如果你设定了 `REACT_DEBUGGER="node /某个路径/launchDebugger.js --port 2345 --type ReactNative"`,那么启动调试器的命令就应该是 `node /某个路径/launchDebugger.js --port 2345 --type ReactNative /某个路径/你的RN项目目录`。 + +> 以这种方式执行的调试器最好是一个短进程(short-lived processes),同时最好也不要有超过 200k 的文字输出。 + +### 使用 Chrome 开发者工具来在设备上调试 +> If you're using Create React Native App, this is configured for you already. + +对于 iOS 真机来说,需要打开 RCTWebSocketExecutor.m 文件,然后将其中的 "localhost" 改为你的电脑的 IP 地址,最后启用开发者菜单中的 "Debug JS Remotely" 选项。 + +对于 Android 5.0+设备(包括模拟器)来说,将设备通过 USB 连接到电脑上后,可以使用adb命令行工具来设定从设备到电脑的端口转发: + +```sh +adb reverse tcp:8081 tcp:8081 +``` + +如果设备 Android 版本在 5.0 以下,则可以在开发者菜单中选择"Dev Settings - Debug server host for device",然后在其中填入电脑的”IP 地址:端口“。 + +如果在 Chrome 调试时遇到一些问题,那有可能是某些 Chrome 的插件引起的。试着禁用所有的插件,然后逐个启用,以确定是否某个插件影响到了调试。 + +### 使用 React Developer Tools 调试 +You can use [the standalone version of React Developer Tools](https://github.com/facebook/react-devtools/tree/master/packages/react-devtools) to debug the React component hierarchy. To use it, install the react-devtools package globally: + +```sh +npm install -g react-devtools +``` + +> 译注:react-devtools 依赖于 electron,而 electron 需要到国外服务器下载二进制包,所以国内用户这一步很可能会卡住。此时请在环境变量中添加 electron 专用的国内镜像源:ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/",然后再尝试安装 react-devtools。 + +安装完成后在命令行中执行 `react-devtools` 即可启动此工具: + +```sh +react-devtools +``` + +![image](https://reactnative.cn/docs/assets/ReactDevTools.png) + +It should connect to your simulator within a few seconds. + +> Note: if you prefer to avoid global installations, you can add react-devtools as a project dependency. Add the react-devtools package to your project using npm install --save-dev react-devtools, then add "react-devtools": "react-devtools" to the scripts section in your package.json, and then run npm run react-devtools from your project folder to open the DevTools. + +#### Integration with React Native Inspector +Open the in-app developer menu and choose "Show Inspector". It will bring up an overlay that lets you tap on any UI element and see information about it: + +![image](https://reactnative.cn/docs/assets/Inspector.gif) + +However, when `react-devtools` is running, Inspector will enter a special collapsed mode, and instead use the DevTools as primary UI. In this mode, clicking on something in the simulator will bring up the relevant components in the DevTools: + +![image](https://reactnative.cn/docs/assets/ReactDevToolsInspector.gif) + +You can choose "Hide Inspector" in the same menu to exit this mode. + +#### Inspecting Component Instances + +When debugging JavaScript in Chrome, you can inspect the props and state of the React components in the browser console. + +First, follow the instructions for debugging in Chrome to open the Chrome console. + +Make sure that the dropdown in the top left corner of the Chrome console says `debuggerWorker.js`. This step is essential. + +Then select a React component in React DevTools. There is a search box at the top that helps you find one by name. As soon as you select it, it will be available as `$r` in the Chrome console, letting you inspect its props, state, and instance properties. + +![image](https://reactnative.cn/docs/assets/ReactDevToolsDollarR.gif) + +### 使用 React Native Debugger 调试 + +[React Native Debugger ](https://github.com/jhen0409/react-native-debugger),一个基于 React Native 官方调试方式、包含 React Inspector / Redux DevTools 独立应用: + +- 基于官方的 [Remote Debugger](https://facebook.github.io/react-native/docs/debugging.html#chrome-developer-tools) 且提供了更为丰富的功能 +- 包含 [`react-devtools-core`](https://github.com/facebook/react-devtools/tree/master/packages/react-devtools-core) 的 [React Inspector](https://github.com/jhen0409/react-native-debugger/blob/master/docs/react-devtools-integration.md) +- 包含 Redux DevTools,且与 [`redux-devtools-extension`](https://github.com/zalmoxisus/redux-devtools-extension) 保持 [API](https://github.com/jhen0409/react-native-debugger/blob/master/docs/redux-devtools-integration.md) 一致 + +![image](https://user-images.githubusercontent.com/3001525/29451479-6621bf1a-83c8-11e7-8ebb-b4e98b1af91c.png) + +#### 安装 + +不同平台及版本的安装包,请点击[这里](https://github.com/jhen0409/react-native-debugger/releases)。 + +**macOS** 平台可以使用 [Homebrew Cask](https://caskroom.github.io/) 安装: + +```sh +$ brew update && brew cask install react-native-debugger +``` + +#### 启动 + +在启动 React Native Debugger 之前,请先确认以下内容: + +- 所有的 React Native 的 debugger 客户端已关闭,特别是 `http://localhost:/debugger-ui` +- React Native Debugger 会尝试连接 debugger 代理, React Native 默认使用 `8081` 端口, 你可以新建一个 debugger 窗口 (macOS: `Command + T`,Linux/Windows: `Ctrl + T`) 开定义端口 +- 保证 [developer menu](https://facebook.github.io/react-native/docs/debugging.html#accessing-the-in-app-developer-menu) 的 `Debug JS Remotely` 处于开启状态 + +你可以启动应用之后再修改端口,也可以直接通过命令行启动应用时指定端口: + +```sh +$ open "rndebugger://set-debugger-loc?host=localhost&port=8081" +``` + +> 如果启动之后调试窗口空白,请确认调试端口正确。 + +#### 使用 Redux DevTools Extension API + +Use the same API as [`redux-devtools-extension`](https://github.com/zalmoxisus/redux-devtools-extension#1-with-redux) is very simple: + +```jsx +const store = createStore( + reducer, /* preloadedState, */ + window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() +) +``` + +See [`Redux DevTools Integration`](https://github.com/jhen0409/react-native-debugger/blob/master/docs/redux-devtools-integration.md) section for more information. + +#### 更多资料 + +- [快速开始](https://github.com/jhen0409/react-native-debugger/blob/master/docs/getting-started.md) +- [Debugger 整合](https://github.com/jhen0409/react-native-debugger/blob/master/docs/debugger-integration.md) +- [React DevTools 整合](https://github.com/jhen0409/react-native-debugger/blob/master/docs/react-devtools-integration.md) +- [Redux DevTools 整合](https://github.com/jhen0409/react-native-debugger/blob/master/docs/redux-devtools-integration.md) +- [Shortcut references](https://github.com/jhen0409/react-native-debugger/blob/master/docs/shortcut-references.md) +- [Network inspect of Chrome Developer Tools](https://github.com/jhen0409/react-native-debugger/blob/master/docs/network-inspect-of-chrome-devtools.md) +- [Enable open in editor in console](https://github.com/jhen0409/react-native-debugger/blob/master/docs/enable-open-in-editor-in-console.md) +- [Troubleshooting](https://github.com/jhen0409/react-native-debugger/blob/master/docs/troubleshooting.md) +- [Contributing](https://github.com/jhen0409/react-native-debugger/blob/master/docs/contributing.md) + +## 使用原生模块 +有一些平台性的差异是 Taro 无法抹平的,比如支付、登录等,这时候就需要自己写跨端代码,RN 端这边可能还需要修改原生代码。 + +例如登录的功能: + +![image](https://user-images.githubusercontent.com/9441951/56015544-ff513600-5d2b-11e9-92a6-ad01d21b2b8f.png) + +React Native 参考文档:[原生模块](https://reactnative.cn/docs/0.55/native-modules-ios/) + +## 集成到现有原生 app +Taro 编译后的项目实际上就是一个 native React Native 项目,所以集成到现有原生 app 的流程和 React Native 也是一样的。 + +如果你正准备从头开始制作一个新的应用,那么 React Native 会是个非常好的选择。但如果你只想给现有的原生应用中添加一两个视图或是业务流程,React Native 也同样不在话下。只需简单几步,你就可以给原有应用加上新的基于 React Native 的特性、画面和视图等。 + +React Native 参考文档:[集成到现有原生应用](https://reactnative.cn/docs/0.55/integration-with-existing-apps/) + +## 构建独立 app + +接下来的步骤将会帮助你为 iOS 和 Android 创建 Expo 应用程序的独立二进制文件,并将其提交到 Apple App Store 和 Google Play Store。 + +构建 iOS 独立应用程序需要 Apple Developer 帐户,但构建 Android 独立应用程序不需要 Google Play Developer 帐户。如果您想要提交到任一应用商店,您将需要该商店的开发者帐户。 + +在打包发布步骤之前,我们先对开发者的源代码进行预处理,将 Taro 代码转成 React Native 代码: + +``` bash +taro build --type rn +``` + +然后 `.rn_temp` 目录(如果你没有修改)下会生成转换后的 React Native 代码。 + +### 配置 app.json + +在 config 目录配置,如: + +```json +rn: { + appJson: { + "name": "Your App Name", + } +} +``` + +Taro 会读取 appJson 字段的内容且自动覆盖到 .rn_temp/app.json。 + +### 构建 app +首先使用 React Native 的 bundle 命令将 rn_temp 目录下的 RN 代码及资源打包成 jsbundle,命令如下: + +```sh +node ../node_modules/react-native/local-cli/cli.js bundle --entry-file ./rn_temp/index.js --bundle-output ./bundle/index.bundle --assets-dest ./${BUNDLE_DIR_NAME} --dev false +``` + +其中参数可以自行调整,`--bundle-output` 可以制定任意目录,然后将 bundle 目录下的文件 copy 到 `taro-native-shell`目录即可。 + +当然,也可以通过指定 `--bundle-output` 直接打包到 `taro-native-shell`目录。 + +接下来,按照 React Native 的文档按照不同的端分别打包对应的应用即可。 + +#### iOS + +参考文档:[在设备上运行](https://reactnative.cn/docs/0.55/running-on-device/) + +#### Android +参考文档:[打包APK](https://reactnative.cn/docs/0.55/signed-apk-android/) + +## 发布 +打包好的应用发布到 App Store 或各大应用商店可以查看官方文档。 + +- [Overview of publishing an app](https://help.apple.com/app-store-connect/#/dev34e9bbb5a) +- [Publish your app | Android Developers](https://developer.android.com/studio/publish) + +## 更新 React Native 版本 +Taro RN 版本暂时固定在 0.55.4 ,用户如有需求,可以自行升级到更高版本。步骤如下: + +1. 更新 Taro 项目中 `package.json` React Native 版本,并重新安装依赖 +2. 更新 `taro-native-shell` 项目中 `package.json` React Native 版本,并重新安装依赖 +3. 分别重新安装 `taro-native-shell` 项目中 ios/android 依赖,如 iOS:`cd ios && pod install` + +> 如果对 react 版本有要求,可以同步更新。 + +## 常见错误 + +### No bundle url present + +导致这个报错的原因很多,最常见的是电脑开了代理。具体可以参考 [#12754](https://github.com/facebook/react-native/issues/12754) + +### UnableToResolveError: Unable to resolve module `AccessibilityInfo` + +原因很多,我这边是重启电脑就好了😂。 具体可以查看 [#14209](https://github.com/facebook/react-native/issues/14209) + +### Metro Bundler error: Expected path […] to be relative to one of the project roots + +不支持 `npm link`,可以使用 [nicojs/node-install-local](https://github.com/nicojs/node-install-local) 替代。 + +### Image component does not resolve images with filenames that include '@' symbol + +![image](https://user-images.githubusercontent.com/22125059/44312799-373dee80-a3d4-11e8-8367-9cf44e851739.PNG) + +React Native 不支持路径中带 @ 符号,具体可以查看 [#14980](https://github.com/facebook/react-native/issues/14980)。 + +### The development server returned response error code 500 + +![image](https://user-images.githubusercontent.com/25324938/41452372-42c1e766-708f-11e8-96ce-323eaa1eb03f.jpeg) +多半是依赖的问题,进入 `.rn_temp/` 目录,然后删除 npm 依赖,在重新安装就可以了。 +也可以试一下以下命令: + +```shell +watchman watch-del-all +rm -rf node_modules && npm install +rm -fr $TMPDIR/react-* +``` + +具体可以参考 [#1282](https://github.com/expo/expo/issues/1282) + +### app 加载阻塞: "Building JavaScript bundle... 100%" + +![image](https://user-images.githubusercontent.com/9441951/47762170-7bb00980-dcf6-11e8-95ab-41152076c3de.png) + +可能的原因很多,可以参考这个 issue:[react-community/create-react-native-app#392](https://github.com/react-community/create-react-native-app/issues/392) + +## 参考 + +- [React Native 中文网](https://reactnative.cn/) +- [Android 开发文档](https://developer.android.com/guide?hl=zh-cn) +- [Android Studio 用户指南](https://developer.android.com/studio/intro?hl=zh-cn) +- [Apple Developer Documentation](https://developer.apple.com/documentation/) +- [React Native Debugger ](https://github.com/jhen0409/react-native-debugger) diff --git a/website/versioned_docs/version-2.0.0-beta.4/size.md b/website/versioned_docs/version-2.0.0-beta.4/size.md new file mode 100644 index 000000000000..317af0c39ebf --- /dev/null +++ b/website/versioned_docs/version-2.0.0-beta.4/size.md @@ -0,0 +1,172 @@ +--- +title: 设计稿及尺寸单位 +id: version-2.0.0-beta.4-size +original_id: size +--- + +在 Taro 中尺寸单位建议使用 `px`、 `百分比 %`,Taro 默认会对所有单位进行转换。在 Taro 中书写尺寸按照 1:1 的关系来进行书写,即从设计稿上量的长度 `100px`,那么尺寸书写就是 `100px`,当转成微信小程序的时候,尺寸将默认转换为 `100rpx`,当转成 H5 时将默认转换为以 `rem` 为单位的值。 + +如果你希望部分 `px` 单位不被转换成 `rpx` 或者 `rem` ,最简单的做法就是在 px 单位中增加一个大写字母,例如 `Px` 或者 `PX` 这样,则会被转换插件忽略。 + +结合过往的开发经验,Taro 默认以 `750px` 作为换算尺寸标准,如果设计稿不是以 `750px` 为标准,则需要在项目配置 `config/index.js` 中进行设置,例如设计稿尺寸是 `640px`,则需要修改项目配置 `config/index.js` 中的 `designWidth` 配置为 `640`: + +```jsx +const config = { + projectName: 'myProject', + date: '2018-4-18', + designWidth: 640, + .... +} +``` + +目前 Taro 支持 `750`、 `640` 、 `828` 三种尺寸设计稿,他们的换算规则如下: + +```jsx +const deviceRatio = { + '640': 2.34 / 2, + '750': 1, + '828': 1.81 / 2 +} +``` + +建议使用 Taro 时,设计稿以 iPhone 6 `750px` 作为设计尺寸标准。 + +如果你的设计稿是 `375` ,不在以上三种之中,那么你需要把 `designWidth` 配置为 `375`,同时在 `deviceRatio` 中添加换算规则如下: +```js +{ + designWidth: 375, + deviceRatio: { + '375': 1 / 2, + '640': 2.34 / 2, + '750': 1, + '828': 1.81 / 2 + } +} +``` + +## API + +在编译时,Taro 会帮你对样式做尺寸转换操作,但是如果是在 JS 中书写了行内样式,那么编译时就无法做替换了,针对这种情况,Taro 提供了 API `Taro.pxTransform` 来做运行时的尺寸转换。 + +```jsx +Taro.pxTransform(10) // 小程序:rpx,H5:rem +``` + +## 配置 + +默认配置会对所有的 `px` 单位进行转换,有大写字母的 `Px` 或 `PX` 则会被忽略。 + +参数默认值如下: + +```js +{ + onePxTransform: true, + unitPrecision: 5, + propList: ['*'], + selectorBlackList: [], + replace: true, + mediaQuery: false, + minPixelValue: 0 +} +``` + +Type: `Object | Null` + +### `onePxTransform` (Boolean) + +设置 1px 是否需要被转换 + +### `unitPrecision` (Number) + +REM 单位允许的小数位。 + +### `propList` (Array) + +允许转换的属性。 + +- Values need to be exact matches. +- Use wildcard `*` to enable all properties. Example: `['*']` +- Use `*` at the start or end of a word. (`['*position*']` will match `background-position-y`) +- Use `!` to not match a property. Example: `['*', '!letter-spacing']` +- Combine the "not" prefix with the other prefixes. Example: `['*', '!font*']` + +### `selectorBlackList` + +黑名单里的选择器将会被忽略。 + +- If value is string, it checks to see if selector contains the string. + - `['body']` will match `.body-class` +- If value is regexp, it checks to see if the selector matches the regexp. + - `[/^body$/]` will match `body` but not `.body` + +### `replace` (Boolean) + +直接替换而不是追加一条进行覆盖。 + +### `mediaQuery` (Boolean) + +允许媒体查询里的 px 单位转换 + +### `minPixelValue` (Number) + +设置一个可被转换的最小 px 值 + +配置规则对应到 `config/index.js` ,例如: + +```js +{ + h5: { + publicPath: '/', + staticDirectory: 'static', + module: { + postcss: { + autoprefixer: { + enable: true + }, + pxtransform: { + enable: true, + config: { + selectorBlackList: ['body'] + } + } + } + } + }, + weapp: { + // ... + module: { + postcss: { + pxtransform: { + enable: true, + config: { + selectorBlackList: ['body'] + } + } + } + } + } +} +``` + +## 忽略 + +### 属性 + +当前忽略单个属性的最简单的方法,就是 px 单位使用大写字母。 + +```css + /* `px` is converted to `rem` */ +.convert { + font-size: 16px; // converted to 1rem +} + + /* `Px` or `PX` is ignored by `postcss-pxtorem` but still accepted by browsers */ +.ignore { + border: 1Px solid; // ignored + border-width: 2PX; // ignored +} +``` + +### 文件 + +对于头部包含注释 `/*postcss-pxtransform disable*/` 的文件,插件不予处理。 diff --git a/website/versioned_docs/version-2.0.0-beta.4/taroize.md b/website/versioned_docs/version-2.0.0-beta.4/taroize.md new file mode 100644 index 000000000000..2bc6737f62f6 --- /dev/null +++ b/website/versioned_docs/version-2.0.0-beta.4/taroize.md @@ -0,0 +1,253 @@ +--- +title: 微信小程序转 Taro +id: version-2.0.0-beta.4-taroize +original_id: taroize +--- + +> 自 `v1.2.0` 开始支持此功能 + +Taro 可以将你的原生微信小程序应用转换为 Taro 代码,进而你可以通过 `taro build` 的命令将 Taro 代码转换为对应平台的代码,或者对转换后的 Taro 代码用 React 的方式进行二次开发。 + +微信原生小程序转 Taro 的操作非常简单,首先必须安装使用 `npm i -g @tarojs/cli` 安装 Taro 命令行工具,其次在命令行中定位到小程序项目的根目录,根目录中运行: + +```bash +$ taro convert +``` + +即可完成转换。转换后的代码保存在根目录下的 `taroConvert` 文件夹下。你需要定位到 `taroConvert` 目录执行 `npm install` 命令之后就可以使用 `taro build` 命令编译到对应平台的代码。 + +## 二次开发 + +假设已有一个转换后文件如下: + +```javascript +import { View } from '@tarojs/components' +import Taro from '@tarojs/taro' +import withWeapp from '@tarojs/with-weapp' +import './index.scss' + +var app = Taro.getApp() + +@withWeapp('Page') +class _C extends Taro.Component { + state = {} + + componentWillMount(e) { + var orderId = e.id + this.data.orderId = orderId + } + + componentDidShow() { + var that = this + Taro.request({ + url: 'https://api.it120.cc/' + app.globalData.subDomain + '/order/detail', + data: { + token: Taro.getStorageSync('token'), + id: that.data.orderId + }, + success: res => { + Taro.hideLoading() + if (res.data.code != 0) { + Taro.showModal({ + title: '错误', + content: res.data.msg, + showCancel: false + }) + return + } + that.setData({ + orderDetail: res.data.data, + logisticsTraces: res.data.data.logisticsTraces.reverse() + }) + } + }) + } + + config = { + navigationBarTitleText: '物流详情' + } + + render() { + const { + orderDetail: orderDetail, + logisticsTraces: logisticsTraces + } = this.state + return ( + + + + 物流单号 + {orderDetail.logistics.trackingNumber} + + + 物流公司 + {orderDetail.logistics.shipperName} + + + + + + {logisticsTraces.map((item, index) => { + return ( + + + + ) + })} + + + + ) + } +} + +export default _C +``` + +它看起来就像普通的 Taro 组件,最重要的区别就在于 `@withWeapp()` 这个装饰器,你可以将它理解为转换代码的运行时,`@withWeapp()` 会增加一些原来 Taro 没有方法和属性,例如: + +### `this.setData` + +转换后的 `this.setData` 的 API 相当于小程序的 `this.setData` 的 polyfill,他和 `this.setState` 最大的区别就在于,`this.setData` 之后 `data` 的数据是同步更新,而渲染是异步更新,而 `setState` 两者都是异步的。 + +### `this.data` 和 `this.properties` + +`this.data` 和 `this.properties` 相当于 Taro 的 `this.state` 和 `this.props` 的 alias,当它们的数据更新时,对应的 `state` 和 `props` 也会同步更新。 + +### 生命周期 + +Taro 会将原始文件的生命周期钩子函数转换为 Taro 的生命周期,完整对应关系如下: + +| Page.onLoad | componentWillMount | +| --: | --: | +| onShow | componentDidShow | +| onHide | componentDidHide | +| onReady | componentDidMount | +| onUnload | componentWillUnmount | +| onError | componentDidCatchError | +| App.onLaunch | componentWillMount | +| Component.created | componentWillMount | +| attached | componentDidMount | +| ready | componentDidMount | +| detached | componentWillUnmount | +| moved | 保留 | + +## 常见问题 + +### 在小程序 IDE 显示 `_createData` 错误 + +这个错误通常是由于原始代码的初始 `data` 中没有对应的数据,后来通过 `this.setData` 补充数据造成的。在 Taro 中推荐不管是 `state(data)` 还是 `properties(props)` 都要设置一个默认值。你可以在类构造器或修改原始代码提供一个默认值解决这个问题,这也应该是编写代码的最佳实践。 + +### 转换 `wxParse` 报错不存在文件 + +这是由于 `wxParse` 的源码使用了一个[不存在的 `template`](https://github.com/icindy/wxParse/issues/255) 声明造成的。你可以修改 `wxParse` 的源码文件 `wxParse.wxml` 134 行到 207 行: + +```html + +