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

What if I want to use as library instead run the entire source code? #330

Closed
jrichardsz opened this issue Nov 10, 2020 · 4 comments
Closed

Comments

@jrichardsz
Copy link
Contributor

jrichardsz commented Nov 10, 2020

According to some researches, is mandatory the use of the internal folder example to use Raneto.

That is fine but some folks might want to use as simple npm module. I tried:

var raneto = require('raneto');
var config = require('./config.default.js');
var app = raneto(config);
var server = app.listen(app.get('port'), function () {
  console.log('Express HTTP server listening on port ' + server.address().port);
});

So in order to make this works, I need to install as npm module:

npm i raneto --save

This throws an error:

gulp not found

That is because gulp is in devDependencies.

I think gulp is not just a dev library for Raneto.
Due to Raneto necesity of public/lib folder with several js files, I think must be moved to dependencies.

I moved it and this error dissapear

@ryanlelek
Copy link
Owner

Can you provide more of your use-case and what you're trying to accomplish?
Typically the public/ directory would not need to be used for a Node "library" but it depends on how it is used.
Please give us an idea and we can better advise.

Are you looking to use the markdown rendering engines alone?
An embeddable widget on pages?

@jrichardsz
Copy link
Contributor Author

Hi.

I mean that if I want to use raneto, I need the entire source code of raneto. Is it correct?

Comparing with similar frameworks or thinking as a library maker, it would be grateful if Raneto will be able to be used as library, instead to clone the entire Raneto source code.

@ryanlelek
Copy link
Owner

I need the entire source code of raneto. Is it correct?
Yes and no.

While we provide a "quickstart" where you can clone this repo and immediately try out Raneto by running on your local machine, it's not required.

All you technically need is the "example/" directory.
Then change example/server.js" line var raneto = require('../app/index.js');to bevar raneto = require('raneto');

and add raneto to your package.json file and run npm install as usual.

So it's currently sort of a library.
There may be additional bumps on that road as you mentioned because gulp and other generators would not be installed.

We'll add testing via library to the list of to-dos

@ryanlelek
Copy link
Owner

Adding this to the Roadmap megathread.
Closing this issue to cleanup

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

2 participants