-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat(icon): moved icon generation script #535
Conversation
🚀 Latest successful build of the PR deployed here. 🚀 |
@@ -48,7 +48,7 @@ jobs: | |||
run: yarn compile | |||
|
|||
- name: Build CDN icon resolver | |||
run: yarn build:icon-resolver --resolveStrategy=cdn --awsAccessKey=${{ secrets.AWS_VIVID_DEMO_PROD_ACCESS }} --awsAccessSecret=${{ secrets.AWS_VIVID_DEMO_PROD_SECRET }} --awsBucketName=vivid-icons-prod --awsBaseUrl=https://icons.resources.vonage.com | |||
run: npx lerna run "generate-icon-resolver" --parallel --scope="@vonage/vwc-icon" -- --verboseOutput --resolveStrategy=cdn --awsBucketName=vivid-icons-prod --awsBaseUrl=https://icons.resources.vonage.com --awsAccessKey=${{ secrets.AWS_VIVID_DEMO_PROD_ACCESS }} --awsAccessSecret=${{ secrets.AWS_VIVID_DEMO_PROD_SECRET }} |
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.
run: npx lerna run "generate-icon-resolver" --parallel --scope="@vonage/vwc-icon" -- --verboseOutput --resolveStrategy=cdn --awsBucketName=vivid-icons-prod --awsBaseUrl=https://icons.resources.vonage.com --awsAccessKey=${{ secrets.AWS_VIVID_DEMO_PROD_ACCESS }} --awsAccessSecret=${{ secrets.AWS_VIVID_DEMO_PROD_SECRET }} | |
run: yarn lerna run "generate-icon-resolver" --parallel --scope="@vonage/vwc-icon" -- --verboseOutput --resolveStrategy=cdn --awsBucketName=vivid-icons-prod --awsBaseUrl=https://icons.resources.vonage.com --awsAccessKey=${{ secrets.AWS_VIVID_DEMO_PROD_ACCESS }} --awsAccessSecret=${{ secrets.AWS_VIVID_DEMO_PROD_SECRET }} |
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.
I'm not sure it will yield the same result:
I think that yarn lerna
will try to execute a package.json script named "lerna" (which does not exist), whereas npx lerna
will run the default bin for package lerna
.
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.
It won't, obviously.
I'm referring to make it back as it was: yarn generate-icon-resolver
just as you have it in a build script.
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.
I was asked by @yinonov to remove this script from /package.json
. In fact, this was the guiding motivation behind this PR.
As for myself: I don't hold a firm opinion as to where this script fits best. Therefore I suggest that @gullerya and @yinonov will discuss their opinions and reach a conclusion.
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.
What makes you think that our opinions are different? Don't push us where we aren't :)
The script can be run via yarn
pointing to the package folder, as it was beforehand and there is no other opinion expressed on this specific point.
Minimum allowed coverage is Generated by 🐒 cobertura-action against f83f106 |
@@ -45,7 +45,7 @@ jobs: | |||
run: yarn compile | |||
|
|||
- name: Build CDN icon resolver | |||
run: yarn build:icon-resolver --resolveStrategy=cdn --awsAccessKey=${{ secrets.AWS_VIVID_DEMO_PROD_ACCESS }} --awsAccessSecret=${{ secrets.AWS_VIVID_DEMO_PROD_SECRET }} --awsBucketName=vivid-icons-prod --awsBaseUrl=https://d3fzvwfxu7izti.cloudfront.net | |||
run: npx lerna run "generate-icon-resolver" --parallel --scope="@vonage/vwc-icon" -- --verboseOutput --resolveStrategy=cdn --awsBucketName=vivid-icons-prod --awsBaseUrl=https://icons.resources.vonage.com --awsAccessKey=${{ secrets.AWS_VIVID_DEMO_PROD_ACCESS }} --awsAccessSecret=${{ secrets.AWS_VIVID_DEMO_PROD_SECRET }} |
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.
same as below, can you please use yarn
to preserve convention as elsewhere?
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.
Are you sure this will yield the same result? (see my comment☝️)
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.
I mean yarn generate-icon-resolver
, sorry, mislead you from what I've meant.
@tveinfeld : beside the ask to replace the |
I use Using Lerna makes it easier to refactor folder structure (like the one @yinonov is promoting), since it can run scripts according to the npm package identifier rather than folder names. |
Then I'd say it is less than obvious and quite not clear here: lerna is used mainly to serve multi-package structure - not your case here; parallel - meant to run all the same scripts in all the packages - not your case here. |
Good catch! I've changed "parallel" to "stream" to enhance readability. As for the proper location for the script, well, I leave this decision to anyone who holds a firmer opinion than mine. @yinonov for one. |
Kudos, SonarCloud Quality Gate passed! |
@tveinfeld : i'm not talking about location of the script, where do you take it from?! |
In order to use yarn, i need to define a script in package.json, and this is exactly what @yinonov wishes to remove. Now, if i want to execute the local script using yarn, i have to chdir into it and run the script, hence create coupling with the folder name in the build yml. to avoid this, lerna comes handy. |
Finally we getting closer :) Let's discuss the whole thing tomorrow, since we probably see here symptoms of being the whole part of icons build mis-located, so it might be a good point to fix stuff. |
we are using it in a context of multi package repo 😅 Lemme sum up the motivation. behind this PR for clarity: Using yarn would force me to reintroduce a script to the root's package.json i don't see how this exposes a deeper issue with the location of the icon module creation script, but it's a good opportunity to hear your opinion. |
Since it becomes too lengthy and not converging I'll ask a simple short one: why |
it is definitely an option.. it's just that @yinonov offered a different approach of using Lerna with a scope instead. |
Pull Request Test Coverage Report for Build 453054845
💛 - Coveralls |
The proposal is not relevant since it requires a broader changes and looks like @yinonov has no meant it to be that way.
/package.json
->/components/icon/package.json