piral-core 0.15.0-beta.4696 → 0.15.0-beta.4699
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/app.codegen +15 -162
- package/dist/codegen.js +5302 -0
- package/esm/tools/codegen.d.ts +14 -0
- package/esm/tools/codegen.js +140 -0
- package/esm/tools/codegen.js.map +1 -0
- package/esm/{debugger.d.ts → tools/debugger.d.ts} +1 -1
- package/esm/{debugger.js → tools/debugger.js} +0 -0
- package/esm/tools/debugger.js.map +1 -0
- package/{lib → esm/tools}/emulator.d.ts +1 -1
- package/esm/{emulator.js → tools/emulator.js} +0 -0
- package/esm/tools/emulator.js.map +1 -0
- package/lib/tools/codegen.d.ts +14 -0
- package/lib/tools/codegen.js +147 -0
- package/lib/tools/codegen.js.map +1 -0
- package/lib/{debugger.d.ts → tools/debugger.d.ts} +1 -1
- package/lib/{debugger.js → tools/debugger.js} +0 -0
- package/lib/tools/debugger.js.map +1 -0
- package/{esm → lib/tools}/emulator.d.ts +1 -1
- package/lib/{emulator.js → tools/emulator.js} +0 -0
- package/lib/tools/emulator.js.map +1 -0
- package/package.json +8 -7
- package/src/tools/codegen.ts +180 -0
- package/src/{debugger.ts → tools/debugger.ts} +1 -1
- package/src/{emulator.ts → tools/emulator.ts} +1 -1
- package/esm/debugger.js.map +0 -1
- package/esm/emulator.js.map +0 -1
- package/lib/debugger.js.map +0 -1
- package/lib/emulator.js.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface CodegenOptions {
|
|
2
|
+
root: string;
|
|
3
|
+
cat: string;
|
|
4
|
+
appName: string;
|
|
5
|
+
externals: Array<string>;
|
|
6
|
+
publicPath: string;
|
|
7
|
+
debug: boolean;
|
|
8
|
+
emulator: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function createDependencies(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
11
|
+
export declare function createDefaultState(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
12
|
+
export declare function createDebugHandler(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
13
|
+
export declare function createRouteHandler(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// this file is bundled, so the references here will not be at runtime (i.e., for a user)
|
|
2
|
+
import { getModulePath } from 'piral-cli/src/external/resolve';
|
|
3
|
+
function getRouterVersion(root) {
|
|
4
|
+
const router = 'react-router';
|
|
5
|
+
try {
|
|
6
|
+
const modulePath = getModulePath(root, `${router}/package.json`);
|
|
7
|
+
const { version } = require(modulePath);
|
|
8
|
+
const [major] = version.split('.');
|
|
9
|
+
return parseInt(major, 10);
|
|
10
|
+
}
|
|
11
|
+
catch (_a) {
|
|
12
|
+
console.warn(`Could not determine version of ${router}. Falling back to v5`);
|
|
13
|
+
return 5;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function getIdentifiers(root, packageName) {
|
|
17
|
+
const packageJson = `${packageName}/package.json`;
|
|
18
|
+
try {
|
|
19
|
+
const modulePath = getModulePath(root, packageJson);
|
|
20
|
+
const details = require(modulePath);
|
|
21
|
+
if (details.version) {
|
|
22
|
+
return [packageName, `${packageName}@${details.version}`];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (_a) { }
|
|
26
|
+
return [packageName];
|
|
27
|
+
}
|
|
28
|
+
function getModulePathOrDefault(root, name) {
|
|
29
|
+
try {
|
|
30
|
+
return getModulePath(root, name);
|
|
31
|
+
}
|
|
32
|
+
catch (_a) {
|
|
33
|
+
return name;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function createDependencies(imports, exports, opts) {
|
|
37
|
+
const { root, appName, externals } = opts;
|
|
38
|
+
const assignments = [];
|
|
39
|
+
if (appName) {
|
|
40
|
+
assignments.push(`deps['${appName}']={}`);
|
|
41
|
+
}
|
|
42
|
+
for (const name of externals) {
|
|
43
|
+
const identifiers = getIdentifiers(root, name);
|
|
44
|
+
const path = getModulePathOrDefault(root, name);
|
|
45
|
+
const ref = `_${imports.length}`;
|
|
46
|
+
imports.push(`import * as ${ref} from ${JSON.stringify(path)}`);
|
|
47
|
+
for (const id of identifiers) {
|
|
48
|
+
assignments.push(`deps[${JSON.stringify(id)}]=${ref}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.push(`
|
|
52
|
+
export function fillDependencies(deps) {
|
|
53
|
+
${assignments.join(';')}
|
|
54
|
+
}
|
|
55
|
+
`);
|
|
56
|
+
}
|
|
57
|
+
export function createDefaultState(imports, exports, opts) {
|
|
58
|
+
const { root, cat, publicPath } = opts;
|
|
59
|
+
const routerVersion = getRouterVersion(root);
|
|
60
|
+
imports.push(`import { DefaultErrorInfo } from 'piral-core/${cat}/defaults/DefaultErrorInfo';`, `import { DefaultLoadingIndicator } from 'piral-core/${cat}/defaults/DefaultLoadingIndicator';`, `import { DefaultLayout } from 'piral-core/${cat}/defaults/DefaultLayout';`);
|
|
61
|
+
if (routerVersion < 6) {
|
|
62
|
+
imports.push(`import { DefaultRouter } from 'piral-core/${cat}/defaults/DefaultRouter_v5';`, `import { DefaultRouteSwitch } from 'piral-core/${cat}/defaults/DefaultRouteSwitch_v5';`, `import { createRedirect, createNavigation, useCurrentNavigation, useRouterContext } from 'piral-core/${cat}/defaults/navigator_v5'`);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
imports.push(`import { DefaultRouter } from 'piral-core/${cat}/defaults/DefaultRouter_v6';`, `import { DefaultRouteSwitch } from 'piral-core/${cat}/defaults/DefaultRouteSwitch_v6';`, `import { createRedirect, createNavigation, useCurrentNavigation, useRouterContext } from 'piral-core/${cat}/defaults/navigator_v6'`);
|
|
66
|
+
}
|
|
67
|
+
exports.push(`
|
|
68
|
+
export { createRedirect, createNavigation, useRouterContext };
|
|
69
|
+
`);
|
|
70
|
+
exports.push(`
|
|
71
|
+
export const publicPath = ${JSON.stringify(publicPath)};
|
|
72
|
+
`);
|
|
73
|
+
exports.push(`
|
|
74
|
+
export function createDefaultState() {
|
|
75
|
+
return {
|
|
76
|
+
app: {
|
|
77
|
+
error: undefined,
|
|
78
|
+
loading: typeof window !== 'undefined',
|
|
79
|
+
},
|
|
80
|
+
components: {
|
|
81
|
+
ErrorInfo: DefaultErrorInfo,
|
|
82
|
+
LoadingIndicator: DefaultLoadingIndicator,
|
|
83
|
+
Router: DefaultRouter,
|
|
84
|
+
RouteSwitch: DefaultRouteSwitch,
|
|
85
|
+
Layout: DefaultLayout,
|
|
86
|
+
},
|
|
87
|
+
errorComponents: {},
|
|
88
|
+
registry: {
|
|
89
|
+
extensions: {},
|
|
90
|
+
pages: {},
|
|
91
|
+
wrappers: {},
|
|
92
|
+
},
|
|
93
|
+
routes: {},
|
|
94
|
+
data: {},
|
|
95
|
+
portals: {},
|
|
96
|
+
modules: [],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
`);
|
|
100
|
+
}
|
|
101
|
+
export function createDebugHandler(imports, exports, opts) {
|
|
102
|
+
const { cat, debug, emulator } = opts;
|
|
103
|
+
// if we build the debug version of piral (debug and emulator build)
|
|
104
|
+
if (debug) {
|
|
105
|
+
imports.push(`import { integrateDebugger } from "piral-core/${cat}/tools/debugger"`);
|
|
106
|
+
exports.push(`export { integrateDebugger }`);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
exports.push(`export function integrateDebugger() {}`);
|
|
110
|
+
}
|
|
111
|
+
// if we build the emulator version of piral (shipped to pilets)
|
|
112
|
+
if (emulator) {
|
|
113
|
+
imports.push(`import { integrateEmulator } from "piral-core/${cat}/tools/emulator"`);
|
|
114
|
+
exports.push(`export { integrateEmulator }`);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
exports.push(`export function integrateEmulator() {}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export function createRouteHandler(imports, exports, opts) {
|
|
121
|
+
const { cat, emulator } = opts;
|
|
122
|
+
const assignments = [];
|
|
123
|
+
imports.push(`import { useGlobalStateContext } from 'piral-core/${cat}/hooks/globalState';`);
|
|
124
|
+
assignments.push(`
|
|
125
|
+
useCurrentNavigation();
|
|
126
|
+
`);
|
|
127
|
+
if (emulator) {
|
|
128
|
+
imports.push(`import { debugRouteFilter } from 'piral-debug-utils';`);
|
|
129
|
+
assignments.push('return debugRouteFilter(paths);');
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
assignments.push('return paths;');
|
|
133
|
+
}
|
|
134
|
+
exports.push(`
|
|
135
|
+
export function useRouteFilter(paths) {
|
|
136
|
+
${assignments.join('\n')}
|
|
137
|
+
}
|
|
138
|
+
`);
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=codegen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/tools/codegen.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,MAAM,GAAG,cAAc,CAAC;IAE9B,IAAI;QACF,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,EAAE,GAAG,MAAM,eAAe,CAAC,CAAC;QACjE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;KAC5B;IAAC,WAAM;QACN,OAAO,CAAC,IAAI,CAAC,kCAAkC,MAAM,sBAAsB,CAAC,CAAC;QAC7E,OAAO,CAAC,CAAC;KACV;AACH,CAAC;AAED,SAAS,cAAc,CAAC,IAAY,EAAE,WAAmB;IACvD,MAAM,WAAW,GAAG,GAAG,WAAW,eAAe,CAAC;I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O,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;KAC9C;SAAM;QACL,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;KACxD;IAED,gEAAgE;IAChE,IAAI,QAAQ,EAAE;QACZ,OAAO,CAAC,IAAI,CAAC,iDAAiD,GAAG,kBAAkB,CAAC,CAAC;QACrF,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;KAC9C;SAAM;QACL,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;KACxD;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAsB,EAAE,OAAsB,EAAE,IAAoB;IACrG,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC/B,MAAM,WAAW,GAAG,EAAE,CAAC;IAEvB,OAAO,CAAC,IAAI,CAAC,qDAAqD,GAAG,sBAAsB,CAAC,CAAC;IAE7F,WAAW,CAAC,IAAI,CAAC;;GAEhB,CAAC,CAAC;IAEH,IAAI,QAAQ,EAAE;QACZ,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACtE,WAAW,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;KACrD;SAAM;QACL,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACnC;IAED,OAAO,CAAC,IAAI,CAAC;;QAEP,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;;GAE3B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LoadPiletsOptions } from 'piral-base';
|
|
2
2
|
import { DebuggerExtensionOptions } from 'piral-debug-utils';
|
|
3
|
-
import { GlobalStateContext } from '
|
|
3
|
+
import { GlobalStateContext } from '../types';
|
|
4
4
|
export declare function integrateDebugger(context: GlobalStateContext, options: LoadPiletsOptions, debug?: DebuggerExtensionOptions): void;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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AAU,KAAK,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAChF,MAAM,KAAK,GAAG,OAAO,KAAK,QAAQ,CAAC;gBACnC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE;oBAC9B,MAAM;oBACN,KAAK;oBACL,UAAU;oBACV,KAAK;iBACN,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,IACD,CAAC;AACL,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emulator.js","sourceRoot":"","sources":["../../src/tools/emulator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD,MAAM,UAAU,iBAAiB,CAAC,OAA2B,EAAE,OAA0B;IACvF,oBAAoB,CAAC,OAAO,CAAC,WAAW,EAAE;QACxC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,CAAC,SAAS;YACjB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;QAClC,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface CodegenOptions {
|
|
2
|
+
root: string;
|
|
3
|
+
cat: string;
|
|
4
|
+
appName: string;
|
|
5
|
+
externals: Array<string>;
|
|
6
|
+
publicPath: string;
|
|
7
|
+
debug: boolean;
|
|
8
|
+
emulator: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function createDependencies(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
11
|
+
export declare function createDefaultState(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
12
|
+
export declare function createDebugHandler(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
13
|
+
export declare function createRouteHandler(imports: Array<string>, exports: Array<string>, opts: CodegenOptions): void;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRouteHandler = exports.createDebugHandler = exports.createDefaultState = exports.createDependencies = void 0;
|
|
4
|
+
// this file is bundled, so the references here will not be at runtime (i.e., for a user)
|
|
5
|
+
const resolve_1 = require("piral-cli/src/external/resolve");
|
|
6
|
+
function getRouterVersion(root) {
|
|
7
|
+
const router = 'react-router';
|
|
8
|
+
try {
|
|
9
|
+
const modulePath = (0, resolve_1.getModulePath)(root, `${router}/package.json`);
|
|
10
|
+
const { version } = require(modulePath);
|
|
11
|
+
const [major] = version.split('.');
|
|
12
|
+
return parseInt(major, 10);
|
|
13
|
+
}
|
|
14
|
+
catch (_a) {
|
|
15
|
+
console.warn(`Could not determine version of ${router}. Falling back to v5`);
|
|
16
|
+
return 5;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function getIdentifiers(root, packageName) {
|
|
20
|
+
const packageJson = `${packageName}/package.json`;
|
|
21
|
+
try {
|
|
22
|
+
const modulePath = (0, resolve_1.getModulePath)(root, packageJson);
|
|
23
|
+
const details = require(modulePath);
|
|
24
|
+
if (details.version) {
|
|
25
|
+
return [packageName, `${packageName}@${details.version}`];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (_a) { }
|
|
29
|
+
return [packageName];
|
|
30
|
+
}
|
|
31
|
+
function getModulePathOrDefault(root, name) {
|
|
32
|
+
try {
|
|
33
|
+
return (0, resolve_1.getModulePath)(root, name);
|
|
34
|
+
}
|
|
35
|
+
catch (_a) {
|
|
36
|
+
return name;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function createDependencies(imports, exports, opts) {
|
|
40
|
+
const { root, appName, externals } = opts;
|
|
41
|
+
const assignments = [];
|
|
42
|
+
if (appName) {
|
|
43
|
+
assignments.push(`deps['${appName}']={}`);
|
|
44
|
+
}
|
|
45
|
+
for (const name of externals) {
|
|
46
|
+
const identifiers = getIdentifiers(root, name);
|
|
47
|
+
const path = getModulePathOrDefault(root, name);
|
|
48
|
+
const ref = `_${imports.length}`;
|
|
49
|
+
imports.push(`import * as ${ref} from ${JSON.stringify(path)}`);
|
|
50
|
+
for (const id of identifiers) {
|
|
51
|
+
assignments.push(`deps[${JSON.stringify(id)}]=${ref}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.push(`
|
|
55
|
+
export function fillDependencies(deps) {
|
|
56
|
+
${assignments.join(';')}
|
|
57
|
+
}
|
|
58
|
+
`);
|
|
59
|
+
}
|
|
60
|
+
exports.createDependencies = createDependencies;
|
|
61
|
+
function createDefaultState(imports, exports, opts) {
|
|
62
|
+
const { root, cat, publicPath } = opts;
|
|
63
|
+
const routerVersion = getRouterVersion(root);
|
|
64
|
+
imports.push(`import { DefaultErrorInfo } from 'piral-core/${cat}/defaults/DefaultErrorInfo';`, `import { DefaultLoadingIndicator } from 'piral-core/${cat}/defaults/DefaultLoadingIndicator';`, `import { DefaultLayout } from 'piral-core/${cat}/defaults/DefaultLayout';`);
|
|
65
|
+
if (routerVersion < 6) {
|
|
66
|
+
imports.push(`import { DefaultRouter } from 'piral-core/${cat}/defaults/DefaultRouter_v5';`, `import { DefaultRouteSwitch } from 'piral-core/${cat}/defaults/DefaultRouteSwitch_v5';`, `import { createRedirect, createNavigation, useCurrentNavigation, useRouterContext } from 'piral-core/${cat}/defaults/navigator_v5'`);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
imports.push(`import { DefaultRouter } from 'piral-core/${cat}/defaults/DefaultRouter_v6';`, `import { DefaultRouteSwitch } from 'piral-core/${cat}/defaults/DefaultRouteSwitch_v6';`, `import { createRedirect, createNavigation, useCurrentNavigation, useRouterContext } from 'piral-core/${cat}/defaults/navigator_v6'`);
|
|
70
|
+
}
|
|
71
|
+
exports.push(`
|
|
72
|
+
export { createRedirect, createNavigation, useRouterContext };
|
|
73
|
+
`);
|
|
74
|
+
exports.push(`
|
|
75
|
+
export const publicPath = ${JSON.stringify(publicPath)};
|
|
76
|
+
`);
|
|
77
|
+
exports.push(`
|
|
78
|
+
export function createDefaultState() {
|
|
79
|
+
return {
|
|
80
|
+
app: {
|
|
81
|
+
error: undefined,
|
|
82
|
+
loading: typeof window !== 'undefined',
|
|
83
|
+
},
|
|
84
|
+
components: {
|
|
85
|
+
ErrorInfo: DefaultErrorInfo,
|
|
86
|
+
LoadingIndicator: DefaultLoadingIndicator,
|
|
87
|
+
Router: DefaultRouter,
|
|
88
|
+
RouteSwitch: DefaultRouteSwitch,
|
|
89
|
+
Layout: DefaultLayout,
|
|
90
|
+
},
|
|
91
|
+
errorComponents: {},
|
|
92
|
+
registry: {
|
|
93
|
+
extensions: {},
|
|
94
|
+
pages: {},
|
|
95
|
+
wrappers: {},
|
|
96
|
+
},
|
|
97
|
+
routes: {},
|
|
98
|
+
data: {},
|
|
99
|
+
portals: {},
|
|
100
|
+
modules: [],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
`);
|
|
104
|
+
}
|
|
105
|
+
exports.createDefaultState = createDefaultState;
|
|
106
|
+
function createDebugHandler(imports, exports, opts) {
|
|
107
|
+
const { cat, debug, emulator } = opts;
|
|
108
|
+
// if we build the debug version of piral (debug and emulator build)
|
|
109
|
+
if (debug) {
|
|
110
|
+
imports.push(`import { integrateDebugger } from "piral-core/${cat}/tools/debugger"`);
|
|
111
|
+
exports.push(`export { integrateDebugger }`);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
exports.push(`export function integrateDebugger() {}`);
|
|
115
|
+
}
|
|
116
|
+
// if we build the emulator version of piral (shipped to pilets)
|
|
117
|
+
if (emulator) {
|
|
118
|
+
imports.push(`import { integrateEmulator } from "piral-core/${cat}/tools/emulator"`);
|
|
119
|
+
exports.push(`export { integrateEmulator }`);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
exports.push(`export function integrateEmulator() {}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.createDebugHandler = createDebugHandler;
|
|
126
|
+
function createRouteHandler(imports, exports, opts) {
|
|
127
|
+
const { cat, emulator } = opts;
|
|
128
|
+
const assignments = [];
|
|
129
|
+
imports.push(`import { useGlobalStateContext } from 'piral-core/${cat}/hooks/globalState';`);
|
|
130
|
+
assignments.push(`
|
|
131
|
+
useCurrentNavigation();
|
|
132
|
+
`);
|
|
133
|
+
if (emulator) {
|
|
134
|
+
imports.push(`import { debugRouteFilter } from 'piral-debug-utils';`);
|
|
135
|
+
assignments.push('return debugRouteFilter(paths);');
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
assignments.push('return paths;');
|
|
139
|
+
}
|
|
140
|
+
exports.push(`
|
|
141
|
+
export function useRouteFilter(paths) {
|
|
142
|
+
${assignments.join('\n')}
|
|
143
|
+
}
|
|
144
|
+
`);
|
|
145
|
+
}
|
|
146
|
+
exports.createRouteHandler = createRouteHandler;
|
|
147
|
+
//# sourceMappingURL=codegen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/tools/codegen.ts"],"names":[],"mappings":";;;AAAA,yFAAyF;AACzF,4DAA+D;AAE/D,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,MAAM,GAAG,cAAc,CAAC;IAE9B,IAAI;QACF,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,IAAI,EAAE,GAAG,MAAM,eAAe,CAAC,CAAC;QACjE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;KAC5B;IAAC,WAAM;QACN,OAAO,CAAC,IAAI,CAAC,kCAAkC,MAAM,sBAAsB,CAAC,CAAC;QAC7E,OAAO,CAAC,CAAC;KACV;AACH,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AG,IAAI,CAAC;IAEtC,oEAAoE;IACpE,IAAI,KAAK,EAAE;QACT,OAAO,CAAC,IAAI,CAAC,iDAAiD,GAAG,kBAAkB,CAAC,CAAC;QACrF,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;KAC9C;SAAM;QACL,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;KACxD;IAED,gEAAgE;IAChE,IAAI,QAAQ,EAAE;QACZ,OAAO,CAAC,IAAI,CAAC,iDAAiD,GAAG,kBAAkB,CAAC,CAAC;QACrF,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;KAC9C;SAAM;QACL,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;KACxD;AACH,CAAC;AAlBD,gDAkBC;AAED,SAAgB,kBAAkB,CAAC,OAAsB,EAAE,OAAsB,EAAE,IAAoB;IACrG,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC/B,MAAM,WAAW,GAAG,EAAE,CAAC;IAEvB,OAAO,CAAC,IAAI,CAAC,qDAAqD,GAAG,sBAAsB,CAAC,CAAC;IAE7F,WAAW,CAAC,IAAI,CAAC;;GAEhB,CAAC,CAAC;IAEH,IAAI,QAAQ,EAAE;QACZ,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACtE,WAAW,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;KACrD;SAAM;QACL,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACnC;IAED,OAAO,CAAC,IAAI,CAAC;;QAEP,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;;GAE3B,CAAC,CAAC;AACL,CAAC;AAtBD,gDAsBC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LoadPiletsOptions } from 'piral-base';
|
|
2
2
|
import { DebuggerExtensionOptions } from 'piral-debug-utils';
|
|
3
|
-
import { GlobalStateContext } from '
|
|
3
|
+
import { GlobalStateContext } from '../types';
|
|
4
4
|
export declare function integrateDebugger(context: GlobalStateContext, options: LoadPiletsOptions, debug?: DebuggerExtensionOptions): void;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debugger.js","sourceRoot":"","sources":["../../src/tools/debugger.ts"],"names":[],"mappings":";;;AACA,yDAAgF;AAGhF,SAAgB,iBAAiB,CAC/B,OAA2B,EAC3B,OAA0B,EAC1B,QAAkC,EAAE;IAEpC,IAAA,qCAAiB,kCACZ,KAAK,KACR,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAC1B,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,WAAW,CAAC,KAAK;YACf,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACnB,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;gBAC9B,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;gBAEhC,IAAI;oBACF,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;oBAC3B,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;iBACrB;gBAAC,OAAO,KAAK,EAAE;oBACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBACtB;aACF;iBAAM;gBACL,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;aAC5B;QACH,CAAC,EACD,SAAS,EAAE,OAAO,CAAC,IAAI,EACvB,eAAe;YACb,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC3C,CAAC;QACD,aAAa;YACX,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QACtE,CAAC;QACD,SAAS;YACP,MAAM,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAA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CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC;gBACvG,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,KAAK,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAChF,MAAM,KAAK,GAAG,OAAO,KAAK,QAAQ,CAAC;gBACnC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE;oBAC9B,MAAM;oBACN,KAAK;oBACL,UAAU;oBACV,KAAK;iBACN,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,IACD,CAAC;AACL,CAAC;AA/ED,8CA+EC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emulator.js","sourceRoot":"","sources":["../../src/tools/emulator.ts"],"names":[],"mappings":";;;AACA,yDAAyD;AAGzD,SAAgB,iBAAiB,CAAC,OAA2B,EAAE,OAA0B;IACvF,IAAA,wCAAoB,EAAC,OAAO,CAAC,WAAW,EAAE;QACxC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,CAAC,SAAS;YACjB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;QAClC,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AARD,8CAQC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-core",
|
|
3
|
-
"version": "0.15.0-beta.
|
|
3
|
+
"version": "0.15.0-beta.4699",
|
|
4
4
|
"description": "The core library for creating a Piral instance.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"sideEffects": false,
|
|
46
46
|
"files": [
|
|
47
|
+
"dist",
|
|
47
48
|
"esm",
|
|
48
49
|
"lib",
|
|
49
50
|
"src",
|
|
@@ -62,17 +63,17 @@
|
|
|
62
63
|
"url": "https://github.com/smapiot/piral/issues"
|
|
63
64
|
},
|
|
64
65
|
"scripts": {
|
|
65
|
-
"cleanup": "rimraf esm lib",
|
|
66
|
-
"build": "yarn build:commonjs && yarn build:esnext",
|
|
66
|
+
"cleanup": "rimraf dist esm lib",
|
|
67
|
+
"build": "yarn build:commonjs && yarn build:esnext && yarn build:codegen",
|
|
67
68
|
"build:commonjs": "tsc --project tsconfig.json --outDir lib --module commonjs",
|
|
68
69
|
"build:esnext": "tsc --project tsconfig.json --outDir esm --module esnext",
|
|
70
|
+
"build:codegen": "esbuild src/tools/codegen.ts --bundle --outfile=dist/codegen.js --format=cjs --platform=node --external:pnpapi",
|
|
69
71
|
"typedoc": "typedoc --json ../../../docs/types/piral-core.json src --exclude \"src/**/*.test.*\"",
|
|
70
72
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
71
73
|
},
|
|
72
74
|
"dependencies": {
|
|
73
|
-
"
|
|
74
|
-
"piral-
|
|
75
|
-
"piral-debug-utils": "0.15.0-beta.4696",
|
|
75
|
+
"piral-base": "0.15.0-beta.4699",
|
|
76
|
+
"piral-debug-utils": "0.15.0-beta.4699",
|
|
76
77
|
"zustand": "^3.0.0"
|
|
77
78
|
},
|
|
78
79
|
"peerDependencies": {
|
|
@@ -98,5 +99,5 @@
|
|
|
98
99
|
"react-router-dom",
|
|
99
100
|
"tslib"
|
|
100
101
|
],
|
|
101
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "1d7d09c7a953009ade1470abf74b5e7e627f2bc2"
|
|
102
103
|
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// this file is bundled, so the references here will not be at runtime (i.e., for a user)
|
|
2
|
+
import { getModulePath } from 'piral-cli/src/external/resolve';
|
|
3
|
+
|
|
4
|
+
function getRouterVersion(root: string) {
|
|
5
|
+
const router = 'react-router';
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
const modulePath = getModulePath(root, `${router}/package.json`);
|
|
9
|
+
const { version } = require(modulePath);
|
|
10
|
+
const [major] = version.split('.');
|
|
11
|
+
return parseInt(major, 10);
|
|
12
|
+
} catch {
|
|
13
|
+
console.warn(`Could not determine version of ${router}. Falling back to v5`);
|
|
14
|
+
return 5;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getIdentifiers(root: string, packageName: string) {
|
|
19
|
+
const packageJson = `${packageName}/package.json`;
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
const modulePath = getModulePath(root, packageJson);
|
|
23
|
+
const details = require(modulePath);
|
|
24
|
+
|
|
25
|
+
if (details.version) {
|
|
26
|
+
return [packageName, `${packageName}@${details.version}`];
|
|
27
|
+
}
|
|
28
|
+
} catch {}
|
|
29
|
+
|
|
30
|
+
return [packageName];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getModulePathOrDefault(root: string, name: string) {
|
|
34
|
+
try {
|
|
35
|
+
return getModulePath(root, name);
|
|
36
|
+
} catch {
|
|
37
|
+
return name;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface CodegenOptions {
|
|
42
|
+
root: string;
|
|
43
|
+
cat: string;
|
|
44
|
+
appName: string;
|
|
45
|
+
externals: Array<string>;
|
|
46
|
+
publicPath: string;
|
|
47
|
+
debug: boolean;
|
|
48
|
+
emulator: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function createDependencies(imports: Array<string>, exports: Array<string>, opts: CodegenOptions) {
|
|
52
|
+
const { root, appName, externals } = opts;
|
|
53
|
+
const assignments: Array<string> = [];
|
|
54
|
+
|
|
55
|
+
if (appName) {
|
|
56
|
+
assignments.push(`deps['${appName}']={}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
for (const name of externals) {
|
|
60
|
+
const identifiers = getIdentifiers(root, name);
|
|
61
|
+
const path = getModulePathOrDefault(root, name);
|
|
62
|
+
const ref = `_${imports.length}`;
|
|
63
|
+
imports.push(`import * as ${ref} from ${JSON.stringify(path)}`);
|
|
64
|
+
|
|
65
|
+
for (const id of identifiers) {
|
|
66
|
+
assignments.push(`deps[${JSON.stringify(id)}]=${ref}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
exports.push(`
|
|
71
|
+
export function fillDependencies(deps) {
|
|
72
|
+
${assignments.join(';')}
|
|
73
|
+
}
|
|
74
|
+
`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function createDefaultState(imports: Array<string>, exports: Array<string>, opts: CodegenOptions) {
|
|
78
|
+
const { root, cat, publicPath } = opts;
|
|
79
|
+
const routerVersion = getRouterVersion(root);
|
|
80
|
+
|
|
81
|
+
imports.push(
|
|
82
|
+
`import { DefaultErrorInfo } from 'piral-core/${cat}/defaults/DefaultErrorInfo';`,
|
|
83
|
+
`import { DefaultLoadingIndicator } from 'piral-core/${cat}/defaults/DefaultLoadingIndicator';`,
|
|
84
|
+
`import { DefaultLayout } from 'piral-core/${cat}/defaults/DefaultLayout';`,
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
if (routerVersion < 6) {
|
|
88
|
+
imports.push(
|
|
89
|
+
`import { DefaultRouter } from 'piral-core/${cat}/defaults/DefaultRouter_v5';`,
|
|
90
|
+
`import { DefaultRouteSwitch } from 'piral-core/${cat}/defaults/DefaultRouteSwitch_v5';`,
|
|
91
|
+
`import { createRedirect, createNavigation, useCurrentNavigation, useRouterContext } from 'piral-core/${cat}/defaults/navigator_v5'`,
|
|
92
|
+
);
|
|
93
|
+
} else {
|
|
94
|
+
imports.push(
|
|
95
|
+
`import { DefaultRouter } from 'piral-core/${cat}/defaults/DefaultRouter_v6';`,
|
|
96
|
+
`import { DefaultRouteSwitch } from 'piral-core/${cat}/defaults/DefaultRouteSwitch_v6';`,
|
|
97
|
+
`import { createRedirect, createNavigation, useCurrentNavigation, useRouterContext } from 'piral-core/${cat}/defaults/navigator_v6'`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
exports.push(`
|
|
102
|
+
export { createRedirect, createNavigation, useRouterContext };
|
|
103
|
+
`);
|
|
104
|
+
|
|
105
|
+
exports.push(`
|
|
106
|
+
export const publicPath = ${JSON.stringify(publicPath)};
|
|
107
|
+
`);
|
|
108
|
+
|
|
109
|
+
exports.push(`
|
|
110
|
+
export function createDefaultState() {
|
|
111
|
+
return {
|
|
112
|
+
app: {
|
|
113
|
+
error: undefined,
|
|
114
|
+
loading: typeof window !== 'undefined',
|
|
115
|
+
},
|
|
116
|
+
components: {
|
|
117
|
+
ErrorInfo: DefaultErrorInfo,
|
|
118
|
+
LoadingIndicator: DefaultLoadingIndicator,
|
|
119
|
+
Router: DefaultRouter,
|
|
120
|
+
RouteSwitch: DefaultRouteSwitch,
|
|
121
|
+
Layout: DefaultLayout,
|
|
122
|
+
},
|
|
123
|
+
errorComponents: {},
|
|
124
|
+
registry: {
|
|
125
|
+
extensions: {},
|
|
126
|
+
pages: {},
|
|
127
|
+
wrappers: {},
|
|
128
|
+
},
|
|
129
|
+
routes: {},
|
|
130
|
+
data: {},
|
|
131
|
+
portals: {},
|
|
132
|
+
modules: [],
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
`);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function createDebugHandler(imports: Array<string>, exports: Array<string>, opts: CodegenOptions) {
|
|
139
|
+
const { cat, debug, emulator } = opts;
|
|
140
|
+
|
|
141
|
+
// if we build the debug version of piral (debug and emulator build)
|
|
142
|
+
if (debug) {
|
|
143
|
+
imports.push(`import { integrateDebugger } from "piral-core/${cat}/tools/debugger"`);
|
|
144
|
+
exports.push(`export { integrateDebugger }`);
|
|
145
|
+
} else {
|
|
146
|
+
exports.push(`export function integrateDebugger() {}`);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// if we build the emulator version of piral (shipped to pilets)
|
|
150
|
+
if (emulator) {
|
|
151
|
+
imports.push(`import { integrateEmulator } from "piral-core/${cat}/tools/emulator"`);
|
|
152
|
+
exports.push(`export { integrateEmulator }`);
|
|
153
|
+
} else {
|
|
154
|
+
exports.push(`export function integrateEmulator() {}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function createRouteHandler(imports: Array<string>, exports: Array<string>, opts: CodegenOptions) {
|
|
159
|
+
const { cat, emulator } = opts;
|
|
160
|
+
const assignments = [];
|
|
161
|
+
|
|
162
|
+
imports.push(`import { useGlobalStateContext } from 'piral-core/${cat}/hooks/globalState';`);
|
|
163
|
+
|
|
164
|
+
assignments.push(`
|
|
165
|
+
useCurrentNavigation();
|
|
166
|
+
`);
|
|
167
|
+
|
|
168
|
+
if (emulator) {
|
|
169
|
+
imports.push(`import { debugRouteFilter } from 'piral-debug-utils';`);
|
|
170
|
+
assignments.push('return debugRouteFilter(paths);');
|
|
171
|
+
} else {
|
|
172
|
+
assignments.push('return paths;');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
exports.push(`
|
|
176
|
+
export function useRouteFilter(paths) {
|
|
177
|
+
${assignments.join('\n')}
|
|
178
|
+
}
|
|
179
|
+
`);
|
|
180
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LoadPiletsOptions } from 'piral-base';
|
|
2
2
|
import { installPiralDebug, DebuggerExtensionOptions } from 'piral-debug-utils';
|
|
3
|
-
import { GlobalStateContext } from '
|
|
3
|
+
import { GlobalStateContext } from '../types';
|
|
4
4
|
|
|
5
5
|
export function integrateDebugger(
|
|
6
6
|
context: GlobalStateContext,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LoadPiletsOptions } from 'piral-base';
|
|
2
2
|
import { installPiletEmulator } from 'piral-debug-utils';
|
|
3
|
-
import { GlobalStateContext } from '
|
|
3
|
+
import { GlobalStateContext } from '../types';
|
|
4
4
|
|
|
5
5
|
export function integrateEmulator(context: GlobalStateContext, options: LoadPiletsOptions) {
|
|
6
6
|
installPiletEmulator(options.fetchPil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CAAC,MAAM,CAAC;gBACvG,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,KAAK,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAChF,MAAM,KAAK,GAAG,OAAO,KAAK,QAAQ,CAAC;gBACnC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE;oBAC9B,MAAM;oBACN,KAAK;oBACL,UAAU;oBACV,KAAK;iBACN,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,IACD,CAAC;AACL,CAAC"}
|
package/esm/emulator.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emulator.js","sourceRoot":"","sources":["../src/emulator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD,MAAM,UAAU,iBAAiB,CAAC,OAA2B,EAAE,OAA0B;IACvF,oBAAoB,CAAC,OAAO,CAAC,WAAW,EAAE;QACxC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,CAAC,SAAS;YACjB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;QAClC,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/lib/debugger.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debugger.js","sourceRoot":"","sources":["../src/debugger.ts"],"names":[],"mappings":";;;AACA,yDAAgF;AAGhF,SAAgB,iBAAiB,CAC/B,OAA2B,EAC3B,OAA0B,EAC1B,QAAkC,EAAE;IAEpC,IAAA,qCAAiB,kCACZ,KAAK,KACR,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAC1B,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,WAAW,CAAC,KAAK;YACf,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACnB,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO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