🏵️ Link to VRT
📌 Preparation Nextプロジェクト作成・環境構築など #9
💉 Test Preparation テスト環境整備 #14
Home Page: https://teamenver.vercel.app
🏵️ Link to VRT
📌 Preparation Nextプロジェクト作成・環境構築など #9
💉 Test Preparation テスト環境整備 #14
supabaseUrlが認識されない
調べたこと:storybookではbuildファイルに環境変数が含まれてしまうのを防ぐため、STORYBOOK_プレフィクスから始まる環境変数以外はビルドから除外される仕様???
https://storybook.js.org/docs/7.4/react/configure/environment-variables
基本的にConfiguringに沿う形で
以下詳細
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@/api/*": ["src/app/api*"],
"@/components/*": ["src/app/components/*"]
}
eslint-config-prettier
eslint-plugin-import:importの秩序を保つ(eslint-plugin-nextに元からある.自分でルールを設定)
eslint-plugin-unused-imports:使ってないインポートを自動削除(@typescript-eslint/no-unused-varsとバッティングするので←をoffに)
.lintstagedrc.js: nextのlint設定&.eslintignore内のファイルをリント対象外とする
https://qiita.com/mu-suke08/items/be6a6d37f443b73cfd58
設定例 .eslintrc.json
prettierrc.json (私はvscodeプラグインの読み込みをjson拡張子にしてるからこう)
{
"plugins": ["prettier-plugin-tailwindcss"],
"semi": false,
"singleQuote": true,
"printWidth": 90,
"tabWidth": 2,
"trailingComma": "all",
"jsxSingleQuote": true
}
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"ignorePresets": [":prHourlyLimit2"],
"timezone": "Asia/Tokyo",
"dependencyDashboard": false,
"automerge": true,
"branchConcurrentLimit": 0
}
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker",
"bradlc.vscode-tailwindcss"
]
}
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.quickSuggestions": {
"strings": true
},
"files.eol": "\n",
"typescript.updateImportsOnFileMove.enabled": "always"
}
今回はUIコンポーネント・BFFロジックの機能テスト,UIコンポーネントの非機能テスト・VRTを単体・結合テストの範囲で行う.
また,テストをCIとして組み込み,継続的にコード品質を保持する.
インタラクションテスト
ロジックテスト
CI: Github Actions
機能テスト:インタラクションテストなど.Webフロントの開発対象機能の大部分がUIコンポーネントの操作(インタラクション)であるため,インタラクションをテストする==Webフロントの開発対象の機能をテストする”機能テスト”となる.Jest, Vitest + Testing Library, Storybookなど
https://storybook.js.org/addons/@storybook/addon-interactions
https://www.npmjs.com/package/@storybook/jest
https://www.npmjs.com/package/@storybook/testing-library
https://storybook.js.org/addons/@storybook/test-runner
非機能テスト:a11yテストなど.Storybook
リグレッションテスト:ビジュアルリグレッションテストなど.特定時点からの差分を検出し,想定外の不具合が発生していないかを検証する.フロントは見た目における変更が大部分を占めるのでvrtとなることが多い.reg-suit, Chromaticなど
そしてそれぞれのテスト目的にあったツールがある
以上の理由から,テストを導入する
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are pending. To force PRs open, click the checkbox below.
package.json
@auth0/nextjs-auth0 ^3.0.0-beta.3
@types/node 20.4.5
@types/react 18.2.18
@types/react-dom 18.2.7
autoprefixer 10.4.14
eslint 8.46.0
eslint-config-next 13.4.12
next 13.4.12
postcss 8.4.27
react 18.2.0
react-dom 18.2.0
tailwindcss 3.3.3
typescript 5.1.6
eslint-config-prettier ^8.9.0
eslint-plugin-unused-imports ^3.0.0
husky ^8.0.3
lint-staged ^13.2.3
prettier 3.0.0
prettier-plugin-tailwindcss ^0.4.1
node 20.5.0
👇with navigation
https://x.com/d151005/status/1719623564645789869?s=20
https://github.com/nkbt/react-copy-to-clipboard
https://www.npmjs.com/package/copy-to-clipboard
フレームワークからnode pkmでインストールできるのを絞る (すべてのフレームワークに対してというのが厳しいならnext特化(他は最低限だけ)という形にする?)
→app routerの選択など
→レンダリング方式の選択など
→選択したFWのUIライブラリをフェッチするAPI(依存のチェック)
→選択したFWのCSSライブラリをフェッチするAPI OR tailwindはインストールしますか?的な簡易なもの(依存のチェック)
→選択したFWのリンタやフォーマッタをフェッチする(依存のチェック)
→最適な設定をできるように...どうしよう(できるならこれの設定もUIベースでしたい)
→tsの設定(パスのみ?)
→lint-staged, husky
→hygen
→vscode拡張機能・設定
→nodeバージョン管理
https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md
https://www.edoardoscibona.com/exploring-the-npm-registry-api
on vercel
セーブ機能:https://reactflow.dev/docs/examples/interaction/save-and-restore/
接続できるノード数の制限:https://reactflow.dev/docs/examples/nodes/connection-limit/
一つのノードを消したらその子ノードも全部消える:done
ボードは常に公開にしておき、他の人が見ることができる状態にすることで正しい方向性をもって編集を進められるようにするという意図。
「オープンな環境での開発」というプロダクトの理念とも沿っているので採用
serverless functions上に作成すれば良い
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.