dotnet / nuget-trends

Check out NuGet packages adoption and what's trending on NuGet.
https://nugettrends.com
MIT License
146 stars 25 forks source link

'ng' commands fail due to missing tmp/release.js #177

Closed joaopgrassi closed 2 years ago

joaopgrassi commented 2 years ago

We require now the presence of tmp/release.js, but when running the ng commands like ng build, ng test or ng serve it fails with:

An unhandled exception occurred: Script file tmp/release.js does not exist

It would be best if the ng commands would still work and not require this file during development.

Maybe we can put the "tmp/release.js" inside the production configuration on angular.json? As then only builds with --prod would require this? Not sure.

tonyqus commented 2 years ago

I'm investigating the issue. I suppose this release.js is a script for production only. Can I remove generate-release directly? any impact on production?

tonyqus commented 2 years ago

@bruno-garcia I notice that Kamil Ogórek is also from Sentry. Can you ping him internally to check what's going on? and why we need this release.js? looks ng build is enough.

kamilogorek commented 2 years ago

Maybe we can put the "tmp/release.js" inside the production configuration on angular.json? As then only builds with --prod would require this? Not sure.

If that's possible, then it would be perfect.

I suppose this release.js is a script for production only. Can I remove generate-release directly? any impact on production?

generate-release is used to create a git hash based release names for Sentry project, so that every release is grouped together. See: https://github.com/dotnet/nuget-trends/pull/175

Afaik there's no way to access git hash during angular build process, so I had to do it by hand. If there is, would be great to integrate it into it.

We basically need window.SENTRY_RELEASE = { id: <hash> } to be injected into the build in one way or another. Sentry.init from our JS SDK will then pick it up automatically.

joaopgrassi commented 2 years ago

I'll take care of this 😊. It should be possible to require the file only when running ng prod builds.