Skip to content
This repository was archived by the owner on Mar 30, 2026. It is now read-only.

Commit 874e537

Browse files
feat: ignore tenant modules when analyzing dependencies in collie repo
This excludes tenant modules from generated documentation. Tenant modules can still be deployed from "collie foundation deploy"
1 parent 5ce2aa9 commit 874e537

4 files changed

Lines changed: 27 additions & 4 deletions

File tree

src/commands/foundation/TestModuleType.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ import { PlatformModuleType } from "./PlatformModuleType.ts";
66
export class TestModuleType extends StringType {
77
async complete(): Promise<string[]> {
88
const repo = await CollieRepository.load();
9+
const excludes = {
10+
testModules: false,
11+
tenantModules: true,
12+
};
13+
914
const modules = await repo.processFilesGlob(
1015
"foundations/*/platforms/**/*.test/terragrunt.hcl",
1116
(file) => PlatformModuleType.parseModuleId(file.path),
12-
false,
17+
excludes,
1318
);
1419

1520
// I don't know how we could get the foundation name passed to the arg to filter

src/foundation/PlatformDeployer.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,15 @@ export class PlatformDeployer<T extends PlatformConfig> {
170170
}
171171

172172
private async testModuleTerragruntFiles(relativeModulePath: string) {
173+
const excludes = {
174+
testModules: false,
175+
tenantModules: true,
176+
};
177+
173178
const files = await this.repo.processFilesGlob(
174179
`${relativeModulePath}/${TEST_MODULE_GLOB}/terragrunt.hcl`,
175180
(file) => file,
176-
false,
181+
excludes,
177182
);
178183

179184
// a terragrunt stack conists of multiple executable terragrunt files

src/kit/KitDependencyAnalyzer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,14 @@ export class KitDependencyAnalyzer {
6161
this.logger,
6262
);
6363

64+
const excludes = {
65+
tenantModules: true,
66+
testModules: true,
67+
};
6468
const q = await this.collie.processFilesGlob(
6569
`${relativePlatformPath}/**/terragrunt.hcl`,
6670
(file) => this.tryParseDependency(file.path),
71+
excludes,
6772
);
6873

6974
const all = await Promise.all(q);

src/model/CollieRepository.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as fs from "std/fs";
22
import * as path from "std/path";
33

44
export const TEST_MODULE_GLOB = "**/*.test";
5+
export const TENANT_MODULE_GLOB = "**/tenants";
56

67
export class CollieRepository {
78
private constructor(private readonly repoDir: string) {
@@ -52,7 +53,13 @@ export class CollieRepository {
5253
async processFilesGlob<T>(
5354
pattern: string,
5455
process: (file: fs.WalkEntry) => T | undefined,
55-
excludeTestModules = true,
56+
excludes: {
57+
testModules: boolean;
58+
tenantModules: boolean;
59+
} = {
60+
testModules: true,
61+
tenantModules: false,
62+
},
5663
): Promise<T[]> {
5764
const q: T[] = [];
5865
for await (
@@ -70,7 +77,8 @@ export class CollieRepository {
7077
"kit/**/modules", // exclude sub-modules
7178
"kit/**/template", // exclude template files
7279

73-
...(excludeTestModules ? [TEST_MODULE_GLOB] : []),
80+
...(excludes.testModules ? [TEST_MODULE_GLOB] : []),
81+
...(excludes.tenantModules ? [TENANT_MODULE_GLOB] : []),
7482
],
7583
})
7684
) {

0 commit comments

Comments
 (0)