ionic-team / ionic-team/ionic-cli

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

Đang mở
#4,656 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
triage
Ngôn ngữ chính
TypeScript
Star
2k
Fork
682
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.