sdocs 0.0.31 → 0.0.32
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 +9 -0
- package/README.md +3 -3
- package/dist/commands/dev.js +1 -1
- package/dist/explorer/Explorer.svelte.d.ts +15 -0
- package/dist/server/app-gen.js +16 -16
- package/dist/server/cli.js +2 -2
- package/package.json +3 -3
- package/dist/client/App.svelte.d.ts +0 -15
- /package/dist/{client/App.svelte → explorer/Explorer.svelte} +0 -0
- /package/dist/{client → explorer}/favicon.png +0 -0
- /package/dist/{client → explorer}/router.svelte.d.ts +0 -0
- /package/dist/{client → explorer}/router.svelte.js +0 -0
- /package/dist/{client → explorer}/tree-builder.d.ts +0 -0
- /package/dist/{client → explorer}/tree-builder.js +0 -0
- /package/dist/{client → explorer}/views/CollapsiblePanel.svelte +0 -0
- /package/dist/{client → explorer}/views/CollapsiblePanel.svelte.d.ts +0 -0
- /package/dist/{client → explorer}/views/ComponentView.svelte +0 -0
- /package/dist/{client → explorer}/views/ComponentView.svelte.d.ts +0 -0
- /package/dist/{client → explorer}/views/ControlsPanel.svelte +0 -0
- /package/dist/{client → explorer}/views/ControlsPanel.svelte.d.ts +0 -0
- /package/dist/{client → explorer}/views/DataTable.svelte +0 -0
- /package/dist/{client → explorer}/views/DataTable.svelte.d.ts +0 -0
- /package/dist/{client → explorer}/views/HomePage.svelte +0 -0
- /package/dist/{client → explorer}/views/HomePage.svelte.d.ts +0 -0
- /package/dist/{client → explorer}/views/LayoutView.svelte +0 -0
- /package/dist/{client → explorer}/views/LayoutView.svelte.d.ts +0 -0
- /package/dist/{client → explorer}/views/PageView.svelte +0 -0
- /package/dist/{client → explorer}/views/PageView.svelte.d.ts +0 -0
- /package/dist/{client → explorer}/views/PreviewFrame.svelte +0 -0
- /package/dist/{client → explorer}/views/PreviewFrame.svelte.d.ts +0 -0
- /package/dist/{client → explorer}/views/Sidebar.svelte +0 -0
- /package/dist/{client → explorer}/views/Sidebar.svelte.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.0.32] - 2026-07-03
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **Breaking: the embedded component is the Explorer now.** Import
|
|
15
|
+
`Explorer` from `sdocs/explorer` instead of `App` from `sdocs/client` —
|
|
16
|
+
same component and props, named for what it is. The CLI help and
|
|
17
|
+
generated app use the same naming.
|
|
18
|
+
|
|
10
19
|
## [0.0.31] - 2026-07-03
|
|
11
20
|
|
|
12
21
|
### Added
|
package/README.md
CHANGED
|
@@ -65,11 +65,11 @@ The plugin discovers `.sdoc` files and exposes them via a `virtual:sdocs` module
|
|
|
65
65
|
```svelte
|
|
66
66
|
<!-- src/routes/docs/+page.svelte -->
|
|
67
67
|
<script>
|
|
68
|
-
import
|
|
68
|
+
import Explorer from 'sdocs/explorer';
|
|
69
69
|
import { docs, cssNames } from 'virtual:sdocs';
|
|
70
70
|
</script>
|
|
71
71
|
|
|
72
|
-
<
|
|
72
|
+
<Explorer
|
|
73
73
|
{docs}
|
|
74
74
|
{cssNames}
|
|
75
75
|
logo="My Design System"
|
|
@@ -273,7 +273,7 @@ sidebar: {
|
|
|
273
273
|
|--------|-------------|
|
|
274
274
|
| `sdocs` | Main entry — `sdocsPlugin` + types |
|
|
275
275
|
| `sdocs/vite` | Vite plugin function |
|
|
276
|
-
| `sdocs/
|
|
276
|
+
| `sdocs/explorer` | Explorer.svelte UI component |
|
|
277
277
|
| `sdocs/ui` | Reusable UI components (Button, Frame, Icon, Control, NavTree, Stack) |
|
|
278
278
|
|
|
279
279
|
## License
|
package/dist/commands/dev.js
CHANGED
|
@@ -44,7 +44,7 @@ export async function devCommand() {
|
|
|
44
44
|
// Rolldown-based Vite (8+) can't scan .svelte entry graphs and floods
|
|
45
45
|
// the console with unresolved-import errors. Skip the initial scan —
|
|
46
46
|
// runtime discovery still optimizes dependencies on demand — and
|
|
47
|
-
// pre-bundle the one dependency the
|
|
47
|
+
// pre-bundle the one dependency the Explorer app always needs.
|
|
48
48
|
entries: [],
|
|
49
49
|
include: ['svelte'],
|
|
50
50
|
},
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import '../ui/styles/sdocs.css';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: Record<string, never>;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {};
|
|
9
|
+
};
|
|
10
|
+
export type ExplorerProps = typeof __propDef.props;
|
|
11
|
+
export type ExplorerEvents = typeof __propDef.events;
|
|
12
|
+
export type ExplorerSlots = typeof __propDef.slots;
|
|
13
|
+
export default class Explorer extends SvelteComponentTyped<ExplorerProps, ExplorerEvents, ExplorerSlots> {
|
|
14
|
+
}
|
|
15
|
+
export {};
|
package/dist/server/app-gen.js
CHANGED
|
@@ -7,13 +7,13 @@ import { discoverDocFiles, getSdocKind } from './discovery.js';
|
|
|
7
7
|
import { extractSnippets, hasDefaultSnippet } from './snippet-extractor.js';
|
|
8
8
|
import { base64urlEncode } from './snippet-compiler.js';
|
|
9
9
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
-
/** Source
|
|
11
|
-
function
|
|
12
|
-
return resolve(__dirname, '../
|
|
10
|
+
/** Source Explorer directory in the installed package (dist/explorer, next to dist/server) */
|
|
11
|
+
function getExplorerSourceDir() {
|
|
12
|
+
return resolve(__dirname, '../explorer');
|
|
13
13
|
}
|
|
14
|
-
/** Copy the
|
|
15
|
-
async function
|
|
16
|
-
await copyDir(
|
|
14
|
+
/** Copy the Explorer app plus the ui/ tree it imports (styles, fonts, components) */
|
|
15
|
+
async function copyExplorerApp(sdocsDir) {
|
|
16
|
+
await copyDir(getExplorerSourceDir(), resolve(sdocsDir, 'explorer'));
|
|
17
17
|
await copyDir(resolve(__dirname, '../ui'), resolve(sdocsDir, 'ui'));
|
|
18
18
|
}
|
|
19
19
|
/** Nearest node_modules walking up from dir (mirrors Node's resolution) */
|
|
@@ -68,7 +68,7 @@ function generateIndexHtml(title) {
|
|
|
68
68
|
<head>
|
|
69
69
|
<meta charset="UTF-8">
|
|
70
70
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
71
|
-
<link rel="icon" type="image/png" href="./
|
|
71
|
+
<link rel="icon" type="image/png" href="./explorer/favicon.png">
|
|
72
72
|
<title>${title}</title>
|
|
73
73
|
<style>body { margin: 0; }</style>
|
|
74
74
|
</head>
|
|
@@ -78,13 +78,13 @@ function generateIndexHtml(title) {
|
|
|
78
78
|
</body>
|
|
79
79
|
</html>`;
|
|
80
80
|
}
|
|
81
|
-
/** Generate the entry.js that mounts the
|
|
81
|
+
/** Generate the entry.js that mounts the Explorer */
|
|
82
82
|
function generateEntryJs(config) {
|
|
83
83
|
return `import { mount } from 'svelte';
|
|
84
84
|
import { docs, cssNames } from 'virtual:sdocs';
|
|
85
|
-
import
|
|
85
|
+
import Explorer from './explorer/Explorer.svelte';
|
|
86
86
|
|
|
87
|
-
mount(
|
|
87
|
+
mount(Explorer, {
|
|
88
88
|
target: document.getElementById('app'),
|
|
89
89
|
props: {
|
|
90
90
|
docs,
|
|
@@ -122,8 +122,8 @@ function generatePreviewHtml(iframeVirtualId, css) {
|
|
|
122
122
|
<div id="app"></div>
|
|
123
123
|
<script type="module">
|
|
124
124
|
import { mount } from 'svelte';
|
|
125
|
-
import
|
|
126
|
-
mount(
|
|
125
|
+
import Preview from '${iframeVirtualId}';
|
|
126
|
+
mount(Preview, { target: document.getElementById('app') });
|
|
127
127
|
|
|
128
128
|
window.addEventListener('message', (e) => {
|
|
129
129
|
if (e.data?.type === 'sdocs:update-stylesheet') {
|
|
@@ -165,8 +165,8 @@ async function discoverSnippets(config, cwd) {
|
|
|
165
165
|
/** Generate the staging directory with entry files for dev mode */
|
|
166
166
|
export async function generateDevFiles(config, cwd) {
|
|
167
167
|
const sdocsDir = await createStagingDir(cwd);
|
|
168
|
-
// Copy
|
|
169
|
-
await
|
|
168
|
+
// Copy Explorer components into the staging dir so they're compiled outside node_modules
|
|
169
|
+
await copyExplorerApp(sdocsDir);
|
|
170
170
|
await writeFile(resolve(sdocsDir, 'index.html'), generateIndexHtml(config.logo));
|
|
171
171
|
await writeFile(resolve(sdocsDir, 'entry.js'), generateEntryJs(config));
|
|
172
172
|
return sdocsDir;
|
|
@@ -174,8 +174,8 @@ export async function generateDevFiles(config, cwd) {
|
|
|
174
174
|
/** Generate the staging directory with entry + preview HTML files for build mode */
|
|
175
175
|
export async function generateBuildFiles(config, cwd) {
|
|
176
176
|
const sdocsDir = await createStagingDir(cwd);
|
|
177
|
-
// Copy
|
|
178
|
-
await
|
|
177
|
+
// Copy Explorer components into the staging dir
|
|
178
|
+
await copyExplorerApp(sdocsDir);
|
|
179
179
|
await writeFile(resolve(sdocsDir, 'index.html'), generateIndexHtml(config.logo));
|
|
180
180
|
await writeFile(resolve(sdocsDir, 'entry.js'), generateEntryJs(config));
|
|
181
181
|
const inputs = {
|
package/dist/server/cli.js
CHANGED
|
@@ -18,9 +18,9 @@ Usage:
|
|
|
18
18
|
sdocs <command>
|
|
19
19
|
|
|
20
20
|
Commands:
|
|
21
|
-
dev Start
|
|
21
|
+
dev Start the Explorer dev server with live reload
|
|
22
22
|
run Same as dev — works with npx and no local install
|
|
23
|
-
build Build static
|
|
23
|
+
build Build the Explorer as a static site
|
|
24
24
|
preview Serve built site locally
|
|
25
25
|
init Scaffold sdocs.config.js
|
|
26
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sdocs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"description": "A lightweight documentation tool for Svelte 5 components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"types": "./dist/vite.d.ts",
|
|
22
22
|
"default": "./dist/vite.js"
|
|
23
23
|
},
|
|
24
|
-
"./
|
|
25
|
-
"svelte": "./dist/
|
|
24
|
+
"./explorer": {
|
|
25
|
+
"svelte": "./dist/explorer/Explorer.svelte"
|
|
26
26
|
},
|
|
27
27
|
"./ui": {
|
|
28
28
|
"types": "./dist/ui/index.d.ts",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import '../ui/styles/sdocs.css';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: Record<string, never>;
|
|
5
|
-
events: {
|
|
6
|
-
[evt: string]: CustomEvent<any>;
|
|
7
|
-
};
|
|
8
|
-
slots: {};
|
|
9
|
-
};
|
|
10
|
-
export type AppProps = typeof __propDef.props;
|
|
11
|
-
export type AppEvents = typeof __propDef.events;
|
|
12
|
-
export type AppSlots = typeof __propDef.slots;
|
|
13
|
-
export default class App extends SvelteComponentTyped<AppProps, AppEvents, AppSlots> {
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|