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

RAN as NPM dependency #44

Open
sedubois opened this issue Jul 13, 2017 · 8 comments
Open

RAN as NPM dependency #44

sedubois opened this issue Jul 13, 2017 · 8 comments

Comments

@sedubois
Copy link

Would there be any chance of releasing RAN as an NPM dependency usable in our projects similar to next.js? When cloning the project, we are importing all of the complexity into our own codebase, are left on our own for maintenance, and can't benefit from future updates made to this project.

Thanks for your time 🙂

@Sly777
Copy link
Owner

Sly777 commented Jul 13, 2017

hey @sedubois! actually, there is. https://www.npmjs.com/package/ran-boilerplate

But honestly, I don't have any best practice for using boilerplate with NPM. So that's why I didn't indicate NPM link on "readme.md". If you know how to deal with it, don't hesitate to contribute to documentation, please :)

@sedubois
Copy link
Author

Thanks. I am not familiar with RAN yet, but I'd say what is needed first is to define some kind of API, similar to the way Next.js is imported in Javascript and how its binaries are accessed. Also need to ensure that the various config files such as .babelrc etc are properly picked up. But I'm really not a Node/JS guru so I'm not the best person to tell.

I just think it's worth spending time trying to modify, use and document the NPM package, because it could make this project considerably more attractive (for the reasons described in the OP).

Repository owner deleted a comment Jul 13, 2017
@ghost
Copy link

ghost commented Jul 15, 2017

@sedubois I'm not quite sure I understand "is to define some kind of API, similar to the way Next.js is imported in Javascript and how its binaries are accessed" and your intentions with this.

I've been digging into RAN these last days and from my understanding it seems it would be interesting to have it available as a global command line tool. (using the name ranx in the example as it is available on npm)

npm install -g ranx

Create a predefined package.json, routes.js, server.js, index.js page, some libraries, check if yarn is installed, if yes run yarn, else run npm install :
ranx init

Create a page :
ranx create page

Remove a page and its children :
ranx remove page

Create something else than a page (example a post or whatever name you use instead of xxx) which also creates a page for it and an archive component and container:
ranx create xxx

Remove something else than a page and its children :
ranx remove xxx

Add authentication and install its dependencies :
ranx add auth

Remove authentication and its dependencies :
ranx remove auth

Update the ran specific dependencies and config files (with/without renaming of the old ones to xx_bak) :
ranx update app

If that's what you mean, I'm willing to contribute to this. If your approach is beyond my understanding I'm not sure yet. WDY guys T?

[EDIT] : I think I know what you mean now; something like having the libraries, configs through an npm package ? Then we have a different approach...

@sedubois
Copy link
Author

Thanks, that documentation is quite helpful and I suggest to enrich the README with me. Seems much more helpful than the git clone version. However I guess should be npm install -g ran-boilerplate and not ranx? Anyway, I didn't manage to install either of them.

So the above comment concerns the binary itself, which you called ranx, and that's a good step in itself which I recommend to take anyway (this would make RAN some enhanced version of create-next-app). But there is also probably the need to have a Javascript API for better developer experience and maintainability (as described in the OP).

By to define some kind of API, similar to the way Next.js is imported in Javascript, I meant that right now ranx (or whatever it is) will probably create plenty of files in userspace, which the user then has to maintain himself. I.e. if it needs internally files like reduxStore.js, apolloClient.js, etc, these should be accessed through some import or require, and not copied to the project.

@ghost
Copy link

ghost commented Jul 16, 2017

I suggest we create these features before editing the readme ;)

@ghost
Copy link

ghost commented Jul 16, 2017

I used the name ranx for the example as I think -boilerplate is not appropriate if the npm package consists of basically a HOC (WithData) when installed locally and Command Line Tools if installed globally...

A boilerplate is the thing you clone and need to manually maintain ;)

Shall we start with this?

@sedubois
Copy link
Author

I thought the published npm already did what you described. If that's not the case, yes what you described sounds good to me.

@Sly777
Copy link
Owner

Sly777 commented Jul 18, 2017

Hey all @sedubois @astenmies, I really like your opinions, comments and ideas, thanks for that :) I'm also considering to create boilerplate that you can control & change it from CLI (this is the main part of RAN) Also as I said on #24, I'm also planning to put plugin system that people can add/remove features easily to their systems.

I created roadmap for RAN v1 (https://github.com/Sly777/ran/projects/1)

Before this big feature, We should work on integrating next-routes and create some CL commands (you can see tasks on the project link). Then, I can split the project (like create-react-app) for CLI system. I think we need to improve some sides of RAN before this. Otherwise, It can be really complicated to hold it stable with 1-2 people :)

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

No branches or pull requests

2 participants