TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
7.98k stars 1.18k forks source link

Should tw be managed as a monorepo? #2663

Closed danielo515 closed 5 years ago

danielo515 commented 7 years ago

I think that the extremely modular architecture of tiddlywiky makes it a good candidate for being managed as a monorepo. In fact, each official plugins is almost an independent edition and an item under the plugins folder. Would it be better to manage them as independent modules/repos? I think this may speed up the inclusion of plugins into the official collection, which is a process that I'm currently unable to understand.

Projects like Babel, React, Angular, Ember, Meteor, Jest, and many others develop all of their packages within a single repository.

What do you think?

pmario commented 7 years ago

You mean "organisation"? TiddlyWiki is a single repo at the moment.

Jermolene/TiddlyWiki5 .. repo https://github.com/TiddlyWiki ... organisation. .. but TW2 unfortunately.

Jermolene commented 7 years ago

Hi @danielo515 as @pmario points out, TiddlyWiki5 is already a mono-repo; are you suggesting that we split it up into several repos within a single organisation?

My thoughts on the mono-repo vs. multi-repo question pretty closely align with this:

http://danluu.com/monorepo/

danielo515 commented 7 years ago

Hello Jeremy,

I know that tiddlywiky is indeed a monorepo, and I'm in favor of keeping it that way. What I'm suggesting is making each plugin looking more like an individual package, with it's own package.json an edition folders contained within the same folder.

Jermolene commented 7 years ago

What I'm suggesting is making each plugin looking more like an individual package, with it's own package.json an edition folders contained within the same folder.

I think I see where you are coming from, but could you just outline the benefits that you'd see?

danielo515 commented 7 years ago

Hello Jeremy,

The main benefit from my point of view is integration with third party plugins. Currently there is no clear structure for creating a tiddlywiky plugin, and each developer does it at its own style. If official plugin tiddlers were like standalone packages it would be a matter of mimic that structure, and we will end with standardization.

Not to mention that including a plugin in the main repo of tiddlywiky is a weird process, specially compared to just add one more plugin to the plugins folder.

Regards

Jermolene commented 7 years ago

Hi @danielo515

If official plugin tiddlers were like standalone packages it would be a matter of mimic that structure, and we will end with standardization.

OK, that makes sense. I'm not sure that it is achievable to have 100% correspondence between a plugin within the core repo and a plugin in it's own repo but I agree it would be useful.

Not to mention that including a plugin in the main repo of tiddlywiky is a weird process, specially compared to just add one more plugin to the plugins folder.

Why is it a weird process? One drops the new plugin folder in plugins/<publisher>, and optionally drops a new edition folder into editions/<publisher>. I agree that dropping in a single folder would be simpler, but dropping in two folders doesn't seem complex or weird, or am I missing something?

Perhaps some of the confusion is because the plugins folder in the repo is the core plugin repository, while the plugins folder within a wiki folder is local to that wiki. I'm open to suggestions but I don't see a good way to avoid the distinction.

pmario commented 7 years ago

The main benefit from my point of view is integration with third party plugins. Currently there is no clear structure for creating a tiddlywiky plugin, and each developer does it at its own style. If official plugin tiddlers were like standalone packages it would be a matter of mimic that structure, and we will end with standardization.

I think there is already a standard, as Jeremy described it. plugins/<publisher> ..

If you set the TW variables: http://tiddlywiki.com/#Environment%20Variables%20on%20Node.js in the right way, you can store your plugins and editions in any folder, that you like. ... You just need to keep the structure like this eg:

Env: TIDDLYWIKI_PLUGIN_PATH = D:\path\to\your\plugins\

D:\path\to\your\plugins\  ... any path allowed 
   +-   pmario\                   ... publisher
   +-   pluginName\tiddlers\  .. your stuff

If the environment variables are set, you can use your own plugins with the following editions tiddlywiki.info config. IMO it just depends on your environment variables.

{
    "description": "Info-button persistent for one session",
    "plugins": [
                "pmario/info-session",
            "pmario/info-tagmap",
                "tiddlywiki/??????",
    ],
    "themes": [
        "tiddlywiki/vanilla",
        "tiddlywiki/snowwhite"
    ],
    "build": {
        "index": [
            "--rendertiddler", "$:/core/save/all", "index.html", "text/plain"
        ],
        "externalimages": [
            "--savetiddlers", "[is[image]]", "images",
            "--setfield", "[is[image]]", "_canonical_uri", "$:/core/templates/canonical-uri-external-image", "text/plain",
            "--setfield", "[is[image]]", "text", "", "text/plain",
            "--rendertiddler", "$:/core/save/all", "externalimages.html", "text/plain"
        ],
        "static": [
            "--rendertiddler", "$:/core/templates/static.template.html", "static.html", "text/plain",
            "--rendertiddler", "$:/core/templates/alltiddlers.template.html", "alltiddlers.html", "text/plain",
            "--rendertiddler", "$:/core/templates/static.template.css", "static/static.css", "text/plain",
            "--rendertiddlers", "[!is[system]]", "$:/core/templates/static.tiddler.html", "static", "text/plain"
        ]
    }
}

btw: I personally don't want to get the directory structure dictated. Since for me it needs to work with. win10, ubuntu 16.10 and mingw64 (aka: git-bash for windows). All those OSes behave different. If I set my environment variables, the tiddlywiki CLI behaves exactly the same way on all OSes. .. That's important.

tobibeer commented 7 years ago

I would suggest to have discussions like these be in the TiddlyWikiDev group, since there's hardly anything actionable about this ticket.