From 976d7a34a0b28484ce033562d86cb2522d6c1f47 Mon Sep 17 00:00:00 2001 From: fushen Date: Fri, 30 Oct 2020 16:00:46 +0800 Subject: [PATCH 01/64] feat: support pages which not under the src/pages --- packages/rax-app/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/rax-app/package.json b/packages/rax-app/package.json index 6fbfa95a9c..e39a856868 100644 --- a/packages/rax-app/package.json +++ b/packages/rax-app/package.json @@ -1,6 +1,6 @@ { "name": "rax-app", - "version": "3.0.6", + "version": "3.0.7-0", "description": "command line interface and builtin plugin for rax app", "author": "ice-admin@alibaba-inc.com", "homepage": "https://github.com/alibaba/ice#readme", @@ -16,8 +16,8 @@ "dependencies": { "@alib/build-scripts": "^0.1.24", "build-plugin-app-core": "0.1.20", - "build-plugin-ice-store": "1.7.6", - "build-plugin-app-base": "1.0.8", + "build-plugin-ice-store": "1.7.8-0", + "build-plugin-app-base": "1.0.9-0", "build-plugin-rax-web": "1.0.5", "build-plugin-rax-weex": "1.0.5", "build-plugin-rax-kraken": "1.0.4", From 3f91638c0978c3864f17b70703e8914fa276128a Mon Sep 17 00:00:00 2001 From: fushen Date: Fri, 30 Oct 2020 16:01:17 +0800 Subject: [PATCH 02/64] feat: support pages which not under the src/pages --- packages/plugin-app-base/package.json | 5 +- .../src/loaders/AppConfigLoader/getDepPath.js | 15 - .../src/loaders/AppConfigLoader/index.js | 26 +- .../src/userConfig/babelPresets.js | 6 +- .../src/userConfig/browserslist.js | 4 +- .../plugin-app-base/src/userConfig/hash.js | 6 +- .../src/userConfig/injectBabel.js | 8 +- .../src/userConfig/outputAssetsPath.js | 6 +- .../src/utils/formatWinPath.js | 5 - packages/plugin-store/package.json | 2 +- packages/plugin-store/src/pageSourceLoader.ts | 17 +- yarn.lock | 260 +++++++++++++++--- 12 files changed, 261 insertions(+), 99 deletions(-) delete mode 100644 packages/plugin-app-base/src/loaders/AppConfigLoader/getDepPath.js delete mode 100644 packages/plugin-app-base/src/utils/formatWinPath.js diff --git a/packages/plugin-app-base/package.json b/packages/plugin-app-base/package.json index 60dec8f10c..6b3c3f8138 100644 --- a/packages/plugin-app-base/package.json +++ b/packages/plugin-app-base/package.json @@ -1,6 +1,6 @@ { "name": "build-plugin-app-base", - "version": "1.0.8", + "version": "1.0.9-0", "description": "rax app base plugin", "main": "lib/index.js", "scripts": { @@ -60,6 +60,7 @@ "webpack-plugin-import": "^0.2.6", "webpack-sources": "^1.3.0", "webpackbar": "^4.0.0", - "copy-webpack-plugin": "^5.0.0" + "copy-webpack-plugin": "^5.0.0", + "build-app-helpers": "^1.0.1" } } diff --git a/packages/plugin-app-base/src/loaders/AppConfigLoader/getDepPath.js b/packages/plugin-app-base/src/loaders/AppConfigLoader/getDepPath.js deleted file mode 100644 index f0b3ddb1a3..0000000000 --- a/packages/plugin-app-base/src/loaders/AppConfigLoader/getDepPath.js +++ /dev/null @@ -1,15 +0,0 @@ -const { join } = require('path'); -const formatWinPath = require('../../utils/formatWinPath'); - -/** - * ./pages/foo -> based on src, return original - * /pages/foo -> based on rootContext - * pages/foo -> based on src, add prefix: './' - */ -// Todo: Will support ice later -module.exports = function getDepPath(path, rootContext = '') { - const splitPath = path.split('/'); - splitPath[splitPath.length - 1] = 'Page'; - const tempPagePath = splitPath.join('/'); - return formatWinPath(join(rootContext, '.rax', tempPagePath)); -}; diff --git a/packages/plugin-app-base/src/loaders/AppConfigLoader/index.js b/packages/plugin-app-base/src/loaders/AppConfigLoader/index.js index 49ed9334b0..62dbebf363 100644 --- a/packages/plugin-app-base/src/loaders/AppConfigLoader/index.js +++ b/packages/plugin-app-base/src/loaders/AppConfigLoader/index.js @@ -1,6 +1,7 @@ const { getOptions } = require('loader-utils'); +const { join } = require('path'); +const { formatPath } = require('build-app-helpers'); const getRouteName = require('../../utils/getRouteName'); -const getDepPath = require('./getDepPath'); /** * universal-app-config-loader @@ -11,11 +12,7 @@ const getDepPath = require('./getDepPath'); "source": "pages/Home/index", "component": fn, } - ], - "shell": { - "source": "shell/index", - "component": fn - }, + ] "hydrate": false } */ @@ -53,7 +50,7 @@ module.exports = function (appJSON) { // Second level function to support rax-use-router rule autorun function type component. const dynamicImportComponent = `(routeProps) => - import(/* webpackChunkName: "${getRouteName(route, this.rootContext).toLocaleLowerCase()}.chunk" */ '${getDepPath(route.source, this.rootContext)}') + import(/* webpackChunkName: "${getRouteName(route, this.rootContext).toLocaleLowerCase()}.chunk" */ '${route.pageSource || formatPath(join(this.rootContext, 'src', route.source))}') .then((mod) => () => { const reference = interopRequire(mod); function Component(props) { @@ -64,7 +61,7 @@ module.exports = function (appJSON) { return Component; }) `; - const importComponent = `() => () => interopRequire(require('${getDepPath(route.source, this.rootContext)}'))`; + const importComponent = `() => () => interopRequire(require('${route.pageSource || formatPath(join(this.rootContext, 'src', route.source))}'))`; return `routes.push( { @@ -74,18 +71,6 @@ module.exports = function (appJSON) { );`; }).join('\n'); - let processShell; - if (appConfig.shell) { - processShell = ` - import Shell from "${getDepPath(appConfig.shell.source, this.rootContext)}"; - appConfig.shell = { - source: '${appConfig.shell.source}', - component: Shell - }; - `; - } else { - processShell = ''; - } return ` import { createElement } from 'rax'; @@ -96,7 +81,6 @@ module.exports = function (appJSON) { ...${appJSON}, routes }; - ${processShell} export default appConfig; `; }; diff --git a/packages/plugin-app-base/src/userConfig/babelPresets.js b/packages/plugin-app-base/src/userConfig/babelPresets.js index 1ac619ea0d..aeeb642b25 100644 --- a/packages/plugin-app-base/src/userConfig/babelPresets.js +++ b/packages/plugin-app-base/src/userConfig/babelPresets.js @@ -1,4 +1,4 @@ -const formatWinPath = require('../utils/formatWinPath'); +const { formatPath } = require('build-app-helpers'); module.exports = (config, babelPresets) => { ['jsx', 'tsx'].forEach((rule) => { @@ -11,7 +11,7 @@ module.exports = (config, babelPresets) => { const [presetPath] = Array.isArray(preset) ? preset : [preset]; let matchedPreset = null; extraPresets = extraPresets.filter((babelPreset) => { - const matched = formatWinPath(presetPath).indexOf(Array.isArray(babelPreset) ? babelPreset[0] : babelPreset) > -1; + const matched = formatPath(presetPath).indexOf(Array.isArray(babelPreset) ? babelPreset[0] : babelPreset) > -1; if (matched) { matchedPreset = babelPreset; } @@ -30,4 +30,4 @@ module.exports = (config, babelPresets) => { }; }); }); -}; \ No newline at end of file +}; diff --git a/packages/plugin-app-base/src/userConfig/browserslist.js b/packages/plugin-app-base/src/userConfig/browserslist.js index 5b0dc239ff..20834951c9 100644 --- a/packages/plugin-app-base/src/userConfig/browserslist.js +++ b/packages/plugin-app-base/src/userConfig/browserslist.js @@ -1,4 +1,4 @@ -const formatWinPath = require('../utils/formatWinPath'); +const { formatPath } = require('build-app-helpers'); module.exports = (config, browserslist) => { ['jsx', 'tsx'].forEach((rule) => { @@ -8,7 +8,7 @@ module.exports = (config, browserslist) => { .tap((options) => { const babelPresets = options.presets || []; const presets = babelPresets.map((preset) => { - if (Array.isArray(preset) && formatWinPath(preset[0]).indexOf(formatWinPath('@babel/preset-env')) > -1) { + if (Array.isArray(preset) && formatPath(preset[0]).indexOf(formatPath('@babel/preset-env')) > -1) { return [ preset[0], Object.assign(preset[1], { targets: browserslist }), diff --git a/packages/plugin-app-base/src/userConfig/hash.js b/packages/plugin-app-base/src/userConfig/hash.js index a1b6129ebb..0d51b6b76e 100644 --- a/packages/plugin-app-base/src/userConfig/hash.js +++ b/packages/plugin-app-base/src/userConfig/hash.js @@ -1,5 +1,5 @@ const path = require('path'); -const formatWinPath = require('../utils/formatWinPath'); +const { formatPath } = require('build-app-helpers'); module.exports = (config, hash, context) => { const { command } = context; @@ -12,10 +12,10 @@ module.exports = (config, hash, context) => { pathArray.pop(); // pop filename pathArray = pathArray.filter((v) => v); const outputPath = pathArray.length ? pathArray.join('/') : ''; - config.output.filename(formatWinPath(path.join(outputPath, `[name].[${hashStr}].js`))); + config.output.filename(formatPath(path.join(outputPath, `[name].[${hashStr}].js`))); if (config.plugins.get('MiniCssExtractPlugin')) { config.plugin('MiniCssExtractPlugin').tap((args) => [Object.assign(...args, { - filename: formatWinPath(path.join(outputPath, `[name].[${hashStr}].css`)), + filename: formatPath(path.join(outputPath, `[name].[${hashStr}].css`)), })]); } } diff --git a/packages/plugin-app-base/src/userConfig/injectBabel.js b/packages/plugin-app-base/src/userConfig/injectBabel.js index da971b062a..735657ebb2 100644 --- a/packages/plugin-app-base/src/userConfig/injectBabel.js +++ b/packages/plugin-app-base/src/userConfig/injectBabel.js @@ -1,4 +1,4 @@ -const formatWinPath = require('../utils/formatWinPath'); +const { formatPath } = require('build-app-helpers'); const addBablePlugins = require('./babelPlugins'); module.exports = (config, injectBabel, context) => { @@ -14,7 +14,7 @@ module.exports = (config, injectBabel, context) => { .tap((options) => { // get @babel/plugin-transform-runtime const babelPlugins = options.plugins || []; - const targetPlugin = formatWinPath('@babel/plugin-transform-runtime'); + const targetPlugin = formatPath('@babel/plugin-transform-runtime'); const plguinOption = { corejs: false, helpers: true, @@ -22,8 +22,8 @@ module.exports = (config, injectBabel, context) => { useESModules: false, }; const plugins = babelPlugins.map((plugin) => { - if (typeof plugin === 'string' && formatWinPath(plugin).indexOf(targetPlugin) > -1 - || Array.isArray(plugin) && formatWinPath(plugin[0]).indexOf(targetPlugin) > -1 ) { + if (typeof plugin === 'string' && formatPath(plugin).indexOf(targetPlugin) > -1 + || Array.isArray(plugin) && formatPath(plugin[0]).indexOf(targetPlugin) > -1 ) { return [Array.isArray(plugin) ? plugin[0] : plugin, plguinOption]; } else { return [require.resolve('@babel/plugin-transform-runtime'), plguinOption]; diff --git a/packages/plugin-app-base/src/userConfig/outputAssetsPath.js b/packages/plugin-app-base/src/userConfig/outputAssetsPath.js index 9df7f06686..6f6c8a0330 100644 --- a/packages/plugin-app-base/src/userConfig/outputAssetsPath.js +++ b/packages/plugin-app-base/src/userConfig/outputAssetsPath.js @@ -1,18 +1,18 @@ const path = require('path'); const { last } = require('lodash'); -const formatWinPath = require('../utils/formatWinPath'); +const { formatPath } = require('build-app-helpers'); function getFilename(filePath) { return last((filePath || '').split('/')); } module.exports = (config, outputAssetsPath) => { const filename = getFilename(config.output.get('filename')); - config.output.filename(formatWinPath(path.join(outputAssetsPath.js || '', filename))); + config.output.filename(formatPath(path.join(outputAssetsPath.js || '', filename))); if (config.plugins.get('MiniCssExtractPlugin')) { const options = config.plugin('MiniCssExtractPlugin').get('args')[0]; config.plugin('MiniCssExtractPlugin').tap((args) => [Object.assign(...args, { - filename: formatWinPath(path.join(outputAssetsPath.css || '', getFilename(options.filename))), + filename: formatPath(path.join(outputAssetsPath.css || '', getFilename(options.filename))), })]); } }; diff --git a/packages/plugin-app-base/src/utils/formatWinPath.js b/packages/plugin-app-base/src/utils/formatWinPath.js deleted file mode 100644 index 21801a2529..0000000000 --- a/packages/plugin-app-base/src/utils/formatWinPath.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = (outputPath) => { - const isWin = process.platform === 'win32'; - // js\index.js => js/index.js - return isWin ? outputPath.replace(/\\/g, '/') : outputPath; -}; diff --git a/packages/plugin-store/package.json b/packages/plugin-store/package.json index eb4a57863d..133a1f362c 100644 --- a/packages/plugin-store/package.json +++ b/packages/plugin-store/package.json @@ -1,6 +1,6 @@ { "name": "build-plugin-ice-store", - "version": "1.7.7", + "version": "1.7.8-0", "description": "builtin `icestore` in icejs", "author": "ice-admin@alibaba-inc.com", "homepage": "", diff --git a/packages/plugin-store/src/pageSourceLoader.ts b/packages/plugin-store/src/pageSourceLoader.ts index 0460507895..80714b9efc 100644 --- a/packages/plugin-store/src/pageSourceLoader.ts +++ b/packages/plugin-store/src/pageSourceLoader.ts @@ -17,10 +17,19 @@ export default function pageSourceLoader(appJSON) { const content = JSON.parse(appJSON); content.routes = content.routes.map(route => { - return { - ...route, - realSource: join(targetPath, route.source) - }; + let pageSource = route.source; + if (/^\/?pages/.test(pageSource)) { + if (/index$/.test(pageSource)) { + pageSource = pageSource.replace(/index$/, 'Page'); + } else { + pageSource = join(pageSource, 'Page'); + } + return { + ...route, + pageSource: join(targetPath, pageSource) + }; + } + return route; }); return JSON.stringify(content); }; diff --git a/yarn.lock b/yarn.lock index 1b81a74733..5902f80e53 100644 --- a/yarn.lock +++ b/yarn.lock @@ -90,7 +90,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@>=7.2.2", "@babel/core@^7.1.0", "@babel/core@^7.7.5", "@babel/core@^7.7.7", "@babel/core@^7.9.6": +"@babel/core@>=7.2.2", "@babel/core@^7.1.0", "@babel/core@^7.5.5", "@babel/core@^7.7.5", "@babel/core@^7.7.7", "@babel/core@^7.9.6": version "7.12.3" resolved "https://registry.npm.taobao.org/@babel/core/download/@babel/core-7.12.3.tgz#1b436884e1e3bff6fb1328dc02b208759de92ad8" integrity sha1-G0NohOHjv/b7EyjcArIIdZ3pKtg= @@ -112,7 +112,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.12.1", "@babel/generator@^7.2.0", "@babel/generator@^7.4.0", "@babel/generator@^7.6.4", "@babel/generator@^7.9.6": +"@babel/generator@^7.12.1", "@babel/generator@^7.2.0", "@babel/generator@^7.3.4", "@babel/generator@^7.4.0", "@babel/generator@^7.6.4", "@babel/generator@^7.9.6": version "7.12.1" resolved "https://registry.npm.taobao.org/@babel/generator/download/@babel/generator-7.12.1.tgz?cache=0&sync_timestamp=1602802522241&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fgenerator%2Fdownload%2F%40babel%2Fgenerator-7.12.1.tgz#0d70be32bdaa03d7c51c8597dda76e0df1f15468" integrity sha1-DXC+Mr2qA9fFHIWX3aduDfHxVGg= @@ -348,7 +348,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.10.4", "@babel/parser@^7.12.1", "@babel/parser@^7.12.3", "@babel/parser@^7.2.0", "@babel/parser@^7.4.3", "@babel/parser@^7.6.4", "@babel/parser@^7.7.0": +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.10.4", "@babel/parser@^7.12.1", "@babel/parser@^7.12.3", "@babel/parser@^7.2.0", "@babel/parser@^7.3.4", "@babel/parser@^7.4.3", "@babel/parser@^7.6.4", "@babel/parser@^7.7.0": version "7.12.3" resolved "https://registry.npm.taobao.org/@babel/parser/download/@babel/parser-7.12.3.tgz?cache=0&sync_timestamp=1602881390944&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fparser%2Fdownload%2F%40babel%2Fparser-7.12.3.tgz#a305415ebe7a6c7023b40b5122a0662d928334cd" integrity sha1-owVBXr56bHAjtAtRIqBmLZKDNM0= @@ -370,7 +370,7 @@ "@babel/helper-create-class-features-plugin" "^7.2.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-proposal-class-properties@^7.1.0", "@babel/plugin-proposal-class-properties@^7.12.1", "@babel/plugin-proposal-class-properties@^7.7.4": +"@babel/plugin-proposal-class-properties@^7.1.0", "@babel/plugin-proposal-class-properties@^7.12.1", "@babel/plugin-proposal-class-properties@^7.5.5", "@babel/plugin-proposal-class-properties@^7.7.4": version "7.12.1" resolved "https://registry.npm.taobao.org/@babel/plugin-proposal-class-properties/download/@babel/plugin-proposal-class-properties-7.12.1.tgz?cache=0&sync_timestamp=1602802520476&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-proposal-class-properties%2Fdownload%2F%40babel%2Fplugin-proposal-class-properties-7.12.1.tgz#a082ff541f2a29a4821065b8add9346c0c16e5de" integrity sha1-oIL/VB8qKaSCEGW4rdk0bAwW5d4= @@ -421,7 +421,7 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-export-default-from" "^7.2.0" -"@babel/plugin-proposal-export-default-from@^7.0.0", "@babel/plugin-proposal-export-default-from@^7.7.4": +"@babel/plugin-proposal-export-default-from@^7.0.0", "@babel/plugin-proposal-export-default-from@^7.5.2", "@babel/plugin-proposal-export-default-from@^7.7.4": version "7.12.1" resolved "https://registry.npm.taobao.org/@babel/plugin-proposal-export-default-from/download/@babel/plugin-proposal-export-default-from-7.12.1.tgz?cache=0&sync_timestamp=1602802636289&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-proposal-export-default-from%2Fdownload%2F%40babel%2Fplugin-proposal-export-default-from-7.12.1.tgz#c6e62d668a8abcfe0d28b82f560395fecb611c5a" integrity sha1-xuYtZoqKvP4NKLgvVgOV/sthHFo= @@ -1013,7 +1013,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-typescript@^7.12.1": +"@babel/plugin-transform-typescript@^7.12.1", "@babel/plugin-transform-typescript@^7.7.4": version "7.12.1" resolved "https://registry.npm.taobao.org/@babel/plugin-transform-typescript/download/@babel/plugin-transform-typescript-7.12.1.tgz?cache=0&sync_timestamp=1602802642005&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-typescript%2Fdownload%2F%40babel%2Fplugin-transform-typescript-7.12.1.tgz#d92cc0af504d510e26a754a7dbc2e5c8cd9c7ab4" integrity sha1-2SzAr1BNUQ4mp1Sn28LlyM2cerQ= @@ -1084,7 +1084,7 @@ js-levenshtein "^1.1.3" semver "^5.3.0" -"@babel/preset-env@^7.4.0", "@babel/preset-env@^7.7.7": +"@babel/preset-env@^7.4.0", "@babel/preset-env@^7.5.5", "@babel/preset-env@^7.7.7": version "7.12.1" resolved "https://registry.npm.taobao.org/@babel/preset-env/download/@babel/preset-env-7.12.1.tgz?cache=0&sync_timestamp=1602802642837&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fpreset-env%2Fdownload%2F%40babel%2Fpreset-env-7.12.1.tgz#9c7e5ca82a19efc865384bb4989148d2ee5d7ac2" integrity sha1-nH5cqCoZ78hlOEu0mJFI0u5desI= @@ -1239,7 +1239,7 @@ "@babel/parser" "^7.10.4" "@babel/types" "^7.10.4" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.1.6", "@babel/traverse@^7.10.4", "@babel/traverse@^7.12.1", "@babel/traverse@^7.4.3", "@babel/traverse@^7.6.3", "@babel/traverse@^7.7.0": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.1.6", "@babel/traverse@^7.10.4", "@babel/traverse@^7.12.1", "@babel/traverse@^7.3.4", "@babel/traverse@^7.4.3", "@babel/traverse@^7.6.3", "@babel/traverse@^7.7.0": version "7.12.1" resolved "https://registry.npm.taobao.org/@babel/traverse/download/@babel/traverse-7.12.1.tgz?cache=0&sync_timestamp=1602802339226&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftraverse%2Fdownload%2F%40babel%2Ftraverse-7.12.1.tgz#941395e0c5cc86d5d3e75caa095d3924526f0c1e" integrity sha1-lBOV4MXMhtXT51yqCV05JFJvDB4= @@ -1254,7 +1254,7 @@ globals "^11.1.0" lodash "^4.17.19" -"@babel/types@^7.0.0", "@babel/types@^7.10.4", "@babel/types@^7.10.5", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0", "@babel/types@^7.5.5", "@babel/types@^7.6.3", "@babel/types@^7.7.0", "@babel/types@^7.7.4": +"@babel/types@^7.0.0", "@babel/types@^7.10.4", "@babel/types@^7.10.5", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.3.4", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0", "@babel/types@^7.5.5", "@babel/types@^7.6.3", "@babel/types@^7.7.0", "@babel/types@^7.7.4": version "7.12.1" resolved "https://registry.npm.taobao.org/@babel/types/download/@babel/types-7.12.1.tgz#e109d9ab99a8de735be287ee3d6a9947a190c4ae" integrity sha1-4QnZq5mo3nNb4ofuPWqZR6GQxK4= @@ -4427,6 +4427,11 @@ babel-merge@^3.0.0: deepmerge "^2.2.1" object.omit "^3.0.0" +babel-plugin-danger-remove-unused-import@^2.0.0: + version "2.0.0" + resolved "https://registry.npm.taobao.org/babel-plugin-danger-remove-unused-import/download/babel-plugin-danger-remove-unused-import-2.0.0.tgz#6e28bff3fb78440f1f025af43e3a7b95d64a9e75" + integrity sha1-bii/8/t4RA8fAlr0Pjp7ldZKnnU= + babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.npm.taobao.org/babel-plugin-dynamic-import-node/download/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" @@ -4520,6 +4525,14 @@ babel-plugin-module-resolver@^4.0.0: reselect "^4.0.0" resolve "^1.13.1" +babel-plugin-transform-define@^1.3.1: + version "1.3.2" + resolved "https://registry.npm.taobao.org/babel-plugin-transform-define/download/babel-plugin-transform-define-1.3.2.tgz#4bdbfe35a839fc206e0f60a7a9ae3b82d5e11808" + integrity sha1-S9v+Nag5/CBuD2Cnqa47gtXhGAg= + dependencies: + lodash "^4.17.11" + traverse "0.6.6" + babel-plugin-transform-jsx-class@^0.1.2, babel-plugin-transform-jsx-class@^0.1.3: version "0.1.3" resolved "https://registry.npm.taobao.org/babel-plugin-transform-jsx-class/download/babel-plugin-transform-jsx-class-0.1.3.tgz#b59e501896280078a68fb8298b2968b060b86a6f" @@ -4979,6 +4992,20 @@ build-plugin-app-core@0.1.20: react-app-renderer "^0.1.9" universal-env "^3.0.0" +build-plugin-ice-store@1.7.6: + version "1.7.6" + resolved "https://registry.npm.taobao.org/build-plugin-ice-store/download/build-plugin-ice-store-1.7.6.tgz#c98e8f5ee90fa88620734b4b8aca59860c97d910" + integrity sha1-yY6PXukPqIYgc0tLispZhgyX2RA= + dependencies: + "@ice/store" "^1.3.1" + ejs "^3.0.2" + enhanced-resolve "^4.3.0" + fs-extra "^8.1.0" + fs-readdir-recursive "^1.1.0" + loader-utils "^2.0.0" + prettier "^2.0.4" + rax-redux "^1.0.0" + builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.npm.taobao.org/builtin-status-codes/download/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" @@ -5329,6 +5356,21 @@ cheerio@^1.0.0-rc.3: lodash "^4.15.0" parse5 "^3.0.1" +"chokidar@>=2.0.0 <4.0.0", chokidar@^3.3.0, chokidar@^3.3.1, chokidar@^3.4.1, chokidar@^3.4.2: + version "3.4.3" + resolved "https://registry.npm.taobao.org/chokidar/download/chokidar-3.4.3.tgz?cache=0&sync_timestamp=1602585366200&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchokidar%2Fdownload%2Fchokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" + integrity sha1-wd84IxRI5FykrFiObHlXO6alfVs= + 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.5.0" + optionalDependencies: + fsevents "~2.1.2" + chokidar@^2.0.4, chokidar@^2.1.8: version "2.1.8" resolved "https://registry.npm.taobao.org/chokidar/download/chokidar-2.1.8.tgz?cache=0&sync_timestamp=1602585366200&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchokidar%2Fdownload%2Fchokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" @@ -5348,21 +5390,6 @@ chokidar@^2.0.4, chokidar@^2.1.8: optionalDependencies: fsevents "^1.2.7" -chokidar@^3.3.0, chokidar@^3.3.1, chokidar@^3.4.1: - version "3.4.3" - resolved "https://registry.npm.taobao.org/chokidar/download/chokidar-3.4.3.tgz?cache=0&sync_timestamp=1602585366200&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchokidar%2Fdownload%2Fchokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" - integrity sha1-wd84IxRI5FykrFiObHlXO6alfVs= - 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.5.0" - optionalDependencies: - fsevents "~2.1.2" - chownr@^1.1.1, chownr@^1.1.2: version "1.1.4" resolved "https://registry.npm.taobao.org/chownr/download/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -6240,6 +6267,13 @@ css-modules-loader-core@^1.1.0: postcss-modules-scope "1.1.0" postcss-modules-values "1.3.0" +css-parse@~2.0.0: + version "2.0.0" + resolved "https://registry.npm.taobao.org/css-parse/download/css-parse-2.0.0.tgz#a468ee667c16d81ccf05c58c38d2a97c780dbfd4" + integrity sha1-pGjuZnwW2BzPBcWMONKpfHgNv9Q= + dependencies: + css "^2.0.0" + css-prefers-color-scheme@^3.1.1: version "3.1.1" resolved "https://registry.npm.taobao.org/css-prefers-color-scheme/download/css-prefers-color-scheme-3.1.1.tgz#6f830a2714199d4f0d0d0bb8a27916ed65cff1f4" @@ -6280,6 +6314,14 @@ css-selector-tokenizer@^0.7.0: cssesc "^3.0.0" fastparse "^1.1.2" +css-tree@1.0.0-alpha.29: + version "1.0.0-alpha.29" + resolved "https://registry.npm.taobao.org/css-tree/download/css-tree-1.0.0-alpha.29.tgz?cache=0&sync_timestamp=1603806518742&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcss-tree%2Fdownload%2Fcss-tree-1.0.0-alpha.29.tgz#3fa9d4ef3142cbd1c301e7664c1f352bd82f5a39" + integrity sha1-P6nU7zFCy9HDAedmTB81K9gvWjk= + dependencies: + mdn-data "~1.1.0" + source-map "^0.5.3" + css-tree@1.0.0-alpha.37: version "1.0.0-alpha.37" resolved "https://registry.npm.taobao.org/css-tree/download/css-tree-1.0.0-alpha.37.tgz#98bebd62c4c1d9f960ec340cf9f7522e30709a22" @@ -6306,7 +6348,7 @@ css-what@^3.2.1: resolved "https://registry.npm.taobao.org/css-what/download/css-what-3.4.2.tgz?cache=0&sync_timestamp=1602570970779&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcss-what%2Fdownload%2Fcss-what-3.4.2.tgz#ea7026fcb01777edbde52124e21f327e7ae950e4" integrity sha1-6nAm/LAXd+295SEk4h8yfnrpUOQ= -css@^2.2.1: +css@^2.0.0, css@^2.2.1, css@^2.2.4: version "2.2.4" resolved "https://registry.npm.taobao.org/css/download/css-2.2.4.tgz#c646755c73971f2bba6a601e2cf2fd71b1298929" integrity sha1-xkZ1XHOXHyu6amAeLPL9cbEpiSk= @@ -6399,6 +6441,13 @@ cssnano@^4.1.10: is-resolvable "^1.0.0" postcss "^7.0.0" +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" + csso@^4.0.2, csso@^4.0.3: version "4.0.3" resolved "https://registry.npm.taobao.org/csso/download/csso-4.0.3.tgz#0d9985dc852c7cc2b2cacfbbe1079014d1a8e903" @@ -6511,7 +6560,7 @@ debug@2, debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9: dependencies: ms "2.0.0" -debug@3.1.0, debug@=3.1.0: +debug@3.1.0, debug@=3.1.0, debug@~3.1.0: version "3.1.0" resolved "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz?cache=0&sync_timestamp=1600502826356&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" integrity sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE= @@ -7169,7 +7218,7 @@ end-or-error@^1.0.1: resolved "https://registry.npm.taobao.org/end-or-error/download/end-or-error-1.0.1.tgz#dc7a6210fe78d372fee24a8b4899dbd155414dcb" integrity sha1-3HpiEP5403L+4kqLSJnb0VVBTcs= -enhanced-resolve@^4.0.0, enhanced-resolve@^4.3.0: +enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.1, enhanced-resolve@^4.3.0: version "4.3.0" resolved "https://registry.npm.taobao.org/enhanced-resolve/download/enhanced-resolve-4.3.0.tgz?cache=0&sync_timestamp=1603193035222&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fenhanced-resolve%2Fdownload%2Fenhanced-resolve-4.3.0.tgz#3b806f3bfafc1ec7de69551ef93cca46c1704126" integrity sha1-O4BvO/r8HsfeaVUe+TzKRsFwQSY= @@ -8224,7 +8273,7 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" -fs-extra@^7.0.0: +fs-extra@^7.0.0, fs-extra@^7.0.1: version "7.0.1" resolved "https://registry.npm.taobao.org/fs-extra/download/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" integrity sha1-TxicRKoSO4lfcigE9V6iPq3DSOk= @@ -11052,6 +11101,11 @@ json-cycle@^1.3.0: resolved "https://registry.npm.taobao.org/json-cycle/download/json-cycle-1.3.0.tgz#c4f6f7d926c2979012cba173b06f9cae9e866d3f" integrity sha1-xPb32SbCl5ASy6FzsG+crp6GbT8= +json-loader@^0.5.7: + version "0.5.7" + resolved "https://registry.npm.taobao.org/json-loader/download/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" + integrity sha1-3KFKcCNf+C8KyaOr62DTN6NlGF0= + json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.npm.taobao.org/json-parse-better-errors/download/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -11165,6 +11219,60 @@ jsx-ast-utils@^2.4.1: array-includes "^3.1.1" object.assign "^4.1.1" +jsx-compiler@^0.4.0: + version "0.4.20" + resolved "https://registry.npm.taobao.org/jsx-compiler/download/jsx-compiler-0.4.20.tgz#0609e5138faf270ff9e4530224e28b8ec1e5cac3" + integrity sha1-BgnlE4+vJw/55FMCJOKLjsHlysM= + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.3.4" + "@babel/parser" "^7.3.4" + "@babel/traverse" "^7.3.4" + "@babel/types" "^7.3.4" + chalk "^2.4.2" + css "^2.2.4" + fs-extra "^7.0.1" + kebab-case "^1.0.0" + md5 "^2.2.1" + resolve "^1.12.0" + +jsx2mp-loader@^0.4.13: + version "0.4.15" + resolved "https://registry.npm.taobao.org/jsx2mp-loader/download/jsx2mp-loader-0.4.15.tgz#800dfbf824aa2012ac0d45a8608e3aeaeec335df" + integrity sha1-gA37+CSqIBKsDUWoYI466u7DNd8= + dependencies: + "@babel/core" "^7.5.5" + "@babel/plugin-proposal-class-properties" "^7.5.5" + "@babel/plugin-proposal-export-default-from" "^7.5.2" + "@babel/plugin-transform-typescript" "^7.7.4" + "@babel/preset-env" "^7.5.5" + babel-plugin-danger-remove-unused-import "^2.0.0" + babel-plugin-minify-dead-code-elimination "^0.5.1" + babel-plugin-transform-define "^1.3.1" + chalk "^2.4.2" + convert-source-map "^1.6.0" + csso "^3.5.1" + enhanced-resolve "^4.1.1" + fs-extra "^8.1.0" + jsx-compiler "^0.4.0" + less "^3.10.3" + loader-utils "^1.2.3" + pretty-data "^0.40.0" + sass "^1.23.2" + stylesheet-loader "^0.8.0" + stylus "^0.54.7" + terser "^4.3.8" + +jsx2mp-runtime@^0.4.16: + version "0.4.16" + resolved "https://registry.npm.taobao.org/jsx2mp-runtime/download/jsx2mp-runtime-0.4.16.tgz#5b3841f1bcc8bf84c010957ee3b8f5e533cb6975" + integrity sha1-WzhB8bzIv4TAEJV+47j15TPLaXU= + +kebab-case@^1.0.0: + version "1.0.0" + resolved "https://registry.npm.taobao.org/kebab-case/download/kebab-case-1.0.0.tgz#3f9e4990adcad0c686c0e701f7645868f75f91eb" + integrity sha1-P55JkK3K0MaGwOcB92RYaPdfkes= + keygrip@~1.1.0: version "1.1.0" resolved "https://registry.npm.taobao.org/keygrip/download/keygrip-1.1.0.tgz#871b1681d5e159c62a445b0c74b615e0917e7226" @@ -11788,6 +11896,11 @@ mdn-data@2.0.6: resolved "https://registry.npm.taobao.org/mdn-data/download/mdn-data-2.0.6.tgz?cache=0&sync_timestamp=1602987131460&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmdn-data%2Fdownload%2Fmdn-data-2.0.6.tgz#852dc60fcaa5daa2e8cf6c9189c440ed3e042978" integrity sha1-hS3GD8ql2qLoz2yRicRA7T4EKXg= +mdn-data@~1.1.0: + version "1.1.4" + resolved "https://registry.npm.taobao.org/mdn-data/download/mdn-data-1.1.4.tgz?cache=0&sync_timestamp=1602987131460&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmdn-data%2Fdownload%2Fmdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" + integrity sha1-ULXU/8RXUnZXPE7tuHgIEqhBnwE= + media-typer@0.3.0: version "0.3.0" resolved "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -12014,7 +12127,7 @@ mini-css-extract-plugin@^0.8.0: schema-utils "^1.0.0" webpack-sources "^1.1.0" -miniapp-builder-shared@^0.1.1, miniapp-builder-shared@^0.1.6, miniapp-builder-shared@^0.1.7: +miniapp-builder-shared@^0.1.0, miniapp-builder-shared@^0.1.1, miniapp-builder-shared@^0.1.6, miniapp-builder-shared@^0.1.7: version "0.1.7" resolved "https://registry.npm.taobao.org/miniapp-builder-shared/download/miniapp-builder-shared-0.1.7.tgz?cache=0&sync_timestamp=1602661514342&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fminiapp-builder-shared%2Fdownload%2Fminiapp-builder-shared-0.1.7.tgz#e78e08aac0d8e32c92ca5082b16a3dc3e20da49a" integrity sha1-544IqsDY4yySylCCsWo9w+INpJo= @@ -12022,6 +12135,27 @@ miniapp-builder-shared@^0.1.1, miniapp-builder-shared@^0.1.6, miniapp-builder-sh enhanced-resolve "^4.3.0" fs-extra "^8.0.1" +miniapp-compile-config@^0.1.3: + version "0.1.5" + resolved "https://registry.npm.taobao.org/miniapp-compile-config/download/miniapp-compile-config-0.1.5.tgz#732f9a9758a48410c8980637b4a7c9c08242d6bb" + integrity sha1-cy+al1ikhBDImAY3tKfJwIJC1rs= + dependencies: + chokidar "^3.4.2" + copy-webpack-plugin "^6.0.3" + fs-extra "^8.0.1" + json-loader "^0.5.7" + jsx2mp-loader "^0.4.13" + jsx2mp-runtime "^0.4.16" + memory-fs "^0.5.0" + miniapp-builder-shared "^0.1.0" + rax-compile-config "^0.2.15" + rax-miniapp-babel-plugins "^0.1.3" + rax-miniapp-config-webpack-plugin "^1.2.3" + rax-miniapp-runtime-webpack-plugin "^1.1.0" + terser "^4.8.0" + ts-loader "^8.0.3" + webpack "^4.44.1" + miniapp-history@^0.1.0: version "0.1.4" resolved "https://registry.npm.taobao.org/miniapp-history/download/miniapp-history-0.1.4.tgz#df37089a677d66b7d754efe67a2835488d1c309b" @@ -12177,7 +12311,7 @@ mkdirp-promise@^5.0.1: dependencies: mkdirp "*" -mkdirp@*, mkdirp@^1.0.3, mkdirp@^1.0.4: +mkdirp@*, mkdirp@^1.0.3, mkdirp@^1.0.4, mkdirp@~1.0.4: version "1.0.4" resolved "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha1-PrXtYmInVteaXw4qIh3+utdcL34= @@ -14829,7 +14963,7 @@ rax-clone-element@^1.0.0: dependencies: rax-is-valid-element "^1.0.0" -rax-compile-config@^0.2.16: +rax-compile-config@^0.2.15, rax-compile-config@^0.2.16: version "0.2.16" resolved "https://registry.npm.taobao.org/rax-compile-config/download/rax-compile-config-0.2.16.tgz#b22c379f70377437dcea6f3c1c6a85d0bc3dcf90" integrity sha1-siw3n3A3dDfc6m88HGqF0Lw9z5A= @@ -14904,6 +15038,23 @@ rax-miniapp-config-webpack-plugin@^1.2.3: dependencies: fs-extra "^8.1.0" +rax-miniapp-runtime-webpack-plugin@^1.1.0: + version "1.2.8" + resolved "https://registry.npm.taobao.org/rax-miniapp-runtime-webpack-plugin/download/rax-miniapp-runtime-webpack-plugin-1.2.8.tgz#c00583c4829e029e074f8fdef0200a436b4e0cd9" + integrity sha1-wAWDxIKeAp4HT4/e8CAKQ2tODNk= + dependencies: + chalk "^3.0.0" + colors "^1.4.0" + csso "^4.0.3" + ejs "^3.1.2" + fs-extra "^8.1.0" + path-to-regexp "^3.0.0" + postcss "^7.0.17" + pretty-data "^0.40.0" + terser "^4.6.10" + webpack "^4.35.3" + webpack-sources "^1.3.0" + rax-miniapp-runtime-webpack-plugin@^1.2.2: version "1.2.6" resolved "https://registry.npm.taobao.org/rax-miniapp-runtime-webpack-plugin/download/rax-miniapp-runtime-webpack-plugin-1.2.6.tgz#1b5e438854b8147f3198f0ae52cef506e7667133" @@ -15867,7 +16018,7 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@^2.1.2, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo= @@ -15908,6 +16059,13 @@ sass-loader@^8.0.0: schema-utils "^2.6.1" semver "^6.3.0" +sass@^1.23.2: + version "1.28.0" + resolved "https://registry.npm.taobao.org/sass/download/sass-1.28.0.tgz#546f1308ff74cc4ec2ad735fd35dc18bc3f51f72" + integrity sha1-VG8TCP90zE7CrXNf013Bi8P1H3I= + dependencies: + chokidar ">=2.0.0 <4.0.0" + sax@>=0.6.0, sax@^1.1.4, sax@^1.2.4, sax@~1.2.4: version "1.2.4" resolved "https://registry.npm.taobao.org/sax/download/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -16346,7 +16504,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.0, source-map@^0.5.3, source-map@^0.5.6: version "0.5.7" resolved "https://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= @@ -16979,7 +17137,7 @@ stylesheet-loader@^0.6.10: css "^2.2.1" loader-utils "^1.2.3" -stylesheet-loader@^0.8.5: +stylesheet-loader@^0.8.0, stylesheet-loader@^0.8.5: version "0.8.5" resolved "https://registry.npm.taobao.org/stylesheet-loader/download/stylesheet-loader-0.8.5.tgz#aeeb9357b238b51c24677b9363a86a324ed22bf4" integrity sha1-ruuTV7I4tRwkZ3uTY6hqMk7SK/Q= @@ -16989,6 +17147,20 @@ stylesheet-loader@^0.8.5: css "^2.2.1" loader-utils "^1.2.3" +stylus@^0.54.7: + version "0.54.8" + resolved "https://registry.npm.taobao.org/stylus/download/stylus-0.54.8.tgz#3da3e65966bc567a7b044bfe0eece653e099d147" + integrity sha1-PaPmWWa8Vnp7BEv+DuzmU+CZ0Uc= + dependencies: + css-parse "~2.0.0" + debug "~3.1.0" + glob "^7.1.6" + mkdirp "~1.0.4" + safer-buffer "^2.1.2" + sax "~1.2.4" + semver "^6.3.0" + source-map "^0.7.3" + sugarss@^2.0.0: version "2.0.0" resolved "https://registry.npm.taobao.org/sugarss/download/sugarss-2.0.0.tgz?cache=0&sync_timestamp=1601167191100&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsugarss%2Fdownload%2Fsugarss-2.0.0.tgz#ddd76e0124b297d40bf3cca31c8b22ecb43bc61d" @@ -17186,7 +17358,7 @@ terser-webpack-plugin@^2.1.3, terser-webpack-plugin@^2.3.1: terser "^4.6.12" webpack-sources "^1.4.3" -terser@^4.1.2, terser@^4.6.10, terser@^4.6.12, terser@^4.6.3, terser@^4.6.4: +terser@^4.1.2, terser@^4.3.8, terser@^4.6.10, terser@^4.6.12, terser@^4.6.3, terser@^4.6.4, terser@^4.8.0: version "4.8.0" resolved "https://registry.npm.taobao.org/terser/download/terser-4.8.0.tgz?cache=0&sync_timestamp=1603116448993&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser%2Fdownload%2Fterser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" integrity sha1-YwVjQ9fHC7KfOvZlhlpG/gOg3xc= @@ -17411,6 +17583,11 @@ tr46@~0.0.3: resolved "https://registry.npm.taobao.org/tr46/download/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= +traverse@0.6.6: + version "0.6.6" + resolved "https://registry.npm.taobao.org/traverse/download/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + integrity sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc= + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.npm.taobao.org/trim-newlines/download/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -17496,6 +17673,17 @@ ts-loader@^6.1.2: micromatch "^4.0.0" semver "^6.0.0" +ts-loader@^8.0.3: + version "8.0.7" + resolved "https://registry.npm.taobao.org/ts-loader/download/ts-loader-8.0.7.tgz?cache=0&sync_timestamp=1603539433117&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fts-loader%2Fdownload%2Fts-loader-8.0.7.tgz#9ce70db5b3906cc9143a09c54ff5247d102ea974" + integrity sha1-nOcNtbOQbMkUOgnFT/UkfRAuqXQ= + dependencies: + chalk "^2.3.0" + enhanced-resolve "^4.0.0" + loader-utils "^1.0.2" + micromatch "^4.0.0" + semver "^6.0.0" + ts-node@^8.6.1: version "8.10.2" resolved "https://registry.npm.taobao.org/ts-node/download/ts-node-8.10.2.tgz?cache=0&sync_timestamp=1598040497631&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fts-node%2Fdownload%2Fts-node-8.10.2.tgz#eee03764633b1234ddd37f8db9ec10b75ec7fb8d" @@ -18326,7 +18514,7 @@ webpack-sources@^2.0.0: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@^4.0.0, webpack@^4.27.1, webpack@^4.35.3, webpack@^4.41.1: +webpack@^4.0.0, webpack@^4.27.1, webpack@^4.35.3, webpack@^4.41.1, webpack@^4.44.1: version "4.44.2" resolved "https://registry.npm.taobao.org/webpack/download/webpack-4.44.2.tgz?cache=0&sync_timestamp=1602853653332&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwebpack%2Fdownload%2Fwebpack-4.44.2.tgz#6bfe2b0af055c8b2d1e90ed2cd9363f841266b72" integrity sha1-a/4rCvBVyLLR6Q7SzZNj+EEma3I= From 6f4ad0d83830d1d8e3c454420e0ee5739793a7ac Mon Sep 17 00:00:00 2001 From: fushen Date: Mon, 2 Nov 2020 12:19:00 +0800 Subject: [PATCH 03/64] feat: lite mode --- examples/with-rax-lite/README.md | 3 +++ examples/with-rax-lite/build.json | 4 ++++ examples/with-rax-lite/package.json | 22 +++++++++++++++++++ examples/with-rax-lite/src/app.json | 15 +++++++++++++ examples/with-rax-lite/src/app.tsx | 6 +++++ examples/with-rax-lite/src/document/index.jsx | 22 +++++++++++++++++++ examples/with-rax-lite/tsconfig.json | 20 +++++++++++++++++ .../plugin-app-base/src/registerUserConfig.js | 7 +++++- .../plugin-app-core/src/generator/index.ts | 12 +++++++--- .../generator/templates/common/runApp.ts.ejs | 1 + packages/plugin-app-core/src/index.ts | 7 +++--- .../src/DocumentPlugin/index.js | 7 ------ packages/rax-app/src/index.ts | 7 ++++-- yarn.lock | 8 +++---- 14 files changed, 121 insertions(+), 20 deletions(-) create mode 100644 examples/with-rax-lite/README.md create mode 100644 examples/with-rax-lite/build.json create mode 100644 examples/with-rax-lite/package.json create mode 100644 examples/with-rax-lite/src/app.json create mode 100644 examples/with-rax-lite/src/app.tsx create mode 100644 examples/with-rax-lite/src/document/index.jsx create mode 100644 examples/with-rax-lite/tsconfig.json diff --git a/examples/with-rax-lite/README.md b/examples/with-rax-lite/README.md new file mode 100644 index 0000000000..98a3bb4ecc --- /dev/null +++ b/examples/with-rax-lite/README.md @@ -0,0 +1,3 @@ +# with rax + +https://github.com/ice-lab/icejs/tree/master/examples diff --git a/examples/with-rax-lite/build.json b/examples/with-rax-lite/build.json new file mode 100644 index 0000000000..79c80c6cf8 --- /dev/null +++ b/examples/with-rax-lite/build.json @@ -0,0 +1,4 @@ +{ + "targets": ["web"], + "inlineStyle": true +} diff --git a/examples/with-rax-lite/package.json b/examples/with-rax-lite/package.json new file mode 100644 index 0000000000..f8957f78b5 --- /dev/null +++ b/examples/with-rax-lite/package.json @@ -0,0 +1,22 @@ +{ + "name": "with-rax", + "description": "rax example", + "dependencies": { + "rax": "^1.1.0", + "rax-document": "^0.1.0", + "rax-image": "^2.0.0", + "rax-link": "^1.0.1", + "rax-text": "^1.0.0", + "rax-view": "^1.0.0" + }, + "devDependencies": { + "@types/rax": "^1.0.0" + }, + "scripts": { + "start": "rax-app start", + "build": "rax-app build" + }, + "engines": { + "node": ">=8.0.0" + } +} diff --git a/examples/with-rax-lite/src/app.json b/examples/with-rax-lite/src/app.json new file mode 100644 index 0000000000..a619508354 --- /dev/null +++ b/examples/with-rax-lite/src/app.json @@ -0,0 +1,15 @@ +{ + "routes": [ + { + "path": "/", + "source": "pages/Home/index" + }, + { + "path": "/about", + "source": "pages/About/index" + } + ], + "window": { + "title": "Rax App" + } +} diff --git a/examples/with-rax-lite/src/app.tsx b/examples/with-rax-lite/src/app.tsx new file mode 100644 index 0000000000..3b7a7f06da --- /dev/null +++ b/examples/with-rax-lite/src/app.tsx @@ -0,0 +1,6 @@ +import { createElement, render } from 'rax'; +import DriverUniversal from 'driver-universal'; + +render(
123
, document.body, { + driver: DriverUniversal +}); diff --git a/examples/with-rax-lite/src/document/index.jsx b/examples/with-rax-lite/src/document/index.jsx new file mode 100644 index 0000000000..9b3cc064ed --- /dev/null +++ b/examples/with-rax-lite/src/document/index.jsx @@ -0,0 +1,22 @@ +import { createElement } from 'rax'; +import { Root, Style, Script, Data } from 'rax-document'; + +function Document(props) { + return ( + + + + + @ali/demo-app +