From 99e00b31b9030fd83da84811f392fe241eec7fa2 Mon Sep 17 00:00:00 2001 From: ZakaryCode Date: Tue, 20 Jun 2023 15:56:56 +0800 Subject: [PATCH 01/14] =?UTF-8?q?fix(h5):=20=E7=A6=81=E7=94=A8=20needClear?= =?UTF-8?q?Output=20=E9=BB=98=E8=AE=A4=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-service/src/platform-plugin-base/web.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/taro-service/src/platform-plugin-base/web.ts b/packages/taro-service/src/platform-plugin-base/web.ts index 2c87618e4111..72d1f78f75f8 100644 --- a/packages/taro-service/src/platform-plugin-base/web.ts +++ b/packages/taro-service/src/platform-plugin-base/web.ts @@ -21,7 +21,7 @@ export abstract class TaroPlatformWeb extends TaroP private setupWebApp () { const { needClearOutput } = this.config - if (typeof needClearOutput === 'undefined' || !!needClearOutput) { + if (typeof needClearOutput === 'boolean' && needClearOutput) { this.emptyOutputDir() } this.printDevelopmentTip() From 867cf68ca971662061c40f6de7abfbeb73758185 Mon Sep 17 00:00:00 2001 From: bigMeow Date: Sun, 25 Jun 2023 18:31:28 +0800 Subject: [PATCH 02/14] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=20output.clean?= =?UTF-8?q?=20=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/presets/platforms/plugin.ts | 6 ++---- packages/taro-helper/src/utils.ts | 10 ++++++++-- .../taro-service/src/platform-plugin-base/mini.ts | 10 ++++++---- .../src/platform-plugin-base/platform.ts | 4 ++-- .../taro-service/src/platform-plugin-base/web.ts | 9 +++++---- packages/taro/types/compile/config/mini.d.ts | 15 ++++++++++++++- 6 files changed, 37 insertions(+), 17 deletions(-) diff --git a/packages/taro-cli/src/presets/platforms/plugin.ts b/packages/taro-cli/src/presets/platforms/plugin.ts index df0b07337965..baba4eb4a327 100644 --- a/packages/taro-cli/src/presets/platforms/plugin.ts +++ b/packages/taro-cli/src/presets/platforms/plugin.ts @@ -35,8 +35,7 @@ export default (ctx: IPluginContext) => { isBuildPlugin: true, isWatch, outputRoot: `${config.outputRoot}`, - platform, - needClearOutput: false + platform }, options: Object.assign({}, options, { platform @@ -52,8 +51,7 @@ export default (ctx: IPluginContext) => { isBuildPlugin: false, isWatch, outputRoot: `${config.outputRoot}/miniprogram`, - platform, - needClearOutput: false + platform }, options: Object.assign({}, options, { platform diff --git a/packages/taro-helper/src/utils.ts b/packages/taro-helper/src/utils.ts index 3bac016cbb28..5c39a2e5a22f 100644 --- a/packages/taro-helper/src/utils.ts +++ b/packages/taro-helper/src/utils.ts @@ -283,7 +283,7 @@ export function cssImports (content: string): string[] { /*eslint-disable*/ const retries = (process.platform === 'win32') ? 100 : 1 -export function emptyDirectory (dirPath: string, opts: { excludes: string[] } = { excludes: [] }) { +export function emptyDirectory (dirPath: string, opts: { excludes: Array | string | RegExp } = { excludes: [] }) { if (fs.existsSync(dirPath)) { fs.readdirSync(dirPath).forEach(file => { const curPath = path.join(dirPath, file) @@ -292,7 +292,13 @@ export function emptyDirectory (dirPath: string, opts: { excludes: string[] } = let i = 0 // retry counter do { try { - if (!opts.excludes.length || !opts.excludes.some(item => curPath.indexOf(item) >= 0)) { + const excludes = Array.isArray(opts.excludes) ? opts.excludes : [opts.excludes] + const canRemove = + !excludes.length || + !excludes.some((item) => + typeof item === 'string' ? curPath.indexOf(item) >= 0 : item.test(curPath) + ) + if (canRemove) { emptyDirectory(curPath) fs.rmdirSync(curPath) } diff --git a/packages/taro-service/src/platform-plugin-base/mini.ts b/packages/taro-service/src/platform-plugin-base/mini.ts index 69af104e920e..c003aaf2ed1d 100644 --- a/packages/taro-service/src/platform-plugin-base/mini.ts +++ b/packages/taro-service/src/platform-plugin-base/mini.ts @@ -1,5 +1,5 @@ import { recursiveMerge } from '@tarojs/helper' -import { PLATFORM_TYPE } from '@tarojs/shared' +import { isObject, PLATFORM_TYPE } from '@tarojs/shared' import { getPkgVersion } from '../utils/package' import TaroPlatform from './platform' @@ -35,9 +35,11 @@ export abstract class TaroPlatformBase extends Taro } private setupImpl () { - const { needClearOutput } = this.config - if (typeof needClearOutput === 'undefined' || !!needClearOutput) { - this.emptyOutputDir() + const { output } = this.config + // 仅 output.clear 为 false 时不清空输出目录 + // eslint-disable-next-line eqeqeq + if (output == undefined || output.clear == undefined || output.clear === true || isObject(output.clear)) { + this.emptyOutputDir(isObject(output.clear) ? output.clear.keep || [] : []) } this.printDevelopmentTip(this.platform) if (this.projectConfigJson) { diff --git a/packages/taro-service/src/platform-plugin-base/platform.ts b/packages/taro-service/src/platform-plugin-base/platform.ts index 31a858129102..bdd940e5252a 100644 --- a/packages/taro-service/src/platform-plugin-base/platform.ts +++ b/packages/taro-service/src/platform-plugin-base/platform.ts @@ -53,9 +53,9 @@ export default abstract class TaroPlatform { this.compiler = typeof _compiler === 'object' ? _compiler.type : _compiler } - protected emptyOutputDir () { + protected emptyOutputDir (excludes: Array = []) { const { outputPath } = this.ctx.paths - this.helper.emptyDirectory(outputPath) + this.helper.emptyDirectory(outputPath, { excludes }) } /** diff --git a/packages/taro-service/src/platform-plugin-base/web.ts b/packages/taro-service/src/platform-plugin-base/web.ts index 72d1f78f75f8..41494f413135 100644 --- a/packages/taro-service/src/platform-plugin-base/web.ts +++ b/packages/taro-service/src/platform-plugin-base/web.ts @@ -1,4 +1,4 @@ -import { PLATFORM_TYPE } from '@tarojs/shared' +import { isObject, PLATFORM_TYPE } from '@tarojs/shared' import { get, merge } from 'lodash' import * as path from 'path' @@ -20,9 +20,10 @@ export abstract class TaroPlatformWeb extends TaroP } private setupWebApp () { - const { needClearOutput } = this.config - if (typeof needClearOutput === 'boolean' && needClearOutput) { - this.emptyOutputDir() + const { output } = this.config + // eslint-disable-next-line eqeqeq + if (output == undefined || output.clear == undefined || output.clear === true || isObject(output.clear)) { + this.emptyOutputDir(isObject(output.clear) ? output.clear.keep || [] : []) } this.printDevelopmentTip() } diff --git a/packages/taro/types/compile/config/mini.d.ts b/packages/taro/types/compile/config/mini.d.ts index 8fb24a4c0c2f..0d1890d2f072 100644 --- a/packages/taro/types/compile/config/mini.d.ts +++ b/packages/taro/types/compile/config/mini.d.ts @@ -35,7 +35,20 @@ export interface IMiniAppConfig { webpackChain?: (chain: Chain, webpack: typeof Webpack, PARSE_AST_TYPE: any) => void /** 可用于修改、拓展 Webpack 的 [output](https://webpack.js.org/configuration/output/) 选项 */ - output?: Webpack.Configuration['output'] + output?: Webpack.Configuration['output'] & { + /** + * 编译前清空输出目录 + * @since Taro v3.6.9 + * @description + * - 默认清空输出目录,可设置 clean: false 不清空 + * - 可设置 clean: { keep: ['project.config.json'] } 保留指定文件 + * - 注意 clean.keep 不支持函数 + */ + clean?: boolean | { + /** 保留指定文件不删除 */ + keep?: Array | string | RegExp + } + } /** 配置 postcss 相关插件 */ postcss?: IPostcssOption From 6c3dc123b9c6faa8022cc92c415d2e52024f3676 Mon Sep 17 00:00:00 2001 From: bigMeow Date: Mon, 26 Jun 2023 10:58:47 +0800 Subject: [PATCH 03/14] =?UTF-8?q?feat(taro-cli):=20=E6=96=B0=E5=A2=9Eenv\m?= =?UTF-8?q?ode=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 --- .../src/__tests__/dotenv-parse.spec.ts | 97 +++++++++++++++++++ .../src/__tests__/dotenvParse.spec.ts | 13 --- .../src/__tests__/fixtures/default/.env | 3 + .../fixtures/default/.env.development | 1 + .../src/__tests__/fixtures/default/.env.local | 1 + .../src/__tests__/fixtures/default/.env.pre | 1 + .../fixtures/default/.env.production | 1 + .../src/__tests__/fixtures/default/.env.uat | 5 + .../__tests__/fixtures/default/.env.uat.local | 1 + 9 files changed, 110 insertions(+), 13 deletions(-) create mode 100644 packages/taro-cli/src/__tests__/dotenv-parse.spec.ts delete mode 100644 packages/taro-cli/src/__tests__/dotenvParse.spec.ts create mode 100644 packages/taro-cli/src/__tests__/fixtures/default/.env create mode 100644 packages/taro-cli/src/__tests__/fixtures/default/.env.development create mode 100644 packages/taro-cli/src/__tests__/fixtures/default/.env.local create mode 100644 packages/taro-cli/src/__tests__/fixtures/default/.env.pre create mode 100644 packages/taro-cli/src/__tests__/fixtures/default/.env.production create mode 100644 packages/taro-cli/src/__tests__/fixtures/default/.env.uat create mode 100644 packages/taro-cli/src/__tests__/fixtures/default/.env.uat.local diff --git a/packages/taro-cli/src/__tests__/dotenv-parse.spec.ts b/packages/taro-cli/src/__tests__/dotenv-parse.spec.ts new file mode 100644 index 000000000000..3a20f9dd3269 --- /dev/null +++ b/packages/taro-cli/src/__tests__/dotenv-parse.spec.ts @@ -0,0 +1,97 @@ +import { Kernel } from '@tarojs/service' +import * as path from 'path' + +import CLI from '../cli' +import { dotenvParse } from '../util/index' + +jest.mock('@tarojs/service') +const MockedKernel = Kernel as unknown as jest.Mock +const APP_PATH = path.join(__dirname, 'fixtures/default') + +function setProcessArgv (cmd: string) { + // @ts-ignore + process.argv = [null, ...cmd.split(' ')] +} + +describe('inspect', () => { + let cli: CLI + + beforeAll(() => { + cli = new CLI(APP_PATH) + }) + + beforeEach(() => { + MockedKernel.mockClear() + process.argv = [] + delete process.env.NODE_ENV + delete process.env.TARO_ENV + delete process.env.TARO_APP_TEST + delete process.env.TARO_APP_ID + delete process.env.JD_APP_TEST + delete process.env.TARO_APP_DEFAULT + }) + + afterEach(() => { + MockedKernel.mockClear() + process.argv = [] + delete process.env.NODE_ENV + delete process.env.TARO_ENV + delete process.env.TARO_APP_TEST + delete process.env.TARO_APP_ID + delete process.env.JD_APP_TEST + delete process.env.TARO_APP_DEFAULT + }) + + describe('cli mode env', () => { + + it('dotenvParse .env .env.dev should success', async () => { + expect(process.env.TARO_test).toBeUndefined() + dotenvParse(path.resolve(__dirname, 'env'), 'TARO_', 'dev') + expect(process.env.TARO_test).toBe('123') + expect(process.env._TARO_test).toBeUndefined() + }) + + it('--watch true => 默认加载 .env.development', async () => { + setProcessArgv('taro build --watch --type weapp') + await cli.run() + expect(process.env.TARO_APP_TEST).toEqual('env-development') + expect(process.env.TARO_APP_DEFAULT).toEqual('default') + }) + + it('--watch false => 默认加载 .env.production', async () => { + setProcessArgv('taro build --type weapp') + await cli.run() + expect(process.env.TARO_APP_TEST).toEqual('env-production') + expect(process.env.TARO_APP_DEFAULT).toEqual('default') + }) + + it('指定加载 .env.pre', async () => { + setProcessArgv('taro build --type weapp --mode pre') + await cli.run() + expect(process.env.TARO_APP_TEST).toEqual('env-pre') + expect(process.env.TARO_APP_DEFAULT).toEqual('default') + }) + + it('env.local 比 .env 优先级更高', async () => { + setProcessArgv('taro build --type weapp --mode find404') + await cli.run() + expect(process.env.TARO_APP_TEST).toEqual('env-local') + expect(process.env.TARO_APP_DEFAULT).toEqual('default') + }) + + it('env.uat.local 比 .env.uat 优先级更高', async () => { + setProcessArgv('taro build --type weapp --mode uat') + await cli.run() + expect(process.env.TARO_APP_TEST).toEqual('env-uat-local') + expect(process.env.TARO_APP_DEFAULT).toEqual('default') + }) + + it('自定义前缀: JD_APP_', async () => { + setProcessArgv('taro build --type weapp --mode uat --env-prefix JD_APP_') + await cli.run() + expect(process.env.JD_APP_TEST).toEqual('env-uat') + expect(process.env.TARO_APP_TEST).toEqual(undefined) + expect(process.env.TARO_APP_ID).toEqual('特殊变量appid') + }) + }) +}) diff --git a/packages/taro-cli/src/__tests__/dotenvParse.spec.ts b/packages/taro-cli/src/__tests__/dotenvParse.spec.ts deleted file mode 100644 index 7d9ecd8734c6..000000000000 --- a/packages/taro-cli/src/__tests__/dotenvParse.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { resolve } from 'path' - -import { dotenvParse } from '../util/index' - - -describe('dotenvParse', () => { - it('dotenvParse .env .env.dev should success', async () => { - expect(process.env.TARO_test).toBeUndefined() - dotenvParse(resolve(__dirname, 'env'), 'TARO_', 'dev') - expect(process.env.TARO_test).toBe('123') - expect(process.env._TARO_test).toBeUndefined() - }) -}) diff --git a/packages/taro-cli/src/__tests__/fixtures/default/.env b/packages/taro-cli/src/__tests__/fixtures/default/.env new file mode 100644 index 000000000000..76bb7901e115 --- /dev/null +++ b/packages/taro-cli/src/__tests__/fixtures/default/.env @@ -0,0 +1,3 @@ +TARO_APP_TEST=env + +TARO_APP_DEFAULT=default \ No newline at end of file diff --git a/packages/taro-cli/src/__tests__/fixtures/default/.env.development b/packages/taro-cli/src/__tests__/fixtures/default/.env.development new file mode 100644 index 000000000000..36bcd02cf475 --- /dev/null +++ b/packages/taro-cli/src/__tests__/fixtures/default/.env.development @@ -0,0 +1 @@ +TARO_APP_TEST=env-development \ No newline at end of file diff --git a/packages/taro-cli/src/__tests__/fixtures/default/.env.local b/packages/taro-cli/src/__tests__/fixtures/default/.env.local new file mode 100644 index 000000000000..2acb5bd7b177 --- /dev/null +++ b/packages/taro-cli/src/__tests__/fixtures/default/.env.local @@ -0,0 +1 @@ +TARO_APP_TEST=env-local \ No newline at end of file diff --git a/packages/taro-cli/src/__tests__/fixtures/default/.env.pre b/packages/taro-cli/src/__tests__/fixtures/default/.env.pre new file mode 100644 index 000000000000..c6a3e880fded --- /dev/null +++ b/packages/taro-cli/src/__tests__/fixtures/default/.env.pre @@ -0,0 +1 @@ +TARO_APP_TEST=env-pre \ No newline at end of file diff --git a/packages/taro-cli/src/__tests__/fixtures/default/.env.production b/packages/taro-cli/src/__tests__/fixtures/default/.env.production new file mode 100644 index 000000000000..499f0896e082 --- /dev/null +++ b/packages/taro-cli/src/__tests__/fixtures/default/.env.production @@ -0,0 +1 @@ +TARO_APP_TEST=env-production \ No newline at end of file diff --git a/packages/taro-cli/src/__tests__/fixtures/default/.env.uat b/packages/taro-cli/src/__tests__/fixtures/default/.env.uat new file mode 100644 index 000000000000..3ff2c5f45108 --- /dev/null +++ b/packages/taro-cli/src/__tests__/fixtures/default/.env.uat @@ -0,0 +1,5 @@ +TARO_APP_TEST=env-uat + +JD_APP_TEST=env-uat + +TARO_APP_ID=特殊变量appid \ No newline at end of file diff --git a/packages/taro-cli/src/__tests__/fixtures/default/.env.uat.local b/packages/taro-cli/src/__tests__/fixtures/default/.env.uat.local new file mode 100644 index 000000000000..e5819429e8d4 --- /dev/null +++ b/packages/taro-cli/src/__tests__/fixtures/default/.env.uat.local @@ -0,0 +1 @@ +TARO_APP_TEST=env-uat-local \ No newline at end of file From a4a982411da742ef6fad20da03542b6dac9946a2 Mon Sep 17 00:00:00 2001 From: bigMeow Date: Mon, 26 Jun 2023 13:10:18 +0800 Subject: [PATCH 04/14] =?UTF-8?q?fix:=20=E5=8F=AF=E8=83=BD=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=BC=82=E5=B8=B8=E7=9A=84=E6=9D=A1=E4=BB=B6=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-service/src/platform-plugin-base/mini.ts | 8 +++++--- packages/taro-service/src/platform-plugin-base/web.ts | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/taro-service/src/platform-plugin-base/mini.ts b/packages/taro-service/src/platform-plugin-base/mini.ts index c003aaf2ed1d..95946fe89fd6 100644 --- a/packages/taro-service/src/platform-plugin-base/mini.ts +++ b/packages/taro-service/src/platform-plugin-base/mini.ts @@ -15,7 +15,7 @@ interface IFileType { xs?: string } -export abstract class TaroPlatformBase extends TaroPlatform { +export abstract class TaroPlatformBase extends TaroPlatform { platformType = PLATFORM_TYPE.MINI abstract globalObject: string @@ -38,8 +38,10 @@ export abstract class TaroPlatformBase extends Taro const { output } = this.config // 仅 output.clear 为 false 时不清空输出目录 // eslint-disable-next-line eqeqeq - if (output == undefined || output.clear == undefined || output.clear === true || isObject(output.clear)) { - this.emptyOutputDir(isObject(output.clear) ? output.clear.keep || [] : []) + if (output == undefined || output.clear == undefined || output.clear === true) { + this.emptyOutputDir() + } else if (isObject(output.clear)) { + this.emptyOutputDir(output.clear.keep || []) } this.printDevelopmentTip(this.platform) if (this.projectConfigJson) { diff --git a/packages/taro-service/src/platform-plugin-base/web.ts b/packages/taro-service/src/platform-plugin-base/web.ts index 41494f413135..028b6913b9dd 100644 --- a/packages/taro-service/src/platform-plugin-base/web.ts +++ b/packages/taro-service/src/platform-plugin-base/web.ts @@ -21,9 +21,12 @@ export abstract class TaroPlatformWeb extends TaroP private setupWebApp () { const { output } = this.config + // H5 中 webpack5 原生支持 output.clear 选项,但是 webpack4 不支持, 为统一行为,这里做一下兼容 // eslint-disable-next-line eqeqeq - if (output == undefined || output.clear == undefined || output.clear === true || isObject(output.clear)) { - this.emptyOutputDir(isObject(output.clear) ? output.clear.keep || [] : []) + if (output == undefined || output.clear == undefined || output.clear === true) { + this.emptyOutputDir() + } else if (isObject(output.clear)) { + this.emptyOutputDir(output.clear.keep || []) } this.printDevelopmentTip() } From d8510d18f4e1ece409f7438af4dbe9e30388d974 Mon Sep 17 00:00:00 2001 From: bigMeow Date: Mon, 26 Jun 2023 16:49:22 +0800 Subject: [PATCH 05/14] chore(release): publish 3.6.9-alpha.6 --tag=alpha --- package.json | 2 +- .../package.json | 2 +- packages/babel-plugin-transform-taroapi/package.json | 2 +- packages/babel-preset-taro/package.json | 2 +- packages/create-app/package.json | 2 +- packages/css-to-react-native/package.json | 2 +- packages/eslint-config-taro/package.json | 2 +- packages/postcss-html-transform/package.json | 2 +- packages/postcss-plugin-constparse/package.json | 2 +- packages/postcss-pxtransform/package.json | 2 +- packages/shared/package.json | 2 +- packages/stylelint-config-taro-rn/package.json | 2 +- packages/stylelint-taro-rn/package.json | 2 +- packages/taro-alipay/package.json | 2 +- packages/taro-api/package.json | 2 +- packages/taro-cli-convertor/package.json | 2 +- packages/taro-cli/package.json | 2 +- packages/taro-components-advanced/package.json | 2 +- packages/taro-components-library-react/package.json | 2 +- packages/taro-components-library-vue2/package.json | 2 +- packages/taro-components-library-vue3/package.json | 2 +- packages/taro-components-react/package.json | 2 +- packages/taro-components-rn/package.json | 2 +- packages/taro-components/package.json | 2 +- packages/taro-extend/package.json | 2 +- packages/taro-h5/package.json | 2 +- packages/taro-helper/package.json | 2 +- packages/taro-jd/package.json | 2 +- packages/taro-loader/package.json | 2 +- packages/taro-mini-runner/package.json | 2 +- packages/taro-platform-h5/package.json | 2 +- packages/taro-plugin-html/package.json | 2 +- packages/taro-plugin-http/package.json | 2 +- packages/taro-plugin-inject/package.json | 2 +- packages/taro-plugin-mini-ci/package.json | 2 +- packages/taro-plugin-react-devtools/package.json | 2 +- packages/taro-plugin-react/package.json | 2 +- packages/taro-plugin-vue-devtools/package.json | 2 +- packages/taro-plugin-vue2/package.json | 2 +- packages/taro-plugin-vue3/package.json | 2 +- packages/taro-qq/package.json | 2 +- packages/taro-react/package.json | 2 +- packages/taro-rn-runner/package.json | 2 +- packages/taro-rn-style-transformer/package.json | 2 +- packages/taro-rn-supporter/package.json | 2 +- packages/taro-rn-transformer/package.json | 2 +- packages/taro-rn/package.json | 2 +- packages/taro-router-rn/package.json | 2 +- packages/taro-router/package.json | 2 +- packages/taro-runner-utils/package.json | 2 +- packages/taro-runtime-rn/package.json | 2 +- packages/taro-runtime/package.json | 2 +- packages/taro-service/package.json | 2 +- packages/taro-swan/package.json | 2 +- packages/taro-tt/package.json | 2 +- packages/taro-weapp/package.json | 2 +- packages/taro-webpack-runner/package.json | 2 +- packages/taro-webpack5-prebundle/package.json | 2 +- packages/taro-webpack5-runner/package.json | 2 +- packages/taro-with-weapp/package.json | 2 +- packages/taro/package.json | 2 +- packages/taroize/package.json | 2 +- 62 files changed, 62 insertions(+), 62 deletions(-) diff --git a/package.json b/package.json index 93e44429500f..544168a5d910 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "taro", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "开放式跨端跨框架开发解决方案", "homepage": "https://github.com/NervJS/taro#readme", "author": "O2Team", diff --git a/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json b/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json index 43de99556707..5395a2e0e136 100644 --- a/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json +++ b/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-react-jsx-to-rn-stylesheet", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Transform stylesheet selector to style in JSX Elements.", "license": "MIT", "main": "dist/index.js", diff --git a/packages/babel-plugin-transform-taroapi/package.json b/packages/babel-plugin-transform-taroapi/package.json index 7de7d5b9596e..91872cf4ee6b 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": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "main": "dist/index.js", "scripts": { "build": "tsc", diff --git a/packages/babel-preset-taro/package.json b/packages/babel-preset-taro/package.json index 70a3ece15965..66fdf67114b8 100644 --- a/packages/babel-preset-taro/package.json +++ b/packages/babel-preset-taro/package.json @@ -1,6 +1,6 @@ { "name": "babel-preset-taro", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro babel preset", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/babel-preset-taro#readme", diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 28453c370e95..ec41a872ccf5 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/create-app", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "create taro app with one command", "author": "VincentW ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/create-app#readme", diff --git a/packages/css-to-react-native/package.json b/packages/css-to-react-native/package.json index b5b6235dc749..d4298c889124 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": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "main": "dist/index.js", "license": "MIT", "files": [ diff --git a/packages/eslint-config-taro/package.json b/packages/eslint-config-taro/package.json index d386ac005697..8b18245b867a 100644 --- a/packages/eslint-config-taro/package.json +++ b/packages/eslint-config-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-taro", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro specific linting rules for ESLint", "main": "index.js", "files": [ diff --git a/packages/postcss-html-transform/package.json b/packages/postcss-html-transform/package.json index 8d93cf05b460..2a69d4e3fa0f 100644 --- a/packages/postcss-html-transform/package.json +++ b/packages/postcss-html-transform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-html-transform", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "transform html tag name selector", "main": "index.js", "author": "drchan", diff --git a/packages/postcss-plugin-constparse/package.json b/packages/postcss-plugin-constparse/package.json index ca2cb8c78606..ea2381c4e626 100644 --- a/packages/postcss-plugin-constparse/package.json +++ b/packages/postcss-plugin-constparse/package.json @@ -1,6 +1,6 @@ { "name": "postcss-plugin-constparse", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "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 867a0ecc22f6..2a2358dd0c73 100644 --- a/packages/postcss-pxtransform/package.json +++ b/packages/postcss-pxtransform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-pxtransform", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位", "main": "index.js", "keywords": [ diff --git a/packages/shared/package.json b/packages/shared/package.json index c42213176989..7ff9818fa702 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/shared", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro utils internal use.", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/shared#readme", diff --git a/packages/stylelint-config-taro-rn/package.json b/packages/stylelint-config-taro-rn/package.json index 3ba1428cb80c..fde3962aa890 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": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Shareable stylelint config for React Native CSS modules", "main": "index.js", "files": [ diff --git a/packages/stylelint-taro-rn/package.json b/packages/stylelint-taro-rn/package.json index c0ae677ad77d..eff302eb7a7e 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": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "main": "dist/index.js", "files": [ "dist", diff --git a/packages/taro-alipay/package.json b/packages/taro-alipay/package.json index 69e40f1a1e1b..eb29322e29cd 100644 --- a/packages/taro-alipay/package.json +++ b/packages/taro-alipay/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-alipay", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "支付宝小程序平台插件", "author": "Chen-jj", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-alipay#readme", diff --git a/packages/taro-api/package.json b/packages/taro-api/package.json index 9aab5499e163..4218917c3ac0 100644 --- a/packages/taro-api/package.json +++ b/packages/taro-api/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/api", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro common API", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/api#readme", diff --git a/packages/taro-cli-convertor/package.json b/packages/taro-cli-convertor/package.json index fdc87f100457..6ab3e6285d6f 100644 --- a/packages/taro-cli-convertor/package.json +++ b/packages/taro-cli-convertor/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/cli-convertor", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "cli tool for taro-convert", "main": "index.js", "scripts": { diff --git a/packages/taro-cli/package.json b/packages/taro-cli/package.json index 6fc5b1edfc76..7e3aac7862f9 100644 --- a/packages/taro-cli/package.json +++ b/packages/taro-cli/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/cli", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "cli tool for taro", "main": "index.js", "types": "dist/index.d.ts", diff --git a/packages/taro-components-advanced/package.json b/packages/taro-components-advanced/package.json index 14284755e0cf..89a6c076a032 100644 --- a/packages/taro-components-advanced/package.json +++ b/packages/taro-components-advanced/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-advanced", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/taro-components-library-react/package.json b/packages/taro-components-library-react/package.json index 3e84dc1b6de4..2c4bd7aaa325 100644 --- a/packages/taro-components-library-react/package.json +++ b/packages/taro-components-library-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-library-react", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro 组件库 React 版本库", "private": true, "main": "index.js", diff --git a/packages/taro-components-library-vue2/package.json b/packages/taro-components-library-vue2/package.json index c5c80657e6f4..c713c0eb5344 100644 --- a/packages/taro-components-library-vue2/package.json +++ b/packages/taro-components-library-vue2/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-library-vue2", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro 组件库 Vue2 版本库", "private": true, "main": "index.js", diff --git a/packages/taro-components-library-vue3/package.json b/packages/taro-components-library-vue3/package.json index e181a3952616..ddcc60055ead 100644 --- a/packages/taro-components-library-vue3/package.json +++ b/packages/taro-components-library-vue3/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-library-vue3", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro 组件库 Vue3 版本库", "private": true, "main": "index.js", diff --git a/packages/taro-components-react/package.json b/packages/taro-components-react/package.json index 913c2babb9bb..87d8feae9e75 100644 --- a/packages/taro-components-react/package.json +++ b/packages/taro-components-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-react", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "", "main:h5": "src/index.js", "main": "dist/index.js", diff --git a/packages/taro-components-rn/package.json b/packages/taro-components-rn/package.json index 894a84fe7167..9827dbf0a659 100644 --- a/packages/taro-components-rn/package.json +++ b/packages/taro-components-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-rn", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "多端解决方案基础组件(RN)", "main": "./dist/index.js", "scripts": { diff --git a/packages/taro-components/package.json b/packages/taro-components/package.json index 247507bd3705..27659c3b0a73 100644 --- a/packages/taro-components/package.json +++ b/packages/taro-components/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro 组件库", "browser": "dist/index.js", "main:h5": "dist/index.js", diff --git a/packages/taro-extend/package.json b/packages/taro-extend/package.json index bec879a962b1..98821019044f 100644 --- a/packages/taro-extend/package.json +++ b/packages/taro-extend/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/extend", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro extend functionality", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-extend#readme", diff --git a/packages/taro-h5/package.json b/packages/taro-h5/package.json index b8b945bc5d92..096403dcb3a9 100644 --- a/packages/taro-h5/package.json +++ b/packages/taro-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-h5", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro h5 framework", "browser": "dist/index.esm.js", "main:h5": "dist/index.js", diff --git a/packages/taro-helper/package.json b/packages/taro-helper/package.json index 4eddc12d5b6b..f0e8259303a7 100644 --- a/packages/taro-helper/package.json +++ b/packages/taro-helper/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/helper", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro Helper", "main": "index.js", "types": "dist/index.d.ts", diff --git a/packages/taro-jd/package.json b/packages/taro-jd/package.json index cff1c3df18fa..ef8cb2547616 100644 --- a/packages/taro-jd/package.json +++ b/packages/taro-jd/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-jd", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "京东小程序平台插件", "author": "Chen-jj", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-jd#readme", diff --git a/packages/taro-loader/package.json b/packages/taro-loader/package.json index a4cf7cc0b6b9..773f87e806a3 100644 --- a/packages/taro-loader/package.json +++ b/packages/taro-loader/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-loader", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro runner use webpack loader", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-loader#readme", diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index 198a6facbb51..1378d07da84d 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Mini app runner for taro", "main": "index.js", "scripts": { diff --git a/packages/taro-platform-h5/package.json b/packages/taro-platform-h5/package.json index f700487f576f..22da6d3a4fa1 100644 --- a/packages/taro-platform-h5/package.json +++ b/packages/taro-platform-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-h5", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Web 端平台插件", "author": "ZakaryCode", "license": "MIT", diff --git a/packages/taro-plugin-html/package.json b/packages/taro-plugin-html/package.json index 57da2f9fa7d0..9d722114ad22 100644 --- a/packages/taro-plugin-html/package.json +++ b/packages/taro-plugin-html/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-html", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro 小程序端支持使用 HTML 标签的插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-http/package.json b/packages/taro-plugin-http/package.json index 59899076b894..b798a1bac37f 100644 --- a/packages/taro-plugin-http/package.json +++ b/packages/taro-plugin-http/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-http", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro 小程序端支持使用 web 请求 的插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-inject/package.json b/packages/taro-plugin-inject/package.json index 4a9a291382c6..64e97d2b24b9 100644 --- a/packages/taro-plugin-inject/package.json +++ b/packages/taro-plugin-inject/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-inject", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro 小程序端平台中间层插件", "author": "luckyadam", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-plugin-mini-ci/package.json b/packages/taro-plugin-mini-ci/package.json index 21ac39cd7d5b..7d54546ec964 100644 --- a/packages/taro-plugin-mini-ci/package.json +++ b/packages/taro-plugin-mini-ci/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-mini-ci", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro 小程序端构建后支持CI(持续集成)的插件", "keywords": [ "Taro", diff --git a/packages/taro-plugin-react-devtools/package.json b/packages/taro-plugin-react-devtools/package.json index 220533f771c8..b9b09067ca25 100644 --- a/packages/taro-plugin-react-devtools/package.json +++ b/packages/taro-plugin-react-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-react-devtools", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro 小程序端支持使用 React DevTools 的插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-react/package.json b/packages/taro-plugin-react/package.json index 46e00ce65db0..cb8fd67e9c96 100644 --- a/packages/taro-plugin-react/package.json +++ b/packages/taro-plugin-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-framework-react", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "React/Preact/Nerv 框架插件", "author": "drchan", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-plugin-vue-devtools/package.json b/packages/taro-plugin-vue-devtools/package.json index 57d55ff1b78f..a706935cb8b0 100644 --- a/packages/taro-plugin-vue-devtools/package.json +++ b/packages/taro-plugin-vue-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-vue-devtools", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro 小程序端支持使用 Vue DevTools 的插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-vue2/package.json b/packages/taro-plugin-vue2/package.json index 99f805d07d5e..dac89d6593ad 100644 --- a/packages/taro-plugin-vue2/package.json +++ b/packages/taro-plugin-vue2/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-framework-vue2", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Vue2 框架插件", "author": "drchan", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-plugin-vue3/package.json b/packages/taro-plugin-vue3/package.json index 5ac614583516..49d5e4b8f0f2 100644 --- a/packages/taro-plugin-vue3/package.json +++ b/packages/taro-plugin-vue3/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-framework-vue3", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Vue3 框架插件", "author": "drchan", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-qq/package.json b/packages/taro-qq/package.json index b775da1a7b54..71b7959a6693 100644 --- a/packages/taro-qq/package.json +++ b/packages/taro-qq/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-qq", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "QQ 小程序平台插件", "author": "Chen-jj", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-qq#readme", diff --git a/packages/taro-react/package.json b/packages/taro-react/package.json index 6310fb63e7f2..4dafa11b075b 100644 --- a/packages/taro-react/package.json +++ b/packages/taro-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/react", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "like react-dom, but for mini apps.", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-react#readme", diff --git a/packages/taro-rn-runner/package.json b/packages/taro-rn-runner/package.json index 35006fbafdaf..7aefbf643a17 100644 --- a/packages/taro-rn-runner/package.json +++ b/packages/taro-rn-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-runner", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "ReactNative build tool for taro", "main": "index.js", "repository": { diff --git a/packages/taro-rn-style-transformer/package.json b/packages/taro-rn-style-transformer/package.json index 2b5fc198fd54..cdb7d987a5cf 100644 --- a/packages/taro-rn-style-transformer/package.json +++ b/packages/taro-rn-style-transformer/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-style-transformer", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "提供Taro RN 统一处理样式文件能力", "main": "dist/index.js", "scripts": { diff --git a/packages/taro-rn-supporter/package.json b/packages/taro-rn-supporter/package.json index 0073cdd15654..6ef012a694d6 100644 --- a/packages/taro-rn-supporter/package.json +++ b/packages/taro-rn-supporter/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-supporter", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro rn supporter", "main": "dist/index.js", "scripts": { diff --git a/packages/taro-rn-transformer/package.json b/packages/taro-rn-transformer/package.json index cd6a4aa15dec..270023279832 100644 --- a/packages/taro-rn-transformer/package.json +++ b/packages/taro-rn-transformer/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-transformer", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro RN 入口文件处理", "main": "dist/index.js", "types": "./src/types/index.d.ts", diff --git a/packages/taro-rn/package.json b/packages/taro-rn/package.json index 724a580c829d..ec812224e0e1 100644 --- a/packages/taro-rn/package.json +++ b/packages/taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-rn", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro RN framework", "main": "dist/index.js", "typings": "types/index.d.ts", diff --git a/packages/taro-router-rn/package.json b/packages/taro-router-rn/package.json index f67fea58a7a9..f36d3c65a8f6 100644 --- a/packages/taro-router-rn/package.json +++ b/packages/taro-router-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/router-rn", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro-router-rn", "main": "dist/index.js", "typings": "src/index.ts", diff --git a/packages/taro-router/package.json b/packages/taro-router/package.json index 0c536cdb0308..a9b84afd2b6f 100644 --- a/packages/taro-router/package.json +++ b/packages/taro-router/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/router", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro-router", "browser": "dist/index.esm.js", "main:h5": "dist/index.js", diff --git a/packages/taro-runner-utils/package.json b/packages/taro-runner-utils/package.json index de728336fe34..890b97c12679 100644 --- a/packages/taro-runner-utils/package.json +++ b/packages/taro-runner-utils/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/runner-utils", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro runner utilities.", "main": "dist/index.js", "types": "types/index.d.ts", diff --git a/packages/taro-runtime-rn/package.json b/packages/taro-runtime-rn/package.json index e9dab0e0e922..22f677a6e979 100644 --- a/packages/taro-runtime-rn/package.json +++ b/packages/taro-runtime-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/runtime-rn", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "taro-runtime-rn", "main": "dist/index.js", "types": "./src/index.ts", diff --git a/packages/taro-runtime/package.json b/packages/taro-runtime/package.json index be735163567a..2fe178c21e92 100644 --- a/packages/taro-runtime/package.json +++ b/packages/taro-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/runtime", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "taro runtime for mini apps.", "main": "dist/runtime.esm.js", "module": "dist/runtime.esm.js", diff --git a/packages/taro-service/package.json b/packages/taro-service/package.json index b65aa3660dd6..e76f75758477 100644 --- a/packages/taro-service/package.json +++ b/packages/taro-service/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/service", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro Service", "main": "index.js", "types": "types/index.d.ts", diff --git a/packages/taro-swan/package.json b/packages/taro-swan/package.json index cc3950549a30..958dbdc66372 100644 --- a/packages/taro-swan/package.json +++ b/packages/taro-swan/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-swan", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "百度小程序平台插件", "author": "Chen-jj", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-swan#readme", diff --git a/packages/taro-tt/package.json b/packages/taro-tt/package.json index f282f3ec147d..dab50423104b 100644 --- a/packages/taro-tt/package.json +++ b/packages/taro-tt/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-tt", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "头条小程序平台插件", "author": "Chen-jj", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-tt#readme", diff --git a/packages/taro-weapp/package.json b/packages/taro-weapp/package.json index 45b8e391b5c7..56fac9604328 100644 --- a/packages/taro-weapp/package.json +++ b/packages/taro-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-weapp", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "微信小程序平台插件", "author": "drchan", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-weapp#readme", diff --git a/packages/taro-webpack-runner/package.json b/packages/taro-webpack-runner/package.json index 5e5e43225483..d1406e8bad5f 100644 --- a/packages/taro-webpack-runner/package.json +++ b/packages/taro-webpack-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack-runner", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "webpack runner for taro", "main": "index.js", "scripts": { diff --git a/packages/taro-webpack5-prebundle/package.json b/packages/taro-webpack5-prebundle/package.json index 5884d5a51477..49f5a386c4f4 100644 --- a/packages/taro-webpack5-prebundle/package.json +++ b/packages/taro-webpack5-prebundle/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack5-prebundle", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro app webpack5 prebundle", "main": "dist/index.js", "scripts": { diff --git a/packages/taro-webpack5-runner/package.json b/packages/taro-webpack5-runner/package.json index b75c2349a1e5..34ea781e04c0 100644 --- a/packages/taro-webpack5-runner/package.json +++ b/packages/taro-webpack5-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack5-runner", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro app runner", "main": "index.js", "scripts": { diff --git a/packages/taro-with-weapp/package.json b/packages/taro-with-weapp/package.json index 9663a8c609aa..1b7555f8d6a8 100644 --- a/packages/taro-with-weapp/package.json +++ b/packages/taro-with-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/with-weapp", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "taroize 之后的运行时", "main": "index.js", "files": [ diff --git a/packages/taro/package.json b/packages/taro/package.json index 407fefa0659e..f6b722710018 100644 --- a/packages/taro/package.json +++ b/packages/taro/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "Taro framework", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme", "main": "index.js", diff --git a/packages/taroize/package.json b/packages/taroize/package.json index 7ef63f8fcf37..853232ac0943 100644 --- a/packages/taroize/package.json +++ b/packages/taroize/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taroize", - "version": "3.6.9-alpha.5", + "version": "3.6.9-alpha.6", "description": "转换原生微信小程序代码为 Taro 代码", "main": "index.js", "files": [ From 67d6c389b1e3eedd7576a98fdc32547a1be5dbe8 Mon Sep 17 00:00:00 2001 From: AzuFF <47267778+heiazu@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:20:32 +0800 Subject: [PATCH 06/14] =?UTF-8?q?feat:=20=E5=AF=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=A8=A1=E7=89=88=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=9A=84=E9=85=8D=E7=BD=AE=20(#14068)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 对默认模版增加测试工具的配置 --------- Co-authored-by: zhuminghui2 Co-authored-by: xuanzebin <38971117+xuanzebin@users.noreply.github.com> --- packages/taro-cli/src/create/creator.ts | 2 +- .../default/__tests__/index.test.js.tmpl | 12 + .../taro-cli/templates/default/jest.config.js | 6 + .../templates/default/package.json.tmpl | 11 +- pnpm-lock.yaml | 475 ++++++++---------- 5 files changed, 246 insertions(+), 260 deletions(-) create mode 100644 packages/taro-cli/templates/default/__tests__/index.test.js.tmpl create mode 100644 packages/taro-cli/templates/default/jest.config.js diff --git a/packages/taro-cli/src/create/creator.ts b/packages/taro-cli/src/create/creator.ts index 7117b8b2da36..74e783b77cee 100644 --- a/packages/taro-cli/src/create/creator.ts +++ b/packages/taro-cli/src/create/creator.ts @@ -95,7 +95,7 @@ export default class Creator { if (!path.isAbsolute(filepath)) { filepath = path.join(this.destinationRoot(), filepath) } - if (filepath.endsWith('package.json.tmpl')) { + if (filepath.endsWith('.tmpl')) { filepath = filepath.replace('.tmpl', '') } const basename = path.basename(filepath) diff --git a/packages/taro-cli/templates/default/__tests__/index.test.js.tmpl b/packages/taro-cli/templates/default/__tests__/index.test.js.tmpl new file mode 100644 index 000000000000..acae28822e64 --- /dev/null +++ b/packages/taro-cli/templates/default/__tests__/index.test.js.tmpl @@ -0,0 +1,12 @@ +<% if (['react', 'preact'].includes(framework)) {%>import TestUtils from '@tarojs/test-utils-react'<%}%><% if (framework === 'vue3') {%>import TestUtils from '@tarojs/test-utils-vue3'<%}%><% if (framework === 'vue') {%>import TestUtils from '@tarojs/test-utils-vue'<%}%> + +describe('Testing', () => { + + test('Test', async () => { + const testUtils = new TestUtils() + await testUtils.createApp() + await testUtils.PageLifecycle.onShow('pages/index/index') + expect(testUtils.html()).toMatchSnapshot() + }) + +}) diff --git a/packages/taro-cli/templates/default/jest.config.js b/packages/taro-cli/templates/default/jest.config.js new file mode 100644 index 000000000000..6bb1aa783465 --- /dev/null +++ b/packages/taro-cli/templates/default/jest.config.js @@ -0,0 +1,6 @@ +<% if (['react', 'preact'].includes(framework)) {%>const defineJestConfig = require('@tarojs/test-utils-react/dist/jest.js').default<%}%><% if (framework === 'vue3') {%>const defineJestConfig = require('@tarojs/test-utils-vue3/dist/jest.js').default<%}%><% if (framework === 'vue') {%>const defineJestConfig = require('@tarojs/test-utils-vue/dist/jest.js').default<%}%> + +module.exports = defineJestConfig({ + testEnvironment: 'jsdom', + testMatch: ['/__tests__/?(*.)+(spec|test).[jt]s?(x)'] +}) diff --git a/packages/taro-cli/templates/default/package.json.tmpl b/packages/taro-cli/templates/default/package.json.tmpl index f24600b32658..f979fa2bfbaa 100644 --- a/packages/taro-cli/templates/default/package.json.tmpl +++ b/packages/taro-cli/templates/default/package.json.tmpl @@ -26,7 +26,8 @@ "dev:rn": "npm run build:rn -- --watch", "dev:qq": "npm run build:qq -- --watch", "dev:jd": "npm run build:jd -- --watch", - "dev:quickapp": "npm run build:quickapp -- --watch" + "dev:quickapp": "npm run build:quickapp -- --watch", + "test": "jest" }, "browserslist": [ "last 3 versions", @@ -63,6 +64,7 @@ "@babel/core": "^7.8.0", "@tarojs/cli": "<%= version %>", "@types/webpack-env": "^1.13.6",<% if (['react', 'preact'].includes(framework)) {%> + "@tarojs/test-utils-react": "^0.1.1", "@types/react": "^18.0.0",<%}%><% if (compiler === 'webpack4') {%> "@tarojs/mini-runner": "<%= version %>", "@tarojs/webpack-runner": "<%= version %>", @@ -73,9 +75,11 @@ "babel-preset-taro": "<%= version %>",<% if (['vue', 'vue3'].includes(framework)) {%> "css-loader": "3.4.2", "style-loader": "1.3.0",<%}%><% if (framework === 'vue') {%> + "@tarojs/test-utils-vue": "^0.1.1", "@vue/babel-preset-jsx": "^1.2.4", "vue-loader": "^15.9.2", "eslint-plugin-vue": "^8.x",<%}%><% if (framework === 'vue3') {%> + "@tarojs/test-utils-vue3": "^0.1.1", "@vue/babel-plugin-jsx": "^1.0.6", "@vue/compiler-sfc": "^3.0.0", "vue-loader": "^17.0.0", @@ -97,6 +101,9 @@ "tsconfig-paths-webpack-plugin": "^4.0.1"<%}%>, "postcss": "^8.4.18", "ts-node": "^10.9.1", - "@types/node": "^18.15.11" + "@types/node": "^18.15.11", + "@types/jest": "^29.3.1", + "jest": "^29.3.1", + "jest-environment-jsdom": "^29.5.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7f7b9a3743b0..be3c3fdb6c42 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -566,7 +566,7 @@ importers: xml2js: ^0.5.0 dependencies: '@tarojs/helper': link:../taro-helper - '@tarojs/plugin-doctor': registry.npmjs.org/@tarojs/plugin-doctor/0.0.10 + '@tarojs/plugin-doctor': 0.0.10 '@tarojs/service': link:../taro-service '@tarojs/shared': link:../shared adm-zip: registry.npmjs.org/adm-zip/0.4.16 @@ -940,9 +940,6 @@ importers: react-native-svg: registry.npmjs.org/react-native-svg/13.7.0_hitw53fjdtts735uumzgadsnzq react-test-renderer: registry.npmjs.org/react-test-renderer/18.1.0_react@18.1.0 - packages/taro-components/loader: - specifiers: {} - packages/taro-extend: specifiers: jest: ^29.3.1 @@ -2518,6 +2515,223 @@ importers: packages: + /@tarojs/api/3.6.7: + resolution: {integrity: sha512-pSvvYbCWELz0k00OJwNQqMUrjWpzTZF4gPat2N8pNcTR4hLx5RERwLpEzZbjuh4f5F1+1dwQ2kO6XZ81EgA8Ew==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/@tarojs/api/-/api-3.6.7.tgz} + dependencies: + '@babel/runtime': registry.npmjs.org/@babel/runtime/7.21.5 + '@tarojs/runtime': 3.6.7 + '@tarojs/shared': 3.6.7 + dev: false + + /@tarojs/helper/3.6.7: + resolution: {integrity: sha512-6NkeufZQSUWeIflF4e17FSudKkNjTJVcSMVeaDE8dhA7YxnSy8P5Qj/KjkyOGMh0u/Zhl6AMPIpnbamdk8FHEQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/@tarojs/helper/-/helper-3.6.7.tgz} + dependencies: + '@babel/core': registry.npmjs.org/@babel/core/7.21.8 + '@babel/parser': registry.npmjs.org/@babel/parser/7.21.8 + '@babel/plugin-proposal-decorators': registry.npmjs.org/@babel/plugin-proposal-decorators/7.21.0_@babel+core@7.21.8 + '@babel/plugin-proposal-object-rest-spread': registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/7.20.7_@babel+core@7.21.8 + '@babel/plugin-transform-runtime': registry.npmjs.org/@babel/plugin-transform-runtime/7.21.4_@babel+core@7.21.8 + '@babel/preset-env': registry.npmjs.org/@babel/preset-env/7.21.5_@babel+core@7.21.8 + '@babel/preset-typescript': registry.npmjs.org/@babel/preset-typescript/7.21.5_@babel+core@7.21.8 + '@babel/register': registry.npmjs.org/@babel/register/7.21.0_@babel+core@7.21.8 + '@babel/runtime': registry.npmjs.org/@babel/runtime/7.21.5 + '@babel/traverse': registry.npmjs.org/@babel/traverse/7.21.5 + '@swc/core': registry.npmjs.org/@swc/core/1.3.23 + '@swc/register': registry.npmjs.org/@swc/register/0.1.10_@swc+core@1.3.23 + ansi-escapes: registry.npmjs.org/ansi-escapes/4.3.2 + chalk: registry.npmjs.org/chalk/3.0.0 + chokidar: registry.npmjs.org/chokidar/3.5.3 + cross-spawn: registry.npmjs.org/cross-spawn/7.0.3 + debug: registry.npmjs.org/debug/4.3.4 + esbuild: registry.npmjs.org/esbuild/0.14.54 + find-yarn-workspace-root: registry.npmjs.org/find-yarn-workspace-root/2.0.0 + fs-extra: registry.npmjs.org/fs-extra/8.1.0 + lodash: registry.npmjs.org/lodash/4.17.21 + require-from-string: registry.npmjs.org/require-from-string/2.0.2 + resolve: registry.npmjs.org/resolve/1.22.2 + supports-hyperlinks: registry.npmjs.org/supports-hyperlinks/2.3.0 + yauzl: registry.npmjs.org/yauzl/2.10.0 + transitivePeerDependencies: + - supports-color + dev: false + + /@tarojs/plugin-doctor-darwin-arm64/0.0.10: + resolution: {integrity: sha512-kEInQk4L4R1RqPiGrE4oQInf247pRq/cmi8X3ciKRTSiIQV78s5ACXFhxCdtTKvXcUKnZA3tUQjkyQtbwlo16A==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@tarojs/plugin-doctor-darwin-universal/0.0.10: + resolution: {integrity: sha512-1SPez0E/3OGnravV9GgZGI4BTSro4sVf7hJvTxjavStpQ0eiNJA3LZcFYtfuwrc3mrNEpDsZycpA8kZmDjatig==} + engines: {node: '>= 10'} + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@tarojs/plugin-doctor-darwin-x64/0.0.10: + resolution: {integrity: sha512-PFXHSCrwcI7c8/kRdSW4o3IK3pw3nrTGs3D69LLdG8a0s7+KbsTAwxnG0KyTXtNzzAZ4g52jNKC81iv9wbTTpA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@tarojs/plugin-doctor-freebsd-x64/0.0.10: + resolution: {integrity: sha512-Zqo30nxMnhQU7n09hsD/I/3Th4w6NAkqLC+TI1ZDbn7gMDCgGkUyE2/ymYveImKYhNE8wQKCpxN6zV1+3JLBnA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: false + optional: true + + /@tarojs/plugin-doctor-linux-arm-gnueabihf/0.0.10: + resolution: {integrity: sha512-KvZD6TEYxquA9+AyUKWd4O9wS38NzSJgId2hteT7rcdh5XCe2dy66bQgtOq0iCiIOV2LxKHN/JbuhoZf6XThJw==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@tarojs/plugin-doctor-linux-arm64-gnu/0.0.10: + resolution: {integrity: sha512-hSb4zxrgPmXW643ZiDiFXRkARvfOKO91+2rCGT1IwTqGfUdgxzo8NTepkj08WSQv0HizyD7XYKsToM1WmqTrdA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@tarojs/plugin-doctor-linux-arm64-musl/0.0.10: + resolution: {integrity: sha512-pwAvOK6g+3HpXnlI20M3U9466raduAs1gXo107xbRTODPB9xtfit/4oYOE+DScboPAZoI267Idw18u/W75XDdw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@tarojs/plugin-doctor-linux-x64-gnu/0.0.10: + resolution: {integrity: sha512-ISnIhgdo4ayfCzKpW4skdtyOUQvROvHLSh44I8DYmt2vcfx3w2eoi8PJICgIqeFNnkJZ4QwBPLjNfGSXMUfCOA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@tarojs/plugin-doctor-linux-x64-musl/0.0.10: + resolution: {integrity: sha512-IDj69YAjKzSap934MBWDcPm8EmC6apVAEVcmSlzHmbXvuJ0irUqsnlT3DFv7cNidluo1TPlL1N8NaStM9moCUA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@tarojs/plugin-doctor-win32-ia32-msvc/0.0.10: + resolution: {integrity: sha512-wTSsl+wFWnHSiDLW0pNv+TzLZMFKcf6w00gDgsO9Wus4z9Zxmgz9isOYQOT3hSn94XeLUej6QXMllaTM5bpHPw==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@tarojs/plugin-doctor-win32-x64-msvc/0.0.10: + resolution: {integrity: sha512-xPHimUsTFNgot4m4zN6iE2UKbn7GlKrJP0XYXrANRnbXlcQQ8a6kcO9oNo341EF4djsEBjQ0CbDEtDbNvfLKVA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@tarojs/plugin-doctor/0.0.10: + resolution: {integrity: sha512-ov8CRb2w92KDSJRM5IhJILeC5/D/m4QMEt8ZVfm9SrMgoLrvK8klwgGNOiKz0JLPy4vCNtU/oNRxleEYGQrlZg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/@tarojs/plugin-doctor/-/plugin-doctor-0.0.10.tgz} + engines: {node: '>= 10'} + dependencies: + '@tarojs/service': 3.6.7 + eslint: registry.npmjs.org/eslint/8.41.0 + glob: registry.npmjs.org/glob/10.2.6 + optionalDependencies: + '@tarojs/plugin-doctor-darwin-arm64': 0.0.10 + '@tarojs/plugin-doctor-darwin-universal': 0.0.10 + '@tarojs/plugin-doctor-darwin-x64': 0.0.10 + '@tarojs/plugin-doctor-freebsd-x64': 0.0.10 + '@tarojs/plugin-doctor-linux-arm-gnueabihf': 0.0.10 + '@tarojs/plugin-doctor-linux-arm64-gnu': 0.0.10 + '@tarojs/plugin-doctor-linux-arm64-musl': 0.0.10 + '@tarojs/plugin-doctor-linux-x64-gnu': 0.0.10 + '@tarojs/plugin-doctor-linux-x64-musl': 0.0.10 + '@tarojs/plugin-doctor-win32-ia32-msvc': 0.0.10 + '@tarojs/plugin-doctor-win32-x64-msvc': 0.0.10 + transitivePeerDependencies: + - '@types/react' + - '@types/webpack' + - '@types/webpack-dev-server' + - supports-color + - vue + dev: false + + /@tarojs/runtime/3.6.7: + resolution: {integrity: sha512-RBb7jIDVg9yNS8AQlNr9IBNad1L7GgOSrI09h6Dd3n94gGUZjuXx2ILwS9cR8Jb6FNAzf0o9GbdSQD4WXokPbg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/@tarojs/runtime/-/runtime-3.6.7.tgz} + dependencies: + '@tarojs/shared': 3.6.7 + lodash-es: registry.npmjs.org/lodash-es/4.17.21 + dev: false + + /@tarojs/service/3.6.7: + resolution: {integrity: sha512-UMdhW91Hrwj4X+ixLIar1UdncGrsV552ITe3zuDnXlKtqzpVmSjaIiSiRcOcsAzntrbR3XhYElvnKFkC49Pa3A==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/@tarojs/service/-/service-3.6.7.tgz} + dependencies: + '@tarojs/helper': 3.6.7 + '@tarojs/shared': 3.6.7 + '@tarojs/taro': 3.6.7 + joi: registry.npmjs.org/joi/17.9.2 + lodash: registry.npmjs.org/lodash/4.17.21 + ora: registry.npmjs.org/ora/5.4.1 + resolve: registry.npmjs.org/resolve/1.22.2 + tapable: registry.npmjs.org/tapable/1.1.3 + webpack-merge: registry.npmjs.org/webpack-merge/4.2.2 + transitivePeerDependencies: + - '@types/react' + - '@types/webpack' + - '@types/webpack-dev-server' + - supports-color + - vue + dev: false + + /@tarojs/shared/3.6.7: + resolution: {integrity: sha512-KOgj1TA+FyFy1ap0gZrB6ilC4H764ivSMyfr8mvlYgygevssticmaKTzkhZsNXRQFOQ+jjZ59cLh0F7VBVhlxg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/@tarojs/shared/-/shared-3.6.7.tgz} + dev: false + + /@tarojs/taro/3.6.7: + resolution: {integrity: sha512-j1PPgAKEtdhGXliQGbFaqC7wtyezpqmEEakWEtD83Xdpr4riNePO7xgv9irYNP0cpkjVt3/hLeSddc54X1zh6w==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/@tarojs/taro/-/taro-3.6.7.tgz} + peerDependencies: + '@types/react': '*' + '@types/webpack': '*' + '@types/webpack-dev-server': '*' + vue: '*' + peerDependenciesMeta: + '@types/react': + optional: true + '@types/webpack': + optional: true + '@types/webpack-dev-server': + optional: true + vue: + optional: true + dependencies: + '@tarojs/api': 3.6.7 + '@tarojs/runtime': 3.6.7 + dev: false + /@tarojs/transformer-wx/2.2.10: resolution: {integrity: sha512-17VF0f/+TILniFQHl+OK7PXt+QgH+evPijJPFkJgpgRUn0S2QKK89g27S6kG8s3GYCgY3XbJRY9w17yAkf9pZA==} dependencies: @@ -9763,259 +9977,6 @@ packages: defer-to-connect: registry.npmjs.org/defer-to-connect/1.1.3 dev: false - registry.npmjs.org/@tarojs/api/3.6.7: - resolution: {integrity: sha512-pSvvYbCWELz0k00OJwNQqMUrjWpzTZF4gPat2N8pNcTR4hLx5RERwLpEzZbjuh4f5F1+1dwQ2kO6XZ81EgA8Ew==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/api/-/api-3.6.7.tgz} - name: '@tarojs/api' - version: 3.6.7 - dependencies: - '@babel/runtime': registry.npmjs.org/@babel/runtime/7.21.5 - '@tarojs/runtime': registry.npmjs.org/@tarojs/runtime/3.6.7 - '@tarojs/shared': registry.npmjs.org/@tarojs/shared/3.6.7 - dev: false - - registry.npmjs.org/@tarojs/helper/3.6.7: - resolution: {integrity: sha512-6NkeufZQSUWeIflF4e17FSudKkNjTJVcSMVeaDE8dhA7YxnSy8P5Qj/KjkyOGMh0u/Zhl6AMPIpnbamdk8FHEQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/helper/-/helper-3.6.7.tgz} - name: '@tarojs/helper' - version: 3.6.7 - dependencies: - '@babel/core': registry.npmjs.org/@babel/core/7.21.8 - '@babel/parser': registry.npmjs.org/@babel/parser/7.21.8 - '@babel/plugin-proposal-decorators': registry.npmjs.org/@babel/plugin-proposal-decorators/7.21.0_@babel+core@7.21.8 - '@babel/plugin-proposal-object-rest-spread': registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/7.20.7_@babel+core@7.21.8 - '@babel/plugin-transform-runtime': registry.npmjs.org/@babel/plugin-transform-runtime/7.21.4_@babel+core@7.21.8 - '@babel/preset-env': registry.npmjs.org/@babel/preset-env/7.21.5_@babel+core@7.21.8 - '@babel/preset-typescript': registry.npmjs.org/@babel/preset-typescript/7.21.5_@babel+core@7.21.8 - '@babel/register': registry.npmjs.org/@babel/register/7.21.0_@babel+core@7.21.8 - '@babel/runtime': registry.npmjs.org/@babel/runtime/7.21.5 - '@babel/traverse': registry.npmjs.org/@babel/traverse/7.21.5 - '@swc/core': registry.npmjs.org/@swc/core/1.3.23 - '@swc/register': registry.npmjs.org/@swc/register/0.1.10_@swc+core@1.3.23 - ansi-escapes: registry.npmjs.org/ansi-escapes/4.3.2 - chalk: registry.npmjs.org/chalk/3.0.0 - chokidar: registry.npmjs.org/chokidar/3.5.3 - cross-spawn: registry.npmjs.org/cross-spawn/7.0.3 - debug: registry.npmjs.org/debug/4.3.4 - esbuild: registry.npmjs.org/esbuild/0.14.54 - find-yarn-workspace-root: registry.npmjs.org/find-yarn-workspace-root/2.0.0 - fs-extra: registry.npmjs.org/fs-extra/8.1.0 - lodash: registry.npmjs.org/lodash/4.17.21 - require-from-string: registry.npmjs.org/require-from-string/2.0.2 - resolve: registry.npmjs.org/resolve/1.22.2 - supports-hyperlinks: registry.npmjs.org/supports-hyperlinks/2.3.0 - yauzl: registry.npmjs.org/yauzl/2.10.0 - transitivePeerDependencies: - - supports-color - dev: false - - registry.npmjs.org/@tarojs/plugin-doctor-darwin-arm64/0.0.10: - resolution: {integrity: sha512-kEInQk4L4R1RqPiGrE4oQInf247pRq/cmi8X3ciKRTSiIQV78s5ACXFhxCdtTKvXcUKnZA3tUQjkyQtbwlo16A==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor-darwin-arm64/-/plugin-doctor-darwin-arm64-0.0.10.tgz} - name: '@tarojs/plugin-doctor-darwin-arm64' - version: 0.0.10 - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - registry.npmjs.org/@tarojs/plugin-doctor-darwin-universal/0.0.10: - resolution: {integrity: sha512-1SPez0E/3OGnravV9GgZGI4BTSro4sVf7hJvTxjavStpQ0eiNJA3LZcFYtfuwrc3mrNEpDsZycpA8kZmDjatig==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor-darwin-universal/-/plugin-doctor-darwin-universal-0.0.10.tgz} - name: '@tarojs/plugin-doctor-darwin-universal' - version: 0.0.10 - engines: {node: '>= 10'} - os: [darwin] - requiresBuild: true - dev: false - optional: true - - registry.npmjs.org/@tarojs/plugin-doctor-darwin-x64/0.0.10: - resolution: {integrity: sha512-PFXHSCrwcI7c8/kRdSW4o3IK3pw3nrTGs3D69LLdG8a0s7+KbsTAwxnG0KyTXtNzzAZ4g52jNKC81iv9wbTTpA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor-darwin-x64/-/plugin-doctor-darwin-x64-0.0.10.tgz} - name: '@tarojs/plugin-doctor-darwin-x64' - version: 0.0.10 - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - registry.npmjs.org/@tarojs/plugin-doctor-freebsd-x64/0.0.10: - resolution: {integrity: sha512-Zqo30nxMnhQU7n09hsD/I/3Th4w6NAkqLC+TI1ZDbn7gMDCgGkUyE2/ymYveImKYhNE8wQKCpxN6zV1+3JLBnA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor-freebsd-x64/-/plugin-doctor-freebsd-x64-0.0.10.tgz} - name: '@tarojs/plugin-doctor-freebsd-x64' - version: 0.0.10 - engines: {node: '>= 10'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: false - optional: true - - registry.npmjs.org/@tarojs/plugin-doctor-linux-arm-gnueabihf/0.0.10: - resolution: {integrity: sha512-KvZD6TEYxquA9+AyUKWd4O9wS38NzSJgId2hteT7rcdh5XCe2dy66bQgtOq0iCiIOV2LxKHN/JbuhoZf6XThJw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor-linux-arm-gnueabihf/-/plugin-doctor-linux-arm-gnueabihf-0.0.10.tgz} - name: '@tarojs/plugin-doctor-linux-arm-gnueabihf' - version: 0.0.10 - engines: {node: '>= 10'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: false - optional: true - - registry.npmjs.org/@tarojs/plugin-doctor-linux-arm64-gnu/0.0.10: - resolution: {integrity: sha512-hSb4zxrgPmXW643ZiDiFXRkARvfOKO91+2rCGT1IwTqGfUdgxzo8NTepkj08WSQv0HizyD7XYKsToM1WmqTrdA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor-linux-arm64-gnu/-/plugin-doctor-linux-arm64-gnu-0.0.10.tgz} - name: '@tarojs/plugin-doctor-linux-arm64-gnu' - version: 0.0.10 - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - registry.npmjs.org/@tarojs/plugin-doctor-linux-arm64-musl/0.0.10: - resolution: {integrity: sha512-pwAvOK6g+3HpXnlI20M3U9466raduAs1gXo107xbRTODPB9xtfit/4oYOE+DScboPAZoI267Idw18u/W75XDdw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor-linux-arm64-musl/-/plugin-doctor-linux-arm64-musl-0.0.10.tgz} - name: '@tarojs/plugin-doctor-linux-arm64-musl' - version: 0.0.10 - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - registry.npmjs.org/@tarojs/plugin-doctor-linux-x64-gnu/0.0.10: - resolution: {integrity: sha512-ISnIhgdo4ayfCzKpW4skdtyOUQvROvHLSh44I8DYmt2vcfx3w2eoi8PJICgIqeFNnkJZ4QwBPLjNfGSXMUfCOA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor-linux-x64-gnu/-/plugin-doctor-linux-x64-gnu-0.0.10.tgz} - name: '@tarojs/plugin-doctor-linux-x64-gnu' - version: 0.0.10 - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - registry.npmjs.org/@tarojs/plugin-doctor-linux-x64-musl/0.0.10: - resolution: {integrity: sha512-IDj69YAjKzSap934MBWDcPm8EmC6apVAEVcmSlzHmbXvuJ0irUqsnlT3DFv7cNidluo1TPlL1N8NaStM9moCUA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor-linux-x64-musl/-/plugin-doctor-linux-x64-musl-0.0.10.tgz} - name: '@tarojs/plugin-doctor-linux-x64-musl' - version: 0.0.10 - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - registry.npmjs.org/@tarojs/plugin-doctor-win32-ia32-msvc/0.0.10: - resolution: {integrity: sha512-wTSsl+wFWnHSiDLW0pNv+TzLZMFKcf6w00gDgsO9Wus4z9Zxmgz9isOYQOT3hSn94XeLUej6QXMllaTM5bpHPw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor-win32-ia32-msvc/-/plugin-doctor-win32-ia32-msvc-0.0.10.tgz} - name: '@tarojs/plugin-doctor-win32-ia32-msvc' - version: 0.0.10 - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: false - optional: true - - registry.npmjs.org/@tarojs/plugin-doctor-win32-x64-msvc/0.0.10: - resolution: {integrity: sha512-xPHimUsTFNgot4m4zN6iE2UKbn7GlKrJP0XYXrANRnbXlcQQ8a6kcO9oNo341EF4djsEBjQ0CbDEtDbNvfLKVA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor-win32-x64-msvc/-/plugin-doctor-win32-x64-msvc-0.0.10.tgz} - name: '@tarojs/plugin-doctor-win32-x64-msvc' - version: 0.0.10 - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: false - optional: true - - registry.npmjs.org/@tarojs/plugin-doctor/0.0.10: - resolution: {integrity: sha512-ov8CRb2w92KDSJRM5IhJILeC5/D/m4QMEt8ZVfm9SrMgoLrvK8klwgGNOiKz0JLPy4vCNtU/oNRxleEYGQrlZg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/plugin-doctor/-/plugin-doctor-0.0.10.tgz} - name: '@tarojs/plugin-doctor' - version: 0.0.10 - engines: {node: '>= 10'} - dependencies: - '@tarojs/service': registry.npmjs.org/@tarojs/service/3.6.7 - eslint: registry.npmjs.org/eslint/8.41.0 - glob: registry.npmjs.org/glob/10.2.6 - optionalDependencies: - '@tarojs/plugin-doctor-darwin-arm64': registry.npmjs.org/@tarojs/plugin-doctor-darwin-arm64/0.0.10 - '@tarojs/plugin-doctor-darwin-universal': registry.npmjs.org/@tarojs/plugin-doctor-darwin-universal/0.0.10 - '@tarojs/plugin-doctor-darwin-x64': registry.npmjs.org/@tarojs/plugin-doctor-darwin-x64/0.0.10 - '@tarojs/plugin-doctor-freebsd-x64': registry.npmjs.org/@tarojs/plugin-doctor-freebsd-x64/0.0.10 - '@tarojs/plugin-doctor-linux-arm-gnueabihf': registry.npmjs.org/@tarojs/plugin-doctor-linux-arm-gnueabihf/0.0.10 - '@tarojs/plugin-doctor-linux-arm64-gnu': registry.npmjs.org/@tarojs/plugin-doctor-linux-arm64-gnu/0.0.10 - '@tarojs/plugin-doctor-linux-arm64-musl': registry.npmjs.org/@tarojs/plugin-doctor-linux-arm64-musl/0.0.10 - '@tarojs/plugin-doctor-linux-x64-gnu': registry.npmjs.org/@tarojs/plugin-doctor-linux-x64-gnu/0.0.10 - '@tarojs/plugin-doctor-linux-x64-musl': registry.npmjs.org/@tarojs/plugin-doctor-linux-x64-musl/0.0.10 - '@tarojs/plugin-doctor-win32-ia32-msvc': registry.npmjs.org/@tarojs/plugin-doctor-win32-ia32-msvc/0.0.10 - '@tarojs/plugin-doctor-win32-x64-msvc': registry.npmjs.org/@tarojs/plugin-doctor-win32-x64-msvc/0.0.10 - transitivePeerDependencies: - - '@types/react' - - '@types/webpack' - - '@types/webpack-dev-server' - - supports-color - - vue - dev: false - - registry.npmjs.org/@tarojs/runtime/3.6.7: - resolution: {integrity: sha512-RBb7jIDVg9yNS8AQlNr9IBNad1L7GgOSrI09h6Dd3n94gGUZjuXx2ILwS9cR8Jb6FNAzf0o9GbdSQD4WXokPbg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/runtime/-/runtime-3.6.7.tgz} - name: '@tarojs/runtime' - version: 3.6.7 - dependencies: - '@tarojs/shared': registry.npmjs.org/@tarojs/shared/3.6.7 - lodash-es: registry.npmjs.org/lodash-es/4.17.21 - dev: false - - registry.npmjs.org/@tarojs/service/3.6.7: - resolution: {integrity: sha512-UMdhW91Hrwj4X+ixLIar1UdncGrsV552ITe3zuDnXlKtqzpVmSjaIiSiRcOcsAzntrbR3XhYElvnKFkC49Pa3A==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/service/-/service-3.6.7.tgz} - name: '@tarojs/service' - version: 3.6.7 - dependencies: - '@tarojs/helper': registry.npmjs.org/@tarojs/helper/3.6.7 - '@tarojs/shared': registry.npmjs.org/@tarojs/shared/3.6.7 - '@tarojs/taro': registry.npmjs.org/@tarojs/taro/3.6.7 - joi: registry.npmjs.org/joi/17.9.2 - lodash: registry.npmjs.org/lodash/4.17.21 - ora: registry.npmjs.org/ora/5.4.1 - resolve: registry.npmjs.org/resolve/1.22.2 - tapable: registry.npmjs.org/tapable/1.1.3 - webpack-merge: registry.npmjs.org/webpack-merge/4.2.2 - transitivePeerDependencies: - - '@types/react' - - '@types/webpack' - - '@types/webpack-dev-server' - - supports-color - - vue - dev: false - - registry.npmjs.org/@tarojs/shared/3.6.7: - resolution: {integrity: sha512-KOgj1TA+FyFy1ap0gZrB6ilC4H764ivSMyfr8mvlYgygevssticmaKTzkhZsNXRQFOQ+jjZ59cLh0F7VBVhlxg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/shared/-/shared-3.6.7.tgz} - name: '@tarojs/shared' - version: 3.6.7 - dev: false - - registry.npmjs.org/@tarojs/taro/3.6.7: - resolution: {integrity: sha512-j1PPgAKEtdhGXliQGbFaqC7wtyezpqmEEakWEtD83Xdpr4riNePO7xgv9irYNP0cpkjVt3/hLeSddc54X1zh6w==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@tarojs/taro/-/taro-3.6.7.tgz} - name: '@tarojs/taro' - version: 3.6.7 - peerDependencies: - '@types/react': '*' - '@types/webpack': '*' - '@types/webpack-dev-server': '*' - vue: '*' - peerDependenciesMeta: - '@types/react': - optional: true - '@types/webpack': - optional: true - '@types/webpack-dev-server': - optional: true - vue: - optional: true - dependencies: - '@tarojs/api': registry.npmjs.org/@tarojs/api/3.6.7 - '@tarojs/runtime': registry.npmjs.org/@tarojs/runtime/3.6.7 - dev: false - registry.npmjs.org/@testing-library/jest-dom/5.16.5: resolution: {integrity: sha512-N5ixQ2qKpi5OLYfwQmUb/5mSV9LneAcaUfp32pn4yCnpb8r/Yz0pXFPck21dIicKmi+ta5WRAknkZCfA8refMA==, registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.16.5.tgz} name: '@testing-library/jest-dom' From 462d4d45b7878cd13bbb2b7de74f27b4a7c134c5 Mon Sep 17 00:00:00 2001 From: bigMeow Date: Mon, 26 Jun 2023 21:51:52 +0800 Subject: [PATCH 07/14] chore(release): publish 3.6.9-alpha.6 --tag=alpha --- packages/taro-cli/src/__tests__/dotenv-parse.spec.ts | 8 ++++++++ packages/taro-cli/src/__tests__/fixtures/default/.env.pre | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/taro-cli/src/__tests__/dotenv-parse.spec.ts b/packages/taro-cli/src/__tests__/dotenv-parse.spec.ts index 3a20f9dd3269..927a22562675 100644 --- a/packages/taro-cli/src/__tests__/dotenv-parse.spec.ts +++ b/packages/taro-cli/src/__tests__/dotenv-parse.spec.ts @@ -29,6 +29,7 @@ describe('inspect', () => { delete process.env.TARO_APP_ID delete process.env.JD_APP_TEST delete process.env.TARO_APP_DEFAULT + delete process.env.TARO_APP_FOO }) afterEach(() => { @@ -40,6 +41,7 @@ describe('inspect', () => { delete process.env.TARO_APP_ID delete process.env.JD_APP_TEST delete process.env.TARO_APP_DEFAULT + delete process.env.TARO_APP_FOO }) describe('cli mode env', () => { @@ -93,5 +95,11 @@ describe('inspect', () => { expect(process.env.TARO_APP_TEST).toEqual(undefined) expect(process.env.TARO_APP_ID).toEqual('特殊变量appid') }) + + it('环境变量可以相互引用', async () => { + setProcessArgv('taro build --type weapp --mode pre') + await cli.run() + expect(process.env.TARO_APP_FOO).toEqual('env-pre-foo') + }) }) }) diff --git a/packages/taro-cli/src/__tests__/fixtures/default/.env.pre b/packages/taro-cli/src/__tests__/fixtures/default/.env.pre index c6a3e880fded..ec139f2c5960 100644 --- a/packages/taro-cli/src/__tests__/fixtures/default/.env.pre +++ b/packages/taro-cli/src/__tests__/fixtures/default/.env.pre @@ -1 +1,3 @@ -TARO_APP_TEST=env-pre \ No newline at end of file +TARO_APP_TEST=env-pre + +TARO_APP_FOO=${TARO_APP_TEST}-foo \ No newline at end of file From 35a99b47acdbc79bc24b390c1786c202822cbdfb Mon Sep 17 00:00:00 2001 From: bigMeow Date: Tue, 27 Jun 2023 15:50:17 +0800 Subject: [PATCH 08/14] =?UTF-8?q?fix:=20clean=20=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E6=8B=BC=E5=86=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-service/src/platform-plugin-base/mini.ts | 8 ++++---- packages/taro-service/src/platform-plugin-base/web.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/taro-service/src/platform-plugin-base/mini.ts b/packages/taro-service/src/platform-plugin-base/mini.ts index 95946fe89fd6..e26fa2c61ba8 100644 --- a/packages/taro-service/src/platform-plugin-base/mini.ts +++ b/packages/taro-service/src/platform-plugin-base/mini.ts @@ -36,12 +36,12 @@ export abstract class TaroPlatformBase extends TaroP private setupImpl () { const { output } = this.config - // 仅 output.clear 为 false 时不清空输出目录 + // 仅 output.clean 为 false 时不清空输出目录 // eslint-disable-next-line eqeqeq - if (output == undefined || output.clear == undefined || output.clear === true) { + if (output == undefined || output.clean == undefined || output.clean === true) { this.emptyOutputDir() - } else if (isObject(output.clear)) { - this.emptyOutputDir(output.clear.keep || []) + } else if (isObject(output.clean)) { + this.emptyOutputDir(output.clean.keep || []) } this.printDevelopmentTip(this.platform) if (this.projectConfigJson) { diff --git a/packages/taro-service/src/platform-plugin-base/web.ts b/packages/taro-service/src/platform-plugin-base/web.ts index 028b6913b9dd..aaf5b33c460b 100644 --- a/packages/taro-service/src/platform-plugin-base/web.ts +++ b/packages/taro-service/src/platform-plugin-base/web.ts @@ -21,12 +21,12 @@ export abstract class TaroPlatformWeb extends TaroP private setupWebApp () { const { output } = this.config - // H5 中 webpack5 原生支持 output.clear 选项,但是 webpack4 不支持, 为统一行为,这里做一下兼容 + // H5 中 webpack5 原生支持 output.clean 选项,但是 webpack4 不支持, 为统一行为,这里做一下兼容 // eslint-disable-next-line eqeqeq - if (output == undefined || output.clear == undefined || output.clear === true) { + if (output == undefined || output.clean == undefined || output.clean === true) { this.emptyOutputDir() - } else if (isObject(output.clear)) { - this.emptyOutputDir(output.clear.keep || []) + } else if (isObject(output.clean)) { + this.emptyOutputDir(output.clean.keep || []) } this.printDevelopmentTip() } From 05209280995cf1944581ce8e5e7f6655b1320df0 Mon Sep 17 00:00:00 2001 From: lizong9527 Date: Wed, 28 Jun 2023 10:59:45 +0800 Subject: [PATCH 09/14] style: format code --- .../src/platform-plugin-base/mini.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/taro-service/src/platform-plugin-base/mini.ts b/packages/taro-service/src/platform-plugin-base/mini.ts index e26fa2c61ba8..03df01b64433 100644 --- a/packages/taro-service/src/platform-plugin-base/mini.ts +++ b/packages/taro-service/src/platform-plugin-base/mini.ts @@ -15,7 +15,7 @@ interface IFileType { xs?: string } -export abstract class TaroPlatformBase extends TaroPlatform { +export abstract class TaroPlatformBase extends TaroPlatform { platformType = PLATFORM_TYPE.MINI abstract globalObject: string @@ -140,10 +140,15 @@ ${exampleCommand}`)) private async buildImpl (extraOptions = {}) { const runner = await this.getRunner() - const options = this.getOptions(Object.assign({ - runtimePath: this.runtimePath, - taroComponentsPath: this.taroComponentsPath - }, extraOptions)) + const options = this.getOptions( + Object.assign( + { + runtimePath: this.runtimePath, + taroComponentsPath: this.taroComponentsPath + }, + extraOptions + ) + ) await runner(options) } @@ -164,7 +169,7 @@ ${exampleCommand}`)) * 递归替换对象的 key 值 */ protected recursiveReplaceObjectKeys (obj, keyMap) { - Object.keys(obj).forEach(key => { + Object.keys(obj).forEach((key) => { if (keyMap[key]) { obj[keyMap[key]] = obj[key] if (typeof obj[key] === 'object') { From 3e5d7f7d60a6661f91f77ce038414d4b8c140351 Mon Sep 17 00:00:00 2001 From: bigMeow Date: Wed, 28 Jun 2023 17:34:46 +0800 Subject: [PATCH 10/14] =?UTF-8?q?fix:=20webpack4=20=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-service/src/platform-plugin-base/web.ts | 2 +- packages/taro-webpack-runner/src/index.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/taro-service/src/platform-plugin-base/web.ts b/packages/taro-service/src/platform-plugin-base/web.ts index aaf5b33c460b..874ce5d66a77 100644 --- a/packages/taro-service/src/platform-plugin-base/web.ts +++ b/packages/taro-service/src/platform-plugin-base/web.ts @@ -21,7 +21,7 @@ export abstract class TaroPlatformWeb extends TaroP private setupWebApp () { const { output } = this.config - // H5 中 webpack5 原生支持 output.clean 选项,但是 webpack4 不支持, 为统一行为,这里做一下兼容 + // H5 中 webpack5 原生支持 output.clean 选项,但是 webpack4 不支持, 为统一行为,这里做一下兼容(在packages/taro-mini-runner/src/index.ts 中对 clean 选项做了过滤) // eslint-disable-next-line eqeqeq if (output == undefined || output.clean == undefined || output.clean === true) { this.emptyOutputDir() diff --git a/packages/taro-webpack-runner/src/index.ts b/packages/taro-webpack-runner/src/index.ts index 73bc01703700..33a5ab6c6b41 100644 --- a/packages/taro-webpack-runner/src/index.ts +++ b/packages/taro-webpack-runner/src/index.ts @@ -234,6 +234,10 @@ const buildDev = async (appPath: string, config: BuildConfig, appHelper: AppHelp } export default async (appPath: string, config: BuildConfig): Promise => { + // 过滤原因:webpack4 不支持 output.clean 选项, 且 packages/taro-service/src/platform-plugin-base/web.ts 中实现了 output.clean + if (config.output && 'clean' in config.output) { + delete config.output.clean + } const newConfig: BuildConfig = await makeConfig(config) const app = new AppHelper(newConfig.entry, { sourceDir: path.join(appPath, config.sourceRoot || SOURCE_DIR), From 5fc99dfe1f641ad67b1a791a3412f7f40a7af1e9 Mon Sep 17 00:00:00 2001 From: bigMeow Date: Wed, 28 Jun 2023 17:35:26 +0800 Subject: [PATCH 11/14] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/__tests__/build-config.spec.ts | 81 +++++++++++++++++++ .../fixtures/default/config/index.js | 8 ++ 2 files changed, 89 insertions(+) create mode 100644 packages/taro-cli/src/__tests__/build-config.spec.ts diff --git a/packages/taro-cli/src/__tests__/build-config.spec.ts b/packages/taro-cli/src/__tests__/build-config.spec.ts new file mode 100644 index 000000000000..17fa359cd64d --- /dev/null +++ b/packages/taro-cli/src/__tests__/build-config.spec.ts @@ -0,0 +1,81 @@ +import { emptyDirectory } from '@tarojs/helper' +import * as path from 'path' + +import { run } from './utils' + +const runBuild = run('build', [ + 'commands/build', + require.resolve('@tarojs/plugin-platform-weapp'), + require.resolve('@tarojs/plugin-platform-h5') +]) + +jest.mock('@tarojs/helper', () => { + const helper = jest.requireActual('@tarojs/helper') + const fs = helper.fs + return { + __esModule: true, + ...helper, + emptyDirectory: jest.fn(), + fs: { + ...fs + }, + } +}) + +const APP_PATH = path.join(__dirname, 'fixtures/default') +const OUTPUT_PATH = path.join(__dirname, 'fixtures/default/dist') + +describe('构建配置测试', () => { + const emptyDirectoryMocked = emptyDirectory as jest.Mock + + beforeEach(() => { + emptyDirectoryMocked.mockReset() + process.argv = [] + }) + + afterEach(() => { + process.argv = [] + emptyDirectoryMocked.mockReset() + }) + + describe('小程序', () => { + it(`项目 output.clean = clean: { keep: ['project.config.json'] } ==> 清空dist文件夹但保留指定文件`, async () => { + try { + await runBuild(APP_PATH, { + options: { + type: 'weapp', + platform: 'weapp' + } + }) + } catch (error) { + // no handler + } + expect(emptyDirectoryMocked).toBeCalledWith(OUTPUT_PATH, { excludes: ['project.config.json'] }) + }) + }) + + describe('h5', () => { + it('output.clean = false ==> 保留dist文件夹', async () => { + const exitSpy = jest.spyOn(process, 'exit') as jest.SpyInstance + const logSpy = jest.spyOn(console, 'log') + const errorSpy = jest.spyOn(console, 'error') + logSpy.mockImplementation(() => {}) + errorSpy.mockImplementation(() => {}) + + exitSpy.mockImplementation(() => { + throw new Error() + }) + try { + await runBuild(APP_PATH, { + options: { + type: 'h5', + platform: 'h5' + } + }) + } catch (error) { + // no handler + } + expect(emptyDirectoryMocked).toBeCalledTimes(0) + }) + }) +}) diff --git a/packages/taro-cli/src/__tests__/fixtures/default/config/index.js b/packages/taro-cli/src/__tests__/fixtures/default/config/index.js index 7c0c9a7ad688..ea835b8a9adf 100644 --- a/packages/taro-cli/src/__tests__/fixtures/default/config/index.js +++ b/packages/taro-cli/src/__tests__/fixtures/default/config/index.js @@ -20,6 +20,11 @@ const config = { }, framework: 'react', mini: { + output: { + clean: { + keep: ['project.config.json'] + } + }, postcss: { pxtransform: { enable: true, @@ -43,6 +48,9 @@ const config = { } }, h5: { + output: { + clean: false + }, publicPath: '/', staticDirectory: 'static', postcss: { From 3bab5ec8baba308ed1d6f1b0b46fbac3b769506f Mon Sep 17 00:00:00 2001 From: bigMeow Date: Wed, 28 Jun 2023 18:12:14 +0800 Subject: [PATCH 12/14] =?UTF-8?q?perf:=20=E8=BF=87=E6=BB=A4=E6=94=B6?= =?UTF-8?q?=E7=BC=A9=E5=88=B0=20makeConfig=20=E5=87=BD=E6=95=B0=E5=86=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-mini-runner/src/webpack/chain.ts | 4 ++++ packages/taro-service/src/platform-plugin-base/mini.ts | 2 ++ packages/taro-service/src/platform-plugin-base/web.ts | 3 ++- packages/taro-webpack-runner/src/index.ts | 4 ---- packages/taro-webpack-runner/src/utils/chain.ts | 4 ++++ 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/taro-mini-runner/src/webpack/chain.ts b/packages/taro-mini-runner/src/webpack/chain.ts index c654c65e158e..5e469eb2c3e0 100644 --- a/packages/taro-mini-runner/src/webpack/chain.ts +++ b/packages/taro-mini-runner/src/webpack/chain.ts @@ -60,6 +60,10 @@ interface IRule { } export const makeConfig = async (buildConfig: IBuildConfig) => { + // 过滤原因:webpack4 不支持 output.clean 选项, 且 packages/taro-service/src/platform-plugin-base/web.ts 中实现了 output.clean + if (buildConfig.output && 'clean' in buildConfig.output) { + delete buildConfig.output.clean + } const sassLoaderOption = await getSassLoaderOption(buildConfig) return { ...buildConfig, diff --git a/packages/taro-service/src/platform-plugin-base/mini.ts b/packages/taro-service/src/platform-plugin-base/mini.ts index 03df01b64433..ef48e03e0852 100644 --- a/packages/taro-service/src/platform-plugin-base/mini.ts +++ b/packages/taro-service/src/platform-plugin-base/mini.ts @@ -36,6 +36,8 @@ export abstract class TaroPlatformBase extends Taro private setupImpl () { const { output } = this.config + // webpack5 原生支持 output.clean 选项,但是 webpack4 不支持, 为统一行为,这里做一下兼容 + // (在 packages/taro-mini-runner/src/webpack/chain.ts 和 packages/taro-webpack-runner/src/utils/chain.ts 的 makeConfig 中对 clean 选项做了过滤) // 仅 output.clean 为 false 时不清空输出目录 // eslint-disable-next-line eqeqeq if (output == undefined || output.clean == undefined || output.clean === true) { diff --git a/packages/taro-service/src/platform-plugin-base/web.ts b/packages/taro-service/src/platform-plugin-base/web.ts index 874ce5d66a77..65b3dec490b4 100644 --- a/packages/taro-service/src/platform-plugin-base/web.ts +++ b/packages/taro-service/src/platform-plugin-base/web.ts @@ -21,7 +21,8 @@ export abstract class TaroPlatformWeb extends TaroP private setupWebApp () { const { output } = this.config - // H5 中 webpack5 原生支持 output.clean 选项,但是 webpack4 不支持, 为统一行为,这里做一下兼容(在packages/taro-mini-runner/src/index.ts 中对 clean 选项做了过滤) + // webpack5 原生支持 output.clean 选项,但是 webpack4 不支持, 为统一行为,这里做一下兼容 + // (在 packages/taro-mini-runner/src/webpack/chain.ts 和 packages/taro-webpack-runner/src/utils/chain.ts 的 makeConfig 中对 clean 选项做了过滤) // eslint-disable-next-line eqeqeq if (output == undefined || output.clean == undefined || output.clean === true) { this.emptyOutputDir() diff --git a/packages/taro-webpack-runner/src/index.ts b/packages/taro-webpack-runner/src/index.ts index 33a5ab6c6b41..73bc01703700 100644 --- a/packages/taro-webpack-runner/src/index.ts +++ b/packages/taro-webpack-runner/src/index.ts @@ -234,10 +234,6 @@ const buildDev = async (appPath: string, config: BuildConfig, appHelper: AppHelp } export default async (appPath: string, config: BuildConfig): Promise => { - // 过滤原因:webpack4 不支持 output.clean 选项, 且 packages/taro-service/src/platform-plugin-base/web.ts 中实现了 output.clean - if (config.output && 'clean' in config.output) { - delete config.output.clean - } const newConfig: BuildConfig = await makeConfig(config) const app = new AppHelper(newConfig.entry, { sourceDir: path.join(appPath, config.sourceRoot || SOURCE_DIR), diff --git a/packages/taro-webpack-runner/src/utils/chain.ts b/packages/taro-webpack-runner/src/utils/chain.ts index de4019f3c09d..953def5e4e13 100644 --- a/packages/taro-webpack-runner/src/utils/chain.ts +++ b/packages/taro-webpack-runner/src/utils/chain.ts @@ -18,6 +18,10 @@ import type { ICopyOptions, IPostcssOption, PostcssOption } from '@tarojs/taro/t import type { BuildConfig, Option } from './types' export const makeConfig = async (buildConfig: BuildConfig) => { + // 过滤原因:webpack4 不支持 output.clean 选项, 且 packages/taro-service/src/platform-plugin-base/web.ts 中实现了 output.clean + if (buildConfig.output && 'clean' in buildConfig.output) { + delete buildConfig.output.clean + } const sassLoaderOption = await getSassLoaderOption(buildConfig) return { ...buildConfig, From d09c885b14a7ee9b057c1cdd299a5c1ac0f34f30 Mon Sep 17 00:00:00 2001 From: bigMeow Date: Wed, 28 Jun 2023 18:16:30 +0800 Subject: [PATCH 13/14] chore(release): publish 3.6.9-alpha.7 --tag=alpha --- package.json | 2 +- .../package.json | 2 +- packages/babel-plugin-transform-taroapi/package.json | 2 +- packages/babel-preset-taro/package.json | 2 +- packages/create-app/package.json | 2 +- packages/css-to-react-native/package.json | 2 +- packages/eslint-config-taro/package.json | 2 +- packages/postcss-html-transform/package.json | 2 +- packages/postcss-plugin-constparse/package.json | 2 +- packages/postcss-pxtransform/package.json | 2 +- packages/shared/package.json | 2 +- packages/stylelint-config-taro-rn/package.json | 2 +- packages/stylelint-taro-rn/package.json | 2 +- packages/taro-alipay/package.json | 2 +- packages/taro-api/package.json | 2 +- packages/taro-cli-convertor/package.json | 2 +- packages/taro-cli/package.json | 2 +- packages/taro-components-advanced/package.json | 2 +- packages/taro-components-library-react/package.json | 2 +- packages/taro-components-library-vue2/package.json | 2 +- packages/taro-components-library-vue3/package.json | 2 +- packages/taro-components-react/package.json | 2 +- packages/taro-components-rn/package.json | 2 +- packages/taro-components/package.json | 2 +- packages/taro-extend/package.json | 2 +- packages/taro-h5/package.json | 2 +- packages/taro-helper/package.json | 2 +- packages/taro-jd/package.json | 2 +- packages/taro-loader/package.json | 2 +- packages/taro-mini-runner/package.json | 2 +- packages/taro-platform-h5/package.json | 2 +- packages/taro-plugin-html/package.json | 2 +- packages/taro-plugin-http/package.json | 2 +- packages/taro-plugin-inject/package.json | 2 +- packages/taro-plugin-mini-ci/package.json | 2 +- packages/taro-plugin-react-devtools/package.json | 2 +- packages/taro-plugin-react/package.json | 2 +- packages/taro-plugin-vue-devtools/package.json | 2 +- packages/taro-plugin-vue2/package.json | 2 +- packages/taro-plugin-vue3/package.json | 2 +- packages/taro-qq/package.json | 2 +- packages/taro-react/package.json | 2 +- packages/taro-rn-runner/package.json | 2 +- packages/taro-rn-style-transformer/package.json | 2 +- packages/taro-rn-supporter/package.json | 2 +- packages/taro-rn-transformer/package.json | 2 +- packages/taro-rn/package.json | 2 +- packages/taro-router-rn/package.json | 2 +- packages/taro-router/package.json | 2 +- packages/taro-runner-utils/package.json | 2 +- packages/taro-runtime-rn/package.json | 2 +- packages/taro-runtime/package.json | 2 +- packages/taro-service/package.json | 2 +- packages/taro-swan/package.json | 2 +- packages/taro-tt/package.json | 2 +- packages/taro-weapp/package.json | 2 +- packages/taro-webpack-runner/package.json | 2 +- packages/taro-webpack5-prebundle/package.json | 2 +- packages/taro-webpack5-runner/package.json | 2 +- packages/taro-with-weapp/package.json | 2 +- packages/taro/package.json | 2 +- packages/taroize/package.json | 2 +- 62 files changed, 62 insertions(+), 62 deletions(-) diff --git a/package.json b/package.json index 544168a5d910..dd721059eb8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "taro", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "开放式跨端跨框架开发解决方案", "homepage": "https://github.com/NervJS/taro#readme", "author": "O2Team", diff --git a/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json b/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json index 5395a2e0e136..a8e9ecf8a58e 100644 --- a/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json +++ b/packages/babel-plugin-transform-react-jsx-to-rn-stylesheet/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-transform-react-jsx-to-rn-stylesheet", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Transform stylesheet selector to style in JSX Elements.", "license": "MIT", "main": "dist/index.js", diff --git a/packages/babel-plugin-transform-taroapi/package.json b/packages/babel-plugin-transform-taroapi/package.json index 91872cf4ee6b..266c8e12dae6 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": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "main": "dist/index.js", "scripts": { "build": "tsc", diff --git a/packages/babel-preset-taro/package.json b/packages/babel-preset-taro/package.json index 66fdf67114b8..3beb4aafda06 100644 --- a/packages/babel-preset-taro/package.json +++ b/packages/babel-preset-taro/package.json @@ -1,6 +1,6 @@ { "name": "babel-preset-taro", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro babel preset", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/babel-preset-taro#readme", diff --git a/packages/create-app/package.json b/packages/create-app/package.json index ec41a872ccf5..2fdb19bbd2bb 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/create-app", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "create taro app with one command", "author": "VincentW ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/create-app#readme", diff --git a/packages/css-to-react-native/package.json b/packages/css-to-react-native/package.json index d4298c889124..6fd4cf69b64f 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": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "main": "dist/index.js", "license": "MIT", "files": [ diff --git a/packages/eslint-config-taro/package.json b/packages/eslint-config-taro/package.json index 8b18245b867a..10740a05b273 100644 --- a/packages/eslint-config-taro/package.json +++ b/packages/eslint-config-taro/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-taro", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro specific linting rules for ESLint", "main": "index.js", "files": [ diff --git a/packages/postcss-html-transform/package.json b/packages/postcss-html-transform/package.json index 2a69d4e3fa0f..b7484aadfa5e 100644 --- a/packages/postcss-html-transform/package.json +++ b/packages/postcss-html-transform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-html-transform", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "transform html tag name selector", "main": "index.js", "author": "drchan", diff --git a/packages/postcss-plugin-constparse/package.json b/packages/postcss-plugin-constparse/package.json index ea2381c4e626..082de1a49ede 100644 --- a/packages/postcss-plugin-constparse/package.json +++ b/packages/postcss-plugin-constparse/package.json @@ -1,6 +1,6 @@ { "name": "postcss-plugin-constparse", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "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 2a2358dd0c73..273deb48d395 100644 --- a/packages/postcss-pxtransform/package.json +++ b/packages/postcss-pxtransform/package.json @@ -1,6 +1,6 @@ { "name": "postcss-pxtransform", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位", "main": "index.js", "keywords": [ diff --git a/packages/shared/package.json b/packages/shared/package.json index 7ff9818fa702..4aa77ee80a97 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/shared", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro utils internal use.", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/shared#readme", diff --git a/packages/stylelint-config-taro-rn/package.json b/packages/stylelint-config-taro-rn/package.json index fde3962aa890..1150f409c006 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": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Shareable stylelint config for React Native CSS modules", "main": "index.js", "files": [ diff --git a/packages/stylelint-taro-rn/package.json b/packages/stylelint-taro-rn/package.json index eff302eb7a7e..6c8c6c6c4fdd 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": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "main": "dist/index.js", "files": [ "dist", diff --git a/packages/taro-alipay/package.json b/packages/taro-alipay/package.json index eb29322e29cd..9821b189b0a9 100644 --- a/packages/taro-alipay/package.json +++ b/packages/taro-alipay/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-alipay", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "支付宝小程序平台插件", "author": "Chen-jj", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-alipay#readme", diff --git a/packages/taro-api/package.json b/packages/taro-api/package.json index 4218917c3ac0..d932bceafe69 100644 --- a/packages/taro-api/package.json +++ b/packages/taro-api/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/api", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro common API", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/api#readme", diff --git a/packages/taro-cli-convertor/package.json b/packages/taro-cli-convertor/package.json index 6ab3e6285d6f..d3104b3829d0 100644 --- a/packages/taro-cli-convertor/package.json +++ b/packages/taro-cli-convertor/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/cli-convertor", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "cli tool for taro-convert", "main": "index.js", "scripts": { diff --git a/packages/taro-cli/package.json b/packages/taro-cli/package.json index 7e3aac7862f9..70e5b742b552 100644 --- a/packages/taro-cli/package.json +++ b/packages/taro-cli/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/cli", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "cli tool for taro", "main": "index.js", "types": "dist/index.d.ts", diff --git a/packages/taro-components-advanced/package.json b/packages/taro-components-advanced/package.json index 89a6c076a032..353eecfa645a 100644 --- a/packages/taro-components-advanced/package.json +++ b/packages/taro-components-advanced/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-advanced", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/taro-components-library-react/package.json b/packages/taro-components-library-react/package.json index 2c4bd7aaa325..a7de3b4d45e5 100644 --- a/packages/taro-components-library-react/package.json +++ b/packages/taro-components-library-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-library-react", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro 组件库 React 版本库", "private": true, "main": "index.js", diff --git a/packages/taro-components-library-vue2/package.json b/packages/taro-components-library-vue2/package.json index c713c0eb5344..6744500edd8b 100644 --- a/packages/taro-components-library-vue2/package.json +++ b/packages/taro-components-library-vue2/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-library-vue2", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro 组件库 Vue2 版本库", "private": true, "main": "index.js", diff --git a/packages/taro-components-library-vue3/package.json b/packages/taro-components-library-vue3/package.json index ddcc60055ead..048ad7914eeb 100644 --- a/packages/taro-components-library-vue3/package.json +++ b/packages/taro-components-library-vue3/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-library-vue3", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro 组件库 Vue3 版本库", "private": true, "main": "index.js", diff --git a/packages/taro-components-react/package.json b/packages/taro-components-react/package.json index 87d8feae9e75..f615caa0e44e 100644 --- a/packages/taro-components-react/package.json +++ b/packages/taro-components-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-react", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "", "main:h5": "src/index.js", "main": "dist/index.js", diff --git a/packages/taro-components-rn/package.json b/packages/taro-components-rn/package.json index 9827dbf0a659..97d4f55fca8d 100644 --- a/packages/taro-components-rn/package.json +++ b/packages/taro-components-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components-rn", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "多端解决方案基础组件(RN)", "main": "./dist/index.js", "scripts": { diff --git a/packages/taro-components/package.json b/packages/taro-components/package.json index 27659c3b0a73..b95eba686171 100644 --- a/packages/taro-components/package.json +++ b/packages/taro-components/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/components", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro 组件库", "browser": "dist/index.js", "main:h5": "dist/index.js", diff --git a/packages/taro-extend/package.json b/packages/taro-extend/package.json index 98821019044f..bc85b96c3032 100644 --- a/packages/taro-extend/package.json +++ b/packages/taro-extend/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/extend", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro extend functionality", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-extend#readme", diff --git a/packages/taro-h5/package.json b/packages/taro-h5/package.json index 096403dcb3a9..e265261a9ce5 100644 --- a/packages/taro-h5/package.json +++ b/packages/taro-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-h5", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro h5 framework", "browser": "dist/index.esm.js", "main:h5": "dist/index.js", diff --git a/packages/taro-helper/package.json b/packages/taro-helper/package.json index f0e8259303a7..2e0488cc5bc6 100644 --- a/packages/taro-helper/package.json +++ b/packages/taro-helper/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/helper", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro Helper", "main": "index.js", "types": "dist/index.d.ts", diff --git a/packages/taro-jd/package.json b/packages/taro-jd/package.json index ef8cb2547616..18bd0bc1f028 100644 --- a/packages/taro-jd/package.json +++ b/packages/taro-jd/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-jd", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "京东小程序平台插件", "author": "Chen-jj", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-jd#readme", diff --git a/packages/taro-loader/package.json b/packages/taro-loader/package.json index 773f87e806a3..c16791dc7673 100644 --- a/packages/taro-loader/package.json +++ b/packages/taro-loader/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-loader", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro runner use webpack loader", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-loader#readme", diff --git a/packages/taro-mini-runner/package.json b/packages/taro-mini-runner/package.json index 1378d07da84d..f594040965a8 100644 --- a/packages/taro-mini-runner/package.json +++ b/packages/taro-mini-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/mini-runner", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Mini app runner for taro", "main": "index.js", "scripts": { diff --git a/packages/taro-platform-h5/package.json b/packages/taro-platform-h5/package.json index 22da6d3a4fa1..2faebd364164 100644 --- a/packages/taro-platform-h5/package.json +++ b/packages/taro-platform-h5/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-h5", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Web 端平台插件", "author": "ZakaryCode", "license": "MIT", diff --git a/packages/taro-plugin-html/package.json b/packages/taro-plugin-html/package.json index 9d722114ad22..6416efbf3ea5 100644 --- a/packages/taro-plugin-html/package.json +++ b/packages/taro-plugin-html/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-html", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro 小程序端支持使用 HTML 标签的插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-http/package.json b/packages/taro-plugin-http/package.json index b798a1bac37f..c8f837f860a9 100644 --- a/packages/taro-plugin-http/package.json +++ b/packages/taro-plugin-http/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-http", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro 小程序端支持使用 web 请求 的插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-inject/package.json b/packages/taro-plugin-inject/package.json index 64e97d2b24b9..3b49ef955588 100644 --- a/packages/taro-plugin-inject/package.json +++ b/packages/taro-plugin-inject/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-inject", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro 小程序端平台中间层插件", "author": "luckyadam", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-plugin-mini-ci/package.json b/packages/taro-plugin-mini-ci/package.json index 7d54546ec964..fb5c55e1c31d 100644 --- a/packages/taro-plugin-mini-ci/package.json +++ b/packages/taro-plugin-mini-ci/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-mini-ci", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro 小程序端构建后支持CI(持续集成)的插件", "keywords": [ "Taro", diff --git a/packages/taro-plugin-react-devtools/package.json b/packages/taro-plugin-react-devtools/package.json index b9b09067ca25..bbcc4d245732 100644 --- a/packages/taro-plugin-react-devtools/package.json +++ b/packages/taro-plugin-react-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-react-devtools", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro 小程序端支持使用 React DevTools 的插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-react/package.json b/packages/taro-plugin-react/package.json index cb8fd67e9c96..5b89bde9af7d 100644 --- a/packages/taro-plugin-react/package.json +++ b/packages/taro-plugin-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-framework-react", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "React/Preact/Nerv 框架插件", "author": "drchan", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-plugin-vue-devtools/package.json b/packages/taro-plugin-vue-devtools/package.json index a706935cb8b0..7d1f2b90b009 100644 --- a/packages/taro-plugin-vue-devtools/package.json +++ b/packages/taro-plugin-vue-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-vue-devtools", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro 小程序端支持使用 Vue DevTools 的插件", "main": "index.js", "scripts": { diff --git a/packages/taro-plugin-vue2/package.json b/packages/taro-plugin-vue2/package.json index dac89d6593ad..68a53c232be7 100644 --- a/packages/taro-plugin-vue2/package.json +++ b/packages/taro-plugin-vue2/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-framework-vue2", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Vue2 框架插件", "author": "drchan", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-plugin-vue3/package.json b/packages/taro-plugin-vue3/package.json index 49d5e4b8f0f2..a80d5be0343e 100644 --- a/packages/taro-plugin-vue3/package.json +++ b/packages/taro-plugin-vue3/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-framework-vue3", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Vue3 框架插件", "author": "drchan", "homepage": "https://github.com/nervjs/taro", diff --git a/packages/taro-qq/package.json b/packages/taro-qq/package.json index 71b7959a6693..0f1cf36c1a4a 100644 --- a/packages/taro-qq/package.json +++ b/packages/taro-qq/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-qq", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "QQ 小程序平台插件", "author": "Chen-jj", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-qq#readme", diff --git a/packages/taro-react/package.json b/packages/taro-react/package.json index 4dafa11b075b..41d750b3c672 100644 --- a/packages/taro-react/package.json +++ b/packages/taro-react/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/react", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "like react-dom, but for mini apps.", "author": "yuche ", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-react#readme", diff --git a/packages/taro-rn-runner/package.json b/packages/taro-rn-runner/package.json index 7aefbf643a17..5aab35898820 100644 --- a/packages/taro-rn-runner/package.json +++ b/packages/taro-rn-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-runner", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "ReactNative build tool for taro", "main": "index.js", "repository": { diff --git a/packages/taro-rn-style-transformer/package.json b/packages/taro-rn-style-transformer/package.json index cdb7d987a5cf..6d1172db2017 100644 --- a/packages/taro-rn-style-transformer/package.json +++ b/packages/taro-rn-style-transformer/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-style-transformer", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "提供Taro RN 统一处理样式文件能力", "main": "dist/index.js", "scripts": { diff --git a/packages/taro-rn-supporter/package.json b/packages/taro-rn-supporter/package.json index 6ef012a694d6..d1301e2fe964 100644 --- a/packages/taro-rn-supporter/package.json +++ b/packages/taro-rn-supporter/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-supporter", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro rn supporter", "main": "dist/index.js", "scripts": { diff --git a/packages/taro-rn-transformer/package.json b/packages/taro-rn-transformer/package.json index 270023279832..af73ad068359 100644 --- a/packages/taro-rn-transformer/package.json +++ b/packages/taro-rn-transformer/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/rn-transformer", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro RN 入口文件处理", "main": "dist/index.js", "types": "./src/types/index.d.ts", diff --git a/packages/taro-rn/package.json b/packages/taro-rn/package.json index ec812224e0e1..d7ba85439ba2 100644 --- a/packages/taro-rn/package.json +++ b/packages/taro-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro-rn", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro RN framework", "main": "dist/index.js", "typings": "types/index.d.ts", diff --git a/packages/taro-router-rn/package.json b/packages/taro-router-rn/package.json index f36d3c65a8f6..d01776a11402 100644 --- a/packages/taro-router-rn/package.json +++ b/packages/taro-router-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/router-rn", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro-router-rn", "main": "dist/index.js", "typings": "src/index.ts", diff --git a/packages/taro-router/package.json b/packages/taro-router/package.json index a9b84afd2b6f..d5de58a94594 100644 --- a/packages/taro-router/package.json +++ b/packages/taro-router/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/router", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro-router", "browser": "dist/index.esm.js", "main:h5": "dist/index.js", diff --git a/packages/taro-runner-utils/package.json b/packages/taro-runner-utils/package.json index 890b97c12679..f53cb1e673e8 100644 --- a/packages/taro-runner-utils/package.json +++ b/packages/taro-runner-utils/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/runner-utils", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro runner utilities.", "main": "dist/index.js", "types": "types/index.d.ts", diff --git a/packages/taro-runtime-rn/package.json b/packages/taro-runtime-rn/package.json index 22f677a6e979..8947777ad09e 100644 --- a/packages/taro-runtime-rn/package.json +++ b/packages/taro-runtime-rn/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/runtime-rn", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "taro-runtime-rn", "main": "dist/index.js", "types": "./src/index.ts", diff --git a/packages/taro-runtime/package.json b/packages/taro-runtime/package.json index 2fe178c21e92..7f8ada4518e7 100644 --- a/packages/taro-runtime/package.json +++ b/packages/taro-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/runtime", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "taro runtime for mini apps.", "main": "dist/runtime.esm.js", "module": "dist/runtime.esm.js", diff --git a/packages/taro-service/package.json b/packages/taro-service/package.json index e76f75758477..9ca0a1f6ebe9 100644 --- a/packages/taro-service/package.json +++ b/packages/taro-service/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/service", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro Service", "main": "index.js", "types": "types/index.d.ts", diff --git a/packages/taro-swan/package.json b/packages/taro-swan/package.json index 958dbdc66372..68d179ab874c 100644 --- a/packages/taro-swan/package.json +++ b/packages/taro-swan/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-swan", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "百度小程序平台插件", "author": "Chen-jj", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-swan#readme", diff --git a/packages/taro-tt/package.json b/packages/taro-tt/package.json index dab50423104b..33286a7a519a 100644 --- a/packages/taro-tt/package.json +++ b/packages/taro-tt/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-tt", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "头条小程序平台插件", "author": "Chen-jj", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-tt#readme", diff --git a/packages/taro-weapp/package.json b/packages/taro-weapp/package.json index 56fac9604328..d77d2530c4d1 100644 --- a/packages/taro-weapp/package.json +++ b/packages/taro-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/plugin-platform-weapp", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "微信小程序平台插件", "author": "drchan", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-weapp#readme", diff --git a/packages/taro-webpack-runner/package.json b/packages/taro-webpack-runner/package.json index d1406e8bad5f..22b37dd4d498 100644 --- a/packages/taro-webpack-runner/package.json +++ b/packages/taro-webpack-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack-runner", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "webpack runner for taro", "main": "index.js", "scripts": { diff --git a/packages/taro-webpack5-prebundle/package.json b/packages/taro-webpack5-prebundle/package.json index 49f5a386c4f4..74b13c54cb82 100644 --- a/packages/taro-webpack5-prebundle/package.json +++ b/packages/taro-webpack5-prebundle/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack5-prebundle", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro app webpack5 prebundle", "main": "dist/index.js", "scripts": { diff --git a/packages/taro-webpack5-runner/package.json b/packages/taro-webpack5-runner/package.json index 34ea781e04c0..7c6dd6f2ead0 100644 --- a/packages/taro-webpack5-runner/package.json +++ b/packages/taro-webpack5-runner/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/webpack5-runner", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro app runner", "main": "index.js", "scripts": { diff --git a/packages/taro-with-weapp/package.json b/packages/taro-with-weapp/package.json index 1b7555f8d6a8..e2cc917269c2 100644 --- a/packages/taro-with-weapp/package.json +++ b/packages/taro-with-weapp/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/with-weapp", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "taroize 之后的运行时", "main": "index.js", "files": [ diff --git a/packages/taro/package.json b/packages/taro/package.json index f6b722710018..47f2c63e273f 100644 --- a/packages/taro/package.json +++ b/packages/taro/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taro", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "Taro framework", "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme", "main": "index.js", diff --git a/packages/taroize/package.json b/packages/taroize/package.json index 853232ac0943..2e1d9804f9ff 100644 --- a/packages/taroize/package.json +++ b/packages/taroize/package.json @@ -1,6 +1,6 @@ { "name": "@tarojs/taroize", - "version": "3.6.9-alpha.6", + "version": "3.6.9-alpha.7", "description": "转换原生微信小程序代码为 Taro 代码", "main": "index.js", "files": [ From e1766fa745ca2410ab1ddad69cb61eb39fd02e45 Mon Sep 17 00:00:00 2001 From: bigMeow Date: Thu, 29 Jun 2023 11:32:11 +0800 Subject: [PATCH 14/14] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/__tests__/build-config.spec.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/taro-cli/src/__tests__/build-config.spec.ts b/packages/taro-cli/src/__tests__/build-config.spec.ts index 17fa359cd64d..4cdeaebf49e7 100644 --- a/packages/taro-cli/src/__tests__/build-config.spec.ts +++ b/packages/taro-cli/src/__tests__/build-config.spec.ts @@ -40,6 +40,15 @@ describe('构建配置测试', () => { describe('小程序', () => { it(`项目 output.clean = clean: { keep: ['project.config.json'] } ==> 清空dist文件夹但保留指定文件`, async () => { + const exitSpy = jest.spyOn(process, 'exit') as jest.SpyInstance + const logSpy = jest.spyOn(console, 'log') + const errorSpy = jest.spyOn(console, 'error') + logSpy.mockImplementation(() => {}) + errorSpy.mockImplementation(() => {}) + exitSpy.mockImplementation(() => { + throw new Error() + }) + try { await runBuild(APP_PATH, { options: { @@ -51,6 +60,10 @@ describe('构建配置测试', () => { // no handler } expect(emptyDirectoryMocked).toBeCalledWith(OUTPUT_PATH, { excludes: ['project.config.json'] }) + + exitSpy.mockRestore() + logSpy.mockRestore() + errorSpy.mockRestore() }) }) @@ -61,10 +74,10 @@ describe('构建配置测试', () => { const errorSpy = jest.spyOn(console, 'error') logSpy.mockImplementation(() => {}) errorSpy.mockImplementation(() => {}) - exitSpy.mockImplementation(() => { throw new Error() }) + try { await runBuild(APP_PATH, { options: { @@ -76,6 +89,10 @@ describe('构建配置测试', () => { // no handler } expect(emptyDirectoryMocked).toBeCalledTimes(0) + + exitSpy.mockRestore() + logSpy.mockRestore() + errorSpy.mockRestore() }) }) })