Compare commits
147 Commits
@verdaccio
...
@verdaccio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88850dce24 | ||
|
|
5c5057fc5f | ||
|
|
04c081b8b2 | ||
|
|
2d2473188d | ||
|
|
6291f5ee1e | ||
|
|
2aa73bb083 | ||
|
|
62c5b919a3 | ||
|
|
44c8f823b4 | ||
|
|
a219e1e11c | ||
|
|
16f58b93c1 | ||
|
|
08aade9a68 | ||
|
|
044eb36ed2 | ||
|
|
338076971a | ||
|
|
cb2281a50d | ||
|
|
fd8bfd5d5f | ||
|
|
99de53b368 | ||
|
|
a556829e5e | ||
|
|
11aee7c712 | ||
|
|
c62accf1ea | ||
|
|
f68232cde8 | ||
|
|
910f728588 | ||
|
|
0022bd28ec | ||
|
|
ca9d11ac2b | ||
|
|
73599b031e | ||
|
|
6a7252f169 | ||
|
|
8c8a761ec0 | ||
|
|
f9f51e82c5 | ||
|
|
771f36a407 | ||
|
|
343aa8dc6e | ||
|
|
f4adf120c3 | ||
|
|
ec9bf85553 | ||
|
|
a3c3e64355 | ||
|
|
f91f7d78a0 | ||
|
|
be85f26bf7 | ||
|
|
7a7840542e | ||
|
|
54a696c428 | ||
|
|
6041f258bb | ||
|
|
f92f20a0af | ||
|
|
15806469f1 | ||
|
|
865478d0ae | ||
|
|
2f59abfc1a | ||
|
|
400ff02a87 | ||
|
|
9e293673be | ||
|
|
30807f05f3 | ||
|
|
5d795ac62f | ||
|
|
5438af9323 | ||
|
|
a5af486e85 | ||
|
|
869f659e3a | ||
|
|
5d13d9ff42 | ||
|
|
93356027cc | ||
|
|
76a9206d1e | ||
|
|
a36ed9b510 | ||
|
|
a94dbbe272 | ||
|
|
48cda34145 | ||
|
|
894394a4f0 | ||
|
|
22c1faa6ec | ||
|
|
7fb055d408 | ||
|
|
fbbf0d6c7c | ||
|
|
4b4afd5ffe | ||
|
|
fb18fc4879 | ||
|
|
3b0cc2c41f | ||
|
|
59d529a2e1 | ||
|
|
70cf4cff12 | ||
|
|
8a76992c35 | ||
|
|
7e83e4e37a | ||
|
|
fcf4cf4d7e | ||
|
|
8b39837b23 | ||
|
|
79ca7954ad | ||
|
|
0c94890ab7 | ||
|
|
7beeaf7af9 | ||
|
|
4915752cb4 | ||
|
|
3ff8af4a59 | ||
|
|
71f5ef2d59 | ||
|
|
71af2686cb | ||
|
|
d8ea9e69e5 | ||
|
|
9ca3dfb3fa | ||
|
|
36a3a38839 | ||
|
|
be65079c17 | ||
|
|
8c7d984dd1 | ||
|
|
89f52e98cd | ||
|
|
8abcbd620a | ||
|
|
45415b2850 | ||
|
|
a10fc4dc33 | ||
|
|
531f89da88 | ||
|
|
7d2fc97b53 | ||
|
|
0969d29b44 | ||
|
|
a33b3289b5 | ||
|
|
5717720544 | ||
|
|
7126fa2071 | ||
|
|
b60ed45359 | ||
|
|
3c0fc27c42 | ||
|
|
c27112488f | ||
|
|
23dbb756f9 | ||
|
|
b269716694 | ||
|
|
e4571d631e | ||
|
|
537f586873 | ||
|
|
750c5f4b08 | ||
|
|
8f53047c5e | ||
|
|
392458aa07 | ||
|
|
09942448df | ||
|
|
ad70d4b283 | ||
|
|
211a52ad57 | ||
|
|
5becb4e255 | ||
|
|
853c77d212 | ||
|
|
9f79713e96 | ||
|
|
8a3c30b134 | ||
|
|
9aa0b92e79 | ||
|
|
e9b36249ef | ||
|
|
b13ab88f85 | ||
|
|
e27c080d97 | ||
|
|
c014af3300 | ||
|
|
91734f58b2 | ||
|
|
5290b9fa2d | ||
|
|
cbb6c657a5 | ||
|
|
9915b73e73 | ||
|
|
3f2aa98fcb | ||
|
|
4ff5d28487 | ||
|
|
850afccbb7 | ||
|
|
9195f0bce7 | ||
|
|
0126893055 | ||
|
|
79cdf449f5 | ||
|
|
0c150fa869 | ||
|
|
8c6f251590 | ||
|
|
914da01729 | ||
|
|
e91a3ee8a3 | ||
|
|
16bc81f985 | ||
|
|
f395e375fe | ||
|
|
3e1ab6910c | ||
|
|
9051fd8f76 | ||
|
|
c262209871 | ||
|
|
c20d9bb6b2 | ||
|
|
16cdae1921 | ||
|
|
8006e73d0a | ||
|
|
4e0017a089 | ||
|
|
a606c6e125 | ||
|
|
8f835eb265 | ||
|
|
fb19e2052d | ||
|
|
000a5e2be5 | ||
|
|
4c9f611da0 | ||
|
|
84584948a9 | ||
|
|
24524f5ea4 | ||
|
|
9c9484df5d | ||
|
|
424ee24a08 | ||
|
|
d4f5f2fc18 | ||
|
|
e1947aaba6 | ||
|
|
489a5c82bd | ||
|
|
a08fd39e0e |
@@ -4,7 +4,7 @@
|
||||
"commit": false,
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "master",
|
||||
"baseBranch": "6.x",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": []
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
'@verdaccio/config': patch
|
||||
---
|
||||
|
||||
Feature
|
||||
|
||||
- add option to set storage from environment variable VERDACCIO_STORAGE_PATH
|
||||
|
||||
#### Related tickets
|
||||
|
||||
https://github.com/verdaccio/verdaccio/issues/1681
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
'@verdaccio/tarball': patch
|
||||
'@verdaccio/mock': patch
|
||||
'@verdaccio/ui-theme': patch
|
||||
'@verdaccio/server': patch
|
||||
'@verdaccio/utils': patch
|
||||
'verdaccio': patch
|
||||
---
|
||||
|
||||
Bug Fixes
|
||||
|
||||
- fix escaped slash in namespaced packages
|
||||
|
||||
#### Related tickets
|
||||
|
||||
https://github.com/verdaccio/verdaccio/pull/2193
|
||||
@@ -47,11 +47,9 @@
|
||||
"few-cooks-destroy",
|
||||
"fifty-jars-rest",
|
||||
"gentle-trains-switch",
|
||||
"healthy-poets-compare",
|
||||
"hip-hounds-destroy",
|
||||
"late-adults-love",
|
||||
"late-parents-act",
|
||||
"many-vans-care",
|
||||
"modern-spies-tell",
|
||||
"neat-toes-report",
|
||||
"perfect-kangaroos-agree",
|
||||
|
||||
@@ -9,4 +9,3 @@ node_modules/
|
||||
static/
|
||||
website/
|
||||
wiki/
|
||||
dist/
|
||||
|
||||
6
.github/workflows/changesets.yml
vendored
6
.github/workflows/changesets.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 6.x
|
||||
|
||||
env:
|
||||
CI: true
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
version:
|
||||
timeout-minutes: 14
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/master' && github.repository == 'verdaccio/verdaccio'
|
||||
if: github.ref == 'refs/heads/6.x' && github.repository == 'verdaccio/verdaccio'
|
||||
steps:
|
||||
- name: checkout code repository
|
||||
uses: actions/checkout@v2
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
run: pnpm build
|
||||
|
||||
- name: create versions
|
||||
uses: verdaccio/changeset-action@master
|
||||
uses: changesets/action@master
|
||||
with:
|
||||
version: pnpm ci:version
|
||||
commit: 'chore: update versions'
|
||||
|
||||
45
.github/workflows/ci-e2e-ui.yml
vendored
Normal file
45
.github/workflows/ci-e2e-ui.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: E2E UI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 6.x
|
||||
- 'changeset-release/6.x'
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/ci.yml
|
||||
- 'packages/**'
|
||||
- 'jest/**'
|
||||
- 'package.json'
|
||||
- 'pnpm-workspace.yaml'
|
||||
- 'test/**'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node_version: [14]
|
||||
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
- name: Install pnpm
|
||||
run: npm i -g pnpm@latest
|
||||
- name: Install
|
||||
run: pnpm recursive install
|
||||
- name: Clean
|
||||
run: pnpm clean
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
- name: Test UI
|
||||
run: pnpm test:e2e:ui
|
||||
env:
|
||||
DEBUG: verdaccio:e2e*
|
||||
45
.github/workflows/ci-e2e.yml
vendored
Normal file
45
.github/workflows/ci-e2e.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: E2E CLI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 5.x
|
||||
- 'changeset-release/6.x'
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/ci.yml
|
||||
- 'packages/**'
|
||||
- 'jest/**'
|
||||
- 'package.json'
|
||||
- 'pnpm-workspace.yaml'
|
||||
- 'test/**'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node_version: [14]
|
||||
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
- name: Install pnpm
|
||||
run: npm i -g pnpm@latest
|
||||
- name: Install
|
||||
run: pnpm recursive install
|
||||
- name: Clean
|
||||
run: pnpm clean
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
- name: Test CLI
|
||||
run: pnpm test:e2e:cli
|
||||
env:
|
||||
DEBUG: verdaccio:e2e*
|
||||
49
.github/workflows/ci-pnpm-dev.yml
vendored
Normal file
49
.github/workflows/ci-pnpm-dev.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: CI with pnpm 6
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 5.x
|
||||
- 'changeset-release/6.x'
|
||||
pull_request:
|
||||
paths:
|
||||
- .changeset/**
|
||||
- .github/workflows/ci.yml
|
||||
- 'packages/**'
|
||||
- 'jest/**'
|
||||
- 'package.json'
|
||||
- 'pnpm-workspace.yaml'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node_version: [12, 15]
|
||||
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node_version: ${{ matrix.node_version }}
|
||||
- name: Install pnpm
|
||||
run: sudo npm i pnpm@dev -g
|
||||
- name: Install
|
||||
run: pnpm recursive install
|
||||
- name: Format
|
||||
run: pnpm format:check
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
- name: Clean
|
||||
run: pnpm clean
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
- name: Test
|
||||
run: pnpm test
|
||||
env:
|
||||
DEBUG: verdaccio:web:*
|
||||
39
.github/workflows/ci-website.yml
vendored
Normal file
39
.github/workflows/ci-website.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: CI Website
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/ci-website.yml
|
||||
- 'website/**'
|
||||
jobs:
|
||||
ci:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
node_version: [14]
|
||||
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node_version: ${{ matrix.node_version }}
|
||||
- name: Install pnpm
|
||||
run: npm i -g pnpm
|
||||
- name: Install
|
||||
run: pnpm recursive install
|
||||
- name: Format
|
||||
run: pnpm format:check
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
- name: Build website
|
||||
run: |
|
||||
cd website
|
||||
pnpm build
|
||||
227
.github/workflows/ci.yml
vendored
227
.github/workflows/ci.yml
vendored
@@ -3,8 +3,8 @@ name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'changeset-release/master'
|
||||
- 6.x
|
||||
- 'changeset-release/6.x'
|
||||
pull_request:
|
||||
paths:
|
||||
- .changeset/**
|
||||
@@ -13,228 +13,37 @@ on:
|
||||
- 'jest/**'
|
||||
- 'package.json'
|
||||
- 'pnpm-workspace.yaml'
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
name: setup verdaccio
|
||||
services:
|
||||
verdaccio:
|
||||
image: verdaccio/verdaccio:5
|
||||
ports:
|
||||
- 4873:4873
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node 14
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- name: set store
|
||||
run: |
|
||||
mkdir ~/.pnpm-store
|
||||
pnpm config set store-dir ~/.pnpm-store
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
|
||||
- name: Cache .pnpm-store
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
pnpm-
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
name: Lint
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
name: Format
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: Lint
|
||||
run: pnpm format:check
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
name: build
|
||||
needs: [format, lint]
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
## we run scripts due gatsby needs it
|
||||
## when website is excluded we can add --ignore-scripts
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: build
|
||||
run: pnpm build
|
||||
- name: tar packages
|
||||
run: |
|
||||
tar -czvf ${{ github.workspace }}/pkg.tar.gz -C ${{ github.workspace }}/packages .
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
path: pkg.tar.gz
|
||||
test:
|
||||
needs: build
|
||||
ci:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
node_version: [12, 14]
|
||||
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: Test
|
||||
run: pnpm test
|
||||
ci-e2e-ui:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
name: UI Test E2E Node 14
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
## we need scripts, pupetter downloads aditional content
|
||||
run: pnpm recursive install --frozen-lockfile
|
||||
- name: Test UI
|
||||
run: pnpm test:e2e:ui
|
||||
env:
|
||||
DEBUG: verdaccio:e2e*
|
||||
ci-e2e-cli:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
name: CLI Test E2E Node 14
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
## we need scripts, pupetter downloads aditional content
|
||||
run: pnpm recursive install --frozen-lockfile
|
||||
- name: Test CLI
|
||||
run: pnpm test:e2e:cli
|
||||
website:
|
||||
needs: [format, lint]
|
||||
runs-on: ubuntu-latest
|
||||
name: website build node 14
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile
|
||||
- name: Build website
|
||||
run: |
|
||||
cd website
|
||||
pnpm build:website
|
||||
test-windows:
|
||||
needs: [format, lint]
|
||||
runs-on: windows-latest
|
||||
name: windows test node 14
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node 14
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
# pnpm cache is not working for windows (we need a solution)
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: build
|
||||
run: pnpm recursive install
|
||||
- name: Format
|
||||
run: pnpm format:check
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
- name: Clean
|
||||
run: pnpm clean
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
- name: Test
|
||||
run: pnpm test
|
||||
env:
|
||||
DEBUG: verdaccio:web:*
|
||||
|
||||
7
.github/workflows/codeql-analysis.yml
vendored
7
.github/workflows/codeql-analysis.yml
vendored
@@ -1,9 +1,14 @@
|
||||
name: 'Code scanning - action'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 5.x
|
||||
- 'changeset-release/6.x'
|
||||
- 'dev/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/codeql-analysis.yml
|
||||
- .github/workflows/ci.yml
|
||||
- 'packages/**'
|
||||
schedule:
|
||||
- cron: '0 2 * * 4'
|
||||
|
||||
30
.github/workflows/docker-publish-pre-check.yml
vendored
Normal file
30
.github/workflows/docker-publish-pre-check.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Docker & Publish Pre-check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/docker-publish-pre-check.yml
|
||||
- 'packages/**'
|
||||
- 'docker-bin/**'
|
||||
- 'package.json'
|
||||
- 'lerna.json'
|
||||
|
||||
jobs:
|
||||
testDocker:
|
||||
name: Test Docker Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Build
|
||||
run: npm run docker
|
||||
env:
|
||||
VERDACCIO_BUILD_REGISTRY: https://registry.verdaccio.org
|
||||
# testVerdaccio:
|
||||
# name: Test Verdaccio Publish
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v1
|
||||
# - name: Publish
|
||||
# uses: verdaccio/github-actions/publish@v0.4.0
|
||||
# with:
|
||||
# args: -d
|
||||
6
.github/workflows/docker-publish.yml
vendored
6
.github/workflows/docker-publish.yml
vendored
@@ -12,7 +12,7 @@ on:
|
||||
- 'Dockerfile'
|
||||
- '.dockerignore'
|
||||
branches:
|
||||
- 'master'
|
||||
- '6.x'
|
||||
tags:
|
||||
- 'v*'
|
||||
jobs:
|
||||
@@ -34,8 +34,8 @@ jobs:
|
||||
uses: crazy-max/ghaction-docker-meta@v1
|
||||
with:
|
||||
images: ${{ github.repository }}
|
||||
tag-custom: nightly-master
|
||||
tag-custom-only: ${{ github.ref == 'refs/heads/master' }}
|
||||
tag-custom: 6.x-next
|
||||
tag-custom-only: ${{ github.ref == 'refs/heads/6.x' }}
|
||||
tag-semver: |
|
||||
{{version}}
|
||||
{{major}}
|
||||
|
||||
1
.npmrc
1
.npmrc
@@ -2,4 +2,3 @@ always-auth = true
|
||||
recursive-install = true
|
||||
registry = https://registry.verdaccio.org
|
||||
loglevel=warn
|
||||
fetch-retries="10"
|
||||
|
||||
19
CHANGELOG.md
19
CHANGELOG.md
@@ -2,25 +2,6 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [5.0.0](https://github.com/verdaccio/verdaccio/compare/v5.0.0-alpha.7...v5.0.0) (2021-04-09)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* prepare release for v5 ([#2175](https://github.com/verdaccio/verdaccio/issues/2175)) ([82c5c4e](https://github.com/verdaccio/verdaccio/commit/82c5c4eb32bfcbf9aec7c96340b226b626526b45))
|
||||
|
||||
## [5.0.0-alpha.7](https://github.com/verdaccio/verdaccio/compare/v5.0.0-alpha.6...v5.0.0-alpha.7) (2021-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ui readme missing css ([#2174](https://github.com/verdaccio/verdaccio/issues/2174)) ([f49ca06](https://github.com/verdaccio/verdaccio/commit/f49ca06c68919f920e10f4f5878c34d5886b2e02))
|
||||
* Upgrade Node from 14.16 to 14.16.1 for security fixes ([#2172](https://github.com/verdaccio/verdaccio/issues/2172)) ([6ab3163](https://github.com/verdaccio/verdaccio/commit/6ab31639fab97b1b3e6323c4da862a1cae3ae1c6)), closes [/github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V14.md#14](https://github.com/verdaccio//github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V14.md/issues/14)
|
||||
|
||||
## [5.0.0-alpha.6](https://github.com/verdaccio/verdaccio/compare/v5.0.0-alpha.5...v5.0.0-alpha.6) (2021-04-06)
|
||||
|
||||
## [5.0.0-alpha.5](https://github.com/verdaccio/verdaccio/compare/v5.0.0-alpha.4...v5.0.0-alpha.5) (2021-04-03)
|
||||
|
||||
## [5.0.0-alpha.4](https://github.com/verdaccio/verdaccio/compare/v5.0.0-alpha.3...v5.0.0-alpha.4) (2021-04-03)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:14.16.1-alpine as builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:14.15.1-alpine as builder
|
||||
|
||||
ENV NODE_ENV=development \
|
||||
VERDACCIO_BUILD_REGISTRY=https://registry.verdaccio.org
|
||||
@@ -19,7 +19,7 @@ RUN npm -g i pnpm@latest && \
|
||||
# FIXME: need to remove devDependencies from the build
|
||||
# RUN pnpm install --prod --ignore-scripts
|
||||
|
||||
FROM node:14.16.1-alpine
|
||||
FROM node:14.15.1-alpine
|
||||
LABEL maintainer="https://github.com/verdaccio/verdaccio"
|
||||
|
||||
ENV VERDACCIO_APPDIR=/opt/verdaccio \
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Verdaccio contributors
|
||||
Copyright (c) 2018 Verdaccio community
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
214
README.md
214
README.md
@@ -1,10 +1,6 @@
|
||||

|
||||
|
||||

|
||||
|
||||
# Version 6 (Development branch)
|
||||
|
||||
> Looking for Verdaccio 5? Check branch `5.x`.
|
||||
# Version 6.x (Under development)
|
||||
|
||||
[Verdaccio](https://verdaccio.org/) is a simple, **zero-config-required local private npm registry**.
|
||||
No need for an entire database just to get started! Verdaccio comes out of the box with
|
||||
@@ -14,209 +10,43 @@ For those looking to extend their storage capabilities, Verdaccio
|
||||
**supports various community-made plugins to hook into services such as Amazon's s3,
|
||||
Google Cloud Storage** or create your own plugin.
|
||||
|
||||
[](https://www.npmjs.com/package/verdaccio)
|
||||
[](https://www.npmjs.com/package/verdaccio)
|
||||
[](https://verdaccio.org/docs/en/docker.html)
|
||||
[](https://opencollective.com/verdaccio)
|
||||
[](https://stackshare.io/verdaccio)
|
||||
|
||||
[](http://chat.verdaccio.org/)
|
||||
[](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)
|
||||
[](https://crowdin.com/project/verdaccio)
|
||||
[](https://www.tickgit.com/browse?repo=github.com/verdaccio/verdaccio)
|
||||
|
||||
[](https://twitter.com/verdaccio_npm)
|
||||
[](https://github.com/verdaccio/verdaccio/stargazers)
|
||||
|
||||
## Install
|
||||
## Install 6.x
|
||||
|
||||
Install with npm:
|
||||
> ⚠️ Not available on npmjs
|
||||
|
||||
With docker
|
||||
|
||||
```bash
|
||||
npm install --global verdaccio@6-next --https://registry.verdaccio.org/
|
||||
docker pull verdaccio/verdaccio:6.x-next
|
||||
```
|
||||
|
||||
> Published on a temporary registry while setup is ready to publish on npmjs
|
||||
## Development
|
||||
|
||||
Please check [docs/development.md](docs/development.md) for further notes.
|
||||
|
||||
## Roadmap
|
||||
|
||||
Please check [the roadmap](https://github.com/verdaccio/verdaccio/discussions/1690) if you are willing to contribute.
|
||||
|
||||
## Donations
|
||||
|
||||
Verdaccio is run by **volunteers**; nobody is working full-time on it. If you find this project to be useful and would like to support its development, consider making a donation - **your logo might end up in this readme.** 😉
|
||||
|
||||
**[Donate](https://github.com/sponsors/verdaccio)** 💵👍🏻 starting from _$1/month_ or just one single contribution.
|
||||
|
||||
## What does Verdaccio do for me?
|
||||
|
||||
### Use private packages
|
||||
|
||||
If you want to use all benefits of npm package system in your company without sending all code to the public, and use your private packages just as easy as public ones.
|
||||
|
||||
### Cache npmjs.org registry
|
||||
|
||||
If you have more than one server you want to install packages on, you might want to use this to decrease latency
|
||||
(presumably "slow" npmjs.org will be connected to only once per package/version) and provide limited failover (if npmjs.org is down, we might still find something useful in the cache) or avoid issues like _[How one developer just broke Node, Babel and thousands of projects in 11 lines of JavaScript](https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/)_, _[Many packages suddenly disappeared](https://github.com/npm/registry-issue-archive/issues/255)_ or _[Registry returns 404 for a package I have installed before](https://github.com/npm/registry-issue-archive/issues/329)_.
|
||||
|
||||
### Link multiple registries
|
||||
|
||||
If you use multiples registries in your organization and need to fetch packages from multiple sources in one single project you might take advance of the uplinks feature with Verdaccio, chaining multiple registries and fetching from one single endpoint.
|
||||
|
||||
### Override public packages
|
||||
|
||||
If you want to use a modified version of some 3rd-party package (for example, you found a bug, but maintainer didn't accept pull request yet), you can publish your version locally under the same name. See in detail [here](https://verdaccio.org/docs/en/best#override-public-packages).
|
||||
|
||||
### E2E Testing
|
||||
|
||||
Verdaccio has proved to be a lightweight registry that can be
|
||||
booted in a couple of seconds, fast enough for any CI. Many open source projects use verdaccio for end to end testing, to mention some examples, **create-react-app**, **mozilla neutrino**, **pnpm**, **storybook**, **alfresco** or **eclipse theia**. You can read more in dedicated article to E2E in our blog.
|
||||
|
||||
## Talks
|
||||
|
||||
### **Node.js Dependency Confusion Attacks**.
|
||||
|
||||
[](https://www.youtube.com/watch?v=qTRADSp3Hpo)
|
||||
|
||||
You might want to check out as well our previous talks:
|
||||
|
||||
- [**OpenJS World 2020** about \*Cover your Projects with a Multi purpose Lightweight Node.js Registry - **Juan Picado\***](https://www.youtube.com/watch?v=oVCjDWeehAQ)
|
||||
- [ViennaJS Meetup - Introduction to Verdaccio by **Priscila Olivera** and **Juan Picado**](https://www.youtube.com/watch?v=hDIFKzmoCa)
|
||||
- [Open Source? trivago - Verdaccio (**Ayush** and **Juan Picado**) January 2020](https://www.youtube.com/watch?v=A5CWxJC9xzc)
|
||||
- [GitNation Open Source Stage - How we have built a Node.js Registry with React - **Juan Picado** December 2019](https://www.youtube.com/watch?v=gpjC8Qp9B9A)
|
||||
- [Verdaccio - A lightweight Private Proxy Registry built in Node.js | **Juan Picado** at The Destro Dev Show](https://www.youtube.com/watch?reload=9&v=P_hxy7W-IL4&ab_channel=TheDestroDevShow)
|
||||
|
||||
## Get Started
|
||||
|
||||
Run in your terminal
|
||||
|
||||
```bash
|
||||
verdaccio
|
||||
```
|
||||
|
||||
You would need set some npm configuration, this is optional.
|
||||
|
||||
```bash
|
||||
$ npm set registry http://localhost:4873/
|
||||
```
|
||||
|
||||
For one-off commands or to avoid setting the registry globally:
|
||||
|
||||
```bash
|
||||
NPM_CONFIG_REGISTRY=http://localhost:4873 npm i
|
||||
```
|
||||
|
||||
Now you can navigate to [http://localhost:4873/](http://localhost:4873/) where your local packages will be listed and can be searched.
|
||||
|
||||
> Warning: Verdaccio [does not currently support PM2's cluster mode](https://github.com/verdaccio/verdaccio/issues/1301#issuecomment-489302298), running it with cluster mode may cause unknown behavior.
|
||||
|
||||
## Publishing
|
||||
|
||||
#### 1. create a user and log in
|
||||
|
||||
```bash
|
||||
npm adduser --registry http://localhost:4873
|
||||
```
|
||||
|
||||
> if you use HTTPS, add an appropriate CA information ("null" means get CA list from OS)
|
||||
|
||||
```bash
|
||||
$ npm set ca null
|
||||
```
|
||||
|
||||
#### 2. publish your package
|
||||
|
||||
```bash
|
||||
npm publish --registry http://localhost:4873
|
||||
```
|
||||
|
||||
This will prompt you for user credentials which will be saved on the `verdaccio` server.
|
||||
|
||||
## Docker
|
||||
|
||||
Below are the most commonly needed information,
|
||||
every aspect of Docker and verdaccio is [documented separately](https://www.verdaccio.org/docs/en/docker.html)
|
||||
|
||||
```
|
||||
docker pull verdaccio/verdaccio:nightly-master
|
||||
```
|
||||
|
||||
Available as [tags](https://hub.docker.com/r/verdaccio/verdaccio/tags/).
|
||||
|
||||
### Running verdaccio using Docker
|
||||
|
||||
To run the docker container:
|
||||
|
||||
```bash
|
||||
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio
|
||||
```
|
||||
|
||||
Docker examples are available [in this repository](https://github.com/verdaccio/docker-examples).
|
||||
|
||||
## Compatibility
|
||||
|
||||
Verdaccio aims to support all features of a standard npm client that make sense to support in private repository. Unfortunately, it isn't always possible.
|
||||
|
||||
### Basic features
|
||||
|
||||
- Installing packages (npm install, npm upgrade, etc.) - **supported**
|
||||
- Publishing packages (npm publish) - **supported**
|
||||
|
||||
### Advanced package control
|
||||
|
||||
- Unpublishing packages (npm unpublish) - **supported**
|
||||
- Tagging (npm tag) - **supported**
|
||||
- Deprecation (npm deprecate) - **supported**
|
||||
|
||||
### User management
|
||||
|
||||
- Registering new users (npm adduser {newuser}) - **supported**
|
||||
- Change password (npm profile set password) - **supported**
|
||||
- Transferring ownership (npm owner add {user} {pkg}) - not supported, _PR-welcome_
|
||||
- Token (npm token) - **supported**
|
||||
|
||||
### Miscellany
|
||||
|
||||
- Searching (npm search) - **supported** (cli / browser)
|
||||
- Ping (npm ping) - **supported**
|
||||
- Starring (npm star, npm unstar, npm stars) - **supported**
|
||||
|
||||
### Security
|
||||
|
||||
- npm/yarn audit - **supported**
|
||||
**[Donate](https://opencollective.com/verdaccio)** 💵👍🏻 starting from _\$1/month_ or just one single contribution.
|
||||
|
||||
## Report a vulnerability
|
||||
|
||||
If you want to report a security vulnerability, please follow the steps which we have defined for you in our [security policy](https://github.com/verdaccio/verdaccio/security/policy).
|
||||
|
||||
## Core Team
|
||||
|
||||
| [Juan Picado](https://github.com/juanpicado) | [Ayush Sharma](https://github.com/ayusharma) | [Sergio Hg](https://github.com/sergiohgz) |
|
||||
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------- |
|
||||
|  |  |  |
|
||||
| [@jotadeveloper](https://twitter.com/jotadeveloper) | [@ayusharma\_](https://twitter.com/ayusharma_) | [@sergiohgz](https://twitter.com/sergiohgz) |
|
||||
| [Priscila Oliveria](https://github.com/priscilawebdev) | [Daniel Ruf](https://github.com/DanielRuf) |
|
||||
|  |  |
|
||||
| [@priscilawebdev](https://twitter.com/priscilawebdev) | [@DanielRufde](https://twitter.com/DanielRufde) |
|
||||
|
||||
You can find and chat with then over Discord, click [here](http://chat.verdaccio.org) or follow them at _Twitter_.
|
||||
|
||||
## Who is using Verdaccio?
|
||||
|
||||
- [create-react-app](https://github.com/facebook/create-react-app/blob/master/CONTRIBUTING.md#customizing-e2e-registry-configuration) _(+86.2k ⭐️)_
|
||||
- [Gatsby](https://github.com/gatsbyjs/gatsby) _(+49.2k ⭐️)_
|
||||
- [Babel.js](https://github.com/babel/babel) _(+38.5k ⭐️)_
|
||||
- [Vue CLI](https://github.com/vuejs/vue-cli) _(+27.4k ⭐️)_
|
||||
- [Angular CLI](https://github.com/angular/angular-cli) _(+24.3k ⭐️)_
|
||||
- [Uppy](https://github.com/transloadit/uppy) _(+23.8k ⭐️)_
|
||||
- [bit](https://github.com/teambit/bit) _(+13k ⭐️)_
|
||||
- [Aurelia Framework](https://github.com/aurelia/framework) _(+11.6k ⭐️)_
|
||||
- [pnpm](https://github.com/pnpm/pnpm) _(+10.1k ⭐️)_
|
||||
- [ethereum/web3.js](https://github.com/ethereum/web3.js) _(+9.8k ⭐️)_
|
||||
- [NX](https://github.com/nrwl/nx) _(+6.1k ⭐️)_
|
||||
- [webiny-js](https://github.com/webiny/webiny-js) _(+4.3k ⭐️)_
|
||||
- [Mozilla Neutrino](https://github.com/neutrinojs/neutrino) _(+3.7k ⭐️)_
|
||||
- [workshopper how to npm](https://github.com/workshopper/how-to-npm) _(+1k ⭐️)_
|
||||
- [Amazon SDK v3](https://github.com/aws/aws-sdk-js-v3)
|
||||
- [Amazon Encryption SDK for Javascript](https://github.com/aws/aws-encryption-sdk-javascript)
|
||||
|
||||
🤓 Don't be shy, you also can be in [the list](https://github.com/verdaccio/website/blob/master/docs/who-is-using.md).
|
||||
|
||||
## Open Collective Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/verdaccio#sponsor)]
|
||||
@@ -244,9 +74,7 @@ Thanks to the following companies to help us to achieve our goals providing free
|
||||
|
||||
[](https://www.jetbrains.com/)
|
||||
[](https://crowdin.com/)
|
||||
[](https://www.browserstack.com/)
|
||||
|
||||
Verdaccio also is part of to the [Docker Open Source Program](https://www.docker.com/blog/expanded-support-for-open-source-software-projects/).
|
||||
[](https://balsamiq.com/)
|
||||
|
||||
## Contributors
|
||||
|
||||
@@ -259,17 +87,17 @@ This project exists thanks to all the people who contribute. [[Contribute](CONTR
|
||||
If you have any issue you can try the following options, do no desist to ask or check our issues database, perhaps someone has asked already what you are looking for.
|
||||
|
||||
- [Blog](https://verdaccio.org/blog/)
|
||||
- [Donations](https://github.com/sponsors/verdaccio)
|
||||
- [Reporting an issue](https://github.com/verdaccio/verdaccio/issues/new/choose)
|
||||
- [Donations](https://opencollective.com/verdaccio)
|
||||
- [Reporting an issue](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md#reporting-a-bug)
|
||||
- [Running discussions](https://github.com/verdaccio/verdaccio/issues?q=is%3Aissue+is%3Aopen+label%3Adiscuss)
|
||||
- [Chat](http://chat.verdaccio.org/)
|
||||
- [Logos](https://verdaccio.org/docs/en/logo)
|
||||
- [Docker Examples](https://github.com/verdaccio/verdaccio/tree/master/docker-examples)
|
||||
- [FAQ](https://github.com/verdaccio/verdaccio/discussions/categories/q-a)
|
||||
- [Docker Examples](https://github.com/verdaccio/docker-examples)
|
||||
- [FAQ](https://github.com/verdaccio/verdaccio/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3Aquestion%20)
|
||||
|
||||
### License
|
||||
|
||||
Verdaccio is [MIT licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)
|
||||
|
||||
The Verdaccio documentation and logos (excluding /thanks, e.g., .md, .png, .sketch) files within the /assets folder) is
|
||||
[Creative Commons licensed](https://creativecommons.org/licenses/by/4.0/).
|
||||
[Creative Commons licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE-docs).
|
||||
|
||||
@@ -1,19 +1,44 @@
|
||||
# Docker + Kubernetes Examples
|
||||
|
||||
This folder aims to create a collection of Docker and Kubernetes examples.
|
||||
|
||||
For more information about the **Helm** Chart, please check it [owns repo](https://github.com/verdaccio/charts).
|
||||
|
||||
> Feel free to contribute whether you consider any use case is relevant for the public in general.
|
||||
|
||||
## Examples
|
||||
|
||||
The following examples aim to be demonstrative and can be either improved or updated.
|
||||
|
||||
- [v4 examples](v4/README.md)
|
||||
- [v5 examples](v5/README.md)
|
||||
### Verdaccio 5
|
||||
|
||||
## Aditional data
|
||||
- [Docker + Nginx + Verdaccio](v5/reverse_proxy/nginx/README.md)
|
||||
|
||||
This folder aims to create a collection of Docker and Kubernetes examples.
|
||||
### Verdaccio 4
|
||||
|
||||
#### Proxies
|
||||
|
||||
- [Docker + Apache + Verdaccio](v4/apache-verdaccio/README.md)
|
||||
- [Docker + Nginx + Verdaccio](v4/reverse_proxy/nginx/README.md)
|
||||
- [Docker + https-portal Example](v4/https-portal-example/README.md)
|
||||
|
||||
#### Plugins
|
||||
|
||||
- [Docker + Uplinks Multi Registry](v4/multi-registry-uplink/README.md)
|
||||
- [Docker + Local Storage](v4/docker-local-storage-volume/readme.md)
|
||||
- [Docker + External Plugins](v4/docker-plugin-external/README.md)
|
||||
|
||||
#### Auth
|
||||
|
||||
- [Docker + LDAP (OpenLDAP) Server + Verdaccio 4](v4/ldap-verdaccio/readme.md) by **@kopax**
|
||||
- [Docker + Gitlab](gitlab-verdaccio/README.md)
|
||||
- [Docker + Active Directory](https://github.com/Mateus-Oli/verdaccio-ad-docker)
|
||||
|
||||
#### Storage
|
||||
|
||||
- [Docker + AWS S3 Plugin(localstack) + Verdaccio 4](v4/amazon-s3-docker-example/v4/README.md)
|
||||
- [Docker + Minio](https://github.com/barolab/verdaccio-minio/tree/master/example)
|
||||
|
||||
For more information about the **Helm** Chart, please check it [owns repo](https://github.com/verdaccio/charts).
|
||||
### Kubernetes
|
||||
|
||||
- Kubernetes (minikube) + Verdaccio (Basic Configuration)
|
||||
@@ -21,7 +46,8 @@ For more information about the **Helm** Chart, please check it [owns repo](https
|
||||
|
||||
### External
|
||||
|
||||
- [Verdaccio examples for Google Cloud and K8s setups. https://github.com/papezt/verdaccio-examples](https://github.com/papezt/verdaccio-examples)
|
||||
- [
|
||||
Verdaccio examples for Google Cloud and K8s setups. https://github.com/papezt/verdaccio-examples](https://github.com/papezt/verdaccio-examples)
|
||||
|
||||
### Articles
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# Verdaccio 4
|
||||
|
||||
#### Proxies
|
||||
|
||||
- [Docker + Apache + Verdaccio](v4/apache-verdaccio/README.md)
|
||||
- [Docker + Nginx + Verdaccio](v4/reverse_proxy/nginx/README.md)
|
||||
- [Docker + https-portal Example](v4/https-portal-example/README.md)
|
||||
|
||||
#### Plugins
|
||||
|
||||
- [Docker + Uplinks Multi Registry](v4/multi-registry-uplink/README.md)
|
||||
- [Docker + Local Storage](v4/docker-local-storage-volume/readme.md)
|
||||
- [Docker + External Plugins](v4/docker-plugin-external/README.md)
|
||||
|
||||
#### Auth
|
||||
|
||||
- [Docker + LDAP (OpenLDAP) Server + Verdaccio 4](v4/ldap-verdaccio/readme.md) by **@kopax**
|
||||
- [Docker + Gitlab](gitlab-verdaccio/README.md)
|
||||
- [Docker + Active Directory](https://github.com/Mateus-Oli/verdaccio-ad-docker)
|
||||
|
||||
#### Storage
|
||||
|
||||
- [Docker + AWS S3 Plugin(localstack) + Verdaccio 4](v4/amazon-s3-docker-example/v4/README.md)
|
||||
- [Docker + Minio](https://github.com/barolab/verdaccio-minio/tree/master/example)
|
||||
@@ -1,5 +0,0 @@
|
||||
# Verdaccio 5
|
||||
|
||||
> Before run examples, build the local image by running `pnpm docker`.
|
||||
|
||||
- [Docker + Nginx + Verdaccio](v5/reverse_proxy/nginx/README.md)
|
||||
@@ -44,7 +44,3 @@ The default header to identify the protocol is `X-Forwarded-Proto`, but there ar
|
||||
```
|
||||
$ VERDACCIO_FORWARDED_PROTO=CloudFront-Forwarded-Proto verdaccio --listen 5000
|
||||
```
|
||||
|
||||
#### VERDACCIO_STORAGE_PATH
|
||||
|
||||
By default, the storage is taken from config file, but using this variable allows to set it from environment variable.
|
||||
|
||||
45
package.json
45
package.json
@@ -14,30 +14,30 @@
|
||||
"url": "https://opencollective.com/verdaccio"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.13.14",
|
||||
"@babel/core": "7.13.15",
|
||||
"@babel/node": "7.13.13",
|
||||
"@babel/plugin-proposal-class-properties": "7.13.0",
|
||||
"@babel/plugin-proposal-decorators": "7.13.15",
|
||||
"@babel/cli": "7.12.13",
|
||||
"@babel/core": "7.12.13",
|
||||
"@babel/node": "7.12.13",
|
||||
"@babel/plugin-proposal-class-properties": "7.12.13",
|
||||
"@babel/plugin-proposal-decorators": "7.12.13",
|
||||
"@babel/plugin-proposal-export-namespace-from": "7.12.13",
|
||||
"@babel/plugin-proposal-function-sent": "7.12.13",
|
||||
"@babel/plugin-proposal-json-strings": "7.13.8",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.13.8",
|
||||
"@babel/plugin-proposal-json-strings": "7.12.13",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.12.13",
|
||||
"@babel/plugin-proposal-numeric-separator": "7.12.13",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.13.8",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.13.12",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.12.13",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.12.13",
|
||||
"@babel/plugin-proposal-throw-expressions": "7.12.13",
|
||||
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
||||
"@babel/plugin-syntax-import-meta": "7.10.4",
|
||||
"@babel/plugin-transform-async-to-generator": "7.13.0",
|
||||
"@babel/plugin-transform-classes": "7.13.0",
|
||||
"@babel/plugin-transform-runtime": "7.13.15",
|
||||
"@babel/plugin-transform-async-to-generator": "7.12.13",
|
||||
"@babel/plugin-transform-classes": "7.12.13",
|
||||
"@babel/plugin-transform-runtime": "7.12.15",
|
||||
"@babel/polyfill": "7.12.1",
|
||||
"@babel/preset-env": "7.13.15",
|
||||
"@babel/preset-react": "7.13.13",
|
||||
"@babel/preset-typescript": "7.13.0",
|
||||
"@babel/register": "7.13.14",
|
||||
"@babel/runtime": "7.13.10",
|
||||
"@babel/preset-env": "7.12.13",
|
||||
"@babel/preset-react": "7.12.13",
|
||||
"@babel/preset-typescript": "7.12.13",
|
||||
"@babel/register": "7.12.13",
|
||||
"@babel/runtime": "7.12.13",
|
||||
"@changesets/changelog-github": "^0.2.8",
|
||||
"@changesets/cli": "^2.15.0",
|
||||
"@changesets/get-dependents-graph": "^1.2.0",
|
||||
@@ -78,7 +78,7 @@
|
||||
"babel-plugin-emotion": "11.0.0",
|
||||
"codecov": "3.8.1",
|
||||
"concurrently": "^5.3.0",
|
||||
"core-js": "^3.10.1",
|
||||
"core-js": "^3.8.3",
|
||||
"cross-env": "7.0.3",
|
||||
"detect-secrets": "1.0.6",
|
||||
"eslint": "7.19.0",
|
||||
@@ -110,11 +110,11 @@
|
||||
"prettier": "2.2.1",
|
||||
"rimraf": "3.0.2",
|
||||
"selfsigned": "1.10.8",
|
||||
"standard-version": "8.0.0",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.2.4",
|
||||
"update-ts-references": "2.3.0",
|
||||
"verdaccio": "^5.0.1",
|
||||
"typescript": "^4.1.3",
|
||||
"verdaccio": "next",
|
||||
"verdaccio-audit": "workspace:*",
|
||||
"verdaccio-auth-memory": "workspace:*",
|
||||
"verdaccio-htpasswd": "workspace:*",
|
||||
@@ -147,8 +147,7 @@
|
||||
"ci:version": "run-s ci:version:changeset ci:version:install",
|
||||
"ci:version:install": "pnpm install --frozen-lockfile=false",
|
||||
"ci:version:changeset": "changeset version",
|
||||
"ci:publish": "changeset publish",
|
||||
"ts:ref": "update-ts-references --discardComments"
|
||||
"ci:publish": "changeset publish"
|
||||
},
|
||||
"license": "MIT",
|
||||
"commitlint": {
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
# @verdaccio/api
|
||||
|
||||
## 6.0.0-6-next.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1810ed0d]
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/config@6.0.0-6-next.5
|
||||
- @verdaccio/tarball@11.0.0-6-next.5
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
- @verdaccio/auth@6.0.0-6-next.7
|
||||
- @verdaccio/hooks@6.0.0-6-next.4
|
||||
- @verdaccio/store@6.0.0-6-next.7
|
||||
- @verdaccio/middleware@6.0.0-6-next.7
|
||||
|
||||
## 6.0.0-6-next.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/api",
|
||||
"version": "6.0.0-6-next.9",
|
||||
"version": "6.0.0-6-next.8",
|
||||
"description": "loaders logic",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -39,15 +39,15 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/hooks": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/middleware": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/tarball": "workspace:11.0.0-6-next.5",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/middleware": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/tarball": "workspace:11.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3",
|
||||
"cookies": "0.8.0",
|
||||
"debug": "^4.1.1",
|
||||
"express": "4.17.1",
|
||||
@@ -56,7 +56,7 @@
|
||||
"semver": "7.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.10",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.9",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4",
|
||||
"body-parser": "1.19.0",
|
||||
"lodash": "^4.17.20",
|
||||
|
||||
@@ -8,34 +8,40 @@
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../auth"
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../commons"
|
||||
},
|
||||
{
|
||||
"path": "../hooks"
|
||||
},
|
||||
{
|
||||
"path": "../store"
|
||||
},
|
||||
{
|
||||
"path": "../middleware"
|
||||
},
|
||||
{
|
||||
"path": "../auth"
|
||||
},
|
||||
{
|
||||
"path": "../server"
|
||||
},
|
||||
{
|
||||
"path": "../loaders"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../core/tarball"
|
||||
},
|
||||
{
|
||||
"path": "../hooks"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../middleware"
|
||||
},
|
||||
{
|
||||
"path": "../server"
|
||||
},
|
||||
{
|
||||
"path": "../store"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
# @verdaccio/auth
|
||||
|
||||
## 6.0.0-6-next.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1810ed0d]
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/config@6.0.0-6-next.5
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
- @verdaccio/loaders@6.0.0-6-next.4
|
||||
|
||||
## 6.0.0-6-next.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/auth",
|
||||
"version": "6.0.0-6-next.7",
|
||||
"version": "6.0.0-6-next.6",
|
||||
"description": "logger",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -39,11 +39,12 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/loaders": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3",
|
||||
"verdaccio-htpasswd": "workspace:11.0.0-alpha.6",
|
||||
"debug": "^4.1.1",
|
||||
"express": "4.17.1",
|
||||
@@ -51,7 +52,7 @@
|
||||
"lodash": "4.17.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"funding": {
|
||||
|
||||
@@ -8,13 +8,10 @@
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../config"
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../core/htpasswd"
|
||||
"path": "../commons"
|
||||
},
|
||||
{
|
||||
"path": "../loaders"
|
||||
@@ -22,11 +19,17 @@
|
||||
{
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../mock"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../core/htpasswd"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
# @verdaccio/cli
|
||||
|
||||
## 6.0.0-6-next.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1810ed0d]
|
||||
- @verdaccio/config@6.0.0-6-next.5
|
||||
- @verdaccio/node-api@6.0.0-6-next.11
|
||||
|
||||
## 6.0.0-6-next.10
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/cli",
|
||||
"version": "6.0.0-6-next.11",
|
||||
"version": "6.0.0-6-next.10",
|
||||
"author": {
|
||||
"name": "Juan Picado",
|
||||
"email": "juanpicado19@gmail.com"
|
||||
@@ -43,9 +43,9 @@
|
||||
"build": "pnpm run build:js && pnpm run build:types"
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/cli-ui": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.11",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.10",
|
||||
"commander": "6.2.0",
|
||||
"clipanion": "3.0.0-rc.11",
|
||||
"envinfo": "7.4.0",
|
||||
|
||||
@@ -2,9 +2,9 @@ import envinfo from 'envinfo';
|
||||
import { Command } from 'clipanion';
|
||||
|
||||
export class InfoCommand extends Command {
|
||||
public static paths = [[`--info`], [`-i`]];
|
||||
static paths = [[`--info`], [`-i`]];
|
||||
|
||||
public async execute(): Promise<void> {
|
||||
async execute() {
|
||||
this.context.stdout.write('\nEnvironment Info:');
|
||||
const data = await envinfo.run({
|
||||
System: ['OS', 'CPU'],
|
||||
|
||||
@@ -5,9 +5,9 @@ import { initServer } from '@verdaccio/node-api';
|
||||
export const DEFAULT_PROCESS_NAME: string = 'verdaccio';
|
||||
|
||||
export class InitCommand extends Command {
|
||||
public static paths = [Command.Default];
|
||||
static paths = [Command.Default];
|
||||
|
||||
private port = Option.String('-l,-p,--listen,--port', {
|
||||
port = Option.String('-l,-p,--listen,--port', {
|
||||
description: 'host:port number to listen on (default: localhost:4873)',
|
||||
});
|
||||
|
||||
@@ -37,11 +37,11 @@ export class InitCommand extends Command {
|
||||
],
|
||||
});
|
||||
|
||||
private config = Option.String('-c,--config', {
|
||||
config = Option.String('-c,--config', {
|
||||
description: 'use this configuration file (default: ./config.yaml)',
|
||||
});
|
||||
|
||||
public async execute() {
|
||||
async execute() {
|
||||
try {
|
||||
const configPathLocation = findConfigFile(this.config as string);
|
||||
const configParsed = parseConfigFile(configPathLocation);
|
||||
|
||||
@@ -11,10 +11,16 @@
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../core/cli-ui"
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../node-api"
|
||||
},
|
||||
{
|
||||
"path": "../core/cli-ui"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,20 +1,5 @@
|
||||
# @verdaccio/config
|
||||
|
||||
## 6.0.0-6-next.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1810ed0d: Feature
|
||||
|
||||
- add option to set storage from environment variable VERDACCIO_STORAGE_PATH
|
||||
|
||||
#### Related tickets
|
||||
|
||||
https://github.com/verdaccio/verdaccio/issues/1681
|
||||
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
|
||||
## 6.0.0-6-next.4
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/config",
|
||||
"version": "6.0.0-6-next.5",
|
||||
"version": "6.0.0-6-next.4",
|
||||
"description": "logger",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -40,7 +40,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3",
|
||||
"debug": "^4.2.0",
|
||||
"js-yaml": "3.14.0",
|
||||
"lodash": "^4.17.20",
|
||||
|
||||
@@ -50,7 +50,7 @@ class Config implements AppConfig {
|
||||
|
||||
public constructor(config: ConfigRuntime) {
|
||||
const self = this;
|
||||
this.storage = process.env.VERDACCIO_STORAGE_PATH || config.storage;
|
||||
this.storage = config.storage;
|
||||
this.config_path = config.config_path;
|
||||
this.plugins = config.plugins;
|
||||
this.security = _.merge(defaultSecurity, config.security);
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
import path from 'path';
|
||||
import { parseConfigFile } from '../src';
|
||||
import { parseConfigurationFile } from './utils';
|
||||
|
||||
describe('Package access utilities', () => {
|
||||
const parseConfigurationFile = (conf) => {
|
||||
const { name, ext } = path.parse(conf);
|
||||
const format = ext.startsWith('.') ? ext.substring(1) : 'yaml';
|
||||
|
||||
return path.join(__dirname, `./partials/config/${format}/${name}.${format}`);
|
||||
};
|
||||
|
||||
describe('JSON format', () => {
|
||||
test('parse default.json', () => {
|
||||
const config = parseConfigFile(parseConfigurationFile('default.json'));
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
ROLES,
|
||||
WEB_TITLE,
|
||||
} from '../src';
|
||||
import { parseConfigurationFile } from './utils';
|
||||
|
||||
const resolveConf = (conf) => {
|
||||
const { name, ext } = path.parse(conf);
|
||||
@@ -81,32 +80,6 @@ describe('check basic content parsed file', () => {
|
||||
checkDefaultConfPackages(config);
|
||||
});
|
||||
|
||||
test('should set storage to value set in VERDACCIO_STORAGE_PATH environment variable', () => {
|
||||
const storageLocation = '/tmp/verdaccio';
|
||||
process.env.VERDACCIO_STORAGE_PATH = storageLocation;
|
||||
const config = new Config(parseConfigFile(resolveConf('default')));
|
||||
expect(config.storage).toBe(storageLocation);
|
||||
delete process.env.VERDACCIO_STORAGE_PATH;
|
||||
});
|
||||
|
||||
test('should set storage path to VERDACCIO_STORAGE_PATH if both config and env are set', () => {
|
||||
const storageLocation = '/tmp/verdaccio';
|
||||
process.env.VERDACCIO_STORAGE_PATH = storageLocation;
|
||||
const config = new Config(parseConfigFile(parseConfigurationFile('storage')));
|
||||
expect(config.storage).toBe(storageLocation);
|
||||
delete process.env.VERDACCIO_STORAGE_PATH;
|
||||
});
|
||||
|
||||
test('should take storage from environment variable if not exists in configs', () => {
|
||||
const storageLocation = '/tmp/verdaccio';
|
||||
process.env.VERDACCIO_STORAGE_PATH = storageLocation;
|
||||
const defaultConfig = parseConfigFile(resolveConf('default'));
|
||||
delete defaultConfig.storage;
|
||||
const config = new Config(defaultConfig);
|
||||
expect(config.storage).toBe(storageLocation);
|
||||
delete process.env.VERDACCIO_STORAGE_PATH;
|
||||
});
|
||||
|
||||
test('parse docker.yaml', () => {
|
||||
const config = new Config(parseConfigFile(resolveConf('docker')));
|
||||
checkDefaultUplink(config);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import path from 'path';
|
||||
import _ from 'lodash';
|
||||
|
||||
import {
|
||||
@@ -6,9 +7,15 @@ import {
|
||||
PACKAGE_ACCESS,
|
||||
} from '../src/package-access';
|
||||
import { parseConfigFile } from '../src';
|
||||
import { parseConfigurationFile } from './utils';
|
||||
|
||||
describe('Package access utilities', () => {
|
||||
const parseConfigurationFile = (conf) => {
|
||||
const { name, ext } = path.parse(conf);
|
||||
const format = ext.startsWith('.') ? ext.substring(1) : 'yaml';
|
||||
|
||||
return path.join(__dirname, `./partials/config/${format}/${name}.${format}`);
|
||||
};
|
||||
|
||||
describe('normalisePackageAccess', () => {
|
||||
test('should test basic conversion', () => {
|
||||
const { packages } = parseConfigFile(parseConfigurationFile('pkgs-basic'));
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
storage: './storage_default_storage'
|
||||
|
||||
logs:
|
||||
- type: stdout
|
||||
format: pretty
|
||||
level: warn
|
||||
@@ -1,8 +1,16 @@
|
||||
import path from 'path';
|
||||
|
||||
import { hasProxyTo, sanityCheckUplinksProps, uplinkSanityCheck } from '../src/uplinks';
|
||||
import { normalisePackageAccess, parseConfigFile } from '../src';
|
||||
import { parseConfigurationFile } from './utils';
|
||||
|
||||
describe('Uplinks Utilities', () => {
|
||||
const parseConfigurationFile = (conf) => {
|
||||
const { name, ext } = path.parse(conf);
|
||||
const format = ext.startsWith('.') ? ext.substring(1) : 'yaml';
|
||||
|
||||
return path.join(__dirname, `./partials/config/${format}/${name}.${format}`);
|
||||
};
|
||||
|
||||
describe('uplinkSanityCheck', () => {
|
||||
test('should test basic conversion', () => {
|
||||
const uplinks = uplinkSanityCheck(
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export { parseConfigurationFile } from './parse-configuration-file';
|
||||
@@ -1,8 +0,0 @@
|
||||
import path from 'path';
|
||||
|
||||
export const parseConfigurationFile = (conf: string) => {
|
||||
const { name, ext } = path.parse(conf);
|
||||
const format = ext.startsWith('.') ? ext.substring(1) : 'yaml';
|
||||
|
||||
return path.join(__dirname, `../partials/config/${format}/${name}.${format}`);
|
||||
};
|
||||
@@ -7,11 +7,14 @@
|
||||
"include": ["src/**/*.ts"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
"path": "../logger"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../commons-api"
|
||||
"path": "../file-locking"
|
||||
},
|
||||
{
|
||||
"path": "../file-locking"
|
||||
"path": "../commons-api"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../commons-api"
|
||||
"path": "../streams"
|
||||
},
|
||||
{
|
||||
"path": "../file-locking"
|
||||
},
|
||||
{
|
||||
"path": "../streams"
|
||||
"path": "../commons-api"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,20 +1,5 @@
|
||||
# Change Log
|
||||
|
||||
## 11.0.0-6-next.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 648575aa: Bug Fixes
|
||||
|
||||
- fix escaped slash in namespaced packages
|
||||
|
||||
#### Related tickets
|
||||
|
||||
https://github.com/verdaccio/verdaccio/pull/2193
|
||||
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
|
||||
## 11.0.0-6-next.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/tarball",
|
||||
"version": "11.0.0-6-next.5",
|
||||
"version": "11.0.0-6-next.4",
|
||||
"description": "tarball utilities resolver",
|
||||
"keywords": [
|
||||
"private",
|
||||
@@ -38,7 +38,7 @@
|
||||
"lodash": "^4.17.21",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/url": "workspace:11.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4"
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4",
|
||||
|
||||
@@ -2,6 +2,7 @@ import URL from 'url';
|
||||
import { Request } from 'express';
|
||||
import buildDebug from 'debug';
|
||||
|
||||
import { encodeScopedUri } from '@verdaccio/utils';
|
||||
import { getPublicUrl } from '@verdaccio/url';
|
||||
|
||||
const debug = buildDebug('verdaccio:core:url');
|
||||
@@ -31,5 +32,5 @@ export function getLocalRegistryTarballUri(
|
||||
// header only set with proxy that setup with HTTPS
|
||||
const domainRegistry = getPublicUrl(urlPrefix || '', req);
|
||||
|
||||
return `${domainRegistry}${pkgName}/-/${tarballName}`;
|
||||
return `${domainRegistry}${encodeScopedUri(pkgName)}/-/${tarballName}`;
|
||||
}
|
||||
|
||||
@@ -8,11 +8,14 @@
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../utils"
|
||||
"path": "../types"
|
||||
},
|
||||
{
|
||||
"path": "../commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../../utils"
|
||||
},
|
||||
{
|
||||
"path": "../url"
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../types"
|
||||
},
|
||||
{
|
||||
"path": "../commons-api"
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
"request": "2.87.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4",
|
||||
"nock": "^13.0.4"
|
||||
},
|
||||
|
||||
@@ -7,17 +7,20 @@
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../auth"
|
||||
},
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
"path": "../auth"
|
||||
},
|
||||
{
|
||||
"path": "../commons"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"homepage": "https://verdaccio.org",
|
||||
|
||||
@@ -10,14 +10,17 @@
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../mock"
|
||||
},
|
||||
{
|
||||
"path": "../node-api"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -6,9 +6,5 @@
|
||||
},
|
||||
"include": ["src/**/*.ts"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
}
|
||||
]
|
||||
"references": [{ "path": "../commons" }, { "path": "../core/commons-api" }]
|
||||
}
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
# @verdaccio/middleware
|
||||
|
||||
## 6.0.0-6-next.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
- @verdaccio/auth@6.0.0-6-next.7
|
||||
|
||||
## 6.0.0-6-next.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/middleware",
|
||||
"version": "6.0.0-6-next.7",
|
||||
"version": "6.0.0-6-next.6",
|
||||
"description": "loaders logic",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -39,10 +39,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "^4.3.1",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.6",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3",
|
||||
"lodash": "4.17.15"
|
||||
},
|
||||
"funding": {
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../auth"
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
"path": "../commons"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
|
||||
@@ -1,22 +1,5 @@
|
||||
# @verdaccio/mock
|
||||
|
||||
## 6.0.0-6-next.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 648575aa: Bug Fixes
|
||||
|
||||
- fix escaped slash in namespaced packages
|
||||
|
||||
#### Related tickets
|
||||
|
||||
https://github.com/verdaccio/verdaccio/pull/2193
|
||||
|
||||
- Updated dependencies [1810ed0d]
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/config@6.0.0-6-next.5
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
|
||||
## 6.0.0-6-next.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/mock",
|
||||
"version": "6.0.0-6-next.5",
|
||||
"version": "6.0.0-6-next.4",
|
||||
"author": {
|
||||
"name": "Juan Picado",
|
||||
"email": "juanpicado19@gmail.com"
|
||||
@@ -40,8 +40,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3",
|
||||
"debug": "^4.2.0",
|
||||
"fs-extra": "^8.1.0",
|
||||
"lodash": "^4.17.20",
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
HTTP_STATUS,
|
||||
TOKEN_BEARER,
|
||||
} from '@verdaccio/commons-api';
|
||||
import { buildToken } from '@verdaccio/utils';
|
||||
import { buildToken, encodeScopedUri } from '@verdaccio/utils';
|
||||
import { generateRandomHexString } from '@verdaccio/utils';
|
||||
import { Package } from '@verdaccio/types';
|
||||
import { response } from 'express';
|
||||
@@ -70,7 +70,7 @@ export function putPackage(
|
||||
export function deletePackage(request: any, pkgName: string, token?: string): Promise<any[]> {
|
||||
return new Promise((resolve) => {
|
||||
const del = request
|
||||
.put(`/${pkgName}/-rev/${generateRandomHexString(8)}`)
|
||||
.put(`/${encodeScopedUri(pkgName)}/-rev/${generateRandomHexString(8)}`)
|
||||
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON);
|
||||
|
||||
if (_.isNil(token) === false) {
|
||||
@@ -216,13 +216,18 @@ export async function fetchPackageByVersionAndTag(
|
||||
}
|
||||
|
||||
export async function isExistPackage(app, packageName) {
|
||||
const [err] = await getPackage(request(app), '', packageName, HTTP_STATUS.OK);
|
||||
const [err] = await getPackage(request(app), '', encodeScopedUri(packageName), HTTP_STATUS.OK);
|
||||
|
||||
return _.isNull(err);
|
||||
}
|
||||
|
||||
export async function verifyPackageVersionDoesExist(app, packageName, version, token?: string) {
|
||||
const [, res] = await getPackage(request(app), token as string, packageName, HTTP_STATUS.OK);
|
||||
const [, res] = await getPackage(
|
||||
request(app),
|
||||
token as string,
|
||||
encodeScopedUri(packageName),
|
||||
HTTP_STATUS.OK
|
||||
);
|
||||
|
||||
const { versions } = res.body;
|
||||
const versionsKeys = Object.keys(versions);
|
||||
@@ -231,5 +236,5 @@ export async function verifyPackageVersionDoesExist(app, packageName, version, t
|
||||
}
|
||||
|
||||
export function generateUnPublishURI(pkgName) {
|
||||
return `/${pkgName}/-rev/${generateRandomHexString(8)}`;
|
||||
return `/${encodeScopedUri(pkgName)}/-rev/${generateRandomHexString(8)}`;
|
||||
}
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
# @verdaccio/node-api
|
||||
|
||||
## 6.0.0-6-next.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1810ed0d]
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/config@6.0.0-6-next.5
|
||||
- @verdaccio/server@6.0.0-6-next.10
|
||||
|
||||
## 6.0.0-6-next.10
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/node-api",
|
||||
"version": "6.0.0-6-next.11",
|
||||
"version": "6.0.0-6-next.10",
|
||||
"description": "node API",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -40,16 +40,16 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/cli-ui": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.10",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.9",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"core-js": "^3.6.5",
|
||||
"debug": "^4.2.0",
|
||||
"lodash": "^4.17.20"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4",
|
||||
"jest-mock-process": "^1.4.0",
|
||||
"selfsigned": "1.10.7",
|
||||
|
||||
@@ -60,7 +60,6 @@ export function getListListenAddresses(argListen: string | void, configListen: a
|
||||
addresses = [argListen];
|
||||
} else if (Array.isArray(configListen)) {
|
||||
addresses = configListen;
|
||||
process.emitWarning('multiple addresses will be deprecated in the next major, only use one');
|
||||
} else if (configListen) {
|
||||
addresses = [configListen];
|
||||
} else {
|
||||
|
||||
@@ -7,23 +7,23 @@
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../core/cli-ui"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../server"
|
||||
},
|
||||
{
|
||||
"path": "../mock"
|
||||
},
|
||||
{
|
||||
"path": "../server"
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../core/cli-ui"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -9,6 +9,12 @@
|
||||
"references": [
|
||||
{
|
||||
"path": "../../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../../core/streams"
|
||||
},
|
||||
{
|
||||
"path": "../../core/types"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5,5 +5,16 @@
|
||||
"outDir": "./build"
|
||||
},
|
||||
"include": ["src/**/*", "types/*.d.ts"],
|
||||
"exclude": ["src/**/*.test.ts"]
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../../core/streams"
|
||||
},
|
||||
{
|
||||
"path": "../../core/types"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
"references": [
|
||||
{
|
||||
"path": "../../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../../core/types"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
},
|
||||
{
|
||||
"path": "../../core/streams"
|
||||
},
|
||||
{
|
||||
"path": "../../core/types"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
},
|
||||
{
|
||||
"path": "../../core/streams"
|
||||
},
|
||||
{
|
||||
"path": "../../core/types"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
},
|
||||
{
|
||||
"path": "../../core/streams"
|
||||
},
|
||||
{
|
||||
"path": "../../core/types"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"extends": "../../../.babelrc",
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": ["last 5 versions"],
|
||||
"bugfixes": true,
|
||||
"modules": "auto",
|
||||
"debug": false
|
||||
}
|
||||
],
|
||||
"@babel/preset-react"
|
||||
],
|
||||
"plugins": ["react-hot-loader/babel", "@babel/transform-runtime", "emotion"],
|
||||
"env": {
|
||||
"test": {
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"bugfixes": true,
|
||||
"debug": false
|
||||
}
|
||||
],
|
||||
"@babel/preset-react",
|
||||
"@babel/typescript"
|
||||
],
|
||||
"plugins": ["@babel/transform-runtime", "dynamic-import-node"]
|
||||
}
|
||||
},
|
||||
"ignore": ["**/*.d.ts"]
|
||||
}
|
||||
@@ -26,6 +26,22 @@
|
||||
},
|
||||
"newlines-between": "always"
|
||||
}],
|
||||
"babel/no-invalid-this": 0,
|
||||
"no-invalid-this": 0,
|
||||
"no-console": ["error", { "allow": ["warn", "error"] }],
|
||||
"@typescript-eslint/no-var-requires": 0,
|
||||
"@typescript-eslint/array-type": "warn",
|
||||
"@typescript-eslint/indent": 0,
|
||||
"@typescript-eslint/explicit-member-accessibility": ["warn",
|
||||
{
|
||||
"accessibility": "explicit",
|
||||
"overrides": {
|
||||
"constructors": "off"
|
||||
}
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/explicit-function-return-type": 0,
|
||||
"@typescript-eslint/no-unused-vars": ["error"],
|
||||
"react/display-name": 0,
|
||||
"react/no-deprecated": 1,
|
||||
"react/jsx-no-target-blank": 1,
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
# @verdaccio/ui-theme
|
||||
|
||||
## 6.0.0-6-next.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 648575aa: Bug Fixes
|
||||
|
||||
- fix escaped slash in namespaced packages
|
||||
|
||||
#### Related tickets
|
||||
|
||||
https://github.com/verdaccio/verdaccio/pull/2193
|
||||
|
||||
## 5.0.0-alpha.5
|
||||
|
||||
### Major Changes
|
||||
|
||||
49
packages/plugins/ui-theme/babel.config.js
Normal file
49
packages/plugins/ui-theme/babel.config.js
Normal file
@@ -0,0 +1,49 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
targets: [
|
||||
'last 5 versions',
|
||||
'FireFox >= 44',
|
||||
'Safari >= 7',
|
||||
'Explorer 11',
|
||||
'last 4 Edge versions',
|
||||
],
|
||||
bugfixes: true,
|
||||
modules: 'auto',
|
||||
debug: false,
|
||||
},
|
||||
],
|
||||
'@babel/preset-react',
|
||||
'@babel/typescript',
|
||||
],
|
||||
plugins: [
|
||||
'@babel/proposal-class-properties',
|
||||
'@babel/proposal-object-rest-spread',
|
||||
'@babel/plugin-proposal-optional-chaining',
|
||||
'@babel/plugin-proposal-nullish-coalescing-operator',
|
||||
// FIXME: filter in production
|
||||
'react-hot-loader/babel',
|
||||
'@babel/transform-runtime',
|
||||
'@babel/plugin-syntax-dynamic-import',
|
||||
'emotion',
|
||||
],
|
||||
env: {
|
||||
test: {
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
bugfixes: true,
|
||||
debug: false,
|
||||
},
|
||||
],
|
||||
'@babel/preset-react',
|
||||
'@babel/typescript',
|
||||
],
|
||||
plugins: ['dynamic-import-node'],
|
||||
},
|
||||
},
|
||||
ignore: ['**/*.d.ts'],
|
||||
};
|
||||
@@ -33,7 +33,6 @@ module.exports = Object.assign({}, config, {
|
||||
// note: this section has to be on sync with webpack configuration
|
||||
'verdaccio-ui/components/(.*)': '<rootDir>/src/components/$1',
|
||||
'verdaccio-ui/utils/(.*)': '<rootDir>/src/utils/$1',
|
||||
'verdaccio-ui/providers/(.*)': '<rootDir>/src/providers/$1',
|
||||
'verdaccio-ui/design-tokens/(.*)': '<rootDir>/src/design-tokens/$1',
|
||||
},
|
||||
});
|
||||
|
||||
@@ -5,20 +5,12 @@
|
||||
import { GlobalWithFetchMock } from 'jest-fetch-mock';
|
||||
import 'mutationobserver-shim';
|
||||
|
||||
// @ts-ignore : Property '__APP_VERSION__' does not exist on type 'Global'.
|
||||
global.__APP_VERSION__ = '1.0.0';
|
||||
// @ts-ignore : Property '__VERDACCIO_BASENAME_UI_OPTIONS' does not exist on type 'Global'.
|
||||
global.__VERDACCIO_BASENAME_UI_OPTIONS = {
|
||||
base: 'http://localhost',
|
||||
protocol: 'http',
|
||||
host: 'localhost',
|
||||
primaryColor: '#4b5e40',
|
||||
url_prefix: '',
|
||||
darkMode: false,
|
||||
language: 'en-US',
|
||||
uri: 'http://localhost:4873',
|
||||
title: 'Verdaccio Dev UI',
|
||||
scope: '',
|
||||
version: 'v1.0.0',
|
||||
};
|
||||
global.__VERDACCIO_BASENAME_UI_OPTIONS = { base: 'http://localhost' };
|
||||
// @ts-ignore : Property 'VERDACCIO_API_URL' does not exist on type 'Global'.
|
||||
global.VERDACCIO_API_URL = 'https://verdaccio.tld';
|
||||
|
||||
const customGlobal: GlobalWithFetchMock = global as GlobalWithFetchMock;
|
||||
customGlobal.fetch = require('jest-fetch-mock');
|
||||
@@ -27,7 +19,8 @@ customGlobal.fetchMock = customGlobal.fetch;
|
||||
// mocking few DOM methods
|
||||
// @ts-ignore : Property 'document' does not exist on type 'Global'.
|
||||
if (global.document) {
|
||||
// @ts-ignore : Type 'Mock<{ selectNodeContents: () => void; }, []>' is not assignable to type '() => Range'.
|
||||
// @ts-ignore : Type 'Mock<{ selectNodeContents: () => void; }, []>'
|
||||
// is not assignable to type '() => Range'.
|
||||
document.createRange = jest.fn((): void => ({
|
||||
selectNodeContents: (): void => {},
|
||||
}));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/ui-theme",
|
||||
"version": "6.0.0-6-next.6",
|
||||
"version": "6.0.0-alpha.5",
|
||||
"description": "Verdaccio User Interface",
|
||||
"author": {
|
||||
"name": "Verdaccio Core Team",
|
||||
@@ -29,13 +29,13 @@
|
||||
"@testing-library/dom": "^7.29.0",
|
||||
"@testing-library/jest-dom": "^5.11.6",
|
||||
"@testing-library/react": "10.4.9",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.11",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.10",
|
||||
"autosuggest-highlight": "3.1.1",
|
||||
"babel-loader": "^8.2.2",
|
||||
"babel-plugin-dynamic-import-node": "^2.3.3",
|
||||
"babel-plugin-emotion": "10.0.33",
|
||||
"bundlesize": "0.18.0",
|
||||
"css-loader": "5.2.1",
|
||||
"css-loader": "4.3.0",
|
||||
"dayjs": "1.9.7",
|
||||
"emotion": "10.0.27",
|
||||
"emotion-theming": "10.0.27",
|
||||
@@ -85,13 +85,13 @@
|
||||
"url-loader": "^4.1.1",
|
||||
"validator": "13.1.1",
|
||||
"wait-on": "5.2.0",
|
||||
"webpack": "5.33.2",
|
||||
"webpack": "5.23.0",
|
||||
"webpack-bundle-analyzer": "3.8.0",
|
||||
"webpack-bundle-size-analyzer": "3.1.0",
|
||||
"webpack-manifest-plugin": "^3.0.0",
|
||||
"webpack-cli": "^4.5.0",
|
||||
"webpack-dev-server": "^3.11.2",
|
||||
"webpack-merge": "^5.7.3",
|
||||
"webpack-dev-server": "^3.11.0",
|
||||
"webpack-merge": "^5.6.1",
|
||||
"whatwg-fetch": "^3.4.1",
|
||||
"xss": "1.0.8"
|
||||
},
|
||||
|
||||
@@ -30,7 +30,7 @@ jest.mock('verdaccio-ui/utils/storage', () => {
|
||||
return new LocalStorageMock();
|
||||
});
|
||||
|
||||
jest.mock('verdaccio-ui/providers/API/api', () => ({
|
||||
jest.mock('verdaccio-ui/utils/api', () => ({
|
||||
// eslint-disable-next-line jest/no-mocks-import
|
||||
request: require('../../jest/unit/components/__mocks__/api').default.request,
|
||||
}));
|
||||
@@ -70,7 +70,7 @@ describe('<App />', () => {
|
||||
expect(queryByTestId('greetings-label')).toBeFalsy();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 20000);
|
||||
|
||||
test('isUserAlreadyLoggedIn: token already available in storage', async () => {
|
||||
storage.setItem('username', 'verdaccio');
|
||||
@@ -93,5 +93,5 @@ describe('<App />', () => {
|
||||
expect(queryAllByText('verdaccio')).toBeTruthy();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
@@ -35,7 +35,7 @@ const StyledBoxContent = styled(Box)<{ theme?: Theme }>(({ theme }) => ({
|
||||
/* eslint-disable react/jsx-no-bind */
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
const App: React.FC = () => {
|
||||
const [user, setUser] = useState<undefined | { username: string | null }>();
|
||||
const [user, setUser] = useState<undefined | { username: string }>();
|
||||
/**
|
||||
* Logout user
|
||||
* Required by: <Header />
|
||||
|
||||
@@ -6,7 +6,7 @@ export interface AppProps {
|
||||
}
|
||||
|
||||
export interface User {
|
||||
username: string | null;
|
||||
username: string;
|
||||
}
|
||||
|
||||
export interface AppContextProps extends AppProps {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
|
||||
import { useConfig } from 'verdaccio-ui/providers/config';
|
||||
|
||||
import AppContext, { AppProps, User } from './AppContext';
|
||||
|
||||
interface Props {
|
||||
@@ -10,9 +8,8 @@ interface Props {
|
||||
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
const AppContextProvider: React.FC<Props> = ({ children, user }) => {
|
||||
const { configOptions } = useConfig();
|
||||
const [state, setState] = useState<AppProps>({
|
||||
scope: configOptions.scope ?? '',
|
||||
scope: window?.__VERDACCIO_BASENAME_UI_OPTIONS?.scope ?? '',
|
||||
user,
|
||||
});
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ enum Route {
|
||||
}
|
||||
|
||||
export const history = createBrowserHistory({
|
||||
basename: window?.__VERDACCIO_BASENAME_UI_OPTIONS?.url_prefix,
|
||||
// basename is deprecated and already removed in a major released
|
||||
basename: window?.__VERDACCIO_BASENAME_UI_OPTIONS?.basename,
|
||||
});
|
||||
|
||||
const AppRoute: React.FC = () => {
|
||||
@@ -37,7 +38,7 @@ const AppRoute: React.FC = () => {
|
||||
|
||||
const { user } = appContext;
|
||||
|
||||
const isUserLoggedIn = user?.username;
|
||||
const isUserLoggedIn = user && user.username;
|
||||
|
||||
return (
|
||||
<Router history={history}>
|
||||
|
||||
@@ -6,15 +6,19 @@ import Footer from './Footer';
|
||||
|
||||
describe('<Footer /> component', () => {
|
||||
beforeAll(() => {
|
||||
window.__VERDACCIO_BASENAME_UI_OPTIONS.version = 'v.1.0.0';
|
||||
window.__VERDACCIO_BASENAME_UI_OPTIONS = {
|
||||
version: 'v.1.0.0',
|
||||
};
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
delete window.__VERDACCIO_BASENAME_UI_OPTIONS.version;
|
||||
// @ts-ignore
|
||||
delete window.__VERDACCIO_BASENAME_UI_OPTIONS;
|
||||
});
|
||||
|
||||
test('should load the initial state of Footer component', () => {
|
||||
const { container } = render(<Footer />);
|
||||
expect(container.firstChild).toMatchSnapshot();
|
||||
render(<Footer />);
|
||||
// FIXME: this match does not work
|
||||
// expect(screen.getByText('Powered by')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
} from 'verdaccio-ui/components/Icons';
|
||||
import Logo from 'verdaccio-ui/components/Logo';
|
||||
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
||||
import { useConfig } from 'verdaccio-ui/providers/config';
|
||||
import { goToVerdaccioWebsite } from 'verdaccio-ui/utils/windows';
|
||||
|
||||
import { Wrapper, Left, Right, Love, Inner } from './styles';
|
||||
@@ -23,7 +22,6 @@ import { Wrapper, Left, Right, Love, Inner } from './styles';
|
||||
/* eslint-disable react/jsx-key */
|
||||
const Footer = () => {
|
||||
const { t } = useTranslation();
|
||||
const { configOptions } = useConfig();
|
||||
return (
|
||||
<Wrapper>
|
||||
<Inner>
|
||||
@@ -44,13 +42,9 @@ const Footer = () => {
|
||||
</ToolTip>
|
||||
</Left>
|
||||
<Right>
|
||||
{configOptions?.version && (
|
||||
<>
|
||||
{t('footer.powered-by')}
|
||||
<Logo onClick={goToVerdaccioWebsite} size="x-small" />
|
||||
{`/ ${configOptions.version}`}
|
||||
</>
|
||||
)}
|
||||
{t('footer.powered-by')}
|
||||
<Logo onClick={goToVerdaccioWebsite} size="x-small" />
|
||||
{`/ ${window?.__VERDACCIO_BASENAME_UI_OPTIONS?.version}`}
|
||||
</Right>
|
||||
</Inner>
|
||||
</Wrapper>
|
||||
|
||||
@@ -1,566 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`<Footer /> component should load the initial state of Footer component 1`] = `
|
||||
.emotion-0 {
|
||||
background: #f9f9f9;
|
||||
border-top: 1px solid #e3e3e3;
|
||||
color: #999999;
|
||||
font-size: 14px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.emotion-2 {
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-align-items: center;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-pack: end;
|
||||
-webkit-justify-content: flex-end;
|
||||
-ms-flex-pack: end;
|
||||
justify-content: flex-end;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media (min-width:768px) {
|
||||
.emotion-2 {
|
||||
min-width: 400px;
|
||||
max-width: 800px;
|
||||
margin: auto;
|
||||
-webkit-box-pack: justify;
|
||||
-webkit-justify-content: space-between;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width:1024px) {
|
||||
.emotion-2 {
|
||||
max-width: 1240px;
|
||||
}
|
||||
}
|
||||
|
||||
.emotion-4 {
|
||||
-webkit-align-items: center;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width:768px) {
|
||||
.emotion-4 {
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.emotion-6 {
|
||||
color: #e25555;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.emotion-8 {
|
||||
position: relative;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.emotion-8:hover .emotion-14 {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.emotion-11 {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin: 0px 8px;
|
||||
}
|
||||
|
||||
.emotion-13 {
|
||||
display: inline-grid;
|
||||
grid-template-columns: repeat(8,max-content);
|
||||
grid-gap: 0px 8px;
|
||||
position: absolute;
|
||||
background: #d3dddd;
|
||||
padding: 1px 4px;
|
||||
border-radius: 3px;
|
||||
height: 20px;
|
||||
-webkit-align-items: center;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
visibility: hidden;
|
||||
top: -2px;
|
||||
}
|
||||
|
||||
.emotion-13:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 29%;
|
||||
left: -4px;
|
||||
margin-left: -5px;
|
||||
border: 5px solid;
|
||||
border-color: #d3dddd transparent transparent transparent;
|
||||
-webkit-transform: rotate(90deg);
|
||||
-ms-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.emotion-15 {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.emotion-31 {
|
||||
-webkit-align-items: center;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
display: none;
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
@media (min-width:768px) {
|
||||
.emotion-31 {
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.emotion-33 {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
box-sizing: border-box;
|
||||
background-position: center;
|
||||
background-size: contain;
|
||||
background-image: url([object Object]);
|
||||
background-repeat: no-repeat;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
<div
|
||||
class="emotion-0 emotion-1"
|
||||
>
|
||||
<div
|
||||
class="emotion-2 emotion-3"
|
||||
>
|
||||
<div
|
||||
class="emotion-4 emotion-5"
|
||||
>
|
||||
Made with
|
||||
<span
|
||||
class="emotion-6 emotion-7"
|
||||
>
|
||||
♥
|
||||
</span>
|
||||
on
|
||||
<span
|
||||
class="emotion-8 emotion-9"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="MuiSvgIcon-root emotion-10 emotion-11 emotion-12"
|
||||
focusable="false"
|
||||
viewBox="0 0 45 45"
|
||||
>
|
||||
<defs>
|
||||
<clippath
|
||||
id="prefix__a"
|
||||
>
|
||||
<path
|
||||
d="M0 36h36V0H0v36z"
|
||||
/>
|
||||
</clippath>
|
||||
<clippath
|
||||
id="prefix__b"
|
||||
>
|
||||
<path
|
||||
d="M18 36C8.059 36 0 27.941 0 18S8.059 0 18 0s18 8.059 18 18-8.059 18-18 18z"
|
||||
/>
|
||||
</clippath>
|
||||
</defs>
|
||||
<g
|
||||
clip-path="url(#prefix__a)"
|
||||
transform="matrix(1.25 0 0 -1.25 0 45)"
|
||||
>
|
||||
<path
|
||||
d="M36 18c0-9.941-8.059-18-18-18S0 8.059 0 18s8.059 18 18 18 18-8.059 18-18"
|
||||
fill="#88c9f9"
|
||||
/>
|
||||
</g>
|
||||
<g
|
||||
clip-path="url(#prefix__b)"
|
||||
transform="matrix(1.25 0 0 -1.25 0 45)"
|
||||
>
|
||||
<path
|
||||
d="M3.627 28.952c-.45 2.93 2.195 4.156 3.607 4.47 1.412.314 2.776.62 2.933-.006.156-.628.311-1.46 1.173-1.148.862.314 3.043.56 4.063 1.342 1.02.783 2.244.787 3.264.473 1.02-.313 3.877-.227 3.25-1.167-.627-.94-1.825-.827-2.45-1.924-.628-1.099.171-1.826 1.033-1.826.865 0 1.71-.135 2.26.727.548.863-.383 2.463.324 2.357.706-.106 1.477-.866 2.03-2.043.547-1.176 1.408-.47 1.723-1.176.313-.705 2.04-2.039 1.177-1.804-.864.236-1.726.392-1.96-.47-.237-.863.388-1.726-.237-1.647-.627.08-.86-.089-1.725-.004-.862.083-1.333.631-2.039-.545-.705-1.175-1.254-1.96-1.567-2.509-.315-.549-.785-.86-.55-1.96.235-1.099-.628-.785-.628.156 0 .94-.548 1.098-1.253.942-.706-.157-1.803-.313-1.724-1.098.077-.784-.315-1.725.313-2.352.627-.629 1.33.076 1.723-.158.393-.237 1.525-.023 1.133-.416-.393-.39-1.76-.88-.976-1.509a4.831 4.831 0 011.893-.907c.313-.08.062.774 1.083 1.166 1.017.392 2.608 1.29 3 .584.391-.705.338-.595 1.75-.75 1.41-.156 1.79-.585 2.417-1.917.626-1.333.446-1.192 1.462-1.58 1.021-.394 1.678-.223.737-1.087-.94-.86-1.65-.814-2.199-1.833-.55-1.017-.153-1.73-1.25-2.75A20.755 20.755 0 0024 4c-.618-.37-2.162-2.07-3.083-2.667-.834-.54-1.083 0-1.083 0s.256 1.667.964 2.372c.704.705 1.105 3.344.87 4.128-.235.783-1.36 1.02-1.75 1.333-.393.312-1.418 1.548-1.418 2.334 0 .784 1.71 2.81 1.71 2.81.218-1.089-1.039.328-1.627.523-.47.157-1.542 1.656-2.459 1.814-.916.16-1.363.7-2.068 1.25-.706.55-2.43 1.332-2.353 2.195.08.862-1.725 1.568-2.038 1.568-.314 0-1.019 0-1.647 1.098-.627 1.098-1.725 2.196-1.41 2.98.312.783.391 1.726.233 2.588-.156.862-1.332 1.176-1.567.941-.235-.236-1.489-1.335-1.647-.315"
|
||||
fill="#5c913b"
|
||||
/>
|
||||
</g>
|
||||
</svg>
|
||||
<span
|
||||
class="emotion-13 emotion-14"
|
||||
>
|
||||
<svg
|
||||
class="MuiSvgIcon-root emotion-15 emotion-12"
|
||||
focusable="false"
|
||||
role="img"
|
||||
viewBox="0 0 45 45"
|
||||
>
|
||||
<defs>
|
||||
<clippath
|
||||
id="prefix__a"
|
||||
>
|
||||
<path
|
||||
d="M0 36h36V0H0v36z"
|
||||
/>
|
||||
</clippath>
|
||||
</defs>
|
||||
<g
|
||||
clip-path="url(#prefix__a)"
|
||||
transform="matrix(1.25 0 0 -1.25 0 45)"
|
||||
>
|
||||
<path
|
||||
d="M36 9a4 4 0 00-4-4H4a4 4 0 00-4 4v18a4 4 0 004 4h28a4 4 0 004-4V9z"
|
||||
fill="#c60a1d"
|
||||
/>
|
||||
<path
|
||||
d="M36 12H0v12h36V12z"
|
||||
fill="#ffc400"
|
||||
/>
|
||||
<path
|
||||
d="M9 19v-3a3 3 0 116 0v3H9z"
|
||||
fill="#ea596e"
|
||||
/>
|
||||
<path
|
||||
d="M12 17h3v3h-3v-3z"
|
||||
fill="#f4a2b2"
|
||||
/>
|
||||
<path
|
||||
d="M12 17H9v3h3v-3z"
|
||||
fill="#dd2e44"
|
||||
/>
|
||||
<path
|
||||
d="M15 21.5c0-.829-1.343-1.5-3-1.5s-3 .671-3 1.5 1.343 1.5 3 1.5 3-.671 3-1.5"
|
||||
fill="#ea596e"
|
||||
/>
|
||||
<path
|
||||
d="M15 22.25c0 .414-1.343.75-3 .75s-3-.336-3-.75 1.343-.75 3-.75 3 .336 3 .75"
|
||||
fill="#ffac33"
|
||||
/>
|
||||
<path
|
||||
d="M7 13h1v7H7v-7zm10 0h-1v7h1v-7z"
|
||||
fill="#99aab5"
|
||||
/>
|
||||
<path
|
||||
d="M9 13H6v1h3v-1zm9 0h-3v1h3v-1zM8 20H7v1h1v-1zm9 0h-1v1h1v-1z"
|
||||
fill="#66757f"
|
||||
/>
|
||||
</g>
|
||||
<title>
|
||||
Spain
|
||||
</title>
|
||||
</svg>
|
||||
<svg
|
||||
class="MuiSvgIcon-root emotion-15 emotion-12"
|
||||
focusable="false"
|
||||
role="img"
|
||||
viewBox="0 0 512 512"
|
||||
>
|
||||
<path
|
||||
d="M512 384c0 31.418-25.473 56.889-56.889 56.889H56.89C25.472 440.889 0 415.417 0 384V128c0-31.418 25.472-56.889 56.889-56.889H455.11C486.53 71.111 512 96.584 512 128v256z"
|
||||
fill="#265fb5"
|
||||
/>
|
||||
<path
|
||||
d="M512 327.111H0V184.89h512v142.22z"
|
||||
fill="#eee"
|
||||
/>
|
||||
<path
|
||||
d="M320.811 256c0 35.797-29.014 64.811-64.811 64.811-35.783 0-64.811-29.014-64.811-64.811s29.027-64.811 64.811-64.811c35.797 0 64.811 29.013 64.811 64.811"
|
||||
fill="#a9bf4c"
|
||||
/>
|
||||
<path
|
||||
d="M312.889 256c0 31.418-25.473 56.889-56.889 56.889S199.111 287.416 199.111 256s25.473-56.889 56.889-56.889 56.889 25.471 56.889 56.889"
|
||||
fill="#eee"
|
||||
/>
|
||||
<path
|
||||
d="M209.891 286.649l45.909-79.517 45.909 79.517H209.89z"
|
||||
fill="#265fb5"
|
||||
/>
|
||||
<path
|
||||
d="M215.04 283.591l40.818-70.685 40.803 70.685H215.04z"
|
||||
fill="#55acee"
|
||||
/>
|
||||
<path
|
||||
d="M215.04 283.591l9.841-17.052 61.483-.783 10.297 17.835H215.04z"
|
||||
fill="#bbddf5"
|
||||
/>
|
||||
<path
|
||||
d="M222.891 272.441l15.331-12.445 6.67 7.553 5.774-6.215 4.893 4.892 4.665-5.12 5.561 5.12 5.106-5.334 4.665 5.334 4.451-4.892 7.325 9.102 1.338 2.674s-7.78 1.55-18.446.669c-10.667-.896-16.882 1.55-25.33 2.66-8.448 1.109-23.553-1.109-23.553-1.109l1.55-2.889z"
|
||||
fill="#5c913b"
|
||||
/>
|
||||
<path
|
||||
d="M237.995 262.67l10.226 11.107-5.12.442-5.774-8.434.668-3.115zm12.231.883l8.22 7.338-3.782.654-3.996-5.546-.442-2.446zm10.439-.442l7.111 6.67L266 270.89l-5.774-6.229.44-1.55zm9.33 0l-2.888 2.66 1.338 1.565 1.55-4.225zm8.889.228l-3.328 4.224 1.109 1.99 2.446-4.664-.227-1.55z"
|
||||
fill="#e2f09f"
|
||||
/>
|
||||
<path
|
||||
d="M256.426 233.671l.939 13.227 7.566-10.867-5.675 11.805 11.805-5.66-10.851 7.553 13.213.939-13.213.952 10.851 7.553-11.805-5.66 5.675 11.805-7.566-10.867-.939 13.226-.939-13.226-7.566 10.867 5.675-11.805-11.805 5.66 10.851-7.553-13.212-.953 13.212-.938-10.85-7.553 11.804 5.66-5.675-11.805 7.566 10.866.94-13.226z"
|
||||
fill="#bbddf5"
|
||||
/>
|
||||
<path
|
||||
d="M256 244.665l-2.66 2.66s.654 4.011.441 4.679C253.554 252.658 256 256 256 256l3.327-3.996-.88-5.334-2.447-2.005z"
|
||||
fill="#dd2e44"
|
||||
/>
|
||||
<path
|
||||
d="M257.28 240.071c10.894 0 17.109 5.334 17.109 5.334l-3.996-7.111s-6.443-4.893-13.995-4.893c-7.567 0-16 6.001-16 6.001l-3.783 7.553s9.771-6.884 20.665-6.884"
|
||||
fill="#269"
|
||||
/>
|
||||
<path
|
||||
d="M257.28 240.071c10.894 0 17.109 5.334 17.109 5.334l-2.888-5.106s-7.78-4.665-15.331-4.665-16.896 5.987-16.896 5.987l-2.66 5.334c.001 0 9.772-6.884 20.666-6.884"
|
||||
fill="#ffcc4d"
|
||||
/>
|
||||
<path
|
||||
d="M257.28 240.071c10.894 0 17.109 5.334 17.109 5.334l-2.005-3.327s-5.988-4.224-16.214-3.783c-7.553 0-18.005 5.561-18.005 5.561l-1.55 3.1c0-.001 9.771-6.885 20.665-6.885"
|
||||
fill="#dd2e44"
|
||||
/>
|
||||
<path
|
||||
d="M264.291 322.873h-14.165V309.29h14.165v13.582zm-16.426-118.898h-10.183l-5.106-12.459 10.198-1.137 5.091 13.596zm23.21 5.66l-6.784-2.261 3.385-16.426 13.028 1.137-9.629 17.55zm-61.141 69.646l-19.811 4.523-.57-13.583 19.812-2.83.569 11.89zm5.106 14.152l-16.426 6.812-3.954-10.766 15.289-5.106 5.091 9.06zm109.269-12.444l-18.105-5.091v-9.63l20.366-2.83-2.261 17.55zm-9.003 18.674l-16.981-7.937 5.646-10.182 18.703 5.66-7.368 12.459z"
|
||||
fill="#eee"
|
||||
/>
|
||||
<title>
|
||||
Nicaragua
|
||||
</title>
|
||||
</svg>
|
||||
<svg
|
||||
class="MuiSvgIcon-root emotion-15 emotion-12"
|
||||
focusable="false"
|
||||
role="img"
|
||||
viewBox="0 0 512 512"
|
||||
>
|
||||
<path
|
||||
d="M0 384c0 31.418 25.473 56.889 56.889 56.889H455.11c31.42 0 56.89-25.473 56.89-56.889v-56.889H0V384z"
|
||||
fill="#138808"
|
||||
/>
|
||||
<path
|
||||
d="M0 327.111h512V184.89H0v142.22z"
|
||||
fill="#eee"
|
||||
/>
|
||||
<path
|
||||
d="M512 184.889V128c0-31.417-25.473-56.889-56.889-56.889H56.89C25.472 71.111 0 96.583 0 128v56.889h512z"
|
||||
fill="#f93"
|
||||
/>
|
||||
<path
|
||||
d="M312.889 256c0-31.431-25.473-56.902-56.903-56.902-31.417 0-56.888 25.472-56.888 56.902 0 31.418 25.472 56.889 56.888 56.889 31.432 0 56.903-25.472 56.903-56.889"
|
||||
fill="navy"
|
||||
/>
|
||||
<path
|
||||
d="M298.666 256c0-23.566-19.115-42.681-42.681-42.681S213.319 232.434 213.319 256s19.1 42.666 42.666 42.666 42.681-19.1 42.681-42.666"
|
||||
fill="#eee"
|
||||
/>
|
||||
<path
|
||||
d="M256 213.334l2.076 32.199 14.251-28.943-10.396 30.535 24.235-21.305-21.291 24.249 30.535-10.396-28.942 14.25L298.666 256l-32.198 2.076 28.942 14.237-30.535-10.383 21.291 24.235-24.235-21.29 10.396 30.535-14.25-28.942L256 298.666l-2.076-32.198-14.252 28.942 10.397-30.535-24.249 21.291 21.305-24.235-30.535 10.383 28.942-14.236L213.334 256l32.199-2.076-28.943-14.251 30.535 10.396-21.305-24.249 24.249 21.305-10.396-30.535 14.25 28.943 2.077-32.2z"
|
||||
fill="navy"
|
||||
opacity="0.6"
|
||||
/>
|
||||
<path
|
||||
d="M241.778 256c0-7.851 6.37-14.223 14.222-14.223s14.223 6.372 14.223 14.223-6.372 14.223-14.223 14.223-14.223-6.372-14.223-14.223"
|
||||
fill="navy"
|
||||
/>
|
||||
<title>
|
||||
India
|
||||
</title>
|
||||
</svg>
|
||||
<svg
|
||||
class="MuiSvgIcon-root emotion-15 emotion-12"
|
||||
focusable="false"
|
||||
role="img"
|
||||
viewBox="0 0 45 45"
|
||||
>
|
||||
<defs>
|
||||
<clippath
|
||||
id="prefix__a"
|
||||
>
|
||||
<path
|
||||
d="M0 36h36V0H0v36z"
|
||||
/>
|
||||
</clippath>
|
||||
</defs>
|
||||
<g
|
||||
clip-path="url(#prefix__a)"
|
||||
transform="matrix(1.25 0 0 -1.25 0 45)"
|
||||
>
|
||||
<path
|
||||
d="M36 9a4 4 0 00-4-4H4a4 4 0 00-4 4v18a4 4 0 004 4h28a4 4 0 004-4V9z"
|
||||
fill="#009b3a"
|
||||
/>
|
||||
<path
|
||||
d="M32.727 18L18 6.876 3.27 18 18 29.125 32.727 18z"
|
||||
fill="#fedf01"
|
||||
/>
|
||||
<path
|
||||
d="M24.434 18.076a6.458 6.458 0 11-12.917 0 6.458 6.458 0 0112.917 0"
|
||||
fill="#002776"
|
||||
/>
|
||||
<path
|
||||
d="M12.277 21.113a6.406 6.406 0 01-.672-2.023c3.994.29 9.417-1.892 11.744-4.596.402.604.7 1.28.882 2.004-2.871 2.809-7.916 4.63-11.954 4.615"
|
||||
fill="#cbe9d4"
|
||||
/>
|
||||
<path
|
||||
d="M13 16.767h-1v1h1v-1zm1-2h-1v1h1v-1z"
|
||||
fill="#88c9f9"
|
||||
/>
|
||||
<path
|
||||
d="M16 16.767h-1v1h1v-1zm2-1h-1v1h1v-1zm4-2h-1v1h1v-1zm-3-1h-1v1h1v-1zm3 6h-1v1h1v-1z"
|
||||
fill="#55acee"
|
||||
/>
|
||||
<path
|
||||
d="M20 14.767h-1v1h1v-1z"
|
||||
fill="#3b88c3"
|
||||
/>
|
||||
</g>
|
||||
<title>
|
||||
Brazil
|
||||
</title>
|
||||
</svg>
|
||||
<svg
|
||||
class="MuiSvgIcon-root emotion-15 emotion-12"
|
||||
focusable="false"
|
||||
role="img"
|
||||
viewBox="0 0 45 45"
|
||||
>
|
||||
<defs>
|
||||
<clippath
|
||||
id="prefix__a"
|
||||
>
|
||||
<path
|
||||
d="M0 36h36V0H0v36z"
|
||||
/>
|
||||
</clippath>
|
||||
</defs>
|
||||
<g
|
||||
clip-path="url(#prefix__a)"
|
||||
transform="matrix(1.25 0 0 -1.25 0 45)"
|
||||
>
|
||||
<path
|
||||
d="M36 9a4 4 0 00-4-4H4a4 4 0 00-4 4v18a4 4 0 004 4h28a4 4 0 004-4V9z"
|
||||
fill="#de2910"
|
||||
/>
|
||||
<path
|
||||
d="M7 25.049l.929-2.67 2.826-.06-2.253-1.706.819-2.707L7 19.52l-2.321-1.615.819 2.707-2.253 1.707 2.826.059.929 2.67zm6 3.423l.34-.688.759-.11-.549-.536.129-.756-.679.357-.679-.357.13.756-.55.536.76.11.339.688zm2-4l.34-.688.759-.11-.549-.536.129-.756-.679.357-.679-.357.13.756-.55.536.76.11.339.688zm0-4l.34-.688.759-.11-.549-.536.129-.756-.679.357-.679-.357.13.756-.55.536.76.11.339.688zm-2-3.999l.34-.69.759-.11-.549-.534.129-.757-.679.357-.679-.357.13.757-.55.535.76.11.339.689z"
|
||||
fill="#ffde02"
|
||||
/>
|
||||
</g>
|
||||
<title>
|
||||
China
|
||||
</title>
|
||||
</svg>
|
||||
<svg
|
||||
class="MuiSvgIcon-root emotion-15 emotion-12"
|
||||
focusable="false"
|
||||
role="img"
|
||||
viewBox="0 0 512 512"
|
||||
>
|
||||
<path
|
||||
d="M473.655 88.276H38.345C17.167 88.276 0 105.443 0 126.621v73.471h512v-73.471c0-21.178-17.167-38.345-38.345-38.345zM0 385.379c0 21.177 17.167 38.345 38.345 38.345h435.31c21.177 0 38.345-17.167 38.345-38.345v-73.471H0v73.471z"
|
||||
fill="#ff4b55"
|
||||
/>
|
||||
<path
|
||||
d="M0 200.09h512V311.9H0z"
|
||||
fill="#f5f5f5"
|
||||
/>
|
||||
<title>
|
||||
Austria
|
||||
</title>
|
||||
</svg>
|
||||
<svg
|
||||
class="MuiSvgIcon-root emotion-15 emotion-12"
|
||||
focusable="false"
|
||||
role="img"
|
||||
viewBox="0 0 512 512"
|
||||
>
|
||||
<path
|
||||
d="M473.655 88.276H38.345C17.167 88.276 0 105.443 0 126.621v73.471h512v-73.471c0-21.178-17.167-38.345-38.345-38.345z"
|
||||
fill="#464655"
|
||||
/>
|
||||
<path
|
||||
d="M0 385.379c0 21.177 17.167 38.345 38.345 38.345h435.31c21.177 0 38.345-17.167 38.345-38.345v-73.471H0v73.471z"
|
||||
fill="#ffe15a"
|
||||
/>
|
||||
<path
|
||||
d="M0 200.09h512V311.9H0z"
|
||||
fill="#ff4b55"
|
||||
/>
|
||||
<title>
|
||||
Germany
|
||||
</title>
|
||||
</svg>
|
||||
<svg
|
||||
class="MuiSvgIcon-root emotion-15 emotion-12"
|
||||
focusable="false"
|
||||
role="img"
|
||||
viewBox="-60 -40 240 160"
|
||||
>
|
||||
<rect
|
||||
fill="#fe0000"
|
||||
height="100%"
|
||||
width="100%"
|
||||
x="-60"
|
||||
y="-40"
|
||||
/>
|
||||
<rect
|
||||
fill="#000095"
|
||||
height="50%"
|
||||
width="50%"
|
||||
x="-60"
|
||||
y="-40"
|
||||
/>
|
||||
<path
|
||||
d="M8 0L0 30-8 0l8-30M0 8l30-8L0-8l-30 8"
|
||||
fill="#fff"
|
||||
id="prefix__a"
|
||||
/>
|
||||
<use
|
||||
transform="rotate(30)"
|
||||
xlink:href="#prefix__a"
|
||||
/>
|
||||
<use
|
||||
transform="rotate(60)"
|
||||
xlink:href="#prefix__a"
|
||||
/>
|
||||
<circle
|
||||
fill="#000095"
|
||||
r="17"
|
||||
/>
|
||||
<circle
|
||||
fill="#fff"
|
||||
r="15"
|
||||
/>
|
||||
<title>
|
||||
Taiwan
|
||||
</title>
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="emotion-31 emotion-32"
|
||||
>
|
||||
Powered by
|
||||
<div
|
||||
class="emotion-33 emotion-34"
|
||||
/>
|
||||
/ v.1.0.0
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -23,7 +23,7 @@ const props = {
|
||||
/* eslint-disable react/jsx-no-bind*/
|
||||
describe('<Header /> component with logged in state', () => {
|
||||
test('should load the component in logged out state', () => {
|
||||
const { container, queryByTestId, getByText } = render(
|
||||
const { queryByTestId, getByText } = render(
|
||||
<Router>
|
||||
<AppContextProvider>
|
||||
<Header />
|
||||
@@ -31,13 +31,12 @@ describe('<Header /> component with logged in state', () => {
|
||||
</Router>
|
||||
);
|
||||
|
||||
expect(container.firstChild).toMatchSnapshot();
|
||||
expect(queryByTestId('header--menu-accountcircle')).toBeNull();
|
||||
expect(getByText('Login')).toBeTruthy();
|
||||
});
|
||||
|
||||
test('should load the component in logged in state', () => {
|
||||
const { container, getByTestId, queryByText } = render(
|
||||
const { getByTestId, queryByText } = render(
|
||||
<Router>
|
||||
<AppContextProvider user={props.user}>
|
||||
<Header />
|
||||
@@ -45,7 +44,6 @@ describe('<Header /> component with logged in state', () => {
|
||||
</Router>
|
||||
);
|
||||
|
||||
expect(container.firstChild).toMatchSnapshot();
|
||||
expect(getByTestId('header--menu-accountcircle')).toBeTruthy();
|
||||
expect(queryByText('Login')).toBeNull();
|
||||
});
|
||||
|
||||
@@ -2,8 +2,8 @@ import React, { useState, useContext } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import Button from 'verdaccio-ui/components/Button';
|
||||
import { useConfig } from 'verdaccio-ui/providers/config';
|
||||
import storage from 'verdaccio-ui/utils/storage';
|
||||
import { getRegistryURL } from 'verdaccio-ui/utils/url';
|
||||
|
||||
import AppContext from '../../App/AppContext';
|
||||
|
||||
@@ -31,7 +31,6 @@ const Header: React.FC<Props> = ({ withoutSearch }) => {
|
||||
}
|
||||
|
||||
const { user, scope, setUser } = appContext;
|
||||
const { configOptions } = useConfig();
|
||||
|
||||
/**
|
||||
* Logouts user
|
||||
@@ -53,14 +52,14 @@ const Header: React.FC<Props> = ({ withoutSearch }) => {
|
||||
onOpenRegistryInfoDialog={() => setOpenInfoDialog(true)}
|
||||
onToggleLogin={() => setShowLoginModal(!showLoginModal)}
|
||||
onToggleMobileNav={() => setShowMobileNavBar(!showMobileNavBar)}
|
||||
username={user?.username}
|
||||
username={user && user.username}
|
||||
withoutSearch={withoutSearch}
|
||||
/>
|
||||
</InnerNavBar>
|
||||
<HeaderInfoDialog
|
||||
isOpen={isInfoDialogOpen}
|
||||
onCloseDialog={() => setOpenInfoDialog(false)}
|
||||
registryUrl={configOptions.base}
|
||||
registryUrl={getRegistryURL()}
|
||||
scope={scope}
|
||||
/>
|
||||
</NavBar>
|
||||
|
||||
@@ -14,7 +14,7 @@ const HeaderGreetings: React.FC<Props> = ({ username }) => {
|
||||
return (
|
||||
<>
|
||||
<Greetings>{t('header.greetings')}</Greetings>
|
||||
<Label data-testid="greetings-label" text={username} weight="bold" />
|
||||
<Label capitalize={true} data-testid="greetings-label" text={username} weight="bold" />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ import { RightSide } from './styles';
|
||||
|
||||
interface Props {
|
||||
withoutSearch?: boolean;
|
||||
username?: string | null;
|
||||
username?: string;
|
||||
onToggleLogin: () => void;
|
||||
onOpenRegistryInfoDialog: () => void;
|
||||
onToggleMobileNav: () => void;
|
||||
|
||||
@@ -25,7 +25,7 @@ import MenuItem from 'verdaccio-ui/components/MenuItem';
|
||||
import { Theme } from 'verdaccio-ui/design-tokens/theme';
|
||||
import ThemeContext from 'verdaccio-ui/design-tokens/ThemeContext';
|
||||
|
||||
import { Language } from '../../../i18n/config';
|
||||
import { Language } from '../../../../i18n/config';
|
||||
|
||||
const lngDetails: Record<Language, { translation: TFunctionKeys; icon: React.ReactElement }> = {
|
||||
'fr-FR': {
|
||||
@@ -166,7 +166,7 @@ const StyledLanguageIcon = styled(LanguageIcon)<{ theme?: Theme }>(({ theme }) =
|
||||
const Wrapper = styled('div')<{ theme?: Theme }>(({ theme }) => ({
|
||||
width: 220,
|
||||
display: 'none',
|
||||
[`@media screen and (min-width: ${theme?.breakPoints.medium}px)`]: {
|
||||
[`@media screen and (min-width: ${theme && theme.breakPoints.medium}px)`]: {
|
||||
display: 'inline-block',
|
||||
},
|
||||
}));
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './LanguageSwitch';
|
||||
@@ -1,13 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import api from 'verdaccio-ui/providers/API/api';
|
||||
import {
|
||||
render,
|
||||
waitFor,
|
||||
fireEvent,
|
||||
cleanup,
|
||||
act,
|
||||
} from 'verdaccio-ui/utils/test-react-testing-library';
|
||||
import api from 'verdaccio-ui/utils/api';
|
||||
import { render, waitFor, fireEvent } from 'verdaccio-ui/utils/test-react-testing-library';
|
||||
|
||||
import AppContext, { AppContextProps } from '../../AppContext';
|
||||
|
||||
@@ -22,7 +16,6 @@ describe('<LoginDialog /> component', () => {
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
jest.resetAllMocks();
|
||||
cleanup();
|
||||
});
|
||||
|
||||
test('should render the component in default state', () => {
|
||||
@@ -68,13 +61,12 @@ describe('<LoginDialog /> component', () => {
|
||||
const loginDialogButton = await waitFor(() => getByTestId('close-login-dialog-button'));
|
||||
expect(loginDialogButton).toBeTruthy();
|
||||
|
||||
act(() => {
|
||||
fireEvent.click(loginDialogButton, { open: false });
|
||||
});
|
||||
fireEvent.click(loginDialogButton, { open: false });
|
||||
expect(props.onClose).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('setCredentials - should set username and password in state', async () => {
|
||||
// TODO
|
||||
test.skip('setCredentials - should set username and password in state', async () => {
|
||||
const props = {
|
||||
open: true,
|
||||
onClose: jest.fn(),
|
||||
@@ -87,7 +79,7 @@ describe('<LoginDialog /> component', () => {
|
||||
})
|
||||
);
|
||||
|
||||
const { getByPlaceholderText, getByTestId } = render(
|
||||
const { getByPlaceholderText, getByText } = render(
|
||||
<AppContext.Provider value={appContextValue}>
|
||||
<LoginDialog onClose={props.onClose} open={props.open} />
|
||||
</AppContext.Provider>
|
||||
@@ -95,23 +87,17 @@ describe('<LoginDialog /> component', () => {
|
||||
|
||||
// TODO: the input's value is not being updated in the DOM
|
||||
const userNameInput = getByPlaceholderText('Your username');
|
||||
|
||||
fireEvent.focus(userNameInput);
|
||||
|
||||
fireEvent.change(userNameInput, { target: { value: 'xyz' } });
|
||||
|
||||
// TODO: the input's value is not being updated in the DOM
|
||||
const passwordInput = getByPlaceholderText('Your strong password');
|
||||
|
||||
fireEvent.focus(passwordInput);
|
||||
fireEvent.change(passwordInput, { target: { value: '1234' } });
|
||||
|
||||
// TODO: submitting form does not work
|
||||
const signInButton = getByTestId('login-dialog-form-login-button');
|
||||
expect(signInButton).not.toBeDisabled();
|
||||
act(() => {
|
||||
fireEvent.click(signInButton);
|
||||
});
|
||||
const signInButton = getByText('Sign in');
|
||||
fireEvent.click(signInButton);
|
||||
});
|
||||
|
||||
test.todo('validateCredentials: should validate credentials');
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import i18next from 'i18next';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import React, { useState, useContext, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import Dialog from 'verdaccio-ui/components/Dialog';
|
||||
import DialogContent from 'verdaccio-ui/components/DialogContent';
|
||||
import { useAPI, LoginBody } from 'verdaccio-ui/providers/API/APIProvider';
|
||||
import { LoginError } from 'verdaccio-ui/utils/login';
|
||||
import { makeLogin, LoginError } from 'verdaccio-ui/utils/login';
|
||||
import storage from 'verdaccio-ui/utils/storage';
|
||||
|
||||
import AppContext from '../../../App/AppContext';
|
||||
@@ -23,35 +20,6 @@ interface Props {
|
||||
const LoginDialog: React.FC<Props> = ({ onClose, open = false }) => {
|
||||
const { t } = useTranslation();
|
||||
const appContext = useContext(AppContext);
|
||||
const { doLogin } = useAPI();
|
||||
|
||||
const makeLogin = useCallback(
|
||||
async (username?: string, password?: string): Promise<LoginBody> => {
|
||||
// checks isEmpty
|
||||
if (isEmpty(username) || isEmpty(password)) {
|
||||
const error = {
|
||||
type: 'error',
|
||||
description: i18next.t('form-validation.username-or-password-cant-be-empty'),
|
||||
};
|
||||
return { error };
|
||||
}
|
||||
|
||||
try {
|
||||
const response: LoginBody = await doLogin(username as string, password as string);
|
||||
|
||||
return response;
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('login error', e.message);
|
||||
const error = {
|
||||
type: 'error',
|
||||
description: i18next.t('form-validation.unable-to-sign-in'),
|
||||
};
|
||||
return { error };
|
||||
}
|
||||
},
|
||||
[doLogin]
|
||||
);
|
||||
|
||||
if (!appContext) {
|
||||
throw Error(t('app-context-not-correct-used'));
|
||||
@@ -74,7 +42,7 @@ const LoginDialog: React.FC<Props> = ({ onClose, open = false }) => {
|
||||
onClose();
|
||||
}
|
||||
},
|
||||
[appContext, onClose, makeLogin]
|
||||
[appContext, onClose]
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -79,7 +79,7 @@ const RegistryInfoContent: React.FC<Props> = (props) => {
|
||||
/* eslint react/prop-types:0 */
|
||||
const TabContainer: React.FC = ({ children }): JSX.Element => {
|
||||
return (
|
||||
<CommandContainer data-testid={'tab-content'}>
|
||||
<CommandContainer>
|
||||
<Typography>{children}</Typography>
|
||||
</CommandContainer>
|
||||
);
|
||||
|
||||
@@ -2,17 +2,9 @@ import React from 'react';
|
||||
import { BrowserRouter as Router } from 'react-router-dom';
|
||||
|
||||
import '@testing-library/jest-dom/extend-expect';
|
||||
|
||||
import api from 'verdaccio-ui/providers/API/api';
|
||||
import api from 'verdaccio-ui/utils/api';
|
||||
import { render, fireEvent, waitFor } from 'verdaccio-ui/utils/test-react-testing-library';
|
||||
|
||||
jest.mock('lodash/debounce', () =>
|
||||
jest.fn((fn) => {
|
||||
fn.cancel = jest.fn();
|
||||
return fn;
|
||||
})
|
||||
);
|
||||
|
||||
import Search from './Search';
|
||||
|
||||
/* eslint-disable verdaccio/jsx-spread */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user