Plugin development environment under Node and Github with external js library---some guidance appreciated

37 views
Skip to first unread message

stefano franchi

unread,
Feb 4, 2019, 10:56:09 AM2/4/19
to TiddlyWikiDev
Dear all:

I am starting to write my first widget plugin + external library in TW5 and I am not completely sure about the the correct / recommended / most useful structure to give to the various pieces I need to orchestrate.
I am using the node + folder model, as recommended on the devs site.

As I see it, there are 4 basic components:

1. TW5 itself
2. My plugin code
3. The demo/test site for the plugin
4. The external js library code (which I maintain too)

Here is what I did:
- I cloned the main TW5 repo  and created a second git repo under TW5/plugins/myName/myPluginName
- I cloned the external library repo under TW5/plugins/myName/myPluginName/files

So I have this structure, which I basically copied from the Railroad plugin I am using as a blueprint (and which seems already a bit too complex):

TW5 (git repo)
   +--------->bin     
   +--------->boot
   +-- .....
   + -------->editions
    |               +--------->server
    |                               +--------->tiddlywiki.info (updated to include myPlugin)         
   +--------->plugins
                    +--------->tiddlywiki
                    +--------->stefano
                                     +---------->myPlugin (git repo)
                                                        +----------->files (git repo for external library)
                                                                          |
                                                                          +------------>external_library.js
Questions:

1. Where would I put the demo/test site (which I also want to be under git control)? Am i correct that any tiddlywik/node site I init from within the TW5 directory above could be anywhere on disk and still have access to myPlugin?

2. Mostly, I am not sure about the external library location. First, it does not seem right to clone the entire external repo under files, which presumably will contain also other local material (.css, tiddlywiki.files, etc).
    Perhaps the external library should be cloned under a subdir of files and tiddlywiki.files structured accordingly, and tiddliwiki.files made to point it to it? With demo/test site included it would look as follows:

 +--TW5 (git repo)
 |       +--------->bin     
 |       +--------->boot
 |       +-- .....
 |       + -------->editions
 |       |               +--------->server
 |       |                               +--------->tiddlywiki.info (updated to include myPlugin)         
 |       +--------->plugins
 |                        +--------->tiddlywiki
 |                        +--------->stefano
 |                                         +---------->myPlugin (git repo)
 |                                                            +----------->files
 |                                                                              +--------->  file.css
 |                                                                              +--------->  tiddlywiki.files
 |                                                                              +----------> external_library-folder (git repo)
 |                                                                                                          |
 |                                                                                                          +------------------>external-library.js
 |    
 |    
 |
 +-->Demo/test site (git repo)

This structure makes logical sense to me but with four different git repos to keep updated seems like a maintenance nightmare (well 3+1, since I am not involved with TW5, although I would have to pull from every now and then).
Any suggestions on possible simplifications? How do you guys do it?

Brian Theado

unread,
Feb 4, 2019, 12:03:42 PM2/4/19
to tiddly...@googlegroups.com
Stefano,

I have a plugin at https://github.com/btheado/tw-ftlist which uses a structure I prefer. This one doesn't have any javascript code, but a javascript plugin can be structured like this as well (just that more will be needed).

TW listed as a dev-dependency in package.json and installed via npm rather than as a git checkout as you've done. That should simplify the directory structure. And in my example, #2 and #3 are in the same repository. If you choose that approach you are down to just 2 repositories.

That's only a partial answer, but I hope it helps.

Brian

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/7618e06f-988b-4db8-8ed9-a53496d1ed54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

stefano franchi

unread,
Feb 4, 2019, 1:56:05 PM2/4/19
to tiddly...@googlegroups.com
Brian,

thanks for the help, I'll look into that suggested structure.

Cheers,
Stefano


For more options, visit https://groups.google.com/d/optout.


--
__________________________________________________
Stefano Franchi

stefano...@gmail.com
http://stefano.cleinias.org
Reply all
Reply to author
Forward
0 new messages