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

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

@ -47,7 +47,7 @@ export async function content() {
blocks.push({
breadcrumbs: [...breadcrumbs, removeMarkdown(remove_TYPE(metadata.title) ?? '')],
href: get_href([slug]),
content: plaintext(intro),
content: await plaintext(intro),
rank
});
@ -67,7 +67,7 @@ export async function content() {
remove_TYPE(removeMarkdown(h2))
],
href: get_href([slug, normalizeSlugify(h2)]),
content: plaintext(intro),
content: await plaintext(intro),
rank
});
@ -83,7 +83,7 @@ export async function content() {
removeMarkdown(remove_TYPE(h3))
],
href: get_href([slug, normalizeSlugify(h2) + '-' + normalizeSlugify(h3)]),
content: plaintext(lines.join('\n').trim()),
content: await plaintext(lines.join('\n').trim()),
rank
});
}
@ -99,37 +99,39 @@ function remove_TYPE(str) {
}
/** @param {string} markdown */
function plaintext(markdown) {
async function plaintext(markdown) {
/** @param {unknown} text */
const block = (text) => `${text}\n`;
/** @param {string} text */
const inline = (text) => text;
return markedTransform(markdown, {
code: (source) => source.split('// ---cut---\n').pop(),
blockquote: block,
html: () => '\n',
heading: (text) => `${text}\n`,
hr: () => '',
list: block,
listitem: block,
checkbox: block,
paragraph: (text) => `${text}\n\n`,
table: block,
tablerow: block,
tablecell: (text, opts) => {
return text + ' ';
},
strong: inline,
em: inline,
codespan: inline,
br: () => '',
del: inline,
link: (href, title, text) => text,
image: (href, title, text) => text,
text: inline
})
return (
await markedTransform(markdown, {
code: (source) => source.split('// ---cut---\n').pop(),
blockquote: block,
html: () => '\n',
heading: (text) => `${text}\n`,
hr: () => '',
list: block,
listitem: block,
checkbox: block,
paragraph: (text) => `${text}\n\n`,
table: block,
tablerow: block,
tablecell: (text, opts) => {
return text + ' ';
},
strong: inline,
em: inline,
codespan: inline,
br: () => '',
del: inline,
link: (href, title, text) => text,
image: (href, title, text) => text,
text: inline
})
)
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&#(\d+);/g, (match, code) => {

Loading…
Cancel
Save