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

作品に関するページの作成 #199

Merged
merged 36 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c938262
feat: add avatar ui component
yamato0211 Nov 5, 2023
e2e9360
fix: review changes
yamato0211 Nov 5, 2023
04556c6
feat: add icon button ui
yamato0211 Nov 6, 2023
96cbbf3
fix: review changes
yamato0211 Nov 10, 2023
9715a76
chore: updateされたbunのバージョンを更新するように変更
tosaken1116 Dec 28, 2023
ff0da71
fix: change work card style
tosaken1116 Mar 29, 2024
74bdec6
feat: add work cards presentation
tosaken1116 Mar 29, 2024
c060601
feat: add grid components
tosaken1116 Mar 29, 2024
b5b3304
chore: format all file
tosaken1116 Mar 29, 2024
94c4e9f
chore: change storybook config
tosaken1116 Mar 29, 2024
adf1f4f
refactor: usecase and repository
tosaken1116 Mar 29, 2024
e4315a4
chore: remove tanstack query
tosaken1116 Mar 30, 2024
8c776d9
feat: add top page
tosaken1116 Mar 30, 2024
b7bf754
feat: add work detail presentation
tosaken1116 Apr 2, 2024
e1bb9aa
chore: change dir of model to domains
tosaken1116 Apr 2, 2024
211926f
chore: format all file
tosaken1116 Apr 2, 2024
f5bfa46
fix: todo task
tosaken1116 Apr 2, 2024
8954dc3
fix: template generator dir
tosaken1116 Apr 2, 2024
f6af097
chore: change URLInput dir
tosaken1116 Apr 2, 2024
1ccf249
feat: add edit work page
tosaken1116 Apr 5, 2024
01ef6b8
refactor: minimize bundle
tosaken1116 Apr 5, 2024
1652474
feat: add task search ui
tosaken1116 Apr 5, 2024
574f80c
chore: remove useless module
tosaken1116 Apr 5, 2024
6a6aa5b
fix: chromatic deploy workflow
tosaken1116 Apr 5, 2024
3eaa853
chore: add WorkDetail story mock data
tosaken1116 Apr 5, 2024
8dea721
chore: add tag story mock data
tosaken1116 Apr 5, 2024
af28afa
chore: add user card mock data
tosaken1116 Apr 5, 2024
11cefbd
chore: add work edit mock data
tosaken1116 Apr 5, 2024
b0356f6
fix: asset mock data
tosaken1116 Apr 5, 2024
4ed0a97
chore: remove console log
tosaken1116 Apr 8, 2024
da61178
feat: add story mock data
tosaken1116 Apr 8, 2024
cece274
fix: uploadable file context
tosaken1116 Apr 8, 2024
618441f
fix: work detail link clickable
tosaken1116 Apr 8, 2024
34dafb2
fix: date diff label full date with 3 month ago
tosaken1116 Apr 9, 2024
c218e6c
feat: add mock workid to page screen
tosaken1116 Apr 9, 2024
3a56525
fix: top page search bar groqw
tosaken1116 Apr 9, 2024
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
7 changes: 3 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"parserOptions": {
"project": "./tsconfig.json"
},
"ignorePatterns": ["src/mocks/**/*"],
"plugins": [
"react",
"import",
Expand All @@ -35,6 +36,7 @@
// 未使用のインポートを禁止
"unused-imports/no-unused-imports": "error",

"@typescript-eslint/no-misused-promises": "off",
// JSXのブール属性の値を明示的に指定する
"react/jsx-boolean-value": "error",

Expand Down Expand Up @@ -92,10 +94,7 @@
// pageコンポーネントにおいて、他のpageコンポーネントからのimportを禁止する
{
"target": "./src/components/page/**/index.tsx",
"from": [
"./src/components/page/**/index.tsx",
"./node_modules/@radix-ui/"
]
"from": ["./src/components/page/**/index.tsx"]
},
// appディレクトリ配下においてmodel,uiのimportを禁止する
{
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/chromatic_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
if: github.event.pull_request.user.login != 'dependabot[bot]'
steps:
- uses: actions/checkout@v1
- uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun i --frozen-lockfile
- name: Setup
uses: ./.github/actions/bun

- uses: chromaui/action@v10
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const config: StorybookConfig = {
docs: {
autodocs: 'tag',
},
staticDirs: [path.resolve(__dirname, '../public')],
webpackFinal: (config) => {
config.resolve!.alias = {
...config!.resolve!.alias,
Expand Down
2 changes: 2 additions & 0 deletions .storybook/preview.ts → .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Preview } from '@storybook/react';
import '../src/app/globals.css';
import React from 'react';
const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
Expand All @@ -10,6 +11,7 @@ const preview: Preview = {
},
},
},
decorators: [(Story) => <Story />],
};

export default preview;
2 changes: 1 addition & 1 deletion _templates/generator/model/container/component.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: "<%= `src/components/model/${domains}/components/${name}/index.tsx` %>"
to: "<%= `src/domains/${domains}/components/${name}/index.tsx` %>"
---
import type { FC } from 'react';
import { Suspense } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/container/container.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: "<%= `src/components/model/${domains}/components/${name}/presentations/container.tsx` %>"
to: "<%= `src/domains/${domains}/components/${name}/presentations/container.tsx` %>"
---
import type { FC } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/container/empty.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: "<%= gen_files.includes('Empty') ? `src/components/model/${domains}/components/${name}/presentations/empty.tsx` : null %>"
to: "<%= gen_files.includes('Empty') ? `src/domains/${domains}/components/${name}/presentations/empty.tsx` : null %>"
---
import type { FC } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/container/error.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: "<%= gen_files.includes('Error') ? `src/components/model/${domains}/components/${name}/presentations/error.tsx` : null %>"
to: "<%= gen_files.includes('Error') ? `src/domains/${domains}/components/${name}/presentations/error.tsx` : null %>"
---
import type { FC } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/container/hooks.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: "<%= have_hooks ? `src/components/model/${domains}/components/${name}/hooks/index.ts` : null %>"
to: "<%= have_hooks ? `src/domains/${domains}/components/${name}/hooks/index.ts` : null %>"
---
import type { Dispatch, SetStateAction } from 'react';
import { useState } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/container/index.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: "<%= `src/components/model/${domains}/components/${name}/presentations/index.ts` %>"
to: "<%= `src/domains/${domains}/components/${name}/presentations/index.ts` %>"
---
export * from "./container"

Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/container/loading.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: "<%= gen_files.includes('Loading') ? `src/components/model/${domains}/components/${name}/presentations/loading.tsx` : null %>"
to: "<%= gen_files.includes('Loading') ? `src/domains/${domains}/components/${name}/presentations/loading.tsx` : null %>"
---
import type { FC } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/container/main.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: "<%= `src/components/model/${domains}/components/${name}/presentations/main.tsx` %>"
to: "<%= `src/domains/${domains}/components/${name}/presentations/main.tsx` %>"
---
import type { FC } from 'react';

Expand Down
4 changes: 2 additions & 2 deletions _templates/generator/model/container/prompt.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require('fs');
const path = require('path');
const targetDirectory = './src/components/model';
const targetDirectory = './src/domains';
function getDomains(basePath) {
return fs.readdirSync(basePath).filter((file) => {
const filePath = path.join(basePath, file);
Expand Down Expand Up @@ -54,7 +54,7 @@ module.exports = {
])
.then(({ name, domains, have_props, have_hooks, gen_files }) => {
const contentToAdd = `\nexport * from './${name}';\n`;
const path = `./src/components/model/${domains}/components/index.ts`;
const path = `./src/domains/${domains}/components/index.ts`;
fs.appendFile(path, contentToAdd, 'utf8', (err) => {
if (err) {
console.error('ファイルの書き込みに失敗しました:', err);
Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/container/stories.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: src/components/model/<%= domains %>/components/<%= name %>/index.stories.tsx
to: src/domains/<%= domains %>/components/<%= name %>/index.stories.tsx
---

import { <%= name %>Presentation } from './presentations';
Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/container/test.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: src/components/model/<%= domains %>/components/<%= name %>/index.test.tsx
to: src/domains/<%= domains %>/components/<%= name %>/index.test.tsx
---
import { render, screen } from "@testing-library/react";

Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/presentation/index.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: "<%= `src/components/model/${domains}/components/${name}/index.ts` %>"
to: "<%= `src/domains/${domains}/components/${name}/index.ts` %>"
---
export * from './main';

Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/presentation/main.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: "<%= `src/components/model/${domains}/components/${name}/main.tsx` %>"
to: "<%= `src/domains/${domains}/components/${name}/main.tsx` %>"
---
import type { FC } from 'react';

Expand Down
4 changes: 2 additions & 2 deletions _templates/generator/model/presentation/prompt.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require('fs');
const path = require('path');
const targetDirectory = './src/components/model';
const targetDirectory = './src/domains';
function getDomains(basePath) {
return fs.readdirSync(basePath).filter((file) => {
const filePath = path.join(basePath, file);
Expand Down Expand Up @@ -38,7 +38,7 @@ module.exports = {
])
.then(({ name, domains, need_loading }) => {
const contentToAdd = `\nexport * from './${name}';\n`;
const path = `./src/components/model/${domains}/components/index.ts`;
const path = `./src/domains/${domains}/components/index.ts`;
fs.appendFile(path, contentToAdd, 'utf8', (err) => {
if (err) {
console.error('ファイルの書き込みに失敗しました:', err);
Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/presentation/skeleton.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: "<%= need_loading ? `src/components/model/${domains}/components/${name}/loading.tsx` : null %>"
to: "<%= need_loading ? `src/domains/${domains}/components/${name}/loading.tsx` : null %>"
---
import type { FC } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/presentation/stories.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: src/components/model/<%= domains %>/components/<%= name %>/index.stories.tsx
to: src/domains/<%= domains %>/components/<%= name %>/index.stories.tsx
---

<% if (need_loading) {%>import { <%= name %>Loading } from './loading';<% } %>
Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/model/presentation/test.ejs.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
to: src/components/model/<%= domains %>/components/<%= name %>/index.test.tsx
to: src/domains/<%= domains %>/components/<%= name %>/index.test.tsx
---
import { render, screen } from "@testing-library/react";

Expand Down
2 changes: 1 addition & 1 deletion _templates/generator/page/prompt.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require('fs');
const path = require('path');
const targetDirectory = './src/components/model';
const targetDirectory = './src/domains';
function getDirectories(basePath) {
return fs.readdirSync(basePath).filter((file) => {
const filePath = path.join(basePath, file);
Expand Down
Binary file modified bun.lockb
Binary file not shown.
15 changes: 13 additions & 2 deletions cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@
// language - current active spelling language
"language": "en",
// words - list of words to be always considered correct
"words": ["aspida", "autodocs", "openapi", "testid", "Usecase", "fakepath"],
"ignorePaths": ["src/api/**/*"]
"words": [
"aspida",
"autodocs",
"openapi",
"testid",
"Usecase",
"fakepath",
"toybox",
"gltf",
"drei",
"nocheck"
],
"ignorePaths": ["src/api/**/*", "src/mocks/**/*"]
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
// For example "hte" should be "the"
Expand Down
25 changes: 22 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env['ANALYZE'] === 'true',
});
const nextConfig = {
images: {
remotePatterns: [
{ hostname: 'placehold.jp' },
{
hostname: 's3.ap-northeast-2.wasabisys.com',
},
{
hostname: 's3.ap-northeast-1.wasabisys.com',
},
],
},
modularizeImports: {
qs: {
transform: 'qs/lib/{{member}}',
},
},
};

module.exports = nextConfig
module.exports = withBundleAnalyzer(nextConfig);
46 changes: 40 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"analyze": "ANALYZE=true next build",
"start": "next start",
"lint": "next lint",
"test:unit": "jest --passWithNoTests",
Expand All @@ -14,7 +15,7 @@
"new:model:p": "hygen generator model/presentation",
"new:page": "hygen generator page",
"prepare": "husky install",
"mock": "prism mock ./schema/build/openapi.yml",
"mock": "tsx scripts/serviceWorker.ts",
"type": "rm -rf src/api && openapi2aspida -c ./aspida.config.js --dotenv .env.local",
"commitmsg": "commitlint -e $GIT_PARAMS",
"fmt": "prettier --write 'src/**/*.{js,jsx,ts,tsx,json,css,scss}'",
Expand All @@ -29,8 +30,7 @@
},
"engines": {
"npm": "bun please",
"yarn": "bun please",
"pnpm": "bun please"
"yarn": "bun please"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json,css,scss}": [
Expand All @@ -40,22 +40,43 @@
},
"dependencies": {
"@aspida/fetch": "^1.14.0",
"@tanstack/react-query": "^5.4.3",
"@hookform/resolvers": "^3.3.4",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-menubar": "^1.0.4",
"@radix-ui/react-radio-group": "^1.1.3",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-separator": "^1.0.3",
"@react-three/drei": "^9.103.0",
"@react-three/fiber": "^8.16.1",
"cookies-next": "^4.1.1",
"date-fns": "^2.30.0",
"jotai": "^2.7.2",
"lucide-react": "^0.314.0",
"next": "14.0.4",
"qs": "^6.11.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-error-boundary": "^4.0.11",
"react-full-screen": "^1.1.1",
"react-image-crop": "^11.0.2"
"react-hook-form": "^7.51.2",
"react-image-crop": "^11.0.2",
"react-markdown": "^9.0.1",
"react-player": "^2.15.1",
"react-syntax-highlighter": "^15.5.0",
"swr": "^2.2.5",
"three": "^0.163.0",
"zod": "^3.22.4"
},
"devDependencies": {
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.4.3",
"@markuplint/jsx-parser": "^3.12.0",
"@markuplint/react-spec": "^3.12.0",
"@mswjs/http-middleware": "^0.9.2",
"@next/bundle-analyzer": "^14.1.4",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
Expand All @@ -71,24 +92,28 @@
"@storybook/nextjs": "^7.2.2",
"@storybook/react": "^7.6.4",
"@storybook/testing-library": "^0.2.0",
"@tanstack/eslint-plugin-query": "^5.0.0",
"@tailwindcss/typography": "^0.5.12",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.1",
"@tsconfig/strictest": "^2.0.1",
"@types/cors": "^2.8.17",
"@types/date-fns": "^2.6.0",
"@types/jest": "^29.5.7",
"@types/node": "20.11.5",
"@types/qs": "^6.9.10",
"@types/react": "18.2.48",
"@types/react-dom": "18.2.18",
"@types/react-syntax-highlighter": "^15.5.11",
"@types/three": "^0.163.0",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.11.0",
"aspida": "^1.14.0",
"autoprefixer": "^10.4.16",
"chromatic": "^10.0.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cors": "^2.8.5",
"cspell": "^8.0.0",
"eslint": "8.56.0",
"eslint-config-next": "14.0.4",
Expand All @@ -98,21 +123,25 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-storybook": "^0.6.13",
"eslint-plugin-unused-imports": "^3.0.0",
"express": "^4.19.2",
"husky": "^8.0.3",
"hygen": "^6.2.11",
"jest": "^29.6.4",
"jest-environment-jsdom": "^29.6.4",
"lint-staged": "^15.0.2",
"markuplint": "^3.15.0",
"msw": "latest",
"npm-run-all": "^4.1.5",
"openapi2aspida": "^0.23.2",
"postcss": "^8.4.31",
"prettier": "^3.0.1",
"prop-types": "^15.8.1",
"storybook": "^7.6.4",
"tailwind-merge": "^2.0.0",
"tailwindcss": "^3.3.3",
"tailwindcss-animate": "^1.0.7",
"ts-jest": "^29.1.1",
"tsx": "^4.7.1",
"typescript": "5.3.3"
},
"exports": {
Expand All @@ -127,5 +156,10 @@
"npm": "10.1.0",
"pnpm": "8.7.4",
"yarn": "3.6.3"
},
"msw": {
"workerDirectory": [
"public"
]
}
}
Loading
Loading