From 8ad435a0ea402c5b7c32b309113b08b29512fff3 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Thu, 29 Aug 2024 21:10:22 -0400 Subject: [PATCH] dev: bundle gui in dev --- package-lock.json | 8 +- .../modules/selfhosted/SelfHostedModule.js | 6 ++ .../src/services/PuterHomepageService.js | 39 +-------- src/gui/doc/webpack_attempts.md | 81 +++++++++++++++++++ src/gui/{src => }/package.json | 3 +- src/gui/src/index.js | 4 +- src/gui/utils.js | 14 ++-- src/gui/webpack.config.cjs | 8 ++ src/gui/webpack/BaseConfig.cjs | 27 +++++++ src/gui/webpack/EmitPlugin.cjs | 78 ++++++++++++++++++ src/gui/webpack/libPaths.cjs | 15 ++++ 11 files changed, 232 insertions(+), 51 deletions(-) create mode 100644 src/gui/doc/webpack_attempts.md rename src/gui/{src => }/package.json (90%) create mode 100644 src/gui/webpack.config.cjs create mode 100644 src/gui/webpack/BaseConfig.cjs create mode 100644 src/gui/webpack/EmitPlugin.cjs create mode 100644 src/gui/webpack/libPaths.cjs diff --git a/package-lock.json b/package-lock.json index 2ce61209..16947f4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2545,6 +2545,10 @@ "resolved": "src/backend", "link": true }, + "node_modules/@heyputer/gui": { + "resolved": "src/gui", + "link": true + }, "node_modules/@heyputer/kv.js": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/@heyputer/kv.js/-/kv.js-0.1.6.tgz", @@ -16790,8 +16794,8 @@ } }, "src/gui": { - "version": "2.3.0", - "extraneous": true, + "name": "@heyputer/gui", + "version": "2.4.0", "license": "AGPL-3.0-only", "workspaces": [ "src/*" diff --git a/src/backend/src/modules/selfhosted/SelfHostedModule.js b/src/backend/src/modules/selfhosted/SelfHostedModule.js index c35e7f2a..9bbd3523 100644 --- a/src/backend/src/modules/selfhosted/SelfHostedModule.js +++ b/src/backend/src/modules/selfhosted/SelfHostedModule.js @@ -48,6 +48,12 @@ class SelfHostedModule extends AdvancedBase { command: 'npm', args: ['run', 'start-webpack'], }, + { + name: 'gui:webpack-watch', + directory: 'src/gui', + command: 'npm', + args: ['run', 'start-webpack'], + }, { name: 'terminal:rollup-watch', directory: 'src/terminal', diff --git a/src/backend/src/services/PuterHomepageService.js b/src/backend/src/services/PuterHomepageService.js index b6236620..ce5238e9 100644 --- a/src/backend/src/services/PuterHomepageService.js +++ b/src/backend/src/services/PuterHomepageService.js @@ -255,46 +255,9 @@ class PuterHomepageService extends BaseService { ? `` : '' } - ${ - ((!bundled && manifest?.lib_paths) - ? manifest.lib_paths.map(path => `\n`) - : []).join('') - } - - - ${ - ((!bundled && manifest?.js_paths) - ? manifest.js_paths.map(path => writeScriptTag(path)) - : []).join('') - } - +