@clarify-labs/cli 0.10.3 → 0.11.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/output/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_engine = require("./engine-BDdPszs2.cjs");
2
+ const require_engine = require("./engine-BfkoyVNo.cjs");
3
3
  exports.ClarifyEngine = require_engine.ClarifyEngine;
4
4
  exports.createClarifyEngine = require_engine.createClarifyEngine;
5
5
  exports.createViteAdapter = require_engine.createViteAdapter;
package/output/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { c as defineConfig, n as createClarifyEngine, s as createViteAdapter, t as ClarifyEngine } from "./engine-CyFtr8Pz.js";
1
+ import { c as defineConfig, n as createClarifyEngine, s as createViteAdapter, t as ClarifyEngine } from "./engine-DfF5RJjC.js";
2
2
  export { ClarifyEngine, createClarifyEngine, createViteAdapter, defineConfig };
@@ -1,4 +1,4 @@
1
- import { ContentRoute, ContentSection, ClarifyNavigationNode, ClarifyPagesConfig, ClarifyPagesGroup, ClarifyPagesItem, ClarifyRouteIntent, ClarifyLocalizedText, ClarifyTabsConfig, LocalizedNavigation, LocalizedTabbedNavigation, ResolvedClarifyI18nConfig, TabbedNavigation } from '../../types.js';
1
+ import { ContentRoute, ContentSection, ClarifyNavigationNode, ClarifyPagesConfig, ClarifyPagesGroup, ClarifyPagesItem, ClarifyRouteIntent, ClarifyLocalizedText, ClarifyTabsConfig, LocalizedNavigation, LocalizedTabbedNavigation, ResolvedClarifyLocalesConfig, TabbedNavigation } from '../../types.js';
2
2
  import { ContentProcessor } from '../content/content.js';
3
3
  export type FindContentRoutesOptions = {
4
4
  contentProcessor?: ContentProcessor;
@@ -12,15 +12,15 @@ export declare function basePathFromRef(ref: string): string;
12
12
  export declare function openAPIPagePathFromRef(ref: string, tagFilter?: string[], explicitPath?: string): string;
13
13
  export declare function routePathFromRef(ref: string, explicitPath?: string): string;
14
14
  export declare function virtualModuleIdFromRef(ref: string): string;
15
- export declare function localizedRoutePath(basePath: string, locale: string, _i18n: ResolvedClarifyI18nConfig): string;
15
+ export declare function localizedRoutePath(basePath: string, locale: string, _i18n: ResolvedClarifyLocalesConfig): string;
16
16
  export declare function resolveLocalizedText(text: ClarifyLocalizedText | undefined, locale: string, fallbackLocale?: string): string | undefined;
17
17
  export declare function findContentRoutes(dir: string, base?: string, options?: FindContentRoutesOptions): Promise<ContentRoute[]>;
18
- export declare function withAlternates(route: ContentRoute, routes: ContentRoute[], i18n: ResolvedClarifyI18nConfig): ContentRoute;
19
- export declare function findLocalizedContentRoutes(contentRoot: string, i18n?: ResolvedClarifyI18nConfig, options?: FindContentRoutesOptions): Promise<ContentRoute[]>;
18
+ export declare function withAlternates(route: ContentRoute, routes: ContentRoute[], locales: ResolvedClarifyLocalesConfig): ContentRoute;
19
+ export declare function findLocalizedContentRoutes(contentRoot: string, locales?: ResolvedClarifyLocalesConfig, options?: FindContentRoutesOptions): Promise<ContentRoute[]>;
20
20
  export declare function buildNavigation(routes: ContentRoute[]): ClarifyNavigationNode[];
21
21
  export declare function routeIntentFromPagesItem(item: ClarifyPagesItem): ClarifyRouteIntent;
22
- export declare function applyConfiguredPageRoutePaths(routes: ContentRoute[], tabs?: ClarifyTabsConfig, i18n?: ResolvedClarifyI18nConfig): ContentRoute[];
22
+ export declare function applyConfiguredPageRoutePaths(routes: ContentRoute[], tabs?: ClarifyTabsConfig, locales?: ResolvedClarifyLocalesConfig): ContentRoute[];
23
23
  export declare function buildNavigationFromTabsConfig(routes: ContentRoute[], tabs: ClarifyTabsConfig): TabbedNavigation;
24
24
  export declare function buildNavigationFromConfig(routes: ContentRoute[], config: ClarifyPagesGroup[]): ClarifyNavigationNode[];
25
- export declare function buildLocalizedNavigation(routes: ContentRoute[], config: ClarifyPagesConfig | undefined, i18n?: ResolvedClarifyI18nConfig): LocalizedNavigation | undefined;
26
- export declare function buildLocalizedNavigationFromTabsConfig(routes: ContentRoute[], tabs: ClarifyTabsConfig, i18n?: ResolvedClarifyI18nConfig): LocalizedTabbedNavigation | undefined;
25
+ export declare function buildLocalizedNavigation(routes: ContentRoute[], config: ClarifyPagesConfig | undefined, localesConfig?: ResolvedClarifyLocalesConfig): LocalizedNavigation | undefined;
26
+ export declare function buildLocalizedNavigationFromTabsConfig(routes: ContentRoute[], tabs: ClarifyTabsConfig, localesConfig?: ResolvedClarifyLocalesConfig): LocalizedTabbedNavigation | undefined;
@@ -1,4 +1,4 @@
1
- import { ContentRoute, ResolvedClarifyI18nConfig } from '../../types.js';
1
+ import { ContentRoute, ResolvedClarifyLocalesConfig } from '../../types.js';
2
2
  type ContentRouteFixture = Partial<Omit<ContentRoute, 'kind' | 'meta' | 'module' | 'source'>> & {
3
3
  kind?: ContentRoute['kind'];
4
4
  title?: string;
@@ -16,5 +16,5 @@ type ContentRouteFixture = Partial<Omit<ContentRoute, 'kind' | 'meta' | 'module'
16
16
  };
17
17
  export declare function contentRoute(route?: ContentRouteFixture): ContentRoute;
18
18
  export declare function mdxRoute(route?: ContentRouteFixture): ContentRoute;
19
- export declare const testI18n: ResolvedClarifyI18nConfig;
19
+ export declare const testI18n: ResolvedClarifyLocalesConfig;
20
20
  export {};
@@ -1,3 +1,3 @@
1
- import { ClarifySourceConfig, ContentRoute } from '../../types.js';
2
- export declare function createSourceEditUrl(filePath: string, contentRoot: string, source: ClarifySourceConfig): string;
3
- export declare function attachSourceEditUrls(routes: ContentRoute[], contentRoot: string, source?: ClarifySourceConfig): void;
1
+ import { ClarifyRepositoryConfig, ContentRoute } from '../../types.js';
2
+ export declare function createSourceEditUrl(filePath: string, contentRoot: string, source: ClarifyRepositoryConfig): string;
3
+ export declare function attachSourceEditUrls(routes: ContentRoute[], contentRoot: string, source?: ClarifyRepositoryConfig): void;
package/output/types.d.ts CHANGED
@@ -19,14 +19,16 @@ export type ClarifyLocaleConfig = {
19
19
  label: string;
20
20
  dir?: 'ltr' | 'rtl';
21
21
  };
22
- export type ClarifyI18nConfig = {
23
- /** Default visible locale. Content is read from rootDirectory/defaultLocale. */
24
- defaultLocale?: string;
22
+ export type ClarifyLocalesConfig = {
23
+ /** Default visible locale. Localized content is read from rootDirectory/<locale>. */
24
+ default?: string;
25
25
  /** Missing translation behavior. Fallback uses default locale content. */
26
26
  missing?: 'fallback' | '404' | 'hide';
27
27
  locales: ClarifyLocaleConfig[];
28
28
  };
29
- export type ResolvedClarifyI18nConfig = Required<Pick<ClarifyI18nConfig, 'defaultLocale' | 'missing'>> & {
29
+ export type ResolvedClarifyLocalesConfig = {
30
+ default: string;
31
+ missing: 'fallback' | '404' | 'hide';
30
32
  locales: ClarifyLocaleConfig[];
31
33
  };
32
34
  export type ClarifyNavbarLink = {
@@ -49,10 +51,10 @@ export type ClarifyVariableValue = ClarifyVariablePrimitive | {
49
51
  [key: string]: ClarifyVariableValue;
50
52
  };
51
53
  export type ClarifyVariablesConfig = Record<string, ClarifyVariableValue>;
52
- export type ClarifySourceConfig = {
54
+ export type ClarifyRepositoryConfig = {
53
55
  /** Repository web URL, for example https://github.com/owner/repo. */
54
- repository: string;
55
- /** Source branch used for edit links. Default: main. */
56
+ url?: string;
57
+ /** Source branch. Default: main. */
56
58
  branch?: string;
57
59
  /** Directory prefix inside the repository that maps to rootDirectory. */
58
60
  directory?: string;
@@ -102,8 +104,6 @@ export type ClarifyThemeConfig = {
102
104
  tokens?: ClarifyThemeTokensConfig;
103
105
  /** Documentation layout overrides applied on top of the selected preset. */
104
106
  layout?: ClarifyThemeLayoutConfig;
105
- /** Expose the live theme editor in the built site. Dev mode enables it automatically. */
106
- editor?: boolean;
107
107
  };
108
108
  export type ResolvedClarifyThemeTokensConfig = {
109
109
  colors: Required<ClarifyThemeColorTokensConfig>;
@@ -114,7 +114,6 @@ export type ResolvedClarifyThemeConfig = {
114
114
  preset: ClarifyThemePreset;
115
115
  tokens: ResolvedClarifyThemeTokensConfig;
116
116
  layout: ResolvedClarifyThemeLayoutConfig;
117
- editor: boolean;
118
117
  };
119
118
  export type ClarifyPagesItem = string | ClarifyPagesGroup | {
120
119
  page: string;
@@ -175,6 +174,44 @@ export type ClarifyTabItem = {
175
174
  pages?: ClarifyPagesConfig;
176
175
  };
177
176
  export type ClarifyTabsConfig = ClarifyTabItem[];
177
+ export type ClarifyNavigationConfig = {
178
+ /** Links displayed in the top navigation. */
179
+ links?: ClarifyNavbarLink[];
180
+ /** Top-level documentation tabs. Each tab owns its sidebar pages. */
181
+ tabs?: ClarifyTabsConfig;
182
+ };
183
+ export type ClarifyFeatureConfig<Options extends object = Record<never, never>> = boolean | ({
184
+ enabled?: boolean;
185
+ } & Options);
186
+ export type ClarifyFeaturesConfig = {
187
+ search?: ClarifyFeatureConfig<{
188
+ provider?: 'pagefind';
189
+ }>;
190
+ repository?: ClarifyFeatureConfig<ClarifyRepositoryConfig>;
191
+ themeEditor?: ClarifyFeatureConfig;
192
+ openapi?: ClarifyFeatureConfig<{
193
+ playground?: boolean;
194
+ }>;
195
+ };
196
+ export type ResolvedClarifyFeaturesConfig = {
197
+ search: {
198
+ enabled: boolean;
199
+ provider: 'pagefind';
200
+ };
201
+ repository: {
202
+ enabled: boolean;
203
+ url?: string;
204
+ branch?: string;
205
+ directory?: string;
206
+ };
207
+ themeEditor: {
208
+ enabled: boolean;
209
+ };
210
+ openapi: {
211
+ enabled: boolean;
212
+ playground: boolean;
213
+ };
214
+ };
178
215
  export type ClarifyProjectConfig = {
179
216
  /** Site title. Used in Header and SEO meta tags. */
180
217
  title?: string;
@@ -182,54 +219,47 @@ export type ClarifyProjectConfig = {
182
219
  description?: string;
183
220
  /** Canonical public site URL. Enables sitemap.xml and robots.txt generation. */
184
221
  siteUrl?: string;
185
- /** Source repository configuration for Edit this page links. */
186
- source?: ClarifySourceConfig;
222
+ /** Route prefix where the site is mounted. Default: '/'. */
223
+ routePrefix?: string;
224
+ /** Path or URL prefix for emitted assets. Defaults to routePrefix. */
225
+ assetPrefix?: string;
187
226
  /** Path to site logo image (relative to rootDirectory or absolute). Supports light/dark mode. */
188
227
  logo?: ClarifyLogoConfig;
189
228
  /** URL used when clicking the top navigation logo. Defaults to '/'. */
190
229
  homeUrl?: string;
191
230
  /** Favicon path or light/dark variants. */
192
231
  favicon?: ClarifyFaviconConfig;
193
- /** Theme preset, token overrides, and editor options. */
232
+ /** Theme preset, token overrides, and layout options. */
194
233
  theme?: ClarifyThemeConfig;
195
- /** Base path for the docs site. Default: '/' */
196
- routePrefix?: string;
197
- /** Base path or URL for emitted static assets. Defaults to routePrefix. */
198
- assetPrefix?: string;
199
- /** Top navigation links. */
200
- navbar?: {
201
- links?: ClarifyNavbarLink[];
202
- };
234
+ /** Top navigation links and documentation tabs. */
235
+ navigation?: ClarifyNavigationConfig;
203
236
  /** Announcement banner displayed at the top of the page. */
204
237
  banner?: ClarifyBannerConfig;
205
238
  /** Footer configuration. */
206
239
  footer?: ClarifyFooterConfig;
240
+ /** Localized content configuration. */
241
+ locales?: ClarifyLocalesConfig;
207
242
  /** Reusable constants available in supported content via {{ variableName }} placeholders. */
208
243
  variables?: ClarifyVariablesConfig;
209
- /** Native multi-language support. Locale content lives under rootDirectory/{locale}. */
210
- i18n?: ClarifyI18nConfig;
211
- /** Top-level documentation tabs. Each tab owns its own sidebar pages. */
212
- tabs?: ClarifyTabsConfig;
244
+ /** Optional product capabilities. All built-in features are enabled by default. */
245
+ features?: ClarifyFeaturesConfig;
213
246
  };
214
247
  export type ResolvedProjectConfig = {
215
248
  title: string;
216
- logo?: ClarifyLogoConfig;
217
- homeUrl?: string;
218
249
  description: string;
219
250
  siteUrl?: string;
220
- source?: ClarifySourceConfig;
221
251
  routePrefix: string;
222
252
  assetPrefix: string;
253
+ logo?: ClarifyLogoConfig;
254
+ homeUrl?: string;
223
255
  favicon?: ClarifyFaviconConfig;
224
256
  theme: ResolvedClarifyThemeConfig;
225
- navbar?: {
226
- links?: ClarifyNavbarLink[];
227
- };
257
+ navigation?: ClarifyNavigationConfig;
228
258
  banner?: ClarifyBannerConfig;
229
259
  footer?: ClarifyFooterConfig;
260
+ locales?: ResolvedClarifyLocalesConfig;
230
261
  variables: ClarifyVariablesConfig;
231
- i18n?: ResolvedClarifyI18nConfig;
232
- tabs?: ClarifyTabsConfig;
262
+ features: ResolvedClarifyFeaturesConfig;
233
263
  };
234
264
  export type ContentSection = {
235
265
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clarify-labs/cli",
3
- "version": "0.10.3",
3
+ "version": "0.11.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "type": "module",
6
6
  "repository": {
@@ -39,8 +39,8 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@apidevtools/swagger-parser": "^12.1.0",
42
- "@clarify-labs/renderer": "0.10.3",
43
- "@clarify-labs/templates": "0.10.3",
42
+ "@clarify-labs/renderer": "0.11.0",
43
+ "@clarify-labs/templates": "0.11.0",
44
44
  "@mdx-js/mdx": "^3.1.1",
45
45
  "@mdx-js/rollup": "^3.1.1",
46
46
  "@shikijs/rehype": "^4.3.0",