Home / Function/ run() — astro Function Reference

run() — astro Function Reference

Architecture documentation for the run() function in render-bench.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  d644f400_df8e_6521_e94b_c7fab26d630a["run()"]
  bc0dd985_37f0_7e6f_1e1b_54d0a5d02137["render-bench.js"]
  d644f400_df8e_6521_e94b_c7fab26d630a -->|defined in| bc0dd985_37f0_7e6f_1e1b_54d0a5d02137
  style d644f400_df8e_6521_e94b_c7fab26d630a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

benchmark/make-project/render-bench.js lines 107–132

export async function run(projectDir) {
	await fs.rm(projectDir, { recursive: true, force: true });
	await fs.mkdir(new URL('./src/pages', projectDir), { recursive: true });
	await fs.mkdir(new URL('./src/components', projectDir), { recursive: true });

	await Promise.all(
		Object.entries(renderFiles).map(([name, content]) => {
			return fs.writeFile(new URL(`./src/${name}`, projectDir), content, 'utf-8');
		}),
	);

	await fs.writeFile(
		new URL('./astro.config.js', projectDir),
		`\
import { defineConfig } from 'astro/config';
import adapter from '@benchmark/adapter';
import mdx from '@astrojs/mdx';

export default defineConfig({
  integrations: [mdx()],
	output: 'server',
	adapter: adapter(),
});`,
		'utf-8',
	);
}

Subdomains

Frequently Asked Questions

What does run() do?
run() is a function in the astro codebase, defined in benchmark/make-project/render-bench.js.
Where is run() defined?
run() is defined in benchmark/make-project/render-bench.js at line 107.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free