@codeenvision/ui-platform
v1.0.16
Published
Aggregator for CE UI framework, web components, and SCSS (reusable across apps)
Readme
CE UI Platform
Aggregator package to consume CE UI stack (framework + web components + SCSS) as a reusable library for future apps (ecommerce, LMS, ERP, etc.).
What’s included
@clusterenvision/ui-framework(local file dep)@clusterenvision/ui-webcomponents(local file dep)ce-scss-vitepress(local file dep, CSS tokens)@ce/templates(templating utilities)@ce/email-engine(email rendering/dispatch)- Barrel exports plus helpers to register default web components and point to the SCSS build.
Usage (conceptual)
- Install in a workspace-aware package manager (pnpm/yarn/npm) so file: deps resolve.
- Import framework/runtime APIs from this package instead of touching the underlying packages directly.
- Call
registerCeUiDefaults()once at app bootstrap to define the custom elements and load global styles. - Import
ceScssPathinto your bundler (e.g., Vite) to include the CSS:import ceScssPath from '@ce/ui-platform/css';(see below). - For a smaller baseline bundle, import
ceScssMinimalPathfrom@ce/ui-platform/css.
Exports
- Framework re-exports: everything from
@clusterenvision/ui-framework. - Web components:
registerDefaultComponents,ensureGlobalStyles,defineComponentElementre-exported. - Bootstrap:
registerCeUiDefaults(andCeUiPlatformBootstrapOptions) for one-call setup. - CSS path helper:
ceScssPathand a named exportcsssubpath for easy import of the compiled SCSS. - Ecosystem:
ceTemplatesandceEmailEnginenamespaces. - App shell templates: token-only layout primitives, app shell kit, reference templates, and product starters.
Bootstrap (recommended)
Call once during app startup (client-side):
import { registerCeUiDefaults } from '@ce/ui-platform';
registerCeUiDefaults();Or configure behavior explicitly:
import { registerCeUiDefaults } from '@ce/ui-platform/bootstrap';
registerCeUiDefaults({
ensureStyles: true,
registerComponents: true,
iconBase: '/assets/icons/latest/nucleo/outline',
iconSpriteUrl: '/assets/icons/latest/nucleo.svg',
diagnostics: true,
scssHref: '/assets/ce-ui/ce-ui-scss.css',
});
If you need direct access to the webcomponents initializer (for fine-grained control):
```ts
import { initCeUiWebcomponents } from '@ce/ui-platform';
initCeUiWebcomponents({
iconBase: '/assets/icons/latest/nucleo/outline',
diagnostics: true,
});
## App shell templates (token-only)
The platform package ships token-only HTML/CSS templates so you can scaffold shells without custom CSS. Each template includes an `html` string and a `css` string (all values are token-backed).
```ts
import { cePlatformTemplates } from '@ce/ui-platform';
const { primitives, appShell, references, starters } = cePlatformTemplates;
// primitives.css provides layout primitives
// appShell.html is a full shell with forms/tables/empty states
// starters include LMS/CRM/ecom examplesNotes
- This is a thin wrapper; underlying packages live in
projects/libraries/ui/and are private file deps. - No build pipeline is added here; consume via ES modules and let your bundler handle it.
- Stack roadmap:
docs/ce-ui-framework/STACK_ROADMAP.md.
