gritzko/swarm

Code structure change ?

Closed this issue · 7 comments

The current project structure is mainly flat all the files are on the same level. The code could be a bit more organized: /storages, /data-structures, /streams, /utils ?

I mostly agree to the suggestion it should be split into several npm
packages. Do you have an idea how to make folder-packages, while keeping
all the git history?

On Sunday, 22 February 2015, Risto Novik notifications@github.com wrote:

The current project structure is mainly flat all the files are on the same
level. The code could be a bit more organized: /storages, /data-structures,
/streams, /utils ?


Reply to this email directly or view it on GitHub
#46.

Victor

Well git has support for feature that allows the subfolder split into separate project. I am not sure that's the easiest way. http://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository

qfox commented

Just saw this.

We can try to git mv all files to right places, make a need count of copies or main repo, and then git rm in each repo.
To store git history it'd be nice to find commits where files were created or moved and put in after them instant git mvs commits.

OK, the current plan is: one repo, many packages.

  1. All the contents of the current repo stay in place
  2. The root package.json is only indended for swarm.js developers who install the developer version from GitHub, like npm install gritzko/swarm
  3. The content gets sorted into folders with separate package.json files:
    • Lamport timestamps,
    • specs,
    • IdArrays,
    • Syncable+Host+Storage (core swarm)
    • SharedStorage
    • WebSocket stream
    • Einaros WebSocket server+stream
    • Redis Storage
    • LevelDB storage
    • IndexedDB storage
    • ...

So each storage is in separate folder(package), like redis-storage/RedisStorage.js ?

Exactly. Those have different dependencies.

On 8 April 2015 at 12:16, Risto Novik notifications@github.com wrote:

So each storage is in separate folder(package), like
redis-storage/RedisStorage.js ?


Reply to this email directly or view it on GitHub
#46 (comment).

Victor

Done in 1.0.0