Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

[bot] Run grit migration: Apply a GritQL pattern #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ const App: React.FC = () => {
);
};

export default App;
export const app = App;
2 changes: 1 addition & 1 deletion app/src/autoUnregister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const options = [
{ value: 'vanilla', label: 'Vanilla' },
];

export default function AutoUnregister() {
export function AutoUnregister() {
const { register, control, handleSubmit } = useForm<{
test: string;
test1: string;
Expand Down
2 changes: 1 addition & 1 deletion app/src/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ const Basic: React.FC = () => {
);
};

export default Basic;
export const basic = Basic;
2 changes: 1 addition & 1 deletion app/src/basicSchemaValidation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ const BasicSchemaValidation: React.FC = () => {
);
};

export default BasicSchemaValidation;
export const basicSchemaValidation = BasicSchemaValidation;
2 changes: 1 addition & 1 deletion app/src/conditionalField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ const ConditionalField: React.FC = () => {
);
};

export default ConditionalField;
export const conditionalField = ConditionalField;
2 changes: 1 addition & 1 deletion app/src/controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Form = {

const PureReactSelect = React.memo(ReactSelect);

export default function Field() {
export function Field() {
const { mode } = useParams();
const methods = useForm<Form>({
defaultValues,
Expand Down
2 changes: 1 addition & 1 deletion app/src/crossFrameForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ const FrameForm: React.FC = () => {
);
};

export default CrossFrameForm;
export const crossFrameForm = CrossFrameForm;
2 changes: 1 addition & 1 deletion app/src/customSchemaValidation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ const BasicSchemaValidation: React.FC = () => {
);
};

export default BasicSchemaValidation;
export const customSchemaValidation = BasicSchemaValidation;
2 changes: 1 addition & 1 deletion app/src/defaultValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ function DefaultValues() {
);
}

export default DefaultValues;
export const defaultValues = DefaultValues;
2 changes: 1 addition & 1 deletion app/src/formState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ const FormState = () => {
);
};

export default FormState;
export const formState = FormState;
2 changes: 1 addition & 1 deletion app/src/formStateWithNestedFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ const FormStateWithNestedFields = () => {
);
};

export default FormStateWithNestedFields;
export const formStateWithNestedFields = FormStateWithNestedFields;
2 changes: 1 addition & 1 deletion app/src/formStateWithSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ const FormStateWithSchema: React.FC = () => {
);
};

export default FormStateWithSchema;
export const formStateWithSchema = FormStateWithSchema;
2 changes: 1 addition & 1 deletion app/src/isValid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ const IsValid: React.FC = () => {
);
};

export default IsValid;
export const isValid = IsValid;
2 changes: 1 addition & 1 deletion app/src/manualRegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,4 @@ const ManualRegisterForm: React.FC = () => {
);
};

export default ManualRegisterForm;
export const manualRegisterForm = ManualRegisterForm;
2 changes: 1 addition & 1 deletion app/src/reValidateMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ const Basic: React.FC = () => {
);
};

export default Basic;
export const reValidateMode = Basic;
2 changes: 1 addition & 1 deletion app/src/reset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ function Reset() {
);
}

export default Reset;
export const reset = Reset;
2 changes: 1 addition & 1 deletion app/src/setError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ const SetError: React.FC = () => {
);
};

export default SetError;
export const setError = SetError;
2 changes: 1 addition & 1 deletion app/src/setFocus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ const SetFocus = () => {
);
};

export default SetFocus;
export const setFocus = SetFocus;
2 changes: 1 addition & 1 deletion app/src/setValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ const SetValue: React.FC = () => {
);
};

export default SetValue;
export const setValue = SetValue;
2 changes: 1 addition & 1 deletion app/src/setValueCustomRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ const SetValueCustomRegister: React.FC = () => {
);
};

export default SetValueCustomRegister;
export const setValueCustomRegister = SetValueCustomRegister;
2 changes: 1 addition & 1 deletion app/src/setValueStrictMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ const SetValueAsyncStrictMode = () => {
);
};

export default SetValueAsyncStrictMode;
export const setValueStrictMode = SetValueAsyncStrictMode;
2 changes: 1 addition & 1 deletion app/src/setValueWithSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ const SetValueWithSchema: React.FC = () => {
);
};

export default SetValueWithSchema;
export const setValueWithSchema = SetValueWithSchema;
2 changes: 1 addition & 1 deletion app/src/setValueWithTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ const SetValueWithTrigger: React.FC = () => {
);
};

export default SetValueWithTrigger;
export const setValueWithTrigger = SetValueWithTrigger;
2 changes: 1 addition & 1 deletion app/src/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ const Component = () => {
);
};

export default Component;
export const test = Component;
2 changes: 1 addition & 1 deletion app/src/triggerValidation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ function TriggerValidation() {
);
}

export default TriggerValidation;
export const triggerValidation = TriggerValidation;
2 changes: 1 addition & 1 deletion app/src/useFieldArray.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,4 @@ const UseFieldArray: React.FC = () => {
);
};

export default UseFieldArray;
export const useFieldArray = UseFieldArray;
2 changes: 1 addition & 1 deletion app/src/useFieldArrayNested.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function NestedArray({
);
}

export default () => {
export const useFieldArrayNested = () => {
const { register, control, reset, setValue, handleSubmit } =
useForm<FormValues>({
defaultValues: {
Expand Down
2 changes: 1 addition & 1 deletion app/src/useFieldArrayUnregister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ const UseFieldArrayUnregister: React.FC = () => {
);
};

export default UseFieldArrayUnregister;
export const useFieldArrayUnregister = UseFieldArrayUnregister;
2 changes: 1 addition & 1 deletion app/src/useFormState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const SubForm = ({ control }: { control: Control<FormInputs> }) => {
);
};

export const UseFormState: React.FC = () => {
export const useFormState = const UseFormState: React.FC = () => {
const { register, handleSubmit, control, reset } = useForm<FormInputs>({
mode: 'onChange',
});
Expand Down
2 changes: 1 addition & 1 deletion app/src/useWatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const Child = ({ control }: { control: Control<FormInputs> }) => {
);
};

export default () => {
export const useWatch = () => {
const { register, control } = useForm<FormInputs>();

counter++;
Expand Down
2 changes: 1 addition & 1 deletion app/src/useWatchUseFieldArrayNested.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function NestedArray({
);
}

export default () => {
export const useWatchUseFieldArrayNested = () => {
const { register, control, reset, setValue, handleSubmit } =
useForm<FormValues>({
defaultValues: {
Expand Down
2 changes: 1 addition & 1 deletion app/src/validateFieldCriteria.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,4 @@ const ValidateFieldCriteria: React.FC = () => {
);
};

export default ValidateFieldCriteria;
export const validateFieldCriteria = ValidateFieldCriteria;
2 changes: 1 addition & 1 deletion app/src/watch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ const Watch: React.FC = () => {
);
};

export default Watch;
export const watch = Watch;
2 changes: 1 addition & 1 deletion app/src/watchDefaultValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ function WatchDefaultValues() {
);
}

export default WatchDefaultValues;
export const watchDefaultValues = WatchDefaultValues;
2 changes: 1 addition & 1 deletion app/src/watchUseFieldArray.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ const WatchUseFieldArray: React.FC = () => {
);
};

export default WatchUseFieldArray;
export const watchUseFieldArray = WatchUseFieldArray;
2 changes: 1 addition & 1 deletion app/src/watchUseFieldArrayNested.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function NestedArray({
);
}

export default () => {
export const watchUseFieldArrayNested = () => {
const { register, control, reset, setValue, handleSubmit, watch } =
useForm<FormValues>({
defaultValues: {
Expand Down
2 changes: 1 addition & 1 deletion app/src/welcome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,4 @@ const Component: React.FC = () => {
);
};

export default Component;
export const index = Component;
16 changes: 8 additions & 8 deletions app/src/welcome/styles.ts
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
export const page: object = {
export const styles = const page: object = {
minHeight: '100vh',
color: 'white',
padding: '1rem',
fontFamily:
'Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif',
};

export const h1: object = {
export const styles = const h1: object = {
fontSize: '4rem',
fontWeight: '600',
textAlign: 'center',
marginBottom: '1rem',
};

export const h2: object = {
export const styles = const h2: object = {
color: '#ec5990',
marginBottom: '2rem',
fontSize: '1.5rem',
textAlign: 'center',
};

export const items: object = {
export const styles = const items: object = {
display: 'grid',
gap: '1rem',
gridTemplateColumns: '1fr 1fr 1fr',
};

export const item: object = {
export const styles = const item: object = {
border: '1px solid #516391',
padding: '1rem',
background: '#0f111d',
};

export const title: object = {
export const styles = const title: object = {
fontSize: '1.5rem',
fontWeight: '600',
marginBottom: '.5rem',
display: 'inline-block',
borderBottom: '1px solid #ec5990',
};

export const description: object = {
export const styles = const description: object = {
fontSize: '1rem',
fontWeight: '300',
marginBottom: '.5rem',
};

export const slug: object = {
export const styles = const slug: object = {
fontSize: '.875rem',
color: '#ec5990',
display: 'block',
Expand Down
2 changes: 1 addition & 1 deletion app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import reactPlugin from '@vitejs/plugin-react';
import { defineConfig } from 'vite';

// https://vitejs.dev/config/
export default defineConfig({
export const vite = defineConfig({
plugins: [reactPlugin()],
});
2 changes: 1 addition & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'cypress';
const cypressReplay = require('@replayio/cypress');
const fs = require('fs');

export default defineConfig({
export const cypress = defineConfig({
video: false,
e2e: {
// We've imported your old cypress plugins here.
Expand Down
2 changes: 1 addition & 1 deletion examples/V6/FieldArray.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function createArrayWithNumbers(length) {
return Array.from({ length }, (_, k) => k);
}

export default function App() {
export function App() {
const { register, handleSubmit, errors } = useForm();
const [size, setSize] = useState(1);
const onSubmit = (data) => {
Expand Down
2 changes: 1 addition & 1 deletion examples/V6/asyncFieldValidation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useForm } from 'react-hook-form';

const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

export default function App() {
export function App() {
const { register, handleSubmit, errors } = useForm();
const onSubmit = (data) => {
alert(JSON.stringify(data));
Expand Down
2 changes: 1 addition & 1 deletion examples/V6/asyncSetFormValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
import ReactDOM from 'react-dom';
import { useForm } from 'react-hook-form';

export default function App() {
export function App() {
const { register, handleSubmit, reset } = useForm();
const onSubmit = (data) => {
alert(JSON.stringify(data));
Expand Down
2 changes: 1 addition & 1 deletion examples/V6/asyncSubmitValidation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useForm } from 'react-hook-form';

const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

export default function App() {
export function App() {
const { register, handleSubmit, errors, setError } = useForm();
const onSubmit = async (data) => {
await sleep(2000);
Expand Down
2 changes: 1 addition & 1 deletion examples/V6/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { useForm } from 'react-hook-form';

export default function App() {
export function App() {
const { register, handleSubmit } = useForm();
const onSubmit = (data) => {
alert(JSON.stringify(data));
Expand Down
2 changes: 1 addition & 1 deletion examples/V6/basicValidation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { useForm } from 'react-hook-form';

export default function App() {
export function App() {
const { register, errors, handleSubmit } = useForm();
const onSubmit = (data) => {
alert(JSON.stringify(data));
Expand Down
2 changes: 1 addition & 1 deletion examples/V6/conditionalFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { useForm } from 'react-hook-form';

export default function App() {
export function App() {
const { register, watch, handleSubmit } = useForm();
const onSubmit = (data) => {
alert(JSON.stringify(data));
Expand Down
Loading