Bismuth-Forge / bismuth

KDE Plasma add-on, that tiles your windows automatically and lets you manage them via keyboard, similarly to i3, Sway or dwm.
https://bismuth-forge.github.io/bismuth/
Other
2.41k stars 92 forks source link

Unable to compile without adding "DOM" to tsconfig.json "lib" section #215

Closed lewiji closed 2 years ago

lewiji commented 2 years ago

Fedora 35, node v17.1.0, npm 8.1.2. Tried on master and v2.1.0

npm install and npm run sysdep-install run properly and install dependencies. npm run bi-install fails due to jsdom not finding DOM types:

14 fedora-kvm in ~/dev/bismuth
Ā± |master āœ“| ā†’ npm run bi-install

> bismuth@2.1.0 prebi-install
> npm run build

> bismuth@2.1.0 build
> scripts/build.sh

šŸ—ļø Building Bismuth...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lewiji/dev/bismuth/build
[0/2] Re-checking globbed directories...
[12/12] šŸ—ļø Compiling and bundling TypeScirpt sources...
FAILED: src/kwinscript/bismuth/contents/code/index.mjs /home/lewiji/dev/bismuth/build/src/kwinscript/bismuth/contents/code/index.mjs 
cd /home/lewiji/dev/bismuth/build/src/kwinscript && npx tsc --noEmit --incremental && npx esbuild --bundle /home/lewiji/dev/bismuth/src/kwinscript/index.ts --outfile=/home/lewiji/dev/bismuth/build/src/kwinscript/bismuth/contents/code/index.mjs --format=esm --platform=neutral
../../../node_modules/@types/jsdom/base.d.ts(24,40): error TS2304: Cannot find name 'DocumentFragment'.
../../../node_modules/@types/jsdom/base.d.ts(41,28): error TS2304: Cannot find name 'Node'.
../../../node_modules/@types/jsdom/base.d.ts(172,19): error TS2304: Cannot find name 'HTMLScriptElement'.
../../../node_modules/@types/jsdom/base.d.ts(172,39): error TS2304: Cannot find name 'HTMLLinkElement'.
../../../node_modules/@types/jsdom/base.d.ts(172,57): error TS2304: Cannot find name 'HTMLIFrameElement'.
../../../node_modules/@types/jsdom/base.d.ts(172,77): error TS2304: Cannot find name 'HTMLImageElement'.
../../../node_modules/@types/jsdom/base.d.ts(181,38): error TS2304: Cannot find name 'Window'.
../../../node_modules/@types/jsdom/base.d.ts(185,24): error TS2304: Cannot find name 'Window'.
../../../node_modules/@types/jsdom/base.d.ts(250,29): error TS2304: Cannot find name 'WebAssembly'.
../../../node_modules/@types/jsdom/base.d.ts(253,30): error TS2304: Cannot find name 'DOMException'.
../../../node_modules/@types/jsdom/base.d.ts(255,21): error TS2304: Cannot find name 'URL'.
../../../node_modules/@types/jsdom/base.d.ts(256,33): error TS2304: Cannot find name 'URLSearchParams'.
../../../node_modules/@types/jsdom/base.d.ts(258,29): error TS2304: Cannot find name 'EventTarget'.
../../../node_modules/@types/jsdom/base.d.ts(260,30): error TS2304: Cannot find name 'NamedNodeMap'.
../../../node_modules/@types/jsdom/base.d.ts(261,22): error TS2304: Cannot find name 'Node'.
../../../node_modules/@types/jsdom/base.d.ts(262,22): error TS2304: Cannot find name 'Attr'.
../../../node_modules/@types/jsdom/base.d.ts(263,25): error TS2304: Cannot find name 'Element'.
../../../node_modules/@types/jsdom/base.d.ts(264,34): error TS2304: Cannot find name 'DocumentFragment'.
../../../node_modules/@types/jsdom/base.d.ts(265,35): error TS2304: Cannot find name 'DOMImplementation'.
../../../node_modules/@types/jsdom/base.d.ts(266,26): error TS2304: Cannot find name 'Document'.
../../../node_modules/@types/jsdom/base.d.ts(267,30): error TS2304: Cannot find name 'HTMLDocument'.
../../../node_modules/@types/jsdom/base.d.ts(268,29): error TS2304: Cannot find name 'XMLDocument'.
../../../node_modules/@types/jsdom/base.d.ts(269,31): error TS2304: Cannot find name 'CharacterData'.
../../../node_modules/@types/jsdom/base.d.ts(270,22): error TS2304: Cannot find name 'Text'.
../../../node_modules/@types/jsdom/base.d.ts(271,30): error TS2304: Cannot find name 'CDATASection'.
../../../node_modules/@types/jsdom/base.d.ts(272,39): error TS2304: Cannot find name 'ProcessingInstruction'.
../../../node_modules/@types/jsdom/base.d.ts(273,25): error TS2304: Cannot find name 'Comment'.
../../../node_modules/@types/jsdom/base.d.ts(274,30): error TS2304: Cannot find name 'DocumentType'.
../../../node_modules/@types/jsdom/base.d.ts(275,26): error TS2304: Cannot find name 'NodeList'.
../../../node_modules/@types/jsdom/base.d.ts(276,32): error TS2304: Cannot find name 'HTMLCollection'.
../../../node_modules/@types/jsdom/base.d.ts(277,39): error TS2304: Cannot find name 'HTMLOptionsCollection'.
../../../node_modules/@types/jsdom/base.d.ts(278,30): error TS2304: Cannot find name 'DOMStringMap'.
../../../node_modules/@types/jsdom/base.d.ts(279,30): error TS2304: Cannot find name 'DOMTokenList'.
../../../node_modules/@types/jsdom/base.d.ts(281,32): error TS2304: Cannot find name 'StyleSheetList'.
../../../node_modules/@types/jsdom/base.d.ts(283,29): error TS2304: Cannot find name 'HTMLElement'.
../../../node_modules/@types/jsdom/base.d.ts(284,33): error TS2304: Cannot find name 'HTMLHeadElement'.
../../../node_modules/@types/jsdom/base.d.ts(285,34): error TS2304: Cannot find name 'HTMLTitleElement'.
../../../node_modules/@types/jsdom/base.d.ts(286,33): error TS2304: Cannot find name 'HTMLBaseElement'.
../../../node_modules/@types/jsdom/base.d.ts(287,33): error TS2304: Cannot find name 'HTMLLinkElement'.
../../../node_modules/@types/jsdom/base.d.ts(288,33): error TS2304: Cannot find name 'HTMLMetaElement'.
../../../node_modules/@types/jsdom/base.d.ts(289,34): error TS2304: Cannot find name 'HTMLStyleElement'.
../../../node_modules/@types/jsdom/base.d.ts(290,33): error TS2304: Cannot find name 'HTMLBodyElement'.
../../../node_modules/@types/jsdom/base.d.ts(291,36): error TS2304: Cannot find name 'HTMLHeadingElement'.
../../../node_modules/@types/jsdom/base.d.ts(292,38): error TS2304: Cannot find name 'HTMLParagraphElement'.
../../../node_modules/@types/jsdom/base.d.ts(293,31): error TS2304: Cannot find name 'HTMLHRElement'.
../../../node_modules/@types/jsdom/base.d.ts(294,32): error TS2304: Cannot find name 'HTMLPreElement'.
../../../node_modules/@types/jsdom/base.d.ts(295,34): error TS2304: Cannot find name 'HTMLUListElement'.
../../../node_modules/@types/jsdom/base.d.ts(296,34): error TS2304: Cannot find name 'HTMLOListElement'.
../../../node_modules/@types/jsdom/base.d.ts(297,31): error TS2304: Cannot find name 'HTMLLIElement'.
../../../node_modules/@types/jsdom/base.d.ts(298,33): error TS2304: Cannot find name 'HTMLMenuElement'.
../../../node_modules/@types/jsdom/base.d.ts(299,34): error TS2304: Cannot find name 'HTMLDListElement'.
../../../node_modules/@types/jsdom/base.d.ts(300,32): error TS2304: Cannot find name 'HTMLDivElement'.
../../../node_modules/@types/jsdom/base.d.ts(301,35): error TS2304: Cannot find name 'HTMLAnchorElement'.
../../../node_modules/@types/jsdom/base.d.ts(302,33): error TS2304: Cannot find name 'HTMLAreaElement'.
../../../node_modules/@types/jsdom/base.d.ts(303,31): error TS2304: Cannot find name 'HTMLBRElement'.
../../../node_modules/@types/jsdom/base.d.ts(304,35): error TS2304: Cannot find name 'HTMLButtonElement'.
../../../node_modules/@types/jsdom/base.d.ts(305,35): error TS2304: Cannot find name 'HTMLCanvasElement'.
../../../node_modules/@types/jsdom/base.d.ts(306,33): error TS2304: Cannot find name 'HTMLDataElement'.
../../../node_modules/@types/jsdom/base.d.ts(307,37): error TS2304: Cannot find name 'HTMLDataListElement'.
../../../node_modules/@types/jsdom/base.d.ts(308,36): error TS2304: Cannot find name 'HTMLDetailsElement'.
../../../node_modules/@types/jsdom/base.d.ts(310,20): error TS2304: Cannot find name 'HTMLDialogElement'.
../../../node_modules/@types/jsdom/base.d.ts(311,33): error TS2304: Cannot find name 'HTMLDialogElement'.
../../../node_modules/@types/jsdom/base.d.ts(313,38): error TS2304: Cannot find name 'HTMLDirectoryElement'.
../../../node_modules/@types/jsdom/base.d.ts(314,37): error TS2304: Cannot find name 'HTMLFieldSetElement'.
../../../node_modules/@types/jsdom/base.d.ts(315,33): error TS2304: Cannot find name 'HTMLFontElement'.
../../../node_modules/@types/jsdom/base.d.ts(316,33): error TS2304: Cannot find name 'HTMLFormElement'.
../../../node_modules/@types/jsdom/base.d.ts(317,33): error TS2304: Cannot find name 'HTMLHtmlElement'.
../../../node_modules/@types/jsdom/base.d.ts(318,34): error TS2304: Cannot find name 'HTMLImageElement'.
../../../node_modules/@types/jsdom/base.d.ts(319,34): error TS2304: Cannot find name 'HTMLInputElement'.
../../../node_modules/@types/jsdom/base.d.ts(320,34): error TS2304: Cannot find name 'HTMLLabelElement'.
../../../node_modules/@types/jsdom/base.d.ts(321,35): error TS2304: Cannot find name 'HTMLLegendElement'.
../../../node_modules/@types/jsdom/base.d.ts(322,32): error TS2304: Cannot find name 'HTMLMapElement'.
../../../node_modules/@types/jsdom/base.d.ts(323,36): error TS2304: Cannot find name 'HTMLMarqueeElement'.
../../../node_modules/@types/jsdom/base.d.ts(324,34): error TS2304: Cannot find name 'HTMLMediaElement'.
../../../node_modules/@types/jsdom/base.d.ts(325,34): error TS2304: Cannot find name 'HTMLMeterElement'.
../../../node_modules/@types/jsdom/base.d.ts(326,32): error TS2304: Cannot find name 'HTMLModElement'.
../../../node_modules/@types/jsdom/base.d.ts(327,37): error TS2304: Cannot find name 'HTMLOptGroupElement'.
../../../node_modules/@types/jsdom/base.d.ts(328,35): error TS2304: Cannot find name 'HTMLOptionElement'.
../../../node_modules/@types/jsdom/base.d.ts(329,35): error TS2304: Cannot find name 'HTMLOutputElement'.
../../../node_modules/@types/jsdom/base.d.ts(330,36): error TS2304: Cannot find name 'HTMLPictureElement'.
../../../node_modules/@types/jsdom/base.d.ts(331,37): error TS2304: Cannot find name 'HTMLProgressElement'.
../../../node_modules/@types/jsdom/base.d.ts(332,34): error TS2304: Cannot find name 'HTMLQuoteElement'.
../../../node_modules/@types/jsdom/base.d.ts(333,35): error TS2304: Cannot find name 'HTMLScriptElement'.
../../../node_modules/@types/jsdom/base.d.ts(334,35): error TS2304: Cannot find name 'HTMLSelectElement'.
../../../node_modules/@types/jsdom/base.d.ts(335,33): error TS2304: Cannot find name 'HTMLSlotElement'.
../../../node_modules/@types/jsdom/base.d.ts(336,35): error TS2304: Cannot find name 'HTMLSourceElement'.
../../../node_modules/@types/jsdom/base.d.ts(337,33): error TS2304: Cannot find name 'HTMLSpanElement'.
../../../node_modules/@types/jsdom/base.d.ts(338,41): error TS2304: Cannot find name 'HTMLTableCaptionElement'.
../../../node_modules/@types/jsdom/base.d.ts(339,38): error TS2304: Cannot find name 'HTMLTableCellElement'.
../../../node_modules/@types/jsdom/base.d.ts(340,37): error TS2304: Cannot find name 'HTMLTableColElement'.
../../../node_modules/@types/jsdom/base.d.ts(341,34): error TS2304: Cannot find name 'HTMLTableElement'.
../../../node_modules/@types/jsdom/base.d.ts(342,33): error TS2304: Cannot find name 'HTMLTimeElement'.
../../../node_modules/@types/jsdom/base.d.ts(343,37): error TS2304: Cannot find name 'HTMLTableRowElement'.
../../../node_modules/@types/jsdom/base.d.ts(344,41): error TS2304: Cannot find name 'HTMLTableSectionElement'.
../../../node_modules/@types/jsdom/base.d.ts(345,37): error TS2304: Cannot find name 'HTMLTemplateElement'.
../../../node_modules/@types/jsdom/base.d.ts(346,37): error TS2304: Cannot find name 'HTMLTextAreaElement'.
../../../node_modules/@types/jsdom/base.d.ts(347,36): error TS2304: Cannot find name 'HTMLUnknownElement'.
../../../node_modules/@types/jsdom/base.d.ts(348,34): error TS2304: Cannot find name 'HTMLFrameElement'.
../../../node_modules/@types/jsdom/base.d.ts(349,37): error TS2304: Cannot find name 'HTMLFrameSetElement'.
../../../node_modules/@types/jsdom/base.d.ts(350,35): error TS2304: Cannot find name 'HTMLIFrameElement'.
../../../node_modules/@types/jsdom/base.d.ts(351,34): error TS2304: Cannot find name 'HTMLEmbedElement'.
../../../node_modules/@types/jsdom/base.d.ts(352,35): error TS2304: Cannot find name 'HTMLObjectElement'.
../../../node_modules/@types/jsdom/base.d.ts(353,34): error TS2304: Cannot find name 'HTMLParamElement'.
../../../node_modules/@types/jsdom/base.d.ts(354,34): error TS2304: Cannot find name 'HTMLVideoElement'.
../../../node_modules/@types/jsdom/base.d.ts(355,34): error TS2304: Cannot find name 'HTMLAudioElement'.
../../../node_modules/@types/jsdom/base.d.ts(356,34): error TS2304: Cannot find name 'HTMLTrackElement'.
../../../node_modules/@types/jsdom/base.d.ts(358,28): error TS2304: Cannot find name 'SVGElement'.
../../../node_modules/@types/jsdom/base.d.ts(359,36): error TS2304: Cannot find name 'SVGGraphicsElement'.
../../../node_modules/@types/jsdom/base.d.ts(360,31): error TS2304: Cannot find name 'SVGSVGElement'.
../../../node_modules/@types/jsdom/base.d.ts(361,33): error TS2304: Cannot find name 'SVGTitleElement'.
../../../node_modules/@types/jsdom/base.d.ts(362,35): error TS2304: Cannot find name 'SVGAnimatedString'.
../../../node_modules/@types/jsdom/base.d.ts(363,27): error TS2304: Cannot find name 'SVGNumber'.
../../../node_modules/@types/jsdom/base.d.ts(364,31): error TS2304: Cannot find name 'SVGStringList'.
../../../node_modules/@types/jsdom/base.d.ts(366,23): error TS2304: Cannot find name 'Event'.
../../../node_modules/@types/jsdom/base.d.ts(367,28): error TS2304: Cannot find name 'CloseEvent'.
../../../node_modules/@types/jsdom/base.d.ts(368,29): error TS2304: Cannot find name 'CustomEvent'.
../../../node_modules/@types/jsdom/base.d.ts(369,30): error TS2304: Cannot find name 'MessageEvent'.
../../../node_modules/@types/jsdom/base.d.ts(370,28): error TS2304: Cannot find name 'ErrorEvent'.
../../../node_modules/@types/jsdom/base.d.ts(371,33): error TS2304: Cannot find name 'HashChangeEvent'.
../../../node_modules/@types/jsdom/base.d.ts(372,31): error TS2304: Cannot find name 'PopStateEvent'.
../../../node_modules/@types/jsdom/base.d.ts(373,30): error TS2304: Cannot find name 'StorageEvent'.
../../../node_modules/@types/jsdom/base.d.ts(374,31): error TS2304: Cannot find name 'ProgressEvent'.
../../../node_modules/@types/jsdom/base.d.ts(375,37): error TS2304: Cannot find name 'PageTransitionEvent'.
../../../node_modules/@types/jsdom/base.d.ts(377,25): error TS2304: Cannot find name 'UIEvent'.
../../../node_modules/@types/jsdom/base.d.ts(378,28): error TS2304: Cannot find name 'FocusEvent'.
../../../node_modules/@types/jsdom/base.d.ts(379,28): error TS2304: Cannot find name 'MouseEvent'.
../../../node_modules/@types/jsdom/base.d.ts(380,31): error TS2304: Cannot find name 'KeyboardEvent'.
../../../node_modules/@types/jsdom/base.d.ts(381,28): error TS2304: Cannot find name 'TouchEvent'.
../../../node_modules/@types/jsdom/base.d.ts(382,34): error TS2304: Cannot find name 'CompositionEvent'.
../../../node_modules/@types/jsdom/base.d.ts(383,28): error TS2304: Cannot find name 'WheelEvent'.
../../../node_modules/@types/jsdom/base.d.ts(385,25): error TS2304: Cannot find name 'BarProp'.
../../../node_modules/@types/jsdom/base.d.ts(386,26): error TS2304: Cannot find name 'Location'.
../../../node_modules/@types/jsdom/base.d.ts(387,25): error TS2304: Cannot find name 'History'.
../../../node_modules/@types/jsdom/base.d.ts(388,24): error TS2304: Cannot find name 'Screen'.
../../../node_modules/@types/jsdom/base.d.ts(389,29): error TS2304: Cannot find name 'Performance'.
../../../node_modules/@types/jsdom/base.d.ts(390,27): error TS2304: Cannot find name 'Navigator'.
../../../node_modules/@types/jsdom/base.d.ts(392,29): error TS2304: Cannot find name 'PluginArray'.
../../../node_modules/@types/jsdom/base.d.ts(393,31): error TS2304: Cannot find name 'MimeTypeArray'.
../../../node_modules/@types/jsdom/base.d.ts(394,24): error TS2304: Cannot find name 'Plugin'.
../../../node_modules/@types/jsdom/base.d.ts(395,26): error TS2304: Cannot find name 'MimeType'.
../../../node_modules/@types/jsdom/base.d.ts(397,28): error TS2304: Cannot find name 'FileReader'.
../../../node_modules/@types/jsdom/base.d.ts(398,22): error TS2693: 'Blob' only refers to a type, but is being used as a value here.
../../../node_modules/@types/jsdom/base.d.ts(399,22): error TS2304: Cannot find name 'File'.
../../../node_modules/@types/jsdom/base.d.ts(400,26): error TS2304: Cannot find name 'FileList'.
../../../node_modules/@types/jsdom/base.d.ts(401,31): error TS2304: Cannot find name 'ValidityState'.
../../../node_modules/@types/jsdom/base.d.ts(403,27): error TS2304: Cannot find name 'DOMParser'.
../../../node_modules/@types/jsdom/base.d.ts(404,31): error TS2304: Cannot find name 'XMLSerializer'.
../../../node_modules/@types/jsdom/base.d.ts(406,26): error TS2304: Cannot find name 'FormData'.
../../../node_modules/@types/jsdom/base.d.ts(407,43): error TS2304: Cannot find name 'XMLHttpRequestEventTarget'.
../../../node_modules/@types/jsdom/base.d.ts(408,38): error TS2304: Cannot find name 'XMLHttpRequestUpload'.
../../../node_modules/@types/jsdom/base.d.ts(409,32): error TS2304: Cannot find name 'XMLHttpRequest'.
../../../node_modules/@types/jsdom/base.d.ts(410,27): error TS2304: Cannot find name 'WebSocket'.
../../../node_modules/@types/jsdom/base.d.ts(412,28): error TS2304: Cannot find name 'NodeFilter'.
../../../node_modules/@types/jsdom/base.d.ts(413,30): error TS2304: Cannot find name 'NodeIterator'.
../../../node_modules/@types/jsdom/base.d.ts(414,28): error TS2304: Cannot find name 'TreeWalker'.
../../../node_modules/@types/jsdom/base.d.ts(416,31): error TS2304: Cannot find name 'AbstractRange'.
../../../node_modules/@types/jsdom/base.d.ts(417,23): error TS2304: Cannot find name 'Range'.
../../../node_modules/@types/jsdom/base.d.ts(418,29): error TS2304: Cannot find name 'StaticRange'.
../../../node_modules/@types/jsdom/base.d.ts(419,27): error TS2304: Cannot find name 'Selection'.
../../../node_modules/@types/jsdom/base.d.ts(421,25): error TS2304: Cannot find name 'Storage'.
../../../node_modules/@types/jsdom/base.d.ts(423,39): error TS2304: Cannot find name 'CustomElementRegistry'.
../../../node_modules/@types/jsdom/base.d.ts(424,28): error TS2304: Cannot find name 'ShadowRoot'.
../../../node_modules/@types/jsdom/base.d.ts(426,34): error TS2304: Cannot find name 'MutationObserver'.
../../../node_modules/@types/jsdom/base.d.ts(427,32): error TS2304: Cannot find name 'MutationRecord'.
../../../node_modules/@types/jsdom/base.d.ts(429,25): error TS2304: Cannot find name 'Headers'.
../../../node_modules/@types/jsdom/base.d.ts(434,28): error TS2304: Cannot find name 'StyleSheet'.
../../../node_modules/@types/jsdom/base.d.ts(435,27): error TS2304: Cannot find name 'MediaList'.
../../../node_modules/@types/jsdom/base.d.ts(436,31): error TS2304: Cannot find name 'CSSStyleSheet'.
../../../node_modules/@types/jsdom/base.d.ts(437,25): error TS2304: Cannot find name 'CSSRule'.
../../../node_modules/@types/jsdom/base.d.ts(438,30): error TS2304: Cannot find name 'CSSStyleRule'.
../../../node_modules/@types/jsdom/base.d.ts(439,30): error TS2304: Cannot find name 'CSSMediaRule'.
../../../node_modules/@types/jsdom/base.d.ts(440,31): error TS2304: Cannot find name 'CSSImportRule'.
../../../node_modules/@types/jsdom/base.d.ts(441,37): error TS2304: Cannot find name 'CSSStyleDeclaration'.
../../../node_modules/@types/jsdom/base.d.ts(445,33): error TS2304: Cannot find name 'XPathExpression'.
../../../node_modules/@types/jsdom/base.d.ts(446,29): error TS2304: Cannot find name 'XPathResult'.
../../../node_modules/@types/jsdom/base.d.ts(447,32): error TS2304: Cannot find name 'XPathEvaluator'.
../../../node_modules/@types/jsdom/ts4.0/index.d.ts(7,28): error TS2304: Cannot find name 'InputEvent'.
../../../node_modules/@types/jsdom/ts4.0/index.d.ts(8,26): error TS2304: Cannot find name 'External'.
ninja: build stopped: subcommand failed.

Editing the tsconfig.json file to add DOM to the list of lib targets allows the build to succeed:

"lib": ["es5", "ES2015", "ES2016", "DOM"],
gikari commented 2 years ago

Relates to https://github.com/facebook/jest/issues/12098

gikari commented 2 years ago

Ok, I pinned jest to version 26, this should fix the issue.