@specverse/engines 4.1.30 → 4.2.1
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/assets/examples/manifests/frontend-only.yaml +3 -6
- package/assets/examples/manifests/fullstack-app.yaml +5 -7
- package/assets/examples/manifests/fullstack-monorepo.yaml +3 -6
- package/assets/templates/default/specs/main.specly +65 -0
- package/dist/inference/comprehensive-engine.d.ts.map +1 -1
- package/dist/inference/comprehensive-engine.js +3 -19
- package/dist/inference/comprehensive-engine.js.map +1 -1
- package/dist/inference/core/rule-engine.d.ts +31 -0
- package/dist/inference/core/rule-engine.d.ts.map +1 -1
- package/dist/inference/core/rule-engine.js +117 -33
- package/dist/inference/core/rule-engine.js.map +1 -1
- package/dist/inference/core/rule-file-types.d.ts +0 -2
- package/dist/inference/core/rule-file-types.d.ts.map +1 -1
- package/dist/inference/core/rule-file-types.js +3 -6
- package/dist/inference/core/rule-file-types.js.map +1 -1
- package/dist/inference/core/rule-loader.d.ts +5 -15
- package/dist/inference/core/rule-loader.d.ts.map +1 -1
- package/dist/inference/core/rule-loader.js +43 -132
- package/dist/inference/core/rule-loader.js.map +1 -1
- package/dist/inference/core/types.d.ts +0 -6
- package/dist/inference/core/types.d.ts.map +1 -1
- package/dist/inference/core/types.js +0 -4
- package/dist/inference/core/types.js.map +1 -1
- package/dist/inference/logical/generators/component-type-resolver.d.ts +0 -26
- package/dist/inference/logical/generators/component-type-resolver.d.ts.map +1 -1
- package/dist/inference/logical/generators/component-type-resolver.js +0 -19
- package/dist/inference/logical/generators/component-type-resolver.js.map +1 -1
- package/dist/inference/logical/generators/specialist-view-expander.d.ts +1 -17
- package/dist/inference/logical/generators/specialist-view-expander.d.ts.map +1 -1
- package/dist/inference/logical/generators/specialist-view-expander.js +0 -15
- package/dist/inference/logical/generators/specialist-view-expander.js.map +1 -1
- package/dist/inference/logical/generators/view-generator.d.ts +4 -14
- package/dist/inference/logical/generators/view-generator.d.ts.map +1 -1
- package/dist/inference/logical/generators/view-generator.js +6 -26
- package/dist/inference/logical/generators/view-generator.js.map +1 -1
- package/dist/inference/logical/index.d.ts +2 -2
- package/dist/inference/logical/index.d.ts.map +1 -1
- package/dist/inference/logical/logical-engine.d.ts.map +1 -1
- package/dist/inference/logical/logical-engine.js +17 -80
- package/dist/inference/logical/logical-engine.js.map +1 -1
- package/dist/inference/quint-transpiler.d.ts +5 -3
- package/dist/inference/quint-transpiler.d.ts.map +1 -1
- package/dist/inference/quint-transpiler.js +11 -6
- package/dist/inference/quint-transpiler.js.map +1 -1
- package/dist/libs/instance-factories/CURVED-INTERFACE.md +278 -0
- package/dist/libs/instance-factories/README.md +73 -0
- package/dist/libs/instance-factories/applications/README.md +51 -0
- package/dist/libs/instance-factories/applications/generic-app.yaml +52 -0
- package/{libs/instance-factories/applications/react-app.yaml → dist/libs/instance-factories/applications/react-app-runtime.yaml} +30 -77
- package/dist/libs/instance-factories/applications/react-app-starter.yaml +143 -0
- package/dist/libs/instance-factories/applications/templates/react/env-example-generator.js +24 -2
- package/dist/libs/instance-factories/applications/templates/react/vite-config-generator.js +54 -33
- package/dist/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/api-types-starter-generator.js +69 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.js +110 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/belongs-to.js +40 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.js +129 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/detail-body-composer.js +80 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/form-body-composer.js +217 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/helpers-emitter.js +51 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/html-to-jsx.js +192 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/list-body-composer.js +56 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/orchestrator.js +41 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/package-json-generator.js +38 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/regen-safety.js +89 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +49 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +96 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +116 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +74 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/use-api-hooks-starter-generator.js +95 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/view-emitter.js +81 -0
- package/dist/libs/instance-factories/applications/templates/react-starter/views-generator.js +66 -0
- package/dist/libs/instance-factories/archived/fastify-prisma.yaml +104 -0
- package/dist/libs/instance-factories/cli/README.md +43 -0
- package/dist/libs/instance-factories/cli/commander-js.yaml +55 -0
- package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +63 -12
- package/dist/libs/instance-factories/communication/README.md +47 -0
- package/dist/libs/instance-factories/communication/event-emitter.yaml +60 -0
- package/dist/libs/instance-factories/communication/rabbitmq-events.yaml +87 -0
- package/dist/libs/instance-factories/controllers/README.md +42 -0
- package/dist/libs/instance-factories/controllers/fastify.yaml +139 -0
- package/dist/libs/instance-factories/controllers/templates/fastify/server-generator.js +29 -2
- package/dist/libs/instance-factories/infrastructure/README.md +29 -0
- package/dist/libs/instance-factories/infrastructure/docker-k8s.yaml +61 -0
- package/dist/libs/instance-factories/orms/README.md +54 -0
- package/dist/libs/instance-factories/orms/prisma.yaml +89 -0
- package/dist/libs/instance-factories/orms/templates/prisma/schema-generator.js +2 -2
- package/dist/libs/instance-factories/scaffolding/README.md +49 -0
- package/dist/libs/instance-factories/scaffolding/generic-scaffold.yaml +65 -0
- package/dist/libs/instance-factories/sdks/README.md +28 -0
- package/dist/libs/instance-factories/sdks/python-sdk.yaml +66 -0
- package/dist/libs/instance-factories/sdks/typescript-sdk.yaml +59 -0
- package/dist/libs/instance-factories/services/README.md +55 -0
- package/dist/libs/instance-factories/services/prisma-services.yaml +71 -0
- package/dist/libs/instance-factories/storage/README.md +34 -0
- package/dist/libs/instance-factories/storage/mongodb.yaml +79 -0
- package/dist/libs/instance-factories/storage/postgresql.yaml +75 -0
- package/dist/libs/instance-factories/storage/redis.yaml +79 -0
- package/dist/libs/instance-factories/testing/README.md +40 -0
- package/dist/libs/instance-factories/testing/vitest-tests.yaml +63 -0
- package/dist/libs/instance-factories/tools/README.md +70 -0
- package/dist/libs/instance-factories/tools/mcp.yaml +36 -0
- package/dist/libs/instance-factories/tools/vscode.yaml +35 -0
- package/dist/libs/instance-factories/validation/README.md +38 -0
- package/dist/libs/instance-factories/validation/zod.yaml +56 -0
- package/dist/realize/engines/code-generator.d.ts.map +1 -1
- package/dist/realize/engines/code-generator.js +3 -0
- package/dist/realize/engines/code-generator.js.map +1 -1
- package/dist/realize/index.d.ts.map +1 -1
- package/dist/realize/index.js +15 -22
- package/dist/realize/index.js.map +1 -1
- package/dist/registry/utils/manifest-adapter.d.ts +8 -1
- package/dist/registry/utils/manifest-adapter.d.ts.map +1 -1
- package/dist/registry/utils/manifest-adapter.js +8 -1
- package/dist/registry/utils/manifest-adapter.js.map +1 -1
- package/libs/instance-factories/applications/react-app-starter.yaml +143 -0
- package/libs/instance-factories/applications/templates/react/env-example-generator.ts +24 -2
- package/libs/instance-factories/applications/templates/react/vite-config-generator.ts +54 -33
- package/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/dashboard-body-composer.test.ts +153 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/detail-body-composer.test.ts +146 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/form-body-composer.test.ts +188 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/helpers-emitter.test.ts +55 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/html-to-jsx.test.ts +140 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/list-body-composer.test.ts +146 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/orchestrator.test.ts +184 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p2-factory-imports.test.ts +116 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p3-rendered-output.test.ts +183 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/regen-safety.test.ts +144 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/starter-generators.test.ts +114 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/view-emitter.test.ts +107 -0
- package/libs/instance-factories/applications/templates/react-starter/__tests__/views-generator.test.ts +139 -0
- package/libs/instance-factories/applications/templates/react-starter/api-types-starter-generator.ts +98 -0
- package/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.ts +141 -0
- package/libs/instance-factories/applications/templates/react-starter/belongs-to.ts +82 -0
- package/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.ts +189 -0
- package/libs/instance-factories/applications/templates/react-starter/detail-body-composer.ts +135 -0
- package/libs/instance-factories/applications/templates/react-starter/form-body-composer.ts +383 -0
- package/libs/instance-factories/applications/templates/react-starter/helpers-emitter.ts +66 -0
- package/libs/instance-factories/applications/templates/react-starter/html-to-jsx.ts +334 -0
- package/libs/instance-factories/applications/templates/react-starter/list-body-composer.ts +146 -0
- package/libs/instance-factories/applications/templates/react-starter/orchestrator.ts +95 -0
- package/libs/instance-factories/applications/templates/react-starter/package-json-generator.ts +57 -0
- package/libs/instance-factories/applications/templates/react-starter/regen-safety.ts +157 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +49 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +96 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +116 -0
- package/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +74 -0
- package/libs/instance-factories/applications/templates/react-starter/use-api-hooks-starter-generator.ts +124 -0
- package/libs/instance-factories/applications/templates/react-starter/view-emitter.ts +209 -0
- package/libs/instance-factories/applications/templates/react-starter/views-generator.ts +137 -0
- package/libs/instance-factories/cli/templates/commander/command-generator.ts +63 -12
- package/libs/instance-factories/controllers/fastify.yaml +7 -0
- package/libs/instance-factories/controllers/templates/fastify/server-generator.ts +36 -2
- package/libs/instance-factories/orms/templates/prisma/schema-generator.ts +11 -4
- package/package.json +3 -3
- package/dist/libs/instance-factories/applications/templates/react/_view-components-source.js +0 -530
- package/dist/libs/instance-factories/applications/templates/react/app-tsx-generator.js +0 -73
- package/dist/libs/instance-factories/applications/templates/react/field-helpers-generator.js +0 -99
- package/dist/libs/instance-factories/applications/templates/react/package-json-generator.js +0 -49
- package/dist/libs/instance-factories/applications/templates/react/pattern-adapter-generator.js +0 -156
- package/dist/libs/instance-factories/applications/templates/react/react-pattern-adapter.js +0 -935
- package/dist/libs/instance-factories/applications/templates/react/relationship-field-generator.js +0 -143
- package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.js +0 -646
- package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.js +0 -65
- package/dist/libs/instance-factories/applications/templates/react/view-dashboard-generator.js +0 -143
- package/dist/libs/instance-factories/applications/templates/react/view-detail-generator.js +0 -143
- package/dist/libs/instance-factories/applications/templates/react/view-form-generator.js +0 -355
- package/dist/libs/instance-factories/applications/templates/react/view-list-generator.js +0 -91
- package/dist/libs/instance-factories/applications/templates/react/view-router-generator.js +0 -79
- package/dist/libs/instance-factories/views/index.js +0 -48
- package/dist/libs/instance-factories/views/templates/react/adapters/antd-adapter.js +0 -742
- package/dist/libs/instance-factories/views/templates/react/adapters/mui-adapter.js +0 -824
- package/dist/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.js +0 -719
- package/dist/libs/instance-factories/views/templates/react/app-generator.js +0 -45
- package/dist/libs/instance-factories/views/templates/react/components-generator.js +0 -820
- package/dist/libs/instance-factories/views/templates/react/forms-generator.js +0 -275
- package/dist/libs/instance-factories/views/templates/react/frontend-package-json-generator.js +0 -46
- package/dist/libs/instance-factories/views/templates/react/hooks-generator.js +0 -81
- package/dist/libs/instance-factories/views/templates/react/index-css-generator.js +0 -9
- package/dist/libs/instance-factories/views/templates/react/index-html-generator.js +0 -23
- package/dist/libs/instance-factories/views/templates/react/main-tsx-generator.js +0 -21
- package/dist/libs/instance-factories/views/templates/react/react-component-generator.js +0 -299
- package/dist/libs/instance-factories/views/templates/react/router-generator.js +0 -136
- package/dist/libs/instance-factories/views/templates/react/router-generic-generator.js +0 -107
- package/dist/libs/instance-factories/views/templates/react/shared-utils-generator.js +0 -187
- package/dist/libs/instance-factories/views/templates/react/spec-json-generator.js +0 -7
- package/dist/libs/instance-factories/views/templates/react/types-generator.js +0 -56
- package/dist/libs/instance-factories/views/templates/react/views-metadata-generator.js +0 -27
- package/dist/libs/instance-factories/views/templates/react/vite-config-generator.js +0 -29
- package/dist/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js +0 -261
- package/dist/libs/instance-factories/views/templates/shared/adapter-types.js +0 -34
- package/dist/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -800
- package/dist/libs/instance-factories/views/templates/shared/base-generator.js +0 -305
- package/dist/libs/instance-factories/views/templates/shared/component-metadata.js +0 -517
- package/dist/libs/instance-factories/views/templates/shared/composite-pattern-types.js +0 -0
- package/dist/libs/instance-factories/views/templates/shared/composite-patterns.js +0 -445
- package/dist/libs/instance-factories/views/templates/shared/index.js +0 -80
- package/dist/libs/instance-factories/views/templates/shared/pattern-validator.js +0 -210
- package/dist/libs/instance-factories/views/templates/shared/property-mapper.js +0 -492
- package/dist/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -321
- package/dist/realize/index.js.bak +0 -758
- package/libs/instance-factories/applications/templates/react/_view-components-source.ts +0 -555
- package/libs/instance-factories/applications/templates/react/app-tsx-generator.ts +0 -94
- package/libs/instance-factories/applications/templates/react/field-helpers-generator.ts +0 -106
- package/libs/instance-factories/applications/templates/react/package-json-generator.ts +0 -57
- package/libs/instance-factories/applications/templates/react/pattern-adapter-generator.ts +0 -179
- package/libs/instance-factories/applications/templates/react/react-pattern-adapter.tsx +0 -1347
- package/libs/instance-factories/applications/templates/react/relationship-field-generator.ts +0 -150
- package/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.ts +0 -704
- package/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.ts +0 -84
- package/libs/instance-factories/applications/templates/react/view-dashboard-generator.ts +0 -150
- package/libs/instance-factories/applications/templates/react/view-detail-generator.ts +0 -150
- package/libs/instance-factories/applications/templates/react/view-form-generator.ts +0 -362
- package/libs/instance-factories/applications/templates/react/view-list-generator.ts +0 -98
- package/libs/instance-factories/applications/templates/react/view-router-generator.ts +0 -89
- package/libs/instance-factories/views/README.md +0 -62
- package/libs/instance-factories/views/index.d.ts +0 -13
- package/libs/instance-factories/views/index.d.ts.map +0 -1
- package/libs/instance-factories/views/index.js +0 -18
- package/libs/instance-factories/views/index.js.map +0 -1
- package/libs/instance-factories/views/index.ts +0 -45
- package/libs/instance-factories/views/react-components.yaml +0 -129
- package/libs/instance-factories/views/templates/ARCHITECTURE.md +0 -198
- package/libs/instance-factories/views/templates/react/adapters/antd-adapter.ts +0 -869
- package/libs/instance-factories/views/templates/react/adapters/mui-adapter.ts +0 -953
- package/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.ts +0 -806
- package/libs/instance-factories/views/templates/react/app-generator.ts +0 -55
- package/libs/instance-factories/views/templates/react/components-generator.ts +0 -938
- package/libs/instance-factories/views/templates/react/forms-generator.ts +0 -325
- package/libs/instance-factories/views/templates/react/frontend-package-json-generator.ts +0 -57
- package/libs/instance-factories/views/templates/react/hooks-generator.ts +0 -106
- package/libs/instance-factories/views/templates/react/index-css-generator.ts +0 -14
- package/libs/instance-factories/views/templates/react/index-html-generator.ts +0 -34
- package/libs/instance-factories/views/templates/react/main-tsx-generator.ts +0 -29
- package/libs/instance-factories/views/templates/react/react-component-generator.d.ts +0 -152
- package/libs/instance-factories/views/templates/react/react-component-generator.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/react/react-component-generator.js +0 -398
- package/libs/instance-factories/views/templates/react/react-component-generator.js.map +0 -1
- package/libs/instance-factories/views/templates/react/react-component-generator.ts +0 -533
- package/libs/instance-factories/views/templates/react/router-generator.ts +0 -197
- package/libs/instance-factories/views/templates/react/router-generic-generator.ts +0 -132
- package/libs/instance-factories/views/templates/react/shared-utils-generator.ts +0 -196
- package/libs/instance-factories/views/templates/react/spec-json-generator.ts +0 -17
- package/libs/instance-factories/views/templates/react/types-generator.ts +0 -76
- package/libs/instance-factories/views/templates/react/views-metadata-generator.ts +0 -42
- package/libs/instance-factories/views/templates/react/vite-config-generator.ts +0 -38
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js.map +0 -1
- package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.ts +0 -474
- package/libs/instance-factories/views/templates/shared/__tests__/composite-patterns.test.ts +0 -242
- package/libs/instance-factories/views/templates/shared/adapter-types.d.ts +0 -77
- package/libs/instance-factories/views/templates/shared/adapter-types.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/adapter-types.js +0 -47
- package/libs/instance-factories/views/templates/shared/adapter-types.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/adapter-types.ts +0 -142
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts +0 -63
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -822
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/atomic-components-registry.ts +0 -908
- package/libs/instance-factories/views/templates/shared/base-generator.d.ts +0 -247
- package/libs/instance-factories/views/templates/shared/base-generator.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/base-generator.js +0 -363
- package/libs/instance-factories/views/templates/shared/base-generator.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/base-generator.ts +0 -608
- package/libs/instance-factories/views/templates/shared/component-metadata.d.ts +0 -254
- package/libs/instance-factories/views/templates/shared/component-metadata.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/component-metadata.js +0 -602
- package/libs/instance-factories/views/templates/shared/component-metadata.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/component-metadata.ts +0 -803
- package/libs/instance-factories/views/templates/shared/composite-pattern-types.ts +0 -250
- package/libs/instance-factories/views/templates/shared/composite-patterns.ts +0 -535
- package/libs/instance-factories/views/templates/shared/index.ts +0 -68
- package/libs/instance-factories/views/templates/shared/pattern-validator.ts +0 -279
- package/libs/instance-factories/views/templates/shared/property-mapper.d.ts +0 -149
- package/libs/instance-factories/views/templates/shared/property-mapper.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/property-mapper.js +0 -580
- package/libs/instance-factories/views/templates/shared/property-mapper.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/property-mapper.ts +0 -700
- package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts +0 -143
- package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts.map +0 -1
- package/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -420
- package/libs/instance-factories/views/templates/shared/syntax-mapper.js.map +0 -1
- package/libs/instance-factories/views/templates/shared/syntax-mapper.ts +0 -539
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for Composite View Patterns
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { describe, it, expect } from 'vitest';
|
|
6
|
-
import {
|
|
7
|
-
COMPOSITE_VIEW_PATTERNS,
|
|
8
|
-
FORM_VIEW_PATTERN,
|
|
9
|
-
LIST_VIEW_PATTERN,
|
|
10
|
-
DETAIL_VIEW_PATTERN,
|
|
11
|
-
DASHBOARD_VIEW_PATTERN,
|
|
12
|
-
getPattern,
|
|
13
|
-
getPatternsByCategory,
|
|
14
|
-
getPatternsByTag,
|
|
15
|
-
getPatternIds,
|
|
16
|
-
hasPattern
|
|
17
|
-
} from '../composite-patterns.js';
|
|
18
|
-
import { validatePattern, validatePatternRegistry } from '../pattern-validator.js';
|
|
19
|
-
|
|
20
|
-
describe('Composite View Patterns', () => {
|
|
21
|
-
describe('Pattern Registry', () => {
|
|
22
|
-
it('should export all 4 core patterns', () => {
|
|
23
|
-
expect(Object.keys(COMPOSITE_VIEW_PATTERNS)).toHaveLength(4);
|
|
24
|
-
expect(COMPOSITE_VIEW_PATTERNS['form-view']).toBeDefined();
|
|
25
|
-
expect(COMPOSITE_VIEW_PATTERNS['list-view']).toBeDefined();
|
|
26
|
-
expect(COMPOSITE_VIEW_PATTERNS['detail-view']).toBeDefined();
|
|
27
|
-
expect(COMPOSITE_VIEW_PATTERNS['dashboard-view']).toBeDefined();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('should have correct pattern IDs', () => {
|
|
31
|
-
const ids = getPatternIds();
|
|
32
|
-
expect(ids).toContain('form-view');
|
|
33
|
-
expect(ids).toContain('list-view');
|
|
34
|
-
expect(ids).toContain('detail-view');
|
|
35
|
-
expect(ids).toContain('dashboard-view');
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
describe('FormView Pattern', () => {
|
|
40
|
-
it('should have correct identity', () => {
|
|
41
|
-
expect(FORM_VIEW_PATTERN.id).toBe('form-view');
|
|
42
|
-
expect(FORM_VIEW_PATTERN.name).toBe('FormView');
|
|
43
|
-
expect(FORM_VIEW_PATTERN.version).toBe('1.0.0');
|
|
44
|
-
expect(FORM_VIEW_PATTERN.category).toBe('data-entry');
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should require form, input, and button components', () => {
|
|
48
|
-
expect(FORM_VIEW_PATTERN.requiredAtomicComponents).toContain('form');
|
|
49
|
-
expect(FORM_VIEW_PATTERN.requiredAtomicComponents).toContain('input');
|
|
50
|
-
expect(FORM_VIEW_PATTERN.requiredAtomicComponents).toContain('button');
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should support create, update, and validate operations', () => {
|
|
54
|
-
expect(FORM_VIEW_PATTERN.supportedOperations).toContain('create');
|
|
55
|
-
expect(FORM_VIEW_PATTERN.supportedOperations).toContain('update');
|
|
56
|
-
expect(FORM_VIEW_PATTERN.supportedOperations).toContain('validate');
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('should validate successfully', () => {
|
|
60
|
-
const result = validatePattern(FORM_VIEW_PATTERN);
|
|
61
|
-
expect(result.valid).toBe(true);
|
|
62
|
-
expect(result.errors).toHaveLength(0);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
describe('ListView Pattern', () => {
|
|
67
|
-
it('should have correct identity', () => {
|
|
68
|
-
expect(LIST_VIEW_PATTERN.id).toBe('list-view');
|
|
69
|
-
expect(LIST_VIEW_PATTERN.name).toBe('ListView');
|
|
70
|
-
expect(LIST_VIEW_PATTERN.category).toBe('data-display');
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it('should require table and list components', () => {
|
|
74
|
-
expect(LIST_VIEW_PATTERN.requiredAtomicComponents).toContain('table');
|
|
75
|
-
expect(LIST_VIEW_PATTERN.requiredAtomicComponents).toContain('list');
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('should support retrieve_many operation', () => {
|
|
79
|
-
expect(LIST_VIEW_PATTERN.supportedOperations).toContain('retrieve_many');
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it('should validate successfully', () => {
|
|
83
|
-
const result = validatePattern(LIST_VIEW_PATTERN);
|
|
84
|
-
expect(result.valid).toBe(true);
|
|
85
|
-
expect(result.errors).toHaveLength(0);
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
describe('DetailView Pattern', () => {
|
|
90
|
-
it('should have correct identity', () => {
|
|
91
|
-
expect(DETAIL_VIEW_PATTERN.id).toBe('detail-view');
|
|
92
|
-
expect(DETAIL_VIEW_PATTERN.name).toBe('DetailView');
|
|
93
|
-
expect(DETAIL_VIEW_PATTERN.category).toBe('data-display');
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it('should require content and profile components', () => {
|
|
97
|
-
expect(DETAIL_VIEW_PATTERN.requiredAtomicComponents).toContain('content');
|
|
98
|
-
expect(DETAIL_VIEW_PATTERN.requiredAtomicComponents).toContain('profile');
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it('should support retrieve, update, and delete operations', () => {
|
|
102
|
-
expect(DETAIL_VIEW_PATTERN.supportedOperations).toContain('retrieve');
|
|
103
|
-
expect(DETAIL_VIEW_PATTERN.supportedOperations).toContain('update');
|
|
104
|
-
expect(DETAIL_VIEW_PATTERN.supportedOperations).toContain('delete');
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it('should validate successfully', () => {
|
|
108
|
-
const result = validatePattern(DETAIL_VIEW_PATTERN);
|
|
109
|
-
expect(result.valid).toBe(true);
|
|
110
|
-
expect(result.errors).toHaveLength(0);
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
describe('DashboardView Pattern', () => {
|
|
115
|
-
it('should have correct identity', () => {
|
|
116
|
-
expect(DASHBOARD_VIEW_PATTERN.id).toBe('dashboard-view');
|
|
117
|
-
expect(DASHBOARD_VIEW_PATTERN.name).toBe('DashboardView');
|
|
118
|
-
expect(DASHBOARD_VIEW_PATTERN.category).toBe('dashboard');
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('should require grid and card components', () => {
|
|
122
|
-
expect(DASHBOARD_VIEW_PATTERN.requiredAtomicComponents).toContain('grid');
|
|
123
|
-
expect(DASHBOARD_VIEW_PATTERN.requiredAtomicComponents).toContain('card');
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('should support retrieve_many operation', () => {
|
|
127
|
-
expect(DASHBOARD_VIEW_PATTERN.supportedOperations).toContain('retrieve_many');
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it('should validate successfully', () => {
|
|
131
|
-
const result = validatePattern(DASHBOARD_VIEW_PATTERN);
|
|
132
|
-
expect(result.valid).toBe(true);
|
|
133
|
-
expect(result.errors).toHaveLength(0);
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
describe('Pattern Query Functions', () => {
|
|
138
|
-
it('should get pattern by ID', () => {
|
|
139
|
-
const pattern = getPattern('form-view');
|
|
140
|
-
expect(pattern).toBeDefined();
|
|
141
|
-
expect(pattern?.name).toBe('FormView');
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it('should return undefined for non-existent pattern', () => {
|
|
145
|
-
const pattern = getPattern('non-existent');
|
|
146
|
-
expect(pattern).toBeUndefined();
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it('should check if pattern exists', () => {
|
|
150
|
-
expect(hasPattern('form-view')).toBe(true);
|
|
151
|
-
expect(hasPattern('non-existent')).toBe(false);
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
it('should get patterns by category', () => {
|
|
155
|
-
const dataEntryPatterns = getPatternsByCategory('data-entry');
|
|
156
|
-
expect(dataEntryPatterns).toHaveLength(1);
|
|
157
|
-
expect(dataEntryPatterns[0].name).toBe('FormView');
|
|
158
|
-
|
|
159
|
-
const dataDisplayPatterns = getPatternsByCategory('data-display');
|
|
160
|
-
expect(dataDisplayPatterns).toHaveLength(2);
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
it('should get patterns by tag', () => {
|
|
164
|
-
const formPatterns = getPatternsByTag('form');
|
|
165
|
-
expect(formPatterns.length).toBeGreaterThan(0);
|
|
166
|
-
expect(formPatterns[0].tags).toContain('form');
|
|
167
|
-
|
|
168
|
-
const tablePatterns = getPatternsByTag('table');
|
|
169
|
-
expect(tablePatterns.length).toBeGreaterThan(0);
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
describe('Pattern Validation', () => {
|
|
174
|
-
it('should validate all patterns in registry', () => {
|
|
175
|
-
const results = validatePatternRegistry(COMPOSITE_VIEW_PATTERNS);
|
|
176
|
-
expect(Object.keys(results)).toHaveLength(4);
|
|
177
|
-
|
|
178
|
-
// All patterns should be valid
|
|
179
|
-
for (const [id, result] of Object.entries(results)) {
|
|
180
|
-
expect(result.valid).toBe(true);
|
|
181
|
-
expect(result.errors).toHaveLength(0);
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
it('should detect missing required fields', () => {
|
|
186
|
-
const invalidPattern: any = {
|
|
187
|
-
id: '',
|
|
188
|
-
name: '',
|
|
189
|
-
version: '1.0.0',
|
|
190
|
-
category: 'data-entry',
|
|
191
|
-
requiredAtomicComponents: [],
|
|
192
|
-
layoutStrategy: { type: 'single-column', responsive: true },
|
|
193
|
-
dataBindings: {
|
|
194
|
-
source: 'controller',
|
|
195
|
-
operations: []
|
|
196
|
-
},
|
|
197
|
-
supportedOperations: []
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
const result = validatePattern(invalidPattern);
|
|
201
|
-
expect(result.valid).toBe(false);
|
|
202
|
-
expect(result.errors.length).toBeGreaterThan(0);
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
it('should detect invalid category', () => {
|
|
206
|
-
const invalidPattern: any = {
|
|
207
|
-
...FORM_VIEW_PATTERN,
|
|
208
|
-
category: 'invalid-category'
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
const result = validatePattern(invalidPattern);
|
|
212
|
-
expect(result.valid).toBe(false);
|
|
213
|
-
expect(result.errors.some(e => e.field === 'category')).toBe(true);
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
it('should detect invalid version format', () => {
|
|
217
|
-
const invalidPattern: any = {
|
|
218
|
-
...FORM_VIEW_PATTERN,
|
|
219
|
-
version: 'not-a-version'
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
const result = validatePattern(invalidPattern);
|
|
223
|
-
expect(result.valid).toBe(false);
|
|
224
|
-
expect(result.errors.some(e => e.field === 'version')).toBe(true);
|
|
225
|
-
});
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
describe('Framework Independence', () => {
|
|
229
|
-
it('should have no React dependencies', () => {
|
|
230
|
-
// Patterns should be pure data structures
|
|
231
|
-
expect(typeof FORM_VIEW_PATTERN).toBe('object');
|
|
232
|
-
expect(FORM_VIEW_PATTERN.requiredAtomicComponents).toBeInstanceOf(Array);
|
|
233
|
-
expect(FORM_VIEW_PATTERN.frameworkHints).toBeDefined();
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
it('should support multiple frameworks in hints', () => {
|
|
237
|
-
expect(FORM_VIEW_PATTERN.frameworkHints?.react).toBeDefined();
|
|
238
|
-
expect(FORM_VIEW_PATTERN.frameworkHints?.vue).toBeDefined();
|
|
239
|
-
expect(FORM_VIEW_PATTERN.frameworkHints?.svelte).toBeDefined();
|
|
240
|
-
});
|
|
241
|
-
});
|
|
242
|
-
});
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component Library Adapter Types
|
|
3
|
-
*
|
|
4
|
-
* Defines the interface for UI library adapters (shadcn/ui, Material-UI, Ant Design, etc.)
|
|
5
|
-
* Each adapter implements these types to map SpecVerse atomic components to their framework.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Context passed to component render functions
|
|
9
|
-
*/
|
|
10
|
-
export interface RenderContext {
|
|
11
|
-
/** Component properties from SpecVerse spec */
|
|
12
|
-
properties: Record<string, any>;
|
|
13
|
-
/** Model definition if component is model-bound */
|
|
14
|
-
model?: any;
|
|
15
|
-
/** Component name in the spec */
|
|
16
|
-
name: string;
|
|
17
|
-
/** Child components (for containers) */
|
|
18
|
-
children?: string;
|
|
19
|
-
/** Indentation level for formatting */
|
|
20
|
-
indent?: number;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Mapping for a single atomic component type
|
|
24
|
-
*/
|
|
25
|
-
export interface ComponentMapping {
|
|
26
|
-
/** Import statement(s) needed for this component */
|
|
27
|
-
imports: string[];
|
|
28
|
-
/** Function to render the component as JSX string */
|
|
29
|
-
render: (context: RenderContext) => string;
|
|
30
|
-
/** Dependencies required for this component */
|
|
31
|
-
dependencies?: {
|
|
32
|
-
name: string;
|
|
33
|
-
version: string;
|
|
34
|
-
}[];
|
|
35
|
-
/** Optional component-specific configuration */
|
|
36
|
-
config?: Record<string, any>;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Complete UI library adapter
|
|
40
|
-
*/
|
|
41
|
-
export interface ComponentLibraryAdapter {
|
|
42
|
-
/** Library name */
|
|
43
|
-
name: string;
|
|
44
|
-
/** Library version */
|
|
45
|
-
version: string;
|
|
46
|
-
/** Description */
|
|
47
|
-
description: string;
|
|
48
|
-
/** Base dependencies for the library */
|
|
49
|
-
baseDependencies: {
|
|
50
|
-
name: string;
|
|
51
|
-
version: string;
|
|
52
|
-
}[];
|
|
53
|
-
/** Mapping for all 49 atomic component types */
|
|
54
|
-
components: Record<string, ComponentMapping>;
|
|
55
|
-
/** Optional global configuration */
|
|
56
|
-
config?: {
|
|
57
|
-
/** Import path prefix (e.g., '@/components/ui', '@mui/material') */
|
|
58
|
-
importPrefix?: string;
|
|
59
|
-
/** Whether to use default or named imports */
|
|
60
|
-
importStyle?: 'default' | 'named';
|
|
61
|
-
/** Theme configuration */
|
|
62
|
-
theme?: Record<string, any>;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Helper to render properties as JSX attributes
|
|
67
|
-
*/
|
|
68
|
-
export declare function renderProps(props: Record<string, any>): string;
|
|
69
|
-
/**
|
|
70
|
-
* Helper to indent code
|
|
71
|
-
*/
|
|
72
|
-
export declare function indent(code: string, level?: number): string;
|
|
73
|
-
/**
|
|
74
|
-
* Helper to wrap component with children
|
|
75
|
-
*/
|
|
76
|
-
export declare function wrapWithChildren(openTag: string, children: string, closeTag: string, indentLevel?: number): string;
|
|
77
|
-
//# sourceMappingURL=adapter-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-types.d.ts","sourceRoot":"","sources":["adapter-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEhC,mDAAmD;IACnD,KAAK,CAAC,EAAE,GAAG,CAAC;IAEZ,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IAEb,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,qDAAqD;IACrD,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,MAAM,CAAC;IAE3C,+CAA+C;IAC/C,YAAY,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IAEJ,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IAEb,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAEhB,kBAAkB;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,wCAAwC;IACxC,gBAAgB,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IAEJ,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAE7C,oCAAoC;IACpC,MAAM,CAAC,EAAE;QACP,oEAAoE;QACpE,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB,8CAA8C;QAC9C,WAAW,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;QAElC,0BAA0B;QAC1B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC7B,CAAC;CACH;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAuB9D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,MAAM,CAG9D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,WAAW,GAAE,MAAU,GACtB,MAAM,CAER"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component Library Adapter Types
|
|
3
|
-
*
|
|
4
|
-
* Defines the interface for UI library adapters (shadcn/ui, Material-UI, Ant Design, etc.)
|
|
5
|
-
* Each adapter implements these types to map SpecVerse atomic components to their framework.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Helper to render properties as JSX attributes
|
|
9
|
-
*/
|
|
10
|
-
export function renderProps(props) {
|
|
11
|
-
return Object.entries(props)
|
|
12
|
-
.filter(([_, value]) => value !== undefined && value !== null)
|
|
13
|
-
.map(([key, value]) => {
|
|
14
|
-
if (typeof value === 'boolean') {
|
|
15
|
-
return value ? key : '';
|
|
16
|
-
}
|
|
17
|
-
if (typeof value === 'string') {
|
|
18
|
-
return `${key}="${value}"`;
|
|
19
|
-
}
|
|
20
|
-
if (typeof value === 'number') {
|
|
21
|
-
return `${key}={${value}}`;
|
|
22
|
-
}
|
|
23
|
-
if (Array.isArray(value)) {
|
|
24
|
-
return `${key}={${JSON.stringify(value)}}`;
|
|
25
|
-
}
|
|
26
|
-
if (typeof value === 'object') {
|
|
27
|
-
return `${key}={${JSON.stringify(value)}}`;
|
|
28
|
-
}
|
|
29
|
-
return `${key}={${value}}`;
|
|
30
|
-
})
|
|
31
|
-
.filter(Boolean)
|
|
32
|
-
.join(' ');
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Helper to indent code
|
|
36
|
-
*/
|
|
37
|
-
export function indent(code, level = 0) {
|
|
38
|
-
const spaces = ' '.repeat(level);
|
|
39
|
-
return code.split('\n').map(line => line ? spaces + line : line).join('\n');
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Helper to wrap component with children
|
|
43
|
-
*/
|
|
44
|
-
export function wrapWithChildren(openTag, children, closeTag, indentLevel = 0) {
|
|
45
|
-
return `${openTag}\n${indent(children, indentLevel + 1)}\n${indent(closeTag, indentLevel)}`;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=adapter-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-types.js","sourceRoot":"","sources":["adapter-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6EH;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAA0B;IACpD,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SACzB,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;SAC7D,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1B,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,GAAG,GAAG,KAAK,KAAK,GAAG,CAAC;QAC7B,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,GAAG,GAAG,KAAK,KAAK,GAAG,CAAC;QAC7B,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,GAAG,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC;QAC7C,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,GAAG,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC;QAC7C,CAAC;QACD,OAAO,GAAG,GAAG,KAAK,KAAK,GAAG,CAAC;IAC7B,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,IAAY,EAAE,QAAgB,CAAC;IACpD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAe,EACf,QAAgB,EAChB,QAAgB,EAChB,cAAsB,CAAC;IAEvB,OAAO,GAAG,OAAO,KAAK,MAAM,CAAC,QAAQ,EAAE,WAAW,GAAG,CAAC,CAAC,KAAK,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE,CAAC;AAC9F,CAAC"}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component Library Adapter Types
|
|
3
|
-
*
|
|
4
|
-
* Defines the interface for UI library adapters (shadcn/ui, Material-UI, Ant Design, etc.)
|
|
5
|
-
* Each adapter implements these types to map SpecVerse atomic components to their framework.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Context passed to component render functions
|
|
10
|
-
*/
|
|
11
|
-
export interface RenderContext {
|
|
12
|
-
/** Component properties from SpecVerse spec */
|
|
13
|
-
properties: Record<string, any>;
|
|
14
|
-
|
|
15
|
-
/** Model definition if component is model-bound */
|
|
16
|
-
model?: any;
|
|
17
|
-
|
|
18
|
-
/** Component name in the spec */
|
|
19
|
-
name: string;
|
|
20
|
-
|
|
21
|
-
/** Child components (for containers) */
|
|
22
|
-
children?: string;
|
|
23
|
-
|
|
24
|
-
/** Indentation level for formatting */
|
|
25
|
-
indent?: number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Mapping for a single atomic component type
|
|
30
|
-
*/
|
|
31
|
-
export interface ComponentMapping {
|
|
32
|
-
/** Import statement(s) needed for this component */
|
|
33
|
-
imports: string[];
|
|
34
|
-
|
|
35
|
-
/** Function to render the component as JSX string */
|
|
36
|
-
render: (context: RenderContext) => string;
|
|
37
|
-
|
|
38
|
-
/** Dependencies required for this component */
|
|
39
|
-
dependencies?: {
|
|
40
|
-
name: string;
|
|
41
|
-
version: string;
|
|
42
|
-
}[];
|
|
43
|
-
|
|
44
|
-
/** Optional component-specific configuration */
|
|
45
|
-
config?: Record<string, any>;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Complete UI library adapter
|
|
50
|
-
*/
|
|
51
|
-
export interface ComponentLibraryAdapter {
|
|
52
|
-
/** Library name */
|
|
53
|
-
name: string;
|
|
54
|
-
|
|
55
|
-
/** Library version */
|
|
56
|
-
version: string;
|
|
57
|
-
|
|
58
|
-
/** Description */
|
|
59
|
-
description: string;
|
|
60
|
-
|
|
61
|
-
/** Base dependencies for the library */
|
|
62
|
-
baseDependencies: {
|
|
63
|
-
name: string;
|
|
64
|
-
version: string;
|
|
65
|
-
}[];
|
|
66
|
-
|
|
67
|
-
/** Mapping for all 49 atomic component types */
|
|
68
|
-
components: Record<string, ComponentMapping>;
|
|
69
|
-
|
|
70
|
-
/** Optional global configuration */
|
|
71
|
-
config?: {
|
|
72
|
-
/** Import path prefix (e.g., '@/components/ui', '@mui/material') */
|
|
73
|
-
importPrefix?: string;
|
|
74
|
-
|
|
75
|
-
/** Whether to use default or named imports */
|
|
76
|
-
importStyle?: 'default' | 'named';
|
|
77
|
-
|
|
78
|
-
/** Theme configuration */
|
|
79
|
-
theme?: Record<string, any>;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Simplified adapter interface (used by tests and runtime renderer)
|
|
85
|
-
*/
|
|
86
|
-
export interface ComponentAdapter {
|
|
87
|
-
name: string;
|
|
88
|
-
version: string;
|
|
89
|
-
description: string;
|
|
90
|
-
components: Record<string, {
|
|
91
|
-
import?: string;
|
|
92
|
-
render: (params: { properties?: Record<string, any>; children?: string }) => string;
|
|
93
|
-
}>;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Helper to render properties as JSX attributes
|
|
98
|
-
*/
|
|
99
|
-
export function renderProps(props: Record<string, any>): string {
|
|
100
|
-
return Object.entries(props)
|
|
101
|
-
.filter(([_, value]) => value !== undefined && value !== null)
|
|
102
|
-
.map(([key, value]) => {
|
|
103
|
-
if (typeof value === 'boolean') {
|
|
104
|
-
return value ? key : '';
|
|
105
|
-
}
|
|
106
|
-
if (typeof value === 'string') {
|
|
107
|
-
return `${key}="${value}"`;
|
|
108
|
-
}
|
|
109
|
-
if (typeof value === 'number') {
|
|
110
|
-
return `${key}={${value}}`;
|
|
111
|
-
}
|
|
112
|
-
if (Array.isArray(value)) {
|
|
113
|
-
return `${key}={${JSON.stringify(value)}}`;
|
|
114
|
-
}
|
|
115
|
-
if (typeof value === 'object') {
|
|
116
|
-
return `${key}={${JSON.stringify(value)}}`;
|
|
117
|
-
}
|
|
118
|
-
return `${key}={${value}}`;
|
|
119
|
-
})
|
|
120
|
-
.filter(Boolean)
|
|
121
|
-
.join(' ');
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Helper to indent code
|
|
126
|
-
*/
|
|
127
|
-
export function indent(code: string, level: number = 0): string {
|
|
128
|
-
const spaces = ' '.repeat(level);
|
|
129
|
-
return code.split('\n').map(line => line ? spaces + line : line).join('\n');
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Helper to wrap component with children
|
|
134
|
-
*/
|
|
135
|
-
export function wrapWithChildren(
|
|
136
|
-
openTag: string,
|
|
137
|
-
children: string,
|
|
138
|
-
closeTag: string,
|
|
139
|
-
indentLevel: number = 0
|
|
140
|
-
): string {
|
|
141
|
-
return `${openTag}\n${indent(children, indentLevel + 1)}\n${indent(closeTag, indentLevel)}`;
|
|
142
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Atomic Components Registry
|
|
3
|
-
*
|
|
4
|
-
* Defines all 49 atomic component types.
|
|
5
|
-
* Each type has metadata about its purpose, properties, and usage patterns.
|
|
6
|
-
*
|
|
7
|
-
* This registry is framework-agnostic. UI library adapters (shadcn, MUI, etc.)
|
|
8
|
-
* implement these types using their specific components.
|
|
9
|
-
*/
|
|
10
|
-
export interface AtomicComponentDefinition {
|
|
11
|
-
/** Component type identifier (matches schema enum) */
|
|
12
|
-
type: string;
|
|
13
|
-
/** Human-readable name */
|
|
14
|
-
name: string;
|
|
15
|
-
/** Category from v3.4 schema */
|
|
16
|
-
category: 'data-display' | 'forms-inputs' | 'actions' | 'overlays-feedback' | 'navigation' | 'layout' | 'progress' | 'specialized';
|
|
17
|
-
/** Description of component purpose */
|
|
18
|
-
description: string;
|
|
19
|
-
/** Common SpecVerse properties this component accepts */
|
|
20
|
-
properties: string[];
|
|
21
|
-
/** Whether this component can contain child components */
|
|
22
|
-
canHaveChildren: boolean;
|
|
23
|
-
/** Example usage in SpecVerse spec */
|
|
24
|
-
example: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Complete registry of all 49 atomic component types
|
|
28
|
-
*/
|
|
29
|
-
export declare const ATOMIC_COMPONENTS_REGISTRY: Record<string, AtomicComponentDefinition>;
|
|
30
|
-
/**
|
|
31
|
-
* Get component definition by type
|
|
32
|
-
*/
|
|
33
|
-
export declare function getComponentDefinition(type: string): AtomicComponentDefinition | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Get all components in a category
|
|
36
|
-
*/
|
|
37
|
-
export declare function getComponentsByCategory(category: string): AtomicComponentDefinition[];
|
|
38
|
-
/**
|
|
39
|
-
* Validate if a component type exists
|
|
40
|
-
*/
|
|
41
|
-
export declare function isValidComponentType(type: string): boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Get all component types as array
|
|
44
|
-
*/
|
|
45
|
-
export declare function getAllComponentTypes(): string[];
|
|
46
|
-
/**
|
|
47
|
-
* Component categories summary
|
|
48
|
-
*/
|
|
49
|
-
export declare const COMPONENT_CATEGORIES: {
|
|
50
|
-
readonly 'data-display': 9;
|
|
51
|
-
readonly 'forms-inputs': 11;
|
|
52
|
-
readonly actions: 5;
|
|
53
|
-
readonly 'overlays-feedback': 9;
|
|
54
|
-
readonly navigation: 5;
|
|
55
|
-
readonly layout: 6;
|
|
56
|
-
readonly progress: 2;
|
|
57
|
-
readonly specialized: 2;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Total count: 49 atomic components
|
|
61
|
-
*/
|
|
62
|
-
export declare const TOTAL_COMPONENT_COUNT = 49;
|
|
63
|
-
//# sourceMappingURL=atomic-components-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"atomic-components-registry.d.ts","sourceRoot":"","sources":["atomic-components-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,yBAAyB;IACxC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IAEb,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IAEb,gCAAgC;IAChC,QAAQ,EAAE,cAAc,GAAG,cAAc,GAAG,SAAS,GAAG,mBAAmB,GACjE,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC;IAE/D,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IAEpB,yDAAyD;IACzD,UAAU,EAAE,MAAM,EAAE,CAAC;IAErB,0DAA0D;IAC1D,eAAe,EAAE,OAAO,CAAC;IAEzB,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAuzBhF,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,yBAAyB,GAAG,SAAS,CAE1F;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,yBAAyB,EAAE,CAErF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;CASvB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC"}
|