@nikkory/vibe-engine 4.0.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/PUBLISH-GUIDE.md +250 -0
- package/README.md +1267 -0
- package/bin/vibe.js +22 -0
- package/dist/adapters/index.d.ts +19 -0
- package/dist/browser.d.ts +25 -0
- package/dist/browser.js +15083 -0
- package/dist/browser.mjs +15000 -0
- package/dist/cli/batch-command.d.ts +142 -0
- package/dist/cli/generate-command.d.ts +119 -0
- package/dist/cli/index.d.ts +34 -0
- package/dist/constants/ComponentTypes.d.ts +65 -0
- package/dist/constants/DesignSystems.d.ts +64 -0
- package/dist/constants/Frameworks.d.ts +71 -0
- package/dist/constants/Tiers.d.ts +72 -0
- package/dist/constants/index.d.ts +10 -0
- package/dist/converters/index.d.ts +12 -0
- package/dist/converters/section-converter.d.ts +176 -0
- package/dist/index.d.ts +58 -0
- package/dist/index.js +19819 -0
- package/dist/index.mjs +19496 -0
- package/dist/resolution/basic/groups-basic.d.ts +80 -0
- package/dist/resolution/basic/index.d.ts +21 -0
- package/dist/resolution/basic/intents-basic.d.ts +195 -0
- package/dist/resolution/basic/presets-basic.d.ts +96 -0
- package/dist/resolution/basic/resolver-basic.d.ts +127 -0
- package/dist/resolution/basic/shorthands-basic.d.ts +88 -0
- package/dist/resolution/core/groups-core.d.ts +160 -0
- package/dist/resolution/core/index.d.ts +21 -0
- package/dist/resolution/core/intents-core.d.ts +355 -0
- package/dist/resolution/core/presets-core.d.ts +160 -0
- package/dist/resolution/core/resolver-core.d.ts +207 -0
- package/dist/resolution/core/shorthands-core.d.ts +144 -0
- package/dist/resolution/core/types-core.d.ts +167 -0
- package/dist/resolution/debugger.d.ts +183 -0
- package/dist/resolution/demo.d.ts +57 -0
- package/dist/resolution/enterprise/index.d.ts +22 -0
- package/dist/resolution/enterprise/metrics.d.ts +152 -0
- package/dist/resolution/enterprise/resolver-enterprise.d.ts +108 -0
- package/dist/resolution/examples.d.ts +486 -0
- package/dist/resolution/groups/experience-group.d.ts +197 -0
- package/dist/resolution/groups/index.d.ts +196 -0
- package/dist/resolution/groups/layout-group.d.ts +192 -0
- package/dist/resolution/groups/motion-group.d.ts +127 -0
- package/dist/resolution/groups/visual-group.d.ts +146 -0
- package/dist/resolution/index.d.ts +41 -0
- package/dist/resolution/intents/button-intents.d.ts +231 -0
- package/dist/resolution/intents/card-intents.d.ts +177 -0
- package/dist/resolution/intents/feedback-intents.d.ts +222 -0
- package/dist/resolution/intents/index.d.ts +189 -0
- package/dist/resolution/intents/input-intents.d.ts +231 -0
- package/dist/resolution/intents/mood-modifiers.d.ts +154 -0
- package/dist/resolution/performance.d.ts +264 -0
- package/dist/resolution/presets/button-presets.d.ts +243 -0
- package/dist/resolution/presets/card-presets.d.ts +216 -0
- package/dist/resolution/presets/data-display-presets.d.ts +290 -0
- package/dist/resolution/presets/feedback-presets.d.ts +335 -0
- package/dist/resolution/presets/form-presets.d.ts +308 -0
- package/dist/resolution/presets/index.d.ts +22 -0
- package/dist/resolution/presets/input-presets.d.ts +207 -0
- package/dist/resolution/presets/nav-presets.d.ts +235 -0
- package/dist/resolution/presets/overlay-presets.d.ts +216 -0
- package/dist/resolution/presets/preset-registry.d.ts +212 -0
- package/dist/resolution/resolveProps.d.ts +235 -0
- package/dist/resolution/shorthand/feel-mappings.d.ts +140 -0
- package/dist/resolution/shorthand/index.d.ts +172 -0
- package/dist/resolution/shorthand/look-mappings.d.ts +107 -0
- package/dist/resolution/shorthand/spacing-mappings.d.ts +164 -0
- package/dist/resolution/shorthand/surface-mappings.d.ts +139 -0
- package/dist/resolution/standard/groups-standard.d.ts +98 -0
- package/dist/resolution/standard/index.d.ts +28 -0
- package/dist/resolution/standard/intents-standard.d.ts +232 -0
- package/dist/resolution/standard/presets-standard.d.ts +123 -0
- package/dist/resolution/standard/resolver-standard.d.ts +204 -0
- package/dist/resolution/standard/shorthands-standard.d.ts +98 -0
- package/dist/resolution/standard/validators.d.ts +141 -0
- package/dist/resolution/types.d.ts +461 -0
- package/dist/resolution/validators/factor24-validator.d.ts +418 -0
- package/dist/resolution/validators/index.d.ts +14 -0
- package/dist/scripts/generate-react-library.d.ts +15 -0
- package/dist/scripts/write-react-library.d.ts +18 -0
- package/dist/storage/cloud-sync.d.ts +182 -0
- package/dist/storage/index.d.ts +69 -0
- package/dist/storage/local-storage.d.ts +131 -0
- package/dist/storage/section-storage.d.ts +191 -0
- package/dist/styling/StyleGenerator.d.ts +76 -0
- package/dist/styling/TokenStyleResolver.d.ts +163 -0
- package/dist/styling/factor-migration.d.ts +192 -0
- package/dist/styling/factor-validators.d.ts +327 -0
- package/dist/styling/factors-1-6.d.ts +674 -0
- package/dist/styling/factors-12-16.d.ts +700 -0
- package/dist/styling/factors-17-24.d.ts +668 -0
- package/dist/styling/factors-all.d.ts +348 -0
- package/dist/styling/factors.d.ts +291 -0
- package/dist/styling/index.d.ts +31 -0
- package/dist/styling/types.d.ts +400 -0
- package/dist/tokens/schema.d.ts +486 -0
- package/dist/types/Option.d.ts +178 -0
- package/dist/types/Result.d.ts +148 -0
- package/dist/types/algorithm-engine.types.d.ts +298 -0
- package/dist/types/granularity/base.types.d.ts +268 -0
- package/dist/types/granularity/config.types.d.ts +177 -0
- package/dist/types/granularity/factors.types.d.ts +194 -0
- package/dist/types/granularity/index.d.ts +57 -0
- package/dist/types/granularity/slot.types.d.ts +128 -0
- package/dist/types/granularity/template.types.d.ts +179 -0
- package/dist/types/granularity-levels/atom.config.d.ts +151 -0
- package/dist/types/granularity-levels/component.config.d.ts +175 -0
- package/dist/types/granularity-levels/index.d.ts +47 -0
- package/dist/types/granularity-levels/layout.config.d.ts +278 -0
- package/dist/types/granularity-levels/page.config.d.ts +210 -0
- package/dist/types/granularity-levels/section.config.d.ts +188 -0
- package/dist/types/granularity-levels/template.config.d.ts +340 -0
- package/dist/types/index.d.ts +152 -0
- package/dist/types/section-slot.types.d.ts +169 -0
- package/dist/types/section-storage.types.d.ts +298 -0
- package/dist/types/section-template.types.d.ts +170 -0
- package/dist/types/section.types.d.ts +326 -0
- package/dist/ui-studio/ComponentGenerator.d.ts +219 -0
- package/dist/ui-studio/composition/FactorPropagator.d.ts +268 -0
- package/dist/ui-studio/composition/PageGenerator.d.ts +176 -0
- package/dist/ui-studio/composition/SectionGenerator.d.ts +312 -0
- package/dist/ui-studio/composition/SlotResolver.d.ts +295 -0
- package/dist/ui-studio/composition/section-orchestrator.d.ts +306 -0
- package/dist/ui-studio/granularity/FactorCascade.d.ts +328 -0
- package/dist/ui-studio/granularity/GranularityGenerator.d.ts +266 -0
- package/dist/ui-studio/granularity/RecursiveGenerator.d.ts +328 -0
- package/dist/ui-studio/index.d.ts +94 -0
- package/dist/ui-studio/matrix/ClassMapper.d.ts +128 -0
- package/dist/ui-studio/matrix/MatrixResolver.d.ts +203 -0
- package/dist/ui-studio/matrix/types.d.ts +96 -0
- package/dist/ui-studio/presets/IndustryDetector.d.ts +183 -0
- package/dist/ui-studio/presets/component-registry.d.ts +213 -0
- package/dist/ui-studio/presets/factor-registry.d.ts +364 -0
- package/dist/ui-studio/presets/granularity-registry.d.ts +252 -0
- package/dist/ui-studio/presets/index.d.ts +32 -0
- package/dist/ui-studio/presets/industries.d.ts +143 -0
- package/dist/ui-studio/presets/layout-registry.d.ts +21 -0
- package/dist/ui-studio/presets/matrix-groups.d.ts +195 -0
- package/dist/ui-studio/presets/page-registry.d.ts +24 -0
- package/dist/ui-studio/presets/registry.constants.d.ts +69 -0
- package/dist/ui-studio/presets/registry.types.d.ts +166 -0
- package/dist/ui-studio/presets/section-defaults.d.ts +175 -0
- package/dist/ui-studio/presets/section-registry.d.ts +83 -0
- package/dist/ui-studio/presets/section-registry.defaults.d.ts +106 -0
- package/dist/ui-studio/presets/section-registry.helpers.d.ts +112 -0
- package/dist/ui-studio/presets/section-registry.types.d.ts +181 -0
- package/dist/ui-studio/presets/template-registry.d.ts +23 -0
- package/dist/ui-studio/presets/variants.d.ts +1038 -0
- package/dist/ui-studio/registries/components-registry.d.ts +193 -0
- package/dist/ui-studio/registries/design-systems-registry.d.ts +153 -0
- package/dist/ui-studio/registries/factors-registry.d.ts +145 -0
- package/dist/ui-studio/registries/tiers-registry.d.ts +150 -0
- package/dist/ui-studio/resolution/FactorResolver.d.ts +201 -0
- package/dist/ui-studio/templates/TestGenerator.d.ts +55 -0
- package/dist/ui-studio/templates/TierGenerator.d.ts +153 -0
- package/dist/ui-studio/templates/TypesGenerator.d.ts +51 -0
- package/dist/ui-studio/types/granularity/base.types.d.ts +268 -0
- package/dist/ui-studio/types/granularity/config.types.d.ts +177 -0
- package/dist/ui-studio/types/granularity/factors.types.d.ts +194 -0
- package/dist/ui-studio/types/granularity/index.d.ts +57 -0
- package/dist/ui-studio/types/granularity/slot.types.d.ts +128 -0
- package/dist/ui-studio/types/granularity/template.types.d.ts +179 -0
- package/dist/ui-studio/types/granularity-levels/atom.config.d.ts +151 -0
- package/dist/ui-studio/types/granularity-levels/component.config.d.ts +175 -0
- package/dist/ui-studio/types/granularity-levels/index.d.ts +47 -0
- package/dist/ui-studio/types/granularity-levels/layout.config.d.ts +278 -0
- package/dist/ui-studio/types/granularity-levels/page.config.d.ts +210 -0
- package/dist/ui-studio/types/granularity-levels/section.config.d.ts +188 -0
- package/dist/ui-studio/types/granularity-levels/template.config.d.ts +340 -0
- package/dist/ui-studio/types.d.ts +323 -0
- package/dist/utils/CodeUtils.d.ts +103 -0
- package/dist/utils/GenerateComponentValidator.d.ts +35 -0
- package/dist/utils/Logger.d.ts +101 -0
- package/dist/utils/StringUtils.d.ts +120 -0
- package/dist/utils/ValidationUtils.d.ts +71 -0
- package/dist/utils/errors/BaseError.d.ts +23 -0
- package/dist/utils/errors/GenerationError.d.ts +14 -0
- package/dist/utils/errors/TemplateNotFoundError.d.ts +13 -0
- package/dist/utils/errors/ValidationError.d.ts +13 -0
- package/dist/utils/errors/index.d.ts +12 -0
- package/dist/utils/factor-resolver.d.ts +294 -0
- package/dist/utils/granularity-helpers.d.ts +359 -0
- package/dist/utils/index.d.ts +20 -0
- package/dist/utils/performance.d.ts +26 -0
- package/dist/utils/stringify.d.ts +28 -0
- package/dist/validators/component-validator.d.ts +86 -0
- package/dist/validators/design-system-validator.d.ts +95 -0
- package/dist/validators/factor-validator.d.ts +101 -0
- package/dist/validators/index.d.ts +263 -0
- package/dist/validators/section-validator.d.ts +120 -0
- package/dist/validators/slot-validator.d.ts +161 -0
- package/dist/validators/tier-validator.d.ts +102 -0
- package/package.json +67 -0
- package/tests/16-factor-integration.test.d.ts +14 -0
- package/tests/16-factor-visual.test.d.ts +14 -0
- package/tests/5-level-integration.test.d.ts +14 -0
- package/tests/CodeUtils.test.d.ts +7 -0
- package/tests/DesignSystems.test.d.ts +7 -0
- package/tests/GenerateComponentValidator.test.d.ts +7 -0
- package/tests/Logger.test.d.ts +7 -0
- package/tests/StringUtils.test.d.ts +7 -0
- package/tests/StyleGenerator.test.d.ts +13 -0
- package/tests/Tiers.test.d.ts +7 -0
- package/tests/TokenRegistry.test.d.ts +14 -0
- package/tests/TokenStyleResolver.test.d.ts +13 -0
- package/tests/ValidationUtils.test.d.ts +7 -0
- package/tests/_pending_fix/Accordion.test.d.ts +13 -0
- package/tests/_pending_fix/Alert.test.d.ts +13 -0
- package/tests/_pending_fix/AlertDialog.test.d.ts +13 -0
- package/tests/_pending_fix/AspectRatio.test.d.ts +13 -0
- package/tests/_pending_fix/Autocomplete.test.d.ts +13 -0
- package/tests/_pending_fix/Avatar.test.d.ts +13 -0
- package/tests/_pending_fix/Badge.test.d.ts +13 -0
- package/tests/_pending_fix/Banner.test.d.ts +13 -0
- package/tests/_pending_fix/Box.test.d.ts +13 -0
- package/tests/_pending_fix/Breadcrumb.test.d.ts +13 -0
- package/tests/_pending_fix/Callout.test.d.ts +13 -0
- package/tests/_pending_fix/Card.test.d.ts +13 -0
- package/tests/_pending_fix/Center.test.d.ts +13 -0
- package/tests/_pending_fix/Checkbox.test.d.ts +13 -0
- package/tests/_pending_fix/Chip.test.d.ts +13 -0
- package/tests/_pending_fix/ColorPicker.test.d.ts +13 -0
- package/tests/_pending_fix/Combobox.test.d.ts +13 -0
- package/tests/_pending_fix/CommandPalette.test.d.ts +13 -0
- package/tests/_pending_fix/ConfirmationModal.test.d.ts +13 -0
- package/tests/_pending_fix/Container.test.d.ts +13 -0
- package/tests/_pending_fix/DataTable.test.d.ts +13 -0
- package/tests/_pending_fix/DatePicker.test.d.ts +13 -0
- package/tests/_pending_fix/DateRangePicker.test.d.ts +13 -0
- package/tests/_pending_fix/DateTimePicker.test.d.ts +13 -0
- package/tests/_pending_fix/Divider.test.d.ts +13 -0
- package/tests/_pending_fix/Drawer.test.d.ts +13 -0
- package/tests/_pending_fix/Dropdown.test.d.ts +13 -0
- package/tests/_pending_fix/EmptyState.test.d.ts +13 -0
- package/tests/_pending_fix/ErrorState.test.d.ts +13 -0
- package/tests/_pending_fix/FileDropzone.test.d.ts +13 -0
- package/tests/_pending_fix/FileUpload.test.d.ts +13 -0
- package/tests/_pending_fix/Flex.test.d.ts +13 -0
- package/tests/_pending_fix/Grid.test.d.ts +13 -0
- package/tests/_pending_fix/GridItem.test.d.ts +13 -0
- package/tests/_pending_fix/HStack.test.d.ts +13 -0
- package/tests/_pending_fix/Input.test.d.ts +13 -0
- package/tests/_pending_fix/InputCurrency.test.d.ts +13 -0
- package/tests/_pending_fix/InputGroup.test.d.ts +13 -0
- package/tests/_pending_fix/InputOTP.test.d.ts +13 -0
- package/tests/_pending_fix/InputPassword.test.d.ts +13 -0
- package/tests/_pending_fix/InputPhone.test.d.ts +13 -0
- package/tests/_pending_fix/InputSearch.test.d.ts +13 -0
- package/tests/_pending_fix/Link.test.d.ts +13 -0
- package/tests/_pending_fix/List.test.d.ts +13 -0
- package/tests/_pending_fix/LoadingOverlay.test.d.ts +13 -0
- package/tests/_pending_fix/Menu.test.d.ts +13 -0
- package/tests/_pending_fix/Modal.test.d.ts +13 -0
- package/tests/_pending_fix/MultiSelect.test.d.ts +13 -0
- package/tests/_pending_fix/NavGroup.test.d.ts +13 -0
- package/tests/_pending_fix/NavItem.test.d.ts +13 -0
- package/tests/_pending_fix/NavLink.test.d.ts +13 -0
- package/tests/_pending_fix/Navbar.test.d.ts +13 -0
- package/tests/_pending_fix/Notification.test.d.ts +13 -0
- package/tests/_pending_fix/NotificationBadge.test.d.ts +13 -0
- package/tests/_pending_fix/NumberInput.test.d.ts +13 -0
- package/tests/_pending_fix/Pagination.test.d.ts +13 -0
- package/tests/_pending_fix/Popover.test.d.ts +13 -0
- package/tests/_pending_fix/Progress.test.d.ts +13 -0
- package/tests/_pending_fix/ProgressCircle.test.d.ts +13 -0
- package/tests/_pending_fix/ProgressSteps.test.d.ts +13 -0
- package/tests/_pending_fix/Radio.test.d.ts +13 -0
- package/tests/_pending_fix/RangeSlider.test.d.ts +13 -0
- package/tests/_pending_fix/ResizablePanel.test.d.ts +13 -0
- package/tests/_pending_fix/ResultState.test.d.ts +13 -0
- package/tests/_pending_fix/ScrollArea.test.d.ts +13 -0
- package/tests/_pending_fix/Select.test.d.ts +14 -0
- package/tests/_pending_fix/Sheet.test.d.ts +13 -0
- package/tests/_pending_fix/Sidebar.test.d.ts +13 -0
- package/tests/_pending_fix/SimpleGrid.test.d.ts +13 -0
- package/tests/_pending_fix/Skeleton.test.d.ts +13 -0
- package/tests/_pending_fix/Slider.test.d.ts +13 -0
- package/tests/_pending_fix/Spacer.test.d.ts +13 -0
- package/tests/_pending_fix/Spinner.test.d.ts +13 -0
- package/tests/_pending_fix/Stack.test.d.ts +13 -0
- package/tests/_pending_fix/Stat.test.d.ts +13 -0
- package/tests/_pending_fix/Stepper.test.d.ts +14 -0
- package/tests/_pending_fix/Switch.test.d.ts +13 -0
- package/tests/_pending_fix/Table.test.d.ts +13 -0
- package/tests/_pending_fix/Tabs.test.d.ts +13 -0
- package/tests/_pending_fix/Textarea.test.d.ts +13 -0
- package/tests/_pending_fix/Timeline.test.d.ts +13 -0
- package/tests/_pending_fix/Toast.test.d.ts +14 -0
- package/tests/_pending_fix/Tooltip.test.d.ts +14 -0
- package/tests/_pending_fix/VStack.test.d.ts +13 -0
- package/tests/alert.test.d.ts +13 -0
- package/tests/badge.test.d.ts +13 -0
- package/tests/benchmarks/factor-resolution.bench.d.ts +41 -0
- package/tests/button.test.d.ts +16 -0
- package/tests/card.test.d.ts +19 -0
- package/tests/checkbox.test.d.ts +13 -0
- package/tests/component-16-factor-types.test.d.ts +13 -0
- package/tests/component-5level-integration.test.d.ts +14 -0
- package/tests/component-registry-ui.test.d.ts +13 -0
- package/tests/e2e/16-factor-visual.test.d.ts +14 -0
- package/tests/edge-cases.test.d.ts +14 -0
- package/tests/factor-17-24-integration.test.d.ts +14 -0
- package/tests/factor-17-24-performance.test.d.ts +14 -0
- package/tests/factor-validators.test.d.ts +13 -0
- package/tests/factors-1-6.test.d.ts +13 -0
- package/tests/factors-12-16.test.d.ts +13 -0
- package/tests/factors-17-24.test.d.ts +21 -0
- package/tests/factors-all.test.d.ts +13 -0
- package/tests/factors-registry.test.d.ts +11 -0
- package/tests/factors.test.d.ts +13 -0
- package/tests/granularity-types.test.d.ts +18 -0
- package/tests/groups.test.d.ts +14 -0
- package/tests/input.test.d.ts +16 -0
- package/tests/intents.test.d.ts +14 -0
- package/tests/memory-leak.test.d.ts +14 -0
- package/tests/modal.test.d.ts +19 -0
- package/tests/presets.test.d.ts +14 -0
- package/tests/radio.test.d.ts +13 -0
- package/tests/resolution-intents.test.d.ts +13 -0
- package/tests/resolution-presets.test.d.ts +13 -0
- package/tests/resolveProps.test.d.ts +14 -0
- package/tests/section-integration.test.d.ts +16 -0
- package/tests/section-types.test.d.ts +11 -0
- package/tests/setup.d.ts +13 -0
- package/tests/shorthands.test.d.ts +14 -0
- package/tests/switch.test.d.ts +13 -0
- package/tests/tabs.test.d.ts +13 -0
- package/tests/tiers-registry.test.d.ts +11 -0
- package/tests/useComponentStyles.test.d.ts +11 -0
- package/tests/useFactors.test.d.ts +13 -0
- package/tests/validators-invalid-input.test.d.ts +13 -0
- package/tsup.config.d.ts +11 -0
- package/vitest.config.d.ts +3 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Generation Utilities
|
|
3
|
+
*
|
|
4
|
+
* Helper functions for generating TypeScript/React code.
|
|
5
|
+
*
|
|
6
|
+
* Powered by Nikkory
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Generate import statements
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* generateImports(['react', 'clsx', 'cva'])
|
|
13
|
+
* // import React from 'react';
|
|
14
|
+
* // import { clsx } from 'clsx';
|
|
15
|
+
* // import { cva, type VariantProps } from 'class-variance-authority';
|
|
16
|
+
*/
|
|
17
|
+
export declare function generateImports(dependencies: string[]): string;
|
|
18
|
+
/**
|
|
19
|
+
* Generate TypeScript interface
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* generateInterface('Button', {
|
|
23
|
+
* variant: "'filled' | 'outlined'",
|
|
24
|
+
* size: "'sm' | 'md' | 'lg'",
|
|
25
|
+
* disabled: 'boolean',
|
|
26
|
+
* })
|
|
27
|
+
*/
|
|
28
|
+
export declare function generateInterface(name: string, props: Record<string, string>, options?: {
|
|
29
|
+
extends?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
optional?: string[];
|
|
32
|
+
}): string;
|
|
33
|
+
/**
|
|
34
|
+
* Generate TypeScript type alias
|
|
35
|
+
*/
|
|
36
|
+
export declare function generateType(name: string, type: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Generate union type from array
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* generateUnionType(['sm', 'md', 'lg']) // "'sm' | 'md' | 'lg'"
|
|
42
|
+
*/
|
|
43
|
+
export declare function generateUnionType(values: string[]): string;
|
|
44
|
+
/**
|
|
45
|
+
* Generate JSDoc comment
|
|
46
|
+
*/
|
|
47
|
+
export declare function generateJSDoc(options: {
|
|
48
|
+
description?: string;
|
|
49
|
+
params?: Array<{
|
|
50
|
+
name: string;
|
|
51
|
+
type: string;
|
|
52
|
+
description: string;
|
|
53
|
+
}>;
|
|
54
|
+
returns?: {
|
|
55
|
+
type: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
example?: string;
|
|
59
|
+
since?: string;
|
|
60
|
+
deprecated?: string;
|
|
61
|
+
}): string;
|
|
62
|
+
/**
|
|
63
|
+
* Generate React component skeleton
|
|
64
|
+
*/
|
|
65
|
+
export declare function generateComponentSkeleton(name: string, options?: {
|
|
66
|
+
withForwardRef?: boolean;
|
|
67
|
+
withMemo?: boolean;
|
|
68
|
+
withDisplayName?: boolean;
|
|
69
|
+
}): string;
|
|
70
|
+
/**
|
|
71
|
+
* Generate file header comment
|
|
72
|
+
*/
|
|
73
|
+
export declare function generateFileHeader(options: {
|
|
74
|
+
name: string;
|
|
75
|
+
description?: string;
|
|
76
|
+
designSystem?: string;
|
|
77
|
+
tier?: string;
|
|
78
|
+
}): string;
|
|
79
|
+
/**
|
|
80
|
+
* Generate component file path
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* generateComponentPath('button', 'material-design', 'standard')
|
|
84
|
+
* // 'components/button/material-design/standard.tsx'
|
|
85
|
+
*/
|
|
86
|
+
export declare function generateComponentPath(component: string, designSystem: string, tier: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* Generate component name
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* generateComponentName('button', 'material-design', 'standard')
|
|
92
|
+
* // 'MaterialButtonStandard'
|
|
93
|
+
*/
|
|
94
|
+
export declare function generateComponentName(component: string, designSystem: string, tier: string): string;
|
|
95
|
+
/**
|
|
96
|
+
* Indent code by specified number of spaces
|
|
97
|
+
*/
|
|
98
|
+
export declare function indent(code: string, spaces?: number): string;
|
|
99
|
+
/**
|
|
100
|
+
* Remove extra blank lines
|
|
101
|
+
*/
|
|
102
|
+
export declare function normalizeWhitespace(code: string): string;
|
|
103
|
+
//# sourceMappingURL=CodeUtils.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate Component Validator
|
|
3
|
+
*
|
|
4
|
+
* Validates GenerateComponentDto before processing.
|
|
5
|
+
*
|
|
6
|
+
* Powered by Nikkory
|
|
7
|
+
*/
|
|
8
|
+
import { Result } from '../types/Result';
|
|
9
|
+
import { ValidationError } from './errors';
|
|
10
|
+
import type { GenerateComponentDto } from '../types';
|
|
11
|
+
export interface ValidationResult {
|
|
12
|
+
isValid: boolean;
|
|
13
|
+
errors: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Validate GenerateComponentDto
|
|
17
|
+
*/
|
|
18
|
+
export declare function validateGenerateComponentDto(dto: GenerateComponentDto): Result<void, ValidationError>;
|
|
19
|
+
/**
|
|
20
|
+
* Get list of valid templates
|
|
21
|
+
*/
|
|
22
|
+
export declare function getValidTemplates(): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Get list of valid design systems
|
|
25
|
+
*/
|
|
26
|
+
export declare function getValidDesignSystems(): string[];
|
|
27
|
+
/**
|
|
28
|
+
* Get list of valid tiers
|
|
29
|
+
*/
|
|
30
|
+
export declare function getValidTiers(): string[];
|
|
31
|
+
/**
|
|
32
|
+
* Get list of valid frameworks
|
|
33
|
+
*/
|
|
34
|
+
export declare function getValidFrameworks(): string[];
|
|
35
|
+
//# sourceMappingURL=GenerateComponentValidator.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger Utility
|
|
3
|
+
*
|
|
4
|
+
* Logging abstraction for consistent logging across the application.
|
|
5
|
+
*
|
|
6
|
+
* Powered by Nikkory
|
|
7
|
+
*/
|
|
8
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
9
|
+
export interface LogEntry {
|
|
10
|
+
level: LogLevel;
|
|
11
|
+
message: string;
|
|
12
|
+
timestamp: Date;
|
|
13
|
+
context?: string;
|
|
14
|
+
metadata?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export interface ILogger {
|
|
17
|
+
debug(message: string, metadata?: Record<string, unknown>): void;
|
|
18
|
+
info(message: string, metadata?: Record<string, unknown>): void;
|
|
19
|
+
warn(message: string, metadata?: Record<string, unknown>): void;
|
|
20
|
+
error(message: string, metadata?: Record<string, unknown>): void;
|
|
21
|
+
setContext(context: string): void;
|
|
22
|
+
setLevel(level: LogLevel): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Console Logger Implementation
|
|
26
|
+
*/
|
|
27
|
+
export declare class ConsoleLogger implements ILogger {
|
|
28
|
+
private context;
|
|
29
|
+
private level;
|
|
30
|
+
constructor(options?: {
|
|
31
|
+
context?: string;
|
|
32
|
+
level?: LogLevel;
|
|
33
|
+
});
|
|
34
|
+
setContext(context: string): void;
|
|
35
|
+
setLevel(level: LogLevel): void;
|
|
36
|
+
debug(message: string, metadata?: Record<string, unknown>): void;
|
|
37
|
+
info(message: string, metadata?: Record<string, unknown>): void;
|
|
38
|
+
warn(message: string, metadata?: Record<string, unknown>): void;
|
|
39
|
+
error(message: string, metadata?: Record<string, unknown>): void;
|
|
40
|
+
private log;
|
|
41
|
+
private formatPrefix;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Silent Logger (for testing)
|
|
45
|
+
*/
|
|
46
|
+
export declare class SilentLogger implements ILogger {
|
|
47
|
+
debug(): void;
|
|
48
|
+
info(): void;
|
|
49
|
+
warn(): void;
|
|
50
|
+
error(): void;
|
|
51
|
+
setContext(): void;
|
|
52
|
+
setLevel(): void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Memory Logger (for testing - stores logs in memory)
|
|
56
|
+
*/
|
|
57
|
+
export declare class MemoryLogger implements ILogger {
|
|
58
|
+
private logs;
|
|
59
|
+
private context;
|
|
60
|
+
private level;
|
|
61
|
+
setContext(context: string): void;
|
|
62
|
+
setLevel(level: LogLevel): void;
|
|
63
|
+
debug(message: string, metadata?: Record<string, unknown>): void;
|
|
64
|
+
info(message: string, metadata?: Record<string, unknown>): void;
|
|
65
|
+
warn(message: string, metadata?: Record<string, unknown>): void;
|
|
66
|
+
error(message: string, metadata?: Record<string, unknown>): void;
|
|
67
|
+
private addLog;
|
|
68
|
+
/**
|
|
69
|
+
* Get all logs
|
|
70
|
+
*/
|
|
71
|
+
getLogs(): LogEntry[];
|
|
72
|
+
/**
|
|
73
|
+
* Get logs by level
|
|
74
|
+
*/
|
|
75
|
+
getLogsByLevel(level: LogLevel): LogEntry[];
|
|
76
|
+
/**
|
|
77
|
+
* Clear all logs
|
|
78
|
+
*/
|
|
79
|
+
clear(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Check if any errors were logged
|
|
82
|
+
*/
|
|
83
|
+
hasErrors(): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Check if any warnings were logged
|
|
86
|
+
*/
|
|
87
|
+
hasWarnings(): boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Create default logger
|
|
91
|
+
*/
|
|
92
|
+
export declare function createLogger(options?: {
|
|
93
|
+
context?: string;
|
|
94
|
+
level?: LogLevel;
|
|
95
|
+
silent?: boolean;
|
|
96
|
+
}): ILogger;
|
|
97
|
+
/**
|
|
98
|
+
* Default logger instance
|
|
99
|
+
*/
|
|
100
|
+
export declare const logger: ILogger;
|
|
101
|
+
//# sourceMappingURL=Logger.d.ts.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* String Utilities
|
|
3
|
+
*
|
|
4
|
+
* Common string manipulation functions.
|
|
5
|
+
*
|
|
6
|
+
* Powered by Nikkory
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Convert string to PascalCase
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* toPascalCase('hello-world') // 'HelloWorld'
|
|
13
|
+
* toPascalCase('hello_world') // 'HelloWorld'
|
|
14
|
+
* toPascalCase('hello world') // 'HelloWorld'
|
|
15
|
+
*/
|
|
16
|
+
export declare function toPascalCase(str: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Convert string to camelCase
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* toCamelCase('hello-world') // 'helloWorld'
|
|
22
|
+
* toCamelCase('HelloWorld') // 'helloWorld'
|
|
23
|
+
*/
|
|
24
|
+
export declare function toCamelCase(str: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Convert string to kebab-case
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* toKebabCase('HelloWorld') // 'hello-world'
|
|
30
|
+
* toKebabCase('helloWorld') // 'hello-world'
|
|
31
|
+
*/
|
|
32
|
+
export declare function toKebabCase(str: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Convert string to snake_case
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* toSnakeCase('HelloWorld') // 'hello_world'
|
|
38
|
+
* toSnakeCase('hello-world') // 'hello_world'
|
|
39
|
+
*/
|
|
40
|
+
export declare function toSnakeCase(str: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Convert string to CONSTANT_CASE
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* toConstantCase('HelloWorld') // 'HELLO_WORLD'
|
|
46
|
+
*/
|
|
47
|
+
export declare function toConstantCase(str: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Capitalize first letter
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* capitalize('hello') // 'Hello'
|
|
53
|
+
*/
|
|
54
|
+
export declare function capitalize(str: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* Uncapitalize first letter
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* uncapitalize('Hello') // 'hello'
|
|
60
|
+
*/
|
|
61
|
+
export declare function uncapitalize(str: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Check if string is PascalCase
|
|
64
|
+
*/
|
|
65
|
+
export declare function isPascalCase(str: string): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Check if string is camelCase
|
|
68
|
+
*/
|
|
69
|
+
export declare function isCamelCase(str: string): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Check if string is kebab-case
|
|
72
|
+
*/
|
|
73
|
+
export declare function isKebabCase(str: string): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Check if string is snake_case
|
|
76
|
+
*/
|
|
77
|
+
export declare function isSnakeCase(str: string): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Pluralize a word (simple version)
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* pluralize('button') // 'buttons'
|
|
83
|
+
* pluralize('category') // 'categories'
|
|
84
|
+
*/
|
|
85
|
+
export declare function pluralize(word: string): string;
|
|
86
|
+
/**
|
|
87
|
+
* Singularize a word (simple version)
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* singularize('buttons') // 'button'
|
|
91
|
+
* singularize('categories') // 'category'
|
|
92
|
+
*/
|
|
93
|
+
export declare function singularize(word: string): string;
|
|
94
|
+
/**
|
|
95
|
+
* Truncate string with ellipsis
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* truncate('Hello World', 8) // 'Hello...'
|
|
99
|
+
*/
|
|
100
|
+
export declare function truncate(str: string, maxLength: number, suffix?: string): string;
|
|
101
|
+
/**
|
|
102
|
+
* Escape HTML special characters
|
|
103
|
+
*/
|
|
104
|
+
export declare function escapeHtml(str: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* Escape string for use in template literals
|
|
107
|
+
*/
|
|
108
|
+
export declare function escapeTemplate(str: string): string;
|
|
109
|
+
/**
|
|
110
|
+
* Generate random string
|
|
111
|
+
*/
|
|
112
|
+
export declare function randomString(length: number, charset?: string): string;
|
|
113
|
+
/**
|
|
114
|
+
* Generate slug from string
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* slugify('Hello World!') // 'hello-world'
|
|
118
|
+
*/
|
|
119
|
+
export declare function slugify(str: string): string;
|
|
120
|
+
//# sourceMappingURL=StringUtils.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation Utilities
|
|
3
|
+
*
|
|
4
|
+
* Input validation functions for security and data integrity.
|
|
5
|
+
*
|
|
6
|
+
* Powered by Nikkory
|
|
7
|
+
*/
|
|
8
|
+
import { Result } from '../types/Result';
|
|
9
|
+
import { ValidationError } from './errors';
|
|
10
|
+
/**
|
|
11
|
+
* Validate component name (PascalCase)
|
|
12
|
+
*
|
|
13
|
+
* Rules:
|
|
14
|
+
* - Must start with uppercase letter
|
|
15
|
+
* - Only alphanumeric characters
|
|
16
|
+
* - Max 100 characters
|
|
17
|
+
* - No reserved keywords
|
|
18
|
+
*/
|
|
19
|
+
export declare function validateComponentName(name: string): Result<void, ValidationError>;
|
|
20
|
+
/**
|
|
21
|
+
* Validate file path
|
|
22
|
+
*
|
|
23
|
+
* Security checks:
|
|
24
|
+
* - No path traversal (..)
|
|
25
|
+
* - No absolute paths
|
|
26
|
+
* - Valid extension
|
|
27
|
+
* - No null bytes
|
|
28
|
+
*/
|
|
29
|
+
export declare function validateFilePath(path: string, allowedExtensions?: string[]): Result<void, ValidationError>;
|
|
30
|
+
/**
|
|
31
|
+
* Validate design system name
|
|
32
|
+
*/
|
|
33
|
+
export declare function validateDesignSystem(designSystem: string): Result<void, ValidationError>;
|
|
34
|
+
/**
|
|
35
|
+
* Validate tier
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateTier(tier: string): Result<void, ValidationError>;
|
|
38
|
+
/**
|
|
39
|
+
* Validate URL
|
|
40
|
+
*
|
|
41
|
+
* Security checks:
|
|
42
|
+
* - Must be http or https
|
|
43
|
+
* - No internal/private IPs
|
|
44
|
+
*/
|
|
45
|
+
export declare function validateUrl(url: string): Result<void, ValidationError>;
|
|
46
|
+
/**
|
|
47
|
+
* Validate email
|
|
48
|
+
*/
|
|
49
|
+
export declare function validateEmail(email: string): Result<void, ValidationError>;
|
|
50
|
+
/**
|
|
51
|
+
* Sanitize string input
|
|
52
|
+
*
|
|
53
|
+
* Removes potentially dangerous characters.
|
|
54
|
+
*/
|
|
55
|
+
export declare function sanitize(input: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* Sanitize for HTML output
|
|
58
|
+
*/
|
|
59
|
+
export declare function sanitizeHtml(input: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Check if value is within allowed list
|
|
62
|
+
*/
|
|
63
|
+
export declare function isAllowedValue<T>(value: T, allowed: T[]): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Validate object against schema (simple version)
|
|
66
|
+
*/
|
|
67
|
+
export declare function validateObject(obj: Record<string, unknown>, schema: Record<string, {
|
|
68
|
+
type: string;
|
|
69
|
+
required?: boolean;
|
|
70
|
+
}>): Result<void, ValidationError>;
|
|
71
|
+
//# sourceMappingURL=ValidationUtils.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Error Class
|
|
3
|
+
*
|
|
4
|
+
* All custom errors extend this class.
|
|
5
|
+
* Provides stack trace, error codes, and metadata.
|
|
6
|
+
*
|
|
7
|
+
* Powered by Nikkory
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class BaseError extends Error {
|
|
10
|
+
readonly timestamp: Date;
|
|
11
|
+
readonly errorCode: string;
|
|
12
|
+
readonly metadata?: Record<string, unknown>;
|
|
13
|
+
constructor(message: string, errorCode: string, metadata?: Record<string, unknown>);
|
|
14
|
+
/**
|
|
15
|
+
* Serialize error to JSON
|
|
16
|
+
*/
|
|
17
|
+
toJSON(): object;
|
|
18
|
+
/**
|
|
19
|
+
* Get user-friendly message
|
|
20
|
+
*/
|
|
21
|
+
abstract getUserMessage(): string;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=BaseError.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generation Error
|
|
3
|
+
*
|
|
4
|
+
* Thrown when code generation fails.
|
|
5
|
+
*
|
|
6
|
+
* Powered by Nikkory
|
|
7
|
+
*/
|
|
8
|
+
import { BaseError } from './BaseError';
|
|
9
|
+
export declare class GenerationError extends BaseError {
|
|
10
|
+
readonly cause?: Error;
|
|
11
|
+
constructor(message: string, cause?: Error);
|
|
12
|
+
getUserMessage(): string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=GenerationError.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template Not Found Error
|
|
3
|
+
*
|
|
4
|
+
* Thrown when a requested template doesn't exist.
|
|
5
|
+
*
|
|
6
|
+
* Powered by Nikkory
|
|
7
|
+
*/
|
|
8
|
+
import { BaseError } from './BaseError';
|
|
9
|
+
export declare class TemplateNotFoundError extends BaseError {
|
|
10
|
+
constructor(templateName: string);
|
|
11
|
+
getUserMessage(): string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=TemplateNotFoundError.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation Error
|
|
3
|
+
*
|
|
4
|
+
* Thrown when input validation fails.
|
|
5
|
+
*
|
|
6
|
+
* Powered by Nikkory
|
|
7
|
+
*/
|
|
8
|
+
import { BaseError } from './BaseError';
|
|
9
|
+
export declare class ValidationError extends BaseError {
|
|
10
|
+
constructor(message: string, metadata?: Record<string, unknown>);
|
|
11
|
+
getUserMessage(): string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ValidationError.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Classes
|
|
3
|
+
*
|
|
4
|
+
* Centralized error handling for Nikkory Vibe.
|
|
5
|
+
*
|
|
6
|
+
* Powered by Nikkory
|
|
7
|
+
*/
|
|
8
|
+
export { BaseError } from './BaseError';
|
|
9
|
+
export { ValidationError } from './ValidationError';
|
|
10
|
+
export { GenerationError } from './GenerationError';
|
|
11
|
+
export { TemplateNotFoundError } from './TemplateNotFoundError';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|