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

Package hosting options #3

Open
toastal opened this issue Jan 17, 2022 · 0 comments
Open

Package hosting options #3

toastal opened this issue Jan 17, 2022 · 0 comments

Comments

@toastal
Copy link
Contributor

toastal commented Jan 17, 2022

derw/src/cli/install.ts

Lines 157 to 171 in 6f94fd8

async function cloneRepo(dependency: Dependency): Promise<void> {
await ensureDirectoryExists(`derw-packages/${dependency.name}`);
const res = spawnSync(
"git",
[ "clone", `git@github.com:${dependency.name}.git`, dependency.name ],
{ cwd: "derw-packages", encoding: "utf-8" }
);
if (res.error) {
console.log(`Encountered error cloning ${dependency.name}`);
console.log(res.error);
}
}
(also, are you sure you don't want console.error instead of log here?)

Before this project digs itself into the same hole Elm did, please do not require that all packages come from Microsoft-owned GitHub. There are several valid reasons this is problematic from requiring agrees to GitHub's ToS to even begin participating in the community, to supporting FOSS platforms, avoiding vendor lock-in, promoting diversity, freedom+self-hosting, etc.

Suggestions:

  1. require the full git: URL regardless of where the Git forge is hosted
  2. above, but provide prefix shorthands for common ones like Nixpkgs fetch*; which includes but not limited to GitHub, GitLab, Gitea, Sourcehut, Bitbucket, Savannah (e.g. sourcehut:toastal/derw-lib) (missing Codeberg though (but Codeberg is Gitea)). This allows self-hosting while adding convenience -- and once the tarball situation is figured out (I believe the latest blog entry is wrong about GitHub lacking tarballs (see fetchGitHub)) all of these platform, including cgit support tarballs via git archive which can be used along the same shorthand switch/case.

Not acceptable:

  1. Only GitHub
  2. Giving GitHub special-er treament than say GitLab (e.g. no to toastal/derw-lib assuming GitHub since it's neither a full Git URL nor contains a shorthand as mentioned above in Suggestion#2, and more pedantically users must always use github:toastal/derw-lib). GitHub does not need additional promotion or implicit endorsement.

Possible longer-term but likely way out of scope for contemporary version control:

  1. Go beyond Git. SVN still exists as does Mercurial, Pijul, darcs, etc.
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

1 participant