-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(developer): ldml-editor: use NodeCompilerCallbacks 🗼
- add an extension point to NodeCompilerCallbacks to support changing message target - add an LDMLCompilerManager to simplify the CommonJS/ESM boundary Fixes: #12789
- Loading branch information
Showing
6 changed files
with
108 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Keyman is copyright (C) SIL Global. MIT License. | ||
*/ | ||
|
||
import * as process from 'node:process'; | ||
import { CompilerCallbackOptions } from "@keymanapp/developer-utils"; | ||
import { NodeCompilerCallbacks } from "@keymanapp/kmc/build/src/util/NodeCompilerCallbacks.js"; | ||
|
||
export class ExtensionCallbacks extends NodeCompilerCallbacks { | ||
/** | ||
* @param options options to pass to NodeCompilerCallbacks | ||
* @param msg callback to write to the console | ||
*/ | ||
constructor(options: CompilerCallbackOptions, private msg?: (m: string)=>void) { | ||
super(options); | ||
} | ||
|
||
protected writeString(str: string) { | ||
if (this.msg) { | ||
this.msg(str); | ||
} else { | ||
process.stdout.write(str); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters