diff --git a/developer/docs/api/etc/kmc-convert.api.md b/developer/docs/api/etc/kmc-convert.api.md new file mode 100644 index 0000000000..d13c779d7a --- /dev/null +++ b/developer/docs/api/etc/kmc-convert.api.md @@ -0,0 +1,101 @@ +## API Report File for "@keymanapp/kmc-convert" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { CompilerCallbacks } from '@keymanapp/developer-utils'; +import { CompilerEvent } from '@keymanapp/developer-utils'; +import { CompilerOptions } from '@keymanapp/developer-utils'; +import { KeymanCompiler } from '@keymanapp/developer-utils'; +import { KeymanCompilerArtifacts } from '@keymanapp/developer-utils'; +import { KeymanCompilerResult } from '@keymanapp/developer-utils'; + +// @public +export class Converter implements KeymanCompiler { + init(callbacks: CompilerCallbacks, options: CompilerOptions): Promise; + // Warning: (ae-forgotten-export) The symbol "ConverterResult" needs to be exported by the entry point main.d.ts + run(inputFilename: string, outputFilename?: string): Promise; + // Warning: (ae-forgotten-export) The symbol "ConverterArtifacts" needs to be exported by the entry point main.d.ts + write(artifacts: ConverterArtifacts): Promise; +} + +// Warning: (ae-internal-missing-underscore) The name "ConverterMessages" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export class ConverterMessages { + // (undocumented) + static ERROR_FileNotFound: number; + // (undocumented) + static Error_FileNotFound: (o?: { + inputFilename: string | null; + }) => CompilerEvent; + // (undocumented) + static ERROR_InvalidFile: number; + // (undocumented) + static Error_InvalidFile: (o: { + errorText: string; + }) => CompilerEvent; + // (undocumented) + static ERROR_NoConverterFound: number; + // (undocumented) + static Error_NoConverterFound: (o: { + inputFilename: string; + outputFilename: string; + }) => CompilerEvent; + // (undocumented) + static ERROR_UnableToConvert: number; + // (undocumented) + static Error_UnableToConvert: (o: { + inputFilename: string; + }) => CompilerEvent; + // (undocumented) + static ERROR_UnableToParse: number; + // (undocumented) + static Error_UnableToParse: () => CompilerEvent; + // (undocumented) + static ERROR_UnableToRead: number; + // (undocumented) + static Error_UnableToRead: (o: { + errorText: string; + }) => CompilerEvent; + // (undocumented) + static ERROR_UnableToReadFile: number; + // (undocumented) + static Error_UnableToReadFile: (o: { + inputFilename: string; + }) => CompilerEvent; + // (undocumented) + static ERROR_UnableToWrite: number; + // (undocumented) + static Error_UnableToWrite: (o: { + outputFilename: string; + errorText: string; + }) => CompilerEvent; + // (undocumented) + static ERROR_UndefinedActionDetected: number; + // (undocumented) + static Error_UndefinedActionDetected: (o: { + action: string; + KeyName: string; + keymapIndex: string; + }) => CompilerEvent; + // (undocumented) + static ERROR_UnsupportedCharactersDetected: number; + // (undocumented) + static Error_UnsupportedCharactersDetected: (o: { + keymapIndex: string; + key: string; + KeyName: string; + output: string; + }) => CompilerEvent; +} + +// @public +export interface ConverterOptions extends CompilerOptions { + failIfIncomplete?: boolean; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/developer/src/kmc-convert/build.sh b/developer/src/kmc-convert/build.sh index 0ddea41b34..4b793af6a8 100755 --- a/developer/src/kmc-convert/build.sh +++ b/developer/src/kmc-convert/build.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# +# Keyman is copyright (C) SIL International. MIT License. +# ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" @@ -7,6 +10,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" . "$KEYMAN_ROOT/resources/build/utils.inc.sh" . "$KEYMAN_ROOT/resources/build/node.inc.sh" +. "$KEYMAN_ROOT/resources/build/typescript.inc.sh" . "$KEYMAN_ROOT/resources/build/ci/ci-publish.inc.sh" builder_describe "Keyman kmc-convert keyboard conversion tools module" \ @@ -14,14 +18,7 @@ builder_describe "Keyman kmc-convert keyboard conversion tools module" \ "@/common/web/types" \ "@/developer/src/common/web/utils" \ "@/developer/src/common/web/test-helpers" \ - "configure" \ - "build" \ - "api analyze API and prepare API documentation" \ - "clean" \ - "test" \ - "publish publish to npm" \ - "--npm-publish+ For publish, do a npm publish, not npm pack (only for CI)" \ - "--dry-run,-n don't actually publish, just dry run" + clean configure build api test builder_describe_outputs \ configure /node_modules \ @@ -35,17 +32,5 @@ builder_parse "$@" builder_run_action clean rm -rf ./build/ ./tsconfig.tsbuildinfo builder_run_action configure node_select_version_and_npm_ci builder_run_action build tsc --build -builder_run_action api api-extractor run --local --verbose - -do_test() { - eslint . - cd test - tsc -b - cd .. - readonly C8_THRESHOLD=20 - c8 -skip-full --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha "${builder_extra_params[@]}" - builder_echo warning "Coverage thresholds are currently $C8_THRESHOLD%, which is lower than ideal." - builder_echo warning "Please increase threshold in build.sh as test coverage improves." -} - -builder_run_action test do_test +builder_run_action api typescript_run_api_extractor developer/src/kmc-convert main.d.ts +builder_run_action test typescript_run_eslint_mocha_tests diff --git a/developer/src/kmc-convert/config/api-extractor.json b/developer/src/kmc-convert/config/api-extractor.json deleted file mode 100644 index 318278f5d5..0000000000 --- a/developer/src/kmc-convert/config/api-extractor.json +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "extends": "../../../config/api-extractor.base.json", - "mainEntryPointFilePath": "/build/src/main.d.ts", - "docModel": { - "enabled": true, - "projectFolderUrl": "http://github.com/keymanapp/keyman/tree/master/developer/src/kmc-convert" - } -}