@clarify-labs/cli 0.10.2 → 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/cli.cjs +18 -32
- package/output/cli.cjs.map +1 -1
- package/output/cli.js +18 -32
- package/output/cli.js.map +1 -1
- package/output/core/adapters.d.ts +5 -0
- package/output/core/config/config-schema.d.ts +196 -201
- package/output/core/config/config.d.ts +2 -1
- package/output/core/config/options.d.ts +0 -8
- package/output/core/config/user-config.d.ts +4 -3
- package/output/core/engine/engine.d.ts +1 -0
- package/output/core/project/project-info.d.ts +3 -3
- package/output/core/runtime/ssg.d.ts +1 -1
- package/output/core/runtime/virtual-modules.d.ts +2 -2
- package/output/{engine-qafLfnXQ.cjs → engine-BfkoyVNo.cjs} +353 -236
- package/output/engine-BfkoyVNo.cjs.map +1 -0
- package/output/{engine-CSSL_gGd.js → engine-DfF5RJjC.js} +353 -236
- package/output/engine-DfF5RJjC.js.map +1 -0
- package/output/index.cjs +1 -1
- package/output/index.js +1 -1
- package/output/parsers/content/diagnostic.d.ts +12 -0
- package/output/parsers/markdown/mdx.d.ts +8 -0
- package/output/parsers/routes/routes.d.ts +7 -7
- package/output/parsers/routes/routes.test-utils.d.ts +2 -2
- package/output/plugins/openapi/parser.d.ts +1 -1
- package/output/plugins/openapi/virtual-modules.d.ts +1 -2
- package/output/plugins/source-links/source-links.d.ts +3 -3
- package/output/types.d.ts +67 -42
- package/package.json +3 -3
- package/output/engine-CSSL_gGd.js.map +0 -1
- package/output/engine-qafLfnXQ.cjs.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ConfigEnv } from 'vite';
|
|
2
|
-
import { ClarifyProjectConfig } from '../../types.js';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { ClarifyProjectConfig, ClarifyPlugin } from '../../types.js';
|
|
3
|
+
export type ClarifyConfig = ClarifyProjectConfig & {
|
|
4
|
+
plugins?: ClarifyPlugin[];
|
|
5
|
+
};
|
|
5
6
|
export declare function defineConfig(config: ClarifyConfig): ClarifyConfig;
|
|
6
7
|
/**
|
|
7
8
|
* Config filenames Clarify CLI looks for at the project root, in resolution
|
|
@@ -6,6 +6,7 @@ import { VirtualModules } from '../runtime/virtual-modules.js';
|
|
|
6
6
|
import { ClarifyContext } from './context.js';
|
|
7
7
|
import { ClarifyEngineRuntime, PrepareOptions } from './types.js';
|
|
8
8
|
export type { ClarifyEngineMode, ClarifyEngineRuntime, PrepareOptions } from './types.js';
|
|
9
|
+
export declare function assertNoContentDiagnostics(routes: ContentRoute[]): void;
|
|
9
10
|
export declare class ClarifyEngine {
|
|
10
11
|
readonly options: ClarifyBuildOptions;
|
|
11
12
|
readonly root: string;
|
|
@@ -11,7 +11,7 @@ import { ClarifyProjectContext } from '../../types.js';
|
|
|
11
11
|
* - `contentRoot`: the resolved content root directory name (relative to
|
|
12
12
|
* the project root, e.g. `"source"`).
|
|
13
13
|
* - `projectRoot`: the absolute project root path.
|
|
14
|
-
* - `
|
|
14
|
+
* - `locales`: locale information when localization is configured.
|
|
15
15
|
*/
|
|
16
16
|
export declare const CLARIFY_DEV_PROJECT_INFO_ENDPOINT = "/dev/project-info";
|
|
17
17
|
/**
|
|
@@ -26,8 +26,8 @@ export type ProjectInfoResponse = {
|
|
|
26
26
|
contentFileExtensions: readonly string[];
|
|
27
27
|
contentRoot: string;
|
|
28
28
|
projectRoot: string;
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
locales?: {
|
|
30
|
+
default: string;
|
|
31
31
|
locales: string[];
|
|
32
32
|
};
|
|
33
33
|
};
|
|
@@ -7,4 +7,4 @@ export declare function routeOutputFiles(outputDirectory: string, route: Content
|
|
|
7
7
|
export declare const SSR_ENTRY_CODE = "import { renderToHTML } from '@clarify-labs/renderer/server';\nimport { routes, navigation } from 'virtual:clarify/routes/server';\nimport { config } from 'virtual:clarify/config';\nimport { openApiSpecs } from 'virtual:clarify/openapi/server';\nimport { runtimeSlots } from 'virtual:clarify/slots';\n\nexport async function render(url) {\n // Pre-resolve every slot component factory so renderToString can use\n // them synchronously (renderToString has no Suspense support).\n const entries = Object.values(runtimeSlots).flat()\n await Promise.all(entries.map(async (entry) => {\n const mod = await entry.loadComponent()\n entry._resolved = mod.default\n }))\n return renderToHTML({ config, routes, navigation, openApiSpecs, runtimeSlots, url, themeEditor: config.theme.editor });\n}";
|
|
8
8
|
export declare function createTempEntryFile(content: string): string;
|
|
9
9
|
export declare function buildSSRBundle(root: string, ssrEntry: string, ssrOutDir: string, plugins: Plugin[]): Promise<void>;
|
|
10
|
-
export declare function renderSSGRoutes(routes: ContentRoute[], contextOrConfig: ClarifyProjectContext | ResolvedProjectConfig, outputDirectory: string, ssrBundlePath: string
|
|
10
|
+
export declare function renderSSGRoutes(routes: ContentRoute[], contextOrConfig: ClarifyProjectContext | ResolvedProjectConfig, outputDirectory: string, ssrBundlePath: string): Promise<void>;
|
|
@@ -31,7 +31,7 @@ export declare function stripVirtualPrefix(id: string): string;
|
|
|
31
31
|
* if the ID is not a Clarify virtual module.
|
|
32
32
|
*/
|
|
33
33
|
export declare function resolveVirtualModuleId(id: string, modules: VirtualModules, routes: readonly ContentRoute[]): string | null;
|
|
34
|
-
export declare function generateConfigModule(projectConfig: ResolvedProjectConfig,
|
|
34
|
+
export declare function generateConfigModule(projectConfig: ResolvedProjectConfig, version?: string): string;
|
|
35
35
|
export declare function generateRoutesModule(routes: ContentRoute[], navigation: NavigationTree, mode?: 'client' | 'server'): string;
|
|
36
36
|
export declare function createClientEntryModule(options?: CreateClientEntryModuleOptions): string;
|
|
37
37
|
/**
|
|
@@ -47,6 +47,6 @@ export declare function createClientEntryModule(options?: CreateClientEntryModul
|
|
|
47
47
|
* type — no runtime validation is needed.
|
|
48
48
|
*/
|
|
49
49
|
export declare function createRuntimeSlotsModule(plugins?: ClarifyPlugin[], root?: string): string;
|
|
50
|
-
export declare function
|
|
50
|
+
export declare function generateContentDiagnosticModule(diagnostic: ContentDiagnostic): string;
|
|
51
51
|
export declare function buildVirtualModules(args: BuildVirtualModulesArgs): VirtualModules;
|
|
52
52
|
export {};
|