@spicemod/creator 0.0.21 → 0.0.23

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 (70) hide show
  1. package/client.d.ts +47 -0
  2. package/dist/bin.mjs +682 -242
  3. package/dist/index.d.mts +697 -0
  4. package/dist/{client/index.mjs → index.mjs} +1 -1
  5. package/dist/templates/custom-app/js/react/eslint.config.ts +29 -0
  6. package/dist/templates/custom-app/js/react/src/app.jsx +22 -0
  7. package/dist/templates/custom-app/js/react/src/components/Onboarding.jsx +82 -0
  8. package/dist/templates/custom-app/js/react/src/extension/index.jsx +23 -0
  9. package/dist/templates/custom-app/meta.json +4 -0
  10. package/dist/templates/custom-app/shared/DOT-gitignore +34 -0
  11. package/dist/templates/custom-app/shared/DOT-oxlintrc.json +36 -0
  12. package/dist/templates/custom-app/shared/README.template.md +53 -0
  13. package/dist/templates/custom-app/shared/app.css +163 -0
  14. package/dist/templates/custom-app/shared/biome.json +36 -0
  15. package/dist/templates/custom-app/shared/css/app.module.scss +58 -0
  16. package/dist/templates/custom-app/shared/icon-active.svg +7 -0
  17. package/dist/templates/custom-app/shared/icon.svg +7 -0
  18. package/dist/templates/custom-app/shared/jsconfig.json +32 -0
  19. package/dist/templates/custom-app/shared/spice.config.js +9 -0
  20. package/dist/templates/custom-app/shared/spice.config.ts +9 -0
  21. package/dist/templates/custom-app/shared/tsconfig.json +32 -0
  22. package/dist/templates/custom-app/ts/react/eslint.config.ts +29 -0
  23. package/dist/templates/custom-app/ts/react/src/app.tsx +23 -0
  24. package/dist/templates/custom-app/ts/react/src/components/Onboarding.tsx +105 -0
  25. package/dist/templates/custom-app/ts/react/src/extension/index.tsx +27 -0
  26. package/dist/templates/extension/js/vanilla/src/components/Onboarding.js +71 -0
  27. package/dist/templates/extension/shared/DOT-gitignore +34 -0
  28. package/dist/templates/extension/shared/DOT-oxlintrc.json +36 -0
  29. package/dist/templates/extension/shared/spice.config.js +1 -1
  30. package/dist/templates/extension/shared/spice.config.ts +1 -1
  31. package/dist/templates/liveReload.js +0 -1
  32. package/dist/templates/theme/shared/DOT-gitignore +34 -0
  33. package/dist/templates/theme/shared/DOT-oxlintrc.json +36 -0
  34. package/dist/templates/theme/shared/spice.config.js +1 -1
  35. package/dist/templates/theme/shared/spice.config.ts +1 -1
  36. package/dist/templates/wrapper.js +6 -9
  37. package/package.json +7 -3
  38. package/templates/custom-app/js/react/eslint.config.ts +29 -0
  39. package/templates/custom-app/js/react/src/app.jsx +22 -0
  40. package/templates/custom-app/js/react/src/components/Onboarding.jsx +82 -0
  41. package/templates/custom-app/js/react/src/extension/index.jsx +23 -0
  42. package/templates/custom-app/meta.json +4 -0
  43. package/templates/custom-app/shared/DOT-gitignore +34 -0
  44. package/templates/custom-app/shared/DOT-oxlintrc.json +36 -0
  45. package/templates/custom-app/shared/README.template.md +53 -0
  46. package/templates/custom-app/shared/app.css +163 -0
  47. package/templates/custom-app/shared/biome.json +36 -0
  48. package/templates/custom-app/shared/css/app.module.scss +58 -0
  49. package/templates/custom-app/shared/icon-active.svg +7 -0
  50. package/templates/custom-app/shared/icon.svg +7 -0
  51. package/templates/custom-app/shared/jsconfig.json +32 -0
  52. package/templates/custom-app/shared/spice.config.js +9 -0
  53. package/templates/custom-app/shared/spice.config.ts +9 -0
  54. package/templates/custom-app/shared/tsconfig.json +32 -0
  55. package/templates/custom-app/ts/react/eslint.config.ts +29 -0
  56. package/templates/custom-app/ts/react/src/app.tsx +23 -0
  57. package/templates/custom-app/ts/react/src/components/Onboarding.tsx +105 -0
  58. package/templates/custom-app/ts/react/src/extension/index.tsx +27 -0
  59. package/templates/extension/js/vanilla/src/components/Onboarding.js +71 -0
  60. package/templates/extension/shared/DOT-gitignore +34 -0
  61. package/templates/extension/shared/DOT-oxlintrc.json +36 -0
  62. package/templates/extension/shared/spice.config.js +1 -1
  63. package/templates/extension/shared/spice.config.ts +1 -1
  64. package/templates/liveReload.js +0 -1
  65. package/templates/theme/shared/DOT-gitignore +34 -0
  66. package/templates/theme/shared/DOT-oxlintrc.json +36 -0
  67. package/templates/theme/shared/spice.config.js +1 -1
  68. package/templates/theme/shared/spice.config.ts +1 -1
  69. package/templates/wrapper.js +6 -9
  70. package/dist/client/index.d.mts +0 -2183
@@ -0,0 +1,71 @@
1
+ export function initOnboarding(config) {
2
+ const overlay = document.createElement("div");
3
+ overlay.className = "onboarding-overlay";
4
+
5
+ overlay.innerHTML = `
6
+ <div class="onboarding-card">
7
+ <button class="close-icon-btn" aria-label="Close" id="close-x">
8
+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none">
9
+ <path d="M1 1L11 11M1 11L11 1" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
10
+ </svg>
11
+ </button>
12
+
13
+ <div>
14
+ <span class="status-dot"></span>
15
+ 🚀 ${config.projectName} Ready
16
+ </div>
17
+
18
+ <div class="config-grid">
19
+ <span class="label">Framework</span>
20
+ <span class="value">${config.framework}</span>
21
+
22
+ <span class="label">Language</span>
23
+ <span class="value">${config.language}</span>
24
+
25
+ <span class="label">Manager</span>
26
+ <span class="value">${config.packageManager}</span>
27
+
28
+ <span class="label">Linter</span>
29
+ <span class="value">${config.linter}</span>
30
+ </div>
31
+
32
+ <div class="footer-tip">
33
+ Next Step: Edit <code>src/app.tsx</code>
34
+ </div>
35
+ <div class="onboarding-actions">
36
+ <button class="dismiss-btn" id="dismiss-btn">Dismiss</button>
37
+ <button class="discord-btn" id="discord-btn">Join Discord</button>
38
+ <button class="get-started-btn" id="get-started-btn">Get Started</button>
39
+ </div>
40
+ </div>
41
+ `;
42
+
43
+ const dismiss = () => {
44
+ overlay.classList.add("fade-out");
45
+ overlay.addEventListener("transitionend", () => overlay.remove(), {
46
+ once: true,
47
+ });
48
+ };
49
+
50
+ overlay.addEventListener("click", (e) => {
51
+ if (e.target === overlay) dismiss();
52
+ });
53
+
54
+ function openLink(url, newTab = true) {
55
+ if (!url) return;
56
+ if (newTab) {
57
+ window.open(url, "_blank", "noopener,noreferrer");
58
+ } else {
59
+ window.location.href = url;
60
+ }
61
+ }
62
+
63
+ const getStarted = () => openLink("{{get-started-link}}");
64
+ const openDiscord = () => openLink("{{discord-link}}");
65
+ overlay.querySelector("#close-x")?.addEventListener("click", dismiss);
66
+ overlay.querySelector("#dismiss-btn")?.addEventListener("click", dismiss);
67
+ overlay.querySelector("#discord-btn")?.addEventListener("click", openDiscord);
68
+ overlay.querySelector("#get-started-btn")?.addEventListener("click", getStarted);
69
+
70
+ document.body.prepend(overlay);
71
+ }
@@ -0,0 +1,34 @@
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ # dependencies
4
+ /node_modules
5
+ /.pnp
6
+ .pnp.*
7
+ .yarn/*
8
+ !.yarn/patches
9
+ !.yarn/plugins
10
+ !.yarn/releases
11
+ !.yarn/versions
12
+
13
+ # testing
14
+ /coverage
15
+
16
+ # build files
17
+ /dist
18
+
19
+ # production
20
+ /build
21
+ .spicetify/
22
+
23
+ # misc
24
+ .DS_Store
25
+ *.pem
26
+
27
+ # debug
28
+ npm-debug.log*
29
+ yarn-debug.log*
30
+ yarn-error.log*
31
+ .pnpm-debug.log*
32
+
33
+ # typescript
34
+ *.tsbuildinfo
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "plugins": null,
4
+ "categories": {},
5
+ "rules": {
6
+ "no-await-in-loop": "error",
7
+ "unicorn/prefer-array-find": "error",
8
+ "unicorn/prefer-array-flat-map": "error",
9
+ "unicorn/prefer-set-has": "error"
10
+ },
11
+ "settings": {
12
+ "jsx-a11y": {
13
+ "polymorphicPropName": null,
14
+ "components": {},
15
+ "attributes": {}
16
+ },
17
+ "react": {
18
+ "formComponents": [],
19
+ "linkComponents": [],
20
+ "version": null,
21
+ "componentWrapperFunctions": []
22
+ },
23
+ "jsdoc": {
24
+ "ignorePrivate": false,
25
+ "ignoreInternal": false,
26
+ "ignoreReplacesDocs": true,
27
+ "overrideReplacesDocs": true,
28
+ "augmentsExtendsReplacesDocs": false,
29
+ "implementsReplacesDocs": false,
30
+ "exemptDestructuredRootsFromChecks": false,
31
+ "tagNamePreference": {}
32
+ }
33
+ },
34
+ "globals": {},
35
+ "ignorePatterns": ["dist/**"]
36
+ }
@@ -1,4 +1,4 @@
1
- import { defineConfig } from "@spicetify/creator/client";
1
+ import { defineConfig } from "@spicetify/creator";
2
2
 
3
3
  // Learn more: {{config-reference-link}}
4
4
  export default defineConfig({
@@ -1,4 +1,4 @@
1
- import { defineConfig } from "@spicetify/creator/client";
1
+ import { defineConfig } from "@spicetify/creator";
2
2
 
3
3
  // Learn more: {{config-reference-link}}
4
4
  export default defineConfig({
@@ -63,7 +63,6 @@
63
63
  const script = document.createElement("script");
64
64
  script.id = JS_ID;
65
65
  script.src = SERVER + JS_PATH;
66
- script.type = "module";
67
66
  document.body.appendChild(script);
68
67
 
69
68
  connect();
@@ -0,0 +1,34 @@
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ # dependencies
4
+ /node_modules
5
+ /.pnp
6
+ .pnp.*
7
+ .yarn/*
8
+ !.yarn/patches
9
+ !.yarn/plugins
10
+ !.yarn/releases
11
+ !.yarn/versions
12
+
13
+ # testing
14
+ /coverage
15
+
16
+ # build files
17
+ /dist
18
+
19
+ # production
20
+ /build
21
+ .spicetify/
22
+
23
+ # misc
24
+ .DS_Store
25
+ *.pem
26
+
27
+ # debug
28
+ npm-debug.log*
29
+ yarn-debug.log*
30
+ yarn-error.log*
31
+ .pnpm-debug.log*
32
+
33
+ # typescript
34
+ *.tsbuildinfo
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "plugins": null,
4
+ "categories": {},
5
+ "rules": {
6
+ "no-await-in-loop": "error",
7
+ "unicorn/prefer-array-find": "error",
8
+ "unicorn/prefer-array-flat-map": "error",
9
+ "unicorn/prefer-set-has": "error"
10
+ },
11
+ "settings": {
12
+ "jsx-a11y": {
13
+ "polymorphicPropName": null,
14
+ "components": {},
15
+ "attributes": {}
16
+ },
17
+ "react": {
18
+ "formComponents": [],
19
+ "linkComponents": [],
20
+ "version": null,
21
+ "componentWrapperFunctions": []
22
+ },
23
+ "jsdoc": {
24
+ "ignorePrivate": false,
25
+ "ignoreInternal": false,
26
+ "ignoreReplacesDocs": true,
27
+ "overrideReplacesDocs": true,
28
+ "augmentsExtendsReplacesDocs": false,
29
+ "implementsReplacesDocs": false,
30
+ "exemptDestructuredRootsFromChecks": false,
31
+ "tagNamePreference": {}
32
+ }
33
+ },
34
+ "globals": {},
35
+ "ignorePatterns": ["dist/**"]
36
+ }
@@ -1,4 +1,4 @@
1
- import { defineConfig } from "@spicetify/creator/client";
1
+ import { defineConfig } from "@spicetify/creator";
2
2
 
3
3
  // Learn more: {{config-reference-link}}
4
4
  export default defineConfig({
@@ -1,4 +1,4 @@
1
- import { defineConfig } from "@spicetify/creator/client";
1
+ import { defineConfig } from "@spicetify/creator";
2
2
 
3
3
  // Learn more: {{config-reference-link}}
4
4
  export default defineConfig({
@@ -1,14 +1,12 @@
1
1
  __ESBUILD__HAS_CSS &&
2
2
  (async () => {
3
3
  try {
4
- const css = `{{INJECTED_CSS_HERE}}`;
5
- if (css && css.trim().length !== 0) {
6
- const style = document.createElement("style");
7
- style.setAttribute("data-app", __ESBUILD__APP_ID);
8
- style.textContent = css;
9
- document.head.appendChild(style);
10
- }
11
- } catch {}
4
+ const css = __ESBUILD__INJECTED_CSS;
5
+ const style = document.createElement("style");
6
+ style.setAttribute("data-app", __ESBUILD__APP_ID);
7
+ style.textContent = css;
8
+ document.head.appendChild(style);
9
+ } catch { }
12
10
  })();
13
11
  (async () => {
14
12
  const _ID = `${__ESBUILD__APP_SLUG}-${__ESBUILD__APP_TYPE}`;
@@ -16,7 +14,6 @@ __ESBUILD__HAS_CSS &&
16
14
  window.SpiceGlobals[_ID] = {
17
15
  id: __ESBUILD__APP_ID,
18
16
  version: __ESBUILD__APP_VERSION,
19
- hash: __ESBUILD__APP_HASH,
20
17
  };
21
18
  const { id: appId, version: v } = window.SpiceGlobals[_ID];
22
19
  const _wait = (p, a = 0) =>