@gudhub/core 1.2.4-beta.38 → 1.2.4-beta.42
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/.parcel-cache/61134f48017c9cc1-AssetGraph +0 -0
- package/.parcel-cache/72a0445d2e7372b4-BundleGraph +0 -0
- package/.parcel-cache/83e7562660f7cc15-BundleGraph +0 -0
- package/.parcel-cache/9a0d07555444f4da-AssetGraph +0 -0
- package/.parcel-cache/d3a1b9507cb44047-AssetGraph +0 -0
- package/.parcel-cache/d647b2950bce7da7-RequestGraph +0 -0
- package/.parcel-cache/data.mdb +0 -0
- package/.parcel-cache/dc1da35000e13623-RequestGraph +0 -0
- package/.parcel-cache/lock.mdb +0 -0
- package/.parcel-cache/snapshot-d647b2950bce7da7.txt +28892 -0
- package/.parcel-cache/snapshot-dc1da35000e13623.txt +28882 -0
- package/.parcelrc.appRequestWorker +4 -0
- package/.vscode/launch.json +31 -0
- package/GUDHUB/DataService/IndexedDB/IndexedDBAppService.js +30 -1
- package/GUDHUB/DataService/IndexedDB/appRequestWorker.js +2 -2
- package/GUDHUB/Storage/ModulesList.js +0 -9
- package/GUDHUB/Utils/AppsTemplateService/AppsTemplateService.js +4 -11
- package/GUDHUB/Utils/get_date/get_date.test.js +12 -3
- package/GUDHUB/Utils/nested_list/nested_list.js +50 -53
- package/GUDHUB/Utils/nested_list/nested_list.test.js +2 -140
- package/GUDHUB/gudhub.js +16 -10
- package/GUDHUB/gudhubAppRequestWorker.js +18 -0
- package/build.sh +55 -0
- package/dist/gudhub.es.js +15880 -0
- package/dist/gudhub.umd.js +195 -0
- package/index.js +3 -1
- package/indexUMD.js +0 -2
- package/indextest.html +35 -0
- package/package.json +37 -25
- package/vite.config.esm.js +67 -0
- package/vite.config.umd.js +66 -0
- package/appRequestWorker.js +0 -1
- package/appRequestWorker.js.LICENSE.txt +0 -13
- package/appRequestWorker.js.map +0 -1
- package/umd/appRequestWorker.js +0 -1
- package/umd/library.min.js +0 -1
- package/webpack.config.js +0 -154
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"name": "Launch Program",
|
|
6
|
+
"program": "${workspaceFolder}/app.js",
|
|
7
|
+
"request": "launch",
|
|
8
|
+
"skipFiles": [
|
|
9
|
+
"<node_internals>/**"
|
|
10
|
+
],
|
|
11
|
+
"type": "node"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "node",
|
|
15
|
+
"request": "launch",
|
|
16
|
+
"runtimeVersion": "16",
|
|
17
|
+
"name": "Launch Program",
|
|
18
|
+
"skipFiles": [
|
|
19
|
+
"<node_internals>/**"
|
|
20
|
+
],
|
|
21
|
+
"program": "${workspaceFolder}/index.js"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "node-terminal",
|
|
25
|
+
"name": "Run Script: test",
|
|
26
|
+
"request": "launch",
|
|
27
|
+
"command": "npm run test",
|
|
28
|
+
"cwd": "${workspaceFolder}"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -12,6 +12,8 @@ import { appsConf } from "./appDataConf.js";
|
|
|
12
12
|
import { chunksMergeConf } from "./storeManagerConf/chunkCacheStoreManagerConf.js";
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
import AppRequestWorkerScript from '../../../dist/PARCEL_APP_REQUEST_WORKER_FILENAME.js?worker&inline';
|
|
16
|
+
|
|
15
17
|
//this should be global in project
|
|
16
18
|
// class IndexedDBFacade extends CacheService {
|
|
17
19
|
|
|
@@ -526,9 +528,36 @@ export class IndexedDBAppService extends AppDataService {
|
|
|
526
528
|
|
|
527
529
|
|
|
528
530
|
|
|
531
|
+
//TODO replace by worker-loader when it will work in webpack 5, take a look to webpack config
|
|
532
|
+
// let csvWorkerFileAsString = require('./csv.worker.js');
|
|
533
|
+
// let worker = new Blob([AppRequestWorkerScript], {type: 'application/javascript'});
|
|
534
|
+
|
|
535
|
+
// angular.module('csvService', [
|
|
536
|
+
// 'itemDataProcessor'
|
|
537
|
+
// ])
|
|
538
|
+
|
|
539
|
+
// .service('csvService', ['itemsDataProcessing', 'PipeService', function(itemsDataProcessing, PipeService) {
|
|
540
|
+
|
|
541
|
+
// var self = this,
|
|
542
|
+
// this.appRequestAndProcessWorker = new Worker(URL.createObjectURL(worker));//TODO URL.createObjectURL - revoke isn't called
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
529
546
|
// this.appRequestAndProcessWorker = new Worker('./appRequestWorker.js');
|
|
530
547
|
// this.appRequestAndProcessWorker = new Worker(new URL('./appRequestWorker.js', import.meta.url));
|
|
531
|
-
this.appRequestAndProcessWorker = new Worker('node_modules/@gudhub/core/umd/appRequestWorker.js');
|
|
548
|
+
// this.appRequestAndProcessWorker = new Worker('node_modules/@gudhub/core/umd/appRequestWorker.js');
|
|
549
|
+
// this.appRequestAndProcessWorker = new Worker('dist/appRequestWorker.built.js', import.meta.url);
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
// const workerBlob = new Blob([atob(AppRequestWorkerScript.split(',')[1])], { type: 'application/javascript' });
|
|
553
|
+
// const workerUrl = URL.createObjectURL(workerBlob);
|
|
554
|
+
// this.appRequestAndProcessWorker = new Worker(workerUrl);
|
|
555
|
+
|
|
556
|
+
this.appRequestAndProcessWorker = new AppRequestWorkerScript;
|
|
557
|
+
// this.appRequestAndProcessWorker = new Worker(
|
|
558
|
+
// // parcel bundler specific syntax. Check https://parceljs.org/features/bundle-inlining/
|
|
559
|
+
// {type: 'module'}
|
|
560
|
+
// );
|
|
532
561
|
// this.appRequestAndProcessWorker = new Worker('override_npm/gudhub/umd/appRequestWorker.js');
|
|
533
562
|
// this.appRequestAndProcessWorker = new AppRequestWorker();
|
|
534
563
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import { appDataServiceConf } from "../export.js";
|
|
3
|
-
import { GudHub } from "../../gudhub.js";
|
|
4
3
|
import { IndexedDBAppServiceForWorker } from "../IndexedDB/IndexedDBAppService.js";
|
|
5
4
|
import { appsConf } from "../IndexedDB/appDataConf.js";
|
|
6
5
|
import { IndexedDBChunkService } from "./IndexedDBChunkService.js";
|
|
7
6
|
import { chunksConf } from "./chunkDataConf.js";
|
|
8
7
|
import { chunksMergeConf } from "./storeManagerConf/chunkCacheStoreManagerConf.js";
|
|
8
|
+
import { GudHubForAppRequestWorker } from "../../gudhubAppRequestWorker.js";
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -24,7 +24,7 @@ self.onmessage = async function(e) {
|
|
|
24
24
|
|
|
25
25
|
e.data.gudhubSerialized.options.initWebsocket = false;
|
|
26
26
|
|
|
27
|
-
gudhub = new
|
|
27
|
+
gudhub = new GudHubForAppRequestWorker(e.data.gudhubSerialized.authKey, e.data.gudhubSerialized.options);
|
|
28
28
|
appDataService = new IndexedDBAppServiceForWorker(gudhub.req, appsConf, gudhub);
|
|
29
29
|
chunkDataService = new IndexedDBChunkService(gudhub.req, chunksMergeConf, gudhub);
|
|
30
30
|
|
|
@@ -979,15 +979,6 @@ export default function generateModulesList(async_modules_path, file_server_url,
|
|
|
979
979
|
type: 'gh_element',
|
|
980
980
|
technology: 'angular'
|
|
981
981
|
},
|
|
982
|
-
{
|
|
983
|
-
data_type: "svg_to_pdf",
|
|
984
|
-
name: "SVG To PDF",
|
|
985
|
-
icon: "box",
|
|
986
|
-
js: "https://gudhub.com/modules/SVG-to-PDF-Gh-Element/dist/main.js",
|
|
987
|
-
css: "https://gudhub.com/modules/SVG-to-PDF-Gh-Element/dist/style.css",
|
|
988
|
-
type: "gh_element",
|
|
989
|
-
technology: "class",
|
|
990
|
-
},
|
|
991
982
|
/* AUTOMATION MODULES */
|
|
992
983
|
/*
|
|
993
984
|
We have next types for automations:
|
|
@@ -443,14 +443,7 @@ export default class AppsTemplateService {
|
|
|
443
443
|
});
|
|
444
444
|
|
|
445
445
|
self.crawling(app.field_list, function (prop, value, parent) {
|
|
446
|
-
|
|
447
|
-
const appProps = ["app_id", "AppId", "destination_app"];
|
|
448
|
-
const viewProps = ["view_id"];
|
|
449
|
-
const srcProps = ["src"];
|
|
450
|
-
|
|
451
|
-
const hasProp = (prop, propArray) => propArray.some(key => prop.indexOf(key) !== -1);
|
|
452
|
-
|
|
453
|
-
if (hasProp(prop, fieldProps)) {
|
|
446
|
+
if (prop.indexOf("field_id") !== -1 || prop.indexOf("FieldId") !== -1 || prop.indexOf("destination_field") !== -1) {
|
|
454
447
|
let fieldsArr = String(value).split(','), newFieldsArr = [];
|
|
455
448
|
|
|
456
449
|
appsConnectingMap.fields.forEach(field => {
|
|
@@ -466,7 +459,7 @@ export default class AppsTemplateService {
|
|
|
466
459
|
}
|
|
467
460
|
}
|
|
468
461
|
|
|
469
|
-
if (
|
|
462
|
+
if (prop.indexOf("app_id") != -1 || prop.indexOf("AppId") != -1 || prop.indexOf("destination_app") != -1) {
|
|
470
463
|
appsConnectingMap.apps.forEach(app => {
|
|
471
464
|
if (value == app.old_app_id) {
|
|
472
465
|
parent[prop] = app.new_app_id;
|
|
@@ -474,7 +467,7 @@ export default class AppsTemplateService {
|
|
|
474
467
|
})
|
|
475
468
|
}
|
|
476
469
|
|
|
477
|
-
if (
|
|
470
|
+
if (prop.indexOf("view_id") !== -1) {
|
|
478
471
|
appsConnectingMap.views.forEach(view => {
|
|
479
472
|
if (value == view.old_view_id) {
|
|
480
473
|
parent[prop] = view.new_view_id;
|
|
@@ -482,7 +475,7 @@ export default class AppsTemplateService {
|
|
|
482
475
|
})
|
|
483
476
|
}
|
|
484
477
|
|
|
485
|
-
if (
|
|
478
|
+
if (prop.indexOf("src") !== -1 && isFinite(value)) {
|
|
486
479
|
const pron_name = 'container_id';
|
|
487
480
|
const old_app_id = appsConnectingMap.apps.find(appMap => appMap.new_app_id === app.app_id).old_app_id;
|
|
488
481
|
const path = self.findPath(source_apps[old_app_id].views_list, pron_name, value);
|
|
@@ -53,7 +53,7 @@ describe("GET DATE", function () {
|
|
|
53
53
|
day.getDay().should.equal(6);
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
it("CHECK
|
|
56
|
+
it("CHECK IF DATE TODAY", function() {
|
|
57
57
|
let today = new Date();
|
|
58
58
|
let result = gudhub.checkRecurringDate(today, 'day');
|
|
59
59
|
result.should.equal(true);
|
|
@@ -64,7 +64,7 @@ describe("GET DATE", function () {
|
|
|
64
64
|
result.should.equal(false);
|
|
65
65
|
})
|
|
66
66
|
|
|
67
|
-
it("CHECK
|
|
67
|
+
it("CHECK IF DATE IN THIS WEEK", function() {
|
|
68
68
|
let today = new Date();
|
|
69
69
|
let result = gudhub.checkRecurringDate(today, 'week');
|
|
70
70
|
result.should.equal(true);
|
|
@@ -75,7 +75,16 @@ describe("GET DATE", function () {
|
|
|
75
75
|
result.should.equal(false);
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
it(
|
|
78
|
+
it('CHECK IF DATE IN THIS WEEK / Compare this wednesday with wednesday two years ago', function(){
|
|
79
|
+
let day = gudhub.getDate('this_wednesday');
|
|
80
|
+
let dayTwoYearsBefore = subYears(day, 2);
|
|
81
|
+
|
|
82
|
+
// console.log(dayTwoYearsBefore);
|
|
83
|
+
let result = gudhub.checkRecurringDate(dayTwoYearsBefore, 'week');
|
|
84
|
+
result.should.equal(true);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("CHECK IF DATE IN THIS MONTH", function() {
|
|
79
88
|
let today = new Date();
|
|
80
89
|
let result = gudhub.checkRecurringDate(today, 'month');
|
|
81
90
|
result.should.equal(true);
|
|
@@ -1,55 +1,52 @@
|
|
|
1
|
-
export function makeNestedList(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
map[parentId][children_property].push(map[item[id]]);
|
|
19
|
-
} else {
|
|
20
|
-
roots.push(map[item[id]]);
|
|
1
|
+
export function makeNestedList(arr, id, parent_id, children_property, priority_property) {
|
|
2
|
+
let array = JSON.parse(JSON.stringify(arr));
|
|
3
|
+
let children = Boolean(children_property) ? children_property : 'children';
|
|
4
|
+
let priority = Boolean(priority_property) ? priority_property : false;
|
|
5
|
+
let i;
|
|
6
|
+
for (i = 0; i < array.length; i++) {
|
|
7
|
+
if (array[i][parent_id] && array[i][parent_id] !== 0) {
|
|
8
|
+
array.forEach((parent) => {
|
|
9
|
+
if (array[i][parent_id] == parent[id]) {
|
|
10
|
+
if (!parent[children]) {
|
|
11
|
+
parent[children] = [];
|
|
12
|
+
}
|
|
13
|
+
parent[children].push(array[i]);
|
|
14
|
+
array.splice(i, 1);
|
|
15
|
+
i == 0 ? i = 0 : i--;
|
|
16
|
+
} else if (parent[children]) {
|
|
17
|
+
findIdsOfChildren(parent);
|
|
21
18
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (priority_property) {
|
|
32
|
-
nodes.sort((a, b) => {
|
|
33
|
-
const priorityA = a[priority_property] ?? Infinity;
|
|
34
|
-
const priorityB = b[priority_property] ?? Infinity;
|
|
35
|
-
return priorityA - priorityB;
|
|
36
|
-
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function findIdsOfChildren(parent) {
|
|
24
|
+
parent[children].forEach((child) => {
|
|
25
|
+
if (child[id] == array[i][parent_id]) {
|
|
26
|
+
if (!child[children]) {
|
|
27
|
+
child[children] = [];
|
|
37
28
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
29
|
+
child[children].push(array[i]);
|
|
30
|
+
array.splice(i, 1);
|
|
31
|
+
i == 0 ? i = 0 : i--;
|
|
32
|
+
} else if (child[children]) {
|
|
33
|
+
findIdsOfChildren(child);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function sortChildrensByPriority(unsorted_array) {
|
|
39
|
+
unsorted_array.sort( (a, b) => a[priority] - b[priority])
|
|
40
|
+
unsorted_array.forEach(element => {
|
|
41
|
+
if(element[children]) {
|
|
42
|
+
sortChildrensByPriority(element[children])
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if(priority) {
|
|
48
|
+
sortChildrensByPriority(array);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return array;
|
|
52
|
+
}
|
|
@@ -29,35 +29,6 @@ describe("NESTED LIST", function () {
|
|
|
29
29
|
nestedList[0].title.should.equal('Nineth');
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
it("Should return correct nested structure with children", function () {
|
|
33
|
-
let nestedList = gudhub.makeNestedList(nestedComplicatedListWithDocs, 'id', 'parent_id', 'children');
|
|
34
|
-
|
|
35
|
-
nestedList.should.be.an.Array().and.have.length(1);
|
|
36
|
-
nestedList[0].should.have.property('children');
|
|
37
|
-
nestedList[0].children.should.be.an.Array().and.have.length(4);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it("Should correctly sort children by priority", function () {
|
|
41
|
-
let nestedList = gudhub.makeNestedList(nestedComplicatedListWithDocs, 'id', 'parent_id', 'children', 'priority');
|
|
42
|
-
|
|
43
|
-
nestedList[0].children[0].title.should.equal('Intro');
|
|
44
|
-
nestedList[0].children[1].title.should.equal('Getting Started');
|
|
45
|
-
nestedList[0].children[2].title.should.equal('Node Installing');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it("Should correctly handle deeply nested structures", function () {
|
|
49
|
-
let nestedList = gudhub.makeNestedList(nestedComplicatedListWithDocs, 'id', 'parent_id', 'children', 'priority');
|
|
50
|
-
let featuresChildren = nestedList[0].children[3].children[4].children;
|
|
51
|
-
|
|
52
|
-
featuresChildren.should.be.an.Array().and.have.length(8);
|
|
53
|
-
featuresChildren[0].title.should.equal("Bundler");
|
|
54
|
-
featuresChildren[7].title.should.equal("SSR-Menu");
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("Should return empty array for items without parents when parent_id is not found", function () {
|
|
58
|
-
let nestedList = gudhub.makeNestedList([], 'id', 'parent_id', 'children');
|
|
59
|
-
nestedList.should.be.an.Array().and.have.length(0);
|
|
60
|
-
});
|
|
61
32
|
});
|
|
62
33
|
|
|
63
34
|
let input = [
|
|
@@ -179,8 +150,7 @@ let complicatedInput = [
|
|
|
179
150
|
parent_id: "26553.2884361",
|
|
180
151
|
title: "Child of second parent"
|
|
181
152
|
}
|
|
182
|
-
]
|
|
183
|
-
|
|
153
|
+
]
|
|
184
154
|
let parentInput = [
|
|
185
155
|
{
|
|
186
156
|
"id": "27026.2937695",
|
|
@@ -212,112 +182,4 @@ let parentInput = [
|
|
|
212
182
|
"title": "Nineth",
|
|
213
183
|
"priority": "0"
|
|
214
184
|
}
|
|
215
|
-
]
|
|
216
|
-
|
|
217
|
-
let nestedComplicatedListWithDocs = [
|
|
218
|
-
{
|
|
219
|
-
id: "123001.1237001",
|
|
220
|
-
parent_id: "",
|
|
221
|
-
title: "SSR/SSG - Parent"
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
id: "123002.1237002",
|
|
225
|
-
parent_id: "123001.1237001",
|
|
226
|
-
title: "Intro",
|
|
227
|
-
priority: 1
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
id: "123003.1237003",
|
|
231
|
-
parent_id: "123001.1237001",
|
|
232
|
-
title: "Getting Started",
|
|
233
|
-
priority: 2
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
id: "123004.1237004",
|
|
237
|
-
parent_id: "123001.1237001",
|
|
238
|
-
title: "Node Installing",
|
|
239
|
-
priority: 3
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
id: "123005.1237005",
|
|
243
|
-
parent_id: "123001.1237001",
|
|
244
|
-
title: "Server - Parent 2"
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
id: "123006.1237006",
|
|
248
|
-
parent_id: "123005.1237005",
|
|
249
|
-
title: "Server",
|
|
250
|
-
priority: 4
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
id: "123007.1237007",
|
|
254
|
-
parent_id: "123005.1237005",
|
|
255
|
-
title: "Install",
|
|
256
|
-
priority: 5
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
id: "123008.1237008",
|
|
260
|
-
parent_id: "123005.1237005",
|
|
261
|
-
title: "Endpoints",
|
|
262
|
-
priority: 6
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
id: "123009.1237009",
|
|
266
|
-
parent_id: "123005.1237005",
|
|
267
|
-
title: "Configure",
|
|
268
|
-
priority: 7
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
id: "123010.1237010",
|
|
272
|
-
parent_id: "123005.1237005",
|
|
273
|
-
title: "Features - Parent 3"
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
id: "123011.1237011",
|
|
277
|
-
parent_id: "123010.1237010",
|
|
278
|
-
title: "Bundler",
|
|
279
|
-
priority: 8
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
id: "123012.1237012",
|
|
283
|
-
parent_id: "123010.1237010",
|
|
284
|
-
title: "RedirectsHandler",
|
|
285
|
-
priority: 9
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
id: "123013.1237013",
|
|
289
|
-
parent_id: "123010.1237010",
|
|
290
|
-
title: "SSG",
|
|
291
|
-
priority: 10
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
id: "123014.1237014",
|
|
295
|
-
parent_id: "123010.1237010",
|
|
296
|
-
title: "SSR",
|
|
297
|
-
priority: 11
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
id: "123015.1237015",
|
|
301
|
-
parent_id: "123010.1237010",
|
|
302
|
-
title: "RouteHandler",
|
|
303
|
-
priority: 12
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
id: "123016.1237016",
|
|
307
|
-
parent_id: "123010.1237010",
|
|
308
|
-
title: "SitemapGenerator",
|
|
309
|
-
priority: 13
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
id: "123017.1237017",
|
|
313
|
-
parent_id: "123010.1237010",
|
|
314
|
-
title: "ImageHandler",
|
|
315
|
-
priority: 14
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
id: "123018.1237018",
|
|
319
|
-
parent_id: "123010.1237010",
|
|
320
|
-
title: "SSR-Menu",
|
|
321
|
-
priority: 15
|
|
322
|
-
},
|
|
323
|
-
];
|
|
185
|
+
]
|
package/GUDHUB/gudhub.js
CHANGED
|
@@ -74,16 +74,9 @@ export class GudHub {
|
|
|
74
74
|
// this.util,
|
|
75
75
|
// new ChunkDataService(this.req, chunkDataServiceConf, this),
|
|
76
76
|
// );
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this.req,
|
|
81
|
-
this.ws,
|
|
82
|
-
// this.chunksManager,
|
|
83
|
-
this.util,
|
|
84
|
-
options.activateSW,
|
|
85
|
-
new AppDataService(this.req, appDataServiceConf, this),
|
|
86
|
-
);
|
|
77
|
+
|
|
78
|
+
this.initializeAppProcessor();
|
|
79
|
+
|
|
87
80
|
this.itemProcessor = new ItemProcessor(
|
|
88
81
|
this.storage,
|
|
89
82
|
this.pipeService,
|
|
@@ -114,6 +107,19 @@ export class GudHub {
|
|
|
114
107
|
}
|
|
115
108
|
}
|
|
116
109
|
|
|
110
|
+
initializeAppProcessor() {
|
|
111
|
+
this.appProcessor = new AppProcessor(
|
|
112
|
+
this.storage,
|
|
113
|
+
this.pipeService,
|
|
114
|
+
this.req,
|
|
115
|
+
this.ws,
|
|
116
|
+
// this.chunksManager,
|
|
117
|
+
this.util,
|
|
118
|
+
this.config.activateSW,
|
|
119
|
+
new AppDataService(this.req, appDataServiceConf, this),
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
117
123
|
async activateSW(swLink) {
|
|
118
124
|
if (IS_BROWSER_MAIN_THREAD && "serviceWorker" in window.navigator) {
|
|
119
125
|
try {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AppProcessor } from "./AppProcessor/AppProcessor";
|
|
2
|
+
import { AppHttpService } from "./DataService/httpService/AppHttpService";
|
|
3
|
+
import { GudHub } from "./gudhub";
|
|
4
|
+
|
|
5
|
+
export class GudHubForAppRequestWorker extends GudHub {
|
|
6
|
+
initializeAppProcessor() {
|
|
7
|
+
this.appProcessor = new AppProcessor(
|
|
8
|
+
this.storage,
|
|
9
|
+
this.pipeService,
|
|
10
|
+
this.req,
|
|
11
|
+
this.ws,
|
|
12
|
+
// this.chunksManager,
|
|
13
|
+
this.util,
|
|
14
|
+
false,
|
|
15
|
+
new AppHttpService(this.req, null, this),
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
}
|
package/build.sh
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export PATH=$PATH:node_modules/.bin
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
|
|
8
|
+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
9
|
+
|
|
10
|
+
nvm ls 16 >/dev/null 2>&1
|
|
11
|
+
if [ $? -ne 0 ]; then
|
|
12
|
+
echo "Node.js version 16 is not installed. Installing Node.js version 16..."
|
|
13
|
+
nvm install 16
|
|
14
|
+
else
|
|
15
|
+
echo "Node.js version 16 is already installed."
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
nvm ls 18 >/dev/null 2>&1
|
|
20
|
+
if [ $? -ne 0 ]; then
|
|
21
|
+
echo "Node.js version 18 is not installed. Installing Node.js version 18..."
|
|
22
|
+
nvm install 18
|
|
23
|
+
else
|
|
24
|
+
echo "Node.js version 18 is already installed."
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
sed -i '/PARCEL_APP_REQUEST_WORKER_FILENAME/d' GUDHUB/DataService/IndexedDB/IndexedDBAppService.js
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
nvm use 16
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# builds appRequestWorker bundle
|
|
35
|
+
./node_modules/.bin/parcel build --config .parcelrc.appRequestWorker --target appRequestWorker
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
git checkout -- GUDHUB/DataService/IndexedDB/IndexedDBAppService.js
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
sed -i 's|PARCEL_APP_REQUEST_WORKER_FILENAME.js|PARCEL_APP_REQUEST_WORKER_FILENAME.js?worker\&inline|g' GUDHUB/DataService/IndexedDB/IndexedDBAppService.js
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
nvm use 18
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
node_modules/.bin/vite -c vite.config.esm.js build
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
node_modules/.bin/vite -c vite.config.umd.js build
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
git checkout -- GUDHUB/DataService/IndexedDB/IndexedDBAppService.js
|
|
54
|
+
|
|
55
|
+
rm ./dist/PARCEL_APP_REQUEST_WORKER_FILENAME.js
|