@brillout/docpress 0.4.17 → 0.5.1

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.
@@ -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
- pageFilesDist: [
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-PWCIRBXY.js";
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-P3BMS7IP.js");
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 } });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  vite_config_default
3
- } from "./chunk-PWCIRBXY.js";
3
+ } from "./chunk-W5PDEMRM.js";
4
4
  import "./chunk-OFUQWIQL.js";
5
5
  import "./chunk-2ZTPUQGS.js";
6
6
  import "./chunk-3QC7HYIF.js";
package/dist/index.d.ts CHANGED
@@ -116,9 +116,7 @@ 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';
119
+ declare function Danger({ children }: {
122
120
  children: JSX.Element;
123
121
  }): JSX.Element;
124
122
 
@@ -156,4 +154,4 @@ declare function CodeBlockTransformer({ children, lineBreak }: {
156
154
  lineBreak: LineBreak;
157
155
  }): JSX.Element;
158
156
 
159
- export { CodeBlockTransformer, Config, Construction, Emoji, EmojiName, HeadingDefinition, HeadingDetachedDefinition, HorizontalLine, ImportMeta, Info, Link, Note, P, ReadingRecommendation, RepoLink, Sponsor, Sponsors, Warning, assert, assertUsage, assertWarning, crawlAllFiles, determineSectionTitle, determineSectionUrlHash, filter, isBrowser, isRepoLink, jsxToTextContent, objectAssign };
157
+ export { CodeBlockTransformer, Config, Construction, Danger, 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
@@ -190,28 +190,37 @@ function Construction({ children }) {
190
190
  type: "construction"
191
191
  }, children);
192
192
  }
193
+ function Danger({ children }) {
194
+ return /* @__PURE__ */ React5.createElement(Note, {
195
+ type: "danger"
196
+ }, children);
197
+ }
193
198
  function Note({
194
199
  type,
195
200
  icon,
196
201
  children
197
202
  }) {
198
- let className = "";
203
+ let className = "custom-icon";
204
+ if (type) {
205
+ className = `${className} type-${type}`;
206
+ }
199
207
  if (!icon) {
200
- if (type === "error") {
208
+ let classColor = "";
209
+ if (type === "danger") {
201
210
  icon = ":no_entry:";
202
- className = "error";
211
+ classColor = "note-color-red";
203
212
  }
204
213
  if (type === "warning") {
205
214
  icon = ":warning:";
206
- className = "warning";
215
+ classColor = "note-color-yellow";
207
216
  }
208
217
  if (type === "construction") {
209
218
  icon = ":construction:";
210
- className = "warning";
219
+ classColor = "note-color-yellow";
220
+ }
221
+ if (classColor) {
222
+ className = `${className} ${classColor}`;
211
223
  }
212
- }
213
- if (icon) {
214
- className = `custom-icon ${className}`;
215
224
  }
216
225
  return /* @__PURE__ */ React5.createElement("blockquote", {
217
226
  className
@@ -289,6 +298,7 @@ var alignable_default = "/assets/alignable-B4QZV4X7.svg";
289
298
 
290
299
  // src/components/Sponsors/sponsorsList.ts
291
300
  var individuals = [
301
+ { username: "royalswe" },
292
302
  { username: "agalbenus" },
293
303
  { username: "phiberber" },
294
304
  { username: "cookieplace" },
@@ -597,13 +607,13 @@ function CodeBlockTransformer({ children, lineBreak }) {
597
607
  export {
598
608
  CodeBlockTransformer,
599
609
  Construction,
610
+ Danger,
600
611
  Emoji,
601
612
  FeatureList,
602
613
  HorizontalLine,
603
614
  ImportMeta,
604
615
  Info,
605
616
  Link,
606
- Note,
607
617
  P,
608
618
  ReadingRecommendation,
609
619
  RepoLink,
@@ -271,7 +271,7 @@ blockquote {
271
271
  margin-right: 0;
272
272
  padding: 4px 16px;
273
273
  }
274
- blockquote.error {
274
+ blockquote.note-color-red {
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.note-color-yellow {
283
283
  --color-strengh-bg: 4;
284
284
  --color-strengh-border: 8;
285
285
  --color:
@@ -293,11 +293,22 @@ 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
+ }
304
+ blockquote.type-danger img[src^="https://twemoji."] {
305
+ margin-right: 2px;
306
+ }
296
307
  blockquote > p:first-child::before,
297
308
  blockquote > div.paragraph:first-child::before {
298
309
  font-family: emoji;
299
310
  content: "\2139\fe0f";
300
- margin-right: 4px;
311
+ margin-right: 7px;
301
312
  }
302
313
 
303
314
  /* src/components/CodeBlockTransformer.css */
@@ -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
- const debugInfo = {
511
- msg: "Heading not found for url: " + pageUrl,
512
- urls: headings.map((h) => h.url),
513
- url: pageUrl
514
- };
515
- assert(activeHeading, debugInfo);
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,16 +1,18 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.4.17",
3
+ "version": "0.5.1",
4
4
  "scripts": {
5
5
  "// Check types while developing": "",
6
6
  "types": "tsc --noEmit --watch",
7
- "// Develop/preview Docpress using demo/": "",
8
- "dev": "docpress dev",
9
- "preview": "docpress build && docpress preview",
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",
@@ -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
  },