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

Start mirroring @types from Definitely Typed #3

Closed
sandersn opened this issue Dec 12, 2019 · 15 comments
Closed

Start mirroring @types from Definitely Typed #3

sandersn opened this issue Dec 12, 2019 · 15 comments

Comments

@sandersn
Copy link

This is a planning thread for mirroring @types from Definitely Typed as Github Packages. Github Packages are associated with an org which determines their npm scope. It will be @types in this case.
But Github Packages exist in a separate namespace from repos; they're required to have an associated repo but it can be named anything. It's not a one-to-one situation the way types currently is.

Here are the open questions I know of:

  1. What to name the Definitely Typed mirror repo.
  2. What to put in the mirror repo (if anything).
  3. What to do with the existing, used repo-based-packages.
  4. What to do with existing, unused repo-based-packages (which start with npm- and env- as far as I can tell).

Here are my initial answers:

  1. probably DefinitelyTypedMirror since I think DefinitelyTyped would be too confusing.
  2. Nothing? Or just a README explaining the purpose of the repo.
  3. I don't understand how these repos are used compared to npm-published packages from DT. I don't think Github Packages will interfere since they are installed in a completely different way.
  4. I don't think anybody uses these, and they are the majority of repos (208 of 231). It might be worthwhile to do something like renaming the org to typesOld, creating a new types org, and moving the 23 other repos over. (Note: Is renaming an org possible? I didn't know that.)
@sandersn
Copy link
Author

@blakeembrey This is the planning thread I said I would create.

@unional
Copy link

unional commented Dec 12, 2019

For 3. Currently since typing is deprecated, they are mostly installed by npm install types/XXX, i.e. installed directly as github source.
Of course, there might be existing typing users if the typing server run by @blakeembrey is still running.

@sandersn
Copy link
Author

@unional so the package.json entry looks like, eg "mysql": "github:types/mysql" ? Actually, how does that avoid conflicts with the mysql package itself?

@sandersn
Copy link
Author

sandersn commented Dec 12, 2019

oh, I see, after trying it, it's "@types/mysql": "github:types/mysql".

Compare this to the entry for Github Packages:

"@types/mysql": "^2.15.7"

Here, it's the configuration environment that redirects @types to github packages.

Edit: So I think projects may not be able to simultaneously use both the existing repo-as-packages and github-npm-packages, but one org can serve both kinds of projects.

@sandersn
Copy link
Author

sandersn commented Dec 12, 2019

OK, here's a plan. Please comment if you're interested; I'll probably do this tomorrow or Monday if there's no discussion.

  1. Rename the Types org to typed-typings.
  2. Create a new Types org.
  3. Re-add all admins and members to Types.
  4. Transfer all repos except npm-* and env-*. There are only 23 of these.
  5. Create a new repo in Types, DefinitelyTypedMirror.
  6. Add @typescript-bot to Types/DefinitelyTypedMirror and give it a token with package publish rights. Hopefully no other rights, but I think Github may not have publish-only tokens yet.
  7. Have @typescript-bot start publishing all DT PRs both to npm in the @types scope AND to Github Packages ... also to the @types scope.

People can use the mirror by adding an .npmrc in their project with the text

registry=https://npm.pkg.github.com/types

Which redirects the @types scope to github.

@felixfbecker
Copy link

Curious, what’s the advantage of Github packages?

@sandersn
Copy link
Author

npm is a good place for Typescript projects to consume packages from the @types scope, but Automatic Type Acquisition uses @types to improve the usability of JS editors — largely Microsoft editors. So it's fair to put the load of serving that on Microsoft's infrastructure. Fortunately Github Packages allows us to do that without changing the publishing infrastructure much.

Humans can still use @types from github, but that would only be needed if npm were to go away.

@blakeembrey
Copy link

@sandersn I am happy with the rename (make it typed-typings for legacy sakes, that was the old org name).

One issue we have is existing users of Typings API/registry, will they all break with the org rename? E.g. https://github.com/typings/registry? Not sure how GitHub handles renames when the old name gets claimed. Unfortunately Typings is still used in production by real people: typings/api#102 (I had hoped the API traffic I saw was legacy/bots).

@sandersn
Copy link
Author

Well, the entries in typings look like this:

{
  "versions": {
    "1.6.15": "github:types/npm-big-integer#f6861ea9a7a9bb72f4001dadf03c0ffb14ef7584"
  }
}

All the repos that we move back to types will be fine. However, when I inspected a few entries, they all pointed to npm-* entries, which will be broken since their new location will be "github:typed-typings/npm-big-integer#...".

There are actually still updates to the npm-* packages too, seems like mostly from @unional. If there's still usage of these, shouldn't we keep them around? They're not going to interfere with the packages from Definitely Typed. I know they should be deprecated soon, but I don't necessarily want to deprecate them now. But because of their deprecation, I also don't want to put in much migration work.

I suppose I could update typings/registry -- that's just a sed command to replace types with typed-typings. What do you think?

@unional you probably have an opinion too.

@unional
Copy link

unional commented Dec 13, 2019

I basically just accepting PRs. Those are contributions made by users.

I personally don’t use those types.

:)

@unional
Copy link

unional commented Dec 13, 2019

About the npm-* naming, we made that change back then because there are libraries that live off of npm, e.g. those only published to bower, and some global ones.

@sandersn
Copy link
Author

All right, I'm going to make the move. I made a PR on typings/registry that changes github:types back to github:typed-typings: typings/registry#1000.

@sandersn
Copy link
Author

Actually, github redirects might make the registry references still work. Still, the PR was so simple that we might as well update the registry.

@sandersn
Copy link
Author

I've done the rename and created a new repo. I invited the current owners for now and will invite everybody else soon.

I'm going to move the non-package repos next.

@sandersn
Copy link
Author

  1. I moved the non-package repos as well as the package repos that didn't show up in Move types back to typed-typings typings/registry#1000. Most of those packages appeared in the registry, but misconfigured. So the right fix might be to fix the registry. This probably doesn't matter for unused packages in a deprecated registry, though.

  2. I invited all current owners and members.

  3. I started publishing @types packages. You can see them in the packages tab from types' org page. I haven't filled in the old packages so right now it's just the most-recently-published packages from Definitely Typed.

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

No branches or pull requests

4 participants