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

Feat/markdown-editor #106

Closed
wants to merge 77 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
d833b7e
⚡️ add `in` filters at the end of the search filters
Fredkiss3 Nov 26, 2023
6260310
🐛 add missing and logic with `in` filter
Fredkiss3 Nov 26, 2023
7c09305
💄 reduce font-size on settings page
Fredkiss3 Nov 26, 2023
cfa3f42
🎨 use biomejs as a formatter
Fredkiss3 Nov 27, 2023
e532e3c
🚧 some things
Fredkiss3 Dec 1, 2023
604a67f
Merge branch 'main' into feat/adding-issues
Fredkiss3 Dec 3, 2023
9ecaa8f
🚚 move client providers to home
Fredkiss3 Dec 3, 2023
804546b
♻️ some refactors
Fredkiss3 Dec 3, 2023
2337196
♻️ set default cache ttl to 7 days & allow explicit caching in dev
Fredkiss3 Dec 3, 2023
77fcfa9
🚚 move markdown into its own file (too annoying to grep)
Fredkiss3 Dec 3, 2023
0b54a2d
♻️ changed the default cache TTL to 7 days
Fredkiss3 Dec 3, 2023
d82015a
💡 some comments
Fredkiss3 Dec 3, 2023
714502e
Merge branch 'main' into feat/adding-issues
Fredkiss3 Dec 3, 2023
3f407e5
♻️ small refactor
Fredkiss3 Dec 3, 2023
eb3f25e
🔧 don't include node_modules symbols in search
Fredkiss3 Dec 3, 2023
4c0e028
🔥 remove new issue icon from header
Fredkiss3 Dec 4, 2023
a1c43ec
♻️ rename redirectIfNotAuthed to getUserOrRedirect
Fredkiss3 Dec 4, 2023
b84e416
🐛 fix bug with not-found & metadata
Fredkiss3 Dec 4, 2023
f713186
🚧 new issue page
Fredkiss3 Dec 4, 2023
69e384a
💄 start responsive layout
Fredkiss3 Dec 4, 2023
3efd053
⬆️ upgrade next to canary
Fredkiss3 Dec 7, 2023
406af66
⬆️ upgrade next to latest version
Fredkiss3 Dec 8, 2023
501bac7
💄 General Layout finished
Fredkiss3 Dec 8, 2023
0c3d3e5
💄 grid-template-areas finished
Fredkiss3 Dec 8, 2023
cfe3404
🐛 set session http cookie based on the host where it is called from
Fredkiss3 Dec 8, 2023
630eb5d
🚸 don't visually disable the button on loading/disabled
Fredkiss3 Dec 8, 2023
1a9598c
🚧 responsive markdown toolbar
Fredkiss3 Dec 8, 2023
750056e
💡 update comment
Fredkiss3 Dec 10, 2023
65caca3
♻️ move dropdown from react-aria to radix-ui
Fredkiss3 Dec 10, 2023
4f326eb
♻️ don't wrap buttons in React Aria
Fredkiss3 Dec 10, 2023
473a2bf
🚧 text resizing & dropdown toolbar items done
Fredkiss3 Dec 10, 2023
e2723d8
♻️ use radix for tooltip instead of react-aria
Fredkiss3 Dec 10, 2023
46079f2
🚧 wip
Fredkiss3 Dec 10, 2023
2258085
♻️ rename action files with `.action.ts`
Fredkiss3 Dec 10, 2023
c10a10f
➕ add client-only pkg for client-only components
Fredkiss3 Dec 10, 2023
62f21e3
🚧 markdown preview working
Fredkiss3 Dec 10, 2023
7b0343d
🏷️ Fix TS issues preventing vercel to build
Fredkiss3 Dec 10, 2023
12f8677
💄 better skeleton for the markdown preview
Fredkiss3 Dec 10, 2023
4185451
➖ removed react-aria-components in favor of radix
Fredkiss3 Dec 10, 2023
dda1ca8
🚸 add auto-hidden toolbar items
Fredkiss3 Dec 10, 2023
42ec01a
♿️ fix toolbar keyboard nav
Fredkiss3 Dec 10, 2023
affb355
🚧 reorganize imports
Fredkiss3 Dec 10, 2023
64a72b7
Merge branch 'main' into feat/adding-issues
Fredkiss3 Dec 11, 2023
9b2aeb8
♻️ use better colors for cache hit/miss labels
Fredkiss3 Dec 11, 2023
374f5a6
⬆️ upgrade next to canary
Fredkiss3 Dec 11, 2023
cb2364e
🚧 wip
Fredkiss3 Dec 11, 2023
9273660
🚚 rename markdown-textarea to markdown-editor
Fredkiss3 Dec 11, 2023
53ac5a0
🚧 wip
Fredkiss3 Dec 11, 2023
50dbfb8
⚡️ don't preload if content is empty
Fredkiss3 Dec 11, 2023
a7b548d
💄 some ui changes
Fredkiss3 Dec 11, 2023
1eb7d07
🔨 re-introduce turbo for dev
Fredkiss3 Dec 12, 2023
55ecc31
💄 fix link break words behavior
Fredkiss3 Dec 12, 2023
75e2444
⬆️ upgrade next to canary
Fredkiss3 Dec 13, 2023
80d523f
🚧 heading + wip bold
Fredkiss3 Dec 13, 2023
841dae1
✨ bold, italics, code
Fredkiss3 Dec 14, 2023
eff8905
♻️ refactor
Fredkiss3 Dec 14, 2023
86c0486
Merge branch 'main' into feat/adding-issues
Fredkiss3 Dec 17, 2023
2b564d8
🐛 cache bug fixed ?
Fredkiss3 Dec 17, 2023
429fc31
🐛 fix heading toolbar btn
Fredkiss3 Dec 17, 2023
7c8d9a9
🚧 wip
Fredkiss3 Dec 17, 2023
3bc4c28
🚸 don't suspend if already resolved
Fredkiss3 Dec 17, 2023
831c9e7
Merge branch 'main' into feat/adding-issues
Fredkiss3 Dec 18, 2023
a7c72f3
♻️ some fixes
Fredkiss3 Dec 18, 2023
c563088
🏷️ types
Fredkiss3 Dec 18, 2023
daeeaf9
➕ add `remark-breaks` for native break support
Fredkiss3 Dec 18, 2023
249aa02
💄 make switching to the preview seemless
Fredkiss3 Dec 18, 2023
f7de600
🚚 move editor into its own folder
Fredkiss3 Dec 19, 2023
61e4fff
🚚 move caddy local server in the root
Fredkiss3 Dec 19, 2023
00d6bf0
✨ make it possible to remove headings
Fredkiss3 Dec 19, 2023
810329b
♻️ augment the number of items in the lru-cache
Fredkiss3 Dec 20, 2023
c5b69b0
Merge branch 'main' into feat/adding-issues
Fredkiss3 Dec 22, 2023
39dc685
🔥 remove unused files
Fredkiss3 Dec 22, 2023
6ed51de
♻️ some refactors
Fredkiss3 Dec 22, 2023
a1e8805
🚧 wip
Fredkiss3 Dec 22, 2023
7d715d3
♻️ get-user-or-redirect
Fredkiss3 Dec 22, 2023
0bac009
🎨 formatted with biome
Fredkiss3 Dec 22, 2023
1f48d50
🔥 delete old component
Fredkiss3 Dec 22, 2023
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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.workspaceSymbols.excludeLibrarySymbols": true,
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "biomejs.biome",
"[typescript]": {
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@t3-oss/env-nextjs": "^0.6.1",
"@tanstack/react-query": "^5.0.0",
"bright": "^0.8.4",
"client-only": "^0.0.1",
"cmdk": "^0.2.0",
"dayjs": "^1.11.9",
"drizzle-orm": "^0.28.6",
Expand All @@ -40,8 +41,9 @@
"eslint-config-next": "14.0.0",
"geist": "^1.0.0",
"isbot": "^3.6.13",
"js-md5": "^0.8.3",
"nanoid": "^4.0.2",
"next": "14.0.4",
"next": "14.0.5-canary.16",
"nextjs-toploader": "^1.6.4",
"nprogress": "^0.2.0",
"pg": "^8.11.3",
Expand All @@ -53,6 +55,7 @@
"rehype-raw": "^7.0.0",
"rehype-slug": "^5.1.0",
"remark": "^15.0.1",
"remark-breaks": "^4.0.0",
"remark-gemoji": "^8.0.0",
"remark-gfm": "^4.0.0",
"remark-github": "^12.0.0",
Expand Down
114 changes: 71 additions & 43 deletions pnpm-lock.yaml

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

8 changes: 5 additions & 3 deletions src/actions/auth.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,20 @@ export const getSession = cache(async function getSession(): Promise<Session> {
return session;
});

export const redirectIfNotAuthed = cache(async function getUserOrRedirect(
export const getUserOrRedirect = cache(async function getUserOrRedirect(
redirectToPath?: string
) {
const session = await getSession();
const user = await getAuthedUser();

if (!session.user) {
if (!user) {
const searchParams = new URLSearchParams();
if (redirectToPath) {
searchParams.set("nextUrl", redirectToPath);
}
redirect("/login?" + searchParams.toString());
}

return user;
});

export const getAuthedUser = cache(async function getUser() {
Expand Down
4 changes: 1 addition & 3 deletions src/actions/github.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ export const getGithubRepoData = cache(async () => {

while (hasNextPage) {
const {
repository: {
stargazers: { pageInfo, edges }
}
repository: { stargazers: { pageInfo, edges } }
} = await fetchFromGithubAPI<StargazersResponse>(stargazersQuery, {
cursor: nextCursor,
repoName: GITHUB_REPOSITORY_NAME,
Expand Down
13 changes: 13 additions & 0 deletions src/actions/markdown.action.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"use server";

import { Markdown } from "~/components/markdown/markdown";
import { renderRSCtoString } from "~/components/custom-rsc-renderer/render-rsc-to-string";

export async function getMarkdownPreview(
content: string,
repositoryPath: `${string}/${string}`
) {
return await renderRSCtoString(
<Markdown content={content} repository={repositoryPath} />
);
}
Loading
Loading