Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #484 from Yancey-Blog/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
YanceyOfficial authored Jun 23, 2021
2 parents 06a12b8 + a6230b8 commit 52a5cde
Show file tree
Hide file tree
Showing 19 changed files with 894 additions and 759 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
next-env.d.ts

shims-env.d.ts
ecosystem.config.js
85 changes: 1 addition & 84 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,86 +1,3 @@
/// <reference types="next" />
/// <reference types="next/types/global" />

declare module '*.bmp' {
const src: string
export default src
}

declare module '*.gif' {
const src: string
export default src
}

declare module '*.jpg' {
const src: string
export default src
}

declare module '*.jpeg' {
const src: string
export default src
}

declare module '*.png' {
const src: string
export default src
}

declare module '*.svg' {
import { SFC, SVGProps } from 'react'

export const ReactComponent: SFC<SVGProps<SVGSVGElement>>

const src: string
export default src
}

declare module '*.cur' {
const src: string
export default src
}

declare module 'aplayer' {
interface Audio {
name: string
url: string
cover: string
lrc: string
}
interface Props {
container: HTMLElement
lrcType: number
fixed: boolean
audio: Audio[]
}
class APlayer {
constructor({ container, lrcType, fixed, audio }: Props) {}
public lrc: { show: Function }
}

export default APlayer
}

interface Window {
ga: Function
GA_INITIALIZED: boolean
}

declare namespace NodeJS {
export interface ProcessEnv {
NEXT_PUBLIC_API_URL: string
NEXT_PUBLIC_DOMAIN_URL: string
NEXT_PUBLIC_STATIC_FILE_URL: string
NEXT_PUBLIC_GA_KEY: string
NEXT_PUBLIC_SENTRY_DSN: string
NEXT_PUBLIC_HOTJAR_ID: string
NEXT_PUBLIC_HOTJAR_SV: string
NEXT_PUBLIC_DISCUSSION_KEY: string
NEXT_PUBLIC_ALGOLIA_SEARCH_APP_ID: string
NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY: string
NEXT_PUBLIC_ALGOLIA_SEARCH_INDEX_NAME: string
}
}

declare const __YANCEY_BLOG_VERSION__: string
declare const __GIT_HASH__: string
/// <reference types="next/image-types/global" />
40 changes: 16 additions & 24 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
const withSourceMaps = require('@zeit/next-source-maps')
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})

module.exports = (phase, { defaultConfig }) =>
withBundleAnalyzer(
withSourceMaps({
compress: true,
pageExtensions: ['mdx', 'jsx', 'js', 'ts', 'tsx'],
future: {
webpack5: true,
},
webpack: (
config,
{ buildId, dev, isServer, defaultLoaders, webpack },
) => {
config.module.rules.push({
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.webp$/, /\.cur$/],
use: [
{
loader: 'url-loader',
},
],
})
withBundleAnalyzer({
compress: true,
pageExtensions: ['mdx', 'jsx', 'js', 'ts', 'tsx'],
productionBrowserSourceMaps: true,
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
config.module.rules.push({
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.webp$/, /\.cur$/],
use: [
{
loader: 'url-loader',
},
],
})

return config
},
}),
)
return config
},
})
46 changes: 22 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"license": "MIT",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start",
"build": "next build",
"analyze": "ANALYZE=true yarn build",
"commit": "npx git-cz",
"push": "git push --follow-tags origin master",
Expand All @@ -21,22 +21,21 @@
"sitemap": "node scripts/createSiteMap"
},
"dependencies": {
"@apollo/client": "^3.3.19",
"@apollo/client": "^3.3.20",
"@material-ui/core": "^4.11.4",
"@material-ui/lab": "^4.0.0-alpha.57",
"@sentry/browser": "^6.2.3",
"@sentry/tracing": "^6.2.3",
"@zeit/next-source-maps": "^0.0.3",
"algoliasearch": "^4.8.6",
"@sentry/browser": "^6.7.2",
"@sentry/tracing": "^6.7.1",
"algoliasearch": "^4.9.3",
"aplayer": "^1.10.1",
"disqus-react": "^1.0.9",
"graphql": "^15.5.0",
"isomorphic-unfetch": "^3.1.0",
"lodash.orderby": "^4.6.0",
"lodash.throttle": "^4.1.1",
"luxon": "^1.27.0",
"next": "^10.2.0",
"next-with-apollo": "^5.1.0",
"next": "^11.0.1",
"next-with-apollo": "^5.2.1",
"normalize.css": "^8.0.1",
"notistack": "^1.0.9",
"nprogress": "^0.2.0",
Expand All @@ -47,43 +46,42 @@
"react-hotjar": "^2.2.1",
"react-instantsearch-core": "^6.11.0",
"react-instantsearch-dom": "^6.11.0",
"react-lazyload": "^3.2.0",
"react-markdown": "^6.0.2",
"react-progressive-graceful-image": "^0.6.13",
"react-share": "^4.4.0",
"react-syntax-highlighter": "^15.4.3",
"remark-gfm": "^1.0.0",
"sitemap": "^6.3.5",
"styled-components": "^5.0.1",
"sitemap": "^7.0.0",
"styled-components": "^5.3.0",
"tocbot": "^4.12.3",
"yancey-js-util": "^3.0.0"
},
"devDependencies": {
"@babel/runtime": "^7.13.6",
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.0.1",
"@next/bundle-analyzer": "^10.2.0",
"@babel/runtime": "^7.14.5",
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@next/bundle-analyzer": "^10.2.3",
"@types/lodash.orderby": "^4.6.6",
"@types/lodash.throttle": "^4.1.6",
"@types/luxon": "^1.26.0",
"@types/markdown-to-jsx": "^6.11.3",
"@types/node": "^14.14.35",
"@types/luxon": "^1.27.0",
"@types/node": "^15.12.2",
"@types/nprogress": "^0.2.0",
"@types/react": "^17.0.8",
"@types/react-instantsearch-dom": "^6.3.0",
"@types/react-syntax-highlighter": "^13.5.0",
"@types/react-instantsearch-dom": "^6.10.0",
"@types/react-syntax-highlighter": "^13.5.1",
"@types/styled-components": "^5.1.7",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"babel-plugin-styled-components": "^1.12.0",
"babel-plugin-transform-imports": "^2.0.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^7.22.0",
"eslint-config-airbnb-typescript": "^11.4.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-config-next": "^11.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^4.3.6",
"lint-staged": "^10.5.3",
Expand All @@ -95,7 +93,7 @@
"stylelint-processor-styled-components": "^1.10.0",
"typescript": "^4.3.2",
"url-loader": "^4.1.1",
"webpack": "^5.20.2"
"webpack": "^5.38.1"
},
"config": {
"commitizen": {
Expand Down
File renamed without changes
File renamed without changes.
83 changes: 83 additions & 0 deletions shims-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
declare module '*.bmp' {
const src: string
export default src
}

declare module '*.gif' {
const src: string
export default src
}

declare module '*.jpg' {
const src: string
export default src
}

declare module '*.jpeg' {
const src: string
export default src
}

declare module '*.png' {
const src: string
export default src
}

declare module '*.svg' {
import { SFC, SVGProps } from 'react'

export const ReactComponent: SFC<SVGProps<SVGSVGElement>>

const src: string
export default src
}

declare module '*.cur' {
const src: string
export default src
}

declare module 'aplayer' {
interface Audio {
name: string
url: string
cover: string
lrc: string
}
interface Props {
container: HTMLElement
lrcType: number
fixed: boolean
audio: Audio[]
}
class APlayer {
constructor({ container, lrcType, fixed, audio }: Props) {}
public lrc: { show: Function }
}

export default APlayer
}

interface Window {
ga: Function
GA_INITIALIZED: boolean
}

declare namespace NodeJS {
export interface ProcessEnv {
NEXT_PUBLIC_API_URL: string
NEXT_PUBLIC_DOMAIN_URL: string
NEXT_PUBLIC_STATIC_FILE_URL: string
NEXT_PUBLIC_GA_KEY: string
NEXT_PUBLIC_SENTRY_DSN: string
NEXT_PUBLIC_HOTJAR_ID: string
NEXT_PUBLIC_HOTJAR_SV: string
NEXT_PUBLIC_DISCUSSION_KEY: string
NEXT_PUBLIC_ALGOLIA_SEARCH_APP_ID: string
NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY: string
NEXT_PUBLIC_ALGOLIA_SEARCH_INDEX_NAME: string
}
}

declare const __YANCEY_BLOG_VERSION__: string
declare const __GIT_HASH__: string
2 changes: 1 addition & 1 deletion src/containers/Archive/Archive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const Archive: FC = () => {
{DateTime.fromISO(day.createdAt).day}
{': '}
</Day>
<Link href="/post/[id]" as={`/post/${day.id}`}>
<Link href={`/post/${day.id}`}>
<a>
{day.title} ({day.pv} PV )
</a>
Expand Down
4 changes: 1 addition & 3 deletions src/containers/Home/components/Cover.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { FC } from 'react'
import styled from 'styled-components'
import LazyLoadImage from 'src/components/LazyLoadImage/LazyLoadImage'
import dot from 'src/static/images/dot.png'

import { ICover } from '../types'

Expand All @@ -18,9 +17,8 @@ const Covers = styled.figure`
height: 100%;
top: 0;
left: 0;
background-image: url(${dot});
background-image: url('images/dot.png');
background-repeat: repeat;
background-attachment: scroll;
opacity: 0.5;
}
`
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Layout/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Footer: FC<Props> = ({ globalSetting }) => {
affiliates.
</CopyRight>
<nav>
<Link href="/post/[id]" as={`/post/${releasePostId}`}>
<Link href={`/post/${releasePostId}`}>
<a>
<InnerLink>Chronicle of Events</InnerLink>
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Layout/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Header: FC<Props> = ({ globalSetting }) => {
Music
</a>
</Link>
<Link href="/post/[id]" as={`/post/${cvPostId}`}>
<Link href={`/post/${cvPostId}`}>
<a>
<svg>
<use xlinkHref={SVG_SPRITE.cv} />
Expand Down
Loading

0 comments on commit 52a5cde

Please sign in to comment.