#1812
feat(monorepo): allow excluding workspace apps via monorepo.exclude and enabled: false
Summary
Fixes #1758
Currently, monorepo detection scans all workspace packages and creates a sub-app for each package found. In repositories with non-deployable packages (e.g. mobile applications, CLI tools, internal documentation), there was no way to prevent openship from treating them as deployable services.
This PR adds two complementary mechanisms in openship.json:
monorepo.exclude: string[]: A list of root directory paths to omit from detected workspace packages.monorepo.apps[].enabled: false: Disables a specific workspace sub-app by root directory. Whenenabled: false,nameis optional.
Changes
- Core schema & parsing (
packages/core):- Added
exclude?: string[]toOpenshipMonorepo. - Added
enabled?: booleantoOpenshipMonorepoApp(allowingnameto be omitted if disabled). - Validated
monorepo.excludeas an array of path strings andmonorepo.apps[].enabledas boolean.
- Added
- Engine overlay & filtering (
packages/platform):- In
mergeMonorepoApps, filtered out detected apps configured withenabled === false. - In
applyOpenshipOverlay, filtered out apps matching paths inmonorepo.exclude. - Added public diagnostics warning when any path in
monorepo.excludedoes not match any detected workspace sub-app (matchingmonorepo.appsbehavior).
- In
- Docs & Schema (
apps/web):- Updated
openship.schema.jsonwithmonorepo.excludeandmonorepo.apps[].enabled. - Updated
apps/web/content/docs/reference/openship-json.mdxdocumentation.
- Updated
- Tests:
- Unit tests in
packages/core/src/openship-config/parse.test.ts. - End-to-end deployment prepare service tests in
apps/api/test/modules/deployments/prepare.service.test.ts.
- Unit tests in
Verification
bun test packages/core/src/openship-config/parse.test.ts(101 tests passed)bunx vitest run test/modules/deployments/prepare.service.test.ts(58 tests passed)