@thallylabs/migrate 0.2.32 → 0.2.34

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,18 +81,25 @@ 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.
92
94
 
93
95
  Page `openapi:` frontmatter with a spec prefix
94
96
  (`openapi: "specs/openapi-b.yaml GET /widgets/{id}"`) is rewritten to where the
95
- spec lands in the output (`/openapi-b.yaml GET /widgets/{id}`). A prefix naming
97
+ spec lands in the output (`/openapi-b.yaml GET /widgets/{id}`). As in Mintlify,
98
+ the prefix may name the spec by path, by file name, or by file name without its
99
+ extension (`v3-openapi GET /tasks`); a name that fits more than one spec is kept
100
+ and reported with its candidates. A declared spec that a published page names
101
+ but that cannot be its tab's spec is bound through a hidden tab, so the page
102
+ still renders its endpoint. A prefix naming
96
103
  a spec that was not migrated is kept and reported. Manual API pages keep their
97
104
  `api:` and `authMethod:` frontmatter, and `api.mdx.server` / `api.mdx.auth` map
98
105
  into `docs.json`; invalid values are dropped with a warning.
@@ -100,9 +107,53 @@ into `docs.json`; invalid values are dropped with a warning.
100
107
  In-content links to auto-generated API operation pages are rewritten to the
101
108
  matching Thally `/api/...` route. A link under a known API section that matches
102
109
  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.
110
+ lists the affected links (up to ten). A link to an address the site answers
111
+ itself (a guide authored inside an API directory, trailing slash or `/index` or
112
+ not, or the source of an authored redirect) is never rewritten. A spec that
113
+ Mintlify mounted under a `directory` also gets a redirect from each endpoint URL that directory served,
114
+ to the matching endpoint page, and never to an operation the published spec
115
+ withholds with `x-hidden` or `x-excluded`. A remote spec gets every directory
116
+ each of its tabs mounted it under, limited to the operations the navigation
117
+ listed under a directory when it listed any. A local spec gets one directory
118
+ per tab (the first) and every operation of the spec. When directories nest
119
+ (`reference` and `reference/v2`), an address belongs to the longest directory it
120
+ lies under, whether the specs are local or remote: the shorter one never
121
+ rewrites a link to it or redirects it. When a site has a remote spec, links and
122
+ endpoint redirects under every directory are generated by
123
+ `hydrateRemoteApiSpecs` once all specs are bound (a tab's position decides the
124
+ id its spec is served under), so they stay as authored until then. A remote
125
+ directory whose download failed still owns the addresses under it: they stay as
126
+ authored, never rewritten or redirected. A link under any
127
+ directory reaches only that directory's own endpoint URLs; a link under none is
128
+ redirected by its last two segments (tag and summary) only when exactly one
129
+ published operation across every spec carries them, to the id its spec is
130
+ served under. A Mintlify default version's pages also get a redirect from their
131
+ address without the version segment, since the original site serves them both
132
+ ways.
133
+
134
+ Redirects are checked once, after every platform and step has added its own.
135
+ Next.js applies a redirect before it looks for a page and compares a source
136
+ without regard to a trailing slash, so a redirect whose source is a page of the
137
+ migrated site would hide that page, and two redirects that send a visit back to
138
+ each other never settle. Each such redirect is left out, and a warning
139
+ lists the first ten of each kind; the earlier redirect of a loop is kept. A
140
+ generated redirect (a version alias, an endpoint URL) for an address that
141
+ already serves a page is left out without a warning, since the page is still
142
+ reachable there. These checks ignore letter case, because a site can run on
143
+ `next start`, which matches a redirect source without regard to case, or on the
144
+ Cloudflare build, which matches it exactly, and a redirect must be safe on
145
+ both. So `/Guide` to `/guide` is left out when `guide` is a page (it would loop
146
+ and hide the page where case is ignored), `/a` to `/B` together with `/b` to
147
+ `/A` is a loop whose second redirect is left out, and a generated redirect
148
+ whose address differs from a page only in case is never created. When letter
149
+ case alone is the conflict, the warning names each redirect left out (the
150
+ first ten), says that its address differs only in letter case from a page or
151
+ another redirect, and says to add it back to `docs.json` if your host matches
152
+ URLs case-sensitively. Next.js reads a redirect source as a route pattern, so one
153
+ whose address has a `+ ? ( ) [ ] { }` character (a `directory` such as
154
+ `sdk/c++`) would fail the build; every redirect from authored config, a local
155
+ spec or a downloaded spec is left out instead, and one warning lists the first
156
+ ten of them.
106
157
 
107
158
  A repository is limited to 5,000 documentation files and, separately, 5,000
108
159
  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-EwtII4P-.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-EwtII4P-.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