-
-
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.
Merge pull request #7809 from keymanapp/change/common/web/keyboard-pr…
…ocessor-modularization change(common/web): keyboard processor package modularization 🧩
- Loading branch information
Showing
43 changed files
with
5,702 additions
and
5,620 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
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,43 @@ | ||
/* | ||
* Note: while this file is not meant to exist long-term, it provides a nice | ||
* low-level proof-of-concept for esbuild bundling of the various Web submodules. | ||
* | ||
* Add some extra code at the end of src/index.ts and run it to verify successful bundling! | ||
*/ | ||
|
||
import esbuild from 'esbuild'; | ||
import { spawn } from 'child_process'; | ||
|
||
// Bundled ES module version | ||
esbuild.buildSync({ | ||
entryPoints: ['build/obj/index.js'], | ||
bundle: true, | ||
sourcemap: true, | ||
format: "esm", | ||
// Sets 'common/web' as a root folder for module resolution; | ||
// this allows the keyman-version and utils imports to resolve. | ||
// | ||
// We also need to point it at the nested build output folder to resolve in-project | ||
// imports when compiled - esbuild doesn't seem to pick up on the shifted base. | ||
nodePaths: ['..', "build/obj"], | ||
outfile: "build/lib/index.mjs", | ||
tsconfig: 'tsconfig.json', | ||
target: "es5" | ||
}); | ||
|
||
// Bundled CommonJS (classic Node) module version | ||
esbuild.buildSync({ | ||
entryPoints: ['build/obj/index.js'], | ||
bundle: true, | ||
sourcemap: true, | ||
format: "cjs", | ||
// Sets 'common/web' as a root folder for module resolution; | ||
// this allows the keyman-version and utils imports to resolve. | ||
// | ||
// We also need to point it at the nested build output folder to resolve in-project | ||
// imports when compiled - esbuild doesn't seem to pick up on the shifted base. | ||
nodePaths: ['..', "build/obj"], | ||
outfile: "build/lib/index.cjs", | ||
tsconfig: 'tsconfig.json', | ||
target: "es5" | ||
}); |
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 |
---|---|---|
|
@@ -35,5 +35,6 @@ | |
"@keymanapp/keyman-version": "*", | ||
"@keymanapp/web-utils": "*", | ||
"@types/node": "^11.9.4" | ||
} | ||
}, | ||
"type": "module" | ||
} |
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,29 @@ | ||
export * from "./keyboards/activeLayout.js"; | ||
export * from "./keyboards/defaultLayouts.js"; | ||
export { default as Keyboard } from "./keyboards/keyboard.js"; | ||
export * from "./keyboards/keyboard.js"; | ||
|
||
export { default as Codes } from "./text/codes.js"; | ||
export * from "./text/codes.js"; | ||
export * from "./text/deadkeys.js"; | ||
export { default as DefaultOutput } from "./text/defaultOutput.js"; | ||
export * from "./text/defaultOutput.js"; | ||
export { default as KeyboardInterface } from "./text/kbdInterface.js"; | ||
export * from "./text/kbdInterface.js"; | ||
export { default as KeyboardProcessor } from "./text/keyboardProcessor.js"; | ||
export * from "./text/keyboardProcessor.js"; | ||
export { default as KeyEvent } from "./text/keyEvent.js"; | ||
export * from "./text/keyEvent.js"; | ||
export { default as KeyMapping } from "./text/keyMapping.js"; | ||
export { default as OutputTarget } from "./text/outputTarget.js"; | ||
export * from "./text/outputTarget.js"; | ||
export { default as RuleBehavior } from "./text/ruleBehavior.js"; | ||
export * from "./text/systemStores.js"; | ||
|
||
export * from "@keymanapp/web-utils/build/obj/index.js"; | ||
|
||
// At the top level, there should be no default export. | ||
|
||
// Without the line below... OutputTarget would likely be aliased there, as it's | ||
// the last `export { default as _ }` => `export * from` pairing seen above. | ||
export default undefined; |
Oops, something went wrong.