@omer-x/next-openapi-json-generator 2.0.1 → 2.0.2

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/dist/index.cjs CHANGED
@@ -226,17 +226,17 @@ async function safeEval(code, routePath) {
226
226
  }
227
227
  }
228
228
  async function getModuleTranspiler() {
229
- if (typeof require === "undefined") {
230
- const { transpileModule } = await import(
229
+ if (typeof require !== "undefined" && typeof exports !== "undefined") {
230
+ return require(
231
231
  /* webpackIgnore: true */
232
232
  "typescript"
233
- );
234
- return transpileModule;
233
+ ).transpileModule;
235
234
  }
236
- return require(
235
+ const { transpileModule } = await import(
237
236
  /* webpackIgnore: true */
238
237
  "typescript"
239
- ).transpileModule;
238
+ );
239
+ return transpileModule;
240
240
  }
241
241
  async function getRouteExports(routePath2, routeDefinerName, schemas) {
242
242
  const rawCode = await import_promises3.default.readFile(routePath2, "utf-8");
package/dist/index.js CHANGED
@@ -197,17 +197,17 @@ async function safeEval(code, routePath) {
197
197
  }
198
198
  }
199
199
  async function getModuleTranspiler() {
200
- if (typeof __require === "undefined") {
201
- const { transpileModule } = await import(
200
+ if (typeof __require !== "undefined" && typeof exports !== "undefined") {
201
+ return __require(
202
202
  /* webpackIgnore: true */
203
203
  "typescript"
204
- );
205
- return transpileModule;
204
+ ).transpileModule;
206
205
  }
207
- return __require(
206
+ const { transpileModule } = await import(
208
207
  /* webpackIgnore: true */
209
208
  "typescript"
210
- ).transpileModule;
209
+ );
210
+ return transpileModule;
211
211
  }
212
212
  async function getRouteExports(routePath2, routeDefinerName, schemas) {
213
213
  const rawCode = await fs3.readFile(routePath2, "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omer-x/next-openapi-json-generator",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "a Next.js plugin to generate OpenAPI documentation from route handlers",
5
5
  "keywords": [
6
6
  "next.js",