Skip to content
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

[api-extractor] Running CLI in parallel causes wrong config to be used #3525

Open
thomasballinger opened this issue Jul 6, 2022 · 0 comments

Comments

@thomasballinger
Copy link

Summary

Running api-extractor in parallel seems to cause it to use the wrong config! Comparing the output of running two commands in parallel and in series, when run in parallel both api-extractor commands use the same config.

Repro steps

Create two api-extractor.json files, and a third that the other two inherit from (dunno if necessary). Run api-extractor on the command line on each using -c flag to specify the file to use. Notice (the --verbose flag helps) that one of the configs is used twice, the other not at all!
This is consistent for me with just two invocations on the command line, but when run from a Python script it helped to run 5 or 6.

Here's the output I see from running first in series, then in parallel.

$ npx api-extractor run -c server-api-extractor.json --verbose; npx api-extractor run -c react-api-extractor.json --verbose

api-extractor 7.28.3  - https://api-extractor.com/

Analysis will use the bundled TypeScript version 4.6.4
The API report is up to date: temp/server-tmp.api.md
Writing package typings: /Users/foo/bar/dist/esm/server/server.d.ts
Writing package typings: /Users/foo/bar/dist/esm/server/server-internal.d.ts

API Extractor completed successfully

api-extractor 7.28.3  - https://api-extractor.com/

Analysis will use the bundled TypeScript version 4.6.4
The API report is up to date: temp/react-tmp.api.md
Writing package typings: /Users/foo/bar/dist/esm/react/react.d.ts
Writing package typings: /Users/foo/bar/dist/esm/react/react-internal.d.ts

API Extractor completed successfully

with the output of running the same commands in parallel:

$ npx api-extractor run -c server-api-extractor.json --verbose & npx api-extractor run -c react-api-extractor.json --verbose
[1] 75259

api-extractor 7.28.3  - https://api-extractor.com/


api-extractor 7.28.3  - https://api-extractor.com/

Analysis will use the bundled TypeScript version 4.6.4
Analysis will use the bundled TypeScript version 4.6.4
The API report is up to date: temp/react-tmp.api.md
Writing package typings: /Users/foo/bar/dist/esm/react/react.d.ts
The API report is up to date: temp/react-tmp.api.md
Writing package typings: /Users/foo/bar/dist/esm/react/react.d.ts
Writing package typings: /Users/foo/bar/dist/esm/react/react-internal.d.ts
Writing package typings: /Users/foo/bar/dist/esm/react/react-internal.d.ts

API Extractor completed successfully

API Extractor completed successfully
[1]  + done       npx api-extractor run -c server-api-extractor.json --verbose

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-extractor version? 7.28.3
Operating system? Mac
API Extractor scenario? reporting + rollup
Would you consider contributing a PR? Yes
TypeScript compiler version? 4.6.4
Node.js version (node -v)? v16.15.1
@thomasballinger thomasballinger changed the title [api-extractor] Running in parallel from CLI causes wrong config to be used [api-extractor] Running in CLI in parallel causes wrong config to be used Jul 7, 2022
@thomasballinger thomasballinger changed the title [api-extractor] Running in CLI in parallel causes wrong config to be used [api-extractor] Running CLI in parallel causes wrong config to be used Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: AE/AD
Development

No branches or pull requests

1 participant