1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix build and lint

- Get `make` to generate new `theme-vars.css` file when necessary

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-04-01 16:07:19 -04:00
parent 8b19da5359
commit 1e2feb92d1
4 changed files with 169 additions and 170 deletions

View File

@ -29,10 +29,13 @@ compile-dev: node_modules
yarn compile:renderer --cache yarn compile:renderer --cache
.PHONY: dev .PHONY: dev
dev: binaries/client build-extensions dev: binaries/client build-extensions src/renderer/themes/theme-vars.css
rm -rf static/build/ rm -rf static/build/
yarn dev yarn dev
src/renderer/themes/theme-vars.css: node_modules src/renderer/themes/lens-dark.ts build/generate-theme-vars-file.ts
yarn run ts-node build/generate-theme-vars-file
.PHONY: lint .PHONY: lint
lint: node_modules lint: node_modules
yarn lint yarn lint
@ -50,7 +53,7 @@ integration: build
yarn integration yarn integration
.PHONY: build .PHONY: build
build: node_modules binaries/client build: node_modules binaries/client src/renderer/themes/theme-vars.css
yarn run npm:fix-build-version yarn run npm:fix-build-version
$(MAKE) build-extensions -B $(MAKE) build-extensions -B
yarn run compile yarn run compile
@ -81,7 +84,7 @@ test-extensions: $(extension_node_modules)
.PHONY: copy-extension-themes .PHONY: copy-extension-themes
copy-extension-themes: copy-extension-themes:
mkdir -p src/extensions/npm/extensions/dist/src/renderer/themes/ mkdir -p src/extensions/npm/extensions/dist/src/renderer/themes/
cp $(wildcard src/renderer/themes/*.json) src/extensions/npm/extensions/dist/src/renderer/themes/ cp $(wildcard src/renderer/themes/lens-*.ts) src/extensions/npm/extensions/dist/src/renderer/themes/
src/extensions/npm/extensions/__mocks__: src/extensions/npm/extensions/__mocks__:
cp -r __mocks__ src/extensions/npm/extensions/ cp -r __mocks__ src/extensions/npm/extensions/

View File

@ -1,31 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import fs from "fs-extra";
import path from "path";
import defaultBaseLensTheme from "../src/renderer/themes/lens-dark.json";
const outputCssFile = path.resolve("src/renderer/themes/theme-vars.css");
const banner = `/*
Generated Lens theme CSS-variables, don't edit manually.
To refresh file run $: yarn run ts-node build/${path.basename(__filename)}
*/`;
const themeCssVars = Object.entries(defaultBaseLensTheme.colors)
.map(([varName, value]) => `--${varName}: ${value};`);
const content = `
${banner}
:root {
${themeCssVars.join("\n")}
}
`;
// Run
console.info(`"Saving default Lens theme css-variables to "${outputCssFile}""`);
fs.ensureFileSync(outputCssFile);
fs.writeFile(outputCssFile, content);

View File

@ -0,0 +1,27 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import fs from "fs-extra";
import path from "path";
import defaultBaseLensTheme from "../src/renderer/themes/lens-dark";
const outputCssFile = path.resolve("src/renderer/themes/theme-vars.css");
const content = [
"/**",
" * Generated Lens theme CSS-variables, don't edit manually.",
" */",
"",
":root {",
...Object.entries(defaultBaseLensTheme.colors)
.map(([varName, value]) => ` --${varName}: ${value};`),
"}",
"",
].join("\n");
// Run
console.log("Writing out new generated src/renderer/themes/theme-vars.css file");
fs.ensureFileSync(outputCssFile);
fs.writeFile(outputCssFile, content);

View File

@ -1,138 +1,138 @@
/**
/* * Generated Lens theme CSS-variables, don't edit manually.
Generated Lens theme CSS-variables, don't edit manually. */
To refresh file run $: yarn run ts-node build/build_theme_vars.ts
*/
:root { :root {
--blue: #3d90ce; --blue: #3d90ce;
--magenta: #c93dce; --magenta: #c93dce;
--golden: #ffc63d; --golden: #ffc63d;
--halfGray: #87909c80; --halfGray: #87909c80;
--primary: #3d90ce; --primary: #3d90ce;
--textColorPrimary: #8e9297; --textColorPrimary: #8e9297;
--textColorSecondary: #a0a0a0; --textColorSecondary: #a0a0a0;
--textColorTertiary: #909ba6; --textColorTertiary: #909ba6;
--textColorAccent: #ffffff; --textColorAccent: #ffffff;
--textColorDimmed: #8e92978c; --textColorDimmed: #8e92978c;
--borderColor: #4c5053; --borderColor: #4c5053;
--borderFaintColor: #373a3e; --borderFaintColor: #373a3e;
--mainBackground: #1e2124; --mainBackground: #1e2124;
--secondaryBackground: #1e2125; --secondaryBackground: #1e2125;
--contentColor: #262b2f; --contentColor: #262b2f;
--layoutBackground: #2e3136; --layoutBackground: #2e3136;
--layoutTabsBackground: #252729; --layoutTabsBackground: #252729;
--layoutTabsActiveColor: #ffffff; --layoutTabsActiveColor: #ffffff;
--layoutTabsLineColor: #87909c80; --layoutTabsLineColor: #87909c80;
--sidebarBackground: #36393e; --sidebarBackground: #36393e;
--sidebarLogoBackground: #414448; --sidebarLogoBackground: #414448;
--sidebarActiveColor: #ffffff; --sidebarActiveColor: #ffffff;
--sidebarSubmenuActiveColor: #ffffff; --sidebarSubmenuActiveColor: #ffffff;
--sidebarItemHoverBackground: #3a3e44; --sidebarItemHoverBackground: #3a3e44;
--buttonPrimaryBackground: #3d90ce; --buttonPrimaryBackground: #3d90ce;
--buttonDefaultBackground: #414448; --buttonDefaultBackground: #414448;
--buttonLightBackground: #f1f1f1; --buttonLightBackground: #f1f1f1;
--buttonAccentBackground: #e85555; --buttonAccentBackground: #e85555;
--buttonDisabledBackground: #808080; --buttonDisabledBackground: #808080;
--tableBgcStripe: #2a2d33; --tableBgcStripe: #2a2d33;
--tableBgcSelected: #383c42; --tableBgcSelected: #383c42;
--tableHeaderBackground: #262b2f; --tableHeaderBackground: #262b2f;
--tableHeaderBorderWidth: 1px; --tableHeaderBorderWidth: 1px;
--tableHeaderBorderColor: #36393e; --tableHeaderBorderColor: #36393e;
--tableHeaderColor: #ffffff; --tableHeaderColor: #ffffff;
--tableSelectedRowColor: #ffffff; --tableSelectedRowColor: #ffffff;
--helmLogoBackground: #ffffff; --helmLogoBackground: #ffffff;
--helmImgBackground: #414448; --helmImgBackground: #414448;
--helmStableRepo: #3d90ce; --helmStableRepo: #3d90ce;
--helmIncubatorRepo: #ff7043; --helmIncubatorRepo: #ff7043;
--helmDescriptionHr: #41474a; --helmDescriptionHr: #41474a;
--helmDescriptionBlockquoteColor: #bbb; --helmDescriptionBlockquoteColor: #bbb;
--helmDescriptionBlockquoteBorder: #8a8f93; --helmDescriptionBlockquoteBorder: #8a8f93;
--helmDescriptionBlockquoteBackground: #3b4348; --helmDescriptionBlockquoteBackground: #3b4348;
--helmDescriptionHeaders: #3e4147; --helmDescriptionHeaders: #3e4147;
--helmDescriptionH6: #6a737d; --helmDescriptionH6: #6a737d;
--helmDescriptionTdBorder: #47494a; --helmDescriptionTdBorder: #47494a;
--helmDescriptionTrBackground: #1c2125; --helmDescriptionTrBackground: #1c2125;
--helmDescriptionCodeBackground: #ffffff1a; --helmDescriptionCodeBackground: #ffffff1a;
--helmDescriptionPreBackground: #1b1f21; --helmDescriptionPreBackground: #1b1f21;
--helmDescriptionPreColor: #b4b5b4; --helmDescriptionPreColor: #b4b5b4;
--colorSuccess: #43a047; --colorSuccess: #43a047;
--colorOk: #4caf50; --colorOk: #4caf50;
--colorInfo: #3d90ce; --colorInfo: #3d90ce;
--colorError: #ce3933; --colorError: #ce3933;
--colorSoftError: #e85555; --colorSoftError: #e85555;
--colorWarning: #ff9800; --colorWarning: #ff9800;
--colorVague: #36393e; --colorVague: #36393e;
--colorTerminated: #4c5053; --colorTerminated: #4c5053;
--dockHeadBackground: #2e3136; --dockHeadBackground: #2e3136;
--dockInfoBackground: #1e2125; --dockInfoBackground: #1e2125;
--dockInfoBorderColor: #303136; --dockInfoBorderColor: #303136;
--dockEditorBackground: #000000; --dockEditorBackground: #000000;
--dockEditorTag: #8e97a3; --dockEditorTag: #8e97a3;
--dockEditorKeyword: #ffffff; --dockEditorKeyword: #ffffff;
--dockEditorComment: #808080; --dockEditorComment: #808080;
--dockEditorActiveLineBackground: #3a3d41; --dockEditorActiveLineBackground: #3a3d41;
--dockBadgeBackground: #36393e; --dockBadgeBackground: #36393e;
--logsBackground: #000000; --dockTabBorderColor: #43424d;
--logsForeground: #ffffff; --dockTabActiveBackground: #3a3e45;
--logRowHoverBackground: #35373a; --logsBackground: #000000;
--terminalBackground: #000000; --logsForeground: #ffffff;
--terminalForeground: #ffffff; --logRowHoverBackground: #35373a;
--terminalCursor: #ffffff; --terminalBackground: #000000;
--terminalCursorAccent: #000000; --terminalForeground: #ffffff;
--terminalSelection: #ffffff77; --terminalCursor: #ffffff;
--terminalBlack: #2e3436; --terminalCursorAccent: #000000;
--terminalRed: #cc0000; --terminalSelection: #ffffff77;
--terminalGreen: #4e9a06; --terminalBlack: #2e3436;
--terminalYellow: #c4a000; --terminalRed: #cc0000;
--terminalBlue: #3465a4; --terminalGreen: #4e9a06;
--terminalMagenta: #75507b; --terminalYellow: #c4a000;
--terminalCyan: #06989a; --terminalBlue: #3465a4;
--terminalWhite: #d3d7cf; --terminalMagenta: #75507b;
--terminalBrightBlack: #555753; --terminalCyan: #06989a;
--terminalBrightRed: #ef2929; --terminalWhite: #d3d7cf;
--terminalBrightGreen: #8ae234; --terminalBrightBlack: #555753;
--terminalBrightYellow: #fce94f; --terminalBrightRed: #ef2929;
--terminalBrightBlue: #729fcf; --terminalBrightGreen: #8ae234;
--terminalBrightMagenta: #ad7fa8; --terminalBrightYellow: #fce94f;
--terminalBrightCyan: #34e2e2; --terminalBrightBlue: #729fcf;
--terminalBrightWhite: #eeeeec; --terminalBrightMagenta: #ad7fa8;
--dialogTextColor: #87909c; --terminalBrightCyan: #34e2e2;
--dialogBackground: #ffffff; --terminalBrightWhite: #eeeeec;
--dialogHeaderBackground: #36393e; --dialogTextColor: #87909c;
--dialogFooterBackground: #f4f4f4; --dialogBackground: #ffffff;
--drawerTogglerBackground: #2f343a; --dialogHeaderBackground: #36393e;
--drawerTitleText: #ffffff; --dialogFooterBackground: #f4f4f4;
--drawerSubtitleBackground: #373a3e; --drawerTogglerBackground: #2f343a;
--drawerItemNameColor: #87909c; --drawerTitleText: #ffffff;
--drawerItemValueColor: #a0a0a0; --drawerSubtitleBackground: #373a3e;
--clusterMenuBackground: #252729; --drawerItemNameColor: #87909c;
--clusterMenuBorderColor: #252729; --drawerItemValueColor: #a0a0a0;
--clusterMenuCellBackground: #2e3136; --clusterMenuBackground: #252729;
--clusterSettingsBackground: #1e2124; --clusterMenuBorderColor: #252729;
--addClusterIconColor: #252729; --clusterMenuCellBackground: #2e3136;
--boxShadow: #0000003a; --clusterSettingsBackground: #1e2124;
--iconActiveColor: #ffffff; --addClusterIconColor: #252729;
--iconActiveBackground: #ffffff18; --boxShadow: #0000003a;
--filterAreaBackground: #23272b; --iconActiveColor: #ffffff;
--chartLiveBarBackground: #00000033; --iconActiveBackground: #ffffff18;
--chartStripesColor: #ffffff08; --filterAreaBackground: #23272b;
--chartCapacityColor: #4c545f; --chartLiveBarBackground: #00000033;
--pieChartDefaultColor: #30353a; --chartStripesColor: #ffffff08;
--inputOptionHoverColor: #87909c; --chartCapacityColor: #4c545f;
--inputControlBackground: #1e2125; --pieChartDefaultColor: #30353a;
--inputControlBorder: #414448; --inputOptionHoverColor: #87909c;
--inputControlHoverBorder: #474a4f; --inputControlBackground: #1e2125;
--lineProgressBackground: #414448; --inputControlBorder: #414448;
--radioActiveBackground: #36393e; --inputControlHoverBorder: #474a4f;
--menuActiveBackground: #36393e; --lineProgressBackground: #414448;
--menuSelectedOptionBgc: #36393e; --radioActiveBackground: #36393e;
--canvasBackground: #24292e; --menuActiveBackground: #3d90ce;
--scrollBarColor: #5f6064; --menuSelectedOptionBgc: #36393e;
--settingsBackground: #262b2e; --canvasBackground: #24292e;
--settingsColor: #909ba6; --scrollBarColor: #5f6064;
--navSelectedBackground: #262b2e; --settingsBackground: #262b2e;
--navHoverColor: #dcddde; --settingsColor: #909ba6;
--hrColor: #ffffff0f; --navSelectedBackground: #262b2e;
--tooltipBackground: #18191c; --navHoverColor: #dcddde;
} --hrColor: #ffffff0f;
--tooltipBackground: #18191c;
}