Skip to content
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

chore: add sentry for logging #47

Merged
merged 2 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
runs-on: ubuntu-latest
env:
PUBLIC_CONTACT_ME_API: ${{ secrets.CONTACT_ME_API }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN}}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4
Expand Down
63 changes: 40 additions & 23 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,61 @@
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import icon from "astro-icon";
import sitemap from '@astrojs/sitemap';
import tailwind from "@astrojs/tailwind";
import autolinkHeadings from 'rehype-autolink-headings'
import rehypeExternalLinks from 'rehype-external-links'
import rehypeSlug from 'rehype-slug'
import { remarkReadingTime } from './src/utils/remark-reading-time';
import { autolinkConfig } from './src/utils/rehype-auto-link';
import { defineConfig } from "astro/config"
import { loadEnv } from "vite"
import mdx from "@astrojs/mdx"
import icon from "astro-icon"
import sitemap from "@astrojs/sitemap"
import tailwind from "@astrojs/tailwind"
import autolinkHeadings from "rehype-autolink-headings"
import rehypeExternalLinks from "rehype-external-links"
import rehypeSlug from "rehype-slug"
import sentry from "@sentry/astro"

import { remarkReadingTime } from "./src/utils/remark-reading-time"
import { autolinkConfig } from "./src/utils/rehype-auto-link"

const nodeEnv = process.env.NODE_ENV || "development"
const { SENTRY_DSN, SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT } = loadEnv(
nodeEnv,
process.cwd(),
""
)

// https://astro.build/config
export default defineConfig({
site: 'https://jaluwibowo.id',
site: "https://jaluwibowo.id",
integrations: [
icon(),
mdx(),
sitemap(),
tailwind({
// Example: Disable injecting a basic `base.css` import on every page.
// Useful if you need to define and/or import your own custom `base.css`.
applyBaseStyles: false,
applyBaseStyles: false
}),
sentry({
dsn: SENTRY_DSN,
sourceMapsUploadOptions: {
org: SENTRY_ORG,
project: SENTRY_PROJECT,
authToken: SENTRY_AUTH_TOKEN,
telemetry: false
},
enabled: process.env.NODE_ENV === "production"
})
],
markdown: {
gfm: true,
syntaxHighlight: 'prism',
syntaxHighlight: "prism",
remarkPlugins: [remarkReadingTime],
rehypePlugins: [
rehypeSlug,
[
autolinkHeadings,
autolinkConfig
],
[autolinkHeadings, autolinkConfig],
[
rehypeExternalLinks,
{
target: '_blank',
rel: 'noreferrer',
},
],
target: "_blank",
rel: "noreferrer"
}
]
]
},
});
}
})
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"build": "SENTRY_LOG_LEVEL=error astro build",
"preview": "astro preview",
"astro": "astro"
},
Expand All @@ -15,6 +15,7 @@
"@iconify-json/logos": "^1.2.3",
"@iconify-json/mdi": "^1.2.1",
"@iconify-json/ri": "^1.2.3",
"@sentry/astro": "^8.45.0",
"astro-icon": "^1.1.2",
"gsap": "^3.12.5",
"sass": "^1.80.7",
Expand All @@ -36,6 +37,7 @@
"reading-time": "^1.5.0",
"rehype-autolink-headings": "^7.1.0",
"rehype-external-links": "^3.0.0",
"rehype-slug": "^6.0.0"
"rehype-slug": "^6.0.0",
"vite": "^6.0.3"
}
}
Loading