This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
schroffl's profile picture

npm-inspired Packet Manager

Started by schroffl, 15 April 2016 - 07:42 PM
schroffl #1
Posted 15 April 2016 - 09:42 PM
Hey guys,

since I found it pretty annoying that you always had to C&P some basic utility functions everytime you need them, I sat down and created a little packet manager.

Here are some resources you may want to look at:
- Client Documentation
- How to create and publish a package
- Server/Registry Source Code

There's also a webinterface to browse the public registry: www.ccpm.ml

Yes, this post is kinda small, but I think that the documentation (currently client-only) should be self-explanatory and if there are any questions, feel free to ask them.

EDIT:
So here's a little example:
Edited on 24 April 2016 - 07:27 PM
lkmnds #2
Posted 16 April 2016 - 11:18 AM
Can anyone publish packages to the server? If the package I send(theoretically) already exists in the server, what would happen? This is a good idea in the lines of npm and cargo… I was thinking if git repositories could be implemented, so you have all the versioning features and branches and tags and <infinite stuff from git>
Edited on 16 April 2016 - 09:19 AM
schroffl #3
Posted 16 April 2016 - 11:39 AM
Can anyone publish packages to the server? If the package I send(theoretically) already exists in the server, what would happen? This is a good idea in the lines of npm and cargo… I was thinking if git repositories could be implemented, so you have all the versioning features and branches and tags and <infinite stuff from git>

Yes, anyone can publish, as long as they have a registered account as shown in the example. The public registry is currently running on my Cloud9, but theoretically you can run your own registry (for whatever reason).

To the git-thing: Could you elaborate? :P/>
Edited on 22 April 2016 - 11:27 AM
lkmnds #4
Posted 17 April 2016 - 01:50 AM
For example, when you initialize a Rust package(with "cargo init") it creates the package data AND a git repository in the current directory, so the packager has all the features of using git(branches, commits, and whatnot).
apemanzilla #5
Posted 17 April 2016 - 03:41 AM
If you want this to work you're going to need to host the server on a proper VPS. Cloud9 was designed for demos and lightweight testing and the registry is currently offline.
schroffl #6
Posted 17 April 2016 - 11:16 AM
If you want this to work you're going to need to host the server on a proper VPS. Cloud9 was designed for demos and lightweight testing and the registry is currently offline.

Yeah, I know, but I wanted to start off with Cloud9 just to test if anyone is actually interested in using it…
(It's online again)
Edited on 18 April 2016 - 03:38 PM
schroffl #7
Posted 18 April 2016 - 09:42 PM
The registry is now being run via Red Hat's OpenShift.
You can get the client using said registry via the pastebin code GuLjbc5i (outdated)
Edited on 22 April 2016 - 11:29 AM
apemanzilla #8
Posted 18 April 2016 - 10:08 PM
Now that the registry is online, it would be nice if there was better documentation :P/>
schroffl #9
Posted 18 April 2016 - 10:20 PM
Now that the registry is online, it would be nice if there was better documentation :P/>
Uhh c'mon, I knew that day would come :D/>
But I will hopefully sit down tomorrow and expand it a little further.
Edited on 18 April 2016 - 08:21 PM
apemanzilla #10
Posted 18 April 2016 - 11:03 PM
Now that the registry is online, it would be nice if there was better documentation :P/>
Uhh c'mon, I knew that day would come :D/>
But I will hopefully sit down tomorrow and expand it a little further.

Also a command to list packages available, or another way to browse them, would be nice :D/>
schroffl #11
Posted 20 April 2016 - 08:11 PM
Now that the registry is online, it would be nice if there was better documentation :P/>

I've just added a little guide on creating a package to the repo.
Edited on 22 April 2016 - 04:00 AM
schroffl #12
Posted 22 April 2016 - 06:06 AM
If the package I send(theoretically) already exists in the server, what would happen?

If you aren't the owner, you cannot publish a package that already exists (the owner is the person to first publish a package).
If you are the owner and the version you want to publish is already in the registry, it won't work either.
So in order to update you will have to increment your version (Semver).
Edited on 22 April 2016 - 04:10 AM
schroffl #13
Posted 24 April 2016 - 06:45 PM
Also a command to list packages available, or another way to browse them, would be nice :D/>

I've created a webinterface to browse and search for packages. It can be reached via www.ccpm.ml
Edited on 24 April 2016 - 05:09 PM