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

Nextjsのバージョンを上げる #322

Merged
merged 22 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
066fa56
🎨 chore: nextとnodeのバージョンを上げる
takashi0602 Nov 18, 2023
ce88e9c
🎨 chore: nextConfigにoutputを追加する
takashi0602 Nov 18, 2023
5bb986f
🎨 chore: @types系のバージョンを上げる
takashi0602 Nov 18, 2023
751efec
🎨 chore: serveをインストールし、startスクリプトで使用する
takashi0602 Nov 18, 2023
a3631d0
🎨 chore: storybookのビルド後のディレクトリをcspellの対象外にする
takashi0602 Nov 18, 2023
e5bf650
🎨 chore: storybookのアップデート
takashi0602 Nov 18, 2023
628556e
🎨 chore: yarnのバージョンをv4.0.2に上げる
takashi0602 Nov 28, 2023
20641f4
👷 ci: yarnのバージョンをv4.0.2に上げる
takashi0602 Nov 28, 2023
34537e7
👷 ci: 環境変数でYARNという文字を使わないようにする
takashi0602 Nov 28, 2023
b292b12
👷 ci: キャッシュが存在しない時にエラーとなってしまうため、--immutable-cacheオプションを削除する
takashi0602 Nov 28, 2023
a97d069
📝 docs: 開発環境にYarnを追加する
takashi0602 Nov 29, 2023
f0f8bb4
👷 ci: キャッシュディレクトリのパスの取得コマンドの修正
takashi0602 Nov 29, 2023
d41a6e7
📝 docs: Corepackを有効化するコマンドの追加
takashi0602 Dec 2, 2023
9422bbe
👷 ci: idと環境変数の命名を修正
takashi0602 Dec 2, 2023
f0c5b86
👷 ci: yarn install時のオプションを修正
takashi0602 Dec 2, 2023
5b14689
📝 docs: Node.jsとYarnのバージョンを明記する
takashi0602 Dec 2, 2023
ac7e434
⏪️ revert: yarn install時のオプションを修正するコミットの取り消し
takashi0602 Dec 3, 2023
d26c403
📝 docs: Corepackを有効化するための理由を明記する
takashi0602 Dec 3, 2023
c3cf189
📝 docs: YarnのBerryを使用していることを明記する
takashi0602 Dec 3, 2023
0d35501
📝 docs: Corepackの文章を修正
takashi0602 Dec 3, 2023
7adacf9
📝 docs: Corepackの文章にBerryの文言を追加
takashi0602 Dec 3, 2023
9b76958
📝 docs: 環境構築の文章を修正
takashi0602 Dec 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"node_modules/**",
"out/**",
"**/*.avif",
"public/fonts/LICENSE"
"public/fonts/LICENSE",
"storybook-static/**",
".yarn/**"
],
"overrides": [
{
Expand All @@ -20,6 +22,7 @@
"chromaui",
"cica",
"clsx",
"corepack",
"dbaeumer",
"esbenp",
"ghpages",
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/deploy-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,24 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.15.0
node-version: 18.17.0

- name: Upgrade to yarn
tyokinuhata marked this conversation as resolved.
Show resolved Hide resolved
run: yarn set version 4.0.2

- name: Get yarn cache directory path
id: yarn_cache_dir_path
run: echo "YARN_CACHE_DIR_PATH=$(yarn cache dir)" >> $GITHUB_ENV
id: package_manager_cache_dir_path
run: echo "PACKAGE_MANAGER_CACHE_DIR_PATH=$(yarn config get cacheFolder)" >> $GITHUB_ENV

- name: Cache yarn cache directory
uses: actions/cache@v3
with:
path: ${{ env.YARN_CACHE_DIR_PATH }}
path: ${{ env.PACKAGE_MANAGER_CACHE_DIR_PATH }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache
run: yarn install --immutable --check-cache

- name: Publish to Chromatic
uses: chromaui/action@v1
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/publish-ghpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,24 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.15.0
node-version: 18.17.0

- name: Upgrade to yarn
run: yarn set version 4.0.2

- name: Get yarn cache directory path
id: yarn_cache_dir_path
run: echo "YARN_CACHE_DIR_PATH=$(yarn cache dir)" >> $GITHUB_ENV
id: package_manager_cache_dir_path
run: echo "PACKAGE_MANAGER_CACHE_DIR_PATH=$(yarn config get cacheFolder)" >> $GITHUB_ENV

- name: Cache yarn cache directory
uses: actions/cache@v3
with:
path: ${{ env.YARN_CACHE_DIR_PATH }}
path: ${{ env.PACKAGE_MANAGER_CACHE_DIR_PATH }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache
run: yarn install --immutable --check-cache

- name: Generate directory name
id: dir_name
Expand Down Expand Up @@ -70,21 +73,24 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.15.0
node-version: 18.17.0

- name: Upgrade to yarn
run: yarn set version 4.0.2

- name: Get yarn cache directory path
id: yarn_cache_dir_path
run: echo "YARN_CACHE_DIR_PATH=$(yarn cache dir)" >> $GITHUB_ENV
id: package_manager_cache_dir_path
run: echo "PACKAGE_MANAGER_CACHE_DIR_PATH=$(yarn config get cacheFolder)" >> $GITHUB_ENV

- name: Cache yarn cache directory
uses: actions/cache@v3
with:
path: ${{ env.YARN_CACHE_DIR_PATH }}
path: ${{ env.PACKAGE_MANAGER_CACHE_DIR_PATH }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache
run: yarn install --immutable --check-cache

- name: Build Next.js app
run: yarn build
Expand Down
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage
Expand Down Expand Up @@ -40,3 +38,12 @@ storybook-static/

# lighthouse
localhost_*.report.html

# yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
tyokinuhata marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.15.0
18.17.0
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
tyokinuhata marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 0 additions & 3 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ const config: StorybookConfig = {
autodocs: true,
},
staticDirs: ['../public'],
core: {
builder: '@storybook/builder-webpack5',
},
tyokinuhata marked this conversation as resolved.
Show resolved Hide resolved
webpackFinal: async (config) =>
merge(config, {
plugins: [new VanillaExtractPlugin()],
Expand Down
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
tyokinuhata marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 6 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 環境構築

開発環境にはNode.js v18.17.0を使用する。

```bash
# リポジトリのクローン
$ git clone https://github.com/uyupun/official.git
Expand All @@ -10,6 +12,10 @@ $ cd official
# envファイルの作成
$ cp .env.example .env

# Corepackの有効化
# Corepackを有効化してYarn (Berry)を使用できるようにするため(https://yarnpkg.com/corepack)
$ corepack enable

# 依存パッケージのインストール
$ yarn install

Expand Down
2 changes: 2 additions & 0 deletions docs/tech.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 開発環境

- [Node.js](https://nodejs.org)
- [Yarn (Berry)](https://yarnpkg.com)
- [Next.js](https://nextjs.org)
- [TypeScript](https://www.typescriptlang.org)

Expand Down
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const withVanillaExtract = createVanillaExtractPlugin();

const nextConfig = {
reactStrictMode: true,
output: 'export',
};

export default withVanillaExtract(nextConfig);
38 changes: 21 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"type": "module",
"scripts": {
"dev": "next dev",
"build": "yarn pathpida && next build && next export",
"start": "next start",
"build": "yarn pathpida && next build",
"start": "serve out",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path .eslintignore --cache --cache-strategy content --cache-file=node_modules/.cache/eslint/.eslintcache",
"lint:prettier": "prettier --check . --ignore-path .prettierignore --cache --cache-strategy content",
"lint:ls": "ls-lint",
Expand All @@ -28,26 +28,26 @@
"@headlessui/react": "^1.7.4",
"@hookform/resolvers": "^2.9.11",
"clsx": "^1.2.1",
"next": "13.5.0",
"next": "14.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "7.43.7",
"zod": "^3.22.4"
},
"devDependencies": {
"@ls-lint/ls-lint": "^2.0.0",
"@storybook/addon-a11y": "^7.0.26",
"@storybook/addon-actions": "^7.0.26",
"@storybook/addon-essentials": "^7.0.26",
"@storybook/addon-links": "^7.0.26",
"@storybook/nextjs": "^7.0.26",
"@storybook/react": "^7.0.26",
"@storybook/addon-a11y": "^7.5.3",
"@storybook/addon-actions": "^7.5.3",
"@storybook/addon-essentials": "^7.5.3",
"@storybook/addon-links": "^7.5.3",
"@storybook/nextjs": "^7.5.3",
"@storybook/react": "^7.5.3",
"@svgr/cli": "^6.5.1",
"@types/micromatch": "^4.0.2",
"@types/minimist": "^1.2.2",
"@types/node": "18.15.0",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"@types/node": "18.17.0",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@vanilla-extract/css": "^1.12.0",
"@vanilla-extract/next-plugin": "^2.1.3",
Expand All @@ -63,7 +63,7 @@
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-storybook": "^0.6.12",
"eslint-plugin-storybook": "^0.6.15",
"git-cz": "^4.9.0",
"husky": "^7.0.0",
"lighthouse": "^10.3.0",
Expand All @@ -73,21 +73,25 @@
"modern-css-reset": "^1.4.0",
"pathpida": "^0.20.1",
"prettier": "^2.8.3",
"serve": "^14.2.1",
tyokinuhata marked this conversation as resolved.
Show resolved Hide resolved
"sharp": "^0.32.1",
"storybook": "^7.0.26",
"storybook": "^7.5.3",
"ts-node": "^10.9.1",
"typescript": "4.9.5",
"webpack-merge": "^5.9.0"
},
"engines": {
"node": "18.15.0"
"node": "18.17.0",
tyokinuhata marked this conversation as resolved.
Show resolved Hide resolved
"npm": "use yarn instead",
tyokinuhata marked this conversation as resolved.
Show resolved Hide resolved
"yarn": "4.0.2"
tyokinuhata marked this conversation as resolved.
Show resolved Hide resolved
},
"resolutions": {
"@types/react": "18.0.28"
"@types/react": "18.2.37"
tyokinuhata marked this conversation as resolved.
Show resolved Hide resolved
},
"config": {
"commitizen": {
"path": "git-cz"
}
}
},
"packageManager": "yarn@4.0.2"
tyokinuhata marked this conversation as resolved.
Show resolved Hide resolved
}
Loading