Skip to content

Commit

Permalink
Merge pull request #339 from nekochans/feature/issue335/update-npm-pa…
Browse files Browse the repository at this point in the history
…ckages

npm packageを最新安定版に更新(デザインリニューアル前の最後のアップデート)
  • Loading branch information
keitakn authored Aug 16, 2024
2 parents 008149b + f26b706 commit 8fc0b2c
Show file tree
Hide file tree
Showing 26 changed files with 3,193 additions and 4,829 deletions.
7 changes: 4 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import typescriptEslint from '@typescript-eslint/eslint-plugin';
import jsxA11Y from 'eslint-plugin-jsx-a11y';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import storybook from 'eslint-plugin-storybook';
import vitest from 'eslint-plugin-vitest';
import globals from 'globals';

const __filename = fileURLToPath(import.meta.url);
Expand Down Expand Up @@ -48,9 +50,6 @@ export default [
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:vitest/recommended',
'plugin:storybook/recommended',
'next/core-web-vitals',
'prettier',
),
),
Expand All @@ -60,6 +59,8 @@ export default [
'jsx-a11y': fixupPluginRules(jsxA11Y),
react: fixupPluginRules(react),
'react-hooks': fixupPluginRules(reactHooks),
storybook,
vitest,
},

languageOptions: {
Expand Down
7,862 changes: 3,128 additions & 4,734 deletions package-lock.json

Large diffs are not rendered by default.

94 changes: 47 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,80 +23,80 @@
"chromatic": "chromatic --project-token=$CHROMATIC_PROJECT_TOKEN"
},
"dependencies": {
"@sentry/nextjs": "8.13.0",
"@upstash/ratelimit": "^1.1.3",
"@upstash/redis": "^1.30.0",
"@vercel/edge-config": "^1.1.0",
"@sentry/nextjs": "8.26.0",
"@upstash/ratelimit": "^2.0.1",
"@upstash/redis": "^1.34.0",
"@vercel/edge-config": "^1.2.1",
"clipboard": "^2.0.11",
"lodash.throttle": "^4.1.1",
"next": "^14.2.3",
"next": "^14.2.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-dropzone": "^14.2.3",
"react-icons": "^5.1.0",
"react-icons": "^5.3.0",
"react-markdown": "^9.0.1",
"react-modal": "^3.16.1",
"ress": "^5.0.2",
"valtio": "^1.13.2",
"zod": "^3.23.4"
"zod": "^3.23.8"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.3.3",
"@chromatic-com/storybook": "^1.6.1",
"@eslint/compat": "^1.1.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.8.0",
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@next/env": "^14.2.3",
"@storybook/addon-a11y": "^8.0.9",
"@storybook/addon-essentials": "^8.0.9",
"@storybook/addon-interactions": "^8.0.9",
"@storybook/addon-links": "^8.0.9",
"@storybook/addon-onboarding": "^8.0.9",
"@storybook/blocks": "^8.0.9",
"@storybook/nextjs": "^8.0.9",
"@storybook/react": "^8.0.9",
"@storybook/test": "^8.0.9",
"@eslint/js": "^9.9.0",
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
"@next/env": "^14.2.5",
"@storybook/addon-a11y": "^8.2.9",
"@storybook/addon-essentials": "^8.2.9",
"@storybook/addon-interactions": "^8.2.9",
"@storybook/addon-links": "^8.2.9",
"@storybook/addon-onboarding": "^8.2.9",
"@storybook/blocks": "^8.2.9",
"@storybook/nextjs": "^8.2.9",
"@storybook/react": "^8.2.9",
"@storybook/test": "^8.2.9",
"@storybook/testing-library": "^0.2.2",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^15.0.5",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@types/clipboard": "^2.0.7",
"@types/eslint": "^8.56.10",
"@types/eslint": "^9.6.0",
"@types/lodash.throttle": "^4.1.9",
"@types/prettier": "^2.7.3",
"@types/react": "18.3.1",
"@types/react": "18.3.3",
"@types/react-modal": "^3.16.3",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@vitejs/plugin-react-swc": "^3.6.0",
"@vitest/coverage-v8": "^1.5.2",
"chromatic": "^11.3.0",
"eslint": "8.57.0",
"eslint-config-next": "^14.2.3",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@vitejs/plugin-react-swc": "^3.7.0",
"@vitest/coverage-v8": "^2.0.5",
"chromatic": "^11.7.1",
"eslint": "9.9.0",
"eslint-config-next": "^14.2.5",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-n": "^17.3.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-vitest": "^0.3.22",
"eslint-plugin-vitest": "^0.5.4",
"globals": "^15.9.0",
"happy-css-modules": "^2.1.2",
"jsdom": "^24.0.0",
"msw": "^2.2.14",
"msw-storybook-addon": "2.0.0",
"happy-css-modules": "^3.1.1",
"jsdom": "^24.1.1",
"msw": "^2.3.5",
"msw-storybook-addon": "2.0.3",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"storybook": "^8.0.9",
"stylelint": "^16.4.0",
"postcss": "^8.4.41",
"prettier": "^3.3.3",
"storybook": "^8.2.9",
"stylelint": "^16.8.2",
"stylelint-config-recess-order": "^5.0.1",
"stylelint-config-standard": "^36.0.0",
"stylelint-config-standard": "^36.0.1",
"stylelint-order": "^6.0.4",
"typescript": "5.4.5",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.5.2"
"typescript": "5.5.4",
"vite-tsconfig-paths": "^5.0.1",
"vitest": "^2.0.5"
},
"msw": {
"workerDirectory": "public"
Expand Down
2 changes: 1 addition & 1 deletion public/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* - Please do NOT serve this file on production.
*/

const PACKAGE_VERSION = '2.2.14'
const PACKAGE_VERSION = '2.3.5'
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
const activeClientIds = new Set()
Expand Down
3 changes: 1 addition & 2 deletions src/api/cognito/openIdConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IssueClientCredentialsAccessTokenError } from './IssueClientCredentials

type CognitoTokenResponseBody = {
access_token: string;
// eslint-disable-next-line no-magic-numbers

expires_in: 3600;
token_type: 'Bearer';
};
Expand Down Expand Up @@ -95,7 +95,6 @@ export const issueClientCredentialsAccessToken: IssueClientCredentialsAccessToke
);
}

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const responseBody = (await response.json()) as unknown;

if (isCognitoTokenResponseBody(responseBody)) {
Expand Down
2 changes: 0 additions & 2 deletions src/api/lgtmeow/lgtmImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
} from '@/features';
import { mightSetRequestIdToSentry } from '@/utils';

// eslint-disable-next-line require-await
export const fetchLgtmImagesInRandom: FetchLgtmImages = async (
appBaseUrl,
revalidate,
Expand All @@ -41,7 +40,6 @@ export const fetchLgtmImagesInRandom: FetchLgtmImages = async (
return (await response.json()) as LgtmImage[];
};

// eslint-disable-next-line require-await
export const fetchLgtmImagesInRecentlyCreated: FetchLgtmImages = async (
appBaseUrl,
revalidate,
Expand Down
1 change: 0 additions & 1 deletion src/app/api/lgtm-images/recently-created/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export const GET = async (request: NextRequest): Promise<Response> => {
options,
);

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const responseBody = (await response.json()) as unknown;
if (isFetchLgtmImagesResponseBody(responseBody)) {
const lgtmImages = responseBody.lgtmImages.map((value) => {
Expand Down
1 change: 0 additions & 1 deletion src/app/api/lgtm-images/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export const GET = async (request: NextRequest): Promise<Response> => {

const response = await fetch(`${lgtmeowApiUrl()}/lgtm-images`, options);

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const responseBody = (await response.json()) as unknown;
if (isFetchLgtmImagesResponseBody(responseBody)) {
const lgtmImages = responseBody.lgtmImages.map((value) => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/en/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const metadata: Metadata = {

const InternationalizationLayout = ({ children }: Props): JSX.Element => {
return (
<html lang={language} prefix="og: https://ogp.me/ns#">
<html lang={language}>
<head>
<link
href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP&family=Roboto&family=Zen+Kaku+Gothic+New&display=swap"
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const metadata: Metadata = {

const RootLayout = ({ children }: Props): JSX.Element => {
return (
<html lang={language} prefix="og: https://ogp.me/ns#">
<html lang={language}>
<head>
<link
href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP&family=Roboto&family=Zen+Kaku+Gothic+New&display=swap"
Expand Down
2 changes: 1 addition & 1 deletion src/components/LgtmImages/LgtmImages.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const WithAppUrl: Story = {
export const WithCallbackFunc: Story = {
args: {
images,
// eslint-disable-next-line no-alert

callback: () => {
alert('run callback func!');
},
Expand Down
15 changes: 3 additions & 12 deletions src/components/Upload/UploadForm/UploadForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable max-lines */
'use client';

import type { AppUrl } from '@/constants';
Expand Down Expand Up @@ -83,7 +82,6 @@ export type Props = {
appUrl?: AppUrl;
};

// eslint-disable-next-line max-lines-per-function, max-statements
export const UploadForm: FC<Props> = ({
language,
imageValidator,
Expand Down Expand Up @@ -143,7 +141,6 @@ export const UploadForm: FC<Props> = ({
setBase64Image(window.btoa(binaryString));
};

// eslint-disable-next-line max-statements
const mightConvertImageToBase64 = (file: File) => {
setUploaded(false);
const fileType = file.type;
Expand Down Expand Up @@ -175,10 +172,9 @@ export const UploadForm: FC<Props> = ({
openModal();
};

// eslint-disable-next-line max-statements
const handleFileUpload = (event: ChangeEvent<HTMLInputElement>) => {
event.preventDefault();
// eslint-disable-next-line no-magic-numbers

if (event.target.files && event.target.files.length > 0) {
const targetIndex = 0;
const file = event.target.files[targetIndex];
Expand All @@ -187,7 +183,6 @@ export const UploadForm: FC<Props> = ({
};

const shouldDisableButton = (): boolean => {
// eslint-disable-next-line no-magic-numbers
if (displayErrorMessages.length !== 0) {
return true;
}
Expand All @@ -201,7 +196,6 @@ export const UploadForm: FC<Props> = ({
openModal();
};

// eslint-disable-next-line max-statements, max-lines-per-function
const executeUpload = async () => {
setIsLoading(true);

Expand All @@ -213,7 +207,6 @@ export const UploadForm: FC<Props> = ({

if (
!imageValidationResult.value.isAcceptableCatImage ||
// eslint-disable-next-line no-magic-numbers
imageValidationResult.value.notAcceptableReason.length !== 0
) {
setDisplayErrorMessages(
Expand Down Expand Up @@ -242,7 +235,6 @@ export const UploadForm: FC<Props> = ({
}
}

// eslint-disable-next-line no-magic-numbers
if (imageUploadResult.value.displayErrorMessages.length !== 0) {
setDisplayErrorMessages(imageUploadResult.value.displayErrorMessages);
stateInitAtError();
Expand All @@ -264,7 +256,6 @@ export const UploadForm: FC<Props> = ({
};

const onDrop = useCallback((acceptedFiles: File[]) => {
// eslint-disable-next-line no-magic-numbers
if (acceptedFiles.length > 0) {
const targetIndex = 0;
const file = acceptedFiles[targetIndex];
Expand All @@ -278,15 +269,15 @@ export const UploadForm: FC<Props> = ({

return (
<div className={styles.wrapper}>
{/* eslint-disable no-magic-numbers */}
{}
{displayErrorMessages.length === 0 ? (
''
) : (
<UploadErrorMessageArea messages={displayErrorMessages} />
)}
<UploadTitleArea language={language} />
<form className={styles.form}>
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
{}
<div {...getRootProps()} className={styles['input-file-area']}>
<FaCloudUploadAlt className={styles['fa-cloud-upload-alt']} />
<div className={styles.text}>{imageDropAreaText(language)}</div>
Expand Down
1 change: 0 additions & 1 deletion src/components/Upload/UploadModal/UploadModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const modalStyle = {
},
};

// eslint-disable-next-line max-lines-per-function
export const UploadModal: FC<Props> = ({
isOpen,
language,
Expand Down
1 change: 0 additions & 1 deletion src/features/imageData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable max-lines */
import type { LgtmImage } from './lgtmImage';

export const imageData: LgtmImage[] = [
Expand Down
9 changes: 2 additions & 7 deletions src/features/lgtmImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,10 @@ export const isLgtmImageUrl = (value: unknown): value is LgtmImageUrl => {

export const isLgtmImages = (value: unknown): value is LgtmImage[] => {
if (Array.isArray(value)) {
// eslint-disable-next-line no-magic-numbers
if (Object.prototype.toString.call(value[0]) !== '[object Object]') {
return false;
}

// eslint-disable-next-line no-magic-numbers
const lgtmImage = value[0] as LgtmImage;

return (
Expand All @@ -120,11 +118,9 @@ export const extractRandomImages = (numberToExtract: number): LgtmImage[] => {
const copiedLgtmImages = [...imageData];
const result = [];

// eslint-disable-next-line id-length, no-magic-numbers
for (let i = numberToExtract; i > 0; i -= 1) {
// eslint-disable-next-line no-magic-numbers
const rand = Math.floor(Math.random() * (copiedLgtmImages.length + 1)) - 1;
// eslint-disable-next-line no-magic-numbers

result.push(...copiedLgtmImages.splice(rand, 1));
}

Expand All @@ -150,10 +146,9 @@ export const extractImageExtFromValidFileType = (

const calculateFileSize = (file: File): number => {
const kb = 1024;
// eslint-disable-next-line no-magic-numbers

const mb = kb ** 2;

// eslint-disable-next-line no-magic-numbers
return Math.round((file.size / mb) * 100.0) / 100.0;
};

Expand Down
4 changes: 2 additions & 2 deletions src/features/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export type Result<T, E> = SuccessResult<T> | FailureResult<E>;

export const createSuccessResult = <T>(value: T): SuccessResult<T> => ({
value,
// eslint-disable-next-line id-length

_: SuccessMarker,
});

export const createFailureResult = <E>(value: E): FailureResult<E> => ({
value,
// eslint-disable-next-line id-length

_: FailureMarker,
});

Expand Down
Loading

0 comments on commit 8fc0b2c

Please sign in to comment.