Switch to using NPM workspaces (#7115)

* Switch to using npm over yarn

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Remove reference to `yarn` from documentation

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Enable NPM workspaces

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Introduce script for installing all dependencies

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Remove usage of lerna bootstrap for no longer being used

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Fix build by not bundling libraries for application in node environment (main) as Electron does that

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Tweak evil static import paths in build of application

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Consolidate npmrc configs to root since required by workspaces

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Make application build not fail for not detecting electron version

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Update package-lock

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Make sure native dependencies are rebuilt for electron

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Remove unused binary for causing trouble when installing dependencies

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Update package-lock

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Disable caching in CI for Windows

Installing Electron in Windows seems to be broken in this regards.

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

---------

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
authored and GitHub committed 2023-02-20 12:48:18 +02:00
1 parent 219a683890
commit a0fb46c3e6
37 files changed
+32995 -40670

No files matched your search

-3
View File
@@ -1,3 +0,0 @@
disturl "https://electronjs.org/headers"
target "19.0.4"
runtime "electron"
+8 -4
View File
@@ -29,13 +29,14 @@
"compile": "cross-env NODE_ENV=production webpack --config webpack/webpack.ts --progress",
"postcompile": "npm run build:tray-icons && npm run download:binaries",
"predev": "rimraf static/build/ && npm run build:tray-icons && npm run download:binaries",
"dev": "concurrently -i -k \"yarn run dev-run -C\" yarn:dev:*",
"dev": "concurrently -i -k \"npm run dev-run -C\" npm:dev:*",
"dev-run": "nodemon --watch ./static/build/main.js --exec \"electron --remote-debugging-port=9223 --inspect .\"",
"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",
"test:integration": "jest -xyz --runInBand --detectOpenHandles --forceExit --modulePaths=[\"<rootDir>/integration/\"];",
"build:tray-icons": "generate-tray-icons --output ./static/build/tray --input ./node_modules/@k8slens/core/src/renderer/components/icon/logo-lens.svg --notice-icon ./node_modules/@k8slens/core/src/renderer/components/icon/notice.svg --spinner-icon ./node_modules/@k8slens/core/src/renderer/components/icon/arrow-spinner.svg",
"download:binaries": "ensure-binaries --package ./package.json --base-dir ./binaries/client"
"build:tray-icons": "generate-tray-icons --output ./static/build/tray --input ../../node_modules/@k8slens/core/src/renderer/components/icon/logo-lens.svg --notice-icon ../../node_modules/@k8slens/core/src/renderer/components/icon/notice.svg --spinner-icon ../../node_modules/@k8slens/core/src/renderer/components/icon/arrow-spinner.svg",
"download:binaries": "ensure-binaries --package ./package.json --base-dir ./binaries/client",
"postinstall": "electron-rebuild"
},
"config": {
"k8sProxyVersion": "0.3.0",
@@ -94,6 +95,8 @@
}
},
"build": {
"npmRebuild": false,
"electronVersion": "19.1.9",
"generateUpdatesFilesForAllChannels": true,
"files": [
"static/**/*",
@@ -268,6 +271,7 @@
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.11.1",
"webpack-node-externals": "^3.0.0",
"xterm-addon-fit": "^0.5.0"
"xterm-addon-fit": "^0.5.0",
"@electron/rebuild": "^3.2.10"
}
}
+1 -1
View File
@@ -27,7 +27,7 @@ const main: webpack.Configuration = ({
extensions: [".json", ".js", ".ts"],
},
externals: [
nodeExternals(),
nodeExternals({ modulesFromFile: true }),
],
module: {
parser: {
+2 -1
View File
@@ -117,7 +117,8 @@
new CopyPlugin({
patterns: [
{
from: "node_modules/@k8slens/core/static/build/library/*.ttf",
// TODO: Figure out a way to access without relative path
from: "../../node_modules/@k8slens/core/static/build/library/*.ttf",
to: "[name][ext]",
},
],
+4 -2
View File
@@ -11,9 +11,11 @@ export const mainDir = path.join(process.cwd(), "src", "main");
export const buildDir = path.join(process.cwd(), "static", "build");
export const assetsFolderName = "assets";
export const rendererDir = path.join(process.cwd(), "src", "renderer");
export const htmlTemplate = path.resolve(__dirname, "..", "node_modules", "@k8slens", "core", "src/renderer", "template.html");
export const publicPath = "/build/";
export const sassCommonVars = path.resolve(__dirname, "..", "node_modules", "@k8slens", "core", "src", "renderer", "components/vars.scss");
export const webpackDevServerPort = Number(process.env.WEBPACK_DEV_SERVER_PORT) || 9191;
// 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 sassCommonVars = path.resolve(__dirname, "..", "..", "..", "node_modules", "@k8slens", "core", "src", "renderer", "components/vars.scss");
assert(Number.isInteger(webpackDevServerPort), "WEBPACK_DEV_SERVER_PORT environment variable must only be an integer");
File diff suppressed because it is too large. Load diff