Home / File/ env.mjs — astro Source File

env.mjs — astro Source File

Architecture documentation for env.mjs, a javascript file in the astro codebase. 2 imports, 0 dependents.

File javascript CoreAstro RenderingEngine 2 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  961a1247_f990_dce4_574e_c55032536b76["env.mjs"]
  9f69a53d_203d_876c_5fa2_7a0ae116a113["internal"]
  961a1247_f990_dce4_574e_c55032536b76 --> 9f69a53d_203d_876c_5fa2_7a0ae116a113
  00cd8d3c_75bb_0f43_4798_0bfa44467124["runtime"]
  961a1247_f990_dce4_574e_c55032536b76 --> 00cd8d3c_75bb_0f43_4798_0bfa44467124
  style 961a1247_f990_dce4_574e_c55032536b76 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/* eslint-disable @typescript-eslint/no-unused-vars */
// @ts-check
import { schema } from 'virtual:astro:env/internal';
import {
	// biome-ignore lint/correctness/noUnusedImports: `_getEnv` is used by the generated code
	getEnv as _getEnv,
	createInvalidVariablesError,
	getEnvFieldType,
	setOnSetGetEnv,
	validateEnvVariable,
} from 'astro/env/runtime';

// @ts-expect-error
/** @returns {string} */
// used while generating the virtual module
// biome-ignore lint/correctness/noUnusedFunctionParameters: `key` is used by the generated code
const getEnv = (key) => {
	// @@GET_ENV@@
};

export const getSecret = (key) => {
	return getEnv(key);
};

const _internalGetSecret = (key) => {
	const rawVariable = getEnv(key);
	const variable = rawVariable === '' ? undefined : rawVariable;
	const options = schema[key];

	const result = validateEnvVariable(variable, options);
	if (result.ok) {
		return result.value;
	}
	const type = getEnvFieldType(options);
	throw createInvalidVariablesError(key, type, result);
};

setOnSetGetEnv(() => {
	// @@ON_SET_GET_ENV@@
});

Domain

Subdomains

Dependencies

  • internal
  • runtime

Frequently Asked Questions

What does env.mjs do?
env.mjs is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in env.mjs?
env.mjs defines 3 function(s): _internalGetSecret, getEnv, getSecret.
What does env.mjs depend on?
env.mjs imports 2 module(s): internal, runtime.
Where is env.mjs in the architecture?
env.mjs is located at packages/astro/templates/env.mjs (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/templates).

Analyze Your Own Codebase

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

Try Supermodel Free