@thallylabs/migrate 0.2.1 → 0.2.3

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 CHANGED
@@ -5,7 +5,17 @@ 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 configuration is projected from `docs.json`/`mint.json`. Docusaurus
9
- sidebars are parsed as bounded, data-only JSON5—never executed—and preserve
10
- explicit categories, autogenerated slices, document IDs/slugs, positions,
11
- generated indexes, admonitions, tabs, and `static/` assets where supported.
8
+ Mintlify repositories are located inside monorepos automatically. Their
9
+ `docs.json`/`mint.json` page and group trees are projected without flattening
10
+ authored nesting or order. The adapter supports tabs, dropdowns, products,
11
+ versions, languages, and reusable `$ref` navigation files; it also preserves
12
+ dropdown presentation, collection descriptions and icons, explicit default
13
+ versions, page route casing, redirects, local snippets, static assets,
14
+ compatible page frontmatter, site identity, and OpenAPI configuration. For public Mintlify
15
+ sites, the URL adapter reads the structured configuration embedded in the
16
+ rendered application before falling back to DOM link inference.
17
+
18
+ Docusaurus sidebars are parsed as bounded, data-only JSON5—never executed—and
19
+ preserve explicit categories, autogenerated slices, document IDs/slugs,
20
+ positions, generated indexes, admonitions, tabs, and `static/` assets where
21
+ supported.
package/dist/index.d.ts CHANGED
@@ -7,20 +7,81 @@ 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;
15
+ description?: string;
16
+ icon?: string;
14
17
  href?: string;
18
+ hidden?: boolean;
19
+ /** Root page/group nodes used when the source has no synthetic section heading. */
20
+ pages?: Array<string | MigrationNavigationGroup>;
15
21
  groups?: Array<MigrationNavigationGroup>;
16
22
  api?: {
17
23
  source: string;
18
24
  navigation?: boolean;
19
25
  };
20
26
  }
27
+ interface MigrationBannerConfig {
28
+ content: string | Record<string, string>;
29
+ dismissible?: boolean;
30
+ id?: string;
31
+ revision?: string;
32
+ type?: 'info' | 'warning' | 'critical';
33
+ color?: {
34
+ light?: string;
35
+ dark?: string;
36
+ };
37
+ }
38
+ interface MigrationNavbarConfig {
39
+ links?: Array<{
40
+ label: string;
41
+ href: string;
42
+ type?: 'github';
43
+ }>;
44
+ primary?: {
45
+ label: string;
46
+ href: string;
47
+ };
48
+ }
49
+ interface MigrationFooterConfig {
50
+ socials?: Record<string, string>;
51
+ links?: Array<{
52
+ heading: string;
53
+ items: Array<{
54
+ label: string;
55
+ href: string;
56
+ }>;
57
+ }>;
58
+ }
21
59
  interface MigrationDocsConfig {
22
60
  tabs: Array<MigrationNavigationTab>;
61
+ navigation?: {
62
+ /** How sibling documentation collections are presented to readers. */
63
+ display?: 'tabs' | 'dropdown';
64
+ };
23
65
  theme?: 'default' | 'maple' | 'sharp' | 'minimal';
66
+ banner?: MigrationBannerConfig;
67
+ navbar?: MigrationNavbarConfig;
68
+ footer?: MigrationFooterConfig;
69
+ seo?: {
70
+ indexing?: 'navigable' | 'all';
71
+ };
72
+ fonts?: {
73
+ body?: {
74
+ family: string;
75
+ weight?: Array<string>;
76
+ };
77
+ heading?: {
78
+ family: string;
79
+ weight?: Array<string>;
80
+ };
81
+ };
82
+ feedback?: {
83
+ thumbsRating?: boolean;
84
+ };
24
85
  ai?: {
25
86
  chat?: boolean;
26
87
  label?: string;
@@ -52,8 +113,13 @@ interface MigrationPage {
52
113
  navigationId: string;
53
114
  locale?: string;
54
115
  title: string;
116
+ navTitle?: string;
55
117
  description: string;
118
+ badge?: string;
56
119
  keywords: Array<string>;
120
+ mode?: 'default' | 'wide' | 'custom' | 'center' | 'home';
121
+ hidden?: boolean;
122
+ noindex?: boolean;
57
123
  /** OpenAPI operation key rendered by Thally instead of ordinary MDX. */
58
124
  openapi?: string;
59
125
  body: string;
@@ -76,6 +142,10 @@ interface MigrationBundle {
76
142
  pages: Array<MigrationPage>;
77
143
  assets: Array<MigrationAsset>;
78
144
  docsConfig: MigrationDocsConfig;
145
+ site?: {
146
+ name?: string;
147
+ description?: string;
148
+ };
79
149
  warnings: Array<MigrationWarning>;
80
150
  stats: {
81
151
  discovered: number;
@@ -134,7 +204,7 @@ declare function parseGitHubRepositoryUrl(rawUrl: string): GitHubRepositorySourc
134
204
  /** Clone a repository without a shell; callers own and remove `targetDir`. */
135
205
  declare function cloneGitHubRepository(source: GitHubRepositorySource, targetDir: string): Promise<void>;
136
206
  /** Detect a supported repository docs platform from unambiguous config files. */
137
- declare function detectRepositoryPlatform(repositoryDir: string): MigrationPlatform;
207
+ declare function detectRepositoryPlatform(repositoryDir: string, docsDir?: string): MigrationPlatform;
138
208
  /** Pick the first conventional content root containing Markdown. */
139
209
  declare function detectRepositoryDocsDir(repositoryDir: string): string;
140
210
  /** Import an already-available repository directory into a canonical bundle. */
@@ -156,10 +226,16 @@ interface MintlifyNavigationResult {
156
226
  pageReferences: Array<MintlifyPageReference>;
157
227
  warnings: Array<MigrationWarning>;
158
228
  }
229
+ interface MintlifyProjectionOptions {
230
+ /** Public URL migrations may expose page hrefs including the docs mount path. */
231
+ pathPrefix?: string;
232
+ }
233
+ /** Preserve Mintlify's implicit `/section` route for section landing pages. */
234
+ declare function addMintlifyDirectoryRedirects(config: MigrationDocsConfig, pages: Array<MigrationPage>): MigrationDocsConfig;
159
235
  /** Read `docs.json`/`mint.json`, including bounded local JSON references. */
160
236
  declare function readMintlifyConfig(repositoryRoot: string): Record<string, unknown> | null;
161
237
  /** Convert current and legacy Mintlify navigation into Thally's schema. */
162
- declare function projectMintlifyNavigation(config: Record<string, unknown>): MintlifyNavigationResult;
238
+ declare function projectMintlifyNavigation(config: Record<string, unknown>, options?: MintlifyProjectionOptions): MintlifyNavigationResult;
163
239
  interface GeneratedNavigationOptions {
164
240
  /** Dedicated docs platforms expose their primary sections as top-level tabs. */
165
241
  topLevelTabs?: boolean;
@@ -224,4 +300,4 @@ declare const defaultMigrationFetcher: MigrationFetcher;
224
300
  /** Crawl one public docs origin into a canonical, caller-independent bundle. */
225
301
  declare function migrateUrl(options: UrlMigrationOptions): Promise<MigrationBundle>;
226
302
 
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 };
303
+ 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 };