[ci] format

This commit is contained in:
matthewp 2022-07-25 16:16:22 +00:00 committed by fredkbot
parent 7e5ac1f45c
commit f9e8e72a48
4 changed files with 9 additions and 12 deletions

View file

@ -11,7 +11,7 @@ test.describe('Lit components', () => {
test.beforeEach(() => { test.beforeEach(() => {
delete globalThis.window; delete globalThis.window;
}); });
test.describe('Development', () => { test.describe('Development', () => {
let devServer; let devServer;
const t = test.extend({}); const t = test.extend({});
@ -19,7 +19,7 @@ test.describe('Lit components', () => {
t.beforeEach(async ({ astro }) => { t.beforeEach(async ({ astro }) => {
devServer = await astro.startDevServer(); devServer = await astro.startDevServer();
}); });
t.afterEach(async () => { t.afterEach(async () => {
await devServer.stop(); await devServer.stop();
}); });
@ -110,12 +110,12 @@ test.describe('Lit components', () => {
test.describe('Production', () => { test.describe('Production', () => {
let previewServer; let previewServer;
const t = test.extend({}); const t = test.extend({});
t.beforeAll(async ({ astro }) => { t.beforeAll(async ({ astro }) => {
// Playwright's Node version doesn't have these functions, so stub them. // Playwright's Node version doesn't have these functions, so stub them.
process.stdout.clearLine = () => {}; process.stdout.clearLine = () => {};
process.stdout.cursorTo = () => {}; process.stdout.cursorTo = () => {};
await astro.build(); await astro.build();
}); });

View file

@ -1,6 +1,5 @@
import type { PluginContext } from 'rollup'; import type { PluginContext } from 'rollup';
import type { Plugin as VitePlugin } from 'vite'; import type { Plugin as VitePlugin } from 'vite';
import type { AstroConfig } from '../../@types/astro';
import type { BuildInternals } from '../../core/build/internal.js'; import type { BuildInternals } from '../../core/build/internal.js';
import type { PluginMetadata as AstroPluginMetadata } from '../../vite-plugin-astro/types'; import type { PluginMetadata as AstroPluginMetadata } from '../../vite-plugin-astro/types';
@ -9,9 +8,7 @@ import { resolveClientDevPath } from '../../core/render/dev/resolve.js';
import { getTopLevelPages } from './graph.js'; import { getTopLevelPages } from './graph.js';
import { getPageDataByViteID, trackClientOnlyPageDatas } from './internal.js'; import { getPageDataByViteID, trackClientOnlyPageDatas } from './internal.js';
export function vitePluginAnalyzer( export function vitePluginAnalyzer(internals: BuildInternals): VitePlugin {
internals: BuildInternals
): VitePlugin {
function hoistedScriptScanner() { function hoistedScriptScanner() {
const uniqueHoistedIds = new Map<string, string>(); const uniqueHoistedIds = new Map<string, string>();
const pageScripts = new Map<string, Set<string>>(); const pageScripts = new Map<string, Set<string>>();

View file

@ -145,9 +145,9 @@ function buildManifest(
// HACK! Patch this special one. // HACK! Patch this special one.
const entryModules = Object.fromEntries(internals.entrySpecifierToBundleMap.entries()); const entryModules = Object.fromEntries(internals.entrySpecifierToBundleMap.entries());
if(!(BEFORE_HYDRATION_SCRIPT_ID in entryModules)) { if (!(BEFORE_HYDRATION_SCRIPT_ID in entryModules)) {
entryModules[BEFORE_HYDRATION_SCRIPT_ID] = entryModules[BEFORE_HYDRATION_SCRIPT_ID] =
'data:text/javascript;charset=utf-8,//[no before-hydration script]'; 'data:text/javascript;charset=utf-8,//[no before-hydration script]';
} }
const ssrManifest: SerializedSSRManifest = { const ssrManifest: SerializedSSRManifest = {

View file

@ -1,4 +1,4 @@
import { Plugin as VitePlugin, ConfigEnv } from 'vite'; import { ConfigEnv, Plugin as VitePlugin } from 'vite';
import { AstroConfig, InjectedScriptStage } from '../@types/astro.js'; import { AstroConfig, InjectedScriptStage } from '../@types/astro.js';
// NOTE: We can't use the virtual "\0" ID convention because we need to // NOTE: We can't use the virtual "\0" ID convention because we need to
@ -57,6 +57,6 @@ export default function astroScriptsPlugin({ config }: { config: AstroConfig }):
name: BEFORE_HYDRATION_SCRIPT_ID, name: BEFORE_HYDRATION_SCRIPT_ID,
}); });
} }
} },
}; };
} }