@thallylabs/migrate 0.2.31 → 0.2.33

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
@@ -81,11 +81,13 @@ only content it binds to the tab itself. The item's `icon` and `hidden` carry
81
81
  onto that tab, and a `directory` output folder is not used (a warning says so:
82
82
  endpoint pages are generated under `/api/`). An item Thally cannot represent
83
83
  produces a warning naming it. Specs that share a file name across folders are
84
- kept as separate files in `openapi/`. Remote `http://` and
85
- `https://` specs are not downloaded during migration. The report names each
86
- remote URL and tells you to add its spec to a project-root folder such as
87
- `openapi/`, then set the API source in `docs.json` to that path. Missing local
88
- specs also produce warnings
84
+ kept as separate files in `openapi/`. A remote `https://` spec is not
85
+ downloaded by `migrateRepository`; the bundle lists it and warns, and
86
+ `hydrateRemoteApiSpecs` (which `create-thally-docs migrate` runs after the
87
+ conversion) downloads it from a public host, up to 25 MB, saves it as `.json`
88
+ or `.yaml` by its content rather than its URL, and binds it to its tab. A
89
+ download that fails leaves a warning naming the URL. An `http://` spec is never
90
+ imported. Missing local specs also produce warnings
89
91
  instead of silently dropping that API tab's reference. AsyncAPI has no Thally
90
92
  renderer, so it always produces a clear warning naming the spec instead of
91
93
  disappearing.
@@ -100,9 +102,53 @@ into `docs.json`; invalid values are dropped with a warning.
100
102
  In-content links to auto-generated API operation pages are rewritten to the
101
103
  matching Thally `/api/...` route. A link under a known API section that matches
102
104
  no operation points to that section's overview page instead, and one warning
103
- lists the affected links (up to ten). A Mintlify default version's pages also
104
- get a redirect from their address without the version segment, since the
105
- original site serves them both ways.
105
+ lists the affected links (up to ten). A link to an address the site answers
106
+ itself (a guide authored inside an API directory, trailing slash or `/index` or
107
+ not, or the source of an authored redirect) is never rewritten. A spec that
108
+ Mintlify mounted under a `directory` also gets a redirect from each endpoint URL that directory served,
109
+ to the matching endpoint page, and never to an operation the published spec
110
+ withholds with `x-hidden` or `x-excluded`. A remote spec gets every directory
111
+ each of its tabs mounted it under, limited to the operations the navigation
112
+ listed under a directory when it listed any. A local spec gets one directory
113
+ per tab (the first) and every operation of the spec. When directories nest
114
+ (`reference` and `reference/v2`), an address belongs to the longest directory it
115
+ lies under, whether the specs are local or remote: the shorter one never
116
+ rewrites a link to it or redirects it. When a site has a remote spec, links and
117
+ endpoint redirects under every directory are generated by
118
+ `hydrateRemoteApiSpecs` once all specs are bound (a tab's position decides the
119
+ id its spec is served under), so they stay as authored until then. A remote
120
+ directory whose download failed still owns the addresses under it: they stay as
121
+ authored, never rewritten or redirected. A link under any
122
+ directory reaches only that directory's own endpoint URLs; a link under none is
123
+ redirected by its last two segments (tag and summary) only when exactly one
124
+ published operation across every spec carries them, to the id its spec is
125
+ served under. A Mintlify default version's pages also get a redirect from their
126
+ address without the version segment, since the original site serves them both
127
+ ways.
128
+
129
+ Redirects are checked once, after every platform and step has added its own.
130
+ Next.js applies a redirect before it looks for a page and compares a source
131
+ without regard to a trailing slash, so a redirect whose source is a page of the
132
+ migrated site would hide that page, and two redirects that send a visit back to
133
+ each other never settle. Each such redirect is left out, and a warning
134
+ lists the first ten of each kind; the earlier redirect of a loop is kept. A
135
+ generated redirect (a version alias, an endpoint URL) for an address that
136
+ already serves a page is left out without a warning, since the page is still
137
+ reachable there. These checks ignore letter case, because a site can run on
138
+ `next start`, which matches a redirect source without regard to case, or on the
139
+ Cloudflare build, which matches it exactly, and a redirect must be safe on
140
+ both. So `/Guide` to `/guide` is left out when `guide` is a page (it would loop
141
+ and hide the page where case is ignored), `/a` to `/B` together with `/b` to
142
+ `/A` is a loop whose second redirect is left out, and a generated redirect
143
+ whose address differs from a page only in case is never created. When letter
144
+ case alone is the conflict, the warning names each redirect left out (the
145
+ first ten), says that its address differs only in letter case from a page or
146
+ another redirect, and says to add it back to `docs.json` if your host matches
147
+ URLs case-sensitively. Next.js reads a redirect source as a route pattern, so one
148
+ whose address has a `+ ? ( ) [ ] { }` character (a `directory` such as
149
+ `sdk/c++`) would fail the build; every redirect from authored config, a local
150
+ spec or a downloaded spec is left out instead, and one warning lists the first
151
+ ten of them.
106
152
 
107
153
  A repository is limited to 5,000 documentation files and, separately, 5,000
108
154
  asset files. Past that, files are kept in navigation order with the default
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { M as MigrationPage, a as MigrationAsset, b as MigrationNavigationGroup, R as RenderedMigrationFile, c as MigrationWarning, d as MigrationFetcher, e as MigrationPlatform, f as MigrationBundle, g as MigrationDocsConfig } from './url-migration-Coy62q1L.js';
2
- export { h as MigrationCapture, i as MigrationCaptureProvider, j as MigrationCaptureState, k as MigrationCapturedAsset, l as MigrationEvidence, m as MigrationFetchRequest, n as MigrationFetchResponse, o as MigrationJournalAsset, p as MigrationNavigationOccurrence, q as MigrationNavigationTab, U as UrlMigrationCheckpoint, r as UrlMigrationCheckpointDelta, s as UrlMigrationIssue, t as UrlMigrationRecord, u as UrlMigrationRun, v as UrlMigrationRunOptions, w as UrlMigrationValidation, x as classifyMigrationResponse, y as mergeMigrationConfig, z as renderMigrationFiles, A as runUrlMigration, B as validateUrlMigration } from './url-migration-Coy62q1L.js';
1
+ import { M as MigrationPage, a as MigrationAsset, b as MigrationNavigationGroup, R as RenderedMigrationFile, c as MigrationWarning, d as MigrationFetcher, e as MigrationPlatform, f as MigrationBundle, g as MigrationDocsConfig } from './url-migration-_wVauqSg.js';
2
+ export { h as MigrationCapture, i as MigrationCaptureProvider, j as MigrationCaptureState, k as MigrationCapturedAsset, l as MigrationEvidence, m as MigrationFetchRequest, n as MigrationFetchResponse, o as MigrationJournalAsset, p as MigrationNavigationOccurrence, q as MigrationNavigationTab, U as UrlMigrationCheckpoint, r as UrlMigrationCheckpointDelta, s as UrlMigrationIssue, t as UrlMigrationRecord, u as UrlMigrationRun, v as UrlMigrationRunOptions, w as UrlMigrationValidation, x as classifyMigrationResponse, y as mergeMigrationConfig, z as renderMigrationFiles, A as runUrlMigration, B as validateUrlMigration } from './url-migration-_wVauqSg.js';
3
3
  export { isPassiveSvg } from './svg-policy.js';
4
4
 
5
5
  /**
@@ -344,9 +344,17 @@ declare const defaultMigrationFetcher: MigrationFetcher;
344
344
  declare function migrateUrl(options: UrlMigrationOptions): Promise<MigrationBundle>;
345
345
 
346
346
  /**
347
- * Attach safely downloaded specs to the exact authored API tabs. Source links
348
- * to Mintlify's tag/summary routes receive redirects only when an operation
349
- * can be identified uniquely; guessing would silently route to wrong APIs.
347
+ * Attach safely downloaded specs to the exact authored API tabs. A spec
348
+ * mounted under Mintlify `directory` folders gets a redirect from each
349
+ * endpoint URL those folders served, and a link under a mount (this bundle's
350
+ * or any other's) reaches nothing else. A link no mount covers is redirected by
351
+ * its tag and summary only when exactly one published operation across every
352
+ * spec carries them, to the id its spec is served under: guessing would
353
+ * silently route to the wrong API. A redirect never takes the place of a page
354
+ * the site serves. Every spec is bound before any link is read, so mounts
355
+ * nested in one another (`reference` and `reference/v2`) are told apart by
356
+ * their longest prefix, and the repository's own mounts are linked here too:
357
+ * a tab's position decides the id its spec is served under.
350
358
  */
351
359
  declare function hydrateRemoteApiSpecs(bundle: MigrationBundle, fetcher?: MigrationFetcher): Promise<MigrationBundle>;
352
360