diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index edf7fcf78f9c..e3a434e0ac68 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,20 +14,20 @@ ### 安装依赖 -基于 yarn workspace。 +基于 pnpm workspace。 ```bash -$ yarn +$ pnpm install ``` ### 编译构建 ```bash # 全局编译 -$ yarn build # 等价于 lerna run build +$ pnpm run build # 等价于 pnpm -r --filter=./packages/* run build # 编译某个子包,如 `@tarojs/cli` -$ lerna run build --scope=@tarojs/cli +$ pnpm --filter @tarojs/cli run dev ``` ### 新增/删除依赖 @@ -41,36 +41,30 @@ $ lerna run build --scope=@tarojs/cli ```bash # 新增 -$ yarn add -W -D +$ pnpm add -wD # 删除 -$ yarn remove -W -D +$ pnpm remove -wD ``` #### 2. 操作某个子包 ```bash # 为某个子包(如 @tarojs/cli)新增一个依赖 -$ yarn workspace @tarojs/cli add +$ pnpm --filter @tarojs/cli add # 为某个子包(如 @tarojs/cli)删除一个依赖 -$ yarn workspace @tarojs/cli remove - -# 如遇到报错 "expected workspace package to exist for",请使用 yarn@1.18 再尝试。 -# 相关 issues: -# - https://github.com/yarnpkg/yarn/issues/7807 -# - https://github.com/yarnpkg/yarn/issues/7734 -$ npx yarn@1.18 workspace @tarojs/cli add +$ pnpm --filter @tarojs/cli remove ``` #### 3. 操作所有子包 ```bash # 新增 -$ yarn workspaces add +$ pnpm -r --filter=./packages/* add # 删除 -$ yarn workspaces remove +$ pnpm -r --filter=./packages/* remove ``` ### 清理所有依赖 @@ -88,11 +82,17 @@ $ lerna run --scope= --stream ### 提交发布 -```bash -$ yarn run version --lerna_version= -$ git add . -$ git commit -m "chore(release): publish " -``` +- PR 发布规则 + + ```bash + $ pnpm version + ``` + +- `feat/**` 分支发布规则 + + ```bash + $ pnpm version --tag= + ``` ## 提交 commit diff --git a/packages/taro-plugin-vue3/src/runtime/utils.ts b/packages/taro-plugin-vue3/src/runtime/utils.ts index 87afcaabdf35..fddfbd15853d 100644 --- a/packages/taro-plugin-vue3/src/runtime/utils.ts +++ b/packages/taro-plugin-vue3/src/runtime/utils.ts @@ -1,4 +1,3 @@ -import { chalk } from '@tarojs/helper' import { Current } from '@tarojs/runtime' /** @@ -20,15 +19,3 @@ export function setRouterParams (options) { ...options } } - -export function getVueLoaderPath (): string { - try { - return require.resolve('vue-loader', { - paths: [process.cwd()] - }) - } catch (error) { - // eslint-disable-next-line no-console - console.log(chalk.yellow('找不到 vue-loader,请先安装。')) - process.exit(1) - } -} diff --git a/packages/taro-plugin-vue3/src/utils.ts b/packages/taro-plugin-vue3/src/utils.ts new file mode 100644 index 000000000000..8c878c718564 --- /dev/null +++ b/packages/taro-plugin-vue3/src/utils.ts @@ -0,0 +1,13 @@ +import { chalk } from '@tarojs/helper' + +export function getVueLoaderPath (): string { + try { + return require.resolve('vue-loader', { + paths: [process.cwd()] + }) + } catch (error) { + // eslint-disable-next-line no-console + console.log(chalk.yellow('找不到 vue-loader,请先安装。')) + process.exit(1) + } +} diff --git a/packages/taro-plugin-vue3/src/webpack.h5.ts b/packages/taro-plugin-vue3/src/webpack.h5.ts index 25def974c262..c53bc09241f9 100644 --- a/packages/taro-plugin-vue3/src/webpack.h5.ts +++ b/packages/taro-plugin-vue3/src/webpack.h5.ts @@ -5,7 +5,7 @@ import type { ElementNode, RootNode, TemplateChildNode } from '@vue/compiler-cor import type { IConfig } from './index' import { getLoaderMeta } from './loader-meta' -import { getVueLoaderPath } from './runtime/utils' +import { getVueLoaderPath } from './utils' export function modifyH5WebpackChain (ctx: IPluginContext, chain, config: IConfig) { // vue3 tsx 使用原生组件 diff --git a/packages/taro-plugin-vue3/src/webpack.mini.ts b/packages/taro-plugin-vue3/src/webpack.mini.ts index b47f76e394f2..817788fe136f 100644 --- a/packages/taro-plugin-vue3/src/webpack.mini.ts +++ b/packages/taro-plugin-vue3/src/webpack.mini.ts @@ -5,7 +5,7 @@ import type { AttributeNode, DirectiveNode, ElementNode, RootNode, SimpleExpress import type { IConfig } from './index' import { getLoaderMeta } from './loader-meta' -import { getVueLoaderPath } from './runtime/utils' +import { getVueLoaderPath } from './utils' const CUSTOM_WRAPPER = 'custom-wrapper'