From 42fa4deeae41ca4852f167ff1264eeb4e057a6bb Mon Sep 17 00:00:00 2001 From: "VL.Y" <1560781+vladimiry@users.noreply.github.com> Date: Wed, 28 Aug 2024 08:24:02 +0300 Subject: [PATCH] wip: windows app build fixes --- package.json | 2 +- .../lib/hovered-href-highlighter/const.ts | 1 - .../lib/hovered-href-highlighter/index.scss | 5 +---- .../lib/hovered-href-highlighter/index.ts | 5 ++--- webpack-configs/web/lib.ts | 11 +---------- 5 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 src/electron-preload/lib/hovered-href-highlighter/const.ts diff --git a/package.json b/package.json index 9757b9e99..347c06ccb 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "scripts/transfer": "pnpm run ts-node:shortcut ./scripts/transfer/index.ts", "electron-builder:shortcut": "npm exec --package=electron-builder -- electron-builder", "ts-node:shortcut": "cross-env TS_NODE_FILES=true node --loader ts-node/esm", - "webpack:shortcut": "cross-env TS_NODE_FILES=true TS_NODE_PROJECT=./webpack-configs/tsconfig.json NODE_OPTIONS=\"--import \\\"data:text/javascript,import { register } from 'node:module'; import { pathToFileURL } from 'node:url'; register('ts-node/esm', pathToFileURL('./'));\\\"\" npm exec --package=webpack-cli -- webpack" + "webpack:shortcut": "cross-env TS_NODE_FILES=true TS_NODE_PROJECT=./webpack-configs/tsconfig.json npm exec --package=webpack-cli --node-options=\"--loader ts-node/esm --experimental-json-modules\" -- webpack" }, "dependencies": { "electron-rpc-api": "10.0.0", diff --git a/src/electron-preload/lib/hovered-href-highlighter/const.ts b/src/electron-preload/lib/hovered-href-highlighter/const.ts deleted file mode 100644 index c5c701de7..000000000 --- a/src/electron-preload/lib/hovered-href-highlighter/const.ts +++ /dev/null @@ -1 +0,0 @@ -export const HOVERED_HREF_HIGHLIGHTER_RENDER_VISIBLE_CLASS_NAME = "visible"; diff --git a/src/electron-preload/lib/hovered-href-highlighter/index.scss b/src/electron-preload/lib/hovered-href-highlighter/index.scss index 5db548626..967562ce1 100644 --- a/src/electron-preload/lib/hovered-href-highlighter/index.scss +++ b/src/electron-preload/lib/hovered-href-highlighter/index.scss @@ -1,9 +1,6 @@ @use "src/web/theming-variables-dark" as theming-variables-dark; @import "src/web/variables"; -// gets injected via sass-loader's "additionalData" option -// $hovered-href-highlighter-render-visible-class: "visible"; - :host { $background-color: theming-variables-dark.$secondary; $padding: 0.2em; @@ -25,7 +22,7 @@ margin: $padding-l $padding; padding: $padding $padding-l; - &.#{$hovered-href-highlighter-render-visible-class} { + &.visible { display: flex; } } diff --git a/src/electron-preload/lib/hovered-href-highlighter/index.ts b/src/electron-preload/lib/hovered-href-highlighter/index.ts index a89b8dcfa..3c9e81df5 100644 --- a/src/electron-preload/lib/hovered-href-highlighter/index.ts +++ b/src/electron-preload/lib/hovered-href-highlighter/index.ts @@ -4,7 +4,6 @@ import {Observable, Subscription} from "rxjs"; import {buildLoggerBundle, resolveIpcMainApi} from "src/electron-preload/lib/util"; import css from "src/electron-preload/lib/hovered-href-highlighter/index.scss"; -import {HOVERED_HREF_HIGHLIGHTER_RENDER_VISIBLE_CLASS_NAME} from "./const"; import {IPC_MAIN_API_NOTIFICATION_ACTIONS} from "src/shared/api/main-process/actions"; import {IpcMainServiceScan} from "src/shared/api/main-process"; import {ofType} from "src/shared/util/ngrx-of-type"; @@ -61,11 +60,11 @@ export class HoveredHrefHighlightElement extends HTMLElement { const {style} = el; const render = (): void => { el.innerText = url; - el.classList.add(HOVERED_HREF_HIGHLIGHTER_RENDER_VISIBLE_CLASS_NAME); + el.classList.add("visible"); }; if (!url) { - el.classList.remove(HOVERED_HREF_HIGHLIGHTER_RENDER_VISIBLE_CLASS_NAME); + el.classList.remove("visible"); return; } diff --git a/webpack-configs/web/lib.ts b/webpack-configs/web/lib.ts index 4460b9237..47235603b 100644 --- a/webpack-configs/web/lib.ts +++ b/webpack-configs/web/lib.ts @@ -1,25 +1,16 @@ -import {Configuration, type LoaderContext, RuleSetRule} from "webpack"; +import {Configuration, RuleSetRule} from "webpack"; import {doNothing} from "remeda"; import HtmlWebpackPlugin from "html-webpack-plugin"; import MiniCssExtractPlugin from "mini-css-extract-plugin"; -import path from "path"; import {merge as webpackMerge} from "webpack-merge"; import {buildBaseConfig, ENVIRONMENT, ENVIRONMENT_STATE, outputRelativePath, srcRelativePath, typescriptLoaderRule} from "../lib"; import {BuildEnvVars} from "webpack-configs/model"; -import {HOVERED_HREF_HIGHLIGHTER_RENDER_VISIBLE_CLASS_NAME} from "src/electron-preload/lib/hovered-href-highlighter/const"; import {WEBPACK_WEB_CHUNK_NAMES} from "src/shared/const/webpack"; export const sassLoaderRuleSetRules: RuleSetRule[] = [{ loader: "sass-loader", options: { - additionalData: (content: string, loaderContext: LoaderContext) => { - const {resourcePath, rootContext} = loaderContext; - const relativePath = path.relative(rootContext, resourcePath); - return relativePath.endsWith("src/electron-preload/lib/hovered-href-highlighter/index.scss") - ? `$hovered-href-highlighter-render-visible-class:${HOVERED_HREF_HIGHLIGHTER_RENDER_VISIBLE_CLASS_NAME};${content}` - : content; - }, warnRuleAsWarning: true, // TODO sass: drop logging suppressing sassOptions: (/* loaderContext */) => {