build: release minified package under new name#1063
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1063 +/- ##
==========================================
- Coverage 97.90% 97.88% -0.02%
==========================================
Files 18 18
Lines 13245 13162 -83
Branches 428 420 -8
==========================================
- Hits 12967 12884 -83
Misses 275 275
Partials 3 3
Continue to review full report at Codecov.
|
|
Warning: This pull request is touching the following templated files:
|
There was a problem hiding this comment.
If we are going with this route, I'd prefer that the build logic is encapsulated in npm scripts.
My preference would be to eventually make this experiment its own GitHub repository, to give you more flexibility with regards to what a smaller version of the logging library looks like ... this feels gross.
I can understand starting the experiment in the same repository, not blocking for me; but I'd rather we pull more logic into npm scripts, which will benefit you when/if we split this out into its own repository.
| done | ||
|
|
||
| # Change and publish under package name `@google-cloud/logging-min` | ||
| sed -i -e 's/"name": "@google-cloud\/logging"/"name": "@google-cloud\/logging-min"/' package.json |
There was a problem hiding this comment.
This seems a little hacky to me, I was picturing we'd perhaps just make a new repository for this use case.
Is this the eventual plan?
There was a problem hiding this comment.
Yes this is the eventual plan. Doc shared for your review in our chat.
|
|
||
| if [ -f "$f.map" ]; then | ||
| # Keep original .ts source mappings | ||
| uglifyjs --source-map "content='$f.map', url='$f.map'" "$f" --output "$f" |
There was a problem hiding this comment.
I would prefer we pull the logic for minifying into package.json scripts, so that when you want the minified version you can just go:
npm compile-min
There was a problem hiding this comment.
This minifies the amount that the publication script deviates from our usual publication script.
There was a problem hiding this comment.
Good idea. My previous attempt did this - and we can just have a new publish-min script. Will modify
bcoe
left a comment
There was a problem hiding this comment.
Approving, so that I'm not blocking your work (since I think we're still on different time zones.).
The actionable feedback I have is that I have a preference for us capturing the build process in npm scripts 👍
This reverts commit 236a466.
Fixes #1037 🦕