0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

[ci] format

This commit is contained in:
Cody Olsen 2024-12-16 19:20:28 +00:00 committed by astrobot-houston
parent 0ac0f25c18
commit 75de4a8c73
5 changed files with 8 additions and 13 deletions

View file

@ -205,8 +205,7 @@ class AstroBuilder {
key: keyPromise, key: keyPromise,
}; };
const { internals, ssrOutputChunkNames } = const { internals, ssrOutputChunkNames } = await viteBuild(opts);
await viteBuild(opts);
const hasServerIslands = this.settings.serverIslandNameMap.size > 0; const hasServerIslands = this.settings.serverIslandNameMap.size > 0;
// Error if there are server islands but no adapter provided. // Error if there are server islands but no adapter provided.

View file

@ -356,8 +356,7 @@ async function cleanServerOutput(
) { ) {
const out = getOutDirWithinCwd(opts.settings.config.outDir); const out = getOutDirWithinCwd(opts.settings.config.outDir);
// The SSR output chunks for Astro are all .mjs files // The SSR output chunks for Astro are all .mjs files
const files = ssrOutputChunkNames const files = ssrOutputChunkNames.filter((f) => f.endsWith('.mjs'));
.filter((f) => f.endsWith('.mjs'));
if (internals.manifestFileName) { if (internals.manifestFileName) {
files.push(internals.manifestFileName); files.push(internals.manifestFileName);
} }
@ -367,10 +366,7 @@ async function cleanServerOutput(
files.map(async (filename) => { files.map(async (filename) => {
const url = new URL(filename, out); const url = new URL(filename, out);
const map = new URL(url + '.map'); const map = new URL(url + '.map');
await Promise.all([ await Promise.all([fs.promises.rm(url), fs.promises.rm(new URL(map)).catch((e) => {})]);
fs.promises.rm(url),
fs.promises.rm(new URL(map)).catch((e) => {})
]);
}), }),
); );
@ -426,7 +422,7 @@ async function ssrMoveAssets(opts: StaticBuildOptions) {
cwd: fileURLToPath(serverAssets), cwd: fileURLToPath(serverAssets),
}); });
console.log("FILES2", files); console.log('FILES2', files);
if (files.length > 0) { if (files.length > 0) {
await Promise.all( await Promise.all(

View file

@ -169,7 +169,7 @@ describe('Astro basic build', () => {
it('server sourcemaps not included in output', async () => { it('server sourcemaps not included in output', async () => {
const files = await fixture.readdir('/'); const files = await fixture.readdir('/');
const hasSourcemaps = files.some(fileName => { const hasSourcemaps = files.some((fileName) => {
return fileName.endsWith('.map'); return fileName.endsWith('.map');
}); });
assert.equal(hasSourcemaps, false, 'no sourcemap files in output'); assert.equal(hasSourcemaps, false, 'no sourcemap files in output');

View file

@ -18,7 +18,7 @@ describe('Sourcemap', async () => {
it('Builds non-empty sourcemap', async () => { it('Builds non-empty sourcemap', async () => {
const assets = await fixture.readdir('/_astro'); const assets = await fixture.readdir('/_astro');
const maps = assets.filter(file => file.endsWith('.map')); const maps = assets.filter((file) => file.endsWith('.map'));
assert.ok(maps.length > 0, 'got source maps'); assert.ok(maps.length > 0, 'got source maps');
for (const mapName of maps) { for (const mapName of maps) {
const filename = `/_astro/${mapName}`; const filename = `/_astro/${mapName}`;

View file

@ -60,7 +60,7 @@ function getViteConfiguration(
'react/jsx-runtime', 'react/jsx-runtime',
'react/jsx-dev-runtime', 'react/jsx-dev-runtime',
'react-dom', 'react-dom',
'react-compiler-runtime' 'react-compiler-runtime',
], ],
exclude: [reactConfig.server], exclude: [reactConfig.server],
}, },