@gasboost/config
v0.2.0
Published
Project definition and configuration loading for Gasboost
Maintainers
Readme
@gasboost/config
Project definition types and configuration loader for gasboost.
Positioning
gasboost.config.ts is the:
gasboost Project Definition / Desired State
It describes what the project intends to use.
It is not a CLI preference file and it is not a storage location for detected remote state or secrets.
gasboost.config.ts
↓
Project Definition
↓
Desired StateExamples of Desired State include:
- Apps Script application type
- build output directory
- Firebase capability usage
- RTDB Security Rules source
- RTDB Security Rules output
Examples of data that do not belong in gasboost.config.ts include:
- Firebase private keys
- OAuth tokens
- Google authentication state
.clasp.jsonstate- deployment IDs discovered from remote APIs
- runtime connection state
Those belong to external providers, environment-specific files, or runtime Actual State.
Installation
pnpm add -D @gasboost/configConfiguration
Create:
gasboost.config.tsCanonical example:
import { defineGasboostConfig } from "@gasboost/config";
export default defineGasboostConfig({
appsScript: {
type: "webapp",
rootDir: "./dist",
},
firebase: {
realtimeDatabase: {
source: "./src/backend/lib/rtdb.ts",
out: "./database.rules.json",
},
},
});Apps Script
Apps Script configuration:
import { defineGasboostConfig } from "@gasboost/config";
export default defineGasboostConfig({
appsScript: {
type: "webapp",
rootDir: "./dist",
},
});rootDir identifies the generated Apps Script build output.
Firebase Realtime Database
Realtime Database rules configuration:
import { defineGasboostConfig } from "@gasboost/config";
export default defineGasboostConfig({
firebase: {
realtimeDatabase: {
source: "./src/backend/lib/rtdb.ts",
out: "./database.rules.json",
},
},
});source points to the application module that exports the RTDB definition.
out is the destination for generated Firebase Realtime Database Security Rules.
Desired State vs Actual State
The distinction is intentional.
gasboost.config.ts
↓
Desired State
.clasp.json
appsscript.json
.env
authentication state
remote provider state
↓
Actual StateHigher-level tooling such as @gasboost/console can combine these views when deciding which lifecycle operations are available.
Config itself remains declarative.
API
defineGasboostConfig
Provides typed configuration authoring.
import { defineGasboostConfig } from "@gasboost/config";loadGasboostConfig
Loads a project configuration from the filesystem.
import { loadGasboostConfig } from "@gasboost/config";normalizeGasboostConfig
Normalizes supported configuration shapes into the current internal representation.
import { normalizeGasboostConfig } from "@gasboost/config";ModuleLoader
Provides project-aware module loading used by developer tooling.
import { ModuleLoader } from "@gasboost/config";Compatibility
Legacy RTDB configuration can still be normalized for compatibility.
New projects should use:
firebase.realtimeDatabaserather than the legacy top-level:
rtdbLicense
MIT
