Skip to content

Commit db08900

Browse files
committed
fix: Fix add type
1 parent 04e4760 commit db08900

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.changeset/dirty-schools-obey.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"jsrepo": patch
3+
---
4+
5+
fix: Fix add type
6+

packages/jsrepo/src/utils/config/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ export type RegistryItemType = LooseAutocomplete<
119119
'block' | 'component' | 'lib' | 'hook' | 'ui' | 'page'
120120
>;
121121

122-
export const RegistryItemAddSchema = z.enum([
122+
export const RegistryItemAddOptions = [
123123
'optionally-on-init',
124124
'on-init',
125125
'when-needed',
126126
'when-added',
127-
]);
128-
129-
export type RegistryItemAdd = z.infer<typeof RegistryItemAddSchema>;
127+
] as const;
128+
export const RegistryItemAddSchema = z.enum(RegistryItemAddOptions);
129+
export type RegistryItemAdd = (typeof RegistryItemAddOptions)[number];
130130

131131
export type RegistryItem = {
132132
/** The name of the item. MUST be unique. Spaces are NOT allowed. */

0 commit comments

Comments
 (0)