@muverse/core 0.1.14 → 0.2.1

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.
package/README.md CHANGED
@@ -104,12 +104,14 @@ interface RunnerResult {
104
104
  Built-in support for Gradle projects (Groovy & Kotlin DSL).
105
105
 
106
106
  **Features:**
107
+
107
108
  - Multi-module project detection
108
109
  - Version management through root `gradle.properties`
109
110
  - Dependency detection
110
111
  - Both Groovy and Kotlin DSL support
111
112
 
112
113
  **Version Format:**
114
+
113
115
  ```properties
114
116
  # Root module
115
117
  version=1.0.0
@@ -3,10 +3,11 @@ import { ProjectInformation, RawProjectInformation } from '../project-informatio
3
3
  * Executes Gradle to collect raw project structure information.
4
4
  * Runs gradlew with init script to output JSON containing module hierarchy, versions, and dependencies.
5
5
  * @param projectRoot - Absolute path to the Gradle project root directory
6
+ * @param outputFile - Path to output JSON file to be generated
6
7
  * @returns Promise resolving to raw project information as JSON
7
8
  * @throws {Error} If initialization script not found or Gradle execution fails
8
9
  */
9
- export declare function getRawProjectInformation(projectRoot: string): Promise<RawProjectInformation>;
10
+ export declare function getRawProjectInformation(projectRoot: string, outputFile: string): Promise<RawProjectInformation>;
10
11
  /**
11
12
  * Transforms raw project information into structured, queryable format.
12
13
  * Normalizes modules, identifies root, parses versions, and maps dependencies.
@@ -1 +1 @@
1
- {"version":3,"file":"gradle-project-information.d.ts","sourceRoot":"","sources":["../../../src/adapters/gradle/gradle-project-information.ts"],"names":[],"mappings":"AAGA,OAAO,EAAU,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAiB9F;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAoDlG;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,kBAAkB,EAAE,qBAAqB,GAAG,kBAAkB,CA6CnG"}
1
+ {"version":3,"file":"gradle-project-information.d.ts","sourceRoot":"","sources":["../../../src/adapters/gradle/gradle-project-information.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAwH1G;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA0DtH;AA2CD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,kBAAkB,EAAE,qBAAqB,GAAG,kBAAkB,CA6CnG"}
@@ -4,6 +4,9 @@ import { exists } from '../../utils/file.js';
4
4
  import { fileURLToPath } from 'url';
5
5
  import { execa } from 'execa';
6
6
  import fs from 'fs/promises';
7
+ import crypto from 'crypto';
8
+ import fg from 'fast-glob';
9
+ import { parseProperties } from '../../utils/properties.js';
7
10
  /**
8
11
  * Name of the Gradle wrapper script file.
9
12
  * Ensures consistent builds without requiring pre-installed Gradle.
@@ -15,13 +18,50 @@ const GRADLE_WRAPPER = 'gradlew';
15
18
  */
16
19
  const GRADLE_INIT_SCRIPT = './init-project-information.gradle.kts';
17
20
  /**
18
- * Executes Gradle to collect raw project structure information.
19
- * Runs gradlew with init script to output JSON containing module hierarchy, versions, and dependencies.
21
+ * Finds all Gradle build files recursively under the project root.
22
+ * Searches for settings.gradle, settings.gradle.kts, build.gradle, and build.gradle.kts files.
20
23
  * @param projectRoot - Absolute path to the Gradle project root directory
21
- * @returns Promise resolving to raw project information as JSON
24
+ * @returns Promise resolving to array of absolute paths to Gradle build files
25
+ */
26
+ async function findGradleFiles(projectRoot) {
27
+ const patterns = [
28
+ '**/settings.gradle',
29
+ '**/settings.gradle.kts',
30
+ '**/build.gradle',
31
+ '**/build.gradle.kts'
32
+ ];
33
+ const files = await fg(patterns, {
34
+ cwd: projectRoot,
35
+ absolute: true,
36
+ ignore: ['**/node_modules/**', '**/build/**', '**/.gradle/**']
37
+ });
38
+ // Sort for consistent ordering
39
+ return files.sort();
40
+ }
41
+ /**
42
+ * Computes SHA-256 hash of all Gradle build files.
43
+ * Used to detect changes in project configuration that would invalidate cached information.
44
+ * @param projectRoot - Absolute path to the Gradle project root directory
45
+ * @returns Promise resolving to hexadecimal hash string
46
+ */
47
+ async function computeGradleFilesHash(projectRoot) {
48
+ const files = await findGradleFiles(projectRoot);
49
+ const hash = crypto.createHash('sha256');
50
+ for (const file of files) {
51
+ const content = await fs.readFile(file, 'utf-8');
52
+ hash.update(file); // Include file path for uniqueness
53
+ hash.update(content);
54
+ }
55
+ return hash.digest('hex');
56
+ }
57
+ /**
58
+ * Executes the Gradle wrapper script to generate project information.
59
+ * Runs gradlew with initialization script to create the project-information.json file.
60
+ * @param projectRoot - Absolute path to the Gradle project root directory
61
+ * @param outputFile - Path to output JSON file to be generated
22
62
  * @throws {Error} If initialization script not found or Gradle execution fails
23
63
  */
24
- export async function getRawProjectInformation(projectRoot) {
64
+ async function executeGradleScript(projectRoot, outputFile) {
25
65
  const gradlew = join(projectRoot, GRADLE_WRAPPER);
26
66
  const dirname = path.dirname(fileURLToPath(import.meta.url));
27
67
  const initScriptPath = join(dirname, GRADLE_INIT_SCRIPT);
@@ -37,7 +77,8 @@ export async function getRawProjectInformation(projectRoot) {
37
77
  '--console=plain', // Disable ANSI formatting
38
78
  '--init-script', // Inject initialization script
39
79
  initScriptPath,
40
- 'structure' // Custom task that outputs project structure
80
+ 'structure', // Custom task that outputs project structure
81
+ `-PprojectInfoOutput=${outputFile}`
41
82
  ];
42
83
  // Execute Gradle wrapper with the prepared arguments
43
84
  const result = await execa(gradlew, args, {
@@ -48,17 +89,85 @@ export async function getRawProjectInformation(projectRoot) {
48
89
  if (result.exitCode !== 0) {
49
90
  throw new Error(`Gradle command failed with exit code ${result.exitCode}: ${result.stderr}`);
50
91
  }
51
- const file = join(projectRoot, 'build', 'project-information.json');
92
+ }
93
+ /**
94
+ * Executes Gradle to collect raw project structure information.
95
+ * Runs gradlew with init script to output JSON containing module hierarchy, versions, and dependencies.
96
+ * @param projectRoot - Absolute path to the Gradle project root directory
97
+ * @param outputFile - Path to output JSON file to be generated
98
+ * @returns Promise resolving to raw project information as JSON
99
+ * @throws {Error} If initialization script not found or Gradle execution fails
100
+ */
101
+ export async function getRawProjectInformation(projectRoot, outputFile) {
102
+ // Step 1: Check if project-information.json exists
103
+ const fileExists = await exists(outputFile);
104
+ if (fileExists) {
105
+ // Step 2: File exists, check cache validity
106
+ try {
107
+ const fileContent = await fs.readFile(outputFile, 'utf-8');
108
+ const cachedData = JSON.parse(fileContent);
109
+ // Step 2.1 & 2.2: Compute hash of all Gradle build files
110
+ const currentHash = await computeGradleFilesHash(projectRoot);
111
+ // Step 2.3 & 2.4: Compare hashes
112
+ if (cachedData.hash === currentHash) {
113
+ // Cache hit - return cached data
114
+ return cachedData.data;
115
+ }
116
+ // Cache miss - hash mismatch, need to regenerate
117
+ }
118
+ catch (error) {
119
+ // If there's any error reading/parsing cached file, regenerate
120
+ console.warn(`Failed to read cached project information: ${error}`);
121
+ }
122
+ }
123
+ // Step 3: File doesn't exist or cache is invalid - execute Gradle script
124
+ await executeGradleScript(projectRoot, outputFile);
52
125
  // Verify that the output file was created
53
- const fileExists = await exists(file);
54
- if (!fileExists) {
55
- throw new Error(`Expected output file not found at ${file}. ` +
126
+ const fileExistsAfterExec = await exists(outputFile);
127
+ if (!fileExistsAfterExec) {
128
+ throw new Error(`Expected output file not found at ${outputFile}. ` +
56
129
  `Ensure that the Gradle init script is correctly generating the project information.`);
57
130
  }
58
131
  // Read the output file content
59
- const projectInformation = await fs.readFile(file, 'utf-8');
132
+ const projectInformationContent = await fs.readFile(outputFile, 'utf-8');
60
133
  // Parse JSON output from Gradle
61
- return JSON.parse(projectInformation.trim() || '{}');
134
+ const gradleProjectInformation = JSON.parse(projectInformationContent.trim() || '{}');
135
+ // Read gradle.properites and add version
136
+ const projectInformation = await getInformationWithVersions(projectRoot, gradleProjectInformation);
137
+ // Compute hash and save with cache information
138
+ const currentHash = await computeGradleFilesHash(projectRoot);
139
+ const cachedData = {
140
+ hash: currentHash,
141
+ data: projectInformation
142
+ };
143
+ // Write back to file with hash for future cache validation
144
+ await fs.writeFile(outputFile, JSON.stringify(cachedData, null, 2), 'utf-8');
145
+ return projectInformation;
146
+ }
147
+ /**
148
+ * Reads gradle.properties to extract module versions and augment raw project information.
149
+ * @param projectRoot - Absolute path to the Gradle project root directory
150
+ * @param projectInformation - Gradle project information without versions
151
+ * @returns Promise resolving to augmented RawProjectInformation with versions
152
+ */
153
+ async function getInformationWithVersions(projectRoot, projectInformation) {
154
+ const gradlePropertiesFile = join(projectRoot, 'gradle.properties');
155
+ const gradlePropertiesExists = await exists(gradlePropertiesFile);
156
+ const result = {};
157
+ let moduleVersions = new Map();
158
+ if (gradlePropertiesExists) {
159
+ moduleVersions = await parseProperties(gradlePropertiesFile);
160
+ for (const [moduleId, module] of Object.entries(projectInformation)) {
161
+ const version = moduleVersions.get(module.versionProperty);
162
+ const resultVersion = version ? version : undefined;
163
+ result[moduleId] = {
164
+ ...module,
165
+ version: resultVersion,
166
+ declaredVersion: resultVersion !== undefined
167
+ };
168
+ }
169
+ }
170
+ return result;
62
171
  }
63
172
  /**
64
173
  * Transforms raw project information into structured, queryable format.
@@ -127,10 +127,8 @@ gradle.rootProject {
127
127
  mapOf(
128
128
  "path" to projectInfo["path"],
129
129
  "affectedModules" to affectedModules.toSortedSet(),
130
- "version" to projectInfo["version"],
131
130
  "type" to projectInfo["type"],
132
131
  "name" to projectInfo["name"],
133
- "declaredVersion" to projectInfo["declaredVersion"],
134
132
  "versionProperty" to projectInfo["versionProperty"]
135
133
  )
136
134
  }
@@ -6,8 +6,9 @@ import { ModuleRegistry } from '../../../services/module-registry.js';
6
6
  */
7
7
  export declare class GradleModuleDetector implements ModuleDetector {
8
8
  readonly repoRoot: string;
9
+ readonly outputFile: string;
9
10
  /** Absolute path to the repository root directory. */
10
- constructor(repoRoot: string);
11
+ constructor(repoRoot: string, outputFile: string);
11
12
  /**
12
13
  * Detects and catalogs all modules in the Gradle project.
13
14
  * @returns ModuleRegistry containing all discovered modules and their relationships
@@ -1 +1 @@
1
- {"version":3,"file":"gradle-module-detector.d.ts","sourceRoot":"","sources":["../../../../src/adapters/gradle/services/gradle-module-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAMtE;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,cAAc;IAE7C,QAAQ,CAAC,QAAQ,EAAE,MAAM;IADrC,sDAAsD;gBACjC,QAAQ,EAAE,MAAM;IAErC;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC;CAUxC"}
1
+ {"version":3,"file":"gradle-module-detector.d.ts","sourceRoot":"","sources":["../../../../src/adapters/gradle/services/gradle-module-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAMtE;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,cAAc;IAE7C,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM;IADlE,sDAAsD;gBACjC,QAAQ,EAAE,MAAM,EAAW,UAAU,EAAE,MAAM;IAElE;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC;CAUxC"}
@@ -6,9 +6,11 @@ import { getRawProjectInformation, getProjectInformation } from '../gradle-proje
6
6
  */
7
7
  export class GradleModuleDetector {
8
8
  repoRoot;
9
+ outputFile;
9
10
  /** Absolute path to the repository root directory. */
10
- constructor(repoRoot) {
11
+ constructor(repoRoot, outputFile) {
11
12
  this.repoRoot = repoRoot;
13
+ this.outputFile = outputFile;
12
14
  }
13
15
  /**
14
16
  * Detects and catalogs all modules in the Gradle project.
@@ -17,7 +19,7 @@ export class GradleModuleDetector {
17
19
  */
18
20
  async detect() {
19
21
  // Step 1: Execute Gradle and collect raw project structure data
20
- const rawProjectInformation = await getRawProjectInformation(this.repoRoot);
22
+ const rawProjectInformation = await getRawProjectInformation(this.repoRoot, this.outputFile);
21
23
  // Step 2: Parse and transform raw data into structured module information
22
24
  const projectInformation = getProjectInformation(rawProjectInformation);
23
25
  // Step 3: Create a registry for efficient module access and querying
@@ -12,11 +12,13 @@ export declare class GradleModuleSystemFactory implements ModuleSystemFactory {
12
12
  constructor(repoRoot: string);
13
13
  /**
14
14
  * Creates a Gradle-specific module detector.
15
+ * @param outputFile - Path to the output file for project information
15
16
  * @returns GradleModuleDetector instance configured with the repository root
16
17
  */
17
- createDetector(): ModuleDetector;
18
+ createDetector(outputFile: string): ModuleDetector;
18
19
  /**
19
20
  * Creates a Gradle-specific version update strategy.
21
+ * @param moduleRegistry - ModuleRegistry containing all detected modules
20
22
  * @returns GradleVersionUpdateStrategy instance configured with the repository root
21
23
  */
22
24
  createVersionUpdateStrategy(moduleRegistry: ModuleRegistry): VersionUpdateStrategy;
@@ -1 +1 @@
1
- {"version":3,"file":"gradle-module-system-factory.d.ts","sourceRoot":"","sources":["../../../../src/adapters/gradle/services/gradle-module-system-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAGrF,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE;;;GAGG;AACH,qBAAa,yBAA0B,YAAW,mBAAmB;IAEvD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IADrC,sDAAsD;gBACzB,QAAQ,EAAE,MAAM;IAE7C;;;OAGG;IACH,cAAc,IAAI,cAAc;IAIhC;;;OAGG;IACH,2BAA2B,CAAC,cAAc,EAAE,cAAc,GAAG,qBAAqB;CAGnF"}
1
+ {"version":3,"file":"gradle-module-system-factory.d.ts","sourceRoot":"","sources":["../../../../src/adapters/gradle/services/gradle-module-system-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAGrF,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE;;;GAGG;AACH,qBAAa,yBAA0B,YAAW,mBAAmB;IAEvD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IADrC,sDAAsD;gBACzB,QAAQ,EAAE,MAAM;IAE7C;;;;OAIG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc;IAIlD;;;;OAIG;IACH,2BAA2B,CAAC,cAAc,EAAE,cAAc,GAAG,qBAAqB;CAGnF"}
@@ -12,13 +12,15 @@ export class GradleModuleSystemFactory {
12
12
  }
13
13
  /**
14
14
  * Creates a Gradle-specific module detector.
15
+ * @param outputFile - Path to the output file for project information
15
16
  * @returns GradleModuleDetector instance configured with the repository root
16
17
  */
17
- createDetector() {
18
- return new GradleModuleDetector(this.repoRoot);
18
+ createDetector(outputFile) {
19
+ return new GradleModuleDetector(this.repoRoot, outputFile);
19
20
  }
20
21
  /**
21
22
  * Creates a Gradle-specific version update strategy.
23
+ * @param moduleRegistry - ModuleRegistry containing all detected modules
22
24
  * @returns GradleVersionUpdateStrategy instance configured with the repository root
23
25
  */
24
26
  createVersionUpdateStrategy(moduleRegistry) {
@@ -1 +1 @@
1
- {"version":3,"file":"gradle-version-update-strategy.d.ts","sourceRoot":"","sources":["../../../../src/adapters/gradle/services/gradle-version-update-strategy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAGrF,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE;;;GAGG;AACH,qBAAa,2BAA4B,YAAW,qBAAqB;IAQzC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAP7D,mDAAmD;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IAEzC;;;OAGG;gBACS,QAAQ,EAAE,MAAM,EAAmB,cAAc,EAAE,cAAc;IAI7E;;;;OAIG;IACG,mBAAmB,CAAC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAgB9E"}
1
+ {"version":3,"file":"gradle-version-update-strategy.d.ts","sourceRoot":"","sources":["../../../../src/adapters/gradle/services/gradle-version-update-strategy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAGrF,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE;;;GAGG;AACH,qBAAa,2BAA4B,YAAW,qBAAqB;IAQzC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAP7D,mDAAmD;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IAEzC;;;OAGG;gBACS,QAAQ,EAAE,MAAM,EAAmB,cAAc,EAAE,cAAc;IAI7E;;;;OAIG;IACG,mBAAmB,CAAC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAe9E"}
@@ -31,10 +31,9 @@ export type ProjectInformation = {
31
31
  readonly rootModule: string;
32
32
  };
33
33
  /**
34
- * Raw module data as extracted from the build system before processing.
35
- * Similar to Module but with arrays instead of Sets and optional string version.
34
+ * Base module data structure without the module ID and with version as a string.
36
35
  */
37
- export type RawModule = {
36
+ export type BaseModule = {
38
37
  /** Human-readable name of the module. */
39
38
  readonly name: string;
40
39
  /** Relative path from repository root to the module directory. */
@@ -47,7 +46,12 @@ export type RawModule = {
47
46
  readonly type: "module" | "root";
48
47
  /** Whether the version is explicitly declared in build configuration. */
49
48
  readonly declaredVersion: boolean;
50
- } & Record<string, unknown>;
49
+ };
50
+ /**
51
+ * Raw module data as extracted from the build system before processing.
52
+ * Similar to Module but with arrays instead of Sets and optional string version.
53
+ */
54
+ export type RawModule = BaseModule & Record<string, unknown>;
51
55
  /**
52
56
  * Raw project structure information as extracted from the build system.
53
57
  * Maps module IDs to their raw module data.
@@ -1 +1 @@
1
- {"version":3,"file":"project-information.d.ts","sourceRoot":"","sources":["../../src/adapters/project-information.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,oFAAoF;IACpF,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IAEjC,oEAAoE;IACpE,QAAQ,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEtC,8CAA8C;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,wFAAwF;IACxF,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAE7B,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9C,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,yCAAyC;IACz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,kBAAkB,GAAG;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAE7B,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9C,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,6DAA6D;IAC7D,QAAQ,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;IAEnC,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE1B,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IAEjC,yEAAyE;IACzE,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,CAAC"}
@@ -12,12 +12,14 @@ export interface ModuleSystemFactory {
12
12
  /**
13
13
  * Creates a module detector for discovering modules.
14
14
  *
15
+ * @param outputFile - Path to the output file for project information
15
16
  * @returns {@link ModuleDetector} configured for this build system
16
17
  */
17
- createDetector(): ModuleDetector;
18
+ createDetector(outputFile: string): ModuleDetector;
18
19
  /**
19
20
  * Creates a version update strategy for writing versions to build files.
20
21
  *
22
+ * @param moduleRegistry - ModuleRegistry containing all detected modules
21
23
  * @returns {@link VersionUpdateStrategy} configured for this build system
22
24
  */
23
25
  createVersionUpdateStrategy(moduleRegistry: ModuleRegistry): VersionUpdateStrategy;
@@ -1 +1 @@
1
- {"version":3,"file":"module-system-factory.d.ts","sourceRoot":"","sources":["../../src/services/module-system-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,cAAc,IAAI,cAAc,CAAC;IAEjC;;;;OAIG;IACH,2BAA2B,CACzB,cAAc,EAAE,cAAc,GAC7B,qBAAqB,CAAC;CAC1B"}
1
+ {"version":3,"file":"module-system-factory.d.ts","sourceRoot":"","sources":["../../src/services/module-system-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAAC;IAEnD;;;;;OAKG;IACH,2BAA2B,CACzB,cAAc,EAAE,cAAc,GAC7B,qBAAqB,CAAC;CAC1B"}
@@ -13,6 +13,7 @@ export type RunnerOptions = {
13
13
  readonly appendSnapshot: boolean;
14
14
  readonly pushChanges: boolean;
15
15
  readonly generateChangelog: boolean;
16
+ readonly outputFile: string;
16
17
  };
17
18
  export type RunnerResult = {
18
19
  readonly bumped: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"verse-runner.d.ts","sourceRoot":"","sources":["../../src/services/verse-runner.ts"],"names":[],"mappings":"AAYA,OAAO,EAGL,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAO9B,OAAO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,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;CACnC,CAAC;AAEF,qBAAa,WAAW;IACtB,OAAO,CAAC,mBAAmB,CAAuB;IAClD,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,OAAO,CAAgB;IAG/B,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,yBAAyB,CAA4B;IAC7D,OAAO,CAAC,uBAAuB,CAA0B;gBAE7C,OAAO,EAAE,aAAa;IA0BlC,OAAO,CAAC,cAAc;IAsBtB,OAAO,CAAC,eAAe;IAgCjB,GAAG,IAAI,OAAO,CAAC,YAAY,CAAC;YAYpB,KAAK;CAkIpB"}
@@ -34,6 +34,7 @@ export class VerseRunner {
34
34
  this.options = {
35
35
  ...options,
36
36
  repoRoot: path.resolve(options.repoRoot),
37
+ outputFile: path.resolve(options.outputFile),
37
38
  };
38
39
  // Initialize services
39
40
  this.configurationLoader = new ConfigurationLoader(new ConfigurationValidator());
@@ -116,7 +117,7 @@ export class VerseRunner {
116
117
  }
117
118
  // Discover modules and get hierarchy manager
118
119
  logger.info("🔍 Discovering modules...");
119
- const detector = this.moduleSystemFactory.createDetector();
120
+ const detector = this.moduleSystemFactory.createDetector(this.options.outputFile);
120
121
  this.moduleRegistry = await detector.detect();
121
122
  // Log discovered modules through hierarchy manager
122
123
  const moduleIds = this.moduleRegistry.getModuleIds();
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Parse a generic properties file into key-value pairs
3
+ * Supports both '=' and ':' as delimiters
4
+ * Skips comments (lines starting with # or !) and empty lines
5
+ * @param propertiesPath - Path to the properties file
6
+ * @returns Map of property keys to values
7
+ */
8
+ export declare function parseProperties(propertiesPath: string): Promise<Map<string, string>>;
1
9
  /**
2
10
  * Updates or inserts a single property in a Java-style properties file.
3
11
  * @param propertiesPath - Path to the properties file
@@ -1 +1 @@
1
- {"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src/utils/properties.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC,CAgDf"}
1
+ {"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src/utils/properties.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAiC9B;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC,CAgDf"}
@@ -1,5 +1,37 @@
1
1
  import { promises as fs } from "fs";
2
2
  import { exists } from "./file.js";
3
+ /**
4
+ * Parse a generic properties file into key-value pairs
5
+ * Supports both '=' and ':' as delimiters
6
+ * Skips comments (lines starting with # or !) and empty lines
7
+ * @param propertiesPath - Path to the properties file
8
+ * @returns Map of property keys to values
9
+ */
10
+ export async function parseProperties(propertiesPath) {
11
+ const content = await fs.readFile(propertiesPath, "utf8");
12
+ const properties = new Map();
13
+ // Parse all properties line by line
14
+ const lines = content.split("\n");
15
+ for (const line of lines) {
16
+ const trimmedLine = line.trim();
17
+ // Skip comments and empty lines
18
+ if (trimmedLine.startsWith("#") ||
19
+ trimmedLine.startsWith("!") ||
20
+ !trimmedLine) {
21
+ continue;
22
+ }
23
+ // Parse property: key=value or key:value
24
+ const match = trimmedLine.match(/^([^=:]+)[=:]\s*(.+)$/);
25
+ if (!match) {
26
+ continue;
27
+ }
28
+ const [, key, value] = match;
29
+ const trimmedKey = key.trim();
30
+ const trimmedValue = value.trim();
31
+ properties.set(trimmedKey, trimmedValue);
32
+ }
33
+ return properties;
34
+ }
3
35
  /**
4
36
  * Updates or inserts a single property in a Java-style properties file.
5
37
  * @param propertiesPath - Path to the properties file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muverse/core",
3
- "version": "0.1.14",
3
+ "version": "0.2.1",
4
4
  "description": "Version Engine for Repo Semantic Evolution (Core Library)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -46,8 +46,10 @@
46
46
  "dependencies": {
47
47
  "conventional-commits-parser": "^6.2.1",
48
48
  "cosmiconfig": "^9.0.0",
49
+ "crypto": "^1.0.1",
49
50
  "deepmerge": "^4.3.1",
50
51
  "execa": "^9.6.1",
52
+ "fast-glob": "^3.3.3",
51
53
  "semver": "^7.5.4",
52
54
  "yaml": "^2.3.4",
53
55
  "zod": "^4.1.12"