@forge/cli-shared

9.0.0-next.79.0.0-next.8
out/apps/template-module.js
~out/apps/template-module.jsModified
+9
Index: package/out/apps/template-module.js
===================================================================
--- package/out/apps/template-module.js
+++ package/out/apps/template-module.js
@@ -10,8 +10,9 @@
 const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
 const text_1 = require("../ui/text");
 const BIFROST_BASE_URL = 'https://forge-templates-bifrost.prod-east.frontend.public.atl-paas.net/assets/';
 const MODULE_INDEX_FILE = 'template-modules.json';
+const MODULE_SHOW_FILE = 'description.json';
 class BifrostFetchError extends Error {
     constructor(message) {
         super(message);
         this.name = 'BifrostFetchError';
@@ -39,8 +40,16 @@
             return this.templatesCache;
         }
         throw new BifrostFetchError(text_1.Text.module.errors.bifrostIndexInvalid);
     }
+    async fetchModuleShowMeta(moduleKey) {
+        const url = `${this.baseUrl}${moduleKey}/${MODULE_SHOW_FILE}`;
+        const res = await (0, node_fetch_1.default)(url);
+        if (!res.ok) {
+            throw new BifrostFetchError(text_1.Text.module.errors.bifrostIndexFetchFailed(res.status, res.statusText));
+        }
+        return (await res.json());
+    }
     async fetchManifestFragment(manifestPath) {
         const url = `${this.baseUrl}${manifestPath}`;
         const res = await (0, node_fetch_1.default)(url);
         if (!res.ok) {