Giter Club home page Giter Club logo

jspm-git's Introduction

jspm-git

NPM version Downloads Build Status Dependency Status

A generic jspm registry for Git Repositories.

jspm-git is based on Guy Bedford's github registry for jspm.

Compatibility

The most recent release of jspm-git is always compatible to the most recent release of jspm. For different jspm releases please have a look on the Jspm Compatibility Wiki to find a compatible jspm-git release.

For all [email protected] users, please use the beta version of jspm-git.

npm install jspm-git@beta

Installation

Install the registry globally or locally within your project:

# Global installation
npm install -g jspm-git

# OR local installation
npm install jspm-git --save-dev

Create a new jspm-git registry

jspm registry create mygit jspm-git

Where mygit will be the name of your new git registry.

Configure an existing registry

jspm registry config mygit

Where mygit is the name of your existing registry which you want to configure.

Export & Import registry configurations

Please have a look on the Auto-configuring Registries documentation of jspm.

Usage

Exemplary usage of jspm-git to install a jspm package from a git server located at ssh://[email protected]/

# Exemplary registry configuration of mygit
# baseurl: ssh://[email protected]/

jspm install mygit:projname/reponame

jspm-git will then try to install the package located at

ssh://[email protected]/projname/reponame.git

Troubleshooting

These combinations of jspm and jspm-git are valid

  • global jspm + global jspm-git
  • local jspm + local jspm-git

These combinations of jspm and jspm-git are invalid

  • global jspm + local jspm-git
  • local jspm + global jspm-git

Registry Configurations

Registry configurations for popular Git hosting services

Bitbucket

jspm registry create bitbucket jspm-git
# baseurl: https://bitbucket.org/

jspm install bitbucket:accountname/reponame

If you want to avoid rate limits please use the base URL ssh://[email protected]/ instead.

Please note that you've to upload your public key to your Bitbucket account or otherwise Bitbucket will refuse the sshconnection. For more details please see official Bitbucket manual Set up SSH for Git

Github

Please use the official github registry that comes along with the jspm-cli

Configuration File

You can find your jspm-git registry configuration in the following locations

  • Linux Systems ~/.jspm/config file
  • Windows %LOCALAPPDATA%/.jspm/config

jspm-git's People

Contributors

davinkevin avatar diagramatics avatar gerarde avatar mmilbrath avatar seangwright avatar subesokun avatar tauren avatar zeitiger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jspm-git's Issues

Error when trying to install a github enterprise repo

     Looking up gatech:user/repo
     Creating registry cache...
     Downloading gatech:user/[email protected]
Thu Jan 22 2015 00:25:28 GMT-0500 (EST): Error while cloning the git branch: 
Cloning into '/var/folders/tt/xxx/T/jspm-git-115022-30287-n66f5p'...


err  Error downloading gatech:user/repo
     Cloning into '/var/folders/tt/xxx/T/jspm-git-115022-30287-n66f5p'...

jspm-git bitbucket packageConfigPaths are wrong

When using jspm 0.17.0-beta.22 and jspm-git@beta, setting up bitbucket as a registry like so:

$ jspm registry create bitbucket jspm-git
// set it up as ssh://[email protected]/

Creates an entry in the jspm.config.js packageConfigPaths that looks like bitbucket:*.json, but because installing bitbucket repos puts them into folders just like GitHub does (eg, jspm i bitbucket:my-org/my-lib), this won't resolve dependencies correctly. You need the packageConfigPaths entry to look like GitHub's - ie, bitbucket:*/*.json instead of bitbucket:*.json.

Not updating to latest tag

I'm using jspm-git to access repositories hosted on our visual studio online server.

My package.json has

"myComponent": "tfsgit:myComponent@^0.0.6"

which will get the v0.0.6 tag fine, but I've pushed a new tag at v0.0.7, and running jspm update just gives me 0.0.6 again. However if I manually uninstall and reinstall, I'll get 0.0.7 as intended. Any ideas why update wouldn't be working?

Bitbucket projects support

I am unable to install packages living inside a project, meaning the git uri has an extra path such as
git.something.org/scm/foc/something-validations-phones.git

Is this supported?

JSPM loader-files issue when using jspm-git

I'm attempting to establish a mirror of GitHub repositories internally leveraging the jspm-git plugin and everything is working well but ran into an issue when JSPM attempts to download the loader-files I get an error that the .../loader-files/systems directories does not exist.

I believe the issue is that the jspm-git plugin expects the directory to exist but doesn't so blows up. I could probably be fixed on the JSPM side but since the existing/native github repository plugin works seems like this may be the more appropriate place.

A simple fix may be to update the moveRepoToOutDir function to ensure/create the outDir before moving from the temporary location. Let me know thoughts?

Regards

Support scp-like syntax for the SSH protocol

hi,

i have done this

jspm endpoint create mygitlab jspm-git

and config result is

"mygitlab": {
      "timeouts": {
        "lookups": 60
      },
      "baseurl": "[email protected]:code.bakery/",
      "reposuffix": ".git",
      "auth": "n1a3rtedgZZKDkghS5u7Swj",
      "shallowclone": true,
      "handler": "jspm-git"
    }

this gives me error
Endpoint not found.

but if i change endpoint name to "gitlab" it works

another thing is that with above i may have different account like code.backery, devmondo so if i set base url to "[email protected]" it does not work, it must specifically add the account name as above

thanks in advanced.

Broken with new versions of Node

See also jspm/github#117.

A recent change in Node (version 8?) means that child_process.execFile will barf if options.timeout is not an integer. Thus, jspm install fails on these versions of Node.

Unhandled rejection TypeError: "timeout" must be an unsigned integer
      at validateTimeout (child_process.js:640:11)
      at exports.execFile (child_process.js:201:3)
      at C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\exec-git.js:74:9
      at Promise._execute (C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\node_modules\bluebird\js\release\debuggability.js:300:9)
      at Promise._resolveFromExecutor (C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\node_modules\bluebird\js\release\promise.js:483:18)
      at new Promise (C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\node_modules\bluebird\js\release\promise.js:79:10)
      at C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\exec-git.js:73:14
      at tryCatcher (C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler (C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\node_modules\bluebird\js\release\promise.js:512:31)
      at Promise._settlePromise (C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\node_modules\bluebird\js\release\promise.js:569:18)
      at Promise._settlePromiseCtx (C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\node_modules\bluebird\js\release\promise.js:606:10)
      at Async._drainQueue (C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\node_modules\bluebird\js\release\async.js:138:12)
      at Async._drainQueues (C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\node_modules\bluebird\js\release\async.js:143:10)
      at Immediate.Async.drainQueues (C:\Build\trace\Ouranos.Trace.Web.Applications\node_modules\jspm-git\node_modules\bluebird\js\release\async.js:17:14)
      at runCallback (timers.js:800:20)
      at tryOnImmediate (timers.js:762:5)
      at processImmediate [as _immediateCallback] (timers.js:733:5)

My hack is to patch exec-git.js (see the lines with // HACK):

if (process.platform === 'win32') {
  var gitPool = new Pool(Math.min(os.cpus().length, 2));
  module.exports = function(command, execOpt, callback) {
    execOpt = Object.assign(execOpt || {}, { timeout: 0 }); // HACK
    return gitPool.execute(function() {
      return new Promise(function(resolve){
        execFile('git', command, execOpt, function(err, stdout, stderr){
          callback(err, stdout, stderr);
          resolve();
        });
      });
    });
  };
} else {
  module.exports = function(command, execOpt, callback) {
    execOpt = Object.assign(execOpt || {}, { timeout: 0 }); // HACK
    execFile('git', command, execOpt, callback);
  };
}

Please fix this ASAP.

How to configure and install jspm-git in bitbucket repository?

I am new in jspm and jspm-git. I followed the below steps to install the jspm package using jspm-git from bitbucket repository.

  1. I already installed jspm and jspm-git globally in my machine.
  2. I configured the below jspm options in my bitbucket repository's package.json.
"jspm": {
    "registry": "jspm",
    "name": "my-package",
    "registries": {      
      "bitbucket": {
        "baseurl": "git+ssh://[email protected]/",
        "handler": "jspm-git"
      }
    }
  }
  1. I run the below command to install the above private bitbucket repository in a new application.

jspm install bitbucket:my-accountname/my-reponame.git

After running the above command I got the below error.

err Repo bitbucket:my-accountname/my-reponame.git not found!

Can you please let me know how to configure and install a private bitbucket repository using jspm-git?

Shell-escape user input

Hey, thanks a lot for your work on this. I recently installed it and configured Bitbucket per the readme, and got the following error when attempting to jspm install a private Bitbucket repo:

warn Error on lookup for bitbucket:foo/bar, retrying (1).
     Error: /bin/sh: -c: line 0: syntax error near unexpected token `)'
/bin/sh: -c: line 0: `git ls-remote  refs/tags/* refs/heads/*'

At a guess, I re-ran jspm registry create bitbucket jspm-git and wrapped my password in single-quotes, after which installing from Bitbucket worked normally. My password is randomly-generated and includes shell control characters, so it looks like lack of escaping is the problem. Based on the output and a cursory scan of the code, I'm blindly assuming that the issue is somewhere in this vicinity.

Let me know if there's anything else I can do to help track it down.

Issue with multiple jspm processes running concurrently

We're seeing an issue, where when multiple jspm processes are running concurrently, they appear to overwrite/loose the config. I'll investigate and try to file a PR, but here's the current error we're seeing intermittently:

err  Registry bitbucket not found.

err  Unable to load registry bitbucket

This appears to happen with any git endpoints, not just bitbucket. There's also no stack trace, or any other real info related...

The endpoint was/is setup prior to running JSPM using the following:

jspm config registries.bitbucket.baseurl git+ssh://[email protected]/
jspm config registries.bitbucket.handler jspm-git

How do you use this locally?

How do I use jspm-git in my local project without installing it globally?

EDIT: Maybe this is better asked in jspm-cli. I'll close this one.

Cannot read length of null after upgrading to Git 2.10.0

Hi,

It seems after upgrading to the current last version of git, the module stop working. It returns an error can not read length of null generated by the line 88 of git.js

After analysis, it seems the regex parses only one digit for each part of the version number.
So, the regex currently /\d.\d.\d/ should take into account Major, minor or patch version upper to 10. To do that, something like /\d+.\d+.\d+/ should do the job.

I will do PR to fix that.

Could it be integrated in the 0.4.X version ?

/cc @aubm

Thanks

How to install Bower component from Stash repo with JSPM

This is a question I asked on StackOverflow already, however you may know about this as well.

My client uses Stash to host project repositories. We use a private Bower registry for our private libraries.

In this new project I am building, I am using JSPM. I have used jspm-git to create a stash registry. Getting the public libraries such as jQuery, Angular and Lodash obviously works fine.

I get into an issue when I run this:

jspm install mapped-name=stash:project-name/lib-name

Obviously the actual lib names are redacted to respect my client's intellectual property.

This is the error I get:

warn Error on build
 TypeError: undefined is not a function
     at Object.posix.isAbsolute (path.js:479:15)
     at Object.posix.normalize (path.js:461:26)
     at GitLocation.build ([REDACTED]/node_modules/jspm-git/git.js:426:17)
     at [REDACTED]/node_modules/jspm/lib/registry.js:117:30
     at lib$rsvp$$internal$$tryCatch ([REDACTED]/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:493:16)
     at lib$rsvp$$internal$$invokeCallback ([REDACTED]/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:505:17)
     at [REDACTED]/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:1001:13
     at lib$rsvp$asap$$flush ([REDACTED]/node_modules/jspm/node_modules/rsvp/dist/rsvp.js:1198:9)
     at process._tickCallback (node.js:355:11)

I do not know if I forgot a step, or if I misconfigured something, or if there is even a bug with JSPM or jspm-git. Any guidances to help me debug this would be appreciated.

NPM dependencies in package.json attempted with myGit:<npm dependency name>

There seems to be a problem with installing npm dependencies that exist within the package.json of a project installed using this tool.

jspm install myGit:owner/project fails with:

warn Error on lookup for myGit:rollup-plugin-babel
Error: fatal: /info/refs not valid: is this a git repository?

Where rollup-plugin-babel is an NPM dependency listed in the package.json of the project within a private git repo.

Install package from mygitlab, dependencies from npm

Hi, how are you?

Our node.js team has sharing some packages in private gitlab on Intranet.

I am trying reuse their packages with config:

{
  ....
  "mygitlab": {
    "version": "1.0",
    "baseurl": "https://gitlab.example.com", // access via VPN
    "auth": "hhhhhhhhhhhhhhhhaaaaaaaaaaasssssssssshhhhhhhhh",
    "handler": "jspm-git"
  }
}

The sharing packages has dependencies which specified in package.json like this:

{
  "name:": "awesome-tool",
  "main": "./index.js",
  "dependencies": {
    "bytes": "^2.3.0",
    "some-base-tool": "git+ssh://[email protected]:30022/packages/some-base-tool.git#v0.2.x",
  }
}

Now, if I do jspm install mygitlab:packages/awesome-tool will get

     Looking up mygitlab:packages/awesome-tool
     Updating registry cache...
     Looking up mygitlab:bytes

warn Error on lookup for mygitlab:bytes, retrying (1).
     Error: fatal: Authentication failed for '/'


warn Error on lookup for mygitlab:bytes, retrying (2).
     Error: fatal: Authentication failed for '/'


warn Error on lookup for mygitlab:bytes, retrying (3).
     Error: fatal: Authentication failed for '/'


warn Error on lookup for mygitlab:bytes
     Error: fatal: Authentication failed for '/'


err  Error looking up mygitlab:bytes.

warn Installation changes not saved.

How can I make it lookup to npm?

many thanks

fe80fb6bb7bd2af0f5dac0992ec28c0ea3fcb3d1

jspm global install doesn't work.

I've followed the instructions in the readme to connect to a bitbucket git repo.

First I installed jspm-git globally:

npm install -g jspm-git

Then I created the bitbucket registry

jspm registry create bitbucket jspm-git

Then I went to my jspm project and attempted to do an install.

jspm install bitbucket:accountname/reponame

I get:

err Error: Cannot find module 'jspm-git'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)

If in my jspm project I install it locally:

npm install jspm-git --save-dev

Then the install command works as expected.

I wouldn't expect to need a local install after doing a global install.

Unable to install when registry baseUrl is using https

I confirmed that I can create a registry and install components from it when using SSH. However, when I set the repository url using https, I can't install components. I walked through and entered the advanced configuration and set credentials with no luck. I even made my repo public to see it that would work and it did not.

configuration for git repository in file system

I would like to use a simple git repository which is only available on a share network drive (on a windows machine).

It seems not possible to define the baseUrl with e.g. file:///myserver/d$/git_repo
Is there a way to do this??

Error: conq: repository does not exist.

First I created the bitbucket registry using jspm registry create bitbucket jspm-git and provided the base url as ssh://[email protected]/.

Then configured the bitbucket in a folder using jspm registry config bitbucket

When I install using jspm install bitbucket:account/repo.git it throws the below error.

 Looking up bitbucket:account/repo.git

warn Error on lookup for bitbucket:account/repo.git, retrying (1).
     Error: conq: repository does not exist.
     fatal: Could not read from remote repository.

     Please make sure you have the correct access rights
     and the repository exists.

    ...........
    ...........

I can checkout the same private repository using below command, but can't install using jspm-git.

git clone ssh://[email protected]/account/repo.git

Note: jspm and jspm-git installed with global access.

jspm : 0.16.39
jspm-git : 0.4.5

ssh:// base URL with port broken

If we specify base git url ssh://username@hostname:port/ (i.e. with a custom ssh port), git itself handles that just fine, but we are getting errors from jspm-git:

Error: ssh: Could not resolve hostname HOSTNAME:PORT: nodename nor servname provider, or not known

Any idea what's going on? Thanks!

Extra folders with package.json/files

As I configure:

// package.json
{
  "files": [ "dist/", "typings.json" ]
  ...
}

When I install the package jspm i bit:abc (bit is my registry), all folders in the git repo are created:

bit
+--- [email protected]
      +--- src
      +--- dist
      +--- spec

Those folders are correctly empty thou.
Also tried

{
  "jspm": {
    "files": ["dist/", "typings.json" ]
  }
}

with same result.

Git version check fails

Hi,

In git.js in line 50, were script is checking git version and trying to match it using regular expression is failing on command output like git version 1.10.1.windows.1.
It is caused because versionArr = stdout.match(/\d.\d.\d/); is expecting single digit.

jspm-git@beta breaks on log

Trying to convert a project to JSPM 0.17 beta I ran into a problem with jspm-git.

err  Error on processPackageConfig
TypeError: Cannot read property 'log' of undefined
    at GitLocation.processPackageConfig (/Users/hape/Sites/apsis/Apsis.Cloud/node_modules/jspm-git/git.js:483:14)
    at /Users/hape/Sites/apsis/Apsis.Cloud/node_modules/jspm/lib/registry.js:133:30
    at tryCatcher (/Users/hape/Sites/apsis/Apsis.Cloud/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/hape/Sites/apsis/Apsis.Cloud/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/Users/hape/Sites/apsis/Apsis.Cloud/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromiseCtx (/Users/hape/Sites/apsis/Apsis.Cloud/node_modules/bluebird/js/release/promise.js:596:10)
    at Async._drainQueue (/Users/hape/Sites/apsis/Apsis.Cloud/node_modules/bluebird/js/release/async.js:143:12)
    at Async._drainQueues (/Users/hape/Sites/apsis/Apsis.Cloud/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/hape/Sites/apsis/Apsis.Cloud/node_modules/bluebird/js/release/async.js:17:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

The issue is that this.ui is undefined in processPackageConfig:

// Line 466
if (noDepsMsg) {
          delete packageConfig.dependencies;
          delete packageConfig.peerDependencies;
          this.ui.log('warn', '`' + packageName + '` dependency installs skipped as it\'s a package with no registry property set.\n' + noDepsMsg + '\n');
        }

// Line 479
if (packageConfig.directories && packageConfig.directories.lib && !packageConfig.directories.dist) {
      packageConfig.directories.dist = packageConfig.directories.lib;
      this.ui.log('warn', 'Package `' + packageName + '` has a %directories.lib% override configuration which will work, but is deprecated for %directories.dist% in future jspm versions.\n');
    }

ui is passed into GitLocation.configure, but that method is never called in my case, and ui is not assigned to the instance anyway.

A quick way to solve it would be to add ui to the options object passed into the GitLocation constructor, but I guess that would change the interface of the package. Maybe this in combination with setting this.ui = options.ui || console;?

I'm happy to PR but would like to get your opinion first.

Create a Git registry non interactively?

Hi,

Is there a way to create a registry without being prompted for the base URL? That would be very handy for CI systems, something like:

jspm registry create mygit jspm-git --baseurl ssh://git@myserver/

Should I report that on the jspm-cli project instead?

Thanks,

Nico

Newest JSPM-git beta fails to install.

OS: Ubuntu 16.04 x64
JSPM version: 0.17.0-beta.22
NPM version: 3.8.9
JSPM-git version I tried to install: jspm-git@beta (0.5.0-beta.3)

Following the steps in the README, I did:

$ npm i -g jspm-git@beta
$ jspm registry create bitbucket jspm-git

The following error occurs:

err  Registry handler jspm-git not installed.

Beta: `files` / `jspm/files` have no effect

Don't know if the non-beta version also have this problem.
UPDATE: Confirm it only exists in beta.
At least not on [email protected] + [email protected]

I have a package that has the following:

// package.json
{
  "files": [
    "dist/",
    "typings.json"
  ],
  "jspm": {
    "files": [
      "dist/",
      "typings.json"
    ]
  }
}

When I install it, neither have effect and I still get the whole repo under jspm_package/bit/<mypackage>/.
(bit is the registry created with jspm-git)

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.