[ci] yarn format
This commit is contained in:
parent
e28d5cb9de
commit
4df98a79f8
2 changed files with 28 additions and 22 deletions
|
@ -73,30 +73,37 @@ export async function build(astroConfig: AstroConfig, logging: LogOptions = defa
|
|||
info(logging, 'build', yellow('! building pages...'));
|
||||
try {
|
||||
await Promise.all(
|
||||
pages.map((filepath) => {
|
||||
const buildPage = getPageType(filepath) === 'collection' ? buildCollectionPage : buildStaticPage;
|
||||
return buildPage({
|
||||
astroConfig,
|
||||
buildState,
|
||||
filepath,
|
||||
logging,
|
||||
mode,
|
||||
resolvePackageUrl: (pkgName: string) => snowpack.getUrlForPackage(pkgName),
|
||||
runtime,
|
||||
site: astroConfig.buildOptions.site,
|
||||
});
|
||||
})
|
||||
)
|
||||
pages.map((filepath) => {
|
||||
const buildPage = getPageType(filepath) === 'collection' ? buildCollectionPage : buildStaticPage;
|
||||
return buildPage({
|
||||
astroConfig,
|
||||
buildState,
|
||||
filepath,
|
||||
logging,
|
||||
mode,
|
||||
resolvePackageUrl: (pkgName: string) => snowpack.getUrlForPackage(pkgName),
|
||||
runtime,
|
||||
site: astroConfig.buildOptions.site,
|
||||
});
|
||||
})
|
||||
);
|
||||
} catch (e) {
|
||||
if (e.filename) {
|
||||
let stack = e.stack.replace(/Object\.__render \(/gm, '').replace(/\/_astro\/(.+)\.astro\.js\:\d+\:\d+\)/gm, (_: string, $1: string) => 'file://' + fileURLToPath(projectRoot) + $1 + '.astro').split('\n');
|
||||
stack.splice(1, 0, ` at file://${e.filename}`)
|
||||
stack = stack.join('\n')
|
||||
let stack = e.stack
|
||||
.replace(/Object\.__render \(/gm, '')
|
||||
.replace(/\/_astro\/(.+)\.astro\.js\:\d+\:\d+\)/gm, (_: string, $1: string) => 'file://' + fileURLToPath(projectRoot) + $1 + '.astro')
|
||||
.split('\n');
|
||||
stack.splice(1, 0, ` at file://${e.filename}`);
|
||||
stack = stack.join('\n');
|
||||
|
||||
error(logging, 'build', `${red(`Unable to render ${underline(e.filename.replace(fileURLToPath(projectRoot), ''))}`)}
|
||||
error(
|
||||
logging,
|
||||
'build',
|
||||
`${red(`Unable to render ${underline(e.filename.replace(fileURLToPath(projectRoot), ''))}`)}
|
||||
|
||||
${stack}
|
||||
`);
|
||||
`
|
||||
);
|
||||
} else {
|
||||
error(logging, 'build', e);
|
||||
}
|
||||
|
|
|
@ -19,10 +19,9 @@ Throwable('Can throw an error from an `.astro` file', async ({ runtime }) => {
|
|||
});
|
||||
|
||||
Throwable('Does not complete build when Error is thrown', async ({ build }) => {
|
||||
await build().catch(e => {
|
||||
await build().catch((e) => {
|
||||
assert.ok(e, 'Build threw');
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Throwable.run();
|
||||
|
|
Loading…
Reference in a new issue