mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-07-21 06:35:41 +00:00
feat(web): authenticated home redesign + Telegram OAuth + SMTP
- AppLayout: logged-in desktop home redesigned — score cards, 4 section cards (Finance/Governance/Social/Education), governance extras, fixed bottom tab bar (Home/Citizen/Referral) matching mobile layout - AppLayout: Trading dropdown in header (Presale/Staking/MultiSig), Logout button; removed 8-button grid - Removed PalletsGrid and TokenomicsSection components - Login: Telegram OAuth via oauth.telegram.org popup + postMessage + custom Edge Function (hash verification, find-or-create user, magic link token exchange) - Login: X (Twitter) OAuth 2.0 wired to Supabase - supabase/functions/telegram-auth: new Edge Function — verifies Telegram Login Widget hash, issues Supabase magic link token - vite.config.ts: process-shim alias to fix TDZ with node polyfills - i18n: updated locales (en/tr/kmr) for new UI sections - SDK docs search index regenerated
This commit is contained in:
+9
-29
@@ -5,7 +5,7 @@ import path from "path";
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(() => ({
|
||||
export default defineConfig(({ command }) => ({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
@@ -32,37 +32,21 @@ export default defineConfig(() => ({
|
||||
react(),
|
||||
nodePolyfills({
|
||||
globals: {
|
||||
Buffer: false,
|
||||
global: false,
|
||||
process: false,
|
||||
Buffer: true,
|
||||
global: true,
|
||||
process: true,
|
||||
},
|
||||
protocolImports: true,
|
||||
}),
|
||||
{
|
||||
name: 'node-globals-shim',
|
||||
transformIndexHtml() {
|
||||
return [
|
||||
{
|
||||
tag: 'script',
|
||||
children: `
|
||||
window.global = window.global || window;
|
||||
window.process = window.process || { env: {}, browser: true, version: "" };
|
||||
`,
|
||||
injectTo: 'head-prepend',
|
||||
},
|
||||
{
|
||||
tag: 'script',
|
||||
attrs: { type: 'module' },
|
||||
children: `import { Buffer } from 'buffer'; window.Buffer = window.Buffer || Buffer;`,
|
||||
injectTo: 'head-prepend',
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
].filter(Boolean),
|
||||
resolve: {
|
||||
mainFields: ['browser', 'module', 'main', 'exports'],
|
||||
alias: {
|
||||
// Rollup cannot resolve virtual shim modules in production — alias to real file.
|
||||
// Dev mode: the plugin's own virtual module handles it; do NOT override it here.
|
||||
...(command === 'build' ? {
|
||||
'vite-plugin-node-polyfills/shims/process': path.resolve(__dirname, './src/lib/process-shim.ts'),
|
||||
} : {}),
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
"@pezkuwi/i18n": path.resolve(__dirname, "../shared/i18n"),
|
||||
"@pezkuwi/lib": path.resolve(__dirname, "../shared/lib"),
|
||||
@@ -71,10 +55,6 @@ export default defineConfig(() => ({
|
||||
"@local/types": path.resolve(__dirname, "../shared/types"),
|
||||
"@pezkuwi/components": path.resolve(__dirname, "../shared/components"),
|
||||
"@shared": path.resolve(__dirname, "../shared"),
|
||||
// Node polyfill shims for shared folder (outside web workspace)
|
||||
'vite-plugin-node-polyfills/shims/buffer': path.resolve(__dirname, './src/polyfills/buffer-shim.ts'),
|
||||
'vite-plugin-node-polyfills/shims/global': path.resolve(__dirname, './src/polyfills/global-shim.ts'),
|
||||
'vite-plugin-node-polyfills/shims/process': path.resolve(__dirname, './src/polyfills/process-shim.ts'),
|
||||
},
|
||||
dedupe: ['react', 'lucide-react', 'sonner', '@pezkuwi/util-crypto', '@pezkuwi/util', '@pezkuwi/api', '@pezkuwi/extension-dapp', '@pezkuwi/keyring'],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user