Skip to content

Commit c9ea3ad

Browse files
fix: resolve formatting and TypeScript configuration issues
- Fix JSON formatting in registry files (arrays and objects on single lines) - Remove invalid @react-router/node type references from tsconfig.json files - Clean up TypeScript configuration to resolve build errors
1 parent e73df42 commit c9ea3ad

20 files changed

+39
-108
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"name": "medusa-forms",
33
"version": "0.1.1",
44
"private": true,
5-
"workspaces": ["apps/*", "packages/*"],
5+
"workspaces": [
6+
"apps/*",
7+
"packages/*"
8+
],
69
"scripts": {
710
"start": "yarn dev",
811
"dev": "turbo run dev",

packages/medusa-forms/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"main": "./dist/cjs/index.cjs",
55
"module": "./dist/esm/index.js",
66
"types": "./dist/types/index.d.ts",
7-
"files": ["dist"],
7+
"files": [
8+
"dist"
9+
],
810
"exports": {
911
".": {
1012
"import": {

packages/medusa-forms/registry.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@
1515
"utils": "src/lib/utils"
1616
}
1717
}
18-

packages/medusa-forms/registry/controlled-checkbox.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22
"name": "controlled-checkbox",
33
"type": "registry:ui",
44
"description": "A checkbox component with react-hook-form integration",
5-
"dependencies": [
6-
"react-hook-form"
7-
],
8-
"registryDependencies": [
9-
"field-checkbox"
10-
],
5+
"dependencies": ["react-hook-form"],
6+
"registryDependencies": ["field-checkbox"],
117
"files": [
128
{
139
"name": "controlled-checkbox.tsx",
1410
"content": "import {\n Controller,\n type ControllerProps,\n type FieldValues,\n type Path,\n type RegisterOptions,\n useFormContext,\n} from 'react-hook-form';\nimport { FieldCheckbox, type FieldCheckboxProps } from '../ui/FieldCheckbox';\n\nexport type ControlledCheckboxProps<T extends FieldValues> = Omit<FieldCheckboxProps, 'name'> &\n Omit<ControllerProps, 'render'> & {\n name: Path<T>;\n rules?: Omit<RegisterOptions<T, Path<T>>, 'disabled' | 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>;\n };\n\nexport const ControlledCheckbox = <T extends FieldValues>({\n name,\n rules,\n onChange,\n ...props\n}: ControlledCheckboxProps<T>) => {\n const {\n control,\n formState: { errors },\n } = useFormContext<T>();\n\n return (\n <Controller\n control={control}\n name={name}\n rules={rules as Omit<RegisterOptions<T, Path<T>>, 'disabled' | 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>}\n render={({ field }) => (\n <FieldCheckbox\n {...field}\n {...props}\n formErrors={errors}\n checked={field.value}\n onChange={(checked) => {\n if (onChange) onChange(checked);\n field.onChange(checked);\n }}\n />\n )}\n />\n );\n};\n\n"
1511
}
1612
]
1713
}
18-

packages/medusa-forms/registry/controlled-currency-input.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22
"name": "controlled-currency-input",
33
"type": "registry:ui",
44
"description": "A currency-input component with react-hook-form integration",
5-
"dependencies": [
6-
"react-hook-form"
7-
],
8-
"registryDependencies": [
9-
"currency-input"
10-
],
5+
"dependencies": ["react-hook-form"],
6+
"registryDependencies": ["currency-input"],
117
"files": [
128
{
139
"name": "controlled-currency-input.tsx",
1410
"content": "import type * as React from 'react';\nimport {\n Controller,\n type ControllerProps,\n type FieldValues,\n type Path,\n type RegisterOptions,\n useFormContext,\n} from 'react-hook-form';\nimport { CurrencyInput, type CurrencyInputProps } from '../ui/CurrencyInput';\n\nexport type ControlledCurrencyInputProps<T extends FieldValues> = CurrencyInputProps &\n Omit<ControllerProps, 'render' | 'control'> & {\n name: Path<T>;\n };\n\nexport const ControlledCurrencyInput = <T extends FieldValues>({\n name,\n rules,\n ...props\n}: ControlledCurrencyInputProps<T>) => {\n const { control } = useFormContext<T>();\n\n return (\n <Controller<T>\n control={control}\n name={name}\n rules={rules as Omit<RegisterOptions<T, Path<T>>, 'disabled' | 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>}\n render={({ field }) => {\n return (\n <CurrencyInput\n {...field}\n {...props}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n field.onChange(e.target.value.replace(/[^0-9.-]+/g, ''));\n }}\n />\n );\n }}\n />\n );\n};\n\n"
1511
}
1612
]
1713
}
18-

packages/medusa-forms/registry/controlled-datepicker.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22
"name": "controlled-datepicker",
33
"type": "registry:ui",
44
"description": "A datepicker component with react-hook-form integration",
5-
"dependencies": [
6-
"react-hook-form"
7-
],
8-
"registryDependencies": [
9-
"datepicker"
10-
],
5+
"dependencies": ["react-hook-form"],
6+
"registryDependencies": ["datepicker"],
117
"files": [
128
{
139
"name": "controlled-datepicker.tsx",
1410
"content": "import {\n Controller,\n type ControllerProps,\n type FieldValues,\n type Path,\n type RegisterOptions,\n useFormContext,\n} from 'react-hook-form';\nimport { DatePickerInput, type DatePickerProps } from '../ui/DatePicker';\n\nexport type ControlledDatePickerProps<T extends FieldValues> = DatePickerProps &\n Omit<ControllerProps, 'render' | 'control'> & {\n name: Path<T>;\n };\n\nexport const ControlledDatePicker = <T extends FieldValues>({\n name,\n rules,\n ...props\n}: ControlledDatePickerProps<T>) => {\n const { control } = useFormContext<T>();\n return (\n <Controller<T>\n control={control}\n name={name}\n rules={rules as Omit<RegisterOptions<T, Path<T>>, 'disabled' | 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>}\n render={({ field }) => <DatePickerInput {...field} {...props} />}\n />\n );\n};\n\n"
1511
}
1612
]
1713
}
18-

packages/medusa-forms/registry/controlled-input.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22
"name": "controlled-input",
33
"type": "registry:ui",
44
"description": "An input component with react-hook-form integration",
5-
"dependencies": [
6-
"react-hook-form"
7-
],
8-
"registryDependencies": [
9-
"input"
10-
],
5+
"dependencies": ["react-hook-form"],
6+
"registryDependencies": ["input"],
117
"files": [
128
{
139
"name": "controlled-input.tsx",
1410
"content": "import type { ComponentProps } from 'react';\nimport {\n Controller,\n type ControllerProps,\n type FieldValues,\n type Path,\n type RegisterOptions,\n useFormContext,\n} from 'react-hook-form';\nimport { Input, type InputProps } from '../ui/Input';\n\nexport type ControlledInputProps<T extends FieldValues> = InputProps &\n Omit<ControllerProps, 'render'> & {\n name: Path<T>;\n rules?: Omit<RegisterOptions<T, Path<T>>, 'disabled' | 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>;\n } & ComponentProps<typeof Input> &\n Omit<ControllerProps<T>, 'render'>;\n\nexport const ControlledInput = <T extends FieldValues>({\n name,\n rules,\n onChange,\n ...props\n}: ControlledInputProps<T>) => {\n const {\n control,\n formState: { errors },\n } = useFormContext<T>();\n\n return (\n <Controller\n control={control}\n name={name}\n rules={rules as Omit<RegisterOptions<T, Path<T>>, 'disabled' | 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>}\n render={({ field }) => (\n <Input\n {...field}\n {...props}\n labelClassName={props.labelClassName}\n formErrors={errors}\n onChange={(evt) => {\n if (onChange) {\n onChange(evt);\n }\n field.onChange(evt);\n }}\n />\n )}\n />\n );\n};\n\n"
1511
}
1612
]
1713
}
18-

packages/medusa-forms/registry/controlled-select.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22
"name": "controlled-select",
33
"type": "registry:ui",
44
"description": "A select component with react-hook-form integration",
5-
"dependencies": [
6-
"react-hook-form"
7-
],
8-
"registryDependencies": [
9-
"select"
10-
],
5+
"dependencies": ["react-hook-form"],
6+
"registryDependencies": ["select"],
117
"files": [
128
{
139
"name": "controlled-select.tsx",
1410
"content": "import type * as React from 'react';\nimport {\n Controller,\n type ControllerProps,\n type FieldPathValue,\n type FieldValues,\n type Path,\n type RegisterOptions,\n useFormContext,\n} from 'react-hook-form';\nimport { Select, type SelectProps } from '../ui/Select';\n\nexport type ControlledSelectProps<T extends FieldValues> = SelectProps &\n Omit<ControllerProps, 'render'> & {\n name: Path<T>;\n onBlur?: () => void;\n onChange?: (value: unknown) => void;\n } & (\n | {\n options: { label: React.ReactNode; value: FieldPathValue<T, Path<T>> }[];\n children?: never;\n }\n | {\n options?: never;\n children: React.ReactNode;\n }\n );\n\nexport const ControlledSelect = <T extends FieldValues>({\n name,\n rules,\n children,\n options,\n onChange,\n onBlur,\n ...props\n}: ControlledSelectProps<T>) => {\n const { control } = useFormContext<T>();\n return (\n <Controller<T>\n control={control}\n name={name}\n rules={rules as Omit<RegisterOptions<T, Path<T>>, 'disabled' | 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>}\n render={({ field }) => {\n const handleChange = (value: unknown) => {\n if (typeof onChange === 'function') onChange(value);\n field.onChange(value);\n };\n\n if (options) {\n return (\n <Select {...({ ...field, ...props, onValueChange: handleChange } as SelectProps)}>\n <Select.Trigger>\n <Select.Value />\n </Select.Trigger>\n <Select.Content>\n {options.map((option) => (\n <Select.Item key={option.value} value={option.value}>\n {option.label}\n </Select.Item>\n ))}\n </Select.Content>\n </Select>\n );\n }\n\n return <Select {...({ ...field, ...props, onValueChange: handleChange } as SelectProps)}>{children}</Select>;\n }}\n />\n );\n};\n\n"
1511
}
1612
]
1713
}
18-

packages/medusa-forms/registry/controlled-textarea.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22
"name": "controlled-textarea",
33
"type": "registry:ui",
44
"description": "A textarea component with react-hook-form integration",
5-
"dependencies": [
6-
"react-hook-form"
7-
],
8-
"registryDependencies": [
9-
"textarea"
10-
],
5+
"dependencies": ["react-hook-form"],
6+
"registryDependencies": ["textarea"],
117
"files": [
128
{
139
"name": "controlled-textarea.tsx",
1410
"content": "import type * as React from 'react';\nimport {\n Controller,\n type ControllerProps,\n type FieldValues,\n type Path,\n type RegisterOptions,\n useFormContext,\n} from 'react-hook-form';\nimport { TextArea, type TextAreaProps } from '../ui/TextArea';\n\nexport type ControlledTextAreaProps<T extends FieldValues> = TextAreaProps &\n Omit<ControllerProps, 'render'> & {\n name: Path<T>;\n rules?: RegisterOptions<T, Path<T>>;\n } & React.ComponentProps<typeof TextArea> &\n Omit<ControllerProps<T>, 'render'>;\n\nexport const ControlledTextArea = <T extends FieldValues>({ name, rules, ...props }: ControlledTextAreaProps<T>) => {\n const { control } = useFormContext<T>();\n return (\n <Controller<T>\n control={control}\n name={name}\n rules={rules}\n render={({ field }) => <TextArea {...field} {...props} />}\n />\n );\n};\n\n"
1511
}
1612
]
1713
}
18-

packages/medusa-forms/registry/currency-input.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22
"name": "currency-input",
33
"type": "registry:ui",
44
"description": "currency-input component",
5-
"dependencies": [
6-
"@medusajs/ui"
7-
],
8-
"registryDependencies": [
9-
"field-wrapper"
10-
],
5+
"dependencies": ["@medusajs/ui"],
6+
"registryDependencies": ["field-wrapper"],
117
"files": [
128
{
139
"name": "currency-input.tsx",
1410
"content": "import { CurrencyInput as MedusaCurrencyInput } from '@medusajs/ui';\nimport { forwardRef } from 'react';\nimport { FieldWrapper } from './FieldWrapper';\nimport type { BasicFieldProps, MedusaCurrencyInputProps } from './types';\n\nexport type CurrencyInputProps = MedusaCurrencyInputProps & BasicFieldProps;\n\nconst Wrapper = FieldWrapper<CurrencyInputProps>;\n\nexport const CurrencyInput = forwardRef<HTMLInputElement, CurrencyInputProps>((props, ref) => (\n <Wrapper {...props}>{(inputProps) => <MedusaCurrencyInput {...inputProps} ref={ref} />}</Wrapper>\n));\n\nCurrencyInput.displayName = 'CurrencyInput';\n"
1511
}
1612
]
1713
}
18-

0 commit comments

Comments
 (0)