jsgui3-server 0.0.95 → 0.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,10 +3,21 @@ const jsgui = require('./square_box_client');
|
|
|
3
3
|
const {Demo_UI, Square_Box} = jsgui.controls;
|
|
4
4
|
const Server = require('../../server');
|
|
5
5
|
|
|
6
|
+
|
|
7
|
+
|
|
6
8
|
// Want to exclude this from the client bundle.
|
|
7
9
|
// Some kind of marking to say that it's server-side only?
|
|
8
10
|
|
|
11
|
+
// Need to include JSGUI3 js within the client document.
|
|
12
|
+
// Seems like an earlier code simplification removed this functionality?
|
|
13
|
+
// Just specifying a Ctrl for the server - and giving it the 'disk_path_client_js'.
|
|
14
|
+
// May as well fix that....
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
9
18
|
if (require.main === module) {
|
|
19
|
+
|
|
20
|
+
// This API is not working right now.
|
|
10
21
|
const server = new Server({
|
|
11
22
|
Ctrl: Demo_UI,
|
|
12
23
|
// Giving it the Ctrl and disk path client js should enable to server to get the JS-bundled CSS from the file(s).
|
package/package.json
CHANGED
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
"main": "module.js",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@babel/core": "^7.
|
|
7
|
-
"@babel/generator": "^7.
|
|
8
|
-
"@babel/parser": "7.
|
|
6
|
+
"@babel/core": "^7.22.9",
|
|
7
|
+
"@babel/generator": "^7.22.9",
|
|
8
|
+
"@babel/parser": "7.22.7",
|
|
9
9
|
"babel-plugin-transform-runtime": "^6.23.0",
|
|
10
10
|
"babel-preset-minify": "^0.5.2",
|
|
11
11
|
"browserify": "17.0.0",
|
|
12
12
|
"child-process": "^1.0.2",
|
|
13
13
|
"cookies": "^0.8.0",
|
|
14
|
-
"fnl": "^0.0.
|
|
14
|
+
"fnl": "^0.0.25",
|
|
15
15
|
"fnlfs": "^0.0.27",
|
|
16
16
|
"jsgui3-client": "^0.0.75",
|
|
17
17
|
|
|
18
18
|
"multiparty": "^4.2.3",
|
|
19
19
|
"ncp": "^2.0.0",
|
|
20
|
-
"obext": "0.0.24",
|
|
20
|
+
"obext": "^0.0.24",
|
|
21
21
|
"rimraf": "^3.0.2",
|
|
22
22
|
"stream-to-array": "^2.3.0",
|
|
23
23
|
"url-parse": "^1.5.10"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"type": "git",
|
|
42
42
|
"url": "https://github.com/metabench/jsgui3-server.git"
|
|
43
43
|
},
|
|
44
|
-
"version": "0.0.
|
|
44
|
+
"version": "0.0.96"
|
|
45
45
|
}
|
|
@@ -48,12 +48,23 @@ obs((next, complete, error) => {
|
|
|
48
48
|
//
|
|
49
49
|
|
|
50
50
|
|
|
51
|
+
// Should include or use various other publishers, such as html or js?
|
|
51
52
|
|
|
52
53
|
|
|
53
54
|
class HTTP_Webpage_Publisher extends HTTP_Publisher {
|
|
54
55
|
|
|
55
56
|
// Website generally serves JS from a single address.
|
|
56
57
|
// Webpage could have its specific JS.
|
|
58
|
+
// This component may need to handle the JS building.
|
|
59
|
+
// webpage-bundler within the 'bundler' directory.
|
|
60
|
+
|
|
61
|
+
// But not sure if babel or esbuild is better here.
|
|
62
|
+
// Babel has obviously improved since I had to switch to esbuild years ago.
|
|
63
|
+
// Being able to use either would help.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
57
68
|
|
|
58
69
|
constructor(spec = {}) {
|
|
59
70
|
super(spec)
|
package/server.js
CHANGED
|
@@ -73,10 +73,14 @@ class JSGUI_Server extends Evented_Class {
|
|
|
73
73
|
|
|
74
74
|
// set up a web page with the ctrl, and a web page publisher.
|
|
75
75
|
|
|
76
|
+
// But does that Webpage need (automatically or not) to include the necessary (built) JS client file?
|
|
77
|
+
|
|
76
78
|
const wp_app = new Webpage({content: Ctrl});
|
|
77
79
|
const opts_wp_publisher = {
|
|
78
80
|
'webpage': wp_app
|
|
79
81
|
};
|
|
82
|
+
|
|
83
|
+
// HTTP_Webpage_Publisher probably needs to build the JavaScript. Possibly other assets too.
|
|
80
84
|
const wp_publisher = new HTTP_Webpage_Publisher(opts_wp_publisher);
|
|
81
85
|
console.log('waiting for wp_publisher ready');
|
|
82
86
|
wp_publisher.on('ready', () => {
|