[BUG] Error when working with npm workspaces
@kay-schecker がすでに取り組んでいます。
2022年1月30日 から。
評価
この issue はまだ評価されていません。
説明
🐛 Bug Report:
Describe the bug
The generator crashes with the [error] Required option '-i' is missing error when running with different cwd.
Steps to Reproduce
Steps to reproduce the behavior:
- Create a npm project with two workspaces:
packages/clientandpackages/server(server probably isn't even necessary) - Save a spec in
packages/openapi.yaml - Reference it in
packages/client/openapitools.jsonvia"inputSpec": "../openapi.yaml" - Add a script in client:
"openapi": "openapi-generator-cli generate"and run it- It works ✔️
- Add a script in root
"openapi": "npm run openapi --workspaces --if-present"and run it- See error ❌
- Generates a
openapitools.jsonin the root directory
Failing workaround
I created a packages/client/openapi.js script and let it run in client via "openapi": "node openapi.js" , but this also fails in the same way.
// try forcing the cwd to the client directory (works when checking with pwd command)
const child = require('child_process').exec('openapi-generator-cli generate', { cwd: __dirname });
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
child.on('exit', code => process.exit(code));
Expected behavior
I expect the generator to always find the file.
Operation System:
- OS: Windows
- Version 10
Package System:
- npm v8.3.0
- 主要言語
- TypeScript
- スター
- 2k
- フォーク
- 208
- 平均マージ
- 7時間 12分
- マージ済み PR(30日)
- 6
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenAPITools/openapi-generator-cli のほかの issue
-
[FEATURE] consider using caret ranges instead of pinned exact versions for runtime dependenciesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
[BUG] JAVA_OPTS is incorrectly evaluated再び着手できるかも @kay-schecker が 115 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
OpenAPITools/openapi-generator-cli#1213 · 担当者 1 名 ·
-
[BUG] Proxy configuration of NPM not used when downloading .jar via version manager再び着手できるかも @kay-schecker が 170 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
OpenAPITools/openapi-generator-cli#1190 · 担当者 1 名 ·
-
[BUG] openapiGeneratorIgnoreList is missing from schema再び着手できるかも @kay-schecker が 220 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
OpenAPITools/openapi-generator-cli#1138 · コメント 1 件 · 担当者 1 名 ·
-
[BUG] Environment variable not found (missing .env loading)再び着手できるかも @kay-schecker が 259 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
OpenAPITools/openapi-generator-cli#1094 · コメント 1 件 · 担当者 1 名 ·
OpenAPITools/openapi-generator-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
diegosouzapw/OmniRoute#14869 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
メンテナーはふだん 1 日以内に返信
-
status: waiting triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
freeCodeCamp/freeCodeCamp#70412 ·
メンテナーはふだん 1 日以内に返信
-
Mend: dependency security vulnerability untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
opensearch-project/OpenSearch-Dashboards#12816 ·
メンテナーはふだん 1 日以内に返信