diff options
author | 2021-07-14 18:16:46 +0000 | |
---|---|---|
committer | 2021-07-14 18:16:46 +0000 | |
commit | 5814f2faca2a4b7a9d00f2895fe824ac786e6383 (patch) | |
tree | f9ac52a4b4464e043a3f6d60b97b28d390259a8b | |
parent | 007c22065daa7cd1c582a2d397619be96686be3e (diff) | |
download | astro-5814f2faca2a4b7a9d00f2895fe824ac786e6383.tar.gz astro-5814f2faca2a4b7a9d00f2895fe824ac786e6383.tar.zst astro-5814f2faca2a4b7a9d00f2895fe824ac786e6383.zip |
[ci] yarn format
-rw-r--r-- | .changeset/strange-kids-sing.md | 2 | ||||
-rw-r--r-- | docs/core-concepts/astro-components.md | 2 | ||||
-rw-r--r-- | packages/astro/src/compiler/codegen/index.ts | 4 | ||||
-rw-r--r-- | packages/astro/src/compiler/index.ts | 2 | ||||
-rw-r--r-- | packages/astro/src/internal/fetch-content.ts | 5 |
5 files changed, 8 insertions, 7 deletions
diff --git a/.changeset/strange-kids-sing.md b/.changeset/strange-kids-sing.md index ea5544844..6d03bdfec 100644 --- a/.changeset/strange-kids-sing.md +++ b/.changeset/strange-kids-sing.md @@ -2,4 +2,4 @@ 'astro': patch --- -Remove custom Astro.fetchContent() glob implementation, use `import.meta.globEager` internally instead.
\ No newline at end of file +Remove custom Astro.fetchContent() glob implementation, use `import.meta.globEager` internally instead. diff --git a/docs/core-concepts/astro-components.md b/docs/core-concepts/astro-components.md index 6b33a2cf4..3642bb727 100644 --- a/docs/core-concepts/astro-components.md +++ b/docs/core-concepts/astro-components.md @@ -53,7 +53,7 @@ For best results, you should only have one `<style>` tag per-Astro component. Th <html> <head> <style> - ... + ...; </style> </head> <body> diff --git a/packages/astro/src/compiler/codegen/index.ts b/packages/astro/src/compiler/codegen/index.ts index 9b9154894..233f2985f 100644 --- a/packages/astro/src/compiler/codegen/index.ts +++ b/packages/astro/src/compiler/codegen/index.ts @@ -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; }, diff --git a/packages/astro/src/compiler/index.ts b/packages/astro/src/compiler/index.ts index 49acec038..ff9c47680 100644 --- a/packages/astro/src/compiler/index.ts +++ b/packages/astro/src/compiler/index.ts @@ -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), diff --git a/packages/astro/src/internal/fetch-content.ts b/packages/astro/src/internal/fetch-content.ts index 733dddbc0..9580cd181 100644 --- a/packages/astro/src/internal/fetch-content.ts +++ b/packages/astro/src/internal/fetch-content.ts @@ -19,5 +19,6 @@ export function fetchContent(importMetaGlobResult: Record<string, any>, url: str ...mod.__content, url: urlSpec.replace(/^.*\/pages\//, '/').replace(/\.md$/, ''), }; - }).filter(Boolean); -}
\ No newline at end of file + }) + .filter(Boolean); +} |