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.json #116

Closed
craigdallimore opened this issue Sep 11, 2016 · 8 comments
Closed

package.json #116

craigdallimore opened this issue Sep 11, 2016 · 8 comments

Comments

@craigdallimore
Copy link
Contributor

craigdallimore commented Sep 11, 2016

Hello!

I've noticed that there are two package.json files - one at /package.json and another at /repl/package.json.

I propose that this be reduced to 1 for the following reasons:

  • all the npm run * commands can be found within one place.
  • we reduce the number of duplicate packages that need to be downloaded (if there are any).

Furthermore I suggest that the npm-shrinkwrap.json (present in /repl, not in /) be moved to / and updated accordingly.

I'd be very happy to make these changes and update the npm scripts etc, if this proposal is accepted.

@buzzdecafe
Copy link
Member

i gotta think it over a bit. I agree the current situation is bad; it's simply legacy from when the new repl got added. An alternative approach could be to manage the repl as a separate repo and include it (without devDependencies et al) at build time.

@craigdallimore
Copy link
Contributor Author

Yep. I've been thinking along those lines too - it'd be nice to be able to reuse the repl for #95 in some way. Just off the top of my head, suppose we could do this on the Try Ramda page:

import repl from `some-ramda-repl-repo`;

const tryRamdaRepl = repl(document.querySelector('.repl-target'), {
  theme : 'dracula',
  controls : [
    'clear-input',
    'clear-output',
    'clipboard-input',
    'clipboard-output',
    'pretty',
    'share'
  ]
});

... and it will build the input / output, buttons etc as configured.

For the docs pages, focussing an example could instantiate a repl in place with perhaps minimal controls - e.g:

import repl from `some-ramda-repl-repo`;

...

document.body.addEventListener('focus', handleFocus);

...

function handleFocus(e) {
  if (e.target.classname === 'code-example') {
   repl(e.target, {
     destroyOnBlur : true
   });
  }
}

This should also make it easier for other people to inject ramda repls into external projects.

@buzzdecafe
Copy link
Member

This should also make it easier for other people to inject ramda repls into external projects.

Yup. Or to run just the repl locally without needing the entire ramda.github.io. I think that is probably a better way to go

@MattMS
Copy link
Member

MattMS commented Sep 12, 2016

(Regarding the first comment only) I'd like to add a 👎 to merging the REPL package.json with the main docs one, mainly because it would be mixing 2 fairly different packages.
That said, it seems the discussion has gone to making a separate repo, which I would give a big 👍 to.

Separating it into a package that could be included in other packages/sites would be excellent!

I'm afraid I haven't touched the REPL code at all, but I'm still happy to help out if needed.

@CrossEye
Copy link
Member

This has grown into a pretty nice REPL, thanks to the hard work of a number of people. I think it would make sense to make it stand alone. Are people thinking of making it more configurable? I.e., right now it builds in Ramda, Ramda-Fantasy, and Sactuary -- would that list just be part of the configuration supplied to the stand-alone version?

@MattMS
Copy link
Member

MattMS commented Sep 13, 2016

I've always dreamed of a CoffeeScript switch.

@CrossEye
Copy link
Member

I have only played around with CoffeeScript and barely that much with TypeScript, Flow, ClojureScript, PureScript, or any of the other compile-to-JS systems. While I don't specifically object, it sounds like a lot of maintenance on something that seems fairly peripheral. But if there's someone very interested in working on it, far be it from me to interfere!

@buzzdecafe
Copy link
Member

Let's go thataway

https://github.com/ramda/repl

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