maiass 5.9.12 → 5.9.15
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/lib/bootstrap.js +15 -0
- package/lib/version-manager.js +5 -2
- package/package.json +1 -1
package/lib/bootstrap.js
CHANGED
|
@@ -105,6 +105,19 @@ function detectVersionSource() {
|
|
|
105
105
|
return 'package.json'; // Default
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Infer version file type from filename/extension
|
|
110
|
+
* @param {string} filename - Version file name or path
|
|
111
|
+
* @returns {string} File type: 'json', 'php', or 'txt'
|
|
112
|
+
*/
|
|
113
|
+
function inferVersionFileType(filename) {
|
|
114
|
+
if (!filename) return 'txt';
|
|
115
|
+
if (filename.endsWith('.json')) return 'json';
|
|
116
|
+
if (filename.endsWith('.php')) return 'php';
|
|
117
|
+
if (filename.endsWith('.css')) return 'php'; // CSS version headers use same pattern as PHP
|
|
118
|
+
return 'txt';
|
|
119
|
+
}
|
|
120
|
+
|
|
108
121
|
/**
|
|
109
122
|
* Main bootstrap function
|
|
110
123
|
* @returns {Promise<boolean>} True if bootstrap completed, false if skipped
|
|
@@ -431,7 +444,9 @@ async function saveConfiguration(config) {
|
|
|
431
444
|
MAIASS_REPO_TYPE=${config.projectType}
|
|
432
445
|
|
|
433
446
|
# Version Management Settings
|
|
447
|
+
# Primary version file (usually auto-detected from package.json)
|
|
434
448
|
MAIASS_VERSION_PRIMARY_FILE=${config.versionSource}
|
|
449
|
+
MAIASS_VERSION_PRIMARY_TYPE=${inferVersionFileType(config.versionSource)}
|
|
435
450
|
# Secondary files that should have their versions updated (comma-separated)
|
|
436
451
|
#MAIASS_VERSION_SECONDARY_FILES=
|
|
437
452
|
|
package/lib/version-manager.js
CHANGED
|
@@ -560,8 +560,11 @@ export function detectVersionFiles(projectPath = process.cwd()) {
|
|
|
560
560
|
const versionFiles = [];
|
|
561
561
|
|
|
562
562
|
// Check for custom primary version file from .env.maiass first
|
|
563
|
-
|
|
564
|
-
const
|
|
563
|
+
// Normalize path separators for cross-platform .env.maiass compatibility (\ → /)
|
|
564
|
+
const primaryFileRaw = process.env.MAIASS_VERSION_PRIMARY_FILE;
|
|
565
|
+
const primaryFile = primaryFileRaw ? primaryFileRaw.split('\\').join('/') : primaryFileRaw;
|
|
566
|
+
const primaryTypeEnv = process.env.MAIASS_VERSION_PRIMARY_TYPE;
|
|
567
|
+
const primaryType = primaryTypeEnv || (primaryFile && primaryFile.endsWith('.json') ? 'json' : 'txt');
|
|
565
568
|
const primaryLineStart = process.env.MAIASS_VERSION_PRIMARY_LINE_START || '';
|
|
566
569
|
|
|
567
570
|
if (primaryFile) {
|