@consciousclouds/frontend-runtime
v0.2.0
Published
Conscious Clouds frontend runtime routing layer
Readme
@cc/frontend-runtime
Headless frontend routing and environment-switching runtime for Conscious Clouds applications.
Provides a controller, pluggable switch strategies (in-place, reload), storage adapters (localStorage, memory), and an optional React integration — with zero external runtime dependencies.
Installation
npm install @cc/frontend-runtime
# or
bun add @cc/frontend-runtimeRequirements: Node ≥18.0.0 or Bun ≥1.0.0
Usage
// Core runtime (framework-agnostic)
import { RuntimeController, createLocalStorageAdapter } from '@cc/frontend-runtime';
const controller = new RuntimeController({
storage: createLocalStorageAdapter(),
});// React integration
import { RuntimeProvider, useRuntime } from '@cc/frontend-runtime/react';
function App() {
return (
<RuntimeProvider>
<MyApp />
</RuntimeProvider>
);
}Subpath Exports
| Import path | Entry point | Purpose |
|---|---|---|
| @cc/frontend-runtime | dist/index.js | Core controller, strategies, storage adapters |
| @cc/frontend-runtime/react | dist/react/index.js | React provider and hooks |
Design Constraints
- Zero external runtime dependencies (devDependencies only: React types, TypeScript)
- Platform-agnostic: usable outside the ENO monorepo
- ESM-only:
"type": "module", no CommonJS output
License
Apache-2.0
