Skip to content

Commit

Permalink
Merge branch 'feat/3.5-theta' of github.com:NervJS/taro into feat/3.5…
Browse files Browse the repository at this point in the history
…-theta
  • Loading branch information
Chen-jj committed Jul 7, 2022
2 parents e1089ee + f156d6c commit da66395
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
42 changes: 21 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

### 新增/删除依赖
Expand All @@ -41,36 +41,30 @@ $ lerna run build --scope=@tarojs/cli

```bash
# 新增
$ yarn add -W -D <dependency>
$ pnpm add -wD <dependency>

# 删除
$ yarn remove -W -D <dependency>
$ pnpm remove -wD <dependency>
```

#### 2. 操作某个子包

```bash
# 为某个子包(如 @tarojs/cli)新增一个依赖
$ yarn workspace @tarojs/cli add <dependency>
$ pnpm --filter @tarojs/cli add <dependency>

# 为某个子包(如 @tarojs/cli)删除一个依赖
$ yarn workspace @tarojs/cli remove <dependency>

# 如遇到报错 "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 <dependency>
$ pnpm --filter @tarojs/cli remove <dependency>
```

#### 3. 操作所有子包

```bash
# 新增
$ yarn workspaces add <dependency>
$ pnpm -r --filter=./packages/* add <dependency>

# 删除
$ yarn workspaces remove <dependency>
$ pnpm -r --filter=./packages/* remove <dependency>
```

### 清理所有依赖
Expand All @@ -88,11 +82,17 @@ $ lerna run <script-name> --scope=<workspace> --stream

### 提交发布

```bash
$ yarn run version --lerna_version=<version>
$ git add .
$ git commit -m "chore(release): publish <version>"
```
- PR 发布规则

```bash
$ pnpm version <version>
```

- `feat/**` 分支发布规则

```bash
$ pnpm version <version> --tag=<tag>
```

## 提交 commit

Expand Down
13 changes: 0 additions & 13 deletions packages/taro-plugin-vue3/src/runtime/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { chalk } from '@tarojs/helper'
import { Current } from '@tarojs/runtime'

/**
Expand All @@ -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)
}
}
13 changes: 13 additions & 0 deletions packages/taro-plugin-vue3/src/utils.ts
Original file line number Diff line number Diff line change
@@ -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)
}
}
2 changes: 1 addition & 1 deletion packages/taro-plugin-vue3/src/webpack.h5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 使用原生组件
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-plugin-vue3/src/webpack.mini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit da66395

Please sign in to comment.