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

Rewrite synchronize-with-npm in Node #67

Merged
merged 9 commits into from
Apr 29, 2022
Merged

Rewrite synchronize-with-npm in Node #67

merged 9 commits into from
Apr 29, 2022

Conversation

minkimcello
Copy link
Contributor

@minkimcello minkimcello commented Nov 23, 2021

Motivation

To rewrite the release action in typescript.

Approach

What's New?

  • Removed IGNORE and NPM_PUBLISH arguments. Similar to what was done in #65. We're skipping packages marked as private and we're using npm publish for all publishing (as opposed to giving the users the ability to provide their own publish command like yarn publish)
  • Also replaced BEFORE_ALL with INSTALL_SCRIPT
  • With the old action, if there were any packages that needed to be deprecated, those packages would've still published before deprecating (given the package version does not exist on the registry yet). But in the new action, we skip the publishing process for packages that are going to be deprecated. See comparison:
    old action:
      get all packages
        npm view each package to see which ones to publish
      yarn install
      yarn custom_script
      for each package
        npm publish pkg @ version
        git tag {pkg}-v{version}
        git push tag
      for each package.json with deprecate property
        npm deprecate pkg deprecate-description
    new action:
      separate packages into two lists
        packages to deprecate
        non-private packages
      npm view non-private packages to see if it should publish
        if there are any packages to publish
          yarn install || custom script
          for each package
            npm publish
            git tag pkg-v{version}
      if there are any packages to deprecate
        for each package
          npm deprecate pkg deprecate-description

TODOs

@frontsidejack
Copy link
Member

frontsidejack commented Nov 23, 2021

📣 NOTIFICATION
You are receiving this message because we did not publish any packages.

Generated by @thefrontside/actions Frontside

@minkimcello
Copy link
Contributor Author

@cowboyd Is there a correct way to write tests for both the synchronize-with-npm and synchronize-npm-tags actions? I'm not sure if I should find a way to mock the github and npm API or insert if/else here and there to skip all the requests portion of the code.

@minkimcello minkimcello changed the title [WIP] Rewrite synchronize-with-npm in Node Rewrite synchronize-with-npm in Node Apr 28, 2022
@minkimcello minkimcello marked this pull request as ready for review April 28, 2022 23:56
@minkimcello minkimcello mentioned this pull request Apr 29, 2022
@minkimcello minkimcello requested a review from taras April 29, 2022 14:35
Copy link
Member

@taras taras left a comment

Choose a reason for hiding this comment

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

👍

Base automatically changed from mk/tags to v2 April 29, 2022 14:54
@minkimcello minkimcello merged commit a469f20 into v2 Apr 29, 2022
@minkimcello minkimcello deleted the mk/release branch April 29, 2022 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants