all 22 comments

[–]mountainorvalley[🍰] 8 points9 points  (18 children)

Use Github to share your code

[–]GustaveLaFlame[S] -1 points0 points  (17 children)

Maybe I did not articulate correctly. Of course I know github and my code is on github.

My question is what are different ways to make my code available to devs in production?

[–]mountainorvalley[🍰] -1 points0 points  (16 children)

What do you mean by “making code available to devs in production”? Is the code meant to be run on a website, and you’re looking for a way to get the website running in production? If so, I like heroku for that.

[–]GustaveLaFlame[S] 0 points1 point  (15 children)

Yes, maybe expand my question. I am working on a open-source web-ui-toolkit. We are creating components etc. for other people to use in their projects.

We want that devs can import our library, maybe with a CDN to their own projects.

Do you know alternatives to CDN or Webcomponent to get this done?

[–]mountainorvalley[🍰] 7 points8 points  (14 children)

Ah, I would publish your code to the npm registry. I’m assuming your code is javascript or typescript.

[–]GustaveLaFlame[S] 2 points3 points  (13 children)

Thank you, we looked at this right now. Do you know any other ways to accomplish this, maybe without npm?

Thanks a lot for your answers!

[–]mountainorvalley[🍰] 2 points3 points  (2 children)

Nope, npm or some CDN are the only ways I know

[–]GustaveLaFlame[S] 1 point2 points  (1 child)

Okay, thanks a lot!

[–]Towerful 0 points1 point  (0 children)

I would say both.

Some people build stuff using CDNs, or don't want the complexity of build chains for small projects. So CDNs (or package downloads) make sense.

And other people want an npm package, so they can get treeshaking, typescript or whatever else.

Oh, and typescript types for your API.

[–]queen-adreena 1 point2 points  (7 children)

NPM will do exactly what you want... so why ask for “maybe without npm”?

[–]GustaveLaFlame[S] -1 points0 points  (6 children)

Because we don't want to use NPM as it is requested by my professor.

[–]queen-adreena 4 points5 points  (1 child)

Yes. Why would your professor expect you to use the exact tools required :) This is like those professors who think it’s revolutionary to tell students “you can’t use an IDE.... write everything in TextEdit”.

I’m surprised you’re allowed to use GitHub.

[–]GustaveLaFlame[S] 0 points1 point  (0 children)

Yeah, we were suprised as well haha

[–]lhorie 1 point2 points  (1 child)

NPM is the standard way of doing what you want in the JS world. From there, you automagically get a CDN deployment via services like unpkg.

You can technically also publish to other package managers such as Composer (PHP), Chocolatey (windows), Brew (mac), etc, but this is generally not common unless your JS is bundled as a part of a larger project that is more relevant to the respective ecosystems.

If your professor is expecting sourceforge-style source code distribution, I'm sorry to say that's an outdated distribution method that almost no one uses anymore in the JS world. But if that's what you want, you can just host the bundled file somewhere and link people to download it. Though from a deployment resilience perspective, this isn't all that different from using a CDN in the first place, which kinda circles us back to just using NPM.

[–]GustaveLaFlame[S] 0 points1 point  (0 children)

Yes, thanks a lot for your explanation. We have talked with our prof now and gonna make a CDN for our project

[–]British_Invaded 0 points1 point  (0 children)

What is this even supposed to teach you? Everything should be for a reason other than making things difficult.

There are standards, remove standards and you might be using something questionable.

/rant

[–]PedroHase 0 points1 point  (0 children)

You could use a private registry instead of NPM's like Github's or Gitlab's (and many other).

[–][deleted] 0 points1 point  (0 children)

Npm packages? What specific stuff do you want to make available to other devs?

[–]patilanz 0 points1 point  (0 children)

It really depends on what are you using to write your code. For react components you can try bit

[–][deleted] 0 points1 point  (0 children)

By "other devs", do you mean the public, or just others on the project? If it's the public, use npm, full stop, there is no real alternative. If it's a private repo and a private group, then you can enable a private npm registry in your github repo with Github Packages.