Home / File/ setup.js — astro Source File

setup.js — astro Source File

Architecture documentation for setup.js, a javascript file in the astro codebase. 4 imports, 0 dependents.

File javascript CoreAstro RoutingSystem 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  c8724ab3_49cd_5062_97d7_92c15bdcfb69["setup.js"]
  0a624eac_945e_c9e8_c9de_3feb9de2dd15["test-utils.js"]
  c8724ab3_49cd_5062_97d7_92c15bdcfb69 --> 0a624eac_945e_c9e8_c9de_3feb9de2dd15
  059d6180_e8b9_fe3d_9d0c_6c7c63b89996["cli"]
  c8724ab3_49cd_5062_97d7_92c15bdcfb69 --> 059d6180_e8b9_fe3d_9d0c_6c7c63b89996
  c52a5f83_66e3_37d7_9ebb_767f7129bc62["node:path"]
  c8724ab3_49cd_5062_97d7_92c15bdcfb69 --> c52a5f83_66e3_37d7_9ebb_767f7129bc62
  d9a92db9_c95e_9165_13ac_24b3d859d946["node:url"]
  c8724ab3_49cd_5062_97d7_92c15bdcfb69 --> d9a92db9_c95e_9165_13ac_24b3d859d946
  style c8724ab3_49cd_5062_97d7_92c15bdcfb69 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import path from 'node:path';
import { fileURLToPath } from 'node:url';
// @ts-expect-error
import { cli } from '../../../astro/test/test-utils.js';

// Copied from utils.ts so we don't have to import TS code for Node 20
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const fixtureDir = path.join(__dirname, './fixture');

export default async function setup() {
	// We only run the tests that require sync on Node.js versions other than 20 because the language server supports
	// a lower minimum version than Astro itself due to our lowest supported VS Code version, which mean we can't run Astro
	if (parseInt(process.versions.node) !== 20) {
		const res = await cli('sync', '--root', fixtureDir).getResult();
		if (res.exitCode !== 0) {
			throw new Error(res.stderr);
		}
	}
}

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does setup.js do?
setup.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain, RoutingSystem subdomain.
What functions are defined in setup.js?
setup.js defines 1 function(s): setup.
What does setup.js depend on?
setup.js imports 4 module(s): cli, node:path, node:url, test-utils.js.
Where is setup.js in the architecture?
setup.js is located at packages/language-tools/language-server/test/setup.js (domain: CoreAstro, subdomain: RoutingSystem, directory: packages/language-tools/language-server/test).

Analyze Your Own Codebase

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

Try Supermodel Free