1
0
mirror of https://github.com/lensapp/lens.git synced 2024-12-01 10:37:09 +03:00

chore: Fix build of open-lens

- Remove need for using relative paths during build

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-05-05 12:12:17 -04:00
parent 6167ad2c25
commit 91354eae01
40 changed files with 284 additions and 160 deletions

View File

@ -4,9 +4,7 @@
"runner": "nx/tasks-runners/default", "runner": "nx/tasks-runners/default",
"options": { "options": {
"cacheableOperations": [ "cacheableOperations": [
"build", "build"
"prepare:dev",
"prepare:lint"
] ]
} }
} }

View File

Before

Width:  |  Height:  |  Size: 169 KiB

After

Width:  |  Height:  |  Size: 169 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -33,7 +33,7 @@
"dev:main": "cross-env NODE_ENV=development webpack --config webpack/main.ts --progress --watch", "dev:main": "cross-env NODE_ENV=development webpack --config webpack/main.ts --progress --watch",
"dev:renderer": "cross-env NODE_ENV=development ts-node ./webpack/dev-server.ts", "dev:renderer": "cross-env NODE_ENV=development ts-node ./webpack/dev-server.ts",
"test:integration": "jest -xyz --runInBand --modulePaths=[\"<rootDir>/integration/\"];", "test:integration": "jest -xyz --runInBand --modulePaths=[\"<rootDir>/integration/\"];",
"build:tray-icons": "npm run --workspace @k8slens/generate-tray-icons generate -- --output static/build/tray --input ../core/src/renderer/components/icon/logo-lens.svg --notice-icon ../core/src/renderer/components/icon/notice.svg --spinner-icon ../core/src/renderer/components/icon/arrow-spinner.svg", "build:tray-icons": "npm run --workspace @k8slens/generate-tray-icons generate -- --output static/build/tray --input @k8slens/core/icons/logo-lens.svg --notice-icon @k8slens/core/icons/notice.svg --spinner-icon @k8slens/core/icons/arrow-spinner.svg",
"download:binaries": "npm run --workspace @k8slens/ensure-binaries ensure -- --package package.json --base-dir binaries/client", "download:binaries": "npm run --workspace @k8slens/ensure-binaries ensure -- --package package.json --base-dir binaries/client",
"postinstall": "electron-rebuild" "postinstall": "electron-rebuild"
}, },

View File

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
@ -15,7 +15,7 @@
}, },
"include": [ "include": [
"src/**/*", "src/**/*",
"../core/types/*.d.ts" "../packages/core/types/*.d.ts"
], ],
"exclude": [ "exclude": [
"out", "out",
@ -23,10 +23,5 @@
"coverage", "coverage",
"binaries", "binaries",
"static" "static"
],
"references": [
{
"path": "../core"
}
] ]
} }

View File

@ -1,7 +1,7 @@
/** /**
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import path from "path"; import path from "path";
import type webpack from "webpack"; import type webpack from "webpack";
@ -15,7 +15,7 @@
import type { WebpackPluginInstance } from "webpack"; import type { WebpackPluginInstance } from "webpack";
import { DefinePlugin } from "webpack"; import { DefinePlugin } from "webpack";
import { assetsFolderName, isDevelopment, rendererDir, buildDir, htmlTemplate, publicPath } from "./vars"; import { assetsFolderName, isDevelopment, rendererDir, buildDir, htmlTemplate, publicPath } from "./vars";
import { platform } from "process"; import corePackageJson from "@k8slens/core/package.json";
const renderer: webpack.Configuration = { const renderer: webpack.Configuration = {
target: "electron-renderer", target: "electron-renderer",
@ -117,8 +117,10 @@
new CopyPlugin({ new CopyPlugin({
patterns: [ patterns: [
{ {
// TODO: Figure out a way to access without relative path from: path.resolve(
from: "../../node_modules/@k8slens/core/static/build/library/*.ttf", path.dirname(require.resolve("@k8slens/core/package.json")),
corePackageJson.exports["./fonts/*"]
),
to: "[name][ext]", to: "[name][ext]",
}, },
], ],
@ -130,7 +132,7 @@
: [] : []
), ),
], ],
}; };
/** /**
* Import icons and image files. * Import icons and image files.
@ -144,7 +146,10 @@
}, },
{ {
test: /\.(jpg|png|ico)$/, test: /\.(jpg|png|ico)$/,
type: "asset/resource", // path to file, e.g. "/static/build/assets/*" type: "asset/resource",
generator: {
filename: "images/[name][ext]",
},
}, },
]; ];
} }
@ -157,6 +162,9 @@
{ {
test: /\.(ttf|eot|woff2?)$/, test: /\.(ttf|eot|woff2?)$/,
type: "asset/resource", type: "asset/resource",
generator: {
filename: "fonts/[name][ext]",
},
}, },
]; ];
} }

View File

@ -15,7 +15,7 @@ export const publicPath = "/build/";
export const webpackDevServerPort = Number(process.env.WEBPACK_DEV_SERVER_PORT) || 9191; export const webpackDevServerPort = Number(process.env.WEBPACK_DEV_SERVER_PORT) || 9191;
// TODO: Figure out a way to access these without relative paths // TODO: Figure out a way to access these without relative paths
export const htmlTemplate = path.resolve(__dirname, "..", "..", "..", "node_modules", "@k8slens", "core", "src/renderer", "template.html"); export const htmlTemplate = require.resolve("@k8slens/core/template.html");
export const sassCommonVars = path.resolve(__dirname, "..", "..", "..", "node_modules", "@k8slens", "core", "src", "renderer", "components/vars.scss"); export const sassCommonVars = require.resolve("@k8slens/core/vars.scss");
assert(Number.isInteger(webpackDevServerPort), "WEBPACK_DEV_SERVER_PORT environment variable must only be an integer"); assert(Number.isInteger(webpackDevServerPort), "WEBPACK_DEV_SERVER_PORT environment variable must only be an integer");

350
package-lock.json generated
View File

@ -6,7 +6,8 @@
"": { "": {
"name": "lens-monorepo", "name": "lens-monorepo",
"workspaces": [ "workspaces": [
"packages/**/*" "packages/**/*",
"open-lens"
], ],
"devDependencies": { "devDependencies": {
"@ogre-tools/linkable": "^15.8.1", "@ogre-tools/linkable": "^15.8.1",
@ -9515,7 +9516,6 @@
"resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz",
"integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==",
"optional": true, "optional": true,
"peer": true,
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
} }
@ -11452,8 +11452,7 @@
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz",
"integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==",
"optional": true, "optional": true
"peer": true
}, },
"node_modules/bplist-parser": { "node_modules/bplist-parser": {
"version": "0.2.0", "version": "0.2.0",
@ -14873,8 +14872,7 @@
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
"optional": true, "optional": true
"peer": true
}, },
"node_modules/esbuild": { "node_modules/esbuild": {
"version": "0.17.18", "version": "0.17.18",
@ -17736,7 +17734,6 @@
"resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz",
"integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==",
"optional": true, "optional": true,
"peer": true,
"dependencies": { "dependencies": {
"boolean": "^3.0.1", "boolean": "^3.0.1",
"es6-error": "^4.1.1", "es6-error": "^4.1.1",
@ -23619,7 +23616,6 @@
"resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",
"integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==",
"optional": true, "optional": true,
"peer": true,
"dependencies": { "dependencies": {
"escape-string-regexp": "^4.0.0" "escape-string-regexp": "^4.0.0"
}, },
@ -25934,7 +25930,7 @@
} }
}, },
"node_modules/open-lens": { "node_modules/open-lens": {
"resolved": "packages/open-lens", "resolved": "open-lens",
"link": true "link": true
}, },
"node_modules/openid-client": { "node_modules/openid-client": {
@ -29272,7 +29268,6 @@
"resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz",
"integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==",
"optional": true, "optional": true,
"peer": true,
"dependencies": { "dependencies": {
"boolean": "^3.0.1", "boolean": "^3.0.1",
"detect-node": "^2.0.4", "detect-node": "^2.0.4",
@ -29620,8 +29615,7 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
"integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==",
"optional": true, "optional": true
"peer": true
}, },
"node_modules/semver-regex": { "node_modules/semver-regex": {
"version": "4.0.5", "version": "4.0.5",
@ -29734,7 +29728,6 @@
"resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz",
"integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==",
"optional": true, "optional": true,
"peer": true,
"dependencies": { "dependencies": {
"type-fest": "^0.13.1" "type-fest": "^0.13.1"
}, },
@ -29750,7 +29743,6 @@
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
"integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==",
"optional": true, "optional": true,
"peer": true,
"engines": { "engines": {
"node": ">=10" "node": ">=10"
}, },
@ -30440,8 +30432,7 @@
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz",
"integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==",
"optional": true, "optional": true
"peer": true
}, },
"node_modules/sshpk": { "node_modules/sshpk": {
"version": "1.17.0", "version": "1.17.0",
@ -34124,6 +34115,222 @@
"url": "https://github.com/sponsors/colinhacks" "url": "https://github.com/sponsors/colinhacks"
} }
}, },
"open-lens": {
"version": "6.5.0-alpha.9",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"@k8slens/application": "^6.5.0-alpha.5",
"@k8slens/application-for-electron-main": "^6.5.0-alpha.4",
"@k8slens/core": "^6.5.0-alpha.9",
"@k8slens/ensure-binaries": "^6.5.0-alpha.5",
"@k8slens/event-emitter": "^1.0.0-alpha.2",
"@k8slens/feature-core": "^6.5.0-alpha.4",
"@k8slens/keyboard-shortcuts": "^1.0.0-alpha.4",
"@k8slens/kube-object": "^1.0.0-alpha.2",
"@k8slens/kubectl-versions": "^1.0.0-alpha.3",
"@k8slens/legacy-extension-example": "^1.0.0-alpha.7",
"@k8slens/legacy-extensions": "^1.0.0-alpha.4",
"@k8slens/legacy-global-di": "^1.0.0-alpha.1",
"@k8slens/logger": "^1.0.0-alpha.6",
"@k8slens/messaging": "^1.0.0-alpha.4",
"@k8slens/messaging-for-main": "^1.0.0-alpha.4",
"@k8slens/messaging-for-renderer": "^1.0.0-alpha.4",
"@k8slens/node-fetch": "^6.5.0-alpha.3",
"@k8slens/react-application": "^1.0.0-alpha.3",
"@k8slens/run-many": "^1.0.0-alpha.4",
"@k8slens/startable-stoppable": "^1.0.0-alpha.3",
"@k8slens/utilities": "^1.0.0-alpha.3",
"@ogre-tools/fp": "^15.8.1",
"@ogre-tools/injectable": "^15.8.1",
"@ogre-tools/injectable-extension-for-auto-registration": "^15.8.1",
"@ogre-tools/injectable-extension-for-mobx": "^15.8.1",
"@ogre-tools/injectable-react": "^15.8.1",
"mobx": "^6.8.0",
"rimraf": "^4.4.1"
},
"devDependencies": {
"@electron/rebuild": "^3.2.10",
"@k8slens/generate-tray-icons": "^6.5.0-alpha.5",
"@k8slens/test-utils": "^1.0.0-alpha.4",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.53",
"@swc/jest": "^0.2.26",
"@types/byline": "^4.2.33",
"@types/chart.js": "^2.9.36",
"@types/color": "^3.0.3",
"@types/crypto-js": "^3.1.47",
"@types/lodash": "^4.14.191",
"@types/node": "^16.18.25",
"@types/proper-lockfile": "^4.1.2",
"@types/react-dom": "^17.0.16",
"@types/react-router-dom": "^5.3.3",
"@types/react-virtualized-auto-sizer": "^1.0.1",
"@types/react-window": "^1.8.5",
"@types/request-promise-native": "^1.0.18",
"@types/tar": "^6.1.4",
"@types/tcp-port-used": "^1.0.1",
"@types/url-parse": "^1.4.8",
"@types/uuid": "^8.3.4",
"@types/webpack": "^5.28.1",
"@types/webpack-dev-server": "^4.7.2",
"@types/webpack-env": "^1.18.0",
"@types/webpack-node-externals": "2.5.3",
"autoprefixer": "^10.4.13",
"circular-dependency-plugin": "^5.2.2",
"concurrently": "^7.6.0",
"copy-webpack-plugin": "^11.0.0",
"cross-env": "^7.0.3",
"css-loader": "^6.7.2",
"electron": "^22.3.7",
"electron-builder": "^23.6.0",
"electron-notarize": "^0.3.0",
"esbuild-loader": "^2.20.0",
"fork-ts-checker-webpack-plugin": "^7.3.0",
"html-webpack-plugin": "^5.5.1",
"jest": "^29.5.0",
"jest-environment-jsdom": "^28.1.3",
"jsonfile": "^6.1.0",
"mini-css-extract-plugin": "^2.7.1",
"monaco-editor": "^0.37.1",
"monaco-editor-webpack-plugin": "^7.0.1",
"node-loader": "^2.0.0",
"nodemon": "^2.0.20",
"playwright": "^1.33.0",
"react-refresh": "^0.14.0",
"react-refresh-typescript": "^2.0.7",
"react-select": "^5.7.0",
"rimraf": "^4.4.1",
"run-script-os": "^1.1.6",
"style-loader": "^3.3.1",
"tailwindcss": "^3.3.2",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"type-fest": "^2.14.0",
"typed-emitter": "^1.4.0",
"typescript": "^4.9.5",
"typescript-plugin-css-modules": "^4.1.1",
"webpack": "^5.81.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.13.3",
"webpack-node-externals": "^3.0.0",
"xterm-addon-fit": "^0.5.0"
},
"engines": {
"node": ">=16 <17"
}
},
"open-lens/node_modules/dotenv": {
"version": "16.0.3",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"open-lens/node_modules/strip-bom": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
"integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"open-lens/node_modules/stylus": {
"version": "0.59.0",
"resolved": "https://registry.npmjs.org/stylus/-/stylus-0.59.0.tgz",
"integrity": "sha512-lQ9w/XIOH5ZHVNuNbWW8D822r+/wBSO/d6XvtyHLF7LW4KaCIDeVbvn5DF8fGCJAUCwVhVi/h6J0NUcnylUEjg==",
"dev": true,
"dependencies": {
"@adobe/css-tools": "^4.0.1",
"debug": "^4.3.2",
"glob": "^7.1.6",
"sax": "~1.2.4",
"source-map": "^0.7.3"
},
"bin": {
"stylus": "bin/stylus"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://opencollective.com/stylus"
}
},
"open-lens/node_modules/tsconfig-paths": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz",
"integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==",
"dev": true,
"dependencies": {
"json5": "^2.2.2",
"minimist": "^1.2.6",
"strip-bom": "^3.0.0"
},
"engines": {
"node": ">=6"
}
},
"open-lens/node_modules/typescript-plugin-css-modules": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/typescript-plugin-css-modules/-/typescript-plugin-css-modules-4.2.3.tgz",
"integrity": "sha512-jEEP2oUPOqR89QGgvPK2HSTZLkrCeKZQ9EwiNxm9VUcufUbNY1Tv053fPKRq6c13PMQjlBU3WrQjKN8u0j5Y6w==",
"dev": true,
"dependencies": {
"@types/postcss-modules-local-by-default": "^4.0.0",
"@types/postcss-modules-scope": "^3.0.1",
"dotenv": "^16.0.3",
"icss-utils": "^5.1.0",
"less": "^4.1.3",
"lodash.camelcase": "^4.3.0",
"postcss": "^8.4.21",
"postcss-load-config": "^3.1.4",
"postcss-modules-extract-imports": "^3.0.0",
"postcss-modules-local-by-default": "^4.0.0",
"postcss-modules-scope": "^3.0.0",
"reserved-words": "^0.1.2",
"sass": "^1.58.3",
"source-map-js": "^1.0.2",
"stylus": "^0.59.0",
"tsconfig-paths": "^4.1.2"
},
"peerDependencies": {
"typescript": ">=3.9.0"
}
},
"open-lens/node_modules/typescript-plugin-css-modules/node_modules/postcss-load-config": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz",
"integrity": "sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==",
"dev": true,
"dependencies": {
"lilconfig": "^2.0.5",
"yaml": "^1.10.2"
},
"engines": {
"node": ">= 10"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
"peerDependencies": {
"postcss": ">=8.0.9",
"ts-node": ">=9.0.0"
},
"peerDependenciesMeta": {
"postcss": {
"optional": true
},
"ts-node": {
"optional": true
}
}
},
"packages/business-features/keyboard-shortcuts": { "packages/business-features/keyboard-shortcuts": {
"name": "@k8slens/keyboard-shortcuts", "name": "@k8slens/keyboard-shortcuts",
"version": "1.0.0-alpha.4", "version": "1.0.0-alpha.4",
@ -37788,7 +37995,6 @@
"@k8slens/webpack": "^6.5.0-alpha.5" "@k8slens/webpack": "^6.5.0-alpha.5"
}, },
"peerDependencies": { "peerDependencies": {
"@k8slens/list-layout": "^1.0.0-alpha.1",
"@k8slens/utilities": "^1.0.0-alpha.2", "@k8slens/utilities": "^1.0.0-alpha.2",
"@ogre-tools/injectable": "^15.8.1", "@ogre-tools/injectable": "^15.8.1",
"auto-bind": "^4.0.0", "auto-bind": "^4.0.0",
@ -38172,116 +38378,6 @@
"node": ">=16 <17" "node": ">=16 <17"
} }
}, },
"packages/open-lens/node_modules/dotenv": {
"version": "16.0.3",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"packages/open-lens/node_modules/strip-bom": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
"integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"packages/open-lens/node_modules/stylus": {
"version": "0.59.0",
"resolved": "https://registry.npmjs.org/stylus/-/stylus-0.59.0.tgz",
"integrity": "sha512-lQ9w/XIOH5ZHVNuNbWW8D822r+/wBSO/d6XvtyHLF7LW4KaCIDeVbvn5DF8fGCJAUCwVhVi/h6J0NUcnylUEjg==",
"dev": true,
"dependencies": {
"@adobe/css-tools": "^4.0.1",
"debug": "^4.3.2",
"glob": "^7.1.6",
"sax": "~1.2.4",
"source-map": "^0.7.3"
},
"bin": {
"stylus": "bin/stylus"
},
"engines": {
"node": "*"
},
"funding": {
"url": "https://opencollective.com/stylus"
}
},
"packages/open-lens/node_modules/tsconfig-paths": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz",
"integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==",
"dev": true,
"dependencies": {
"json5": "^2.2.2",
"minimist": "^1.2.6",
"strip-bom": "^3.0.0"
},
"engines": {
"node": ">=6"
}
},
"packages/open-lens/node_modules/typescript-plugin-css-modules": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/typescript-plugin-css-modules/-/typescript-plugin-css-modules-4.2.3.tgz",
"integrity": "sha512-jEEP2oUPOqR89QGgvPK2HSTZLkrCeKZQ9EwiNxm9VUcufUbNY1Tv053fPKRq6c13PMQjlBU3WrQjKN8u0j5Y6w==",
"dev": true,
"dependencies": {
"@types/postcss-modules-local-by-default": "^4.0.0",
"@types/postcss-modules-scope": "^3.0.1",
"dotenv": "^16.0.3",
"icss-utils": "^5.1.0",
"less": "^4.1.3",
"lodash.camelcase": "^4.3.0",
"postcss": "^8.4.21",
"postcss-load-config": "^3.1.4",
"postcss-modules-extract-imports": "^3.0.0",
"postcss-modules-local-by-default": "^4.0.0",
"postcss-modules-scope": "^3.0.0",
"reserved-words": "^0.1.2",
"sass": "^1.58.3",
"source-map-js": "^1.0.2",
"stylus": "^0.59.0",
"tsconfig-paths": "^4.1.2"
},
"peerDependencies": {
"typescript": ">=3.9.0"
}
},
"packages/open-lens/node_modules/typescript-plugin-css-modules/node_modules/postcss-load-config": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz",
"integrity": "sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==",
"dev": true,
"dependencies": {
"lilconfig": "^2.0.5",
"yaml": "^1.10.2"
},
"engines": {
"node": ">= 10"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
"peerDependencies": {
"postcss": ">=8.0.9",
"ts-node": ">=9.0.0"
},
"peerDependenciesMeta": {
"postcss": {
"optional": true
},
"ts-node": {
"optional": true
}
}
},
"packages/release-tool": { "packages/release-tool": {
"name": "@k8slens/release-tool", "name": "@k8slens/release-tool",
"version": "6.5.0-alpha.6", "version": "6.5.0-alpha.6",

View File

@ -3,7 +3,8 @@
"private": true, "private": true,
"workspaces": [ "workspaces": [
"packages/**/*" "packages/**/*",
"open-lens"
], ],
"scripts": { "scripts": {

View File

@ -18,9 +18,14 @@
}, },
"main": "static/build/main.js", "main": "static/build/main.js",
"exports": { "exports": {
"./package.json": "./package.json",
"./main": "./static/build/library/main.js", "./main": "./static/build/library/main.js",
"./renderer": "./static/build/library/renderer.js", "./renderer": "./static/build/library/renderer.js",
"./styles": "./static/build/library/renderer.css" "./styles": "./static/build/library/renderer.css",
"./template.html": "./src/renderer/template.html",
"./vars.scss": "./src/renderer/components/vars.scss",
"./fonts/*": "./static/build/library/fonts/*",
"./icons/*.svg": "./src/renderer/components/icon/*.svg"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {
@ -38,7 +43,8 @@
"build/notarize.js", "build/notarize.js",
"static/build/library/**/*", "static/build/library/**/*",
"src/renderer/template.html", "src/renderer/template.html",
"templates/**/*", "src/renderer/components/vars.scss",
"src/renderer/components/icon/*.svg",
"types/*", "types/*",
"tsconfig.json" "tsconfig.json"
], ],

View File

@ -124,7 +124,10 @@ export function iconsAndImagesWebpackRules(): webpack.RuleSetRule[] {
}, },
{ {
test: /\.(jpg|png|ico)$/, test: /\.(jpg|png|ico)$/,
type: "asset/resource", // path to file, e.g. "/static/build/assets/*" type: "asset/resource",
generator: {
filename: "images/[name][ext]",
},
}, },
]; ];
} }
@ -137,6 +140,9 @@ export function fontsLoaderWebpackRules(): webpack.RuleSetRule[] {
{ {
test: /\.(ttf|eot|woff2?)$/, test: /\.(ttf|eot|woff2?)$/,
type: "asset/resource", type: "asset/resource",
generator: {
filename: "fonts/[name][ext]",
},
}, },
]; ];
} }

View File

@ -6,7 +6,7 @@
"scripts": { "scripts": {
"clean": "rimraf dist/", "clean": "rimraf dist/",
"build": "swc ./src/index.ts -d ./dist/", "build": "swc ./src/index.ts -d ./dist/",
"generate": "node ./dist/index.js" "generate": "node --experimental-import-meta-resolve ./dist/index.js"
}, },
"files": [ "files": [
"dist" "dist"

View File

@ -9,6 +9,7 @@ import { JSDOM } from "jsdom";
import path from "path"; import path from "path";
import sharp from "sharp"; import sharp from "sharp";
import arg from "arg"; import arg from "arg";
import assert from "assert";
const options = arg({ const options = arg({
"--input": String, "--input": String,
@ -41,11 +42,21 @@ const joinWithInitCwd = (relativePath: string): string => {
return path.join(INIT_CWD, relativePath); return path.join(INIT_CWD, relativePath);
}; };
const resolve = async (input: string) => {
return (await import.meta.resolve?.(input))?.replace("file://", "");
}
const size = options["--output-size"] ?? 16; const size = options["--output-size"] ?? 16;
const inputFile = joinWithInitCwd(assertOption("--input"));
const outputFolder = joinWithInitCwd(assertOption("--output")); const outputFolder = joinWithInitCwd(assertOption("--output"));
const noticeFile = joinWithInitCwd(assertOption("--notice-icon")); const inputFile = await resolve(assertOption("--input"));
const spinnerFile = joinWithInitCwd(assertOption("--spinner-icon")); const noticeFile = await resolve(assertOption("--notice-icon"));
const spinnerFile = await resolve(assertOption("--spinner-icon"));
assert(inputFile, "input file not found");
assert(noticeFile, "notice icon file not found");
assert(spinnerFile, "spinner icon file not found");
console.log(inputFile, noticeFile, spinnerFile)
const getSvgStyling = (colouring: "dark" | "light") => ( const getSvgStyling = (colouring: "dark" | "light") => (
` `

View File

@ -69,6 +69,9 @@ export const getReactConfigFor =
{ {
test: /\.(ttf|eot|woff2?)$/, test: /\.(ttf|eot|woff2?)$/,
type: "asset/resource", type: "asset/resource",
generator: {
filename: "fonts/[name][ext]",
},
}, },
{ {
@ -79,6 +82,9 @@ export const getReactConfigFor =
{ {
test: /\.(jpg|png|ico)$/, test: /\.(jpg|png|ico)$/,
type: "asset/resource", type: "asset/resource",
generator: {
filename: "images/[name][ext]",
},
}, },
], ],
}, },

View File

@ -31,7 +31,6 @@
"lint:fix": "lens-lint --fix" "lint:fix": "lens-lint --fix"
}, },
"peerDependencies": { "peerDependencies": {
"@k8slens/list-layout": "^1.0.0-alpha.1",
"@k8slens/utilities": "^1.0.0-alpha.2", "@k8slens/utilities": "^1.0.0-alpha.2",
"@ogre-tools/injectable": "^15.8.1", "@ogre-tools/injectable": "^15.8.1",
"auto-bind": "^4.0.0", "auto-bind": "^4.0.0",

View File

@ -5,7 +5,6 @@
import moment from "moment"; import moment from "moment";
import { formatDuration, isObject, isString } from "@k8slens/utilities"; import { formatDuration, isObject, isString } from "@k8slens/utilities";
import type { ItemObject } from "@k8slens/list-layout";
import type { Patch } from "rfc6902"; import type { Patch } from "rfc6902";
import autoBind from "auto-bind"; import autoBind from "auto-bind";
import type { KubeObjectMetadata, KubeObjectScope, KubeJsonApiData } from "./api-types"; import type { KubeObjectMetadata, KubeObjectScope, KubeJsonApiData } from "./api-types";
@ -34,8 +33,7 @@ export class KubeObject<
Metadata extends KubeObjectMetadata<KubeObjectScope> = KubeObjectMetadata<KubeObjectScope>, Metadata extends KubeObjectMetadata<KubeObjectScope> = KubeObjectMetadata<KubeObjectScope>,
Status = unknown, Status = unknown,
Spec = unknown, Spec = unknown,
> implements ItemObject > {
{
static readonly kind?: string; static readonly kind?: string;
static readonly namespaced?: boolean; static readonly namespaced?: boolean;