Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
9 commits
Select commit Hold shift + click to select a range
ed47404
feat: VITE_GOOGLE_REDIRECT_URI ํ•˜๋‚˜๋กœ ํ†ตํ•ฉ
constantly-dev Mar 19, 2026
cf4b2fd
feat: extension build dev์™€ prod ํ™˜๊ฒฝ ๋ถ„๋ฆฌํ•˜๋„๋ก script, turbo.json ์„ค์ •
constantly-dev Mar 19, 2026
63aa58c
feat: extension build ์‹œ์ ์— dev, prod๊ฐ€ name env ๊ธฐ์ค€์œผ๋กœ ๋‚˜๋‰˜๋„๋ก ์•ฑ ๋ถ„๋ฆฌ ์„ค์ •
constantly-dev Mar 19, 2026
f132130
feat: extension login popup ์ฐฝ ์—ด๋ฆด ๋•Œ dev, prod ํ™˜๊ฒฝ ๋ถ„๋ฆฌ๋˜๋„๋ก ๋™์  url ๋ณ€์ˆ˜ ์„ค์ •
constantly-dev Mar 19, 2026
c1e56ac
feat: extension background webUrl ์„ค์ • ์‹œ ๋™์ ์œผ๋กœ ๋ถ„๊ธฐ๋กœ์ง ์ถ”๊ฐ€
constantly-dev Mar 19, 2026
d5def08
setting: update extension version to 1.0.3
constantly-dev Mar 19, 2026
01f8933
fix: build script ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ € yarn์—์„œ pnpm์œผ๋กœ ์ˆ˜์ •
constantly-dev Mar 19, 2026
823c4a6
refactor: ALLOWED_ORIGINS ์—†๋Š” ๊ฒฝ์šฐ ์˜ˆ์™ธ์ฒ˜๋ฆฌ ์ถ”๊ฐ€
constantly-dev Mar 19, 2026
de53079
refactor: split(,)์— ๋”ฐ๋ผ [] ๋ฐฐ์—ด ์ƒ์„ฑ์œผ๋กœ ์ธํ•œ ์—ฃ์ง€ ์ผ€์ด์Šค ์—๋Ÿฌ ๋ฐฉ์ง€ ๋กœ์ง ์ถ”๊ฐ€
constantly-dev Mar 19, 2026
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
4 changes: 1 addition & 3 deletions apps/client/src/pages/onBoarding/GoogleCallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ const GoogleCallback = () => {
}
};

const redirectUri = import.meta.env.PROD
? import.meta.env.VITE_GOOGLE_REDIRECT_URI_PROD
: import.meta.env.VITE_GOOGLE_REDIRECT_URI_DEV;
const redirectUri = import.meta.env.VITE_GOOGLE_REDIRECT_URI;

const loginWithCode = async (code: string) => {
try {
Expand Down
5 changes: 2 additions & 3 deletions apps/client/src/shared/utils/handleGoogleLogin.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
export const handleGoogleLogin = () => {
const clientId = import.meta.env.VITE_GOOGLE_CLIENT_ID;

const redirectUri = import.meta.env.PROD
? import.meta.env.VITE_GOOGLE_REDIRECT_URI_PROD
: import.meta.env.VITE_GOOGLE_REDIRECT_URI_DEV;
const redirectUri = import.meta.env.VITE_GOOGLE_REDIRECT_URI;

if (!clientId || !redirectUri) {
alert('Google OAuth ์„ค์ •์ด ๋ˆ„๋ฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.');
return;
}

const googleAuthUrl =
`https://accounts.google.com/o/oauth2/v2/auth?` +
`client_id=${clientId}` +
Expand Down
2 changes: 2 additions & 0 deletions apps/extension/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
# misc
.DS_Store
.env.local
.env.development
.env.development.local
.env.test.local
.env.production
.env.production.local

npm-debug.log*
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Pinback ํ•€๋ฐฑ - ๋ถ๋งˆํฌ ๊ด€๋ฆฌ์™€ ๋ฆฌ๋งˆ์ธ๋“œ ๋„๊ตฌ",
"version": "1.0.2",
"version": "1.0.3",
"action": { "default_popup": "popup.html" },
"icons": {
"128": "icon.png",
Expand Down
8 changes: 5 additions & 3 deletions apps/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"dev": "vite --mode development",
"build": "pnpm build:prod",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build๊ฐ€ 10 ๋ฒˆ์จฐ ์ค„ build:prod์™€ ๋‹ค๋ฅผ๊ฒŒ ์—†๋Š”๊ฑฐ ๊ฐ™์€๋ฐ ์ค‘๋ณต๋˜์–ด ์žˆ๋Š” ์ด์œ ๊ฐ€ ์žˆ๋‚˜์š”?

"build:dev": "tsc -b && vite build --mode development",
"build:prod": "tsc -b && vite build --mode production",
"lint": "eslint .",
"format": "prettier -w .",
"zip": "vite build && node scripts/zip.mjs"
"zip": "pnpm build:prod && node scripts/zip.mjs"
},
"dependencies": {
"@pinback/contracts": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions apps/extension/src/background.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { EXTENSION_MESSAGE_TYPE } from '@pinback/contracts/extension-messages';

const webUrl = import.meta.env.VITE_WEB_URL || 'https://pinback.today';

chrome.runtime.onInstalled.addListener((details) => {
if (details.reason === 'install') {
chrome.identity.getProfileUserInfo(function (info) {
chrome.storage.local.set({ email: info.email }, () => {
console.log('User email saved:');

Check warning on line 9 in apps/extension/src/background.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
});
setTimeout(() => {
chrome.tabs.create({
url: `https://pinback.today/onboarding?email=${info.email}`,
url: `${webUrl}/onboarding?email=${info.email}`,
});
}, 1000);
});
Expand All @@ -18,15 +20,13 @@
chrome.runtime.onMessage.addListener((message) => {
if (message.type === EXTENSION_MESSAGE_TYPE.setToken) {
chrome.storage.local.set({ token: message.token }, () => {
console.log('Token saved!');

Check warning on line 23 in apps/extension/src/background.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
});
}
});

chrome.runtime.onMessage.addListener((message) => {
if (message.type === EXTENSION_MESSAGE_TYPE.logout) {
chrome.storage.local.remove('token', () => {
console.log('Token removed!');

Check warning on line 29 in apps/extension/src/background.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
});
}
});
30 changes: 21 additions & 9 deletions apps/extension/src/content.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
import { EXTENSION_MESSAGE_TYPE } from '@pinback/contracts/extension-messages';

const ALLOWED_ORIGINS = __ALLOWED_ORIGINS__;

if (ALLOWED_ORIGINS.length === 0) {
console.warn(

Check warning on line 6 in apps/extension/src/content.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
'[Pinback] ํ—ˆ์šฉ๋œ ๋„๋ฉ”์ธ(ALLOWED_ORIGINS) ์„ค์ •์ด ๋น„์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ํ† ํฐ ๋™๊ธฐํ™”๊ฐ€ ์ž‘๋™ํ•˜์ง€ ์•Š์œผ๋‹ˆ .env ํŒŒ์ผ์„ ํ™•์ธํ•ด์ฃผ์„ธ์š”.'
);
}

window.addEventListener('message', (event) => {
if (event.source !== window) return;
if (event.data.type === EXTENSION_MESSAGE_TYPE.setToken) {

if (!ALLOWED_ORIGINS.includes(event.origin)) return;
Comment thread
coderabbitai[bot] marked this conversation as resolved.

const { type, token } = event.data;

if (type === EXTENSION_MESSAGE_TYPE.setToken) {
chrome.runtime.sendMessage({
type: EXTENSION_MESSAGE_TYPE.setToken,
token: event.data.token,
token,
});
chrome.storage.local.set({ token: event.data.token }, () => {
console.log('Token saved!');

chrome.storage.local.set({ token }, () => {
console.log(`[${event.origin}] Token saved!`);

Check warning on line 25 in apps/extension/src/content.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
});
}
});

window.addEventListener('message', (event) => {
if (event.source !== window) return;
if (event.data.type === EXTENSION_MESSAGE_TYPE.logout) {
// ํ† ํฐ ์‚ญ์ œ (๋กœ๊ทธ์•„์›ƒ)
if (type === EXTENSION_MESSAGE_TYPE.logout) {
chrome.storage.local.remove('token', () => {
console.log('Token removed!');
console.log(`[${event.origin}] Token removed!`);

Check warning on line 32 in apps/extension/src/content.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
});
}
});
4 changes: 3 additions & 1 deletion apps/extension/src/pages/LogOutPop.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Icon } from '@pinback/design-system/icons';
import LogOutImg from '/logout_chippi.svg';
const LogOutPop = () => {
const webUrl = import.meta.env.VITE_WEB_URL || 'https://pinback.today';

return (
<div className="bg-white-bg common-shadow flex h-[37.5rem] w-[35.2rem] flex-col items-center justify-center rounded-[1.2rem] px-[3.2rem] py-[2.4rem] leading-normal">
<div className="mr-auto">
Expand All @@ -25,7 +27,7 @@ const LogOutPop = () => {
type="button"
onClick={() => {
chrome.tabs.create({
url: 'https://pinback.today/onboarding?step=SOCIAL_LOGIN',
url: `${webUrl}/onboarding?step=SOCIAL_LOGIN`,
});
}}
>
Expand Down
3 changes: 3 additions & 0 deletions apps/extension/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference types="vite/client" />

declare const __ALLOWED_ORIGINS__: string[];
70 changes: 42 additions & 28 deletions apps/extension/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,50 @@
// vite.config.ts
import { defineConfig } from 'vite';
import { crx } from '@crxjs/vite-plugin';
import svgSpritePlugin from '@pivanov/vite-plugin-svg-sprite';
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 { defineConfig, loadEnv } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import manifest from './manifest.json';
import svgSpritePlugin from '@pivanov/vite-plugin-svg-sprite';

export default defineConfig({
plugins: [
react(),
tsconfigPaths({
projects: [resolve(__dirname, './tsconfig.json')],
}),
tailwindcss(),
crx({ manifest }),
svgSpritePlugin({
iconDirs: ['../../packages/design-system/src/icons/source'],
symbolId: 'icon-[name]',
inject: 'body-last',
}),
],
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd());

const dynamicManifest = {
...manifest,
name: env.VITE_EXTENSION_NAME || manifest.name,
};

return {
define: {
__ALLOWED_ORIGINS__: JSON.stringify(
env.VITE_ALLOWED_ORIGINS?.split(',').filter(Boolean) || []
),
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.

plugins: [
react(),
tsconfigPaths({
projects: [resolve(__dirname, './tsconfig.json')],
}),
tailwindcss(),
crx({ manifest: dynamicManifest }),
svgSpritePlugin({
iconDirs: ['../../packages/design-system/src/icons/source'],
symbolId: 'icon-[name]',
inject: 'body-last',
}),
],

build: {
outDir: 'dist',
copyPublicDir: true,
},
publicDir: 'public',
build: {
outDir: 'dist',
copyPublicDir: true,
},
publicDir: 'public',

server: {
port: 5175,
strictPort: true,
},
server: {
port: 5175,
strictPort: true,
},
};
});
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
"private": true,
"scripts": {
"build": "turbo run build",
"build:dev": "turbo run build:dev --filter=@pinback/extension",
"build:prod": "turbo run build:prod --filter=@pinback/extension",
"build-storybook": "storybook build",
"dev": "turbo run dev",
"dev:client": "turbo run dev --filter=@pinback/client",
"storybook": "storybook dev -p 6006",
"lint": "turbo run lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"check-types": "turbo run check-types",
"test": "turbo run test",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
"test": "turbo run test"
},
"devDependencies": {
"@chromatic-com/storybook": "^4.1.1",
Expand Down
11 changes: 11 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
"inputs": ["$TURBO_DEFAULT$", ".env*", "!.env.sample"],
"outputs": [".next/**", "!.next/cache/**", "dist/**"]
},

"build:dev": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*", "!.env.sample"],
"outputs": ["dist/**"]
},
"build:prod": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*", "!.env.sample"],
"outputs": ["dist/**"]
},
"dev": {
"cache": false,
"persistent": true
Expand Down
Loading