@spicemod/creator 0.0.24 → 0.0.26

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.
Files changed (2) hide show
  1. package/dist/bin.mjs +11 -8
  2. package/package.json +1 -1
package/dist/bin.mjs CHANGED
@@ -143,7 +143,7 @@ const customAppEntryFilePath = dist("templates/customAppEntry.js", import.meta.u
143
143
  //#endregion
144
144
  //#region package.json
145
145
  var name = "@spicemod/creator";
146
- var version = "0.0.24";
146
+ var version = "0.0.26";
147
147
 
148
148
  //#endregion
149
149
  //#region src/utils/common.ts
@@ -667,7 +667,7 @@ function resolveDefaultIcon(cwd) {
667
667
  cwd,
668
668
  absolute: true
669
669
  });
670
- if (matches.length > 0 && matches[0]) return readFileSync(matches[0]).toString();
670
+ if (matches.length > 0 && matches[0]) return matches[0];
671
671
  }
672
672
  const expectedFiles = ICON_GLOBS.map((g) => ` - ${g}`).join("\n");
673
673
  throw new Error(`No icon file found in your project.\nPlease create one of the following files:\n${expectedFiles}`);
@@ -678,7 +678,7 @@ function resolveActiveIcon(cwd) {
678
678
  cwd,
679
679
  absolute: true
680
680
  });
681
- if (matches.length > 0 && matches[0]) return readFileSync(matches[0]).toString();
681
+ if (matches.length > 0 && matches[0]) return matches[0];
682
682
  }
683
683
  return "";
684
684
  }
@@ -1073,14 +1073,15 @@ function wrapWithLoader({ config, cache, outFiles, server, dev = false, logger =
1073
1073
  });
1074
1074
  await Promise.all(transformPromises);
1075
1075
  if (type === "custom-app") {
1076
- const icon = config.icon;
1076
+ const icon = readFileSync(config.icon.default).toString();
1077
+ const activeIcon = config.icon.active ? readFileSync(config.icon.active).toString() : icon;
1077
1078
  const manifestPath = join(outdir, "manifest.json");
1078
1079
  const manifest = {
1079
1080
  name: config.name,
1080
1081
  subfiles: [],
1081
1082
  subfiles_extension: ["extension.js"],
1082
- icon: icon.default,
1083
- "active-icon": icon.active ?? ""
1083
+ icon,
1084
+ activeIcon
1084
1085
  };
1085
1086
  const manifestString = JSON.stringify(manifest, null, 2);
1086
1087
  const currentHash = createHash("md5").update(manifestString).digest("hex");
@@ -2135,13 +2136,15 @@ const render = () => {
2135
2136
  }
2136
2137
  });
2137
2138
  writeFileSync(extensionJsPath, extensionCode);
2139
+ const icon = readFileSync(config.icon.default).toString();
2140
+ const activeIcon = config.icon.active ? readFileSync(config.icon.active).toString() : icon;
2138
2141
  const manifestPath = resolve(destDir, "manifest.json");
2139
2142
  const manifest = {
2140
2143
  name: config.name,
2141
2144
  subfiles: [],
2142
2145
  subfiles_extension: [outFiles.jsExtension ?? "extension.js"],
2143
- icon: config.icon.default,
2144
- "active-icon": config.icon.active ?? config.icon.default
2146
+ icon,
2147
+ activeIcon
2145
2148
  };
2146
2149
  writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
2147
2150
  if (spiceConfig) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicemod/creator",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "Easily make Spicetify extensions and themes",
5
5
  "keywords": [
6
6
  "cli",