Open mikeharder opened 3 months ago
Update all code in openapi-alps to call npm exec --no -- oad compare instead of importing @azure/oad
Will it make somehow harder to pass arguments and capture output? Like, what if the code throws? We will have to manually parse exception from the stdout or stderr? I understand in case of API call this is easier.
For reference, this is an example API call right now:
oadCompareOutput = await oad.compareTags(oldSpec, oldTag, newSpec, newTag, {
consoleLogLevel: "warn",
});
The only dependency on oad
and/or openapi-diff
in openapi-alps
is in the Azure DevOps extension breaking-change.ts
and its package.json
.
Update all code in openapi-alps to call npm exec --no -- oad compare instead of importing @azure/oad
Will it make somehow harder to pass arguments and capture output? Like, what if the code throws? We will have to manually parse exception from the stdout or stderr? I understand in case of API call this is easier.
For reference, this is an example API call right now:
oadCompareOutput = await oad.compareTags(oldSpec, oldTag, newSpec, newTag, { consoleLogLevel: "warn", });
I think our tools should move away from sharing code/APIs and towards sharing data over stdin/stdout. The https://en.wikipedia.org/wiki/Unix_philosophy. Because it allows interop between our own tools and third-party tools, and our own tools written in different langauges.
But either way, I think pinning the version of @azure/oad
directly in azure-rest-api-specs
will simplify updates enough to be worth any tradeoffs. It's one small step to getting everything out of openapi-alps
.
@azure/openapi-diff
toazure-rest-api-specs/package.json
npm exec --no -- oad compare
instead of importing@azure/oad
@azure/openapi-diff
completely from openapi-alps