cloudflare / doca

A CLI tool that scaffolds API documentation based on JSON HyperSchemas.
BSD 3-Clause "New" or "Revised" License
228 stars 36 forks source link

How do I create a new theme without publishing to npm? #34

Closed Relequestual closed 7 years ago

Relequestual commented 7 years ago

The theme docs say the easiest way to create a new theme is to fork the project, but provide no further information.

It seems unlikely that I'm expected to publish an npm module every time I make a change. I really don't know how I'm supposed to develop and test a new theme. The docs expect I should already know how to do this...

tajo commented 7 years ago

Checkout the README of https://github.com/cloudflare/doca-bootstrap-theme, it expects that you are comfortable with:

It seems unlikely that I'm expected to publish an npm module every time I make a change.

Why not? We publish a new version of our private doca-cf-theme with every single change as well.

handrews commented 7 years ago

@tajo not everyone sets up their own local npm server I'm guessing.

tajo commented 7 years ago

That's understandable, I think npmjs.com provides ~free~ private modules now. They also have an enterprise solution. Also, you can just npm install directly from git repository (but using a npm server is definitely better).

Relequestual commented 7 years ago

I didn't even realise you COULD have local npm servers till yesterday... I don't have suffeciant privlidges to spin up new machines at whim here.

I'm new to node, npm, and React. I'm happy to learn though. I will defintaly be wanting to make a number of pull requests in the very near future!

Relequestual commented 7 years ago

It doens't look like npmjs.com is offering free private modules.

I'll investigate alternative solutions =] Thanks.

Relequestual commented 7 years ago

@handrews is it really reasonable to expect people to publish every single to change they make for testing to npm in order to make a new theme? If so, I'll keep this issue closed... (Although it seems I can't re-open it anyway... =/ )

tajo commented 7 years ago

@Relequestual If you are doing a theme from scratch I would recommend to copy&paste it into the main project, so you'll get automatic hot reloading - it speeds up the development a lot. Then, you extract it into a different module.

What I am usually doing is npm link (It works great with node 7 and npm 4). When you make a change in your theme components, you just need to call npm link again and refresh the browser (it's pretty fast). If you change the stylesheet, you need to reload the dev server CTRL+C and npm start.

There is no need to republish to test your changes.

Relequestual commented 7 years ago

OK. That was what I was trying to understand. I'm not sure HOW I intend to develop a new theme yet... I may take a few existing components... Thanks for your help on this! =]