@globules-io/ogx.js 1.45.0 → 1.46.0

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.
package/install.js CHANGED
@@ -5,10 +5,11 @@ const src_www = path.normalize(__dirname+'/www');
5
5
  const src_themes = path.normalize(__dirname+'/www/themes');
6
6
  const src_bin = path.normalize(__dirname+'/www/js/bin');
7
7
  const src_lib = path.normalize(__dirname+'/www/js/lib');
8
- const dest_www = path.normalize(__dirname+'./../../../www');
9
- const dest_themes = path.normalize(__dirname+'./../../../www/themes');
10
- const dest_lib = path.normalize(__dirname+'./../../js/lib');
11
- const dest_bin = path.normalize(__dirname+'./../../js/bin');
8
+ const root = require.main.paths[0].split('node_modules')[0].slice(0, -1);
9
+ const dest_www = path.normalize(root+'/www');
10
+ const dest_themes = path.normalize(root+'/www/themes');
11
+ const dest_lib = path.normalize(root+'/www/js/lib');
12
+ const dest_bin = path.normalize(root+'/www/js/bin');
12
13
  //if no www, copy the whole folder
13
14
  if(!fs.existsSync(dest_www)){
14
15
  copy(src_www, dest_www);
@@ -17,30 +18,34 @@ if(!fs.existsSync(dest_www)){
17
18
  console.log('Info: www present, merging files...');
18
19
  //if www, check if js and js/lib already there
19
20
  if(!fs.existsSync(dest_lib)){
21
+ console.log('Info: copying lib folder');
20
22
  copy(src_lib, dest_lib);
21
- }else{
23
+ }else{
24
+ console.log('Info: merging libraries...');
22
25
  //copy cryto, globules, howler, jquery, moment, mongogx
23
26
  let lib_folders = ['cryto', 'globules', 'howler', 'jquery', 'moment', 'mongogx'];
24
27
  let lib_folders_src;
25
28
  let lib_folders_dest;
26
29
  for(let i = 0; i < lib_folders.length; i++){
27
- lib_folders_src = path.normalize(__dirname+'/www/js/lib/'+lib_folders[i]);
28
- lib_folders_dest = path.normalize(__dirname+'./../../js/lib/'+lib_folders[i]);
30
+ lib_folders_src = path.normalize(src_lib+'/'+lib_folders[i]);
31
+ lib_folders_dest = path.normalize(dest_www+'/js/lib/'+lib_folders[i]);
29
32
  //patch --dev
30
33
  if(fs.existsSync(lib_folders_src)){
31
34
  console.log('Info: merging lib', lib_folders[i]);
32
35
  copy(lib_folders_src, lib_folders_dest, {overwrite:true});
33
36
  }
34
- }
37
+ }
38
+ console.log('Info: done merging libraries');
35
39
  }
36
40
  //check if themes are here
37
41
  //patch --dev
38
42
  if(!fs.existsSync(dest_themes) && fs.existsSync(src_themes)){
43
+ console.log('Info: copying default theme');
39
44
  copy(src_themes, dest_themes, {overwrite:false});
40
45
  }
41
46
  //deploy js/bin if not already there
42
47
  //patch --dev
43
- if(!fs.existsSync(dest_bin) && fs.existsSync(src_bin)){
48
+ if(!fs.existsSync(dest_bin) && fs.existsSync(src_bin)){
44
49
  copy(src_bin, dest_bin, {overwrite:false});
45
50
  }
46
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globules-io/ogx.js",
3
- "version": "1.45.0",
3
+ "version": "1.46.0",
4
4
  "description": "Javascript framework for webviews",
5
5
  "dependencies": {
6
6
  "fs-extra": "^10.0.0",
package/www/app.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "routing":{
3
3
  "routes":{},
4
+ "index": "",
4
5
  "options":{
5
6
  "history": true,
6
7
  "bookmark": true,