@gudhub/core 1.2.4-beta.6 → 1.2.4-beta.60

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.
Files changed (63) hide show
  1. package/.parcel-cache/83e7562660f7cc15-BundleGraph +0 -0
  2. package/.parcel-cache/9a0d07555444f4da-AssetGraph +0 -0
  3. package/.parcel-cache/d3a1b9507cb44047-AssetGraph +0 -0
  4. package/.parcel-cache/data.mdb +0 -0
  5. package/.parcel-cache/dc1da35000e13623-RequestGraph +0 -0
  6. package/.parcel-cache/lock.mdb +0 -0
  7. package/.parcel-cache/snapshot-dc1da35000e13623.txt +29402 -0
  8. package/.parcelrc.appRequestWorker +4 -0
  9. package/GUDHUB/AppProcessor/AppProcessor.js +58 -26
  10. package/GUDHUB/ChunksManager/ChunksManager.test.js +11 -4
  11. package/GUDHUB/DataService/AppDataService.js +36 -1
  12. package/GUDHUB/DataService/ChunkDataService.js +7 -1
  13. package/GUDHUB/DataService/IndexedDB/IndexedDBAppService.js +773 -43
  14. package/GUDHUB/DataService/IndexedDB/IndexedDBChunkService.js +118 -85
  15. package/GUDHUB/DataService/IndexedDB/IndexedDBService.js +171 -7
  16. package/GUDHUB/DataService/IndexedDB/StoreManager/BaseStoreManager.js +97 -0
  17. package/GUDHUB/DataService/IndexedDB/StoreManager/managers.js +77 -0
  18. package/GUDHUB/DataService/IndexedDB/appDataConf.js +6 -3
  19. package/GUDHUB/DataService/IndexedDB/appRequestWorker.js +163 -0
  20. package/GUDHUB/DataService/IndexedDB/chunkDataConf.js +3 -3
  21. package/GUDHUB/DataService/IndexedDB/consts.js +1 -1
  22. package/GUDHUB/DataService/IndexedDB/init.js +18 -17
  23. package/GUDHUB/DataService/IndexedDB/storeManagerConf/chunkCacheStoreManagerConf.js +11 -0
  24. package/GUDHUB/DataService/IndexedDB/storeManagerConf/init.js +1 -0
  25. package/GUDHUB/DataService/export.js +69 -14
  26. package/GUDHUB/DataService/httpService/AppHttpService.js +13 -5
  27. package/GUDHUB/DataService/httpService/ChunkHttpService.js +41 -26
  28. package/GUDHUB/DataService/utils.js +27 -27
  29. package/GUDHUB/FileManager/FileManager.js +7 -3
  30. package/GUDHUB/GHConstructor/createAngularModuleInstance.js +63 -42
  31. package/GUDHUB/GHConstructor/createClassInstance.js +8 -3
  32. package/GUDHUB/ItemProcessor/ItemProcessor.js +14 -6
  33. package/GUDHUB/Storage/ModulesList.js +66 -3
  34. package/GUDHUB/Utils/AppsTemplateService/AppsTemplateService.js +48 -5
  35. package/GUDHUB/Utils/Utils.js +29 -1
  36. package/GUDHUB/Utils/filter/filter.js +32 -1
  37. package/GUDHUB/Utils/get_date/get_date.test.js +3 -12
  38. package/GUDHUB/Utils/merge_chunks/merge_chunks.js +36 -28
  39. package/GUDHUB/Utils/merge_chunks/merge_chunks.worker.js +78 -0
  40. package/GUDHUB/Utils/merge_compare_items/merge_compare_items.js +40 -9
  41. package/GUDHUB/Utils/nested_list/nested_list.js +53 -50
  42. package/GUDHUB/Utils/nested_list/nested_list.test.js +140 -2
  43. package/GUDHUB/WebSocket/WebSocket.js +2 -1
  44. package/GUDHUB/api/AppApi.js +13 -13
  45. package/GUDHUB/api/ChunkApi.js +6 -6
  46. package/GUDHUB/config.js +11 -2
  47. package/GUDHUB/consts.js +15 -1
  48. package/GUDHUB/gudhub.js +48 -26
  49. package/GUDHUB/gudhubAppRequestWorker.js +18 -0
  50. package/build.sh +127 -0
  51. package/diff.txt +1221 -0
  52. package/dist/gudhub.es.js +13455 -0
  53. package/dist/gudhub.umd.js +197 -0
  54. package/index.js +3 -1
  55. package/indexUMD.js +0 -2
  56. package/package.json +38 -22
  57. package/umd/library.min.js +285 -2
  58. package/umd/library.min.js.map +1 -1
  59. package/vite.config.esm.js +72 -0
  60. package/vite.config.umd.js +68 -0
  61. package/GUDHUB/ChunksManager/ChunksManager.js +0 -68
  62. package/umd/library.min.js.LICENSE.txt +0 -13
  63. package/webpack.config.js +0 -33
@@ -0,0 +1,72 @@
1
+ import { defineConfig } from 'vite'
2
+ import { resolve } from 'path'
3
+ import { babel } from '@rollup/plugin-babel';
4
+
5
+
6
+ let isMinified = true;
7
+
8
+
9
+ export default defineConfig({
10
+ build: {
11
+ minify: true,
12
+ sourcemap: 'inline',
13
+ rollupOptions: {
14
+ output: {
15
+ // Enables inline worker support using a data URI
16
+ inlineDynamicImports: true,
17
+ // globals: {
18
+ // GudHub: 'GudHub',
19
+ // },
20
+ },
21
+
22
+ },
23
+
24
+ lib: {
25
+ entry: resolve(__dirname, 'index.js'),
26
+ fileName: (format) => `gudhub.${format}.js`,
27
+ name: 'GudHub',
28
+ formats: ['es'],
29
+ },
30
+ emptyOutDir: false,
31
+ },
32
+ plugins: [
33
+ {
34
+ name: 'worker-loader',
35
+ transform(code, id) {
36
+ if (id.endsWith('PARCEL_APP_REQUEST_WORKER_FILENAME.js')) {
37
+ return {
38
+ code: `export default new URL('${id}?worker', import.meta.url)`,
39
+ map: null // Optional: if you want source maps for the worker
40
+ }
41
+ }
42
+ return code
43
+ }
44
+ },
45
+ babel({
46
+ presets: [
47
+ [
48
+ '@babel/preset-env', {
49
+ targets: '> 0.25%, last 2 versions, not dead',
50
+ // useBuiltIns: 'entry', // @babel/plugin-transform-runtime When this plugin is enabled, the useBuiltIns option in @babel/preset-env must not be set. Otherwise, this plugin may not able to completely sandbox the environment.
51
+ corejs: '3.40.0',
52
+ shippedProposals: true,
53
+ }
54
+ ],
55
+ ],
56
+
57
+ plugins: [
58
+ [
59
+ '@babel/plugin-transform-runtime', {
60
+ "corejs": { version: 3, proposals: true }, // will be replaced. Take a look to https://github.com/babel/babel-polyfills/blob/main/packages/babel-plugin-polyfill-corejs3/README.md
61
+ "helpers": true,
62
+ "regenerator": true,
63
+ "version": "7.26.0"
64
+ }
65
+ ],
66
+ ],
67
+
68
+ babelHelpers: 'runtime',
69
+ }),
70
+ ]
71
+ });
72
+
@@ -0,0 +1,68 @@
1
+ import { defineConfig } from 'vite'
2
+ import { resolve } from 'path'
3
+ import { babel } from '@rollup/plugin-babel';
4
+
5
+
6
+ export default defineConfig({
7
+ build: {
8
+ minify: true,
9
+ sourcemap: 'inline',
10
+ rollupOptions: {
11
+ output: {
12
+ // Enables inline worker support using a data URI
13
+ inlineDynamicImports: true,
14
+ // globals: {
15
+ // GudHub: 'GudHub',
16
+ // },
17
+ },
18
+
19
+ },
20
+
21
+ lib: {
22
+ entry: resolve(__dirname, 'indexUMD.js'),
23
+ fileName: (format) => `gudhub.${format}.js`,
24
+ name: 'GudHub',
25
+ formats: ['umd'],
26
+ },
27
+ emptyOutDir: false,
28
+ },
29
+ plugins: [
30
+ {
31
+ name: 'worker-loader',
32
+ transform(code, id) {
33
+ if (id.endsWith('PARCEL_APP_REQUEST_WORKER_FILENAME.js')) {
34
+ return {
35
+ code: `export default new URL('${id}?worker', import.meta.url)`,
36
+ map: null // Optional: if you want source maps for the worker
37
+ }
38
+ }
39
+ return code
40
+ }
41
+ },
42
+ babel({
43
+ presets: [
44
+ [
45
+ '@babel/preset-env', {
46
+ targets: '> 0.25%, last 2 versions, not dead',
47
+ // useBuiltIns: 'entry', // @babel/plugin-transform-runtime When this plugin is enabled, the useBuiltIns option in @babel/preset-env must not be set. Otherwise, this plugin may not able to completely sandbox the environment.
48
+ corejs: '3.40.0',
49
+ shippedProposals: true,
50
+ }
51
+ ],
52
+ ],
53
+
54
+ plugins: [
55
+ [
56
+ '@babel/plugin-transform-runtime', {
57
+ "corejs": { version: 3, proposals: true }, // will be replaced. Take a look to https://github.com/babel/babel-polyfills/blob/main/packages/babel-plugin-polyfill-corejs3/README.md
58
+ "helpers": true,
59
+ "regenerator": true,
60
+ "version": "7.26.0"
61
+ }
62
+ ],
63
+ ],
64
+
65
+ babelHelpers: 'runtime',
66
+ }),
67
+ ]
68
+ });
@@ -1,68 +0,0 @@
1
- import { ChunkAPI } from "../api/ChunkApi.js";
2
-
3
-
4
- export class ChunksManager {
5
- constructor(
6
- storage,
7
- pipeService,
8
- req,
9
- util,
10
- dataService,
11
- ) {
12
- this.storage = storage;
13
- this.pipeService = pipeService;
14
- this.req = req;
15
- this.util = util;
16
- this.dataService = dataService;
17
- this.chunkApi = new ChunkAPI(req);
18
- this.itemListeners();
19
- }
20
-
21
- async getChunk(app_id, chunk_id) {
22
- try {
23
- return this.dataService.getChunk(app_id, chunk_id);
24
- } catch (err) {
25
- console.log(err);
26
- return null;
27
- }
28
- }
29
-
30
- async getLastChunk(app_id) {
31
- try {
32
- return this.chunkApi.getLastChunk(app_id);
33
- } catch (err) {
34
- console.log(err);
35
- return null;
36
- }
37
- }
38
-
39
- async getChunks(app_id, chunk_ids) {
40
- let chunks = [];
41
- if(chunk_ids){
42
- chunks = await Promise.all(chunk_ids.map((chunk_id) => this.getChunk(app_id, chunk_id)));
43
- }
44
- return chunks;
45
- }
46
-
47
- itemListeners() {
48
- }
49
-
50
- async getApp(app_id) {
51
- if (!app_id) return null;
52
- let app = this.getAppFromStorage(app_id);
53
- if (!app) {
54
- if (this.getAppPromises[app_id]) {
55
- return this.getAppPromises[app_id];
56
- }
57
- this.getAppPromises[app_id] = this.getAppApi(app_id);
58
- app = await this.getAppPromises[app_id];
59
- if (app) {
60
- this.saveAppInStorage(app);
61
- this.ws.addSubscription(app_id);
62
- } else {
63
- return null;
64
- }
65
- }
66
- return app;
67
- }
68
- }
@@ -1,13 +0,0 @@
1
- /*! jsonpath 1.1.1 */
2
-
3
- //!!! temporary check !!!! if app has chanks property then we start getting it
4
-
5
- //!!!!! 1) Change for each to for
6
-
7
- //!!!!! 2) Stop iteration after value has been found
8
-
9
- //!!!!! Shou Be Renamed to getFields() !!!!!!!
10
-
11
- //!!!!! Shou Be added fieldID argument !!!!!!!
12
-
13
- //!!!!!!!!!!!!!!******** All Methods below should be moved to AppProcesor and Auth **********!!!!!!!!!!!!!!!!//
package/webpack.config.js DELETED
@@ -1,33 +0,0 @@
1
- import { fileURLToPath } from 'url';
2
- import path from 'path';
3
-
4
- // Convert import.meta.url to a file path
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = path.dirname(__filename);
7
-
8
- export default {
9
- entry: './indexUMD.js', // Entry point of your library
10
- output: {
11
- path: path.resolve(__dirname, './umd'),
12
- filename: 'library.min.js', // Output filename
13
- library: 'GudHubLibrary', // Global variable name
14
- libraryTarget: 'umd', // Universal Module Definition
15
- globalObject: 'this' // Ensures compatibility in various environments
16
- },
17
- module: {
18
- rules: [
19
- {
20
- test: /\.js$/,
21
- exclude: /node_modules/,
22
- use: {
23
- loader: 'babel-loader',
24
- options: {
25
- presets: ['@babel/preset-env']
26
- }
27
- }
28
- }
29
- ]
30
- },
31
- externals: [], // List any dependencies you want to exclude from the bundle
32
- mode: 'production', // Use 'development' for development builds
33
- };