aicm 0.20.1 → 0.20.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withWorkingDirectory = withWorkingDirectory;
4
- /**
5
- * Helper function to execute a function within a specific working directory
6
- * and ensure the original directory is always restored
7
- */
8
- async function withWorkingDirectory(targetDir, fn) {
9
- const originalCwd = process.cwd();
10
- if (targetDir !== originalCwd) {
11
- process.chdir(targetDir);
12
- }
13
- try {
14
- return await fn();
15
- }
16
- finally {
17
- if (targetDir !== originalCwd) {
18
- process.chdir(originalCwd);
19
- }
20
- }
21
- }
@@ -1,13 +0,0 @@
1
- import { ResolvedConfig } from "./config";
2
- /**
3
- * Discover all packages with aicm configurations using git ls-files
4
- */
5
- export declare function findAicmFiles(rootDir: string): string[];
6
- /**
7
- * Discover all packages with aicm configurations
8
- */
9
- export declare function discoverPackagesWithAicm(rootDir: string): Promise<Array<{
10
- relativePath: string;
11
- absolutePath: string;
12
- config: ResolvedConfig;
13
- }>>;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.findAicmFiles = findAicmFiles;
7
- exports.discoverPackagesWithAicm = discoverPackagesWithAicm;
8
- const child_process_1 = require("child_process");
9
- const path_1 = __importDefault(require("path"));
10
- const config_1 = require("./config");
11
- /**
12
- * Discover all packages with aicm configurations using git ls-files
13
- */
14
- function findAicmFiles(rootDir) {
15
- try {
16
- const output = (0, child_process_1.execSync)("git ls-files --cached --others --exclude-standard aicm.json **/aicm.json", {
17
- cwd: rootDir,
18
- encoding: "utf8",
19
- });
20
- return output
21
- .trim()
22
- .split("\n")
23
- .filter(Boolean)
24
- .map((file) => path_1.default.resolve(rootDir, file));
25
- }
26
- catch (_a) {
27
- // Fallback to manual search if git is not available
28
- return [];
29
- }
30
- }
31
- /**
32
- * Discover all packages with aicm configurations
33
- */
34
- async function discoverPackagesWithAicm(rootDir) {
35
- const aicmFiles = findAicmFiles(rootDir);
36
- const packages = [];
37
- for (const aicmFile of aicmFiles) {
38
- const packageDir = path_1.default.dirname(aicmFile);
39
- const relativePath = path_1.default.relative(rootDir, packageDir);
40
- // Normalize to forward slashes for cross-platform compatibility
41
- const normalizedRelativePath = relativePath.replace(/\\/g, "/");
42
- const config = await (0, config_1.loadConfig)(packageDir);
43
- if (config) {
44
- packages.push({
45
- relativePath: normalizedRelativePath || ".",
46
- absolutePath: packageDir,
47
- config,
48
- });
49
- }
50
- }
51
- // Sort packages by relativePath for deterministic order
52
- return packages.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
53
- }