piral-core 0.14.0-unstable.3065 → 0.14.0-unstable.3105
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/package.json +4 -6
- package/debug-pilet.ts +0 -11
- package/debug-piral.ts +0 -74
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-core",
|
|
3
|
-
"version": "0.14.0-unstable.
|
|
3
|
+
"version": "0.14.0-unstable.3105",
|
|
4
4
|
"description": "The core library for creating a Piral instance.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -22,8 +22,6 @@
|
|
|
22
22
|
"esm",
|
|
23
23
|
"lib",
|
|
24
24
|
"src",
|
|
25
|
-
"debug-pilet.ts",
|
|
26
|
-
"debug-piral.ts",
|
|
27
25
|
"debug-pilet.d.ts",
|
|
28
26
|
"debug-piral.d.ts",
|
|
29
27
|
"debug-pilet.js",
|
|
@@ -66,8 +64,8 @@
|
|
|
66
64
|
},
|
|
67
65
|
"dependencies": {
|
|
68
66
|
"@dbeining/react-atom": "^4.0.0",
|
|
69
|
-
"piral-base": "^0.14.0-unstable.
|
|
70
|
-
"piral-debug-utils": "^0.14.0-unstable.
|
|
67
|
+
"piral-base": "^0.14.0-unstable.3105",
|
|
68
|
+
"piral-debug-utils": "^0.14.0-unstable.3105"
|
|
71
69
|
},
|
|
72
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "f0732b5a8decdddc5abd7c50a05af59dbcb03912"
|
|
73
71
|
}
|
package/debug-pilet.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LoadPiletsOptions } from 'piral-base';
|
|
2
|
-
import { withEmulatorPilets } from 'piral-debug-utils';
|
|
3
|
-
import { GlobalStateContext } from './lib/types';
|
|
4
|
-
|
|
5
|
-
export function integrate(context: GlobalStateContext, options: LoadPiletsOptions) {
|
|
6
|
-
options.fetchPilets = withEmulatorPilets(options.fetchPilets, {
|
|
7
|
-
injectPilet: context.injectPilet,
|
|
8
|
-
createApi: options.createApi,
|
|
9
|
-
loadPilet: options.loadPilet,
|
|
10
|
-
});
|
|
11
|
-
}
|
package/debug-piral.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { addChangeHandler } from '@dbeining/react-atom';
|
|
2
|
-
import { LoadPiletsOptions } from 'piral-base';
|
|
3
|
-
import { installPiralDebug, DebuggerExtensionOptions } from 'piral-debug-utils';
|
|
4
|
-
import { GlobalStateContext } from './lib/types';
|
|
5
|
-
|
|
6
|
-
export function integrate(
|
|
7
|
-
context: GlobalStateContext,
|
|
8
|
-
options: LoadPiletsOptions,
|
|
9
|
-
debug: DebuggerExtensionOptions = {},
|
|
10
|
-
) {
|
|
11
|
-
installPiralDebug({
|
|
12
|
-
...debug,
|
|
13
|
-
createApi: options.createApi,
|
|
14
|
-
loadPilet: options.loadPilet,
|
|
15
|
-
injectPilet: context.injectPilet,
|
|
16
|
-
fireEvent: context.emit,
|
|
17
|
-
getDependencies() {
|
|
18
|
-
return Object.keys(options.dependencies);
|
|
19
|
-
},
|
|
20
|
-
getExtensions() {
|
|
21
|
-
return context.readState((s) => Object.keys(s.registry.extensions));
|
|
22
|
-
},
|
|
23
|
-
getRoutes() {
|
|
24
|
-
const registeredRoutes = context.readState((state) => Object.keys(state.registry.pages));
|
|
25
|
-
const componentRoutes = context.readState((state) => Object.keys(state.routes));
|
|
26
|
-
return [...componentRoutes, ...registeredRoutes];
|
|
27
|
-
},
|
|
28
|
-
getGlobalState() {
|
|
29
|
-
return context.readState((s) => s);
|
|
30
|
-
},
|
|
31
|
-
getPilets() {
|
|
32
|
-
return context.readState((s) => s.modules);
|
|
33
|
-
},
|
|
34
|
-
setPilets(modules) {
|
|
35
|
-
context.dispatch((state) => ({
|
|
36
|
-
...state,
|
|
37
|
-
modules,
|
|
38
|
-
}));
|
|
39
|
-
},
|
|
40
|
-
integrate(dbg) {
|
|
41
|
-
context.dispatch((s) => ({
|
|
42
|
-
...s,
|
|
43
|
-
components: {
|
|
44
|
-
...s.components,
|
|
45
|
-
...dbg.components,
|
|
46
|
-
},
|
|
47
|
-
routes: {
|
|
48
|
-
...s.routes,
|
|
49
|
-
...dbg.routes,
|
|
50
|
-
},
|
|
51
|
-
registry: {
|
|
52
|
-
...s.registry,
|
|
53
|
-
wrappers: {
|
|
54
|
-
...s.registry.wrappers,
|
|
55
|
-
...dbg.wrappers,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
}));
|
|
59
|
-
|
|
60
|
-
addChangeHandler(context.state, 'debugging', ({ previous, current }) => {
|
|
61
|
-
const pilets = current.modules !== previous.modules;
|
|
62
|
-
const pages = current.registry.pages !== previous.registry.pages || current.routes !== previous.routes;
|
|
63
|
-
const extensions = current.registry.extensions !== previous.registry.extensions;
|
|
64
|
-
const state = current !== previous;
|
|
65
|
-
dbg.onChange(previous, current, {
|
|
66
|
-
pilets,
|
|
67
|
-
pages,
|
|
68
|
-
extensions,
|
|
69
|
-
state,
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
}
|