Skip to content

Commit

Permalink
feat: 🎸 editorconfig + prettier + git-cz + next-seo
Browse files Browse the repository at this point in the history
  • Loading branch information
k1tikurisu committed Jun 23, 2021
1 parent b1e7713 commit 6ec359b
Show file tree
Hide file tree
Showing 19 changed files with 1,271 additions and 256 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.next
yarn.lock
public
build
6 changes: 5 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": ["next", "next/core-web-vitals"]
"extends": ["next", "next/core-web-vitals", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error"
}
}
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"semi": false
}
56 changes: 56 additions & 0 deletions .versionrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"types": [
{
"type": "chore",
"section": "ビルドプロセスまたは補助ツールの変更",
"hidden": false
},
{
"type": "feat",
"section": "機能の追加",
"hidden": false
},
{
"type": "fix",
"section": "バグ修正",
"hidden": false
},
{
"type": "docs",
"section": "ドキュメントの変更",
"hidden": false
},
{
"type": "style",
"section": "コードスタイルの変更",
"hidden": false
},
{
"type": "refactor",
"section": "リファクタリング",
"hidden": false
},
{
"type": "perf",
"section": "パフォーマンスの向上",
"hidden": false
},
{
"type": "ci",
"section": "CI関連",
"hidden": false
},
{
"type": "config",
"section": "設定ファイルの更新",
"hidden": false
},
{
"type": "package",
"section": "依存関係の更新",
"hidden": false
}
],

"releaseCommitMessageFormat": "release: 🔖 v{{currentTag}}"
}
94 changes: 94 additions & 0 deletions changelog.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
module.exports = {
// Emojiを非表示にするか
disableEmoji: false,

// types一覧
// 入れる値は、typesのvalueプロパティで指定した値
list: [
'feat',
'fix',
'chore',
'docs',
'refactor',
'style',
'ci',
'perf',
'config',
'package',
],

// コミットメッセージの最大文字数
maxMessageLength: 64,

// コミットメッセージの最小文字数
minMessageLength: 3,

// 質問の種類
questions: [
'type',
'scope',
'subject',
'body',
'breaking',
'issues',
'lerna',
],

// scopesの種類
scopes: [],

// typesの種類を設定する
types: {
chore: {
description: 'ビルドプロセスまたは補助ツールの変更',
emoji: '🤖',
value: 'chore',
},
ci: {
description: 'CI関連の変更',
emoji: '🎡',
value: 'ci',
},
docs: {
description: 'ドキュメントの変更のみ',
emoji: '✏️',
value: 'docs',
},
feat: {
description: '新機能の追加や更新',
emoji: '🎸',
value: 'feat',
},
fix: {
description: 'バグ修正',
emoji: '🐛',
value: 'fix',
},
perf: {
description: 'パフォーマンスを向上させるコード変更',
emoji: '⚡️',
value: 'perf',
},
refactor: {
description: 'リファクタリング',
emoji: '💡',
value: 'refactor',
},
style: {
description:
'マークアップ、ホワイトスペース、フォーマット、セミコロンなどの修正',
emoji: '💄',
value: 'style',
},
config: {
description: '設定ファイルの追加・修正',
emoji: '⚙️',
value: 'config',
},
package: {
description: 'パッケージの追加・更新・削除',
emoji: '📦',
value: 'package',
},
},
}
9 changes: 9 additions & 0 deletions components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

type Props = {
children?: React.ReactNode
}

export const Layout: React.FC<Props> = ({ children }) => {
return <div>{children}</div>
}
5 changes: 3 additions & 2 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />
12 changes: 12 additions & 0 deletions next-seo.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const config = {
openGraph: {
type: 'website',
locale: 'ja',
site_name: 'Wantedly',
},
twitter: {
cardType: 'summary_large_image',
},
}

export default config
4 changes: 3 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module.exports = {
const config = {
reactStrictMode: true,
}

module.exports = config
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"start": "next dev",
"lint": "next lint",
"format": "prettier . --write --ignore-path .eslintignore",
"release:patch": "standard-version --release-as patch",
"release:minor": "standard-version --release-as minor",
"release:major": "standard-version --release-as major"
},
"dependencies": {
"next": "11.0.1",
"next-seo": "^4.26.0",
"react": "17.0.2",
"react-dom": "17.0.2"
},
"devDependencies": {
"@types/react": "17.0.11",
"eslint": "7.29.0",
"eslint-config-next": "11.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"prettier": "^2.3.1",
"standard-version": "^9.3.0",
"typescript": "4.3.4"
}
}
18 changes: 14 additions & 4 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import '../styles/globals.css'
import type { AppProps } from 'next/app'
import Head from 'next/head'
import { DefaultSeo } from 'next-seo'
import SEO from '../next-seo.config'

function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
const App = ({ Component, pageProps }: AppProps) => {
return (
<>
<Head>
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</Head>
<DefaultSeo {...SEO} />
<Component {...pageProps} />
</>
)
}
export default MyApp
export default App
13 changes: 0 additions & 13 deletions pages/api/hello.ts

This file was deleted.

77 changes: 12 additions & 65 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,69 +1,16 @@
import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'
import React from 'react'
import { Layout } from '../components/Layout'
import { NextSeo } from 'next-seo'

export default function Home() {
const Home: React.FC = () => {
return (
<div className={styles.container}>
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
</Head>

<main className={styles.main}>
<h1 className={styles.title}>
Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1>

<p className={styles.description}>
Get started by editing{' '}
<code className={styles.code}>pages/index.js</code>
</p>

<div className={styles.grid}>
<a href="https://nextjs.org/docs" className={styles.card}>
<h2>Documentation &rarr;</h2>
<p>Find in-depth information about Next.js features and API.</p>
</a>

<a href="https://nextjs.org/learn" className={styles.card}>
<h2>Learn &rarr;</h2>
<p>Learn about Next.js in an interactive course with quizzes!</p>
</a>

<a
href="https://github.com/vercel/next.js/tree/master/examples"
className={styles.card}
>
<h2>Examples &rarr;</h2>
<p>Discover and deploy boilerplate example Next.js projects.</p>
</a>

<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
>
<h2>Deploy &rarr;</h2>
<p>
Instantly deploy your Next.js site to a public URL with Vercel.
</p>
</a>
</div>
</main>

<footer className={styles.footer}>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by{' '}
<span className={styles.logo}>
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
</span>
</a>
</footer>
</div>
<Layout>
<NextSeo
title="Wantedly"
description="Wantedly Frontend Internship 選考課題"
/>
</Layout>
)
}

export default Home
Binary file removed public/favicon.ico
Binary file not shown.
4 changes: 0 additions & 4 deletions public/vercel.svg

This file was deleted.

Loading

0 comments on commit 6ec359b

Please sign in to comment.