@astralkit/cli 4.1.0 → 4.1.1
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.
- package/package.json +1 -1
- package/src/lib/config.js +14 -0
package/package.json
CHANGED
package/src/lib/config.js
CHANGED
|
@@ -125,3 +125,17 @@ export function addCssImports(cssFilePath, imports) {
|
|
|
125
125
|
const existing = fs.existsSync(cssFilePath) ? fs.readFileSync(cssFilePath, 'utf8') : '';
|
|
126
126
|
fs.writeFileSync(cssFilePath, imports.join('\n') + '\n\n' + existing);
|
|
127
127
|
}
|
|
128
|
+
|
|
129
|
+
// ─── Legacy config file support ───────────────────────────
|
|
130
|
+
// Reads astralkit.config.json if it exists (from older init versions).
|
|
131
|
+
// New installs don't create this file.
|
|
132
|
+
|
|
133
|
+
export const CONFIG_FILENAME = 'astralkit.config.json';
|
|
134
|
+
|
|
135
|
+
export function getProjectConfig(dir = process.cwd()) {
|
|
136
|
+
const configPath = path.join(dir, CONFIG_FILENAME);
|
|
137
|
+
if (!fs.existsSync(configPath)) return null;
|
|
138
|
+
try {
|
|
139
|
+
return JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
140
|
+
} catch { return null; }
|
|
141
|
+
}
|