@storm-stack/core
Version:
A build toolkit and runtime used by Storm Software in TypeScript applications
81 lines (78 loc) • 3.26 kB
text/typescript
import { C as Context, M as MetaInfo, R as ResolvedOptions, W as WorkspaceConfig } from './babel-C68ay88r.cjs';
import '@babel/core';
import '@stryke/types/base';
import 'magic-string';
import '@storm-software/config-tools/types';
import '@stryke/types/configuration';
import 'esbuild';
import 'hookable';
import 'vite';
import '@rspack/core';
import '@storm-software/build-tools/types';
import '@storm-software/config/types';
import '@storm-software/esbuild/types';
import '@storm-software/unbuild/types';
import 'c12';
import 'rolldown';
import 'rollup';
import 'webpack';
import '@storm-stack/core/deepkit/type';
import '@stryke/env/get-env-paths';
import '@stryke/types/package-json';
import 'jest-worker';
import 'jiti';
import 'unimport';
import './reflection-DTM1oT21.cjs';
import '@stryke/capnp';
import 'semver';
import './tsconfig-DWrxucuq.cjs';
import '@stryke/types/tsconfig';
import 'typescript';
import 'memfs';
import 'node:fs';
import 'unionfs';
interface CreateContextOptions {
name?: string;
}
declare const PROJECT_ROOT_HASH_LENGTH = 45;
/**
* Generates a prefixed project root hash object.
*
* @remarks
* This function returns a string where the project root hash is prefixed with the project name plus a hyphen. If the total length of this string combination exceeds 45 characters, it will truncate the hash.
*
* @param name - The name of the project.
* @param projectRootHash - The hash of the project root.
* @returns An object containing the name and project root hash.
*/
declare function getPrefixedProjectRootHash(name: string, projectRootHash: string): string;
declare function discoverTemplates(context: Context, paths?: string[]): Promise<string[]>;
declare function getChecksum(path: string): Promise<string>;
/**
* Retrieves the persisted meta information from the context's data path.
*
* @param context - The build context.
* @returns A promise that resolves to the persisted meta information, or undefined if not found.
*/
declare function getPersistedMeta(context: Context): Promise<MetaInfo | undefined>;
/**
* Creates a new context for the Storm Stack build process.
*
* @remarks
* This function initializes the context with the provided inline configuration, workspace configuration, and other options.
*
* @param inlineConfig - The inline configuration for the Storm Stack build process.
* @param workspaceConfig - The workspace configuration for the Storm Stack project.
* @param options - Additional options for creating the context.
* @returns The created context.
*/
declare function createContext<TOptions extends ResolvedOptions = ResolvedOptions>(inlineConfig: TOptions["inlineConfig"], workspaceConfig?: WorkspaceConfig, options?: CreateContextOptions): Promise<Context<TOptions>>;
/**
* Writes the meta file for the context.
*
* @param context - The context to write the meta file for.
* @returns A promise that resolves when the meta file has been written.
*/
declare function writeMetaFile(context: Context): Promise<void>;
declare type __ΩCreateContextOptions = any[];
export { type CreateContextOptions, PROJECT_ROOT_HASH_LENGTH, type __ΩCreateContextOptions, createContext, discoverTemplates, getChecksum, getPersistedMeta, getPrefixedProjectRootHash, writeMetaFile };