boltdocs 1.0.1 → 1.0.4
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/{CodeBlock-37XMKCYY.mjs → CodeBlock-V3Z5EKGR.mjs} +0 -1
- package/dist/{PackageManagerTabs-4NWXLXQO.mjs → PackageManagerTabs-XEKI3L7P.mjs} +0 -2
- package/dist/Playground-B2FA34BC.mjs +6 -0
- package/dist/{SearchDialog-ZAZXYIFX.css → SearchDialog-PYF3QMYG.css} +3 -3
- package/dist/{SearchDialog-FTOQZ763.mjs → SearchDialog-R36WKAQ7.mjs} +1 -2
- package/dist/{Video-I6QY4X7J.mjs → Video-KNTY5BNO.mjs} +0 -1
- package/dist/{chunk-ZFCOLEXN.mjs → chunk-TWSRXUFF.mjs} +7 -10
- package/dist/{chunk-PN4GCTYG.mjs → chunk-WPT4MWTQ.mjs} +25 -3
- package/dist/client/index.css +3 -3
- package/dist/client/index.d.mts +34 -4
- package/dist/client/index.d.ts +34 -4
- package/dist/client/index.js +28 -10
- package/dist/client/index.mjs +4 -5
- package/dist/client/ssr.css +3 -3
- package/dist/client/ssr.d.mts +1 -1
- package/dist/client/ssr.d.ts +1 -1
- package/dist/client/ssr.js +25 -3
- package/dist/client/ssr.mjs +1 -2
- package/dist/node/index.mjs +68 -28
- package/dist/{index-CRQKWAeo.d.mts → types-CvrzTbEX.d.mts} +1 -28
- package/dist/{index-CRQKWAeo.d.ts → types-CvrzTbEX.d.ts} +1 -28
- package/package.json +1 -1
- package/src/client/app/index.tsx +7 -56
- package/src/client/app/preload.tsx +1 -1
- package/src/client/index.ts +1 -1
- package/src/client/ssr.tsx +2 -1
- package/src/client/theme/components/Playground/Playground.tsx +40 -2
- package/src/client/theme/styles/markdown.css +3 -3
- package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +1 -1
- package/src/client/theme/ui/Layout/Layout.tsx +1 -1
- package/src/client/theme/ui/Navbar/Navbar.tsx +1 -1
- package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +1 -1
- package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +1 -1
- package/src/client/types.ts +50 -0
- package/dist/Playground-OE2OE6B6.mjs +0 -7
- package/dist/chunk-X2TDGMTR.mjs +0 -64
- package/dist/chunk-X6BYQHVC.mjs +0 -12
- package/dist/node/cli/index.d.mts +0 -1
- package/dist/node/cli/index.d.ts +0 -1
- package/dist/node/cli/index.js +0 -199
- package/dist/node/cli/index.mjs +0 -154
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
package/dist/node/cli/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
package/dist/node/cli/index.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
-
mod
|
|
24
|
-
));
|
|
25
|
-
|
|
26
|
-
// src/node/cli/index.ts
|
|
27
|
-
var import_cac = __toESM(require("cac"));
|
|
28
|
-
|
|
29
|
-
// src/node/cli/commands/config.ts
|
|
30
|
-
var import_path2 = __toESM(require("path"));
|
|
31
|
-
|
|
32
|
-
// src/node/config.ts
|
|
33
|
-
var import_path = __toESM(require("path"));
|
|
34
|
-
var import_url = require("url");
|
|
35
|
-
var import_fs = __toESM(require("fs"));
|
|
36
|
-
var CONFIG_FILES = [
|
|
37
|
-
"boltdocs.config.js",
|
|
38
|
-
"boltdocs.config.mjs",
|
|
39
|
-
"boltdocs.config.ts"
|
|
40
|
-
];
|
|
41
|
-
async function resolveConfig(docsDir) {
|
|
42
|
-
const projectRoot = process.cwd();
|
|
43
|
-
const defaults = {
|
|
44
|
-
docsDir: import_path.default.resolve(docsDir),
|
|
45
|
-
themeConfig: {
|
|
46
|
-
title: "Boltdocs",
|
|
47
|
-
description: "A Vite documentation framework",
|
|
48
|
-
navbar: [
|
|
49
|
-
{ text: "Home", link: "/" },
|
|
50
|
-
{ text: "Documentation", link: "/docs" }
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
for (const filename of CONFIG_FILES) {
|
|
55
|
-
const configPath = import_path.default.resolve(projectRoot, filename);
|
|
56
|
-
if (import_fs.default.existsSync(configPath)) {
|
|
57
|
-
try {
|
|
58
|
-
const fileUrl = (0, import_url.pathToFileURL)(configPath).href + "?t=" + Date.now();
|
|
59
|
-
const mod = await import(fileUrl);
|
|
60
|
-
const userConfig = mod.default || mod;
|
|
61
|
-
const userThemeConfig = userConfig.themeConfig || userConfig;
|
|
62
|
-
return {
|
|
63
|
-
docsDir: import_path.default.resolve(docsDir),
|
|
64
|
-
themeConfig: {
|
|
65
|
-
...defaults.themeConfig,
|
|
66
|
-
...userThemeConfig
|
|
67
|
-
},
|
|
68
|
-
i18n: userConfig.i18n,
|
|
69
|
-
versions: userConfig.versions,
|
|
70
|
-
siteUrl: userConfig.siteUrl,
|
|
71
|
-
plugins: userConfig.plugins || []
|
|
72
|
-
};
|
|
73
|
-
} catch (e) {
|
|
74
|
-
console.warn(`[boltdocs] Failed to load config from ${filename}:`, e);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return defaults;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// src/node/cli/commands/config.ts
|
|
82
|
-
async function configAction(root) {
|
|
83
|
-
const rootDir = root ? import_path2.default.resolve(root) : process.cwd();
|
|
84
|
-
const docsDir = import_path2.default.resolve(rootDir, "docs");
|
|
85
|
-
try {
|
|
86
|
-
const config = await resolveConfig(docsDir);
|
|
87
|
-
process.stdout.write(JSON.stringify(config, null, 2) + "\n");
|
|
88
|
-
} catch (e) {
|
|
89
|
-
process.stderr.write("Failed to resolve configuration: " + e + "\n");
|
|
90
|
-
process.exit(1);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// src/node/cli/commands/generate-css.ts
|
|
95
|
-
var import_path3 = __toESM(require("path"));
|
|
96
|
-
var import_node_fs = __toESM(require("fs"));
|
|
97
|
-
|
|
98
|
-
// src/node/cli/constants.ts
|
|
99
|
-
var DEFAULT_CSS_VARIABLES = `:root {
|
|
100
|
-
/* \u2500 Base palette \u2500 */
|
|
101
|
-
--ld-bg-main: #0a0a0f;
|
|
102
|
-
--ld-bg-soft: #0f0f18;
|
|
103
|
-
--ld-bg-mute: #141420;
|
|
104
|
-
--ld-surface: #1a1a2e;
|
|
105
|
-
--ld-border-subtle: rgba(255, 255, 255, 0.06);
|
|
106
|
-
--ld-border-strong: rgba(255, 255, 255, 0.12);
|
|
107
|
-
|
|
108
|
-
/* \u2500 Text \u2500 */
|
|
109
|
-
--ld-text-main: #e4e4ed;
|
|
110
|
-
--ld-text-muted: #9d9db5;
|
|
111
|
-
--ld-text-dim: #6b6b85;
|
|
112
|
-
|
|
113
|
-
/* \u2500 Accent \u2500 */
|
|
114
|
-
--ld-color-primary: #ffff;
|
|
115
|
-
--ld-color-primary-hover: #f8f8f8;
|
|
116
|
-
--ld-color-primary-muted: rgba(255, 255, 255, 0.05);
|
|
117
|
-
--ld-color-primary-glow: rgba(255, 255, 255, 0.15);
|
|
118
|
-
--ld-color-primary-text: #010101;
|
|
119
|
-
--ld-color-accent: #ffff; /* Yellow accent for TOC */
|
|
120
|
-
|
|
121
|
-
/* \u2500 Code \u2500 */
|
|
122
|
-
--ld-code-bg: #0d0d14;
|
|
123
|
-
--ld-code-header: #111119;
|
|
124
|
-
--ld-code-text: #d4d4d4;
|
|
125
|
-
|
|
126
|
-
/* \u2500 Typography \u2500 */
|
|
127
|
-
--ld-font-sans: "Inter", system-ui, -apple-system, sans-serif;
|
|
128
|
-
--ld-font-mono:
|
|
129
|
-
"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
|
130
|
-
monospace;
|
|
131
|
-
|
|
132
|
-
/* \u2500 Dimensions \u2500 */
|
|
133
|
-
--ld-navbar-height: 3.5rem;
|
|
134
|
-
--ld-sidebar-width: 14.5rem;
|
|
135
|
-
--ld-toc-width: 13rem;
|
|
136
|
-
--ld-content-max-width: 820px;
|
|
137
|
-
--ld-radius-sm: 4px;
|
|
138
|
-
--ld-radius-md: 8px;
|
|
139
|
-
--ld-radius-lg: 12px;
|
|
140
|
-
--ld-radius-full: 9999px;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
[data-theme="light"],
|
|
144
|
-
.theme-light {
|
|
145
|
-
--ld-bg-main: #ffffff;
|
|
146
|
-
--ld-bg-soft: #f9fafb;
|
|
147
|
-
--ld-bg-mute: #f3f4f6;
|
|
148
|
-
|
|
149
|
-
--ld-surface: #ffffff;
|
|
150
|
-
|
|
151
|
-
--ld-border-subtle: #e5e7eb;
|
|
152
|
-
--ld-border-strong: #d1d5db;
|
|
153
|
-
|
|
154
|
-
--ld-text-main: #111827;
|
|
155
|
-
--ld-text-muted: #4b5563;
|
|
156
|
-
--ld-text-dim: #6b7280;
|
|
157
|
-
|
|
158
|
-
--ld-color-primary: #010101;
|
|
159
|
-
--ld-color-primary-hover: #010101;
|
|
160
|
-
--ld-color-primary-muted: rgba(127, 19, 236, 0.1);
|
|
161
|
-
--ld-color-primary-glow: rgba(127, 19, 236, 0.25);
|
|
162
|
-
--ld-color-primary-text: #010101;
|
|
163
|
-
|
|
164
|
-
--ld-code-bg: #f3f4f6;
|
|
165
|
-
--ld-code-header: #e5e7eb;
|
|
166
|
-
--ld-code-text: #1f2937;
|
|
167
|
-
}
|
|
168
|
-
`;
|
|
169
|
-
|
|
170
|
-
// src/node/cli/commands/generate-css.ts
|
|
171
|
-
function generateCssAction(outputPath) {
|
|
172
|
-
try {
|
|
173
|
-
const target = process.cwd();
|
|
174
|
-
const filename = outputPath || "custom.css";
|
|
175
|
-
const filepath = import_path3.default.resolve(target, filename);
|
|
176
|
-
if (import_node_fs.default.existsSync(filepath)) {
|
|
177
|
-
process.stderr.write(
|
|
178
|
-
"Error: File " + filename + " already exists in " + target + ".\n"
|
|
179
|
-
);
|
|
180
|
-
process.exit(1);
|
|
181
|
-
}
|
|
182
|
-
import_node_fs.default.writeFileSync(filepath, DEFAULT_CSS_VARIABLES);
|
|
183
|
-
process.stdout.write("Success! Generated " + filename + "\n");
|
|
184
|
-
} catch (e) {
|
|
185
|
-
process.stderr.write("Failed to generate CSS: " + e + "\n");
|
|
186
|
-
process.exit(1);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// src/node/cli/index.ts
|
|
191
|
-
var cli = (0, import_cac.default)("boltdocs");
|
|
192
|
-
cli.command("config [root]", "Output the resolved boltdocs configuration").action(configAction);
|
|
193
|
-
cli.command(
|
|
194
|
-
"generate:css [path]",
|
|
195
|
-
"Generate a custom.css file with default Boltdocs CSS variables"
|
|
196
|
-
).action(generateCssAction);
|
|
197
|
-
cli.help();
|
|
198
|
-
cli.version("1.0.0");
|
|
199
|
-
cli.parse();
|
package/dist/node/cli/index.mjs
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
init_config,
|
|
4
|
-
resolveConfig
|
|
5
|
-
} from "../../chunk-X2TDGMTR.mjs";
|
|
6
|
-
import {
|
|
7
|
-
__commonJS,
|
|
8
|
-
__esm
|
|
9
|
-
} from "../../chunk-X6BYQHVC.mjs";
|
|
10
|
-
|
|
11
|
-
// src/node/cli/commands/config.ts
|
|
12
|
-
import path from "path";
|
|
13
|
-
async function configAction(root) {
|
|
14
|
-
const rootDir = root ? path.resolve(root) : process.cwd();
|
|
15
|
-
const docsDir = path.resolve(rootDir, "docs");
|
|
16
|
-
try {
|
|
17
|
-
const config = await resolveConfig(docsDir);
|
|
18
|
-
process.stdout.write(JSON.stringify(config, null, 2) + "\n");
|
|
19
|
-
} catch (e) {
|
|
20
|
-
process.stderr.write("Failed to resolve configuration: " + e + "\n");
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
var init_config2 = __esm({
|
|
25
|
-
"src/node/cli/commands/config.ts"() {
|
|
26
|
-
"use strict";
|
|
27
|
-
init_config();
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// src/node/cli/constants.ts
|
|
32
|
-
var DEFAULT_CSS_VARIABLES;
|
|
33
|
-
var init_constants = __esm({
|
|
34
|
-
"src/node/cli/constants.ts"() {
|
|
35
|
-
"use strict";
|
|
36
|
-
DEFAULT_CSS_VARIABLES = `:root {
|
|
37
|
-
/* \u2500 Base palette \u2500 */
|
|
38
|
-
--ld-bg-main: #0a0a0f;
|
|
39
|
-
--ld-bg-soft: #0f0f18;
|
|
40
|
-
--ld-bg-mute: #141420;
|
|
41
|
-
--ld-surface: #1a1a2e;
|
|
42
|
-
--ld-border-subtle: rgba(255, 255, 255, 0.06);
|
|
43
|
-
--ld-border-strong: rgba(255, 255, 255, 0.12);
|
|
44
|
-
|
|
45
|
-
/* \u2500 Text \u2500 */
|
|
46
|
-
--ld-text-main: #e4e4ed;
|
|
47
|
-
--ld-text-muted: #9d9db5;
|
|
48
|
-
--ld-text-dim: #6b6b85;
|
|
49
|
-
|
|
50
|
-
/* \u2500 Accent \u2500 */
|
|
51
|
-
--ld-color-primary: #ffff;
|
|
52
|
-
--ld-color-primary-hover: #f8f8f8;
|
|
53
|
-
--ld-color-primary-muted: rgba(255, 255, 255, 0.05);
|
|
54
|
-
--ld-color-primary-glow: rgba(255, 255, 255, 0.15);
|
|
55
|
-
--ld-color-primary-text: #010101;
|
|
56
|
-
--ld-color-accent: #ffff; /* Yellow accent for TOC */
|
|
57
|
-
|
|
58
|
-
/* \u2500 Code \u2500 */
|
|
59
|
-
--ld-code-bg: #0d0d14;
|
|
60
|
-
--ld-code-header: #111119;
|
|
61
|
-
--ld-code-text: #d4d4d4;
|
|
62
|
-
|
|
63
|
-
/* \u2500 Typography \u2500 */
|
|
64
|
-
--ld-font-sans: "Inter", system-ui, -apple-system, sans-serif;
|
|
65
|
-
--ld-font-mono:
|
|
66
|
-
"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
|
67
|
-
monospace;
|
|
68
|
-
|
|
69
|
-
/* \u2500 Dimensions \u2500 */
|
|
70
|
-
--ld-navbar-height: 3.5rem;
|
|
71
|
-
--ld-sidebar-width: 14.5rem;
|
|
72
|
-
--ld-toc-width: 13rem;
|
|
73
|
-
--ld-content-max-width: 820px;
|
|
74
|
-
--ld-radius-sm: 4px;
|
|
75
|
-
--ld-radius-md: 8px;
|
|
76
|
-
--ld-radius-lg: 12px;
|
|
77
|
-
--ld-radius-full: 9999px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
[data-theme="light"],
|
|
81
|
-
.theme-light {
|
|
82
|
-
--ld-bg-main: #ffffff;
|
|
83
|
-
--ld-bg-soft: #f9fafb;
|
|
84
|
-
--ld-bg-mute: #f3f4f6;
|
|
85
|
-
|
|
86
|
-
--ld-surface: #ffffff;
|
|
87
|
-
|
|
88
|
-
--ld-border-subtle: #e5e7eb;
|
|
89
|
-
--ld-border-strong: #d1d5db;
|
|
90
|
-
|
|
91
|
-
--ld-text-main: #111827;
|
|
92
|
-
--ld-text-muted: #4b5563;
|
|
93
|
-
--ld-text-dim: #6b7280;
|
|
94
|
-
|
|
95
|
-
--ld-color-primary: #010101;
|
|
96
|
-
--ld-color-primary-hover: #010101;
|
|
97
|
-
--ld-color-primary-muted: rgba(127, 19, 236, 0.1);
|
|
98
|
-
--ld-color-primary-glow: rgba(127, 19, 236, 0.25);
|
|
99
|
-
--ld-color-primary-text: #010101;
|
|
100
|
-
|
|
101
|
-
--ld-code-bg: #f3f4f6;
|
|
102
|
-
--ld-code-header: #e5e7eb;
|
|
103
|
-
--ld-code-text: #1f2937;
|
|
104
|
-
}
|
|
105
|
-
`;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// src/node/cli/commands/generate-css.ts
|
|
110
|
-
import path2 from "path";
|
|
111
|
-
import fs from "fs";
|
|
112
|
-
function generateCssAction(outputPath) {
|
|
113
|
-
try {
|
|
114
|
-
const target = process.cwd();
|
|
115
|
-
const filename = outputPath || "custom.css";
|
|
116
|
-
const filepath = path2.resolve(target, filename);
|
|
117
|
-
if (fs.existsSync(filepath)) {
|
|
118
|
-
process.stderr.write(
|
|
119
|
-
"Error: File " + filename + " already exists in " + target + ".\n"
|
|
120
|
-
);
|
|
121
|
-
process.exit(1);
|
|
122
|
-
}
|
|
123
|
-
fs.writeFileSync(filepath, DEFAULT_CSS_VARIABLES);
|
|
124
|
-
process.stdout.write("Success! Generated " + filename + "\n");
|
|
125
|
-
} catch (e) {
|
|
126
|
-
process.stderr.write("Failed to generate CSS: " + e + "\n");
|
|
127
|
-
process.exit(1);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
var init_generate_css = __esm({
|
|
131
|
-
"src/node/cli/commands/generate-css.ts"() {
|
|
132
|
-
"use strict";
|
|
133
|
-
init_constants();
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
// src/node/cli/index.ts
|
|
138
|
-
import cac from "cac";
|
|
139
|
-
var require_cli = __commonJS({
|
|
140
|
-
"src/node/cli/index.ts"() {
|
|
141
|
-
init_config2();
|
|
142
|
-
init_generate_css();
|
|
143
|
-
var cli = cac("boltdocs");
|
|
144
|
-
cli.command("config [root]", "Output the resolved boltdocs configuration").action(configAction);
|
|
145
|
-
cli.command(
|
|
146
|
-
"generate:css [path]",
|
|
147
|
-
"Generate a custom.css file with default Boltdocs CSS variables"
|
|
148
|
-
).action(generateCssAction);
|
|
149
|
-
cli.help();
|
|
150
|
-
cli.version("1.0.0");
|
|
151
|
-
cli.parse();
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
export default require_cli();
|