Skip to content

Commit dda981d

Browse files
committed
feat(dart_source_generator): return boolean indicating if generation was successful
1 parent 2a524c7 commit dda981d

File tree

1 file changed

+6
-2
lines changed
  • packages/globe_runtime_ts/dart_source_generator/src

1 file changed

+6
-2
lines changed

packages/globe_runtime_ts/dart_source_generator/src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import type { GenerateDartSourceOptions } from "./types";
1111
/**
1212
* Generates a Dart source file from TypeScript declaration and JavaScript source
1313
* @param options - Configuration options for generation
14+
* @returns true if generation was successful, false otherwise
1415
*/
1516
export function generateDartSourceFile(
1617
options: GenerateDartSourceOptions
17-
): void {
18+
): boolean {
1819
const { jsSourcePath, dtsFilePath, outputPath, fileName, version } = options;
1920

2021
// Read the JavaScript source
@@ -28,7 +29,7 @@ export function generateDartSourceFile(
2829
"Could not parse SDK definition from declaration file",
2930
dtsFilePath
3031
);
31-
return;
32+
return false;
3233
}
3334

3435
const { initArgs, functions } = result;
@@ -53,6 +54,9 @@ export function generateDartSourceFile(
5354

5455
// Run dart format on the Dart file
5556
execSync(`dart format ${outputPath}`);
57+
58+
// Generation was successful
59+
return true;
5660
}
5761

5862
// Re-export types for consumers

0 commit comments

Comments
 (0)