Home / File/ shared.mjs — astro Source File

shared.mjs — astro Source File

Architecture documentation for shared.mjs, a javascript file in the astro codebase. 1 imports, 1 dependents.

File javascript CoreAstro RoutingSystem 1 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  4d75c445_4391_c7d4_eae5_d220320b7783["shared.mjs"]
  80b99928_2154_ad65_1f34_9c854d2c9ec5["colors"]
  4d75c445_4391_c7d4_eae5_d220320b7783 --> 80b99928_2154_ad65_1f34_9c854d2c9ec5
  ff2c719f_fe27_09a3_da3d_e2e373d9ff80["build.mjs"]
  ff2c719f_fe27_09a3_da3d_e2e373d9ff80 --> 4d75c445_4391_c7d4_eae5_d220320b7783
  style 4d75c445_4391_c7d4_eae5_d220320b7783 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// @ts-check
import { dim, green, red, yellow } from 'kleur/colors';

const dt = new Intl.DateTimeFormat('en-us', {
	hour: '2-digit',
	minute: '2-digit',
});

/**
 * @type {import('esbuild').Plugin}
 */
export const rebuildPlugin = {
	name: 'astro:rebuild',
	setup(build) {
		build.onEnd(async (result) => {
			const date = dt.format(new Date());
			if (result && result.errors.length) {
				console.error(dim(`[${date}] `) + red(result.errors.map((error) => error.text).join('\n')));
			} else {
				if (result.warnings.length) {
					console.info(
						dim(`[${date}] `) + yellow('⚠ updated with warnings:\n' + result.warnings.join('\n')),
					);
				}
				console.info(dim(`[${date}] `) + green('✔ updated'));
			}
		});
	},
};

Domain

Subdomains

Dependencies

  • colors

Frequently Asked Questions

What does shared.mjs do?
shared.mjs is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain, RoutingSystem subdomain.
What functions are defined in shared.mjs?
shared.mjs defines 1 function(s): rebuildPlugin.setup.
What does shared.mjs depend on?
shared.mjs imports 1 module(s): colors.
What files import shared.mjs?
shared.mjs is imported by 1 file(s): build.mjs.
Where is shared.mjs in the architecture?
shared.mjs is located at packages/language-tools/vscode/scripts/shared.mjs (domain: CoreAstro, subdomain: RoutingSystem, directory: packages/language-tools/vscode/scripts).

Analyze Your Own Codebase

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

Try Supermodel Free