@muverse/core 0.1.13 → 0.2.0

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,CAuCnG"}
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;AAmH9F;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuDtH;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,kBAAkB,EAAE,qBAAqB,GAAG,kBAAkB,CA6CnG"}
@@ -4,6 +4,8 @@ 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';
7
9
  /**
8
10
  * Name of the Gradle wrapper script file.
9
11
  * Ensures consistent builds without requiring pre-installed Gradle.
@@ -15,13 +17,50 @@ const GRADLE_WRAPPER = 'gradlew';
15
17
  */
16
18
  const GRADLE_INIT_SCRIPT = './init-project-information.gradle.kts';
17
19
  /**
18
- * Executes Gradle to collect raw project structure information.
19
- * Runs gradlew with init script to output JSON containing module hierarchy, versions, and dependencies.
20
+ * Finds all Gradle build files recursively under the project root.
21
+ * Searches for settings.gradle, settings.gradle.kts, build.gradle, and build.gradle.kts files.
20
22
  * @param projectRoot - Absolute path to the Gradle project root directory
21
- * @returns Promise resolving to raw project information as JSON
23
+ * @returns Promise resolving to array of absolute paths to Gradle build files
24
+ */
25
+ async function findGradleFiles(projectRoot) {
26
+ const patterns = [
27
+ '**/settings.gradle',
28
+ '**/settings.gradle.kts',
29
+ '**/build.gradle',
30
+ '**/build.gradle.kts'
31
+ ];
32
+ const files = await fg(patterns, {
33
+ cwd: projectRoot,
34
+ absolute: true,
35
+ ignore: ['**/node_modules/**', '**/build/**', '**/.gradle/**']
36
+ });
37
+ // Sort for consistent ordering
38
+ return files.sort();
39
+ }
40
+ /**
41
+ * Computes SHA-256 hash of all Gradle build files.
42
+ * Used to detect changes in project configuration that would invalidate cached information.
43
+ * @param projectRoot - Absolute path to the Gradle project root directory
44
+ * @returns Promise resolving to hexadecimal hash string
45
+ */
46
+ async function computeGradleFilesHash(projectRoot) {
47
+ const files = await findGradleFiles(projectRoot);
48
+ const hash = crypto.createHash('sha256');
49
+ for (const file of files) {
50
+ const content = await fs.readFile(file, 'utf-8');
51
+ hash.update(file); // Include file path for uniqueness
52
+ hash.update(content);
53
+ }
54
+ return hash.digest('hex');
55
+ }
56
+ /**
57
+ * Executes the Gradle wrapper script to generate project information.
58
+ * Runs gradlew with initialization script to create the project-information.json file.
59
+ * @param projectRoot - Absolute path to the Gradle project root directory
60
+ * @param outputFile - Path to output JSON file to be generated
22
61
  * @throws {Error} If initialization script not found or Gradle execution fails
23
62
  */
24
- export async function getRawProjectInformation(projectRoot) {
63
+ async function executeGradleScript(projectRoot, outputFile) {
25
64
  const gradlew = join(projectRoot, GRADLE_WRAPPER);
26
65
  const dirname = path.dirname(fileURLToPath(import.meta.url));
27
66
  const initScriptPath = join(dirname, GRADLE_INIT_SCRIPT);
@@ -37,7 +76,8 @@ export async function getRawProjectInformation(projectRoot) {
37
76
  '--console=plain', // Disable ANSI formatting
38
77
  '--init-script', // Inject initialization script
39
78
  initScriptPath,
40
- 'structure' // Custom task that outputs project structure
79
+ 'structure', // Custom task that outputs project structure
80
+ `-PprojectInfoOutput=${outputFile}`
41
81
  ];
42
82
  // Execute Gradle wrapper with the prepared arguments
43
83
  const result = await execa(gradlew, args, {
@@ -48,17 +88,58 @@ export async function getRawProjectInformation(projectRoot) {
48
88
  if (result.exitCode !== 0) {
49
89
  throw new Error(`Gradle command failed with exit code ${result.exitCode}: ${result.stderr}`);
50
90
  }
51
- const file = join(projectRoot, 'build', 'project-information.json');
91
+ }
92
+ /**
93
+ * Executes Gradle to collect raw project structure information.
94
+ * Runs gradlew with init script to output JSON containing module hierarchy, versions, and dependencies.
95
+ * @param projectRoot - Absolute path to the Gradle project root directory
96
+ * @param outputFile - Path to output JSON file to be generated
97
+ * @returns Promise resolving to raw project information as JSON
98
+ * @throws {Error} If initialization script not found or Gradle execution fails
99
+ */
100
+ export async function getRawProjectInformation(projectRoot, outputFile) {
101
+ // Step 1: Check if project-information.json exists
102
+ const fileExists = await exists(outputFile);
103
+ if (fileExists) {
104
+ // Step 2: File exists, check cache validity
105
+ try {
106
+ const fileContent = await fs.readFile(outputFile, 'utf-8');
107
+ const cachedData = JSON.parse(fileContent);
108
+ // Step 2.1 & 2.2: Compute hash of all Gradle build files
109
+ const currentHash = await computeGradleFilesHash(projectRoot);
110
+ // Step 2.3 & 2.4: Compare hashes
111
+ if (cachedData.hash === currentHash) {
112
+ // Cache hit - return cached data
113
+ return cachedData.data;
114
+ }
115
+ // Cache miss - hash mismatch, need to regenerate
116
+ }
117
+ catch (error) {
118
+ // If there's any error reading/parsing cached file, regenerate
119
+ console.warn(`Failed to read cached project information: ${error}`);
120
+ }
121
+ }
122
+ // Step 3: File doesn't exist or cache is invalid - execute Gradle script
123
+ await executeGradleScript(projectRoot, outputFile);
52
124
  // 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}. ` +
125
+ const fileExistsAfterExec = await exists(outputFile);
126
+ if (!fileExistsAfterExec) {
127
+ throw new Error(`Expected output file not found at ${outputFile}. ` +
56
128
  `Ensure that the Gradle init script is correctly generating the project information.`);
57
129
  }
58
130
  // Read the output file content
59
- const projectInformation = await fs.readFile(file, 'utf-8');
131
+ const projectInformationContent = await fs.readFile(outputFile, 'utf-8');
60
132
  // Parse JSON output from Gradle
61
- return JSON.parse(projectInformation.trim() || '{}');
133
+ const projectInformation = JSON.parse(projectInformationContent.trim() || '{}');
134
+ // Compute hash and save with cache information
135
+ const currentHash = await computeGradleFilesHash(projectRoot);
136
+ const cachedData = {
137
+ hash: currentHash,
138
+ data: projectInformation
139
+ };
140
+ // Write back to file with hash for future cache validation
141
+ await fs.writeFile(outputFile, JSON.stringify(cachedData, null, 2), 'utf-8');
142
+ return projectInformation;
62
143
  }
63
144
  /**
64
145
  * Transforms raw project information into structured, queryable format.
@@ -72,23 +153,27 @@ export function getProjectInformation(projectInformation) {
72
153
  const modules = new Map();
73
154
  // Find root module by looking for the one with type 'root'
74
155
  let rootModule;
75
- for (const [moduleId, module] of Object.entries(projectInformation)) {
76
- if (module.type === 'root') {
156
+ for (const [moduleId, rawModule] of Object.entries(projectInformation)) {
157
+ if (rawModule.type === 'root') {
77
158
  rootModule = moduleId;
78
159
  }
79
160
  // Create normalized Module object
80
- modules.set(moduleId, {
161
+ const module = {
81
162
  id: moduleId,
82
- name: module.name,
83
- path: module.path,
84
- type: module.type,
85
- affectedModules: new Set(module.affectedModules),
163
+ name: rawModule.name,
164
+ path: rawModule.path,
165
+ type: rawModule.type,
166
+ affectedModules: new Set(rawModule.affectedModules),
86
167
  // Parse version if present, otherwise create initial version
87
- version: module.version === undefined ?
168
+ version: rawModule.version === undefined ?
88
169
  createInitialVersion() :
89
- parseSemVer(module.version),
90
- declaredVersion: module.declaredVersion,
91
- });
170
+ parseSemVer(rawModule.version),
171
+ declaredVersion: rawModule.declaredVersion,
172
+ };
173
+ if ('versionProperty' in rawModule) {
174
+ module['versionProperty'] = rawModule.versionProperty;
175
+ }
176
+ modules.set(moduleId, module);
92
177
  }
93
178
  // Validate that a root module was found
94
179
  if (!rootModule) {
@@ -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) {
@@ -47,7 +47,7 @@ export type RawModule = {
47
47
  readonly type: "module" | "root";
48
48
  /** Whether the version is explicitly declared in build configuration. */
49
49
  readonly declaredVersion: boolean;
50
- };
50
+ } & Record<string, unknown>;
51
51
  /**
52
52
  * Raw project structure information as extracted from the build system.
53
53
  * 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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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,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B;;;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,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAK5D,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,Q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c,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;CAgIpB"}
@@ -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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muverse/core",
3
- "version": "0.1.13",
3
+ "version": "0.2.0",
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"