Compare commits
21 Commits
@verdaccio
...
@verdaccio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4137a96c20 | ||
|
|
37274e4c8d | ||
|
|
f1527f5f20 | ||
|
|
a32a7e617e | ||
|
|
08c36e688e | ||
|
|
ba3d100b63 | ||
|
|
37da9e0f61 | ||
|
|
e630954923 | ||
|
|
4b61029718 | ||
|
|
13398c6ab8 | ||
|
|
16f847fd7d | ||
|
|
225b5235a9 | ||
|
|
1b5bcfeac6 | ||
|
|
eaebffaf9e | ||
|
|
dc4fa8e20d | ||
|
|
99b947a2a5 | ||
|
|
83c4705821 | ||
|
|
3f5a1ee22a | ||
|
|
bf0f331dfc | ||
|
|
89b2b9104f | ||
|
|
21478f3221 |
@@ -124,6 +124,7 @@
|
||||
"three-moles-drop",
|
||||
"three-pots-sit",
|
||||
"tiny-seals-join",
|
||||
"tricky-taxis-watch",
|
||||
"two-dolls-check",
|
||||
"wild-jokes-beam"
|
||||
]
|
||||
|
||||
28
.changeset/tricky-taxis-watch.md
Normal file
28
.changeset/tricky-taxis-watch.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
'@verdaccio/api': minor
|
||||
'@verdaccio/types': minor
|
||||
'@verdaccio/local-storage': minor
|
||||
'@verdaccio/server-fastify': minor
|
||||
'@verdaccio/store': minor
|
||||
'@verdaccio/test-helper': minor
|
||||
'@verdaccio/web': minor
|
||||
---
|
||||
|
||||
feat: implement abbreviated manifest
|
||||
|
||||
Enable abbreviated manifest data by adding the header:
|
||||
|
||||
```
|
||||
curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
|
||||
```
|
||||
|
||||
It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
|
||||
|
||||
Current support for packages managers:
|
||||
|
||||
- npm: yes
|
||||
- pnpm: yes
|
||||
- yarn classic: yes
|
||||
- yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
|
||||
|
||||
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
|
||||
28
.github/workflows/benchmark.yml
vendored
28
.github/workflows/benchmark.yml
vendored
@@ -18,8 +18,8 @@ jobs:
|
||||
name: Prepare build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
- name: install pnpm
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: Cache .pnpm-store
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
- name: tar packages
|
||||
run: |
|
||||
tar -czvf ${{ github.workspace }}/pkg.tar.gz -C ${{ github.workspace }}/packages .
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
path: pkg.tar.gz
|
||||
@@ -65,11 +65,11 @@ jobs:
|
||||
name: Benchmark autocannon
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # tag=v3
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
- name: install pnpm
|
||||
# require fixed version
|
||||
run: sudo npm i pnpm@latest-6 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -90,7 +90,7 @@ jobs:
|
||||
shell: bash
|
||||
env:
|
||||
DEBUG: metrics*
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
|
||||
with:
|
||||
name: verdaccio-metrics-api
|
||||
path: ./api-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
@@ -126,11 +126,11 @@ jobs:
|
||||
name: Benchmark hyperfine
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # tag=v3
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
- name: install pnpm
|
||||
# require fixed version
|
||||
run: sudo npm i pnpm@latest-6 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -156,7 +156,7 @@ jobs:
|
||||
shell: bash
|
||||
- name: rename
|
||||
run: mv ./hyper-results.json ./hyper-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
|
||||
with:
|
||||
name: verdaccio-metrics
|
||||
path: ./hyper-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
|
||||
4
.github/workflows/changesets.yml
vendored
4
.github/workflows/changesets.yml
vendored
@@ -20,12 +20,12 @@ jobs:
|
||||
if: github.ref == 'refs/heads/master' && github.repository == 'verdaccio/verdaccio'
|
||||
steps:
|
||||
- name: checkout code repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: setup node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 14
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
42
.github/workflows/ci.yml
vendored
42
.github/workflows/ci.yml
vendored
@@ -25,9 +25,9 @@ jobs:
|
||||
ports:
|
||||
- 4873:4873
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
|
||||
- name: Cache .pnpm-store
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -50,14 +50,14 @@ jobs:
|
||||
name: Lint
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -70,14 +70,14 @@ jobs:
|
||||
name: Format
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -95,14 +95,14 @@ jobs:
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -117,13 +117,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
name: UI Test E2E Node 16
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -140,13 +140,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
name: CLI Test E2E Node 16
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -165,13 +165,13 @@ jobs:
|
||||
name: synchronize translations
|
||||
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
|
||||
8
.github/workflows/codeql-analysis.yml
vendored
8
.github/workflows/codeql-analysis.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=v2
|
||||
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
# with:
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=v2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -56,4 +56,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=v2
|
||||
|
||||
6
.github/workflows/contributors.yml
vendored
6
.github/workflows/contributors.yml
vendored
@@ -15,11 +15,11 @@ jobs:
|
||||
name: Run script
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 17.x
|
||||
- name: install pnpm
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
- name: format
|
||||
run: pnpm format
|
||||
- name: Commit & Push changes
|
||||
uses: actions-js/push@v1.3
|
||||
uses: actions-js/push@a52398fac807b0c1e5f1492c969b477c8560a0ba # tag=v1.3
|
||||
with:
|
||||
github_token: ${{ secrets.TOKEN_VERDACCIOBOT_GITHUB }}
|
||||
message: "chore: updated contributors list"
|
||||
|
||||
4
.github/workflows/docker-publish.yml
vendored
4
.github/workflows/docker-publish.yml
vendored
@@ -19,8 +19,8 @@ jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # tag=v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
driver-opts: network=host
|
||||
|
||||
16
.github/workflows/website.yml
vendored
16
.github/workflows/website.yml
vendored
@@ -16,15 +16,15 @@ jobs:
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Cache pnpm modules
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
env:
|
||||
cache-name: cache-pnpm-modules
|
||||
with:
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
|
||||
|
||||
- uses: pnpm/action-setup@v2.2.2
|
||||
- uses: pnpm/action-setup@10693b3829bf86eb2572aef5f3571dcf5ca9287d # tag=v2.2.2
|
||||
with:
|
||||
version: 6.32.15
|
||||
run_install: |
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
- name: Build Plugins
|
||||
run: pnpm build --filter "docusaurus-plugin-contributors"
|
||||
- name: Cache Docusaurus Build
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: website/node_modules/.cache/webpack
|
||||
key: cache/webpack-${{github.ref}}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
@@ -91,7 +91,7 @@ jobs:
|
||||
- name: Audit preview URL with Lighthouse
|
||||
if: github.repository == 'verdaccio/verdaccio'
|
||||
id: lighthouse_audit
|
||||
uses: treosh/lighthouse-ci-action@9.3.0
|
||||
uses: treosh/lighthouse-ci-action@b4dfae3eb959c5226e2c5c6afd563d493188bfaf # tag=9.3.0
|
||||
with:
|
||||
urls: |
|
||||
${{ steps.netlify_preview.outputs.preview-url }}
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
|
||||
- name: Format lighthouse score
|
||||
id: format_lighthouse_score
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@d50f485531ba88479582bc2da03ff424389af5c1 # tag=v6
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
@@ -125,7 +125,7 @@ jobs:
|
||||
- name: Add comment to PR
|
||||
if: github.repository == 'verdaccio/verdaccio'
|
||||
id: comment_to_pr
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 # tag=v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
number: ${{ github.event.issue.number }}
|
||||
|
||||
18
README.md
18
README.md
@@ -44,7 +44,19 @@ Google Cloud Storage** or create your own plugin.
|
||||
Install with npm:
|
||||
|
||||
```bash
|
||||
npm install --global verdaccio@6-next
|
||||
npm install --location=global verdaccio@6-next
|
||||
```
|
||||
|
||||
With `yarn`
|
||||
|
||||
```bash
|
||||
yarn global add verdaccio@6-next
|
||||
```
|
||||
|
||||
With `pnpm`
|
||||
|
||||
```bash
|
||||
pnpm i -g verdaccio@6-next
|
||||
```
|
||||
|
||||
or
|
||||
@@ -68,8 +80,8 @@ Furthermore, you can read the [**Debugging Guidelines**](https://github.com/verd
|
||||
You can develop your own [plugins](https://verdaccio.org/docs/plugins) with the [verdaccio generator](https://github.com/verdaccio/generator-verdaccio-plugin). Installing [Yeoman](https://yeoman.io/) is required.
|
||||
|
||||
```
|
||||
npm install -g yo
|
||||
npm install -g generator-verdaccio-plugin
|
||||
npm install --location=global yo
|
||||
npm install --location=global generator-verdaccio-plugin
|
||||
```
|
||||
|
||||
Learn more [here](https://verdaccio.org/docs/dev-plugins) how to develop plugins. Share your plugins with the community.
|
||||
|
||||
18
package.json
18
package.json
@@ -38,32 +38,32 @@
|
||||
"@babel/preset-typescript": "7.18.6",
|
||||
"@babel/register": "7.18.9",
|
||||
"@babel/runtime": "7.18.9",
|
||||
"@dianmora/contributors": "2.0.2",
|
||||
"@dianmora/contributors": "5.0.0",
|
||||
"@changesets/changelog-github": "0.4.6",
|
||||
"@changesets/cli": "2.15.0",
|
||||
"@changesets/get-dependents-graph": "1.3.3",
|
||||
"@crowdin/cli": "3.7.9",
|
||||
"@crowdin/cli": "3.7.10",
|
||||
"@trivago/prettier-plugin-sort-imports": "3.3.0",
|
||||
"@types/async": "3.2.15",
|
||||
"@types/autocannon": "4.1.1",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/http-errors": "1.8.2",
|
||||
"@types/jest": "27.5.2",
|
||||
"@types/lodash": "4.14.182",
|
||||
"@types/lodash": "4.14.184",
|
||||
"@types/mime": "2.0.3",
|
||||
"@types/minimatch": "3.0.5",
|
||||
"@types/node": "16.11.47",
|
||||
"@types/node": "16.11.51",
|
||||
"@types/jsonwebtoken": "8.5.8",
|
||||
"@types/request": "2.48.8",
|
||||
"@types/semver": "7.3.10",
|
||||
"@types/semver": "7.3.12",
|
||||
"@types/node-fetch": "2.6.2",
|
||||
"@types/supertest": "2.0.12",
|
||||
"@types/testing-library__jest-dom": "5.14.5",
|
||||
"@types/validator": "13.7.5",
|
||||
"@types/webpack": "5.28.0",
|
||||
"@types/webpack-env": "1.17.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.32.0",
|
||||
"@typescript-eslint/parser": "5.32.0",
|
||||
"@types/webpack-env": "1.18.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.33.1",
|
||||
"@typescript-eslint/parser": "5.33.1",
|
||||
"@verdaccio/benchmark": "workspace:*",
|
||||
"@verdaccio/eslint-config": "workspace:*",
|
||||
"@verdaccio/types": "workspace:*",
|
||||
@@ -82,7 +82,7 @@
|
||||
"detect-secrets": "1.0.6",
|
||||
"pretty-format": "27.5.1",
|
||||
"jest-diff": "27.5.1",
|
||||
"eslint": "8.21.0",
|
||||
"eslint": "8.22.0",
|
||||
"fs-extra": "10.1.0",
|
||||
"husky": "7.0.4",
|
||||
"in-publish": "2.0.1",
|
||||
|
||||
@@ -1,5 +1,36 @@
|
||||
# @verdaccio/api
|
||||
|
||||
## 6.0.0-6-next.27
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 37274e4c: feat: implement abbreviated manifest
|
||||
|
||||
Enable abbreviated manifest data by adding the header:
|
||||
|
||||
```
|
||||
curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
|
||||
```
|
||||
|
||||
It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
|
||||
|
||||
Current support for packages managers:
|
||||
|
||||
- npm: yes
|
||||
- pnpm: yes
|
||||
- yarn classic: yes
|
||||
- yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
|
||||
|
||||
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [37274e4c]
|
||||
- @verdaccio/store@6.0.0-6-next.24
|
||||
- @verdaccio/auth@6.0.0-6-next.23
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- @verdaccio/logger@6.0.0-6-next.12
|
||||
|
||||
## 6.0.0-6-next.26
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/api",
|
||||
"version": "6.0.0-6-next.26",
|
||||
"version": "6.0.0-6-next.27",
|
||||
"description": "loaders logic",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -44,7 +44,7 @@
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/middleware": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.24",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
|
||||
"abortcontroller-polyfill": "1.7.3",
|
||||
"cookies": "0.8.0",
|
||||
@@ -56,10 +56,10 @@
|
||||
"semver": "7.3.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "16.11.47",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.32",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.1",
|
||||
"@types/node": "16.11.51",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.33",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.2",
|
||||
"supertest": "6.2.4",
|
||||
"nock": "13.2.9",
|
||||
"mockdate": "3.0.5"
|
||||
|
||||
@@ -25,6 +25,7 @@ export default function (route: Router, auth: IAuth, storage: Storage): void {
|
||||
const name = req.params.package;
|
||||
let version = req.params.version;
|
||||
const write = req.query.write === 'true';
|
||||
const abbreviated = req.get('Accept') === Storage.ABBREVIATED_HEADER;
|
||||
const requestOptions = {
|
||||
protocol: req.protocol,
|
||||
headers: req.headers as any,
|
||||
@@ -38,6 +39,7 @@ export default function (route: Router, auth: IAuth, storage: Storage): void {
|
||||
const manifest = await storage.getPackageByOptions({
|
||||
name,
|
||||
uplinksLook: true,
|
||||
abbreviated,
|
||||
version,
|
||||
requestOptions,
|
||||
});
|
||||
|
||||
@@ -56,7 +56,7 @@ const debug = buildDebug('verdaccio:api:publish');
|
||||
*
|
||||
* There are two possible flows:
|
||||
*
|
||||
* - Remove all pacakges (entirely)
|
||||
* - Remove all packages (entirely)
|
||||
* eg: npm unpublish package-name@* --force
|
||||
* eg: npm unpublish package-name --force
|
||||
*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import supertest from 'supertest';
|
||||
|
||||
import { HEADERS, HEADER_TYPE, HTTP_STATUS } from '@verdaccio/core';
|
||||
import { DIST_TAGS, HEADERS, HEADER_TYPE, HTTP_STATUS } from '@verdaccio/core';
|
||||
import { Storage } from '@verdaccio/store';
|
||||
|
||||
import { initializeServer, publishVersion } from './_helper';
|
||||
|
||||
@@ -45,4 +46,24 @@ describe('package', () => {
|
||||
expect(response.body.name).toEqual(pkg);
|
||||
}
|
||||
);
|
||||
|
||||
test.each([['foo-abbreviated'], ['@scope/foo-abbreviated']])(
|
||||
'should return abbreviated local manifest',
|
||||
async (pkg) => {
|
||||
await publishVersion(app, pkg, '1.0.0');
|
||||
const response = await supertest(app)
|
||||
.get(`/${pkg}`)
|
||||
.set(HEADERS.ACCEPT, HEADERS.JSON)
|
||||
.set(HEADERS.ACCEPT, Storage.ABBREVIATED_HEADER)
|
||||
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
|
||||
.expect(HTTP_STATUS.OK);
|
||||
expect(response.body.name).toEqual(pkg);
|
||||
expect(response.body.time).toBeDefined();
|
||||
expect(response.body.modified).toBeDefined();
|
||||
expect(response.body[DIST_TAGS]).toEqual({ latest: '1.0.0' });
|
||||
expect(response.body.readme).not.toBeDefined();
|
||||
expect(response.body._rev).not.toBeDefined();
|
||||
expect(response.body.users).not.toBeDefined();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
"verdaccio-htpasswd": "workspace:11.0.0-6-next.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @verdaccio/cli
|
||||
|
||||
## 6.0.0-6-next.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- @verdaccio/logger@6.0.0-6-next.12
|
||||
- @verdaccio/node-api@6.0.0-6-next.34
|
||||
|
||||
## 6.0.0-6-next.35
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/cli",
|
||||
"version": "6.0.0-6-next.35",
|
||||
"version": "6.0.0-6-next.36",
|
||||
"author": {
|
||||
"name": "Juan Picado",
|
||||
"email": "juanpicado19@gmail.com"
|
||||
@@ -47,7 +47,7 @@
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.33",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.34",
|
||||
"clipanion": "3.1.0",
|
||||
"envinfo": "7.8.1",
|
||||
"kleur": "3.0.3",
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"lodash": "4.17.21",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"lockfile": "1.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
"marked": "3.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
"lodash": "4.17.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"node-mocks-http": "1.11.0"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# Change Log
|
||||
|
||||
## 11.0.0-6-next.14
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 37274e4c: feat: implement abbreviated manifest
|
||||
|
||||
Enable abbreviated manifest data by adding the header:
|
||||
|
||||
```
|
||||
curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
|
||||
```
|
||||
|
||||
It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
|
||||
|
||||
Current support for packages managers:
|
||||
|
||||
- npm: yes
|
||||
- pnpm: yes
|
||||
- yarn classic: yes
|
||||
- yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
|
||||
|
||||
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
|
||||
|
||||
## 11.0.0-6-next.13
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/types",
|
||||
"version": "11.0.0-6-next.13",
|
||||
"version": "11.0.0-6-next.14",
|
||||
"description": "verdaccio types definitions",
|
||||
"keywords": [
|
||||
"private",
|
||||
@@ -41,7 +41,7 @@
|
||||
"build": "tsc --emitDeclarationOnly -p tsconfig.build.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "16.11.47",
|
||||
"@types/node": "16.11.51",
|
||||
"typedoc": "beta",
|
||||
"typedoc-plugin-missing-exports": "1.0.0"
|
||||
},
|
||||
|
||||
@@ -92,7 +92,6 @@ export interface Tags {
|
||||
export interface Version {
|
||||
name: string;
|
||||
version: string;
|
||||
devDependencies?: string;
|
||||
directories?: any;
|
||||
dist: Dist;
|
||||
author: string | Author;
|
||||
@@ -113,7 +112,11 @@ export interface Version {
|
||||
scripts?: any;
|
||||
homepage?: string;
|
||||
etag?: string;
|
||||
dependencies: any;
|
||||
dependencies?: Dependencies;
|
||||
peerDependencies?: Dependencies;
|
||||
devDependencies?: Dependencies;
|
||||
optionalDependencies?: Dependencies;
|
||||
bundleDependencies?: Dependencies;
|
||||
keywords?: string | string[];
|
||||
nodeVersion?: string;
|
||||
_id: string;
|
||||
@@ -121,6 +124,17 @@ export interface Version {
|
||||
_npmUser: Author;
|
||||
_hasShrinkwrap?: boolean;
|
||||
deprecated?: string;
|
||||
funding?: { type: string; url: string };
|
||||
engines?: Engines;
|
||||
hasInstallScript?: boolean;
|
||||
}
|
||||
|
||||
export interface Dependencies {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export interface Engines {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export interface Versions {
|
||||
@@ -194,6 +208,32 @@ export interface Manifest extends FullRemoteManifest, PublishManifest {
|
||||
*/
|
||||
_rev: string;
|
||||
}
|
||||
|
||||
export type AbbreviatedVersion = Pick<
|
||||
Version,
|
||||
| 'name'
|
||||
| 'version'
|
||||
| 'description'
|
||||
| 'dependencies'
|
||||
| 'devDependencies'
|
||||
| 'bin'
|
||||
| 'dist'
|
||||
| 'engines'
|
||||
| 'funding'
|
||||
| 'peerDependencies'
|
||||
>;
|
||||
|
||||
export interface AbbreviatedVersions {
|
||||
[key: string]: AbbreviatedVersion;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export type AbbreviatedManifest = Pick<Manifest, 'name' | 'dist-tags' | 'time'> & {
|
||||
modified: string;
|
||||
versions: AbbreviatedVersions;
|
||||
};
|
||||
|
||||
export interface PublishManifest {
|
||||
/**
|
||||
* The `_attachments` object has different usages:
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"validator": "13.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"node-mocks-http": "1.11.0"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -38,10 +38,10 @@
|
||||
"undici": "4.16.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "16.11.47",
|
||||
"@types/node": "16.11.51",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"devDependencies": {
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14"
|
||||
},
|
||||
"homepage": "https://verdaccio.org",
|
||||
"keywords": [
|
||||
|
||||
@@ -39,14 +39,14 @@
|
||||
"build": "pnpm run build:js && pnpm run build:types"
|
||||
},
|
||||
"dependencies": {
|
||||
"dayjs": "1.11.4",
|
||||
"dayjs": "1.11.5",
|
||||
"pino-abstract-transport": "1.0.0",
|
||||
"colorette": "2.0.7",
|
||||
"colorette": "2.0.19",
|
||||
"lodash": "4.17.21",
|
||||
"sonic-boom": "3.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"pino": "8.4.1"
|
||||
"pino": "8.4.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -42,11 +42,11 @@
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/logger-prettify": "workspace:6.0.0-6-next.7",
|
||||
"debug": "4.3.4",
|
||||
"colorette": "2.0.7",
|
||||
"pino": "8.4.1"
|
||||
"colorette": "2.0.19",
|
||||
"pino": "8.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @verdaccio/node-api
|
||||
|
||||
## 6.0.0-6-next.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [37274e4c]
|
||||
- @verdaccio/server-fastify@6.0.0-6-next.25
|
||||
- @verdaccio/server@6.0.0-6-next.33
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- @verdaccio/logger@6.0.0-6-next.12
|
||||
|
||||
## 6.0.0-6-next.33
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/node-api",
|
||||
"version": "6.0.0-6-next.33",
|
||||
"version": "6.0.0-6-next.34",
|
||||
"description": "node API",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -42,15 +42,15 @@
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.32",
|
||||
"@verdaccio/server-fastify": "workspace:6.0.0-6-next.24",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.33",
|
||||
"@verdaccio/server-fastify": "workspace:6.0.0-6-next.25",
|
||||
"core-js": "3.24.1",
|
||||
"debug": "4.3.4",
|
||||
"lodash": "4.17.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "16.11.47",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@types/node": "16.11.51",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"jest-mock-process": "1.5.1",
|
||||
"selfsigned": "1.10.14",
|
||||
"supertest": "6.2.4"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"node-fetch": "cjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"nock": "13.2.9",
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bcryptjs": "2.4.2",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"mockdate": "3.0.5"
|
||||
|
||||
@@ -1,5 +1,33 @@
|
||||
# Change Log
|
||||
|
||||
## 11.0.0-6-next.14
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 37274e4c: feat: implement abbreviated manifest
|
||||
|
||||
Enable abbreviated manifest data by adding the header:
|
||||
|
||||
```
|
||||
curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
|
||||
```
|
||||
|
||||
It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
|
||||
|
||||
Current support for packages managers:
|
||||
|
||||
- npm: yes
|
||||
- pnpm: yes
|
||||
- yarn classic: yes
|
||||
- yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
|
||||
|
||||
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- @verdaccio/file-locking@11.0.0-6-next.5
|
||||
|
||||
## 11.0.0-6-next.13
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/local-storage",
|
||||
"version": "11.0.0-6-next.13",
|
||||
"version": "11.0.0-6-next.14",
|
||||
"description": "Local storage implementation",
|
||||
"keywords": [
|
||||
"private",
|
||||
@@ -50,11 +50,11 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/minimatch": "3.0.5",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.1",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.2",
|
||||
"minimatch": "3.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -40,7 +40,7 @@ class LocalDatabase extends TokenActions implements IPluginStorage {
|
||||
debug('config path %o', config.configPath);
|
||||
this.path = _dbGenPath(DB_NAME, config);
|
||||
this.storages = this._getCustomPackageLocalStorages();
|
||||
this.logger.debug({ path: this.path }, 'local storage path @{path}');
|
||||
this.logger.info({ path: this.path }, 'local storage path @{path}');
|
||||
debug('plugin storage path %o', this.path);
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ export default class LocalFS implements ILocalFSPackageManager {
|
||||
});
|
||||
|
||||
// if upload is aborted, we clean up the temporal file
|
||||
signal.addEventListener(
|
||||
signal?.addEventListener(
|
||||
'abort',
|
||||
async () => {
|
||||
if (opened) {
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"memfs": "3.4.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12"
|
||||
},
|
||||
|
||||
@@ -26,19 +26,19 @@
|
||||
"@emotion/css": "11.10.0",
|
||||
"@emotion/babel-plugin": "11.10.0",
|
||||
"@mui/icons-material": "5.8.4",
|
||||
"@mui/material": "5.9.3",
|
||||
"@mui/material": "5.10.1",
|
||||
"@mui/styles": "5.9.3",
|
||||
"@rematch/core": "2.2.0",
|
||||
"@rematch/loading": "2.1.2",
|
||||
"@testing-library/dom": "8.16.1",
|
||||
"@testing-library/dom": "8.17.1",
|
||||
"@testing-library/jest-dom": "5.16.5",
|
||||
"@testing-library/react": "12.1.5",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.33",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.34",
|
||||
"@verdaccio/types": "workspace:*",
|
||||
"babel-loader": "8.2.5",
|
||||
"babel-plugin-dynamic-import-node": "2.3.3",
|
||||
"css-loader": "6.7.1",
|
||||
"dayjs": "1.11.4",
|
||||
"dayjs": "1.11.5",
|
||||
"friendly-errors-webpack-plugin": "1.7.0",
|
||||
"github-markdown-css": "4.0.0",
|
||||
"harmony-reflect": "1.6.2",
|
||||
@@ -62,9 +62,9 @@
|
||||
"ora": "5.4.1",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"react-hook-form": "7.34.0",
|
||||
"react-hook-form": "7.34.2",
|
||||
"react-hot-loader": "4.13.0",
|
||||
"react-i18next": "11.18.3",
|
||||
"react-i18next": "11.18.4",
|
||||
"react-router": "5.3.3",
|
||||
"react-router-dom": "5.3.3",
|
||||
"react-virtualized": "9.22.3",
|
||||
@@ -74,24 +74,24 @@
|
||||
"raw-loader": "4.0.2",
|
||||
"msw": "0.44.2",
|
||||
"style-loader": "3.3.1",
|
||||
"stylelint": "14.9.1",
|
||||
"stylelint": "14.10.0",
|
||||
"stylelint-config-recommended": "7.0.0",
|
||||
"stylelint-config-styled-components": "0.1.1",
|
||||
"stylelint-processor-styled-components": "1.10.0",
|
||||
"stylelint-webpack-plugin": "3.3.0",
|
||||
"supertest": "6.2.4",
|
||||
"terser-webpack-plugin": "5.3.3",
|
||||
"terser-webpack-plugin": "5.3.5",
|
||||
"url-loader": "4.1.1",
|
||||
"validator": "13.7.0",
|
||||
"webpack": "5.74.0",
|
||||
"webpack-bundle-analyzer": "4.5.0",
|
||||
"webpack-bundle-analyzer": "4.6.0",
|
||||
"webpack-bundle-size-analyzer": "3.1.0",
|
||||
"webpack-cli": "^4.7.2",
|
||||
"webpack-dev-server": "3.11.3",
|
||||
"webpack-manifest-plugin": "4.1.1",
|
||||
"webpack-merge": "5.8.0",
|
||||
"whatwg-fetch": "3.6.2",
|
||||
"xss": "1.0.13"
|
||||
"xss": "1.0.14"
|
||||
},
|
||||
"keywords": [
|
||||
"private",
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @verdaccio/proxy
|
||||
|
||||
## 6.0.0-6-next.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [37274e4c]
|
||||
- @verdaccio/local-storage@11.0.0-6-next.14
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- @verdaccio/logger@6.0.0-6-next.12
|
||||
|
||||
## 6.0.0-6-next.21
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/proxy",
|
||||
"version": "6.0.0-6-next.21",
|
||||
"version": "6.0.0-6-next.22",
|
||||
"description": "verdaccio proxy fetcher",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -41,7 +41,7 @@
|
||||
"dependencies": {
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/local-storage": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/local-storage": "workspace:11.0.0-6-next.14",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
|
||||
"JSONStream": "1.3.5",
|
||||
@@ -52,8 +52,8 @@
|
||||
"undici": "4.16.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "16.11.47",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@types/node": "16.11.51",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"get-stream": "^6.0.1",
|
||||
"nock": "13.2.9",
|
||||
"node-mocks-http": "1.11.0",
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# @verdaccio/server
|
||||
|
||||
## 6.0.0-6-next.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [37274e4c]
|
||||
- @verdaccio/api@6.0.0-6-next.27
|
||||
- @verdaccio/store@6.0.0-6-next.24
|
||||
- @verdaccio/web@6.0.0-6-next.31
|
||||
- @verdaccio/auth@6.0.0-6-next.23
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- @verdaccio/loaders@6.0.0-6-next.13
|
||||
- @verdaccio/logger@6.0.0-6-next.12
|
||||
- verdaccio-audit@11.0.0-6-next.9
|
||||
|
||||
## 6.0.0-6-next.32
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/server",
|
||||
"version": "6.0.0-6-next.32",
|
||||
"version": "6.0.0-6-next.33",
|
||||
"description": "server logic",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -30,16 +30,16 @@
|
||||
"npm": ">=6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/api": "workspace:6.0.0-6-next.26",
|
||||
"@verdaccio/api": "workspace:6.0.0-6-next.27",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/loaders": "workspace:6.0.0-6-next.13",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/middleware": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.24",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/web": "workspace:6.0.0-6-next.30",
|
||||
"@verdaccio/web": "workspace:6.0.0-6-next.31",
|
||||
"verdaccio-audit": "workspace:11.0.0-6-next.9",
|
||||
"compression": "1.7.4",
|
||||
"cors": "2.8.5",
|
||||
@@ -49,9 +49,9 @@
|
||||
"lodash": "4.17.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "16.11.47",
|
||||
"@verdaccio/proxy": "workspace:6.0.0-6-next.21",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.1",
|
||||
"@types/node": "16.11.51",
|
||||
"@verdaccio/proxy": "workspace:6.0.0-6-next.22",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.2",
|
||||
"http-errors": "1.8.1"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,38 @@
|
||||
# @verdaccio/server-fastify
|
||||
|
||||
## 6.0.0-6-next.25
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 37274e4c: feat: implement abbreviated manifest
|
||||
|
||||
Enable abbreviated manifest data by adding the header:
|
||||
|
||||
```
|
||||
curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
|
||||
```
|
||||
|
||||
It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
|
||||
|
||||
Current support for packages managers:
|
||||
|
||||
- npm: yes
|
||||
- pnpm: yes
|
||||
- yarn classic: yes
|
||||
- yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
|
||||
|
||||
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [37274e4c]
|
||||
- @verdaccio/store@6.0.0-6-next.24
|
||||
- @verdaccio/auth@6.0.0-6-next.23
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- @verdaccio/readme@11.0.0-6-next.5
|
||||
- @verdaccio/tarball@11.0.0-6-next.13
|
||||
- @verdaccio/logger@6.0.0-6-next.12
|
||||
|
||||
## 6.0.0-6-next.24
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/server-fastify",
|
||||
"version": "6.0.0-6-next.24",
|
||||
"version": "6.0.0-6-next.25",
|
||||
"description": "fastify server api implementation",
|
||||
"keywords": [
|
||||
"private",
|
||||
@@ -38,19 +38,19 @@
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.24",
|
||||
"@verdaccio/tarball": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/readme": "workspace:11.0.0-6-next.5",
|
||||
"core-js": "3.24.1",
|
||||
"debug": "4.3.4",
|
||||
"fastify": "4.3.0",
|
||||
"fastify-plugin": "4.1.0",
|
||||
"fastify": "4.5.2",
|
||||
"fastify-plugin": "4.2.0",
|
||||
"lodash": "4.17.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "16.11.47",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@types/node": "16.11.51",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"ts-node": "10.9.1"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -16,6 +16,8 @@ async function manifestRoute(fastify: FastifyInstance) {
|
||||
const { name } = request.params;
|
||||
const storage = fastify.storage;
|
||||
debug('pkg name %s ', name);
|
||||
// @ts-ignore
|
||||
const abbreviated = request.headers['accept'] === Storage.ABBREVIATED_HEADER;
|
||||
const data = await storage?.getPackageByOptions({
|
||||
name,
|
||||
// @ts-ignore
|
||||
@@ -25,6 +27,7 @@ async function manifestRoute(fastify: FastifyInstance) {
|
||||
headers: request.headers as any,
|
||||
host: request.hostname,
|
||||
},
|
||||
abbreviated,
|
||||
});
|
||||
return data;
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@ import { FastifyInstance } from 'fastify';
|
||||
import _ from 'lodash';
|
||||
|
||||
import sanitizyReadme from '@verdaccio/readme';
|
||||
import { Manifest } from '@verdaccio/types';
|
||||
|
||||
const debug = buildDebug('verdaccio:fastify:web:readme');
|
||||
export const NOT_README_FOUND = 'ERROR: No README data found!';
|
||||
@@ -12,7 +13,7 @@ async function readmeRoute(fastify: FastifyInstance) {
|
||||
// @ts-ignore
|
||||
const { version, packageName } = request.params;
|
||||
debug('readme name %s version: %s', packageName, version);
|
||||
const manifest = await fastify.storage?.getPackageByOptions({
|
||||
const manifest = (await fastify.storage?.getPackageByOptions({
|
||||
name: packageName,
|
||||
// remove on refactor getPackageByOptions
|
||||
// @ts-ignore
|
||||
@@ -24,7 +25,7 @@ async function readmeRoute(fastify: FastifyInstance) {
|
||||
headers: request.headers as any,
|
||||
host: request.hostname,
|
||||
},
|
||||
});
|
||||
})) as Manifest;
|
||||
try {
|
||||
const parsedReadme = parseReadme(manifest.name, manifest.readme as string);
|
||||
reply.code(fastify.statusCode.OK).send(parsedReadme);
|
||||
@@ -37,7 +38,7 @@ async function readmeRoute(fastify: FastifyInstance) {
|
||||
// @ts-ignore
|
||||
const { version, packageName } = request.params;
|
||||
debug('readme name %s version: %s', packageName, version);
|
||||
const manifest = await fastify.storage?.getPackageByOptions({
|
||||
const manifest = (await fastify.storage?.getPackageByOptions({
|
||||
name: packageName,
|
||||
// remove on refactor getPackageByOptions
|
||||
// @ts-ignore
|
||||
@@ -49,7 +50,7 @@ async function readmeRoute(fastify: FastifyInstance) {
|
||||
headers: request.headers as any,
|
||||
host: request.hostname,
|
||||
},
|
||||
});
|
||||
})) as Manifest;
|
||||
try {
|
||||
const parsedReadme = parseReadme(manifest.name, manifest.readme as string);
|
||||
reply.code(fastify.statusCode.OK).send(parsedReadme);
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
"homepage": "https://verdaccio.org",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@verdaccio/cli": "workspace:6.0.0-6-next.35",
|
||||
"@verdaccio/cli": "workspace:6.0.0-6-next.36",
|
||||
"@verdaccio/ui-theme": "workspace:6.0.0-6-next.26",
|
||||
"fs-extra": "10.1.0",
|
||||
"webpack": "5.74.0",
|
||||
"webpack-bundle-analyzer": "4.5.0",
|
||||
"webpack-bundle-analyzer": "4.6.0",
|
||||
"webpack-bundle-size-analyzer": "3.1.0",
|
||||
"webpack-cli": "4.10.0"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,40 @@
|
||||
# @verdaccio/store
|
||||
|
||||
## 6.0.0-6-next.24
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 37274e4c: feat: implement abbreviated manifest
|
||||
|
||||
Enable abbreviated manifest data by adding the header:
|
||||
|
||||
```
|
||||
curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
|
||||
```
|
||||
|
||||
It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
|
||||
|
||||
Current support for packages managers:
|
||||
|
||||
- npm: yes
|
||||
- pnpm: yes
|
||||
- yarn classic: yes
|
||||
- yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
|
||||
|
||||
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [37274e4c]
|
||||
- @verdaccio/local-storage@11.0.0-6-next.14
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- @verdaccio/tarball@11.0.0-6-next.13
|
||||
- @verdaccio/url@11.0.0-6-next.10
|
||||
- @verdaccio/hooks@6.0.0-6-next.14
|
||||
- @verdaccio/loaders@6.0.0-6-next.13
|
||||
- @verdaccio/logger@6.0.0-6-next.12
|
||||
- @verdaccio/proxy@6.0.0-6-next.22
|
||||
|
||||
## 6.0.0-6-next.23
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -4,9 +4,9 @@ module.exports = Object.assign({}, config, {
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
// FIXME: increase to 90
|
||||
branches: 51,
|
||||
functions: 75,
|
||||
lines: 64,
|
||||
branches: 55,
|
||||
functions: 81,
|
||||
lines: 71,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/store",
|
||||
"version": "6.0.0-6-next.23",
|
||||
"version": "6.0.0-6-next.24",
|
||||
"description": "loaders logic",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -43,9 +43,9 @@
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/hooks": "workspace:6.0.0-6-next.14",
|
||||
"@verdaccio/loaders": "workspace:6.0.0-6-next.13",
|
||||
"@verdaccio/local-storage": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/local-storage": "workspace:11.0.0-6-next.14",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/proxy": "workspace:6.0.0-6-next.21",
|
||||
"@verdaccio/proxy": "workspace:6.0.0-6-next.22",
|
||||
"@verdaccio/url": "workspace:11.0.0-6-next.10",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/tarball": "workspace:11.0.0-6-next.13",
|
||||
@@ -56,9 +56,9 @@
|
||||
"semver": "7.3.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "16.11.47",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.1",
|
||||
"@types/node": "16.11.51",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.2",
|
||||
"undici": "4.16.0",
|
||||
"nock": "13.2.9",
|
||||
"node-mocks-http": "1.11.0",
|
||||
|
||||
@@ -256,7 +256,7 @@ export function hasInvalidPublishBody(manifest: Pick<Manifest, '_attachments' |
|
||||
*/
|
||||
export function mergeVersions(cacheManifest: Manifest, remoteManifest: Manifest): Manifest {
|
||||
let _cacheManifest = { ...cacheManifest };
|
||||
const { versions } = remoteManifest;
|
||||
const { versions, time } = remoteManifest;
|
||||
// copy new versions to a cache
|
||||
// NOTE: if a certain version was updated, we can't refresh it reliably
|
||||
for (const i in versions) {
|
||||
@@ -265,6 +265,12 @@ export function mergeVersions(cacheManifest: Manifest, remoteManifest: Manifest)
|
||||
}
|
||||
}
|
||||
|
||||
for (const i in time) {
|
||||
if (typeof cacheManifest.time[i] === 'undefined') {
|
||||
_cacheManifest.time[i] = time[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (const distTag in remoteManifest[DIST_TAGS]) {
|
||||
if (_cacheManifest[DIST_TAGS][distTag] !== remoteManifest[DIST_TAGS][distTag]) {
|
||||
if (
|
||||
|
||||
@@ -25,6 +25,8 @@ import {
|
||||
convertDistVersionToLocalTarballsUrl,
|
||||
} from '@verdaccio/tarball';
|
||||
import {
|
||||
AbbreviatedManifest,
|
||||
AbbreviatedVersions,
|
||||
Author,
|
||||
Config,
|
||||
DistFile,
|
||||
@@ -91,6 +93,9 @@ class Storage {
|
||||
debug('uplinks available %o', Object.keys(this.uplinks));
|
||||
}
|
||||
|
||||
static ABBREVIATED_HEADER =
|
||||
'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*';
|
||||
|
||||
/**
|
||||
* Change an existing package (i.e. unpublish one version)
|
||||
Function changes a package info from local storage and all uplinks with write access./
|
||||
@@ -523,17 +528,66 @@ class Storage {
|
||||
return convertedManifest;
|
||||
}
|
||||
|
||||
private convertAbbreviatedManifest(manifest: Manifest): AbbreviatedManifest {
|
||||
const abbreviatedVersions = Object.keys(manifest.versions).reduce(
|
||||
(acc: AbbreviatedVersions, version: string) => {
|
||||
const _version = manifest.versions[version];
|
||||
// This should be align with this document
|
||||
// https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-object
|
||||
const _version_abbreviated = {
|
||||
name: _version.name,
|
||||
version: _version.version,
|
||||
description: _version.description,
|
||||
deprecated: _version.deprecated,
|
||||
bin: _version.bin,
|
||||
dist: _version.dist,
|
||||
engines: _version.engines,
|
||||
funding: _version.funding,
|
||||
directories: _version.directories,
|
||||
dependencies: _version.dependencies,
|
||||
devDependencies: _version.devDependencies,
|
||||
peerDependencies: _version.peerDependencies,
|
||||
optionalDependencies: _version.optionalDependencies,
|
||||
bundleDependencies: _version.bundleDependencies,
|
||||
// npm cli specifics
|
||||
_hasShrinkwrap: _version._hasShrinkwrap,
|
||||
hasInstallScript: _version.hasInstallScript,
|
||||
};
|
||||
acc[version] = _version_abbreviated;
|
||||
return acc;
|
||||
},
|
||||
{}
|
||||
);
|
||||
const convertedManifest = {
|
||||
name: manifest['name'],
|
||||
[DIST_TAGS]: manifest[DIST_TAGS],
|
||||
versions: abbreviatedVersions,
|
||||
modified: manifest.time.modified,
|
||||
// NOTE: special case for pnpm https://github.com/pnpm/rfcs/pull/2
|
||||
time: manifest.time,
|
||||
};
|
||||
|
||||
return convertedManifest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a manifest or version based on the options.
|
||||
* @param options {Object}
|
||||
* @returns A package manifest or specific version
|
||||
*/
|
||||
public async getPackageByOptions(options: IGetPackageOptionsNext): Promise<Manifest | Version> {
|
||||
public async getPackageByOptions(
|
||||
options: IGetPackageOptionsNext
|
||||
): Promise<Manifest | AbbreviatedManifest | Version> {
|
||||
// if no version we return the whole manifest
|
||||
if (_.isNil(options.version) === false) {
|
||||
return this.getPackageByVersion(options);
|
||||
} else {
|
||||
return this.getPackageManifest(options);
|
||||
const manifest = await this.getPackageManifest(options);
|
||||
if (options.abbreviated === true) {
|
||||
debug('abbreviated manifest');
|
||||
return this.convertAbbreviatedManifest(manifest);
|
||||
}
|
||||
return manifest;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -596,7 +650,7 @@ class Storage {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the storage asyncronously.
|
||||
* Initialize the storage asynchronously.
|
||||
* @param config Config
|
||||
* @param filters IPluginFilters
|
||||
* @returns Storage instance
|
||||
@@ -1613,7 +1667,7 @@ class Storage {
|
||||
* @param options options
|
||||
* @returns Returns a promise that resolves with the merged manifest.
|
||||
*/
|
||||
public async mergeCacheRemoteMetadata(
|
||||
private async mergeCacheRemoteMetadata(
|
||||
uplink: IProxy,
|
||||
cachedManifest: Manifest,
|
||||
options: ISyncUplinksOptions
|
||||
@@ -1642,7 +1696,7 @@ class Storage {
|
||||
);
|
||||
|
||||
try {
|
||||
_cacheManifest = validatioUtils.normalizeMetadata(remoteManifest, _cacheManifest.name);
|
||||
_cacheManifest = validatioUtils.normalizeMetadata(_cacheManifest, _cacheManifest.name);
|
||||
} catch (err: any) {
|
||||
this.logger.error(
|
||||
{
|
||||
@@ -1657,7 +1711,7 @@ class Storage {
|
||||
// merge time field cache and remote
|
||||
_cacheManifest = mergeUplinkTimeIntoLocalNext(_cacheManifest, remoteManifest);
|
||||
// update the _uplinks field in the cache
|
||||
_cacheManifest = updateVersionsHiddenUpLinkNext(cachedManifest, uplink);
|
||||
_cacheManifest = updateVersionsHiddenUpLinkNext(_cacheManifest, uplink);
|
||||
try {
|
||||
// merge versions from remote into the cache
|
||||
_cacheManifest = mergeVersions(_cacheManifest, remoteManifest);
|
||||
@@ -1667,7 +1721,7 @@ class Storage {
|
||||
{
|
||||
err: err,
|
||||
},
|
||||
'package.json mergin has failed @{!err?.message}\n@{err.stack}'
|
||||
'package.json merge has failed @{!err?.message}\n@{err.stack}'
|
||||
);
|
||||
throw err;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,12 @@ export type IGetPackageOptionsNext = {
|
||||
* internally indicates to avoid any cache layer.
|
||||
*/
|
||||
byPassCache?: boolean;
|
||||
|
||||
/**
|
||||
* Reduce the package metadata to the minimum required to get the package.
|
||||
* https://github.com/npm/registry/blob/c0b573593fb5d6e0268de7d6612addd7059cb779/docs/responses/package-metadata.md#package-metadata
|
||||
*/
|
||||
abbreviated?: boolean;
|
||||
};
|
||||
|
||||
// @deprecate remove this type
|
||||
|
||||
@@ -11,16 +11,17 @@ import { API_ERROR, DIST_TAGS, HEADERS, HEADER_TYPE, errorUtils, fileUtils } fro
|
||||
import { setup } from '@verdaccio/logger';
|
||||
import {
|
||||
addNewVersion,
|
||||
generateLocalPackageMetadata,
|
||||
generatePackageMetadata,
|
||||
generateRemotePackageMetadata,
|
||||
} from '@verdaccio/test-helper';
|
||||
import { Manifest, Version } from '@verdaccio/types';
|
||||
import { AbbreviatedManifest, Manifest, Version } from '@verdaccio/types';
|
||||
|
||||
import { Storage } from '../src';
|
||||
import manifestFooRemoteNpmjs from './fixtures/manifests/foo-npmjs.json';
|
||||
import { configExample } from './helpers';
|
||||
|
||||
function generateRamdonStorage() {
|
||||
function generateRandomStorage() {
|
||||
const tempStorage = pseudoRandomBytes(5).toString('hex');
|
||||
const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), '/verdaccio-test'));
|
||||
|
||||
@@ -29,7 +30,7 @@ function generateRamdonStorage() {
|
||||
|
||||
setup({ type: 'stdout', format: 'pretty', level: 'trace' });
|
||||
|
||||
const domain = 'http://localhost:4873';
|
||||
const domain = 'https://registry.npmjs.org';
|
||||
const fakeHost = 'localhost:4873';
|
||||
const fooManifest = generatePackageMetadata('foo', '1.0.0');
|
||||
|
||||
@@ -40,23 +41,6 @@ describe('storage', () => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
// describe('add packages', () => {
|
||||
// test('add package item', async () => {
|
||||
// nock(domain).get('/foo').reply(404);
|
||||
// const config = new Config(
|
||||
// configExample({
|
||||
// storage: generateRamdonStorage(),
|
||||
// })
|
||||
// );
|
||||
// const storage = new Storage(config);
|
||||
// await storage.init(config);
|
||||
|
||||
// await storage.addPackage('foo', fooManifest, (err) => {
|
||||
// expect(err).toBeNull();
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
|
||||
describe('updateManifest', () => {
|
||||
test('create private package', async () => {
|
||||
const mockDate = '2018-01-14T11:17:40.712Z';
|
||||
@@ -71,7 +55,7 @@ describe('storage', () => {
|
||||
configExample(
|
||||
{
|
||||
...getDefaultConfig(),
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/updateManifest-1.yaml',
|
||||
__dirname
|
||||
@@ -114,7 +98,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/updateManifest-1.yaml',
|
||||
__dirname
|
||||
@@ -155,7 +139,7 @@ describe('storage', () => {
|
||||
},
|
||||
};
|
||||
const pkgName = 'upstream';
|
||||
// const storage = generateRamdonStorage();
|
||||
// const storage = generateRandomStorage();
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
@@ -246,7 +230,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/getTarballNext-getupstream.yaml',
|
||||
__dirname
|
||||
@@ -276,7 +260,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const storage = new Storage(config);
|
||||
@@ -313,7 +297,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/getTarballNext-getupstream.yaml',
|
||||
__dirname
|
||||
@@ -357,7 +341,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/getTarballNext-getupstream.yaml',
|
||||
__dirname
|
||||
@@ -417,7 +401,7 @@ describe('storage', () => {
|
||||
.replyWithFile(201, path.join(__dirname, 'fixtures/tarball.tgz'), {
|
||||
[HEADER_TYPE.CONTENT_LENGTH]: 277,
|
||||
});
|
||||
const storagePath = generateRamdonStorage();
|
||||
const storagePath = generateRandomStorage();
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
@@ -474,7 +458,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/getTarballNext-getupstream.yaml',
|
||||
__dirname
|
||||
@@ -532,7 +516,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/syncDoubleUplinksMetadata.yaml',
|
||||
__dirname
|
||||
@@ -562,7 +546,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/syncSingleUplinksMetadata.yaml',
|
||||
__dirname
|
||||
@@ -583,7 +567,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/syncSingleUplinksMetadata.yaml',
|
||||
__dirname
|
||||
@@ -600,12 +584,12 @@ describe('storage', () => {
|
||||
|
||||
describe('success scenarios', () => {
|
||||
test('should handle one proxy success', async () => {
|
||||
const fooManifest = generatePackageMetadata('foo', '8.0.0');
|
||||
const fooManifest = generateLocalPackageMetadata('foo', '8.0.0');
|
||||
nock('https://registry.verdaccio.org').get('/foo').reply(201, manifestFooRemoteNpmjs);
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/syncSingleUplinksMetadata.yaml',
|
||||
__dirname
|
||||
@@ -617,7 +601,28 @@ describe('storage', () => {
|
||||
const [response] = await storage.syncUplinksMetadataNext(fooManifest.name, fooManifest);
|
||||
expect(response).not.toBeNull();
|
||||
expect((response as Manifest).name).toEqual(fooManifest.name);
|
||||
expect(Object.keys((response as Manifest).versions)).toEqual([
|
||||
'8.0.0',
|
||||
'1.0.0',
|
||||
'0.0.3',
|
||||
'0.0.4',
|
||||
'0.0.5',
|
||||
'0.0.6',
|
||||
'0.0.7',
|
||||
]);
|
||||
expect(Object.keys((response as Manifest).time)).toEqual([
|
||||
'modified',
|
||||
'created',
|
||||
'8.0.0',
|
||||
'1.0.0',
|
||||
'0.0.3',
|
||||
'0.0.4',
|
||||
'0.0.5',
|
||||
'0.0.6',
|
||||
'0.0.7',
|
||||
]);
|
||||
expect((response as Manifest)[DIST_TAGS].latest).toEqual('8.0.0');
|
||||
expect((response as Manifest).time['8.0.0']).toBeDefined();
|
||||
});
|
||||
|
||||
test('should handle one proxy success with no local cache manifest', async () => {
|
||||
@@ -625,7 +630,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/syncSingleUplinksMetadata.yaml',
|
||||
__dirname
|
||||
@@ -647,7 +652,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/syncNoUplinksMetadata.yaml',
|
||||
__dirname
|
||||
@@ -670,7 +675,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample(
|
||||
{
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
},
|
||||
'./fixtures/config/syncSingleUplinksMetadata.yaml',
|
||||
__dirname
|
||||
@@ -689,7 +694,184 @@ describe('storage', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// TODO: getPackageNext should replace getPackage eventually
|
||||
describe('getLocalDatabaseNext', () => {
|
||||
test('should return 0 local packages', async () => {
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const storage = new Storage(config);
|
||||
await storage.init(config);
|
||||
await expect(storage.getLocalDatabaseNext()).resolves.toHaveLength(0);
|
||||
});
|
||||
|
||||
test('should return 1 local packages', async () => {
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const req = httpMocks.createRequest({
|
||||
method: 'GET',
|
||||
connection: { remoteAddress: fakeHost },
|
||||
headers: {
|
||||
host: 'host',
|
||||
},
|
||||
url: '/',
|
||||
});
|
||||
const storage = new Storage(config);
|
||||
await storage.init(config);
|
||||
const manifest = generatePackageMetadata('foo');
|
||||
const ac = new AbortController();
|
||||
await storage.updateManifest(manifest, {
|
||||
signal: ac.signal,
|
||||
name: 'foo',
|
||||
uplinksLook: false,
|
||||
requestOptions: {
|
||||
headers: req.headers as any,
|
||||
protocol: req.protocol,
|
||||
host: req.get('host') as string,
|
||||
},
|
||||
});
|
||||
const response = await storage.getLocalDatabaseNext();
|
||||
expect(response).toHaveLength(1);
|
||||
expect(response[0]).toEqual(expect.objectContaining({ name: 'foo', version: '1.0.0' }));
|
||||
});
|
||||
});
|
||||
|
||||
describe('tokens', () => {
|
||||
describe('saveToken', () => {
|
||||
test('should retrieve tokens created', async () => {
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const storage = new Storage(config);
|
||||
await storage.init(config);
|
||||
await storage.saveToken({
|
||||
user: 'foo',
|
||||
token: 'secret',
|
||||
key: 'key',
|
||||
created: 'created',
|
||||
readonly: true,
|
||||
});
|
||||
const tokens = await storage.readTokens({ user: 'foo' });
|
||||
expect(tokens).toEqual([
|
||||
{ user: 'foo', token: 'secret', key: 'key', readonly: true, created: 'created' },
|
||||
]);
|
||||
});
|
||||
|
||||
test('should delete a token created', async () => {
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const storage = new Storage(config);
|
||||
await storage.init(config);
|
||||
await storage.saveToken({
|
||||
user: 'foo',
|
||||
token: 'secret',
|
||||
key: 'key',
|
||||
created: 'created',
|
||||
readonly: true,
|
||||
});
|
||||
const tokens = await storage.readTokens({ user: 'foo' });
|
||||
expect(tokens).toHaveLength(1);
|
||||
await storage.deleteToken('foo', 'key');
|
||||
const tokens2 = await storage.readTokens({ user: 'foo' });
|
||||
expect(tokens2).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('removeTarball', () => {
|
||||
test('should fail on remove tarball of package does not exist', async () => {
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const storage = new Storage(config);
|
||||
await storage.init(config);
|
||||
await expect(storage.removeTarball('foo', 'foo-1.0.0.tgz', 'rev')).rejects.toThrow(
|
||||
API_ERROR.NO_PACKAGE
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('removePackage', () => {
|
||||
test('should remove entirely a package', async () => {
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const req = httpMocks.createRequest({
|
||||
method: 'GET',
|
||||
connection: { remoteAddress: fakeHost },
|
||||
headers: {
|
||||
host: fakeHost,
|
||||
[HEADERS.FORWARDED_PROTO]: 'http',
|
||||
},
|
||||
url: '/',
|
||||
});
|
||||
const storage = new Storage(config);
|
||||
await storage.init(config);
|
||||
|
||||
const manifest = generatePackageMetadata('foo');
|
||||
const ac = new AbortController();
|
||||
// 1. publish a package
|
||||
await storage.updateManifest(manifest, {
|
||||
signal: ac.signal,
|
||||
name: 'foo',
|
||||
uplinksLook: false,
|
||||
requestOptions: {
|
||||
headers: req.headers as any,
|
||||
protocol: req.protocol,
|
||||
host: req.get('host') as string,
|
||||
},
|
||||
});
|
||||
// 2. request package (should be available in the local cache)
|
||||
const manifest1 = (await storage.getPackageByOptions({
|
||||
name: 'foo',
|
||||
uplinksLook: false,
|
||||
requestOptions: {
|
||||
headers: req.headers as any,
|
||||
protocol: req.protocol,
|
||||
host: req.get('host') as string,
|
||||
},
|
||||
})) as Manifest;
|
||||
const _rev = manifest1._rev;
|
||||
// 3. remove the tarball
|
||||
await expect(
|
||||
storage.removeTarball(manifest1.name, 'foo-1.0.0.tgz', _rev)
|
||||
).resolves.toBeDefined();
|
||||
// 4. remove the package
|
||||
await storage.removePackage(manifest1.name, _rev);
|
||||
// 5. fails if package does not exist anymore in storage
|
||||
await expect(
|
||||
storage.getPackageByOptions({
|
||||
name: 'foo',
|
||||
uplinksLook: false,
|
||||
requestOptions: {
|
||||
headers: req.headers as any,
|
||||
protocol: req.protocol,
|
||||
host: req.get('host') as string,
|
||||
},
|
||||
})
|
||||
).rejects.toThrowError('package does not exist on uplink: foo');
|
||||
});
|
||||
});
|
||||
|
||||
describe('get packages getPackageByOptions()', () => {
|
||||
describe('with uplinks', () => {
|
||||
test('should get 201 and merge from uplink', async () => {
|
||||
@@ -697,7 +879,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const req = httpMocks.createRequest({
|
||||
@@ -729,7 +911,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const req = httpMocks.createRequest({
|
||||
@@ -762,7 +944,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const req = httpMocks.createRequest({
|
||||
@@ -795,7 +977,7 @@ describe('storage', () => {
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const req = httpMocks.createRequest({
|
||||
@@ -835,7 +1017,7 @@ describe('storage', () => {
|
||||
url: domain,
|
||||
},
|
||||
},
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const req = httpMocks.createRequest({
|
||||
@@ -875,7 +1057,7 @@ describe('storage', () => {
|
||||
url: domain,
|
||||
},
|
||||
},
|
||||
storage: generateRamdonStorage(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const req = httpMocks.createRequest({
|
||||
@@ -902,6 +1084,72 @@ describe('storage', () => {
|
||||
})
|
||||
).rejects.toThrow(errorUtils.getServiceUnavailable('ETIMEDOUT'));
|
||||
});
|
||||
|
||||
test('should fetch abbreviated version of manifest ', async () => {
|
||||
const fooManifest = generateLocalPackageMetadata('foo', '1.0.0');
|
||||
nock(domain).get('/foo').reply(201, fooManifest);
|
||||
const config = new Config(
|
||||
configExample({
|
||||
...getDefaultConfig(),
|
||||
storage: generateRandomStorage(),
|
||||
})
|
||||
);
|
||||
const req = httpMocks.createRequest({
|
||||
method: 'GET',
|
||||
connection: { remoteAddress: fakeHost },
|
||||
headers: {
|
||||
host: fakeHost,
|
||||
[HEADERS.FORWARDED_PROTO]: 'http',
|
||||
},
|
||||
url: '/',
|
||||
});
|
||||
const storage = new Storage(config);
|
||||
await storage.init(config);
|
||||
|
||||
const manifest = (await storage.getPackageByOptions({
|
||||
name: 'foo',
|
||||
uplinksLook: true,
|
||||
requestOptions: {
|
||||
headers: req.headers as any,
|
||||
protocol: req.protocol,
|
||||
host: req.get('host') as string,
|
||||
},
|
||||
abbreviated: true,
|
||||
})) as AbbreviatedManifest;
|
||||
const { versions, name } = manifest;
|
||||
expect(name).toEqual('foo');
|
||||
expect(Object.keys(versions)).toEqual(['1.0.0']);
|
||||
expect(manifest[DIST_TAGS]).toEqual({ latest: '1.0.0' });
|
||||
const version = versions['1.0.0'];
|
||||
expect(Object.keys(version)).toEqual([
|
||||
'name',
|
||||
'version',
|
||||
'description',
|
||||
'deprecated',
|
||||
'bin',
|
||||
'dist',
|
||||
'engines',
|
||||
'funding',
|
||||
'directories',
|
||||
'dependencies',
|
||||
'devDependencies',
|
||||
'peerDependencies',
|
||||
'optionalDependencies',
|
||||
'bundleDependencies',
|
||||
'_hasShrinkwrap',
|
||||
'hasInstallScript',
|
||||
]);
|
||||
expect(manifest.modified).toBeDefined();
|
||||
// special case for pnpm/rfcs/pull/2
|
||||
expect(manifest.time).toBeDefined();
|
||||
// fields must not have
|
||||
// @ts-expect-error
|
||||
expect(manifest.readme).not.toBeDefined();
|
||||
// @ts-expect-error
|
||||
expect(manifest._attachments).not.toBeDefined();
|
||||
// @ts-expect-error
|
||||
expect(manifest._rev).not.toBeDefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -31,7 +31,10 @@ export default function contributorsPlugin(
|
||||
const contributorsFilesName = pathFileName || join(__dirname, 'contributors.json');
|
||||
try {
|
||||
content = JSON.parse(readFileSync(contributorsFilesName, 'utf8'));
|
||||
return content;
|
||||
return {
|
||||
contributors: content.contributors,
|
||||
repositories: content.repositories,
|
||||
};
|
||||
} catch (error) {
|
||||
console.log('error', error);
|
||||
return { error: true };
|
||||
@@ -47,7 +50,7 @@ export default function contributorsPlugin(
|
||||
path: normalizeUrl([baseUrl, 'contributors']),
|
||||
component: '@site/src/components/Contributors.tsx',
|
||||
modules: {
|
||||
contributors: contributorsJsonPath,
|
||||
data: contributorsJsonPath,
|
||||
},
|
||||
exact: true,
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
"eslint-plugin-babel": "5.3.1",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"eslint-plugin-jest": "26.8.0",
|
||||
"eslint-plugin-jest": "26.8.4",
|
||||
"eslint-plugin-jsx-a11y": "6.6.1",
|
||||
"eslint-plugin-prettier": "4.2.1",
|
||||
"eslint-plugin-react": "7.30.1",
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# Change Log
|
||||
|
||||
## 1.1.0-6-next.2
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 37274e4c: feat: implement abbreviated manifest
|
||||
|
||||
Enable abbreviated manifest data by adding the header:
|
||||
|
||||
```
|
||||
curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
|
||||
```
|
||||
|
||||
It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
|
||||
|
||||
Current support for packages managers:
|
||||
|
||||
- npm: yes
|
||||
- pnpm: yes
|
||||
- yarn classic: yes
|
||||
- yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
|
||||
|
||||
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
|
||||
|
||||
## 1.1.0-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/test-helper",
|
||||
"version": "1.1.0-6-next.1",
|
||||
"version": "1.1.0-6-next.2",
|
||||
"private": true,
|
||||
"description": "test helpers",
|
||||
"author": "Juan Picado <juanpicado19@gmail.com>",
|
||||
@@ -9,7 +9,7 @@
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Manifest } from '@verdaccio/types';
|
||||
import { GenericBody, Manifest } from '@verdaccio/types';
|
||||
|
||||
export interface DistTags {
|
||||
[key: string]: string;
|
||||
@@ -73,7 +73,8 @@ export function addNewVersion(
|
||||
export function generateLocalPackageMetadata(
|
||||
pkgName: string,
|
||||
version = '1.0.0',
|
||||
domain: string = 'http://localhost:5555'
|
||||
domain: string = 'http://localhost:5555',
|
||||
time?: GenericBody
|
||||
): Manifest {
|
||||
// @ts-ignore
|
||||
return {
|
||||
@@ -115,6 +116,11 @@ export function generateLocalPackageMetadata(
|
||||
},
|
||||
},
|
||||
},
|
||||
time: time ?? {
|
||||
modified: new Date().toISOString(),
|
||||
created: new Date().toISOString(),
|
||||
[version]: new Date().toISOString(),
|
||||
},
|
||||
readme: '# test',
|
||||
_attachments: {
|
||||
[`${getTarball(pkgName)}-${version}.tgz`]: {
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# verdaccio
|
||||
|
||||
## 6.0.0-6-next.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/hooks@6.0.0-6-next.14
|
||||
- @verdaccio/logger@6.0.0-6-next.12
|
||||
- @verdaccio/node-api@6.0.0-6-next.34
|
||||
- verdaccio-audit@11.0.0-6-next.9
|
||||
- verdaccio-htpasswd@11.0.0-6-next.14
|
||||
- @verdaccio/ui-theme@6.0.0-6-next.26
|
||||
- @verdaccio/cli@6.0.0-6-next.36
|
||||
|
||||
## 6.0.0-6-next.42
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "verdaccio",
|
||||
"version": "6.0.0-6-next.42",
|
||||
"version": "6.0.0-6-next.43",
|
||||
"description": "A lightweight private npm proxy registry",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -37,10 +37,10 @@
|
||||
},
|
||||
"homepage": "https://verdaccio.org",
|
||||
"dependencies": {
|
||||
"@verdaccio/cli": "workspace:6.0.0-6-next.35",
|
||||
"@verdaccio/cli": "workspace:6.0.0-6-next.36",
|
||||
"@verdaccio/hooks": "workspace:6.0.0-6-next.14",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.33",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.34",
|
||||
"@verdaccio/ui-theme": "workspace:6.0.0-6-next.26",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
|
||||
"verdaccio-audit": "workspace:11.0.0-6-next.9",
|
||||
@@ -50,9 +50,9 @@
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.1",
|
||||
"fastify": "4.3.0",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.24",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.2",
|
||||
"fastify": "4.5.2",
|
||||
"yaml": "2.1.1",
|
||||
"got": "11.8.5",
|
||||
"lodash": "4.17.21",
|
||||
|
||||
@@ -1,5 +1,40 @@
|
||||
# @verdaccio/web
|
||||
|
||||
## 6.0.0-6-next.31
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 37274e4c: feat: implement abbreviated manifest
|
||||
|
||||
Enable abbreviated manifest data by adding the header:
|
||||
|
||||
```
|
||||
curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
|
||||
```
|
||||
|
||||
It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
|
||||
|
||||
Current support for packages managers:
|
||||
|
||||
- npm: yes
|
||||
- pnpm: yes
|
||||
- yarn classic: yes
|
||||
- yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
|
||||
|
||||
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [37274e4c]
|
||||
- @verdaccio/store@6.0.0-6-next.24
|
||||
- @verdaccio/auth@6.0.0-6-next.23
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- @verdaccio/readme@11.0.0-6-next.5
|
||||
- @verdaccio/tarball@11.0.0-6-next.13
|
||||
- @verdaccio/url@11.0.0-6-next.10
|
||||
- @verdaccio/loaders@6.0.0-6-next.13
|
||||
- @verdaccio/logger@6.0.0-6-next.12
|
||||
|
||||
## 6.0.0-6-next.30
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/web",
|
||||
"version": "6.0.0-6-next.30",
|
||||
"version": "6.0.0-6-next.31",
|
||||
"description": "web ui middleware",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -32,7 +32,7 @@
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/middleware": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/readme": "workspace:11.0.0-6-next.5",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.23",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.24",
|
||||
"@verdaccio/tarball": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/url": "workspace:11.0.0-6-next.10",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
|
||||
@@ -43,10 +43,10 @@
|
||||
"lru-cache": "6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "16.11.47",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.13",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.1",
|
||||
"@verdaccio/api": "workspace:6.0.0-6-next.26",
|
||||
"@types/node": "16.11.51",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.14",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.2",
|
||||
"@verdaccio/api": "workspace:6.0.0-6-next.27",
|
||||
"node-html-parser": "4.1.5",
|
||||
"supertest": "6.2.4",
|
||||
"nock": "13.2.9",
|
||||
|
||||
@@ -75,7 +75,7 @@ function addPackageWebApi(storage: Storage, auth: IAuth, config: Config): Router
|
||||
}
|
||||
} catch (err: any) {
|
||||
debug('process packages error %o', err);
|
||||
logger.logger.error(
|
||||
logger.error(
|
||||
{ name: pkg.name, error: err },
|
||||
'permission process for @{name} has failed: @{error}'
|
||||
);
|
||||
|
||||
@@ -45,11 +45,12 @@ function addReadmeWebApi(storage: Storage, auth: IAuth): Router {
|
||||
remoteAddress: req.socket.remoteAddress,
|
||||
};
|
||||
try {
|
||||
const manifest = await storage.getPackageByOptions({
|
||||
const manifest = (await storage.getPackageByOptions({
|
||||
name,
|
||||
uplinksLook: true,
|
||||
abbreviated: false,
|
||||
requestOptions,
|
||||
});
|
||||
})) as Manifest;
|
||||
debug('readme pkg %o', manifest?.name);
|
||||
res.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.TEXT_PLAIN_UTF8);
|
||||
try {
|
||||
|
||||
1956
pnpm-lock.yaml
generated
1956
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -2,15 +2,35 @@
|
||||
"extends": ["config:base", "schedule:earlyMondays", "helpers:pinGitHubActionDigests"],
|
||||
"prConcurrentLimit": 1,
|
||||
"ignorePaths": ["docker-examples/**"],
|
||||
"ignoreDeps": ["eslint-plugin-verdaccio", "@verdaccio/test-helper"],
|
||||
"ignoreDeps": [
|
||||
"eslint-plugin-verdaccio",
|
||||
"@verdaccio/test-helper",
|
||||
"docker/setup-buildx-action",
|
||||
"docker/login-action",
|
||||
"docker/build-push-action",
|
||||
"crazy-max/ghaction-docker-meta",
|
||||
"pnpm"
|
||||
],
|
||||
"baseBranches": ["master", "5.x"],
|
||||
"major": true,
|
||||
"major": false,
|
||||
"labels": ["bot: dependencies"],
|
||||
"packageRules": [
|
||||
{
|
||||
"packageNames": ["aws-sdk"],
|
||||
"allowedVersions": "2.607.0"
|
||||
},
|
||||
{
|
||||
"packageNames": ["got"],
|
||||
"allowedVersions": "^11.8.5"
|
||||
},
|
||||
{
|
||||
"packageNames": ["globby"],
|
||||
"allowedVersions": "^12.2.0"
|
||||
},
|
||||
{
|
||||
"packageNames": ["get-port"],
|
||||
"allowedVersions": "^5.1.1"
|
||||
},
|
||||
{
|
||||
"packageNames": ["@google-cloud/datastore"],
|
||||
"allowedVersions": "4.5.0"
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
# @verdaccio/test-cli-commons
|
||||
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [37274e4c]
|
||||
- @verdaccio/test-helper@1.1.0-6-next.2
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- verdaccio@6.0.0-6-next.43
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [292c0a37]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/test-cli-commons",
|
||||
"version": "1.0.1-6-next.0",
|
||||
"version": "1.0.1-6-next.1",
|
||||
"main": "./build/index.js",
|
||||
"types": "./build/index.d.ts",
|
||||
"dependencies": {
|
||||
@@ -12,10 +12,10 @@
|
||||
"fs-extra": "10.1.0",
|
||||
"semver": "7.3.7",
|
||||
"got": "11.8.5",
|
||||
"verdaccio": "workspace:6.0.0-6-next.42",
|
||||
"verdaccio": "workspace:6.0.0-6-next.43",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.1"
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.2"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest",
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# @verdaccio/e2e-cli-npm6
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/e2e-cli-npm6",
|
||||
"version": "1.0.1-6-next.0",
|
||||
"version": "1.0.1-6-next.1",
|
||||
"dependencies": {
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.0",
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.1",
|
||||
"npm": "latest-6"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# @verdaccio/e2e-cli-npm7
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/e2e-cli-npm7",
|
||||
"version": "1.0.1-6-next.0",
|
||||
"version": "1.0.1-6-next.1",
|
||||
"dependencies": {
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.0",
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.1",
|
||||
"npm": "latest-7"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# @verdaccio/e2e-cli-npm8
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/e2e-cli-npm8",
|
||||
"version": "1.0.1-6-next.0",
|
||||
"version": "1.0.1-6-next.1",
|
||||
"dependencies": {
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.0",
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.1",
|
||||
"npm": "next-8"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# @verdaccio/e2e-cli-pnpm6
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/e2e-cli-pnpm6",
|
||||
"version": "1.0.1-6-next.0",
|
||||
"version": "1.0.1-6-next.1",
|
||||
"dependencies": {
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.0",
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.1",
|
||||
"pnpm": "latest-6"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# @verdaccio/e2e-cli-pnpm7
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/e2e-cli-pnpm7",
|
||||
"version": "1.0.1-6-next.0",
|
||||
"version": "1.0.1-6-next.1",
|
||||
"dependencies": {
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.0",
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.1",
|
||||
"pnpm": "next-7"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# @verdaccio/e2e-cli-yarn1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/e2e-cli-yarn1",
|
||||
"version": "1.0.1-6-next.0",
|
||||
"version": "1.0.1-6-next.1",
|
||||
"dependencies": {
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.0",
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.1",
|
||||
"yarn": "1.22.19"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# @verdaccio/e2e-cli-yarn2
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/e2e-cli-yarn2",
|
||||
"version": "1.0.1-6-next.0",
|
||||
"version": "1.0.1-6-next.1",
|
||||
"dependencies": {
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.0",
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.1",
|
||||
"@yarnpkg/cli-dist": "2.4.2"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# @verdaccio/e2e-cli-yarn3
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/e2e-cli-yarn3",
|
||||
"version": "1.0.1-6-next.0",
|
||||
"version": "1.0.1-6-next.1",
|
||||
"dependencies": {
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.0",
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.1",
|
||||
"@yarnpkg/cli-dist": "3.2.2"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# @verdaccio/e2e-cli-yarn4
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/e2e-cli-yarn4",
|
||||
"version": "1.0.1-6-next.0",
|
||||
"version": "1.0.1-6-next.1",
|
||||
"dependencies": {
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.0"
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest"
|
||||
|
||||
@@ -13,9 +13,10 @@ verdaccio --listen 4000 --config ~./config.yaml
|
||||
|
||||
Command | Default | Example | Description
|
||||
--- | --- | --- | ---
|
||||
--listen \ **-l** | 4873 | -p 7000 | http port
|
||||
--config \ **-c** | ~/.local/verdaccio/config.yaml | ~./config.yaml | the configuration file
|
||||
--info \ **-i** | | | prints local environment information
|
||||
--listen \ **-l** | http:localhost:4873 | 7000 | Define protocol + host + port ([formats](https://github.com/verdaccio/verdaccio/blob/08c36e688e8635733f92080eb3598239d43259cb/packages/node-api/src/cli-utils.ts#L7-L16))
|
||||
--config \ **-c** | ~/.local/verdaccio/config.yaml | ~./config.yaml | Set location of the configuration file
|
||||
--info \ **-i** | | | Print local environment information
|
||||
--version \ **-v** | | | Show version information
|
||||
|
||||
## Default config file location {#default-config-file-location}
|
||||
|
||||
|
||||
@@ -108,21 +108,26 @@ If you want to make the directory accessible only to a specific container, use `
|
||||
An alternative solution is to use [z and Z flags](https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label). To add the `z` flag to the mountpoint `./conf:/verdaccio/conf` simply change it to `./conf:/verdaccio/conf:z`. The `z` flag relabels the directory and makes it accessible by every container while the `Z` flags relables the directory and makes it accessible only to that specific container. However using these flags is dangerous. A small configuration mistake, like mounting `/home/user` or `/var` can mess up the labels on those directories and make the system unbootable.
|
||||
|
||||
### Plugins {#plugins}
|
||||
|
||||
Plugins can be installed in a separate directory and mounted using Docker or Kubernetes, however make sure you build plugins with native dependencies using the same base image as the Verdaccio Dockerfile.
|
||||
|
||||
```docker
|
||||
FROM verdaccio/verdaccio
|
||||
|
||||
USER root
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
RUN npm i && npm install verdaccio-s3-storage
|
||||
|
||||
USER verdaccio
|
||||
FROM node:lts-alpine as builder
|
||||
RUN mkdir -p /verdaccio/plugins \
|
||||
&& cd /verdaccio/plugins \
|
||||
&& npm install --global-style --no-bin-links --omit=optional verdaccio-auth-memory@latest
|
||||
FROM verdaccio/verdaccio:5
|
||||
ADD docker.yaml /verdaccio/conf/config.yaml
|
||||
COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
|
||||
/verdaccio/plugins/node_modules/verdaccio-auth-memory \
|
||||
/verdaccio/plugins/verdaccio-auth-memory
|
||||
```
|
||||
|
||||
For more information check real plugin examples with Docker in our [source code](https://github.com/verdaccio/verdaccio/tree/master/docker-examples/v5/plugins).
|
||||
|
||||
|
||||
### Docker and custom port configuration {#docker-and-custom-port-configuration}
|
||||
|
||||
Any `host:port` configured in `conf/config.yaml` under `listen` **is currently ignored when using docker**.
|
||||
|
||||
If you want to reach Verdaccio docker instance under different port, lets say `5000`
|
||||
@@ -137,6 +142,7 @@ V_PATH=/path/for/verdaccio; docker run -it --rm --name verdaccio \
|
||||
Of course the numbers you give to the `-p` parameter need to match.
|
||||
|
||||
### Using HTTPS with Docker {#using-https-with-docker}
|
||||
|
||||
You can configure the protocol verdaccio is going to listen on, similarly to the port configuration.
|
||||
You have to overwrite the default value("http") of the `PROTOCOL` environment variable to "https", after you specified the certificates in the config.yaml.
|
||||
|
||||
@@ -198,6 +204,7 @@ $ docker volume inspect verdaccio_verdaccio
|
||||
|
||||
## Build your own Docker image {#build-your-own-docker-image}
|
||||
|
||||
|
||||
```bash
|
||||
docker build -t verdaccio .
|
||||
```
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
id: google-cloud
|
||||
title: "Google Cloud"
|
||||
---
|
||||
|
||||
dsadsa
|
||||
@@ -23,7 +23,7 @@ Are you still using **Verdaccio 4**?. Check the [migration guide](https://verdac
|
||||
|
||||
Learn the basics before getting started, how to install, where is the location of the configuration file and more.
|
||||
|
||||
<iframe width="560" height="415" src="https://www.youtube.com/embed/P_hxy7W-IL4?enablejsapi=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
<iframe width="560" height="515" src="https://www.youtube.com/embed/hDIFKzmoCaA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
|
||||
## Installing the CLI {#installing-the-cli}
|
||||
|
||||
@@ -34,7 +34,7 @@ Learn the basics before getting started, how to install, where is the location o
|
||||
Using `npm`
|
||||
|
||||
```bash
|
||||
npm install -g verdaccio
|
||||
npm install --location=global verdaccio
|
||||
```
|
||||
|
||||
or using `yarn`
|
||||
@@ -51,6 +51,22 @@ pnpm install -g verdaccio
|
||||
|
||||

|
||||
|
||||
### Next major release (verdaccio 6 alpha) {#next-major-release}
|
||||
|
||||
Next [major release is under development](https://github.com/verdaccio/verdaccio/discussions/2970), byt can try it out already, either for testing purposes or helping to catch any possible bug, if you find something report it under the label [6.x bugs](https://github.com/verdaccio/verdaccio/labels/6.x%20bugs).
|
||||
|
||||
```bash
|
||||
npm install --location=global verdaccio@6-next
|
||||
```
|
||||
|
||||
or with the docker image
|
||||
|
||||
```bash
|
||||
docker pull verdaccio/verdaccio:nightly-master
|
||||
```
|
||||
|
||||
> The docker image `verdaccio/verdaccio:nightly-master` is alinged with the latest commits in master branch, while the npmjs version has a longer release cycle. **It is highly recommended don't use alpha versions for production**.
|
||||
|
||||
## Basic Usage {#basic-usage}
|
||||
|
||||
Once it has been installed, you only need to execute the CLI command:
|
||||
|
||||
@@ -5,9 +5,10 @@ title: "What is Verdaccio?"
|
||||
|
||||
Verdaccio is a **lightweight private npm proxy registry** built in **Node.js**
|
||||
|
||||
[](https://www.youtube.com/channel/UC5i20v6o7lSjXzAHOvatt0w)
|
||||
Using a private npm registry like Verdaccio is one of the [Top 10 NPM Security Best Practices](https://cheatsheetseries.owasp.org/cheatsheets/NPM_Security_Cheat_Sheet.html#6-use-a-local-npm-proxy)
|
||||
recommended by the Open Web Application Security Project ([OWASP](https://owasp.org/)).
|
||||
|
||||
<iframe width="560" height="515" src="https://www.youtube.com/embed/hDIFKzmoCaA?enablejsapi=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
<iframe width="560" height="515" src="https://www.youtube.com/embed/qRMucS3i3kQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
|
||||
## What's a registry? {#whats-a-registry}
|
||||
|
||||
|
||||
@@ -37,6 +37,9 @@ module.exports = {
|
||||
onBrokenMarkdownLinks: 'warn',
|
||||
favicon: "img/logo/uk/verdaccio-tiny-uk-no-bg.svg",
|
||||
i18n: i18nConfig,
|
||||
scripts: [
|
||||
"https://buttons.github.io/buttons.js",
|
||||
],
|
||||
plugins: [
|
||||
'docusaurus-plugin-sass',
|
||||
"docusaurus-plugin-contributors",
|
||||
@@ -59,7 +62,7 @@ module.exports = {
|
||||
announcementBar: {
|
||||
id: 'announcementBar',
|
||||
content:
|
||||
'<a target="_blank" rel="noopener noreferrer" href="https://donate.redcrossredcrescent.org/ua/donate/~my-donation?_cv=1">Help provide humanitarian support to Ukraine refugees</a>!',
|
||||
'<a target="_blank" rel="noopener noreferrer" href="https://www.wfp.org/support-us/stories/ukraine-appeal">Help provide humanitarian support to Ukraine refugees</a>!',
|
||||
isCloseable: false,
|
||||
backgroundColor: '#1595de',
|
||||
textColor: '#ffffff',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/website",
|
||||
"version": "5.13.0",
|
||||
"version": "5.14.0",
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
"start": "docusaurus start",
|
||||
@@ -18,7 +18,7 @@
|
||||
"eslint:write": "eslint src/**/*.tsx --fix"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
"node": ">=16"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.0.1 ",
|
||||
@@ -28,16 +28,19 @@
|
||||
"@docusaurus/theme-search-algolia": "2.0.1 ",
|
||||
"@docusaurus/plugin-content-docs": "2.0.1 ",
|
||||
"@docusaurus/theme-common": "2.0.1 ",
|
||||
"@material-ui/core": "^4.11.2",
|
||||
"@material-ui/icons": "^4.11.2",
|
||||
"@mui/material": "5.10.1",
|
||||
"@mui/icons-material": "5.8.4",
|
||||
"@mui/styles": "5.9.3",
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"clsx": "1.1.1",
|
||||
"clsx": "1.2.1",
|
||||
"classnames": "2.3.1",
|
||||
"copy-text-to-clipboard": "3.0.1",
|
||||
"docusaurus-plugin-contributors": "workspace:1.0.0",
|
||||
"docusaurus-plugin-sentry": "1.0.0",
|
||||
"react": "17.0.2",
|
||||
"react-player": "2.10.1",
|
||||
"react-dom": "17.0.2",
|
||||
"usehooks-ts": "2.6.0",
|
||||
"react-twitter-widgets": "^1.10.0",
|
||||
"use-is-in-viewport": "^1.0.9"
|
||||
},
|
||||
@@ -60,7 +63,7 @@
|
||||
"esbuild": "0.14.10",
|
||||
"esbuild-loader": "2.16.0",
|
||||
"prism-react-renderer": "^1.2.1",
|
||||
"sass": "1.54.3",
|
||||
"sass": "1.54.5",
|
||||
"sass-loader": "^12.1.0",
|
||||
"url-loader": "4.1.1"
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user