ionic-team / ionic-team/ionic-cli

bug: multi-app doesn't properly configure capacitor.config.json per project

未关闭
#4,656 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
triage
主要语言
TypeScript
星标
2k
派生
682
PR 合并指标
30 天内没有已合并 PR

描述

**Description:**
Establishing a multi-app project structure, such as for a monorepo, creates a root `capacitor.config.json` file in addition to `capacitor.config.json` files in each project's directory. However, only the `capacitor.config.json` file at the root of the repository contains all required Capacitor configuration options. The `capacitor.config.json` files within each project's directory contains only the `appName` property.

**Steps to Reproduce:**

```bash
mkdir sample-monorepo && cd ./sample-monorepo
npx lerna init
ionic init --multi-app
cd ./packages
ionic start app1 blank --type=react
ionic start app2 blank --type=react --no-deps
```

Output Files:

- Root folder: [capacitor.config.json](https://github.com/ehorodyski-ionic/cap-react-lerna-monorepo/commit/71caf0c1a2254331494578d775bc85865d3e59cc#diff-ec2b53f1220a8bca613b0f050e250e7869ef60b2c5bc3de7cbb55f98ad0999f4)
- App One: "Employee App” [capacitor.config.json](https://github.com/ehorodyski-ionic/cap-react-lerna-monorepo/commit/71caf0c1a2254331494578d775bc85865d3e59cc#diff-20154324b00f53761b4f9f7e6516f198c974f08a00a33a359794ec73f8e7f779)
- App Two: "Customer App" [capacitor.config.json](https://github.com/ehorodyski-ionic/cap-react-lerna-monorepo/commit/71caf0c1a2254331494578d775bc85865d3e59cc#diff-b88ec38539bf156f5409fe61c9accba12cc62f1c8620b69d6cad2469e7b57ea6)

**Output:**

**My `ionic info`:**

```
[WARN] Multi-app workspace detected, but cannot determine which project to use.

Please set a defaultProject in ./ionic.config.json or specify the project
using the global --project option. Read the documentation[1] for more
information.

[1]: https://ion.link/multi-app-docs

Ionic:

Ionic CLI : 6.13.1 (/Users/eric/npm-global/lib/node_modules/@ionic/cli)

Utility:

cordova-res (update available: 0.15.3) : 0.15.2
native-run (update available: 1.3.0) : 1.2.2

System:

NodeJS : v14.15.1 (/usr/local/bin/node)
npm : 6.14.11
OS : macOS Big Sur
```

**Other Information:**

This can be resolved by copy & pasting the root config to each project's `capacitor.config.json` file and modifying the package name and bundle. It is unknown if this root config file serves a purpose however.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。