@storm-stack/core
Version:
A build toolkit and runtime used by Storm Software in TypeScript applications
71 lines (68 loc) • 3.09 kB
text/typescript
import { Jiti } from 'jiti';
import { Context, StormStackCommand, ResolvedUserConfig, InlineConfig, ResolvedOptions } from '../types/index.cjs';
import '@babel/core';
import '@babel/types';
import '@storm-stack/types/shared/error';
import '@stryke/types/base';
import 'magic-string';
import '@storm-software/config-tools/types';
import '@stryke/types/configuration';
import 'hookable';
import '@storm-software/build-tools/types';
import '@storm-software/config/types';
import '@storm-software/esbuild/types';
import '@storm-software/unbuild/types';
import 'c12';
import 'esbuild';
import 'unbuild';
import '@deepkit/type';
import '../reflection-DTM1oT21.cjs';
import '@stryke/capnp';
import '@storm-stack/types/shared/log';
import '@stryke/env/get-env-paths';
import '@stryke/types/package-json';
import 'jest-worker';
import 'memfs';
import 'unimport';
import '../types/tsconfig.cjs';
import '@stryke/types/tsconfig';
import 'typescript';
import '../types/vfs.cjs';
import 'memfs/lib/volume';
import 'node:fs';
import 'unionfs';
type PartiallyResolvedContext = {
options: Partial<Context["options"]>;
} & Omit<Context, "options" | "tsconfig" | "entry" | "vfs" | "compiler" | "unimport">;
/**
* Loads the user configuration file for the project.
*
* @param projectRoot - The root directory of the project.
* @param jiti - An instance of Jiti to resolve modules from
* @param command - The {@link StormStackCommand} string associated with the current running process
* @param mode - The mode in which the project is running (default is "production").
* @returns A promise that resolves to the resolved user configuration.
*/
declare function loadUserConfigFile(projectRoot: string, jiti: Jiti, command?: StormStackCommand, mode?: string): Promise<ResolvedUserConfig>;
/**
* Resolves the configuration for the project.
*
* @param context - The context containing options and environment paths.
* @param inlineConfig - The inline project configuration to resolve.
* @param userConfig - The user-defined configuration options.
* @param projectRoot - The root directory of the project.
* @returns A promise that resolves to the resolved project configuration options.
*/
declare function resolveConfig(context: PartiallyResolvedContext, inlineConfig: InlineConfig, userConfig?: ResolvedUserConfig, projectRoot?: string): Promise<ResolvedOptions>;
/**
* Returns the default environment name based on the resolved options.
*
* @remarks
* The environment name is determined based on the build context, such as whether it's a server-side rendering (SSR) build, a Node.js platform, or a browser platform. If none of these conditions are met, it defaults to "shared".
*
* @param options - The resolved options containing the build context.
* @returns The default environment name.
*/
declare function defaultEnvironmentName(options: ResolvedOptions): "server" | "client" | "shared";
declare type __ΩPartiallyResolvedContext = any[];
export { type PartiallyResolvedContext, type __ΩPartiallyResolvedContext, defaultEnvironmentName, loadUserConfigFile, resolveConfig };