@spicemod/creator 0.0.22 → 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.
- package/client.d.ts +47 -0
- package/dist/bin.mjs +684 -245
- package/dist/index.d.mts +697 -0
- package/dist/{client/index.mjs → index.mjs} +1 -1
- package/dist/templates/custom-app/js/react/eslint.config.ts +29 -0
- package/dist/templates/custom-app/js/react/src/app.jsx +22 -0
- package/dist/templates/custom-app/js/react/src/components/Onboarding.jsx +82 -0
- package/dist/templates/custom-app/js/react/src/extension/index.jsx +23 -0
- package/dist/templates/custom-app/meta.json +4 -0
- package/dist/templates/custom-app/shared/DOT-gitignore +34 -0
- package/dist/templates/custom-app/shared/DOT-oxlintrc.json +36 -0
- package/dist/templates/custom-app/shared/README.template.md +53 -0
- package/dist/templates/custom-app/shared/app.css +163 -0
- package/dist/templates/custom-app/shared/biome.json +36 -0
- package/dist/templates/custom-app/shared/css/app.module.scss +58 -0
- package/dist/templates/custom-app/shared/icon-active.svg +7 -0
- package/dist/templates/custom-app/shared/icon.svg +7 -0
- package/dist/templates/custom-app/shared/jsconfig.json +32 -0
- package/dist/templates/custom-app/shared/spice.config.js +9 -0
- package/dist/templates/custom-app/shared/spice.config.ts +9 -0
- package/dist/templates/custom-app/shared/tsconfig.json +32 -0
- package/dist/templates/custom-app/ts/react/eslint.config.ts +29 -0
- package/dist/templates/custom-app/ts/react/src/app.tsx +23 -0
- package/dist/templates/custom-app/ts/react/src/components/Onboarding.tsx +105 -0
- package/dist/templates/custom-app/ts/react/src/extension/index.tsx +27 -0
- package/dist/templates/extension/js/vanilla/src/components/Onboarding.js +71 -0
- package/dist/templates/extension/shared/DOT-gitignore +34 -0
- package/dist/templates/extension/shared/DOT-oxlintrc.json +36 -0
- package/dist/templates/extension/shared/spice.config.js +1 -1
- package/dist/templates/extension/shared/spice.config.ts +1 -1
- package/dist/templates/liveReload.js +0 -1
- package/dist/templates/theme/shared/DOT-gitignore +34 -0
- package/dist/templates/theme/shared/DOT-oxlintrc.json +36 -0
- package/dist/templates/theme/shared/spice.config.js +1 -1
- package/dist/templates/theme/shared/spice.config.ts +1 -1
- package/dist/templates/wrapper.js +6 -9
- package/package.json +7 -3
- package/templates/custom-app/js/react/eslint.config.ts +29 -0
- package/templates/custom-app/js/react/src/app.jsx +22 -0
- package/templates/custom-app/js/react/src/components/Onboarding.jsx +82 -0
- package/templates/custom-app/js/react/src/extension/index.jsx +23 -0
- package/templates/custom-app/meta.json +4 -0
- package/templates/custom-app/shared/DOT-gitignore +34 -0
- package/templates/custom-app/shared/DOT-oxlintrc.json +36 -0
- package/templates/custom-app/shared/README.template.md +53 -0
- package/templates/custom-app/shared/app.css +163 -0
- package/templates/custom-app/shared/biome.json +36 -0
- package/templates/custom-app/shared/css/app.module.scss +58 -0
- package/templates/custom-app/shared/icon-active.svg +7 -0
- package/templates/custom-app/shared/icon.svg +7 -0
- package/templates/custom-app/shared/jsconfig.json +32 -0
- package/templates/custom-app/shared/spice.config.js +9 -0
- package/templates/custom-app/shared/spice.config.ts +9 -0
- package/templates/custom-app/shared/tsconfig.json +32 -0
- package/templates/custom-app/ts/react/eslint.config.ts +29 -0
- package/templates/custom-app/ts/react/src/app.tsx +23 -0
- package/templates/custom-app/ts/react/src/components/Onboarding.tsx +105 -0
- package/templates/custom-app/ts/react/src/extension/index.tsx +27 -0
- package/templates/extension/js/vanilla/src/components/Onboarding.js +71 -0
- package/templates/extension/shared/DOT-gitignore +34 -0
- package/templates/extension/shared/DOT-oxlintrc.json +36 -0
- package/templates/extension/shared/spice.config.js +1 -1
- package/templates/extension/shared/spice.config.ts +1 -1
- package/templates/liveReload.js +0 -1
- package/templates/theme/shared/DOT-gitignore +34 -0
- package/templates/theme/shared/DOT-oxlintrc.json +36 -0
- package/templates/theme/shared/spice.config.js +1 -1
- package/templates/theme/shared/spice.config.ts +1 -1
- package/templates/wrapper.js +6 -9
- 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
|
+
}
|
package/templates/liveReload.js
CHANGED
|
@@ -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
|
+
}
|
package/templates/wrapper.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
__ESBUILD__HAS_CSS &&
|
|
2
2
|
(async () => {
|
|
3
3
|
try {
|
|
4
|
-
const css =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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) =>
|