everything-dev 1.32.0 → 1.33.1
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/dist/config.cjs +18 -3
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +18 -3
- package/dist/config.mjs.map +1 -1
- package/dist/contract.d.cts +9 -9
- package/dist/contract.d.mts +9 -9
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/plugin.d.cts +12 -12
- package/dist/plugin.d.mts +12 -12
- package/dist/service-descriptor.cjs.map +1 -1
- package/dist/service-descriptor.d.cts +2 -2
- package/dist/service-descriptor.d.cts.map +1 -1
- package/dist/service-descriptor.d.mts +2 -2
- package/dist/service-descriptor.d.mts.map +1 -1
- package/dist/service-descriptor.mjs.map +1 -1
- package/dist/types.cjs +16 -5
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +21 -14
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +21 -14
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +15 -6
- package/dist/types.mjs.map +1 -1
- package/dist/ui/head.cjs +7 -11
- package/dist/ui/head.cjs.map +1 -1
- package/dist/ui/head.d.cts +1 -3
- package/dist/ui/head.d.cts.map +1 -1
- package/dist/ui/head.d.mts +1 -3
- package/dist/ui/head.d.mts.map +1 -1
- package/dist/ui/head.mjs +8 -11
- package/dist/ui/head.mjs.map +1 -1
- package/dist/ui/index.cjs +0 -1
- package/dist/ui/index.d.cts +2 -2
- package/dist/ui/index.d.mts +2 -2
- package/dist/ui/index.mjs +2 -2
- package/dist/ui/types.d.cts +0 -2
- package/dist/ui/types.d.cts.map +1 -1
- package/dist/ui/types.d.mts +0 -2
- package/dist/ui/types.d.mts.map +1 -1
- package/package.json +1 -1
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import * as z from \"zod\";\n\nexport const ExtendsSchema = z.union([\n z.string(),\n z.object({\n development: z.string().optional(),\n production: z.string().optional(),\n staging: z.string().optional(),\n }),\n]);\nexport type Extends = z.infer<typeof ExtendsSchema>;\nexport type ExtendsConfig = Extract<Extends, Record<string, string | undefined>>;\n\nexport const SourceModeSchema = z.enum([\"local\", \"remote\"]);\nexport type SourceMode = z.infer<typeof SourceModeSchema>;\n\nexport const SharedConfigSchema = z.object({\n version: z.string(),\n requiredVersion: z.string().optional(),\n singleton: z.boolean().optional(),\n eager: z.boolean().optional(),\n strictVersion: z.boolean().optional(),\n shareScope: z.string().optional(),\n});\nexport type SharedConfig = z.infer<typeof SharedConfigSchema>;\nexport type SharedDepConfig = SharedConfig;\nexport const SharedDepConfigSchema = SharedConfigSchema;\n\nexport const FederationEntrySchema = z.object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n source: SourceModeSchema,\n integrity: z.string().optional(),\n});\nexport type FederationEntry = z.infer<typeof FederationEntrySchema>;\n\nexport const SidebarRoleSchema = z.enum([\"anon\", \"member\", \"admin\"]);\nexport type SidebarRole = z.infer<typeof SidebarRoleSchema>;\n\nexport const SidebarItemSchema = z.object({\n icon: z.string(),\n label: z.string(),\n to: z.string().optional(),\n roleRequired: SidebarRoleSchema.optional(),\n});\nexport type SidebarItem = z.infer<typeof SidebarItemSchema>;\n\nexport const ComposableAppEntrySchema = z.object({\n extends: ExtendsSchema.optional(),\n name: z.string().optional(),\n development: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n proxy: z.string().optional(),\n variables: z.record(z.string(), z.string()).optional(),\n secrets: z.array(z.string()).optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n routes: z.array(z.string()).optional(),\n});\nexport type ComposableAppEntry = z.infer<typeof ComposableAppEntrySchema>;\n\nexport const ApiPluginConfigSchema = ComposableAppEntrySchema;\nexport type ApiPluginConfig = z.infer<typeof ApiPluginConfigSchema>;\n\nexport const PluginUiConfigSchema = z.object({\n name: z.string(),\n development: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n});\nexport type PluginUiConfig = z.infer<typeof PluginUiConfigSchema>;\n\nexport const BosPluginRefSchema = ComposableAppEntrySchema.extend({\n version: z.string().optional(),\n app: z.record(z.string(), z.unknown()).optional(),\n shared: z.record(z.string(), z.record(z.string(), SharedConfigSchema)).optional(),\n plugins: z.record(z.string(), z.unknown()).optional(),\n});\nexport type BosPluginRef = z.infer<typeof BosPluginRefSchema>;\nexport type PluginEntryValue = string | BosPluginRef;\nexport type PluginEntries = Record<string, PluginEntryValue>;\n\nconst PluginRuntimeUiSchema = z.object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n source: SourceModeSchema,\n localPath: z.string().optional(),\n port: z.number().optional(),\n integrity: z.string().optional(),\n});\nexport type PluginRuntimeUi = z.infer<typeof PluginRuntimeUiSchema>;\n\nexport const RuntimePluginConfigSchema = z.object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n source: SourceModeSchema,\n localPath: z.string().optional(),\n port: z.number().optional(),\n proxy: z.string().optional(),\n variables: z.record(z.string(), z.string()).optional(),\n secrets: z.array(z.string()).optional(),\n integrity: z.string().optional(),\n ui: PluginRuntimeUiSchema.optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n routes: z.array(z.string()).optional(),\n});\nexport type RuntimePluginConfig = z.infer<typeof RuntimePluginConfigSchema>;\n\nexport const UiConfigSchema = z.object({\n name: z.string().optional(),\n development: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n ssr: z.string().optional(),\n ssrIntegrity: z.string().optional(),\n});\nexport type UiConfig = z.infer<typeof UiConfigSchema>;\n\nexport const HostConfigSchema = z.object({\n development: z.string(),\n production: z.string(),\n integrity: z.string().optional(),\n secrets: z.array(z.string()).optional(),\n});\nexport type HostConfig = z.infer<typeof HostConfigSchema>;\n\nexport const ClientRuntimeInfoSchema = z.object({\n accountId: z.string(),\n gatewayId: z.string(),\n runtimeBasePath: z.string(),\n title: z.string().nullable(),\n description: z.string().nullable(),\n hostUrl: z.string().nullable(),\n});\nexport type ClientRuntimeInfo = z.infer<typeof ClientRuntimeInfoSchema>;\n\nexport const RuntimeLineageSchema = z.object({\n parent: z.string().nullable(),\n root: z.string().nullable(),\n depth: z.number().int().nonnegative(),\n extendsChain: z.array(z.string()),\n});\nexport type RuntimeLineage = z.infer<typeof RuntimeLineageSchema>;\n\nexport const BosStagingSchema = z.object({\n domain: z.string(),\n});\nexport type BosStaging = z.infer<typeof BosStagingSchema>;\n\nconst BosConfigInputAppEntrySchema = z.record(z.string(), z.unknown());\nexport type BosConfigInputAppEntry = z.infer<typeof BosConfigInputAppEntrySchema>;\n\nexport const BosConfigInputSchema: z.ZodType<BosConfigInput> = z.lazy(() =>\n z.object({\n extends: ExtendsSchema.optional(),\n account: z.string().optional(),\n domain: z.string().optional(),\n testnet: z.string().optional(),\n template: z.string().optional(),\n gateway: z\n .object({\n development: z.string().optional(),\n production: z.string().optional(),\n account: z.string().optional(),\n })\n .optional(),\n development: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n name: z.string().optional(),\n version: z.string().optional(),\n proxy: z.string().optional(),\n variables: z.record(z.string(), z.string()).optional(),\n secrets: z.array(z.string()).optional(),\n routes: z.array(z.string()).optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n app: z.record(z.string(), BosConfigInputAppEntrySchema).optional(),\n shared: z.record(z.string(), z.record(z.string(), SharedConfigSchema)).optional(),\n plugins: z.record(z.string(), z.union([z.string(), BosConfigInputSchema])).optional(),\n ci: CiConfigSchema.optional(),\n }),\n);\n\nexport interface BosConfigInput {\n extends?: string | ExtendsConfig;\n account?: string;\n domain?: string;\n title?: string;\n description?: string;\n testnet?: string;\n template?: string;\n gateway?: {\n development?: string;\n production?: string;\n account?: string;\n };\n development?: string;\n production?: string;\n integrity?: string;\n name?: string;\n version?: string;\n proxy?: string;\n variables?: Record<string, string>;\n secrets?: string[];\n routes?: string[];\n sidebar?: SidebarItem[];\n app?: Record<string, BosConfigInputAppEntry>;\n shared?: Record<string, Record<string, SharedDepConfig>>;\n plugins?: Record<string, string | BosConfigInput>;\n ci?: CiConfig;\n}\n\nexport const RailwayCiSchema = z.object({\n service: z.string(),\n});\nexport type RailwayCi = z.infer<typeof RailwayCiSchema>;\n\nexport const CiConfigSchema = z.object({\n railway: RailwayCiSchema.optional(),\n});\nexport type CiConfig = z.infer<typeof CiConfigSchema>;\n\nexport const BosConfigSchema = z.object({\n account: z.string(),\n extends: ExtendsSchema.optional(),\n domain: z.string().optional(),\n title: z.string().optional(),\n description: z.string().optional(),\n testnet: z.string().optional(),\n staging: BosStagingSchema.optional(),\n repository: z.string().optional(),\n ci: CiConfigSchema.optional(),\n shared: z.record(z.string(), z.record(z.string(), SharedConfigSchema)).optional(),\n plugins: z.record(z.string(), z.union([z.string(), BosPluginRefSchema])).optional(),\n app: z.object({\n host: HostConfigSchema,\n ui: UiConfigSchema,\n api: ComposableAppEntrySchema,\n auth: ComposableAppEntrySchema.optional(),\n }),\n});\nexport type BosConfig = z.infer<typeof BosConfigSchema>;\n\nexport const RuntimeConfigSchema = z.object({\n env: z.enum([\"development\", \"production\", \"staging\"]),\n account: z.string(),\n domain: z.string().optional(),\n networkId: z.enum([\"mainnet\", \"testnet\"]),\n title: z.string().optional(),\n description: z.string().optional(),\n repository: z.string().optional(),\n host: FederationEntrySchema.extend({\n localPath: z.string().optional(),\n port: z.number().optional(),\n secrets: z.array(z.string()).optional(),\n remoteUrl: z.string().optional(),\n }),\n shared: z\n .object({\n ui: z.record(z.string(), SharedConfigSchema).optional(),\n plugins: z.record(z.string(), SharedConfigSchema).optional(),\n })\n .optional(),\n ui: FederationEntrySchema.extend({\n localPath: z.string().optional(),\n port: z.number().optional(),\n ssrUrl: z.string().optional(),\n ssrIntegrity: z.string().optional(),\n }),\n api: FederationEntrySchema.extend({\n localPath: z.string().optional(),\n port: z.number().optional(),\n proxy: z.string().optional(),\n variables: z.record(z.string(), z.string()).optional(),\n secrets: z.array(z.string()).optional(),\n }),\n auth: FederationEntrySchema.extend({\n localPath: z.string().optional(),\n port: z.number().optional(),\n proxy: z.string().optional(),\n variables: z.record(z.string(), z.string()).optional(),\n secrets: z.array(z.string()).optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n }).optional(),\n plugins: z.record(z.string(), RuntimePluginConfigSchema).optional(),\n});\nexport type RuntimeConfig = z.infer<typeof RuntimeConfigSchema>;\n\nexport const ClientRuntimeConfigSchema = z.object({\n env: z.enum([\"development\", \"production\", \"staging\"]),\n account: z.string(),\n networkId: z.enum([\"mainnet\", \"testnet\"]),\n hostUrl: z.string().optional(),\n assetsUrl: z.string(),\n apiBase: z.string(),\n rpcBase: z.string(),\n repository: z.string().optional(),\n authAvailable: z.boolean().optional(),\n runtime: ClientRuntimeInfoSchema.optional(),\n ui: z\n .object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n integrity: z.string().optional(),\n })\n .optional(),\n api: z\n .object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n integrity: z.string().optional(),\n })\n .optional(),\n auth: z\n .object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n integrity: z.string().optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n })\n .optional(),\n plugins: z\n .record(\n z.string(),\n z.object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n integrity: z.string().optional(),\n ui: z\n .object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n source: SourceModeSchema,\n integrity: z.string().optional(),\n })\n .optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n }),\n )\n .optional(),\n});\nexport type ClientRuntimeConfig = z.infer<typeof ClientRuntimeConfigSchema>;\n"],"mappings":";;;AAEA,MAAa,gBAAgB,EAAE,MAAM,CACnC,EAAE,QAAQ,EACV,EAAE,OAAO;CACP,aAAa,EAAE,QAAQ,CAA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\nexport type JsonPrimitive = string | number | boolean | null;\nexport interface JsonObject {\n [key: string]: JsonValue;\n}\nexport type JsonValue = JsonPrimitive | JsonObject | JsonValue[];\n\nexport const JsonValueSchema: z.ZodType<JsonValue> = z.lazy(() =>\n z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.array(JsonValueSchema),\n z.record(z.string(), JsonValueSchema),\n ]),\n);\nexport const JsonObjectSchema = z.record(z.string(), JsonValueSchema);\n\nexport const ExtendsSchema = z.union([\n z.string(),\n z.object({\n development: z.string().optional(),\n production: z.string().optional(),\n staging: z.string().optional(),\n }),\n]);\nexport type Extends = z.infer<typeof ExtendsSchema>;\nexport type ExtendsConfig = Extract<Extends, Record<string, string | undefined>>;\n\nexport const SourceModeSchema = z.enum([\"local\", \"remote\"]);\nexport type SourceMode = z.infer<typeof SourceModeSchema>;\n\nexport const SharedConfigSchema = z.object({\n version: z.string(),\n requiredVersion: z.string().optional(),\n singleton: z.boolean().optional(),\n eager: z.boolean().optional(),\n strictVersion: z.boolean().optional(),\n shareScope: z.string().optional(),\n});\nexport type SharedConfig = z.infer<typeof SharedConfigSchema>;\nexport type SharedDepConfig = SharedConfig;\nexport const SharedDepConfigSchema = SharedConfigSchema;\n\nexport const FederationEntrySchema = z.object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n source: SourceModeSchema,\n integrity: z.string().optional(),\n});\nexport type FederationEntry = z.infer<typeof FederationEntrySchema>;\n\nexport const SidebarRoleSchema = z.enum([\"anon\", \"member\", \"admin\"]);\nexport type SidebarRole = z.infer<typeof SidebarRoleSchema>;\n\nexport const SidebarItemSchema = z.object({\n icon: z.string(),\n label: z.string(),\n to: z.string().optional(),\n roleRequired: SidebarRoleSchema.optional(),\n});\nexport type SidebarItem = z.infer<typeof SidebarItemSchema>;\n\nexport const ComposableAppEntrySchema = z.object({\n extends: ExtendsSchema.optional(),\n name: z.string().optional(),\n development: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n proxy: z.string().optional(),\n variables: JsonObjectSchema.optional(),\n secrets: z.array(z.string()).optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n routes: z.array(z.string()).optional(),\n});\nexport type ComposableAppEntry = z.infer<typeof ComposableAppEntrySchema>;\n\nexport const ApiPluginConfigSchema = ComposableAppEntrySchema;\nexport type ApiPluginConfig = z.infer<typeof ApiPluginConfigSchema>;\n\nexport const PluginUiConfigSchema = z.object({\n name: z.string(),\n development: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n});\nexport type PluginUiConfig = z.infer<typeof PluginUiConfigSchema>;\n\nexport const BosPluginRefSchema = ComposableAppEntrySchema.extend({\n version: z.string().optional(),\n app: z.record(z.string(), z.unknown()).optional(),\n shared: z.record(z.string(), z.record(z.string(), SharedConfigSchema)).optional(),\n plugins: z.record(z.string(), z.unknown()).optional(),\n});\nexport type BosPluginRef = z.infer<typeof BosPluginRefSchema>;\nexport type PluginEntryValue = string | BosPluginRef;\nexport type PluginEntries = Record<string, PluginEntryValue>;\n\nconst PluginRuntimeUiSchema = z.object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n source: SourceModeSchema,\n localPath: z.string().optional(),\n port: z.number().optional(),\n integrity: z.string().optional(),\n});\nexport type PluginRuntimeUi = z.infer<typeof PluginRuntimeUiSchema>;\n\nexport const RuntimePluginConfigSchema = z.object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n source: SourceModeSchema,\n localPath: z.string().optional(),\n port: z.number().optional(),\n proxy: z.string().optional(),\n variables: JsonObjectSchema.optional(),\n secrets: z.array(z.string()).optional(),\n integrity: z.string().optional(),\n ui: PluginRuntimeUiSchema.optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n routes: z.array(z.string()).optional(),\n});\nexport type RuntimePluginConfig = z.infer<typeof RuntimePluginConfigSchema>;\n\nexport const UiConfigSchema = z.object({\n name: z.string().optional(),\n development: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n ssr: z.string().optional(),\n ssrIntegrity: z.string().optional(),\n});\nexport type UiConfig = z.infer<typeof UiConfigSchema>;\n\nexport const HostConfigSchema = z.object({\n development: z.string(),\n production: z.string(),\n integrity: z.string().optional(),\n secrets: z.array(z.string()).optional(),\n});\nexport type HostConfig = z.infer<typeof HostConfigSchema>;\n\nexport const ClientRuntimeInfoSchema = z.object({\n accountId: z.string(),\n gatewayId: z.string(),\n runtimeBasePath: z.string(),\n title: z.string().nullable(),\n description: z.string().nullable(),\n hostUrl: z.string().nullable(),\n});\nexport type ClientRuntimeInfo = z.infer<typeof ClientRuntimeInfoSchema>;\n\nexport const RuntimeLineageSchema = z.object({\n parent: z.string().nullable(),\n root: z.string().nullable(),\n depth: z.number().int().nonnegative(),\n extendsChain: z.array(z.string()),\n});\nexport type RuntimeLineage = z.infer<typeof RuntimeLineageSchema>;\n\nexport const BosStagingSchema = z.object({\n domain: z.string(),\n});\nexport type BosStaging = z.infer<typeof BosStagingSchema>;\n\nconst BosConfigInputAppEntrySchema = z.record(z.string(), z.unknown());\nexport type BosConfigInputAppEntry = z.infer<typeof BosConfigInputAppEntrySchema>;\n\nexport const BosConfigInputSchema: z.ZodType<BosConfigInput> = z.lazy(() =>\n z.object({\n extends: ExtendsSchema.optional(),\n account: z.string().optional(),\n domain: z.string().optional(),\n testnet: z.string().optional(),\n template: z.string().optional(),\n gateway: z\n .object({\n development: z.string().optional(),\n production: z.string().optional(),\n account: z.string().optional(),\n })\n .optional(),\n development: z.string().optional(),\n production: z.string().optional(),\n integrity: z.string().optional(),\n name: z.string().optional(),\n version: z.string().optional(),\n proxy: z.string().optional(),\n variables: JsonObjectSchema.optional(),\n secrets: z.array(z.string()).optional(),\n routes: z.array(z.string()).optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n app: z.record(z.string(), BosConfigInputAppEntrySchema).optional(),\n shared: z.record(z.string(), z.record(z.string(), SharedConfigSchema)).optional(),\n plugins: z.record(z.string(), z.union([z.string(), BosConfigInputSchema])).optional(),\n ci: CiConfigSchema.optional(),\n }),\n);\n\nexport interface BosConfigInput {\n extends?: string | ExtendsConfig;\n account?: string;\n domain?: string;\n title?: string;\n description?: string;\n testnet?: string;\n template?: string;\n gateway?: {\n development?: string;\n production?: string;\n account?: string;\n };\n development?: string;\n production?: string;\n integrity?: string;\n name?: string;\n version?: string;\n proxy?: string;\n variables?: JsonObject;\n secrets?: string[];\n routes?: string[];\n sidebar?: SidebarItem[];\n app?: Record<string, BosConfigInputAppEntry>;\n shared?: Record<string, Record<string, SharedDepConfig>>;\n plugins?: Record<string, string | BosConfigInput>;\n ci?: CiConfig;\n}\n\nexport const RailwayCiSchema = z.object({\n service: z.string(),\n});\nexport type RailwayCi = z.infer<typeof RailwayCiSchema>;\n\nexport const CiConfigSchema = z.object({\n railway: RailwayCiSchema.optional(),\n});\nexport type CiConfig = z.infer<typeof CiConfigSchema>;\n\nexport const BosConfigSchema = z.object({\n account: z.string(),\n extends: ExtendsSchema.optional(),\n domain: z.string().optional(),\n title: z.string().optional(),\n description: z.string().optional(),\n testnet: z.string().optional(),\n staging: BosStagingSchema.optional(),\n repository: z.string().optional(),\n ci: CiConfigSchema.optional(),\n shared: z.record(z.string(), z.record(z.string(), SharedConfigSchema)).optional(),\n plugins: z.record(z.string(), z.union([z.string(), BosPluginRefSchema])).optional(),\n app: z.object({\n host: HostConfigSchema,\n ui: UiConfigSchema,\n api: ComposableAppEntrySchema,\n auth: ComposableAppEntrySchema.optional(),\n }),\n});\nexport type BosConfig = z.infer<typeof BosConfigSchema>;\n\nexport const RuntimeConfigSchema = z.object({\n env: z.enum([\"development\", \"production\", \"staging\"]),\n account: z.string(),\n domain: z.string().optional(),\n networkId: z.enum([\"mainnet\", \"testnet\"]),\n title: z.string().optional(),\n description: z.string().optional(),\n repository: z.string().optional(),\n host: FederationEntrySchema.extend({\n localPath: z.string().optional(),\n port: z.number().optional(),\n secrets: z.array(z.string()).optional(),\n remoteUrl: z.string().optional(),\n }),\n shared: z\n .object({\n ui: z.record(z.string(), SharedConfigSchema).optional(),\n plugins: z.record(z.string(), SharedConfigSchema).optional(),\n })\n .optional(),\n ui: FederationEntrySchema.extend({\n localPath: z.string().optional(),\n port: z.number().optional(),\n ssrUrl: z.string().optional(),\n ssrIntegrity: z.string().optional(),\n }),\n api: FederationEntrySchema.extend({\n localPath: z.string().optional(),\n port: z.number().optional(),\n proxy: z.string().optional(),\n variables: JsonObjectSchema.optional(),\n secrets: z.array(z.string()).optional(),\n }),\n auth: FederationEntrySchema.extend({\n localPath: z.string().optional(),\n port: z.number().optional(),\n proxy: z.string().optional(),\n variables: JsonObjectSchema.optional(),\n secrets: z.array(z.string()).optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n }).optional(),\n plugins: z.record(z.string(), RuntimePluginConfigSchema).optional(),\n});\nexport type RuntimeConfig = z.infer<typeof RuntimeConfigSchema>;\n\nexport const ClientRuntimeConfigSchema = z.object({\n env: z.enum([\"development\", \"production\", \"staging\"]),\n account: z.string(),\n networkId: z.enum([\"mainnet\", \"testnet\"]),\n hostUrl: z.string().optional(),\n assetsUrl: z.string(),\n apiBase: z.string(),\n rpcBase: z.string(),\n repository: z.string().optional(),\n authAvailable: z.boolean().optional(),\n runtime: ClientRuntimeInfoSchema.optional(),\n ui: z\n .object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n integrity: z.string().optional(),\n })\n .optional(),\n api: z\n .object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n integrity: z.string().optional(),\n })\n .optional(),\n auth: z\n .object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n integrity: z.string().optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n })\n .optional(),\n plugins: z\n .record(\n z.string(),\n z.object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n integrity: z.string().optional(),\n ui: z\n .object({\n name: z.string(),\n url: z.string(),\n entry: z.string(),\n source: SourceModeSchema,\n integrity: z.string().optional(),\n })\n .optional(),\n sidebar: z.array(SidebarItemSchema).optional(),\n }),\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,UAAU;GACjC,CAAC,CACD,UAAU;EACb,SAAS,EAAE,MAAM,kBAAkB,CAAC,UAAU;EAC/C,CAAC,CACH,CACA,UAAU;CACd,CAAC"}
|
package/dist/ui/head.cjs
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
3
|
//#region src/ui/head.ts
|
|
4
|
-
function getRemoteEntryScript(assetsUrl, integrity) {
|
|
5
|
-
const script = { src: `${assetsUrl}/remoteEntry.js` };
|
|
6
|
-
if (integrity) {
|
|
7
|
-
script.integrity = integrity;
|
|
8
|
-
script.crossOrigin = "anonymous";
|
|
9
|
-
}
|
|
10
|
-
return script;
|
|
11
|
-
}
|
|
12
4
|
function getThemeInitScript() {
|
|
13
5
|
return { children: "(function(){var t=localStorage.getItem('theme');if(t==='dark'||(!t&&window.matchMedia('(prefers-color-scheme: dark)').matches)){document.documentElement.classList.add('dark');}})();" };
|
|
14
6
|
}
|
|
@@ -41,9 +33,14 @@ function getHydrateScript(runtimeConfig, containerName = "ui", hydratePath = "./
|
|
|
41
33
|
`.trim() };
|
|
42
34
|
}
|
|
43
35
|
function getRemoteScripts(options) {
|
|
44
|
-
const {
|
|
36
|
+
const { runtimeConfig, containerName, hydratePath, integrity } = options;
|
|
37
|
+
const entryScript = { src: integrity ? `/remoteEntry.js?v=${encodeURIComponent(integrity)}` : "/remoteEntry.js" };
|
|
38
|
+
if (integrity) {
|
|
39
|
+
entryScript.integrity = integrity;
|
|
40
|
+
entryScript.crossOrigin = "anonymous";
|
|
41
|
+
}
|
|
45
42
|
return [
|
|
46
|
-
|
|
43
|
+
entryScript,
|
|
47
44
|
getThemeInitScript(),
|
|
48
45
|
getHydrateScript(runtimeConfig, containerName, hydratePath)
|
|
49
46
|
];
|
|
@@ -61,7 +58,6 @@ body { min-height: 100%; min-height: 100dvh; margin: 0; background-color: var(--
|
|
|
61
58
|
//#endregion
|
|
62
59
|
exports.getBaseStyles = getBaseStyles;
|
|
63
60
|
exports.getHydrateScript = getHydrateScript;
|
|
64
|
-
exports.getRemoteEntryScript = getRemoteEntryScript;
|
|
65
61
|
exports.getRemoteScripts = getRemoteScripts;
|
|
66
62
|
exports.getThemeInitScript = getThemeInitScript;
|
|
67
63
|
//# sourceMappingURL=head.cjs.map
|
package/dist/ui/head.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head.cjs","names":[],"sources":["../../src/ui/head.ts"],"sourcesContent":["import type { ClientRuntimeConfig } from \"../types\";\nimport type { HeadScript } from \"./types\";\n\nexport interface RemoteScriptsOptions {\n
|
|
1
|
+
{"version":3,"file":"head.cjs","names":[],"sources":["../../src/ui/head.ts"],"sourcesContent":["import type { ClientRuntimeConfig } from \"../types\";\nimport type { HeadScript } from \"./types\";\n\nexport interface RemoteScriptsOptions {\n runtimeConfig?: Partial<ClientRuntimeConfig>;\n containerName?: string;\n hydratePath?: string;\n integrity?: string;\n}\n\nexport function getThemeInitScript(): HeadScript {\n return {\n children:\n \"(function(){var t=localStorage.getItem('theme');if(t==='dark'||(!t&&window.matchMedia('(prefers-color-scheme: dark)').matches)){document.documentElement.classList.add('dark');}})();\",\n };\n}\n\nexport function getHydrateScript(\n runtimeConfig: Partial<ClientRuntimeConfig> | undefined,\n containerName = \"ui\",\n hydratePath = \"./Hydrate\",\n): HeadScript {\n return {\n children: `\n window.__RUNTIME_CONFIG__=${JSON.stringify(runtimeConfig)};\n function __hydrate(){\n var container = window['${containerName}'];\n if (!container) {\n console.warn('[Hydrate] Container not ready yet, waiting...');\n window.__hydrateRetry = window.__hydrateRetry || 0;\n if (window.__hydrateRetry < 10) {\n window.__hydrateRetry++;\n setTimeout(__hydrate, 100);\n return;\n }\n console.error('[Hydrate] Container not found after 10 retries');\n return;\n }\n console.log('[Hydrate] Container available, starting init...');\n container.init({}).then(function(){\n return container.get('${hydratePath}');\n }).then(function(mod){\n return mod().hydrate();\n }).catch(function(e){\n console.error('[Hydrate] Failed:', e);\n });\n }\n if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',__hydrate);}else{__hydrate();}\n \t\t`.trim(),\n };\n}\n\nexport function getRemoteScripts(options: RemoteScriptsOptions): HeadScript[] {\n const { runtimeConfig, containerName, hydratePath, integrity } = options;\n const entryScript: HeadScript = {\n src: integrity ? `/remoteEntry.js?v=${encodeURIComponent(integrity)}` : \"/remoteEntry.js\",\n };\n if (integrity) {\n entryScript.integrity = integrity;\n entryScript.crossOrigin = \"anonymous\";\n }\n return [\n entryScript,\n getThemeInitScript(),\n getHydrateScript(runtimeConfig, containerName, hydratePath),\n ];\n}\n\nexport function getBaseStyles(): string {\n return `\n*, *::before, *::after { box-sizing: border-box; }\nhtml { height: 100%; height: 100dvh; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: light dark; }\nbody { min-height: 100%; min-height: 100dvh; margin: 0; background-color: var(--background); color: var(--foreground); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }\n#root { min-height: 100vh; }\n@supports (min-height: 100dvh) { #root { min-height: 100dvh; } }\n `.trim();\n}\n"],"mappings":";;;AAUA,SAAgB,qBAAiC;AAC/C,QAAO,EACL,UACE,yLACH;;AAGH,SAAgB,iBACd,eACA,gBAAgB,MAChB,cAAc,aACF;AACZ,QAAO,EACL,UAAU;6BACe,KAAK,UAAU,cAAc,CAAC;;4BAE/B,cAAc;;;;;;;;;;;;;;4BAcd,YAAY;;;;;;;;KAQnC,MAAM,EACR;;AAGH,SAAgB,iBAAiB,SAA6C;CAC5E,MAAM,EAAE,eAAe,eAAe,aAAa,cAAc;CACjE,MAAM,cAA0B,EAC9B,KAAK,YAAY,qBAAqB,mBAAmB,UAAU,KAAK,mBACzE;AACD,KAAI,WAAW;AACb,cAAY,YAAY;AACxB,cAAY,cAAc;;AAE5B,QAAO;EACL;EACA,oBAAoB;EACpB,iBAAiB,eAAe,eAAe,YAAY;EAC5D;;AAGH,SAAgB,gBAAwB;AACtC,QAAO;;;;;;IAML,MAAM"}
|
package/dist/ui/head.d.cts
CHANGED
|
@@ -3,17 +3,15 @@ import { HeadScript } from "./types.cjs";
|
|
|
3
3
|
|
|
4
4
|
//#region src/ui/head.d.ts
|
|
5
5
|
interface RemoteScriptsOptions {
|
|
6
|
-
assetsUrl: string;
|
|
7
6
|
runtimeConfig?: Partial<ClientRuntimeConfig>;
|
|
8
7
|
containerName?: string;
|
|
9
8
|
hydratePath?: string;
|
|
10
9
|
integrity?: string;
|
|
11
10
|
}
|
|
12
|
-
declare function getRemoteEntryScript(assetsUrl: string, integrity?: string): HeadScript;
|
|
13
11
|
declare function getThemeInitScript(): HeadScript;
|
|
14
12
|
declare function getHydrateScript(runtimeConfig: Partial<ClientRuntimeConfig> | undefined, containerName?: string, hydratePath?: string): HeadScript;
|
|
15
13
|
declare function getRemoteScripts(options: RemoteScriptsOptions): HeadScript[];
|
|
16
14
|
declare function getBaseStyles(): string;
|
|
17
15
|
//#endregion
|
|
18
|
-
export { RemoteScriptsOptions, getBaseStyles, getHydrateScript,
|
|
16
|
+
export { RemoteScriptsOptions, getBaseStyles, getHydrateScript, getRemoteScripts, getThemeInitScript };
|
|
19
17
|
//# sourceMappingURL=head.d.cts.map
|
package/dist/ui/head.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head.d.cts","names":[],"sources":["../../src/ui/head.ts"],"mappings":";;;;UAGiB,oBAAA;EACf,
|
|
1
|
+
{"version":3,"file":"head.d.cts","names":[],"sources":["../../src/ui/head.ts"],"mappings":";;;;UAGiB,oBAAA;EACf,aAAA,GAAgB,OAAA,CAAQ,mBAAA;EACxB,aAAA;EACA,WAAA;EACA,SAAA;AAAA;AAAA,iBAGc,kBAAA,CAAA,GAAsB,UAAA;AAAA,iBAOtB,gBAAA,CACd,aAAA,EAAe,OAAA,CAAQ,mBAAA,eACvB,aAAA,WACA,WAAA,YACC,UAAA;AAAA,iBA+Ba,gBAAA,CAAiB,OAAA,EAAS,oBAAA,GAAuB,UAAA;AAAA,iBAgBjD,aAAA,CAAA"}
|
package/dist/ui/head.d.mts
CHANGED
|
@@ -3,17 +3,15 @@ import { HeadScript } from "./types.mjs";
|
|
|
3
3
|
|
|
4
4
|
//#region src/ui/head.d.ts
|
|
5
5
|
interface RemoteScriptsOptions {
|
|
6
|
-
assetsUrl: string;
|
|
7
6
|
runtimeConfig?: Partial<ClientRuntimeConfig>;
|
|
8
7
|
containerName?: string;
|
|
9
8
|
hydratePath?: string;
|
|
10
9
|
integrity?: string;
|
|
11
10
|
}
|
|
12
|
-
declare function getRemoteEntryScript(assetsUrl: string, integrity?: string): HeadScript;
|
|
13
11
|
declare function getThemeInitScript(): HeadScript;
|
|
14
12
|
declare function getHydrateScript(runtimeConfig: Partial<ClientRuntimeConfig> | undefined, containerName?: string, hydratePath?: string): HeadScript;
|
|
15
13
|
declare function getRemoteScripts(options: RemoteScriptsOptions): HeadScript[];
|
|
16
14
|
declare function getBaseStyles(): string;
|
|
17
15
|
//#endregion
|
|
18
|
-
export { RemoteScriptsOptions, getBaseStyles, getHydrateScript,
|
|
16
|
+
export { RemoteScriptsOptions, getBaseStyles, getHydrateScript, getRemoteScripts, getThemeInitScript };
|
|
19
17
|
//# sourceMappingURL=head.d.mts.map
|
package/dist/ui/head.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head.d.mts","names":[],"sources":["../../src/ui/head.ts"],"mappings":";;;;UAGiB,oBAAA;EACf,
|
|
1
|
+
{"version":3,"file":"head.d.mts","names":[],"sources":["../../src/ui/head.ts"],"mappings":";;;;UAGiB,oBAAA;EACf,aAAA,GAAgB,OAAA,CAAQ,mBAAA;EACxB,aAAA;EACA,WAAA;EACA,SAAA;AAAA;AAAA,iBAGc,kBAAA,CAAA,GAAsB,UAAA;AAAA,iBAOtB,gBAAA,CACd,aAAA,EAAe,OAAA,CAAQ,mBAAA,eACvB,aAAA,WACA,WAAA,YACC,UAAA;AAAA,iBA+Ba,gBAAA,CAAiB,OAAA,EAAS,oBAAA,GAAuB,UAAA;AAAA,iBAgBjD,aAAA,CAAA"}
|
package/dist/ui/head.mjs
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
//#region src/ui/head.ts
|
|
2
|
-
function getRemoteEntryScript(assetsUrl, integrity) {
|
|
3
|
-
const script = { src: `${assetsUrl}/remoteEntry.js` };
|
|
4
|
-
if (integrity) {
|
|
5
|
-
script.integrity = integrity;
|
|
6
|
-
script.crossOrigin = "anonymous";
|
|
7
|
-
}
|
|
8
|
-
return script;
|
|
9
|
-
}
|
|
10
2
|
function getThemeInitScript() {
|
|
11
3
|
return { children: "(function(){var t=localStorage.getItem('theme');if(t==='dark'||(!t&&window.matchMedia('(prefers-color-scheme: dark)').matches)){document.documentElement.classList.add('dark');}})();" };
|
|
12
4
|
}
|
|
@@ -39,9 +31,14 @@ function getHydrateScript(runtimeConfig, containerName = "ui", hydratePath = "./
|
|
|
39
31
|
`.trim() };
|
|
40
32
|
}
|
|
41
33
|
function getRemoteScripts(options) {
|
|
42
|
-
const {
|
|
34
|
+
const { runtimeConfig, containerName, hydratePath, integrity } = options;
|
|
35
|
+
const entryScript = { src: integrity ? `/remoteEntry.js?v=${encodeURIComponent(integrity)}` : "/remoteEntry.js" };
|
|
36
|
+
if (integrity) {
|
|
37
|
+
entryScript.integrity = integrity;
|
|
38
|
+
entryScript.crossOrigin = "anonymous";
|
|
39
|
+
}
|
|
43
40
|
return [
|
|
44
|
-
|
|
41
|
+
entryScript,
|
|
45
42
|
getThemeInitScript(),
|
|
46
43
|
getHydrateScript(runtimeConfig, containerName, hydratePath)
|
|
47
44
|
];
|
|
@@ -57,5 +54,5 @@ body { min-height: 100%; min-height: 100dvh; margin: 0; background-color: var(--
|
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
//#endregion
|
|
60
|
-
export { getBaseStyles, getHydrateScript,
|
|
57
|
+
export { getBaseStyles, getHydrateScript, getRemoteScripts, getThemeInitScript };
|
|
61
58
|
//# sourceMappingURL=head.mjs.map
|
package/dist/ui/head.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head.mjs","names":[],"sources":["../../src/ui/head.ts"],"sourcesContent":["import type { ClientRuntimeConfig } from \"../types\";\nimport type { HeadScript } from \"./types\";\n\nexport interface RemoteScriptsOptions {\n
|
|
1
|
+
{"version":3,"file":"head.mjs","names":[],"sources":["../../src/ui/head.ts"],"sourcesContent":["import type { ClientRuntimeConfig } from \"../types\";\nimport type { HeadScript } from \"./types\";\n\nexport interface RemoteScriptsOptions {\n runtimeConfig?: Partial<ClientRuntimeConfig>;\n containerName?: string;\n hydratePath?: string;\n integrity?: string;\n}\n\nexport function getThemeInitScript(): HeadScript {\n return {\n children:\n \"(function(){var t=localStorage.getItem('theme');if(t==='dark'||(!t&&window.matchMedia('(prefers-color-scheme: dark)').matches)){document.documentElement.classList.add('dark');}})();\",\n };\n}\n\nexport function getHydrateScript(\n runtimeConfig: Partial<ClientRuntimeConfig> | undefined,\n containerName = \"ui\",\n hydratePath = \"./Hydrate\",\n): HeadScript {\n return {\n children: `\n window.__RUNTIME_CONFIG__=${JSON.stringify(runtimeConfig)};\n function __hydrate(){\n var container = window['${containerName}'];\n if (!container) {\n console.warn('[Hydrate] Container not ready yet, waiting...');\n window.__hydrateRetry = window.__hydrateRetry || 0;\n if (window.__hydrateRetry < 10) {\n window.__hydrateRetry++;\n setTimeout(__hydrate, 100);\n return;\n }\n console.error('[Hydrate] Container not found after 10 retries');\n return;\n }\n console.log('[Hydrate] Container available, starting init...');\n container.init({}).then(function(){\n return container.get('${hydratePath}');\n }).then(function(mod){\n return mod().hydrate();\n }).catch(function(e){\n console.error('[Hydrate] Failed:', e);\n });\n }\n if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',__hydrate);}else{__hydrate();}\n \t\t`.trim(),\n };\n}\n\nexport function getRemoteScripts(options: RemoteScriptsOptions): HeadScript[] {\n const { runtimeConfig, containerName, hydratePath, integrity } = options;\n const entryScript: HeadScript = {\n src: integrity ? `/remoteEntry.js?v=${encodeURIComponent(integrity)}` : \"/remoteEntry.js\",\n };\n if (integrity) {\n entryScript.integrity = integrity;\n entryScript.crossOrigin = \"anonymous\";\n }\n return [\n entryScript,\n getThemeInitScript(),\n getHydrateScript(runtimeConfig, containerName, hydratePath),\n ];\n}\n\nexport function getBaseStyles(): string {\n return `\n*, *::before, *::after { box-sizing: border-box; }\nhtml { height: 100%; height: 100dvh; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: light dark; }\nbody { min-height: 100%; min-height: 100dvh; margin: 0; background-color: var(--background); color: var(--foreground); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }\n#root { min-height: 100vh; }\n@supports (min-height: 100dvh) { #root { min-height: 100dvh; } }\n `.trim();\n}\n"],"mappings":";AAUA,SAAgB,qBAAiC;AAC/C,QAAO,EACL,UACE,yLACH;;AAGH,SAAgB,iBACd,eACA,gBAAgB,MAChB,cAAc,aACF;AACZ,QAAO,EACL,UAAU;6BACe,KAAK,UAAU,cAAc,CAAC;;4BAE/B,cAAc;;;;;;;;;;;;;;4BAcd,YAAY;;;;;;;;KAQnC,MAAM,EACR;;AAGH,SAAgB,iBAAiB,SAA6C;CAC5E,MAAM,EAAE,eAAe,eAAe,aAAa,cAAc;CACjE,MAAM,cAA0B,EAC9B,KAAK,YAAY,qBAAqB,mBAAmB,UAAU,KAAK,mBACzE;AACD,KAAI,WAAW;AACb,cAAY,YAAY;AACxB,cAAY,cAAc;;AAE5B,QAAO;EACL;EACA,oBAAoB;EACpB,iBAAiB,eAAe,eAAe,YAAY;EAC5D;;AAGH,SAAgB,gBAAwB;AACtC,QAAO;;;;;;IAML,MAAM"}
|
package/dist/ui/index.cjs
CHANGED
|
@@ -16,7 +16,6 @@ exports.getBaseStyles = require_ui_head.getBaseStyles;
|
|
|
16
16
|
exports.getHydrateScript = require_ui_head.getHydrateScript;
|
|
17
17
|
exports.getLinkKey = require_ui_router.getLinkKey;
|
|
18
18
|
exports.getMetaKey = require_ui_router.getMetaKey;
|
|
19
|
-
exports.getRemoteEntryScript = require_ui_head.getRemoteEntryScript;
|
|
20
19
|
exports.getRemoteScripts = require_ui_head.getRemoteScripts;
|
|
21
20
|
exports.getRuntimeConfig = require_ui_runtime.getRuntimeConfig;
|
|
22
21
|
exports.getScriptKey = require_ui_router.getScriptKey;
|
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClientRuntimeInfo } from "../types.cjs";
|
|
2
2
|
import { CreateRouterOptions, HeadData, HeadLink, HeadMeta, HeadScript, RenderOptions, RenderOptionsWithApi, RenderResult, RouterContext, RouterContextWithApi, RouterModule } from "./types.cjs";
|
|
3
|
-
import { RemoteScriptsOptions, getBaseStyles, getHydrateScript,
|
|
3
|
+
import { RemoteScriptsOptions, getBaseStyles, getHydrateScript, getRemoteScripts, getThemeInitScript } from "./head.cjs";
|
|
4
4
|
import { DotIconSvgOptions, SOCIAL_IMAGE_HEIGHT, SOCIAL_IMAGE_WIDTH, SocialImageMetaOptions, createDotIconSvg, createPngIcoBuffer, getSocialImageMeta } from "./metadata.cjs";
|
|
5
5
|
import { collectHeadData, getLinkKey, getMetaKey, getScriptKey } from "./router.cjs";
|
|
6
6
|
import { buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, getRuntimeConfig } from "./runtime.cjs";
|
|
7
|
-
export { ClientRuntimeInfo, CreateRouterOptions, DotIconSvgOptions, HeadData, HeadLink, HeadMeta, HeadScript, RemoteScriptsOptions, RenderOptions, RenderOptionsWithApi, RenderResult, RouterContext, RouterContextWithApi, RouterModule, SOCIAL_IMAGE_HEIGHT, SOCIAL_IMAGE_WIDTH, SocialImageMetaOptions, buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, collectHeadData, createDotIconSvg, createPngIcoBuffer, getBaseStyles, getHydrateScript, getLinkKey, getMetaKey,
|
|
7
|
+
export { ClientRuntimeInfo, CreateRouterOptions, DotIconSvgOptions, HeadData, HeadLink, HeadMeta, HeadScript, RemoteScriptsOptions, RenderOptions, RenderOptionsWithApi, RenderResult, RouterContext, RouterContextWithApi, RouterModule, SOCIAL_IMAGE_HEIGHT, SOCIAL_IMAGE_WIDTH, SocialImageMetaOptions, buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, collectHeadData, createDotIconSvg, createPngIcoBuffer, getBaseStyles, getHydrateScript, getLinkKey, getMetaKey, getRemoteScripts, getRuntimeConfig, getScriptKey, getSocialImageMeta, getThemeInitScript };
|
package/dist/ui/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClientRuntimeInfo } from "../types.mjs";
|
|
2
2
|
import { CreateRouterOptions, HeadData, HeadLink, HeadMeta, HeadScript, RenderOptions, RenderOptionsWithApi, RenderResult, RouterContext, RouterContextWithApi, RouterModule } from "./types.mjs";
|
|
3
|
-
import { RemoteScriptsOptions, getBaseStyles, getHydrateScript,
|
|
3
|
+
import { RemoteScriptsOptions, getBaseStyles, getHydrateScript, getRemoteScripts, getThemeInitScript } from "./head.mjs";
|
|
4
4
|
import { DotIconSvgOptions, SOCIAL_IMAGE_HEIGHT, SOCIAL_IMAGE_WIDTH, SocialImageMetaOptions, createDotIconSvg, createPngIcoBuffer, getSocialImageMeta } from "./metadata.mjs";
|
|
5
5
|
import { collectHeadData, getLinkKey, getMetaKey, getScriptKey } from "./router.mjs";
|
|
6
6
|
import { buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, getRuntimeConfig } from "./runtime.mjs";
|
|
7
|
-
export { ClientRuntimeInfo, CreateRouterOptions, DotIconSvgOptions, HeadData, HeadLink, HeadMeta, HeadScript, RemoteScriptsOptions, RenderOptions, RenderOptionsWithApi, RenderResult, RouterContext, RouterContextWithApi, RouterModule, SOCIAL_IMAGE_HEIGHT, SOCIAL_IMAGE_WIDTH, SocialImageMetaOptions, buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, collectHeadData, createDotIconSvg, createPngIcoBuffer, getBaseStyles, getHydrateScript, getLinkKey, getMetaKey,
|
|
7
|
+
export { ClientRuntimeInfo, CreateRouterOptions, DotIconSvgOptions, HeadData, HeadLink, HeadMeta, HeadScript, RemoteScriptsOptions, RenderOptions, RenderOptionsWithApi, RenderResult, RouterContext, RouterContextWithApi, RouterModule, SOCIAL_IMAGE_HEIGHT, SOCIAL_IMAGE_WIDTH, SocialImageMetaOptions, buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, collectHeadData, createDotIconSvg, createPngIcoBuffer, getBaseStyles, getHydrateScript, getLinkKey, getMetaKey, getRemoteScripts, getRuntimeConfig, getScriptKey, getSocialImageMeta, getThemeInitScript };
|
package/dist/ui/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getBaseStyles, getHydrateScript,
|
|
1
|
+
import { getBaseStyles, getHydrateScript, getRemoteScripts, getThemeInitScript } from "./head.mjs";
|
|
2
2
|
import { SOCIAL_IMAGE_HEIGHT, SOCIAL_IMAGE_WIDTH, createDotIconSvg, createPngIcoBuffer, getSocialImageMeta } from "./metadata.mjs";
|
|
3
3
|
import { collectHeadData, getLinkKey, getMetaKey, getScriptKey } from "./router.mjs";
|
|
4
4
|
import { buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, getRuntimeConfig } from "./runtime.mjs";
|
|
5
5
|
|
|
6
|
-
export { SOCIAL_IMAGE_HEIGHT, SOCIAL_IMAGE_WIDTH, buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, collectHeadData, createDotIconSvg, createPngIcoBuffer, getBaseStyles, getHydrateScript, getLinkKey, getMetaKey,
|
|
6
|
+
export { SOCIAL_IMAGE_HEIGHT, SOCIAL_IMAGE_WIDTH, buildPublishedAccountHref, buildPublishedGatewayHref, buildRuntimeHref, collectHeadData, createDotIconSvg, createPngIcoBuffer, getBaseStyles, getHydrateScript, getLinkKey, getMetaKey, getRemoteScripts, getRuntimeConfig, getScriptKey, getSocialImageMeta, getThemeInitScript };
|
package/dist/ui/types.d.cts
CHANGED
|
@@ -5,7 +5,6 @@ import { AnyRouteMatch, AnyRouter, RouterHistory } from "@tanstack/react-router"
|
|
|
5
5
|
//#region src/ui/types.d.ts
|
|
6
6
|
interface RouterContext<TSession = unknown> {
|
|
7
7
|
queryClient: QueryClient;
|
|
8
|
-
assetsUrl: string;
|
|
9
8
|
runtimeConfig?: Partial<ClientRuntimeConfig>;
|
|
10
9
|
session?: TSession;
|
|
11
10
|
cspNonce?: string;
|
|
@@ -27,7 +26,6 @@ interface HeadData {
|
|
|
27
26
|
scripts: HeadScript[];
|
|
28
27
|
}
|
|
29
28
|
interface RenderOptions<TSession = unknown> {
|
|
30
|
-
assetsUrl: string;
|
|
31
29
|
runtimeConfig: Partial<ClientRuntimeConfig>;
|
|
32
30
|
basepath?: string;
|
|
33
31
|
session?: TSession;
|
package/dist/ui/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/ui/types.ts"],"mappings":";;;;;UAIiB,aAAA;EACf,WAAA,EAAa,WAAA;EACb,
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/ui/types.ts"],"mappings":";;;;;UAIiB,aAAA;EACf,WAAA,EAAa,WAAA;EACb,aAAA,GAAgB,OAAA,CAAQ,mBAAA;EACxB,OAAA,GAAU,QAAA;EACV,QAAA;AAAA;AAAA,UAGe,oBAAA,mDACP,aAAA,CAAc,QAAA;EACtB,SAAA,GAAY,UAAA;AAAA;AAAA,UAGG,mBAAA;EACf,OAAA,GAAU,aAAA;EACV,OAAA,GAAU,OAAA,CAAQ,oBAAA,CAAqB,UAAA,EAAY,QAAA;EACnD,QAAA;AAAA;AAAA,KAGU,QAAA,GAAW,WAAA,CAAY,aAAA;AAAA,KACvB,QAAA,GAAW,WAAA,CAAY,aAAA;AAAA,KACvB,UAAA,GAAa,WAAA,CAAY,aAAA;AAAA,UAEpB,QAAA;EACf,IAAA,EAAM,QAAA;EACN,KAAA,EAAO,QAAA;EACP,OAAA,EAAS,UAAA;AAAA;AAAA,UAGM,aAAA;EACf,aAAA,EAAe,OAAA,CAAQ,mBAAA;EACvB,QAAA;EACA,OAAA,GAAU,QAAA;EACV,QAAA;AAAA;AAAA,UAGe,oBAAA,mDACP,aAAA,CAAc,QAAA;EACtB,SAAA,EAAW,UAAA;EACX,UAAA;AAAA;AAAA,UAGe,YAAA;EACf,MAAA,EAAQ,cAAA;EACR,UAAA;EACA,OAAA,EAAS,OAAA;AAAA;AAAA,UAGM,YAAA;EACf,YAAA,GAAe,IAAA,GAAO,mBAAA,CAAoB,UAAA,EAAY,QAAA;IACpD,MAAA,EAAQ,SAAA;IACR,WAAA,EAAa,WAAA;EAAA;EAEf,YAAA,GACE,QAAA,UACA,OAAA,GAAU,OAAA,CAAQ,oBAAA,CAAqB,UAAA,EAAY,QAAA,OAChD,OAAA,CAAQ,QAAA;EACb,cAAA,GACE,OAAA,EAAS,OAAA,EACT,OAAA,EAAS,oBAAA,CAAqB,UAAA,EAAY,QAAA,MACvC,OAAA,CAAQ,YAAA;AAAA"}
|
package/dist/ui/types.d.mts
CHANGED
|
@@ -5,7 +5,6 @@ import { AnyRouteMatch, AnyRouter, RouterHistory } from "@tanstack/react-router"
|
|
|
5
5
|
//#region src/ui/types.d.ts
|
|
6
6
|
interface RouterContext<TSession = unknown> {
|
|
7
7
|
queryClient: QueryClient;
|
|
8
|
-
assetsUrl: string;
|
|
9
8
|
runtimeConfig?: Partial<ClientRuntimeConfig>;
|
|
10
9
|
session?: TSession;
|
|
11
10
|
cspNonce?: string;
|
|
@@ -27,7 +26,6 @@ interface HeadData {
|
|
|
27
26
|
scripts: HeadScript[];
|
|
28
27
|
}
|
|
29
28
|
interface RenderOptions<TSession = unknown> {
|
|
30
|
-
assetsUrl: string;
|
|
31
29
|
runtimeConfig: Partial<ClientRuntimeConfig>;
|
|
32
30
|
basepath?: string;
|
|
33
31
|
session?: TSession;
|
package/dist/ui/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/ui/types.ts"],"mappings":";;;;;UAIiB,aAAA;EACf,WAAA,EAAa,WAAA;EACb,
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/ui/types.ts"],"mappings":";;;;;UAIiB,aAAA;EACf,WAAA,EAAa,WAAA;EACb,aAAA,GAAgB,OAAA,CAAQ,mBAAA;EACxB,OAAA,GAAU,QAAA;EACV,QAAA;AAAA;AAAA,UAGe,oBAAA,mDACP,aAAA,CAAc,QAAA;EACtB,SAAA,GAAY,UAAA;AAAA;AAAA,UAGG,mBAAA;EACf,OAAA,GAAU,aAAA;EACV,OAAA,GAAU,OAAA,CAAQ,oBAAA,CAAqB,UAAA,EAAY,QAAA;EACnD,QAAA;AAAA;AAAA,KAGU,QAAA,GAAW,WAAA,CAAY,aAAA;AAAA,KACvB,QAAA,GAAW,WAAA,CAAY,aAAA;AAAA,KACvB,UAAA,GAAa,WAAA,CAAY,aAAA;AAAA,UAEpB,QAAA;EACf,IAAA,EAAM,QAAA;EACN,KAAA,EAAO,QAAA;EACP,OAAA,EAAS,UAAA;AAAA;AAAA,UAGM,aAAA;EACf,aAAA,EAAe,OAAA,CAAQ,mBAAA;EACvB,QAAA;EACA,OAAA,GAAU,QAAA;EACV,QAAA;AAAA;AAAA,UAGe,oBAAA,mDACP,aAAA,CAAc,QAAA;EACtB,SAAA,EAAW,UAAA;EACX,UAAA;AAAA;AAAA,UAGe,YAAA;EACf,MAAA,EAAQ,cAAA;EACR,UAAA;EACA,OAAA,EAAS,OAAA;AAAA;AAAA,UAGM,YAAA;EACf,YAAA,GAAe,IAAA,GAAO,mBAAA,CAAoB,UAAA,EAAY,QAAA;IACpD,MAAA,EAAQ,SAAA;IACR,WAAA,EAAa,WAAA;EAAA;EAEf,YAAA,GAC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