[ci] yarn format

This commit is contained in:
natemoo-re 2021-06-01 23:42:10 +00:00 committed by GitHub Actions
parent c9d833ee0b
commit 00c6dec8eb
3 changed files with 25 additions and 20 deletions

View file

@ -69,13 +69,15 @@ setup("${astroId}", async () => {
const getComponentName = (Component: any, componentProps: any) => { const getComponentName = (Component: any, componentProps: any) => {
if (componentProps.displayName) return componentProps.displayName; if (componentProps.displayName) return componentProps.displayName;
switch (typeof Component) { switch (typeof Component) {
case 'function': return Component.displayName ?? Component.name; case 'function':
case 'string': return Component; return Component.displayName ?? Component.name;
case 'string':
return Component;
default: { default: {
return Component; return Component;
} }
} }
} };
export const __astro_component = (Component: any, componentProps: AstroComponentProps = {} as any) => { export const __astro_component = (Component: any, componentProps: AstroComponentProps = {} as any) => {
if (Component == null) { if (Component == null) {

View file

@ -304,10 +304,14 @@ async function createSnowpack(astroConfig: AstroConfig, options: CreateSnowpackO
(process.env as any).TAILWIND_DISABLE_TOUCH = true; (process.env as any).TAILWIND_DISABLE_TOUCH = true;
} }
const rendererInstances = (await Promise.all(renderers.map((renderer) => { const rendererInstances = (
await Promise.all(
renderers.map((renderer) => {
const entrypoint = pathToFileURL(resolveDependency(renderer)).toString(); const entrypoint = pathToFileURL(resolveDependency(renderer)).toString();
return import(entrypoint); return import(entrypoint);
}))).map(({ default: raw }, i) => { })
)
).map(({ default: raw }, i) => {
const { name = renderers[i], client, server, snowpackPlugin: snowpackPluginName, snowpackPluginOptions } = raw; const { name = renderers[i], client, server, snowpackPlugin: snowpackPluginName, snowpackPluginOptions } = raw;
if (typeof client !== 'string') { if (typeof client !== 'string') {
@ -376,7 +380,7 @@ async function createSnowpack(astroConfig: AstroConfig, options: CreateSnowpackO
}, },
packageOptions: { packageOptions: {
knownEntrypoints, knownEntrypoints,
external: snowpackExternals external: snowpackExternals,
}, },
}); });

View file

@ -1,18 +1,17 @@
/* App.svelte generated by Svelte v3.38.2 */ /* App.svelte generated by Svelte v3.38.2 */
import { import { create_ssr_component, missing_component, validate_component } from 'svelte/internal';
create_ssr_component,
missing_component,
validate_component
} from "svelte/internal";
const App = create_ssr_component(($$result, $$props, $$bindings, slots) => { const App = create_ssr_component(($$result, $$props, $$bindings, slots) => {
const { __astro_component: Component, __astro_children, ...props } = $$props; const { __astro_component: Component, __astro_children, ...props } = $$props;
return `${validate_component(Component || missing_component, "svelte:component").$$render($$result, Object.assign(props), {}, { return `${validate_component(Component || missing_component, 'svelte:component').$$render(
default: () => `${__astro_children $$result,
? `<astro-fragment>${__astro_children}</astro-fragment>` Object.assign(props),
: ``}` {},
})}`; {
default: () => `${__astro_children ? `<astro-fragment>${__astro_children}</astro-fragment>` : ``}`,
}
)}`;
}); });
export default App; export default App;