@trops/dash-core 0.1.210 → 0.1.212
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 +30 -13
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +171 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +212 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -32138,29 +32138,33 @@ async function prepareThemeForPublish$1(win, appId, themeKey, options = {}) {
|
|
|
32138
32138
|
*/
|
|
32139
32139
|
async function installThemeFromRegistry$1(win, appId, packageName) {
|
|
32140
32140
|
try {
|
|
32141
|
-
|
|
32141
|
+
const TAG = "[ThemeInstall]";
|
|
32142
|
+
|
|
32143
|
+
// Stage 1: Package lookup
|
|
32144
|
+
console.log(`${TAG} [1/5 Package Lookup] input="${packageName}"`);
|
|
32142
32145
|
const pkg = await registryController$2.getPackage(packageName);
|
|
32143
32146
|
if (!pkg) {
|
|
32147
|
+
console.log(`${TAG} [1/5 Package Lookup] FAIL — package not found`);
|
|
32144
32148
|
return {
|
|
32145
32149
|
success: false,
|
|
32146
32150
|
error: `Theme package "${packageName}" not found in registry`,
|
|
32147
32151
|
};
|
|
32148
32152
|
}
|
|
32153
|
+
console.log(
|
|
32154
|
+
`${TAG} [1/5 Package Lookup] resolved scope="${pkg.scope}" name="${pkg.name}" version="${pkg.version || "1.0.0"}"`,
|
|
32155
|
+
);
|
|
32149
32156
|
|
|
32150
|
-
//
|
|
32157
|
+
// Stage 2: URL construction
|
|
32151
32158
|
const registryBaseUrl =
|
|
32152
32159
|
process.env.DASH_REGISTRY_API_URL ||
|
|
32153
32160
|
"https://main.d919rwhuzp7rj.amplifyapp.com";
|
|
32154
32161
|
const downloadUrl = `${registryBaseUrl}/api/packages/${encodeURIComponent(pkg.scope)}/${encodeURIComponent(pkg.name)}/download?version=${encodeURIComponent(pkg.version || "1.0.0")}`;
|
|
32162
|
+
console.log(`${TAG} [2/5 URL Construction] url="${downloadUrl}"`);
|
|
32155
32163
|
|
|
32156
|
-
|
|
32157
|
-
"[ThemeRegistryController] Downloading theme from:",
|
|
32158
|
-
downloadUrl,
|
|
32159
|
-
);
|
|
32160
|
-
|
|
32161
|
-
// Download the ZIP (with auth header)
|
|
32164
|
+
// Stage 3: Download
|
|
32162
32165
|
const auth = getStoredToken$1();
|
|
32163
32166
|
if (!auth) {
|
|
32167
|
+
console.log(`${TAG} [3/5 Download] FAIL — no stored auth token`);
|
|
32164
32168
|
return {
|
|
32165
32169
|
success: false,
|
|
32166
32170
|
error: "Not authenticated with registry",
|
|
@@ -32172,6 +32176,9 @@ async function installThemeFromRegistry$1(win, appId, packageName) {
|
|
|
32172
32176
|
headers["Authorization"] = `Bearer ${auth.token}`;
|
|
32173
32177
|
}
|
|
32174
32178
|
const response = await fetch(downloadUrl, { headers });
|
|
32179
|
+
console.log(
|
|
32180
|
+
`${TAG} [3/5 Download] status=${response.status} contentType="${response.headers.get("content-type") || "unknown"}"`,
|
|
32181
|
+
);
|
|
32175
32182
|
if (response.status === 401) {
|
|
32176
32183
|
clearToken$1();
|
|
32177
32184
|
return {
|
|
@@ -32189,16 +32196,23 @@ async function installThemeFromRegistry$1(win, appId, packageName) {
|
|
|
32189
32196
|
|
|
32190
32197
|
const arrayBuffer = await response.arrayBuffer();
|
|
32191
32198
|
const zipBuffer = Buffer.from(arrayBuffer);
|
|
32199
|
+
console.log(`${TAG} [3/5 Download] size=${zipBuffer.length} bytes`);
|
|
32192
32200
|
|
|
32193
|
-
//
|
|
32201
|
+
// Stage 4: ZIP extraction
|
|
32194
32202
|
const zip = new AdmZip$1(zipBuffer);
|
|
32195
32203
|
const entries = zip.getEntries();
|
|
32196
|
-
|
|
32204
|
+
const entryNames = entries.map((e) => e.entryName);
|
|
32197
32205
|
const themeEntry = entries.find((entry) =>
|
|
32198
32206
|
entry.entryName.endsWith(".theme.json"),
|
|
32199
32207
|
);
|
|
32208
|
+
console.log(
|
|
32209
|
+
`${TAG} [4/5 ZIP Extraction] files=[${entryNames.join(", ")}] hasThemeJson=${!!themeEntry}`,
|
|
32210
|
+
);
|
|
32200
32211
|
|
|
32201
32212
|
if (!themeEntry) {
|
|
32213
|
+
console.log(
|
|
32214
|
+
`${TAG} [4/5 ZIP Extraction] FAIL — no .theme.json in archive`,
|
|
32215
|
+
);
|
|
32202
32216
|
return {
|
|
32203
32217
|
success: false,
|
|
32204
32218
|
error: "ZIP does not contain a .theme.json file",
|
|
@@ -32232,10 +32246,12 @@ async function installThemeFromRegistry$1(win, appId, packageName) {
|
|
|
32232
32246
|
installedAt: new Date().toISOString(),
|
|
32233
32247
|
};
|
|
32234
32248
|
|
|
32235
|
-
//
|
|
32249
|
+
// Stage 5: Theme save
|
|
32236
32250
|
const themeKey = pkg.displayName || pkg.name;
|
|
32251
|
+
console.log(
|
|
32252
|
+
`${TAG} [5/5 Theme Save] themeKey="${themeKey}" hasName=${!!themeData.name} hasColors=${!!(themeData.colors || themeData.primary)}`,
|
|
32253
|
+
);
|
|
32237
32254
|
|
|
32238
|
-
// Save via themeController
|
|
32239
32255
|
const saveResult = themeController$4.saveThemeForApplication(
|
|
32240
32256
|
win,
|
|
32241
32257
|
appId,
|
|
@@ -32244,13 +32260,14 @@ async function installThemeFromRegistry$1(win, appId, packageName) {
|
|
|
32244
32260
|
);
|
|
32245
32261
|
|
|
32246
32262
|
if (saveResult.error) {
|
|
32263
|
+
console.log(`${TAG} [5/5 Theme Save] FAIL — ${saveResult.message}`);
|
|
32247
32264
|
return {
|
|
32248
32265
|
success: false,
|
|
32249
32266
|
error: "Failed to save theme: " + saveResult.message,
|
|
32250
32267
|
};
|
|
32251
32268
|
}
|
|
32252
32269
|
|
|
32253
|
-
console.log(
|
|
32270
|
+
console.log(`${TAG} [5/5 Theme Save] SUCCESS — installed "${themeKey}"`);
|
|
32254
32271
|
|
|
32255
32272
|
return {
|
|
32256
32273
|
success: true,
|