Skip to content

Apps

An app is the top-level unit of the framework. You define it with an AppDefinition and register it with appLoaderService.

AppDefinition

FieldRequiredDescription
idYesUnique application identifier.
nameYesHuman-readable name.
versionYesSemantic version string.
descriptionNoShort description.
extensionsNoList of extension ids (e.g. @kispace-io/extension-command-palette) to enable when the app loads.
contributionsNoApp-level contributions (UI and/or extensions).
renderNoRoot component: tag string, { tag, attributes }, or a function returning a Lit TemplateResult. Defaults to k-standard-layout.
initializeNoCalled after extensions and contributions are registered.
disposeNoCalled when the app is unloaded.
releaseHistoryNoStatic array or callback for release history (used by version-info).
metadataNoCustom metadata (e.g. metadata.github for release checking).

Registration

ts
import { appLoaderService } from '@kispace-io/core';

appLoaderService.registerApp(
  {
    id: 'my-app',
    name: 'My App',
    version: '1.0.0',
    extensions: ['@kispace-io/extension-command-palette', '@kispace-io/extension-settings-tree'],
    render: { tag: 'k-standard-layout', attributes: { 'show-bottom-panel': 'true' } },
  },
  { autoStart: true }
);
  • autoStart — If true, the app loader starts after registration (loads extensions and renders).
  • defaultAppId — App to load when no app is specified (e.g. via URL).
  • container — DOM element to render into (default: document.body).

App host config

If your app uses the marketplace or needs to expose package info, call applyAppHostConfig before registering apps:

ts
import { applyAppHostConfig } from '@kispace-io/core';
import appPkg from '../package.json';

applyAppHostConfig({
  packageInfo: {
    name: appPkg.name,
    version: appPkg.version,
    dependencies: appPkg.dependencies,
    devDependencies: appPkg.devDependencies,
  },
  marketplaceCatalogUrls: (appPkg as any).marketplace?.catalogUrls,
});

See Build your own app.