@spicetify/kit 0.4.2 → 0.4.3

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/create.js CHANGED
@@ -206,7 +206,7 @@ test("nowPlaying returns the track name, or a fallback when idle", () => {
206
206
  function writeThemeModule(dir, name, description, author, bare, cwd) {
207
207
  writeFileSync(path.join(dir, "metadata.json"), `${JSON.stringify({
208
208
  name,
209
- tags: ["theme"],
209
+ kind: "theme",
210
210
  version: "0.1.0",
211
211
  authors: [author],
212
212
  description,
@@ -315,13 +315,13 @@ export async function runCreate(argv, cwd = process.cwd()) {
315
315
  writeThemeModule(dir, name, description, author, bare, cwd);
316
316
  return;
317
317
  }
318
- const tag = template === "app" ? "app" : "extension";
318
+ const kind = template === "app" ? "app" : "extension";
319
319
  // Extensions are behavior-only; templates that render a page ship css.
320
320
  const hasCss = template !== "extension";
321
321
  const entries = hasCss ? { js: "index.js", css: "index.css" } : { js: "index.js" };
322
322
  writeFileSync(path.join(dir, "metadata.json"), `${JSON.stringify({
323
323
  name,
324
- tags: [tag],
324
+ kind,
325
325
  version: "0.1.0",
326
326
  authors: [author],
327
327
  description,
@@ -58,7 +58,7 @@ export async function runFromTheme(argv, cwd = process.cwd()) {
58
58
  }
59
59
  writeFileSync(path.join(dir, "metadata.json"), `${JSON.stringify({
60
60
  name,
61
- tags: ["theme"],
61
+ kind: "theme",
62
62
  version: "0.1.0",
63
63
  authors: [author],
64
64
  description: `${path.basename(themeDir)} theme, migrated from the classic format`,
package/dist/push.js CHANGED
@@ -234,9 +234,15 @@ export function push(rec, id, port) {
234
234
  // Refuse an oversized install before opening the socket (U7), so the failure
235
235
  // is a named cause here rather than an opaque client-side quota error.
236
236
  checkQuota(rec);
237
- // The whole exchange runs in the client: disable the old instance, install
238
- // the fresh content, and re-enable anything the unload cascade took down.
239
- const expr = `(async () => {
237
+ return evaluate(port, pushExpression(rec, id, nonce, stamped));
238
+ }
239
+ /**
240
+ * The expression push evaluates in the client: it installs the record, then
241
+ * re-enables anything the unload cascade took down, except other themes when
242
+ * the pushed module is one.
243
+ */
244
+ export function pushExpression(rec, id, nonce, stamped) {
245
+ return `(async () => {
240
246
  ${AWAIT_LOADER}
241
247
  if (!M) return JSON.stringify({ error: "loader not ready" });
242
248
  const rec = ${JSON.stringify(rec)};
@@ -251,8 +257,10 @@ export function push(rec, id, port) {
251
257
  if (reenabled) await (M.reload ?? M.enable)(id);
252
258
  // Re-enabling a theme the loader just unloaded would fight the
253
259
  // single-active-theme invariant and knock the pushed theme back off.
254
- const pushedIsTheme = (rec.metadata.tags ?? []).includes("theme");
255
- const isTheme = (mid) => ((M.manifest?.modules?.find((m) => m.identifier === mid)?.tags) ?? []).includes("theme");
260
+ // metadata.json says "kind"; modules published before it carry "tags".
261
+ const themed = (meta) => meta?.kind === "theme" || (meta?.tags ?? []).includes("theme");
262
+ const pushedIsTheme = themed(rec.metadata);
263
+ const isTheme = (mid) => themed(M.manifest?.modules?.find((m) => m.identifier === mid));
256
264
  for (const other of before) {
257
265
  if (pushedIsTheme && isTheme(other)) continue;
258
266
  const s = M.list().find((m) => m.identifier === other);
@@ -268,7 +276,6 @@ export function push(rec, id, port) {
268
276
  reenabled,
269
277
  });
270
278
  })()`;
271
- return evaluate(port, expr);
272
279
  }
273
280
  // removeLocal drops a hot-pushed override so the client falls back to the
274
281
  // staged or store-installed copy.
package/dist/version.js CHANGED
@@ -4,5 +4,5 @@
4
4
  */
5
5
  // Kept in lockstep with package.json by release-please. Scaffolds must depend
6
6
  // on the kit version that generated them, especially across pre-1.0 minors.
7
- export const KIT_VERSION = "0.4.2"; // x-release-please-version
7
+ export const KIT_VERSION = "0.4.3"; // x-release-please-version
8
8
  export const KIT_DEPENDENCY_RANGE = `^${KIT_VERSION}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicetify/kit",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Developer kit for spicetify v3 modules: scaffold, build, hot-push, and pack",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "homepage": "https://github.com/spicetify/modules#readme",
@@ -1,13 +1,31 @@
1
1
  {
2
+ "context_menu": {
3
+ "menu_item": "fmmygDM45MTS7I35OyLh"
4
+ },
2
5
  "main": {
6
+ "navbar": {
7
+ "link": {
8
+ "container": "xlH6FJnBzFT4l3TgUBre",
9
+ "container__active": "ajKYUZPcNmFVzcAzzlwe",
10
+ "wrapper": "xlH6FJnBzFT4l3TgUBre"
11
+ }
12
+ },
13
+ "playbar": {
14
+ "buttons": {
15
+ "button": {
16
+ "wrapper": "e-10860-legacy-button e-10860-button-tertiary--icon-only-small",
17
+ "wrapper__active": "e-10860-legacy-button e-10860-legacy-button-primary",
18
+ "wrapper__indicator": "e-10860-button-primary__inner"
19
+ }
20
+ }
21
+ },
3
22
  "topbar": {
4
- "wrapper": "bQetA_KiP9n0DQVcGa7m",
5
23
  "left": {
6
24
  "button": {
7
- "wrapper": "e-10860-legacy-button e-10860-button-tertiary--icon-only-medium",
8
25
  "icon": {
9
26
  "wrapper": "e-10860-icon e-10860-icon--auto-mirror"
10
- }
27
+ },
28
+ "wrapper": "e-10860-legacy-button e-10860-button-tertiary--icon-only-medium"
11
29
  },
12
30
  "button_t": {
13
31
  "wrapper": "e-10860-legacy-button e-10860-button-tertiary--icon-only-medium"
@@ -23,87 +41,64 @@
23
41
  "upgrade_button": {
24
42
  "wrapper": "e-10860-legacy-button e-10860-legacy-button-primary"
25
43
  }
26
- }
27
- },
28
- "playbar": {
29
- "widget": {},
30
- "controls": {},
31
- "buttons": {
32
- "button": {
33
- "wrapper": "e-10860-legacy-button e-10860-button-tertiary--icon-only-small",
34
- "wrapper__active": "e-10860-legacy-button e-10860-legacy-button-primary",
35
- "wrapper__indicator": "e-10860-button-primary__inner"
36
- }
37
- }
38
- },
39
- "navbar": {
40
- "link": {
41
- "wrapper": "xlH6FJnBzFT4l3TgUBre",
42
- "container": "xlH6FJnBzFT4l3TgUBre",
43
- "container__active": "ajKYUZPcNmFVzcAzzlwe"
44
- }
45
- },
46
- "global_navbar": {},
47
- "sidebar": {},
48
- "panel": {}
49
- },
50
- "tracklist": {
51
- "column_header": "e-10860-legacy-list-row__header"
52
- },
53
- "search_chips": {
54
- "wrapper_wrapper": "e-10860-chip-group",
55
- "wrapper": "e-10860-chip-group__component",
56
- "container": "e-10860-chip-group__component",
57
- "chip": "e-10860-legacy-chip"
44
+ },
45
+ "wrapper": "bQetA_KiP9n0DQVcGa7m"
46
+ }
58
47
  },
59
48
  "modal": {
49
+ "track_credits": {
50
+ "container": "gtXQasDkhtg93wGk6yNG",
51
+ "content": {
52
+ "container": "wYQNBdH2rNMGe_B4oumf"
53
+ },
54
+ "header": {
55
+ "close": "CaHvWv36mAu4x5QTKlb1",
56
+ "container": "nQ_c7yoZ2XOD6fWtmv18"
57
+ }
58
+ },
60
59
  "widget_generator": {
61
60
  "container": "_XeAt3IgtZQepOYqU2g4",
62
- "header": {
63
- "container": "mnU1hqlaF5JIcrTxLnZF",
64
- "close": "AslPcD0TRZBBGZofe58g"
65
- },
66
61
  "content": {
67
62
  "container": "Xu_Z4l6TIOF1f5kDB9dt"
68
- }
69
- },
70
- "track_credits": {
71
- "container": "gtXQasDkhtg93wGk6yNG",
72
- "header": {
73
- "container": "nQ_c7yoZ2XOD6fWtmv18",
74
- "close": "CaHvWv36mAu4x5QTKlb1"
75
63
  },
76
- "content": {
77
- "container": "wYQNBdH2rNMGe_B4oumf"
64
+ "header": {
65
+ "close": "AslPcD0TRZBBGZofe58g",
66
+ "container": "mnU1hqlaF5JIcrTxLnZF"
78
67
  }
79
68
  }
80
69
  },
70
+ "scrollable_text": {
71
+ "container": "e-10860-legacy-box e-10860-legacy-box--naked",
72
+ "wrapper": "e-10860-legacy-box"
73
+ },
74
+ "search_box": {
75
+ "container": "mlx0CgXAnGz0dADVsCdS",
76
+ "expand_button": "e-10860-legacy-button e-10860-button-tertiary--icon-only-medium aslJk0YypwKvyKXaBJcG"
77
+ },
78
+ "search_chips": {
79
+ "chip": "e-10860-legacy-chip",
80
+ "container": "e-10860-chip-group__component",
81
+ "wrapper": "e-10860-chip-group__component",
82
+ "wrapper_wrapper": "e-10860-chip-group"
83
+ },
81
84
  "settings": {
85
+ "button": {
86
+ "wrapper": "e-10860-legacy-button e-10860-legacy-button--small e-10860-legacy-button-secondary"
87
+ },
82
88
  "header": {
83
89
  "container": "Hwax_pfCzrntLhnYXiqL"
84
90
  },
85
91
  "section": {
86
92
  "container": "HdwEUcX8xijMdU7doYPt"
87
93
  },
88
- "button": {
89
- "wrapper": "e-10860-legacy-button e-10860-legacy-button--small e-10860-legacy-button-secondary"
90
- },
91
94
  "text_input": "e-10860-form-input e-10860-form-control encore-text-body-medium"
92
95
  },
93
- "scrollable_text": {
94
- "container": "e-10860-legacy-box e-10860-legacy-box--naked",
95
- "wrapper": "e-10860-legacy-box"
96
- },
97
96
  "sort_box": {
98
97
  "list": {
99
98
  "button": "MYWr4UY4pKAAscUXvqrB"
100
99
  }
101
100
  },
102
- "search_box": {
103
- "container": "mlx0CgXAnGz0dADVsCdS",
104
- "expand_button": "e-10860-legacy-button e-10860-button-tertiary--icon-only-medium aslJk0YypwKvyKXaBJcG"
105
- },
106
- "context_menu": {
107
- "menu_item": "fmmygDM45MTS7I35OyLh"
101
+ "tracklist": {
102
+ "column_header": "e-10860-legacy-list-row__header"
108
103
  }
109
104
  }