Initial Commit
This commit is contained in:
72
scripts/lib/config.ts
Normal file
72
scripts/lib/config.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* Centralized configuration for scripts
|
||||
*
|
||||
* All registry URLs, paths, and validation thresholds are defined here
|
||||
* to avoid hardcoding values across multiple scripts.
|
||||
*/
|
||||
|
||||
export const CONFIG = {
|
||||
/**
|
||||
* Registry configurations
|
||||
*/
|
||||
registry: {
|
||||
verdaccio: {
|
||||
url: process.env.VERDACCIO_URL || "https://npmjs.fq.io/",
|
||||
webUrl: "https://npmjs.fq.io/-/web/detail",
|
||||
},
|
||||
gitlab: {
|
||||
url:
|
||||
process.env.GITLAB_REGISTRY ||
|
||||
"https://gitlab.fq.io/api/v4/projects/2/packages/npm/",
|
||||
apiKey: process.env.GITLAB_API_KEY,
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* Monorepo paths
|
||||
*/
|
||||
paths: {
|
||||
root: process.env.MONOREPO_ROOT || process.cwd(),
|
||||
|
||||
/**
|
||||
* Single root for all genesis workspace packages.
|
||||
* Layout is `packages/<category>/<plugin>/<pkg>/` — see
|
||||
* `discoverPackageDirs` in `./discover-packages.ts` for the 3-level
|
||||
* walk (with 2-level and flat fallbacks).
|
||||
*/
|
||||
packagesRoot: "packages",
|
||||
},
|
||||
|
||||
/**
|
||||
* Quality and validation thresholds
|
||||
*/
|
||||
validation: {
|
||||
minCoverage: 95,
|
||||
minDocsCoverage: 90,
|
||||
maxComplexity: 10,
|
||||
maxMethodLines: 20,
|
||||
maxClassLines: 200,
|
||||
},
|
||||
|
||||
/**
|
||||
* Build and test settings
|
||||
*/
|
||||
build: {
|
||||
cacheDir: "node_modules/.vite",
|
||||
distDir: "dist",
|
||||
},
|
||||
|
||||
/**
|
||||
* Exit codes for consistent error handling
|
||||
*/
|
||||
exitCodes: {
|
||||
success: 0,
|
||||
failure: 1,
|
||||
partialSuccess: 2,
|
||||
},
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Type-safe access to config values
|
||||
*/
|
||||
export type Config = typeof CONFIG;
|
||||
Reference in New Issue
Block a user