sdocs 0.0.29 → 0.0.31
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/CHANGELOG.md +21 -0
- package/dist/client/App.svelte +3 -1
- package/dist/client/views/Sidebar.svelte +12 -2
- package/dist/commands/dev.js +8 -1
- package/dist/commands/init.js +3 -0
- package/dist/server/app-gen.js +1 -0
- package/dist/server/config.js +2 -0
- package/dist/types.d.ts +3 -0
- package/package.json +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.0.31] - 2026-07-03
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`icon` config option** — the sidebar header icon is now configurable:
|
|
15
|
+
`'sdocs'` shows the built-in mascot (the default), any other string is
|
|
16
|
+
used as an image URL, and `false` hides it.
|
|
17
|
+
|
|
18
|
+
## [0.0.30] - 2026-07-03
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- The `sdocs dev`/`run` explorer UI rendered unstyled since 0.0.28: with the
|
|
23
|
+
staging directory under `node_modules`, the Svelte plugin doesn't serve
|
|
24
|
+
virtual CSS modules for the client's components. Styles are now compiled
|
|
25
|
+
into the components in dev. (Static builds were unaffected.)
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- The package exports `./package.json`.
|
|
30
|
+
|
|
10
31
|
## [0.0.29] - 2026-07-03
|
|
11
32
|
|
|
12
33
|
### Fixed
|
package/dist/client/App.svelte
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
interface Props {
|
|
16
16
|
docs: DocEntry[];
|
|
17
17
|
logo?: string;
|
|
18
|
+
icon?: string | false;
|
|
18
19
|
cssNames?: string[];
|
|
19
20
|
sidebarConfig?: {
|
|
20
21
|
order?: Record<string, string[]>;
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
let { docs, logo = 'sdocs', cssNames = [], sidebarConfig }: Props = $props();
|
|
26
|
+
let { docs, logo = 'sdocs', icon = 'sdocs', cssNames = [], sidebarConfig }: Props = $props();
|
|
26
27
|
|
|
27
28
|
let sidebarHidden = $state(false);
|
|
28
29
|
let activeStylesheet = $state<string | undefined>(undefined);
|
|
@@ -62,6 +63,7 @@
|
|
|
62
63
|
{tree}
|
|
63
64
|
{currentPath}
|
|
64
65
|
{logo}
|
|
66
|
+
{icon}
|
|
65
67
|
{cssNames}
|
|
66
68
|
{activeStylesheet}
|
|
67
69
|
{theme}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
tree: TreeNode[];
|
|
12
12
|
currentPath: string[];
|
|
13
13
|
logo: string;
|
|
14
|
+
icon?: string | false;
|
|
14
15
|
cssNames?: string[];
|
|
15
16
|
activeStylesheet?: string;
|
|
16
17
|
theme?: ThemeMode;
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
onThemeChange?: (theme: ThemeMode) => void;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
let { tree, currentPath, logo, cssNames = [], activeStylesheet, theme = 'light', onToggleFullscreen, onStylesheetChange, onThemeChange }: Props = $props();
|
|
23
|
+
let { tree, currentPath, logo, icon = 'sdocs', cssNames = [], activeStylesheet, theme = 'light', onToggleFullscreen, onStylesheetChange, onThemeChange }: Props = $props();
|
|
23
24
|
|
|
24
25
|
const themeIcons: Record<ThemeMode, string> = { light: '\u2600', dark: '\u263D' };
|
|
25
26
|
const themeLabels: Record<ThemeMode, string> = { light: 'Light', dark: 'Dark' };
|
|
@@ -185,7 +186,11 @@
|
|
|
185
186
|
<aside class="sdocs-sidebar">
|
|
186
187
|
<div class="sdocs-sidebar-header">
|
|
187
188
|
<a href="#/" class="sdocs-logo">
|
|
188
|
-
|
|
189
|
+
{#if icon === 'sdocs'}
|
|
190
|
+
<Icon name="sdocs" --w="22px" --h="22px" --fill="#FC1D29" />
|
|
191
|
+
{:else if icon}
|
|
192
|
+
<img class="sdocs-logo-img" src={icon} alt="" />
|
|
193
|
+
{/if}
|
|
189
194
|
{logo}
|
|
190
195
|
</a>
|
|
191
196
|
<div class="sdocs-header-actions">
|
|
@@ -304,6 +309,11 @@
|
|
|
304
309
|
color: var(--color-base-900);
|
|
305
310
|
text-decoration: none;
|
|
306
311
|
}
|
|
312
|
+
.sdocs-logo-img {
|
|
313
|
+
width: 22px;
|
|
314
|
+
height: 22px;
|
|
315
|
+
object-fit: contain;
|
|
316
|
+
}
|
|
307
317
|
.sdocs-header-actions {
|
|
308
318
|
display: flex;
|
|
309
319
|
align-items: center;
|
package/dist/commands/dev.js
CHANGED
|
@@ -49,7 +49,14 @@ export async function devCommand() {
|
|
|
49
49
|
include: ['svelte'],
|
|
50
50
|
},
|
|
51
51
|
plugins: [
|
|
52
|
-
svelte(
|
|
52
|
+
svelte({
|
|
53
|
+
compilerOptions: {
|
|
54
|
+
// The staging dir lives under node_modules (see createStagingDir),
|
|
55
|
+
// where vite-plugin-svelte doesn't serve virtual CSS modules for
|
|
56
|
+
// components; inject styles into the JS instead.
|
|
57
|
+
css: 'injected',
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
53
60
|
sdocsPlugin({ ...config, include: absoluteIncludes }),
|
|
54
61
|
],
|
|
55
62
|
server: {
|
package/dist/commands/init.js
CHANGED
|
@@ -21,6 +21,9 @@ export default {
|
|
|
21
21
|
// Sidebar logo text (default: 'sdocs')
|
|
22
22
|
// logo: 'sdocs',
|
|
23
23
|
|
|
24
|
+
// Sidebar logo icon: 'sdocs' for the mascot, an image URL, or false to hide (default: 'sdocs')
|
|
25
|
+
// icon: 'sdocs',
|
|
26
|
+
|
|
24
27
|
// Sidebar configuration
|
|
25
28
|
// sidebar: {
|
|
26
29
|
// order: { root: ['Components', '*', 'Documentation'] },
|
package/dist/server/app-gen.js
CHANGED
package/dist/server/config.js
CHANGED
|
@@ -8,6 +8,7 @@ const DEFAULTS = {
|
|
|
8
8
|
open: false,
|
|
9
9
|
css: null,
|
|
10
10
|
logo: 'sdocs',
|
|
11
|
+
icon: 'sdocs',
|
|
11
12
|
sidebar: {
|
|
12
13
|
order: {},
|
|
13
14
|
open: [],
|
|
@@ -77,6 +78,7 @@ export function resolveConfig(userConfig) {
|
|
|
77
78
|
open: userConfig.open ?? DEFAULTS.open,
|
|
78
79
|
css: userConfig.css ?? DEFAULTS.css,
|
|
79
80
|
logo: userConfig.logo ?? DEFAULTS.logo,
|
|
81
|
+
icon: userConfig.icon ?? DEFAULTS.icon,
|
|
80
82
|
sidebar: {
|
|
81
83
|
order: userConfig.sidebar?.order ?? DEFAULTS.sidebar.order,
|
|
82
84
|
open: userConfig.sidebar?.open ?? DEFAULTS.sidebar.open,
|
package/dist/types.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface SdocsConfig {
|
|
|
10
10
|
css?: string | Record<string, string>;
|
|
11
11
|
/** Sidebar logo text. Default: 'sdocs' */
|
|
12
12
|
logo?: string;
|
|
13
|
+
/** Sidebar logo icon: 'sdocs' for the built-in mascot, an image URL, or false to hide. Default: 'sdocs' */
|
|
14
|
+
icon?: string | false;
|
|
13
15
|
/** Sidebar configuration */
|
|
14
16
|
sidebar?: {
|
|
15
17
|
/** Per-folder sort overrides. Keys are folder paths, 'root' for top level. '*' = unlisted items. */
|
|
@@ -25,6 +27,7 @@ export interface ResolvedSdocsConfig {
|
|
|
25
27
|
open: boolean;
|
|
26
28
|
css: string | Record<string, string> | null;
|
|
27
29
|
logo: string;
|
|
30
|
+
icon: string | false;
|
|
28
31
|
sidebar: {
|
|
29
32
|
order: Record<string, string[]>;
|
|
30
33
|
open: string[];
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sdocs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"description": "A lightweight documentation tool for Svelte 5 components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/gabilungu/sdocs.git",
|
|
10
|
+
"directory": "packages/sdocs"
|
|
11
|
+
},
|
|
7
12
|
"bin": {
|
|
8
13
|
"sdocs": "./bin/sdocs.js"
|
|
9
14
|
},
|
|
@@ -22,7 +27,8 @@
|
|
|
22
27
|
"./ui": {
|
|
23
28
|
"types": "./dist/ui/index.d.ts",
|
|
24
29
|
"svelte": "./dist/ui/index.js"
|
|
25
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"./package.json": "./package.json"
|
|
26
32
|
},
|
|
27
33
|
"files": [
|
|
28
34
|
"dist",
|