Compare commits

..

39 Commits

Author SHA1 Message Date
Juan Picado
5a61cdd0cf chore: update versions (6-next) (#3341)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-02 20:52:37 +02:00
Juan Picado
b849128ded fix: handle upload scoped tarball and add new deprecations (#3340)
* chore: add local publish support

* chore: fix upload scoped tarball

* add e2e
2022-09-02 20:40:12 +02:00
verdacciobot
efa2efe531 chore: updated contributors list 2022-09-01 00:14:39 +00:00
renovate[bot]
62ef397df1 chore(deps): update actions/github-script digest to c713e51 (#3336)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-31 08:09:06 +02:00
dependabot[bot]
e8fd4daf78 chore(deps): bump actions/github-script from 6.1.1 to 6.2.0 (#3337)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.1.1 to 6.2.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](d50f485531...c713e510db)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-31 08:08:19 +02:00
dependabot[bot]
acc5862323 chore(deps): bump github/codeql-action from 2.1.20 to 2.1.21 (#3338)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.20 to 2.1.21.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](7fee4ca032...c7f292ea4f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-31 08:08:00 +02:00
Aron Hafner
43c164efe0 docs: update config to use log property (#3339)
Update config.yaml to use log property instead of the depreciated logs

When using logs the following error occurs

```
Error: Error: the property config "logs" property is longer supported, rename to "log" and use object instead
```
2022-08-31 08:07:25 +02:00
verdacciobot
cd02e8d56a chore: updated contributors list 2022-08-29 00:14:20 +00:00
Juan Picado
5b270bdd06 Update package.json 2022-08-28 17:18:29 +02:00
Juan Picado
e06d8a0956 chore: update versions (6-next) (#3334)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-28 13:32:17 +02:00
Juan Picado
44b7a0f300 chore: remove website from changeset 2022-08-28 06:10:46 +02:00
Zoltan Kochan
351aeeaa88 fix(deps): @verdaccio/utils should be a prod dep of local-storage (#3333)
* fix(deps): @verdaccio/utils should be a prod dep of local-storage

* add changeset

Co-authored-by: Juan Picado <juanpicado19@gmail.com>
2022-08-28 07:44:48 +02:00
Juan Picado
3089c1c9cb chore: update versions (6-next) (#3331)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-08-27 19:33:00 +02:00
Juan Picado
d202128a06 chore: remove local packacages 2022-08-27 19:27:03 +02:00
Juan Picado
3c81bf8945 chore: update contributors script (#3332)
* chore: update script

* chore: update contributors file
2022-08-27 19:24:57 +02:00
okyanusoz
20d63dc30e ui: basic grammatical fixes in the Ukraine Message (#3330)
* Update Support.tsx

* Update Support.tsx

* chore: add changeset

Co-authored-by: Juan Picado <juanpicado19@gmail.com>
2022-08-27 19:12:35 +02:00
Juan Picado
5e22a52d9d Update changesets.yml 2022-08-27 16:25:59 +02:00
renovate[bot]
f332927f02 fix(deps): update all core dependencies (#3327)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-27 15:41:25 +02:00
github-actions[bot]
4137a96c20 chore: update versions (6-next) (#3329) 2022-08-27 15:07:19 +02:00
Juan Picado
37274e4c8d feat: implement abbreviated manifest (#3322)
* feat: implement abbreviated manifest

* chore: add time field

* chore: add abbreviated version

* chore: fix missing time

* chore: fix merge time issue

* Update jest.config.js

* add tests

* chore: add tests

* chore: add missing fields
2022-08-27 12:52:23 +02:00
Shenhe
f1527f5f20 docs: changed the deprecated installation method (#3323)
* Changed the deprecated installation method

Altered the `npm` global installation command i.e. `npm i -g` and `npm install --global` to `npm i --location=global` and `npm install --location=global` respectively. Also added methods for installing using `yarn` and `pnpm`

* Changed the deprecated installation method for `npm`

Changed the installation flag from `--global` and `-g` to `--location=global` for `npm` i.e. to `npm --location=global`

Co-authored-by: Juan Picado <juanpicado19@gmail.com>
2022-08-27 09:20:09 +02:00
Marc Bernard
a32a7e617e Update docs for cli (#3325)
- Minor corrections and additions
- Added link to possible formats for `listen` command
2022-08-26 19:53:35 +02:00
Marc Bernard
08c36e688e docs: add statement about npm security best practices (#3324)
OWASP is explicitly mentioning Verdaccio in one of their recommendations for npm security best practices. 

It's high praise so should be mentioned in a central place. If not here, you might find another page to add it.
2022-08-24 17:59:08 +02:00
Juan Picado
ba3d100b63 chore: fix format 2022-08-24 07:23:09 +02:00
Shenhe
37da9e0f61 Changed the deprecated installation method (#3321)
Altered the `npm` global installation command i.e. `npm i -g` and `npm install --global` to `npm i --location=global` and `npm install --location=global` respectively. Also added methods for installing using `yarn` and `pnpm`
2022-08-24 07:13:55 +02:00
Juan Picado
e630954923 website: restore github button front page 2022-08-22 20:46:20 +02:00
Juan Picado
4b61029718 chore: add more install notes 2022-08-22 20:31:59 +02:00
Juan Picado
13398c6ab8 update docker plugins examples 2022-08-22 18:51:04 +02:00
renovate[bot]
16f847fd7d chore(deps): pin dependencies (#3319)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-22 17:58:45 +02:00
Juan Picado
225b5235a9 update help website page 2022-08-21 15:15:40 +02:00
Juan Picado
1b5bcfeac6 Update renovate.json 2022-08-21 15:00:15 +02:00
Juan Picado
eaebffaf9e Update renovate.json 2022-08-21 14:31:43 +02:00
Juan Picado
dc4fa8e20d chore: remove unused file 2022-08-21 14:21:08 +02:00
Juan Picado
99b947a2a5 chore: clean unused code 2022-08-21 14:19:59 +02:00
Juan Picado
83c4705821 chore: migrate material ui old dep (#3318) 2022-08-21 14:15:20 +02:00
Juan Picado
3f5a1ee22a chore: update front page website (#3317)
* chore: update front page website

* Update UsedBy.tsx

* update links
2022-08-20 19:23:24 +02:00
Juan Picado
bf0f331dfc chore: remove empty website page 2022-08-20 18:20:22 +02:00
renovate[bot]
89b2b9104f fix(deps): update all linting dependencies (#3312) 2022-08-20 10:18:38 +02:00
renovate[bot]
21478f3221 fix(deps): update all core dependencies (#3298) 2022-08-20 09:28:29 +02:00
177 changed files with 10747 additions and 9980 deletions

View File

@@ -0,0 +1,42 @@
---
'@verdaccio/api': patch
'@verdaccio/auth': patch
'@verdaccio/cli': patch
'@verdaccio/core': patch
'@verdaccio/file-locking': patch
'@verdaccio/readme': patch
'@verdaccio/tarball': patch
'@verdaccio/types': patch
'@verdaccio/url': patch
'@verdaccio/hooks': patch
'@verdaccio/loaders': patch
'@verdaccio/logger': patch
'@verdaccio/node-api': patch
'verdaccio-audit': patch
'verdaccio-auth-memory': patch
'verdaccio-htpasswd': patch
'@verdaccio/local-storage': patch
'verdaccio-memory': patch
'@verdaccio/ui-theme': patch
'@verdaccio/proxy': patch
'@verdaccio/server': patch
'@verdaccio/server-fastify': patch
'@verdaccio/cli-standalone': patch
'@verdaccio/store': patch
'docusaurus-plugin-contributors': patch
'@verdaccio/test-helper': patch
'verdaccio': patch
'@verdaccio/web': patch
'@verdaccio/test-cli-commons': patch
'@verdaccio/e2e-cli-npm6': patch
'@verdaccio/e2e-cli-npm7': patch
'@verdaccio/e2e-cli-npm8': patch
'@verdaccio/e2e-cli-pnpm6': patch
'@verdaccio/e2e-cli-pnpm7': patch
'@verdaccio/e2e-cli-yarn1': patch
'@verdaccio/e2e-cli-yarn2': patch
'@verdaccio/e2e-cli-yarn3': patch
'@verdaccio/e2e-cli-yarn4': patch
---
fix(deps): @verdaccio/utils should be a prod dep of local-storage

View File

@@ -41,16 +41,17 @@
"@verdaccio/test-helper": "1.0.0",
"docusaurus-plugin-contributors": "1.0.0",
"@verdaccio/website": "5.4.0",
"@verdaccio/test-cli-commons": "1.0.0",
"@verdaccio/e2e-cli-npm6": "1.0.0",
"@verdaccio/e2e-cli-npm7": "1.0.0",
"@verdaccio/e2e-cli-npm8": "1.0.0",
"@verdaccio/e2e-cli-pnpm6": "1.0.0",
"@verdaccio/e2e-cli-pnpm7": "1.0.0",
"@verdaccio/e2e-cli-yarn1": "1.0.0",
"@verdaccio/e2e-cli-yarn2": "1.0.0",
"@verdaccio/e2e-cli-yarn3": "1.0.0",
"@verdaccio/e2e-cli-yarn4": "1.0.0"
"@verdaccio/test-cli-commons": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-npm6": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-npm7": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-npm8": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-pnpm6": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-pnpm7": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-yarn1": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-yarn2": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-yarn3": "1.0.1-6-next.1",
"@verdaccio/e2e-cli-yarn4": "1.0.1-6-next.1",
"@verdaccio/local-publish": "0.0.1"
},
"changesets": [
"afraid-mice-obey",
@@ -67,6 +68,7 @@
"eleven-brooms-hunt",
"eleven-spoons-matter",
"fair-lemons-beam",
"famous-tigers-doubt",
"few-cooks-destroy",
"few-mangos-grow",
"fifty-jars-rest",
@@ -112,6 +114,7 @@
"slow-carrots-relate",
"smart-apricots-kneel",
"smart-beds-cross",
"smooth-owls-pump",
"sour-buses-shout",
"spicy-frogs-press",
"spicy-snakes-sip",
@@ -124,7 +127,9 @@
"three-moles-drop",
"three-pots-sit",
"tiny-seals-join",
"tricky-taxis-watch",
"two-dolls-check",
"wild-jokes-beam"
"wild-jokes-beam",
"witty-ties-speak"
]
}

View File

@@ -0,0 +1,5 @@
---
'@verdaccio/ui-theme': patch
---
ui: basic grammatical fixes in the Ukraine Message

View 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

View File

@@ -0,0 +1,11 @@
---
'@verdaccio/api': patch
'@verdaccio/cli': patch
'@verdaccio/core': patch
'@verdaccio/types': patch
'@verdaccio/store': patch
'@verdaccio/test-helper': patch
'@verdaccio/local-publish': patch
---
fix: handle upload scoped tarball

View File

@@ -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

View File

@@ -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'
@@ -63,7 +63,7 @@ jobs:
title: 'chore: update versions'
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }}
NPM_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}
NPM_CONFIG_REGISTRY: https://registry.npmjs.org

View File

@@ -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') }}

View File

@@ -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@c7f292ea4f542c473194b33813ccd4c207a6c725 # 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@c7f292ea4f542c473194b33813ccd4c207a6c725 # 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@c7f292ea4f542c473194b33813ccd4c207a6c725 # tag=v2

View File

@@ -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"

View File

@@ -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

View File

@@ -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@c713e510dbd7d213d92d41b7a7805a986f4c5c66 # 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 }}

View File

@@ -183,7 +183,7 @@ a report in our [issue tracker](https://github.com/verdaccio/verdaccio/issues).
- _Features clearly flagged as not supported_
- _Node.js issues installation in any platform_: If you cannot install the
global package (this is considered external issue)
- Any ticket which has beed flagged as an [external issue
- Any ticket which has been flagged as an [external issue
](https://github.com/verdaccio/verdaccio/labels/external-issue)
If you intend to report a **security** issue, please follow our [Security policy
@@ -234,7 +234,7 @@ the project. Adding in context and the use-case will really help!
- A detailed description the advantages of your request
- Whether or not it's compatible with `npm`, `pnpm` and [_yarn classic_
](https://github.com/yarnpkg/yarn) or [_yarn berry_
](https://github.com/yarnpkg/yarn) or [_yarn modern_
](https://github.com/yarnpkg/berry).
- A potential implementation or design
- Whatever else is on your mind! 🤓
@@ -420,3 +420,25 @@ If you want to develop your own plugin:
3. You are free to host your plugin in your repository
4. Provide a detailed description of your plugin to help users understand how to
use it
## Testing your changes in a local registry
Once you have perform your changes in the code base, the build and tests passes you can publish a local version:
- Ensure you have build all modules (or the one you have modified)
- Run `pnpm local:publish:release` to launch a local registry and publish all packages into it. This command will be alive until server is killed (Control Key + C)
```
pnpm build
pnpm local:publish:release
```
The last step consist on install globally the package from the local registry.
```
npm i -g verdaccio --registry=http://localhost:4873
verdaccio
```
If you perform more changes in the source code, repeat this process, there is not _hot reloading_ support.

View File

@@ -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.

View File

@@ -66,6 +66,6 @@ middlewares:
enabled: true
# log settings
logs:
log:
- { type: stdout, format: pretty, level: trace }
#- {type: file, path: verdaccio.log, level: info}

View File

@@ -16,7 +16,7 @@
},
"devDependencies": {
"@babel/cli": "7.18.10",
"@babel/core": "7.18.10",
"@babel/core": "7.18.13",
"@babel/node": "7.18.10",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-proposal-decorators": "7.18.10",
@@ -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/cli": "2.24.4",
"@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/jsonwebtoken": "8.5.8",
"@types/node": "16.11.56",
"@types/jsonwebtoken": "8.5.9",
"@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:*",
@@ -76,13 +76,13 @@
"babel-plugin-emotion": "10.2.2",
"codecov": "3.8.3",
"concurrently": "6.5.1",
"core-js": "3.24.1",
"core-js": "3.25.0",
"cross-env": "7.0.3",
"debug": "4.3.4",
"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",
@@ -93,7 +93,7 @@
"jest-junit": "12.3.0",
"kleur": "3.0.3",
"lint-staged": "11.2.6",
"nock": "12.0.3",
"nock": "13.2.9",
"node-fetch": "cjs",
"nodemon": "2.0.19",
"npm-run-all": "4.1.5",
@@ -102,7 +102,7 @@
"selfsigned": "1.10.14",
"supertest": "6.2.4",
"ts-node": "10.9.1",
"typescript": "4.7.4",
"typescript": "4.8.2",
"update-ts-references": "2.4.1",
"verdaccio-audit": "workspace:*",
"verdaccio-auth-memory": "workspace:*",
@@ -146,7 +146,10 @@
"crowdin:upload": "crowdin upload sources --auto-update --config ./crowdin.yaml",
"crowdin:download": "crowdin download --verbose --config ./crowdin.yaml",
"crowdin:sync": "pnpm crowdin:upload && pnpm crowdin:download --verbose",
"postinstall": "husky install"
"postinstall": "husky install",
"local:registry": "pnpm start --filter ...@verdaccio/local-publish",
"local:publish": "cross-env npm_config_registry=http://localhost:4873 pnpm ci:publish",
"local:publish:release": "concurrently \"pnpm local:registry\" \"pnpm local:publish\""
},
"engines": {
"node": ">=16.5",

View File

@@ -1,5 +1,64 @@
# @verdaccio/api
## 6.0.0-6-next.29
### Patch Changes
- b849128d: fix: handle upload scoped tarball
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/store@6.0.0-6-next.26
- @verdaccio/auth@6.0.0-6-next.25
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/middleware@6.0.0-6-next.25
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.28
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/auth@6.0.0-6-next.24
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/logger@6.0.0-6-next.13
- @verdaccio/store@6.0.0-6-next.25
- @verdaccio/middleware@6.0.0-6-next.24
- @verdaccio/config@6.0.0-6-next.16
- @verdaccio/utils@6.0.0-6-next.13
## 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

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/api",
"version": "6.0.0-6-next.26",
"version": "6.0.0-6-next.29",
"description": "loaders logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,13 +39,13 @@
},
"license": "MIT",
"dependencies": {
"@verdaccio/auth": "workspace:6.0.0-6-next.23",
"@verdaccio/config": "workspace:6.0.0-6-next.15",
"@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/utils": "workspace:6.0.0-6-next.12",
"@verdaccio/auth": "workspace:6.0.0-6-next.25",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"@verdaccio/middleware": "workspace:6.0.0-6-next.25",
"@verdaccio/store": "workspace:6.0.0-6-next.26",
"@verdaccio/utils": "workspace:6.0.0-6-next.14",
"abortcontroller-polyfill": "1.7.3",
"cookies": "0.8.0",
"debug": "4.3.4",
@@ -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.56",
"@verdaccio/server": "workspace:6.0.0-6-next.35",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.4",
"supertest": "6.2.4",
"nock": "13.2.9",
"mockdate": "3.0.5"

View File

@@ -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,
});
@@ -57,6 +59,7 @@ export default function (route: Router, auth: IAuth, storage: Storage): void {
try {
const stream = (await storage.getTarballNext(pkg, filename, {
signal: abort.signal,
// TODO: review why this param
// enableRemote: true,
})) as any;

View File

@@ -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
*
@@ -81,7 +81,7 @@ const debug = buildDebug('verdaccio:api:publish');
* specific flag for star or un start.
* The URL for star is similar to the unpublish (change package format)
*
* npm has no enpoint for star a package, rather mutate the metadata and acts as, the difference
* npm has no endpoint for star a package, rather mutate the metadata and acts as, the difference
* is the users property which is part of the payload and the body only includes
*
* {
@@ -206,13 +206,12 @@ export function publishPackageNext(storage: Storage): any {
return next({
// TODO: this could be also Package Updated based on the
// action, deprecate, star, publish new version, or create a package
// the mssage some return from the method
// the message some return from the method
ok: API_MESSAGE.PKG_CREATED,
success: true,
});
} catch (err: any) {
// TODO: review if we need the abort controller here
ac.abort();
next(err);
}
};

View File

@@ -0,0 +1,26 @@
auth:
htpasswd:
file: ./htpasswd-publish-proxy
web:
enable: true
title: verdaccio
uplinks:
npmjs:
url: https://registry.npmjs.org/
log: { type: stdout, format: pretty, level: trace }
packages:
'@*/*':
access: $all
publish: $anonymous
unpublish: $anonymous
proxy: npmjs
'**':
access: $all
publish: $anonymous
unpublish: $anonymous
proxy: npmjs
_debug: true

View File

@@ -1,28 +1,52 @@
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';
describe('package', () => {
let app;
beforeEach(async () => {
app = await initializeServer('package.yaml');
describe('get tarball', () => {
let app;
beforeEach(async () => {
app = await initializeServer('package.yaml');
});
test.each([
['foo', 'foo-1.0.0.tgz'],
['@scope/foo', 'foo-1.0.0.tgz'],
])('should return a file tarball', async (pkg, fileName) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}/-/${fileName}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.OCTET_STREAM)
.expect(HTTP_STATUS.OK);
expect(Buffer.from(response.body).toString('utf8')).toBeDefined();
});
test.each([
['foo', 'foo-1.0.0.tgz'],
['@scope/foo', 'foo-1.0.0.tgz'],
])('should fails if tarball does not exist', async (pkg, fileName) => {
await publishVersion(app, pkg, '1.0.1');
return await supertest(app)
.get(`/${pkg}/-/${fileName}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.OCTET_STREAM)
.expect(HTTP_STATUS.NOT_FOUND);
});
test.todo('check content length file header');
test.todo('fails on file was aborted');
});
test.each([['foo'], ['@scope/foo']])('should return a foo private package', async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
});
describe('get package', () => {
let app;
beforeEach(async () => {
app = await initializeServer('package.yaml');
});
test.each([['foo'], ['@scope/foo']])(
'should return a foo private package by version',
async (pkg) => {
test.each([['foo'], ['@scope/foo']])('should return a foo private package', async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
@@ -30,19 +54,52 @@ describe('package', () => {
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
}
);
});
test.each([['foo'], ['@scope/foo']])(
'should return a foo private package by version',
async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
}
);
test.each([['foo'], ['@scope/foo']])(
'should return a foo private package by version',
async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
expect(response.body.name).toEqual(pkg);
}
);
test.each([['foo'], ['@scope/foo']])(
'should return a foo private package by version',
async (pkg) => {
await publishVersion(app, pkg, '1.0.0');
const response = await supertest(app)
.get(`/${pkg}`)
.set(HEADERS.ACCEPT, HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.OK);
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();
}
);
});
});

View File

@@ -1,11 +1,13 @@
import nock from 'nock';
import { basename } from 'path';
import supertest from 'supertest';
import { HTTP_STATUS } from '@verdaccio/core';
import { API_ERROR, API_MESSAGE, HEADERS, HEADER_TYPE } from '@verdaccio/core';
import { generatePackageMetadata } from '@verdaccio/test-helper';
import { generatePackageMetadata, generateRemotePackageMetadata } from '@verdaccio/test-helper';
import { $RequestExtend, $ResponseExtend } from '../../types/custom';
import { initializeServer, publishVersion } from './_helper';
import { getPackage, initializeServer, publishVersion } from './_helper';
const mockApiJWTmiddleware = jest.fn(
() =>
@@ -33,31 +35,8 @@ jest.mock('@verdaccio/auth', () => ({
},
}));
// const mockStorage = jest.fn(() => {
// const { Storage } = jest.requireActual('@verdaccio/store');
// return {
// Storage: class extends Storage {
// addPackage(name, metadata, cb) {
// super.addPackage(name, metadata, cb);
// }
// }
// };
// });
// jest.mock('@verdaccio/store', () => {
// const { Storage } = jest.requireActual('@verdaccio/store');
// return ({
// Storage: class extends Storage {
// addPackage(name, metadata, cb) {
// // super.addPackage(name, metadata, cb);
// return mockStorage(name, metadata, cb);
// }
// }
// })
// });
describe('publish', () => {
describe('handle invalid publish formats', () => {
describe('handle errors', () => {
const pkgName = 'test';
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
test('should fail on publish a bad _attachments package', async () => {
@@ -101,134 +80,179 @@ describe('publish', () => {
});
describe('publish a package', () => {
test('should publish a package', async () => {
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
publishVersion(app, 'foo', '1.0.0')
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
test('should publish a new package', async () => {
const pkgName = 'test';
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
supertest(app)
.put(`/${encodeURIComponent(pkgName)}`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.send(JSON.stringify(Object.assign({}, pkgMetadata)))
.set('accept', HEADERS.GZIP)
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
test('should publish a new package with no readme', async () => {
const pkgName = 'test';
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
supertest(app)
.put(`/${encodeURIComponent(pkgName)}`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.send(
JSON.stringify(
Object.assign({}, pkgMetadata, {
versions: {
['1.0.0']: {
readme: null,
},
},
})
)
)
.set('accept', HEADERS.GZIP)
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
});
test('should fails on publish a duplicated package', async () => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, 'foo', '1.0.0');
return new Promise((resolve) => {
publishVersion(app, 'foo', '1.0.0')
.expect(HTTP_STATUS.CONFLICT)
.then((response) => {
expect(response.body.error).toEqual(API_ERROR.PACKAGE_EXIST);
resolve(response);
describe('no proxies setup', () => {
test.each([['foo', '@scope/foo']])('should publish a package', async (pkgName) => {
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
publishVersion(app, pkgName, '1.0.0')
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
test.each([['foo', '@scope/foo']])('should publish a new package', async (pkgName) => {
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
supertest(app)
.put(`/${encodeURIComponent(pkgName)}`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.send(JSON.stringify(Object.assign({}, pkgMetadata)))
.set('accept', HEADERS.GZIP)
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
test('should publish a new package with no readme', async () => {
const pkgName = 'test';
const pkgMetadata = generatePackageMetadata(pkgName, '1.0.0');
const app = await initializeServer('publish.yaml');
return new Promise((resolve) => {
supertest(app)
.put(`/${encodeURIComponent(pkgName)}`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.send(
JSON.stringify(
Object.assign({}, pkgMetadata, {
versions: {
['1.0.0']: {
readme: null,
},
},
})
)
)
.set('accept', HEADERS.GZIP)
.expect(HTTP_STATUS.CREATED)
.then((response) => {
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
resolve(response);
});
});
});
});
describe('proxies setup', () => {
test.each([['foo', '@scope%2Ffoo']])(
'should publish a a patch package that already exist on a remote',
async (pkgName) => {
const upstreamManifest = generateRemotePackageMetadata(
pkgName,
'1.0.0',
'https://registry.npmjs.org',
['1.0.1', '1.0.2', '1.0.3']
);
nock('https://registry.npmjs.org').get(`/${pkgName}`).reply(200, upstreamManifest);
const app = await initializeServer('publish-proxy.yaml');
const manifest = await getPackage(app, '', decodeURIComponent(pkgName));
expect(manifest.body.name).toEqual(decodeURIComponent(pkgName));
const response = await publishVersion(
app,
decodeURIComponent(pkgName),
'1.0.1-patch'
).expect(HTTP_STATUS.CREATED);
expect(response.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
const response2 = await publishVersion(
app,
decodeURIComponent(pkgName),
'1.0.2-patch'
).expect(HTTP_STATUS.CREATED);
expect(response2.body.ok).toEqual(API_MESSAGE.PKG_CREATED);
}
);
});
});
test.each([['foo', '@scope/foo']])(
'should fails on publish a duplicated package',
async (pkgName) => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, pkgName, '1.0.0');
return new Promise((resolve) => {
publishVersion(app, pkgName, '1.0.0')
.expect(HTTP_STATUS.CONFLICT)
.then((response) => {
expect(response.body.error).toEqual(API_ERROR.PACKAGE_EXIST);
resolve(response);
});
});
}
);
describe('unpublish a package', () => {
test('should unpublish entirely a package', async () => {
test.each([['foo', '@scope/foo']])('should unpublish entirely a package', async (pkgName) => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, 'foo', '1.0.0');
await publishVersion(app, pkgName, '1.0.0');
const response = await supertest(app)
// FIXME: should be filtered by revision to avoid
// conflicts
.delete(`/${encodeURIComponent('foo')}/-rev/xxx`)
.delete(`/${encodeURIComponent(pkgName)}/-rev/xxx`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.CREATED);
expect(response.body.ok).toEqual(API_MESSAGE.PKG_REMOVED);
// package should be completely un published
await supertest(app)
.get('/foo')
.get(`/${pkgName}`)
.set('Accept', HEADERS.JSON)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET)
.expect(HTTP_STATUS.NOT_FOUND);
});
test('should fails unpublish entirely a package', async () => {
const app = await initializeServer('publish.yaml');
const response = await supertest(app)
.delete(`/${encodeURIComponent('foo')}/-rev/1cf3-fe3`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_PACKAGE);
});
test.each([['foo', '@scope/foo']])(
'should fails unpublish entirely a package',
async (pkgName) => {
const app = await initializeServer('publish.yaml');
const response = await supertest(app)
.delete(`/${encodeURIComponent(pkgName)}/-rev/1cf3-fe3`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_PACKAGE);
}
);
test('should fails remove a tarball of a package does not exist', async () => {
const app = await initializeServer('publish.yaml');
const response = await supertest(app)
.delete(`/foo/-/foo-1.0.3.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_PACKAGE);
});
test.each([['foo', '@scope/foo']])(
'should fails remove a tarball of a package does not exist',
async (pkgName) => {
const app = await initializeServer('publish.yaml');
const response = await supertest(app)
.delete(`/${pkgName}/-/${basename(pkgName)}-1.0.3.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_PACKAGE);
}
);
test('should fails on try remove a tarball does not exist', async () => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, 'foo', '1.0.0');
const response = await supertest(app)
.delete(`/foo/-/foo-1.0.3.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_SUCH_FILE);
});
test.each([['foo', '@scope/foo']])(
'should fails on try remove a tarball does not exist',
async (pkgName) => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, pkgName, '1.0.0');
const response = await supertest(app)
.delete(`/${pkgName}/-/${basename(pkgName)}-1.0.3.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.NOT_FOUND);
expect(response.body.error).toEqual(API_ERROR.NO_SUCH_FILE);
}
);
test('should remove a tarball that does exist', async () => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, 'foo', '1.0.0');
const response = await supertest(app)
.delete(`/foo/-/foo-1.0.0.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.CREATED);
expect(response.body.ok).toEqual(API_MESSAGE.TARBALL_REMOVED);
});
test.each([['foo', '@scope/foo']])(
'should remove a tarball that does exist',
async (pkgName) => {
const app = await initializeServer('publish.yaml');
await publishVersion(app, pkgName, '1.0.0');
const response = await supertest(app)
.delete(`/${pkgName}/-/${basename(pkgName)}-1.0.0.tgz/-rev/revision`)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.expect(HTTP_STATUS.CREATED);
expect(response.body.ok).toEqual(API_MESSAGE.TARBALL_REMOVED);
}
);
});
describe('star a package', () => {});

View File

@@ -1,8 +1,6 @@
import nock from 'nock';
import supertest from 'supertest';
import { API_ERROR, HEADERS, HEADER_TYPE, HTTP_STATUS, TOKEN_BEARER } from '@verdaccio/core';
import { generateRemotePackageMetadata } from '@verdaccio/test-helper';
import { buildToken } from '@verdaccio/utils';
import { createUser, getPackage, initializeServer } from './_helper';
@@ -13,13 +11,6 @@ describe('token', () => {
describe('basics', () => {
const FAKE_TOKEN: string = buildToken(TOKEN_BEARER, 'fake');
test.each([['user.yaml'], ['user.jwt.yaml']])('should test add a new user', async (conf) => {
const upstreamManifest = generateRemotePackageMetadata(
'vue',
'1.0.0',
'https://registry.verdaccio.org'
);
nock('https://registry.verdaccio.org').get(`/vue`).reply(201, upstreamManifest);
const app = await initializeServer(conf);
const credentials = { name: 'JotaJWT', password: 'secretPass' };
const response = await createUser(app, credentials.name, credentials.password);

View File

@@ -1,5 +1,30 @@
# @verdaccio/auth
## 6.0.0-6-next.25
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/loaders@6.0.0-6-next.15
- @verdaccio/logger@6.0.0-6-next.14
- verdaccio-htpasswd@11.0.0-6-next.16
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.24
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/loaders@6.0.0-6-next.14
- @verdaccio/logger@6.0.0-6-next.13
- verdaccio-htpasswd@11.0.0-6-next.15
- @verdaccio/config@6.0.0-6-next.16
- @verdaccio/utils@6.0.0-6-next.13
## 6.0.0-6-next.23
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/auth",
"version": "6.0.0-6-next.23",
"version": "6.0.0-6-next.25",
"description": "logger",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,19 +39,19 @@
},
"license": "MIT",
"dependencies": {
"@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/utils": "workspace:6.0.0-6-next.12",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/loaders": "workspace:6.0.0-6-next.15",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"@verdaccio/utils": "workspace:6.0.0-6-next.14",
"debug": "4.3.4",
"express": "4.18.1",
"jsonwebtoken": "8.5.1",
"lodash": "4.17.21",
"verdaccio-htpasswd": "workspace:11.0.0-6-next.14"
"verdaccio-htpasswd": "workspace:11.0.0-6-next.16"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.13"
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"funding": {
"type": "opencollective",

View File

@@ -1,5 +1,35 @@
# @verdaccio/cli
## 6.0.0-6-next.38
### Patch Changes
- b849128d: fix: handle upload scoped tarball
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/node-api@6.0.0-6-next.36
## 6.0.0-6-next.37
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/logger@6.0.0-6-next.13
- @verdaccio/node-api@6.0.0-6-next.35
- @verdaccio/config@6.0.0-6-next.16
## 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

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/cli",
"version": "6.0.0-6-next.35",
"version": "6.0.0-6-next.38",
"author": {
"name": "Juan Picado",
"email": "juanpicado19@gmail.com"
@@ -44,10 +44,10 @@
"start": "ts-node src/index.ts"
},
"dependencies": {
"@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/core": "workspace:6.0.0-6-next.8",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"@verdaccio/node-api": "workspace:6.0.0-6-next.36",
"clipanion": "3.1.0",
"envinfo": "7.8.1",
"kleur": "3.0.3",

View File

@@ -1,6 +1,7 @@
import { Command, Option } from 'clipanion';
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
import { warningUtils } from '@verdaccio/core';
import { logger, setup } from '@verdaccio/logger';
import { initServer } from '@verdaccio/node-api';
import { ConfigYaml, LoggerConfigItem } from '@verdaccio/types';
@@ -45,17 +46,13 @@ export class InitCommand extends Command {
});
private initLogger(logConfig: ConfigYaml) {
try {
// @ts-expect-error
if (logConfig.logs) {
// @ts-expect-error
if (logConfig.logs) {
throw Error(
'the property config "logs" property is longer supported, rename to "log" and use object instead'
);
}
setup(logConfig.log as LoggerConfigItem);
} catch (err: any) {
throw new Error(err);
logConfig.log = logConfig.logs;
warningUtils.emit(warningUtils.Codes.VERWAR002);
}
setup(logConfig.log as LoggerConfigItem);
}
public async execute() {

View File

@@ -1,5 +1,21 @@
# @verdaccio/config
## 6.0.0-6-next.17
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.16
### Patch Changes
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/utils@6.0.0-6-next.13
## 6.0.0-6-next.15
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/config",
"version": "6.0.0-6-next.15",
"version": "6.0.0-6-next.17",
"description": "logger",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,8 +39,8 @@
"build": "pnpm run build:js && pnpm run build:types"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.6",
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/utils": "workspace:6.0.0-6-next.14",
"debug": "4.3.4",
"yaml": "2.1.1",
"lodash": "4.17.21",

View File

@@ -1,5 +1,17 @@
# @verdaccio/core
## 6.0.0-6-next.8
### Patch Changes
- b849128d: fix: handle upload scoped tarball
## 6.0.0-6-next.7
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
## 6.0.0-6-next.6
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/core",
"version": "6.0.0-6-next.6",
"version": "6.0.0-6-next.8",
"description": "core utilities",
"keywords": [
"private",
@@ -39,11 +39,11 @@
"semver": "7.3.7",
"ajv": "8.11.0",
"process-warning": "1.0.0",
"core-js": "3.24.1"
"core-js": "3.25.0"
},
"devDependencies": {
"lodash": "4.17.21",
"@verdaccio/types": "workspace:11.0.0-6-next.13"
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -6,12 +6,19 @@ const verdaccioDeprecation = 'VerdaccioDeprecation';
export enum Codes {
VERWAR001 = 'VERWAR001',
VERWAR002 = 'VERWAR002',
VERWAR003 = 'VERWAR003',
VERWAR004 = 'VERWAR004',
// deprecation warnings
VERDEP003 = 'VERDEP003',
}
warningInstance.create(
verdaccioWarning,
Codes.VERWAR002,
`The property config "logs" property is longer supported, rename to "log" and use object instead`
);
warningInstance.create(
verdaccioWarning,
Codes.VERWAR001,

View File

@@ -1,5 +1,11 @@
# Change Log
## 11.0.0-6-next.6
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
## 11.0.0-6-next.5
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/file-locking",
"version": "11.0.0-6-next.5",
"version": "11.0.0-6-next.6",
"description": "library that handle file locking",
"keywords": [
"private",
@@ -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.16"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -1,5 +1,11 @@
# Change Log
## 11.0.0-6-next.6
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
## 11.0.0-6-next.5
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/readme",
"version": "11.0.0-6-next.5",
"version": "11.0.0-6-next.6",
"description": "Readme markdown parser",
"keywords": [
"private",
@@ -40,12 +40,12 @@
"build"
],
"dependencies": {
"dompurify": "2.3.10",
"dompurify": "2.4.0",
"jsdom": "17.0.0",
"marked": "3.0.8"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.13"
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -1,5 +1,24 @@
# Change Log
## 11.0.0-6-next.15
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/url@11.0.0-6-next.12
- @verdaccio/utils@6.0.0-6-next.14
## 11.0.0-6-next.14
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/url@11.0.0-6-next.11
- @verdaccio/utils@6.0.0-6-next.13
## 11.0.0-6-next.13
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/tarball",
"version": "11.0.0-6-next.13",
"version": "11.0.0-6-next.15",
"description": "tarball utilities resolver",
"keywords": [
"private",
@@ -35,13 +35,13 @@
},
"dependencies": {
"debug": "4.3.4",
"@verdaccio/core": "workspace:6.0.0-6-next.6",
"@verdaccio/url": "workspace:11.0.0-6-next.10",
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/url": "workspace:11.0.0-6-next.12",
"@verdaccio/utils": "workspace:6.0.0-6-next.14",
"lodash": "4.17.21"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.13",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"node-mocks-http": "1.11.0"
},
"scripts": {

View File

@@ -1,5 +1,40 @@
# Change Log
## 11.0.0-6-next.16
### Patch Changes
- b849128d: fix: handle upload scoped tarball
## 11.0.0-6-next.15
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
## 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

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/types",
"version": "11.0.0-6-next.13",
"version": "11.0.0-6-next.16",
"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.56",
"typedoc": "beta",
"typedoc-plugin-missing-exports": "1.0.0"
},

View File

@@ -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 {
@@ -167,6 +181,7 @@ export interface FullRemoteManifest {
homepage?: string;
repository?: string | { type?: string; url: string; directory?: string };
keywords?: string[];
author?: string | Author;
}
export interface Manifest extends FullRemoteManifest, PublishManifest {
@@ -194,6 +209,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:

View File

@@ -1,5 +1,20 @@
# Change Log
## 11.0.0-6-next.12
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
## 11.0.0-6-next.11
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
## 11.0.0-6-next.10
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/url",
"version": "11.0.0-6-next.10",
"version": "11.0.0-6-next.12",
"description": "url utilities resolver",
"keywords": [
"private",
@@ -34,13 +34,13 @@
"access": "public"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.6",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"debug": "4.3.4",
"lodash": "4.17.21",
"validator": "13.7.0"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.13",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"node-mocks-http": "1.11.0"
},
"scripts": {

View File

@@ -1,5 +1,22 @@
# @verdaccio/hooks
## 6.0.0-6-next.16
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/logger@6.0.0-6-next.14
## 6.0.0-6-next.15
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/logger@6.0.0-6-next.13
## 6.0.0-6-next.14
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/hooks",
"version": "6.0.0-6-next.14",
"version": "6.0.0-6-next.16",
"description": "loaders logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -30,18 +30,18 @@
"npm": ">=6"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.6",
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
"core-js": "3.24.1",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"core-js": "3.25.0",
"debug": "4.3.4",
"handlebars": "4.7.7",
"undici": "4.16.0"
},
"devDependencies": {
"@types/node": "16.11.47",
"@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"
"@types/node": "16.11.56",
"@verdaccio/auth": "workspace:6.0.0-6-next.25",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -1,5 +1,19 @@
# @verdaccio/loaders
## 6.0.0-6-next.15
### Patch Changes
- @verdaccio/logger@6.0.0-6-next.14
## 6.0.0-6-next.14
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/logger@6.0.0-6-next.13
## 6.0.0-6-next.13
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/loaders",
"version": "6.0.0-6-next.13",
"version": "6.0.0-6-next.15",
"description": "loaders logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -13,14 +13,14 @@
"url": "https://github.com/verdaccio/verdaccio"
},
"dependencies": {
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"debug": "4.3.4",
"lodash": "4.17.21"
},
"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/core": "workspace:6.0.0-6-next.8",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"homepage": "https://verdaccio.org",
"keywords": [

View File

@@ -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",

View File

@@ -1,5 +1,20 @@
# @verdaccio/logger
## 6.0.0-6-next.14
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
## 6.0.0-6-next.13
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
## 6.0.0-6-next.12
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/logger",
"version": "6.0.0-6-next.12",
"version": "6.0.0-6-next.14",
"description": "logger",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,14 +39,14 @@
"build": "babel src/ --out-dir build/ --copy-files --extensions \".ts,.tsx\" --source-maps"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.6",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@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.16"
},
"funding": {
"type": "opencollective",

View File

@@ -1,5 +1,25 @@
# @verdaccio/middleware
## 6.0.0-6-next.25
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/auth@6.0.0-6-next.25
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.24
### Patch Changes
- Updated dependencies [351aeeaa]
- @verdaccio/auth@6.0.0-6-next.24
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/logger@6.0.0-6-next.13
- @verdaccio/utils@6.0.0-6-next.13
## 6.0.0-6-next.23
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/middleware",
"version": "6.0.0-6-next.23",
"version": "6.0.0-6-next.25",
"description": "loaders logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -40,10 +40,10 @@
"dependencies": {
"debug": "4.3.4",
"body-parser": "1.20.0",
"@verdaccio/auth": "workspace:6.0.0-6-next.23",
"@verdaccio/core": "workspace:6.0.0-6-next.6",
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
"@verdaccio/auth": "workspace:6.0.0-6-next.25",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"@verdaccio/utils": "workspace:6.0.0-6-next.14",
"lodash": "4.17.21"
},
"funding": {

View File

@@ -1,5 +1,38 @@
# @verdaccio/node-api
## 6.0.0-6-next.36
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/server@6.0.0-6-next.35
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/server-fastify@6.0.0-6-next.27
## 6.0.0-6-next.35
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/logger@6.0.0-6-next.13
- @verdaccio/server@6.0.0-6-next.34
- @verdaccio/server-fastify@6.0.0-6-next.26
- @verdaccio/config@6.0.0-6-next.16
## 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

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/node-api",
"version": "6.0.0-6-next.33",
"version": "6.0.0-6-next.36",
"description": "node API",
"main": "build/index.js",
"types": "build/index.d.ts",
@@ -39,18 +39,18 @@
},
"license": "MIT",
"dependencies": {
"@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",
"core-js": "3.24.1",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"@verdaccio/server": "workspace:6.0.0-6-next.35",
"@verdaccio/server-fastify": "workspace:6.0.0-6-next.27",
"core-js": "3.25.0",
"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.56",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"jest-mock-process": "1.5.1",
"selfsigned": "1.10.14",
"supertest": "6.2.4"

View File

@@ -1,5 +1,11 @@
# Change Log
## 11.0.0-6-next.10
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
## 11.0.0-6-next.9
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "verdaccio-audit",
"version": "11.0.0-6-next.9",
"version": "11.0.0-6-next.10",
"description": "Verdaccio Middleware plugin to bypass npmjs audit",
"keywords": [
"private",
@@ -37,9 +37,9 @@
"node-fetch": "cjs"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.13",
"@verdaccio/config": "workspace:6.0.0-6-next.15",
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"nock": "13.2.9",
"supertest": "6.2.4"
},

View File

@@ -1,5 +1,20 @@
# Change Log
## 11.0.0-6-next.11
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
## 11.0.0-6-next.10
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
## 11.0.0-6-next.9
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "verdaccio-auth-memory",
"version": "11.0.0-6-next.9",
"version": "11.0.0-6-next.11",
"description": "Auth plugin for Verdaccio that keeps users in memory",
"keywords": [
"private",
@@ -32,10 +32,10 @@
},
"dependencies": {
"debug": "4.3.4",
"@verdaccio/core": "workspace:6.0.0-6-next.6"
"@verdaccio/core": "workspace:6.0.0-6-next.8"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.13"
"@verdaccio/types": "workspace:11.0.0-6-next.16"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -1,5 +1,22 @@
# Change Log
## 11.0.0-6-next.16
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/file-locking@11.0.0-6-next.6
## 11.0.0-6-next.15
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/file-locking@11.0.0-6-next.6
## 11.0.0-6-next.14
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "verdaccio-htpasswd",
"version": "11.0.0-6-next.14",
"version": "11.0.0-6-next.16",
"description": "htpasswd auth plugin for Verdaccio",
"keywords": [
"private",
@@ -34,20 +34,20 @@
"npm": ">=6"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.6",
"@verdaccio/file-locking": "workspace:11.0.0-6-next.5",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/file-locking": "workspace:11.0.0-6-next.6",
"apache-md5": "1.1.7",
"bcryptjs": "2.4.3",
"core-js": "3.24.1",
"core-js": "3.25.0",
"http-errors": "1.8.1",
"debug": "4.3.4",
"unix-crypt-td-js": "1.1.4"
},
"devDependencies": {
"@types/bcryptjs": "2.4.2",
"@verdaccio/types": "workspace:11.0.0-6-next.13",
"@verdaccio/config": "workspace:6.0.0-6-next.15",
"@verdaccio/logger": "workspace:6.0.0-6-next.12",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"mockdate": "3.0.5"
},
"scripts": {

View File

@@ -1,5 +1,52 @@
# Change Log
## 11.0.0-6-next.16
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/utils@6.0.0-6-next.14
- @verdaccio/file-locking@11.0.0-6-next.6
## 11.0.0-6-next.15
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/file-locking@11.0.0-6-next.6
- @verdaccio/utils@6.0.0-6-next.13
## 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

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/local-storage",
"version": "11.0.0-6-next.13",
"version": "11.0.0-6-next.16",
"description": "Local storage implementation",
"keywords": [
"private",
@@ -37,9 +37,10 @@
"npm": ">=7"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.6",
"@verdaccio/file-locking": "workspace:11.0.0-6-next.5",
"core-js": "3.24.1",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/file-locking": "workspace:11.0.0-6-next.6",
"@verdaccio/utils": "workspace:6.0.0-6-next.14",
"core-js": "3.25.0",
"debug": "4.3.4",
"globby": "11.1.0",
"lockfile": "1.0.4",
@@ -50,11 +51,10 @@
},
"devDependencies": {
"@types/minimatch": "3.0.5",
"@verdaccio/types": "workspace:11.0.0-6-next.13",
"@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/types": "workspace:11.0.0-6-next.16",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.4",
"minimatch": "3.1.2"
},
"scripts": {

View File

@@ -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);
}

View File

@@ -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) {

View File

@@ -1,5 +1,20 @@
# Change Log
## 11.0.0-6-next.13
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
## 11.0.0-6-next.12
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
## 11.0.0-6-next.11
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "verdaccio-memory",
"version": "11.0.0-6-next.11",
"version": "11.0.0-6-next.13",
"description": "Storage implementation in memory",
"keywords": [
"private",
@@ -31,15 +31,15 @@
"npm": ">=6"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.6",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"memory-fs": "0.5.0",
"debug": "4.3.4",
"memfs": "3.4.7"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.13",
"@verdaccio/config": "workspace:6.0.0-6-next.15",
"@verdaccio/logger": "workspace:6.0.0-6-next.12"
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/logger": "workspace:6.0.0-6-next.14"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -1,5 +1,17 @@
# @verdaccio/ui-theme
## 6.0.0-6-next.28
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
## 6.0.0-6-next.27
### Patch Changes
- 20d63dc3: ui: basic grammatical fixes in the Ukraine Message
## 6.0.0-6-next.26
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/ui-theme",
"version": "6.0.0-6-next.26",
"version": "6.0.0-6-next.28",
"description": "Verdaccio User Interface",
"author": {
"name": "Verdaccio Contributors",
@@ -24,21 +24,21 @@
"@emotion/jest": "11.10.0",
"@emotion/styled": "11.10.0",
"@emotion/css": "11.10.0",
"@emotion/babel-plugin": "11.10.0",
"@mui/icons-material": "5.8.4",
"@mui/material": "5.9.3",
"@mui/styles": "5.9.3",
"@emotion/babel-plugin": "11.10.2",
"@mui/icons-material": "5.10.2",
"@mui/material": "5.10.2",
"@mui/styles": "5.10.2",
"@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.36",
"@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.5",
"react-router": "5.3.3",
"react-router-dom": "5.3.3",
"react-virtualized": "9.22.3",
@@ -72,26 +72,26 @@
"redux": "4.2.0",
"rimraf": "3.0.2",
"raw-loader": "4.0.2",
"msw": "0.44.2",
"msw": "0.45.0",
"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.1",
"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",

View File

@@ -13,7 +13,7 @@ const title = 'Support people affected by the war in Ukraine';
const links = [
{
href: 'https://twitter.com/denysdovhan/status/1501486563842211843',
text: 'Listen at Twitter OSS developers about the kjkjwar',
text: 'Listen OSS developers about the war on Twitter',
},
{
href: 'https://snyk.io/blog/celebrating-amazing-open-source-innovation-ukraine/',
@@ -21,7 +21,7 @@ const links = [
},
{
href: 'https://www.savethechildren.org/us/where-we-work/ukraine/',
text: 'Donate to Save the Children',
text: 'Donate to save children in Ukraine',
},
{
href: 'https://www.ifrc.org/',
@@ -29,7 +29,7 @@ const links = [
},
{
href: 'https://www.hrw.org/news/2022/03/10/ukraine-russian-air-dropped-bombs-hit-residential-area/',
text: 'Read Reports from Human Rights Watch',
text: 'Read reports from Human Rights Watch',
},
{
href: 'https://europeanbloodalliance.eu/',
@@ -59,7 +59,7 @@ const Support = () => {
<Typography>
{`Hi, this is a message that I've composed to call your attention to ask
for humanitarian support for more than 44 million Ukrainians that are having
a hard time suffering for a horrible and unjustified war. It would be great if you
a hard time suffering for a horrible and unjustified war. It would be great if you
decide today to make a difference and help others. You could help by donating
to very well-known humanitarian organizations, helping in your local
area with food, clothes, donate blood, toys for kids, or your own time. Any help is very welcome.`}

View File

@@ -175,6 +175,10 @@
"username": "CrispyConductor",
"id": 2132722
},
{
"username": "NotWearingPants",
"id": 26556598
},
{
"username": "Utwo",
"id": 282668
@@ -195,6 +199,10 @@
"username": "dschaller",
"id": 1004789
},
{
"username": "zkochan",
"id": 1927579
},
{
"username": "semoal",
"id": 22656541
@@ -260,8 +268,8 @@
"id": 175305
},
{
"username": "NotWearingPants",
"id": 26556598
"username": "mbtools",
"id": 59966492
},
{
"username": "rmkanda",
@@ -283,10 +291,6 @@
"username": "ddhp",
"id": 1715380
},
{
"username": "zkochan",
"id": 1927579
},
{
"username": "alexjurkiewicz",
"id": 379509
@@ -403,6 +407,10 @@
"username": "innosatyam",
"id": 85342175
},
{
"username": "SuzunaMinami",
"id": 49131888
},
{
"username": "varijkapil13",
"id": 8291077
@@ -603,6 +611,10 @@
"username": "tiandrey",
"id": 152357
},
{
"username": "hafffe",
"id": 3322693
},
{
"username": "BarthV",
"id": 1901955
@@ -783,10 +795,6 @@
"username": "larsgw",
"id": 14018963
},
{
"username": "mbtools",
"id": 59966492
},
{
"username": "mavimo",
"id": 43941
@@ -1043,6 +1051,10 @@
"username": "oeph",
"id": 2753218
},
{
"username": "okyanusoz",
"id": 46757266
},
{
"username": "robi-wan",
"id": 30210

View File

@@ -1,5 +1,37 @@
# @verdaccio/proxy
## 6.0.0-6-next.24
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/local-storage@11.0.0-6-next.16
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.23
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/logger@6.0.0-6-next.13
- @verdaccio/local-storage@11.0.0-6-next.15
- @verdaccio/config@6.0.0-6-next.16
- @verdaccio/utils@6.0.0-6-next.13
## 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

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/proxy",
"version": "6.0.0-6-next.21",
"version": "6.0.0-6-next.24",
"description": "verdaccio proxy fetcher",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,11 +39,11 @@
"build": "pnpm run build:js && pnpm run build:types"
},
"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/logger": "workspace:6.0.0-6-next.12",
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/local-storage": "workspace:11.0.0-6-next.16",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"@verdaccio/utils": "workspace:6.0.0-6-next.14",
"JSONStream": "1.3.5",
"debug": "4.3.4",
"lodash": "4.17.21",
@@ -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.56",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"get-stream": "^6.0.1",
"nock": "13.2.9",
"node-mocks-http": "1.11.0",

View File

@@ -1,5 +1,54 @@
# @verdaccio/server
## 6.0.0-6-next.35
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/api@6.0.0-6-next.29
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/store@6.0.0-6-next.26
- @verdaccio/web@6.0.0-6-next.33
- @verdaccio/auth@6.0.0-6-next.25
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/loaders@6.0.0-6-next.15
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/middleware@6.0.0-6-next.25
- @verdaccio/utils@6.0.0-6-next.14
- verdaccio-audit@11.0.0-6-next.10
## 6.0.0-6-next.34
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/api@6.0.0-6-next.28
- @verdaccio/auth@6.0.0-6-next.24
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/loaders@6.0.0-6-next.14
- @verdaccio/logger@6.0.0-6-next.13
- verdaccio-audit@11.0.0-6-next.10
- @verdaccio/store@6.0.0-6-next.25
- @verdaccio/web@6.0.0-6-next.32
- @verdaccio/middleware@6.0.0-6-next.24
- @verdaccio/config@6.0.0-6-next.16
- @verdaccio/utils@6.0.0-6-next.13
## 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

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/server",
"version": "6.0.0-6-next.32",
"version": "6.0.0-6-next.35",
"description": "server logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -30,17 +30,17 @@
"npm": ">=6"
},
"dependencies": {
"@verdaccio/api": "workspace:6.0.0-6-next.26",
"@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/utils": "workspace:6.0.0-6-next.12",
"@verdaccio/web": "workspace:6.0.0-6-next.30",
"verdaccio-audit": "workspace:11.0.0-6-next.9",
"@verdaccio/api": "workspace:6.0.0-6-next.29",
"@verdaccio/auth": "workspace:6.0.0-6-next.25",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/loaders": "workspace:6.0.0-6-next.15",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"@verdaccio/middleware": "workspace:6.0.0-6-next.25",
"@verdaccio/store": "workspace:6.0.0-6-next.26",
"@verdaccio/utils": "workspace:6.0.0-6-next.14",
"@verdaccio/web": "workspace:6.0.0-6-next.33",
"verdaccio-audit": "workspace:11.0.0-6-next.10",
"compression": "1.7.4",
"cors": "2.8.5",
"debug": "4.3.4",
@@ -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.56",
"@verdaccio/proxy": "workspace:6.0.0-6-next.24",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.4",
"http-errors": "1.8.1"
},
"scripts": {

View File

@@ -1,5 +1,67 @@
# @verdaccio/server-fastify
## 6.0.0-6-next.27
### Patch Changes
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/store@6.0.0-6-next.26
- @verdaccio/auth@6.0.0-6-next.25
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/tarball@11.0.0-6-next.15
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/utils@6.0.0-6-next.14
- @verdaccio/readme@11.0.0-6-next.6
## 6.0.0-6-next.26
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/auth@6.0.0-6-next.24
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/readme@11.0.0-6-next.6
- @verdaccio/tarball@11.0.0-6-next.14
- @verdaccio/logger@6.0.0-6-next.13
- @verdaccio/store@6.0.0-6-next.25
- @verdaccio/config@6.0.0-6-next.16
- @verdaccio/utils@6.0.0-6-next.13
## 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

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/server-fastify",
"version": "6.0.0-6-next.24",
"version": "6.0.0-6-next.27",
"description": "fastify server api implementation",
"keywords": [
"private",
@@ -34,23 +34,23 @@
"access": "public"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.6",
"@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/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",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/auth": "workspace:6.0.0-6-next.25",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"@verdaccio/store": "workspace:6.0.0-6-next.26",
"@verdaccio/tarball": "workspace:11.0.0-6-next.15",
"@verdaccio/utils": "workspace:6.0.0-6-next.14",
"@verdaccio/readme": "workspace:11.0.0-6-next.6",
"core-js": "3.25.0",
"debug": "4.3.4",
"fastify": "4.3.0",
"fastify-plugin": "4.1.0",
"fastify": "4.5.3",
"fastify-plugin": "4.2.1",
"lodash": "4.17.21"
},
"devDependencies": {
"@types/node": "16.11.47",
"@verdaccio/types": "workspace:11.0.0-6-next.13",
"@types/node": "16.11.56",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"ts-node": "10.9.1"
},
"scripts": {

View File

@@ -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;
});

View File

@@ -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);

View File

@@ -1,5 +1,11 @@
# @verdaccio/cli-standalone
## 6.0.0-6-next.7
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
## 6.0.0-6-next.6
### Major Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/cli-standalone",
"version": "6.0.0-6-next.6",
"version": "6.0.0-6-next.7",
"description": "standalone verdaccio registry with no dependencies",
"main": "dist/bundle.js",
"bin": {
@@ -32,11 +32,11 @@
"homepage": "https://verdaccio.org",
"license": "MIT",
"devDependencies": {
"@verdaccio/cli": "workspace:6.0.0-6-next.35",
"@verdaccio/ui-theme": "workspace:6.0.0-6-next.26",
"@verdaccio/cli": "workspace:6.0.0-6-next.38",
"@verdaccio/ui-theme": "workspace:6.0.0-6-next.28",
"fs-extra": "10.1.0",
"webpack": "5.74.0",
"webpack-bundle-analyzer": "4.5.0",
"webpack-bundle-analyzer": "4.6.1",
"webpack-bundle-size-analyzer": "3.1.0",
"webpack-cli": "4.10.0"
},

View File

@@ -1,5 +1,74 @@
# @verdaccio/store
## 6.0.0-6-next.26
### Patch Changes
- b849128d: fix: handle upload scoped tarball
- Updated dependencies [b849128d]
- @verdaccio/core@6.0.0-6-next.8
- @verdaccio/config@6.0.0-6-next.17
- @verdaccio/tarball@11.0.0-6-next.15
- @verdaccio/url@11.0.0-6-next.12
- @verdaccio/hooks@6.0.0-6-next.16
- @verdaccio/loaders@6.0.0-6-next.15
- @verdaccio/logger@6.0.0-6-next.14
- @verdaccio/local-storage@11.0.0-6-next.16
- @verdaccio/proxy@6.0.0-6-next.24
- @verdaccio/utils@6.0.0-6-next.14
## 6.0.0-6-next.25
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/core@6.0.0-6-next.7
- @verdaccio/tarball@11.0.0-6-next.14
- @verdaccio/url@11.0.0-6-next.11
- @verdaccio/hooks@6.0.0-6-next.15
- @verdaccio/loaders@6.0.0-6-next.14
- @verdaccio/logger@6.0.0-6-next.13
- @verdaccio/local-storage@11.0.0-6-next.15
- @verdaccio/proxy@6.0.0-6-next.23
- @verdaccio/config@6.0.0-6-next.16
- @verdaccio/utils@6.0.0-6-next.13
## 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

View File

@@ -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,
},
},
});

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/store",
"version": "6.0.0-6-next.23",
"version": "6.0.0-6-next.26",
"description": "loaders logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -39,16 +39,16 @@
"build": "pnpm run build:js && pnpm run build:types"
},
"dependencies": {
"@verdaccio/config": "workspace:6.0.0-6-next.15",
"@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/logger": "workspace:6.0.0-6-next.12",
"@verdaccio/proxy": "workspace:6.0.0-6-next.21",
"@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",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/hooks": "workspace:6.0.0-6-next.16",
"@verdaccio/loaders": "workspace:6.0.0-6-next.15",
"@verdaccio/local-storage": "workspace:11.0.0-6-next.16",
"@verdaccio/logger": "workspace:6.0.0-6-next.14",
"@verdaccio/proxy": "workspace:6.0.0-6-next.24",
"@verdaccio/url": "workspace:11.0.0-6-next.12",
"@verdaccio/utils": "workspace:6.0.0-6-next.14",
"@verdaccio/tarball": "workspace:11.0.0-6-next.15",
"JSONStream": "1.3.5",
"debug": "4.3.4",
"lodash": "4.17.21",
@@ -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.56",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.4",
"undici": "4.16.0",
"nock": "13.2.9",
"node-mocks-http": "1.11.0",

View File

@@ -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 (

View File

@@ -1,7 +1,8 @@
import assert from 'assert';
import buildDebug from 'debug';
import _, { isEmpty, isNil } from 'lodash';
import { PassThrough, Readable, Transform, Writable, pipeline as streamPipeline } from 'stream';
import { basename } from 'path';
import { PassThrough, Readable, Transform, pipeline as streamPipeline } from 'stream';
import { pipeline } from 'stream/promises';
import { default as URL } from 'url';
@@ -25,6 +26,8 @@ import {
convertDistVersionToLocalTarballsUrl,
} from '@verdaccio/tarball';
import {
AbbreviatedManifest,
AbbreviatedVersions,
Author,
Config,
DistFile,
@@ -91,6 +94,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 +529,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 +651,7 @@ class Storage {
}
/**
* Initialize the storage asyncronously.
* Initialize the storage asynchronously.
* @param config Config
* @param filters IPluginFilters
* @returns Storage instance
@@ -907,7 +962,7 @@ class Storage {
// if (typeof storage === 'undefined') {
// throw errorUtils.getNotFound();
// }
throw errorUtils.getInternalError('no implemenation ready for npm deprecate');
throw errorUtils.getInternalError('no implementation ready for npm deprecate');
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -918,7 +973,7 @@ class Storage {
// throw errorUtils.getNotFound();
// }
throw errorUtils.getInternalError('no implemenation ready for npm star');
throw errorUtils.getInternalError('no implementation ready for npm star');
}
/**
@@ -1006,9 +1061,9 @@ class Storage {
debug('%s version %s already exists', name, versionToPublish);
throw errorUtils.getConflict();
}
const uplinksLook = this.config?.publish?.allow_offline === false;
// if execution get here, package does not exist locally, we search upstream
const remoteManifest = await this.checkPackageRemote(name, this.isAllowPublishOffline());
const remoteManifest = await this.checkPackageRemote(name, uplinksLook);
if (remoteManifest?.versions[versionToPublish] != null) {
debug('%s version %s already exists', name, versionToPublish);
throw errorUtils.getConflict();
@@ -1058,7 +1113,7 @@ class Storage {
// 3. upload the tarball to the storage
try {
const readable = Readable.from(buffer);
await this.uploadTarball(name, firstAttachmentKey, readable, {
await this.uploadTarball(name, basename(firstAttachmentKey), readable, {
signal: options.signal,
});
} catch (err: any) {
@@ -1094,43 +1149,46 @@ class Storage {
* @param options
* @returns
*/
public async uploadTarball(
public uploadTarball(
name: string,
fileName: string,
contentReadable: Readable,
{ signal }
): Promise<void> {
return new Promise((resolve, reject) => {
(async () => {
const stream: Writable = await this.uploadTarballAsStream(name, fileName, {
signal,
this.uploadTarballAsStream(name, fileName, {
signal,
})
.then((stream) => {
stream.on('error', (err) => {
debug(
'error on stream a tarball %o for %o with error %o',
'foo.tar.gz',
name,
err.message
);
reject(err);
});
stream.on('success', () => {
this.logger.debug(
{ fileName, name },
'file @{fileName} for package @{name} has been successfully uploaded'
);
resolve();
});
return stream;
})
.then((stream) => {
pipeline(contentReadable, stream, { signal })
.then(() => {
debug('success pipe upload tarball');
})
.catch(reject);
});
stream.on('error', (err) => {
debug(
'error on stream a tarball %o for %o with error %o',
'foo.tar.gz',
name,
err.message
);
reject(err);
});
stream.on('success', () => {
this.logger.debug(
{ fileName, name },
'file @{fileName} for package @{name} has been succesfully uploaded'
);
resolve();
});
await pipeline(contentReadable, stream, { signal });
})().catch((err) => {
reject(err);
});
});
}
public async uploadTarballAsStream(
private async uploadTarballAsStream(
pkgName: string,
filename: string,
{ signal }
@@ -1341,14 +1399,6 @@ class Storage {
}
}
private isAllowPublishOffline(): boolean {
return (
typeof this.config.publish !== 'undefined' &&
_.isBoolean(this.config.publish.allow_offline) &&
this.config.publish.allow_offline
);
}
/**
*
* @param name package name
@@ -1513,8 +1563,8 @@ class Storage {
A package requires uplinks syncronization if enables the proxy section, uplinks
can be more than one, the more are the most slow request will take, the request
are made in serie and if 1st call fails, the second will be triggered, otherwise
the 1st will reply and others will be discareded. The order is important.
are made in serial and if 1st call fails, the second will be triggered, otherwise
the 1st will reply and others will be discarded. The order is important.
Errors on upkinks are considered are, time outs, connection fails and http status 304,
in that case the request returns empty body and we want ask next on the list if has fresh
@@ -1613,7 +1663,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 +1692,7 @@ class Storage {
);
try {
_cacheManifest = validatioUtils.normalizeMetadata(remoteManifest, _cacheManifest.name);
_cacheManifest = validatioUtils.normalizeMetadata(_cacheManifest, _cacheManifest.name);
} catch (err: any) {
this.logger.error(
{
@@ -1657,7 +1707,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 +1717,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;
}

View File

@@ -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

View File

@@ -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
@@ -663,14 +668,15 @@ describe('storage', () => {
});
test.todo('should handle double proxy with last one success');
});
describe('options', () => {
test('should handle disable uplinks via options.uplinksLook=false', async () => {
test('should handle disable uplinks via options.uplinksLook=false with cache', async () => {
const fooManifest = generatePackageMetadata('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
@@ -686,10 +692,216 @@ describe('storage', () => {
expect((response as Manifest).name).toEqual(fooManifest.name);
expect((response as Manifest)[DIST_TAGS].latest).toEqual('8.0.0');
});
test('should handle disable uplinks via options.uplinksLook=false without cache', async () => {
const fooRemoteManifest = generateRemotePackageMetadata(
'foo',
'9.0.0',
'https://registry.verdaccio.org',
['9.0.0', '9.0.1', '9.0.2', '9.0.3']
);
nock('https://registry.verdaccio.org').get('/foo').reply(201, fooRemoteManifest);
const config = new Config(
configExample(
{
...getDefaultConfig(),
storage: generateRandomStorage(),
},
'./fixtures/config/syncSingleUplinksMetadata.yaml',
__dirname
)
);
const storage = new Storage(config);
await storage.init(config);
const [response] = await storage.syncUplinksMetadataNext('foo', null, {
uplinksLook: true,
});
expect((response as Manifest).name).toEqual('foo');
expect((response as Manifest)[DIST_TAGS].latest).toEqual('9.0.0');
});
});
});
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');
});
});
// TODO: getPackageNext should replace getPackage eventually
describe('get packages getPackageByOptions()', () => {
describe('with uplinks', () => {
test('should get 201 and merge from uplink', async () => {
@@ -697,7 +909,7 @@ describe('storage', () => {
const config = new Config(
configExample({
...getDefaultConfig(),
storage: generateRamdonStorage(),
storage: generateRandomStorage(),
})
);
const req = httpMocks.createRequest({
@@ -729,7 +941,7 @@ describe('storage', () => {
const config = new Config(
configExample({
...getDefaultConfig(),
storage: generateRamdonStorage(),
storage: generateRandomStorage(),
})
);
const req = httpMocks.createRequest({
@@ -762,7 +974,7 @@ describe('storage', () => {
const config = new Config(
configExample({
...getDefaultConfig(),
storage: generateRamdonStorage(),
storage: generateRandomStorage(),
})
);
const req = httpMocks.createRequest({
@@ -795,7 +1007,7 @@ describe('storage', () => {
const config = new Config(
configExample({
...getDefaultConfig(),
storage: generateRamdonStorage(),
storage: generateRandomStorage(),
})
);
const req = httpMocks.createRequest({
@@ -835,7 +1047,7 @@ describe('storage', () => {
url: domain,
},
},
storage: generateRamdonStorage(),
storage: generateRandomStorage(),
})
);
const req = httpMocks.createRequest({
@@ -875,7 +1087,7 @@ describe('storage', () => {
url: domain,
},
},
storage: generateRamdonStorage(),
storage: generateRandomStorage(),
})
);
const req = httpMocks.createRequest({
@@ -902,6 +1114,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();
});
});
});
});

View File

@@ -0,0 +1,6 @@
# docusaurus-plugin-contributors
## 1.0.1-6-next.0
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage

View File

@@ -1,6 +1,6 @@
{
"name": "docusaurus-plugin-contributors",
"version": "1.0.0",
"version": "1.0.1-6-next.0",
"private": true,
"main": "./build/index.js",
"types": "build/index.d.ts",

View File

@@ -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,
};

View File

@@ -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",

View File

@@ -1,5 +1,40 @@
# Change Log
## 1.1.0-6-next.4
### Patch Changes
- b849128d: fix: handle upload scoped tarball
## 1.1.0-6-next.3
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
## 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

View File

@@ -0,0 +1,10 @@
const config = require('../../../jest/config');
module.exports = Object.assign({}, config, {
coverageThreshold: {
global: {
// FIXME: increase to 90
lines: 50,
},
},
});

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/test-helper",
"version": "1.1.0-6-next.1",
"version": "1.1.0-6-next.4",
"private": true,
"description": "test helpers",
"author": "Juan Picado <juanpicado19@gmail.com>",
@@ -9,12 +9,12 @@
"main": "build/index.js",
"types": "build/index.d.ts",
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.13",
"@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/middleware": "workspace:6.0.0-6-next.23",
"@verdaccio/utils": "workspace:6.0.0-6-next.12",
"@verdaccio/types": "workspace:11.0.0-6-next.16",
"@verdaccio/auth": "workspace:6.0.0-6-next.25",
"@verdaccio/core": "workspace:6.0.0-6-next.8",
"@verdaccio/config": "workspace:6.0.0-6-next.17",
"@verdaccio/middleware": "workspace:6.0.0-6-next.25",
"@verdaccio/utils": "workspace:6.0.0-6-next.14",
"body-parser": "1.20.0",
"express": "4.18.1",
"supertest": "6.2.4",

View File

@@ -1,4 +1,4 @@
import { Manifest } from '@verdaccio/types';
import { FullRemoteManifest, GenericBody, Manifest, Version, Versions } from '@verdaccio/types';
export interface DistTags {
[key: string]: string;
@@ -49,7 +49,7 @@ export function addNewVersion(
};
// update the latest with the new version
newManifest['dist-tags'] = { latest: version };
// add new version does not need attachmetns
// add new version does not need attachments
if (isRemote) {
newManifest._distfiles = {
...newManifest._distfiles,
@@ -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`]: {
@@ -131,58 +137,83 @@ export function generateLocalPackageMetadata(
export function generateRemotePackageMetadata(
pkgName: string,
version = '1.0.0',
domain: string = 'http://localhost:5555'
): Manifest {
domain: string = 'http://localhost:5555',
versions: string[] = []
): FullRemoteManifest {
// @ts-ignore
const generateVersion = (version: string): Version => {
const metadata = {
name: pkgName,
version: version,
description: 'package generated',
main: 'index.js',
scripts: {
test: 'echo "Error: no test specified" && exit 1',
},
keywords: [],
author: {
name: 'User NPM',
email: 'user@domain.com',
},
license: 'ISC',
dependencies: {
verdaccio: '^2.7.2',
},
readme: '# test',
readmeFilename: 'README.md',
_id: `${pkgName}@${version}`,
_npmVersion: '5.5.1',
_npmUser: {
name: 'foo',
},
dist: {
integrity:
'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +
'E6dUBf+XoPoH4g==',
shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
tarball: `${domain}\/${pkgName}\/-\/${getTarball(pkgName)}-${version}.tgz`,
},
};
return metadata;
};
const mappedVersions: Versions = versions.reduce((acc, v) => {
acc[v] = generateVersion(v);
return acc;
}, {});
const mappedTimes: GenericBody = versions.reduce((acc, v) => {
const date = new Date(Date.now());
acc[v] = date.toISOString();
return acc;
}, {});
return {
_id: pkgName,
name: pkgName,
description: '',
'dist-tags': { ['latest']: version },
versions: {
[version]: {
name: pkgName,
version: version,
description: 'package generated',
main: 'index.js',
scripts: {
test: 'echo "Error: no test specified" && exit 1',
},
keywords: [],
author: {
name: 'User NPM',
email: 'user@domain.com',
},
license: 'ISC',
dependencies: {
verdaccio: '^2.7.2',
},
readme: '# test',
readmeFilename: 'README.md',
_id: `${pkgName}@${version}`,
_npmVersion: '5.5.1',
_npmUser: {
name: 'foo',
},
dist: {
integrity:
'sha512-6gHiERpiDgtb3hjqpQH5/i7zRmvYi9pmCjQf2ZMy3QEa9wVk9RgdZaPWUt7ZOnWUPFjcr9cm' +
'E6dUBf+XoPoH4g==',
shasum: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
tarball: `${domain}\/${pkgName}\/-\/${getTarball(pkgName)}-${version}.tgz`,
},
[version]: generateVersion(version),
...mappedVersions,
},
time: {
modified: '2019-06-13T06:44:45.747Z',
created: '2019-06-13T06:44:45.747Z',
[version]: '2019-06-13T06:44:45.747Z',
...mappedTimes,
},
maintainers: [
{
name: 'foo',
email: 'foo@foo.com',
},
],
author: {
name: 'foo',
},
readme: '# test',
_attachments: {},
_uplinks: {},
_distfiles: {
[`${pkgName}-${version}.tgz`]: {
url: `${domain}/${pkgName}\/-\/${getTarball(pkgName)}-${version}.tgz`,
sha: '2c03764f651a9f016ca0b7620421457b619151b9', // pragma: allowlist secret
},
},
_rev: '',
_rev: '12-c8fe8a9c79fa57a87347a0213e6f2548',
};
}

View File

@@ -1,3 +0,0 @@
const config = require('../../jest/config');
module.exports = Object.assign({}, config, {});

View File

@@ -35,27 +35,27 @@ describe('generate metadata', () => {
});
describe('generateRemotePackageMetadata', () => {
test('should generate package metadata', () => {
const m = generateRemotePackageMetadata('foo', '1.0.0', 'https://registry.verdaccio.org');
expect(m).toBeDefined();
expect(m._attachments).toEqual({});
expect(m._distfiles['foo-1.0.0.tgz']).toEqual({
sha: '2c03764f651a9f016ca0b7620421457b619151b9',
url: 'https://registry.verdaccio.org/foo/-/foo-1.0.0.tgz',
});
expect(
generateRemotePackageMetadata('foo', '1.0.0', 'https://registry.verdaccio.org')
).toBeDefined();
});
test('should add new versions remote', () => {
const manifest = generateRemotePackageMetadata('foo', '1.0.0');
const m1 = addNewVersion(manifest, '1.0.1', true);
expect(Object.keys(m1._attachments)).toEqual([]);
expect(Object.keys(m1._distfiles)).toEqual(['foo-1.0.0.tgz', 'foo-1.0.1.tgz']);
const m2 = addNewVersion(m1, '1.0.2');
expect(Object.keys(m2.versions)).toEqual(['1.0.0', '1.0.1', '1.0.2']);
expect(m2['dist-tags'].latest).toEqual('1.0.2');
expect(m2._distfiles['foo-1.0.2.tgz']).toEqual({
sha: '2c03764f651a9f016ca0b7620421457b619151b9',
url: 'http://localhost:5555/foo/-/foo-1.0.2.tgz',
});
expect(Object.keys(m2._attachments)).toEqual([]);
test('should generate package metadata with multiple versions', () => {
const m = generateRemotePackageMetadata('foo', '1.0.0', 'https://registry.verdaccio.org', [
'1.0.1',
'1.0.2',
'3.0.0',
]);
expect(m).toBeDefined();
expect(Object.keys(m.versions)).toEqual(['1.0.0', '1.0.1', '1.0.2', '3.0.0']);
expect(Object.keys(m.time)).toEqual([
'modified',
'created',
'1.0.0',
'1.0.1',
'1.0.2',
'3.0.0',
]);
});
});
describe('generateLocalPackageMetadata', () => {

Some files were not shown because too many files have changed in this diff Show More