prettier format

pull/8289/head
Puru Vijay 3 years ago
parent 5da78e3e46
commit 47709f0c5b

@ -8,3 +8,4 @@ scripts/*
/test /test
.svelte-kit .svelte-kit
types types
.vercel

@ -1248,6 +1248,18 @@
"vite": "^4.0.0" "vite": "^4.0.0"
} }
}, },
"node_modules/@sveltejs/kit/node_modules/magic-string": {
"version": "0.30.0",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz",
"integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==",
"dev": true,
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.13"
},
"engines": {
"node": ">=12"
}
},
"node_modules/@sveltejs/repl": { "node_modules/@sveltejs/repl": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/@sveltejs/repl/-/repl-0.2.0.tgz", "resolved": "https://registry.npmjs.org/@sveltejs/repl/-/repl-0.2.0.tgz",
@ -2539,9 +2551,9 @@
} }
}, },
"node_modules/magic-string": { "node_modules/magic-string": {
"version": "0.30.0", "version": "0.27.0",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz",
"integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==", "integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.13" "@jridgewell/sourcemap-codec": "^1.4.13"
@ -3743,18 +3755,6 @@
} }
} }
}, },
"node_modules/svelte-preprocess/node_modules/magic-string": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz",
"integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==",
"dev": true,
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.13"
},
"engines": {
"node": ">=12"
}
},
"node_modules/tar-fs": { "node_modules/tar-fs": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",

@ -14,7 +14,7 @@ const escape_replacements = {
'<': '&lt;', '<': '&lt;',
'>': '&gt;', '>': '&gt;',
'"': '&quot;', '"': '&quot;',
"'": '&#39;', "'": '&#39;'
}; };
const get_escape_replacement = (ch) => escape_replacements[ch]; const get_escape_replacement = (ch) => escape_replacements[ch];
@ -45,7 +45,7 @@ const prism_languages = {
css: 'css', css: 'css',
diff: 'diff', diff: 'diff',
ts: 'typescript', ts: 'typescript',
'': '', '': ''
}; };
/** @type {Partial<import('marked').Renderer>} */ /** @type {Partial<import('marked').Renderer>} */
@ -165,7 +165,7 @@ const default_renderer = {
text(text) { text(text) {
return text; return text;
}, }
}; };
/** /**
@ -179,8 +179,8 @@ export function transform(markdown, renderer = {}) {
// options are global, and merged in confusing ways. You can't do e.g. // options are global, and merged in confusing ways. You can't do e.g.
// `new Marked(options).parse(markdown)` // `new Marked(options).parse(markdown)`
...default_renderer, ...default_renderer,
...renderer, ...renderer
}, }
}); });
return marked(markdown); return marked(markdown);

@ -16,7 +16,7 @@ export function get_examples_data() {
const section = { const section = {
title: '', // Initialise with empty title: '', // Initialise with empty
slug: subdir.split('-').slice(1).join('-'), slug: subdir.split('-').slice(1).join('-'),
examples: [], examples: []
}; };
if (!(fs.statSync(`${base}/${subdir}`).isDirectory() || subdir.endsWith('meta.json'))) continue; if (!(fs.statSync(`${base}/${subdir}`).isDirectory() || subdir.endsWith('meta.json'))) continue;
@ -44,7 +44,7 @@ export function get_examples_data() {
files.push({ files.push({
filename: file, filename: file,
type: file.split('.').at(-1), type: file.split('.').at(-1),
content: fs.readFileSync(`${example_base_dir}/${file}`, 'utf-8'), content: fs.readFileSync(`${example_base_dir}/${file}`, 'utf-8')
}); });
} }
@ -66,7 +66,7 @@ export function get_examples_list(examples_data) {
title: section.title, title: section.title,
examples: section.examples.map((example) => ({ examples: section.examples.map((example) => ({
title: example.title, title: example.title,
slug: example.slug, slug: example.slug
})), }))
})); }));
} }

@ -14,7 +14,7 @@ export function get_tutorial_data() {
const section = { const section = {
title: '', // Initialise with empty title: '', // Initialise with empty
slug: subdir.split('-').slice(1).join('-'), slug: subdir.split('-').slice(1).join('-'),
tutorials: [], tutorials: []
}; };
if (!(fs.statSync(`${base}/${subdir}`).isDirectory() || subdir.endsWith('meta.json'))) continue; if (!(fs.statSync(`${base}/${subdir}`).isDirectory() || subdir.endsWith('meta.json'))) continue;
@ -46,7 +46,7 @@ export function get_tutorial_data() {
completion_states_data[app_dir === 'app-a' ? 'initial' : 'complete'].push({ completion_states_data[app_dir === 'app-a' ? 'initial' : 'complete'].push({
name: file, name: file,
type: file.split('.').at(-1), type: file.split('.').at(-1),
content: fs.readFileSync(`${app_dir_path}/${file}`, 'utf-8'), content: fs.readFileSync(`${app_dir_path}/${file}`, 'utf-8')
}); });
} }
} }
@ -56,7 +56,7 @@ export function get_tutorial_data() {
slug, slug,
content: body, content: body,
dir: `${subdir}/${section_dir}`, dir: `${subdir}/${section_dir}`,
...completion_states_data, ...completion_states_data
}); });
} }
@ -75,7 +75,7 @@ export function get_tutorial_list(tutorial_data) {
title: section.title, title: section.title,
tutorials: section.tutorials.map((tutorial) => ({ tutorials: section.tutorials.map((tutorial) => ({
title: tutorial.title, title: tutorial.title,
slug: tutorial.slug, slug: tutorial.slug
})), }))
})); }));
} }

@ -11,7 +11,7 @@ const languages = {
css: 'css', css: 'css',
diff: 'diff', diff: 'diff',
ts: 'typescript', ts: 'typescript',
'': '', '': ''
}; };
/** /**
@ -82,7 +82,7 @@ export async function get_parsed_tutorial(tutorial_data, slug) {
return html; return html;
}, },
codespan: (text) => '<code>' + text + '</code>', codespan: (text) => '<code>' + text + '</code>'
}); });
return { ...tutorial, content }; return { ...tutorial, content };

@ -12,6 +12,6 @@ export async function load({ params }) {
return { return {
examples_list, examples_list,
example, example,
slug: params.slug, slug: params.slug
}; };
} }

@ -15,6 +15,6 @@ export async function load({ params }) {
return { return {
tutorials_list, tutorials_list,
tutorial, tutorial,
slug: params.slug, slug: params.slug
}; };
} }

Loading…
Cancel
Save