Installation
TokiForge v1.0.0
Prerequisites
- Node.js 18+
- npm, yarn, or pnpm
Package Installation
Core Package
The core package is required for all TokiForge functionality:
bash
npm install @tokiforge/core@^1.0.0Framework Adapters
Install the adapter for your framework:
React
bash
npm install @tokiforge/react@^1.0.0Requires React 16.8+ (hooks support).
Vue
bash
npm install @tokiforge/vue@^1.0.0Requires Vue 3.0+.
Svelte
bash
npm install @tokiforge/svelte@^1.0.0Requires Svelte 3.0+.
Angular
bash
npm install @tokiforge/angular@^1.0.0Requires Angular 17.0+.
CLI Tool
Install globally for easy access:
bash
npm install -g tokiforge-cli@^1.0.0Or use with npx:
bash
npx tokiforge-cli@^1.0.0 initTypeScript Support
TokiForge is built with TypeScript and includes full type definitions. No additional @types packages needed!
CDN Usage
For vanilla JavaScript projects, you can use the core package via CDN:
html
<script type="module">
import { ThemeRuntime } from 'https://cdn.jsdelivr.net/npm/@tokiforge/core@1.0.0/dist/index.mjs';
const runtime = new ThemeRuntime({
themes: [{ name: 'default', tokens: myTokens }],
});
runtime.init();
</script>Framework-Specific Setup
React
tsx
import { ThemeProvider } from '@tokiforge/react';
// Wrap your app
function App() {
return (
<ThemeProvider config={themeConfig}>
<YourApp />
</ThemeProvider>
);
}Vue
vue
<script setup>
import { provideTheme } from '@tokiforge/vue';
provideTheme(themeConfig);
</script>Svelte
svelte
<script>
import { createThemeStore } from '@tokiforge/svelte';
const themeStore = createThemeStore(themeConfig);
</script>Verification
After installation, verify it's working:
bash
# Check CLI
TokiForge --version
# Or test in your code
import { TokenParser } from '@tokiforge/core';
console.log('TokiForge loaded!');Troubleshooting
Module Not Found
If you get module not found errors:
- Make sure you've installed the package:
npm install @tokiforge/core - Check your Node.js version:
node --version(should be 18+) - Try clearing cache:
npm cache clean --force
TypeScript Errors
If TypeScript can't find types:
- Ensure you're using TypeScript 5.0+
- Check your
tsconfig.jsonincludes node_modules - Restart your TypeScript server
Build Errors
If you encounter build errors:
- Make sure all dependencies are installed
- Check that you're using compatible versions
- See the Troubleshooting Guide for more help