forked from sombochea/verdaccio-ui
chore: improve local dev displaying 2 packages by default
vue and jquery as examples
This commit is contained in:
parent
240535ddad
commit
6f8d891c42
1
partials/storage/.verdaccio-db.json
Normal file
1
partials/storage/.verdaccio-db.json
Normal file
@ -0,0 +1 @@
|
||||
{"list":["vue","jquery"],"secret":"3bb332943c7086716a35dea44754b43b956ee655af1fe61866fbdaf38486836c"}
|
BIN
partials/storage/jquery/jquery-1.5.1.tgz
Normal file
BIN
partials/storage/jquery/jquery-1.5.1.tgz
Normal file
Binary file not shown.
4919
partials/storage/jquery/package.json
Normal file
4919
partials/storage/jquery/package.json
Normal file
File diff suppressed because it is too large
Load Diff
25169
partials/storage/vue/package.json
Normal file
25169
partials/storage/vue/package.json
Normal file
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
web:
|
||||
title: Verdaccio
|
||||
# gravatar: false
|
||||
# sort_packages: asc
|
||||
title: Verdaccio Local Dev
|
||||
sort_packages: asc
|
||||
primary_color: #CCC
|
||||
|
||||
plugins: ../
|
||||
|
||||
@ -14,22 +14,15 @@ auth:
|
||||
bar:
|
||||
name: bar
|
||||
password: test
|
||||
store:
|
||||
memory:
|
||||
limit: 1000
|
||||
|
||||
# theme:
|
||||
|
||||
|
||||
security:
|
||||
api:
|
||||
jwt:
|
||||
sign:
|
||||
expiresIn: 60d
|
||||
expiresIn: 120d
|
||||
notBefore: 1
|
||||
web:
|
||||
sign:
|
||||
expiresIn: 7d
|
||||
expiresIn: 100d
|
||||
notBefore: 1
|
||||
|
||||
uplinks:
|
||||
@ -41,12 +34,18 @@ packages:
|
||||
access: $all
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
|
||||
'vue':
|
||||
access: foo
|
||||
publish: foo
|
||||
unpublish: foo
|
||||
'jquery':
|
||||
access: $all
|
||||
publish: bar
|
||||
unpublish: bar
|
||||
'**':
|
||||
access: $all
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
|
||||
middlewares:
|
||||
audit:
|
||||
enabled: true
|
@ -1,19 +1,26 @@
|
||||
const fs = require('fs');
|
||||
const startServer = require('verdaccio').default;
|
||||
const yalm = require('js-yaml');
|
||||
const path = require('path');
|
||||
|
||||
const configJsonFormat = yalm.safeLoad(fs.readFileSync('./tools/_config.yaml', 'utf8'));
|
||||
const storageLocation = path.join(__dirname, '../partials/storage');
|
||||
const pluginsLocation = path.join(__dirname, '../partials/plugins');
|
||||
const configJsonFormat = Object.assign({}, yalm.safeLoad(fs.readFileSync('./tools/_verdaccio.config.yaml', 'utf8')), {
|
||||
storage: storageLocation,
|
||||
plugins: pluginsLocation,
|
||||
});
|
||||
|
||||
const handler = function(webServer, addr, pkgName, pkgVersion) {
|
||||
const serverHandler = function(webServer, addr, pkgName, pkgVersion) {
|
||||
webServer.listen(addr.port || addr.path, addr.host, () => {
|
||||
console.log(`${pkgName}:${pkgVersion} running ${addr.proto}://${addr.host}:${addr.port}`);
|
||||
});
|
||||
|
||||
process.on('SIGTERM', () => {
|
||||
webServer.close(() => {
|
||||
console.log('Process terminated');
|
||||
console.log('verdaccio server has been shutdown');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
startServer(configJsonFormat, 8080, '', '1.0.0', 'verdaccio', handler);
|
||||
// https://verdaccio.org/docs/en/node-api
|
||||
startServer(configJsonFormat, 8080, '', '1.0.0', 'verdaccio', serverHandler);
|
||||
|
Loading…
Reference in New Issue
Block a user