Skip to content

Commit c034d38

Browse files
committed
Move types to dedicated folder
1 parent 8b23f52 commit c034d38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+149
-145
lines changed

gatsby-config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import {
1616
INDEX_PATH,
1717
SOCIAL_IMAGES_PATH,
1818
} from './src/common/constants';
19-
import { SocialImageType, ThemeType } from './src/common/types';
2019
import { getAbsoluteUrl } from './src/common/utils';
20+
import { SocialImageType, ThemeType } from './src/types/types';
2121
import tailwindConfig from './tailwind.config';
2222

2323
const SITE_METADATA = getSiteMetadata();
@@ -37,7 +37,7 @@ const config: GatsbyConfig = {
3737
jsxRuntime: 'automatic',
3838
trailingSlash: 'never',
3939
graphqlTypegen: {
40-
typesOutputPath: 'src/common/gatsby-types.d.ts',
40+
typesOutputPath: 'src/types/gatsby-types.d.ts',
4141
},
4242
plugins: [
4343
'gatsby-plugin-fontawesome',

gatsby-node.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ import {
1313
SOCIAL_IMAGES_PATH,
1414
SOCIAL_IMAGE_TEMPLATES_DIR,
1515
} from './src/common/constants';
16-
import {
17-
type AbsolutePathString,
18-
type EmptyObject,
19-
EntryPage,
20-
type IndexPageContext,
21-
type PageMetadata,
22-
type Project,
23-
type ProjectPageContext,
24-
type ResumePageContext,
25-
} from './src/common/types';
2616
import { transformGithubDataNode } from './src/node/github-data-node-transformer';
2717
import { schema } from './src/node/graphql';
2818
import { setReporter, warn } from './src/node/logger';
@@ -33,6 +23,16 @@ import {
3323
deletePage,
3424
setGatsbyNodeHelpers,
3525
} from './src/node/utils';
26+
import {
27+
type AbsolutePathString,
28+
type EmptyObject,
29+
EntryPage,
30+
type IndexPageContext,
31+
type PageMetadata,
32+
type Project,
33+
type ProjectPageContext,
34+
type ResumePageContext,
35+
} from './src/types/types';
3636

3737
// Constants
3838

src/common/config-manager.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
*/
55

66
import type { JobOptions } from 'gatsby-plugin-component-to-image/lib/types';
7+
import { colorMappingsConfig } from '../config/color-mappings';
8+
import { externalServicesConfig } from '../config/external-services';
9+
import { pagesMetadataConfig } from '../config/metadata/pages';
10+
import { siteMetadataConfig } from '../config/metadata/site';
11+
import { projectsConfig } from '../config/projects';
12+
import { educationRolesConfig } from '../config/roles/education';
13+
import { employmentRolesConfig } from '../config/roles/employment';
14+
import { volunteeringRolesConfig } from '../config/roles/volunteering';
15+
import { socialImagesGenerationConfig } from '../config/social-images-generation';
16+
import { themesConfig } from '../config/themes';
717
import {
818
type BgColorString,
919
type EmploymentRole,
@@ -20,17 +30,7 @@ import {
2030
type Theme,
2131
type ThemesConfig,
2232
type UrlString,
23-
} from '../common/types';
24-
import { colorMappingsConfig } from '../config/color-mappings';
25-
import { externalServicesConfig } from '../config/external-services';
26-
import { pagesMetadataConfig } from '../config/metadata/pages';
27-
import { siteMetadataConfig } from '../config/metadata/site';
28-
import { projectsConfig } from '../config/projects';
29-
import { educationRolesConfig } from '../config/roles/education';
30-
import { employmentRolesConfig } from '../config/roles/employment';
31-
import { volunteeringRolesConfig } from '../config/roles/volunteering';
32-
import { socialImagesGenerationConfig } from '../config/social-images-generation';
33-
import { themesConfig } from '../config/themes';
33+
} from '../types/types';
3434
import { arrayToObject, isDefined } from './utils';
3535

3636
// Types

src/common/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--------------------------------------------------
44
*/
55

6-
import type { AbsolutePathString, WorkingPathString } from './types';
6+
import type { AbsolutePathString, WorkingPathString } from '../types/types';
77

88
// Constants
99

src/common/utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
*/
55

66
import { panic } from '../node/logger';
7+
import type {
8+
PropsWithClassName,
9+
SentenceString,
10+
UrlString,
11+
} from '../types/types';
712
import { getSiteMetadata } from './config-manager';
8-
import type { PropsWithClassName, SentenceString, UrlString } from './types';
913

1014
// Types
1115

src/components/divider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
-------------------------
44
*/
55

6-
import type { PropsWithClassName } from '../common/types';
76
import { getClassNameProps } from '../common/utils';
7+
import type { PropsWithClassName } from '../types/types';
88

99
export function Divider({ className }: PropsWithClassName) {
1010
const classNameProps = getClassNameProps('m-0 h-auto divider', className);

src/components/ghost-alert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {
1212
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
1313
import { AnimatePresence, motion } from 'framer-motion';
1414
import { FADE_IN_ANIMATION_PROPS } from '../common/constants';
15-
import { AlertType, type PropsWithClassName } from '../common/types';
1615
import { getClassNameProps } from '../common/utils';
16+
import { AlertType, type PropsWithClassName } from '../types/types';
1717

1818
// Types
1919

src/components/input/base-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
88
import { AnimatePresence, motion } from 'framer-motion';
99
import { FADE_IN_ANIMATION_PROPS } from '../../common/constants';
10-
import type { Button } from '../../common/types';
1110
import { getClassNameProps } from '../../common/utils';
11+
import type { Button } from '../../types/types';
1212
import { Tooltip } from '../tooltip';
1313

1414
export function BaseButton({

src/components/input/base-input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
import { motion } from 'framer-motion';
88
import type { FieldErrors, UseFormRegister } from 'react-hook-form';
9+
import { getClassNameProps, getOrDefault } from '../../common/utils';
910
import {
1011
AlertType,
1112
type InputElementRenderFunction,
1213
type InputValidationOptions,
1314
type PropsWithClassName,
1415
type PropsWithLayoutAnimations,
15-
} from '../../common/types';
16-
import { getClassNameProps, getOrDefault } from '../../common/utils';
16+
} from '../../types/types';
1717
import { GhostAlert } from '../ghost-alert';
1818

1919
interface BaseInput extends PropsWithClassName, PropsWithLayoutAnimations {

src/components/input/checkbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
*/
55

66
import { useCallback } from 'react';
7+
import { getClassNameProps } from '../../common/utils';
78
import type {
89
Input,
910
InputElementRenderFunction,
1011
InputOptions,
11-
} from '../../common/types';
12-
import { getClassNameProps } from '../../common/utils';
12+
} from '../../types/types';
1313
import { BaseInput } from './base-input';
1414

1515
export interface Props extends Input {

0 commit comments

Comments
 (0)