@fluid-app/fluid-cli-theme-dev 0.1.526 → 0.1.528
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/dist/index.mjs +24 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -13288,11 +13288,14 @@ function describeStaging(status) {
|
|
|
13288
13288
|
* branch planner refuses by design are left out and reported, never sent.
|
|
13289
13289
|
* Files deleted locally stay on staging: a manifest changes only the paths
|
|
13290
13290
|
* it names.
|
|
13291
|
+
*
|
|
13292
|
+
* `members_sites.json` goes with the files, so staging gets the theme's
|
|
13293
|
+
* member sites, pages and menus along with their templates; the server
|
|
13294
|
+
* imports it with the files it names, as a push does.
|
|
13291
13295
|
*/
|
|
13292
13296
|
const MAX_ENTRIES = 5e3;
|
|
13293
13297
|
/** Why the branch planner refuses this path, or null when it accepts it. */
|
|
13294
13298
|
function unpublishableReason(path) {
|
|
13295
|
-
if (path === "members_sites.json") return "member configuration is not published to branches yet";
|
|
13296
13299
|
if (isRetiredTemplateKey(path)) return "account and member pages are not theme files";
|
|
13297
13300
|
if (/~\d+(\/|$)/.test(path)) return "numbered duplicate template; rename it first";
|
|
13298
13301
|
if (/^[^/]+\/.+\/assets\//.test(path)) return "files attached to a template are not published to branches yet";
|
|
@@ -13316,7 +13319,7 @@ function planPublication(root) {
|
|
|
13316
13319
|
});
|
|
13317
13320
|
continue;
|
|
13318
13321
|
}
|
|
13319
|
-
const bytes = file.isText ? Buffer.from(file
|
|
13322
|
+
const bytes = file.isText ? Buffer.from(publishedText(file), "utf-8") : file.readBinary();
|
|
13320
13323
|
const sha256 = createHash("sha256").update(bytes).digest("hex");
|
|
13321
13324
|
entries.push({
|
|
13322
13325
|
path,
|
|
@@ -13332,6 +13335,25 @@ function planPublication(root) {
|
|
|
13332
13335
|
skipped
|
|
13333
13336
|
};
|
|
13334
13337
|
}
|
|
13338
|
+
/**
|
|
13339
|
+
* The text staging receives for a file. Account and member pages are not
|
|
13340
|
+
* published, and the server refuses a member configuration that still
|
|
13341
|
+
* names one, which would hold back every site and menu it carries; so those
|
|
13342
|
+
* references are left out of what is sent. The local file is not changed.
|
|
13343
|
+
*/
|
|
13344
|
+
function publishedText(file) {
|
|
13345
|
+
const text = file.read();
|
|
13346
|
+
if (file.relativePath !== "members_sites.json") return text;
|
|
13347
|
+
let parsed;
|
|
13348
|
+
try {
|
|
13349
|
+
parsed = JSON.parse(text);
|
|
13350
|
+
} catch {
|
|
13351
|
+
return text;
|
|
13352
|
+
}
|
|
13353
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return text;
|
|
13354
|
+
const { document, removed } = withoutRetiredTemplates(parsed);
|
|
13355
|
+
return removed.length > 0 ? `${JSON.stringify(document, null, 2)}\n` : text;
|
|
13356
|
+
}
|
|
13335
13357
|
async function publishToStaging(api, themeId, root, onProgress = () => {}) {
|
|
13336
13358
|
const branch = (await readStagingStatus(api, themeId)).branch;
|
|
13337
13359
|
if (branch?.state !== "ready") throw new Error("Staging is not ready. Run `fluid theme staging request` and wait for it first.");
|