Skip to content

Commit

Permalink
v0.1.3
Browse files Browse the repository at this point in the history
v0.1.3

chore: fix version

fix: redirecting
  • Loading branch information
backrunner committed Aug 26, 2024
1 parent 7e183ac commit 4b2e6cc
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 28 deletions.
7 changes: 6 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ export default defineConfig({
}),
auth(),
],
});
vite: {
ssr: {
external: ['node:crypto', 'node:path'],
},
},
});
14 changes: 12 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "alphapush",
"type": "module",
"version": "0.1.2",
"version": "0.1.3",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand All @@ -12,7 +12,7 @@
"db:migrate:local": "wrangler d1 migrations apply alphapush-prod --local",
"db:migrate:prod": "wrangler d1 migrations apply alphapush-prod --remote",
"db:migrate:dev": "wrangler d1 migrations apply --env dev alphapush-dev --remote",
"deploy": "astro build && wrangler deploy"
"deploy": "astro build && wrangler pages deploy dist"
},
"license": "MIT",
"homepage": "https://github.com/alkinum/alphapush",
Expand All @@ -38,6 +38,7 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"drizzle-orm": "^0.33.0",
"highlight.js": "^11.10.0",
"marked": "^14.0.0",
"nanoid": "^5.0.7",
"radix-vue": "^1.9.4",
Expand Down
10 changes: 4 additions & 6 deletions src/components/notification/NotificationCard.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue';
import hljs from 'highlight.js';
import { marked } from 'marked';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import type { Notification } from '@/types/notification';
import { highlighter } from '@/utils/highlighter';
import 'highlight.js/styles/github-dark.css';
interface Props {
notification: Notification & { highlight?: boolean };
Expand All @@ -17,11 +18,8 @@ const isTruncated = ref(false);
const buttonText = ref('View All');
const renderer = new marked.Renderer();
renderer.code = ({ text, lang }) => {
const highlightedCode = highlighter.codeToHtml(text, {
lang: lang || 'plaintext',
theme: 'github-dark',
});
renderer.code = ({ text, language }) => {
const highlightedCode = hljs.highlight(text, { language });
return `<div class="code-block">${highlightedCode}</div>`;
};
Expand Down
1 change: 0 additions & 1 deletion src/pages/api/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { getSession } from 'auth-astro/server';
import { eq, and } from 'drizzle-orm';
import { getDb } from '@/db';
import { subscriptions } from '@/schema';
import { SubscriptionService } from '@/services/subscriptionService';

// Helper function: Validate SHA256 hash
function isValidSHA256(hash: string): boolean {
Expand Down
7 changes: 4 additions & 3 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ let initialNotifications = [];
let totalPages = 0;
const allowedEmails = import.meta.env.ALLOWED_EMAILS?.split(',').map((email: string) => email.trim()) || [];
const isAllowedUser = session?.user?.email && allowedEmails.includes(session.user.email);
const isLogin = !!session?.user?.email;
const isAllowedUser = isLogin && allowedEmails.includes(session?.user?.email);
if (!isAllowedUser) {
if (isLogin && !isAllowedUser) {
return Astro.redirect('/403');
}
if (session?.user?.email) {
if (isLogin) {
const apiUrl = new URL('/api/notifications', Astro.url);
apiUrl.searchParams.set('page', '1');
apiUrl.searchParams.set('pageSize', '10');
Expand Down
8 changes: 0 additions & 8 deletions src/utils/highlighter.ts

This file was deleted.

9 changes: 4 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
"@/*": ["./src/*"]
},
"jsx": "preserve",
"types": ["@cloudflare/workers-types"]
}
}
},
"exclude": ["dist", "public"]
}

0 comments on commit 4b2e6cc

Please sign in to comment.