jsgui3-server 0.0.86 → 0.0.89

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.
@@ -80,6 +80,8 @@ const bundle_js = (js_file_path, options = {}, callback) => {
80
80
  // are there any replacements to do?
81
81
  // options.replacements
82
82
 
83
+
84
+
83
85
  if (options.js_mode === 'debug') {
84
86
  options.include_sourcemaps = true;
85
87
  }
@@ -167,6 +167,8 @@ const bundle_web_page = (webpage, options = {}) => {
167
167
  // So when it finds CSS, it can output that.
168
168
  // A Control's CSS property, within the JS definition.
169
169
  // That can be output to a CSS file, copied or removed from the JS file.
170
+
171
+ // js_mode debug
170
172
 
171
173
  res_bundle_js = await bundle_js(diskpath_js_client, {
172
174
  'js_mode': 'mini',
@@ -317,10 +319,12 @@ const bundle_web_page = (webpage, options = {}) => {
317
319
 
318
320
  //const diskpath_js_client = require.resolve('./../controls/page/admin.js');
319
321
 
322
+ // debug mode
323
+
320
324
 
321
325
  const obs_bundle = bundle_js(diskpath_js_client, {
322
- 'js_mode': 'mini',
323
- 'babel': 'mini'
326
+ 'js_mode': 'debug',
327
+ 'babel': 'debug'
324
328
  });
325
329
 
326
330
 
@@ -1,5 +1,6 @@
1
+ const jsgui = require('./square_box_client');
1
2
 
2
- const {Demo_UI, Square_Box} = require('./square_box_client');
3
+ const {Demo_UI, Square_Box} = jsgui.controls;
3
4
  const Server = require('../server');
4
5
 
5
6
  // Want to exclude this from the client bundle.
@@ -85,9 +85,29 @@ Square_Box.css = `
85
85
  height: 220px;
86
86
  }
87
87
  `;
88
+
89
+ // then if running on the client...?
90
+
91
+
92
+
88
93
  //controls.Square_Box = Square_Box;
94
+ // could export jsgui with the updated controls....
95
+ // so that they are in the correct Page Context.?
96
+
97
+
98
+ controls.Demo_UI = Demo_UI;
99
+ controls.Square_Box = Square_Box;
89
100
 
101
+ module.exports = jsgui;
102
+
103
+ /*
90
104
  module.exports = {
91
105
  Square_Box: Square_Box,
92
106
  Demo_UI: Demo_UI
93
- }
107
+ }
108
+ */
109
+
110
+ // Then if window...?
111
+
112
+ // Need to add the Square_Box control to the context or original map of controls...
113
+
package/old/square_box.js CHANGED
@@ -47,6 +47,8 @@ Demo_UI.css = `
47
47
  }
48
48
  `;
49
49
 
50
+
51
+
50
52
  class Square_Box extends Control {
51
53
  constructor(spec) {
52
54
  spec.__type_name = spec.__type_name || 'square_box';
@@ -82,6 +84,8 @@ Square_Box.css = `
82
84
  `;
83
85
  controls.Square_Box = Square_Box;
84
86
 
87
+ // need records in the map of controls by name
88
+
85
89
  if (require.main === module) {
86
90
  const SCS = require('../../single-control-server');
87
91
  const server = new SCS({
package/package.json CHANGED
@@ -11,13 +11,13 @@
11
11
  "browserify": "17.0.0",
12
12
  "child-process": "^1.0.2",
13
13
  "cookies": "^0.8.0",
14
- "fnl": "^0.0.21",
15
- "fnlfs": "^0.0.24",
16
- "jsgui3-client": "^0.0.69",
17
- "jsgui3-html": "0.0.96",
14
+ "fnl": "^0.0.22",
15
+ "fnlfs": "^0.0.25",
16
+ "jsgui3-client": "^0.0.71",
17
+ "jsgui3-html": "0.0.98",
18
18
  "multiparty": "^4.2.3",
19
19
  "ncp": "^2.0.0",
20
- "obext": "0.0.23",
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"
@@ -40,5 +40,5 @@
40
40
  "type": "git",
41
41
  "url": "https://github.com/metabench/jsgui3-server.git"
42
42
  },
43
- "version": "0.0.86"
43
+ "version": "0.0.89"
44
44
  }
@@ -31,31 +31,49 @@ class Local_Server_Info extends Resource {
31
31
  //this.meta.set('status', 'off');
32
32
  // could use a _ object with proxies.
33
33
  this.status = 'off';
34
+
35
+
36
+ this.getters = {};
37
+
38
+ var getters = {
39
+ 'net': (callback) => {
40
+ callback(null, os.networkInterfaces());
41
+ },
42
+ 'cpus': (callback) => {
43
+ callback(null, os.cpus());
44
+ }
45
+ };
46
+ Object.assign(this.getters, getters);
47
+
34
48
  }
35
49
  // context needs to work properly in call multiple.. need to sort that out.
36
50
  // may need to specify the calling object and the function.
37
51
  // may not just be a pair.
38
52
 
39
53
  'start'(callback) {
54
+
55
+ // Returning observable / optional callback would be better.
56
+ // Switching to observable may be best all round.
57
+
58
+
40
59
  //var that = this;
60
+
61
+ // Super should not be callback start? Seems a little confusing or like it could go wrong here.
62
+
63
+
64
+
41
65
  super.start((err, res_start) => {
42
66
  if (err) {
43
67
  callback(err);
44
68
  } else {
69
+
70
+ console.log('\n start callback \n');
71
+
45
72
  // collections responding to events in their objects?
46
73
  if (this.status === 'off') {
47
74
  //that.meta.set('status', 'starting');
48
75
  this.status = 'starting';
49
-
50
- var getters = {
51
- 'net': (callback) => {
52
- callback(null, os.networkInterfaces());
53
- },
54
- 'cpus': (callback) => {
55
- callback(null, os.cpus());
56
- }
57
- };
58
- Object.assign(this.getters, getters);
76
+
59
77
  this.status = 'on';
60
78
  this.raise_event('started');
61
79
  if (callback) {
package/server.js CHANGED
@@ -350,6 +350,8 @@ class JSGUI_Server extends Evented_Class {
350
350
  var sock_router = rp.get_resource('Server Sock Router');
351
351
  */
352
352
 
353
+ // just lsi.get?
354
+
353
355
  lsi.getters.net((err, net) => {
354
356
  if (err) {
355
357
  callback(err);