Skip to content

Commit 3ae0773

Browse files
committed
chore: revive static-assets (for now)
1 parent d6d6fb0 commit 3ae0773

File tree

2 files changed

+57
-7
lines changed

2 files changed

+57
-7
lines changed

src/static-assets.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/**
2+
* Copyright (C) 2024 Puter Technologies Inc.
3+
*
4+
* This file is part of Puter.
5+
*
6+
* Puter is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Affero General Public License as published
8+
* by the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Affero General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Affero General Public License
17+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18+
*/
19+
20+
// Ordered list of statically-linked external JS libraries and scripts
21+
const lib_paths =[
22+
`/lib/jquery-3.6.1/jquery-3.6.1.min.js`,
23+
`/lib/viselect.min.js`,
24+
`/lib/FileSaver.min.js`,
25+
`/lib/socket.io/socket.io.min.js`,
26+
`/lib/qrcode.min.js`,
27+
`/lib/jquery-ui-1.13.2/jquery-ui.min.js`,
28+
29+
`/lib/jquery.dragster.js`,
30+
'/lib/jquery.menu-aim.js',
31+
`/lib/html-entities.js`,
32+
`/lib/timeago.min.js`,
33+
`/lib/iro.min.js`,
34+
`/lib/isMobile.min.js`,
35+
`/lib/jszip-3.10.1.min.js`,
36+
]
37+
38+
// Ordered list of CSS stylesheets
39+
const css_paths = [
40+
'/css/normalize.css',
41+
'/lib/jquery-ui-1.13.2/jquery-ui.min.css',
42+
'/css/style.css',
43+
]
44+
45+
// Ordered list of JS scripts
46+
const js_paths = [
47+
'/init_sync.js',
48+
'/init_async.js',
49+
'/initgui.js',
50+
'/helpers.js',
51+
'/IPC.js',
52+
'/globals.js',
53+
`/i18n/i18n.js`,
54+
]
55+
56+
export { lib_paths, css_paths, js_paths };

utils.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,9 @@ import path from 'path';
2222
import webpack from 'webpack';
2323
import CleanCSS from 'clean-css';
2424
import uglifyjs from 'uglify-js';
25+
import { lib_paths, css_paths, js_paths } from './src/static-assets.js';
2526
import { fileURLToPath } from 'url';
2627

27-
// load puter-gui.json
28-
const puter_gui = JSON.parse(fs.readFileSync(path.join(__dirname, 'puter-gui.json')));
29-
// map puter_gui to lib_paths, css_paths, js_paths
30-
const lib_paths = puter_gui.lib_paths;
31-
const css_paths = puter_gui.css_paths;
32-
const js_paths = puter_gui.js_paths;
33-
3428
// Polyfill __dirname, which doesn't exist in modules mode
3529
const __dirname = path.dirname(fileURLToPath(import.meta.url));
3630

0 commit comments

Comments
 (0)