@kosdev-code/kos-ui-plugin 2.1.7 → 2.1.9
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/{documentation-generator-C0BDW8NY.js → documentation-generator-7qgOfgJZ.js} +231 -208
- package/documentation-generator-7qgOfgJZ.js.map +1 -0
- package/documentation-generator-hrRc6NVI.cjs +266 -0
- package/documentation-generator-hrRc6NVI.cjs.map +1 -0
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/lib/contexts/plugins-provider/plugins-provider.d.ts +2 -2
- package/lib/contexts/plugins-provider/plugins-provider.d.ts.map +1 -1
- package/lib/utils/processors/initialize-plugins.d.ts +1 -1
- package/lib/utils/processors/initialize-plugins.d.ts.map +1 -1
- package/package.json +2 -2
- package/utils.cjs +1 -1
- package/utils.cjs.map +1 -1
- package/utils.js +2 -2
- package/utils.js.map +1 -1
- package/documentation-generator-Blyj8V7Z.cjs +0 -266
- package/documentation-generator-Blyj8V7Z.cjs.map +0 -1
- package/documentation-generator-C0BDW8NY.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins-provider.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-plugin/src/lib/contexts/plugins-provider/plugins-provider.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,iBAAiB,EAKlB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,UAAU,WAAW;IACnB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;IACpD,aAAa,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,eAAe,EAAE,CAAC;CAChE;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,CAAC,EAAE,MAAM,GAAG;QACX,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;KAC9B,CAAC;CACH;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,kDAAoD,CAAC;AAEhF,UAAU,KAAK;IACb,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC;;OAEG;IACH,YAAY,CAAC,EAAE;QACb,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE;YACd,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"plugins-provider.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-plugin/src/lib/contexts/plugins-provider/plugins-provider.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,iBAAiB,EAKlB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,UAAU,WAAW;IACnB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;IACpD,aAAa,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,eAAe,EAAE,CAAC;CAChE;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,CAAC,EAAE,MAAM,GAAG;QACX,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;KAC9B,CAAC;CACH;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,kDAAoD,CAAC;AAEhF,UAAU,KAAK;IACb,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC;;OAEG;IACH,YAAY,CAAC,EAAE;QACb,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE;YACd,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;YAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;SAChB,CAAC;QACF,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACpC,CAAC;CACH;AAgBD;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CACrD,iBAAiB,CAAC,KAAK,CAAC,CAoEzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,mBAQhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize-plugins.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-plugin/src/lib/utils/processors/initialize-plugins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,iDAAiD,CAAC;AAEzD,OAAO,WAAW,cAAc;IAC9B,gBAAgB,EAAE,cAAc,CAAC;IACjC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;CAChD;AACD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE,cAAc,CAAC;KAC5B;CACF;AAED,MAAM,WAAW,UAAU;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,UAAU,EAAE,UAAU,EAAE,CAAC;QACzB,WAAW,EAAE,aAAa,CAAC;KAC5B,CAAC;CACH;AAED,UAAU,eAAe;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE;QACd,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"initialize-plugins.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-plugin/src/lib/utils/processors/initialize-plugins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,iDAAiD,CAAC;AAEzD,OAAO,WAAW,cAAc;IAC9B,gBAAgB,EAAE,cAAc,CAAC;IACjC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;CAChD;AACD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE,cAAc,CAAC;KAC5B;CACF;AAED,MAAM,WAAW,UAAU;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,UAAU,EAAE,UAAU,EAAE,CAAC;QACzB,WAAW,EAAE,aAAa,CAAC;KAC5B,CAAC;CACH;AAED,UAAU,eAAe;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE;QACd,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,sBAiBjB,CAAC;AAWX;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,oBAAoB,WAAkB,eAAe,oCAuFjE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-ui-plugin",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"kos": {
|
|
23
23
|
"build": {
|
|
24
|
-
"gitHash": "
|
|
24
|
+
"gitHash": "408815d5ff697b0e9bebea79ec397bfb93917f11"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
package/utils.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./documentation-generator-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./documentation-generator-hrRc6NVI.cjs");require("zod");function m(n,e,...t){return[n,e,...t].filter(Boolean).join(".")}function V(n){const e=n.match(/^(\d+)\.(\d+)\.\d+(?:-\S+)?$/);if(!e)throw new Error(`Invalid version format: ${n}`);const[t,s,l]=e;return`${s}.${l}.0`}function h(n,e){var c,u;e!=null&&e.sdkVersion&&console.log("sdkVersion",e.sdkVersion),e!=null&&e.ddkVersion&&console.log("ddkVersion",e.ddkVersion);const t=V((e==null?void 0:e.sdkVersion)||"0.2.0"),s=V((e==null?void 0:e.ddkVersion)||"0.2.0");console.log(`Using DDK version: ${s}`),console.log(`Using SDK version: ${t}`);const l=n==null?void 0:n.name;if(!l)throw new Error("KOS Configuration should be added. Project name not found in config");const i=((e==null?void 0:e.pluginPath)||"kos.ui.plugin").split(".").reduce((a,o)=>(console.log(`Accessing key: ${o}`),a&&a[o]?a[o]:void 0),n),g=i==null?void 0:i.id;if(!g)throw new Error("KOS Configuration should be added. Plugin ID not found in config");const d=Object.keys(((c=i==null?void 0:i.contributes)==null?void 0:c.views)||{}).reduce((a,o)=>(i.contributes.views[o].forEach(f=>{a[`./${f.component}`]=f.location}),a),{});return Object.values(((u=i==null?void 0:i.contributes)==null?void 0:u.experiences)||{}).forEach(a=>{d[`./${a.component}`]=a.location}),i!=null&&i.init&&(d["./InitPlugin"]="./src/app/init.ts"),{name:l,exposes:d,library:{type:"var",name:g},additionalShared:[{libraryName:"@kosdev-code/kos-ui-plugin",sharedConfig:{singleton:!0,eager:!1,requiredVersion:`~${s}`}},{libraryName:"react",sharedConfig:{singleton:!0,eager:!1,strictVersion:!0,requiredVersion:"18.2.0"}},{libraryName:"react-dom",sharedConfig:{singleton:!0,eager:!1,strictVersion:!0,requiredVersion:"18.2.0"}},{libraryName:"@kosdev-code/kos-ui-sdk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${t}`}},{libraryName:"@kosdev-code/kos-dispense-sdk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${t}`}},{libraryName:"@kosdev-code/kos-freestyle-sdk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${t}`}},{libraryName:"@kosdev-code/kos-ddk-components",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${s}`}},{libraryName:"@kosdev-code/kos-ddk-model-components",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${s}`}},{libraryName:"@kosdev-code/kos-ddk-models",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${s}`}},{libraryName:"@kosdev-code/kos-ddk",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${s}`}},{libraryName:"@kosdev-code/kos-ddk-styles",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:`~${s}`}},{libraryName:"@emotion/styled",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"~11.11.0"}},{libraryName:"@emotion/react",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"~11.11.0"}},{libraryName:"reflect-metadata",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^0.2.2"}},{libraryName:"mobx",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^6.9.0"}},{libraryName:"loglevel",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^1.8.1"}},{libraryName:"robot3",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^0.4.0"}},{libraryName:"mobx-react-lite",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^3.4.3"}},{libraryName:"react-router-dom",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^6.11.2"}},{libraryName:"date-fns",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^2.30.0"}},{libraryName:"@use-gesture/react",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^10.3.0"}},{libraryName:"@react-spring/web",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^9.7.3"}},{libraryName:"react-simple-keyboard",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^3.6.13"}},{libraryName:"expr-eval",sharedConfig:{singleton:!0,eager:!1,strictVersion:!1,requiredVersion:"^2.0.2"}},{libraryName:"zod",sharedConfig:{singleton:!0,eager:!0,strictVersion:!1,requiredVersion:"^3.25.0"}}]}}exports.BaseViewExtensionSchema=r.BaseViewExtensionSchema;exports.DocumentationGenerator=r.DocumentationGenerator;exports.PluginDiscoveryService=r.PluginDiscoveryService;exports.RankableViewExtensionSchema=r.RankableViewExtensionSchema;exports.contributionReducer=r.contributionReducer;exports.createExtensionSchema=r.createExtensionSchema;exports.createViewAwareTransform=r.createViewAwareTransform;exports.defineExtensionPoint=r.defineExtensionPoint;exports.getContributions=r.getContributions;exports.getExtensionPointRegistry=r.getExtensionPointRegistry;exports.getExtensions=r.getExtensions;exports.getValidationResults=r.getValidationResults;exports.initPluginManager=r.initPluginManager;exports.initializeKosPlugins=r.initializeKosPlugins;exports.loadExtensions=r.loadExtensions;exports.registry=r.registry;exports.resolveBestExtension=r.resolveBestExtension;exports.validateDescriptorFormat=r.validateDescriptorFormat;exports.validateRank=r.validateRank;exports.validateRankIfPresent=r.validateRankIfPresent;exports.validateWithSchema=r.validateWithSchema;exports.extensionPointId=m;exports.generatePluginConfiguration=h;
|
|
2
2
|
//# sourceMappingURL=utils.cjs.map
|
package/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["../../../../packages/sdk/kos-ui-plugin/src/lib/utils/extension-points/extension-point-types.ts","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/processors/process-kos-config.ts"],"sourcesContent":["/**\n * Core types and interfaces for extension point system\n */\n\n// React import removed - component creation happens at runtime via hooks\nimport type { z } from \"zod\";\nimport type {\n BasePluginExtension,\n PluginExtensionsType,\n ProcessedContributions,\n} from \"../../../types/plugins\";\n\n/**\n * Validation context for collecting validation issues\n */\nexport interface ValidationContext {\n addError(message: string): void;\n addWarning(message: string): void;\n addInfo(message: string): void;\n hasErrors(): boolean;\n hasIssues(): boolean;\n getIssues(): { type: \"error\" | \"warning\" | \"info\"; message: string }[];\n}\n\n/**\n * Context provided to transform functions\n */\nexport interface TransformContext {\n remote: string;\n sectionId: string;\n experiences?: Record<string, any>;\n contributions: ProcessedContributions;\n}\n\n/**\n * Schema field information for documentation\n */\nexport interface SchemaFieldInfo {\n name: string;\n description?: string;\n type?: string;\n required?: boolean;\n}\n\n/**\n * Configuration for defining a new extension point\n */\nexport interface ExtensionPointConfig<\n TData = any,\n TProcessed = TData,\n _TProps = any\n> {\n /**\n * Unique identifier for this extension point\n * Convention: \"ddk.{feature}\" or \"ddk.{feature}.{sub-feature}\"\n */\n id: string;\n\n /**\n * Optional display name for documentation/discovery\n */\n displayName?: string;\n\n /**\n * Optional description for documentation/discovery\n */\n description?: string;\n\n /**\n * The contribution key in the plugin descriptor\n * e.g., \"myFeature\" maps to contributes.myFeature in kosdev-plugin.json\n */\n contributionKey: string;\n\n /**\n * Optional related extension points\n * For example, a main extension might have .view and .definition variants\n */\n relatedPoints?: {\n view?: string;\n definition?: string;\n [key: string]: string | undefined;\n };\n\n /**\n * Transform function to process raw contribution data\n * Allows custom processing logic while maintaining type safety\n */\n transform?: (data: TData, context: TransformContext) => TProcessed;\n\n /**\n * Optional validation function\n * Use context.addError/addWarning/addInfo to collect validation issues\n * Return \"skip\" to skip processing this contribution\n */\n validate?: (data: TData, context: ValidationContext) => \"skip\" | void;\n\n /**\n * Whether this extension point uses view/experience pattern\n * Default: false\n */\n hasView?: boolean;\n\n /**\n * Whether contributions should be ranked\n * Default: false\n */\n isRankable?: boolean;\n\n /**\n * Optional Zod schema for runtime validation and documentation\n * Provides both type safety and field introspection for Plugin Explorer\n */\n schema?: z.ZodSchema<TData>;\n\n /**\n * Metadata for discovery/documentation\n */\n metadata?: {\n category?: string;\n tags?: string[];\n since?: string;\n deprecated?: boolean;\n replacedBy?: string;\n owner?: string;\n /**\n * The actual export name of this extension point in the code\n * Used for documentation generation to show correct import statements\n */\n exportName?: string;\n };\n}\n\n/**\n * Props for extension point components\n */\nexport interface ExtensionComponentProps {\n /** Specific module to load (optional) */\n module?: string;\n /** Fallback component when extension not found */\n fallback?: React.ReactNode;\n}\n\n/**\n * Result of defining an extension point\n */\nexport interface ExtensionPointDefinition<\n TData = any,\n TProcessed = TData,\n TProps = any\n> {\n /**\n * The extension point configuration\n */\n config: ExtensionPointConfig<TData, TProcessed, TProps>;\n\n /**\n * Extension point ID for use in components\n */\n id: string;\n\n /**\n * Helper to get typed extensions (for future use with hooks)\n */\n getExtensions?: (\n extensions: PluginExtensionsType\n ) => Record<string, BasePluginExtension & { data: TProcessed }>;\n\n /**\n * Registration status\n */\n isRegistered: boolean;\n\n /**\n * Method to register this extension point\n */\n register: () => void;\n\n // Component property removed - use useExtensionComponent hook or createExtensionComponent factory at runtime\n\n /**\n * Get schema field information for documentation purposes\n * Returns field info that can be safely displayed by Plugin Explorer\n */\n getSchemaFieldInfo?: () => SchemaFieldInfo[];\n}\n\n/**\n * Extension point with hasView: true, guarantees Component property\n */\nexport interface ViewExtensionPointDefinition<\n TData = any,\n TProcessed = TData,\n TProps = any\n> extends ExtensionPointDefinition<TData, TProcessed, TProps> {\n Component: React.ComponentType<ExtensionComponentProps & TProps>;\n}\n\n/**\n * Type-safe extension point ID helper\n * Ensures consistent naming and helps with refactoring\n */\nexport function extensionPointId(\n namespace: string,\n feature: string,\n ...subFeatures: string[]\n): string {\n const parts = [namespace, feature, ...subFeatures].filter(Boolean);\n return parts.join(\".\");\n}\n","/* eslint-disable max-lines-per-function */\nimport type { Contributions } from \"../../../types/global\";\n\ninterface KosConfigView {\n id: string;\n title: string;\n component: string;\n location: string;\n}\n\ninterface KosPluginConfig {\n id: string;\n init?: boolean;\n contributes: Contributions;\n}\n\ninterface DDKConfig {\n name: string;\n kosdev: {\n ddk: {\n ncui: {\n plugin: KosPluginConfig;\n };\n };\n };\n}\n\ninterface CoreKosConfig {\n name: string;\n kos: {\n ui: {\n plugin: KosPluginConfig;\n };\n };\n}\n\nexport type KosConfig = DDKConfig | CoreKosConfig;\n\nfunction normalizeVersion(version: string): string {\n const match = version.match(/^(\\d+)\\.(\\d+)\\.\\d+(?:-\\S+)?$/);\n if (!match) {\n throw new Error(`Invalid version format: ${version}`);\n }\n const [_, major, minor] = match;\n return `${major}.${minor}.0`;\n}\n\nexport interface PluginOptions {\n sdkVersion?: string;\n ddkVersion?: string;\n pluginPath?: string;\n}\nexport function generatePluginConfiguration(\n config: KosConfig,\n options?: PluginOptions\n): any {\n if (options?.sdkVersion) {\n console.log(\"sdkVersion\", options.sdkVersion);\n }\n if (options?.ddkVersion) {\n console.log(\"ddkVersion\", options.ddkVersion);\n }\n const sdkVersion = normalizeVersion(options?.sdkVersion || \"0.2.0\");\n const ddkVersion = normalizeVersion(options?.ddkVersion || \"0.2.0\");\n\n console.log(`Using DDK version: ${ddkVersion}`);\n console.log(`Using SDK version: ${sdkVersion}`);\n const projectId = config?.name;\n if (!projectId) {\n throw new Error(\n \"KOS Configuration should be added. Project name not found in config\"\n );\n }\n const pluginPath = options?.pluginPath || \"kosdev.ddk.ncui.plugin\";\n const pluginObj = pluginPath\n .split(\".\")\n .reduce<KosPluginConfig>((obj, key) => {\n console.log(`Accessing key: ${key}`);\n return obj && obj[key] ? obj[key] : undefined;\n }, config as unknown as KosPluginConfig);\n\n const pluginId = pluginObj?.id;\n if (!pluginId) {\n throw new Error(\n \"KOS Configuration should be added. Plugin ID not found in config\"\n );\n }\n const mfConfig = Object.keys(pluginObj?.contributes?.views || {}).reduce(\n (acc, key) => {\n const views = pluginObj.contributes.views[key];\n\n views.forEach((view) => {\n acc[`./${view.component}`] = view.location;\n });\n return acc;\n },\n {}\n );\n\n Object.values(pluginObj?.contributes?.experiences || {}).forEach(\n (experience) => {\n mfConfig[`./${experience.component}`] = experience.location;\n }\n );\n\n if (pluginObj?.init) {\n mfConfig[\"./InitPlugin\"] = \"./src/app/init.ts\";\n }\n\n return {\n name: projectId,\n exposes: mfConfig,\n library: { type: \"var\", name: pluginId },\n additionalShared: [\n {\n libraryName: \"@kosdev-code/kos-ui-plugin\",\n sharedConfig: {\n singleton: true,\n eager: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: true,\n requiredVersion: \"18.2.0\",\n },\n },\n\n {\n libraryName: \"react-dom\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: true,\n requiredVersion: \"18.2.0\",\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ui-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-dispense-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n\n {\n libraryName: \"@kosdev-code/kos-freestyle-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-components\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-model-components\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-models\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-styles\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@emotion/styled\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"~11.11.0\",\n },\n },\n {\n libraryName: \"@emotion/react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"~11.11.0\",\n },\n },\n {\n libraryName: \"reflect-metadata\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^0.2.2\",\n },\n },\n {\n libraryName: \"mobx\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^6.9.0\",\n },\n },\n\n {\n libraryName: \"loglevel\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^1.8.1\",\n },\n },\n {\n libraryName: \"robot3\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^0.4.0\",\n },\n },\n {\n libraryName: \"mobx-react-lite\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^3.4.3\",\n },\n },\n {\n libraryName: \"react-router-dom\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^6.11.2\",\n },\n },\n {\n libraryName: \"date-fns\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^2.30.0\",\n },\n },\n {\n libraryName: \"@use-gesture/react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^10.3.0\",\n },\n },\n {\n libraryName: \"@react-spring/web\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^9.7.3\",\n },\n },\n {\n libraryName: \"react-simple-keyboard\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^3.6.13\",\n },\n },\n {\n libraryName: \"expr-eval\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^2.0.2\",\n },\n },\n {\n libraryName: \"zod\",\n sharedConfig: {\n singleton: true,\n eager: true,\n strictVersion: false,\n requiredVersion: \"^3.25.0\",\n },\n },\n ],\n };\n}\n"],"names":["extensionPointId","namespace","feature","subFeatures","normalizeVersion","version","match","_","major","minor","generatePluginConfiguration","config","options","sdkVersion","ddkVersion","projectId","pluginObj","obj","key","pluginId","mfConfig","_a","acc","view","_b","experience"],"mappings":"yJA0MO,SAASA,EACdC,EACAC,KACGC,EACK,CAER,MADc,CAACF,EAAWC,EAAS,GAAGC,CAAW,EAAE,OAAO,OAAO,EACpD,KAAK,GAAG,CACvB,CC3KA,SAASC,EAAiBC,EAAyB,CACjD,MAAMC,EAAQD,EAAQ,MAAM,8BAA8B,EAC1D,GAAI,CAACC,EACH,MAAM,IAAI,MAAM,2BAA2BD,CAAO,EAAE,EAEtD,KAAM,CAACE,EAAGC,EAAOC,CAAK,EAAIH,EAC1B,MAAO,GAAGE,CAAK,IAAIC,CAAK,IAC1B,CAOO,SAASC,EACdC,EACAC,EACK,SACDA,GAAA,MAAAA,EAAS,YACX,QAAQ,IAAI,aAAcA,EAAQ,UAAU,EAE1CA,GAAA,MAAAA,EAAS,YACX,QAAQ,IAAI,aAAcA,EAAQ,UAAU,EAE9C,MAAMC,EAAaT,GAAiBQ,GAAA,YAAAA,EAAS,aAAc,OAAO,EAC5DE,EAAaV,GAAiBQ,GAAA,YAAAA,EAAS,aAAc,OAAO,EAElE,QAAQ,IAAI,sBAAsBE,CAAU,EAAE,EAC9C,QAAQ,IAAI,sBAAsBD,CAAU,EAAE,EAC9C,MAAME,EAAYJ,GAAA,YAAAA,EAAQ,KAC1B,GAAI,CAACI,EACH,MAAM,IAAI,MACR,sEAAA,EAIJ,MAAMC,IADaJ,GAAA,YAAAA,EAAS,aAAc,0BAEvC,MAAM,GAAG,EACT,OAAwB,CAACK,EAAKC,KAC7B,QAAQ,IAAI,kBAAkBA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,GACP,cAAe,GACf,gBAAiB,SAAA,CACnB,EAEF,CACE,YAAa,WACb,aAAc,CACZ,UAAW,GACX,MAAO,GACP,cAAe,GACf,gBAAiB,SAAA,CACnB,EAEF,CACE,YAAa,qBACb,aAAc,CACZ,UAAW,GACX,MAAO,GACP,cAAe,GACf,gBAAiB,SAAA,CACnB,EAEF,CACE,YAAa,oBACb,aAAc,CACZ,UAAW,GACX,MAAO,GACP,cAAe,GACf,gBAAiB,QAAA,CACnB,EAEF,CACE,YAAa,wBACb,aAAc,CACZ,UAAW,GACX,MAAO,GACP,cAAe,GACf,gBAAiB,SAAA,CACnB,EAEF,CACE,YAAa,YACb,aAAc,CACZ,UAAW,GACX,MAAO,GACP,cAAe,GACf,gBAAiB,QAAA,CACnB,EAEF,CACE,YAAa,MACb,aAAc,CACZ,UAAW,GACX,MAAO,GACP,cAAe,GACf,gBAAiB,SAAA,CACnB,CACF,CACF,CAEJ"}
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../../../packages/sdk/kos-ui-plugin/src/lib/utils/extension-points/extension-point-types.ts","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/processors/process-kos-config.ts"],"sourcesContent":["/**\n * Core types and interfaces for extension point system\n */\n\n// React import removed - component creation happens at runtime via hooks\nimport type { z } from \"zod\";\nimport type {\n BasePluginExtension,\n PluginExtensionsType,\n ProcessedContributions,\n} from \"../../../types/plugins\";\n\n/**\n * Validation context for collecting validation issues\n */\nexport interface ValidationContext {\n addError(message: string): void;\n addWarning(message: string): void;\n addInfo(message: string): void;\n hasErrors(): boolean;\n hasIssues(): boolean;\n getIssues(): { type: \"error\" | \"warning\" | \"info\"; message: string }[];\n}\n\n/**\n * Context provided to transform functions\n */\nexport interface TransformContext {\n remote: string;\n sectionId: string;\n experiences?: Record<string, any>;\n contributions: ProcessedContributions;\n}\n\n/**\n * Schema field information for documentation\n */\nexport interface SchemaFieldInfo {\n name: string;\n description?: string;\n type?: string;\n required?: boolean;\n}\n\n/**\n * Configuration for defining a new extension point\n */\nexport interface ExtensionPointConfig<\n TData = any,\n TProcessed = TData,\n _TProps = any\n> {\n /**\n * Unique identifier for this extension point\n * Convention: \"ddk.{feature}\" or \"ddk.{feature}.{sub-feature}\"\n */\n id: string;\n\n /**\n * Optional display name for documentation/discovery\n */\n displayName?: string;\n\n /**\n * Optional description for documentation/discovery\n */\n description?: string;\n\n /**\n * The contribution key in the plugin descriptor\n * e.g., \"myFeature\" maps to contributes.myFeature in kosdev-plugin.json\n */\n contributionKey: string;\n\n /**\n * Optional related extension points\n * For example, a main extension might have .view and .definition variants\n */\n relatedPoints?: {\n view?: string;\n definition?: string;\n [key: string]: string | undefined;\n };\n\n /**\n * Transform function to process raw contribution data\n * Allows custom processing logic while maintaining type safety\n */\n transform?: (data: TData, context: TransformContext) => TProcessed;\n\n /**\n * Optional validation function\n * Use context.addError/addWarning/addInfo to collect validation issues\n * Return \"skip\" to skip processing this contribution\n */\n validate?: (data: TData, context: ValidationContext) => \"skip\" | void;\n\n /**\n * Whether this extension point uses view/experience pattern\n * Default: false\n */\n hasView?: boolean;\n\n /**\n * Whether contributions should be ranked\n * Default: false\n */\n isRankable?: boolean;\n\n /**\n * Optional Zod schema for runtime validation and documentation\n * Provides both type safety and field introspection for Plugin Explorer\n */\n schema?: z.ZodSchema<TData>;\n\n /**\n * Metadata for discovery/documentation\n */\n metadata?: {\n category?: string;\n tags?: string[];\n since?: string;\n deprecated?: boolean;\n replacedBy?: string;\n owner?: string;\n /**\n * The actual export name of this extension point in the code\n * Used for documentation generation to show correct import statements\n */\n exportName?: string;\n };\n}\n\n/**\n * Props for extension point components\n */\nexport interface ExtensionComponentProps {\n /** Specific module to load (optional) */\n module?: string;\n /** Fallback component when extension not found */\n fallback?: React.ReactNode;\n}\n\n/**\n * Result of defining an extension point\n */\nexport interface ExtensionPointDefinition<\n TData = any,\n TProcessed = TData,\n TProps = any\n> {\n /**\n * The extension point configuration\n */\n config: ExtensionPointConfig<TData, TProcessed, TProps>;\n\n /**\n * Extension point ID for use in components\n */\n id: string;\n\n /**\n * Helper to get typed extensions (for future use with hooks)\n */\n getExtensions?: (\n extensions: PluginExtensionsType\n ) => Record<string, BasePluginExtension & { data: TProcessed }>;\n\n /**\n * Registration status\n */\n isRegistered: boolean;\n\n /**\n * Method to register this extension point\n */\n register: () => void;\n\n // Component property removed - use useExtensionComponent hook or createExtensionComponent factory at runtime\n\n /**\n * Get schema field information for documentation purposes\n * Returns field info that can be safely displayed by Plugin Explorer\n */\n getSchemaFieldInfo?: () => SchemaFieldInfo[];\n}\n\n/**\n * Extension point with hasView: true, guarantees Component property\n */\nexport interface ViewExtensionPointDefinition<\n TData = any,\n TProcessed = TData,\n TProps = any\n> extends ExtensionPointDefinition<TData, TProcessed, TProps> {\n Component: React.ComponentType<ExtensionComponentProps & TProps>;\n}\n\n/**\n * Type-safe extension point ID helper\n * Ensures consistent naming and helps with refactoring\n */\nexport function extensionPointId(\n namespace: string,\n feature: string,\n ...subFeatures: string[]\n): string {\n const parts = [namespace, feature, ...subFeatures].filter(Boolean);\n return parts.join(\".\");\n}\n","/* eslint-disable max-lines-per-function */\nimport type { Contributions } from \"../../../types/global\";\n\ninterface KosConfigView {\n id: string;\n title: string;\n component: string;\n location: string;\n}\n\ninterface KosPluginConfig {\n id: string;\n init?: boolean;\n contributes: Contributions;\n}\n\ninterface DDKConfig {\n name: string;\n kosdev: {\n ddk: {\n ncui: {\n plugin: KosPluginConfig;\n };\n };\n };\n}\n\ninterface CoreKosConfig {\n name: string;\n kos: {\n ui: {\n plugin: KosPluginConfig;\n };\n };\n}\n\nexport type KosConfig = DDKConfig | CoreKosConfig;\n\nfunction normalizeVersion(version: string): string {\n const match = version.match(/^(\\d+)\\.(\\d+)\\.\\d+(?:-\\S+)?$/);\n if (!match) {\n throw new Error(`Invalid version format: ${version}`);\n }\n const [_, major, minor] = match;\n return `${major}.${minor}.0`;\n}\n\nexport interface PluginOptions {\n sdkVersion?: string;\n ddkVersion?: string;\n pluginPath?: string;\n}\nexport function generatePluginConfiguration(\n config: KosConfig,\n options?: PluginOptions\n): any {\n if (options?.sdkVersion) {\n console.log(\"sdkVersion\", options.sdkVersion);\n }\n if (options?.ddkVersion) {\n console.log(\"ddkVersion\", options.ddkVersion);\n }\n const sdkVersion = normalizeVersion(options?.sdkVersion || \"0.2.0\");\n const ddkVersion = normalizeVersion(options?.ddkVersion || \"0.2.0\");\n\n console.log(`Using DDK version: ${ddkVersion}`);\n console.log(`Using SDK version: ${sdkVersion}`);\n const projectId = config?.name;\n if (!projectId) {\n throw new Error(\n \"KOS Configuration should be added. Project name not found in config\"\n );\n }\n const pluginPath = options?.pluginPath || \"kos.ui.plugin\";\n const pluginObj = pluginPath\n .split(\".\")\n .reduce<KosPluginConfig>((obj, key) => {\n console.log(`Accessing key: ${key}`);\n return obj && obj[key] ? obj[key] : undefined;\n }, config as unknown as KosPluginConfig);\n\n const pluginId = pluginObj?.id;\n if (!pluginId) {\n throw new Error(\n \"KOS Configuration should be added. Plugin ID not found in config\"\n );\n }\n const mfConfig = Object.keys(pluginObj?.contributes?.views || {}).reduce(\n (acc, key) => {\n const views = pluginObj.contributes.views[key];\n\n views.forEach((view) => {\n acc[`./${view.component}`] = view.location;\n });\n return acc;\n },\n {}\n );\n\n Object.values(pluginObj?.contributes?.experiences || {}).forEach(\n (experience) => {\n mfConfig[`./${experience.component}`] = experience.location;\n }\n );\n\n if (pluginObj?.init) {\n mfConfig[\"./InitPlugin\"] = \"./src/app/init.ts\";\n }\n\n return {\n name: projectId,\n exposes: mfConfig,\n library: { type: \"var\", name: pluginId },\n additionalShared: [\n {\n libraryName: \"@kosdev-code/kos-ui-plugin\",\n sharedConfig: {\n singleton: true,\n eager: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: true,\n requiredVersion: \"18.2.0\",\n },\n },\n\n {\n libraryName: \"react-dom\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: true,\n requiredVersion: \"18.2.0\",\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ui-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-dispense-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n\n {\n libraryName: \"@kosdev-code/kos-freestyle-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-components\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-model-components\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-models\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-styles\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@emotion/styled\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"~11.11.0\",\n },\n },\n {\n libraryName: \"@emotion/react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"~11.11.0\",\n },\n },\n {\n libraryName: \"reflect-metadata\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^0.2.2\",\n },\n },\n {\n libraryName: \"mobx\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^6.9.0\",\n },\n },\n\n {\n libraryName: \"loglevel\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^1.8.1\",\n },\n },\n {\n libraryName: \"robot3\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^0.4.0\",\n },\n },\n {\n libraryName: \"mobx-react-lite\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^3.4.3\",\n },\n },\n {\n libraryName: \"react-router-dom\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^6.11.2\",\n },\n },\n {\n libraryName: \"date-fns\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^2.30.0\",\n },\n },\n {\n libraryName: \"@use-gesture/react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^10.3.0\",\n },\n },\n {\n libraryName: \"@react-spring/web\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^9.7.3\",\n },\n },\n {\n libraryName: \"react-simple-keyboard\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^3.6.13\",\n },\n },\n {\n libraryName: \"expr-eval\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^2.0.2\",\n },\n },\n {\n libraryName: \"zod\",\n sharedConfig: {\n singleton: true,\n eager: true,\n strictVersion: false,\n requiredVersion: \"^3.25.0\",\n },\n },\n ],\n };\n}\n"],"names":["extensionPointId","namespace","feature","subFeatures","normalizeVersion","version","match","_","major","minor","generatePluginConfiguration","config","options","sdkVersion","ddkVersion","projectId","pluginObj","obj","key","pluginId","mfConfig","_a","acc","view","_b","experience"],"mappings":"yJA0MO,SAASA,EACdC,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ACZ,UAAW,GACX,MAAO,GACP,cAAe,GACf,gBAAiB,SAAA,CACnB,EAEF,CACE,YAAa,YACb,aAAc,CACZ,UAAW,GACX,MAAO,GACP,cAAe,GACf,gBAAiB,QAAA,CACnB,EAEF,CACE,YAAa,MACb,aAAc,CACZ,UAAW,GACX,MAAO,GACP,cAAe,GACf,gBAAiB,SAAA,CACnB,CACF,CACF,CAEJ"}
|
package/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as v, D as q, P as N, R as $, d as x, p as P, j as w, h as E, e as S, c as D, f as I, g as R, b as K, a as B, l as z, k as A, r as U, n as F, o as G, q as M, v as T } from "./documentation-generator-
|
|
1
|
+
import { B as v, D as q, P as N, R as $, d as x, p as P, j as w, h as E, e as S, c as D, f as I, g as R, b as K, a as B, l as z, k as A, r as U, n as F, o as G, q as M, v as T } from "./documentation-generator-7qgOfgJZ.js";
|
|
2
2
|
import "zod";
|
|
3
3
|
function k(i, e, ...n) {
|
|
4
4
|
return [i, e, ...n].filter(Boolean).join(".");
|
|
@@ -20,7 +20,7 @@ function y(i, e) {
|
|
|
20
20
|
throw new Error(
|
|
21
21
|
"KOS Configuration should be added. Project name not found in config"
|
|
22
22
|
);
|
|
23
|
-
const r = ((e == null ? void 0 : e.pluginPath) || "
|
|
23
|
+
const r = ((e == null ? void 0 : e.pluginPath) || "kos.ui.plugin").split(".").reduce((a, o) => (console.log(`Accessing key: ${o}`), a && a[o] ? a[o] : void 0), i), d = r == null ? void 0 : r.id;
|
|
24
24
|
if (!d)
|
|
25
25
|
throw new Error(
|
|
26
26
|
"KOS Configuration should be added. Plugin ID not found in config"
|
package/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../packages/sdk/kos-ui-plugin/src/lib/utils/extension-points/extension-point-types.ts","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/processors/process-kos-config.ts"],"sourcesContent":["/**\n * Core types and interfaces for extension point system\n */\n\n// React import removed - component creation happens at runtime via hooks\nimport type { z } from \"zod\";\nimport type {\n BasePluginExtension,\n PluginExtensionsType,\n ProcessedContributions,\n} from \"../../../types/plugins\";\n\n/**\n * Validation context for collecting validation issues\n */\nexport interface ValidationContext {\n addError(message: string): void;\n addWarning(message: string): void;\n addInfo(message: string): void;\n hasErrors(): boolean;\n hasIssues(): boolean;\n getIssues(): { type: \"error\" | \"warning\" | \"info\"; message: string }[];\n}\n\n/**\n * Context provided to transform functions\n */\nexport interface TransformContext {\n remote: string;\n sectionId: string;\n experiences?: Record<string, any>;\n contributions: ProcessedContributions;\n}\n\n/**\n * Schema field information for documentation\n */\nexport interface SchemaFieldInfo {\n name: string;\n description?: string;\n type?: string;\n required?: boolean;\n}\n\n/**\n * Configuration for defining a new extension point\n */\nexport interface ExtensionPointConfig<\n TData = any,\n TProcessed = TData,\n _TProps = any\n> {\n /**\n * Unique identifier for this extension point\n * Convention: \"ddk.{feature}\" or \"ddk.{feature}.{sub-feature}\"\n */\n id: string;\n\n /**\n * Optional display name for documentation/discovery\n */\n displayName?: string;\n\n /**\n * Optional description for documentation/discovery\n */\n description?: string;\n\n /**\n * The contribution key in the plugin descriptor\n * e.g., \"myFeature\" maps to contributes.myFeature in kosdev-plugin.json\n */\n contributionKey: string;\n\n /**\n * Optional related extension points\n * For example, a main extension might have .view and .definition variants\n */\n relatedPoints?: {\n view?: string;\n definition?: string;\n [key: string]: string | undefined;\n };\n\n /**\n * Transform function to process raw contribution data\n * Allows custom processing logic while maintaining type safety\n */\n transform?: (data: TData, context: TransformContext) => TProcessed;\n\n /**\n * Optional validation function\n * Use context.addError/addWarning/addInfo to collect validation issues\n * Return \"skip\" to skip processing this contribution\n */\n validate?: (data: TData, context: ValidationContext) => \"skip\" | void;\n\n /**\n * Whether this extension point uses view/experience pattern\n * Default: false\n */\n hasView?: boolean;\n\n /**\n * Whether contributions should be ranked\n * Default: false\n */\n isRankable?: boolean;\n\n /**\n * Optional Zod schema for runtime validation and documentation\n * Provides both type safety and field introspection for Plugin Explorer\n */\n schema?: z.ZodSchema<TData>;\n\n /**\n * Metadata for discovery/documentation\n */\n metadata?: {\n category?: string;\n tags?: string[];\n since?: string;\n deprecated?: boolean;\n replacedBy?: string;\n owner?: string;\n /**\n * The actual export name of this extension point in the code\n * Used for documentation generation to show correct import statements\n */\n exportName?: string;\n };\n}\n\n/**\n * Props for extension point components\n */\nexport interface ExtensionComponentProps {\n /** Specific module to load (optional) */\n module?: string;\n /** Fallback component when extension not found */\n fallback?: React.ReactNode;\n}\n\n/**\n * Result of defining an extension point\n */\nexport interface ExtensionPointDefinition<\n TData = any,\n TProcessed = TData,\n TProps = any\n> {\n /**\n * The extension point configuration\n */\n config: ExtensionPointConfig<TData, TProcessed, TProps>;\n\n /**\n * Extension point ID for use in components\n */\n id: string;\n\n /**\n * Helper to get typed extensions (for future use with hooks)\n */\n getExtensions?: (\n extensions: PluginExtensionsType\n ) => Record<string, BasePluginExtension & { data: TProcessed }>;\n\n /**\n * Registration status\n */\n isRegistered: boolean;\n\n /**\n * Method to register this extension point\n */\n register: () => void;\n\n // Component property removed - use useExtensionComponent hook or createExtensionComponent factory at runtime\n\n /**\n * Get schema field information for documentation purposes\n * Returns field info that can be safely displayed by Plugin Explorer\n */\n getSchemaFieldInfo?: () => SchemaFieldInfo[];\n}\n\n/**\n * Extension point with hasView: true, guarantees Component property\n */\nexport interface ViewExtensionPointDefinition<\n TData = any,\n TProcessed = TData,\n TProps = any\n> extends ExtensionPointDefinition<TData, TProcessed, TProps> {\n Component: React.ComponentType<ExtensionComponentProps & TProps>;\n}\n\n/**\n * Type-safe extension point ID helper\n * Ensures consistent naming and helps with refactoring\n */\nexport function extensionPointId(\n namespace: string,\n feature: string,\n ...subFeatures: string[]\n): string {\n const parts = [namespace, feature, ...subFeatures].filter(Boolean);\n return parts.join(\".\");\n}\n","/* eslint-disable max-lines-per-function */\nimport type { Contributions } from \"../../../types/global\";\n\ninterface KosConfigView {\n id: string;\n title: string;\n component: string;\n location: string;\n}\n\ninterface KosPluginConfig {\n id: string;\n init?: boolean;\n contributes: Contributions;\n}\n\ninterface DDKConfig {\n name: string;\n kosdev: {\n ddk: {\n ncui: {\n plugin: KosPluginConfig;\n };\n };\n };\n}\n\ninterface CoreKosConfig {\n name: string;\n kos: {\n ui: {\n plugin: KosPluginConfig;\n };\n };\n}\n\nexport type KosConfig = DDKConfig | CoreKosConfig;\n\nfunction normalizeVersion(version: string): string {\n const match = version.match(/^(\\d+)\\.(\\d+)\\.\\d+(?:-\\S+)?$/);\n if (!match) {\n throw new Error(`Invalid version format: ${version}`);\n }\n const [_, major, minor] = match;\n return `${major}.${minor}.0`;\n}\n\nexport interface PluginOptions {\n sdkVersion?: string;\n ddkVersion?: string;\n pluginPath?: string;\n}\nexport function generatePluginConfiguration(\n config: KosConfig,\n options?: PluginOptions\n): any {\n if (options?.sdkVersion) {\n console.log(\"sdkVersion\", options.sdkVersion);\n }\n if (options?.ddkVersion) {\n console.log(\"ddkVersion\", options.ddkVersion);\n }\n const sdkVersion = normalizeVersion(options?.sdkVersion || \"0.2.0\");\n const ddkVersion = normalizeVersion(options?.ddkVersion || \"0.2.0\");\n\n console.log(`Using DDK version: ${ddkVersion}`);\n console.log(`Using SDK version: ${sdkVersion}`);\n const projectId = config?.name;\n if (!projectId) {\n throw new Error(\n \"KOS Configuration should be added. Project name not found in config\"\n );\n }\n const pluginPath = options?.pluginPath || \"kosdev.ddk.ncui.plugin\";\n const pluginObj = pluginPath\n .split(\".\")\n .reduce<KosPluginConfig>((obj, key) => {\n console.log(`Accessing key: ${key}`);\n return obj && obj[key] ? obj[key] : undefined;\n }, config as unknown as KosPluginConfig);\n\n const pluginId = pluginObj?.id;\n if (!pluginId) {\n throw new Error(\n \"KOS Configuration should be added. Plugin ID not found in config\"\n );\n }\n const mfConfig = Object.keys(pluginObj?.contributes?.views || {}).reduce(\n (acc, key) => {\n const views = pluginObj.contributes.views[key];\n\n views.forEach((view) => {\n acc[`./${view.component}`] = view.location;\n });\n return acc;\n },\n {}\n );\n\n Object.values(pluginObj?.contributes?.experiences || {}).forEach(\n (experience) => {\n mfConfig[`./${experience.component}`] = experience.location;\n }\n );\n\n if (pluginObj?.init) {\n mfConfig[\"./InitPlugin\"] = \"./src/app/init.ts\";\n }\n\n return {\n name: projectId,\n exposes: mfConfig,\n library: { type: \"var\", name: pluginId },\n additionalShared: [\n {\n libraryName: \"@kosdev-code/kos-ui-plugin\",\n sharedConfig: {\n singleton: true,\n eager: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: true,\n requiredVersion: \"18.2.0\",\n },\n },\n\n {\n libraryName: \"react-dom\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: true,\n requiredVersion: \"18.2.0\",\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ui-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-dispense-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n\n {\n libraryName: \"@kosdev-code/kos-freestyle-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-components\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-model-components\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-models\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-styles\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@emotion/styled\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"~11.11.0\",\n },\n },\n {\n libraryName: \"@emotion/react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"~11.11.0\",\n },\n },\n {\n libraryName: \"reflect-metadata\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^0.2.2\",\n },\n },\n {\n libraryName: \"mobx\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^6.9.0\",\n },\n },\n\n {\n libraryName: \"loglevel\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^1.8.1\",\n },\n },\n {\n libraryName: \"robot3\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^0.4.0\",\n },\n },\n {\n libraryName: \"mobx-react-lite\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^3.4.3\",\n },\n },\n {\n libraryName: \"react-router-dom\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^6.11.2\",\n },\n },\n {\n libraryName: \"date-fns\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^2.30.0\",\n },\n },\n {\n libraryName: \"@use-gesture/react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^10.3.0\",\n },\n },\n {\n libraryName: \"@react-spring/web\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^9.7.3\",\n },\n },\n {\n libraryName: \"react-simple-keyboard\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^3.6.13\",\n },\n },\n {\n libraryName: \"expr-eval\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^2.0.2\",\n },\n },\n {\n libraryName: \"zod\",\n sharedConfig: {\n singleton: true,\n eager: true,\n strictVersion: false,\n requiredVersion: \"^3.25.0\",\n },\n },\n ],\n };\n}\n"],"names":["extensionPointId","namespace","feature","subFeatures","normalizeVersion","version","match","_","major","minor","generatePluginConfiguration","config","options","sdkVersion","ddkVersion","projectId","pluginObj","obj","key","pluginId","mfConfig","_a","acc","view","_b","experience"],"mappings":";;AA0MO,SAASA,EACdC,GACAC,MACGC,GACK;AAER,SADc,CAACF,GAAWC,GAAS,GAAGC,CAAW,EAAE,OAAO,OAAO,EACpD,KAAK,GAAG;AACvB;AC3KA,SAASC,EAAiBC,GAAyB;AACjD,QAAMC,IAAQD,EAAQ,MAAM,8BAA8B;AAC1D,MAAI,CAACC;AACH,UAAM,IAAI,MAAM,2BAA2BD,CAAO,EAAE;AAEtD,QAAM,CAACE,GAAGC,GAAOC,CAAK,IAAIH;AAC1B,SAAO,GAAGE,CAAK,IAAIC,CAAK;AAC1B;AAOO,SAASC,EACdC,GACAC,GACK;;AACL,EAAIA,KAAA,QAAAA,EAAS,cACX,QAAQ,IAAI,cAAcA,EAAQ,UAAU,GAE1CA,KAAA,QAAAA,EAAS,cACX,QAAQ,IAAI,cAAcA,EAAQ,UAAU;AAE9C,QAAMC,IAAaT,GAAiBQ,KAAA,gBAAAA,EAAS,eAAc,OAAO,GAC5DE,IAAaV,GAAiBQ,KAAA,gBAAAA,EAAS,eAAc,OAAO;AAElE,UAAQ,IAAI,sBAAsBE,CAAU,EAAE,GAC9C,QAAQ,IAAI,sBAAsBD,CAAU,EAAE;AAC9C,QAAME,IAAYJ,KAAA,gBAAAA,EAAQ;AAC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cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../packages/sdk/kos-ui-plugin/src/lib/utils/extension-points/extension-point-types.ts","../../../../packages/sdk/kos-ui-plugin/src/lib/utils/processors/process-kos-config.ts"],"sourcesContent":["/**\n * Core types and interfaces for extension point system\n */\n\n// React import removed - component creation happens at runtime via hooks\nimport type { z } from \"zod\";\nimport type {\n BasePluginExtension,\n PluginExtensionsType,\n ProcessedContributions,\n} from \"../../../types/plugins\";\n\n/**\n * Validation context for collecting validation issues\n */\nexport interface ValidationContext {\n addError(message: string): void;\n addWarning(message: string): void;\n addInfo(message: string): void;\n hasErrors(): boolean;\n hasIssues(): boolean;\n getIssues(): { type: \"error\" | \"warning\" | \"info\"; message: string }[];\n}\n\n/**\n * Context provided to transform functions\n */\nexport interface TransformContext {\n remote: string;\n sectionId: string;\n experiences?: Record<string, any>;\n contributions: ProcessedContributions;\n}\n\n/**\n * Schema field information for documentation\n */\nexport interface SchemaFieldInfo {\n name: string;\n description?: string;\n type?: string;\n required?: boolean;\n}\n\n/**\n * Configuration for defining a new extension point\n */\nexport interface ExtensionPointConfig<\n TData = any,\n TProcessed = TData,\n _TProps = any\n> {\n /**\n * Unique identifier for this extension point\n * Convention: \"ddk.{feature}\" or \"ddk.{feature}.{sub-feature}\"\n */\n id: string;\n\n /**\n * Optional display name for documentation/discovery\n */\n displayName?: string;\n\n /**\n * Optional description for documentation/discovery\n */\n description?: string;\n\n /**\n * The contribution key in the plugin descriptor\n * e.g., \"myFeature\" maps to contributes.myFeature in kosdev-plugin.json\n */\n contributionKey: string;\n\n /**\n * Optional related extension points\n * For example, a main extension might have .view and .definition variants\n */\n relatedPoints?: {\n view?: string;\n definition?: string;\n [key: string]: string | undefined;\n };\n\n /**\n * Transform function to process raw contribution data\n * Allows custom processing logic while maintaining type safety\n */\n transform?: (data: TData, context: TransformContext) => TProcessed;\n\n /**\n * Optional validation function\n * Use context.addError/addWarning/addInfo to collect validation issues\n * Return \"skip\" to skip processing this contribution\n */\n validate?: (data: TData, context: ValidationContext) => \"skip\" | void;\n\n /**\n * Whether this extension point uses view/experience pattern\n * Default: false\n */\n hasView?: boolean;\n\n /**\n * Whether contributions should be ranked\n * Default: false\n */\n isRankable?: boolean;\n\n /**\n * Optional Zod schema for runtime validation and documentation\n * Provides both type safety and field introspection for Plugin Explorer\n */\n schema?: z.ZodSchema<TData>;\n\n /**\n * Metadata for discovery/documentation\n */\n metadata?: {\n category?: string;\n tags?: string[];\n since?: string;\n deprecated?: boolean;\n replacedBy?: string;\n owner?: string;\n /**\n * The actual export name of this extension point in the code\n * Used for documentation generation to show correct import statements\n */\n exportName?: string;\n };\n}\n\n/**\n * Props for extension point components\n */\nexport interface ExtensionComponentProps {\n /** Specific module to load (optional) */\n module?: string;\n /** Fallback component when extension not found */\n fallback?: React.ReactNode;\n}\n\n/**\n * Result of defining an extension point\n */\nexport interface ExtensionPointDefinition<\n TData = any,\n TProcessed = TData,\n TProps = any\n> {\n /**\n * The extension point configuration\n */\n config: ExtensionPointConfig<TData, TProcessed, TProps>;\n\n /**\n * Extension point ID for use in components\n */\n id: string;\n\n /**\n * Helper to get typed extensions (for future use with hooks)\n */\n getExtensions?: (\n extensions: PluginExtensionsType\n ) => Record<string, BasePluginExtension & { data: TProcessed }>;\n\n /**\n * Registration status\n */\n isRegistered: boolean;\n\n /**\n * Method to register this extension point\n */\n register: () => void;\n\n // Component property removed - use useExtensionComponent hook or createExtensionComponent factory at runtime\n\n /**\n * Get schema field information for documentation purposes\n * Returns field info that can be safely displayed by Plugin Explorer\n */\n getSchemaFieldInfo?: () => SchemaFieldInfo[];\n}\n\n/**\n * Extension point with hasView: true, guarantees Component property\n */\nexport interface ViewExtensionPointDefinition<\n TData = any,\n TProcessed = TData,\n TProps = any\n> extends ExtensionPointDefinition<TData, TProcessed, TProps> {\n Component: React.ComponentType<ExtensionComponentProps & TProps>;\n}\n\n/**\n * Type-safe extension point ID helper\n * Ensures consistent naming and helps with refactoring\n */\nexport function extensionPointId(\n namespace: string,\n feature: string,\n ...subFeatures: string[]\n): string {\n const parts = [namespace, feature, ...subFeatures].filter(Boolean);\n return parts.join(\".\");\n}\n","/* eslint-disable max-lines-per-function */\nimport type { Contributions } from \"../../../types/global\";\n\ninterface KosConfigView {\n id: string;\n title: string;\n component: string;\n location: string;\n}\n\ninterface KosPluginConfig {\n id: string;\n init?: boolean;\n contributes: Contributions;\n}\n\ninterface DDKConfig {\n name: string;\n kosdev: {\n ddk: {\n ncui: {\n plugin: KosPluginConfig;\n };\n };\n };\n}\n\ninterface CoreKosConfig {\n name: string;\n kos: {\n ui: {\n plugin: KosPluginConfig;\n };\n };\n}\n\nexport type KosConfig = DDKConfig | CoreKosConfig;\n\nfunction normalizeVersion(version: string): string {\n const match = version.match(/^(\\d+)\\.(\\d+)\\.\\d+(?:-\\S+)?$/);\n if (!match) {\n throw new Error(`Invalid version format: ${version}`);\n }\n const [_, major, minor] = match;\n return `${major}.${minor}.0`;\n}\n\nexport interface PluginOptions {\n sdkVersion?: string;\n ddkVersion?: string;\n pluginPath?: string;\n}\nexport function generatePluginConfiguration(\n config: KosConfig,\n options?: PluginOptions\n): any {\n if (options?.sdkVersion) {\n console.log(\"sdkVersion\", options.sdkVersion);\n }\n if (options?.ddkVersion) {\n console.log(\"ddkVersion\", options.ddkVersion);\n }\n const sdkVersion = normalizeVersion(options?.sdkVersion || \"0.2.0\");\n const ddkVersion = normalizeVersion(options?.ddkVersion || \"0.2.0\");\n\n console.log(`Using DDK version: ${ddkVersion}`);\n console.log(`Using SDK version: ${sdkVersion}`);\n const projectId = config?.name;\n if (!projectId) {\n throw new Error(\n \"KOS Configuration should be added. Project name not found in config\"\n );\n }\n const pluginPath = options?.pluginPath || \"kos.ui.plugin\";\n const pluginObj = pluginPath\n .split(\".\")\n .reduce<KosPluginConfig>((obj, key) => {\n console.log(`Accessing key: ${key}`);\n return obj && obj[key] ? obj[key] : undefined;\n }, config as unknown as KosPluginConfig);\n\n const pluginId = pluginObj?.id;\n if (!pluginId) {\n throw new Error(\n \"KOS Configuration should be added. Plugin ID not found in config\"\n );\n }\n const mfConfig = Object.keys(pluginObj?.contributes?.views || {}).reduce(\n (acc, key) => {\n const views = pluginObj.contributes.views[key];\n\n views.forEach((view) => {\n acc[`./${view.component}`] = view.location;\n });\n return acc;\n },\n {}\n );\n\n Object.values(pluginObj?.contributes?.experiences || {}).forEach(\n (experience) => {\n mfConfig[`./${experience.component}`] = experience.location;\n }\n );\n\n if (pluginObj?.init) {\n mfConfig[\"./InitPlugin\"] = \"./src/app/init.ts\";\n }\n\n return {\n name: projectId,\n exposes: mfConfig,\n library: { type: \"var\", name: pluginId },\n additionalShared: [\n {\n libraryName: \"@kosdev-code/kos-ui-plugin\",\n sharedConfig: {\n singleton: true,\n eager: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: true,\n requiredVersion: \"18.2.0\",\n },\n },\n\n {\n libraryName: \"react-dom\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: true,\n requiredVersion: \"18.2.0\",\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ui-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-dispense-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n\n {\n libraryName: \"@kosdev-code/kos-freestyle-sdk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${sdkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-components\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-model-components\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-models\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@kosdev-code/kos-ddk-styles\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: `~${ddkVersion}`,\n },\n },\n {\n libraryName: \"@emotion/styled\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"~11.11.0\",\n },\n },\n {\n libraryName: \"@emotion/react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"~11.11.0\",\n },\n },\n {\n libraryName: \"reflect-metadata\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^0.2.2\",\n },\n },\n {\n libraryName: \"mobx\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^6.9.0\",\n },\n },\n\n {\n libraryName: \"loglevel\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^1.8.1\",\n },\n },\n {\n libraryName: \"robot3\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^0.4.0\",\n },\n },\n {\n libraryName: \"mobx-react-lite\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^3.4.3\",\n },\n },\n {\n libraryName: \"react-router-dom\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^6.11.2\",\n },\n },\n {\n libraryName: \"date-fns\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^2.30.0\",\n },\n },\n {\n libraryName: \"@use-gesture/react\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^10.3.0\",\n },\n },\n {\n libraryName: \"@react-spring/web\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^9.7.3\",\n },\n },\n {\n libraryName: \"react-simple-keyboard\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^3.6.13\",\n },\n },\n {\n libraryName: \"expr-eval\",\n sharedConfig: {\n singleton: true,\n eager: false,\n strictVersion: false,\n requiredVersion: \"^2.0.2\",\n },\n },\n {\n libraryName: \"zod\",\n sharedConfig: {\n singleton: true,\n eager: true,\n strictVersion: false,\n requiredVersion: \"^3.25.0\",\n },\n },\n ],\n };\n}\n"],"names":["extensionPointId","namespace","feature","subFeatures","normalizeVersion","version","match","_","major","minor","generatePluginConfiguration","config","options","sdkVersion","ddkVersion","projectId","pluginObj","obj","key","pluginId","mfConfig","_a","acc","view","_b","experience"],"mappings":";;AA0MO,SAASA,EACdC,GACAC,MACGC,GACK;AAER,SADc,CAACF,GAAWC,GAAS,GAAGC,CAAW,EAAE,OAAO,OAAO,EACpD,KAAK,GAAG;AACvB;AC3KA,SAASC,EAAiBC,GAAyB;AACjD,QAAMC,IAAQD,EAAQ,MAAM,8BAA8B;AAC1D,MAAI,CAACC;AACH,UAAM,IAAI,MAAM,2BAA2BD,CAAO,EAAE;AAEtD,QAAM,CAACE,GAAGC,GAAOC,CAAK,IAAIH;AAC1B,SAAO,GAAGE,CAAK,IAAIC,CAAK;AAC1B;AAOO,SAASC,EACdC,GACAC,GACK;;AACL,EAAIA,KAAA,QAAAA,EAAS,cACX,QAAQ,IAAI,cAAcA,EAAQ,UAAU,GAE1CA,KAAA,QAAAA,EAAS,cACX,QAAQ,IAAI,cAAcA,EAAQ,UAAU;AAE9C,QAAMC,IAAaT,GAAiBQ,KAAA,gBAAAA,EAAS,eAAc,OAAO,GAC5DE,IAAaV,GAAiBQ,KAAA,gBAAAA,EAAS,eAAc,OAAO;AAElE,UAAQ,IAAI,sBAAsBE,CAAU,EAAE,GAC9C,QAAQ,IAAI,sBAAsBD,CAAU,EAAE;AAC9C,QAAME,IAAYJ,KAAA,gBAAAA,EAAQ;AAC1B,MAAI,CAACI;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAIJ,QAAMC,MADaJ,KAAA,gBAAA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AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,MAEF;AAAA,QACE,aAAa;AAAA,QACb,cAAc;AAAA,UACZ,WAAW;AAAA,UACX,OAAO;AAAA,UACP,eAAe;AAAA,UACf,iBAAiB;AAAA,QAAA;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAEJ;"}
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
"use strict";var B=Object.defineProperty;var z=(n,t,e)=>t in n?B(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var v=(n,t,e)=>(z(n,typeof t!="symbol"?t+"":t,e),e);const E=require("zod");function H(n,t){for(var e=0;e<t.length;e++){const i=t[e];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in n)){const o=Object.getOwnPropertyDescriptor(i,s);o&&Object.defineProperty(n,s,o.get?o:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var P={},x={};Object.defineProperty(x,"__esModule",{value:!0});x.loadRemoteModule=x.setRemoteDefinitions=x.setRemoteUrlResolver=void 0;let w,S;const I=new Map,F=new Map;let D=!1;function W(n){S=n}x.setRemoteUrlResolver=W;function G(n){w=n}x.setRemoteDefinitions=G;async function J(n,t){const e=`${n}:${t}`;if(I.has(e))return I.get(e);const o=(await(F.has(n)?F.get(n):await Y(n)).get(t))();return I.set(e,o),o}x.loadRemoteModule=J;const Z=(n,t)=>new Promise((e,i)=>{const s=document.createElement("script");s.src=n,s.type="text/javascript",s.async=!0,s.onload=()=>{e({get:a=>window[t].get(a),init:a=>{try{window[t].init(a)}catch(r){console.error(`Failed to initialize remote ${t}`,r),i(r)}}})},s.onerror=()=>i(new Error(`Remote ${t} not found`)),document.head.appendChild(s)});async function Y(n){if(!S&&!w)throw new Error("Call setRemoteDefinitions or setRemoteUrlResolver to allow Dynamic Federation to find the remote apps correctly.");D||(D=!0,await __webpack_init_sharing__("default"));const t=w?w[n]:await S(n);let e=t;!t.endsWith(".mjs")&&!t.endsWith(".js")&&(e=`${t}${t.endsWith("/")?"":"/"}remoteEntry.js`);const i=await Z(e,n);return await i.init(__webpack_share_scopes__.default),F.set(n,i),i}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.setRemoteUrlResolver=n.setRemoteDefinitions=n.loadRemoteModule=void 0;var t=x;Object.defineProperty(n,"loadRemoteModule",{enumerable:!0,get:function(){return t.loadRemoteModule}}),Object.defineProperty(n,"setRemoteDefinitions",{enumerable:!0,get:function(){return t.setRemoteDefinitions}}),Object.defineProperty(n,"setRemoteUrlResolver",{enumerable:!0,get:function(){return t.setRemoteUrlResolver}})})(P);const Q=H({__proto__:null},[P]);function X(n){var t;try{if("shape"in n){const e=n,i=[];for(const[s,o]of Object.entries(e.shape)){const a=o,r={name:s,required:!a.isOptional()};if(a._def&&a._def.description&&(r.description=a._def.description),a._def){let c=a._def.typeName||"unknown";c==="ZodOptional"&&a._def.innerType&&(c=((t=a._def.innerType._def)==null?void 0:t.typeName)||"unknown"),r.type=c.replace("Zod","").toLowerCase()}i.push(r)}return i}return[]}catch(e){return console.warn("Failed to extract schema field info:",e),[]}}class ee{constructor(){v(this,"issues",[])}addError(t){this.issues.push({type:"error",message:t})}addWarning(t){this.issues.push({type:"warning",message:t})}addInfo(t){this.issues.push({type:"info",message:t})}hasErrors(){return this.issues.some(t=>t.type==="error")}hasIssues(){return this.issues.length>0}getIssues(){return[...this.issues]}}class te{constructor(){v(this,"cache",new Map)}set(t,e){this.cache.set(t,e)}get(t){return this.cache.get(t)||[]}clear(){this.cache.clear()}}const $=new te;function ne(n){return $.get(n)}const O=[];function ie(n){O.push(n)}function se(n,t,e){return O.reduce((i,s)=>s(i,t,e),n)}class oe{constructor(){v(this,"extensionPoints",new Map)}define(t){if(this.extensionPoints.has(t.id))return console.warn(`Extension point ${t.id} is already defined`),this.extensionPoints.get(t.id);const e={config:t,id:t.id,isRegistered:!1,getExtensions:i=>i[t.id]||{},register:()=>{if(e.isRegistered){console.warn(`Extension point ${t.id} is already registered`);return}const i=this.createReducer(t);ie(i),e.isRegistered=!0}};return t.schema&&(e.getSchemaFieldInfo=()=>X(t.schema)),this.extensionPoints.set(t.id,e),e}createReducer(t){return(e,i,s)=>{const o=i[t.contributionKey];return!o||typeof o!="object"||Object.entries(o).forEach(([a,r])=>{var m,h;if(!r)return;const c={remote:r.remote||"",sectionId:r.sectionId||a,experiences:s,contributions:i};if(t.validate){const d=new ee;if(t.validate(r,d)==="skip"){$.set(a,[{type:"warning",message:"Plugin marked to skip processing"}]);return}if(d.hasIssues()){const b=d.getIssues().map(f=>({...f,message:`Extension point validation: ${f.message}`}));if($.set(a,b),d.hasErrors()){console.error(`Validation failed for ${t.id} contribution "${a}":`,b.filter(f=>f.type==="error").map(f=>f.message).join(", "));return}}else $.set(a,[])}const l=t.transform?t.transform(r,c):r;e[t.id]||(e[t.id]={});const u={id:a,type:t.contributionKey,data:l,remote:c.remote,sectionId:c.sectionId};if(t.isRankable&&typeof r.rank=="number"&&(u.rank=r.rank),l&&typeof l=="object"&&("component"in l&&(u.component=l.component),"view"in l&&(u.view=l.view),"location"in l&&(u.location=l.location)),e[t.id][a]=u,t.hasView&&((m=t.relatedPoints)!=null&&m.view)){const d=r.experienceId,p=s==null?void 0:s[d];p&&(e[t.relatedPoints.view]||(e[t.relatedPoints.view]={}),e[t.relatedPoints.view][a]={id:a,type:`${t.contributionKey}.view`,data:p,remote:c.remote,sectionId:c.sectionId})}(h=t.relatedPoints)!=null&&h.definition&&(e[t.relatedPoints.definition]||(e[t.relatedPoints.definition]={}),e[t.relatedPoints.definition][a]={id:a,type:`${t.contributionKey}.definition`,data:l,remote:c.remote,sectionId:c.sectionId})}),e}}getAllExtensionPoints(){return Array.from(this.extensionPoints.values()).filter(t=>t.isRegistered)}getAllDefinedExtensionPoints(){return Array.from(this.extensionPoints.values())}getExtensionPoint(t){return this.extensionPoints.get(t)}hasExtensionPoint(t){return this.extensionPoints.has(t)}}const _=new oe;function y(){return _}function A(n={}){const{experienceIdProperty:t="experienceId",flattenComponentProperties:e=!0,customTransform:i}=n;return(s,o)=>{var l;const a=s[t],r=a?((l=o.experiences)==null?void 0:l[a])||{}:{};let c={...s,view:r};return e&&r&&(r.component&&(c.component=r.component),r.location&&(c.location=r.location)),i&&(c=i(s,r,o)||c),c}}function j(n){return _.define(n)}const re={$timestamp:()=>Date.now(),$date:()=>new Date().toISOString(),$packageVersion:()=>process.env.npm_package_version||"0.0.0",$env:()=>process.env.NODE_ENV||"development"};function ae(n){const t={id:n.id,displayName:n.displayName,description:n.description,contributionKey:n.contributionKey,hasView:n.hasView,isRankable:n.isRankable,relatedPoints:n.relatedPoints,metadata:n.metadata?{...n.metadata,exportName:n.metadata.exportName||ce(n.id)}:void 0};return n.schema&&(t.schema=le(n.schema,{hasView:n.hasView,isRankable:n.isRankable})),n.validation&&(t.validate=de(n.validation)),n.transform?t.transform=xe(n.transform):n.hasView&&(t.transform=A()),t}function ce(n){return n.split(".").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")+"Extension"}function le(n,t){try{const{z:e}=require("zod");if(n.properties){const i={};i.id=e.string().min(1),i.title=e.string().min(1),i.namespace=e.string().min(1),t!=null&&t.hasView&&(i.experienceId=e.string().min(1)),t!=null&&t.isRankable&&(i.rank=e.number().min(0).max(1e3).optional());for(const[o,a]of Object.entries(n.properties))i[o]=ue(a,e);let s=e.object(i);return n.additionalProperties||(s=s.strict()),s}return e.any()}catch(e){console.warn("Zod not available for JSON schema conversion:",e);return}}function ue(n,t){let e;switch(n.type){case"string":e=t.string(),n.minLength&&(e=e.min(n.minLength)),n.maxLength&&(e=e.max(n.maxLength)),n.pattern&&(e=e.regex(new RegExp(n.pattern))),n.enum&&(e=t.enum(n.enum));break;case"number":e=t.number(),n.minimum!==void 0&&(e=e.min(n.minimum)),n.maximum!==void 0&&(e=e.max(n.maximum));break;case"boolean":e=t.boolean();break;case"array":e=t.array(t.any());break;case"object":e=t.object({});break;default:e=t.any()}return n.description&&(e=e.describe(n.description)),n.default!==void 0&&(e=e.default(n.default)),e}function de(n){return n.module?be(n.module):(t,e)=>{if(!n.rules)return;const i=t;for(const s of n.rules)pe(s,i,e)}}function pe(n,t,e){switch(n.type){case"required":fe(n,t,e);break;case"range":me(n,t,e);break;case"pattern":ge(n,t,e);break;case"dependency":he(n,t,e);break;case"custom":ye(n,t,e);break}}function fe(n,t,e){n.field&&!t[n.field]&&e.addError(n.message||`Field '${n.field}' is required`)}function me(n,t,e){if(n.field&&typeof t[n.field]=="number"){const i=t[n.field];n.min!==void 0&&i<n.min&&e.addError(n.message||`Field '${n.field}' must be at least ${n.min}`),n.max!==void 0&&i>n.max&&e.addError(n.message||`Field '${n.field}' must be at most ${n.max}`)}}function ge(n,t,e){n.field&&n.pattern&&typeof t[n.field]=="string"&&(new RegExp(n.pattern).test(t[n.field])||e.addError(n.message||`Field '${n.field}' does not match pattern ${n.pattern}`))}function he(n,t,e){if(n.field&&n.dependsOn&&n.expression)try{C(n.expression,t)||e.addError(n.message||`Field '${n.field}' dependency validation failed`)}catch(i){e.addWarning(`Failed to evaluate dependency expression: ${i}`)}}function ye(n,t,e){if(n.expression)try{C(n.expression,t)||e.addError(n.message||"Custom validation failed")}catch(i){e.addWarning(`Failed to evaluate custom expression: ${i}`)}}function be(n){return(t,e)=>{console.warn(`External validation module not implemented: ${n}`),e.addWarning(`External validation module not yet supported: ${n}`)}}function xe(n){return n.module?Ee(n.module):(t,e)=>{const i={...t};if(n.addFields)for(const[s,o]of Object.entries(n.addFields))i[s]=Pe(o);if(n.removeFields)for(const s of n.removeFields)delete i[s];if(n.renameFields)for(const[s,o]of Object.entries(n.renameFields))s in i&&(i[o]=i[s],delete i[s]);if(n.normalizeFields)for(const{field:s,operation:o}of n.normalizeFields)s in i&&typeof i[s]=="string"&&(i[s]=ve(i[s],o));return i}}function Ee(n){return(t,e)=>(console.warn(`External transform module not implemented: ${n}`),t)}function Pe(n){if(typeof n=="string"&&n.startsWith("$")){const t=re[n];if(t)return t()}return n}function ve(n,t){switch(t){case"trim":return n.trim();case"lowercase":return n.toLowerCase();case"uppercase":return n.toUpperCase();case"camelCase":return we(n);case"kebabCase":return $e(n);default:return n}}function we(n){return n.replace(/[-_\s]+(.)?/g,(t,e)=>e?e.toUpperCase():"").replace(/^./,t=>t.toLowerCase())}function $e(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function C(n,t){try{let e=n;for(const[i,s]of Object.entries(t)){const o=typeof s=="string"?`"${s}"`:String(s);e=e.replace(new RegExp(`\\b${i}\\b`,"g"),o)}if(e.includes("!==")){const[i,s]=e.split("!==").map(o=>o.trim());return i!==s}if(e.includes("===")){const[i,s]=e.split("===").map(o=>o.trim());return i===s}return e.includes("||")?e.split("||").map(s=>s.trim()).some(s=>C(s,t)):e.includes("&&")?e.split("&&").map(s=>s.trim()).every(s=>C(s,t)):!1}catch(e){return console.error("Expression evaluation failed:",e),!1}}const N=n=>(t,e)=>{var c;const i=n[e].remote,s=e,o=(c=n[e].contributes)==null?void 0:c.experiences;return Object.keys(o).forEach(l=>{const u=o[l];t.experiences[l]={...u,remote:i,sectionId:s}}),y().getAllExtensionPoints().forEach(l=>{var h;const{contributionKey:u}=l.config,m=(h=n[e].contributes)==null?void 0:h[u];m&&(t[u]||(t[u]={}),Array.isArray(m)?m.forEach(d=>{d&&d.id&&(t[u][d.id]={...d,remote:i,sectionId:s})}):typeof m=="object"&&Object.entries(m).forEach(([d,p])=>{t[u][d]={...p,id:d,remote:i,sectionId:s}}))}),t};async function V(n){const t=n??window.KosPlugins.__dynamicRemotes;if(window.KosPlugins.extensions){const o=window.KosPlugins.extensions;return{extensionPoints:o,getExtensions:a=>o[a]||[],remotes:t,extensions:window.KosPlugins.__extensions}}const e=window.KosPlugins.__extensions??await M(t),i={};if(e)for(const o of Object.keys(e))i[o]=Object.values(e[o]||{});return window.KosPlugins.extensions=i,{extensionPoints:i,getExtensions:o=>i[o]||[],remotes:t,extensions:e}}const U={controlPourDefinitions:{},experiences:{}};function K(n){return n?Object.keys(n).reduce(N(n),{...U}):U}async function M(n){if(!n)return window.KosPlugins=window.KosPlugins||{},{};for(const o of Object.values(n)){try{if(o.extensions&&Array.isArray(o.extensions)){const a=o.extensions.filter(r=>r&&typeof r=="object"&&"id"in r).map(r=>ae(r));if(a.length>0){console.info(`Registering ${a.length} JSON extension point(s) from ${o.remote}`);for(const r of a)try{j(r).register(),console.debug(`Registered JSON extension point: ${r.id}`)}catch(c){console.error(`Failed to register JSON extension point '${r.id}' from ${o.remote}:`,c)}}}}catch(a){console.warn(`Failed to parse JSON extension points from ${o.remote}:`,a)}if(o.init)try{const a=await P.loadRemoteModule(o.remote,"./InitPlugin");if(a.default){const r=new a.default;r==null||r.register()}}catch(a){console.warn(`Failed to load InitPlugin from ${o.remote}:`,a)}}const t=K(n),e=t.experiences,s=se({},t,e);return window.KosPlugins=window.KosPlugins||{},window.KosPlugins.__extensions=s,s}async function ke(n){const{getExtensions:t}=await V();return t(n)}const Ce=(n=null)=>(n||window.location.search.replace("?","")).split("&").map(t=>{const[e,i]=t.split("=");return[e,decodeURIComponent(i||"")]}).reduce((t,[e,i])=>(t[e]=i,t),{}),Re=()=>{const n=window.location.origin,t=Ce();return(t==null?void 0:t.host)||n},Ie=async n=>{var b;const t=Re(),e=n??{},{pluginBaseUrl:i=t,pluginApiPath:s="/api/app/kosdev.ddk/ncui/plugins",overrides:o={},pluginContext:a}=e,r=!!a,c=r?`${i}/api/kos/ui/plugins/contexts`:`${i}${s}`;console.log(`initialize-plugins: Using Plugin Framework: ${r}: Fetching plugins from ${c}`);const u=await(await fetch(c)).json(),m=typeof(a==null?void 0:a.context)=="string"?[a.context]:(a==null?void 0:a.context)||[],h=r?((b=u.data)==null?void 0:b.filter(f=>m.includes(f.name)).flatMap(f=>f.plugins))??[]:u.data??[],d=h==null?void 0:h.reduce((f,g)=>{const R=(o==null?void 0:o[g.id])??r?`${i}${g.path}`:`${i}${g.baseUrl}`;return g.descriptor?f[g.id]={basePath:`${R}remoteEntry.js`,extensions:g.descriptor.extensions||[],contributes:g.descriptor.contributes,remote:g.descriptor.id,init:!!g.descriptor.init}:console.error(`initialize-plugins: Plugin ${g.id} does not have a descriptor`),f},{});window.KosPlugins=window.KosPlugins||{},window.KosPlugins.__dynamicRemotes=d;const p=Object.keys(d).reduce((f,g)=>{const R=d[g].remote;return f[R]=d[g].basePath,f},{});return P.setRemoteDefinitions(p),p};function Se(n,t,e=!1){return!n||Object.keys(n).length===0?null:e?t&&n[t]?n[t]:null:t&&n[t]?n[t]:Object.values(n).filter(s=>typeof s.id=="string").sort((s,o)=>{const a=typeof s.rank=="number"?s.rank:1/0,r=typeof o.rank=="number"?o.rank:1/0;if(a===r){const c=s.id??"",l=o.id??"";return c.localeCompare(l)}return a-r})[0]??null}const T=E.z.object({id:E.z.string().min(1,"ID is required").describe("Unique identifier for this extension"),title:E.z.string().min(1,"Title is required").describe("Display title shown in the interface"),namespace:E.z.string().min(1,"Namespace is required").describe("Namespace for organizing related extensions"),experienceId:E.z.string().min(1,"Experience ID is required").describe("Reference to the UI component experience for rendering")}),L=T.extend({rank:E.z.number().int().min(0).optional().describe("Optional ranking for ordering (higher = preferred)")});function Fe(n,t,e){const i=n.safeParse(t);return i.success?!0:(i.error.errors.forEach(s=>{e.addError(`${s.path.join(".")}: ${s.message}`)}),!1)}function _e(n,t,e){t&&!t.includes(".")&&e.addWarning(`${n} '${t}' should typically include dot notation (e.g., 'category.item')`)}function q(n,t,e=1e3){n!==void 0&&n>e&&t.addWarning(`Rank ${n} seems unusually high - consider using lower values for better ordering`)}function Te(n,t={}){return(t.rankable?L:T).extend(n)}function De(n,t,e=1e3){typeof n=="object"&&n!==null&&"rank"in n&&q(n.rank,t,e)}class k{static getExtensionPoints(t,e={}){const{includeLegacyExtensions:i=!0,includeEmptyExtensionPoints:s=!0}=e,a=y().getAllExtensionPoints(),r=[];return a.forEach(c=>{const l=Object.values((t==null?void 0:t[c.id])||{});!s&&l.length===0||r.push({id:c.id,displayName:c.config.displayName,description:c.config.description,source:"simplified",metadata:c.config.metadata,pluginCount:l.length,plugins:l})}),i&&t&&Object.entries(t).forEach(([c,l])=>{if(r.some(m=>m.id===c))return;const u=Object.values(l||{});!s&&u.length===0||r.push({id:c,source:"legacy",pluginCount:u.length,plugins:u})}),r.sort((c,l)=>c.id.localeCompare(l.id))}static filterExtensionPoints(t,e){if(!e.trim())return t;const i=e.toLowerCase();return t.filter(s=>{var o,a,r,c,l,u;return s.id.toLowerCase().includes(i)||((o=s.displayName)==null?void 0:o.toLowerCase().includes(i))||((a=s.description)==null?void 0:a.toLowerCase().includes(i))||((c=(r=s.metadata)==null?void 0:r.category)==null?void 0:c.toLowerCase().includes(i))||((u=(l=s.metadata)==null?void 0:l.tags)==null?void 0:u.some(m=>m.toLowerCase().includes(i)))})}static calculateHealthStats(t){const e=t.length,i=t.filter(c=>c.pluginCount>0).length,s=t.reduce((c,l)=>c+l.pluginCount,0),o=t.filter(c=>c.source==="simplified").length,a=t.filter(c=>c.source==="legacy").length,r=t.filter(c=>{var l;return(l=c.metadata)==null?void 0:l.deprecated}).length;return{totalExtensionPoints:e,extensionPointsWithPlugins:i,totalPlugins:s,simplifiedExtensionPoints:o,legacyExtensionPoints:a,deprecatedExtensionPoints:r}}static analyzePlugin(t){const e=!!t.component,i=typeof t.rank=="number",s=t.rank||0,o=[];if(e?o.push("UI Component"):o.push("Background Service"),i&&o.push(`Rank: ${s}`),t.namespace){const r=t.namespace;r.includes("kos")||r.includes("ddk")?o.push("First-party"):o.push("Third-party")}t.modalMode&&o.push(`Modal: ${t.modalMode}`);let a="healthy";return t.remote||(a="warning"),{hasComponent:e,hasRank:i,healthStatus:a,capabilities:o}}static getExtensionPointById(t,e){return t.find(i=>i.id===e)}static validateExtensionPointId(t){const e=[],i=[];t.includes(".")||(e.push("Extension point ID should contain at least one dot (namespace.feature)"),i.push('Use format like "ddk.myFeature" or "app.myFeature"'));const s=t.split(".");s.length<2&&e.push("Extension point ID should have at least 2 parts (namespace.feature)");const o=s[0];return o&&!["ddk","cui","app"].includes(o)&&!o.endsWith("app")&&i.push("Consider using standard namespaces: ddk, cui, or [appname]app"),s.some(r=>/[A-Z]/.test(r))&&(e.push("Extension point ID parts should be lowercase"),i.push('Use kebab-case or dot notation: "my.feature" not "my.myFeature"')),{isValid:e.length===0,issues:e,suggestions:i}}static validatePluginDescriptor(t){const e=[],i=[],s=[],o=[];if(t.id?t.id.match(/^[a-z0-9-]+$/)||o.push("Plugin ID convention: use lowercase letters, numbers, and hyphens (e.g., 'my-awesome-plugin')"):(s.push("id"),e.push("Plugin descriptor must have an 'id' field")),!t.contributes)i.push("Plugin has no contributions - it won't extend any functionality"),o.push("Add a 'contributes' section with plugin contributions");else{const a=Object.keys(t.contributes);a.length===0&&i.push("Plugin contributes section is empty"),a.forEach(r=>{const c=t.contributes[r];if(!Array.isArray(c)){e.push(`Contribution '${r}' must be an array`);return}c.forEach((l,u)=>{l.id||e.push(`Contribution ${r}[${u}] missing required 'id' field`),r==="experiences"&&l.component&&!l.location&&(e.push(`Experience '${l.id}' has component but no location`),o.push("Add 'location' field pointing to the component file")),["cui","utilities","settings","setup"].includes(r)&&(l.title||i.push(`${r} contribution '${l.id}' missing 'title' field`),l.namespace||i.push(`${r} contribution '${l.id}' missing 'namespace' field`),l.experienceId||e.push(`${r} contribution '${l.id}' missing required 'experienceId' field`))})})}return t.init!==void 0&&typeof t.init!="boolean"&&e.push("'init' field must be a boolean value"),{isValid:e.length===0&&s.length===0,errors:e,warnings:i,missingRequired:s,suggestions:o}}static checkPluginCompatibility(t,e){const i=[],s=[],o=[],a=[];if(!t.contributes)return{isCompatible:!0,issues:["Plugin has no contributions to check"],missingExtensionPoints:[],incompatibleTypes:[],suggestions:[]};const r=y(),c=new Set(e.map(l=>l.id));return Object.entries(t.contributes).forEach(([l,u])=>{this.getExpectedExtensionPoints(l).forEach(p=>{c.has(p)||(s.push(p),i.push(`Extension point '${p}' not available for '${l}' contributions`),a.push(`Ensure the extension point '${p}' is registered`))});const d=r.getAllExtensionPoints().find(p=>p.config.contributionKey===l);d&&u.length>0&&u.forEach((p,b)=>{d.config.isRankable&&typeof p.rank!="number"&&(i.push(`${l}[${b}]: Extension point '${d.id}' expects 'rank' property`),a.push("Add 'rank' property with numeric value for ordering")),d.config.hasView&&!p.experienceId&&(i.push(`${l}[${b}]: Extension point '${d.id}' expects 'experienceId' for view-based contributions`),a.push("Add 'experienceId' property linking to an experience definition"))})}),{isCompatible:i.length===0,issues:i,missingExtensionPoints:s,incompatibleTypes:o,suggestions:a}}static getExpectedExtensionPoints(t){return{cui:["ddk.cui","ddk.cui.view","ddk.cui.settings.config"],utilities:["ddk.utility","ddk.utility.view","ddk.utilities"],setup:["ddk.setup","ddk.setup.view"],settings:["ddk.settings","ddk.settings.view"],troubleActions:["ddk.troubleAction","ddk.troubleAction.view"],navViews:["ddk.nav","ddk.nav.view"],controlPour:["ddk.controlPour","ddk.controlPour.view"],experiences:[],views:[]}[t]||[]}static analyzePluginDescriptor(t,e){const i=this.validatePluginDescriptor(t),s=this.checkPluginCompatibility(t,e),o=[];return i.warnings.length>0&&o.push("Address validation warnings to improve plugin quality"),s.isCompatible||o.push("Resolve compatibility issues before deploying plugin"),t.contributes&&Object.keys(t.contributes).length===1&&o.push("Consider adding more contribution types to increase plugin value"),{validation:i,compatibility:s,recommendations:o}}}class Ue{static generateFullDocumentation(t,e={}){const{includeUsageExamples:i=!0,includeTypeDefinitions:s=!0,includeLegacyExtensions:o=!0,includePluginHealth:a=!0}=e,r=k.getExtensionPoints(t,{includeLegacyExtensions:o,includeEmptyExtensionPoints:!0}),c=k.calculateHealthStats(r);let l=this.generateHeader(c);return l+=this.generateTableOfContents(r),l+=this.generateOverviewSection(r,c),r.forEach(u=>{l+=this.generateExtensionPointSection(u,{includeUsageExamples:i,includePluginHealth:a})}),s&&(l+=this.generateTypeDefinitionsSection(r)),l+=this.generateContributionGuide(),l+=this.generateTroubleshootingSection(),{content:l,metadata:{generatedAt:new Date().toISOString(),totalExtensionPoints:c.totalExtensionPoints,totalPlugins:c.totalPlugins,simplifiedExtensionPoints:c.simplifiedExtensionPoints,legacyExtensionPoints:c.legacyExtensionPoints}}}static generateHeader(t){return`# KOS Plugin Extension Points Reference
|
|
2
|
-
|
|
3
|
-
**Generated**: ${new Date().toLocaleString()}
|
|
4
|
-
|
|
5
|
-
## System Overview
|
|
6
|
-
|
|
7
|
-
- **Total Extension Points**: ${t.totalExtensionPoints}
|
|
8
|
-
- **Extension Points with Plugins**: ${t.extensionPointsWithPlugins}
|
|
9
|
-
- **Total Active Plugins**: ${t.totalPlugins}
|
|
10
|
-
- **Simplified Extension Points**: ${t.simplifiedExtensionPoints}
|
|
11
|
-
- **Legacy Extension Points**: ${t.legacyExtensionPoints}
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
`}static generateTableOfContents(t){let e=`## Table of Contents
|
|
16
|
-
|
|
17
|
-
`;return e+=`- [Overview](#overview)
|
|
18
|
-
`,e+=`- [Extension Points](#extension-points)
|
|
19
|
-
`,t.forEach(i=>{const s=i.id.toLowerCase().replace(/\./g,"");e+=` - [${i.id}](#${s}) (${i.pluginCount} plugins)
|
|
20
|
-
`}),e+=`- [Type Definitions](#type-definitions)
|
|
21
|
-
`,e+=`- [Contribution Guide](#contribution-guide)
|
|
22
|
-
`,e+=`- [Troubleshooting](#troubleshooting)
|
|
23
|
-
|
|
24
|
-
`,e}static generateOverviewSection(t,e){let i=`## Overview
|
|
25
|
-
|
|
26
|
-
`;return i+="This document provides a comprehensive reference for all available extension points in the KOS plugin system. ",i+=`Extension points allow plugins to contribute functionality to the application.
|
|
27
|
-
|
|
28
|
-
`,i+=`### Extension Point Types
|
|
29
|
-
|
|
30
|
-
`,i+="- ** Simplified Extension Points**: Use the new simplified API from `defineExtensionPoint`\n",i+=`- ** Legacy Extension Points**: Use the traditional reducer-based system
|
|
31
|
-
|
|
32
|
-
`,e.deprecatedExtensionPoints>0&&(i+=`### ⚠️ Deprecated Extension Points
|
|
33
|
-
|
|
34
|
-
`,i+=`${e.deprecatedExtensionPoints} extension points are marked as deprecated. `,i+=`Consider migrating to newer alternatives.
|
|
35
|
-
|
|
36
|
-
`),i+`---
|
|
37
|
-
|
|
38
|
-
`}static generateExtensionPointSection(t,e){var a;const{includeUsageExamples:i=!0,includePluginHealth:s=!0}=e;let o=`## ${t.id}
|
|
39
|
-
|
|
40
|
-
`;if(t.displayName&&(o+=`**Display Name**: ${t.displayName}
|
|
41
|
-
|
|
42
|
-
`),t.description&&(o+=`**Description**: ${t.description}
|
|
43
|
-
|
|
44
|
-
`),o+=`**Source**: ${t.source}
|
|
45
|
-
`,o+=`**Active Plugins**: ${t.pluginCount}
|
|
46
|
-
|
|
47
|
-
`,t.metadata){o+=`### Metadata
|
|
48
|
-
|
|
49
|
-
`;const r=t.metadata;r.category&&(o+=`- **Category**: ${r.category}
|
|
50
|
-
`),r.owner&&(o+=`- **Owner**: ${r.owner}
|
|
51
|
-
`),r.since&&(o+=`- **Since**: ${r.since}
|
|
52
|
-
`),(a=r.tags)!=null&&a.length&&(o+=`- **Tags**: ${r.tags.join(", ")}
|
|
53
|
-
`),r.deprecated&&(o+=`- **⚠️ Status**: Deprecated
|
|
54
|
-
`),o+=`
|
|
55
|
-
`}return i&&(o+=this.generateUsageExamples(t)),t.plugins.length>0?o+=this.generatePluginList(t.plugins,s):o+=`### Plugins
|
|
56
|
-
|
|
57
|
-
No plugins currently registered for this extension point.
|
|
58
|
-
|
|
59
|
-
`,o+=this.generateSchemaFieldsSection(t),o+=this.generateContributionStructure(t),o+`---
|
|
60
|
-
|
|
61
|
-
`}static generateUsageExamples(t){let e=`### Usage Examples
|
|
62
|
-
|
|
63
|
-
`;return t.source==="simplified"&&(e+=`#### Using Simplified API
|
|
64
|
-
|
|
65
|
-
`,e+="```typescript\n",e+=`// Import the extension point
|
|
66
|
-
`,e+=`import { ${this.getExtensionPointImportName(t.id)} } from './extension-points';
|
|
67
|
-
|
|
68
|
-
`,e+=`// Use extension component hook
|
|
69
|
-
`,e+=`import { useExtensionComponent } from '@kosdev-code/kos-ui-plugin';
|
|
70
|
-
|
|
71
|
-
`,e+=`const Component = useExtensionComponent(${this.getExtensionPointImportName(t.id)});
|
|
72
|
-
|
|
73
|
-
`,e+=`if (Component) {
|
|
74
|
-
`,e+=` return (
|
|
75
|
-
`,e+=` <Component
|
|
76
|
-
`,e+=` customProp="value"
|
|
77
|
-
`,e+=` onComplete={handleComplete}
|
|
78
|
-
`,e+=` />
|
|
79
|
-
`,e+=` );
|
|
80
|
-
`,e+=`}
|
|
81
|
-
|
|
82
|
-
`,e+=`// Or use with dynamic component
|
|
83
|
-
`,e+=`const [Component] = useDynamicComponent({
|
|
84
|
-
`,e+=` extension: ${this.getExtensionPointImportName(t.id)}.id
|
|
85
|
-
`,e+=`});
|
|
86
|
-
`,e+="```\n\n",e+=`#### Using Typed Hooks
|
|
87
|
-
|
|
88
|
-
`,e+="```typescript\n",e+=`// Get all extensions with type safety
|
|
89
|
-
`,e+=`const extensions = useExtensions(${this.getExtensionPointImportName(t.id)});
|
|
90
|
-
|
|
91
|
-
`,e+=`// Get best extension
|
|
92
|
-
`,e+=`const bestExtension = useBest(${this.getExtensionPointImportName(t.id)});
|
|
93
|
-
|
|
94
|
-
`,e+=`// Check availability
|
|
95
|
-
`,e+=`const hasExtensions = useHasExtensions(${this.getExtensionPointImportName(t.id)});
|
|
96
|
-
`,e+="```\n\n"),e+=`#### Using DynamicComponent
|
|
97
|
-
|
|
98
|
-
`,e+="```typescript\n",e+=`import { DynamicComponent } from '@kosdev-code/kos-ui-plugin';
|
|
99
|
-
`,e+=`import { ${this.getExtensionPointImportName(t.id)} } from './extension-points';
|
|
100
|
-
|
|
101
|
-
`,e+=`<DynamicComponent
|
|
102
|
-
`,e+=` extension={${this.getExtensionPointImportName(t.id)}.id}
|
|
103
|
-
`,e+=` props={{ customData: "value" }}
|
|
104
|
-
`,e+=` fallback={<div>Loading...</div>}
|
|
105
|
-
`,e+=`/>
|
|
106
|
-
`,e+="```\n\n",e+=`#### Using Context
|
|
107
|
-
|
|
108
|
-
`,e+="```typescript\n",e+=`import { useKosPluginsContext } from '@kosdev-code/kos-ui-plugin';
|
|
109
|
-
`,e+=`import { ${this.getExtensionPointImportName(t.id)} } from './extension-points';
|
|
110
|
-
|
|
111
|
-
`,e+=`const { getExtensions } = useKosPluginsContext();
|
|
112
|
-
`,e+=`const extensions = getExtensions(${this.getExtensionPointImportName(t.id)}.id);
|
|
113
|
-
`,e+="```\n\n",e}static generatePluginList(t,e){let i=`### Active Plugins
|
|
114
|
-
|
|
115
|
-
`;return t.forEach(s=>{if(i+=`#### ${s.id}
|
|
116
|
-
|
|
117
|
-
`,s.remote&&(i+=`- **Remote**: ${s.remote}
|
|
118
|
-
`),s.sectionId&&(i+=`- **Section**: ${s.sectionId}
|
|
119
|
-
`),s.rank!==void 0&&(i+=`- **Rank**: ${s.rank}
|
|
120
|
-
`),e){const o=k.analyzePlugin(s);i+=`- **Health**: ${this.getHealthEmoji(o.healthStatus)} ${o.healthStatus}
|
|
121
|
-
`,o.capabilities.length>0&&(i+=`- **Capabilities**: ${o.capabilities.join(", ")}
|
|
122
|
-
`)}i+=`
|
|
123
|
-
`}),i}static generateSchemaFieldsSection(t){if(t.source!=="simplified")return"";const i=y().getExtensionPoint(t.id);if(!(i!=null&&i.getSchemaFieldInfo))return"";const s=i.getSchemaFieldInfo();if(s.length===0)return"";let o=`### Schema Fields
|
|
124
|
-
|
|
125
|
-
`;return o+=`The following fields are defined in the schema for this extension point:
|
|
126
|
-
|
|
127
|
-
`,o+=`| Field | Type | Required | Description |
|
|
128
|
-
`,o+=`|-------|------|----------|-------------|
|
|
129
|
-
`,s.forEach(a=>{const r=a.name,c=a.type||"unknown",l=a.required?"✅":"⭕",u=a.description||"-";o+=`| \`${r}\` | ${c} | ${l} | ${u} |
|
|
130
|
-
`}),o+=`
|
|
131
|
-
`,o}static generateContributionStructure(t){let e=`### Contribution Structure
|
|
132
|
-
|
|
133
|
-
`;e+=`To contribute to this extension point, add the following to your plugin descriptor:
|
|
134
|
-
|
|
135
|
-
`,e+="```json\n",e+=`{
|
|
136
|
-
`,e+=` "id": "your-plugin-id",
|
|
137
|
-
`,e+=` "contributes": {
|
|
138
|
-
`;const i=this.inferContributionKey(t);e+=` "${i}": [
|
|
139
|
-
`,e+=` {
|
|
140
|
-
`;const s=this.getSchemaFieldsForContribution(t);if(s.length>0){const a=[];s.forEach(r=>{let c;r.name==="id"?c='"your-contribution-id"':r.name==="title"?c='"Your Contribution Title"':r.name==="namespace"?c='"your-namespace"':r.name==="experienceId"?c='"your-experience-id"':r.name==="dashboardKey"?c='"your-dashboard-key"':r.name==="rank"?c="10":r.type==="string"?c=`"your-${r.name}"`:r.type==="number"?c="0":r.type==="boolean"?c="false":c=`"your-${r.name}"`,(r.required||["experienceId","rank","dashboardKey"].includes(r.name))&&a.push(` "${r.name}": ${c}`)}),e+=a.join(`,
|
|
141
|
-
`)}else{e+=` "id": "your-contribution-id",
|
|
142
|
-
`,e+=` "title": "Your Contribution Title",
|
|
143
|
-
`,e+=' "namespace": "your-namespace"',this.isViewBasedExtensionPoint(t)&&(e+=`,
|
|
144
|
-
"experienceId": "your-experience-id"`),this.isRankableExtensionPoint(t)&&(e+=`,
|
|
145
|
-
"rank": 10`);const a=this.getSpecificFields(t);a.length>0&&(e+=`,
|
|
146
|
-
${a.join(`,
|
|
147
|
-
`)}`)}return e+=`
|
|
148
|
-
}
|
|
149
|
-
`,e+=" ]",(s.some(a=>a.name==="experienceId")||this.isViewBasedExtensionPoint(t))&&(e+=`,
|
|
150
|
-
"experiences": {
|
|
151
|
-
`,e+=` "your-experience-id": {
|
|
152
|
-
`,e+=` "id": "your-experience-id",
|
|
153
|
-
`,e+=` "component": "YourComponent",
|
|
154
|
-
`,e+=` "location": "./src/components/YourComponent.tsx"
|
|
155
|
-
`,e+=` }
|
|
156
|
-
`,e+=" }"),e+=`
|
|
157
|
-
}
|
|
158
|
-
`,e+=`}
|
|
159
|
-
`,e+="```\n\n",e}static generateTypeDefinitionsSection(t){let e=`## Type Definitions
|
|
160
|
-
|
|
161
|
-
`;return e+=`### Extension Point Types
|
|
162
|
-
|
|
163
|
-
`,e+="```typescript\n",t.forEach(i=>{i.source==="simplified"&&(e+=`// ${i.id}
|
|
164
|
-
`,e+=`interface ${this.getExtensionPointTypeName(i.id)} {
|
|
165
|
-
`,e+=` id: "${i.id}";
|
|
166
|
-
`,e+=` displayName?: "${i.displayName||""}";
|
|
167
|
-
`,e+=` description?: "${i.description||""}";
|
|
168
|
-
`,e+=`}
|
|
169
|
-
|
|
170
|
-
`)}),e+="```\n\n",e+=`### Plugin Contribution Types
|
|
171
|
-
|
|
172
|
-
`,e+="```typescript\n",e+=`interface BaseContribution {
|
|
173
|
-
`,e+=` id: string;
|
|
174
|
-
`,e+=` title: string;
|
|
175
|
-
`,e+=` namespace: string;
|
|
176
|
-
`,e+=`}
|
|
177
|
-
|
|
178
|
-
`,e+=`interface ViewBasedContribution extends BaseContribution {
|
|
179
|
-
`,e+=` experienceId: string;
|
|
180
|
-
`,e+=`}
|
|
181
|
-
|
|
182
|
-
`,e+=`interface RankableContribution extends BaseContribution {
|
|
183
|
-
`,e+=` rank: number;
|
|
184
|
-
`,e+=`}
|
|
185
|
-
`,e+="```\n\n",e}static generateContributionGuide(){return`## Contribution Guide
|
|
186
|
-
|
|
187
|
-
### Creating a Plugin
|
|
188
|
-
|
|
189
|
-
1. **Create Plugin Project**
|
|
190
|
-
\`\`\`bash
|
|
191
|
-
kosui plugin-project --name my-plugin
|
|
192
|
-
\`\`\`
|
|
193
|
-
|
|
194
|
-
2. **Add Components**
|
|
195
|
-
\`\`\`bash
|
|
196
|
-
kosui component --name MyComponent --pluginType utility --project my-plugin
|
|
197
|
-
\`\`\`
|
|
198
|
-
|
|
199
|
-
3. **Update Plugin Descriptor**
|
|
200
|
-
Add contributions to your \`kosdev-plugin.json\` file following the structure examples above.
|
|
201
|
-
|
|
202
|
-
4. **Test Integration**
|
|
203
|
-
Use the Plugin Explorer (Ctrl+Shift+P) to validate your plugin registration.
|
|
204
|
-
|
|
205
|
-
### Best Practices
|
|
206
|
-
|
|
207
|
-
- **Use descriptive IDs**: Plugin and contribution IDs should be clear and unique
|
|
208
|
-
- **Follow naming conventions**: Use kebab-case for IDs, PascalCase for components
|
|
209
|
-
- **Provide meaningful titles**: Titles are shown to users in the interface
|
|
210
|
-
- **Set appropriate ranks**: Higher numbers = higher priority for rankable contributions
|
|
211
|
-
- **Include proper metadata**: Namespace helps organize plugins by owner
|
|
212
|
-
|
|
213
|
-
### Validation
|
|
214
|
-
|
|
215
|
-
Use the Plugin Discovery Service to validate your plugin descriptor:
|
|
216
|
-
|
|
217
|
-
\`\`\`typescript
|
|
218
|
-
import { PluginDiscoveryService } from '@kosdev-code/kos-ui-plugin';
|
|
219
|
-
|
|
220
|
-
const validation = PluginDiscoveryService.validatePluginDescriptor(yourDescriptor);
|
|
221
|
-
console.log(validation.errors); // Check for errors
|
|
222
|
-
console.log(validation.warnings); // Check for warnings
|
|
223
|
-
\`\`\`
|
|
224
|
-
|
|
225
|
-
`}static generateTroubleshootingSection(){return`## Troubleshooting
|
|
226
|
-
|
|
227
|
-
### Common Issues
|
|
228
|
-
|
|
229
|
-
**Plugin not appearing in extension point**
|
|
230
|
-
- Check plugin descriptor syntax
|
|
231
|
-
- Verify contribution key matches extension point requirements
|
|
232
|
-
- Ensure experienceId references exist in experiences section
|
|
233
|
-
|
|
234
|
-
**Component fails to load**
|
|
235
|
-
- Verify component path in experience location
|
|
236
|
-
- Check module federation configuration
|
|
237
|
-
- Use Plugin Explorer to see detailed error messages
|
|
238
|
-
|
|
239
|
-
**Type errors with simplified extension points**
|
|
240
|
-
- Ensure extension point is properly imported
|
|
241
|
-
- Check that component props match expected interface
|
|
242
|
-
- Verify extension point is registered before use
|
|
243
|
-
|
|
244
|
-
### Debugging Tools
|
|
245
|
-
|
|
246
|
-
**Plugin Explorer**
|
|
247
|
-
- Press Ctrl+Shift+P in development mode
|
|
248
|
-
- View all extension points and their plugins
|
|
249
|
-
- See plugin health status and capabilities
|
|
250
|
-
- Test component rendering with error boundaries
|
|
251
|
-
|
|
252
|
-
**Validation Service**
|
|
253
|
-
- Use \`PluginDiscoveryService.validatePluginDescriptor()\`
|
|
254
|
-
- Check \`PluginDiscoveryService.checkPluginCompatibility()\`
|
|
255
|
-
- Run \`PluginDiscoveryService.analyzePluginDescriptor()\` for full analysis
|
|
256
|
-
|
|
257
|
-
**Browser DevTools**
|
|
258
|
-
- Check \`window.KosPlugins.extensions\` for runtime state
|
|
259
|
-
- Look for module federation errors in Network tab
|
|
260
|
-
- Use React DevTools to inspect component loading
|
|
261
|
-
|
|
262
|
-
---
|
|
263
|
-
|
|
264
|
-
*Generated by KOS Plugin Documentation Generator*
|
|
265
|
-
`}static getExtensionPointImportName(t){var a;const i=y().getExtensionPoint(t);if((a=i==null?void 0:i.config.metadata)!=null&&a.exportName)return i.config.metadata.exportName;const s=t.split(".");return(s.length>1?s.slice(1):s).map(r=>r.split("-").map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("")+"Extension"}static getExtensionPointTypeName(t){return this.getExtensionPointImportName(t)+"Type"}static getHealthEmoji(t){switch(t){case"healthy":return"✅";case"warning":return"⚠️";case"error":return"❌";default:return"❓"}}static inferContributionKey(t){if(t.source==="simplified"){const a=y().getExtensionPoint(t.id);if(a!=null&&a.config.contributionKey)return a.config.contributionKey}const e=t.id.split("."),i=e[e.length-1];return{cui:"cui",utility:"utilities",utilities:"utilities",setup:"setupStep",settings:"settings",nav:"navViews",troubleAction:"troubleActions",controlPour:"controlPour"}[i]||i+"s"}static isViewBasedExtensionPoint(t){if(t.source==="simplified"){const i=y().getExtensionPoint(t.id);return(i==null?void 0:i.config.hasView)||!1}return t.plugins.some(e=>e.experienceId)}static isRankableExtensionPoint(t){if(t.source==="simplified"){const i=y().getExtensionPoint(t.id);return(i==null?void 0:i.config.isRankable)||!1}return t.plugins.some(e=>typeof e.rank=="number")}static getSchemaFieldsForContribution(t){if(t.source!=="simplified")return[];const i=y().getExtensionPoint(t.id);return i!=null&&i.getSchemaFieldInfo?i.getSchemaFieldInfo():[]}static getSpecificFields(t){const e=[];switch(this.inferContributionKey(t)){case"utilities":e.push('"utilDescriptor": "your-util-descriptor"');break;case"setupStep":e.push('"setupDescriptor": "your-setup-descriptor"');break;case"settings":e.push('"settingsGroup": "your-settings-group"');break;case"navViews":e.push('"navDescriptor": "your-nav-descriptor"');break;case"troubleActions":e.push('"troubleType": "your-trouble-type"');break;case"cui":e.push('"cuiDescriptor": "your-cui-descriptor"');break}return e}}exports.BaseViewExtensionSchema=T;exports.DocumentationGenerator=Ue;exports.PluginDiscoveryService=k;exports.RankableViewExtensionSchema=L;exports.contributionReducer=N;exports.createExtensionSchema=Te;exports.createViewAwareTransform=A;exports.defineExtensionPoint=j;exports.getContributions=K;exports.getExtensionPointRegistry=y;exports.getExtensions=ke;exports.getValidationResults=ne;exports.index=Q;exports.initPluginManager=V;exports.initializeKosPlugins=Ie;exports.loadExtensions=M;exports.mf=P;exports.registry=_;exports.resolveBestExtension=Se;exports.validateDescriptorFormat=_e;exports.validateRank=q;exports.validateRankIfPresent=De;exports.validateWithSchema=Fe;
|
|
266
|
-
//# sourceMappingURL=documentation-generator-Blyj8V7Z.cjs.map
|