@mono-labs/project 0.1.255 → 0.1.257

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +14 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -37,6 +37,7 @@ import {
37
37
  - **`resolveMonoDirectory()`** -- Resolves the path to the `.mono/` directory (checks project root and cwd).
38
38
  - **`getMonoFiles()`** -- Returns a `MonoFiles` record of all `.mono/*.json` command definitions (excluding `config.json`).
39
39
  - **`getMonoConfig()`** -- Loads and returns the parsed `.mono/config.json` as a `MonoConfig` object.
40
+ - **`clearMonoConfigCache()`** -- Clears the cached mono config, forcing a fresh read on the next call to `getMonoConfig()`.
40
41
 
41
42
  ### App Configuration
42
43
 
@@ -58,9 +59,21 @@ import { loadMergedEnv } from "@mono-labs/project";
58
59
 
59
60
  - **`loadMergedEnv()`** -- Loads `.env` and `.env.local` from the project root, merges them (`.env.local` takes precedence), and injects into `process.env` without overwriting existing variables.
60
61
 
62
+ ### Environment Filtering
63
+
64
+ ```typescript
65
+ import {
66
+ filterEnvByPrefixes,
67
+ filterEnvByConfig
68
+ } from "@mono-labs/project";
69
+ ```
70
+
71
+ - **`filterEnvByPrefixes(env, prefixes, include?)`** -- Returns only env vars whose keys start with one of the given prefixes. Pass an optional `include` array for specific keys that should always be kept regardless of prefix.
72
+ - **`filterEnvByConfig(env?, include?)`** -- Reads prefixes from `.mono/config.json` `envMap` and combines them with default prefixes (`MONO_`, `EAS_`, `APP_`, `TAMAGUI_`). Defaults to `process.env` if `env` is omitted.
73
+
61
74
  ### Subpath Export
62
75
 
63
- The `@mono-labs/project/project` subpath provides access to app config loading and documentation generation utilities.
76
+ The `@mono-labs/project/project` subpath provides access to app config loading, environment filtering, and documentation generation utilities.
64
77
 
65
78
  ## Config Types
66
79
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/project",
3
- "version": "0.1.255",
3
+ "version": "0.1.257",
4
4
  "type": "commonjs",
5
5
  "description": "Project configuration utilities for mono-labs",
6
6
  "main": "dist/index.js",