[ci] yarn format

This commit is contained in:
FredKSchott 2021-07-14 18:16:46 +00:00 committed by GitHub Actions
parent 007c22065d
commit 5814f2faca
5 changed files with 8 additions and 7 deletions

View file

@ -2,4 +2,4 @@
'astro': patch
---
Remove custom Astro.fetchContent() glob implementation, use `import.meta.globEager` internally instead.
Remove custom Astro.fetchContent() glob implementation, use `import.meta.globEager` internally instead.

View file

@ -53,7 +53,7 @@ For best results, you should only have one `<style>` tag per-Astro component. Th
<html>
<head>
<style>
...
...;
</style>
</head>
<body>

View file

@ -352,7 +352,7 @@ function compileModule(ast: Ast, module: Script, state: CodegenState, compileOpt
}
// Convert Astro.fetchContent() to use import.meta.glob
if ((/Astro\s*\.\s*fetchContent/).test(module.content)) {
if (/Astro\s*\.\s*fetchContent/.test(module.content)) {
state.importStatements.add(`import {fetchContent} from 'astro/dist/internal/fetch-content.js';\n`);
traverse(parseResult, {
enter({ node }) {
@ -377,7 +377,7 @@ function compileModule(ast: Ast, module: Script, state: CodegenState, compileOpt
property: { type: 'Identifier', name: 'globEager' },
computed: false,
},
arguments: node.arguments
arguments: node.arguments,
},
] as any;
},

View file

@ -114,7 +114,7 @@ export async function compileComponent(source: string, { compileOptions, filenam
import fetch from 'node-fetch';
${result.imports.join('\n')}
${/* Global Astro Namespace (shadowed & extended by the scoped namespace inside of __render()) */''}
${/* Global Astro Namespace (shadowed & extended by the scoped namespace inside of __render()) */ ''}
const __TopLevelAstro = {
site: new URL('/', ${JSON.stringify(site)}),
fetchContent: (globResult) => fetchContent(globResult, import.meta.url),

View file

@ -19,5 +19,6 @@ export function fetchContent(importMetaGlobResult: Record<string, any>, url: str
...mod.__content,
url: urlSpec.replace(/^.*\/pages\//, '/').replace(/\.md$/, ''),
};
}).filter(Boolean);
}
})
.filter(Boolean);
}