Skip to content

fix: better esm compatibility with api-doc-parser #338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.6.0",
"@playwright-testing-library/test": "4.3.0-beta.1",
"@playwright-testing-library/test": "4.4.0-beta.1",
"@playwright/test": "^1.25.0",
"babel-jest": "^28.1.0",
"babel-jest": "^29.0.0",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.0",
"husky": "^8.0.0",
"jest": "^28.1.0",
"jest-light-runner": "^0.3.0",
"jest": "^29.0.0",
"jest-light-runner": "^0.4.0",
"lint-staged": "^13.0.0",
"start-server-and-test": "^1.14.0",
"tmp": "^0.2.0"
Expand Down
15 changes: 8 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import path from "path";
import { fileURLToPath } from "url";
import "isomorphic-fetch";
import { program } from "commander";
import apiDocParser from "@api-platform/api-doc-parser";
import {
parseHydraDocumentation,
parseOpenApi3Documentation,
parseSwaggerDocumentation,
} from "@api-platform/api-doc-parser";
import generators from "./generators.js";

const dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down Expand Up @@ -102,14 +106,11 @@ async function main() {
switch (options.format) {
case "swagger": // deprecated
case "openapi2":
return apiDocParser.parseSwaggerDocumentation(entrypointWithSlash);
return parseSwaggerDocumentation(entrypointWithSlash);
case "openapi3":
return apiDocParser.parseOpenApi3Documentation(entrypointWithSlash);
return parseOpenApi3Documentation(entrypointWithSlash);
default:
return apiDocParser.parseHydraDocumentation(
entrypointWithSlash,
parserOptions
);
return parseHydraDocumentation(entrypointWithSlash, parserOptions);
}
};

Expand Down
3 changes: 2 additions & 1 deletion templates/next/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { AppProps } from "next/app";
import type { DehydratedState } from "react-query";

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

const App = ({ Component, pageProps }: AppProps) => (
const App = ({ Component, pageProps }: AppProps<{dehydratedState: DehydratedState}>) => (
<Layout dehydratedState={pageProps.dehydratedState}>
<Component {...pageProps} />
</Layout>
Expand Down
Loading