playwright ํ…Œ์ŠคํŠธ ์ „ ํ•„์š”ํ•œ ๊ฒƒ๋“ค setupํ•˜๊ธฐ (feat. beforeMount ์‚ฌ์šฉ)
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2024. 8. 28. 09:28

์—๋Ÿฌ ๋ฐœ์ƒreact-router-dom๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์ฝ”๋“œ์˜ playwright ํ…Œ์ŠคํŠธ ์ค‘ ์•„๋ž˜์™€ ๊ฐ™์ด useNavigate ๊ด€๋ จ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹จ์ˆœ ํ•ด๊ฒฐuseNavigate๋Š” react-router-dom ์˜ ํ›…์œผ๋กœ ์„œ์นญํ•ด๋ณด๋‹ˆ MemoryRouter ๋กœ ๊ฐ์‹ธ์ฃผ๋ฉด ๋œ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. const component = await mount( , { hooksConfig } ); ์ด๋ ‡๊ฒŒ mount ์‹œ์— ๋‹จ์ˆœํžˆ ๊ฐ์‹ธ๋Š” ์‹์œผ๋กœ ํ•ด๊ฒฐํ•  ์ˆ˜๋„ ์žˆ๊ฒ ์ง€๋งŒ, ์ด ๋ถ€๋ถ„์„ ๊ณตํ†ตํ™” ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ณตํ†ตํ™” ์‹œ๋„ 1import { MemoryRouter } from 'react-router-dom';import { AuthContext } from '@contexts';export const TE..

vite ํ”„๋กœ์ ํŠธ์—์„œ playwright ์„ค์ • ์‹œ type ๊ด€๋ จ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2024. 8. 6. 00:25

vite ํ”„๋กœ์ ํŠธ์—์„œ playwright ๋ฅผ ์„ค์ •ํ–ˆ์„ ๋•Œ, typecheck ๋ฅผ ๋Œ๋ฆฌ๋ฉด spec.tsx ์—์„œ ํƒ€์ž… ๊ด€๋ จ ์—๋Ÿฌ๊ฐ€ ๋‚œ๋‹ค. ์ด ๋•Œ๋Š” `@playwright/test` ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•ด์„œ tsconfig์˜ compilerOptions.types ํ•„๋“œ์— ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋œ๋‹ค.{ "compilerOptions": { "types": ["node", "vite/client", "jest", "@testing-library/jest-dom", "@playwright/test"], }}

[Git] revert commit is ignored when merge branch
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2024. 6. 26. 01:00

๋ฌธ์ œbranchA ์— revert commit ์ด ํฌํ•จ๋˜์–ด ์žˆ๊ณ  main ์—๋Š” ์—†์„ ๋•Œ, branchA ์—์„œ `git merge main` ์„ ์ˆ˜ํ–‰ํ•˜๋ฉด main ๋ธŒ๋žœ์น˜์˜ ์ƒํƒœ์™€ ๋™์ผํ•˜๊ฒŒ revert commit ์ด ์—†๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋ฌด์‹œํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. merge recursive ์ „๋žตgit ์—์„œ๋Š” merge ๋ช…๋ น์–ด ์‚ฌ์šฉ ์‹œ ๊ธฐ๋ณธ ์ „๋žต์œผ๋กœ recursive ๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๋ฐ, ์ด ์ „๋žต์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.1. ๋‘ ์ปค๋ฐ‹์˜ ๊ณตํ†ต ์กฐ์ƒ ์ปค๋ฐ‹์„ ์ฐพ์Šต๋‹ˆ๋‹ค.2. ๊ฐ ๋ธŒ๋žœ์น˜์˜ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์กฐํ•ฉํ•ด ์ƒˆ๋กœ์šด ๋ณ‘ํ•ฉ ์ปค๋ฐ‹์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.3. 2๋ฒˆ์—์„œ ์ถฉ๋Œ์ด ๋‚˜๋ฉด ์‚ฌ์šฉ์ž์—๊ฒŒ ํ•ด๊ฒฐ์„ ์œ„์ž„ํ•ฉ๋‹ˆ๋‹ค. (recursive ์ „๋žต) ์ด์Šˆ ์ƒํ™ฉ ์ž์„ธํžˆ ์ด์Šˆ๊ฐ€ ์ƒ๊ฒผ๋˜ ์ƒํ™ฉ์„ ๊ทธ๋Œ€๋กœ ๊ฐ€์ ธ์™€๋ดค์Šต๋‹ˆ๋‹ค.main branch ์—์„œ 24.12.0 ๋ธŒ๋žœ์น˜๋ฅผ..

require() of ES Module someFile.js from someFile2.js not supported ์ด์Šˆ ํ•ด๊ฒฐ
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2024. 6. 23. 17:17

์—๋ŸฌError [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/packageA/node_modules/packageB/dist/index.cjs.js from /app/node_modules/packageA/dist/cjs/hooks.js not supported.index.cjs.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.Instead either rename index..

์–ด๋Š 3๋…„์ฐจ ๊ฐœ๋ฐœ์ž์˜ ํšŒ๊ณ ๋ก
๋„์ ์ด๋Š” ๊ธ€/๊ฐœ๋ฐœ์ž๋กœ์„œ ๋„์ ์ด๋Š” ๊ธ€ 2024. 6. 8. 17:04

์–ผ๋งˆ ์ „ ์นœํ•œ ๋™๋ฃŒ ๋ถ„์ด ๋ธ”๋กœ๊ทธ์—์„œ ์ €์˜ ํšŒ๊ณ  ๊ธ€์„ ๋ดค๋‹ค๊ณ  ๋ง์”€ํ•ด์ฃผ์‹  ๊ฒŒ ๊ณ„๊ธฐ๊ฐ€ ๋˜์–ด ์˜ค๋žœ๋งŒ์— ํšŒ๊ณ ๋ฅผ ์ž‘์„ฑํ•ด ๋ด…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‹ค ๋ณด๋‹ˆ ์ œ๋ชฉ์ด ํ•„์š”ํ•ด์„œ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ “3๋…„์ฐจ ๊ฐœ๋ฐœ์ž์˜ ํšŒ๊ณ ๋ก” ์ด๋ผ๊ณ  ์จ๋ฒ„๋ ธ๋Š”๋ฐ, ์–ธ์ œ 3๋…„์ฐจ๊ฐ€ ๋˜์–ด ๋ฒ„๋ฆฐ ๊ฑด๊ฐ€ ์‹ถ์–ด์š”. ์–ด์จŒ๋“  ์Šค์Šค๋กœ ๋ถ€๋‹ด ์ฃผ์ง€ ์•Š๊ณ  ๊ฐ€๋ณ๊ฒŒ ์ €์— ๋Œ€ํ•ด์„œ, ๊ทธ๋ฆฌ๊ณ  ์•ž์œผ๋กœ ์–ด๋–ป๊ฒŒ ํ•˜๊ณ ์‹ถ์€์ง€์— ๋Œ€ํ•ด์„œ ์จ๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๋ฐ˜์„ฑ์˜ ์‹œ๊ฐ„๋‚˜์˜ ์ž๋งŒ์— ๋Œ€ํ•˜์—ฌ์‚ฌ์กฑ์ด์ง€๋งŒ ์˜ฌํ•ด ์—ฐ์ดˆ์— ํ† ์ •๋น„๊ฒฐ์„ ๋ดค์—ˆ๋Š”๋ฐ ์ฒซ ๋ฌธ์žฅ์ด “๋ถ„์ˆ˜์— ๋งž๊ฒŒ ์‚ด๋ผ” ์˜€์–ด์š”. ์ง€๊ธˆ๊ป ์ œ ์‹ค๋ ฅ๋ณด๋‹ค ์šด์ด ์ข‹์•„์„œ ๋งŽ์€ ์ผ๋“ค์ด ์ž˜ ํ’€๋ ค์™”๋Š”๋ฐ, ๊ทธ๋กœ ์ธํ•ด ์ œ๊ฐ€ ๋Œ€๋‹จํ•œ ๊ฐœ๋ฐœ์ž์ธ์–‘ ์ฐฉ๊ฐํ•˜๊ณ  ์žˆ์—ˆ๋˜ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์ผ์„ ํ•  ๋•Œ ์ €์˜ ๋งํˆฌ๋‚˜ ์งˆ๋ฌธ ์Šต๊ด€, ๊ทธ ์•ˆ์— ์ˆจ์–ด์žˆ๋Š” ์ƒ๊ฐ๋“ค์ด ์ ์  ์ž๋งŒ์œผ๋กœ ๋ฌผ๋“ค์–ด๊ฐ€๋Š” ๊ฑธ ๋Š๋ผ๋˜ ์ฐจ์˜€์–ด์š”. ๊ทธ๋งŒํ•˜๋ผ๊ณ ..

์•„์ดํฐ ์ฒœ์ง€์ธ ํ‚ค๋ณด๋“œ ์ด์Šˆ (แ„‹แ†ž, แ„‹แ†ข ๋Œ€์‘)
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2024. 4. 11. 11:21

์•„์ดํฐ ์ฒœ์ง€์ธ ํ‚ค๋ณด๋“œ์—์„œ "์œ ์š”" ๋ผ๋Š” ๊ธ€์ž๋ฅผ ์ž…๋ ฅํ•  ๋•Œ, "์œต" -> "์œ แ„‹แ†ž" -> "์œ แ„‹แ†ข" ์ด๋ ‡๊ฒŒ ์ž…๋ ฅ์ด ๋˜๋Š”๋ฐ ํ•œ๊ธ€๋งŒ ๋Œ€์‘ํ•˜๊ธฐ ์œ„ํ•ด ๋„ฃ์–ด๋‘์—ˆ๋˜ regex ๊ฐ€ ๋™์ž‘ํ•˜๋ฉด์„œ ๊ธ€์ž๋ฅผ ์ง€์›Œ๋ฒ„๋ฆฌ๋Š” ์ด์Šˆ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. [๊ธฐ์กด Regex]return target.replace(/[^๊ฐ€-ํžฃใ†แ†žแ†ขใ„ฑ-ใ…Žใ…-ใ…ฃa-zA-Z\s]/g, '');ํ•œ๊ธ€, ์˜์–ด๊ฐ€ ์•„๋‹Œ ๋ฌธ์ž๋Š” ์ œ๊ฑฐํ•˜๊ธฐ ์œ„ํ•œ regex ์ž…๋‹ˆ๋‹ค. [์ด์Šˆ ์›์ธ] ์ข…์„ฑ ์ž์Œ๊ณผ ใ†แ†žแ†ข ๊ฐ™์€ ์ฒจ์ž๊ฐ€ ํ•ฉ์ณ์ง€๋ฉด์„œ ์ƒˆ๋กœ์šด ์œ ๋‹ˆ์ฝ”๋“œ ๋ฌธ์ž๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. [๋ณ€๊ฒฝ๋œ Regex]/*** ์•„์ดํฐ ์ฒœ์ง€์ธ์„ ๋Œ€์‘ํ•ฉ๋‹ˆ๋‹ค.* \u1100-\u1112 ์ž์Œ ใ„ฑ-ใ…Ž* \u318D\u119E\u11A2\u2022\u2025\u00B7\uFE55 - ใ†แ†žแ†ข•โ€ฅ·๏น•*/ret..

์›น๊ฐœ๋ฐœ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์•ฑ๊ฐœ๋ฐœ ์Š์–ด๋ณด๊ธฐ :: ๋‘˜ ๋‹ค ํ•ด๋ณธ ๊ฐœ๋ฐœ์ž ๐Ÿ˜Ž
์›น (WEB)/๊ณต๋ถ€ 2024. 3. 24. 14:52

์ œ๊ฐ€ ํ•  ์ˆ˜ ์žˆ๋Š” ์ด์•ผ๊ธฐ๊ฐ€ ๋ฌด์—‡์ผ๊นŒ ์ƒ๊ฐํ•ด๋ณด์•˜๋Š”๋ฐ, 2023๋…„ ๊ฐ€์„ “์˜ค๋Š˜์˜๊ฐ€๋“ ” ์ด๋ผ๋Š” ํ”„๋กœ๋•ํŠธ๋ฅผ ๋Ÿฐ์นญ ํ•ด ๋ณธ ๊ฒฝํ—˜์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์•ฑ ๊ฐœ๋ฐœ์„ ํ•ด๋ณด๋ฉด์„œ ๋Š๋‚€ ์›น ๊ฐœ๋ฐœ๊ณผ์˜ ์ฐจ์ด์ ์„ ์ฃผ๋กœ ๋‹ค๋ฃจ๊ณ  ๋Œ€๋ถ€๋ถ„์˜ ์„œ๋น„์Šค๊ฐ€ ๋ชจ๋ฐ”์ผ ํผ์ŠคํŠธ๊ฐ€ ๋œ ํ˜„์‹œ์ ์—์„œ ์•ฑ์„ ์›น๋ทฐ / ๋„ค์ดํ‹ฐ๋ธŒ / ํ•˜์ด๋ธŒ๋ฆฌ๋“œ๋กœ ๊ตฌ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•๊ณผ ๊ฐ์ž์˜ ์žฅ๋‹จ์ ์„ ์‚ดํŽด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. https://yozm.wishket.com/magazine/detail/1969/ ์ด ๋ธ”๋กœ๊ทธ์—์„œ ๊ธ€์„ ๋ณด๊ณ  ๋งˆ์ง€๋ง‰ ๋„ํ‘œ์˜ ๊ธ€์— ํ˜นํ•ด์„œ ๊ธ€์„ ์จ์•ผ๊ฒ ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. "2023๋…„ 2์›” ๊ธฐ์ค€ ์ „ ์„ธ๊ณ„ ์›น ์‚ฌ์ดํŠธ ํŠธ๋ž˜ํ”ฝ์˜ 60.06% ๊ฐ€ ๋ชจ๋ฐ”์ผ ๋””๋ฐ”์ด์Šค๋ฅผ ํ†ตํ•ด ์œ ์ž…๋˜์—ˆ์Šต๋‹ˆ๋‹ค." ์•ฑ ๊ฐœ๋ฐœ์€ ์›น ๊ฐœ๋ฐœ๊ณผ ๋ญ๊ฐ€ ๋‹ค๋ฅผ๊นŒ? ํฌ๊ฒŒ “๋ฐฐํฌ”์™€ “๋ฉ”๋ชจ๋ฆฌ ๊ด€๋ฆฌ” ๊ทธ๋ฆฌ๊ณ  “UI ๊ณ„์ธต๊ตฌ์กฐ” ์„ธ๊ฐ€์ง€ ์ธก..

[Next.js] Redirect ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐฉ๋ฒ• 5๊ฐ€์ง€
์›น (WEB) 2024. 1. 6. 17:54

Next.js์—์„œ ๋Œ€์‘์ด ๋˜์–ด ์žˆ์ง€ ์•Š์€ `/` path๋กœ ์ง„์ž…ํ–ˆ์„ ๋•Œ default `/home` page๋กœ redirect ํ•˜๋Š” ์ŠคํŽ™์„ ๊ตฌํ˜„ํ•ด์•ผ ํ•œ๋‹ค. Redirect ์‹œ ์‚ฌ์šฉํ•˜๋Š” ์ƒํƒœ์ฝ”๋“œ Next.js์—์„œ์˜ redirect ๋ฅผ ๊ตฌํ˜„ํ•˜๊ธฐ ์ „ redirect ์‹œ์— ์„œ๋ฒ„์—์„œ ๋ฐ˜ํ™˜ํ•˜๋Š” ์ƒํƒœ์ฝ”๋“œ๋ฅผ ๋จผ์ € ์‚ดํŽด๋ณด์ž. 300๋ฒˆ ๋Œ€์˜ ์ƒํƒœ์ฝ”๋“œ๋Š” ๋ชจ๋‘ Redirection ์„ ์˜๋ฏธํ•˜๋ฉฐ, 300 ~ 308 ๊นŒ์ง€ ์žˆ๋‹ค. 301 (Moved Permanently) : ํด๋ผ์ด์–ธํŠธ์˜ ์š”์ฒญ ๋ฉ”์†Œ๋“œ๋ฅผ GET ์œผ๋กœ ๋ฐ”๊พธ๋ฉฐ, redirect ์ฒ˜๋ฆฌ๊ฐ€ ์บ์‹ฑ๋œ๋‹ค. 302 (Found - Moved Temporarily) : ํด๋ผ์ด์–ธํŠธ์˜ ์š”์ฒญ ๋ฉ”์†Œ๋“œ๋ฅผ GET ์œผ๋กœ ๋ฐ”๊พธ๋ฉฐ, redirect ์ฒ˜๋ฆฌ๊ฐ€ ์ผ์‹œ์ ์ด๊ณ  ์บ์‹ฑ๋˜์ง€ ์•Š๋Š”๋‹ค. 304 (Not..