ptitgraig / bower-nexus-resolver Goto Github PK
View Code? Open in Web Editor NEWAlmost a Nexus Bower Resolver
License: MIT License
Almost a Nexus Bower Resolver
License: MIT License
Hello, sorry for this very fast comment, but my colleague had a problem while trying to pass strictSsl = false config parameter to the resolver.
His goal is to pass strictSsl=false for the moment, and in a near future, to pass a specific ca.
While tracking why this was not working, I discovered an error in the code.
In index.js, in the download call, the 3rd parameter is this.config, which is always null. It should be bower.config or maybe leave it to this.config but in that case one should add config: bower.config in the returned object.
Hope this is clear, I asked him to send a pull request to correct this bug.
regards
below is a minor fix for express and json in the "server.js" implementing the intermediate registry as proposed. It also includes a second fix to keep prefix as 'nexus://' versus 'nexus:////'. In the example I used the port 8082.
So the .bowerrc should be :
{
"directory": "bower_components",
"registry": "http://localhost:8082/nexus-bower/",
"nexusRegistry": "http://localhost:8081/nexus/content/repositories/npm-bower/",
"resolvers": [
"bower-nexus-resolver"
]
}
The .bowerrc file could be located in your project folder, next to the bower.json file.
var express = require('express'),
json = require('express-json'),
http = require('http'),
config = {
port: 8082,
context: 'nexus-bower',
prefix: 'nexus://'
},
app = express(),
server = http.createServer(app).listen( process.env.PORT || config.port);
app.use( json() );
// wait for a request as:
// http://<hostname>/<context>/packages/<package-name>
// respond a simple JSON
app.get('/' + config.context + '/packages/:name', function(req, res){
res.json({
"name": req.params.name,
"url": config.prefix + req.params.name + '/' +req.params.name
});
});
console.log("STARTUP:: Express Bower registry simulator server listening on port::", server.address().port, ", environment:: ", app.settings.env);
Finally, you may want to create on your nexus a npm-bower local repository dedicated to bower packages and npm publish downloaded bower packages. Does any one know a tool that jsut does that ?
troubleshooting
javascript bower -j -V install angular
javascript set DEBUG=express:* & grunt server
First thanks a lot for publishing this solution. I would recommend to improve the documentation just by adding the code to mimic the bower registry.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.