Skip to content

Commit

Permalink
UXIT-1556 - Cleaning: move files, rename files and update generate pa…
Browse files Browse the repository at this point in the history
…ge (#707)

* move files, rename files and update generate page

* clean imports, remove _

* fix import allocator schema

* fix imports

* let git know I renamed the file

* use git mv to rename the files

* Apply suggestions from code review

---------

Co-authored-by: Mirha Masala <[email protected]>
  • Loading branch information
barbaraperic and mirhamasala authored Oct 10, 2024
1 parent 6495169 commit 70124b1
Show file tree
Hide file tree
Showing 74 changed files with 87 additions and 100 deletions.
2 changes: 1 addition & 1 deletion src/app/_components/AlternatingImageCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Image from 'next/image'

import { clsx } from 'clsx'

import type { StaticImageProps } from '@/types/sharedProps/imageType'
import type { StaticImageProps } from '@/types/imageType'

import { buildImageSizeProp } from '@/utils/buildImageSizeProp'

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/ArticleHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ImageProps } from '@/types/sharedProps/imageType'
import type { ImageProps } from '@/types/imageType'

import { graphicsData } from '@/data/graphicsData'

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/CTAButtonGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { clsx } from 'clsx'

import type { CTAProps } from '@/types/sharedProps/ctaType'
import type { CTAProps } from '@/types/ctaType'

import { Button } from '@/components/Button'

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ArrowUpRight } from '@phosphor-icons/react/dist/ssr'
import { clsx } from 'clsx'
import theme from 'tailwindcss/defaultTheme'

import { type CTAProps } from '@/types/sharedProps/ctaType'
import { type CTAProps } from '@/types/ctaType'

import { isExternalLink } from '@/utils/linkUtils'

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/DesktopNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { Route } from 'next'

import { PATHS } from '@/constants/paths'

import { desktopNavigationItems } from '@/data/components/navigationData'
import { desktopNavigationItems } from '@/data/navigationData'

import { useNavigationItems } from '@/hooks/useNavigationItems'

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/DynamicImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Image, { type ImageProps } from 'next/image'

import { clsx } from 'clsx'

import type { ImageObjectFit } from '@/types/sharedProps/imageType'
import type { ImageObjectFit } from '@/types/imageType'

import { StaticImage, type StaticImageProps } from '@/components/StaticImage'

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/ErrorMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type CTAProps } from '@/types/sharedProps/ctaType'
import { type CTAProps } from '@/types/ctaType'

import { PATHS } from '@/constants/paths'

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/FocusAreaCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Image from 'next/image'

import type { StaticImageProps } from '@/types/sharedProps/imageType'
import type { StaticImageProps } from '@/types/imageType'

import { buildImageSizeProp } from '@/utils/buildImageSizeProp'

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/HomeExploreSectionCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { clsx } from 'clsx'

import { type CTAProps } from '@/types/sharedProps/ctaType'
import type { CTAProps } from '@/types/ctaType'

import { Card } from '@/components/Card'
import { type HeadingProps, Heading } from '@/components/Heading'
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/NoResultsMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CTAProps } from '@/types/sharedProps/ctaType'
import type { CTAProps } from '@/types/ctaType'

import { Button } from '@/components/Button'
import { Heading } from '@/components/Heading'
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/StaticImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Image, { type StaticImageData, type ImageProps } from 'next/image'

import { clsx } from 'clsx'

import type { ImageObjectFit } from '@/types/sharedProps/imageType'
import type { ImageObjectFit } from '@/types/imageType'

export type StaticImageProps = {
data: StaticImageData
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { z } from 'zod'

import {
getCategorySettings,
createCategorySchema,
getCategorySettings,
} from '@/utils/categoryUtils'

import { DynamicBaseDataSchema } from '@/schemas/dynamicDataBaseSchema'
import { DynamicBaseDataSchema } from '@/schemas/DynamicDataBaseSchema'

const { validCategoryIds } = getCategorySettings('blog_posts')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from 'zod'

import { DynamicBaseDataSchema } from '@/schemas/dynamicDataBaseSchema'
import { ImagePropsSchema } from '@/schemas/imagePropsSchema'
import { DynamicBaseDataSchema } from '@/schemas/DynamicDataBaseSchema'
import { ImagePropsSchema } from '@/schemas/ImagePropsSchema'

export const DigestArticleFrontMatterSchema = DynamicBaseDataSchema.extend({
title: z.string(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from 'zod'

import { ImagePropsSchema } from '@/schemas/imagePropsSchema'
import { SeoMetadataSchema } from '@/schemas/seoMetadataSchema'
import { ImagePropsSchema } from '@/schemas/ImagePropsSchema'
import { SeoMetadataSchema } from '@/schemas/SeoMetadataSchema'

export const DynamicBaseDataSchema = z.object({
createdOn: z.coerce.date(),
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/app/_schemas/ecosystemProject/FrontMatterSchema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from 'zod'

import { BaseDataSchemaKebabCase } from '@/schemas/dynamicDataBaseSchema'
import { BaseDataSchemaKebabCase } from '@/schemas/DynamicDataBaseSchema'

import { CategorySchema, SubcategorySchema } from './CategorySchemas'

Expand Down
4 changes: 2 additions & 2 deletions src/app/_schemas/event/FrontMatterSchema.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { z } from 'zod'

import {
getEventsCategorySettings,
createCategorySchema,
getEventsCategorySettings,
} from '@/utils/categoryUtils'

import { DynamicBaseDataSchema } from '@/schemas/dynamicDataBaseSchema'
import { DynamicBaseDataSchema } from '@/schemas/DynamicDataBaseSchema'
import { SpeakersSchema } from '@/schemas/event/SpeakerSchema'
import { SponsorsSchema } from '@/schemas/event/SponsorSchema'

Expand Down
2 changes: 1 addition & 1 deletion src/app/_schemas/event/SpeakerSchema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from 'zod'

import { ImagePropsSchema } from '@/schemas/imagePropsSchema'
import { ImagePropsSchema } from '@/schemas/ImagePropsSchema'

const speakerSchema = z.object({
name: z.string(),
Expand Down
2 changes: 1 addition & 1 deletion src/app/_schemas/event/SponsorSchema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from 'zod'

import { ImagePropsSchema } from '@/schemas/imagePropsSchema'
import { ImagePropsSchema } from '@/schemas/ImagePropsSchema'

const sponsorSchema = z.object({
name: z.string(),
Expand Down
2 changes: 1 addition & 1 deletion src/app/_types/attributesTypes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SeoMetadata } from '@/schemas/seoMetadataSchema'
import type { SeoMetadata } from '@/schemas/SeoMetadataSchema'

export type PageAttributes = {
header: {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/app/_types/sortTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Event } from '@/types/eventType'

import { DEFAULT_SORT_OPTION, SORT_TYPES } from '@/constants/sortConstants'

import type { DynamicBaseData } from '@/schemas/dynamicDataBaseSchema'
import type { DynamicBaseData } from '@/schemas/DynamicDataBaseSchema'

type BaseSortType = typeof SORT_TYPES

Expand Down
2 changes: 1 addition & 1 deletion src/app/_utils/convertMarkdownToDigestArticleData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import removeMarkdown from 'remove-markdown'

import { DigestArticleFrontMatterSchema } from '@/schemas/digestArticleFrontMatterSchema'
import { DigestArticleFrontMatterSchema } from '@/schemas/DigestArticleFrontMatterSchema'

const CONTENT_PREVIEW_CHARACTER_LENGTH = 220

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BlogPostFrontMatterSchema } from '@/schemas/blogPostFrontMatterSchema'
import { BlogPostFrontMatterSchema } from '@/schemas/BlogPostFrontMatterSchema'

export function convertMarkdownToBlogPostData(data: Record<string, any>) {
return BlogPostFrontMatterSchema.parse({
Expand Down
2 changes: 1 addition & 1 deletion src/app/_utils/createMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { graphicsData } from '@/data/graphicsData'
import {
type SeoMetadata,
SeoMetadataSchema,
} from '@/schemas/seoMetadataSchema'
} from '@/schemas/SeoMetadataSchema'

type CreateMetadataProps = {
seo: SeoMetadata
Expand Down
5 changes: 2 additions & 3 deletions src/app/_utils/generateWebPageStructuredData.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { WebPage, WithContext } from 'schema-dts'


import { type PathValues, type DynamicPathValues } from '@/constants/paths'
import { type DynamicPathValues, type PathValues } from '@/constants/paths'
import { BASE_URL } from '@/constants/siteMetadata'
import { SCHEMA_CONTEXT_URL } from '@/constants/structuredDataConstants'

import type { SeoMetadata } from '@/schemas/seoMetadataSchema'
import type { SeoMetadata } from '@/schemas/SeoMetadataSchema'

type GenerateWebPageStructuredDataProps = {
title: SeoMetadata['title']
Expand Down
4 changes: 2 additions & 2 deletions src/app/_utils/getBlogPostData.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PATHS } from '@/constants/paths'

import { convertMarkdownToBlogPostData } from '@/utils/covertMarkdowntoBlogPostData'
import { getData, getAllData } from '@/utils/getData'
import { convertMarkdownToBlogPostData } from '@/utils/convertMarkdowntoBlogPostData'
import { getAllData, getData } from '@/utils/getData'

const BLOG_DIRECTORY_PATH = PATHS.BLOG.entriesContentPath as string

Expand Down
2 changes: 1 addition & 1 deletion src/app/about/data/focusAreasData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StaticImageProps } from '@/types/sharedProps/imageType'
import type { StaticImageProps } from '@/types/imageType'

import { graphicsData } from '@/data/graphicsData'

Expand Down
3 changes: 1 addition & 2 deletions src/app/about/utils/generateStructuredData.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { WebPage, WithContext } from 'schema-dts'


import { PATHS } from '@/constants/paths'
import { ORGANIZATION_SCHEMA_BASE } from '@/constants/structuredDataConstants'

import { generateWebPageStructuredData } from '@/utils/generateWebPageStructuredData'

import type { SeoMetadata } from '@/schemas/seoMetadataSchema'
import type { SeoMetadata } from '@/schemas/SeoMetadataSchema'

export function generateStructuredData(seo: SeoMetadata): WithContext<WebPage> {
const baseData = generateWebPageStructuredData({
Expand Down
3 changes: 1 addition & 2 deletions src/app/blog/utils/generateStructuredData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import type { WebPage, WithContext } from 'schema-dts'

import type { BlogPost } from '@/types/blogPostType'


import { PATHS } from '@/constants/paths'
import { BASE_URL, ORGANIZATION_NAME } from '@/constants/siteMetadata'
import { ORGANIZATION_SCHEMA_BASE } from '@/constants/structuredDataConstants'

import { generateWebPageStructuredData } from '@/utils/generateWebPageStructuredData'

import type { SeoMetadata } from '@/schemas/seoMetadataSchema'
import type { SeoMetadata } from '@/schemas/SeoMetadataSchema'

export function generateStructuredData(
posts: Array<BlogPost>,
Expand Down
3 changes: 1 addition & 2 deletions src/app/digest/utils/generateStructuredData.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { WebPage, WithContext } from 'schema-dts'


import { PATHS } from '@/constants/paths'

import { generateWebPageStructuredData } from '@/utils/generateWebPageStructuredData'

import type { SeoMetadata } from '@/schemas/seoMetadataSchema'
import type { SeoMetadata } from '@/schemas/SeoMetadataSchema'

export function generateStructuredData(seo: SeoMetadata): WithContext<WebPage> {
return generateWebPageStructuredData({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
NETWORK_USE_CASE_CHARACTER_LIMIT,
} from '../constants'
import { useSubmitEcosystemProjectForm } from '../hooks/useSubmitEcosystemProjectForm'
import { EcosystemProjectFormSchema } from '../schema/form'
import { EcosystemProjectFormSchema } from '../schema/EcosystemProjectFormSchema'
import { getOptionsFromObject } from '../utils/getOptionsFromObject'
import { getYearOptions } from '../utils/getYearOptions'

Expand Down
2 changes: 1 addition & 1 deletion src/app/ecosystem-explorer/project-form/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { StructuredDataScript } from '@/components/StructuredDataScript'
import { EcosystemProjectForm } from './components/EcosystemProjectForm'
import { ErrorNotification } from './components/ErrorNotification'
import { SuccessMessage } from './components/SuccessMessage'
import { SearchParamsSchema } from './schema/searchParams'
import { SearchParamsSchema } from './schema/SearchParamsSchema'
import { generateStructuredData } from './utils/generateStructuredData'
import { getFormInitialValue } from './utils/getFormInitialValue'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { WebPage, WithContext } from 'schema-dts'


import { PATHS } from '@/constants/paths'

import { generateWebPageStructuredData } from '@/utils/generateWebPageStructuredData'

import type { SeoMetadata } from '@/schemas/seoMetadataSchema'
import type { SeoMetadata } from '@/schemas/SeoMetadataSchema'

export function generateStructuredData(seo: SeoMetadata): WithContext<WebPage> {
return generateWebPageStructuredData({
Expand Down
3 changes: 1 addition & 2 deletions src/app/ecosystem-explorer/utils/generateStructuredData.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { WebPage, WithContext } from 'schema-dts'


import { PATHS } from '@/constants/paths'

import { generateWebPageStructuredData } from '@/utils/generateWebPageStructuredData'

import type { SeoMetadata } from '@/schemas/seoMetadataSchema'
import type { SeoMetadata } from '@/schemas/SeoMetadataSchema'

export function generateStructuredData(seo: SeoMetadata): WithContext<WebPage> {
return generateWebPageStructuredData({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { WebPage, WithContext } from 'schema-dts'


import { PATHS } from '@/constants/paths'

import { generateWebPageStructuredData } from '@/utils/generateWebPageStructuredData'

import type { SeoMetadata } from '@/schemas/seoMetadataSchema'
import type { SeoMetadata } from '@/schemas/SeoMetadataSchema'

export function generateStructuredData(seo: SeoMetadata): WithContext<WebPage> {
return generateWebPageStructuredData({
Expand Down
2 changes: 1 addition & 1 deletion src/app/events/[slug]/utils/buildCtaArray.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CTAProps } from '@/types/ctaType'
import type { Event } from '@/types/eventType'
import type { CTAProps } from '@/types/sharedProps/ctaType'

type ctaArrayProps = {
externalLink?: Event['externalLink']
Expand Down
3 changes: 1 addition & 2 deletions src/app/events/utils/generateStructuredData.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { WebPage, WithContext } from 'schema-dts'


import { PATHS } from '@/constants/paths'

import { generateWebPageStructuredData } from '@/utils/generateWebPageStructuredData'

import type { SeoMetadata } from '@/schemas/seoMetadataSchema'
import type { SeoMetadata } from '@/schemas/SeoMetadataSchema'

export function generateStructuredData(seo: SeoMetadata): WithContext<WebPage> {
return generateWebPageStructuredData({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { TableBody } from '@/components/Table/TableBody'
import { TableHead } from '@/components/Table/TableHead'

import type { Allocator } from '../schemas/allocatorSchema'
import { type Allocator } from '../schemas/AllocatorSchema'

import { AllocatorsTableColumns } from './AllocatorsTableColumns'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createColumnHelper } from '@tanstack/react-table'
import { CustomLink } from '@/components/CustomLink'
import { Icon } from '@/components/Icon'

import type { Allocator } from '../schemas/allocatorSchema'
import type { Allocator } from '../schemas/AllocatorSchema'

const columnHelper = createColumnHelper<Allocator>()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
type AllocatorFileMetaData,
AllocatorSchema,
} from '../schemas/allocatorSchema'
} from '../schemas/AllocatorSchema'

export function extractAllocators(
allocatorFileMetaData: Array<AllocatorFileMetaData | null>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PATHS } from '@/constants/paths'

import { generateWebPageStructuredData } from '@/utils/generateWebPageStructuredData'

import type { SeoMetadata } from '@/schemas/seoMetadataSchema'
import type { SeoMetadata } from '@/schemas/SeoMetadataSchema'

export function generateStructuredData(seo: SeoMetadata): WithContext<WebPage> {
return generateWebPageStructuredData({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
AllocatorFileListMetaDataBaseSchema,
type AllocatorFileMetaDataBase,
} from '../schemas/allocatorSchema'
} from '../schemas/AllocatorSchema'

const GITHUB_ALLOCATORS_REPO =
'https://api.github.com/repos/filecoin-project/Allocator-Registry/contents/Allocators'
Expand Down
Loading

0 comments on commit 70124b1

Please sign in to comment.