wbond / package_control_channel

Default channel file for Package Control. Follow the directions at:
https://packagecontrol.io/docs/developers
1.25k stars 3.62k forks source link

Question: What happens when you change the name of the package? #1016

Closed aponxi closed 11 years ago

aponxi commented 11 years ago

My package was added under the name sublime-better-coffeescript since it was automatically added by @SublimeText organization repo. I wish to rename the package to Better CoffeeScript now, as it is added by me utilizing package.json. Will renaming the package result in resetting the package info at package control? Do people have to re-install the package with the new name?

What issues can be expected?

sentience commented 11 years ago

The normal process for renaming a package is to remove the old "repositories" entry for the package from repositories.json, and add the replacement entry along with an entry under "renamed_packages" indicating the old and new names of the package, so that existing installations can be replaced with the new package automatically.

In your case, where your package’s entry is overriding a package that is also present in the @SublimeText organization repo, I’m not sure it’s possible to rename your package with that other entry for the old package still present.

@wbond, what do you suggest?

aponxi commented 11 years ago

@sentience thank you for your reply. To make things clear I am asking about renaming the package from my package.json file and not by the channels file. So the repositories.json file will still point to the same file

"https://raw.github.com/aponxi/sublime-better-coffeescript/master/package.json",

but the name in that package.json will be Better CoffeeScript instead of sublime-better-coffeescript. I'm guessing a new entry under "renamed_packages" isn't required for renaming package from package.json?

wbond commented 11 years ago

Here's the skinny:

  1. Delete the repo from the SublimeText organization. You are just adding confusion by having two copies. The default repository list has the SublimeText organization first so that other packages will override it, but it won't help if you are using a different name.
  2. Change the name in your packages.json file.
  3. Add the following to your packages.json file:
"renamed_packages": {
    "sublime-better-coffeescript": "Better CoffeeScript"
}

Part 3 will cause everyone who has it installed to automatically rename the package on their hard disk, which means when automatic upgrades happen, they will be getting the new versions of Better CoffeeScript.

The final step in the process is something I have to do, which is run a SQL command on the channel server to update all of the stats so that sublime-better-coffeescript installs are changed to Better CoffeeScript. This way you will keep your current install count.

aponxi commented 11 years ago

@wbond thanks for the information :) I appreciate it

aponxi commented 11 years ago

@wbond I am having trouble with my package.json

We have been experiencing issues with downloading the package, after I've removed the clone from SublimeText repo. The issue is reported here https://github.com/aponxi/sublime-better-coffeescript/issues/48

I've followed the guides that I've found on your website and I was able to update my package.json to the point where the error is now as follows:

Package Control: Error downloading package. HTTP error 404 Not Found downloading https://nodeload.github.com/aponxi/sublime-better-coffeescript/zip/master.
ignored packages updated to: [Vintage]

I've read that we were supposed to be using an url format such as http://nodeload.github.com/john_smith/github_example/zipball/master (zipball now has a new name which is archive. You might want to update those examples.) I also have https:// instead of http:// and I've also tried the download link https://github.com/aponxi/sublime-better-coffeescript/archive/master.zip as the url vale which didn't work either.

How exactly should the url look like for github?

Also could you please check if I've done the renaming right please? I think I need you to run that SQL command on the channel server to update the stats too.

For the ease of reference, the current package.json contains:

{
    "schema_version": "1.2",
    "renamed_packages": { "sublime-better-coffeescript": "Better CoffeeScript" },
    "packages": [
        {
            "name": "Better CoffeeScript",
            "description": "Syntax highlighting and checking, commands, shortcuts, snippets, watched compilation and more.",
            "author": "aponxi",
            "homepage": "https://github.com/aponxi/sublime-better-coffeescript",
            "last_modified": "2013-05-18 19:10:00",
            "platforms": {
                "*": [
                    {
                        "version": "0.6.36",
                        "url": "https://nodeload.github.com/aponxi/sublime-better-coffeescript/zip/master"
                    }
                ]
            }
        }
    ]
}

I appreciate the help!

wbond commented 11 years ago

https://nodeload.github.com/aponxi/sublime-better-coffeescript/zip/master is the correct URL to use. Not sure why you are getting a 404 - I am not.

zipball has not been changed to archive. archive is for github.com, whereas zip (or previously zipball) is for nodeload.github.com.

Downloads need to be done over https. http://wbond.net/sublime_packages/package_control/package_developers only mentions https for nodeload.github.com - where did you see the reference to http?

  1. Yes, https only
  2. Yes, this is the actual download URL. Other URLs are redirects and older versions of Package Control don't support redirects.
  3. No, it should not point to a URL ending with .zip. I should point to the URL https://nodeload.github.com/USERNAME/REPOSITORY/zip/master where USERNAME and REPOSITORY are replaced with package-specific values.
  4. No, the name of the JSON file does not matter at all, only the contents of it.

When the PC 2.0 beta and new website are released, there will be a tool to automatically handle renames and update stats counts.

aponxi commented 11 years ago

Ok thanks for the response. I will make adjustments upon your suggestions. Where I saw http, I cannot remember. I was doing all kinds of research that day. Maybe someone else's package.json was my reference point.