@astryxdesign/cli 0.1.6-canary.e8d4c3f → 0.1.6-canary.eb23da7
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/package.json +9 -9
- package/src/api/template.mjs +1 -1
- package/src/codemods/__tests__/registry.test.mjs +0 -1
- package/src/codemods/registry.mjs +0 -1
- package/src/config.mjs +14 -5
- package/src/doc.mjs +261 -17
- package/src/integration.mjs +15 -4
- package/src/lib/component-format.mjs +13 -45
- package/src/lib/component-format.test.mjs +1 -95
- package/src/lib/component-loader.mjs +3 -52
- package/src/lib/hook-format.mjs +3 -8
- package/src/template.mjs +67 -9
- package/src/types/config.d.ts +66 -11
- package/src/types/doc.d.ts +135 -19
- package/src/types/integration.d.ts +18 -7
- package/src/types/template-api.d.ts +50 -14
- package/templates/pages/ide/page.tsx +41 -35
- package/src/codemods/transforms/v0.1.7/__tests__/migrate-table-tableprops-to-direct-props.test.mjs +0 -120
- package/src/codemods/transforms/v0.1.7/index.mjs +0 -19
- package/src/codemods/transforms/v0.1.7/migrate-table-tableprops-to-direct-props.mjs +0 -188
- package/src/lib/componentDocOverlay.test.mjs +0 -111
- package/src/schemas/doc-schema.mjs +0 -226
- package/src/schemas/template-schema.mjs +0 -47
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @file Template load-boundary schemas.
|
|
5
|
-
*
|
|
6
|
-
* The Zod schemas that integration template discovery runs a module's default
|
|
7
|
-
* export through (see `loadModuleWithSchema`). Kept free of any
|
|
8
|
-
* `@astryxdesign/core` import so the hot path that loads them (template
|
|
9
|
-
* discovery, `astryx init`) does not require core's built `dist/`. The
|
|
10
|
-
* authoring factories live in `@astryxdesign/core/authoring` and are re-exported
|
|
11
|
-
* from `../template.mjs` for the public `@astryxdesign/cli/template` surface.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import {z} from 'zod';
|
|
15
|
-
|
|
16
|
-
const PreviewSchema = z
|
|
17
|
-
.object({
|
|
18
|
-
image: z.string().optional(),
|
|
19
|
-
aspectRatio: z.string().optional(),
|
|
20
|
-
})
|
|
21
|
-
.strict();
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Shared authored-template shape. `type` is injected by the create* helpers,
|
|
25
|
-
* so authors never write it. Inline source/sourceFile are intentionally NOT
|
|
26
|
-
* part of v1 — a template's source is the required same-stem sibling file.
|
|
27
|
-
* Exported so integration template discovery can validate the stamped result.
|
|
28
|
-
*/
|
|
29
|
-
export const BaseTemplateSchema = z
|
|
30
|
-
.object({
|
|
31
|
-
name: z.string().min(1, 'name is required'),
|
|
32
|
-
description: z.string().min(1, 'description is required'),
|
|
33
|
-
category: z.string().optional(),
|
|
34
|
-
componentsUsed: z.array(z.string()).optional(),
|
|
35
|
-
preview: PreviewSchema.optional(),
|
|
36
|
-
})
|
|
37
|
-
.strict();
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* The metadata envelope integration template discovery validates: a stamped
|
|
41
|
-
* template doc. This is the LOAD-boundary contract — a hand-written plain
|
|
42
|
-
* object that matches this shape is accepted (discovery does not check "was it
|
|
43
|
-
* made by the factory", only the shape).
|
|
44
|
-
*/
|
|
45
|
-
export const TemplateEnvelopeSchema = BaseTemplateSchema.extend({
|
|
46
|
-
type: z.enum(['page', 'block']),
|
|
47
|
-
});
|