[ci] format

This commit is contained in:
matthewp 2023-03-13 19:38:46 +00:00 committed by fredkbot
parent 6a7cf0712d
commit 9676f94840
4 changed files with 10 additions and 15 deletions

View file

@ -1,6 +1,4 @@
import { import { createImage } from 'astro/content/runtime-assets';
createImage
} from 'astro/content/runtime-assets';
const assetsDir = '@@ASSETS_DIR@@'; const assetsDir = '@@ASSETS_DIR@@';

View file

@ -43,9 +43,9 @@ export function astroContentVirtualModPlugin({
.replace('@@ASSETS_DIR@@', assetsDir); .replace('@@ASSETS_DIR@@', assetsDir);
const astroContentVirtualModuleId = '\0' + VIRTUAL_MODULE_ID; const astroContentVirtualModuleId = '\0' + VIRTUAL_MODULE_ID;
const allContents = settings.config.experimental.assets ? const allContents = settings.config.experimental.assets
(virtualModContents + virtualAssetsModContents) : ? virtualModContents + virtualAssetsModContents
virtualModContents; : virtualModContents;
return { return {
name: 'astro-content-virtual-mod-plugin', name: 'astro-content-virtual-mod-plugin',

View file

@ -224,10 +224,8 @@ describe('Content Collections', () => {
output: 'server', output: 'server',
adapter: testAdapter(), adapter: testAdapter(),
vite: { vite: {
plugins: [ plugins: [preventNodeBuiltinDependencyPlugin()],
preventNodeBuiltinDependencyPlugin() },
]
}
}); });
await fixture.build(); await fixture.build();
app = await fixture.loadTestAdapterApp(); app = await fixture.loadTestAdapterApp();

View file

@ -1,4 +1,3 @@
export function preventNodeBuiltinDependencyPlugin() { export function preventNodeBuiltinDependencyPlugin() {
// Verifies that `astro:content` does not have a hard dependency on Node builtins. // Verifies that `astro:content` does not have a hard dependency on Node builtins.
// This is to verify it will run on Cloudflare and Deno // This is to verify it will run on Cloudflare and Deno
@ -6,12 +5,12 @@ export function preventNodeBuiltinDependencyPlugin() {
name: 'verify-no-node-stuff', name: 'verify-no-node-stuff',
generateBundle() { generateBundle() {
const nodeModules = ['node:fs', 'node:url', 'node:worker_threads', 'node:path']; const nodeModules = ['node:fs', 'node:url', 'node:worker_threads', 'node:path'];
nodeModules.forEach(name => { nodeModules.forEach((name) => {
const mod = this.getModuleInfo(name); const mod = this.getModuleInfo(name);
if (mod) { if (mod) {
throw new Error(`Node builtins snuck in: ${name}`) throw new Error(`Node builtins snuck in: ${name}`);
} }
}); });
} },
}; };
} }