Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reestructure project to have src folder #151

Open
wants to merge 1 commit into
base: main
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions codegen.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generates:
./typings/graphql-schemas.d.ts:
schema: 'node/**/*.graphql'
./src/typings/graphql-schemas.d.ts:
schema: 'src/node/**/*.graphql'
plugins:
- typescript
config:
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion node/business/reviews.ts → src/node/business/reviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
OrderBy,
OrderDirection,
ReviewInput,
} from '@/types/graphql-schemas'
} from 'src/typings/graphql-schemas'

import type { collections } from '../lib/firebase-admin'
import admin from '../lib/firebase-admin'
Expand Down
2 changes: 1 addition & 1 deletion node/business/users.ts → src/node/business/users.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { collections } from 'node/lib/firebase-admin'
import type { collections } from 'src/node/lib/firebase-admin'

export const getUserById = (
userId: string,
Expand Down
2 changes: 1 addition & 1 deletion node/context.ts → src/node/context.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextApiRequest } from 'next'
import { getSession } from 'next-auth/client'

import type { SessionWithId } from 'pages/api/auth/[...nextauth]'
import type { SessionWithId } from 'src/pages/api/auth/[...nextauth]'

import spotify from './lib/spotify'
import admin, { collections } from './lib/firebase-admin'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion node/resolvers/review.ts → src/node/resolvers/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
MutationReviewTrackArgs,
QueryAlbumReviewsArgs,
QueryTrackReviewsArgs,
} from '@/types/graphql-schemas'
} from 'src/typings/graphql-schemas'

import type { ReviewModel } from '../business/reviews'
import {
Expand Down
2 changes: 1 addition & 1 deletion node/resolvers/search.ts → src/node/resolvers/search.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AlbumSimplified, Track } from 'spotify-web-sdk'

import type { QuerySearchArgs } from '@/types/graphql-schemas'
import type { QuerySearchArgs } from 'src/typings/graphql-schemas'

import type { Context } from '../context'

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions pages/_app.tsx → src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client'

import IntlProvider from '@/providers/IntlProvider'
import ThemeProvider from '@/providers/ThemeProvider'
import IntlProvider from 'src/react/providers/IntlProvider'
import ThemeProvider from 'src/react/providers/ThemeProvider'

import type { Page } from '../typings/page'

Expand Down
12 changes: 6 additions & 6 deletions pages/albums/[id].tsx → src/pages/albums/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import type {
import type { Album, AlbumSimplified } from 'spotify-web-sdk'
import type { FC } from 'react'

import spotify from '@/node/lib/spotify'
import AlbumPageHeader from '@/components/album/AlbumPageHeader'
import AlbumTracklist from '@/components/album/AlbumTracklist'
import ArtistAlbumsGrid from '@/components/album/ArtistAlbumsGrid'
import AlbumReviewSection from '@/components/album/AlbumReviewSection/index'
import type { AlbumReview } from '@/types/graphql-schemas'
import spotify from 'src/node/lib/spotify'
import AlbumPageHeader from 'src/react/components/album/AlbumPageHeader'
import AlbumTracklist from 'src/react/components/album/AlbumTracklist'
import ArtistAlbumsGrid from 'src/react/components/album/ArtistAlbumsGrid'
import AlbumReviewSection from 'src/react/components/album/AlbumReviewSection/index'
import type { AlbumReview } from 'src/typings/graphql-schemas'

import ALBUM_REVIEWS from './albumReviews.graphql'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Providers from 'next-auth/providers'
import { FirebaseAdapter } from '@next-auth/firebase-adapter'
import type firebase from 'firebase'

import { firestore } from '@/node/lib/firebase-admin'
import { firestore } from 'src/node/lib/firebase-admin'

export type SessionWithId = Session & { user: { id?: string } }

Expand Down
4 changes: 2 additions & 2 deletions pages/api/graphql.ts → src/pages/api/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
} from 'apollo-server-core'

import typeDefs from '@/node/schema.graphql'
import resolvers from '@/node/resolvers'
import context from '@/node/context'
import resolvers from 'src/node/resolvers'
import context from 'src/node/context'

const apolloServer = new ApolloServer({
typeDefs,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type { Album } from 'spotify-web-sdk'
import type { ThemeUIStyleObject } from 'theme-ui'
import { Heading, Flex, Text } from 'theme-ui'

import Link from '@/components/common/Link'
import Skeleton from '@/components/common/Skeleton'
import Link from 'src/react/components/common/Link'
import Skeleton from 'src/react/components/common/Skeleton'

const messages = defineMessages({
byArtists: { id: 'musicritic.album-page.by-artists' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type { Album } from 'spotify-web-sdk'
import { Flex } from 'theme-ui'
import type { ThemeUIStyleObject } from 'theme-ui'

import Skeleton from '@/components/common/Skeleton'
import SkeletonImage from '@/components/common/SkeletonImage'
import Skeleton from 'src/react/components/common/Skeleton'
import SkeletonImage from 'src/react/components/common/SkeletonImage'

import AlbumRatingBadge from './AlbumRatingBadge'
import AlbumMetadata from './AlbumMetadata'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { defineMessages, FormattedMessage, useIntl } from 'react-intl'
import type { ThemeUIStyleObject } from 'theme-ui'
import { Heading, Box, Grid } from 'theme-ui'

import type { AlbumReview } from '@/types/graphql-schemas'
import Select from '@/components/common/Select'
import Skeleton from '@/components/common/Skeleton'
import UserReviewCard from '@/components/common/UserReviewCard'
import type { AlbumReview } from 'src/typings/graphql-schemas'
import Select from 'src/react/components/common/Select'
import Skeleton from 'src/react/components/common/Skeleton'
import UserReviewCard from 'src/react/components/common/UserReviewCard'

import EmptyState from './EmptyState'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { AlbumSimplified } from 'spotify-web-sdk'
import { Card, Text, Flex } from 'theme-ui'
import type { ThemeUIStyleObject } from 'theme-ui'

import Link from '@/components/common/Link'
import Skeleton from '@/components/common/Skeleton'
import SkeletonImage from '@/components/common/SkeletonImage'
import Link from 'src/react/components/common/Link'
import Skeleton from 'src/react/components/common/Skeleton'
import SkeletonImage from 'src/react/components/common/SkeletonImage'

const cardStyles: ThemeUIStyleObject = {
display: 'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineMessages, FormattedMessage } from 'react-intl'
import { Grid, Box, Heading } from 'theme-ui'
import type { AlbumSimplified } from 'spotify-web-sdk'

import Skeleton from '@/components/common/Skeleton'
import Skeleton from 'src/react/components/common/Skeleton'

import AlbumCard from './AlbumCard'

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { FC } from 'react'
import { FormattedDate } from 'react-intl'
import { Flex, Text } from 'theme-ui'

import type { AlbumReview } from '@/types/graphql-schemas'
import Rating from '@/components/common/Rating'
import Skeleton from '@/components/common/Skeleton'
import type { AlbumReview } from 'src/typings/graphql-schemas'
import Rating from 'src/react/components/common/Rating'
import Skeleton from 'src/react/components/common/Skeleton'

import SkeletonImage from '../SkeletonImage'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useState } from 'react'
import type { ThemeUIStyleObject } from 'theme-ui'
import { Button } from 'theme-ui'

import IconThumbsDown from '@/components/icons/IconThumbsDown'
import IconThumbsUp from '@/components/icons/IconThumbsUp'
import IconThumbsDown from 'src/react/components/icons/IconThumbsDown'
import IconThumbsUp from 'src/react/components/icons/IconThumbsUp'

const baseStyles: ThemeUIStyleObject = {
padding: 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { FC } from 'react'
import { Card, Flex, Paragraph } from 'theme-ui'

import type { AlbumReview } from '@/types/graphql-schemas'
import Skeleton from '@/components/common/Skeleton'
import type { AlbumReview } from 'src/typings/graphql-schemas'
import Skeleton from 'src/react/components/common/Skeleton'

import AlbumReviewReactions from './AlbumReviewReactions'
import CardHeader from './CardHeader'
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type AlbumSearchResult = {
__typename?: 'AlbumSearchResult'
id: Scalars['ID']
name: Scalars['String']
images: Array<Image>
images: Image[]
releaseYear: Scalars['String']
artists: Scalars['String']
}
Expand All @@ -46,7 +46,7 @@ export type ArtistSearchResult = {
__typename?: 'ArtistSearchResult'
id: Scalars['ID']
name: Scalars['String']
images: Array<Image>
images: Image[]
}

export type Image = {
Expand Down Expand Up @@ -80,8 +80,8 @@ export type OrderDirection = 'asc' | 'desc'
export type Query = {
__typename?: 'Query'
search: SearchResult
albumReviews: Array<AlbumReview>
trackReviews: Array<TrackReview>
albumReviews: AlbumReview[]
trackReviews: TrackReview[]
}

export type QuerySearchArgs = {
Expand Down Expand Up @@ -126,9 +126,9 @@ export type Reviewer = {

export type SearchResult = {
__typename?: 'SearchResult'
albums: Array<AlbumSearchResult>
tracks: Array<TrackSearchResult>
artists: Array<ArtistSearchResult>
albums: AlbumSearchResult[]
tracks: TrackSearchResult[]
artists: ArtistSearchResult[]
}

export type TrackReview = Review & {
Expand All @@ -147,7 +147,7 @@ export type TrackSearchResult = {
__typename?: 'TrackSearchResult'
id: Scalars['ID']
name: Scalars['String']
images: Array<Image>
images: Image[]
album: Scalars['String']
artists: Scalars['String']
releaseYear: Scalars['String']
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"jsx": "preserve",
"baseUrl": ".",
"paths": {
"@/components/*": ["react/components/*"],
"@/providers/*": ["react/providers/*"],
"@/node/*": ["node/*"],
"@/types/*": ["typings/*"]
"@/components/*": ["src/react/components/*"],
"@/providers/*": ["src/react/providers/*"],
"@/node/*": ["src/node/*"],
"@/types/*": ["src/typings/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
Expand Down