0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

Refactor web, relocate files to web folder

This commit is contained in:
Juan Picado @jotadeveloper 2017-06-11 09:01:13 +02:00
parent 999a65e412
commit c9bf4ed20e
No known key found for this signature in database
GPG key ID: 18AC54485952D158
11 changed files with 4 additions and 81 deletions

View file

@ -1,4 +1,7 @@
node_modules
lib/web/static
lib/web/ui/
lib/web/static
coverage/
wiki/

0
Gruntfile.js Normal file
View file

View file

@ -1,62 +0,0 @@
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const Middleware = require('../middleware');
const match = Middleware.match;
const validate_name = Middleware.validate_name;
const validate_pkg = Middleware.validate_package;
const encodeScopePackage = Middleware.encodeScopePackage;
const whoami = require('./endpoint/whoami');
const ping = require('./endpoint/ping');
const user = require('./endpoint/user');
const distTags = require('./endpoint/dist-tags');
const publish = require('./endpoint/publish');
const search = require('./endpoint/search');
const pkg = require('./endpoint/package');
module.exports = function(config, auth, storage) {
/* eslint new-cap:off */
const app = express.Router();
/* eslint new-cap:off */
// validate all of these params as a package name
// this might be too harsh, so ask if it causes trouble
app.param('package', validate_pkg);
app.param('filename', validate_name);
app.param('tag', validate_name);
app.param('version', validate_name);
app.param('revision', validate_name);
app.param('token', validate_name);
// these can't be safely put into express url for some reason
app.param('_rev', match(/^-rev$/));
app.param('org_couchdb_user', match(/^org\.couchdb\.user:/));
app.param('anything', match(/.*/));
app.use(auth.basic_middleware());
// app.use(auth.bearer_middleware())
app.use(bodyParser.json({strict: false, limit: config.max_body_size || '10mb'}));
app.use(Middleware.anti_loop(config));
// encode / in a scoped package name to be matched as a single parameter in routes
app.use(encodeScopePackage);
// for "npm whoami"
whoami(app);
pkg(app, auth, storage, config);
search(app, auth, storage);
user(app, auth);
distTags(app, auth, storage);
publish(app, auth, storage, config);
ping(app);
return app;
};

View file

@ -1,9 +1,9 @@
'use strict';
const async = require('async');
const escape = require('js-string-escape');
const bodyParser = require('body-parser');
const Cookies = require('cookies');
const escape = require('js-string-escape');
const express = require('express');
const fs = require('fs');
const Handlebars = require('handlebars');

View file

@ -8,7 +8,6 @@ const createError = require('http-errors');
const utils = require('../utils');
const Logger = require('../logger');
module.exports.match = function match(regexp) {
return function(req, res, next, value) {
if (regexp.exec(value)) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

0
lib/web/ui/.eslintrc Normal file
View file

View file

@ -1,17 +0,0 @@
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>{{ name }}</title>
<link rel="icon" type="image/png" href="{{ baseUrl }}/-/static/favicon.png"/>
<link rel="stylesheet" type="text/css" href="{{ baseUrl }}/-/static/styles.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body class="body">
<div id="root"></div>
<script>
window.__INITIAL_STATE = JSON.parse('{{{data}}}');
</script>
<script type='text/javascript' src='{{ baseUrl }}/-/static/bundle.js'></script>
</body>
</html>

0
lib/web/ui/js/bootstrap-modal.js vendored Normal file
View file

0
lib/web/ui/js/entry.js Normal file
View file

0
lib/web/ui/js/search.js Normal file
View file