Compare commits
97 Commits
@verdaccio
...
@verdaccio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6bbc8ecc6 | ||
|
|
3763b9f285 | ||
|
|
f96b147ea1 | ||
|
|
1117dd347b | ||
|
|
78486b87e8 | ||
|
|
b121e3662f | ||
|
|
2e51c931dd | ||
|
|
4b0eaff5f7 | ||
|
|
15d5e969c4 | ||
|
|
9805298893 | ||
|
|
e0e39540c5 | ||
|
|
7c75776c84 | ||
|
|
586f1b0684 | ||
|
|
d036190aff | ||
|
|
988ff72081 | ||
|
|
b6495d5b6c | ||
|
|
2f033888e4 | ||
|
|
8a8f2b6774 | ||
|
|
3fe8cb0406 | ||
|
|
13710ba371 | ||
|
|
e39fbfee5f | ||
|
|
14671d8a10 | ||
|
|
be2626fcd5 | ||
|
|
717175567c | ||
|
|
65e077a926 | ||
|
|
b704689309 | ||
|
|
f625c114bb | ||
|
|
42d08eb423 | ||
|
|
668bbd0955 | ||
|
|
2ce7c7dfad | ||
|
|
a2877ab03c | ||
|
|
12d4b1ffc2 | ||
|
|
0fb5d31596 | ||
|
|
b315d4e113 | ||
|
|
6ab1faa25e | ||
|
|
2808cc268f | ||
|
|
d1d820f8b2 | ||
|
|
25a4601594 | ||
|
|
28ce2a99da | ||
|
|
7521a59f19 | ||
|
|
1ca89d923e | ||
|
|
386e47c34b | ||
|
|
fc185335a3 | ||
|
|
a6b0d63afb | ||
|
|
b8c7b771ad | ||
|
|
2645ae2e48 | ||
|
|
66c6df4ae9 | ||
|
|
feb385c8fd | ||
|
|
bd9b170090 | ||
|
|
30c5c19d5f | ||
|
|
9e419a99fc | ||
|
|
9faf6cb209 | ||
|
|
90b8bc242c | ||
|
|
c45711ade5 | ||
|
|
625f529fe9 | ||
|
|
0165ac1cd1 | ||
|
|
d753f02f91 | ||
|
|
456c78b4a7 | ||
|
|
cf9d2d50aa | ||
|
|
843328f73c | ||
|
|
65d7392b3a | ||
|
|
e7ef249b1d | ||
|
|
669f0a63e8 | ||
|
|
35677db1f1 | ||
|
|
d278f1b259 | ||
|
|
0f0cbf2b2f | ||
|
|
f74a6a39e8 | ||
|
|
cd3b702aa6 | ||
|
|
960ebc67a5 | ||
|
|
dd442f192f | ||
|
|
b549a0de59 | ||
|
|
f9c90dd3f5 | ||
|
|
135d21c9db | ||
|
|
a8b7fb0e8d | ||
|
|
05ed10811f | ||
|
|
4c40fa6664 | ||
|
|
3d45cecf04 | ||
|
|
aad7707268 | ||
|
|
73e6863426 | ||
|
|
54b17f4442 | ||
|
|
7aff3dcb9c | ||
|
|
a9144021d4 | ||
|
|
77e2e50943 | ||
|
|
09a7cf3456 | ||
|
|
8ca5fe6d26 | ||
|
|
73d34bf9c4 | ||
|
|
67406082ed | ||
|
|
d6e44a4c18 | ||
|
|
2197d08e42 | ||
|
|
15c694156a | ||
|
|
59ac312c21 | ||
|
|
8f16dcfdee | ||
|
|
95ed3db43c | ||
|
|
cb8991f3d5 | ||
|
|
3d1d5071ed | ||
|
|
8682af5628 | ||
|
|
1d8910a8cd |
@@ -1,245 +0,0 @@
|
||||
{
|
||||
"projectName": "verdaccio",
|
||||
"projectOwner": "verdaccio",
|
||||
"repoType": "github",
|
||||
"repoHost": "https://github.com",
|
||||
"commitConvention": "none",
|
||||
"files": [
|
||||
"CONTRIBUTORS.md"
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"login": "juanpicado",
|
||||
"name": "Juan Picado",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/558752?v=4",
|
||||
"profile": "https://www.linkedin.com/in/jotadeveloper/",
|
||||
"contributions": [
|
||||
"doc",
|
||||
"code",
|
||||
"infra",
|
||||
"eventOrganizing",
|
||||
"blog",
|
||||
"maintenance"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "sergiohgz",
|
||||
"name": "Sergio Herrera",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/14012309?v=4",
|
||||
"profile": "https://github.com/sergiohgz",
|
||||
"contributions": [
|
||||
"infra",
|
||||
"maintenance"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "DanielRuf",
|
||||
"name": "Daniel Ruf",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/827205?v=4",
|
||||
"profile": "https://daniel-ruf.de/",
|
||||
"contributions": [
|
||||
"security",
|
||||
"infra",
|
||||
"maintenance"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "priscilawebdev",
|
||||
"name": "Priscila Oliveira",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/29228205?v=4",
|
||||
"profile": "https://priscilawebdev.github.io/priscilaoliveira/",
|
||||
"contributions": [
|
||||
"design",
|
||||
"code",
|
||||
"maintenance"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ayusharma",
|
||||
"name": "Ayush Sharma",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/6918450?v=4",
|
||||
"profile": "http://ayusharma.github.io/",
|
||||
"contributions": [
|
||||
"infra",
|
||||
"code",
|
||||
"design"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "trentearl",
|
||||
"name": "Trent Earl",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/802857?v=4",
|
||||
"profile": "https://github.com/trentearl",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jmwilkinson",
|
||||
"name": "jmwilkinson",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/17836030?v=4",
|
||||
"profile": "https://github.com/jmwilkinson",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "bufferoverflow",
|
||||
"name": "Roger Meier",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/378909?v=4",
|
||||
"profile": "https://github.com/bufferoverflow",
|
||||
"contributions": [
|
||||
"plugin"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jamesgeorge007",
|
||||
"name": "James George",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/25279263?v=4",
|
||||
"profile": "https://ghuser.io/jamesgeorge007",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "AvailCat",
|
||||
"name": "AvailCat",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/19658647?v=4",
|
||||
"profile": "https://github.com/AvailCat",
|
||||
"contributions": [
|
||||
"code",
|
||||
"infra",
|
||||
"maintenance"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "lgaitan",
|
||||
"name": "Lucius Gaitán",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/5970350?v=4",
|
||||
"profile": "https://www.luciusgaitan.com/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ramonornela",
|
||||
"name": "Ramon Henrique Ornelas",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/187946?v=4",
|
||||
"profile": "https://github.com/ramonornela",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "UnitedMarsupials-zz",
|
||||
"name": "UnitedMarsupials-zz",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/1486340?v=4",
|
||||
"profile": "https://people.freebsd.org/~mi/resume/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ryan-codingintrigue",
|
||||
"name": "Ryan Graham",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/9048902?v=4",
|
||||
"profile": "http://www.codingintrigue.co.uk/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "coolsp",
|
||||
"name": "coolsp",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/1246647?v=4",
|
||||
"profile": "https://github.com/coolsp",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ashishsurana",
|
||||
"name": "Ashish Surana",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/5610944?v=4",
|
||||
"profile": "http://ashishsurana.in/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "buffaybu",
|
||||
"name": "Wang Yifei",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/2025661?v=4",
|
||||
"profile": "https://github.com/buffaybu",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "lirantal",
|
||||
"name": "Liran Tal",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/316371?v=4",
|
||||
"profile": "https://twitter.com/liran_tal",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "brenordr",
|
||||
"name": "Breno Rodrigues",
|
||||
"avatar_url": "https://avatars2.githubusercontent.com/u/19731692?v=4",
|
||||
"profile": "https://github.com/brenordr",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "jachstet-sea",
|
||||
"name": "jachstet-sea",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/7993508?v=4",
|
||||
"profile": "https://github.com/jachstet-sea",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "Vrtak-CZ",
|
||||
"name": "Patrik Votoček",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/112567?v=4",
|
||||
"profile": "https://patrik.votocek.cz/",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "monkeywithacupcake",
|
||||
"name": "jess",
|
||||
"avatar_url": "https://avatars3.githubusercontent.com/u/7316730?v=4",
|
||||
"profile": "https://github.com/monkeywithacupcake",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "toolsofraj",
|
||||
"name": "toolsofraj",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/2507152?v=4",
|
||||
"profile": "https://github.com/toolsofraj",
|
||||
"contributions": [
|
||||
"code"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "ddhp",
|
||||
"name": "Jian-Chen Chen (jesse)",
|
||||
"avatar_url": "https://avatars1.githubusercontent.com/u/1715380?v=4",
|
||||
"profile": "https://github.com/ddhp",
|
||||
"contributions": [
|
||||
"translation",
|
||||
"code"
|
||||
]
|
||||
}
|
||||
],
|
||||
"skipCi": true,
|
||||
"contributorsPerLine": 7
|
||||
}
|
||||
5
.changeset/few-mangos-grow.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': minor
|
||||
---
|
||||
|
||||
upgrade to react@17 and other dependencies
|
||||
5
.changeset/little-stingrays-rule.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'verdaccio-audit': patch
|
||||
---
|
||||
|
||||
fix: several issues which caused the audit to fail (#2335)
|
||||
@@ -40,13 +40,16 @@
|
||||
"@verdaccio/tarball": "11.0.0-alpha.3",
|
||||
"@verdaccio/url": "11.0.0-alpha.3",
|
||||
"@verdaccio/fastify-migration": "6.0.0-6-next.9",
|
||||
"@verdaccio/eslint-config": "1.0.0"
|
||||
"@verdaccio/eslint-config": "1.0.0",
|
||||
"@verdaccio/benchmark": "1.0.0",
|
||||
"@verdaccio/website": "5.1.3"
|
||||
},
|
||||
"changesets": [
|
||||
"afraid-mice-obey",
|
||||
"big-lobsters-sin",
|
||||
"calm-pants-impress",
|
||||
"few-cooks-destroy",
|
||||
"few-mangos-grow",
|
||||
"fifty-jars-rest",
|
||||
"gentle-parrots-lay",
|
||||
"gentle-trains-switch",
|
||||
@@ -57,6 +60,7 @@
|
||||
"hip-hounds-destroy",
|
||||
"late-adults-love",
|
||||
"late-parents-act",
|
||||
"little-stingrays-rule",
|
||||
"many-vans-care",
|
||||
"modern-spies-tell",
|
||||
"neat-toes-report",
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
**/types/custom.d.ts
|
||||
build/
|
||||
coverage/
|
||||
flow-typed/
|
||||
node_modules/
|
||||
static/
|
||||
website/
|
||||
|
||||
27
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -6,6 +6,25 @@ title: ''
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
<!-- PLEASE READ THIS:
|
||||
- If you are not sure is a bug, OPEN a DISCUSSION, if is a legitimate bug, is easy to create a bug from a discussion.
|
||||
- Empty reports won't be considered and eventually be closed by a bot.
|
||||
- Include debugging notes will help to fix it faster, HOW TO: https://github.com/verdaccio/verdaccio/wiki/Debugging-Verdaccio
|
||||
- If you remove this template, ticket will be closed immediately.
|
||||
- No English perfect is required, use public translators if is need it, we will do our best to help you.
|
||||
- Extra bonus: The most complete this report is delivered, the faster you will get a response.
|
||||
- Extra bonus: include screenshots, logs (remove sensitive data).
|
||||
- If you are willing to fix it, there is a checkbox at the bottom.
|
||||
-->
|
||||
|
||||
**Your Environment**
|
||||
<!-- bug below the version 5.x will be closed, see SECURITY.md for more details -->
|
||||
* **verdaccio version**: 5.x.x
|
||||
* **node version** [12.x.x, 14.x.x]:
|
||||
* **package manager**: [npm@7, pnpm@6, yarn@2]
|
||||
* **os**: [mac, windows@10, linux]
|
||||
* **platform**: [npm, docker, helm, other]
|
||||
|
||||
**Describe the bug**
|
||||
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
@@ -23,7 +42,7 @@ Be aware, the lack of reproducible steps the issue might cause your ticket to be
|
||||
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
**Screenshots**
|
||||
**Screenshots, server logs, package manager log**
|
||||
|
||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||
|
||||
@@ -38,10 +57,14 @@ Be aware, the lack of reproducible steps the issue might cause your ticket to be
|
||||
**Debugging output**
|
||||
|
||||
- `$ NODE_DEBUG=request verdaccio` display request calls (verdaccio <--> uplinks)
|
||||
- `$ DEBUG=express:* verdaccio` enable extreme verdaccio debug mode (verdaccio api)
|
||||
- `$ DEBUG=verdaccio* verdaccio` enable extreme verdaccio debug mode (verdaccio api)
|
||||
- `$ npm -ddd` prints:
|
||||
- `$ npm config get registry` prints:
|
||||
|
||||
**Contribute to Verdaccio**
|
||||
|
||||
- [ ] I'm willing to fix this bug 🥇
|
||||
|
||||
<!--
|
||||
|
||||
IMPORTANT: please do not attach external files, all content should be visible from any device.
|
||||
|
||||
10
.github/ISSUE_TEMPLATE/feature.md
vendored
@@ -7,14 +7,18 @@ assignees: ''
|
||||
---
|
||||
|
||||
<!--
|
||||
IMPORTANT: If you don't have an action plan, please consider create a DISCUSSION (idea) instead for an open a feature request issue.
|
||||
|
||||
https://github.com/verdaccio/verdaccio/discussions/new
|
||||
|
||||
Verdaccio is a project addressed for voluntaries, if you appreciate this project consider to donate.
|
||||
1$/5$ or custom amount single contribution
|
||||
|
||||
or monthly
|
||||
1$/month - minimal contribution
|
||||
5$/month - nice contribution
|
||||
500$ - help to promote this project, marketing, stickers.
|
||||
2000$/year - sponsor status, your company logo will be in our readme, meetups talks and your request will have high priority
|
||||
|
||||
https://opencollective.com/verdaccio
|
||||
https://github.com/sponsors/verdaccio
|
||||
|
||||
As reminder, the Open Source must be sustainable.
|
||||
-->
|
||||
|
||||
6
.github/stale.yml
vendored
@@ -1,7 +1,7 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 15
|
||||
daysUntilStale: 365
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 10
|
||||
daysUntilClose: 500
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- dev: high priority
|
||||
@@ -17,7 +17,7 @@ markComment: >
|
||||
|
||||
This issue has gone quiet 😶.
|
||||
|
||||
We get a lot of issues, so we currently close issues after 25 days of inactivity. It’s been at least 15 days since the last update here.
|
||||
We get a lot of issues, so we currently close issues after 180 days of inactivity. It’s been at least 90c days since the last update here.
|
||||
If we missed this issue or if you want to keep it open, please reply here. You can also add/suggest the label "discuss" to keep this issue open!
|
||||
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out [https://github.com/verdaccio/contributing](https://github.com/verdaccio/contributing) for more information about opening PRs, triaging issues, and contributing!
|
||||
|
||||
|
||||
168
.github/workflows/benckmark.yml
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
---
|
||||
name: ci - benchmark
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# 3 times day
|
||||
# collecting enough data to draw some graphics
|
||||
- cron: '0 1 * * *'
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
jobs:
|
||||
prepare:
|
||||
name: Prepare build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14.x
|
||||
- name: install pnpm
|
||||
run: sudo npm i pnpm@6.6.1 -g
|
||||
- name: set store
|
||||
run: |
|
||||
mkdir ~/.pnpm-store
|
||||
pnpm config set store-dir ~/.pnpm-store
|
||||
- name: setup pnpm config registry
|
||||
run: pnpm config set registry https://registry.verdaccio.org
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: Cache .pnpm-store
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
pnpm-
|
||||
- name: build
|
||||
run: pnpm build
|
||||
- name: tar packages
|
||||
run: |
|
||||
tar -czvf ${{ github.workspace }}/pkg.tar.gz -C ${{ github.workspace }}/packages .
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
path: pkg.tar.gz
|
||||
benchmark-autocannon:
|
||||
needs: prepare
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
benchmark:
|
||||
- info
|
||||
- tarball
|
||||
verdaccioVersion:
|
||||
# - local
|
||||
- 3.13.1
|
||||
- 4.12.2
|
||||
- 5.1.2
|
||||
name: Benchmark autocannon
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14.x
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: install pnpm
|
||||
# require fixed version
|
||||
run: sudo npm i pnpm@6.6.1 -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: start registry
|
||||
run: ./scripts/benchmark-prepare.sh ${{matrix.verdaccioVersion}}
|
||||
- name: benchmark
|
||||
run: pnpm benchmark:api -- -v ${{matrix.verdaccioVersion}} -f ${{matrix.benchmark}}
|
||||
shell: bash
|
||||
env:
|
||||
DEBUG: metrics*
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: verdaccio-metrics-api
|
||||
path: ./api-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
if-no-files-found: error
|
||||
retention-days: 10
|
||||
- name: submit metrics
|
||||
run: pnpm benchmark:submit
|
||||
env:
|
||||
DEBUG: metrics
|
||||
METRICS_SOURCE: autocannon
|
||||
METRICS_URL: ${{ secrets.METRICS_URL }}
|
||||
METRICS_TOKEN: ${{ secrets.METRICS_TOKEN }}
|
||||
METRICS_BENCHMARK: ${{matrix.benchmark}}
|
||||
METRICS_VERSION: ${{matrix.verdaccioVersion}}
|
||||
METRICS_COMMIT_HASH: ${{ github.sha }}
|
||||
METRICS_FILE_NAME: 'api-results'
|
||||
benchmark:
|
||||
needs: prepare
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
benchmark:
|
||||
- info
|
||||
- tarball
|
||||
verdaccioVersion:
|
||||
# future 6.x (wip)
|
||||
# - local (master branch)
|
||||
# old versions to compare same test along previous releases
|
||||
- 3.13.1
|
||||
- 4.12.2
|
||||
- 5.1.2
|
||||
name: Benchmark hyperfine
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14.x
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: install pnpm
|
||||
# require fixed version
|
||||
run: sudo npm i pnpm@6.6.1 -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: install hyperfine
|
||||
run: |
|
||||
wget https://github.com/sharkdp/hyperfine/releases/download/v1.11.0/hyperfine_1.11.0_amd64.deb
|
||||
sudo dpkg -i hyperfine_1.11.0_amd64.deb
|
||||
- name: start registry
|
||||
run: ./scripts/benchmark-prepare.sh ${{matrix.verdaccioVersion}}
|
||||
- name: benchmark
|
||||
run: ./scripts/benchmark-run.sh ${{matrix.benchmark}}
|
||||
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
|
||||
shell: bash
|
||||
- name: rename
|
||||
run: mv ./hyper-results.json ./hyper-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: verdaccio-metrics
|
||||
path: ./hyper-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
if-no-files-found: error
|
||||
retention-days: 10
|
||||
- name: submit metrics
|
||||
run: pnpm benchmark:submit
|
||||
env:
|
||||
DEBUG: metrics
|
||||
METRICS_SOURCE: hyperfine
|
||||
METRICS_URL: ${{ secrets.METRICS_URL }}
|
||||
METRICS_TOKEN: ${{ secrets.METRICS_TOKEN }}
|
||||
METRICS_BENCHMARK: ${{matrix.benchmark}}
|
||||
METRICS_VERSION: ${{matrix.verdaccioVersion}}
|
||||
METRICS_COMMIT_HASH: ${{ github.sha }}
|
||||
2
.github/workflows/changesets.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.VERDACCIO_TOKEN }}
|
||||
|
||||
- name: install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.VERDACCIO_TOKEN }}
|
||||
|
||||
|
||||
18
.github/workflows/ci.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
- name: set store
|
||||
run: |
|
||||
mkdir ~/.pnpm-store
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
@@ -74,7 +74,7 @@ jobs:
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
@@ -94,7 +94,7 @@ jobs:
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node_version: [12, 14]
|
||||
node_version: [14]
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
@@ -131,7 +131,7 @@ jobs:
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
@@ -155,7 +155,7 @@ jobs:
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
@@ -182,7 +182,7 @@ jobs:
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
@@ -203,7 +203,7 @@ jobs:
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
# pnpm cache is not working for windows (we need a solution)
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
|
||||
148
.github/workflows/website.yml
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
name: Verdaccio Website CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
paths:
|
||||
- 'website/**'
|
||||
- 'package.json'
|
||||
- './.github/workflows/website.yml'
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- 'website/**'
|
||||
- 'package.json'
|
||||
- './.github/workflows/website.yml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
|
||||
- name: Use Node 14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Cache pnpm modules
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-pnpm-modules
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
|
||||
|
||||
- uses: pnpm/action-setup@v2.0.1
|
||||
with:
|
||||
version: 6.10.2
|
||||
run_install: |
|
||||
- recursive: true
|
||||
args: [--frozen-lockfile]
|
||||
|
||||
- name: Lint And Pretty
|
||||
run: |
|
||||
pnpm eslint:check --filter ...@verdaccio/website
|
||||
pnpm prettier:check --filter ...@verdaccio/website
|
||||
|
||||
- name: Cache Docusaurus Build
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: website/node_modules/.cache/webpack
|
||||
key: cache/webpack-${{github.ref}}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: cache/webpack-${{github.ref}}
|
||||
|
||||
# Will deploy to production on:
|
||||
# 1st: When a push occurs on master branch
|
||||
# 2nd: When we force the worflow dispatch through the UI
|
||||
- name: Build Production
|
||||
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
||||
env:
|
||||
CROWDIN_VERDACCIO_PROJECT_ID: ${{ secrets.CROWDIN_VERDACCIO_PROJECT_ID }}
|
||||
CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }}
|
||||
CONTEXT: production
|
||||
run: pnpm netlify:build:production --filter ...@verdaccio/website
|
||||
|
||||
- name: 🔥 Deploy Production Netlify
|
||||
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
||||
uses: semoal/action-netlify-deploy@master
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
|
||||
build-dir: './website/build'
|
||||
|
||||
# Will deploy to Preview URL, only when a pull request is open with changes on the website
|
||||
- name: Build Deployment Preview
|
||||
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
|
||||
env:
|
||||
CONTEXT: deploy-preview
|
||||
run: pnpm netlify:build:deployPreview --filter ...@verdaccio/website
|
||||
|
||||
- name: 🤖 Deploy Preview Netlify
|
||||
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
|
||||
uses: semoal/action-netlify-deploy@master
|
||||
id: netlify_preview
|
||||
with:
|
||||
draft: true
|
||||
comment-on-pull-request: true
|
||||
github-deployment-is-production: false
|
||||
github-deployment-is-transient: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
|
||||
build-dir: './website/build'
|
||||
|
||||
- name: Audit preview URL with Lighthouse
|
||||
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
|
||||
id: lighthouse_audit
|
||||
uses: treosh/lighthouse-ci-action@v3
|
||||
with:
|
||||
urls: |
|
||||
${{ steps.netlify_preview.outputs.preview-url }}
|
||||
uploadArtifacts: true
|
||||
temporaryPublicStorage: true
|
||||
|
||||
- name: Format lighthouse score
|
||||
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
|
||||
id: format_lighthouse_score
|
||||
uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
const result = ${{ steps.lighthouse_audit.outputs.manifest }}[0].summary
|
||||
const links = ${{ steps.lighthouse_audit.outputs.links }}
|
||||
const formatResult = (res) => Math.round((res * 100))
|
||||
Object.keys(result).forEach(key => result[key] = formatResult(result[key]))
|
||||
const score = res => res >= 90 ? '🟢' : res >= 50 ? '🟠' : '🔴'
|
||||
const comment = [
|
||||
`⚡️ [Lighthouse report](${Object.values(links)[0]}) for the changes in this PR:`,
|
||||
'| Category | Score |',
|
||||
'| --- | --- |',
|
||||
`| ${score(result.performance)} Performance | ${result.performance} |`,
|
||||
`| ${score(result.accessibility)} Accessibility | ${result.accessibility} |`,
|
||||
`| ${score(result['best-practices'])} Best practices | ${result['best-practices']} |`,
|
||||
`| ${score(result.seo)} SEO | ${result.seo} |`,
|
||||
' ',
|
||||
`*Lighthouse ran on [${Object.keys(links)[0]}](${Object.keys(links)[0]})*`
|
||||
].join('\n')
|
||||
core.setOutput("comment", comment);
|
||||
|
||||
- name: Add comment to PR
|
||||
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
|
||||
id: comment_to_pr
|
||||
uses: marocchino/sticky-pull-request-comment@v1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
number: ${{ github.event.issue.number }}
|
||||
header: lighthouse
|
||||
message: |
|
||||
${{ steps.format_lighthouse_score.outputs.comment }}
|
||||
24
.gitignore
vendored
@@ -2,22 +2,17 @@
|
||||
verdaccio-*.tgz
|
||||
.DS_Store
|
||||
build/
|
||||
dist/
|
||||
.eslintcache
|
||||
./dist
|
||||
|
||||
### Test
|
||||
node_modules
|
||||
|
||||
### database
|
||||
.verdaccio-db.json
|
||||
.sinopia-db.json
|
||||
|
||||
###
|
||||
### test
|
||||
test-storage*
|
||||
.verdaccio_test_env
|
||||
node_modules
|
||||
package-lock.json
|
||||
yarn-error.log
|
||||
yarn.lock
|
||||
|
||||
|
||||
# docker examples
|
||||
docker-examples/v5/reverse_proxy/nginx/relative_path/storage/*
|
||||
@@ -36,12 +31,15 @@ tsconfig.tsbuildinfo
|
||||
|
||||
## bundle files
|
||||
packages/standalone/dist/
|
||||
|
||||
## ui
|
||||
packages/plugins/ui-theme/static
|
||||
|
||||
# website
|
||||
website/public
|
||||
website/.cache
|
||||
|
||||
# CI Pnpm cache
|
||||
.pnpm-store/
|
||||
|
||||
# benchmark
|
||||
api-results.json
|
||||
hyper-results.json
|
||||
hyper-results*.json
|
||||
api-results*.json
|
||||
|
||||
10
.netlify/netlify-plugin-pnpm/index.js
Normal file
@@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
onPreBuild: async ({ utils: { build, run } }) => {
|
||||
try {
|
||||
await run.command("npm install -g pnpm")
|
||||
await run.command("pnpm install --ignore-scripts --frozen-lockfile")
|
||||
} catch (error) {
|
||||
return build.failBuild(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
2
.netlify/netlify-plugin-pnpm/manifest.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
name: netlify-plugin-pnpm
|
||||
inputs: []
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
## npm
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
@@ -23,7 +22,6 @@ docs/
|
||||
wiki/
|
||||
|
||||
## flow
|
||||
flow-typed/
|
||||
types/
|
||||
|
||||
# jest
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
**/pnpm-lock.yaml
|
||||
**/verdaccio-corrupted.db.json
|
||||
**/wrong.package.json
|
||||
/website/.cache/
|
||||
/website/crowdin/
|
||||
/website/public/
|
||||
/website/src/dictionaries/
|
||||
crowdin.yaml
|
||||
/docs/website
|
||||
/website/*
|
||||
/website/translated_docs/
|
||||
CHANGELOG.md
|
||||
CONTRIBUTORS.md
|
||||
node_modules/
|
||||
@@ -22,4 +22,5 @@ docker-examples/v5/reverse_proxy/nginx/relative_path/storage/*
|
||||
docker-examples/
|
||||
build/
|
||||
.vscode/
|
||||
.github/
|
||||
.github/
|
||||
.netlify/
|
||||
|
||||
22
.project
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>verdaccio-dev</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1630305579538</id>
|
||||
<name></name>
|
||||
<type>26</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||
<arguments>1.0-name-matches-true-false-node_modules</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
186
CONTRIBUTING.md
@@ -2,8 +2,8 @@
|
||||
|
||||
> Any change matters, whatever the size, just do it.
|
||||
|
||||
We are happy that you are willing to contribute. For that reason, we
|
||||
have prepared these guidelines for you:
|
||||
We're happy that you're considering contributing! To help, we've prepared these
|
||||
guidelines for you:
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
@@ -32,34 +32,47 @@ have prepared these guidelines for you:
|
||||
|
||||
## How Do I Contribute?
|
||||
|
||||
There are different ways to contribute, each comes with a different levels
|
||||
of tasks, such as:
|
||||
There are many ways to contribute:
|
||||
|
||||
- Report a bug.
|
||||
- Request a feature you think would be great for verdaccio.
|
||||
- Fix bugs.
|
||||
- Test and triage reported bugs by others.
|
||||
- Work on requested/approved features.
|
||||
- Improve the codebase (lint, naming, comments, test descriptions, etc...)
|
||||
- Report a bug
|
||||
- Request a feature you think would be great for Verdaccio
|
||||
- Fix bugs
|
||||
- Test and triage bugs reported by others
|
||||
- Work on requested/approved features
|
||||
- Improve the codebase (linting, naming, comments, test descriptions, etc...)
|
||||
|
||||
Verdaccio has several areas of involvement, which might fit you better, eg:
|
||||
The Verdaccio project is split into several areas:
|
||||
|
||||
- **Core**: The [core](https://github.com/verdaccio/verdaccio) is the main repository, built with **Node.js**.
|
||||
- **Website**: we uses **Gatsby.js** for the **website** and if you are familiar with this technology, you might become the official webmaster.
|
||||
- **Website**: we use [**Docusaurus**](https://docusaurus.io/) for the **website** and if you are familiar with this technology, you might become the official webmaster.
|
||||
- **User Interface**: The [user Interface](https://github.com/verdaccio/ui) is based in **react** and **material-ui** and looking for front-end contributors.
|
||||
- **Kubernetes and Helm**: Ts the official repository for the [**Helm chart**](https://github.com/verdaccio/charts).
|
||||
|
||||
> There are other areas to contribute, like documentation, translation which are not hosted on this repo but check the last section of this notes for further information.
|
||||
> There are other areas to contribute, like documentation, translation which are
|
||||
> not hosted on this repo but check the last section of this notes for further
|
||||
> information.
|
||||
|
||||
## Development Setup
|
||||
|
||||
Verdaccio uses [_pnpm_](https://pnpm.js.org/) as package manager for development in this repository. Please install the latest one:
|
||||
Verdaccio uses [pnpm](https://pnpm.io) as the package manager for development in this repository.
|
||||
|
||||
If you are using pnpm for the first time the [pnpm configuration documentation](https://pnpm.io/configuring) may be useful to avoid any potential problems with the following steps.
|
||||
|
||||
**Note**: pnpm uses npm's configuration formats so check that your global `.npmrc` file does not inadvertently disable package locks. In other words, your `.npmrc` file **should not** contain
|
||||
|
||||
```
|
||||
package-lock=false
|
||||
```
|
||||
|
||||
This setting would cause the `pnpm install` command to install incorrect versions of package dependencies and the subsequent `pnpm build` step would likely fail.
|
||||
|
||||
To begin your development setup, please install the latest version of pnpm globally:
|
||||
|
||||
```
|
||||
npm i -g pnpm
|
||||
```
|
||||
|
||||
First step is installing all dependencies:
|
||||
With pnpm installed, the first step is installing all dependencies:
|
||||
|
||||
```
|
||||
pnpm install
|
||||
@@ -79,62 +92,69 @@ pnpm build
|
||||
pnpm test
|
||||
```
|
||||
|
||||
Verdaccio is a mono repository, for running an specific test or package go the specific package eg:
|
||||
Verdaccio is a mono repository. To run the tests for for a specific package:
|
||||
|
||||
```
|
||||
cd packages/store
|
||||
pnpm test
|
||||
```
|
||||
|
||||
or an specific test in that package
|
||||
or an specific test in that package:
|
||||
|
||||
```
|
||||
pnpm test test/merge.dist.tags.spec.ts
|
||||
```
|
||||
|
||||
or a single test unit
|
||||
or a single test unit:
|
||||
|
||||
```
|
||||
pnpm test test/merge.dist.tags.spec.ts -- -t 'simple'
|
||||
```
|
||||
|
||||
The coverage is enabled by default, to speed up test running
|
||||
Coverage reporting is enabled by default, but you can turn it off to speed up
|
||||
test runs:
|
||||
|
||||
```
|
||||
pnpm test test/merge.dist.tags.spec.ts -- -t 'simple' --coverage=false
|
||||
```
|
||||
|
||||
To increase debug output, we use `debug`, to enable it in your test just add
|
||||
You can enable increased [`debug`](https://www.npmjs.com/package/debug) output:
|
||||
|
||||
```
|
||||
DEBUG=verdaccio* pnpm test
|
||||
DEBUG=verdaccio:* pnpm test
|
||||
```
|
||||
|
||||
More details in the debug section
|
||||
|
||||
### Running and debugging
|
||||
|
||||
We uses [`debug`](https://www.npmjs.com/package/debug) for debug outcome. Each package has it owns namespace.
|
||||
We use [`debug`](https://www.npmjs.com/package/debug) to add helpful debugging
|
||||
output to the code. Each package has it owns namespace.
|
||||
|
||||
### Debugging compiled code
|
||||
#### Debugging compiled code
|
||||
|
||||
Currently you can only run in debug mode pre-compiled packages, to enable debug while running add the `verdaccio` namespace using the `DEBUG` environment variable, like this:
|
||||
Currently you can only run pre-compiled packages in debug mode. To enable debug
|
||||
while running add the `verdaccio` namespace using the `DEBUG` environment
|
||||
variable, like this:
|
||||
|
||||
```
|
||||
DEBUG=verdaccio:* node packages/verdaccio/debug/bootstrap.js
|
||||
```
|
||||
|
||||
On this way can be reviewed every package, but if you need to filter out and display more specific output, increase the name space filter.
|
||||
You can filter this output to just the packages you're interested in using
|
||||
namespaces:
|
||||
|
||||
```
|
||||
DEBUG=verdaccio:plugin:* node packages/verdaccio/debug/bootstrap.js
|
||||
```
|
||||
|
||||
The debug code is intended to analyze what is happening under the hood and none of the output is gathered with the logger module.
|
||||
The debug code is intended to analyze what is happening under the hood and none
|
||||
of the output is sent to the logger module.
|
||||
|
||||
## Reporting Bugs
|
||||
|
||||
**Bugs are considered features that are not working as described in documentation.**
|
||||
**Bugs are considered features that are not working as described in
|
||||
documentation.**
|
||||
|
||||
If you've found a bug in Verdaccio **that isn't a security risk**, please file
|
||||
a report in our [issue tracker](https://github.com/verdaccio/verdaccio/issues).
|
||||
@@ -142,28 +162,31 @@ a report in our [issue tracker](https://github.com/verdaccio/verdaccio/issues).
|
||||
> **NOTE: Verdaccio still does not support all npm commands. Some were not
|
||||
> considered important and others have not been requested yet.**
|
||||
|
||||
### Read the documentation
|
||||
|
||||
Check whether you are using the software in the way is documented [documentation](http://www.verdaccio.org/docs/en/installation.html).
|
||||
|
||||
### What's is not considered a bug?
|
||||
|
||||
- _Third party integrations_: proxies integrations, external plugins.
|
||||
- _Package managers_: If a package manager does not support a specific command or cannot be reproduced with another package manager.
|
||||
- _Features clearly flagged as not supported_.
|
||||
- _Node.js issues installation in any platform_: If you cannot install the global package ( this is considered external issue)
|
||||
- Any ticket which has the flagged as [external issue](https://github.com/verdaccio/verdaccio/labels/external-issue).
|
||||
- _Third party integrations_: proxies integrations, external plugins
|
||||
- _Package managers_: If a package manager does not support a specific command
|
||||
or cannot be reproduced with another package manager
|
||||
- _Features clearly flagged as not supported_
|
||||
- _Node.js issues installation in any platform_: If you cannot install the
|
||||
global package (this is considered external issue)
|
||||
- Any ticket which has beed flagged as an [external issue
|
||||
](https://github.com/verdaccio/verdaccio/labels/external-issue)
|
||||
|
||||
If you intent to report a **security** issue, please follow our [Security policy guidelines](https://github.com/verdaccio/verdaccio/security/policy).
|
||||
If you intend to report a **security** issue, please follow our [Security policy
|
||||
guidelines](https://github.com/verdaccio/verdaccio/security/policy).
|
||||
|
||||
### Issue Search
|
||||
|
||||
Before consider report a bug, please follow this steps before:
|
||||
Before reporting a bug please:
|
||||
|
||||
- Search if has already been reported via the issue search.
|
||||
- Look for the **question** label: we have labelled questions for easy follow-up as [questions](https://github.com/verdaccio/verdaccio/labels/question).
|
||||
- Search for existing issues to see if it has already been reported
|
||||
- Look for the **question** label: we have labelled questions for easy follow-up
|
||||
as [questions](https://github.com/verdaccio/verdaccio/labels/question)
|
||||
|
||||
In case any of those match with your search, up-vote it (using GitHub reactions) or add additional helpful details to the existing issue to show that it's affecting multiple people.
|
||||
In case any of those match with your search, up-vote it (using GitHub reactions)
|
||||
or add additional helpful details to the existing issue to show that it's
|
||||
affecting multiple people.
|
||||
|
||||
### Chat
|
||||
|
||||
@@ -174,20 +197,24 @@ Questions can be asked via [Discord](http://chat.verdaccio.org/)
|
||||
## Request Features
|
||||
|
||||
New feature requests are welcome. Analyse whether the idea fits within scope of
|
||||
the project. Then, detail your request, ensuring context and use case is provided.
|
||||
the project. Adding in context and the use-case will really help!
|
||||
|
||||
**Please provide:**
|
||||
|
||||
- A detailed description the advantages of your request
|
||||
- Whether or not it's compatible with `npm`, `pnpm` and [_yarn classic_](https://github.com/yarnpkg/yarn) or [_yarn berry_](https://github.com/yarnpkg/berry).
|
||||
- Whether or not it's compatible with `npm`, `pnpm` and [_yarn classic_
|
||||
](https://github.com/yarnpkg/yarn) or [_yarn berry_
|
||||
](https://github.com/yarnpkg/berry).
|
||||
- A potential implementation or design
|
||||
- Whatever else you have in your mind 🤓
|
||||
- Whatever else is on your mind! 🤓
|
||||
|
||||
## Contributing Guidelines
|
||||
|
||||
This is the most exciting part, when you became a Verdaccio contributor 🙌🏼, to ensure a fast code review and merge, please follow the next guidelines:
|
||||
It's very exciting to become a Verdaccio contributor 🙌🏼. To ensure a fast code
|
||||
review and merge, please follow the next guidelines:
|
||||
|
||||
> Any contribution gives you the right to be part of this organization as _collaborator_.
|
||||
> Any contribution gives you the right to be part of this organization as
|
||||
> _collaborator_.
|
||||
|
||||
### Submitting a Pull Request
|
||||
|
||||
@@ -213,14 +240,14 @@ information on [rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing)
|
||||
|
||||
#### Caveats
|
||||
|
||||
Feel free to commit as much times you want in your branch, but keep on mind on this repository we `git squash` on merge by default, any other way is forbidden since we intent to have a clean git history.
|
||||
Feel free to commit as much times you want in your branch, but keep on mind on
|
||||
this repository we `git squash` on merge by default, as we like to maintain a
|
||||
clean git history.
|
||||
|
||||
#### Before Commit
|
||||
|
||||
Before committing, **you must ensure there are no linting errors and
|
||||
all tests pass.**
|
||||
|
||||
To do this, run these commands before create the PR:
|
||||
all tests pass.** To do this, run these commands before create the PR:
|
||||
|
||||
```bash
|
||||
pnpm lint
|
||||
@@ -229,9 +256,10 @@ pnpm build
|
||||
pnpm test
|
||||
```
|
||||
|
||||
> note: eslint and formatting are running separately, keep code formatting before push.
|
||||
> note: eslint and formatting are run separately, keep code formatting
|
||||
> before push.
|
||||
|
||||
All good? perfect, then you should create the pull request.
|
||||
All good? Perfect! You should create the pull request.
|
||||
|
||||
#### Commit Guidelines
|
||||
|
||||
@@ -240,8 +268,8 @@ For example:
|
||||
- `feat: A new feature`
|
||||
- `fix: A bug fix`
|
||||
|
||||
A commit of the type feat introduces a new feature to the codebase
|
||||
(this correlates with MINOR in semantic versioning).
|
||||
A commit of the type feat introduces a new feature to the codebase (this
|
||||
correlates with MINOR in semantic versioning).
|
||||
|
||||
e.g.:
|
||||
|
||||
@@ -249,7 +277,8 @@ e.g.:
|
||||
feat: xxxxxxxxxx
|
||||
```
|
||||
|
||||
A commit of the type fix patches a bug in your codebase (this correlates with PATCH in semantic versioning).
|
||||
A commit of the type fix patches a bug in your codebase (this correlates with
|
||||
PATCH in semantic versioning).
|
||||
|
||||
e.g.:
|
||||
|
||||
@@ -257,24 +286,31 @@ e.g.:
|
||||
fix: xxxxxxxxxxx
|
||||
```
|
||||
|
||||
Commits types such as as `docs:`,`style:`,`refactor:`,`perf:`,`test:`
|
||||
and `chore:` are valid but have no effect on versioning. **It would be great if you use them.**
|
||||
Commits types such as as `docs:`,`style:`,`refactor:`,`perf:`,`test:` and
|
||||
`chore:` are valid but have no effect on versioning: **please use them!**
|
||||
|
||||
All commits message are going to be validated when they are created using husky hooks.
|
||||
All commits message are going to be validated when they are created using
|
||||
_husky_ hooks.
|
||||
|
||||
> Please, try to provide one single commit to help a clean and easy merge process.
|
||||
> Please try to provide one single commit to help a clean and easy merge process
|
||||
|
||||
### Adding a changeset
|
||||
|
||||
We use [changesets](https://github.com/atlassian/changesets) in order to generate a detailed Changelog as possible.
|
||||
We use [changesets](https://github.com/atlassian/changesets) in order to
|
||||
generate a detailed Changelog as possible.
|
||||
|
||||
Add a changeset with your Pull Request is essential if you want your contribution get merged (unless is a change that does not affect library functionality, eg: typo, docs, readme, add additional test or linting code). To create a changeset please run:
|
||||
Adding a changeset with your Pull Request is essential if you want your
|
||||
contribution to get merged (unless is a change that does not affect library
|
||||
functionality, eg: typo, docs, readme, add additional test or linting code). To
|
||||
create a changeset please run:
|
||||
|
||||
```
|
||||
pnpm changeset
|
||||
```
|
||||
|
||||
Then select the packages you want to include in your changeset navigating through them and press the spacebar to check it, on finish press enter to move to the next step.
|
||||
Then select the packages you want to include in your changeset navigating
|
||||
through them and press the spacebar to check it, on finish press enter to move
|
||||
to the next step.
|
||||
|
||||
```
|
||||
🦋 Which packages would you like to include? …
|
||||
@@ -287,7 +323,9 @@ Then select the packages you want to include in your changeset navigating throug
|
||||
✔ @verdaccio/commons-api
|
||||
```
|
||||
|
||||
The next question would be if you want a _major bump_, this is not the usual scenario, most likely would be a patch, in that case press enter 2 times (to skip minor)
|
||||
The next question would be if you want a _major bump_. This is not the usual
|
||||
scenario, most likely you want a patch, and in that case press enter 2 times
|
||||
(to skip minor)
|
||||
|
||||
```
|
||||
🦋 Which packages should have a major bump? …
|
||||
@@ -295,7 +333,8 @@ The next question would be if you want a _major bump_, this is not the usual sce
|
||||
✔ @verdaccio/config@5.0.0-alpha.0
|
||||
```
|
||||
|
||||
Once the desired bump you need, the CLI will ask for a summary, here you have fully freedom what to include.
|
||||
Once you have the desired bump you need, the CLI will ask for a summary. Here
|
||||
you have full freedom on what to include:
|
||||
|
||||
```
|
||||
🦋 Which packages would you like to include? · @verdaccio/config
|
||||
@@ -307,7 +346,7 @@ Once the desired bump you need, the CLI will ask for a summary, here you have fu
|
||||
🦋 Summary ›
|
||||
```
|
||||
|
||||
The last step is confirm your changeset or abort the operation.
|
||||
The last step is to confirm your changeset or abort the operation:
|
||||
|
||||
```
|
||||
🦋 Is this your desired changeset? (Y/n) · true
|
||||
@@ -317,9 +356,13 @@ The last step is confirm your changeset or abort the operation.
|
||||
🦋 info /Users/user/verdaccio.clone/.changeset/light-scissors-smell.md
|
||||
```
|
||||
|
||||
Once the changeset is added (all will have an unique name) you can freely edit using markdown, adding additional information, code snippets or what you consider is relevant.
|
||||
Once the changeset is added (all will have an unique name) you can freely edit
|
||||
using markdown, adding additional information, code snippets or whatever else
|
||||
you consider to be relevant.
|
||||
|
||||
All that information will be part of the **changelog**, be concise but informative. It is considered a good option to add your nickname and GitHub link to your profile.
|
||||
All that information will be part of the **changelog**. Be concise but
|
||||
informative! It's recommended to add your nickname and GitHub link to your
|
||||
profile.
|
||||
|
||||
**PRs that do not follow the commit message guidelines will not be merged.**
|
||||
|
||||
@@ -327,7 +370,8 @@ All that information will be part of the **changelog**, be concise but informati
|
||||
|
||||
**Any change in source code must include test updates**.
|
||||
|
||||
If you need help with how testing works, please [refer to the following guide](https://github.com/verdaccio/verdaccio/wiki/Running-and-Debugging-tests).
|
||||
If you need help with how testing works, please [refer to the following guide
|
||||
](https://github.com/verdaccio/verdaccio/wiki/Running-and-Debugging-tests).
|
||||
|
||||
**If you are introducing new features, you MUST include new tests. PRs for
|
||||
features without tests will not be merged.**
|
||||
@@ -340,6 +384,8 @@ If you want to develop your own plugin:
|
||||
|
||||
1. Check whether there is a legacy Sinopia plugin for the feature that you need
|
||||
via [npmjs](https://www.npmjs.com/search?q=sinopia)
|
||||
2. Keep in mind the [life-cycle to load a plugin](https://verdaccio.org/docs/en/dev-plugins)
|
||||
2. Keep in mind the [life-cycle to load a plugin
|
||||
](https://verdaccio.org/docs/en/dev-plugins)
|
||||
3. You are free to host your plugin in your repository
|
||||
4. Provide a detailed description of your plugin to help users understand how to use it.
|
||||
4. Provide a detailed description of your plugin to help users understand how to
|
||||
use it
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:14.16.1-alpine as builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:14.17.6-alpine as builder
|
||||
|
||||
ENV NODE_ENV=development \
|
||||
VERDACCIO_BUILD_REGISTRY=https://registry.verdaccio.org
|
||||
@@ -12,14 +12,14 @@ RUN apk --no-cache add openssl ca-certificates wget && \
|
||||
WORKDIR /opt/verdaccio-build
|
||||
COPY . .
|
||||
|
||||
RUN npm -g i pnpm@latest && \
|
||||
RUN npm -g i pnpm@6.10.3 && \
|
||||
pnpm config set registry $VERDACCIO_BUILD_REGISTRY && \
|
||||
pnpm recursive install --frozen-lockfile --ignore-scripts && \
|
||||
pnpm run build
|
||||
# FIXME: need to remove devDependencies from the build
|
||||
# RUN pnpm install --prod --ignore-scripts
|
||||
|
||||
FROM node:14.16.1-alpine
|
||||
FROM node:14.17.6-alpine
|
||||
LABEL maintainer="https://github.com/verdaccio/verdaccio"
|
||||
|
||||
ENV VERDACCIO_APPDIR=/opt/verdaccio \
|
||||
|
||||
@@ -69,12 +69,14 @@ booted in a couple of seconds, fast enough for any CI. Many open source projects
|
||||
|
||||
## Talks
|
||||
|
||||
### **Node.js Dependency Confusion Attacks**.
|
||||
### **Testing the integrity of your React components by publishing in a private registry - React Finland 2021**.
|
||||
|
||||
[](https://www.youtube.com/watch?v=qTRADSp3Hpo)
|
||||
[](https://react-finland.fi/schedule/#testing-the-integrity-of-your-react-components-by-publishing-in-a-private-registry)
|
||||
|
||||
You might want to check out as well our previous talks:
|
||||
|
||||
- [BeerJS Cba Meetup No. 53 May 2021 - **Juan Picado**](https://www.youtube.com/watch?v=6SyjqBmS49Y&ab_channel=BeerJSCba)
|
||||
- [Node.js Dependency Confusion Attacks - April 2021 - **Juan Picado\***](https://www.youtube.com/watch?v=qTRADSp3Hpo)
|
||||
- [**OpenJS World 2020** about \*Cover your Projects with a Multi purpose Lightweight Node.js Registry - **Juan Picado\***](https://www.youtube.com/watch?v=oVCjDWeehAQ)
|
||||
- [ViennaJS Meetup - Introduction to Verdaccio by **Priscila Olivera** and **Juan Picado**](https://www.youtube.com/watch?v=hDIFKzmoCa)
|
||||
- [Open Source? trivago - Verdaccio (**Ayush** and **Juan Picado**) January 2020](https://www.youtube.com/watch?v=A5CWxJC9xzc)
|
||||
@@ -245,6 +247,8 @@ Thanks to the following companies to help us to achieve our goals providing free
|
||||
[](https://www.jetbrains.com/)
|
||||
[](https://crowdin.com/)
|
||||
[](https://www.browserstack.com/)
|
||||
[](https://www.netlify.com/)
|
||||
[](https://algolia.com/)
|
||||
|
||||
Verdaccio also is part of to the [Docker Open Source Program](https://www.docker.com/blog/expanded-support-for-open-source-software-projects/).
|
||||
|
||||
|
||||
16
SECURITY.md
@@ -4,13 +4,13 @@
|
||||
|
||||
The following table describes the versions of this project that are currently supported with security updates:
|
||||
|
||||
| Version | Supported |
|
||||
| --------- | ---------------------------------------- |
|
||||
| 2.x | :x: |
|
||||
| 3.x | :x: |
|
||||
| 4.x | :white_check_mark: (until 1st July 2021) |
|
||||
| 5.x | :white_check_mark: |
|
||||
| 6.x alpha | :x: |
|
||||
| Version | Supported |
|
||||
| --------- | ------------------ |
|
||||
| 2.x | :x: |
|
||||
| 3.x | :x: |
|
||||
| 4.x | :x: |
|
||||
| 5.x | :white_check_mark: |
|
||||
| 6.x alpha | :x: |
|
||||
|
||||
## Responsible disclosure security policy
|
||||
|
||||
@@ -32,7 +32,7 @@ If you discover a security vulnerability, please use one of the following means
|
||||
|
||||
Note that time-frame and processes are subject to each program’s own policy.
|
||||
|
||||
- Report the security issue to the project maintainers directly at verdaccio@pm.me. If the report contains highly sensitive information, please be advised to encrypt your findings using our [PGP key](https://verdaccio.nyc3.digitaloceanspaces.com/gpg/publickey.verdaccio@pm.me.asc) which is also available in this document.
|
||||
- Report the security issue to the project maintainers directly at verdaccio@pm.me. If the report contains highly sensitive information, please be advised to encrypt your findings using our [PGP key](https://cdn.verdaccio.dev/gpg/publickey.verdaccio@pm.me.asc) which is also available in this document.
|
||||
|
||||
Your efforts to responsibly disclose your findings are sincerely appreciated and will be taken into account to acknowledge your contributions.
|
||||
|
||||
|
||||
16
crowdin.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
project_id_env: CROWDIN_VERDACCIO_PROJECT_ID
|
||||
api_token_env: CROWDIN_VERDACCIO_API_KEY
|
||||
|
||||
preserve_hierarchy: true
|
||||
|
||||
files:
|
||||
[
|
||||
{
|
||||
source: '/website/i18n/en/**/*',
|
||||
translation: '/website/i18n/%locale%/**/%original_file_name%',
|
||||
},
|
||||
{
|
||||
source: '/website/docs/**/*',
|
||||
translation: '/website/i18n/%locale%/docusaurus-plugin-content-docs/current/**/%original_file_name%',
|
||||
}
|
||||
]
|
||||
@@ -2,23 +2,23 @@
|
||||
|
||||
#### Proxies
|
||||
|
||||
- [Docker + Apache + Verdaccio](v4/apache-verdaccio/README.md)
|
||||
- [Docker + Nginx + Verdaccio](v4/reverse_proxy/nginx/README.md)
|
||||
- [Docker + https-portal Example](v4/https-portal-example/README.md)
|
||||
- [Docker + Apache + Verdaccio](apache-verdaccio/README.md)
|
||||
- [Docker + Nginx + Verdaccio](reverse_proxy/nginx/README.md)
|
||||
- [Docker + https-portal Example](https-portal-example/README.md)
|
||||
|
||||
#### Plugins
|
||||
|
||||
- [Docker + Uplinks Multi Registry](v4/multi-registry-uplink/README.md)
|
||||
- [Docker + Local Storage](v4/docker-local-storage-volume/readme.md)
|
||||
- [Docker + External Plugins](v4/docker-plugin-external/README.md)
|
||||
- [Docker + Uplinks Multi Registry](multi-registry-uplink/README.md)
|
||||
- [Docker + Local Storage](docker-local-storage-volume/readme.md)
|
||||
- [Docker + External Plugins](docker-plugin-external/README.md)
|
||||
|
||||
#### Auth
|
||||
|
||||
- [Docker + LDAP (OpenLDAP) Server + Verdaccio 4](v4/ldap-verdaccio/readme.md) by **@kopax**
|
||||
- [Docker + LDAP (OpenLDAP) Server + Verdaccio 4](ldap-verdaccio/readme.md) by **@kopax**
|
||||
- [Docker + Gitlab](gitlab-verdaccio/README.md)
|
||||
- [Docker + Active Directory](https://github.com/Mateus-Oli/verdaccio-ad-docker)
|
||||
|
||||
#### Storage
|
||||
|
||||
- [Docker + AWS S3 Plugin(localstack) + Verdaccio 4](v4/amazon-s3-docker-example/v4/README.md)
|
||||
- [Docker + AWS S3 Plugin(localstack) + Verdaccio 4](amazon-s3-docker-example/README.md)
|
||||
- [Docker + Minio](https://github.com/barolab/verdaccio-minio/tree/master/example)
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
FROM nginx:1.14.2-alpine
|
||||
FROM nginx:1.21-alpine
|
||||
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
2
docker-examples/v5/reverse_proxy/nginx/relative_path/nginx/Dockerfile
Executable file → Normal file
@@ -1,2 +1,2 @@
|
||||
FROM nginx:1.14.2-alpine
|
||||
FROM nginx:1.21-alpine
|
||||
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
2
docker-examples/v5/reverse_proxy/nginx/relative_path/nginx_ssl/Dockerfile
Executable file → Normal file
@@ -1,4 +1,4 @@
|
||||
FROM nginx
|
||||
FROM nginx:1
|
||||
|
||||
COPY cert.crt /etc/nginx/cert.crt
|
||||
COPY cert.key /etc/nginx/cert.key
|
||||
|
||||
2
docker-examples/v5/reverse_proxy/nginx_relative/nginx/Dockerfile
Executable file → Normal file
@@ -1,2 +1,2 @@
|
||||
FROM nginx:1.14.2-alpine
|
||||
FROM nginx:1.21-alpine
|
||||
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
BIN
docs/website/assets/docker_verdaccio.gif
Normal file
|
After Width: | Height: | Size: 244 KiB |
BIN
docs/website/assets/install_verdaccio.gif
Normal file
|
After Width: | Height: | Size: 269 KiB |
BIN
docs/website/assets/logo/banner/png/verdaccio-banner.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
docs/website/assets/logo/banner/png/verdaccio-banner@2x.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
docs/website/assets/logo/banner/png/verdaccio-banner@3x.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
50
docs/website/assets/logo/banner/svg/verdaccio-banner.svg
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="301px" height="100px" viewBox="0 0 301 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>verdaccio-banner</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="verdaccio-banner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="verdaccio-logo-Full">
|
||||
<rect id="BG" fill="#F7F8F6" fill-rule="nonzero" x="0" y="0" width="301" height="100" rx="37"></rect>
|
||||
<g id="Group-2" transform="translate(27.000000, 22.000000)">
|
||||
<g id="Group-2-Copy" transform="translate(81.200000, 0.400000)" fill="#405236" font-family="OpenSansLight-Italic, Open Sans" font-size="42.4" font-style="italic" font-weight="300">
|
||||
<g id="Verdaccio">
|
||||
<text>
|
||||
<tspan x="0" y="45">Verdaccio</tspan>
|
||||
</text>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Group" transform="translate(0.000000, 5.500000)">
|
||||
<g id="Combined-Shape">
|
||||
<g id="path-1-link" fill="#000000" fill-rule="nonzero">
|
||||
<polygon id="path-1" points="48 17.6 32.8 48 24 48 0.4 0.8 15.6 0.8 28.4 26.4 32.8 17.6"></polygon>
|
||||
</g>
|
||||
<g id="path-1-link" fill="#405236">
|
||||
<polygon id="path-1" points="48 17.6 32.8 48 24 48 0.4 0.8 15.6 0.8 28.4 26.4 32.8 17.6"></polygon>
|
||||
</g>
|
||||
<polygon id="Shape" stroke="#405236" stroke-width="2.4" points="46.0583592 18.8 33.5416408 18.8 28.4 29.0832816 14.8583592 2 2.34164079 2 24.7416408 46.8 32.0583592 46.8"></polygon>
|
||||
</g>
|
||||
<g id="Path" transform="translate(35.000000, 0.000000)">
|
||||
<g id="path-3-link" fill="#000000" fill-rule="nonzero">
|
||||
<polygon id="path-3" points="15.8 12 0.6 12 6.2 0.8 21.4 0.8"></polygon>
|
||||
</g>
|
||||
<g id="path-3-link" fill="#CD4000">
|
||||
<polygon id="path-3" points="15.8 12 0.6 12 6.2 0.8 21.4 0.8"></polygon>
|
||||
</g>
|
||||
<polygon id="Shape" stroke="#CD4000" stroke-width="2.4" points="15.0583592 10.8 19.4583592 2 6.9416408 2 2.5416408 10.8"></polygon>
|
||||
</g>
|
||||
<g id="Combined-Shape">
|
||||
<g id="path-5-link" fill="#4A5E3F">
|
||||
<polygon id="path-5" points="32.8 48 24 48 0.4 0.8 15.6 0.8 35.9772662 41.6908081"></polygon>
|
||||
</g>
|
||||
<polygon id="Shape" stroke="#405236" stroke-width="2.4" points="32.0607372 46.8 34.6351125 41.6879866 14.8572527 2 2.34164079 2 24.7416408 46.8"></polygon>
|
||||
</g>
|
||||
<path d="M37.6,2 L52.8210381,2" id="Line-3" stroke="#CD4000" stroke-width="2.4" stroke-linecap="square"></path>
|
||||
<path d="M33.6,6 L48.8210381,6" id="Line-3" stroke="#CD4000" stroke-width="2.4" stroke-linecap="square"></path>
|
||||
<path d="M29.6,10.8 L44.8210381,10.8" id="Line-3" stroke="#CD4000" stroke-width="2.4" stroke-linecap="square"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
BIN
docs/website/assets/logo/symbol/png/logo-small-header-bottom.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 18 KiB |
BIN
docs/website/assets/logo/symbol/png/verdaccio-blackwhite.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
docs/website/assets/logo/symbol/png/verdaccio-blackwhite@2x.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
docs/website/assets/logo/symbol/png/verdaccio-blackwhite@3x.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
docs/website/assets/logo/symbol/png/verdaccio-tiny.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
docs/website/assets/logo/symbol/png/verdaccio-tiny@2x.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
BIN
docs/website/assets/logo/symbol/png/verdaccio-tiny@3x.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="100px" height="100px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>logo-small-header-bottom</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
<polygon id="path-1" points="48 17.6 32.8 48 24 48 0.4 0.8 15.6 0.8 28.4 26.4 32.8 17.6 48 17.6"></polygon>
|
||||
<filter x="-20.0%" y="-11.7%" width="139.9%" height="140.3%" filterUnits="objectBoundingBox" id="filter-2">
|
||||
<feOffset dx="0" dy="4" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
||||
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
<polygon id="path-3" points="50.8 12 35.6 12 41.2 0.8 56.4 0.8 50.8 12"></polygon>
|
||||
<filter x="-45.7%" y="-49.1%" width="191.3%" height="269.6%" filterUnits="objectBoundingBox" id="filter-4">
|
||||
<feOffset dx="0" dy="4" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
||||
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
</defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="logo-small-header-bottom">
|
||||
<g>
|
||||
<path d="M37,0 L63,0 C83.421,0 100,16.579 100,37 L100,63 C100,83.421 83.421,100 63,100 L37,100 C16.579,100 0,83.421 0,63 L0,37 C0,16.579 16.579,0 37,0 Z" id="Shape" fill="#F7F8F6"></path>
|
||||
<g id="Textmarke" transform="translate(28.400000, 77.000000)" fill="#405236" font-family="OpenSansLight-Italic, Open Sans" font-size="10" font-style="italic" font-weight="300">
|
||||
<text id="Verdaccio">
|
||||
<tspan x="0.497" y="11.379">Verdaccio</tspan>
|
||||
</text>
|
||||
</g>
|
||||
<g id="Bildmarke" transform="translate(22.000000, 26.000000)">
|
||||
<g id="Combined-Shape">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
|
||||
<path stroke="#405236" stroke-width="2.4" d="M46.0583592,18.8 L33.5416408,18.8 L28.4,29.0832816 L14.8583592,2 L2.34164079,2 L24.7416408,46.8 L32.0583592,46.8 L46.0583592,18.8 Z" stroke-linejoin="square" fill="#405236" fill-rule="evenodd"></path>
|
||||
</g>
|
||||
<g id="Path">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-4)" xlink:href="#path-3"></use>
|
||||
<path stroke="#CD4000" stroke-width="2.4" d="M50.0583592,10.8 L54.4583592,2 L41.9416408,2 L37.5416408,10.8 L50.0583592,10.8 Z" stroke-linejoin="square" fill="#CD4000" fill-rule="evenodd"></path>
|
||||
</g>
|
||||
<path d="M32.0607372,46.8 L34.6351125,41.6879866 L14.8572527,2 L2.34164079,2 L24.7416408,46.8 L32.0607372,46.8 Z" id="Combined-Shape" stroke="#405236" stroke-width="2.4" fill="#4A5E3F"></path>
|
||||
<path d="M37.6,2 L52.8210381,2" id="Line-3" stroke="#CD4000" stroke-width="2.4" stroke-linecap="square"></path>
|
||||
<path d="M33.6,6 L48.8210381,6" id="Line-3" stroke="#CD4000" stroke-width="2.4" stroke-linecap="square"></path>
|
||||
<path d="M29.6,10.8 L44.8210381,10.8" id="Line-3" stroke="#CD4000" stroke-width="2.4" stroke-linecap="square"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.0 KiB |
37
docs/website/assets/logo/symbol/svg/verdaccio-blackwhite.svg
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="100px" height="100px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>verdaccio-blackwhite</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
<polygon id="path-1" points="48 16.7288136 32.6722689 47 23.7983193 47 0 0 15.3277311 5.66025569e-15 28.2352941 25.4915254 32.6722689 16.7288136 48 16.7288136"></polygon>
|
||||
<filter x="-19.8%" y="-11.7%" width="139.6%" height="140.4%" filterUnits="objectBoundingBox" id="filter-2">
|
||||
<feOffset dx="0" dy="4" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
||||
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
<path d="M35.2,11 L28,11 L28,8.64285714 L36.4,8.64285714 L37.6,6.28571429 L32,6.28571429 L32,3.92857143 L38.8,3.92857143 L39.6,2.35714286 L36,2.35714286 L36,0 L40.8,0 L56,0 L50.4,11 L35.2,11 Z" id="path-3"></path>
|
||||
<filter x="-33.9%" y="-50.0%" width="167.9%" height="272.7%" filterUnits="objectBoundingBox" id="filter-4">
|
||||
<feOffset dx="0" dy="4" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
</defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="verdaccio-blackwhite">
|
||||
<rect id="BG" fill="#000000" x="0" y="0" width="100" height="100" rx="37"></rect>
|
||||
<g id="Group" transform="translate(22.000000, 30.000000)">
|
||||
<g id="Combined-Shape">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
|
||||
<use fill-opacity="0.6" fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
|
||||
</g>
|
||||
<g id="Combined-Shape">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-4)" xlink:href="#path-3"></use>
|
||||
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-3"></use>
|
||||
</g>
|
||||
<polygon id="Combined-Shape" fill="#FFFFFF" points="32.7849811 47 23.8804183 47 0 0 15.3806084 0 36 40.7175419"></polygon>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
41
docs/website/assets/logo/symbol/svg/verdaccio-tiny.svg
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="100px" height="100px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>verdaccio-tiny</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
<polygon id="path-1" points="48 17.6 32.8 48 24 48 0.4 0.8 15.6 0.8 28.4 26.4 32.8 17.6 48 17.6"></polygon>
|
||||
<filter x="-20.0%" y="-11.7%" width="139.9%" height="140.3%" filterUnits="objectBoundingBox" id="filter-2">
|
||||
<feOffset dx="0" dy="4" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
||||
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
<polygon id="path-3" points="50.8 12 35.6 12 41.2 0.8 56.4 0.8 50.8 12"></polygon>
|
||||
<filter x="-45.7%" y="-49.1%" width="191.3%" height="269.6%" filterUnits="objectBoundingBox" id="filter-4">
|
||||
<feOffset dx="0" dy="4" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
||||
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
|
||||
</filter>
|
||||
</defs>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="verdaccio-tiny">
|
||||
<rect id="BG" fill="#F7F8F6" x="0" y="0" width="100" height="100" rx="37"></rect>
|
||||
<g id="Group" transform="translate(22.000000, 29.000000)">
|
||||
<g id="Combined-Shape">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
|
||||
<path stroke="#405236" stroke-width="2.4" d="M46.0583592,18.8 L33.5416408,18.8 L28.4,29.0832816 L14.8583592,2 L2.34164079,2 L24.7416408,46.8 L32.0583592,46.8 L46.0583592,18.8 Z" stroke-linejoin="square" fill="#405236" fill-rule="evenodd"></path>
|
||||
</g>
|
||||
<g id="Path">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-4)" xlink:href="#path-3"></use>
|
||||
<path stroke="#CD4000" stroke-width="2.4" d="M50.0583592,10.8 L54.4583592,2 L41.9416408,2 L37.5416408,10.8 L50.0583592,10.8 Z" stroke-linejoin="square" fill="#CD4000" fill-rule="evenodd"></path>
|
||||
</g>
|
||||
<path d="M32.0607372,46.8 L34.6351125,41.6879866 L14.8572527,2 L2.34164079,2 L24.7416408,46.8 L32.0607372,46.8 Z" id="Combined-Shape" stroke="#405236" stroke-width="2.4" fill="#4A5E3F"></path>
|
||||
<path d="M37.6,2 L52.8210381,2" id="Line-3" stroke="#CD4000" stroke-width="2.4" stroke-linecap="square"></path>
|
||||
<path d="M33.6,6 L48.8210381,6" id="Line-3" stroke="#CD4000" stroke-width="2.4" stroke-linecap="square"></path>
|
||||
<path d="M29.6,10.8 L44.8210381,10.8" id="Line-3" stroke="#CD4000" stroke-width="2.4" stroke-linecap="square"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
BIN
docs/website/assets/npm_install.gif
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
docs/website/assets/uplinks.png
Normal file
|
After Width: | Height: | Size: 81 KiB |
BIN
docs/website/assets/verdaccio_server.gif
Normal file
|
After Width: | Height: | Size: 3.5 MiB |
@@ -1,5 +0,0 @@
|
||||
## Where are the docs now?
|
||||
|
||||
The documentation was relocated to the following website:
|
||||
|
||||
https://github.com/verdaccio/website
|
||||
19
netlify.toml
Normal file
@@ -0,0 +1,19 @@
|
||||
[build]
|
||||
command = "pnpm build"
|
||||
publish = "build/"
|
||||
|
||||
[build.environment]
|
||||
NPM_FLAGS="--prefix=/dev/null"
|
||||
NODE_VERSION = "14"
|
||||
|
||||
[context.production]
|
||||
command = "pnpm netlify:build:production"
|
||||
|
||||
[context.deploy-preview]
|
||||
command = "pnpm netlify:build:deployPreview"
|
||||
|
||||
[context.branch-deploy]
|
||||
command = "pnpm netlify:build:deployPreview"
|
||||
|
||||
[[plugins]]
|
||||
package = "../.netlify/netlify-plugin-pnpm"
|
||||
167
package.json
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "verdaccio-dev",
|
||||
"author": {
|
||||
"name": "Verdaccio Maintainers",
|
||||
"email": "verdaccio.npm@gmail.com"
|
||||
@@ -8,115 +10,117 @@
|
||||
"url": "https://github.com/verdaccio/verdaccio"
|
||||
},
|
||||
"homepage": "https://verdaccio.org",
|
||||
"private": true,
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/verdaccio"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.13.14",
|
||||
"@babel/core": "7.13.15",
|
||||
"@babel/node": "7.13.13",
|
||||
"@babel/plugin-proposal-class-properties": "7.13.0",
|
||||
"@babel/plugin-proposal-decorators": "7.13.15",
|
||||
"@babel/plugin-proposal-export-namespace-from": "7.12.13",
|
||||
"@babel/plugin-proposal-function-sent": "7.12.13",
|
||||
"@babel/plugin-proposal-json-strings": "7.13.8",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.13.8",
|
||||
"@babel/plugin-proposal-numeric-separator": "7.12.13",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.13.8",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.13.12",
|
||||
"@babel/plugin-proposal-throw-expressions": "7.12.13",
|
||||
"@babel/cli": "7.14.8",
|
||||
"@babel/core": "7.15.0",
|
||||
"@babel/node": "7.14.9",
|
||||
"@babel/plugin-proposal-class-properties": "7.14.5",
|
||||
"@babel/plugin-proposal-decorators": "7.14.5",
|
||||
"@babel/plugin-proposal-export-namespace-from": "7.14.5",
|
||||
"@babel/plugin-proposal-function-sent": "7.14.5",
|
||||
"@babel/plugin-proposal-json-strings": "7.14.5",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.14.5",
|
||||
"@babel/plugin-proposal-numeric-separator": "7.14.5",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.14.7",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.14.5",
|
||||
"@babel/plugin-proposal-throw-expressions": "7.14.5",
|
||||
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
||||
"@babel/plugin-syntax-import-meta": "7.10.4",
|
||||
"@babel/plugin-transform-async-to-generator": "7.13.0",
|
||||
"@babel/plugin-transform-classes": "7.13.0",
|
||||
"@babel/plugin-transform-runtime": "7.13.15",
|
||||
"@babel/plugin-transform-async-to-generator": "7.14.5",
|
||||
"@babel/plugin-transform-classes": "7.14.9",
|
||||
"@babel/plugin-transform-runtime": "7.15.0",
|
||||
"@babel/polyfill": "7.12.1",
|
||||
"@babel/preset-env": "7.13.15",
|
||||
"@babel/preset-react": "7.13.13",
|
||||
"@babel/preset-typescript": "7.13.0",
|
||||
"@babel/register": "7.13.14",
|
||||
"@babel/runtime": "7.13.10",
|
||||
"@babel/preset-env": "7.15.0",
|
||||
"@babel/preset-react": "7.14.5",
|
||||
"@babel/preset-typescript": "7.15.0",
|
||||
"@babel/register": "7.15.3",
|
||||
"@babel/runtime": "7.15.3",
|
||||
"@changesets/changelog-github": "^0.2.8",
|
||||
"@changesets/cli": "2.15.0",
|
||||
"@changesets/get-dependents-graph": "^1.2.0",
|
||||
"@commitlint/cli": "8.3.5",
|
||||
"@commitlint/config-conventional": "8.2.0",
|
||||
"@octokit/rest": "17.0.0",
|
||||
"@types/async": "3.2.5",
|
||||
"@crowdin/cli": "3.6.5",
|
||||
"@types/async": "3.2.7",
|
||||
"@types/autocannon": "4.1.1",
|
||||
"@types/autosuggest-highlight": "3.1.1",
|
||||
"@types/express": "4.17.6",
|
||||
"@types/http-errors": "1.8.0",
|
||||
"@types/jest": "^26.0.20",
|
||||
"@types/js-base64": "3.0.0",
|
||||
"@types/lodash": "4.14.167",
|
||||
"@types/lowdb": "^1.0.9",
|
||||
"@types/mime": "2.0.2",
|
||||
"@types/minimatch": "3.0.3",
|
||||
"@types/node": "^14.14.7",
|
||||
"@types/react": "16.14.2",
|
||||
"@types/react-autosuggest": "10.0.1",
|
||||
"@types/react-dom": "^16.9.10",
|
||||
"@types/react-router-dom": "5.1.6",
|
||||
"@types/react-virtualized": "9.21.10",
|
||||
"@types/request": "2.48.5",
|
||||
"@types/semver": "7.3.4",
|
||||
"@types/supertest": "2.0.10",
|
||||
"@types/testing-library__jest-dom": "^5.9.5",
|
||||
"@types/validator": "^13.1.3",
|
||||
"@types/webpack": "^4.41.26",
|
||||
"@types/webpack-env": "1.16.0",
|
||||
"@typescript-eslint/eslint-plugin": "4.13.0",
|
||||
"@typescript-eslint/parser": "4.13.0",
|
||||
"@types/express": "4.17.8",
|
||||
"@types/http-errors": "1.8.1",
|
||||
"@types/jest": "27.0.1",
|
||||
"@types/lodash": "4.14.172",
|
||||
"@types/lowdb": "1.0.11",
|
||||
"@types/mime": "2.0.3",
|
||||
"@types/minimatch": "3.0.5",
|
||||
"@types/node": "14.6.0",
|
||||
"@types/react": "17.0.19",
|
||||
"@types/react-autosuggest": "10.1.5",
|
||||
"@types/react-dom": "17.0.9",
|
||||
"@types/react-helmet": "6.1.2",
|
||||
"@types/react-router-dom": "5.1.8",
|
||||
"@types/react-virtualized": "9.21.13",
|
||||
"@types/request": "2.48.7",
|
||||
"@types/semver": "7.3.8",
|
||||
"@types/supertest": "2.0.11",
|
||||
"@types/testing-library__jest-dom": "5.14.1",
|
||||
"@types/validator": "13.6.3",
|
||||
"@types/webpack": "4.41.26",
|
||||
"@types/webpack-env": "1.16.2",
|
||||
"@typescript-eslint/eslint-plugin": "4.30.0",
|
||||
"@typescript-eslint/parser": "4.30.0",
|
||||
"@verdaccio/benchmark": "workspace:*",
|
||||
"@verdaccio/eslint-config": "workspace:*",
|
||||
"@verdaccio/types": "workspace:*",
|
||||
"@verdaccio/ui-theme": "workspace:*",
|
||||
"@verdaccio/eslint-config": "workspace:*",
|
||||
"autocannon": "7.4.0",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"babel-eslint": "10.1.0",
|
||||
"babel-jest": "26.6.3",
|
||||
"babel-jest": "27.1.0",
|
||||
"babel-plugin-dynamic-import-node": "2.3.3",
|
||||
"babel-plugin-emotion": "11.0.0",
|
||||
"codecov": "3.8.1",
|
||||
"concurrently": "^5.3.0",
|
||||
"core-js": "^3.12.1",
|
||||
"babel-plugin-emotion": "10.0.33",
|
||||
"codecov": "3.8.3",
|
||||
"concurrently": "6.2.1",
|
||||
"cross-env": "7.0.3",
|
||||
"debug": "4.3.2",
|
||||
"detect-secrets": "1.0.6",
|
||||
"eslint": "7.26.0",
|
||||
"eslint": "7.32.0",
|
||||
"eslint-config-google": "0.14.0",
|
||||
"eslint-config-prettier": "8.3.0",
|
||||
"eslint-plugin-babel": "5.3.1",
|
||||
"eslint-plugin-import": "2.23.2",
|
||||
"eslint-plugin-jest": "24.3.6",
|
||||
"eslint-plugin-import": "2.24.2",
|
||||
"eslint-plugin-jest": "24.4.0",
|
||||
"eslint-plugin-jsx-a11y": "6.4.1",
|
||||
"eslint-plugin-react": "7.23.2",
|
||||
"eslint-plugin-prettier": "4.0.0",
|
||||
"eslint-plugin-react": "7.25.1",
|
||||
"eslint-plugin-react-hooks": "4.2.0",
|
||||
"eslint-plugin-simple-import-sort": "7.0.0",
|
||||
"eslint-plugin-verdaccio": "10.0.0",
|
||||
"eslint-plugin-prettier": "3.4.0",
|
||||
"fs-extra": "9.1.0",
|
||||
"get-stdin": "7.0.0",
|
||||
"fs-extra": "10.0.0",
|
||||
"husky": "2.7.0",
|
||||
"in-publish": "2.0.1",
|
||||
"jest": "26.6.3",
|
||||
"jest-environment-jsdom": "26.6.2",
|
||||
"jest-environment-jsdom-global": "^2.0.4",
|
||||
"jest-environment-node": "26.6.2",
|
||||
"jest": "27.1.0",
|
||||
"jest-environment-jsdom": "27.1.0",
|
||||
"jest-environment-jsdom-global": "3.0.0",
|
||||
"jest-environment-node": "27.1.0",
|
||||
"jest-fetch-mock": "3.0.3",
|
||||
"jest-junit": "11.0.1",
|
||||
"kleur": "4.1.4",
|
||||
"lint-staged": "8.2.1",
|
||||
"jest-junit": "12.2.0",
|
||||
"kleur": "3.0.3",
|
||||
"lint-staged": "9.5.0",
|
||||
"nock": "12.0.3",
|
||||
"nodemon": "^2.0.7",
|
||||
"node-fetch": "3.0.0-beta.6-exportfix",
|
||||
"nodemon": "2.0.12",
|
||||
"npm-run-all": "4.1.5",
|
||||
"prettier": "2.3.0",
|
||||
"prettier": "2.3.2",
|
||||
"rimraf": "3.0.2",
|
||||
"selfsigned": "1.10.8",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.2.4",
|
||||
"update-ts-references": "2.3.0",
|
||||
"verdaccio": "^5.0.4",
|
||||
"selfsigned": "1.10.11",
|
||||
"supertest": "6.1.6",
|
||||
"ts-node": "10.2.1",
|
||||
"typescript": "4.4.2",
|
||||
"update-ts-references": "2.4.0",
|
||||
"verdaccio": "5.1.3",
|
||||
"verdaccio-audit": "workspace:*",
|
||||
"verdaccio-auth-memory": "workspace:*",
|
||||
"verdaccio-htpasswd": "workspace:*",
|
||||
@@ -124,15 +128,18 @@
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "pnpm recursive run clean",
|
||||
"build": "pnpm recursive run build",
|
||||
"build": "pnpm recursive run build --filter=!@verdaccio/website",
|
||||
"docker": "docker build -t verdaccio/verdaccio:local . --no-cache",
|
||||
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md}\"",
|
||||
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md}\"",
|
||||
"lint": "eslint --max-warnings 165 \"**/*.{js,jsx,ts,tsx}\"",
|
||||
"lint": "eslint --max-warnings 49 \"**/*.{js,jsx,ts,tsx}\"",
|
||||
"test": "pnpm recursive test --filter ./packages",
|
||||
"test:e2e:cli": "pnpm test --filter ...@verdaccio/e2e-cli",
|
||||
"test:e2e:ui": "pnpm test --filter ...@verdaccio/e2e-ui",
|
||||
"start": "concurrently --kill-others \"pnpm _start:server\" \"pnpm _start:web\"",
|
||||
"benchmark:hyper": "verdaccio-benchmark hyper -r ./hyper-results.json",
|
||||
"benchmark:api": "verdaccio-benchmark api",
|
||||
"benchmark:submit": "pnpm ts-node ./scripts/submit-metrics.ts",
|
||||
"start:watch": "concurrently --kill-others \"pnpm _build:watch\" \"pnpm _start:server\" \"pnpm _debug:reload\"",
|
||||
"_build:watch": "pnpm run --parallel watch --filter ./packages",
|
||||
"_start:server": "node packages/verdaccio/debug/bootstrap.js --listen 8000",
|
||||
@@ -147,7 +154,11 @@
|
||||
"ci:version:install": "pnpm install --frozen-lockfile=false",
|
||||
"ci:version:changeset": "changeset version",
|
||||
"ci:publish": "changeset publish",
|
||||
"ts:ref": "update-ts-references --discardComments"
|
||||
"ts:ref": "update-ts-references --discardComments",
|
||||
"website": "pnpm build --filter ...@verdaccio/website",
|
||||
"crowdin:upload": "crowdin upload sources --auto-update --config ./crowdin.yaml",
|
||||
"crowdin:download": "crowdin download --config ./crowdin.yaml",
|
||||
"crowdin:sync": "pnpm crowdin:upload && pnpm crowdin:download --verbose"
|
||||
},
|
||||
"license": "MIT",
|
||||
"commitlint": {
|
||||
|
||||
@@ -49,18 +49,18 @@
|
||||
"@verdaccio/tarball": "workspace:11.0.0-6-next.6",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.5",
|
||||
"cookies": "0.8.0",
|
||||
"debug": "^4.1.1",
|
||||
"debug": "4.3.2",
|
||||
"express": "4.17.1",
|
||||
"lodash": "^4.17.20",
|
||||
"mime": "2.4.4",
|
||||
"semver": "7.3.2"
|
||||
"lodash": "4.17.21",
|
||||
"mime": "2.5.2",
|
||||
"semver": "7.3.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.16",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.17",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.7",
|
||||
"body-parser": "1.19.0",
|
||||
"lodash": "^4.17.20",
|
||||
"supertest": "next"
|
||||
"lodash": "4.17.21",
|
||||
"supertest": "6.1.6"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import _ from 'lodash';
|
||||
import express, { Express } from 'express';
|
||||
|
||||
import express, { Router } from 'express';
|
||||
import {
|
||||
match,
|
||||
validateName,
|
||||
@@ -25,11 +23,7 @@ import profile from './v1/profile';
|
||||
import token from './v1/token';
|
||||
import v1Search from './v1/search';
|
||||
|
||||
export default function (
|
||||
config: Config,
|
||||
auth: IAuth,
|
||||
storage: IStorageHandler
|
||||
): Express.Application {
|
||||
export default function (config: Config, auth: IAuth, storage: IStorageHandler): Router {
|
||||
/* eslint new-cap:off */
|
||||
const app = express.Router();
|
||||
/* eslint new-cap:off */
|
||||
|
||||
@@ -269,7 +269,7 @@ export function publishPackage(storage: IStorageHandler, config: Config, auth: I
|
||||
req.remote_user,
|
||||
`${metadataCopy.name}@${versionToPublish}`
|
||||
);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
debug(
|
||||
'error on notify add a new tag %o',
|
||||
`${metadataCopy.name}@${versionToPublish}`
|
||||
@@ -319,7 +319,7 @@ export function publishPackage(storage: IStorageHandler, config: Config, auth: I
|
||||
afterChange(error, API_MESSAGE.PKG_CREATED, metadata);
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
debug('error on publish, bad package format %o', packageName);
|
||||
logger.error({ packageName }, 'error on publish, bad package data for @{packageName}');
|
||||
return next(ErrorCode.getBadData(API_ERROR.BAD_PACKAGE_DATA));
|
||||
|
||||
@@ -46,7 +46,7 @@ export default function (
|
||||
next: '', // TODO: pagination?
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error({ error: error.msg }, 'token list has failed: @{error}');
|
||||
return next(ErrorCode.getCode(HTTP_STATUS.INTERNAL_ERROR, error.message));
|
||||
}
|
||||
@@ -116,7 +116,7 @@ export default function (
|
||||
created: saveToken.created,
|
||||
})
|
||||
);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error({ error: error.msg }, 'token creation has failed: @{error}');
|
||||
return next(ErrorCode.getCode(HTTP_STATUS.INTERNAL_ERROR, error.message));
|
||||
}
|
||||
@@ -138,7 +138,7 @@ export default function (
|
||||
await storage.deleteToken(name, tokenKey);
|
||||
logger.info({ tokenKey, name }, 'token id @{tokenKey} was revoked for user @{name}');
|
||||
return next({});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error({ error: error.msg }, 'token creation has failed: @{error}');
|
||||
return next(ErrorCode.getCode(HTTP_STATUS.INTERNAL_ERROR, error.message));
|
||||
}
|
||||
|
||||
@@ -34,30 +34,34 @@ describe('package', () => {
|
||||
app = await initializeServer('package.yaml');
|
||||
});
|
||||
|
||||
test('should return a package', async (done) => {
|
||||
test('should return a package', async () => {
|
||||
await publishVersion(app, 'package.yaml', 'foo', '1.0.0');
|
||||
return supertest(app)
|
||||
.get('/foo')
|
||||
.set('Accept', HEADERS.JSON)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.OK)
|
||||
.then((response) => {
|
||||
expect(response.body.name).toEqual('foo');
|
||||
done();
|
||||
});
|
||||
return new Promise((resolve) => {
|
||||
supertest(app)
|
||||
.get('/foo')
|
||||
.set('Accept', HEADERS.JSON)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.OK)
|
||||
.then((response) => {
|
||||
expect(response.body.name).toEqual('foo');
|
||||
resolve(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('should return a package by version', async (done) => {
|
||||
test('should return a package by version', async () => {
|
||||
await publishVersion(app, 'package.yaml', 'foo2', '1.0.0');
|
||||
return supertest(app)
|
||||
.get('/foo2/1.0.0')
|
||||
.set('Accept', HEADERS.JSON)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.OK)
|
||||
.then((response) => {
|
||||
expect(response.body.name).toEqual('foo2');
|
||||
done();
|
||||
});
|
||||
return new Promise((resolve) => {
|
||||
supertest(app)
|
||||
.get('/foo2/1.0.0')
|
||||
.set('Accept', HEADERS.JSON)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.OK)
|
||||
.then((response) => {
|
||||
expect(response.body.name).toEqual('foo2');
|
||||
resolve(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// TODO: investigate the 404
|
||||
|
||||
@@ -18,8 +18,6 @@ const mockApiJWTmiddleware = jest.fn(
|
||||
}
|
||||
);
|
||||
|
||||
jest.setTimeout(50000000);
|
||||
|
||||
jest.mock('@verdaccio/auth', () => ({
|
||||
Auth: class {
|
||||
apiJWTmiddleware() {
|
||||
@@ -86,98 +84,108 @@ describe('publish', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('should fail on publish a bad versions package', async (done) => {
|
||||
test('should fail on publish a bad versions package', async () => {
|
||||
const app = await initializeServer('publish.yaml');
|
||||
return supertest(app)
|
||||
.put(`/${encodeURIComponent(pkgName)}`)
|
||||
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
|
||||
.send(
|
||||
JSON.stringify(
|
||||
Object.assign({}, pkgMetadata, {
|
||||
versions: '',
|
||||
})
|
||||
return new Promise((resolve) => {
|
||||
supertest(app)
|
||||
.put(`/${encodeURIComponent(pkgName)}`)
|
||||
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
|
||||
.send(
|
||||
JSON.stringify(
|
||||
Object.assign({}, pkgMetadata, {
|
||||
versions: '',
|
||||
})
|
||||
)
|
||||
)
|
||||
)
|
||||
.set('accept', HEADERS.GZIP)
|
||||
.expect(HTTP_STATUS.BAD_REQUEST)
|
||||
.then((response) => {
|
||||
console.log('response.body', response.body);
|
||||
expect(response.body.error).toEqual(API_ERROR.UNSUPORTED_REGISTRY_CALL);
|
||||
done();
|
||||
});
|
||||
.set('accept', HEADERS.GZIP)
|
||||
.expect(HTTP_STATUS.BAD_REQUEST)
|
||||
.then((response) => {
|
||||
console.log('response.body', response.body);
|
||||
expect(response.body.error).toEqual(API_ERROR.UNSUPORTED_REGISTRY_CALL);
|
||||
resolve(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('publish a package', () => {
|
||||
test('should publish a package', async (done) => {
|
||||
test('should publish a package', async () => {
|
||||
const app = await initializeServer('publish.yaml');
|
||||
return publishVersion(app, 'publish.yaml', 'foo', '1.0.0')
|
||||
.expect(HTTP_STATUS.CREATED)
|
||||
.then((response) => {
|
||||
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
|
||||
done();
|
||||
});
|
||||
return new Promise((resolve) => {
|
||||
publishVersion(app, 'publish.yaml', 'foo', '1.0.0')
|
||||
.expect(HTTP_STATUS.CREATED)
|
||||
.then((response) => {
|
||||
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
|
||||
resolve(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('should publish a new package', async (done) => {
|
||||
test('should publish a new package', async () => {
|
||||
const pkgName = 'test';
|
||||
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
|
||||
const app = await initializeServer('publish.yaml');
|
||||
return supertest(app)
|
||||
.put(`/${encodeURIComponent(pkgName)}`)
|
||||
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
|
||||
.send(
|
||||
JSON.stringify(
|
||||
Object.assign({}, pkgMetadata, {
|
||||
_attachments: null,
|
||||
})
|
||||
return new Promise((resolve) => {
|
||||
supertest(app)
|
||||
.put(`/${encodeURIComponent(pkgName)}`)
|
||||
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
|
||||
.send(
|
||||
JSON.stringify(
|
||||
Object.assign({}, pkgMetadata, {
|
||||
_attachments: null,
|
||||
})
|
||||
)
|
||||
)
|
||||
)
|
||||
.set('accept', HEADERS.GZIP)
|
||||
.expect(HTTP_STATUS.CREATED)
|
||||
.then((response) => {
|
||||
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
|
||||
done();
|
||||
});
|
||||
.set('accept', HEADERS.GZIP)
|
||||
.expect(HTTP_STATUS.CREATED)
|
||||
.then((response) => {
|
||||
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
|
||||
resolve(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('should publish a new package with no readme', async (done) => {
|
||||
test('should publish a new package with no readme', async () => {
|
||||
const pkgName = 'test';
|
||||
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
|
||||
const app = await initializeServer('publish.yaml');
|
||||
return supertest(app)
|
||||
.put(`/${encodeURIComponent(pkgName)}`)
|
||||
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
|
||||
.send(
|
||||
JSON.stringify(
|
||||
Object.assign({}, pkgMetadata, {
|
||||
versions: {
|
||||
['1.0.0']: {
|
||||
readme: null,
|
||||
return new Promise((resolve) => {
|
||||
supertest(app)
|
||||
.put(`/${encodeURIComponent(pkgName)}`)
|
||||
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
|
||||
.send(
|
||||
JSON.stringify(
|
||||
Object.assign({}, pkgMetadata, {
|
||||
versions: {
|
||||
['1.0.0']: {
|
||||
readme: null,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
)
|
||||
)
|
||||
)
|
||||
.set('accept', HEADERS.GZIP)
|
||||
.expect(HTTP_STATUS.CREATED)
|
||||
.then((response) => {
|
||||
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
|
||||
done();
|
||||
});
|
||||
.set('accept', HEADERS.GZIP)
|
||||
.expect(HTTP_STATUS.CREATED)
|
||||
.then((response) => {
|
||||
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
|
||||
resolve(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('should fails on publish a duplicated package', async (done) => {
|
||||
test('should fails on publish a duplicated package', async () => {
|
||||
const app = await initializeServer('publish.yaml');
|
||||
await publishVersion(app, 'publish.yaml', 'foo', '1.0.0');
|
||||
return publishVersion(app, 'publish.yaml', 'foo', '1.0.0')
|
||||
.expect(HTTP_STATUS.CONFLICT)
|
||||
.then((response) => {
|
||||
console.log('response.body', response.body);
|
||||
expect(response.body.error).toEqual(API_ERROR.PACKAGE_EXIST);
|
||||
done();
|
||||
});
|
||||
return new Promise((resolve) => {
|
||||
publishVersion(app, 'publish.yaml', 'foo', '1.0.0')
|
||||
.expect(HTTP_STATUS.CONFLICT)
|
||||
.then((response) => {
|
||||
console.log('response.body', response.body);
|
||||
expect(response.body.error).toEqual(API_ERROR.PACKAGE_EXIST);
|
||||
resolve(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('unpublish a package', () => {
|
||||
|
||||
@@ -52,7 +52,7 @@ jest.mock('@verdaccio/auth', () => ({
|
||||
describe('user', () => {
|
||||
const credentials = { name: 'test', password: 'test' };
|
||||
|
||||
test('should test add a new user', async (done) => {
|
||||
test('should test add a new user', async () => {
|
||||
mockApiJWTmiddleware.mockImplementationOnce(
|
||||
() =>
|
||||
(req: $RequestExtend, res: $ResponseExtend, _next): void => {
|
||||
@@ -64,28 +64,31 @@ describe('user', () => {
|
||||
mockAddUser.mockImplementationOnce(() => (_name, _password, callback): void => {
|
||||
return callback(null, true);
|
||||
});
|
||||
supertest(await initializeServer('user.yaml'))
|
||||
.put(`/-/user/org.couchdb.user:newUser`)
|
||||
.send({
|
||||
name: 'newUser',
|
||||
password: 'newUser',
|
||||
})
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.CREATED)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
expect(res.body.ok).toBeDefined();
|
||||
expect(res.body.token).toBeDefined();
|
||||
const token = res.body.token;
|
||||
expect(typeof token).toBe('string');
|
||||
expect(res.body.ok).toMatch(`user 'newUser' created`);
|
||||
done();
|
||||
});
|
||||
const app = await initializeServer('user.yaml');
|
||||
return new Promise((resolve, reject) => {
|
||||
supertest(app)
|
||||
.put(`/-/user/org.couchdb.user:newUser`)
|
||||
.send({
|
||||
name: 'newUser',
|
||||
password: 'newUser',
|
||||
})
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.CREATED)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
expect(res.body.ok).toBeDefined();
|
||||
expect(res.body.token).toBeDefined();
|
||||
const token = res.body.token;
|
||||
expect(typeof token).toBe('string');
|
||||
expect(res.body.ok).toMatch(`user 'newUser' created`);
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('should test fails on add a existing user with login', async (done) => {
|
||||
test('should test fails on add a existing user with login', async () => {
|
||||
mockApiJWTmiddleware.mockImplementationOnce(
|
||||
() =>
|
||||
(req: $RequestExtend, res: $ResponseExtend, _next): void => {
|
||||
@@ -93,39 +96,45 @@ describe('user', () => {
|
||||
_next();
|
||||
}
|
||||
);
|
||||
supertest(await initializeServer('user.yaml'))
|
||||
.put('/-/user/org.couchdb.user:jotaNew')
|
||||
.send(credentials)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.CONFLICT)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
expect(res.body.error).toBeDefined();
|
||||
expect(res.body.error).toMatch(API_ERROR.USERNAME_ALREADY_REGISTERED);
|
||||
done();
|
||||
});
|
||||
const app = await initializeServer('user.yaml');
|
||||
return new Promise((resolve, reject) => {
|
||||
supertest(app)
|
||||
.put('/-/user/org.couchdb.user:jotaNew')
|
||||
.send(credentials)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.CONFLICT)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
expect(res.body.error).toBeDefined();
|
||||
expect(res.body.error).toMatch(API_ERROR.USERNAME_ALREADY_REGISTERED);
|
||||
resolve(res.body);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('should log in as existing user', async (done) => {
|
||||
supertest(await initializeServer('user.yaml'))
|
||||
.put(`/-/user/org.couchdb.user:${credentials.name}`)
|
||||
.send(credentials)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.CREATED)
|
||||
.end((err, res) => {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
test('should log in as existing user', async () => {
|
||||
const app = await initializeServer('user.yaml');
|
||||
return new Promise((resolve, reject) => {
|
||||
supertest(app)
|
||||
.put(`/-/user/org.couchdb.user:${credentials.name}`)
|
||||
.send(credentials)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.CREATED)
|
||||
.end((err, res) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
expect(res.body).toBeTruthy();
|
||||
expect(res.body.ok).toMatch(`you are authenticated as \'${credentials.name}\'`);
|
||||
done();
|
||||
});
|
||||
expect(res.body).toBeTruthy();
|
||||
expect(res.body.ok).toMatch(`you are authenticated as \'${credentials.name}\'`);
|
||||
resolve(res);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('should test fails add a new user with missing name', async (done) => {
|
||||
test('should test fails add a new user with missing name', async () => {
|
||||
mockApiJWTmiddleware.mockImplementationOnce(
|
||||
() =>
|
||||
(req: $RequestExtend, res: $ResponseExtend, _next): void => {
|
||||
@@ -139,23 +148,26 @@ describe('user', () => {
|
||||
const credentialsShort = _.cloneDeep(credentials);
|
||||
delete credentialsShort.name;
|
||||
|
||||
supertest(await initializeServer('user.yaml'))
|
||||
.put(`/-/user/org.couchdb.user:${credentials.name}`)
|
||||
.send(credentialsShort)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.BAD_REQUEST)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
const app = await initializeServer('user.yaml');
|
||||
return new Promise((resolve, reject) => {
|
||||
supertest(app)
|
||||
.put(`/-/user/org.couchdb.user:${credentials.name}`)
|
||||
.send(credentialsShort)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.BAD_REQUEST)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
expect(res.body.error).toBeDefined();
|
||||
expect(res.body.error).toMatch(API_ERROR.USERNAME_PASSWORD_REQUIRED);
|
||||
done();
|
||||
});
|
||||
expect(res.body.error).toBeDefined();
|
||||
expect(res.body.error).toMatch(API_ERROR.USERNAME_PASSWORD_REQUIRED);
|
||||
resolve(app);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('should test fails add a new user with missing password', async (done) => {
|
||||
test('should test fails add a new user with missing password', async () => {
|
||||
mockApiJWTmiddleware.mockImplementationOnce(
|
||||
() =>
|
||||
(req: $RequestExtend, res: $ResponseExtend, _next): void => {
|
||||
@@ -166,25 +178,28 @@ describe('user', () => {
|
||||
const credentialsShort = _.cloneDeep(credentials);
|
||||
delete credentialsShort.password;
|
||||
|
||||
supertest(await initializeServer('user.yaml'))
|
||||
.put(`/-/user/org.couchdb.user:${credentials.name}`)
|
||||
.send(credentialsShort)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.BAD_REQUEST)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
const app = await initializeServer('user.yaml');
|
||||
return new Promise((resolve, reject) => {
|
||||
supertest(app)
|
||||
.put(`/-/user/org.couchdb.user:${credentials.name}`)
|
||||
.send(credentialsShort)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.BAD_REQUEST)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
expect(res.body.error).toBeDefined();
|
||||
// FIXME: message is not 100% accurate
|
||||
// eslint-disable-next-line new-cap
|
||||
expect(res.body.error).toMatch(API_ERROR.PASSWORD_SHORT());
|
||||
done();
|
||||
});
|
||||
expect(res.body.error).toBeDefined();
|
||||
// FIXME: message is not 100% accurate
|
||||
// eslint-disable-next-line new-cap
|
||||
expect(res.body.error).toMatch(API_ERROR.PASSWORD_SHORT());
|
||||
resolve(res);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('should test fails add a new user with wrong password', async (done) => {
|
||||
test('should test fails add a new user with wrong password', async () => {
|
||||
mockApiJWTmiddleware.mockImplementationOnce(
|
||||
() =>
|
||||
(req: $RequestExtend, res: $ResponseExtend, _next): void => {
|
||||
@@ -197,27 +212,29 @@ describe('user', () => {
|
||||
});
|
||||
const credentialsShort = _.cloneDeep(credentials);
|
||||
credentialsShort.password = 'failPassword';
|
||||
const app = await initializeServer('user.yaml');
|
||||
return new Promise((resolve, reject) => {
|
||||
supertest(app)
|
||||
.put('/-/user/org.couchdb.user:test')
|
||||
.send(credentialsShort)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.UNAUTHORIZED)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
supertest(await initializeServer('user.yaml'))
|
||||
.put('/-/user/org.couchdb.user:test')
|
||||
.send(credentialsShort)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.UNAUTHORIZED)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
|
||||
expect(res.body.error).toBeDefined();
|
||||
expect(res.body.error).toMatch(API_ERROR.BAD_USERNAME_PASSWORD);
|
||||
done();
|
||||
});
|
||||
expect(res.body.error).toBeDefined();
|
||||
expect(res.body.error).toMatch(API_ERROR.BAD_USERNAME_PASSWORD);
|
||||
resolve(res);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('should be able to logout an user', async (done) => {
|
||||
test('should be able to logout an user', async () => {
|
||||
mockApiJWTmiddleware.mockImplementationOnce(
|
||||
() =>
|
||||
(req: $RequestExtend, res: $ResponseExtend, _next): void => {
|
||||
(req: $RequestExtend, _res: $ResponseExtend, _next): void => {
|
||||
req.remote_user = { name: 'test' };
|
||||
_next();
|
||||
}
|
||||
@@ -228,18 +245,21 @@ describe('user', () => {
|
||||
const credentialsShort = _.cloneDeep(credentials);
|
||||
credentialsShort.password = 'failPassword';
|
||||
|
||||
supertest(await initializeServer('user.yaml'))
|
||||
.delete('/-/user/token/someSecretToken')
|
||||
.send(credentialsShort)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.OK)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
const app = await initializeServer('user.yaml');
|
||||
return new Promise((resolve, reject) => {
|
||||
supertest(app)
|
||||
.delete('/-/user/token/someSecretToken')
|
||||
.send(credentialsShort)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.OK)
|
||||
.end(function (err, res) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
expect(res.body.ok).toMatch(API_MESSAGE.LOGGED_OUT);
|
||||
done();
|
||||
});
|
||||
expect(res.body.ok).toMatch(API_MESSAGE.LOGGED_OUT);
|
||||
resolve(res);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -44,11 +44,11 @@
|
||||
"@verdaccio/loaders": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.5",
|
||||
"verdaccio-htpasswd": "workspace:11.0.0-alpha.6",
|
||||
"debug": "^4.1.1",
|
||||
"debug": "4.3.2",
|
||||
"express": "4.17.1",
|
||||
"jsonwebtoken": "8.5.1",
|
||||
"lodash": "4.17.15"
|
||||
"lodash": "4.17.21",
|
||||
"verdaccio-htpasswd": "workspace:11.0.0-alpha.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.7",
|
||||
|
||||
@@ -116,7 +116,7 @@ class Auth implements IAuth {
|
||||
let authPlugin;
|
||||
try {
|
||||
authPlugin = new HTPasswd(plugingConf, pluginOptions);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
debug('error on loading auth htpasswd plugin stack: %o', error);
|
||||
return [];
|
||||
}
|
||||
@@ -559,7 +559,7 @@ class Auth implements IAuth {
|
||||
let credentials;
|
||||
try {
|
||||
credentials = verifyJWTPayload(token, this.config.secret);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
// FIXME: intended behaviour, do we want it?
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ export function aesDecrypt(value: string, key: string): string | void {
|
||||
decrypted += decipher.final(inputEncoding);
|
||||
debug('token decrypted successfully');
|
||||
return decrypted.toString();
|
||||
} catch (_) {
|
||||
} catch (_: any) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ export function verifyJWTPayload(token: string, secret: string): RemoteUser {
|
||||
const payload: RemoteUser = verifyPayload(token, secret);
|
||||
|
||||
return payload;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
// #168 this check should be removed as soon AES encrypt is removed.
|
||||
if (expireReasons.includes(error.name)) {
|
||||
// it might be possible the jwt configuration is enabled and
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @verdaccio/cli
|
||||
|
||||
## 6.0.0-6-next.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/node-api@6.0.0-6-next.18
|
||||
|
||||
## 6.0.0-6-next.17
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/cli",
|
||||
"version": "6.0.0-6-next.17",
|
||||
"version": "6.0.0-6-next.18",
|
||||
"author": {
|
||||
"name": "Juan Picado",
|
||||
"email": "juanpicado19@gmail.com"
|
||||
@@ -46,16 +46,16 @@
|
||||
"dependencies": {
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.17",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.18",
|
||||
"@verdaccio/fastify-migration": "workspace:6.0.0-6-next.10",
|
||||
"commander": "6.2.0",
|
||||
"clipanion": "3.0.0-rc.11",
|
||||
"envinfo": "7.4.0",
|
||||
"clipanion": "3.0.1",
|
||||
"envinfo": "7.8.1",
|
||||
"kleur": "3.0.3",
|
||||
"semver": "7.3.2"
|
||||
"semver": "7.3.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ts-node": "9.1.1"
|
||||
"ts-node": "10.2.1"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -68,7 +68,7 @@ export class InitCommand extends Command {
|
||||
|
||||
await initServer(configParsed, this.port as string, version, name);
|
||||
logger.info('server started');
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ export class NewServer extends Command {
|
||||
|
||||
process.title = web?.title || DEFAULT_PROCESS_NAME;
|
||||
// const { version, name } = require('../../package.json');
|
||||
const ser = await server({ logger });
|
||||
const ser = await server({ logger, config: configParsed });
|
||||
await ser.listen(4873);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
|
||||
import { Command } from 'clipanion';
|
||||
|
||||
export class VersionCommand extends Command {
|
||||
|
||||
@@ -41,15 +41,15 @@
|
||||
"dependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.5",
|
||||
"debug": "^4.2.0",
|
||||
"debug": "4.3.2",
|
||||
"js-yaml": "3.14.0",
|
||||
"lodash": "^4.17.20",
|
||||
"lodash": "4.17.21",
|
||||
"minimatch": "3.0.4",
|
||||
"yup": "^0.29.3"
|
||||
"yup": "0.32.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/minimatch": "3.0.3",
|
||||
"@types/yup": "^0.29.9"
|
||||
"@types/minimatch": "3.0.5",
|
||||
"@types/yup": "0.29.13"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -9,7 +9,7 @@ export function folderExists(path: string): boolean {
|
||||
try {
|
||||
const stat = fs.statSync(path);
|
||||
return stat.isDirectory();
|
||||
} catch (_) {
|
||||
} catch (_: any) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ export function fileExists(path: string): boolean {
|
||||
try {
|
||||
const stat = fs.statSync(path);
|
||||
return stat.isFile();
|
||||
} catch (_) {
|
||||
} catch (_: any) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export function parseConfigFile(configPath: string): ConfigRuntime {
|
||||
return Object.assign({}, jsonConfig, {
|
||||
config_path: configPath,
|
||||
});
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
if (e.code !== 'MODULE_NOT_FOUND') {
|
||||
e.message = APP_ERROR.CONFIG_NOT_VALID;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
parseConfigFile,
|
||||
ROLES,
|
||||
WEB_TITLE,
|
||||
getMatchedPackagesSpec,
|
||||
} from '../src';
|
||||
import { parseConfigurationFile } from './utils';
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"npm": ">=6"
|
||||
},
|
||||
"dependencies": {
|
||||
"http-errors": "^1.8.0",
|
||||
"http-status-codes": "^1.4.0"
|
||||
"http-errors": "1.8.0",
|
||||
"http-status-codes": "2.1.4"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -68,7 +68,7 @@ function readFile(
|
||||
try {
|
||||
contents = JSON.parse(contents);
|
||||
return resolve(contents);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
return reject(err);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -36,15 +36,15 @@
|
||||
"dependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/file-locking": "workspace:11.0.0-alpha.3",
|
||||
"apache-md5": "1.1.2",
|
||||
"apache-md5": "1.1.7",
|
||||
"bcryptjs": "2.4.3",
|
||||
"http-errors": "1.8.0",
|
||||
"unix-crypt-td-js": "1.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/bcryptjs": "2.4.2",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.7",
|
||||
"mockdate": "^3.0.2"
|
||||
"mockdate": "3.0.5"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -178,7 +178,7 @@ export default class HTPasswd implements IPluginAuth<HTPasswdConfig> {
|
||||
|
||||
try {
|
||||
this._writeFile(addUserToHTPasswd(body, user, password, this.hashConfig), cb);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
return cb(err);
|
||||
}
|
||||
});
|
||||
@@ -275,7 +275,7 @@ export default class HTPasswd implements IPluginAuth<HTPasswdConfig> {
|
||||
changePasswordToHTPasswd(body, user, password, newPassword, this.hashConfig),
|
||||
cb
|
||||
);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
return cb(err);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
|
||||
export default class Config {
|
||||
constructor() {
|
||||
this.storage = './test-storage';
|
||||
|
||||
@@ -252,7 +252,7 @@ describe('changePasswordToHTPasswd', () => {
|
||||
'newPassword',
|
||||
defaultHashConfig
|
||||
);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
expect(error.message).toEqual('Invalid old Password');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -40,16 +40,16 @@
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/file-locking": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/streams": "workspace:11.0.0-alpha.3",
|
||||
"async": "^3.2.0",
|
||||
"debug": "^4.1.1",
|
||||
"lodash": "^4.17.20",
|
||||
"async": "3.2.1",
|
||||
"debug": "4.3.2",
|
||||
"lodash": "4.17.21",
|
||||
"lowdb": "1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"@types/minimatch": "3.0.5",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.7",
|
||||
"minimatch": "^3.0.4",
|
||||
"rmdir-sync": "^1.0.1"
|
||||
"minimatch": "3.0.4",
|
||||
"rmdir-sync": "1.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -279,7 +279,7 @@ class LocalDatabase extends TokenActions implements IPluginStorage<{}> {
|
||||
debug('creating folder %o', folderName);
|
||||
fs.mkdirSync(folderName, { recursive: true });
|
||||
debug('sync folder %o created succeed', folderName);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
debug('sync create folder has failed with error: %o', err);
|
||||
return null;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ class LocalDatabase extends TokenActions implements IPluginStorage<{}> {
|
||||
debug('sync write succeed');
|
||||
|
||||
return null;
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
debug('sync failed %o', err);
|
||||
|
||||
return err;
|
||||
@@ -326,7 +326,7 @@ class LocalDatabase extends TokenActions implements IPluginStorage<{}> {
|
||||
|
||||
try {
|
||||
return await loadPrivatePackages(this.path, this.logger);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
// readFileSync is platform specific, macOS, Linux and Windows thrown an error
|
||||
// Only recreate if file not found to prevent data loss
|
||||
debug('error on fetch local packages %o', err);
|
||||
|
||||
@@ -171,7 +171,7 @@ export default class LocalFS implements ILocalFSPackageManager {
|
||||
|
||||
debug('read storage file %o has succeed', name);
|
||||
cb(null, data);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
debug('parse storage file %o has failed with error %o', name, err);
|
||||
cb(err);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ export async function loadPrivatePackages(path: string, logger: Logger): Promise
|
||||
let db;
|
||||
try {
|
||||
db = JSON.parse(data);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
logger.error(
|
||||
`Package database file corrupted (invalid JSON), please check the error` +
|
||||
` printed below.\nFile Path: ${path}`,
|
||||
|
||||
@@ -68,7 +68,7 @@ export async function findPackages(
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
reject(error);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
/* eslint-disable jest/no-mocks-import */
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { assign } from 'lodash';
|
||||
import { ILocalData, PluginOptions, Token } from '@verdaccio/types';
|
||||
|
||||
import LocalDatabase from '../src/local-database';
|
||||
import { ILocalFSPackageManager } from '../src/local-fs';
|
||||
import * as pkgUtils from '../src/pkg-utils';
|
||||
|
||||
// FIXME: remove this mocks imports
|
||||
@@ -19,14 +15,11 @@ const optionsPlugin: PluginOptions<{}> = {
|
||||
};
|
||||
|
||||
let locaDatabase: ILocalData<{}>;
|
||||
let loadPrivatePackages;
|
||||
|
||||
describe('Local Database', () => {
|
||||
beforeEach(() => {
|
||||
const writeMock = jest.spyOn(fs, 'writeFileSync').mockImplementation();
|
||||
loadPrivatePackages = jest
|
||||
.spyOn(pkgUtils, 'loadPrivatePackages')
|
||||
.mockReturnValue({ list: [], secret: '' });
|
||||
jest.spyOn(pkgUtils, 'loadPrivatePackages').mockReturnValue({ list: [], secret: '' });
|
||||
locaDatabase = new LocalDatabase(optionsPlugin.config, optionsPlugin.logger);
|
||||
(locaDatabase as LocalDatabase).clean();
|
||||
writeMock.mockClear();
|
||||
|
||||
@@ -54,7 +54,7 @@ describe('Utitlies', () => {
|
||||
'./no_such_folder_fake',
|
||||
jest.fn(() => true)
|
||||
);
|
||||
} catch (e) {
|
||||
} catch (e: any) {
|
||||
expect(e.code).toEqual(noSuchFile);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
"build"
|
||||
],
|
||||
"dependencies": {
|
||||
"dompurify": "2.0.8",
|
||||
"jsdom": "15.2.1",
|
||||
"dompurify": "2.3.1",
|
||||
"jsdom": "17.0.0",
|
||||
"marked": "1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -19,10 +19,10 @@ const debug = buildDebug('verdaccio:fastify:debug');
|
||||
logger.info(`config location ${configFile}`);
|
||||
debug('configParsed %s', configParsed);
|
||||
process.title = 'fastify-verdaccio';
|
||||
const ser = await server({ logger });
|
||||
const ser = await server({ logger, config: configParsed });
|
||||
await ser.listen(4873);
|
||||
logger.info('fastify running on port 4873');
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
|
||||
@@ -34,15 +34,17 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.9",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"fastify": "3.15.1",
|
||||
"fastify-plugin": "3.0.0",
|
||||
"debug": "4.3.1"
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.10",
|
||||
"debug": "4.3.2",
|
||||
"fastify": "3.20.2",
|
||||
"fastify-plugin": "3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.7",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.7",
|
||||
"ts-node": "9.1.1"
|
||||
"ts-node": "10.2.1"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
/* eslint-disable no-console */
|
||||
/* eslint-disable no-invalid-this */
|
||||
import { logger } from '@verdaccio/logger';
|
||||
|
||||
async function pingRoute(fastify) {
|
||||
fastify.get('/-/ping', async () => {
|
||||
logger.http('ping endpoint');
|
||||
// @ts-ignore
|
||||
console.log('-storage->', fastify.storage);
|
||||
console.log('-config->', fastify.config);
|
||||
return {};
|
||||
});
|
||||
}
|
||||
|
||||
9
packages/core/server/src/plugins/storage.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Storage, IStorageHandler } from '@verdaccio/store';
|
||||
|
||||
export async function storageService(fastify, opts, done) {
|
||||
const { config, filters } = opts;
|
||||
const storage: IStorageHandler = new Storage(config);
|
||||
await storage.init(config, filters ?? {});
|
||||
fastify.decorate('storage', storage);
|
||||
done();
|
||||
}
|
||||
@@ -1,14 +1,36 @@
|
||||
import { Config as IConfig } from '@verdaccio/types';
|
||||
import { Config as AppConfig } from '@verdaccio/config';
|
||||
|
||||
import fastify from 'fastify';
|
||||
import buildDebug from 'debug';
|
||||
import fp from 'fastify-plugin';
|
||||
|
||||
import ping from './endpoints/ping';
|
||||
import { storageService } from './plugins/storage';
|
||||
|
||||
const debug = buildDebug('verdaccio:fastify');
|
||||
|
||||
async function startServer({ logger }) {
|
||||
async function startServer({ logger, config }) {
|
||||
const configInstance: IConfig = new AppConfig(Object.assign({}, config));
|
||||
debug('start server');
|
||||
const app = fastify({ logger });
|
||||
app.register(ping);
|
||||
|
||||
app.decorate('config', configInstance);
|
||||
app.register(fp(storageService), { config: configInstance });
|
||||
|
||||
// api
|
||||
app.register((instance, opts, done) => {
|
||||
instance.decorate('utility', new Map());
|
||||
instance.register(ping);
|
||||
done();
|
||||
});
|
||||
|
||||
// web
|
||||
app.register((instance, opts, done) => {
|
||||
instance.register(ping, { prefix: '/web' });
|
||||
done();
|
||||
});
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,5 +5,19 @@
|
||||
"outDir": "./build"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["src/**/*.test.ts"]
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../store"
|
||||
},
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../auth"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "^4.3.1",
|
||||
"lodash": "^4.17.21",
|
||||
"debug": "4.3.2",
|
||||
"lodash": "4.17.21",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/url": "workspace:11.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.5"
|
||||
|
||||
@@ -34,14 +34,14 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "^4.3.1",
|
||||
"lodash": "^4.17.21",
|
||||
"validator": "^13.5.2",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3"
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"debug": "4.3.2",
|
||||
"lodash": "4.17.21",
|
||||
"validator": "13.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"node-mocks-http": "^1.10.1",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.7"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.7",
|
||||
"node-mocks-http": "1.10.1"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { URL } from 'url';
|
||||
import _ from 'lodash';
|
||||
import buildDebug from 'debug';
|
||||
import isURLValidator from 'validator/lib/isURL';
|
||||
|
||||
import { ConfigYaml } from '@verdaccio/types';
|
||||
import { HEADERS } from '@verdaccio/commons-api';
|
||||
|
||||
const debug = buildDebug('verdaccio:core:url');
|
||||
@@ -85,7 +82,7 @@ export function validateURL(publicUrl: string | void) {
|
||||
throw Error('invalid protocol');
|
||||
}
|
||||
return true;
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
// TODO: add error logger here
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
const config = require('../../jest/config');
|
||||
|
||||
module.exports = Object.assign({}, config, {});
|
||||
module.exports = Object.assign({}, config, {
|
||||
testEnvironment: 'node',
|
||||
});
|
||||
|
||||
@@ -26,23 +26,22 @@
|
||||
"verdaccio"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10",
|
||||
"node": ">=12",
|
||||
"npm": ">=6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"debug": "^4.2.0",
|
||||
"handlebars": "4.5.3",
|
||||
"node-fetch": "^2.6.1",
|
||||
"request": "2.87.0"
|
||||
"debug": "4.3.2",
|
||||
"handlebars": "4.7.7",
|
||||
"undici": "4.5.1",
|
||||
"undici-fetch": "1.0.0-rc.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.9",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.7",
|
||||
"nock": "^13.0.4"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.7"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
import fetch, { RequestInit } from 'node-fetch';
|
||||
import buildDebug from 'debug';
|
||||
|
||||
import { logger } from '@verdaccio/logger';
|
||||
import { HTTP_STATUS } from '@verdaccio/commons-api';
|
||||
|
||||
const debug = buildDebug('verdaccio:hooks:request');
|
||||
export type NotifyRequestOptions = RequestInit;
|
||||
const fetch = require('undici-fetch');
|
||||
|
||||
export async function notifyRequest(url: string, options: NotifyRequestOptions): Promise<boolean> {
|
||||
export type FetchOptions = {
|
||||
body: string;
|
||||
headers?: {};
|
||||
method?: string;
|
||||
};
|
||||
|
||||
export async function notifyRequest(url: string, options: FetchOptions): Promise<boolean> {
|
||||
let response;
|
||||
try {
|
||||
debug('uri %o', url);
|
||||
@@ -27,7 +32,7 @@ export async function notifyRequest(url: string, options: NotifyRequestOptions):
|
||||
'The notification @{content} has been successfully dispatched'
|
||||
);
|
||||
return true;
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
debug('request error %o', err);
|
||||
logger.error(
|
||||
{ errorMessage: err?.message },
|
||||
|
||||
@@ -5,10 +5,9 @@ import Handlebars from 'handlebars';
|
||||
import buildDebug from 'debug';
|
||||
import { Config, Package, RemoteUser, Notification } from '@verdaccio/types';
|
||||
import { logger } from '@verdaccio/logger';
|
||||
import { notifyRequest, NotifyRequestOptions } from './notify-request';
|
||||
import { notifyRequest, FetchOptions } from './notify-request';
|
||||
|
||||
const debug = buildDebug('verdaccio:hooks');
|
||||
type TemplateMetadata = Package & { publishedPackage: string };
|
||||
|
||||
export function compileTemplate(content, metadata) {
|
||||
// FUTURE: multiple handlers
|
||||
@@ -20,7 +19,7 @@ export function compileTemplate(content, metadata) {
|
||||
const template: HandlebarsTemplateDelegate = Handlebars.compile(content);
|
||||
return resolve(template(metadata));
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
debug('error template handler %o', error);
|
||||
reject(error);
|
||||
}
|
||||
@@ -51,7 +50,7 @@ export async function handleNotify(
|
||||
content = await compileTemplate(notifyEntry.content, metadata);
|
||||
}
|
||||
|
||||
const options: NotifyRequestOptions = {
|
||||
const options: FetchOptions = {
|
||||
body: JSON.stringify(content),
|
||||
};
|
||||
|
||||
|
||||