-
Notifications
You must be signed in to change notification settings - Fork 634
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
DYN-5405 npm pack dependencies #13599
DYN-5405 npm pack dependencies #13599
Conversation
@@ -104,11 +104,7 @@ test/core/customast/test.txt | |||
test/core/files/test.png | |||
test/core/migration/writetext.txt | |||
logo.png | |||
/src/Notifications/node_modules |
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.
Removing the old folder hierarchy
@@ -14,16 +14,33 @@ | |||
</PropertyGroup> | |||
|
|||
<Target Name="NpmRunBuild" BeforeTargets="BeforeBuild"> | |||
<Exec Command="npm install --prefix ./ @dynamods/splash-screen@latest" /> | |||
<Exec Command="npm pack @dynamods/splash-screen@latest" /> |
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.
The first step is to download the .tgz file
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.
Would you add inline comments, you should be able to use <!-- 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.
Should we clean up none latest versioned npm package?
|
||
<Target Name="ExtractTGZFile" BeforeTargets="BeforeBuild"> | ||
<ItemGroup> | ||
<TGZFiles Include="./*.tgz" /> |
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.
This gets all the files that contain the .tgz suffix
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reversed Include="@(TGZFiles->Reverse())" /> |
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.
Reverts the order of the found files
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<Last>%(TGZFiles.Identity)</Last> |
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.
Gets the last one
<Last>%(TGZFiles.Identity)</Last> | ||
</PropertyGroup> | ||
|
||
<Exec Command="tar -xzf $(Last)"></Exec> |
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.
Extracts the selected file
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.
No doubt this would work, but I have some concern.
- If we want to specify the npm package version, similar to versioned Nuget package. If we stick to latest, it seems hard to get the exact package
- If we want to clean up the legacy npm package.
Just two thoughts I would like team to think over
1 - If we delete it after being extracted, maybe it won't be an issue since we will not maintain the files locally. |
The self-service job is running in a loop and the build is failing. Converting this to draft to unblock the jobs. |
We are getting this message from the self-service job:
Looks like there is no libarchive or something else to extract the tgz file. |
@filipeotero Should we include this dll in the repo, is that enought to leverage it? |
@filipeotero @avidit (not sure what investigation you did of the builder image) but I see that the above document that @filipeotero linked says: In addition, have you considered using powershell? (which we know works on the builder image) 🤦 ... the end of that post, if I had read far enough uses a 7zip powershell commandlet. |
one more thought - if 7zip turns out to be the best solution, another approach is to add it to the builder image - this is nice because we add it for all our jobs that use that image, not just dynamo, in addition it makes it very unlikely we would distribute it - worth checking with legal if that makes things simpler. |
Hi @mjkkirschner, I'm using VS 2019. |
we don't need to include the binaries, but we still need to reference it and still need to go through legal. |
@mjkkirschner I ran |
@mjkkirschner I submitted a new commit that deletes the binaries and references the nuget package. Also, I'm still trying to reach the legal team about using 7zip. Thanks! |
@QilongTang Just to let you know, we have to wait for the EngOps to catch up before we merge this. https://jira.autodesk.com/browse/ESC-34251 |
<EmbeddedResource Include="node_modules\@dynamods\splash-screen\build\index.bundle.js" /> | ||
<EmbeddedResource Include="node_modules\@dynamods\splash-screen\build\index.html" /> | ||
<EmbeddedResource Include="package\build\index.bundle.js" /> | ||
<EmbeddedResource Include="package\build\index.html" /> |
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.
If there is no need for a specific package name, to me it means that we would only support a single npm package per project. Do we need to specify the folder name during unzipping? I would like to think about if a project depending on two or more npm package, does the current structure work in that setup?
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.
Is not necessary to specify the folder name during unzipping. By default, the folder created is called package. We can create folders named properly using the --directory argument from tar.
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.
@filipeotero Understood, my point is that if in the future DynamoCoreWpf
is depending on multiple npm packages, they will all be unzipped to the package
folder and the index.html will be overwriting each other. If possible, I would love to have the dir specified to prevent that case from happening, what do you think?
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.
Makes sense. I will do that!
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.
LGTM but with one concern commented
@filipeotero I think we can get this PR ready for merging again. The BRE pipeline have been using VS2022 now for a couple of days. |
@zeusongit Just to let you know, this PR is ready to be merged after the checks are completed. Thanks! |
Purpose
This PR is to avoid installing all the npm dependencies of the Notification Center and Splash Screen.
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@QilongTang
FYIs
@RobertGlobant20