@thallylabs/migrate 0.2.1 → 0.2.2
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/README.md +13 -4
- package/dist/index.d.ts +71 -3
- package/dist/index.js +624 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,16 @@ Cloud. It imports documentation repositories and public documentation URLs
|
|
|
5
5
|
into one canonical bundle before any caller writes files.
|
|
6
6
|
|
|
7
7
|
Repository migration includes dedicated Mintlify and Docusaurus adapters.
|
|
8
|
-
Mintlify
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
Mintlify repositories are located inside monorepos automatically and their
|
|
9
|
+
`docs.json`/`mint.json` configuration is projected without flattening the
|
|
10
|
+
information architecture. The adapter preserves nested groups, tabs,
|
|
11
|
+
dropdowns, products, versions, languages, reusable `$ref` navigation files,
|
|
12
|
+
page route casing, redirects, local snippets, static assets, compatible page
|
|
13
|
+
frontmatter, site identity, and OpenAPI configuration. For public Mintlify
|
|
14
|
+
sites, the URL adapter reads the structured configuration embedded in the
|
|
15
|
+
rendered application before falling back to DOM link inference.
|
|
16
|
+
|
|
17
|
+
Docusaurus sidebars are parsed as bounded, data-only JSON5—never executed—and
|
|
18
|
+
preserve explicit categories, autogenerated slices, document IDs/slugs,
|
|
19
|
+
positions, generated indexes, admonitions, tabs, and `static/` assets where
|
|
20
|
+
supported.
|
package/dist/index.d.ts
CHANGED
|
@@ -7,20 +7,73 @@ type MigrationPlatform = 'mintlify' | 'docusaurus' | 'gitbook' | 'nextra' | 'vit
|
|
|
7
7
|
interface MigrationNavigationGroup {
|
|
8
8
|
group: string;
|
|
9
9
|
icon?: string;
|
|
10
|
+
hidden?: boolean;
|
|
10
11
|
pages: Array<string | MigrationNavigationGroup>;
|
|
11
12
|
}
|
|
12
13
|
interface MigrationNavigationTab {
|
|
13
14
|
tab: string;
|
|
14
15
|
href?: string;
|
|
16
|
+
hidden?: boolean;
|
|
15
17
|
groups?: Array<MigrationNavigationGroup>;
|
|
16
18
|
api?: {
|
|
17
19
|
source: string;
|
|
18
20
|
navigation?: boolean;
|
|
19
21
|
};
|
|
20
22
|
}
|
|
23
|
+
interface MigrationBannerConfig {
|
|
24
|
+
content: string | Record<string, string>;
|
|
25
|
+
dismissible?: boolean;
|
|
26
|
+
id?: string;
|
|
27
|
+
revision?: string;
|
|
28
|
+
type?: 'info' | 'warning' | 'critical';
|
|
29
|
+
color?: {
|
|
30
|
+
light?: string;
|
|
31
|
+
dark?: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
interface MigrationNavbarConfig {
|
|
35
|
+
links?: Array<{
|
|
36
|
+
label: string;
|
|
37
|
+
href: string;
|
|
38
|
+
type?: 'github';
|
|
39
|
+
}>;
|
|
40
|
+
primary?: {
|
|
41
|
+
label: string;
|
|
42
|
+
href: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
interface MigrationFooterConfig {
|
|
46
|
+
socials?: Record<string, string>;
|
|
47
|
+
links?: Array<{
|
|
48
|
+
heading: string;
|
|
49
|
+
items: Array<{
|
|
50
|
+
label: string;
|
|
51
|
+
href: string;
|
|
52
|
+
}>;
|
|
53
|
+
}>;
|
|
54
|
+
}
|
|
21
55
|
interface MigrationDocsConfig {
|
|
22
56
|
tabs: Array<MigrationNavigationTab>;
|
|
23
57
|
theme?: 'default' | 'maple' | 'sharp' | 'minimal';
|
|
58
|
+
banner?: MigrationBannerConfig;
|
|
59
|
+
navbar?: MigrationNavbarConfig;
|
|
60
|
+
footer?: MigrationFooterConfig;
|
|
61
|
+
seo?: {
|
|
62
|
+
indexing?: 'navigable' | 'all';
|
|
63
|
+
};
|
|
64
|
+
fonts?: {
|
|
65
|
+
body?: {
|
|
66
|
+
family: string;
|
|
67
|
+
weight?: Array<string>;
|
|
68
|
+
};
|
|
69
|
+
heading?: {
|
|
70
|
+
family: string;
|
|
71
|
+
weight?: Array<string>;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
feedback?: {
|
|
75
|
+
thumbsRating?: boolean;
|
|
76
|
+
};
|
|
24
77
|
ai?: {
|
|
25
78
|
chat?: boolean;
|
|
26
79
|
label?: string;
|
|
@@ -52,8 +105,13 @@ interface MigrationPage {
|
|
|
52
105
|
navigationId: string;
|
|
53
106
|
locale?: string;
|
|
54
107
|
title: string;
|
|
108
|
+
navTitle?: string;
|
|
55
109
|
description: string;
|
|
110
|
+
badge?: string;
|
|
56
111
|
keywords: Array<string>;
|
|
112
|
+
mode?: 'default' | 'wide' | 'custom' | 'center' | 'home';
|
|
113
|
+
hidden?: boolean;
|
|
114
|
+
noindex?: boolean;
|
|
57
115
|
/** OpenAPI operation key rendered by Thally instead of ordinary MDX. */
|
|
58
116
|
openapi?: string;
|
|
59
117
|
body: string;
|
|
@@ -76,6 +134,10 @@ interface MigrationBundle {
|
|
|
76
134
|
pages: Array<MigrationPage>;
|
|
77
135
|
assets: Array<MigrationAsset>;
|
|
78
136
|
docsConfig: MigrationDocsConfig;
|
|
137
|
+
site?: {
|
|
138
|
+
name?: string;
|
|
139
|
+
description?: string;
|
|
140
|
+
};
|
|
79
141
|
warnings: Array<MigrationWarning>;
|
|
80
142
|
stats: {
|
|
81
143
|
discovered: number;
|
|
@@ -134,7 +196,7 @@ declare function parseGitHubRepositoryUrl(rawUrl: string): GitHubRepositorySourc
|
|
|
134
196
|
/** Clone a repository without a shell; callers own and remove `targetDir`. */
|
|
135
197
|
declare function cloneGitHubRepository(source: GitHubRepositorySource, targetDir: string): Promise<void>;
|
|
136
198
|
/** Detect a supported repository docs platform from unambiguous config files. */
|
|
137
|
-
declare function detectRepositoryPlatform(repositoryDir: string): MigrationPlatform;
|
|
199
|
+
declare function detectRepositoryPlatform(repositoryDir: string, docsDir?: string): MigrationPlatform;
|
|
138
200
|
/** Pick the first conventional content root containing Markdown. */
|
|
139
201
|
declare function detectRepositoryDocsDir(repositoryDir: string): string;
|
|
140
202
|
/** Import an already-available repository directory into a canonical bundle. */
|
|
@@ -156,10 +218,16 @@ interface MintlifyNavigationResult {
|
|
|
156
218
|
pageReferences: Array<MintlifyPageReference>;
|
|
157
219
|
warnings: Array<MigrationWarning>;
|
|
158
220
|
}
|
|
221
|
+
interface MintlifyProjectionOptions {
|
|
222
|
+
/** Public URL migrations may expose page hrefs including the docs mount path. */
|
|
223
|
+
pathPrefix?: string;
|
|
224
|
+
}
|
|
225
|
+
/** Preserve Mintlify's implicit `/section` route for section landing pages. */
|
|
226
|
+
declare function addMintlifyDirectoryRedirects(config: MigrationDocsConfig, pages: Array<MigrationPage>): MigrationDocsConfig;
|
|
159
227
|
/** Read `docs.json`/`mint.json`, including bounded local JSON references. */
|
|
160
228
|
declare function readMintlifyConfig(repositoryRoot: string): Record<string, unknown> | null;
|
|
161
229
|
/** Convert current and legacy Mintlify navigation into Thally's schema. */
|
|
162
|
-
declare function projectMintlifyNavigation(config: Record<string, unknown
|
|
230
|
+
declare function projectMintlifyNavigation(config: Record<string, unknown>, options?: MintlifyProjectionOptions): MintlifyNavigationResult;
|
|
163
231
|
interface GeneratedNavigationOptions {
|
|
164
232
|
/** Dedicated docs platforms expose their primary sections as top-level tabs. */
|
|
165
233
|
topLevelTabs?: boolean;
|
|
@@ -224,4 +292,4 @@ declare const defaultMigrationFetcher: MigrationFetcher;
|
|
|
224
292
|
/** Crawl one public docs origin into a canonical, caller-independent bundle. */
|
|
225
293
|
declare function migrateUrl(options: UrlMigrationOptions): Promise<MigrationBundle>;
|
|
226
294
|
|
|
227
|
-
export { type GitHubRepositorySource, type MigrationAsset, type MigrationBundle, type MigrationDocsConfig, type MigrationFetchRequest, type MigrationFetchResponse, type MigrationFetcher, type MigrationNavigationGroup, type MigrationNavigationTab, type MigrationPage, type MigrationPlatform, type MigrationWarning, type RenderedMigrationFile, type RepositoryMigrationOptions, type UrlMigrationOptions, buildNavigationFromPages, cloneGitHubRepository, defaultMigrationFetcher, detectRepositoryDocsDir, detectRepositoryPlatform, mergeMigrationConfig, migrateRepository, migrateUrl, normalizeMdx, parseGitHubRepositoryUrl, parseMarkdownPage, projectMintlifyNavigation, readMintlifyConfig, renderMigrationFiles, validateMigrationUrl };
|
|
295
|
+
export { type GitHubRepositorySource, type MigrationAsset, type MigrationBundle, type MigrationDocsConfig, type MigrationFetchRequest, type MigrationFetchResponse, type MigrationFetcher, type MigrationNavigationGroup, type MigrationNavigationTab, type MigrationPage, type MigrationPlatform, type MigrationWarning, type RenderedMigrationFile, type RepositoryMigrationOptions, type UrlMigrationOptions, addMintlifyDirectoryRedirects, buildNavigationFromPages, cloneGitHubRepository, defaultMigrationFetcher, detectRepositoryDocsDir, detectRepositoryPlatform, mergeMigrationConfig, migrateRepository, migrateUrl, normalizeMdx, parseGitHubRepositoryUrl, parseMarkdownPage, projectMintlifyNavigation, readMintlifyConfig, renderMigrationFiles, validateMigrationUrl };
|