@trops/dash-core 0.1.134 → 0.1.136
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/electron/index.js +22 -10
- package/dist/electron/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -8687,9 +8687,7 @@ function generateRegistryManifest(dashboardConfig, options = {}) {
|
|
|
8687
8687
|
.toLowerCase();
|
|
8688
8688
|
|
|
8689
8689
|
const githubUser = options.githubUser || "";
|
|
8690
|
-
const version =
|
|
8691
|
-
? `1.0.${dashboardConfig.workspace.version}`
|
|
8692
|
-
: "1.0.0";
|
|
8690
|
+
const version = "1.0.0";
|
|
8693
8691
|
|
|
8694
8692
|
const manifest = {
|
|
8695
8693
|
githubUser,
|
|
@@ -10758,13 +10756,14 @@ function sanitizeName(name) {
|
|
|
10758
10756
|
* @returns {Object} Registry manifest
|
|
10759
10757
|
*/
|
|
10760
10758
|
function generateThemeRegistryManifest(themeData, themeKey, options = {}) {
|
|
10761
|
-
const
|
|
10759
|
+
const humanName = themeData.name || themeKey;
|
|
10760
|
+
const sanitizedName = sanitizeName(humanName);
|
|
10762
10761
|
const colors = extractColors(themeData);
|
|
10763
10762
|
|
|
10764
10763
|
return {
|
|
10765
10764
|
scope: options.scope || "",
|
|
10766
10765
|
name: sanitizedName,
|
|
10767
|
-
displayName:
|
|
10766
|
+
displayName: humanName,
|
|
10768
10767
|
author: options.authorName || "",
|
|
10769
10768
|
description: options.description || "",
|
|
10770
10769
|
version: "1.0.0",
|
|
@@ -12052,14 +12051,27 @@ async function prepareDashboardForPublish$1(
|
|
|
12052
12051
|
);
|
|
12053
12052
|
}
|
|
12054
12053
|
|
|
12055
|
-
// 7.
|
|
12054
|
+
// 7. Resolve registry username for scope
|
|
12055
|
+
let registryUsername = options.githubUser || "";
|
|
12056
|
+
if (!registryUsername) {
|
|
12057
|
+
try {
|
|
12058
|
+
const { getRegistryProfile } = registryAuthController$1;
|
|
12059
|
+
const profile = await getRegistryProfile();
|
|
12060
|
+
registryUsername = profile?.username || options.authorId || "";
|
|
12061
|
+
} catch {
|
|
12062
|
+
registryUsername = options.authorId || "";
|
|
12063
|
+
}
|
|
12064
|
+
}
|
|
12065
|
+
|
|
12066
|
+
// 8. Generate registry manifest
|
|
12056
12067
|
const manifest = generateRegistryManifest(dashboardConfig, {
|
|
12057
|
-
githubUser:
|
|
12068
|
+
githubUser: registryUsername,
|
|
12058
12069
|
category: options.category || "general",
|
|
12059
12070
|
repository: options.repository || "",
|
|
12071
|
+
appOrigin: appId,
|
|
12060
12072
|
});
|
|
12061
12073
|
|
|
12062
|
-
//
|
|
12074
|
+
// 9. Show save dialog for the publish package
|
|
12063
12075
|
const sanitizedName = manifest.name;
|
|
12064
12076
|
const { canceled, filePath } = await dialog.showSaveDialog(win, {
|
|
12065
12077
|
title: "Save Dashboard Package for Registry",
|
|
@@ -12074,7 +12086,7 @@ async function prepareDashboardForPublish$1(
|
|
|
12074
12086
|
return { success: false, canceled: true };
|
|
12075
12087
|
}
|
|
12076
12088
|
|
|
12077
|
-
//
|
|
12089
|
+
// 10. Create ZIP with manifest and dashboard config
|
|
12078
12090
|
const zip = new AdmZip();
|
|
12079
12091
|
zip.addFile(
|
|
12080
12092
|
"manifest.json",
|
|
@@ -12090,7 +12102,7 @@ async function prepareDashboardForPublish$1(
|
|
|
12090
12102
|
`[DashboardConfigController] Prepared publish package: ${filePath}`,
|
|
12091
12103
|
);
|
|
12092
12104
|
|
|
12093
|
-
//
|
|
12105
|
+
// 11. Attempt to publish to registry if authenticated
|
|
12094
12106
|
let registrySubmission = null;
|
|
12095
12107
|
try {
|
|
12096
12108
|
const { getAuthStatus } = registryAuthController$1;
|