chore(sites): Bump deps (#9115)

* Push

* Bump deps

* Bumps deps
pull/9139/head
Puru Vijay 2 years ago committed by GitHub
parent 670200c78c
commit f2ead82a40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

File diff suppressed because it is too large Load Diff

@ -18,7 +18,7 @@
}, },
"dependencies": { "dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15", "@jridgewell/sourcemap-codec": "^1.4.15",
"@supabase/supabase-js": "^2.31.0", "@supabase/supabase-js": "^2.33.1",
"@sveltejs/repl": "0.5.0", "@sveltejs/repl": "0.5.0",
"cookie": "^0.5.0", "cookie": "^0.5.0",
"devalue": "^4.3.2", "devalue": "^4.3.2",
@ -29,32 +29,32 @@
"devDependencies": { "devDependencies": {
"@resvg/resvg-js": "^2.4.1", "@resvg/resvg-js": "^2.4.1",
"@sveltejs/adapter-vercel": "^3.0.3", "@sveltejs/adapter-vercel": "^3.0.3",
"@sveltejs/kit": "^1.22.4", "@sveltejs/kit": "^1.22.6",
"@sveltejs/site-kit": "6.0.0-next.25", "@sveltejs/site-kit": "6.0.0-next.32",
"@sveltejs/vite-plugin-svelte": "^2.4.3", "@sveltejs/vite-plugin-svelte": "^2.4.5",
"@types/cookie": "^0.5.1", "@types/cookie": "^0.5.1",
"@types/node": "^20.4.7", "@types/node": "^20.5.3",
"browserslist": "^4.21.10", "browserslist": "^4.21.10",
"degit": "^2.8.4", "degit": "^2.8.4",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"jimp": "^0.22.10", "jimp": "^0.22.10",
"lightningcss": "^1.21.5", "lightningcss": "^1.21.7",
"magic-string": "^0.30.2", "magic-string": "^0.30.3",
"marked": "^6.0.0", "marked": "^7.0.4",
"prettier": "^3.0.1", "prettier": "^3.0.2",
"prettier-plugin-svelte": "^3.0.3", "prettier-plugin-svelte": "^3.0.3",
"sass": "^1.64.2", "sass": "^1.66.1",
"satori": "^0.10.2", "satori": "^0.10.3",
"satori-html": "^0.3.2", "satori-html": "^0.3.2",
"shelljs": "^0.8.5", "shelljs": "^0.8.5",
"shiki": "^0.14.3", "shiki": "^0.14.3",
"shiki-twoslash": "^3.1.2", "shiki-twoslash": "^3.1.2",
"svelte": "workspace:*", "svelte": "workspace:*",
"svelte-check": "^3.4.6", "svelte-check": "^3.5.0",
"svelte-preprocess": "^5.0.4", "svelte-preprocess": "^5.0.4",
"tiny-glob": "^0.2.9", "tiny-glob": "^0.2.9",
"typescript": "^5.1.6", "typescript": "^5.1.6",
"vite": "^4.4.8", "vite": "^4.4.9",
"vite-imagetools": "^5.0.7" "vite-imagetools": "^5.0.8"
} }
} }

@ -76,7 +76,7 @@ export async function get_docs_data(base = CONTENT_BASE_PATHS.DOCS) {
slug: page_slug, slug: page_slug,
content: page_content, content: page_content,
category: category_title, category: category_title,
sections: get_sections(page_content), sections: await get_sections(page_content),
path: `${app_base}/docs/${page_slug}`, path: `${app_base}/docs/${page_slug}`,
file: `${category_dir}/${filename}` file: `${category_dir}/${filename}`
}); });
@ -99,9 +99,9 @@ export function get_docs_list(docs_data) {
})); }));
} }
const titled = (str) => const titled = async (str) =>
removeMarkdown( removeMarkdown(
escape(markedTransform(str, { paragraph: (txt) => txt })) escape(await markedTransform(str, { paragraph: (txt) => txt }))
.replace(/<\/?code>/g, '') .replace(/<\/?code>/g, '')
.replace(/&#39;/g, "'") .replace(/&#39;/g, "'")
.replace(/&quot;/g, '"') .replace(/&quot;/g, '"')
@ -111,7 +111,7 @@ const titled = (str) =>
); );
/** @param {string} markdown */ /** @param {string} markdown */
function get_sections(markdown) { async function get_sections(markdown) {
const lines = markdown.split('\n'); const lines = markdown.split('\n');
const root = /** @type {import('./types').Section} */ ({ const root = /** @type {import('./types').Section} */ ({
title: 'Root', title: 'Root',
@ -122,11 +122,11 @@ function get_sections(markdown) {
}); });
let currentNodes = [root]; let currentNodes = [root];
lines.forEach((line) => { for (const line of lines) {
const match = line.match(/^(#{2,4})\s(.*)/); const match = line.match(/^(#{2,4})\s(.*)/);
if (match) { if (match) {
const level = match[1].length - 2; const level = match[1].length - 2;
const text = titled(match[2]); const text = await titled(match[2]);
const slug = normalizeSlugify(text); const slug = normalizeSlugify(text);
// Prepare new node // Prepare new node
@ -149,7 +149,7 @@ function get_sections(markdown) {
// Add non-heading line to the text of the current section // Add non-heading line to the text of the current section
currentNodes[currentNodes.length - 1].text += line + '\n'; currentNodes[currentNodes.length - 1].text += line + '\n';
} }
}); }
return root.sections; return root.sections;
} }

@ -47,7 +47,7 @@ export async function content() {
blocks.push({ blocks.push({
breadcrumbs: [...breadcrumbs, removeMarkdown(remove_TYPE(metadata.title) ?? '')], breadcrumbs: [...breadcrumbs, removeMarkdown(remove_TYPE(metadata.title) ?? '')],
href: get_href([slug]), href: get_href([slug]),
content: plaintext(intro), content: await plaintext(intro),
rank rank
}); });
@ -67,7 +67,7 @@ export async function content() {
remove_TYPE(removeMarkdown(h2)) remove_TYPE(removeMarkdown(h2))
], ],
href: get_href([slug, normalizeSlugify(h2)]), href: get_href([slug, normalizeSlugify(h2)]),
content: plaintext(intro), content: await plaintext(intro),
rank rank
}); });
@ -83,7 +83,7 @@ export async function content() {
removeMarkdown(remove_TYPE(h3)) removeMarkdown(remove_TYPE(h3))
], ],
href: get_href([slug, normalizeSlugify(h2) + '-' + normalizeSlugify(h3)]), href: get_href([slug, normalizeSlugify(h2) + '-' + normalizeSlugify(h3)]),
content: plaintext(lines.join('\n').trim()), content: await plaintext(lines.join('\n').trim()),
rank rank
}); });
} }
@ -99,14 +99,15 @@ function remove_TYPE(str) {
} }
/** @param {string} markdown */ /** @param {string} markdown */
function plaintext(markdown) { async function plaintext(markdown) {
/** @param {unknown} text */ /** @param {unknown} text */
const block = (text) => `${text}\n`; const block = (text) => `${text}\n`;
/** @param {string} text */ /** @param {string} text */
const inline = (text) => text; const inline = (text) => text;
return markedTransform(markdown, { return (
await markedTransform(markdown, {
code: (source) => source.split('// ---cut---\n').pop(), code: (source) => source.split('// ---cut---\n').pop(),
blockquote: block, blockquote: block,
html: () => '\n', html: () => '\n',
@ -130,6 +131,7 @@ function plaintext(markdown) {
image: (href, title, text) => text, image: (href, title, text) => text,
text: inline text: inline
}) })
)
.replace(/&lt;/g, '<') .replace(/&lt;/g, '<')
.replace(/&gt;/g, '>') .replace(/&gt;/g, '>')
.replace(/&#(\d+);/g, (match, code) => { .replace(/&#(\d+);/g, (match, code) => {

Loading…
Cancel
Save