Skip to content

Proposal to change npm module name to 'cloudevents' #242

Closed

Description

@lance

Since renaming the module has been an area of disagreement in this community, I propose we resolve this with a vote.

Currently the module is named cloudevents-sdk, however Grant has proposed changing this to simply cloudevents and has provided the cloudevents namespace on NPM. We have an upcoming 3.0.0 release which would be the appropriate time to make this change if voted on and approved.

Because there is no way to just change a module name and have things "just work", changing the name of the module would be a breaking change, requiring users to modify their existing package.json files. There are a couple of things that would need to happen in addition to simply renaming and publishing the module to npm.

  1. Deprecate all current versions with a warning so that when they are installed by existing projects. npm deprecate cloudevents-sdk@2.0.2 "WARNING: This module has been renamed to 'cloudevents'. Please install it instead. See https://cloudevents/sdk-javascript for more information."
  2. Update README with this same information

For votes in favor of renaming, please react to this issue description with 👍. Those opposed, please react to this issue with 👎.

Only votes on the issue description itself are counted. Please use additional comments to discuss pros/cons/concerns/etc. Thanks!

Activity

  1. added
    type/questionFurther information is requested
    type/discussionIssues that need to be decided/debated/discussed
    version/3.xIssues related to the 3.0 release of this library
    on Jul 7, 2020
  2. changed the title [-]Proposal to Change npm Module Name to 'cloudevents'[/-] [+]Proposal to change npm module name to 'cloudevents'[/+] on Jul 7, 2020
  3. helio-frota commented on Jul 7, 2020

    @helio-frota
    Member

    Additional comments:

    1. I agree this module is not a SDK, it is a library.
    2. I agree that, at that time, was not good to change, but now the project has an opportunity frame/window to be changed.
  4. pinned this issue on Jul 7, 2020
  5. loopingz commented on Jul 10, 2020

    @loopingz
    Contributor

    If we rename the module, I think it would be good to provide script to use with jscodeshift.
    So either reuse stuff like this: https://github.com/jurassix/refactoring-codemods

    or custom jscodeshift template, so people can just run npx jscodeshift -t cloudevents-sdk-2.0-3.0

    const util = require("util");
    // Update packages
    const packagesReplaceMap = {
      "cloudevents-sdk": { pkg: "cloudevents" }
    };
    
    // Update package.json?
    
    export default function transformer(fileInfo, api, options) {
      const j = api.jscodeshift;
      // eslint-disable-next-line global-require, import/no-dynamic-require
      const printOptions = options.printOptions || {};
      let root = j(fileInfo.source);
    
      // Replace all imports
      for (let i in packagesReplaceMap) {
        root
          .find(j.ImportDeclaration, {
            source: { value: i }
          })
          .replaceWith(path => {
            const { node, value } = path;
            value.source.value = packagesReplaceMap[i].pkg || i;
            return node;
          });
      }
    
      return root.toSource(printOptions);
    }
    

    This is a draft not final version, I can work on it if we think it is a good idea

  6. lance commented on Jul 13, 2020

    @lance
    MemberAuthor

    @loopingz this is good - but since the API has also changed, I wonder how tricky it will be

  7. grant commented on Jul 23, 2020

    @grant
    Member

    I think the votes are in, thanks for organizing @lance 👍
    9 👍
    3 👎
    as of July 23, 2020.

    Want to close this and resume in #215? I've created a PR.

  8. lance commented on Jul 24, 2020

    @lance
    MemberAuthor

    Closing. Fixed in #260

  9. unpinned this issue on Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/discussionIssues that need to be decided/debated/discussedtype/questionFurther information is requestedversion/3.xIssues related to the 3.0 release of this library

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions