Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove GitHub dependency #3

Open
SimenB opened this issue Feb 28, 2015 · 18 comments
Open

Remove GitHub dependency #3

SimenB opened this issue Feb 28, 2015 · 18 comments

Comments

@SimenB
Copy link

SimenB commented Feb 28, 2015

Hi!

I work behind a firewall, and while packages from npm get through, your dependency on a fork on GitHub does not. Would it be possible to either get you fork's changes merged into the main project or publish your fork on the npm-repo?

@bessdsv
Copy link
Owner

bessdsv commented Mar 2, 2015

What do you mean?
In npm-repo is a last version of GitHub Sources.
Can you show me a differences?

@SimenB
Copy link
Author

SimenB commented Mar 2, 2015

The main difference for us would be that this would be usable for us at all. We are not able to clone from github, but we can pull down from NPM.

For others, it would be that they can lock the version, and not get whatever is at the tip of your fork. Shrinkwrap will make the build reproducible

@thomaswhite
Copy link

Thank you for your good work!. Using the default version of jQuery work great.
I am trying to use a different version jquery. My karma.config.js has the following sections:
...
frameworks: ['jquery-1.5.2', 'jasmine-jquery', 'jasmine' ],
plugins: [
'karma-chrome-launcher',
'karma-html2js-preprocessor',
'karma-jasmine-jquery',
'karma-jasmine',
],
...
I have all modules installed globally :
npm install -g karma karma-cli karma-chrome-launcher karma-firefox-launcher karma-html2js-preprocessor karma-environments karma-chrome-launcher karma-firefox-launcher bower jasmine-jquery karma-jasmine karma-jasmine-jquery

If I run karma without 'jquery-1.5.2' in the framework array all is fine.
When I add 'jquery-1.5.2', I go the following error message:

karma karma.conf.js
DEBUG [plugin]: Loading plugin karma-chrome-launcher.
DEBUG [plugin]: Loading plugin karma-html2js-preprocessor.
DEBUG [plugin]: Loading plugin karma-jasmine-jquery.
DEBUG [plugin]: Loading plugin karma-jasmine.

/home/twhite/.nvm/v0.10.36/lib/node_modules/karma/node_modules/di/lib/injector.js:9
throw error('No provider for "' + name + '"!');
^
Error: No provider for "framework:jquery-1"! (Resolving: framework:jquery-1)
at error (/home/twhite/.nvm/v0.10.36/lib/node_modules/karma/node_modules/di/lib/injector.js:22:68)
at Object.parent.get (/home/twhite/.nvm/v0.10.36/lib/node_modules/karma/node_modules/di/lib/injector.js:9:13)
at get (/home/twhite/.nvm/v0.10.36/lib/node_modules/karma/node_modules/di/lib/injector.js:54:19)
at get (/home/twhite/.nvm/v0.10.36/lib/node_modules/karma/node_modules/di/lib/injector.js:28:19)
at /home/twhite/.nvm/v0.10.36/lib/node_modules/karma/lib/server.js:31:14
at Array.forEach (native)

Any ideas?

@thomaswhite
Copy link

Sorry for the noise - I figured it out - karma-jquery do not include this version.

@bessdsv
Copy link
Owner

bessdsv commented Mar 3, 2015

SimenB,
Sorry, I'm not so long ago been programming on node and githab. can you write in more detail what should i do in code? Or make pool request with the desired changes?

@SimenB
Copy link
Author

SimenB commented Mar 29, 2015

@bessdsv Sorry about the slow response

In your dependencies, you reference your own fork of a project. https://github.com/bessdsv/karma-jasmine-jquery/blob/master/package.json#L32

What I'd like to happen is that you either make a PR back upstream to github.com/blittle/bower-installer, or publish your fork as a separate npm-module, to avoid having a git-dependency.

Make sense?

@bessdsv
Copy link
Owner

bessdsv commented Mar 30, 2015

@SimenB
I did PR for a long time, but for some reason the maintainer does not merge.
Create new module in the NPM is not desirable, and probably not correct.
Perhaps I will be able to rewrite the project after upgrading to a new version of Bower-installer next month.

@farnsy
Copy link

farnsy commented Aug 17, 2015

Did you have any luck resolving this? It appears the bower.json file in the karma-jasmine-jquery package has bower-install as a dependency, but it doesn't allow for downloading this dependency using the https url, only the git protocol. As I am on a corporate network, I can't install this package. If I try git clone https://github.com/bessdsv/bower-installer.git it clones fine. However it appears that when npm tries to install karma-jasmine-jquery, it uses https, but when it gets to the bower-install dependency it only uses git - which fails.

@SimenB
Copy link
Author

SimenB commented Aug 17, 2015

Nope, but we've upgraded to Jasmine@2, so we can use the jasmine-jquery npm-package directly, no need for this package. (just put the path to node_modules at the top of files, or use AMD/CJS/ES6-imports)

@farnsy
Copy link

farnsy commented Aug 17, 2015

Thanks for the tips here - added it as a reference in files, and all works great.

@rsquared86
Copy link

@SimenB I'm having the same issue behind a firewall. Tried using jasmine-jquery straight up, but am getting an error during karma start. No provider for framework:jasmine-jquery. Did you or anyone else run into this?

@SimenB
Copy link
Author

SimenB commented Nov 11, 2015

What does your config look like?

@rsquared86
Copy link

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '../../..',

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine-jquery', 'jasmine'],

// list of files / patterns to load in the browser
files: [
    'node_modules/jasmine-jquery/lib/jasmine-jquery.js',

    // core libraries
    'src/main/webapp/app/assets/libs/jquery.min.js',
    'src/main/webapp/app/assets/libs/angular.min.js',
    'src/main/webapp/app/assets/libs/angular-cookies.min.js',
    'src/main/webapp/app/assets/libs/angular-resource.min.js',
    'src/main/webapp/app/assets/libs/angular-touch.min.js',
    //'src/main/webapp/app/assets/libs/angular-route.min.js',
    'src/main/webapp/app/assets/libs/angular-ui-router.js',
    'src/main/webapp/app/assets/libs/bootstrap.min.js',
    'src/main/webapp/app/assets/libs/owl.carousel.min.js',
    'src/main/webapp/app/assets/libs/ui-bootstrap-tpls.min.js',

    // testing libraries
    'node_modules/angular-mocks/angular-mocks.js',

    // app scripts
    'src/main/webapp/app/*.js',
    'src/main/webapp/app/*.module.js',
    'src/main/webapp/app/*.filters.js',
    'src/main/webapp/app/*.routes.js',
    'src/main/webapp/app/core/*.module.js',
    'src/main/webapp/app/core/*.js',
    'src/main/webapp/app/services/*.module.js', 
    'src/main/webapp/app/services/*.js',
    'src/main/webapp/app/widgets/*.module.js',
    'src/main/webapp/app/widgets/*.js',
    'src/main/webapp/app/widgets/**/*.js',      
    'src/main/webapp/app/home/*.module.js',
    'src/main/webapp/app/home/*.js',
    'src/main/webapp/app/listing/*.module.js',
    'src/main/webapp/app/listing/*.js',
    'src/main/webapp/app/detail/*.module.js',
    'src/main/webapp/app/detail/*.js',

    // templates
    'src/main/webapp/app/widgets/**/*.html',


    // testing scripts
    'src/test/js/**/*.js',
    'src/test/js/*.js',

    //mock data
    //'src/test/mock/*.json'
    // fixtures
    {pattern: 'src/test/mock/*.json', watched: true, served: true, included: false}
],

// list of files to exclude
exclude: [
],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
    'src/main/webapp/app/**/*.js' : ['coverage'],
    'src/main/webapp/app/widgets/**/*.html': ['ng-html2js']
    //'src/test/mock/*.json': ['ng-html2js']
},

ngHtml2JsPreprocessor: {

    // strip this from the file path
    stripPrefix: 'src/main/webapp',

    moduleName: 'templates'
},

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress', 'coverage'],

// web server port
port: 9876,

// enable / disable colors in the output (reporters and logs)
colors: true,

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome', 'PhantomJS'],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false

})
}

@SimenB
Copy link
Author

SimenB commented Nov 11, 2015

If you use jasmine-jquery directly, you don't put it into frameworks, just add it to files

@rsquared86
Copy link

Thats what it was. Thank you!

@SimenB
Copy link
Author

SimenB commented Nov 11, 2015

👍

@julkue
Copy link

julkue commented Dec 11, 2015

I have the same problem and I don't understand why this is (10 months later) still an issue.

@boxersb
Copy link

boxersb commented Feb 19, 2016

@bessdsv Can you replace protocol of bower-installer git dependency in your package.json?

"bower-installer": "git://github.com/bessdsv/bower-installer.git#temp"

to

"bower-installer": "https://github.com/bessdsv/bower-installer.git#temp"

https://github.com/bessdsv/karma-jasmine-jquery/blob/master/package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants