-
Notifications
You must be signed in to change notification settings - Fork 1
Setting(extension): 익스텐션 환경 설정 #5
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
|
||
| # dependencies | ||
| /node_modules | ||
| /.pnp | ||
| .pnp.js | ||
|
|
||
| # testing | ||
| /coverage | ||
|
|
||
| # production | ||
| /build | ||
| /dist | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
|
|
||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| "manifest_version": 3, | ||
| "name": "PinBack Extension", | ||
| "version": "0.1.0", | ||
| "action": { "default_popup": "popup.html" }, | ||
| "icons": { | ||
| "128": "icon128.png" | ||
| }, | ||
| "background": { | ||
| "service_worker": "src/background.ts", | ||
| "type": "module" | ||
| }, | ||
| "content_scripts": [ | ||
| { | ||
| "matches": ["<all_urls>"], | ||
| "js": ["src/content.ts"] | ||
| } | ||
| ], | ||
| "host_permissions": ["<all_urls>"] | ||
| } |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "name": "@pinback/extension", | ||
| "version": "0.1.0", | ||
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vite", | ||
| "build": "tsc -b && vite build", | ||
| "lint": "eslint .", | ||
| "format": "prettier -w .", | ||
| "zip": "vite build && node scripts/zip.mjs" | ||
| }, | ||
| "dependencies": { | ||
| "@pivanov/vite-plugin-svg-sprite": "^3.1.3", | ||
| "@tanstack/react-query": "^5.85.3", | ||
| "react": "^18.3.1", | ||
| "react-dom": "^18.3.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@crxjs/vite-plugin": "^2.2.0", | ||
| "@tailwindcss/vite": "^4.1.12", | ||
| "@types/chrome": "^0.0.273", | ||
| "@types/react": "^18.3.5", | ||
| "@types/react-dom": "^18.3.0", | ||
| "@vitejs/plugin-react": "^4.3.1", | ||
| "@vitejs/plugin-react-swc": "^4.0.0", | ||
| "autoprefixer": "^10.4.21", | ||
| "eslint": "^9.9.0", | ||
| "eslint-plugin-jsx-a11y": "^6.9.0", | ||
| "eslint-plugin-react": "^7.35.0", | ||
| "postcss": "^8.5.6", | ||
| "prettier": "^3.3.3", | ||
| "prettier-plugin-tailwindcss": "^0.6.8", | ||
| "tailwindcss": "^4.1.12", | ||
| "typescript": "^5.5.4", | ||
| "typescript-eslint": "^8.0.1", | ||
| "vite": "^7.1.2", | ||
| "vite-plugin-chrome-extension": "0.0.7", | ||
| "vite-tsconfig-paths": "^5.1.4" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <!doctype html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <!-- src 경로는 프로젝트 루트 기준으로 모듈 import --> | ||
| <script type="module" src="/src/popup.tsx"></script> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import * as React from "react"; | ||
| import './index.css' | ||
| const App = () => { | ||
| return ( | ||
| <div className="App"> | ||
| <div className="h-[50rem] w-[26rem] bg-blue-500 text-white flex items-center justify-center text-2xl"> | ||
| 자 핀백 앱잼 시작~오늘은 7월 7일임~ | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default App; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| console.log("백그라운드 기능") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| console.log("컨텐츠 스크립트") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| declare module '*.svg' { | ||
| const content: string; | ||
| export default content; | ||
| } | ||
|
|
||
| declare module '*.png' { | ||
| const content: string; | ||
| export default content; | ||
| } | ||
|
|
||
| declare module '*.jpg' { | ||
| const content: string; | ||
| export default content; | ||
| } | ||
|
|
||
| declare module '*.webp' { | ||
| const content: string; | ||
| export default content; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| @import "tailwindcss"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainTailwind v4의 단일 import 사용 — LGTM 팀 러닝과 일치합니다. 이 한 줄이면 base/components/utilities 전부 포함됩니다. Tailwind 스타일이 실제 번들에 포함되는지 확인해 주세요. 보통 popup 엔트리에서 🏁 Script executed: #!/bin/bash
# apps/extension에서 index.css가 어디에서 import/참조되는지 확인
rg -n -C1 --glob '!**/node_modules/**' --type-add 'tsx:*.tsx' --type-add 'html:*.html' 'index\.css|@import\s+"tailwindcss"' apps/extensionLength of output: 194 popup 엔트리에 Tailwind 스타일 포함을 위한 index.css import 추가 필요 Tailwind v4의 + import './index.css';
🤖 Prompt for AI Agents
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 부분은 이후 디자인 시스템 설정 PR 머지된 이후에 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @constantly-dev 좋은 계획이네요! 현재 ✏️ Learnings added
🧠 Learnings used |
||
| /* 디자인 시스템 구축 이후에! 임포트 바꿀 예정입니당 | ||
| */ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // src/popup.tsx | ||
| import * as React from 'react'; | ||
| import { createRoot } from 'react-dom/client'; | ||
| import App from './App'; | ||
| import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
|
|
||
| const queryClient = new QueryClient(); | ||
| const rootEl = document.getElementById('root'); | ||
| if (rootEl) { | ||
| createRoot(rootEl).render( | ||
| <QueryClientProvider client={queryClient}> | ||
| <App /> | ||
| </QueryClientProvider> | ||
| ); | ||
| } else { | ||
| console.error('❌ root element not found!'); | ||
| } |
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 우리 프로젝트에서 tailwind를 ver4를 쓰고 있기 때문에, config파일이 필수가 아니에요! tailwind-config를 따로 package로 빼둔 상태여서 css파일에서 import하고 사용하면 될 것 같아요 👍
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 헉 넵!! 확인해두었습니다! 이후 스타일 적용 확인 후 제거해두겠습니다 :) |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||||||||||||||||||||||||||
| import type { Config } from 'tailwindcss'; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| export default { | ||||||||||||||||||||||||||||
| content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], | ||||||||||||||||||||||||||||
| theme: { | ||||||||||||||||||||||||||||
| extend: {}, | ||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||
| plugins: [], | ||||||||||||||||||||||||||||
| } satisfies Config; | ||||||||||||||||||||||||||||
|
Comment on lines
+4
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Tailwind content 경로에 popup.html 누락 — 스캔 대상에 추가 권장 확장 팝업 엔트리가 popup.html이라면 index.html만 지정 시 해당 파일의 클래스는 스캔되지 않습니다. JIT에서 미검출된 유틸리티가 제거될 수 있습니다. export default {
- content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
+ content: ['./popup.html', './src/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {},
},
plugins: [],
} satisfies Config;추가로, 동적 클래스 네이밍을 사용한다면 safelist 설정도 검토해 주세요. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "moduleResolution": "bundler", | ||
| "baseUrl": ".", | ||
| "outDir": "./dist/", | ||
| "sourceMap": true, | ||
| "strict": true, | ||
| "noImplicitReturns": true, | ||
| "noImplicitAny": true, | ||
| "module": "esnext", | ||
| "target": "ES2020", | ||
| "lib": ["ES2020", "DOM", "DOM.Iterable", "WebWorker"], | ||
| "jsx": "react-jsx", | ||
| "allowJs": false, | ||
| "allowSyntheticDefaultImports": true, | ||
| "esModuleInterop": true, | ||
| "skipLibCheck": true, | ||
| "plugins": [{ "name": "react" }], | ||
| "types": ["vite/client", "chrome"], | ||
| "resolveJsonModule": true, | ||
| "paths": { | ||
| "@components/*": ["src/components/*"], | ||
| "@utils/*": ["src/utils/*"], | ||
| "@constants/*": ["src/constants/*"], | ||
| "@shared-types/*": ["src/types/*"], | ||
| "@api/*": ["src/api/*"] | ||
| } | ||
| }, | ||
| "include": ["src/**/*", "manifest.json", "popup.html", "vite.config.ts"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // vite.config.ts | ||
| import { defineConfig } from 'vite'; | ||
| import tailwindcss from '@tailwindcss/vite'; | ||
| import react from '@vitejs/plugin-react-swc'; | ||
| import tsconfigPaths from 'vite-tsconfig-paths'; | ||
| import { resolve } from 'path'; | ||
| import { crx } from '@crxjs/vite-plugin'; | ||
| import manifest from './manifest.json'; | ||
| export default defineConfig({ | ||
| plugins: [ | ||
| react(), | ||
| tsconfigPaths({ | ||
| projects: [resolve(__dirname, '../../tsconfig.json')], | ||
| }), | ||
| tailwindcss(), | ||
| crx({ manifest }), | ||
| ], | ||
|
|
||
| build: { | ||
| outDir: 'dist', | ||
| copyPublicDir: true, | ||
|
|
||
| }, | ||
| publicDir: 'public', | ||
| resolve: { | ||
| alias: { | ||
| '@': resolve(__dirname, './src'), | ||
| '@api': resolve(__dirname, './src/api'), | ||
| '@utils': resolve(__dirname, './src/utils'), | ||
| '@constants': resolve(__dirname, './src/constants'), | ||
| '@shared-types': resolve(__dirname, './src/types'), | ||
| '@components': resolve(__dirname, './src/components'), | ||
| }, | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
zip 스크립트 리소스 존재 여부 확인
node scripts/zip.mjs가 레포 내에 있는지 확인 부탁드립니다. 누락 시 CI에서 스크립트가 실패합니다.🏁 Script executed:
Length of output: 61
파일이 여전히 보이지 않아 추가 확인이 필요합니다. 아래 스크립트로
apps/extension/scripts디렉터리 및 전체.mjs파일을 다시 검색해 주세요.🏁 Script executed:
Length of output: 317
zip.mjs 파일 누락 – 스크립트 경로 확인 및 추가 필요
apps/extension/package.json에서 참조하는node scripts/zip.mjs파일이 레포에 존재하지 않습니다. CI 오류를 방지하려면 아래 중 하나를 조치해 주세요:apps/extension/scripts/zip.mjs파일을 생성하여 필요한 압축 로직을 구현하고 커밋"zip"스크립트 경로를 실제 스크립트 위치로 수정대상 위치:
"zip": "vite build && node scripts/zip.mjs")🤖 Prompt for AI Agents