mirror of
https://github.com/SomboChea/ui
synced 2024-11-24 15:04:27 +07:00
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:
|
web:
|
||||||
title: Verdaccio
|
title: Verdaccio Local Dev
|
||||||
# gravatar: false
|
sort_packages: asc
|
||||||
# sort_packages: asc
|
primary_color: #CCC
|
||||||
|
|
||||||
plugins: ../
|
plugins: ../
|
||||||
|
|
||||||
@ -14,22 +14,15 @@ auth:
|
|||||||
bar:
|
bar:
|
||||||
name: bar
|
name: bar
|
||||||
password: test
|
password: test
|
||||||
store:
|
|
||||||
memory:
|
|
||||||
limit: 1000
|
|
||||||
|
|
||||||
# theme:
|
|
||||||
|
|
||||||
|
|
||||||
security:
|
security:
|
||||||
api:
|
api:
|
||||||
jwt:
|
jwt:
|
||||||
sign:
|
sign:
|
||||||
expiresIn: 60d
|
expiresIn: 120d
|
||||||
notBefore: 1
|
notBefore: 1
|
||||||
web:
|
web:
|
||||||
sign:
|
sign:
|
||||||
expiresIn: 7d
|
expiresIn: 100d
|
||||||
notBefore: 1
|
notBefore: 1
|
||||||
|
|
||||||
uplinks:
|
uplinks:
|
||||||
@ -41,12 +34,18 @@ packages:
|
|||||||
access: $all
|
access: $all
|
||||||
publish: $authenticated
|
publish: $authenticated
|
||||||
unpublish: $authenticated
|
unpublish: $authenticated
|
||||||
|
'vue':
|
||||||
|
access: foo
|
||||||
|
publish: foo
|
||||||
|
unpublish: foo
|
||||||
|
'jquery':
|
||||||
|
access: $all
|
||||||
|
publish: bar
|
||||||
|
unpublish: bar
|
||||||
'**':
|
'**':
|
||||||
access: $all
|
access: $all
|
||||||
publish: $authenticated
|
publish: $authenticated
|
||||||
unpublish: $authenticated
|
unpublish: $authenticated
|
||||||
|
|
||||||
middlewares:
|
middlewares:
|
||||||
audit:
|
audit:
|
||||||
enabled: true
|
enabled: true
|
@ -1,19 +1,26 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const startServer = require('verdaccio').default;
|
const startServer = require('verdaccio').default;
|
||||||
const yalm = require('js-yaml');
|
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, () => {
|
webServer.listen(addr.port || addr.path, addr.host, () => {
|
||||||
console.log(`${pkgName}:${pkgVersion} running ${addr.proto}://${addr.host}:${addr.port}`);
|
console.log(`${pkgName}:${pkgVersion} running ${addr.proto}://${addr.host}:${addr.port}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on('SIGTERM', () => {
|
process.on('SIGTERM', () => {
|
||||||
webServer.close(() => {
|
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