@barodoc/core 1.0.1 → 3.0.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.
@@ -36,6 +36,28 @@ var searchSchema = z.object({
36
36
  enabled: z.boolean().optional()
37
37
  }).optional();
38
38
  var lineNumbersSchema = z.boolean().optional();
39
+ var editLinkSchema = z.object({
40
+ baseUrl: z.string()
41
+ }).optional();
42
+ var announcementSchema = z.object({
43
+ text: z.string(),
44
+ link: z.string().optional(),
45
+ dismissible: z.boolean().optional()
46
+ }).optional();
47
+ var feedbackSchema = z.object({
48
+ enabled: z.boolean(),
49
+ endpoint: z.string().optional()
50
+ }).optional();
51
+ var docsFrontmatterSchema = z.object({
52
+ title: z.string().optional(),
53
+ description: z.string().optional(),
54
+ tags: z.array(z.string()).optional(),
55
+ related: z.array(z.string()).optional(),
56
+ category: z.string().optional(),
57
+ api_reference: z.boolean().optional(),
58
+ difficulty: z.enum(["beginner", "intermediate", "advanced"]).optional(),
59
+ lastUpdated: z.date().optional()
60
+ });
39
61
  var pluginConfigSchema = z.union([
40
62
  z.string(),
41
63
  z.tuple([z.string(), z.record(z.unknown())])
@@ -44,12 +66,18 @@ var barodocConfigSchema = z.object({
44
66
  name: z.string(),
45
67
  logo: z.string().optional(),
46
68
  favicon: z.string().optional(),
69
+ site: z.string().optional(),
70
+ base: z.string().optional(),
47
71
  theme: themeConfigSchema,
48
72
  i18n: i18nConfigSchema,
49
73
  navigation: z.array(navItemSchema),
50
74
  topbar: topbarSchema,
51
75
  search: searchSchema,
52
76
  lineNumbers: lineNumbersSchema,
77
+ editLink: editLinkSchema,
78
+ lastUpdated: z.boolean().optional(),
79
+ announcement: announcementSchema,
80
+ feedback: feedbackSchema,
53
81
  plugins: z.array(pluginConfigSchema).optional(),
54
82
  customCss: z.array(z.string()).optional()
55
83
  });
@@ -104,6 +132,7 @@ function getConfigDefaults() {
104
132
  }
105
133
 
106
134
  export {
135
+ docsFrontmatterSchema,
107
136
  barodocConfigSchema,
108
137
  loadConfig,
109
138
  getConfigDefaults
@@ -1,11 +1,43 @@
1
1
  import { z } from 'zod';
2
- import { R as ResolvedBarodocConfig, a as BarodocConfig } from '../types-Be4n5fTN.js';
2
+ import { R as ResolvedBarodocConfig, a as BarodocConfig } from '../types-EzD7o05V.js';
3
3
  import 'astro';
4
4
 
5
+ /** Frontmatter schema for MDX/MD content files. Reusable across custom and quick mode. */
6
+ declare const docsFrontmatterSchema: z.ZodObject<{
7
+ title: z.ZodOptional<z.ZodString>;
8
+ description: z.ZodOptional<z.ZodString>;
9
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
10
+ related: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
11
+ category: z.ZodOptional<z.ZodString>;
12
+ api_reference: z.ZodOptional<z.ZodBoolean>;
13
+ difficulty: z.ZodOptional<z.ZodEnum<["beginner", "intermediate", "advanced"]>>;
14
+ lastUpdated: z.ZodOptional<z.ZodDate>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ title?: string | undefined;
17
+ description?: string | undefined;
18
+ tags?: string[] | undefined;
19
+ related?: string[] | undefined;
20
+ category?: string | undefined;
21
+ api_reference?: boolean | undefined;
22
+ difficulty?: "beginner" | "intermediate" | "advanced" | undefined;
23
+ lastUpdated?: Date | undefined;
24
+ }, {
25
+ title?: string | undefined;
26
+ description?: string | undefined;
27
+ tags?: string[] | undefined;
28
+ related?: string[] | undefined;
29
+ category?: string | undefined;
30
+ api_reference?: boolean | undefined;
31
+ difficulty?: "beginner" | "intermediate" | "advanced" | undefined;
32
+ lastUpdated?: Date | undefined;
33
+ }>;
34
+ type DocsFrontmatter = z.infer<typeof docsFrontmatterSchema>;
5
35
  declare const barodocConfigSchema: z.ZodObject<{
6
36
  name: z.ZodString;
7
37
  logo: z.ZodOptional<z.ZodString>;
8
38
  favicon: z.ZodOptional<z.ZodString>;
39
+ site: z.ZodOptional<z.ZodString>;
40
+ base: z.ZodOptional<z.ZodString>;
9
41
  theme: z.ZodOptional<z.ZodObject<{
10
42
  colors: z.ZodOptional<z.ZodObject<{
11
43
  primary: z.ZodOptional<z.ZodString>;
@@ -123,6 +155,37 @@ declare const barodocConfigSchema: z.ZodObject<{
123
155
  enabled?: boolean | undefined;
124
156
  }>>;
125
157
  lineNumbers: z.ZodOptional<z.ZodBoolean>;
158
+ editLink: z.ZodOptional<z.ZodObject<{
159
+ baseUrl: z.ZodString;
160
+ }, "strip", z.ZodTypeAny, {
161
+ baseUrl: string;
162
+ }, {
163
+ baseUrl: string;
164
+ }>>;
165
+ lastUpdated: z.ZodOptional<z.ZodBoolean>;
166
+ announcement: z.ZodOptional<z.ZodObject<{
167
+ text: z.ZodString;
168
+ link: z.ZodOptional<z.ZodString>;
169
+ dismissible: z.ZodOptional<z.ZodBoolean>;
170
+ }, "strip", z.ZodTypeAny, {
171
+ text: string;
172
+ link?: string | undefined;
173
+ dismissible?: boolean | undefined;
174
+ }, {
175
+ text: string;
176
+ link?: string | undefined;
177
+ dismissible?: boolean | undefined;
178
+ }>>;
179
+ feedback: z.ZodOptional<z.ZodObject<{
180
+ enabled: z.ZodBoolean;
181
+ endpoint: z.ZodOptional<z.ZodString>;
182
+ }, "strip", z.ZodTypeAny, {
183
+ enabled: boolean;
184
+ endpoint?: string | undefined;
185
+ }, {
186
+ enabled: boolean;
187
+ endpoint?: string | undefined;
188
+ }>>;
126
189
  plugins: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>], null>]>, "many">>;
127
190
  customCss: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
128
191
  }, "strip", z.ZodTypeAny, {
@@ -131,8 +194,11 @@ declare const barodocConfigSchema: z.ZodObject<{
131
194
  group: z.ZodString;
132
195
  pages: z.ZodArray<z.ZodString, "many">;
133
196
  }, z.ZodTypeAny, "passthrough">[];
197
+ lastUpdated?: boolean | undefined;
134
198
  logo?: string | undefined;
135
199
  favicon?: string | undefined;
200
+ site?: string | undefined;
201
+ base?: string | undefined;
136
202
  theme?: {
137
203
  colors?: {
138
204
  primary?: string | undefined;
@@ -164,6 +230,18 @@ declare const barodocConfigSchema: z.ZodObject<{
164
230
  enabled?: boolean | undefined;
165
231
  } | undefined;
166
232
  lineNumbers?: boolean | undefined;
233
+ editLink?: {
234
+ baseUrl: string;
235
+ } | undefined;
236
+ announcement?: {
237
+ text: string;
238
+ link?: string | undefined;
239
+ dismissible?: boolean | undefined;
240
+ } | undefined;
241
+ feedback?: {
242
+ enabled: boolean;
243
+ endpoint?: string | undefined;
244
+ } | undefined;
167
245
  plugins?: (string | [string, Record<string, unknown>])[] | undefined;
168
246
  customCss?: string[] | undefined;
169
247
  }, {
@@ -172,8 +250,11 @@ declare const barodocConfigSchema: z.ZodObject<{
172
250
  group: z.ZodString;
173
251
  pages: z.ZodArray<z.ZodString, "many">;
174
252
  }, z.ZodTypeAny, "passthrough">[];
253
+ lastUpdated?: boolean | undefined;
175
254
  logo?: string | undefined;
176
255
  favicon?: string | undefined;
256
+ site?: string | undefined;
257
+ base?: string | undefined;
177
258
  theme?: {
178
259
  colors?: {
179
260
  primary?: string | undefined;
@@ -205,6 +286,18 @@ declare const barodocConfigSchema: z.ZodObject<{
205
286
  enabled?: boolean | undefined;
206
287
  } | undefined;
207
288
  lineNumbers?: boolean | undefined;
289
+ editLink?: {
290
+ baseUrl: string;
291
+ } | undefined;
292
+ announcement?: {
293
+ text: string;
294
+ link?: string | undefined;
295
+ dismissible?: boolean | undefined;
296
+ } | undefined;
297
+ feedback?: {
298
+ enabled: boolean;
299
+ endpoint?: string | undefined;
300
+ } | undefined;
208
301
  plugins?: (string | [string, Record<string, unknown>])[] | undefined;
209
302
  customCss?: string[] | undefined;
210
303
  }>;
@@ -214,4 +307,4 @@ type BarodocConfigOutput = z.output<typeof barodocConfigSchema>;
214
307
  declare function loadConfig(configPath: string, root: string): Promise<ResolvedBarodocConfig>;
215
308
  declare function getConfigDefaults(): Partial<BarodocConfig>;
216
309
 
217
- export { type BarodocConfigInput, type BarodocConfigOutput, barodocConfigSchema, getConfigDefaults, loadConfig };
310
+ export { type BarodocConfigInput, type BarodocConfigOutput, type DocsFrontmatter, barodocConfigSchema, docsFrontmatterSchema, getConfigDefaults, loadConfig };
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  barodocConfigSchema,
3
+ docsFrontmatterSchema,
3
4
  getConfigDefaults,
4
5
  loadConfig
5
- } from "../chunk-SX42YS3W.js";
6
+ } from "../chunk-633IEUDI.js";
6
7
  export {
7
8
  barodocConfigSchema,
9
+ docsFrontmatterSchema,
8
10
  getConfigDefaults,
9
11
  loadConfig
10
12
  };
@@ -1,4 +1,4 @@
1
- import { b as BarodocI18nConfig, c as BarodocNavItem } from '../types-Be4n5fTN.js';
1
+ import { b as BarodocI18nConfig, c as BarodocNavItem } from '../types-EzD7o05V.js';
2
2
  import 'astro';
3
3
 
4
4
  declare function getLocaleFromPath(path: string, i18n: BarodocI18nConfig): string;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AstroIntegration } from 'astro';
2
- import { B as BarodocOptions } from './types-Be4n5fTN.js';
3
- export { a as BarodocConfig, b as BarodocI18nConfig, c as BarodocNavItem, d as BarodocPlugin, e as BarodocPluginFactory, f as BarodocPluginHooks, g as BarodocThemeColors, h as BarodocThemeConfig, i as BuildContext, C as ContentContext, P as PluginConfig, j as PluginContext, R as ResolvedBarodocConfig, k as ResolvedPlugin, T as ThemeExport } from './types-Be4n5fTN.js';
4
- export { barodocConfigSchema, loadConfig } from './config/index.js';
2
+ import { B as BarodocOptions } from './types-EzD7o05V.js';
3
+ export { a as BarodocConfig, b as BarodocI18nConfig, c as BarodocNavItem, d as BarodocPlugin, e as BarodocPluginFactory, f as BarodocPluginHooks, g as BarodocThemeColors, h as BarodocThemeConfig, i as BuildContext, C as ContentContext, P as PluginConfig, j as PluginContext, R as ResolvedBarodocConfig, k as ResolvedPlugin, T as ThemeExport } from './types-EzD7o05V.js';
4
+ export { DocsFrontmatter, barodocConfigSchema, docsFrontmatterSchema, loadConfig } from './config/index.js';
5
5
  export { getLocaleFromPath, getLocaleLabel, getLocalizedNavGroup, getLocalizedPath, removeLocaleFromPath } from './i18n/index.js';
6
6
  export { definePlugin, getPluginIntegrations, loadPlugins, runConfigHook, runHook } from './plugins/index.js';
7
7
  import 'zod';
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  barodocConfigSchema,
3
+ docsFrontmatterSchema,
3
4
  loadConfig
4
- } from "./chunk-SX42YS3W.js";
5
+ } from "./chunk-633IEUDI.js";
5
6
  import {
6
7
  getLocaleFromPath,
7
8
  getLocaleLabel,
@@ -18,6 +19,8 @@ import {
18
19
  } from "./chunk-UICDSNBG.js";
19
20
 
20
21
  // src/integration.ts
22
+ import { existsSync } from "fs";
23
+ import { join } from "path";
21
24
  var VIRTUAL_CONFIG_ID = "virtual:barodoc/config";
22
25
  var VIRTUAL_I18N_ID = "virtual:barodoc/i18n";
23
26
  function resolveVirtualId(id) {
@@ -86,9 +89,20 @@ function barodoc(options) {
86
89
  };
87
90
  const themeIntegration = options.theme.integration(resolvedConfig);
88
91
  const pluginIntegrations = getPluginIntegrations(plugins, pluginContext);
92
+ const overridesDir = join(rootPath, "overrides");
93
+ const overridesAlias = {};
94
+ if (existsSync(join(overridesDir, "components"))) {
95
+ overridesAlias["@overrides/components"] = join(overridesDir, "components");
96
+ logger.info("Overrides: components/ detected");
97
+ }
98
+ if (existsSync(join(overridesDir, "layouts"))) {
99
+ overridesAlias["@overrides/layouts"] = join(overridesDir, "layouts");
100
+ logger.info("Overrides: layouts/ detected");
101
+ }
89
102
  updateConfig({
90
103
  vite: {
91
- plugins: [createVirtualModulesPlugin(resolvedConfig)]
104
+ plugins: [createVirtualModulesPlugin(resolvedConfig)],
105
+ resolve: Object.keys(overridesAlias).length > 0 ? { alias: overridesAlias } : void 0
92
106
  },
93
107
  integrations: [themeIntegration, ...pluginIntegrations]
94
108
  });
@@ -106,6 +120,7 @@ export {
106
120
  barodocConfigSchema,
107
121
  barodoc as default,
108
122
  definePlugin,
123
+ docsFrontmatterSchema,
109
124
  getLocaleFromPath,
110
125
  getLocaleLabel,
111
126
  getLocalizedNavGroup,
@@ -1,5 +1,5 @@
1
- import { k as ResolvedPlugin, j as PluginContext, P as PluginConfig, R as ResolvedBarodocConfig, f as BarodocPluginHooks, d as BarodocPlugin } from '../types-Be4n5fTN.js';
2
- export { e as BarodocPluginFactory, i as BuildContext, C as ContentContext } from '../types-Be4n5fTN.js';
1
+ import { k as ResolvedPlugin, j as PluginContext, P as PluginConfig, R as ResolvedBarodocConfig, f as BarodocPluginHooks, d as BarodocPlugin } from '../types-EzD7o05V.js';
2
+ export { e as BarodocPluginFactory, i as BuildContext, C as ContentContext } from '../types-EzD7o05V.js';
3
3
  import * as astro from 'astro';
4
4
 
5
5
  /**
@@ -117,6 +117,8 @@ interface BarodocConfig {
117
117
  name: string;
118
118
  logo?: string;
119
119
  favicon?: string;
120
+ site?: string;
121
+ base?: string;
120
122
  theme?: BarodocThemeConfig;
121
123
  i18n?: BarodocI18nConfig;
122
124
  navigation: BarodocNavItem[];
@@ -130,6 +132,23 @@ interface BarodocConfig {
130
132
  };
131
133
  /** When true, code blocks render with line numbers. */
132
134
  lineNumbers?: boolean;
135
+ /** GitHub edit link base URL for "Edit this page" links. */
136
+ editLink?: {
137
+ baseUrl: string;
138
+ };
139
+ /** When true, shows git-based last updated timestamp on each page. */
140
+ lastUpdated?: boolean;
141
+ /** Top-of-page announcement banner. */
142
+ announcement?: {
143
+ text: string;
144
+ link?: string;
145
+ dismissible?: boolean;
146
+ };
147
+ /** Page feedback widget ("Was this helpful?"). */
148
+ feedback?: {
149
+ enabled: boolean;
150
+ endpoint?: string;
151
+ };
133
152
  plugins?: PluginConfig[];
134
153
  customCss?: string[];
135
154
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barodoc/core",
3
- "version": "1.0.1",
3
+ "version": "3.0.0",
4
4
  "description": "Core integration for Barodoc documentation framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",