openapi-typesafe-migrate 1.0.0-rc.1 → 1.0.0-rc.10

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/CHANGELOG.md ADDED
@@ -0,0 +1,374 @@
1
+ # openapi-typesafe-migrate
2
+
3
+ ## 1.0.0-rc.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#126](https://github.com/openapi-typesafe/openapi-typesafe/pull/126) [`06e4e2b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/06e4e2b3a54a9bd93bf79a8949ec3c9a7be5cec8) Thanks [@fedorello](https://github.com/fedorello)! - Old flags appended to a variable that holds the generator are renamed: a Makefile `GEN += -it`,
8
+ a shell `G+=" -it"` and a justfile `"npx openapi-typescript" + " -it"`. A Makefile value that `+=`
9
+ starts after an empty one (`CMD =`, then `CMD += npx openapi-typescript`) runs the generator, so
10
+ the flags after `$(CMD)` are renamed too. Where the variable may also run another program, the
11
+ appended flags are listed as a manual step. Before, they were kept without a word, and the
12
+ migrated command failed with an unknown flag.
13
+
14
+ - [#126](https://github.com/openapi-typesafe/openapi-typesafe/pull/126) [`06e4e2b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/06e4e2b3a54a9bd93bf79a8949ec3c9a7be5cec8) Thanks [@fedorello](https://github.com/fedorello)! - The generator set in Azure Pipelines `variables` is migrated, as in a workflow `env`: a map, or a
15
+ list of `- name: … / value: …` items, in `azure-pipelines.yml`, `*.azure-pipelines.yml`,
16
+ `azure-pipelines-*.yml` and the files of `.azure-pipelines/` and `.azuredevops/`. A script that
17
+ runs it as `$(gen)`, `${{ variables.gen }}`, `$GEN` or `${GEN}` gets the flags after it renamed.
18
+ A GitLab CI list item with a `value` key under `variables` is no longer read as a variable.
19
+
20
+ - [#126](https://github.com/openapi-typesafe/openapi-typesafe/pull/126) [`06e4e2b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/06e4e2b3a54a9bd93bf79a8949ec3c9a7be5cec8) Thanks [@fedorello](https://github.com/fedorello)! - The generator set in the variables of more files is migrated, as in a workflow `env`: GitLab CI
21
+ `variables` (also `{ value: … }`), CircleCI, Drone and Woodpecker `environment`, Docker Compose
22
+ `environment` (a map or `NAME=value` items), and Taskfile `vars` and `env`. A Taskfile command
23
+ that names a variable as `{{.GEN}}` gets the flags after it renamed, as after `$GEN`. Before,
24
+ these values kept the old name, and the report could say that nothing was found.
25
+
26
+ - [#126](https://github.com/openapi-typesafe/openapi-typesafe/pull/126) [`06e4e2b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/06e4e2b3a54a9bd93bf79a8949ec3c9a7be5cec8) Thanks [@fedorello](https://github.com/fedorello)! - Old flags that a workflow step gets from an input are listed as a manual step in more forms:
27
+ `${{ github.event.inputs.flags }}`, an `env` value `FL: ${{ inputs.flags }}` used as `$FL`, and a
28
+ literal in an expression (`${{ inputs.flags || '-it' }}`). The flags after a shell default around
29
+ an input (`${GEN:-${{ inputs.gen }}} e.yaml -it`) and after a shell default for a variable the
30
+ file does not set (`${GEN:-mytool}`) are listed too. Before, these were kept without a word.
31
+
32
+ - [#126](https://github.com/openapi-typesafe/openapi-typesafe/pull/126) [`06e4e2b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/06e4e2b3a54a9bd93bf79a8949ec3c9a7be5cec8) Thanks [@fedorello](https://github.com/fedorello)! - A Kubernetes container `env` item whose value names an old package
33
+ (`- name: GEN / value: npx openapi-typescript`) is now listed in the report as a step to do by
34
+ hand. No shell reads such a value, so the tool does not change it. Before, it was not reported.
35
+
36
+ - [#126](https://github.com/openapi-typesafe/openapi-typesafe/pull/126) [`06e4e2b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/06e4e2b3a54a9bd93bf79a8949ec3c9a7be5cec8) Thanks [@fedorello](https://github.com/fedorello)! - The generator inside a Makefile `$(strip …)` is renamed, as inside `$(or …)` and `$(if …)`. A call
37
+ of any other make function whose arguments name an old package (`$(firstword npx
38
+ openapi-typescript)`, `$(call …)`, `$(shell …)`) is listed as a manual step. Before, such a call
39
+ kept the old name, and the report could say that nothing was found.
40
+
41
+ - [#126](https://github.com/openapi-typesafe/openapi-typesafe/pull/126) [`06e4e2b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/06e4e2b3a54a9bd93bf79a8949ec3c9a7be5cec8) Thanks [@fedorello](https://github.com/fedorello)! - The generator bin given by a Windows path without a suffix (`node_modules\.bin\openapi-typescript`,
42
+ which cmd.exe runs as the `.cmd` file) is renamed to `node_modules\.bin\openapi-typesafe`, and the
43
+ old flags after it are renamed. Before, the script was kept as it was and not reported, so it
44
+ called a bin that the migration had removed.
45
+
46
+ ## 1.0.0-rc.9
47
+
48
+ ### Patch Changes
49
+
50
+ - [#116](https://github.com/openapi-typesafe/openapi-typesafe/pull/116) [`600dd3a`](https://github.com/openapi-typesafe/openapi-typesafe/commit/600dd3afd7148146a4ec06c9400dae98a17ef3e1) Thanks [@fedorello](https://github.com/fedorello)! - A shell default around a GitHub Actions expression (`${GEN:-${{ inputs.gen || 'npx
51
+ openapi-typescript' }}} api.yaml`, also with `:+`, `:=` and in `G=${G:-…}`) is migrated: the old
52
+ name in it is renamed once, and old flags after it are listed as a manual step. Before, the tool
53
+ skipped the whole file with "edits overlap" and exited with `1`. A report whose only findings were
54
+ in such a skipped file no longer also says "Nothing to migrate".
55
+
56
+ - [#116](https://github.com/openapi-typesafe/openapi-typesafe/pull/116) [`600dd3a`](https://github.com/openapi-typesafe/openapi-typesafe/commit/600dd3afd7148146a4ec06c9400dae98a17ef3e1) Thanks [@fedorello](https://github.com/fedorello)! - Old flags in the default of an action or workflow input (`inputs.flags.default: --immutable-types`)
57
+ are listed as a manual step where a command gets them as `${{ inputs.flags }}`, as for an `env`
58
+ value used as `$FLAGS`. Before, they were not reported, and the migrated step failed.
59
+
60
+ - [#116](https://github.com/openapi-typesafe/openapi-typesafe/pull/116) [`600dd3a`](https://github.com/openapi-typesafe/openapi-typesafe/commit/600dd3afd7148146a4ec06c9400dae98a17ef3e1) Thanks [@fedorello](https://github.com/fedorello)! - Old flags in an exported justfile variable are listed as a manual step where a recipe line uses it
61
+ as a shell variable: `export FLAGS := "-it"` used as `$FLAGS`, a parameter `$OPTS="-it"` used as
62
+ `$OPTS`, and every variable with `set export`. Before, only `{{flags}}` was reported, and the
63
+ migrated recipe failed.
64
+
65
+ - [#116](https://github.com/openapi-typesafe/openapi-typesafe/pull/116) [`600dd3a`](https://github.com/openapi-typesafe/openapi-typesafe/commit/600dd3afd7148146a4ec06c9400dae98a17ef3e1) Thanks [@fedorello](https://github.com/fedorello)! - The old generator inside a make function is renamed: `$(or $(GEN),npx openapi-typescript)`,
66
+ `$(if $(GEN),$(GEN),npx openapi-typescript)` and `$(and …)`, in a recipe line or in a variable's
67
+ value. The function may give another program, so old flags after it are still listed as a manual
68
+ step. Before, the old name stayed, and with no flags after it the report said "Nothing to migrate".
69
+
70
+ - [#116](https://github.com/openapi-typesafe/openapi-typesafe/pull/116) [`600dd3a`](https://github.com/openapi-typesafe/openapi-typesafe/commit/600dd3afd7148146a4ec06c9400dae98a17ef3e1) Thanks [@fedorello](https://github.com/fedorello)! - The migration keeps the old flags after a variable whose program is decided when the job runs,
71
+ and lists them as a manual step: a workflow `env` set by an expression
72
+ (`GEN: ${{ vars.GEN || 'npx openapi-typescript' }}` or `GEN: ${{ vars.GEN }}`, used as `$GEN`), a
73
+ Makefile `GEN ?= npx openapi-typescript`, which the environment can override, and a Makefile value
74
+ that make computes (`GEN := $(or $(X),npx openapi-typescript)`). Before, the flags after `$GEN`
75
+ were renamed without a word, or kept without a word, though `$GEN` may run another program.
76
+
77
+ - [#116](https://github.com/openapi-typesafe/openapi-typesafe/pull/116) [`600dd3a`](https://github.com/openapi-typesafe/openapi-typesafe/commit/600dd3afd7148146a4ec06c9400dae98a17ef3e1) Thanks [@fedorello](https://github.com/fedorello)! - A `transform` that returns an array of a one-member union (`createArrayTypeNode(
78
+ createUnionTypeNode([DATE_OR_NULL]))`, where `DATE_OR_NULL` is `Date | null`) is rewritten to
79
+ `"(Date | null)[]"`. Before, the parentheses were lost and the type text was `"Date | null[]"`, a
80
+ different type that still compiled.
81
+
82
+ - [#116](https://github.com/openapi-typesafe/openapi-typesafe/pull/116) [`600dd3a`](https://github.com/openapi-typesafe/openapi-typesafe/commit/600dd3afd7148146a4ec06c9400dae98a17ef3e1) Thanks [@fedorello](https://github.com/fedorello)! - The generator bin written with a Windows suffix is migrated: `openapi-typescript.cmd`,
83
+ `openapi-typescript.ps1`, `openapi-typescript.exe` and `node_modules\.bin\openapi-typescript.cmd`
84
+ become the same names of `openapi-typesafe`, and the old flags after them are renamed. Before, they
85
+ were neither changed nor reported, so the script called a bin that the migration had removed.
86
+
87
+ - [#116](https://github.com/openapi-typesafe/openapi-typesafe/pull/116) [`600dd3a`](https://github.com/openapi-typesafe/openapi-typesafe/commit/600dd3afd7148146a4ec06c9400dae98a17ef3e1) Thanks [@fedorello](https://github.com/fedorello)! - Commands that a YAML anchor shares are migrated where they are written, when an alias uses them
88
+ under a command key: a GitLab `.gen_scripts: &gen_scripts` list used as
89
+ `script: [*gen_scripts]`, an anchored `env` map, a Taskfile command. Before, such a file was
90
+ neither changed nor reported ("Nothing to migrate"), and the job kept running the old generator.
91
+
92
+ ## 1.0.0-rc.8
93
+
94
+ ### Patch Changes
95
+
96
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - When a bug of the tool would corrupt one file, only that file is left as it was: the report lists
97
+ it under "Skipped" with the reason and asks you to migrate it by hand, the other files are still
98
+ migrated (and written with `--write`), and the command exits with `1`. Before, such a bug stopped
99
+ the whole run and nothing was migrated.
100
+
101
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - A CircleCI job now takes the `shell` of the executor it names (`executor: py` with
102
+ `executors.py.shell: /usr/bin/python3`), so the Python code of its steps is no longer rewritten as
103
+ a command line; a step that names an old package is listed as a manual step. The job's own `shell`
104
+ still wins.
105
+
106
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - A Dockerfile `ARG` or `ENV` whose value has a shell default, such as
107
+ `ENV GEN=${GEN:-npx openapi-typescript}`, no longer stops the whole migration with "Edits overlap"
108
+ and exit code 1: the default is renamed once, like any other `ARG` or `ENV` value.
109
+
110
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - A GitLab CI job named `openapi`, `swagger`, `asyncapi`, `overlay` or `arazzo` no longer makes the
111
+ whole `.gitlab-ci.yml` count as an API description, so its commands are migrated again. A YAML file
112
+ counts as an API description only when such a top-level key holds a version (`openapi: 3.1.0`), and
113
+ a CI config (`.gitlab-ci.yml`, a GitHub workflow, a CircleCI config, …) never does.
114
+
115
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - Old flags in a justfile recipe parameter default (`b *flags='-it':` with `{{gen}} f.yaml
116
+ {{flags}}`) are now reported, like the flags of a `flags := '-it'` variable. Before, the run failed
117
+ later with `CLI_FLAG_REMOVED`.
118
+
119
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - A Makefile command that make computes, such as `$(or $(GEN),npx openapi-typescript) b.yaml -it`,
120
+ is now reported with the text you wrote. Before, the report showed a row of underscores instead.
121
+
122
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - A path that names the `node_modules` folder of an old package itself (`"paths": { "a":
123
+ ["./node_modules/openapi-fetch"] }` in a tsconfig, or an import of `../node_modules/openapi-fetch`)
124
+ is now reported, like a path to a file inside it.
125
+
126
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - Options passed to `openapiTS()` that take keys from another object (`{ ...base }`) are now checked
127
+ for legacy callbacks. When the file writes that object (`...{ transform }` or `const base = { … }`),
128
+ its `transform`, `postTransform` and `transformProperty` are listed as manual steps; a spread of an
129
+ object the tool cannot read (an import, a call) is listed too, so you can check it. Before, such
130
+ options were not reported at all.
131
+
132
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - A justfile recipe whose first line is a shebang for another program (`#!/usr/bin/env python3`), and
133
+ code given on the command line (`python3 -c '…'`, `node -e "…"`, `ruby -e '…'`), are no longer
134
+ read as shell commands. When such code names an old package, it is listed as a manual step
135
+ ("the script runs with python3, …"); before, it was neither changed nor reported, or a command
136
+ line inside it was rewritten.
137
+
138
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - A rewritten `transform` whose type is declared outside the function now compiles: a TypeScript
139
+ node type in the type of its `const` (`const transform: (s: SchemaObject) => ts.TypeNode`), in a
140
+ JSDoc `@type` or in a JSDoc `@returns` becomes `string`, like the returns. Before, that type stayed
141
+ and the file no longer compiled. A declared type the tool cannot map, such as a local alias, keeps
142
+ the `transform`, which is listed as a manual step.
143
+
144
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - A launcher or install command written with its Windows file suffix (`npx.cmd openapi-typescript`,
145
+ `pnpm.exe exec …`, `npm.ps1 i openapi-fetch`) is now migrated like `npx`, `pnpm` and `npm`.
146
+ Before, the old name after it was only reported.
147
+
148
+ - [#107](https://github.com/openapi-typesafe/openapi-typesafe/pull/107) [`173c82c`](https://github.com/openapi-typesafe/openapi-typesafe/commit/173c82c24fb8d59a5e3d4894596391dd48f2608f) Thanks [@fedorello](https://github.com/fedorello)! - The migration renames the old generator in GitHub Actions expressions again, such as
149
+ `run: ${{ inputs.generator || 'npx openapi-typescript' }} api.yaml` and
150
+ `npx ${{ inputs.pkg || 'openapi-typescript' }}`, and in input defaults of an `action.yml` or a
151
+ reusable workflow (`default: npx openapi-typescript`). The value of an expression comes from the
152
+ run, so old flags after it are listed as a manual step. Before, these places were neither changed
153
+ nor reported, and npx ran the old package after the migration.
154
+
155
+ ## 1.0.0-rc.7
156
+
157
+ ### Patch Changes
158
+
159
+ - [#101](https://github.com/openapi-typesafe/openapi-typesafe/pull/101) [`7b4ba3f`](https://github.com/openapi-typesafe/openapi-typesafe/commit/7b4ba3f783c16e506d4c9afbfe6392b1e820b1e4) Thanks [@fedorello](https://github.com/fedorello)! - A CI script now runs with the shell that CI gives it: the step's own `shell`, then the job's and
160
+ the workflow's `defaults.run.shell` in GitHub Actions, or the job's `shell` in CircleCI. A Python
161
+ or Node script under such a default is left and reported instead of rewritten as shell, and
162
+ `shell: /usr/bin/env bash -e {0}`, `shell: msys2 {0}` and `shell: wsl-bash {0}` are read as bash
163
+ again, so their commands are migrated.
164
+
165
+ - [#101](https://github.com/openapi-typesafe/openapi-typesafe/pull/101) [`7b4ba3f`](https://github.com/openapi-typesafe/openapi-typesafe/commit/7b4ba3f783c16e506d4c9afbfe6392b1e820b1e4) Thanks [@fedorello](https://github.com/fedorello)! - A rewritten `transform` in options of a `const` without a type (`const options = { transform }`)
166
+ now gets `irCallbacks: true as const` (in JavaScript, `/** @type {const} */ (true)`): a plain
167
+ `true` became `boolean` there, and the `openapiTS` call stopped compiling (TS2769). The option is
168
+ also written before the JSDoc of `transform`, which stays with `transform`.
169
+
170
+ - [#101](https://github.com/openapi-typesafe/openapi-typesafe/pull/101) [`7b4ba3f`](https://github.com/openapi-typesafe/openapi-typesafe/commit/7b4ba3f783c16e506d4c9afbfe6392b1e820b1e4) Thanks [@fedorello](https://github.com/fedorello)! - An import that a JSDoc comment still names (`@param {ts.TypeNode} node`, `{@link ts.factory}`) is
171
+ no longer removed with the rewritten `transform` returns. In a checked JavaScript file the type
172
+ stopped resolving (TS2503).
173
+
174
+ - [#101](https://github.com/openapi-typesafe/openapi-typesafe/pull/101) [`7b4ba3f`](https://github.com/openapi-typesafe/openapi-typesafe/commit/7b4ba3f783c16e506d4c9afbfe6392b1e820b1e4) Thanks [@fedorello](https://github.com/fedorello)! - A justfile variable set by an expression (`gen := env_var_or_default("GEN", "npx
175
+ openapi-typescript")`, an `if … { … } else { … }`), a recipe parameter default
176
+ (`types gen="npx openapi-typescript":`) and a string in an interpolation get the new generator
177
+ name again; they kept the old one without a word, and `npx` then downloaded the old generator.
178
+ Such a value can also be another program, so the old flags after `{{gen}}` are reported.
179
+
180
+ - [#101](https://github.com/openapi-typesafe/openapi-typesafe/pull/101) [`7b4ba3f`](https://github.com/openapi-typesafe/openapi-typesafe/commit/7b4ba3f783c16e506d4c9afbfe6392b1e820b1e4) Thanks [@fedorello](https://github.com/fedorello)! - A local package under an old name in a workspace root (`"openapi-fetch": "file:./vendor/…"`) no
181
+ longer keeps the imports of a workspace package that declares the npm package itself. The
182
+ nearest manifest that declares the name decides, as Node resolves it: that package's dependency
183
+ and its imports now both get the new name.
184
+
185
+ - [#101](https://github.com/openapi-typesafe/openapi-typesafe/pull/101) [`7b4ba3f`](https://github.com/openapi-typesafe/openapi-typesafe/commit/7b4ba3f783c16e506d4c9afbfe6392b1e820b1e4) Thanks [@fedorello](https://github.com/fedorello)! - The migration now renames the old generator inside a shell default value, such as
186
+ `${GEN:-npx openapi-typescript}`, `: "${GEN:=npx openapi-typescript}"` or
187
+ `npx ${PKG:-openapi-typescript}`. Before, these commands kept the old name and npx quietly ran the
188
+ old package. The variable can still be set to another program outside the file, so the flags after
189
+ such a default are listed as a manual step instead of being changed.
190
+
191
+ - [#101](https://github.com/openapi-typesafe/openapi-typesafe/pull/101) [`7b4ba3f`](https://github.com/openapi-typesafe/openapi-typesafe/commit/7b4ba3f783c16e506d4c9afbfe6392b1e820b1e4) Thanks [@fedorello](https://github.com/fedorello)! - The files of a split API description (`components/schemas/Job.yaml`, reached by `$ref` from
192
+ `openapi.yaml` or `openapi.json`) and OpenAPI Overlay and Arazzo documents are data now, like the
193
+ API description itself: their example `command` and `script` values are no longer rewritten, so
194
+ the change no longer reaches the generated comments.
195
+
196
+ - [#101](https://github.com/openapi-typesafe/openapi-typesafe/pull/101) [`7b4ba3f`](https://github.com/openapi-typesafe/openapi-typesafe/commit/7b4ba3f783c16e506d4c9afbfe6392b1e820b1e4) Thanks [@fedorello](https://github.com/fedorello)! - The migration now lists the old flags after a variable that runs a command when it cannot see
197
+ where the variable is set: in another GitLab `script` item, through `$GITHUB_ENV` in an earlier
198
+ step, as `$$GEN` in a Makefile recipe, as a bash array run with `"${GEN[@]}"`, or outside the
199
+ file. Before, flags like `-it` after such a variable were kept without a word, and the new
200
+ generator then stopped with an unknown flag. The items of a bash array are now renamed too.
201
+
202
+ ## 1.0.0-rc.6
203
+
204
+ ### Patch Changes
205
+
206
+ - [#93](https://github.com/openapi-typesafe/openapi-typesafe/pull/93) [`25f631d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/25f631d8dabed24e18a859b08e8395496e145118) Thanks [@fedorello](https://github.com/fedorello)! - An OpenAPI, Swagger or AsyncAPI document in YAML is no longer changed: an example value under a
207
+ `command` or `script` key that mentions the generator stays as written.
208
+
209
+ - [#93](https://github.com/openapi-typesafe/openapi-typesafe/pull/93) [`25f631d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/25f631d8dabed24e18a859b08e8395496e145118) Thanks [@fedorello](https://github.com/fedorello)! - `openapi-typesafe-migrate | head` (or any reader that closes the pipe early) no longer crashes with
210
+ an `EPIPE` stack trace and exit code 1: the rest of the report is dropped and the run ends as it
211
+ would have.
212
+
213
+ - [#93](https://github.com/openapi-typesafe/openapi-typesafe/pull/93) [`25f631d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/25f631d8dabed24e18a859b08e8395496e145118) Thanks [@fedorello](https://github.com/fedorello)! - A constant or an import that an `export { … }` list names is no longer removed with the old
214
+ `transform` returns, so the file still compiles.
215
+
216
+ - [#93](https://github.com/openapi-typesafe/openapi-typesafe/pull/93) [`25f631d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/25f631d8dabed24e18a859b08e8395496e145118) Thanks [@fedorello](https://github.com/fedorello)! - An exported function that `transform` names is no longer rewritten: other modules may call it
217
+ and expect TypeScript nodes. It is kept and reported as a manual step, like options that other
218
+ code uses.
219
+
220
+ - [#93](https://github.com/openapi-typesafe/openapi-typesafe/pull/93) [`25f631d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/25f631d8dabed24e18a859b08e8395496e145118) Thanks [@fedorello](https://github.com/fedorello)! - A justfile variable that holds the generator (`gen := "npx openapi-typescript"`) now has its old
221
+ flags renamed where it runs: `{{gen}} api.yaml -it` kept `-it`. A variable of old flags that the
222
+ generator gets (`{{flags}}`) is reported.
223
+
224
+ - [#93](https://github.com/openapi-typesafe/openapi-typesafe/pull/93) [`25f631d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/25f631d8dabed24e18a859b08e8395496e145118) Thanks [@fedorello](https://github.com/fedorello)! - A dependency under an old name on a local package (`workspace:*`, `link:`, `file:`, `portal:`),
225
+ such as a fork named `openapi-fetch` in the workspace, is no longer renamed: the new name pointed
226
+ at a package the workspace does not have, and the install failed. The dependency and the imports
227
+ of it keep their name, and the report lists it as a manual step.
228
+
229
+ - [#93](https://github.com/openapi-typesafe/openapi-typesafe/pull/93) [`25f631d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/25f631d8dabed24e18a859b08e8395496e145118) Thanks [@fedorello](https://github.com/fedorello)! - A CI step whose `shell` is another program (`shell: python` in GitHub Actions, or a CircleCI
230
+ `shell` next to `command`) runs code of that language, not commands. Its script is now left as it
231
+ is and reported when it names an old package; it was skipped without a word.
232
+
233
+ - [#93](https://github.com/openapi-typesafe/openapi-typesafe/pull/93) [`25f631d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/25f631d8dabed24e18a859b08e8395496e145118) Thanks [@fedorello](https://github.com/fedorello)! - A shell variable that holds the generator is migrated now. A script, a CI `run` block or a
234
+ `package.json` script that sets `GEN="npx openapi-typescript"` (also after `export`, `local` or
235
+ `readonly`) and then runs `$GEN api.yaml -it` was left as it was, and nothing was reported, so
236
+ the build went on downloading the old generator. The value is renamed where it is set and the
237
+ flags after `$GEN` where it runs, and a variable of old flags that the generator gets is reported.
238
+
239
+ - [#93](https://github.com/openapi-typesafe/openapi-typesafe/pull/93) [`25f631d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/25f631d8dabed24e18a859b08e8395496e145118) Thanks [@fedorello](https://github.com/fedorello)! - Once `openapi-fetch` is aliased to `openapi-typesafe-fetch` in the overrides (as the docs ask for
240
+ swr-openapi), the report no longer says to update that override or to add the alias again, so a
241
+ second run is clean. The alias counts in the `package.json` itself and in a workspace above it.
242
+
243
+ - [#93](https://github.com/openapi-typesafe/openapi-typesafe/pull/93) [`25f631d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/25f631d8dabed24e18a859b08e8395496e145118) Thanks [@fedorello](https://github.com/fedorello)! - A path in the `typesVersions` of `package.json` into the installed files of an old package
244
+ (`node_modules/openapi-fetch/dist/index.d.ts`) is reported, as such paths in a tsconfig are: the
245
+ new package has its own files there.
246
+
247
+ - [#93](https://github.com/openapi-typesafe/openapi-typesafe/pull/93) [`25f631d`](https://github.com/openapi-typesafe/openapi-typesafe/commit/25f631d8dabed24e18a859b08e8395496e145118) Thanks [@fedorello](https://github.com/fedorello)! - The `command` of a wireit script in `package.json` is migrated like the other scripts. It was
248
+ neither changed nor reported.
249
+
250
+ ## 1.0.0-rc.5
251
+
252
+ ### Patch Changes
253
+
254
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - A module specifier with a bundler query (`"openapi-fetch?url"`, `"openapi-fetch/x.js?raw"`) gets the
255
+ new package name and keeps its query. Before, a query right after the package name hid the package,
256
+ and the specifier was left as it was.
257
+
258
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - A `catalog:` dependency whose catalog entry is not in the project (`--root packages/api` of a pnpm
259
+ workspace) keeps its name and is reported as a manual step: the entry above the root cannot be
260
+ renamed, and renaming only the dependency failed the install with
261
+ `ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_SPEC`. At a workspace root, where no catalog is above, such a
262
+ dependency is reported as one whose entry is missing. `catalog: ` with a space is the default
263
+ catalog, as pnpm reads it.
264
+
265
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - The generator is renamed after more programs that run it: `nice`, `timeout`, `xargs`, `command`,
266
+ `exec -a`, `dotenvx run --`, `doppler run --`, `nx exec --`, `yarn workspace <name>`, a bare `bun`,
267
+ `corepack`, and `tsx` or `ts-node` before the path of its binary; `yarn global add` renames its
268
+ packages. Any other word of a command that names an old package or a path to its binary (a
269
+ script name after `npm run`, an argument of an unknown program, `$(npm bin)/openapi-typescript`)
270
+ is reported as a manual step. Such commands were left without a word, and
271
+ `dotenvx run -- npx openapi-typescript` kept downloading the old generator.
272
+
273
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - The body of a here-document (`<<NOTE`, `<<'NOTE'`, `<<-NOTE`) is read as data in scripts, `run: |`
274
+ blocks and Dockerfiles: an apostrophe in it (`Don't edit`) opened a quote to the end of the file,
275
+ and no command after it was migrated. A here-document that a shell runs (`bash <<EOF`,
276
+ Dockerfile `RUN <<EOF` and `RUN <<EOT bash`, `cat <<EOF | sh`) is read as the script it is, so its
277
+ commands are migrated. A shift in an arithmetic expansion (`$((1 << 2))`) is not a here-document.
278
+
279
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - When `transform` is rewritten to type text with `irCallbacks: true`, the options declared with
280
+ `OpenAPITSOptions` (`const options: OpenAPITSOptions`, `satisfies` or `as OpenAPITSOptions`, a
281
+ `transform` const typed `OpenAPITSOptions["transform"]`) name `OpenAPITSIrOptions` instead, with its
282
+ import; the rewritten file did not compile. Options typed with a type built from `OpenAPITSOptions`
283
+ (`Partial<OpenAPITSOptions>`) keep their `transform`, reported as a manual step. The type is found
284
+ in the other forms it is written in too: `import("openapi-typescript").OpenAPITSOptions`, a local
285
+ alias or an interface that extends it, and the JSDoc `@type` and `@satisfies` of a JavaScript file.
286
+ Options that take keys from another object (`{ ...base, transform }`) keep their `transform`,
287
+ reported as a manual step: the tool cannot see the callbacks and type of `base`. A `transform`
288
+ written as a shorthand property (`{ transform }`) is rewritten too.
289
+
290
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - The Jest patterns that name an old package (`moduleNameMapper: { "^openapi-fetch$": … }`,
291
+ `transformIgnorePatterns`) are reported as manual steps, in `jest.config.*` files and in the `jest`
292
+ field of `package.json`. A pattern is not a module specifier, so the tool does not change it. A
293
+ value of a JSON config that is just a package name (`"^@api$": "openapi-fetch"`) is reported too;
294
+ a string of a config script that names a package (`"openapi-fetch/$1"`) is reported once.
295
+
296
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - The `import` and `export` blocks of `.mdx` files are migrated like those of a source file. Prose and
297
+ code fences of the page stay as written.
298
+
299
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - More files that run the generator are migrated:
300
+ - Task's `Taskfile.yml` (`cmds`, `cmd`, `sh`, `status`, `defer`, `preconditions`);
301
+ - pre-commit's `.pre-commit-config.yaml`: the `entry` and `args` of a hook as one command, and the
302
+ old packages in `additional_dependencies`;
303
+ - the `simple-git-hooks`, `lint-staged` and `nx.targets` commands of `package.json` and
304
+ `package.yaml`;
305
+ - `.lintstagedrc` (JSON or YAML), `.lintstagedrc.json`, `.lintstagedrc.yaml`, `.simple-git-hooks.json`;
306
+ - the `targetDefaults` commands of `nx.json`, and the commands of Nx `configurations`.
307
+
308
+ A YAML command written with escapes (`"openapi-typescript \"$SPEC\""`) is migrated by its value,
309
+ and the whole string is written again with its escapes.
310
+
311
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - The import map file that a Deno config names (`"importMap": "./deps.json"`) is migrated like
312
+ `import_map.json`, and its imports count as declared for the files under that config. An import map
313
+ named by a URL or by a path outside the project is reported as a manual step.
314
+
315
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - An import of a path into the installed files of an old package
316
+ (`"../node_modules/openapi-fetch/dist/index.js"`) is reported as a manual step: the old package is no
317
+ longer installed after the migration, so the path stops resolving.
318
+
319
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - A patch file of an old package (patch-package `patches/openapi-fetch+0.13.0.patch`, pnpm
320
+ `openapi-fetch@0.13.0.patch`, Yarn `openapi-fetch-npm-0.13.0-<hash>.patch`) is reported as a manual
321
+ step: the new package has other code, so the patch cannot be carried over.
322
+
323
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - Every package manager setting that names an old package is reported as a manual step, not only
324
+ `overrides` and `patchedDependencies`: `packageExtensions`, `allowedDeprecatedVersions`,
325
+ `onlyBuiltDependencies` and the rest, in `pnpm-workspace.yaml`, in the `pnpm` field of
326
+ `package.json` and in `.yarnrc.yml`. Values count too (`"x": "npm:openapi-fetch@0.13.0"` in
327
+ `overrides`). A setting under the `pnpm` field is reported by its own key (`pnpm.overrides`).
328
+
329
+ - [#66](https://github.com/openapi-typesafe/openapi-typesafe/pull/66) [`15344bf`](https://github.com/openapi-typesafe/openapi-typesafe/commit/15344bfb803ff9872a6d3f79b8279fbbbbfd14ea) Thanks [@fedorello](https://github.com/fedorello)! - The report shows control characters of file names and project text as escapes (`\n`, `\u001b`),
330
+ so a file name cannot forge CI commands or erase the lines before it.
331
+
332
+ - [#69](https://github.com/openapi-typesafe/openapi-typesafe/pull/69) [`1296bd7`](https://github.com/openapi-typesafe/openapi-typesafe/commit/1296bd79e83c39598a471b9bfabf34ffcd71a83e) Thanks [@fedorello](https://github.com/fedorello)! - The targets of Node subpath imports in `package.json` (`"imports": { "#client": "openapi-fetch" }`,
333
+ also under conditions and fallback lists) get the new package names, so they still resolve once the
334
+ dependencies are renamed. So do the keys and values of the `browser` field
335
+ (`"browser": { "openapi-fetch": false }`). A target or `browser` key that reaches into a file of
336
+ the package is reported as a manual step.
337
+
338
+ - [#77](https://github.com/openapi-typesafe/openapi-typesafe/pull/77) [`decc2e2`](https://github.com/openapi-typesafe/openapi-typesafe/commit/decc2e2ae056f8a9b191d7f838056487760df530) Thanks [@fedorello](https://github.com/fedorello)! - `tsconfig.json`, `tsconfig.*.json` and `jsconfig.json` are migrated: the `compilerOptions.paths`
339
+ keys of an old package (`"openapi-fetch"`, `"openapi-fetch/*"`) and its name in
340
+ `compilerOptions.types` get the new names, so the paths still match the renamed imports. A path into
341
+ `node_modules` of an old package is reported as a manual step.
342
+
343
+ ## 1.0.0-rc.4
344
+
345
+ No changes in this release.
346
+
347
+ ## 1.0.0-rc.3
348
+
349
+ No changes in this release.
350
+
351
+ ## 1.0.0-rc.2
352
+
353
+ No changes in this release.
354
+
355
+ ## 1.0.0-rc.1
356
+
357
+ No changes in this release.
358
+
359
+ ## 1.0.0-rc.0
360
+
361
+ ### Minor Changes
362
+
363
+ - [`730de95`](https://github.com/openapi-typesafe/openapi-typesafe/commit/730de95d814cf9b1ec70d2b8fac6b84b17106a29) Thanks [@fedorello](https://github.com/fedorello)! - New package `openapi-typesafe-migrate`: run `npx openapi-typesafe-migrate` in a project to move it from openapi-typescript, openapi-fetch, openapi-react-query and openapi-typescript-helpers. It renames the packages in `package.json` files and pnpm catalogs, module specifiers in sources, and the generator command and its renamed flags in scripts, CI files and Makefiles. A legacy `transform` callback that returns plain `ts.factory` types is rewritten to return type text with `irCallbacks: true`. Everything it cannot change safely is listed as a manual step. It only reports until you add `--write`, and logs every finding to a JSON Lines file.
364
+
365
+ ### Patch Changes
366
+
367
+ - [`e57d12b`](https://github.com/openapi-typesafe/openapi-typesafe/commit/e57d12b11b023258100cbabc5cac1d276ba5ae1f) Thanks [@fedorello](https://github.com/fedorello)! - `--help` lists the exit codes: `0` done, `1` the migration failed, `2` unknown option or argument.
368
+
369
+ - [`f0a93e4`](https://github.com/openapi-typesafe/openapi-typesafe/commit/f0a93e4094b3c69dfa8aeb229339f7d622f5cb06) Thanks [@fedorello](https://github.com/fedorello)! - The report now names only the package an override key targets: `openapi-typescript-helpers` no
370
+ longer also reports `openapi-typescript`, and `app>openapi-fetch`, `**/openapi-fetch` and
371
+ `openapi-fetch@0.13` keys are read as `openapi-fetch`. `overrides:` and `patchedDependencies:` in
372
+ `pnpm-workspace.yaml` that name an old package are reported like those of `package.json`; before,
373
+ they were neither rewritten nor reported. The output folders `.next`, `.nuxt`, `.output`,
374
+ `.svelte-kit`, `.turbo` and `coverage` are skipped like `dist`.
package/LICENSE CHANGED
@@ -1,6 +1,5 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Drew Powers
4
3
  Copyright (c) 2026 Fedor Chishchin and openapi-typesafe contributors
5
4
 
6
5
  Permission is hereby granted, free of charge, to any person obtaining a copy