Skip to content

Commit

Permalink
wip: windows app build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Aug 28, 2024
1 parent 8275b1b commit 42fa4de
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion src/electron-preload/lib/hovered-href-highlighter/const.ts

This file was deleted.

5 changes: 1 addition & 4 deletions src/electron-preload/lib/hovered-href-highlighter/index.scss
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -25,7 +22,7 @@
margin: $padding-l $padding;
padding: $padding $padding-l;

&.#{$hovered-href-highlighter-render-visible-class} {
&.visible {
display: flex;
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/electron-preload/lib/hovered-href-highlighter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}

Expand Down
11 changes: 1 addition & 10 deletions webpack-configs/web/lib.ts
Original file line number Diff line number Diff line change
@@ -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<string>) => {
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 */) => {
Expand Down

0 comments on commit 42fa4de

Please sign in to comment.