@globules-io/ogx.js 1.8.4 → 1.8.7

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
@@ -1,43 +1,25 @@
1
+ const fs = require('fs');
1
2
  const path = require('path');
2
- const fs = require('fs-extra');
3
- const src_ogx = path.normalize(__dirname+'/ogx');
3
+ const copy = require('recursive-copy');
4
4
  const src_www = path.normalize(__dirname+'/www');
5
- const src_lib = path.normalize(__dirname+'/www/js/lib/globules/ogx.min.js');
6
5
  const dest_www = path.normalize(__dirname+'./../../../www');
6
+ const src_ogx = path.normalize(__dirname+'/ogx');
7
7
  const dest_ogx = path.normalize(__dirname+'./../../../ogx');
8
- const dest_lib = path.normalize(__dirname+'./../../js/lib/globules/ogx.min.js');
9
-
10
- //Make ogx folder at root
11
- try {
12
- if(!fs.existsSync(dest_ogx)){
13
- fs.mkdirSync(dest_ogx);
14
- }
15
- } catch (err) {
16
- console.error(err);
8
+ let index_exists = fs.existsSync(dest_www+'/index.html');
9
+ let app_exists = fs.existsSync(dest_www+'/app.json');
10
+ if(index_exists){
11
+ fs.renameSync(dest_www+'/index.html', dest_www+'/index.bak');
12
+ }
13
+ if(app_exists){
14
+ fs.renameSync(dest_www+'/app.json', dest_www+'/app.bak');
15
+ }
16
+ copy(src_www, dest_www, {overwrite:true});
17
+ copy(src_ogx, dest_ogx, {overwrite:true});
18
+ if(index_exists){
19
+ fs.unlinkSync(dest_www+'/index.html');
20
+ fs.renameSync(dest_www+'/index.bak', dest_www+'/index.html');
17
21
  }
18
- try {
19
- if (!fs.existsSync(dest_www)){
20
- fs.mkdirSync(dest_www);
21
- }
22
- } catch (err) {
23
- console.error(err);
24
- }
25
- //Folders
26
- fs.readdir(src_www, (err, files) => {
27
- files.forEach(file => {
28
- if(!fs.existsSync(dest_www+'/'+file)){
29
- fs.copySync(src_www+'/'+file, dest_www+'/'+file);
30
- }else{
31
- console.log('File '+dest_www+'/'+file+' already exists, skipping');
32
- }
33
- });
34
- })
35
- //Update framework
36
- //remove old ogx files
37
- fs.removeSync(dest_ogx);
38
- //copy ogx to root
39
- fs.copySync(src_ogx, dest_ogx);
40
- //remove old ogx.js
41
- fs.removeSync(dest_lib);
42
- //move new ogx.js
43
- fs.copySync(src_lib, dest_lib);
22
+ if(app_exists){
23
+ fs.unlinkSync(dest_www+'/app.json');
24
+ fs.renameSync(dest_www+'/app.bak', dest_www+'/app.json');
25
+ }
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@globules-io/ogx.js",
3
- "version": "1.8.4",
3
+ "version": "1.8.7",
4
4
  "description": "Javascript framework for webviews",
5
5
  "dependencies": {
6
- "fs-extra" : "latest",
7
- "path" : "latest"
6
+ "fs": "^0.0.1-security",
7
+ "path": "latest",
8
+ "recursive-copy": "^2.0.13"
8
9
  },
9
10
  "main": "install.js",
10
11
  "scripts": {
11
12
  "test": "echo \"Error: no test specified\" && exit 1",
12
- "postinstall": "node install.js"
13
+ "postinstall": "node install.js"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -17,10 +18,10 @@
17
18
  },
18
19
  "keywords": [
19
20
  "javascript",
20
- "framework",
21
+ "framework",
21
22
  "webview",
22
- "front-end",
23
- "mobile",
23
+ "front-end",
24
+ "mobile",
24
25
  "desktop",
25
26
  "web"
26
27
  ],