-
Notifications
You must be signed in to change notification settings - Fork 828
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
chore: simplify version script invocation #3887
chore: simplify version script invocation #3887
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3887 +/- ##
=======================================
Coverage 92.88% 92.88%
=======================================
Files 297 297
Lines 8836 8836
Branches 1814 1814
=======================================
Hits 8207 8207
Misses 629 629 |
74511a4
to
453ba00
Compare
The reason we didn't do this before is because if i'm in some subpackage and run |
@@ -16,7 +16,7 @@ | |||
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p ../", | |||
"codecov:webworker": "nyc report --reporter=json && codecov -f coverage/*.json -p ../", | |||
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../", | |||
"precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies", | |||
"precompile": "npm run version", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could remove cross-var by doing this:
"precompile": "npm run version", | |
"precompile": "lerna run version --scope @opentelemetry/api --include-dependencies", |
Since lerna is already in the root and is a hoisted dependency I don't think it should be a problem to keep it as long as all subpackages contain the same version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially I was not trying to remove cross-var
, but what initially sparked the idea was a devDependency on lerna
in @opentelemetry/core
but not anywhere else which I wanted to get rid of, but then I saw what I thought was an opportunity to remove cross-var
as well 😅
I guess this leaves us with two options - see comment
Ah, that's the gotcha I was waiting for 😓 I guess that leaves us with two options:
|
I also prefer option 1 |
Alright then I'll close this one and open another PR that does that instead. 🙂 |
Which problem is this PR solving?
Currently we need the
cross-var
dependency to support Windows, and would also needlerna
in every package as we're using it in theversion
script. It seems to me that the version script can just be invoked directly from theprecompile
script.Related discussion #3885
Related PR adding
cross-var
#3857Short description of the changes
version
fromprecompile
in every packagecross-var
as it is then not needed anymoreType of change
How Has This Been Tested?
npm run compile
from project root -> generatedversion.ts
correctly for all modulesnpm run compile
from module root -> generatedversion.ts
correctly for module