Coder Social home page Coder Social logo

Comments (6)

creationix avatar creationix commented on September 26, 2024

Good idea.

So for a bare local repo, all that's needed is the git-db interface. Inflate and Deflate are internal implementation details for that. Network communication is a little trickier. For clone/fetch/ls-remote the platform needs to provide tcp, http, and/or ssh interfaces (depending on which protocols you want to support).

If you want to use the built-in fs-db library, then you do need inflate/deflate/sha1 as well as an fs instance.

If you want to have a working directory, you need to provide an fs instance as part of the git-db interface. You don't have to use the fs-db adapter library. You could do this with only indexdb by emulating the fs on top of the indexdb system, but using indexdb directly for the git-db implementation.

from js-git.

maks avatar maks commented on September 26, 2024

@creationix yes but I was thinking about the "platform" package and what implementations of it need to provide.

But now that I think about I have confused the low-level with higher level requirements!

So with https://github.com/creationix/js-git-node-platform it provides node-based implementations of: sha1, inflate/deflate, fs, http, ssh, etc

And then a (imaginary) js-git-node-lib would provide object-db, working-dir, index-db, ls-remote, fetch, push, etc on top of what the platform module provides. The rough equivalent of cgit "plumping" cmds.

Does that makes sense?

from js-git.

creationix avatar creationix commented on September 26, 2024

I don't there would be such a high-level library, and if there was, it would be simply:

require('js-git/lib/platform.js')(require('js-git-node-platform'));
module.exports = require('js-git');

Assuming that js-git eventually exports a central thing.

All the high-level APIs will either be in js-git itself or in js-git addon modules, both which would be platform independent I think.

from js-git.

maks avatar maks commented on September 26, 2024

@creationix Yes you're right as usual! :-)
I had an even harder think about it and yes i can see that a platform just needs to expose the git-db interface for bare repo access.
For any kind of remote ops, it needs to expose at least 1 transport protocol (http, ssh, etc).
And then to support working dirs it needs to expose a fs interface.

But what about the index, do we need a seperate interface for it? or is it just something that client code of js-git will just handle itself?

from js-git.

maks avatar maks commented on September 26, 2024

As discussed on irc, the index interface should have: add/remove/read/list functions.

from js-git.

creationix avatar creationix commented on September 26, 2024

I documented this in the main README at the js-git repo.

We'll be adding more as we implement the other milestones.

from js-git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.