-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathconfig.js
More file actions
51 lines (44 loc) · 1.28 KB
/
config.js
File metadata and controls
51 lines (44 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* Centralized Configuration Module
*
* This module provides a single source of truth for all configuration values.
* It reads from package.json and can apply stage-wise transforms as needed.
*
* Usage:
* const { stage, trustedElectronDomains, productName } = require('./config');
*/
const packageJson = require('./package.json');
// Core package.json values
const name = packageJson.name;
const identifier = packageJson.identifier;
const stage = packageJson.stage;
const version = packageJson.version;
const productName = packageJson.productName;
const description = packageJson.description;
// Security configuration
const trustedElectronDomains = packageJson.trustedElectronDomains || [];
/**
* Initialize configuration (call once at app startup if needed).
* Currently a no-op but can be extended for async config loading,
* environment variable overrides, or stage-wise transforms.
*/
function initConfig() {
// Future: Add stage-wise transforms, env overrides, etc.
// Example:
// if (stage === 'prod') {
// // Apply production-specific config
// }
}
module.exports = {
// Package info
name,
identifier,
stage,
version,
productName,
description,
// Security
trustedElectronDomains,
// Initialization
initConfig
};