Skip to content

Commit 10c4e5b

Browse files
committed
feat: initial commit
This was largely generated by bolt.new.
0 parents  commit 10c4e5b

21 files changed

+6545
-0
lines changed

.eslintrc.cjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
extends: [
3+
"eslint:recommended",
4+
"plugin:@typescript-eslint/recommended",
5+
"plugin:astro/recommended",
6+
"prettier",
7+
],
8+
parser: "@typescript-eslint/parser",
9+
plugins: ["@typescript-eslint", "prettier"],
10+
root: true,
11+
env: {
12+
node: true,
13+
browser: true,
14+
},
15+
rules: {
16+
"prettier/prettier": "error",
17+
},
18+
overrides: [
19+
{
20+
files: ["*.astro"],
21+
parser: "astro-eslint-parser",
22+
parserOptions: {
23+
parser: "@typescript-eslint/parser",
24+
extraFileExtensions: [".astro"],
25+
},
26+
},
27+
],
28+
};

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# build output
2+
/dist/
3+
4+
# generated types
5+
/.astro/
6+
7+
# dependencies
8+
/node_modules/
9+
10+
# logs
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# environment variables
17+
/.env
18+
/.env.production
19+
20+
# macOS-specific files
21+
.DS_Store
22+
23+
# jetbrains setting folder
24+
/.idea/
25+
26+
# Netlify output and cache
27+
/.netlify/

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.9.0

.prettierrc.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
plugins: [require.resolve("prettier-plugin-astro")],
3+
overrides: [
4+
{
5+
files: "*.astro",
6+
options: {
7+
parser: "astro",
8+
},
9+
},
10+
],
11+
};

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Next.js Sentinel
2+
3+
```sh
4+
npm create astro@latest -- --template basics
5+
```
6+
7+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
8+
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
9+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)
10+
11+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
12+
13+
![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)
14+
15+
## 🚀 Project Structure
16+
17+
Inside of your Astro project, you'll see the following folders and files:
18+
19+
```text
20+
/
21+
├── public/
22+
│ └── favicon.svg
23+
├── src/
24+
│ ├── components/
25+
│ │ └── Card.astro
26+
│ ├── layouts/
27+
│ │ └── Layout.astro
28+
│ └── pages/
29+
│ └── index.astro
30+
└── package.json
31+
```
32+
33+
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
34+
35+
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
36+
37+
Any static assets, like images, can be placed in the `public/` directory.
38+
39+
## 🧞 Commands
40+
41+
All commands are run from the root of the project, from a terminal:
42+
43+
| Command | Action |
44+
| :------------------------ | :----------------------------------------------- |
45+
| `npm install` | Installs dependencies |
46+
| `npm run dev` | Starts local dev server at `localhost:4321` |
47+
| `npm run build` | Build your production site to `./dist/` |
48+
| `npm run preview` | Preview your build locally, before deploying |
49+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
50+
| `npm run astro -- --help` | Get help using the Astro CLI |
51+
52+
## 👀 Want to learn more?
53+
54+
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).

astro.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { defineConfig } from "astro/config";
2+
import netlify from "@astrojs/netlify";
3+
import tailwind from "@astrojs/tailwind";
4+
5+
export default defineConfig({
6+
output: "server",
7+
adapter: netlify(),
8+
integrations: [tailwind()],
9+
vite: {
10+
resolve: {
11+
alias: {
12+
"@": "/src",
13+
},
14+
},
15+
},
16+
});

netlify.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build]
2+
command = "pnpm run build"
3+
publish = "dist"
4+
5+
[build.environment]
6+
NODE_VERSION = "22.9.0"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import type { Config } from "@netlify/functions";
2+
import { getLatestNextjsReleases } from "@/lib/github";
3+
import { analyzeReleaseNotes } from "@/lib/openai";
4+
import { getAnalyzedReleases, insertAnalyzedRelease } from "@/lib/db";
5+
import { sendSlackNotification } from "@/lib/slack";
6+
7+
export default async function handler() {
8+
try {
9+
const [latestRelease] = await getLatestNextjsReleases(1);
10+
const existingReleases = await getAnalyzedReleases();
11+
12+
if (
13+
existingReleases.some(
14+
(release) => release.version === latestRelease.version,
15+
)
16+
) {
17+
return {
18+
statusCode: 200,
19+
body: JSON.stringify({ message: "Release already analyzed" }),
20+
};
21+
}
22+
23+
const analysis = await analyzeReleaseNotes(
24+
latestRelease.version,
25+
latestRelease.body,
26+
);
27+
await insertAnalyzedRelease(
28+
latestRelease.version,
29+
analysis.summary,
30+
analysis.score,
31+
analysis.relevance,
32+
);
33+
34+
if (analysis.score > 60) {
35+
await sendSlackNotification(
36+
latestRelease.version,
37+
analysis.summary,
38+
analysis.score,
39+
);
40+
}
41+
42+
return {
43+
statusCode: 200,
44+
body: JSON.stringify({ message: "Release analyzed and stored" }),
45+
};
46+
} catch (error) {
47+
console.error("Error in check-nextjs-release function:", error);
48+
return {
49+
statusCode: 500,
50+
body: JSON.stringify({ error: "Internal server error" }),
51+
};
52+
}
53+
}
54+
55+
export const config: Config = {
56+
schedule: "0 * * * *",
57+
};

package.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "nextjs-sentinel",
3+
"description": "FIXME",
4+
"type": "module",
5+
"version": "0.0.1",
6+
"private": false,
7+
"scripts": {
8+
"astro": "astro",
9+
"build": "astro build",
10+
"dev": "astro dev",
11+
"format": "prettier --write .",
12+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.astro",
13+
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx,.astro --fix",
14+
"migrate": "tsx src/scripts/migrate.ts",
15+
"preview": "astro preview",
16+
"start": "astro dev",
17+
"test": "pnpm run typecheck && pnpm run lint && pnpm run build",
18+
"typecheck": "tsc --noEmit"
19+
},
20+
"dependencies": {
21+
"@astrojs/netlify": "^5.5.3",
22+
"@astrojs/tailwind": "^5.1.1",
23+
"@libsql/client": "^0.3.5",
24+
"astro": "^4.15.12",
25+
"daisyui": "^3.9.2",
26+
"date-fns": "^2.30.0",
27+
"openai": "^4.0.0"
28+
},
29+
"devDependencies": {
30+
"@netlify/functions": "^2.8.2",
31+
"@types/node": "^22.0.0",
32+
"@typescript-eslint/eslint-plugin": "^6.0.0",
33+
"@typescript-eslint/parser": "^6.0.0",
34+
"eslint": "^8.45.0",
35+
"eslint-config-prettier": "^8.8.0",
36+
"eslint-plugin-astro": "^0.27.2",
37+
"eslint-plugin-prettier": "^5.0.0",
38+
"prettier": "^3.0.0",
39+
"prettier-plugin-astro": "^0.11.0",
40+
"tailwindcss": "^3.3.3",
41+
"tsx": "^3.12.7",
42+
"typescript": "^5.0.0"
43+
},
44+
"engines": {
45+
"node": ">=22.9.0"
46+
},
47+
"packageManager": "[email protected]+sha1.65cd48c20dd329b7f455088b6dd17d4d5b6d02e3"
48+
}

0 commit comments

Comments
 (0)