Sourced from i18next-cli's changelog.
1.75.2
- fix(extract): declarations with the same name in different files no longer overwrite each other. Two generated OpenAPI clients that both export
componentsresolved to whichever file was read first, soimport { components as githubComponents } from './github-api'andimport { components as digitalOceanComponents } from './digital-ocean-api'extracted the keys of only one of them, and moving files around changed which. A name now resolves to the module the file imports it from, for renamed and plain imports, namespace imports (GH.components),.jsimport specifiers and tsconfigpathsaliases. Imports that cannot be traced to a scanned file (packages, re-exporting barrels) still resolve by name as before. Fixes #306.1.75.1
- fix(extract): types and values read through a namespace import resolve like named imports. With
import * as Types from './types', a qualified type ((color: Types.Color) => …,x as Types.Color,FC<Types.Props>,declare const s: Types.Status) and a namespace member (Types.SIZES.map(…),Types.Status.Done,t(Types.LABELS.save),Object.keys(Types.LABELS)) now extract their keys, also for a namespace re-exported from a barrel (export * as Shared from './types'). Fixes #305.- fix(extract): an exported
as constobject resolves in the files that import it:t(LABELS.save)andObject.keys(LABELS)only worked in the declaring file before.- fix(extract): a value typed
keyof typeof MAPresolves to the map's keys, sot(`label.${key}`)withdeclare const key: keyof typeof LABELSextractslabel.saveandlabel.cancel. This branch never matched before.1.75.0
- feat(extract): new
extract.maxTypeDepthoption sets how many levels of nested object members are followed when a dynamic key reads a typed value (default: 5). Higher values cost time and memory on large recursive types such as OpenAPI schemas. Requested in #302.- fix(extract): the depth now counts from the type an indexed access picks instead of from the declared wrapper type.
type Pet = components['schemas']['Pet']gets the full depth belowPet, where thecomponents/schemaswrapper used to take two of the five levels.- fix(extract): numeric keys resolve in object types and indexed access types, so openapi-typescript response types work:
operations['getPet']['responses'][200]['content']['application/json']andop.responses[200].content['application/json'].statusresolved nothing before.1.74.8
- fix(extract): a commented template literal no longer extracts its placeholder as a key.
// t(`QUARTER.${q}`)extractedQUARTER.${q}and// t(`status.${deepObject.status}`)extractedstatus.${deepObject.status}. Such a comment now keeps the existing keys it matches (QUARTER.1,QUARTER.2, …) even withremoveUnusedKeys, the way a commented static key keeps its key, while code can still add new matching keys. A pattern without any static part (`${a}.${b}`) is ignored. Fixes #304.
540b3be
1.75.29cc03de
fix(extract): resolve same-named declarations by the module they are
imported...dd21f26
1.75.17c637a8
fix(extract): resolve types and values read through a namespace import
#305ef3ebc5
1.75.033d47ac
feat(extract): add maxTypeDepth, count it from the indexed type, resolve
nume...747d5e9
1.74.8a824669
fix(extract): keep the keys a commented template literal matches instead
of e...