Skip to content

Commit

Permalink
Merge branch 'main' into zh-cn
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Oct 16, 2024
2 parents eae1aa9 + 61471e7 commit d395692
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: 3.13
- name: Install dependencies
env:
UV_SYSTEM_PYTHON: true
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.5
rev: v0.6.9
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/crate-ci/typos
rev: v1.24.6
rev: v1.26.0
hooks:
- id: typos
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,34 @@
"dependencies": {
"@ethercorps/sveltekit-og": "^3.0.0",
"@fontsource-variable/fira-code": "^5.1.0",
"@iconify/json": "^2.2.251",
"@iconify/json": "^2.2.260",
"@neodrag/svelte": "^2.0.6",
"@shikijs/monaco": "^1.18.0",
"@shikijs/rehype": "^1.18.0",
"@sveltejs/adapter-netlify": "^4.3.4",
"@sveltejs/kit": "^2.5.28",
"@shikijs/monaco": "^1.22.0",
"@shikijs/rehype": "^1.22.0",
"@sveltejs/adapter-netlify": "^4.3.5",
"@sveltejs/kit": "^2.7.1",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@unocss/extractor-svelte": "^0.62.4",
"@unocss/reset": "^0.62.4",
"bits-ui": "^0.21.15",
"bits-ui": "^0.21.16",
"cheerio": "^1.0.0",
"cmdk-sv": "^0.0.18",
"dayjs": "^1.11.13",
"htmlparser2": "^9.1.0",
"misans-vf": "^1.0.0",
"monaco-editor-core": "^0.52.0",
"openai": "^4.63.0",
"openai": "^4.67.3",
"paneforge": "^0.0.6",
"pyodide": "0.26.2",
"rehype-parse": "^9.0.0",
"rehype-parse": "^9.0.1",
"rehype-remark": "^10.0.0",
"rehype-stringify": "^10.0.0",
"rehype-stringify": "^10.0.1",
"remark-gfm": "^4.0.0",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.1",
"remark-stringify": "^11.0.0",
"rollup-plugin-flatten-dir": "^1.0.1",
"shiki": "^1.18.0",
"shiki": "^1.22.0",
"svelte": "^4.2.19",
"svelte-persisted-store": "^0.11.0",
"svelte-portal": "^2.2.1",
Expand All @@ -55,16 +55,16 @@
"unified": "^11.0.5",
"unocss": "^0.62.4",
"unzipit": "^1.4.3",
"vite": "^5.4.7"
"vite": "^5.4.9"
},
"devDependencies": {
"@antfu/eslint-config": "^3.7.1",
"@antfu/eslint-config": "^3.7.3",
"@types/mdast": "^4.0.4",
"@types/turndown": "^5.0.5",
"@unocss/eslint-config": "^0.62.4",
"eslint": "^9.11.0",
"eslint": "^9.12.0",
"eslint-plugin-format": "^0.1.2",
"eslint-plugin-svelte": "^2.44.0",
"svelte-check": "^4.0.2"
"eslint-plugin-svelte": "^2.44.1",
"svelte-check": "^4.0.5"
}
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies = [
"micropip~=0.6.0",
"pyodide-py==0.26.2",
"promplate-pyodide~=0.0.3.5",
"pre-commit~=3.8.0",
"pre-commit~=4.0.0",
"pure-eval~=0.2.3",
"html2text2~=1.0.0",
]
Expand Down
14 changes: 0 additions & 14 deletions src/routes/(workspace)/gist/[gist_id]/+page.server.ts

This file was deleted.

8 changes: 3 additions & 5 deletions src/routes/(workspace)/gist/[gist_id]/+page.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { PageLoad } from "./$types";

import { type GistResponse, transformFiles } from "./common";

export const load = (async ({ params: { gist_id }, fetch }) => {
const { files }: GistResponse = await fetch(`https://api.github.com/gists/${gist_id}`).then(res => res.json());
return { sources: transformFiles(files) };
export const load = (async ({ fetch }) => {
const sources: Record<string, string> = await fetch("").then(res => res.json());
return { sources };
}) satisfies PageLoad;
15 changes: 15 additions & 0 deletions src/routes/(workspace)/gist/[gist_id]/+server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { RequestHandler } from "./$types";

import { type GistResponse, transformFiles } from "./common";
import { json } from "@sveltejs/kit";
import { env } from "$env/dynamic/private";
import { forwardResponseHeaders } from "$lib/utils/headers";

export const GET: RequestHandler = async ({ params: { gist_id }, fetch, cookies }) => {
const token = cookies.get("access_token") || env.GITHUB_TOKEN;
const headers = new Headers();
token && headers.set("Authorization", `Bearer ${token}`);
const res = await fetch(`https://api.github.com/gists/${gist_id}`, { headers });
const { files }: GistResponse = await res.json();
return json(transformFiles(files), { headers: forwardResponseHeaders(res.headers) });
};
2 changes: 1 addition & 1 deletion src/routes/oauth/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const load = (async ({ fetch, url: { searchParams, origin }, cookies }) =
headers: { "accept": "application/json", "content-type": "application/json" },
}).then(res => res.json());

cookies.set("access_token", access_token, { path: "/", maxAge: 60 * 60 * 24 * 365 });
access_token && cookies.set("access_token", access_token, { path: "/", maxAge: 60 * 60 * 24 * 365 });

return { access_token, scope };
}) satisfies PageServerLoad;

0 comments on commit d395692

Please sign in to comment.