Compare commits

..

11 Commits

Author SHA1 Message Date
Juan Picado
0a37a9808a chore: update versions (6-next) (#3611)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-14 21:58:20 +01:00
Juan Picado
d167f92e18 rollback yaml support old nodejs versions (#3610) 2023-02-14 21:44:08 +01:00
Juan Picado
a931cb6646 chore: update versions (6-next) (#3604)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-14 17:35:58 +01:00
dependabot[bot]
7ad320a444 chore(deps): bump marocchino/sticky-pull-request-comment (#3606)
Bumps [marocchino/sticky-pull-request-comment](https://github.com/marocchino/sticky-pull-request-comment) from 2.3.1 to 2.5.0.
- [Release notes](https://github.com/marocchino/sticky-pull-request-comment/releases)
- [Commits](fcf6fe9e4a...3d60a5b2da)

---
updated-dependencies:
- dependency-name: marocchino/sticky-pull-request-comment
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-14 08:30:56 +01:00
dependabot[bot]
d1e190e067 chore(deps): bump actions/cache from 3.2.4 to 3.2.5 (#3605)
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](627f0f41f6...6998d139dd)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-14 08:30:42 +01:00
dependabot[bot]
ae391a73f1 chore(deps): bump github/codeql-action from 2.2.1 to 2.2.4 (#3607)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.1 to 2.2.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](3ebbd71c74...17573ee1cc)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-14 08:30:29 +01:00
Juan Picado
45c03819e2 refactor: html render middleware improvements (#3603)
* refactor: render middleware

* refactor: render middleware
2023-02-12 20:26:18 +01:00
Juan Picado
1b38fb2d30 improve storage documentation 2023-02-09 20:48:01 +01:00
verdacciobot
ee5e5d55e6 chore: updated static data 2023-02-09 01:02:58 +00:00
dependabot[bot]
a12e825345 chore(deps): bump docker/build-push-action from 2 to 4 (#3597)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2 to 4.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2...v4)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-06 21:57:38 +01:00
dependabot[bot]
d2614d6869 chore(deps): bump actions/cache from 3.2.3 to 3.2.4 (#3598)
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](58c146cc91...627f0f41f6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-06 20:19:17 +01:00
165 changed files with 1766 additions and 809 deletions

View File

@@ -0,0 +1,6 @@
---
'@verdaccio/test-cli-commons': minor
'@verdaccio/config': minor
---
chore: rollback yaml dep support old nodejs versions

View File

@@ -92,6 +92,7 @@
"fuzzy-onions-draw",
"gentle-parrots-lay",
"gentle-trains-switch",
"giant-years-trade",
"gold-vans-tease",
"green-yaks-divide",
"healthy-bikes-behave",
@@ -157,6 +158,7 @@
"twelve-crabs-guess",
"two-dolls-check",
"unlucky-hairs-wonder",
"weak-mangos-taste",
"wild-jokes-beam",
"witty-ties-speak"
]

View File

@@ -0,0 +1,15 @@
---
'@verdaccio/api': minor
'@verdaccio/config': minor
'@verdaccio/types': minor
'@verdaccio/hooks': minor
'@verdaccio/middleware': minor
'verdaccio-audit': minor
'@verdaccio/proxy': minor
'@verdaccio/server': minor
'@verdaccio/store': minor
'@verdaccio/web': minor
'@verdaccio/ui-theme': minor
---
refactor: render html middleware

View File

@@ -32,7 +32,7 @@ jobs:
- name: Install
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
- name: Cache .pnpm-store
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
@@ -50,7 +50,7 @@ jobs:
node-version-file: '.nvmrc'
- name: Install pnpm
run: npm i pnpm@6.32.15 -g
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
@@ -70,7 +70,7 @@ jobs:
node-version-file: '.nvmrc'
- name: Install pnpm
run: npm i pnpm@6.32.15 -g
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
@@ -95,7 +95,7 @@ jobs:
node-version: ${{ matrix.node_version }}
- name: Install pnpm
run: npm i pnpm@6.32.15 -g
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
@@ -116,7 +116,7 @@ jobs:
node-version-file: '.nvmrc'
- name: Install pnpm
run: npm i pnpm@6.32.15 -g
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}

View File

@@ -43,7 +43,7 @@ jobs:
- name: Install
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
- name: Cache .pnpm-store
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
@@ -63,7 +63,7 @@ jobs:
run: |
corepack enable
corepack prepare --activate pnpm@6.32.15
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
@@ -85,7 +85,7 @@ jobs:
run: |
corepack enable
corepack prepare --activate pnpm@6.32.15
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
@@ -112,7 +112,7 @@ jobs:
run: |
corepack enable
corepack prepare --activate pnpm@6.32.15
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
@@ -136,7 +136,7 @@ jobs:
run: |
corepack enable
corepack prepare --activate pnpm@6.32.15
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}

View File

@@ -34,7 +34,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@3ebbd71c74ef574dbc558c82f70e52732c8b44fe # tag=v2
uses: github/codeql-action/init@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # 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@3ebbd71c74ef574dbc558c82f70e52732c8b44fe # tag=v2
uses: github/codeql-action/autobuild@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # 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@3ebbd71c74ef574dbc558c82f70e52732c8b44fe # tag=v2
uses: github/codeql-action/analyze@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # tag=v2

View File

@@ -45,7 +45,7 @@ jobs:
{{major}}
{{major}}.{{minor}}
- name: Build & Push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile

View File

@@ -29,7 +29,7 @@ jobs:
- name: Install
run: pnpm recursive install --frozen-lockfile --reporter=silence --ignore-scripts --registry http://localhost:4873
- name: Cache .pnpm-store
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
@@ -46,7 +46,7 @@ jobs:
node-version-file: '.nvmrc'
- name: Install pnpm
run: npm i pnpm@6.32.15 -g
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
@@ -55,7 +55,7 @@ jobs:
- name: build
run: pnpm build
- name: Cache packages
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
id: cache-packages
with:
path: ./packages/
@@ -86,13 +86,13 @@ jobs:
node-version: ${{ matrix.node }}
- name: Install pnpm
run: npm i pnpm@6.32.15 -g
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
- name: Install
run: pnpm recursive install --offline --frozen-lockfile --reporter=silence --ignore-scripts --registry http://localhost:4873
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: ./packages/
key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}

View File

@@ -35,7 +35,7 @@ jobs:
node-version-file: '.nvmrc'
- name: Cache pnpm modules
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
env:
cache-name: cache-pnpm-modules
with:

View File

@@ -31,7 +31,7 @@ jobs:
node-version: 16
- name: Cache pnpm modules
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
env:
cache-name: cache-pnpm-modules
with:
@@ -51,7 +51,7 @@ jobs:
- name: Build Translations percentage
run: pnpm build --filter "@verdaccio/crowdin-translations"
- name: Cache Docusaurus Build
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3
with:
path: website/node_modules/.cache/webpack
key: cache/webpack-${{github.ref}}-${{ hashFiles('**/pnpm-lock.yaml') }}
@@ -134,7 +134,7 @@ jobs:
- name: Add comment to PR
if: github.repository == 'verdaccio/verdaccio'
id: comment_to_pr
uses: marocchino/sticky-pull-request-comment@fcf6fe9e4a0409cd9316a5011435be0f3327f1e1 # tag=v2
uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd # tag=v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
number: ${{ github.event.issue.number }}

View File

@@ -1,5 +1,11 @@
# @verdaccio/test-cli-commons
## 1.1.0-6-next.6
### Minor Changes
- d167f92e: chore: rollback yaml dep support old nodejs versions
## 1.0.1-6-next.5
### Patch Changes

View File

@@ -1,15 +1,15 @@
{
"private": true,
"name": "@verdaccio/test-cli-commons",
"version": "1.0.1-6-next.5",
"version": "1.1.0-6-next.6",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"devDependencies": {
"verdaccio": "workspace:6.0.0-6-next.59",
"@verdaccio/core": "workspace:6.0.0-6-next.59",
"@verdaccio/config": "workspace:6.0.0-6-next.59",
"@verdaccio/types": "workspace:11.0.0-6-next.19",
"yaml": "2.2.0",
"verdaccio": "workspace:6.0.0-6-next.61",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"@verdaccio/config": "workspace:6.0.0-6-next.61",
"@verdaccio/types": "workspace:11.0.0-6-next.20",
"js-yaml": "4.1.0",
"debug": "4.3.4",
"fs-extra": "10.1.0",
"got": "11.8.6",

View File

@@ -1,7 +1,7 @@
import { cp, writeFile } from 'fs/promises';
import YAML from 'js-yaml';
import { join } from 'path';
import { URL } from 'url';
import YAML from 'yaml';
import { Dependencies } from '@verdaccio/types';
@@ -25,7 +25,7 @@ export function createYamlConfig(registry: string, token?: string) {
};
}
return YAML.stringify(defaultYaml);
return YAML.dump(defaultYaml);
}
export async function prepareYarnModernProject(

View File

@@ -1,5 +1,12 @@
# @verdaccio/e2e-cli-npm6
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes

View File

@@ -1,9 +1,9 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-npm6",
"version": "1.0.1-6-next.5",
"version": "1.0.1-6-next.6",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
"@verdaccio/test-cli-commons": "workspace:1.1.0-6-next.6",
"npm": "6.14.18"
},
"scripts": {

View File

@@ -1,5 +1,12 @@
# @verdaccio/e2e-cli-npm7
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes

View File

@@ -1,9 +1,9 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-npm7",
"version": "1.0.1-6-next.5",
"version": "1.0.1-6-next.6",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
"@verdaccio/test-cli-commons": "workspace:1.1.0-6-next.6",
"npm": "7.24.2"
},
"scripts": {

View File

@@ -1,5 +1,12 @@
# @verdaccio/e2e-cli-npm8
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes

View File

@@ -1,9 +1,9 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-npm8",
"version": "1.0.1-6-next.5",
"version": "1.0.1-6-next.6",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
"@verdaccio/test-cli-commons": "workspace:1.1.0-6-next.6",
"npm": "8.19.3"
},
"scripts": {

View File

@@ -1,5 +1,12 @@
# @verdaccio/e2e-cli-npm9
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes

View File

@@ -1,9 +1,9 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-npm9",
"version": "1.0.1-6-next.5",
"version": "1.0.1-6-next.6",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
"@verdaccio/test-cli-commons": "workspace:1.1.0-6-next.6",
"npm": "9.2.0"
},
"scripts": {

View File

@@ -1,5 +1,12 @@
# @verdaccio/e2e-cli-pnpm6
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes

View File

@@ -1,9 +1,9 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-pnpm6",
"version": "1.0.1-6-next.5",
"version": "1.0.1-6-next.6",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
"@verdaccio/test-cli-commons": "workspace:1.1.0-6-next.6",
"pnpm": "latest-6"
},
"scripts": {

View File

@@ -1,5 +1,12 @@
# @verdaccio/e2e-cli-pnpm7
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes

View File

@@ -1,9 +1,9 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-pnpm7",
"version": "1.0.1-6-next.5",
"version": "1.0.1-6-next.6",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
"@verdaccio/test-cli-commons": "workspace:1.1.0-6-next.6",
"pnpm": "next-7"
},
"scripts": {

View File

@@ -1,5 +1,12 @@
# @verdaccio/e2e-cli-yarn1
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes

View File

@@ -1,9 +1,9 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-yarn1",
"version": "1.0.1-6-next.5",
"version": "1.0.1-6-next.6",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
"@verdaccio/test-cli-commons": "workspace:1.1.0-6-next.6",
"yarn": "1.22.19"
},
"scripts": {

View File

@@ -1,5 +1,12 @@
# @verdaccio/e2e-cli-yarn2
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes

View File

@@ -1,9 +1,9 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-yarn2",
"version": "1.0.1-6-next.5",
"version": "1.0.1-6-next.6",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
"@verdaccio/test-cli-commons": "workspace:1.1.0-6-next.6",
"@yarnpkg/cli-dist": "2.4.2"
},
"scripts": {

View File

@@ -1,5 +1,12 @@
# @verdaccio/e2e-cli-yarn3
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes

View File

@@ -1,9 +1,9 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-yarn3",
"version": "1.0.1-6-next.5",
"version": "1.0.1-6-next.6",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
"@verdaccio/test-cli-commons": "workspace:1.1.0-6-next.6",
"@yarnpkg/cli-dist": "3.3.1"
},
"scripts": {

View File

@@ -1,5 +1,12 @@
# @verdaccio/e2e-cli-yarn4
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes

View File

@@ -1,9 +1,9 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-yarn4",
"version": "1.0.1-6-next.5",
"version": "1.0.1-6-next.6",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5"
"@verdaccio/test-cli-commons": "workspace:1.1.0-6-next.6"
},
"scripts": {
"test": "jest"

View File

@@ -3,9 +3,9 @@
"name": "@verdaccio/e2e-ui",
"version": "2.0.0-6-next.3",
"devDependencies": {
"verdaccio": "workspace:6.0.0-6-next.59",
"@verdaccio/core": "workspace:6.0.0-6-next.59",
"@verdaccio/config": "workspace:6.0.0-6-next.59",
"verdaccio": "workspace:6.0.0-6-next.61",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"@verdaccio/config": "workspace:6.0.0-6-next.61",
"@verdaccio/test-helper": "workspace:2.0.0-6-next.7",
"debug": "4.3.4",
"cypress": "11.2.0"

View File

@@ -1,5 +1,35 @@
# @verdaccio/api
## 6.0.0-6-next.44
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/config@6.0.0-6-next.61
- @verdaccio/auth@6.0.0-6-next.40
- @verdaccio/middleware@6.0.0-6-next.40
- @verdaccio/store@6.0.0-6-next.41
- @verdaccio/core@6.0.0-6-next.61
- @verdaccio/utils@6.0.0-6-next.29
- @verdaccio/logger@6.0.0-6-next.29
## 6.0.0-6-next.43
### Minor Changes
- 45c03819: refactor: render html middleware
### Patch Changes
- Updated dependencies [45c03819]
- @verdaccio/config@6.0.0-6-next.60
- @verdaccio/middleware@6.0.0-6-next.39
- @verdaccio/store@6.0.0-6-next.40
- @verdaccio/auth@6.0.0-6-next.39
- @verdaccio/core@6.0.0-6-next.60
- @verdaccio/logger@6.0.0-6-next.28
- @verdaccio/utils@6.0.0-6-next.28
## 6.0.0-6-next.42
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/api",
"version": "6.0.0-6-next.42",
"version": "6.0.0-6-next.44",
"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.38",
"@verdaccio/config": "workspace:6.0.0-6-next.59",
"@verdaccio/core": "workspace:6.0.0-6-next.59",
"@verdaccio/logger": "workspace:6.0.0-6-next.27",
"@verdaccio/middleware": "workspace:6.0.0-6-next.38",
"@verdaccio/store": "workspace:6.0.0-6-next.39",
"@verdaccio/utils": "workspace:6.0.0-6-next.27",
"@verdaccio/auth": "workspace:6.0.0-6-next.40",
"@verdaccio/config": "workspace:6.0.0-6-next.61",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"@verdaccio/logger": "workspace:6.0.0-6-next.29",
"@verdaccio/middleware": "workspace:6.0.0-6-next.40",
"@verdaccio/store": "workspace:6.0.0-6-next.41",
"@verdaccio/utils": "workspace:6.0.0-6-next.29",
"abortcontroller-polyfill": "1.7.5",
"cookies": "0.8.0",
"debug": "4.3.4",
@@ -57,8 +57,8 @@
},
"devDependencies": {
"@types/node": "16.18.10",
"@verdaccio/server": "workspace:6.0.0-6-next.48",
"@verdaccio/types": "workspace:11.0.0-6-next.19",
"@verdaccio/server": "workspace:6.0.0-6-next.50",
"@verdaccio/types": "workspace:11.0.0-6-next.20",
"@verdaccio/test-helper": "workspace:2.0.0-6-next.7",
"supertest": "6.3.3",
"nock": "13.2.9",

View File

@@ -13,6 +13,7 @@ import {
validatioUtils,
} from '@verdaccio/core';
import { logger } from '@verdaccio/logger';
import { rateLimit } from '@verdaccio/middleware';
import { Config, RemoteUser } from '@verdaccio/types';
import { getAuthenticatedMessage, mask } from '@verdaccio/utils';
@@ -23,6 +24,7 @@ const debug = buildDebug('verdaccio:api:user');
export default function (route: Router, auth: Auth, config: Config): void {
route.get(
'/-/user/:org_couchdb_user',
rateLimit(config?.userRateLimit),
function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {
debug('verifying user');
const message = getAuthenticatedMessage(req.remote_user.name);
@@ -53,6 +55,7 @@ export default function (route: Router, auth: Auth, config: Config): void {
*/
route.put(
'/-/user/:org_couchdb_user/:_rev?/:revision?',
rateLimit(config?.userRateLimit),
function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {
const { name, password } = req.body;
debug('login or adduser');

View File

@@ -10,6 +10,7 @@ import {
errorUtils,
validatioUtils,
} from '@verdaccio/core';
import { rateLimit } from '@verdaccio/middleware';
import { Config } from '@verdaccio/types';
import { $NextFunctionVer, $RequestExtend } from '../../types/custom';
@@ -41,6 +42,7 @@ export default function (route: Router, auth: Auth, config: Config): void {
route.get(
'/-/npm/v1/user',
rateLimit(config?.userRateLimit),
function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {
if (_.isNil(req.remote_user.name) === false) {
return next(buildProfile(req.remote_user.name));
@@ -55,6 +57,7 @@ export default function (route: Router, auth: Auth, config: Config): void {
route.post(
'/-/npm/v1/user',
rateLimit(config?.userRateLimit),
function (req: $RequestExtend, res: Response, next: $NextFunctionVer): void {
if (_.isNil(req.remote_user.name)) {
res.status(HTTP_STATUS.UNAUTHORIZED);

View File

@@ -5,6 +5,7 @@ import { getApiToken } from '@verdaccio/auth';
import { Auth } from '@verdaccio/auth';
import { HEADERS, HTTP_STATUS, SUPPORT_ERRORS, errorUtils } from '@verdaccio/core';
import { logger } from '@verdaccio/logger';
import { rateLimit } from '@verdaccio/middleware';
import { Storage } from '@verdaccio/store';
import { Config, RemoteUser, Token } from '@verdaccio/types';
import { mask, stringToMD5 } from '@verdaccio/utils';
@@ -26,6 +27,7 @@ function normalizeToken(token: Token): NormalizeToken {
export default function (route: Router, auth: Auth, storage: Storage, config: Config): void {
route.get(
'/-/npm/v1/tokens',
rateLimit(config?.userRateLimit),
async function (req: $RequestExtend, res: Response, next: $NextFunctionVer) {
const { name } = req.remote_user;
@@ -53,6 +55,7 @@ export default function (route: Router, auth: Auth, storage: Storage, config: Co
route.post(
'/-/npm/v1/tokens',
rateLimit(config?.userRateLimit),
function (req: $RequestExtend, res: Response, next: $NextFunctionVer) {
const { password, readonly, cidr_whitelist } = req.body;
const { name } = req.remote_user;
@@ -123,6 +126,7 @@ export default function (route: Router, auth: Auth, storage: Storage, config: Co
route.delete(
'/-/npm/v1/tokens/token/:tokenKey',
rateLimit(config?.userRateLimit),
async (req: $RequestExtend, res: Response, next: $NextFunctionVer) => {
const {
params: { tokenKey },

View File

@@ -1,5 +1,29 @@
# @verdaccio/auth
## 6.0.0-6-next.40
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/config@6.0.0-6-next.61
- @verdaccio/loaders@6.0.0-6-next.30
- verdaccio-htpasswd@11.0.0-6-next.31
- @verdaccio/core@6.0.0-6-next.61
- @verdaccio/utils@6.0.0-6-next.29
- @verdaccio/logger@6.0.0-6-next.29
## 6.0.0-6-next.39
### Patch Changes
- Updated dependencies [45c03819]
- @verdaccio/config@6.0.0-6-next.60
- @verdaccio/loaders@6.0.0-6-next.29
- verdaccio-htpasswd@11.0.0-6-next.30
- @verdaccio/core@6.0.0-6-next.60
- @verdaccio/logger@6.0.0-6-next.28
- @verdaccio/utils@6.0.0-6-next.28
## 6.0.0-6-next.38
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/auth",
"version": "6.0.0-6-next.38",
"version": "6.0.0-6-next.40",
"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.59",
"@verdaccio/config": "workspace:6.0.0-6-next.59",
"@verdaccio/loaders": "workspace:6.0.0-6-next.28",
"@verdaccio/logger": "workspace:6.0.0-6-next.27",
"@verdaccio/utils": "workspace:6.0.0-6-next.27",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"@verdaccio/config": "workspace:6.0.0-6-next.61",
"@verdaccio/loaders": "workspace:6.0.0-6-next.30",
"@verdaccio/logger": "workspace:6.0.0-6-next.29",
"@verdaccio/utils": "workspace:6.0.0-6-next.29",
"debug": "4.3.4",
"express": "4.18.2",
"jsonwebtoken": "9.0.0",
"lodash": "4.17.21",
"verdaccio-htpasswd": "workspace:11.0.0-6-next.29"
"verdaccio-htpasswd": "workspace:11.0.0-6-next.31"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.19"
"@verdaccio/types": "workspace:11.0.0-6-next.20"
},
"funding": {
"type": "opencollective",

View File

@@ -1,5 +1,25 @@
# @verdaccio/cli
## 6.0.0-6-next.61
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/config@6.0.0-6-next.61
- @verdaccio/node-api@6.0.0-6-next.61
- @verdaccio/core@6.0.0-6-next.61
- @verdaccio/logger@6.0.0-6-next.29
## 6.0.0-6-next.60
### Patch Changes
- Updated dependencies [45c03819]
- @verdaccio/config@6.0.0-6-next.60
- @verdaccio/node-api@6.0.0-6-next.60
- @verdaccio/core@6.0.0-6-next.60
- @verdaccio/logger@6.0.0-6-next.28
## 6.0.0-6-next.59
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/cli",
"version": "6.0.0-6-next.59",
"version": "6.0.0-6-next.61",
"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.59",
"@verdaccio/config": "workspace:6.0.0-6-next.59",
"@verdaccio/logger": "workspace:6.0.0-6-next.27",
"@verdaccio/node-api": "workspace:6.0.0-6-next.59",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"@verdaccio/config": "workspace:6.0.0-6-next.61",
"@verdaccio/logger": "workspace:6.0.0-6-next.29",
"@verdaccio/node-api": "workspace:6.0.0-6-next.61",
"clipanion": "3.1.0",
"envinfo": "7.8.1",
"kleur": "3.0.3",

View File

@@ -1,5 +1,27 @@
# @verdaccio/config
## 6.0.0-6-next.61
### Minor Changes
- d167f92e: chore: rollback yaml dep support old nodejs versions
### Patch Changes
- @verdaccio/core@6.0.0-6-next.61
- @verdaccio/utils@6.0.0-6-next.29
## 6.0.0-6-next.60
### Minor Changes
- 45c03819: refactor: render html middleware
### Patch Changes
- @verdaccio/core@6.0.0-6-next.60
- @verdaccio/utils@6.0.0-6-next.28
## 6.0.0-6-next.59
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/config",
"version": "6.0.0-6-next.59",
"version": "6.0.0-6-next.61",
"description": "logger",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -38,10 +38,10 @@
"build": "pnpm run build:js && pnpm run build:types"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.59",
"@verdaccio/utils": "workspace:6.0.0-6-next.27",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"@verdaccio/utils": "workspace:6.0.0-6-next.29",
"debug": "4.3.4",
"yaml": "2.2.0",
"js-yaml": "4.1.0",
"lodash": "4.17.21",
"minimatch": "3.1.2",
"yup": "0.32.11"

View File

@@ -1,5 +1,17 @@
const pkgVersion = require('../package.json').version;
import _ from 'lodash';
export function getUserAgent(): string {
return `verdaccio/${pkgVersion}`;
export function getUserAgent(
customUserAgent?: boolean | string,
version?: string,
name?: string
): string {
if (customUserAgent === true) {
return `${name}/${version}`;
} else if (_.isString(customUserAgent) && _.isEmpty(customUserAgent) === false) {
return customUserAgent;
} else if (customUserAgent === false) {
return 'hidden';
}
return `${name}/${version}`;
}

View File

@@ -10,6 +10,7 @@ import {
FlagsConfig,
PackageAccess,
PackageList,
RateLimit,
Security,
ServerSettingsConf,
} from '@verdaccio/types';
@@ -28,11 +29,17 @@ const debug = buildDebug('verdaccio:config');
export const WEB_TITLE = 'Verdaccio';
// we limit max 1000 request per 15 minutes on user endpoints
export const defaultUserRateLimiting = {
windowMs: 15 * 60 * 1000, // 15 minutes
max: 1000,
};
/**
* Coordinates the application configuration
*/
class Config implements AppConfig {
public user_agent: string;
public user_agent: string | undefined;
public uplinks: any;
public packages: PackageList;
public users: any;
@@ -49,7 +56,7 @@ class Config implements AppConfig {
// @ts-ignore
public secret: string;
public flags: FlagsConfig;
public userRateLimit: RateLimit;
public constructor(config: ConfigYaml & { config_path: string }) {
const self = this;
this.storage = process.env.VERDACCIO_STORAGE_PATH || config.storage;
@@ -65,6 +72,7 @@ class Config implements AppConfig {
this.flags = {
searchRemote: config.flags?.searchRemote ?? true,
};
this.user_agent = config.user_agent;
for (const configProp in config) {
if (self[configProp] == null) {
@@ -72,11 +80,14 @@ class Config implements AppConfig {
}
}
// @ts-ignore
if (_.isNil(this.user_agent)) {
this.user_agent = getUserAgent();
if (typeof this.user_agent === 'undefined') {
// by default user agent is hidden
debug('set default user agent');
this.user_agent = getUserAgent(false);
}
this.userRateLimit = { ...defaultUserRateLimiting, ...config?.userRateLimit };
// some weird shell scripts are valid yaml files parsed as string
assert(_.isObject(config), APP_ERROR.CONFIG_NOT_VALID);

View File

@@ -5,6 +5,7 @@ export * from './package-access';
export { fromJStoYAML, parseConfigFile } from './parse';
export * from './uplinks';
export * from './security';
export * from './agent';
export * from './user';
export { default as ConfigBuilder } from './builder';
export { getDefaultConfig } from './conf';

View File

@@ -1,7 +1,7 @@
import buildDebug from 'debug';
import fs from 'fs';
import YAML from 'js-yaml';
import { isObject } from 'lodash';
import YAML from 'yaml';
import { APP_ERROR } from '@verdaccio/core';
import { ConfigYaml } from '@verdaccio/types';
@@ -26,7 +26,7 @@ export function parseConfigFile(configPath: string): ConfigYaml & {
debug('parsing config file: %o', configPath);
try {
if (/\.ya?ml$/i.test(configPath)) {
const yamlConfig = YAML.parse(fs.readFileSync(configPath, 'utf8'), {
const yamlConfig = YAML.load(fs.readFileSync(configPath, 'utf8'), {
strict: false,
}) as ConfigYaml;
@@ -56,7 +56,7 @@ export function parseConfigFile(configPath: string): ConfigYaml & {
export function fromJStoYAML(config: Partial<ConfigYaml>): string | null {
debug('convert config from JSON to YAML');
if (isObject(config)) {
return YAML.stringify(config);
return YAML.dump(config);
} else {
throw new Error(`config is not a valid object`);
}

View File

@@ -6,7 +6,7 @@ uplinks:
npmjs:
url: http://localhost:4873/
packages:
"@*/*":
'@*/*':
access: $all
publish: $all
proxy: npmjs
@@ -32,7 +32,7 @@ packages:
access: $authenticated
publish: $authenticated
proxy: npmjs
"*":
'*':
access: $all
publish: $all
proxy: npmjs

View File

@@ -1,5 +1,9 @@
# @verdaccio/core
## 6.0.0-6-next.61
## 6.0.0-6-next.60
## 6.0.0-6-next.59
## 6.0.0-6-next.58

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/core",
"version": "6.0.0-6-next.59",
"version": "6.0.0-6-next.61",
"description": "core utilities",
"keywords": [
"private",
@@ -44,7 +44,7 @@
"lodash": "4.17.21",
"typedoc": "0.23.23",
"typedoc-plugin-missing-exports": "latest",
"@verdaccio/types": "workspace:11.0.0-6-next.19"
"@verdaccio/types": "workspace:11.0.0-6-next.20"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -39,7 +39,7 @@
"lockfile": "1.0.4"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.19"
"@verdaccio/types": "workspace:11.0.0-6-next.20"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -1,5 +1,21 @@
# Change Log
## 11.0.0-6-next.30
### Patch Changes
- @verdaccio/core@6.0.0-6-next.61
- @verdaccio/url@11.0.0-6-next.27
- @verdaccio/utils@6.0.0-6-next.29
## 11.0.0-6-next.29
### Patch Changes
- @verdaccio/core@6.0.0-6-next.60
- @verdaccio/url@11.0.0-6-next.26
- @verdaccio/utils@6.0.0-6-next.28
## 11.0.0-6-next.28
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/tarball",
"version": "11.0.0-6-next.28",
"version": "11.0.0-6-next.30",
"description": "tarball utilities resolver",
"keywords": [
"private",
@@ -34,13 +34,13 @@
},
"dependencies": {
"debug": "4.3.4",
"@verdaccio/core": "workspace:6.0.0-6-next.59",
"@verdaccio/url": "workspace:11.0.0-6-next.25",
"@verdaccio/utils": "workspace:6.0.0-6-next.27",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"@verdaccio/url": "workspace:11.0.0-6-next.27",
"@verdaccio/utils": "workspace:6.0.0-6-next.29",
"lodash": "4.17.21"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.19",
"@verdaccio/types": "workspace:11.0.0-6-next.20",
"node-mocks-http": "1.12.1"
},
"scripts": {

View File

@@ -1,5 +1,11 @@
# Change Log
## 11.0.0-6-next.20
### Minor Changes
- 45c03819: refactor: render html middleware
## 11.0.0-6-next.19
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/types",
"version": "11.0.0-6-next.19",
"version": "11.0.0-6-next.20",
"description": "verdaccio types definitions",
"keywords": [
"private",

View File

@@ -252,6 +252,7 @@ export interface ConfigYaml {
store?: any;
listen?: ListenAddress;
https?: HttpsConf;
user_agent?: string;
http_proxy?: string;
plugins?: string | void | null;
https_proxy?: string;
@@ -264,6 +265,7 @@ export interface ConfigYaml {
url_prefix?: string;
server?: ServerSettingsConf;
flags?: FlagsConfig;
userRateLimit?: RateLimit;
// internal objects, added by internal yaml to JS config parser
// @deprecated use configPath instead
config_path?: string;
@@ -277,7 +279,6 @@ export interface ConfigYaml {
* @extends {ConfigYaml}
*/
export interface Config extends Omit<ConfigYaml, 'packages' | 'security' | 'configPath'> {
user_agent: string;
server_id: string;
secret: string;
// save the configuration file path, it's fails without thi configPath

View File

@@ -1,5 +1,17 @@
# Change Log
## 11.0.0-6-next.27
### Patch Changes
- @verdaccio/core@6.0.0-6-next.61
## 11.0.0-6-next.26
### Patch Changes
- @verdaccio/core@6.0.0-6-next.60
## 11.0.0-6-next.25
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/url",
"version": "11.0.0-6-next.25",
"version": "11.0.0-6-next.27",
"description": "url utilities resolver",
"keywords": [
"private",
@@ -33,13 +33,13 @@
"access": "public"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.59",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"debug": "4.3.4",
"lodash": "4.17.21",
"validator": "13.7.0"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.19",
"@verdaccio/types": "workspace:11.0.0-6-next.20",
"node-mocks-http": "1.12.1"
},
"scripts": {

View File

@@ -1,5 +1,23 @@
# @verdaccio/hooks
## 6.0.0-6-next.31
### Patch Changes
- @verdaccio/core@6.0.0-6-next.61
- @verdaccio/logger@6.0.0-6-next.29
## 6.0.0-6-next.30
### Minor Changes
- 45c03819: refactor: render html middleware
### Patch Changes
- @verdaccio/core@6.0.0-6-next.60
- @verdaccio/logger@6.0.0-6-next.28
## 6.0.0-6-next.29
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/hooks",
"version": "6.0.0-6-next.29",
"version": "6.0.0-6-next.31",
"description": "loaders logic",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -29,8 +29,8 @@
"node": ">=16"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.59",
"@verdaccio/logger": "workspace:6.0.0-6-next.27",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"@verdaccio/logger": "workspace:6.0.0-6-next.29",
"core-js": "3.27.0",
"debug": "4.3.4",
"handlebars": "4.7.7",
@@ -38,9 +38,9 @@
},
"devDependencies": {
"@types/node": "16.18.10",
"@verdaccio/auth": "workspace:6.0.0-6-next.38",
"@verdaccio/config": "workspace:6.0.0-6-next.59",
"@verdaccio/types": "workspace:11.0.0-6-next.19"
"@verdaccio/auth": "workspace:6.0.0-6-next.40",
"@verdaccio/config": "workspace:6.0.0-6-next.61",
"@verdaccio/types": "workspace:11.0.0-6-next.20"
},
"scripts": {
"clean": "rimraf ./build",

View File

@@ -15,7 +15,7 @@ const singleHeaderNotificationConfig = parseConfigFile(
);
const multiNotificationConfig = parseConfigFile(parseConfigurationNotifyFile('multiple.notify'));
setup([]);
setup({});
const domain = 'http://slack-service';

View File

@@ -1,5 +1,17 @@
# @verdaccio/loaders
## 6.0.0-6-next.30
### Patch Changes
- @verdaccio/logger@6.0.0-6-next.29
## 6.0.0-6-next.29
### Patch Changes
- @verdaccio/logger@6.0.0-6-next.28
## 6.0.0-6-next.28
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/loaders",
"version": "6.0.0-6-next.28",
"version": "6.0.0-6-next.30",
"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.27",
"@verdaccio/logger": "workspace:6.0.0-6-next.29",
"debug": "4.3.4",
"lodash": "4.17.21"
},
"devDependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.59",
"@verdaccio/config": "workspace:6.0.0-6-next.59",
"@verdaccio/types": "workspace:11.0.0-6-next.19",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"@verdaccio/config": "workspace:6.0.0-6-next.61",
"@verdaccio/types": "workspace:11.0.0-6-next.20",
"@verdaccio-scope/verdaccio-auth-foo": "0.0.2",
"verdaccio-auth-memory": "workspace:*",
"customprefix-auth": "1.0.0-6-next.0"

View File

@@ -1,5 +1,17 @@
# @verdaccio/logger-7
## 6.0.0-6-next.6
### Patch Changes
- @verdaccio/logger-commons@6.0.0-6-next.29
## 6.0.0-6-next.5
### Patch Changes
- @verdaccio/logger-commons@6.0.0-6-next.28
## 6.0.0-6-next.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/logger-7",
"version": "6.0.0-6-next.4",
"version": "6.0.0-6-next.6",
"description": "logger for verdaccio 5.x version",
"main": "./build/index.js",
"types": "./build/index.d.ts",
@@ -38,11 +38,11 @@
"build": "pnpm run build:js && pnpm run build:types"
},
"dependencies": {
"@verdaccio/logger-commons": "workspace:6.0.0-6-next.27",
"@verdaccio/logger-commons": "workspace:6.0.0-6-next.29",
"pino": "7.11.0"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.19"
"@verdaccio/types": "workspace:11.0.0-6-next.20"
},
"funding": {
"type": "opencollective",

View File

@@ -1,5 +1,17 @@
# @verdaccio/logger-commons
## 6.0.0-6-next.29
### Patch Changes
- @verdaccio/core@6.0.0-6-next.61
## 6.0.0-6-next.28
### Patch Changes
- @verdaccio/core@6.0.0-6-next.60
## 6.0.0-6-next.27
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/logger-commons",
"version": "6.0.0-6-next.27",
"version": "6.0.0-6-next.29",
"description": "logger",
"main": "./build/index.js",
"types": "./build/index.d.ts",
@@ -38,14 +38,14 @@
"build": "pnpm run build:js && pnpm run build:types"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.59",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"@verdaccio/logger-prettify": "workspace:6.0.0-6-next.9",
"debug": "4.3.4",
"colorette": "2.0.19"
},
"devDependencies": {
"pino": "8.8.0",
"@verdaccio/types": "workspace:11.0.0-6-next.19"
"@verdaccio/types": "workspace:11.0.0-6-next.20"
},
"funding": {
"type": "opencollective",

View File

@@ -1,5 +1,17 @@
# @verdaccio/logger
## 6.0.0-6-next.29
### Patch Changes
- @verdaccio/logger-commons@6.0.0-6-next.29
## 6.0.0-6-next.28
### Patch Changes
- @verdaccio/logger-commons@6.0.0-6-next.28
## 6.0.0-6-next.27
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/logger",
"version": "6.0.0-6-next.27",
"version": "6.0.0-6-next.29",
"description": "logger",
"main": "./build/index.js",
"types": "./build/index.d.ts",
@@ -38,11 +38,11 @@
"build": "pnpm run build:js && pnpm run build:types"
},
"dependencies": {
"@verdaccio/logger-commons": "workspace:6.0.0-6-next.27",
"@verdaccio/logger-commons": "workspace:6.0.0-6-next.29",
"pino": "8.8.0"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.19"
"@verdaccio/types": "workspace:11.0.0-6-next.20"
},
"funding": {
"type": "opencollective",

View File

@@ -1,5 +1,29 @@
# @verdaccio/middleware
## 6.0.0-6-next.40
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/config@6.0.0-6-next.61
- @verdaccio/core@6.0.0-6-next.61
- @verdaccio/url@11.0.0-6-next.27
- @verdaccio/utils@6.0.0-6-next.29
## 6.0.0-6-next.39
### Minor Changes
- 45c03819: refactor: render html middleware
### Patch Changes
- Updated dependencies [45c03819]
- @verdaccio/config@6.0.0-6-next.60
- @verdaccio/core@6.0.0-6-next.60
- @verdaccio/url@11.0.0-6-next.26
- @verdaccio/utils@6.0.0-6-next.28
## 6.0.0-6-next.38
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@verdaccio/middleware",
"version": "6.0.0-6-next.38",
"version": "6.0.0-6-next.40",
"description": "express middleware utils",
"main": "./build/index.js",
"types": "build/index.d.ts",
@@ -38,18 +38,23 @@
"build": "pnpm run build:js && pnpm run build:types"
},
"dependencies": {
"@verdaccio/core": "workspace:6.0.0-6-next.59",
"@verdaccio/utils": "workspace:6.0.0-6-next.27",
"@verdaccio/core": "workspace:6.0.0-6-next.61",
"@verdaccio/utils": "workspace:6.0.0-6-next.29",
"@verdaccio/config": "workspace:6.0.0-6-next.61",
"@verdaccio/url": "workspace:11.0.0-6-next.27",
"debug": "4.3.4",
"lru-cache": "7.14.1",
"express": "4.18.2",
"lodash": "4.17.21",
"mime": "2.6.0"
"mime": "2.6.0",
"express-rate-limit": "5.5.1"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/verdaccio"
},
"devDependencies": {
"@verdaccio/logger": "workspace:6.0.0-6-next.27",
"@verdaccio/logger": "workspace:6.0.0-6-next.29",
"body-parser": "1.20.1",
"supertest": "6.3.3"
}

View File

@@ -7,6 +7,9 @@ export { expectJson } from './middlewares/json';
export { antiLoop } from './middlewares/antiLoop';
export { final } from './middlewares/final';
export { allow } from './middlewares/allow';
export { rateLimit } from './middlewares/rate-limit';
export { userAgent } from './middlewares/user-agent';
export { webMiddleware } from './middlewares/web';
export { errorReportingMiddleware, handleError } from './middlewares/error';
export {
log,

View File

@@ -0,0 +1,8 @@
import RateLimit from 'express-rate-limit';
import { RateLimit as RateLimitType } from '@verdaccio/types';
export function rateLimit(rateLimitOptions?: RateLimitType) {
const limiter = new RateLimit(rateLimitOptions);
return limiter;
}

View File

@@ -0,0 +1,10 @@
import { getUserAgent } from '@verdaccio/config';
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
export function userAgent(config) {
return function (_req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
res.setHeader('x-powered-by', getUserAgent(config?.user_agent));
next();
};
}

View File

@@ -4,15 +4,7 @@ import {
validatePackage as utilValidatePackage,
} from '@verdaccio/utils';
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';
export function validateName(
req: $RequestExtend,
res: $ResponseExtend,
next: $NextFunctionVer,
value: string,
name: string
): void {
export function validateName(_req, _res, next, value: string, name: string) {
if (value === '-') {
// special case in couchdb usually
next('route');
@@ -23,13 +15,7 @@ export function validateName(
}
}
export function validatePackage(
req: $RequestExtend,
res: $ResponseExtend,
next: $NextFunctionVer,
value: string,
name: string
): void {
export function validatePackage(_req, _res, next, value: string, name: string) {
if (value === '-') {
// special case in couchdb usually
next('route');

View File

@@ -0,0 +1 @@
export { default as webMiddleware } from './web-middleware';

View File

@@ -1,39 +1,16 @@
import buildDebug from 'debug';
import express from 'express';
import _ from 'lodash';
import fs from 'fs';
import path from 'path';
import { HTTP_STATUS } from '@verdaccio/core';
import { asyncLoadPlugin } from '@verdaccio/loaders';
import { logger } from '@verdaccio/logger';
import { isURLhasValidProtocol } from '@verdaccio/url';
import renderHTML from '../renderHTML';
import { setSecurityWebHeaders } from './security';
import renderHTML, { isHTTPProtocol } from './utils/renderHTML';
const debug = buildDebug('verdaccio:web:render');
export async function loadTheme(config: any) {
if (_.isNil(config.theme) === false) {
const plugin = await asyncLoadPlugin(
config.theme,
{ config, logger },
// TODO: add types { staticPath: string; manifest: unknown; manifestFiles: unknown }
function (plugin: any) {
return plugin.staticPath && plugin.manifest && plugin.manifestFiles;
},
config?.serverSettings?.pluginPrefix ?? 'verdaccio-theme'
);
if (plugin.length > 1) {
logger.warn(
'multiple ui themes has been detected and is not supported, only the first one will be used'
);
}
return _.head(plugin);
}
}
const sendFileCallback = (next) => (err) => {
if (!err) {
return;
@@ -45,14 +22,15 @@ const sendFileCallback = (next) => (err) => {
}
};
export async function renderWebMiddleware(config, auth): Promise<any> {
const { staticPath, manifest, manifestFiles } =
(await loadTheme(config)) || require('@verdaccio/ui-theme')();
export function renderWebMiddleware(config, tokenMiddleware, pluginOptions) {
const { staticPath, manifest, manifestFiles } = pluginOptions;
debug('static path %o', staticPath);
/* eslint new-cap:off */
const router = express.Router();
router.use(auth.webUIJWTmiddleware());
if (typeof tokenMiddleware === 'function') {
router.use(tokenMiddleware);
}
router.use(setSecurityWebHeaders);
// Logo
@@ -77,6 +55,36 @@ export async function renderWebMiddleware(config, auth): Promise<any> {
res.sendFile(file, sendFileCallback(next));
});
// logo
if (config?.web?.logo && !isHTTPProtocol(config?.web?.logo)) {
// URI related to a local file
const absoluteLocalFile = path.posix.resolve(config.web.logo);
debug('serve local logo %s', absoluteLocalFile);
try {
// TODO: remove existsSync by async alternative
if (
fs.existsSync(absoluteLocalFile) &&
typeof fs.accessSync(absoluteLocalFile, fs.constants.R_OK) === 'undefined'
) {
// Note: `path.join` will break on Windows, because it transforms `/` to `\`
// Use POSIX version `path.posix.join` instead.
config.web.logo = path.posix.join('/-/static/', path.basename(config.web.logo));
router.get(config.web.logo, function (_req, res, next) {
// @ts-ignore
debug('serve custom logo web:%s - local:%s', config.web.logo, absoluteLocalFile);
res.sendFile(absoluteLocalFile, sendFileCallback(next));
});
debug('enabled custom logo %s', config.web.logo);
} else {
config.web.logo = undefined;
debug(`web logo is wrong, path ${absoluteLocalFile} does not exist or is not readable`);
}
} catch {
config.web.logo = undefined;
debug(`web logo is wrong, path ${absoluteLocalFile} does not exist or is not readable`);
}
}
router.get('/-/web/:section/*', function (req, res) {
renderHTML(config, manifest, manifestFiles, req, res);
debug('render html section');

View File

@@ -1,11 +1,6 @@
import { HEADERS } from '@verdaccio/core';
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '@verdaccio/middleware';
export function setSecurityWebHeaders(
req: $RequestExtend,
res: $ResponseExtend,
next: $NextFunctionVer
): void {
export function setSecurityWebHeaders(_req, res, next): void {
// disable loading in frames (clickjacking, etc.)
res.header(HEADERS.FRAMES_OPTIONS, 'deny');
// avoid stablish connections outside of domain

View File

@@ -1,5 +1,6 @@
import buildDebug from 'debug';
import LRU from 'lru-cache';
import path from 'path';
import { URL } from 'url';
import { WEB_TITLE } from '@verdaccio/config';
@@ -8,9 +9,8 @@ import { TemplateUIOptions } from '@verdaccio/types';
import { getPublicUrl } from '@verdaccio/url';
import renderTemplate from './template';
import { hasLogin, validatePrimaryColor } from './utils/web-utils';
import { hasLogin, validatePrimaryColor } from './web-utils';
const pkgJSON = require('../package.json');
const DEFAULT_LANGUAGE = 'es-US';
const cache = new LRU({ max: 500, ttl: 1000 * 60 * 60 });
@@ -21,6 +21,26 @@ const defaultManifestFiles = {
ico: 'favicon.ico',
};
/**
* Check if URI is starting with "http://", "https://" or "//"
* @param {string} uri
*/
export function isHTTPProtocol(uri: string): boolean {
return /^(https?:)?\/\//.test(uri);
}
export function resolveLogo(config, req) {
const isLocalFile = config?.web?.logo && !isHTTPProtocol(config?.web?.logo);
if (isLocalFile) {
return `${getPublicUrl(config?.url_prefix, req)}-/static/${path.basename(config?.web?.logo)}`;
} else if (isHTTPProtocol(config?.web?.logo)) {
return config?.web?.logo;
} else {
return '';
}
}
export default function renderHTML(config, manifest, manifestFiles, req, res) {
const { url_prefix } = config;
const base = getPublicUrl(config?.url_prefix, req);
@@ -33,11 +53,13 @@ export default function renderHTML(config, manifest, manifestFiles, req, res) {
const title = config?.web?.title ?? WEB_TITLE;
const login = hasLogin(config);
const scope = config?.web?.scope ?? '';
const logoURI = config?.web?.logo ?? '';
const logoURI = resolveLogo(config, req);
const pkgManagers = config?.web?.pkgManagers ?? ['yarn', 'pnpm', 'npm'];
const version = pkgJSON.version;
const version = config?.web?.version;
const flags = {
...config.flags,
// legacy from 5.x
...config.experiments,
};
const primaryColor = validatePrimaryColor(config?.web?.primary_color) ?? '#4b5e40';
const {

View File

@@ -2,7 +2,7 @@ import buildDebug from 'debug';
import { TemplateUIOptions } from '@verdaccio/types';
import { Manifest, getManifestValue } from './utils/manifest';
import { Manifest, getManifestValue } from './manifest';
const debug = buildDebug('verdaccio:web:render:template');

View File

@@ -0,0 +1,18 @@
import buildDebug from 'debug';
import _ from 'lodash';
const debug = buildDebug('verdaccio:web:middlwares');
export function validatePrimaryColor(primaryColor) {
const isHex = /^#([0-9A-F]{3}){1,2}$/i.test(primaryColor);
if (!isHex) {
debug('invalid primary color %o', primaryColor);
return;
}
return primaryColor;
}
export function hasLogin(config: any) {
return _.isNil(config?.web?.login) || config?.web?.login === true;
}

View File

@@ -0,0 +1,27 @@
import express from 'express';
import { Router } from 'express';
import { validateName, validatePackage } from '../validation';
import { setSecurityWebHeaders } from './security';
export function webMiddleware(tokenMiddleware, webEndpointsApi) {
// eslint-disable-next-line new-cap
const route = Router();
// validate all of these params as a package name
// this might be too harsh, so ask if it causes trouble=
route.param('package', validatePackage);
route.param('filename', validateName);
route.param('version', validateName);
route.use(express.urlencoded({ extended: false }));
if (typeof tokenMiddleware === 'function') {
route.use(tokenMiddleware);
}
route.use(setSecurityWebHeaders);
if (webEndpointsApi) {
route.use(webEndpointsApi);
}
return route;
}

View File

@@ -0,0 +1,15 @@
import express from 'express';
import { renderWebMiddleware } from './render-web';
import { webMiddleware } from './web-api';
export default (config, middlewares, pluginOptions): any => {
// eslint-disable-next-line new-cap
const router = express.Router();
const { tokenMiddleware, webEndpointsApi } = middlewares;
// render web
router.use('/', renderWebMiddleware(config, tokenMiddleware, pluginOptions));
// web endpoints, search, packages, etc
router.use('/-/verdaccio/', webMiddleware(tokenMiddleware, webEndpointsApi));
return router;
};

View File

@@ -0,0 +1,8 @@
import path from 'path';
import { parseConfigFile } from '@verdaccio/config';
export const getConf = (configName: string) => {
const configPath = path.join(__dirname, 'config', configName);
return parseConfigFile(configPath);
};

View File

@@ -0,0 +1,28 @@
auth:
auth-memory:
users:
test:
name: test
password: test
web:
title: verdaccio
publish:
allow_offline: false
uplinks:
log: { type: stdout, format: pretty, level: trace }
packages:
'@*/*':
access: $anonymous
publish: $anonymous
'**':
access: $anonymous
publish: $anonymous
_debug: true
flags:
changePassword: true

View File

@@ -0,0 +1,29 @@
auth:
auth-memory:
users:
test:
name: test
password: test
web:
title: verdaccio
login: false
publish:
allow_offline: false
uplinks:
log: { type: stdout, format: pretty, level: trace }
packages:
'@*/*':
access: $anonymous
publish: $anonymous
'**':
access: $anonymous
publish: $anonymous
_debug: true
flags:
changePassword: true

View File

@@ -0,0 +1,23 @@
web:
title: verdaccio web
login: true
scope: '@scope'
pkgManagers:
- pnpm
- yarn
showInfo: true
showSettings: true
showSearch: true
showFooter: true
showThemeSwitch: true
showDownloadTarball: true
showRaw: true
primary_color: '#ffffff'
logoURI: 'http://logo.org/logo.png'
url_prefix: /prefix
log: { type: stdout, format: pretty, level: trace }
flags:
changePassword: true

View File

@@ -1,4 +1,4 @@
import { getManifestValue } from '../src/utils/manifest';
import { getManifestValue } from '../src/middlewares/web/utils/manifest';
const manifest = require('./partials/manifest/manifest.json');

View File

@@ -0,0 +1 @@
export const parseHtml = (html) => require('node-html-parser').parse(html);

View File

@@ -0,0 +1,64 @@
{
"main.js": "/-/static/main.6126058572f989c948b1.js",
"main.css": "/-/static/main.6f2f2cccce0c813b509f.css",
"main.woff2": "/-/static/fonts/roboto-latin-900italic.woff2",
"main.woff": "/-/static/fonts/roboto-latin-900italic.woff",
"main.svg": "/-/static/93df1ce974e744e7d98f5d842da74ba0.svg",
"runtime.js": "/-/static/runtime.6126058572f989c948b1.js",
"NotFound.js": "/-/static/NotFound.6126058572f989c948b1.js",
"NotFound.svg": "/-/static/4743f1431b042843890a8644e89bb852.svg",
"Provider.js": "/-/static/Provider.6126058572f989c948b1.js",
"Version.css": "/-/static/454.97490e2b7f0dca05ddf3.css",
"Home.js": "/-/static/Home.6126058572f989c948b1.js",
"Home.css": "/-/static/268.97490e2b7f0dca05ddf3.css",
"Versions.js": "/-/static/Versions.6126058572f989c948b1.js",
"UpLinks.js": "/-/static/UpLinks.6126058572f989c948b1.js",
"Dependencies.js": "/-/static/Dependencies.6126058572f989c948b1.js",
"Engines.js": "/-/static/Engines.6126058572f989c948b1.js",
"Engines.svg": "/-/static/737531cc93ceb77b82b1c2e074a2557a.svg",
"Engines.png": "/-/static/2939f26c293bff8f35ba87194742aea8.png",
"Dist.js": "/-/static/Dist.6126058572f989c948b1.js",
"Install.js": "/-/static/Install.6126058572f989c948b1.js",
"Install.svg": "/-/static/1f07aa4bad48cd09088966736d1ed121.svg",
"Repository.js": "/-/static/Repository.6126058572f989c948b1.js",
"Repository.png": "/-/static/728ff5a8e44d74cd0f2359ef0a9ec88a.png",
"vendors.js": "/-/static/vendors.6126058572f989c948b1.js",
"38.6126058572f989c948b1.js": "/-/static/38.6126058572f989c948b1.js",
"26.6126058572f989c948b1.js": "/-/static/26.6126058572f989c948b1.js",
"761.6126058572f989c948b1.js": "/-/static/761.6126058572f989c948b1.js",
"4743f1431b042843890a8644e89bb852.svg": "/-/static/4743f1431b042843890a8644e89bb852.svg",
"node.png": "/-/static/2939f26c293bff8f35ba87194742aea8.png",
"fonts/roboto-latin-900italic.woff": "/-/static/fonts/roboto-latin-900italic.woff",
"fonts/roboto-latin-300italic.woff": "/-/static/fonts/roboto-latin-300italic.woff",
"fonts/roboto-latin-500italic.woff": "/-/static/fonts/roboto-latin-500italic.woff",
"fonts/roboto-latin-400italic.woff": "/-/static/fonts/roboto-latin-400italic.woff",
"fonts/roboto-latin-100italic.woff": "/-/static/fonts/roboto-latin-100italic.woff",
"fonts/roboto-latin-700italic.woff": "/-/static/fonts/roboto-latin-700italic.woff",
"fonts/roboto-latin-500.woff": "/-/static/fonts/roboto-latin-500.woff",
"fonts/roboto-latin-900.woff": "/-/static/fonts/roboto-latin-900.woff",
"fonts/roboto-latin-100.woff": "/-/static/fonts/roboto-latin-100.woff",
"fonts/roboto-latin-700.woff": "/-/static/fonts/roboto-latin-700.woff",
"fonts/roboto-latin-300.woff": "/-/static/fonts/roboto-latin-300.woff",
"fonts/roboto-latin-400.woff": "/-/static/fonts/roboto-latin-400.woff",
"fonts/roboto-latin-900italic.woff2": "/-/static/fonts/roboto-latin-900italic.woff2",
"fonts/roboto-latin-300italic.woff2": "/-/static/fonts/roboto-latin-300italic.woff2",
"fonts/roboto-latin-400italic.woff2": "/-/static/fonts/roboto-latin-400italic.woff2",
"fonts/roboto-latin-500italic.woff2": "/-/static/fonts/roboto-latin-500italic.woff2",
"fonts/roboto-latin-700italic.woff2": "/-/static/fonts/roboto-latin-700italic.woff2",
"fonts/roboto-latin-100italic.woff2": "/-/static/fonts/roboto-latin-100italic.woff2",
"fonts/roboto-latin-500.woff2": "/-/static/fonts/roboto-latin-500.woff2",
"fonts/roboto-latin-700.woff2": "/-/static/fonts/roboto-latin-700.woff2",
"fonts/roboto-latin-100.woff2": "/-/static/fonts/roboto-latin-100.woff2",
"fonts/roboto-latin-300.woff2": "/-/static/fonts/roboto-latin-300.woff2",
"fonts/roboto-latin-400.woff2": "/-/static/fonts/roboto-latin-400.woff2",
"fonts/roboto-latin-900.woff2": "/-/static/fonts/roboto-latin-900.woff2",
"favicon.ico": "/-/static/favicon.ico",
"git.png": "/-/static/728ff5a8e44d74cd0f2359ef0a9ec88a.png",
"logo.svg": "/-/static/93df1ce974e744e7d98f5d842da74ba0.svg",
"pnpm.svg": "/-/static/81ca2d852b9bc86713fe993bf5c7104c.svg",
"yarn.svg": "/-/static/1f07aa4bad48cd09088966736d1ed121.svg",
"logo-black-and-white.svg": "/-/static/983328eca26f265748c004651ca0e6c8.svg",
"npm.svg": "/-/static/737531cc93ceb77b82b1c2e074a2557a.svg",
"index.html": "/-/static/index.html",
"package.svg": "/-/static/4743f1431b042843890a8644e89bb852.svg"
}

View File

@@ -1,3 +1,4 @@
import express from 'express';
import { JSDOM } from 'jsdom';
import path from 'path';
import supertest from 'supertest';
@@ -5,33 +6,30 @@ import supertest from 'supertest';
import { HEADERS, HEADER_TYPE, HTTP_STATUS } from '@verdaccio/core';
import { setup } from '@verdaccio/logger';
import { initializeServer } from './helper';
import { webMiddleware } from '../src';
import { getConf } from './_helper';
setup([]);
const pluginOptions = {
manifestFiles: {
js: ['runtime.js', 'vendors.js', 'main.js'],
},
staticPath: path.join(__dirname, 'static'),
manifest: require('./partials/manifest/manifest.json'),
};
const mockManifest = jest.fn();
jest.mock('@verdaccio/ui-theme', () => mockManifest());
const initializeServer = (configName: string, middlewares = {}) => {
const app = express();
app.use(webMiddleware(getConf(configName), middlewares, pluginOptions));
return app;
};
setup({});
describe('test web server', () => {
beforeAll(() => {
mockManifest.mockReturnValue(() => ({
manifestFiles: {
js: ['runtime.js', 'vendors.js', 'main.js'],
},
staticPath: path.join(__dirname, 'static'),
manifest: require('./partials/manifest/manifest.json'),
}));
});
afterEach(() => {
jest.clearAllMocks();
mockManifest.mockClear();
});
describe('render', () => {
describe('output', () => {
const render = async (config = 'default-test.yaml') => {
const response = await supertest(await initializeServer(config))
const response = await supertest(initializeServer(config))
.get('/')
.set('Accept', HEADERS.TEXT_HTML)
.expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.TEXT_HTML_UTF8)
@@ -59,7 +57,7 @@ describe('test web server', () => {
// base: 'http://127.0.0.1:60864/prefix/',
// version: '6.0.0-6-next.28',
logoURI: '',
flags: { searchRemote: true },
flags: { changePassword: true },
login: true,
pkgManagers: ['pnpm', 'yarn'],
title: 'verdaccio web',

View File

@@ -0,0 +1,3 @@
{
main: '';
}

View File

@@ -0,0 +1,3 @@
{
'vendors': '';
}

View File

@@ -1,4 +1,4 @@
import template from '../src/template';
import template from '../src/middlewares/web/utils/template';
const manifest = require('./partials/manifest/manifest.json');

View File

@@ -1,4 +1,4 @@
import { validatePrimaryColor } from '../src/utils/web-utils';
import { validatePrimaryColor } from '../src/middlewares/web/utils/web-utils';
describe('Utilities', () => {
describe('validatePrimaryColor', () => {

View File

@@ -10,6 +10,12 @@
{
"path": "../auth"
},
{
"path": "../core/url"
},
{
"path": "../core/core"
},
{
"path": "../logger/logger"
},

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