Skip to content
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

Publish a local release (canary or stable) to NPM #14260

Merged
merged 22 commits into from
Nov 23, 2018

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Nov 17, 2018

Issue #14201. Builds on top of #14255 (view the delta).

This PR adds the final publish script and does a bit of cleanup of the pre-existing scripts. (For example, the build script is no longer needed and so it has been removed.)

This PR also removes the pre-build "version-check" behavior since there is an expected version mismatch between canary packages and the embedded React version (used by DevTools). If this change is controversial, I'm happy to elaborate on why I chose this detail and discuss alternatives.

Learn more about these new release scripts here.

Demos

Checking out a Circle CI build for a canary release

prepare-canary

Preparing a canary release to be promoted to stable

prepare-stable

Publishing a release

publish-canary

Resuming an interrupted publish (dry run)

publish-resume

Creating a local canary (escape hatch)

Note that I trimmed the middle out of this GIF since building takes a long time.
create-canary-output

@bvaughn bvaughn mentioned this pull request Nov 17, 2018
31 tasks
@facebook facebook deleted a comment from sizebot Nov 17, 2018
@bvaughn bvaughn force-pushed the automated-release-scripts-part-4 branch from 26001f6 to 8f6e199 Compare November 17, 2018 19:47
@bvaughn bvaughn changed the title [WIP] Publish a local release (canary or stable) to NPM Publish a local release (canary or stable) to NPM Nov 17, 2018
@bvaughn bvaughn requested review from acdlite and gaearon and removed request for acdlite November 17, 2018 19:53
@bvaughn
Copy link
Contributor Author

bvaughn commented Nov 18, 2018

My last commit was totally unnecessary, but I thought I might as well replace our scattered chalk styles with a shared theme. This has the (admittedly small) benefit of making repeated things (e.g. package name or version) more recognizable at a glance, since they are consistently formatted now:

screen shot 2018-11-18 at 10 51 42 am

screen shot 2018-11-18 at 10 52 10 am

screen shot 2018-11-18 at 10 53 38 am

screen shot 2018-11-18 at 10 53 47 am

screen shot 2018-11-18 at 10 53 51 am

screen shot 2018-11-18 at 10 54 12 am

screen shot 2018-11-18 at 10 54 39 am

screen shot 2018-11-18 at 10 54 58 am

screen shot 2018-11-18 at 10 55 08 am

These colors look best on a dark terminal themes, but I think they are also legible with a white terminal background. The yellow and green text are a little bit low contrast with light themes, but...it's probably okay?

@bvaughn bvaughn force-pushed the automated-release-scripts-part-4 branch from 5ff1d68 to 26a00aa Compare November 19, 2018 19:06
@bvaughn
Copy link
Contributor Author

bvaughn commented Nov 19, 2018

Rebased and added a new artifact to the Circle CI config– the error codes JSON. Going to let CI run to see if I configured it correctly. If so, I'm going to try to use this artifact when promoting a canary to stable so that I can avoid re-building it.

Brian Vaughn added 2 commits November 19, 2018 11:32
This commit also temporarily changes an error message so I can verify the updated error codes JSON
console.log(
theme`A full diff is availbale at {path ${relative(cwd, diffPath)}}.`
);
await confirm('Do changes changes look correct?');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo on "availbale" in line 161 too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, yes.

@bvaughn
Copy link
Contributor Author

bvaughn commented Nov 19, 2018

Error codes are now stored as Circle CI artifacts and automatically downloaded (and staged) after publishing (for stable releases). If the published release was a local build, instructions are provided for updating error codes.

CI build

screen shot 2018-11-19 at 12 58 02 pm

Local build

screen shot 2018-11-19 at 1 01 11 pm

@bvaughn bvaughn force-pushed the automated-release-scripts-part-4 branch from 8ba1f03 to 3585929 Compare November 19, 2018 22:16
@bvaughn
Copy link
Contributor Author

bvaughn commented Nov 20, 2018

During our chat today, Sunil, it occurred to me that I could pretty easily auto-stage changes to package JSONs after a stable publish by just copying over portions of the just-published package JSON (40dde41).

screen shot 2018-11-20 at 3 04 42 pm

screen shot 2018-11-20 at 3 07 01 pm

@bvaughn bvaughn force-pushed the automated-release-scripts-part-4 branch from 4b99ae2 to 03182f4 Compare November 20, 2018 23:17
@bvaughn bvaughn force-pushed the automated-release-scripts-part-4 branch from 03182f4 to 40dde41 Compare November 20, 2018 23:18
@bvaughn
Copy link
Contributor Author

bvaughn commented Nov 22, 2018

🕺

@threepointone
Copy link
Contributor

the code looks good to me, and we discussed this in person. I'm trying to actually run it on my machine today.

ps - er, where do I approve this? I see this
screenshot 2018-11-23 at 16 08 18

@bvaughn
Copy link
Contributor Author

bvaughn commented Nov 23, 2018

Top right of the page should have options to approve/request changes/comment.

Copy link
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested/verified dry runs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants