Skip to content
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
38 changes: 29 additions & 9 deletions .github/workflows/pull-request-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:

jobs:
check:
name: Run check jobs
name: Check Types
runs-on: ubuntu-latest

steps:
Expand All @@ -29,17 +29,17 @@ jobs:
- name: Setup environment variables
uses: Firenza/secrets-to-env@v1.3.0
with:
secrets: ${{ toJSON(secrets) }}
secret_filter_regex: SPOTIFY_*
secrets: ${{ toJSON(secrets) }}
secret_filter_regex: SPOTIFY_*

- name: Install dependencies
run: pnpm install
timeout-minutes: 2

- name: Run checks for repo
run: pnpm check
test:
name: Run test jobs
lint:
name: Lint Code
runs-on: ubuntu-latest

steps:
Expand All @@ -52,13 +52,33 @@ jobs:
version: 9

- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4

- name: Install dependencies
run: pnpm install
timeout-minutes: 2

- name: Run linting for repo
run: pnpm lint
format:
name: Check Formatting
runs-on: ubuntu-latest

steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
node-version: 20
version: 9

- name: Install Node
uses: actions/setup-node@v4

- name: Install dependencies
run: pnpm install
timeout-minutes: 2

- name: Run tests for repo
run: pnpm test
- name: Run format checks for repo
run: pnpm format:check
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
6 changes: 6 additions & 0 deletions .oxlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"ignorePatterns": [
"node_modules"
]
}
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# `fi.dev`
# `fi`

Monorepo holding my procrastination and hopefully some actual merged code.

## 🧞 Commands
| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `pnpm install` | Installs workspace dependencies |
| `pnpm dev` | Run workspace dev tasks |
| `pnpm build` | Run workspace build tasks |
| `pnpm @home` | Alias to home app scripts (@fi.dev/home) |

| Command | Action |
| :------------- | :----------------------------------- |
| `pnpm install` | Installs workspace dependencies |
| `pnpm dev` | Run workspace dev tasks |
| `pnpm build` | Run workspace build tasks |
| `pnpm @home` | Alias to home app scripts (@fi/home) |
20 changes: 11 additions & 9 deletions apps/home/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# `fi.dev` home
# `fi` home

Home application containing the blog and other goodies

## 🧞 Commands
| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `pnpm install` | Installs dependencies |
| `pnpm dev` | Starts local dev server at `localhost:3000` |
| `pnpm build` | Build your production site to `./dist/` |
| `pnpm preview` | Preview your build locally, before deploying |
| `pnpm astro ...` | Run CLI commands like `astro add`, `astro check` |
| `pnpm astro -- --help` | Get help using the Astro CLI |

| Command | Action |
| :--------------------- | :----------------------------------------------- |
| `pnpm install` | Installs dependencies |
| `pnpm dev` | Starts local dev server at `localhost:3000` |
| `pnpm build` | Build your production site to `./dist/` |
| `pnpm preview` | Preview your build locally, before deploying |
| `pnpm astro ...` | Run CLI commands like `astro add`, `astro check` |
| `pnpm astro -- --help` | Get help using the Astro CLI |
2 changes: 1 addition & 1 deletion apps/home/astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { loadEnv } from "vite";
import { defineConfig } from "astro/config";
import { loadEnv } from "vite";

import tailwind from "@astrojs/tailwind";

Expand Down
7 changes: 0 additions & 7 deletions apps/home/biome.jsonc

This file was deleted.

4 changes: 1 addition & 3 deletions apps/home/cms.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import { exec } from "node:child_process";

import "dotenv/config";

import { defineContentConfig } from "@fi.dev/content";
import { defineContentConfig } from "@fi/content";

import { musicPost } from "@/libraries/posts/music";
import { onPublishPosts } from "@/libraries/posts/onPublish";

export default defineContentConfig({
dir: "./src/content",
entries: [musicPost],
onPublish: onPublishPosts,
hooks: [
{
events: ["create"],
Expand Down
12 changes: 0 additions & 12 deletions apps/home/drizzle.config.ts

This file was deleted.

15 changes: 5 additions & 10 deletions apps/home/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "@fi.dev/home",
"name": "@fi/home",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"lint": "oxlint",
"check": "astro check",
"test": "vitest",
"astro": "astro",
"astro:upgrade": "pnpm dlx @astrojs/upgrade",
"drizzle": "drizzle-kit",
"node": "tsx",
"content": "pnpm node ./cms.config.ts",
"sync:icons": "pnpm node ./scripts/sync-svg-sprites.ts",
Expand All @@ -23,14 +22,13 @@
"@astrojs/solid-js": "^5.0.0",
"@astrojs/tailwind": "^5.1.3",
"@astrojs/vercel": "^8.0.0",
"@fi.dev/content": "workspace:*",
"@fi.dev/theme": "workspace:*",
"@fi.dev/typescript": "workspace:*",
"@fi/content": "workspace:*",
"@fi/theme": "workspace:*",
"@fi/typescript": "workspace:*",
"@fontsource-variable/nunito": "^5.1.0",
"@fontsource-variable/space-grotesk": "^5.1.0",
"@kobalte/core": "^0.13.7",
"@kobalte/tailwindcss": "^0.9.0",
"@neondatabase/serverless": "^0.10.1",
"@solid-primitives/intersection-observer": "^2.1.6",
"@tanstack/solid-query": "^5.56.2",
"@tanstack/solid-query-devtools": "^5.56.2",
Expand All @@ -39,8 +37,6 @@
"astro": "^5.0.2",
"astro-compressor": "^1.0.0",
"class-variance-authority": "^0.7.0",
"drizzle-orm": "^0.35.3",
"drizzle-zod": "^0.5.1",
"hast-util-from-html": "^2.0.3",
"html-to-text": "^9.0.5",
"qss": "^3.0.0",
Expand All @@ -53,7 +49,6 @@
"@astrojs/check": "^0.9.4",
"@types/hast": "^3.0.4",
"dotenv": "^16.4.5",
"drizzle-kit": "^0.26.2",
"open": "^10.1.0",
"rehype-stringify": "^10.0.1",
"remark-parse": "^11.0.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/home/scripts/spotify-auth-code-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import "dotenv/config";

import open from "open";

import { getSpotifyEnv } from "@/libraries/schemas";
import { createSpotifyClient } from "@/libraries/clients";
import { getSpotifyEnv } from "@/libraries/schemas";

const startSpotifyAuthFlow = async () => {
console.log("Starting Spotify authorisation code flow");
Expand Down
27 changes: 0 additions & 27 deletions apps/home/scripts/sync-music-post-entries-db.ts

This file was deleted.

4 changes: 2 additions & 2 deletions apps/home/scripts/sync-music-post-entries-local.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import fs from "node:fs";

import { getPostsPathsFromRootDir, matter } from "@fi.dev/content";
import { getPostsPathsFromRootDir, matter } from "@fi/content";

const syncMusicPostEntriesLocal = () => {
const paths = getPostsPathsFromRootDir("./src/content/music").filter((path) =>
path.includes(".md"),
path.includes(".md")
);

for (const path of paths) {
Expand Down
56 changes: 23 additions & 33 deletions apps/home/src/components/astro/ContentDisplay.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import { render, type CollectionEntry } from "astro:content";
import { type CollectionEntry, render } from "astro:content";
import { twMerge } from "tailwind-merge";

import { getEnvironmentVariable } from "@fi.dev/typescript";
import { getEnvironmentVariable } from "@fi/typescript";

import { compileOutputWithPlugins } from "@/libraries/plugins";
import type { CollectionKey } from "astro:content";
Expand Down Expand Up @@ -31,40 +31,30 @@ const output = await (async () => {
})();
---
<article
class={
twMerge(
"prose max-w-full",
"prose-headings:font-heading",
"prose-h2:text-2xl md:prose-h2:text-3xl prose-h2:font-normal",
"prose-h3:font-light prose-h3:text-blue-500",
"prose-a:decoration-blue-500 prose-a:underline-offset-2",
_class
)
}
class={twMerge(
"prose max-w-full",
"prose-headings:font-heading",
"prose-h2:text-2xl md:prose-h2:text-3xl prose-h2:font-normal",
"prose-h3:font-light prose-h3:text-blue-500",
"prose-a:decoration-blue-500 prose-a:underline-offset-2",
_class,
)}
>
{
typeof output === "string" ? (
<Fragment set:html={output}/>
) : (
<output.Content/>
)
}
{typeof output === "string" ? <Fragment set:html={output} /> : <output.Content />}
</article>

<script>
document.addEventListener("astro:page-load", () => {
const articleLinks = document.querySelectorAll("article a");

for (const link of articleLinks) {
const linkHref = link.getAttribute("href") || "";
// Skip any directive based links
if (!linkHref.includes("https://") && !linkHref.includes("http://")) {
continue;
}

link.setAttribute("target", "_blank");
document.addEventListener("astro:page-load", () => {
const articleLinks = document.querySelectorAll("article a");

for (const link of articleLinks) {
const linkHref = link.getAttribute("href") || "";
// Skip any directive based links
if (!linkHref.includes("https://") && !linkHref.includes("http://")) {
continue;
}
});
</script>


link.setAttribute("target", "_blank");
}
});
</script>
Loading