-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: move xml2js into the repo to eliminate npm git dependency #11660
Conversation
Small rewrites to the xml2js code as ES6 modules. Based on https://github.com/keymanapp/dependency-node-xml2js Fixes: #8616
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
@@ -1,4 +1,4 @@ | |||
import * as xml2js from 'xml2js'; | |||
import * as xml2js from '../deps/xml2js/xml2js.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly worth considering: subpath imports.
In the common/web/types/package.json
, you could define a package-internal import (say, #xml2js
) and not have to worry about potential variations in the relative pathing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can give it a go but am concerned that our bundling will break with it -- we already have to copy published packages into a temp folder to avoid problems with hoisting and workspaces when bundling (see
keyman/developer/src/kmc/build.sh
Line 72 in ee0fc0c
function do_bundle() { |
When importing all of events with: import * as events from 'events'; tsc for kmc-ldml (but not for common/web/types) would error with: ../../../common/web/types/build/src/deps/xml2js/parser.d.ts:17:25 - error TS2306: File '.../node_modules/@types/node/events.d.ts' is not a module. 17 import * as events from "node/events.js"; I am not clear why. Changing to the following side-stepped this: import { EventEmitter } from 'events';
Changes in this pull request will be available for download in Keyman version 18.0.50-alpha |
Small rewrites to the xml2js code as ES6 modules. Based on https://github.com/keymanapp/dependency-node-xml2js
Fixes: #8616
@keymanapp-test-bot skip