Skip to content

Commit

Permalink
Merge pull request #12131 from keymanapp/refactor/web/12110_keyboard
Browse files Browse the repository at this point in the history
refactor(web): move remaining parts of `keyboard-processor` → `keyboard` 🏗️
  • Loading branch information
ermshiperete authored Aug 15, 2024
2 parents 2ab89c6 + d640dbe commit 1dd484a
Show file tree
Hide file tree
Showing 160 changed files with 738 additions and 672 deletions.
96 changes: 0 additions & 96 deletions common/web/keyboard-processor/build.sh

This file was deleted.

69 changes: 0 additions & 69 deletions common/web/keyboard-processor/package.json

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions common/web/keyboard-processor/tsconfig.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const PRIVATE_USE_IDS = [
] as const;

/* A map of key field names with values matching the `typeof` the corresponding property
* exists in common/web/keyboard-processor, keyboards/activeLayout.ts.
* exists in /web/src/engine/keyboard/src/keyboards/activeLayout.ts.
*
* Make sure that when one is updated, the other also is. TS types are compile-time only,
* so the run-time-accessible mapping in activeLayout.ts cannot be auto-generated by TS. */
Expand Down
22 changes: 0 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

"paths": {
"@keymanapp/common-types": ["./common/web/types/src/main"],
"@keymanapp/keyboard-processor": ["./common/web/keyboard-processor/src"],
"@keymanapp/keyman": ["./web" ],
"@keymanapp/models-types": ["./common/models/types"],
"@keymanapp/models-templates": ["./common/models/templates"],
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

{ "path": "./common/web/gesture-recognizer/tsconfig.json" },
{ "path": "./common/web/gesture-recognizer/src/tools/unit-test-resources/tsconfig.json" },
{ "path": "./common/web/keyboard-processor/tsconfig.json" },
{ "path": "./common/web/keyman-version" },
{ "path": "./common/web/lm-message-types/" },
{ "path": "./common/web/lm-worker/" },
Expand Down
4 changes: 2 additions & 2 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ title: Dependency Graph
%%{init: {"flowchart": {"htmlLabels": false}} }%%
graph TD;
OSK["/web/src/engine/osk"];
KP["@keymanapp/keyboard-processor<br>(/common/web/keyboard-processor)"];
KP["/web/src/engine/keyboard"];
JSProc["/web/src/engine/js-processor"];
OSK-->KP;
WebUtils["@keymanapp/web-utils<br>(/common/web/utils)"];
Expand Down Expand Up @@ -119,7 +119,7 @@ graph TD;
Device["/web/src/engine/device-detect"];
Device----->WebUtils;
Elements["/web/src/engine/element-wrappers"];
Elements-->KP;
Elements-->JSProc;
KeyboardCache["/web/src/engine/package-cache"];
KeyboardCache-->Interfaces;
DomUtils["/web/src/engine/dom-utils"];
Expand Down
2 changes: 2 additions & 0 deletions web/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ builder_describe "Builds engine modules for Keyman Engine for Web (KMW)." \
":engine/events Specialized classes utilized to support KMW API events" \
":engine/element-wrappers Subset used to integrate with website elements" \
":engine/js-processor Build JS processor for KMW" \
":engine/keyboard Builds KMW's keyboard-loading and caching code" \
":engine/main Builds all common code used by KMW's app/-level targets" \
":engine/osk Builds the Web OSK module" \
":engine/package-cache Subset used to collate keyboards and request them from the cloud" \
Expand Down Expand Up @@ -59,6 +60,7 @@ builder_describe_outputs \
build:engine/events "/web/build/engine/events/lib/index.mjs" \
build:engine/element-wrappers "/web/build/engine/element-wrappers/lib/index.mjs" \
build:engine/js-processor "/web/build/engine/js-processor/lib/index.mjs" \
build:engine/keyboard "/web/build/engine/keyboard/lib/index.mjs" \
build:engine/main "/web/build/engine/main/lib/index.mjs" \
build:engine/osk "/web/build/engine/osk/lib/index.mjs" \
build:engine/package-cache "/web/build/engine/package-cache/lib/index.mjs" \
Expand Down
2 changes: 1 addition & 1 deletion web/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if builder_start_action test; then

# No --reporter option exists yet for the headless modules.

"$KEYMAN_ROOT/common/web/keyboard-processor/build.sh" test $OPTIONS
"$KEYMAN_ROOT/web/src/engine/keyboard/build.sh" test $OPTIONS
"$KEYMAN_ROOT/common/web/gesture-recognizer/test.sh" $OPTIONS

./build.sh test $OPTIONS
Expand Down
16 changes: 15 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@
"types": "./build/engine/js-processor/obj/index.d.ts",
"import": "./build/engine/js-processor/obj/index.js"
},
"./engine/keyboard": {
"es6-bundling": "./src/engine/keyboard/src/index.ts",
"types": "./build/engine/keyboard/obj/index.d.ts",
"import": "./build/engine/keyboard/obj/index.js"
},
"./engine/keyboard/node-keyboard-loader": {
"es6-bundling": "./src/engine/keyboard/src/keyboards/loaders/node-keyboard-loader.ts",
"types": "./build/engine/keyboard/obj/keyboards/loaders/node-keyboard-loader.d.ts",
"import": "./build/engine/keyboard/obj/keyboards/loaders/node-keyboard-loader.js"
},
"./engine/keyboard/dom-keyboard-loader": {
"es6-bundling": "./src/engine/keyboard/src/keyboards/loaders/dom-keyboard-loader.ts",
"types": "./build/engine/keyboard/obj/keyboards/loaders/dom-keyboard-loader.d.ts",
"import": "./build/engine/keyboard/obj/keyboards/loaders/dom-keyboard-loader.js"
},
"./engine/package-cache": {
"es6-bundling": "./src/engine/package-cache/src/index.ts",
"types": "./build/engine/package-cache/obj/index.d.ts",
Expand Down Expand Up @@ -104,7 +119,6 @@
"test": "gosh ./test.sh"
},
"dependencies": {
"@keymanapp/keyboard-processor": "*",
"@keymanapp/keyman-version": "*",
"@keymanapp/lexical-model-layer": "*",
"@keymanapp/models-types": "*",
Expand Down
3 changes: 1 addition & 2 deletions web/src/app/browser/src/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { EngineConfiguration, InitOptionSpec, InitOptionDefaults } from "keyman/engine/main";

import { OutputTarget as DOMOutputTarget } from 'keyman/engine/element-wrappers';
import { isEmptyTransform, OutputTarget } from '@keymanapp/keyboard-processor';
import { RuleBehavior } from 'keyman/engine/js-processor';
import { isEmptyTransform, OutputTarget, RuleBehavior } from 'keyman/engine/js-processor';
import { AlertHost } from "./utils/alertHost.js";
import { whenDocumentReady } from "./utils/documentReady.js";

Expand Down
2 changes: 1 addition & 1 deletion web/src/app/browser/src/contextManager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Keyboard, KeyboardScriptError } from '@keymanapp/keyboard-processor';
import { type Keyboard, KeyboardScriptError } from 'keyman/engine/keyboard';
import { type KeyboardStub } from 'keyman/engine/package-cache';
import { CookieSerializer } from 'keyman/engine/dom-utils';
import { eventOutputTarget, outputTargetForElement, PageContextAttachment } from 'keyman/engine/attachment';
Expand Down
6 changes: 3 additions & 3 deletions web/src/app/browser/src/defaultBrowserRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { ModifierKeyConstants } from '@keymanapp/common-types';
import {
Codes,
DefaultRules,
type KeyEvent,
type OutputTarget
} from '@keymanapp/keyboard-processor';
type KeyEvent
} from 'keyman/engine/keyboard';
import { type OutputTarget } from 'keyman/engine/js-processor';

import ContextManager from './contextManager.js';

Expand Down
2 changes: 1 addition & 1 deletion web/src/app/browser/src/hardwareEventKeyboard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Codes, DeviceSpec, KeyEvent, KeyMapping, Keyboard } from '@keymanapp/keyboard-processor';
import { Codes, DeviceSpec, KeyEvent, KeyMapping, Keyboard } from 'keyman/engine/keyboard';
import { KeyboardProcessor } from 'keyman/engine/js-processor';
import { ModifierKeyConstants } from '@keymanapp/common-types';

Expand Down
2 changes: 1 addition & 1 deletion web/src/app/browser/src/keymanEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
VisualKeyboard
} from 'keyman/engine/osk';
import { ErrorStub, KeyboardStub, CloudQueryResult, toPrefixedKeyboardId as prefixed } from 'keyman/engine/package-cache';
import { DeviceSpec, Keyboard, KeyboardObject } from "@keymanapp/keyboard-processor";
import { DeviceSpec, Keyboard, KeyboardObject } from "keyman/engine/keyboard";

import * as views from './viewsAnchorpoint.js';
import { BrowserConfiguration, BrowserInitOptionDefaults, BrowserInitOptionSpec } from './configuration.js';
Expand Down
Loading

0 comments on commit 1dd484a

Please sign in to comment.