Skip to content

Commit

Permalink
Merge pull request #10560 from keymanapp/chore/developer/10547-disabl…
Browse files Browse the repository at this point in the history
…e-js-output-for-ldml-17.0

chore(developer): disable .js output for LDML keyboard compiler for 17.0
  • Loading branch information
mcdurdin authored Jan 31, 2024
2 parents 92aa65d + 6672f0a commit ad26396
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions developer/src/kmc-ldml/src/compiler/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { SectionIdent, constants } from '@keymanapp/ldml-keyboard-constants';
import { KmnCompiler } from '@keymanapp/kmc-kmn';
import { KMXPlusMetadataCompiler } from './metadata-compiler.js';
import { LdmlKeyboardVisualKeyboardCompiler } from './visual-keyboard-compiler.js';
import { LdmlKeyboardKeymanWebCompiler } from './keymanweb-compiler.js';
//KMW17.0: import { LdmlKeyboardKeymanWebCompiler } from './keymanweb-compiler.js';

export const SECTION_COMPILERS = [
// These are in dependency order.
Expand Down Expand Up @@ -97,18 +97,19 @@ export class LdmlKeyboardCompiler implements KeymanCompiler {
// const tlcompiler = new kmc.TouchLayoutCompiler();
// const tl = tlcompiler.compile(source);
// const tlwriter = new TouchLayoutFileWriter();
const kmwcompiler = new LdmlKeyboardKeymanWebCompiler(this.callbacks, compilerOptions);
const kmw_string = kmwcompiler.compile(inputFilename, source);
const encoder = new TextEncoder();
const kmw_binary = encoder.encode(kmw_string);

//KMW17.0: const kmwcompiler = new LdmlKeyboardKeymanWebCompiler(this.callbacks, compilerOptions);
//KMW17.0: const kmw_string = kmwcompiler.compile(inputFilename, source);
//KMW17.0: const encoder = new TextEncoder();
//KMW17.0: const kmw_binary = encoder.encode(kmw_string);

outputFilename = outputFilename ?? inputFilename.replace(/\.xml$/, '.kmx');

return {
artifacts: {
kmx: { data: kmx_binary, filename: outputFilename },
kvk: { data: kvk_binary, filename: outputFilename.replace(/\.kmx$/, '.kvk') },
js: { data: kmw_binary, filename: outputFilename.replace(/\.kmx$/, '.js') },
//KMW17.0: js: { data: kmw_binary, filename: outputFilename.replace(/\.kmx$/, '.js') },
}
};
}
Expand Down

0 comments on commit ad26396

Please sign in to comment.