@brillout/docpress 0.4.16 → 0.5.0
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/{chunk-PWCIRBXY.js → chunk-W5PDEMRM.js} +9 -5
- package/dist/cli/index.js +2 -2
- package/dist/{devServer-P3BMS7IP.js → devServer-5TMJUDWP.js} +1 -1
- package/dist/index.d.ts +1 -6
- package/dist/index.js +12 -8
- package/dist/renderer/_default.page.client.css +11 -3
- package/dist/renderer/_default.page.server.d.ts +2 -2
- package/dist/renderer/_default.page.server.js +9 -6
- package/package.json +11 -8
|
@@ -130,6 +130,14 @@ var root = process.cwd();
|
|
|
130
130
|
var prettyCode = [rehypePrettyCode, { theme: "github-light" }];
|
|
131
131
|
var rehypePlugins = [prettyCode];
|
|
132
132
|
var remarkPlugins = [remarkGfm];
|
|
133
|
+
var isDev = !process.argv[1].endsWith("/bin.js");
|
|
134
|
+
var extensionFiles = isDev ? { pageFilesSrc: "/src/renderer/*" } : {
|
|
135
|
+
pageFilesDist: [
|
|
136
|
+
"@brillout/docpress/renderer/_default.page.server.js",
|
|
137
|
+
"@brillout/docpress/renderer/_default.page.client.js"
|
|
138
|
+
],
|
|
139
|
+
assetsDir: "/dist/"
|
|
140
|
+
};
|
|
133
141
|
var config = {
|
|
134
142
|
root,
|
|
135
143
|
plugins: [
|
|
@@ -143,11 +151,7 @@ var config = {
|
|
|
143
151
|
extensions: [
|
|
144
152
|
{
|
|
145
153
|
npmPackageName: "@brillout/docpress",
|
|
146
|
-
|
|
147
|
-
"@brillout/docpress/renderer/_default.page.server.js",
|
|
148
|
-
"@brillout/docpress/renderer/_default.page.client.js"
|
|
149
|
-
],
|
|
150
|
-
assetsDir: "/dist/"
|
|
154
|
+
...extensionFiles
|
|
151
155
|
}
|
|
152
156
|
],
|
|
153
157
|
includeAssetsImportedByServer: true,
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vite_config_default
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-W5PDEMRM.js";
|
|
4
4
|
import "../chunk-OFUQWIQL.js";
|
|
5
5
|
import "../chunk-2ZTPUQGS.js";
|
|
6
6
|
import "../chunk-3QC7HYIF.js";
|
|
@@ -16,7 +16,7 @@ Error.stackTraceLimit = Infinity;
|
|
|
16
16
|
cli();
|
|
17
17
|
async function cli() {
|
|
18
18
|
if (isDev) {
|
|
19
|
-
await import("../devServer-
|
|
19
|
+
await import("../devServer-5TMJUDWP.js");
|
|
20
20
|
} else if (isBuild) {
|
|
21
21
|
await build(vite_config_default);
|
|
22
22
|
await build({ ...vite_config_default, build: { ssr: true } });
|
package/dist/index.d.ts
CHANGED
|
@@ -116,11 +116,6 @@ declare function Warning({ children }: {
|
|
|
116
116
|
declare function Construction({ children }: {
|
|
117
117
|
children: JSX.Element;
|
|
118
118
|
}): JSX.Element;
|
|
119
|
-
declare function Note({ type, icon, children }: {
|
|
120
|
-
icon?: JSX.Element | string;
|
|
121
|
-
type?: 'error' | 'warning' | 'construction';
|
|
122
|
-
children: JSX.Element;
|
|
123
|
-
}): JSX.Element;
|
|
124
119
|
|
|
125
120
|
declare function ImportMeta({ prop }: {
|
|
126
121
|
prop: string;
|
|
@@ -156,4 +151,4 @@ declare function CodeBlockTransformer({ children, lineBreak }: {
|
|
|
156
151
|
lineBreak: LineBreak;
|
|
157
152
|
}): JSX.Element;
|
|
158
153
|
|
|
159
|
-
export { CodeBlockTransformer, Config, Construction, Emoji, EmojiName, HeadingDefinition, HeadingDetachedDefinition, HorizontalLine, ImportMeta, Info, Link,
|
|
154
|
+
export { CodeBlockTransformer, Config, Construction, Emoji, EmojiName, HeadingDefinition, HeadingDetachedDefinition, HorizontalLine, ImportMeta, Info, Link, P, ReadingRecommendation, RepoLink, Sponsor, Sponsors, Warning, assert, assertUsage, assertWarning, crawlAllFiles, determineSectionTitle, determineSectionUrlHash, filter, isBrowser, isRepoLink, jsxToTextContent, objectAssign };
|
package/dist/index.js
CHANGED
|
@@ -195,23 +195,27 @@ function Note({
|
|
|
195
195
|
icon,
|
|
196
196
|
children
|
|
197
197
|
}) {
|
|
198
|
-
let className = "";
|
|
198
|
+
let className = "custom-icon";
|
|
199
|
+
if (type) {
|
|
200
|
+
className = `${className} type-${type}`;
|
|
201
|
+
}
|
|
199
202
|
if (!icon) {
|
|
203
|
+
let classColor = "";
|
|
200
204
|
if (type === "error") {
|
|
201
205
|
icon = ":no_entry:";
|
|
202
|
-
|
|
206
|
+
classColor = "color-error";
|
|
203
207
|
}
|
|
204
208
|
if (type === "warning") {
|
|
205
209
|
icon = ":warning:";
|
|
206
|
-
|
|
210
|
+
classColor = "color-warning";
|
|
207
211
|
}
|
|
208
212
|
if (type === "construction") {
|
|
209
213
|
icon = ":construction:";
|
|
210
|
-
|
|
214
|
+
classColor = "color-warning";
|
|
215
|
+
}
|
|
216
|
+
if (classColor) {
|
|
217
|
+
className = `${className} ${classColor}`;
|
|
211
218
|
}
|
|
212
|
-
}
|
|
213
|
-
if (icon) {
|
|
214
|
-
className = `custom-icon ${className}`;
|
|
215
219
|
}
|
|
216
220
|
return /* @__PURE__ */ React5.createElement("blockquote", {
|
|
217
221
|
className
|
|
@@ -289,6 +293,7 @@ var alignable_default = "/assets/alignable-B4QZV4X7.svg";
|
|
|
289
293
|
|
|
290
294
|
// src/components/Sponsors/sponsorsList.ts
|
|
291
295
|
var individuals = [
|
|
296
|
+
{ username: "royalswe" },
|
|
292
297
|
{ username: "agalbenus" },
|
|
293
298
|
{ username: "phiberber" },
|
|
294
299
|
{ username: "cookieplace" },
|
|
@@ -603,7 +608,6 @@ export {
|
|
|
603
608
|
ImportMeta,
|
|
604
609
|
Info,
|
|
605
610
|
Link,
|
|
606
|
-
Note,
|
|
607
611
|
P,
|
|
608
612
|
ReadingRecommendation,
|
|
609
613
|
RepoLink,
|
|
@@ -271,7 +271,7 @@ blockquote {
|
|
|
271
271
|
margin-right: 0;
|
|
272
272
|
padding: 4px 16px;
|
|
273
273
|
}
|
|
274
|
-
blockquote.error {
|
|
274
|
+
blockquote.color-error {
|
|
275
275
|
--color-strengh-bg: 1.7;
|
|
276
276
|
--color-strengh-border: 6;
|
|
277
277
|
--color:
|
|
@@ -279,7 +279,7 @@ blockquote.error {
|
|
|
279
279
|
25,
|
|
280
280
|
49;
|
|
281
281
|
}
|
|
282
|
-
blockquote.warning {
|
|
282
|
+
blockquote.color-warning {
|
|
283
283
|
--color-strengh-bg: 4;
|
|
284
284
|
--color-strengh-border: 8;
|
|
285
285
|
--color:
|
|
@@ -293,11 +293,19 @@ blockquote.warning {
|
|
|
293
293
|
blockquote.custom-icon > .blockquote-content > :first-child {
|
|
294
294
|
display: inline;
|
|
295
295
|
}
|
|
296
|
+
blockquote.type-construction img[src^="https://twemoji."] {
|
|
297
|
+
margin-right: 2px;
|
|
298
|
+
}
|
|
299
|
+
blockquote.type-warning img[src^="https://twemoji."] {
|
|
300
|
+
position: relative;
|
|
301
|
+
top: -1px;
|
|
302
|
+
margin-right: 2px;
|
|
303
|
+
}
|
|
296
304
|
blockquote > p:first-child::before,
|
|
297
305
|
blockquote > div.paragraph:first-child::before {
|
|
298
306
|
font-family: emoji;
|
|
299
307
|
content: "\2139\fe0f";
|
|
300
|
-
margin-right:
|
|
308
|
+
margin-right: 7px;
|
|
301
309
|
}
|
|
302
310
|
|
|
303
311
|
/* src/components/CodeBlockTransformer.css */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vite_plugin_ssr_dist_types_node_runtime_html_renderHtml from 'vite-plugin-ssr/dist/types/node/runtime/html/renderHtml';
|
|
2
2
|
import { PageContextBuiltIn } from 'vite-plugin-ssr/types';
|
|
3
3
|
|
|
4
4
|
type MarkdownHeading = {
|
|
@@ -17,6 +17,6 @@ type PageContextOriginal = PageContextBuiltIn & {
|
|
|
17
17
|
exports: Exports;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
declare function render(pageContextOriginal: PageContextOriginal): Promise<
|
|
20
|
+
declare function render(pageContextOriginal: PageContextOriginal): Promise<vite_plugin_ssr_dist_types_node_runtime_html_renderHtml.TemplateWrapped>;
|
|
21
21
|
|
|
22
22
|
export { render };
|
|
@@ -507,12 +507,15 @@ function findHeading(headings, headingsDetached, pageContext) {
|
|
|
507
507
|
if (!activeHeading) {
|
|
508
508
|
activeHeading = headingsDetached.find(({ url }) => pageUrl === url) ?? null;
|
|
509
509
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
510
|
+
if (!activeHeading) {
|
|
511
|
+
throw new Error(
|
|
512
|
+
[
|
|
513
|
+
`Heading not found for URL '${pageUrl}'`,
|
|
514
|
+
"Heading is defined for following URLs:",
|
|
515
|
+
...headings.map((h) => ` ${h.url}`).filter(Boolean).sort()
|
|
516
|
+
].join("\n")
|
|
517
|
+
);
|
|
518
|
+
}
|
|
516
519
|
return { activeHeading, activeNavigationHeading };
|
|
517
520
|
}
|
|
518
521
|
function getHeadingsWithSubHeadings(headings, pageContext, activeNavigationHeading) {
|
package/package.json
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brillout/docpress",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"// Check types while developing": "",
|
|
6
6
|
"types": "tsc --noEmit --watch",
|
|
7
|
-
"// Develop
|
|
8
|
-
"dev": "
|
|
9
|
-
"
|
|
7
|
+
"// Develop Docpress using demo/": "",
|
|
8
|
+
"dev:build": "tsup",
|
|
9
|
+
"dev:start": "node dist/index.js dev",
|
|
10
|
+
"dev": "pnpm run dev:build && pnpm run dev:start",
|
|
10
11
|
"// Build Docpress": "",
|
|
11
12
|
"build": "rimraf dist/ && framework-builder",
|
|
12
13
|
"// Release": "",
|
|
13
|
-
"release": "release-me patch"
|
|
14
|
+
"release": "release-me patch",
|
|
15
|
+
"release:breaking-change": "release-me minor"
|
|
14
16
|
},
|
|
15
17
|
"dependencies": {
|
|
16
18
|
"@mdx-js/mdx": "^2.0.0",
|
|
17
19
|
"@mdx-js/react": "^2.0.0",
|
|
18
20
|
"@mdx-js/rollup": "^2.0.0",
|
|
19
|
-
"@vitejs/plugin-react-swc": "^3.3.
|
|
21
|
+
"@vitejs/plugin-react-swc": "^3.3.2",
|
|
20
22
|
"balloon-css": "^1.2.0",
|
|
21
23
|
"express": "^4.17.1",
|
|
22
24
|
"rehype-pretty-code": "^0.3.2",
|
|
23
25
|
"remark-gfm": "^3.0.1",
|
|
24
26
|
"shiki": "^0.10.1",
|
|
25
27
|
"twemoji": "^13.1.0",
|
|
26
|
-
"vite": "
|
|
27
|
-
"vite-plugin-ssr": "^0.4.
|
|
28
|
+
"vite": "^4.3.9",
|
|
29
|
+
"vite-plugin-ssr": "^0.4.131"
|
|
28
30
|
},
|
|
29
31
|
"type": "module",
|
|
30
32
|
"exports": {
|
|
@@ -71,6 +73,7 @@
|
|
|
71
73
|
"react-dom": "^18.1.0",
|
|
72
74
|
"rimraf": "^3.0.2",
|
|
73
75
|
"rollup": "^2.74.1",
|
|
76
|
+
"tsup": "^7.0.0",
|
|
74
77
|
"tsx": "^3.12.1",
|
|
75
78
|
"typescript": "^4.9.4"
|
|
76
79
|
},
|