fiboui 1.0.2 → 2.1.0
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/README.md +141 -96
- package/dist/FineGrain-BTgNt7fN.js +29 -0
- package/dist/Link-DDzSPY1Q.js +88 -0
- package/dist/PluginManager-D5-ApsSN.js +111 -0
- package/dist/Router-i6Nc6qVs.js +386 -0
- package/dist/builder-6GkZlCaz.js +1894 -0
- package/dist/bundle-mjs-wppB-TKB.js +2760 -0
- package/dist/cli/bin.js +20 -0
- package/dist/cli/commands/generate/component.js +67 -0
- package/dist/cli/commands/generate/index.js +10 -0
- package/dist/cli/commands/generate/module.js +58 -0
- package/dist/cli/commands/generate/plugin.js +67 -0
- package/dist/cli/commands/init.js +58 -0
- package/dist/content.js +17 -0
- package/dist/core.js +33 -0
- package/dist/{effects-D16XdB_d.mjs → effects-CnevV566.js} +1 -0
- package/dist/index-BaX5zy8O.js +33 -0
- package/dist/index-C4xZywsh.js +1024 -0
- package/dist/index-C8y7FIYH.js +119 -0
- package/dist/index-CREALegH.js +1031 -0
- package/dist/index-CWz0hYog.js +778 -0
- package/dist/index-OLW4l8s8.js +1102 -0
- package/dist/index-zOfPHD00.js +90 -0
- package/dist/index.d.ts +43764 -6
- package/dist/index.js +2070 -0
- package/dist/interactive.js +12 -0
- package/dist/layout.js +18 -0
- package/dist/mount-rDUAHuDT.js +95 -0
- package/dist/navigation.js +13 -0
- package/dist/provider-B0eB-Wy7.js +286 -0
- package/dist/structure.js +15 -0
- package/dist/style.css +1 -1
- package/dist/style.js +1 -0
- package/dist/theme.js +9 -0
- package/package.json +88 -13
- package/dist/content/Alert/index.d.ts +0 -878
- package/dist/content/Avatar/index.d.ts +0 -886
- package/dist/content/Badge/index.d.ts +0 -887
- package/dist/content/Image/index.d.ts +0 -893
- package/dist/content/Label/index.d.ts +0 -879
- package/dist/content/Progress/index.d.ts +0 -898
- package/dist/content/Skeleton/index.d.ts +0 -879
- package/dist/content/Spinner/index.d.ts +0 -880
- package/dist/content/Text/index.d.ts +0 -878
- package/dist/content/index.d.ts +0 -9
- package/dist/core/StateWrapper.d.ts +0 -31
- package/dist/core/builder.d.ts +0 -58
- package/dist/core/component.d.ts +0 -7
- package/dist/core/effects.d.ts +0 -4
- package/dist/core/hooks.d.ts +0 -5
- package/dist/core/icons.d.ts +0 -11
- package/dist/core/index.d.ts +0 -6
- package/dist/core/state.d.ts +0 -86
- package/dist/core/types.d.ts +0 -51
- package/dist/demo.d.ts +0 -7
- package/dist/index.esm.js +0 -4777
- package/dist/index.umd.js +0 -251
- package/dist/interactive/Button/index.d.ts +0 -897
- package/dist/interactive/Checkbox/index.d.ts +0 -884
- package/dist/interactive/Combobox/index.d.ts +0 -898
- package/dist/interactive/RadioGroup/index.d.ts +0 -888
- package/dist/interactive/Select/index.d.ts +0 -895
- package/dist/interactive/Switch/index.d.ts +0 -881
- package/dist/interactive/TextField/index.d.ts +0 -893
- package/dist/interactive/Textarea/index.d.ts +0 -890
- package/dist/interactive/index.d.ts +0 -8
- package/dist/layout/Center/index.d.ts +0 -869
- package/dist/layout/Column/index.d.ts +0 -881
- package/dist/layout/Container/index.d.ts +0 -870
- package/dist/layout/DashboardLayout/index.d.ts +0 -870
- package/dist/layout/Header/index.d.ts +0 -870
- package/dist/layout/Line/index.d.ts +0 -872
- package/dist/layout/Row/index.d.ts +0 -879
- package/dist/layout/Scaffold/index.d.ts +0 -878
- package/dist/layout/ScrollView/index.d.ts +0 -879
- package/dist/layout/Sidebar/index.d.ts +0 -870
- package/dist/layout/Spacer/index.d.ts +0 -875
- package/dist/layout/StakentComponents.d.ts +0 -4
- package/dist/layout/index.d.ts +0 -11
- package/dist/structure/Banner/index.d.ts +0 -879
- package/dist/structure/Box/index.d.ts +0 -869
- package/dist/structure/Card/index.d.ts +0 -881
- package/dist/structure/Collapse/index.d.ts +0 -884
- package/dist/structure/Grid/index.d.ts +0 -1757
- package/dist/structure/List/index.d.ts +0 -888
- package/dist/structure/Table/index.d.ts +0 -895
- package/dist/structure/Tags/index.d.ts +0 -876
- package/dist/structure/cards/AssetCard/index.d.ts +0 -884
- package/dist/structure/cards/CollectionCard/index.d.ts +0 -880
- package/dist/structure/cards/ContentCard/index.d.ts +0 -884
- package/dist/structure/cards/ProfileCard/index.d.ts +0 -892
- package/dist/structure/cards/index.d.ts +0 -5
- package/dist/structure/cards/variants/index.d.ts +0 -3490
- package/dist/structure/index.d.ts +0 -9
- package/dist/theme/cupertino.d.ts +0 -3
- package/dist/theme/index.d.ts +0 -5
- package/dist/theme/material.d.ts +0 -3
- package/dist/theme/provider.d.ts +0 -16
- package/dist/theme/types.d.ts +0 -57
- package/dist/theme/web.d.ts +0 -3
- package/src/content/Alert/index.ts +0 -110
- package/src/content/Avatar/index.ts +0 -116
- package/src/content/Badge/index.ts +0 -162
- package/src/content/Image/index.ts +0 -137
- package/src/content/Label/index.ts +0 -66
- package/src/content/Progress/index.ts +0 -378
- package/src/content/Skeleton/index.ts +0 -71
- package/src/content/Spinner/index.ts +0 -139
- package/src/content/Text/index.ts +0 -74
- package/src/content/index.ts +0 -9
- package/src/core/StateWrapper.tsx +0 -131
- package/src/core/builder.ts +0 -301
- package/src/core/component.ts +0 -49
- package/src/core/effects.ts +0 -27
- package/src/core/hooks.ts +0 -48
- package/src/core/icons.tsx +0 -57
- package/src/core/index.ts +0 -6
- package/src/core/state.ts +0 -297
- package/src/core/types.ts +0 -62
- package/src/demo.tsx +0 -1050
- package/src/index.ts +0 -8
- package/src/interactive/Button/index.ts +0 -219
- package/src/interactive/Checkbox/index.ts +0 -145
- package/src/interactive/Combobox/index.ts +0 -278
- package/src/interactive/RadioGroup/index.ts +0 -124
- package/src/interactive/Select/index.ts +0 -227
- package/src/interactive/Switch/index.ts +0 -123
- package/src/interactive/TextField/index.ts +0 -223
- package/src/interactive/Textarea/index.ts +0 -129
- package/src/interactive/index.ts +0 -8
- package/src/layout/Center/index.ts +0 -34
- package/src/layout/Column/index.ts +0 -101
- package/src/layout/Container/index.ts +0 -28
- package/src/layout/DashboardLayout/index.ts +0 -106
- package/src/layout/Header/index.ts +0 -50
- package/src/layout/Line/index.ts +0 -41
- package/src/layout/Row/index.ts +0 -93
- package/src/layout/Scaffold/index.ts +0 -133
- package/src/layout/ScrollView/index.ts +0 -67
- package/src/layout/Sidebar/index.ts +0 -56
- package/src/layout/Spacer/index.ts +0 -46
- package/src/layout/StakentComponents.tsx +0 -57
- package/src/layout/index.ts +0 -11
- package/src/structure/Banner/index.ts +0 -92
- package/src/structure/Box/index.ts +0 -46
- package/src/structure/Card/index.ts +0 -113
- package/src/structure/Collapse/index.ts +0 -122
- package/src/structure/Grid/index.ts +0 -197
- package/src/structure/List/index.ts +0 -185
- package/src/structure/Table/index.ts +0 -165
- package/src/structure/Tags/index.ts +0 -69
- package/src/structure/cards/AssetCard/index.ts +0 -158
- package/src/structure/cards/CollectionCard/index.ts +0 -95
- package/src/structure/cards/ContentCard/index.ts +0 -127
- package/src/structure/cards/ProfileCard/index.ts +0 -152
- package/src/structure/cards/index.ts +0 -5
- package/src/structure/cards/variants/index.ts +0 -301
- package/src/structure/index.ts +0 -10
- package/src/styles/base.css +0 -186
- package/src/styles/core.css +0 -52
- package/src/styles/themes/cupertino.css +0 -197
- package/src/styles/themes/material.css +0 -322
- package/src/styles/themes/web.css +0 -196
- package/src/theme/cupertino.ts +0 -85
- package/src/theme/index.ts +0 -5
- package/src/theme/material.ts +0 -86
- package/src/theme/provider.tsx +0 -76
- package/src/theme/types.ts +0 -62
- package/src/theme/web.ts +0 -82
package/dist/cli/bin.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
import { generateCommand } from './commands/generate';
|
|
5
|
+
import { initCommand } from './commands/init';
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const pkg = require('../../package.json');
|
|
8
|
+
const version = pkg.version;
|
|
9
|
+
const program = new Command();
|
|
10
|
+
program
|
|
11
|
+
.name('fibo')
|
|
12
|
+
.description('FiboUI CLI - Supercharge your development')
|
|
13
|
+
.version(version);
|
|
14
|
+
// ... (version import)
|
|
15
|
+
program.addCommand(initCommand);
|
|
16
|
+
program.addCommand(generateCommand);
|
|
17
|
+
program.parse(process.argv);
|
|
18
|
+
if (!process.argv.slice(2).length) {
|
|
19
|
+
program.outputHelp();
|
|
20
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import prompts from 'prompts';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import fs from 'fs-extra';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import ora from 'ora';
|
|
7
|
+
export const componentCommand = new Command('component')
|
|
8
|
+
.alias('c')
|
|
9
|
+
.description('Generate a new FiboUI functional component')
|
|
10
|
+
.argument('[name]', 'Name of the component')
|
|
11
|
+
.action(async (name) => {
|
|
12
|
+
let componentName = name;
|
|
13
|
+
if (!componentName) {
|
|
14
|
+
const response = await prompts({
|
|
15
|
+
type: 'text',
|
|
16
|
+
name: 'value',
|
|
17
|
+
message: 'What is the name of your Component?',
|
|
18
|
+
validate: value => value.length < 3 ? 'Component name must be at least 3 characters' : true
|
|
19
|
+
});
|
|
20
|
+
componentName = response.value;
|
|
21
|
+
}
|
|
22
|
+
if (!componentName)
|
|
23
|
+
process.exit(1);
|
|
24
|
+
const spinner = ora(`Scaffolding component ${chalk.bold(componentName)}...`).start();
|
|
25
|
+
// Try to guess location: src/components or current dir
|
|
26
|
+
const srcComponents = path.resolve(process.cwd(), 'src/components');
|
|
27
|
+
const targetDir = (await fs.pathExists(srcComponents)) ? srcComponents : process.cwd();
|
|
28
|
+
// Create folder for component? Or just file? Let's do file for simplicity or folder if preferred.
|
|
29
|
+
// Standard: src/components/MyComponent/index.tsx
|
|
30
|
+
const componentDir = path.join(targetDir, componentName);
|
|
31
|
+
const targetFile = path.join(componentDir, 'index.tsx');
|
|
32
|
+
try {
|
|
33
|
+
if (await fs.pathExists(componentDir)) {
|
|
34
|
+
spinner.fail(`Component ${componentName} already exists at ${componentDir}`);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
await fs.ensureDir(componentDir);
|
|
38
|
+
const content = `import React from 'react';
|
|
39
|
+
import { Component, Text, Row, FiboBuilder } from 'fiboui';
|
|
40
|
+
|
|
41
|
+
export interface ${componentName}Props {
|
|
42
|
+
title?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const ${componentName} = Component<${componentName}Props>()(
|
|
46
|
+
({ title = '${componentName}' }) => {
|
|
47
|
+
return Row()
|
|
48
|
+
.padding(16)
|
|
49
|
+
.bg('white')
|
|
50
|
+
.rounded('lg')
|
|
51
|
+
.shadow('sm')
|
|
52
|
+
.children([
|
|
53
|
+
Text(title).size(18).weight('bold').build()
|
|
54
|
+
])
|
|
55
|
+
.build();
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
`;
|
|
59
|
+
await fs.writeFile(targetFile, content);
|
|
60
|
+
spinner.succeed(`Component ${chalk.green(componentName)} created successfully!`);
|
|
61
|
+
console.log(chalk.dim(`\nLocated at: ${targetFile}`));
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
spinner.fail('Failed to create component');
|
|
65
|
+
console.error(error);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { moduleCommand } from './module';
|
|
3
|
+
import { pluginCommand } from './plugin';
|
|
4
|
+
import { componentCommand } from './component';
|
|
5
|
+
export const generateCommand = new Command('generate')
|
|
6
|
+
.alias('g')
|
|
7
|
+
.description('Generate new architectural components (modules, plugins, etc.)')
|
|
8
|
+
.addCommand(moduleCommand)
|
|
9
|
+
.addCommand(pluginCommand)
|
|
10
|
+
.addCommand(componentCommand);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import prompts from 'prompts';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import fs from 'fs-extra';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import ora from 'ora';
|
|
7
|
+
export const moduleCommand = new Command('module')
|
|
8
|
+
.alias('m')
|
|
9
|
+
.description('Generate a new clean architecture module')
|
|
10
|
+
.argument('[name]', 'Name of the module')
|
|
11
|
+
.action(async (name) => {
|
|
12
|
+
let moduleName = name;
|
|
13
|
+
if (!moduleName) {
|
|
14
|
+
const response = await prompts({
|
|
15
|
+
type: 'text',
|
|
16
|
+
name: 'value',
|
|
17
|
+
message: 'What is the name of your module?',
|
|
18
|
+
validate: value => value.length < 3 ? 'Module name must be at least 3 characters' : true
|
|
19
|
+
});
|
|
20
|
+
moduleName = response.value;
|
|
21
|
+
}
|
|
22
|
+
if (!moduleName)
|
|
23
|
+
process.exit(1);
|
|
24
|
+
const spinner = ora(`Scaffolding module ${chalk.bold(moduleName)}...`).start();
|
|
25
|
+
// Normalize path: assume we are in project root or src
|
|
26
|
+
const targetDir = path.resolve(process.cwd(), 'src/modules', moduleName);
|
|
27
|
+
try {
|
|
28
|
+
if (await fs.pathExists(targetDir)) {
|
|
29
|
+
spinner.fail(`Module ${moduleName} already exists at ${targetDir}`);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
await fs.ensureDir(targetDir);
|
|
33
|
+
// 1. Domain Layer
|
|
34
|
+
await fs.ensureDir(path.join(targetDir, 'domain/entities'));
|
|
35
|
+
await fs.ensureDir(path.join(targetDir, 'domain/repositories'));
|
|
36
|
+
await fs.writeFile(path.join(targetDir, 'domain/entities', `${moduleName}.entity.ts`), `export interface ${capitalize(moduleName)} {\n id: string;\n // Add properties\n}\n`);
|
|
37
|
+
await fs.writeFile(path.join(targetDir, 'domain/repositories', `${moduleName}.repository.ts`), `import { ${capitalize(moduleName)} } from '../entities/${moduleName}.entity';\n\nexport interface I${capitalize(moduleName)}Repository {\n getAll(): Promise<${capitalize(moduleName)}[]>;\n getById(id: string): Promise<${capitalize(moduleName)} | null>;\n}\n`);
|
|
38
|
+
// 2. Application Layer (Use Cases)
|
|
39
|
+
await fs.ensureDir(path.join(targetDir, 'application/usecases'));
|
|
40
|
+
await fs.writeFile(path.join(targetDir, 'application/usecases', `Get${capitalize(moduleName)}.usecase.ts`), `import { I${capitalize(moduleName)}Repository } from '../../domain/repositories/${moduleName}.repository';\n\nexport class Get${capitalize(moduleName)}UseCase {\n constructor(private repo: I${capitalize(moduleName)}Repository) {}\n\n async execute() {\n return this.repo.getAll();\n }\n}\n`);
|
|
41
|
+
// 3. Infrastructure Layer
|
|
42
|
+
await fs.ensureDir(path.join(targetDir, 'infrastructure/api'));
|
|
43
|
+
await fs.writeFile(path.join(targetDir, 'infrastructure/api', `${moduleName}.api.ts`), `import { I${capitalize(moduleName)}Repository } from '../../domain/repositories/${moduleName}.repository';\nimport { ${capitalize(moduleName)} } from '../../domain/entities/${moduleName}.entity';\n\nexport class ${capitalize(moduleName)}ApiRepository implements I${capitalize(moduleName)}Repository {\n async getAll(): Promise<${capitalize(moduleName)}[]> {\n // Implement API call\n return [];\n }\n\n async getById(id: string): Promise<${capitalize(moduleName)} | null> {\n return null;\n }\n}\n`);
|
|
44
|
+
// 4. Presentation Layer (UI)
|
|
45
|
+
await fs.ensureDir(path.join(targetDir, 'presentation/components'));
|
|
46
|
+
await fs.ensureDir(path.join(targetDir, 'presentation/pages'));
|
|
47
|
+
await fs.writeFile(path.join(targetDir, 'presentation/pages', `${capitalize(moduleName)}Page.tsx`), `import React from 'react';\nimport { Column, Text, FiboBuilder } from 'fiboui';\n\nexport const ${capitalize(moduleName)}Page = () => \n Column()\n .center()\n .gap(20)\n .children([\n Text('${capitalize(moduleName)} Module').size(24).weight('bold').build()\n ])\n .build();\n`);
|
|
48
|
+
spinner.succeed(`Module ${chalk.green(moduleName)} created successfully!`);
|
|
49
|
+
console.log(chalk.dim(`\nLocated at: ${targetDir}`));
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
spinner.fail('Failed to create module');
|
|
53
|
+
console.error(error);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
function capitalize(str) {
|
|
57
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
58
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import prompts from 'prompts';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import fs from 'fs-extra';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import ora from 'ora';
|
|
7
|
+
export const pluginCommand = new Command('plugin')
|
|
8
|
+
.alias('p')
|
|
9
|
+
.description('Generate a new FiboUI plugin')
|
|
10
|
+
.argument('[name]', 'Name of the plugin')
|
|
11
|
+
.action(async (name) => {
|
|
12
|
+
let pluginName = name;
|
|
13
|
+
if (!pluginName) {
|
|
14
|
+
const response = await prompts({
|
|
15
|
+
type: 'text',
|
|
16
|
+
name: 'value',
|
|
17
|
+
message: 'What is the name of your Plugin?',
|
|
18
|
+
validate: value => value.length < 3 ? 'Plugin name must be at least 3 characters' : true
|
|
19
|
+
});
|
|
20
|
+
pluginName = response.value;
|
|
21
|
+
}
|
|
22
|
+
if (!pluginName)
|
|
23
|
+
process.exit(1);
|
|
24
|
+
const safeName = pluginName.endsWith('Plugin') ? pluginName : `${pluginName}Plugin`;
|
|
25
|
+
const spinner = ora(`Scaffolding plugin ${chalk.bold(safeName)}...`).start();
|
|
26
|
+
const targetDir = path.resolve(process.cwd(), 'src/plugins');
|
|
27
|
+
const targetFile = path.resolve(targetDir, `${safeName}.ts`);
|
|
28
|
+
try {
|
|
29
|
+
await fs.ensureDir(targetDir);
|
|
30
|
+
if (await fs.pathExists(targetFile)) {
|
|
31
|
+
spinner.fail(`Plugin ${safeName} already exists at ${targetFile}`);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const content = `import { FiboPlugin, FiboContext, Card, Text, Icon } from 'fiboui';
|
|
35
|
+
import { Settings } from 'lucide-react';
|
|
36
|
+
|
|
37
|
+
export const ${safeName}: FiboPlugin = {
|
|
38
|
+
name: '${safeName}',
|
|
39
|
+
version: '1.0.0',
|
|
40
|
+
setup: (ctx: FiboContext) => {
|
|
41
|
+
console.log('Initializing ${safeName}...');
|
|
42
|
+
|
|
43
|
+
// Example: Register Sidebar Item
|
|
44
|
+
ctx.registerSidebarItem({
|
|
45
|
+
label: '${pluginName.replace('Plugin', '')}',
|
|
46
|
+
path: '/${pluginName.toLowerCase().replace('plugin', '')}',
|
|
47
|
+
icon: Settings, // Example icon
|
|
48
|
+
order: 10
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Example: Register an Overlay
|
|
52
|
+
// ctx.registerOverlay(() =>
|
|
53
|
+
// Card().padding(10).children([ Text('Hello from ${safeName}').build() ]).build()
|
|
54
|
+
// );
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
`;
|
|
58
|
+
await fs.writeFile(targetFile, content);
|
|
59
|
+
spinner.succeed(`Plugin ${chalk.green(safeName)} created successfully!`);
|
|
60
|
+
console.log(chalk.dim(`\nLocated at: ${targetFile}`));
|
|
61
|
+
console.log(chalk.blue(`\nNext step: Register it in your main.tsx using .plugins([${safeName}])`));
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
spinner.fail('Failed to create plugin');
|
|
65
|
+
console.error(error);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
export const initCommand = new Command('init')
|
|
7
|
+
.description('Initialize FiboUI configuration')
|
|
8
|
+
.action(async () => {
|
|
9
|
+
const spinner = ora('Checking project structure...').start();
|
|
10
|
+
const configPath = path.resolve(process.cwd(), 'fibo.config.js'); // Keeping it JS for wider compatibility or TS? User asked for ts.
|
|
11
|
+
if (await fs.pathExists(configPath)) {
|
|
12
|
+
spinner.fail('fibo.config.js already exists.');
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
// Heuristics for standard architecture
|
|
16
|
+
const hasModules = await fs.pathExists(path.resolve(process.cwd(), 'src/modules'));
|
|
17
|
+
const hasPlugins = await fs.pathExists(path.resolve(process.cwd(), 'src/plugins'));
|
|
18
|
+
const hasComponents = await fs.pathExists(path.resolve(process.cwd(), 'src/components'));
|
|
19
|
+
const isStandard = hasModules && hasPlugins && hasComponents;
|
|
20
|
+
let configContent = '';
|
|
21
|
+
if (isStandard) {
|
|
22
|
+
spinner.succeed('Standard FiboUI architecture detected.');
|
|
23
|
+
configContent = `/** @type {import('fiboui').FiboConfig} */
|
|
24
|
+
module.exports = {
|
|
25
|
+
paths: {
|
|
26
|
+
modules: 'src/modules',
|
|
27
|
+
plugins: 'src/plugins',
|
|
28
|
+
components: 'src/components',
|
|
29
|
+
core: 'src/core'
|
|
30
|
+
},
|
|
31
|
+
architecture: 'clean'
|
|
32
|
+
};
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
spinner.warn('Standard architecture NOT detected.');
|
|
37
|
+
console.log(chalk.yellow('Creating configuration with default/empty values. Please update "fibo.config.js" with your project paths.'));
|
|
38
|
+
configContent = `/** @type {import('fiboui').FiboConfig} */
|
|
39
|
+
module.exports = {
|
|
40
|
+
paths: {
|
|
41
|
+
modules: 'src/modules', // Update this
|
|
42
|
+
plugins: 'src/plugins', // Update this
|
|
43
|
+
components: 'src/components', // Update this
|
|
44
|
+
core: 'src/core' // Update this
|
|
45
|
+
},
|
|
46
|
+
architecture: 'custom'
|
|
47
|
+
};
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
await fs.writeFile(configPath, configContent);
|
|
52
|
+
console.log(chalk.green(`\n✔ Created ${chalk.bold('fibo.config.js')}`));
|
|
53
|
+
console.log(chalk.dim('You can now generate components using your custom structure.'));
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
console.error(chalk.red('Failed to write config file.'), error);
|
|
57
|
+
}
|
|
58
|
+
});
|
package/dist/content.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { b as s, A as r, B as o, I as t, c as n, L as I, P as g, a as l, S as m } from "./index-CREALegH.js";
|
|
3
|
+
import { T as x } from "./index-zOfPHD00.js";
|
|
4
|
+
import { I as f } from "./index-C8y7FIYH.js";
|
|
5
|
+
export {
|
|
6
|
+
s as Alert,
|
|
7
|
+
r as Avatar,
|
|
8
|
+
o as Badge,
|
|
9
|
+
f as Icon,
|
|
10
|
+
t as Image,
|
|
11
|
+
n as Integration,
|
|
12
|
+
I as Label,
|
|
13
|
+
g as Progress,
|
|
14
|
+
l as Skeleton,
|
|
15
|
+
m as Spinner,
|
|
16
|
+
x as Text
|
|
17
|
+
};
|
package/dist/core.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { C as s, O as r, d as t, P as o, R as i, S as u, V as p, f as l, c as b, b as n, a as c, g as d, o as v, r as S, s as m, u as R, e as g } from "./builder-6GkZlCaz.js";
|
|
3
|
+
import { d as x, F as f, c as y, m as O, t as B, b as C, a as P, u as A } from "./mount-rDUAHuDT.js";
|
|
4
|
+
import { F as V, b as E } from "./FineGrain-BTgNt7fN.js";
|
|
5
|
+
export {
|
|
6
|
+
s as ComputedSignal,
|
|
7
|
+
x as Fibo,
|
|
8
|
+
f as FiboApp,
|
|
9
|
+
y as FiboAppBuilder,
|
|
10
|
+
V as FineGrainText,
|
|
11
|
+
r as Observable,
|
|
12
|
+
t as Observer,
|
|
13
|
+
o as ProviderWrapper,
|
|
14
|
+
i as ReactivityRoot,
|
|
15
|
+
u as Signal,
|
|
16
|
+
p as ValueBuilder,
|
|
17
|
+
l as applyResponsiveStyles,
|
|
18
|
+
E as bindText,
|
|
19
|
+
b as computed,
|
|
20
|
+
n as createReactivityRoot,
|
|
21
|
+
c as createStore,
|
|
22
|
+
d as getCurrentScope,
|
|
23
|
+
O as mount,
|
|
24
|
+
v as observable,
|
|
25
|
+
S as runInScope,
|
|
26
|
+
m as signal,
|
|
27
|
+
B as toElement,
|
|
28
|
+
R as useBuilderState,
|
|
29
|
+
C as useObservable,
|
|
30
|
+
g as useProvider,
|
|
31
|
+
P as useReactiveStore,
|
|
32
|
+
A as useSignal
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import o from "react";
|
|
3
|
+
import { h as n, F as i } from "./builder-6GkZlCaz.js";
|
|
4
|
+
const a = o.memo((r) => {
|
|
5
|
+
const { className: c, style: e, children: s, ...t } = r;
|
|
6
|
+
return o.createElement(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
className: c,
|
|
10
|
+
style: e,
|
|
11
|
+
...t
|
|
12
|
+
},
|
|
13
|
+
...s
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
class m extends i {
|
|
17
|
+
build() {
|
|
18
|
+
const e = [
|
|
19
|
+
"fibo-box",
|
|
20
|
+
...this._classNames
|
|
21
|
+
].filter(Boolean).join(" "), s = this.getStyle(), t = this.processChildren(), l = {
|
|
22
|
+
className: e,
|
|
23
|
+
style: s,
|
|
24
|
+
children: t,
|
|
25
|
+
...this._props
|
|
26
|
+
};
|
|
27
|
+
return o.createElement(a, l);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const p = n(m);
|
|
31
|
+
export {
|
|
32
|
+
p as B
|
|
33
|
+
};
|