Skip to content

Commit 0c7708b

Browse files
authored
fix: better esm compatibility with api-doc-parser (#338)
1 parent cfd0c94 commit 0c7708b

File tree

4 files changed

+692
-667
lines changed

4 files changed

+692
-667
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
2626
"@babel/plugin-transform-runtime": "^7.0.0",
2727
"@babel/preset-env": "^7.6.0",
28-
"@playwright-testing-library/test": "4.3.0-beta.1",
28+
"@playwright-testing-library/test": "4.4.0-beta.1",
2929
"@playwright/test": "^1.25.0",
30-
"babel-jest": "^28.1.0",
30+
"babel-jest": "^29.0.0",
3131
"eslint": "^8.22.0",
3232
"eslint-config-prettier": "^8.5.0",
3333
"eslint-plugin-import": "^2.26.0",
3434
"eslint-plugin-prettier": "^4.2.0",
3535
"husky": "^8.0.0",
36-
"jest": "^28.1.0",
37-
"jest-light-runner": "^0.3.0",
36+
"jest": "^29.0.0",
37+
"jest-light-runner": "^0.4.0",
3838
"lint-staged": "^13.0.0",
3939
"start-server-and-test": "^1.14.0",
4040
"tmp": "^0.2.0"

src/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import path from "path";
55
import { fileURLToPath } from "url";
66
import "isomorphic-fetch";
77
import { program } from "commander";
8-
import apiDocParser from "@api-platform/api-doc-parser";
8+
import {
9+
parseHydraDocumentation,
10+
parseOpenApi3Documentation,
11+
parseSwaggerDocumentation,
12+
} from "@api-platform/api-doc-parser";
913
import generators from "./generators.js";
1014

1115
const dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -102,14 +106,11 @@ async function main() {
102106
switch (options.format) {
103107
case "swagger": // deprecated
104108
case "openapi2":
105-
return apiDocParser.parseSwaggerDocumentation(entrypointWithSlash);
109+
return parseSwaggerDocumentation(entrypointWithSlash);
106110
case "openapi3":
107-
return apiDocParser.parseOpenApi3Documentation(entrypointWithSlash);
111+
return parseOpenApi3Documentation(entrypointWithSlash);
108112
default:
109-
return apiDocParser.parseHydraDocumentation(
110-
entrypointWithSlash,
111-
parserOptions
112-
);
113+
return parseHydraDocumentation(entrypointWithSlash, parserOptions);
113114
}
114115
};
115116

templates/next/pages/_app.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type { AppProps } from "next/app";
2+
import type { DehydratedState } from "react-query";
23

34
import Layout from "../components/common/Layout";
45

5-
const App = ({ Component, pageProps }: AppProps) => (
6+
const App = ({ Component, pageProps }: AppProps<{dehydratedState: DehydratedState}>) => (
67
<Layout dehydratedState={pageProps.dehydratedState}>
78
<Component {...pageProps} />
89
</Layout>

0 commit comments

Comments
 (0)