Skip to content

Commit d0c29d5

Browse files
committed
refactor: replace ts-morph with orval mutator
1 parent c256c12 commit d0c29d5

File tree

6 files changed

+1418
-3016
lines changed

6 files changed

+1418
-3016
lines changed

build-client/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ runs:
5454
sed -i s/'ORVAL_API_NAME'/'"'${{ inputs.API_NAME }}'"'/ orval.config.ts
5555
sed -i s/'API_TARGET_NAME'/''${{ inputs.API_TARGET_NAME }}''/ orval.config.ts
5656
sed -i s/'API_TARGET_NAME'/${{ inputs.API_TARGET_NAME }}/ src/index.ts
57+
sed -i s/'API_TARGET_NAME'/${{ inputs.API_TARGET_NAME }}/ src/options-mutator.ts
5758
shell: bash
5859
# Run orval and tsup to build the client
5960
- run: |

morph-query-keys.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

orval.config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ export default defineConfig({
1212
override: {
1313
operationName: (operation) => operation["x-semantic-name"],
1414
mutator: { path: "./src/custom-instance.ts", name: "customInstance" },
15-
query: { useQuery: true, useSuspenseQuery: true },
15+
query: {
16+
useQuery: true,
17+
useSuspenseQuery: true,
18+
queryOptions: { path: "./src/options-mutator.ts", name: "queryMutator" },
19+
mutationOptions: { path: "./src/options-mutator.ts", name: "mutationMutator" },
20+
},
1621
},
1722
},
18-
hooks: {
19-
afterAllFilesWrite: [
20-
{ command: "node morph-query-keys.js API_TARGET_NAME", injectGeneratedDirsAndFiles: false },
21-
{ command: "prettier --ignore-path .prettierignore --write" },
22-
],
23-
},
23+
hooks: { afterAllFilesWrite: [{ command: "prettier --ignore-path .prettierignore --write" }] },
2424
},
2525
});

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"js-yaml": "4.1.0",
2222
"orval": "7.10.0",
2323
"prettier": "3.6.2",
24-
"ts-morph": "26.0.0",
2524
"tslib": "2.8.1",
2625
"tsup": "8.5.0",
2726
"typescript": "5.8.3"

0 commit comments

Comments
 (0)