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

Request: Publish binaries as NPM package #19

Open
mattrossman opened this issue Oct 26, 2020 · 7 comments
Open

Request: Publish binaries as NPM package #19

mattrossman opened this issue Oct 26, 2020 · 7 comments
Assignees
Labels
todo Make this happen

Comments

@mattrossman
Copy link

It would be super handy to be able to bootstrap a Tweego project with a simple

npm install tweego

and then be able to set up a package.json with scripts like

"scripts": {
  "start": "tweego -w -o dist/index.html src/index.twee & live-server dist",
  "build" "tweego -o dist/index.html src/index.twee"
}

This would make projects more portable since the Tweego dependency would be clearly defined and automatically pulled along with any other web development tools like live-server on an npm install, rather than requiring users to manually download the appropriate binary and add it to their PATH.

@Uzume
Copy link

Uzume commented Nov 5, 2020

I am not sure this is a good idea. Tweego can be used in projects on systems that do not even use node and npm (much less have them installed even). I am aware binaries can be packaged with npm packages and some people are using it as a generic packaging tool but remember it was originally designed to be a package tool for JavaScript and although tweego manipulates text that typically includes some JavaScript, it does not in fact contain any itself (short of prepackaging some twine story formats that do use JavaScript).

Using npm with tweego might make more sense if it were being compiled to JavaScript by the likes of gopherjs/gopherjs, however, I do not know of anyone actually trying to do that.

There already are some other projects around that have tweego setups similar to what you are requesting, e.g., ChapelR/tweego-setup.

@mattrossman
Copy link
Author

To clarify, I'm not suggesting the current distribution channel be removed, just that the binaries be mirrored on npmjs. Nothing would change for folks that don't use NPM. That being said, given the audience that Tweego is targeting I think you'd be hard pressed to find a user that doesn't already have NPM installed.

The example you shared requires users to manually install Tweego on their system and set the $PATH, which adds friction. NPM would be a convenience so you only need to run a single command to have a working dev environment. Also it would ensure your dev tools are versioned together, so the builds run the same on each system.

Just for a simple project I find myself using 3 other NPM tools (live-server for a dev server, cpx for watching static files like images and audio, and concurrently for running everything together), so Tweego is the awkward black sheep. When deploying my story on Netlify, I have to write a build script to install Tweego and modify the $PATH whereas npm dependencies get installed by default.

To me, it's not important what language the tool was written in, it's about the use case. Tweego is a tool for building web pages, and NPM is the defacto package manager for web developers.

Related: https://www.npmjs.com/package/go-npm

@Uzume
Copy link

Uzume commented Nov 6, 2020

@mattrossman Perhaps you have valid points, however:

[...]I think you'd be hard pressed to find a user that doesn't already have NPM installed.

I think I qualify here as I use tweego often and rarely on systems where I am using npm. Perhaps I am not your average user though as I use it most often to decompile Twine stories to twee code with -d (I enjoy many engagingly well written stories that unfortunately are also often poorly written from a technical perspective and decompiling helps when no or only highly dated walkthroughs are available; without such it is very easy to miss/bypass large portions of the work).

The example you shared requires users to manually install Tweego on their system and set the $PATH, which adds friction.

I agree that example is dated and could be better but the point I was trying to make is nothing is keeping you from repackaging tweego and distributing it yourself on npmjs as you suggest (not unlike how @ChapelR created his own setup framework).

I appreciate the clarification.

@mattrossman
Copy link
Author

Good idea, I've never published on npm before but I'll look into how I might repackage it :)

@tmedwards
Copy link
Owner

I've been resistant to this idea in the past for various reasons, but I suppose an NPM package wouldn't be the end of the world.

I'll look into it.

@tmedwards tmedwards self-assigned this Nov 6, 2020
@tmedwards tmedwards added the todo Make this happen label Nov 6, 2020
@mattrossman
Copy link
Author

I've put together a working example here:

https://github.com/mattrossman/tweego-node

Right now it just downloads version 2.1.1 but ideally the node package versions would mirror the Tweego version.

@Uzume
Copy link

Uzume commented Nov 6, 2020

You will likely want to look at something like: https://api.github.com/repos/tmedwards/tweego/releases

The package could also be hosted at GitHub, e.g.:

I am not sure but I believe these can even be made private so @mattrossman could solve this just for himself and @tmedwards could come up with a more permanent solution later, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
todo Make this happen
Projects
None yet
Development

No branches or pull requests

3 participants