Skip to content

Commit

Permalink
feat: use src/ dir for holding files
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerwooo committed Jan 26, 2023
1 parent d00a316 commit 799a423
Show file tree
Hide file tree
Showing 56 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"format": "prettier 'components/**/*.tsx' 'config/*.js' 'pages/**/*.{ts,tsx}' '{types,utils}/**/*.ts' --write",
"format": "prettier 'src/**/*.{js,ts,jsx,tsx}' --write",
"extract": "i18next"
},
"dependencies": {
Expand Down
File renamed without changes.
File renamed without changes.
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 components/Footer.tsx → src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import config from '../config/site.config'
import config from '../../config/site.config'

const createFooterMarkup = () => {
return {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion components/Navbar.tsx → src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useRouter } from 'next/router'
import { Fragment, useEffect, useState } from 'react'
import { useTranslation } from 'next-i18next'

import siteConfig from '../config/site.config'
import siteConfig from '../../config/site.config'
import SearchModal from './SearchModal'
import SwitchLang from './SwitchLang'
import useDeviceOS from '../utils/useDeviceOS'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { LoadingIcon } from './Loading'

import { getFileIcon } from '../utils/getFileIcon'
import { fetcher } from '../utils/fetchWithSWR'
import siteConfig from '../config/site.config'
import siteConfig from '../../config/site.config'

/**
* Extract the searched item's path in field 'parentReference' and convert it to the
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pages/[...path].tsx → src/pages/[...path].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Head from 'next/head'
import { useRouter } from 'next/router'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'

import siteConfig from '../config/site.config'
import siteConfig from '../../config/site.config'
import Navbar from '../components/Navbar'
import FileListing from '../components/FileListing'
import Footer from '../components/Footer'
Expand All @@ -20,8 +20,8 @@ export default function Folders() {

<main className="flex w-full flex-1 flex-col bg-gray-50 dark:bg-gray-800">
<Navbar />
<div className="mx-auto w-full max-w-5xl sm:p-4 py-4">
<nav className="mb-4 flex items-center justify-between space-x-3 sm:pl-1 sm:px-0 px-4">
<div className="mx-auto w-full max-w-5xl py-4 sm:p-4">
<nav className="mb-4 flex items-center justify-between space-x-3 px-4 sm:px-0 sm:pl-1">
<Breadcrumb query={query} />
<SwitchLayout />
</nav>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pages/_document.tsx → src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Document, { Head, Html, Main, NextScript } from 'next/document'
import siteConfig from '../config/site.config'
import siteConfig from '../../config/site.config'

class MyDocument extends Document {
render() {
Expand Down
4 changes: 2 additions & 2 deletions pages/api/index.ts → src/pages/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { posix as pathPosix } from 'path'
import type { NextApiRequest, NextApiResponse } from 'next'
import axios from 'axios'

import apiConfig from '../../config/api.config'
import siteConfig from '../../config/site.config'
import apiConfig from '../../../config/api.config'
import siteConfig from '../../../config/site.config'
import { revealObfuscatedToken } from '../../utils/oAuthHandler'
import { compareHashedToken } from '../../utils/protectedRouteHandler'
import { getOdAuthTokens, storeOdAuthTokens } from '../../utils/odAuthTokenStore'
Expand Down
2 changes: 1 addition & 1 deletion pages/api/item.ts → src/pages/api/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios'
import type { NextApiRequest, NextApiResponse } from 'next'

import { getAccessToken } from '.'
import apiConfig from '../../config/api.config'
import apiConfig from '../../../config/api.config'

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
// Get access token from storage
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pages/api/raw.ts → src/pages/api/raw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { NextApiRequest, NextApiResponse } from 'next'
import axios, { AxiosResponseHeaders } from 'axios'
import Cors from 'cors'

import { driveApi, cacheControlHeader } from '../../config/api.config'
import { driveApi, cacheControlHeader } from '../../../config/api.config'
import { encodePath, getAccessToken, checkAuthRoute } from '.'

// CORS middleware for raw links: https://nextjs.org/docs/api-routes/api-middlewares
Expand Down
4 changes: 2 additions & 2 deletions pages/api/search.ts → src/pages/api/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import axios from 'axios'
import type { NextApiRequest, NextApiResponse } from 'next'

import { encodePath, getAccessToken } from '.'
import apiConfig from '../../config/api.config'
import siteConfig from '../../config/site.config'
import apiConfig from '../../../config/api.config'
import siteConfig from '../../../config/site.config'

/**
* Sanitize the search query
Expand Down
2 changes: 1 addition & 1 deletion pages/api/thumbnail.ts → src/pages/api/thumbnail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import axios from 'axios'
import type { NextApiRequest, NextApiResponse } from 'next'

import { checkAuthRoute, encodePath, getAccessToken } from '.'
import apiConfig from '../../config/api.config'
import apiConfig from '../../../config/api.config'

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const accessToken = await getAccessToken()
Expand Down
6 changes: 3 additions & 3 deletions pages/index.tsx → src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Head from 'next/head'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'

import siteConfig from '../config/site.config'
import siteConfig from '../../config/site.config'
import Navbar from '../components/Navbar'
import FileListing from '../components/FileListing'
import Footer from '../components/Footer'
Expand All @@ -17,8 +17,8 @@ export default function Home() {

<main className="flex w-full flex-1 flex-col bg-gray-50 dark:bg-gray-800">
<Navbar />
<div className="mx-auto w-full max-w-5xl sm:p-4 py-4">
<nav className="mb-4 flex items-center justify-between sm:pl-1 sm:px-0 px-4">
<div className="mx-auto w-full max-w-5xl py-4 sm:p-4">
<nav className="mb-4 flex items-center justify-between px-4 sm:px-0 sm:pl-1">
<Breadcrumb />
<SwitchLayout />
</nav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useRouter } from 'next/router'
import { useTranslation, Trans } from 'next-i18next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'

import siteConfig from '../../config/site.config'
import apiConfig from '../../config/api.config'
import siteConfig from '../../../config/site.config'
import apiConfig from '../../../config/api.config'
import Navbar from '../../components/Navbar'
import Footer from '../../components/Footer'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { useTranslation, Trans } from 'next-i18next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'

import siteConfig from '../../config/site.config'
import siteConfig from '../../../config/site.config'
import Navbar from '../../components/Navbar'
import Footer from '../../components/Footer'
import { LoadingIcon } from '../../components/Loading'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { useTranslation, Trans } from 'next-i18next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'

import siteConfig from '../../config/site.config'
import siteConfig from '../../../config/site.config'
import Navbar from '../../components/Navbar'
import Footer from '../../components/Footer'

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 utils/fileDetails.ts → src/utils/fileDetails.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dayjs from 'dayjs'

import siteConfig from '../config/site.config'
import siteConfig from '../../config/site.config'

/**
* Convert raw bits file/folder size into a human readable string
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion utils/oAuthHandler.ts → src/utils/oAuthHandler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'
import CryptoJS from 'crypto-js'

import apiConfig from '../config/api.config'
import apiConfig from '../../config/api.config'

// Just a disguise to obfuscate required tokens (including but not limited to client secret,
// access tokens, and refresh tokens), used along with the following two functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Redis from 'ioredis'
import siteConfig from '../config/site.config'
import siteConfig from '../../config/site.config'

// Persistent key-value store is provided by Redis, hosted on Upstash
// https://vercel.com/integrations/upstash
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sha256 from 'crypto-js/sha256'
import siteConfig from '../config/site.config'
import siteConfig from '../../config/site.config'

// Hash password token with SHA256
function encryptToken(token: string): string {
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 799a423

Please sign in to comment.