gro_config.ts

view source

Declarations
#

10 declarations

cook_gro_config
#

gro_config.ts view source

(raw_config: RawGroConfig): Promise<GroConfig> import {cook_gro_config} from '@fuzdev/gro/gro_config.js';

Transforms a RawGroConfig to the more strict GroConfig. This allows users to provide a more relaxed config. Hashes the build_cache_config and deletes the raw value for security.

raw_config

returns

Promise<GroConfig>

create_empty_gro_config
#

gro_config.ts view source

(): GroConfig import {create_empty_gro_config} from '@fuzdev/gro/gro_config.js';

returns

GroConfig

CreateGroConfig
#

EMPTY_BUILD_CACHE_CONFIG_HASH
#

gro_config.ts view source

"af1349b9f5f9a1a6a0404dea36dcc9499bcb25c9adc112b7cc9a93cae41f3262" import {EMPTY_BUILD_CACHE_CONFIG_HASH} from '@fuzdev/gro/gro_config.js';

BLAKE3 hash of empty string, used for configs without build_cache_config. This ensures consistent cache behavior when no custom config is provided.

GroConfig
#

gro_config.ts view source

GroConfig import type {GroConfig} from '@fuzdev/gro/gro_config.js';

The config that users can extend via gro.config.ts. This is exposed to users in places like tasks and genfiles.

inheritance

extends: RawGroConfig

see also

plugins

type (ctx: PluginContext<object>): Plugin<PluginContext<object>>[] | Promise<Plugin<PluginContext<object>>[]>

ctx

type PluginContext<object>
returns Plugin<PluginContext<object>>[] | Promise<Plugin<PluginContext<object>>[]>

see also

map_package_json

Maps the project's package.json before writing it to the filesystem. The package_json argument may be mutated, but the return value is what's used by the caller. Returning null is a no-op for the caller.

type (PackageJsonMapper) | null

task_root_dirs

The root directories to search for tasks given implicit relative input paths. Defaults to ./src/lib, then the cwd, then the Gro package dist.

type PathId[]

search_filters

When searching the filesystem for tasks and genfiles, directories and files are included if they pass all of these filters.

type PathFilter[]

js_cli

The CLI to use that's compatible with node.

type string

pm_cli

The CLI to use that's compatible with npm install and npm link. Defaults to 'npm'.

type string

build_cache_config_hash

SHA-256 hash of the user's build_cache_config from gro.config.ts. This is computed during config normalization and the raw value is immediately deleted. If no build_cache_config was provided, this is the hash of an empty string.

type string

see also

  • ``RawGroConfig.build_cache_config``

filer_options

Options passed to the Filer for file watching and import resolution.

type Partial<FilerOptions> | null

see also

  • ``FilerOptions``

GroConfigModule
#

load_gro_config
#

gro_config.ts view source

(dir?: string): Promise<GroConfig> import {load_gro_config} from '@fuzdev/gro/gro_config.js';

dir

type string
default paths.root

returns

Promise<GroConfig>

RawGroConfig
#

gro_config.ts view source

RawGroConfig import type {RawGroConfig} from '@fuzdev/gro/gro_config.js';

The relaxed variant of GroConfig that users can provide via gro.config.ts. Superset of GroConfig.

see also

plugins?

type (ctx: PluginContext<object>): Plugin<PluginContext<object>>[] | Promise<Plugin<PluginContext<object>>[]>

ctx

type PluginContext<object>
returns Plugin<PluginContext<object>>[] | Promise<Plugin<PluginContext<object>>[]>

map_package_json?

type (PackageJsonMapper) | null

task_root_dirs?

type string[]

search_filters?

type (PathFilter) | (PathFilter)[] | null

js_cli?

type string

pm_cli?

type string

build_cache_config?

Optional object defining custom build inputs for cache invalidation. This value is hashed during config normalization and used to detect when builds need to be regenerated due to non-source changes.

Use cases:

  • Environment variables baked into build: {api_url: process.env.PUBLIC_API_URL}
  • External data files: {data: fs.readFileSync('data.json', 'utf-8')}
  • Build feature flags: {enable_analytics: true}

Can be a static object or an async function that returns an object.

IMPORTANT: It's safe to include secrets here because they are hashed and deleted during config normalization. The raw value is never logged or persisted.

type Record<string, unknown> | (() => Record<string, unknown> | Promise<Record<string, unknown>>)

filer_options?

Options passed to the Filer for file watching and import resolution.

type Partial<FilerOptions> | null

see also

  • ``FilerOptions``

SEARCH_EXCLUDER_DEFAULT
#

gro_config.ts view source

RegExp import {SEARCH_EXCLUDER_DEFAULT} from '@fuzdev/gro/gro_config.js';

The regexp used by default to exclude directories and files when searching the filesystem for tasks and genfiles. Customize via search_filters in the GroConfig. See the test cases for the exact behavior.

validate_gro_config_module
#

gro_config.ts view source

(config_module: any, config_path: string): asserts config_module is GroConfigModule import {validate_gro_config_module} from '@fuzdev/gro/gro_config.js';

config_module

type any

config_path

type string

returns

void

Depends on
#

Imported by
#