Skip to content

Commit fc8331e

Browse files
committed
rename as to namespaceExport
1 parent fc217b8 commit fc8331e

7 files changed

Lines changed: 10 additions & 8 deletions

File tree

packages/cli/src/schema.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const moduleDeclaration = z.discriminatedUnion('type', [
1414
}),
1515
z.object({
1616
type: z.literal('namespace'),
17-
as: z.string(),
17+
namespaceExport: z.string(),
1818
}),
1919
z.object({
2020
type: z.literal('object-literal'),
@@ -27,6 +27,7 @@ const moduleDeclaration = z.discriminatedUnion('type', [
2727
),
2828
}),
2929
])
30+
export type ModuleDeclaration = z.infer<typeof moduleDeclaration>
3031

3132
type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue }
3233

@@ -46,6 +47,7 @@ const indexFile = z.object({
4647
exports: z.array(moduleDeclaration).optional(),
4748
imports: z.array(moduleDeclaration).optional(),
4849
})
50+
export type IndexFile = z.infer<typeof indexFile>
4951

5052
const registryFile = z.object({
5153
type: registryItemType,

registry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const getExportEntries = (exp: ExportDeclaration) => {
77
if (exp.getNamespaceExport()) {
88
exports.push({
99
type: 'namespace',
10-
as: exp.getNamespaceExportOrThrow().getName(),
10+
namespaceExport: exp.getNamespaceExportOrThrow().getName(),
1111
})
1212
}
1313

@@ -56,7 +56,7 @@ type ModuleDeclaration =
5656
}
5757
| {
5858
type: 'namespace'
59-
as: string
59+
namespaceExport: string
6060
}
6161
| {
6262
type: 'object-literal'

website/public/registry/components/react/avatar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"exports": [
1212
{
1313
"type": "namespace",
14-
"as": "Avatar"
14+
"namespaceExport": "Avatar"
1515
}
1616
]
1717
}

website/public/registry/components/react/card.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"exports": [
1212
{
1313
"type": "namespace",
14-
"as": "Card"
14+
"namespaceExport": "Card"
1515
}
1616
]
1717
}

website/public/registry/components/react/field.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"exports": [
1212
{
1313
"type": "namespace",
14-
"as": "Field"
14+
"namespaceExport": "Field"
1515
}
1616
]
1717
}

website/public/schema/registry-item.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@
5959
"type": {
6060
"const": "namespace"
6161
},
62-
"as": {
62+
"namespaceExport": {
6363
"type": "string"
6464
}
6565
},
66-
"required": ["type", "as"],
66+
"required": ["type", "namespaceExport"],
6767
"additionalProperties": false
6868
},
6969
{

0 commit comments

Comments
 (0)