Skip to content

Commit

Permalink
refactor/#801 패키지의 버전을 업데이트한다 (#802)
Browse files Browse the repository at this point in the history
* chore: 패키지 업데이트, nvm 및 volta 설정, script 수정

* chore: yarn.lock 제거

* chore: eslint 및 tsconifg 설정 수정

* chore: gatsby-config 설정 수정

- gatsby-plugin-image 추가
- gatsby-transformer-remark의 옵션중 excerpt_separator 삭제
- gatsby-remark-abbr 삭제
- gatsby-plugin-feed 옵션 추가

* fix: ending slash 제거

- https://github.com/scttcper/gatsby-casper\#how-to-edit-your-site-title-and-description
- https://www.gatsbyjs.com/plugins/gatsby-plugin-canonical-urls/

* chore: gatsby-plugin-emotion을 통한 emotion 사용 설정

* feat: gatsby-image를 gatsby-plugin-image로 마이그레이션

* refactor: AuthorYaml의 id 대신 name으로 변경

* refactor: frontmatter___date를 frontmatter: date로 변경

* fix: 404 페이지에서 홈으로 가는 링크 수정

* fix: Pagination 이슈 해결

- issue: scttcper/gatsby-casper#111
- PR: scttcper/gatsby-casper#112

* fix: gatsby-transformer-yaml v4로 업데이트 하면서 id를 사용하지 못하는 이슈 해결

- issue: scttcper/gatsby-casper#115
- PR: scttcper/gatsby-casper#116

* fix: 포스트에서 meta og가 정상적으로 되지 않는 오류 수정

* fix: ico 모듈에 타입을 지정하여 모듈을 찾을 수 없는 타입스크립트 에러 해결

* style: eslint fix

- type alias 적용 (consistent-type-definitions: type)
- function-declaration 적용 (react/function-component-definition: namedComponents: function-declaration)
- import type 적용 (consistent-type-imports: fixStyle: inline-type-imports)
- arrow body imemediately return value (arrow-body-style)

* style: prettier 적용

* style: 변수명 변경

* fix: eslint 에러 수정

- target이 _blank로 된 form 태그에 noopener와 noreferrer 속성 추가(jsx-no-target-blank)
- optional chaining으로 eslint 에러 주석 제거

* style: 코드 스타일 수정

* fix: html lang 속성을 ko로 변경

* feat: about 페이지 삭제

* chore: node 버전을 18.0.0 이상으로 강제(gatsby v5 minimal node version)

* chore: gh-pages 패키지 삭제

* feat: mailchimp를 사용하는 subscribe 기능 제거 및 컴포넌트 삭제
  • Loading branch information
cruelladevil authored Nov 27, 2023
1 parent 8b7a4c8 commit 805469a
Show file tree
Hide file tree
Showing 43 changed files with 17,822 additions and 35,368 deletions.
30 changes: 0 additions & 30 deletions .babelrc

This file was deleted.

63 changes: 60 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ module.exports = {
jest: true,
browser: true,
},
extends: ['xo-space/esnext', 'xo-react/space', 'xo-typescript'],
extends: ['xo-space', 'xo-react/space', 'xo-typescript'],
rules: {
'object-curly-spacing': ['error', 'always'],
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
'@typescript-eslint/indent': ['error', 2, { SwitchCase: 1 }],
'@typescript-eslint/explicit-function-return-type': 'off',
'capitalized-comments': 'off',
'comma-dangle': ['error', 'always-multiline'],
'react/jsx-tag-spacing': 'off',
'react/prop-types': 'off',
'react/require-default-props': 'off',
'no-warning-comments': 'off',
'complexity': 'off',
complexity: 'off',
'jsx-quotes': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
Expand All @@ -24,5 +26,60 @@ module.exports = {
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-unnecessary-type-arguments': 'off',
'@typescript-eslint/quotes': 'off',
'@typescript-eslint/indent': 'off',
'operator-linebreak': 'off',
'react/no-unknown-property': ['error', { ignore: ['css'] }],
'react/prefer-read-only-props': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/ban-types': [
'error',
{
extendDefaults: false,
types: {
String: {
message: 'Use `string` instead.',
fixWith: 'string',
},
Number: {
message: 'Use `number` instead.',
fixWith: 'number',
},
Boolean: {
message: 'Use `boolean` instead.',
fixWith: 'boolean',
},
Symbol: {
message: 'Use `symbol` instead.',
fixWith: 'symbol',
},
Object: {
message:
'The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848',
fixWith: 'Record<string, unknown>',
},
'{}': {
message:
'The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.',
fixWith: 'Record<string, unknown>',
},
object: {
message:
'The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848',
fixWith: 'Record<string, unknown>',
},
Function: 'Use a specific function type instead, like `() => void`.',
'[]': "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
'[[]]':
"Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
'[[[]]]': "Don't use `[[[]]]`. Use `SomeType[][][]` instead.",
},
},
],
},
};
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

69 changes: 59 additions & 10 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@ module.exports = {
siteMetadata: {
title: 'Tecoble',
description: 'woowacourse code review & devlog',
siteUrl: 'https://tecoble.techcourse.co.kr/', // full path to blog - no ending slash
siteUrl: 'https://tecoble.techcourse.co.kr',
},
mapping: {
'MarkdownRemark.frontmatter.author': 'AuthorYaml',
'MarkdownRemark.frontmatter.author': 'AuthorYaml.name',
},
plugins: [
{
resolve: 'gatsby-plugin-google-gtag',
options: {
trackingIds: [
'G-7YLT36LV0M',
],
trackingIds: ['G-7YLT36LV0M'],
},
},

'gatsby-plugin-sitemap',
'gatsby-plugin-image',
{
resolve: 'gatsby-plugin-sharp',
options: {
Expand All @@ -38,7 +36,6 @@ module.exports = {
{
resolve: 'gatsby-transformer-remark',
options: {
"excerpt_separator": `<!-- end -->`,
plugins: [
{
resolve: 'gatsby-remark-responsive-iframe',
Expand All @@ -49,7 +46,6 @@ module.exports = {
'gatsby-remark-prismjs',
'gatsby-remark-copy-linked-files',
'gatsby-remark-smartypants',
'gatsby-remark-abbr',
{
resolve: 'gatsby-remark-images',
options: {
Expand All @@ -64,14 +60,67 @@ module.exports = {
{
resolve: 'gatsby-plugin-canonical-urls',
options: {
siteUrl: 'https://tecoble.techcourse.co.kr/',
siteUrl: 'https://tecoble.techcourse.co.kr',
},
},
'gatsby-plugin-typescript',
'gatsby-plugin-emotion',
'gatsby-transformer-sharp',
'gatsby-plugin-react-helmet',
'gatsby-transformer-yaml',
'gatsby-plugin-feed',
{
resolve: 'gatsby-plugin-feed',
options: {
query: `
{
site {
siteMetadata {
title
description
siteUrl
site_url: siteUrl
}
}
}
`,
feeds: [
{
serialize: ({ query: { site, allMarkdownRemark } }) =>
allMarkdownRemark.edges.map(edge => ({
...edge.node.frontmatter,
description: edge.node.excerpt,
date: edge.node.frontmatter.date,
url: `${site.siteMetadata.siteUrl}${edge.node.fields.slug}`,
guid: `${site.siteMetadata.siteUrl}${edge.node.fields.slug}`,
custom_elements: [{ 'content:encoded': edge.node.html }],
})),
query: `
{
allMarkdownRemark(
filter: { frontmatter: { draft: { ne: true } } }
sort: { frontmatter: { date: DESC } }
) {
edges {
node {
excerpt
html
fields { slug }
frontmatter {
title
date
}
}
}
}
}
`,
output: '/rss.xml',
title: 'Tecoble',
match: '^/blog/',
},
],
},
},
{
resolve: 'gatsby-plugin-postcss',
options: {
Expand Down
35 changes: 11 additions & 24 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ exports.createPages = async ({ graphql, actions }) => {
{
allMarkdownRemark(
limit: 2000
sort: { fields: [frontmatter___date], order: ASC }
sort: { frontmatter: { date: ASC } }
filter: { frontmatter: { draft: { ne: true } } }
) {
edges {
Expand All @@ -66,29 +66,15 @@ exports.createPages = async ({ graphql, actions }) => {
excerpt
image {
childImageSharp {
fluid(maxWidth: 3720) {
aspectRatio
base64
sizes
src
srcSet
}
gatsbyImageData(placeholder: BLURRED, layout: FULL_WIDTH)
}
}
author {
id
name
bio
avatar {
children {
... on ImageSharp {
fluid(quality: 100) {
aspectRatio
base64
sizes
src
srcSet
}
}
childImageSharp {
gatsbyImageData(placeholder: BLURRED, layout: FULL_WIDTH)
}
}
}
Expand All @@ -104,6 +90,7 @@ exports.createPages = async ({ graphql, actions }) => {
edges {
node {
id
name
}
}
}
Expand Down Expand Up @@ -167,9 +154,9 @@ exports.createPages = async ({ graphql, actions }) => {
const tagTemplate = path.resolve('./src/templates/tags.tsx');
const tags = _.uniq(
_.flatten(
result.data.allMarkdownRemark.edges.map(edge => {
return _.castArray(_.get(edge, 'node.frontmatter.tags', []));
}),
result.data.allMarkdownRemark.edges.map(edge =>
_.castArray(_.get(edge, 'node.frontmatter.tags', [])),
),
),
);
tags.forEach(tag => {
Expand All @@ -186,10 +173,10 @@ exports.createPages = async ({ graphql, actions }) => {
const authorTemplate = path.resolve('./src/templates/author.tsx');
result.data.allAuthorYaml.edges.forEach(edge => {
createPage({
path: `/author/${_.kebabCase(edge.node.id)}/`,
path: `/author/${_.kebabCase(edge.node.name)}/`,
component: authorTemplate,
context: {
author: edge.node.id,
author: edge.node.name,
},
});
});
Expand Down
Loading

0 comments on commit 805469a

Please sign in to comment.