@forge/cli
12.22.0-experimental-04cc2b912.23.0-next.7-experimental-44b7a12
out/module-add/manifest-merger.js~
out/module-add/manifest-merger.jsModified+4−3
Index: package/out/module-add/manifest-merger.js
===================================================================
--- package/out/module-add/manifest-merger.js
+++ package/out/module-add/manifest-merger.js
@@ -1,9 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.planManifestChange = planManifestChange;
-exports.applyManifestChange = applyManifestChange;
-exports.substituteVars = substituteVars;
+exports.substituteVars = exports.applyManifestChange = exports.planManifestChange = void 0;
const tslib_1 = require("tslib");
const fs_1 = tslib_1.__importDefault(require("fs"));
const path_1 = tslib_1.__importDefault(require("path"));
const yaml_1 = tslib_1.__importDefault(require("yaml"));
@@ -40,17 +38,20 @@
}
const patch = (0, diff_1.createTwoFilesPatch)(manifestPath, manifestPath, before, after, 'before', 'after');
return { filePath: manifestPath, before, after, patch };
}
+exports.planManifestChange = planManifestChange;
function applyManifestChange(change) {
if (!change)
return false;
fs_1.default.writeFileSync(change.filePath, change.after, 'utf8');
return true;
}
+exports.applyManifestChange = applyManifestChange;
function substituteVars(input, vars) {
return input.replace(/\{\{\s*([a-zA-Z0-9_-]+)\s*\}\}/g, (_m, key) => vars[key] ?? '');
}
+exports.substituteVars = substituteVars;
function computeAutoKeys(existingManifest, variables, fragmentContent) {
const result = {};
const modules = isObject(existingManifest.modules) ? existingManifest.modules : {};
const functions = Array.isArray(modules.function) ? modules.function : [];