blomqma / next-rest-framework

Type-safe, self-documenting APIs for Next.js
https://next-rest-framework.vercel.app
Other
134 stars 17 forks source link

Warnings emitted during generate/validate using yarn workspaces #158

Closed markedwards closed 4 months ago

markedwards commented 4 months ago

Running the generate or validate CLI commands in a project using yarn workspaces emits a bunch of noisy warnings like:

Compiling endpoints...
▲ [WARNING] "../package.json" should be marked as external for use with "require.resolve" [require-resolve-not-external]

    ../../node_modules/playwright/lib/index.js:59:64:
      59 │ (0, _utils.addInternalStackPrefix)(path.dirname(require.resolve('../package.json')));

All of the warnings point to things in the top-level node_modules, so I'm guessing this is related to workspaces.

blomqma commented 4 months ago

This is most likely the same issue as described in https://github.com/blomqma/next-rest-framework/issues/159, please upgrade to v6.0.0-beta.4 and let me know if your issue persists.

markedwards commented 4 months ago

I don't get the warnings, but v6.0.0-beta.4 fails to locate the config, which was not a problem with v6.0.0-beta.2.

$ yarn next-rest-framework generate                                                      
yarn run v1.22.22
$ /bluefish/node_modules/.bin/next-rest-framework generate
Generating OpenAPI spec...
Next REST Framework config not found. Initialize a docs handler to generate the OpenAPI spec.
Done in 0.16s.

It also fails if I use --config. Happy to open a new issue for this if needed.

markedwards commented 4 months ago

This was simply a failure to set NODE_OPTIONS='--import=tsx', working now. Thanks!