Compare commits
201 Commits
@verdaccio
...
@verdaccio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d675ce1fba | ||
|
|
55f74373f2 | ||
|
|
d43894e8f6 | ||
|
|
8ea712935e | ||
|
|
d08fe29d97 | ||
|
|
d65db96ff0 | ||
|
|
1fafb266bd | ||
|
|
6de8d61527 | ||
|
|
5401fd7635 | ||
|
|
8eee286b01 | ||
|
|
44be7b94b7 | ||
|
|
bbbb42b8fe | ||
|
|
fae5093d96 | ||
|
|
8c5ae96f79 | ||
|
|
d78c8b5153 | ||
|
|
966d9fad1d | ||
|
|
c40eae41de | ||
|
|
6c50f8569c | ||
|
|
82cb0f2bff | ||
|
|
4088cdef6d | ||
|
|
5167bb528f | ||
|
|
80df591e8f | ||
|
|
a2c3fa9ea7 | ||
|
|
a5019d89f3 | ||
|
|
24fbba1c6c | ||
|
|
c77d03018e | ||
|
|
5a6bf953a7 | ||
|
|
a57ba5f655 | ||
|
|
20a5e571d1 | ||
|
|
5b3903963a | ||
|
|
274910ca8d | ||
|
|
98a40887f5 | ||
|
|
5199775a06 | ||
|
|
9fb5429d18 | ||
|
|
3e4498ccdc | ||
|
|
a709357db6 | ||
|
|
4bee336945 | ||
|
|
20f244222b | ||
|
|
4311afea53 | ||
|
|
f00cfb4f97 | ||
|
|
4fc14eab02 | ||
|
|
a2b69a08e2 | ||
|
|
6eea70a6dd | ||
|
|
e533f1d500 | ||
|
|
45cc559f47 | ||
|
|
ce81b3e96d | ||
|
|
31d661c7bd | ||
|
|
b69333778d | ||
|
|
4dcc250fdb | ||
|
|
756a47aee0 | ||
|
|
2c45bc6e82 | ||
|
|
31050ee369 | ||
|
|
9652472780 | ||
|
|
87f903d530 | ||
|
|
8d625d25d2 | ||
|
|
a179f1fd43 | ||
|
|
a049eaa38f | ||
|
|
d2dd76260b | ||
|
|
f38c759cb2 | ||
|
|
28c3aad443 | ||
|
|
a020d4f580 | ||
|
|
160c25ddc5 | ||
|
|
1debee3e9d | ||
|
|
76d78b0328 | ||
|
|
61bbede301 | ||
|
|
635ca3f924 | ||
|
|
aeff267d94 | ||
|
|
a0dca6e927 | ||
|
|
71e5fb0221 | ||
|
|
aa0b2aa9df | ||
|
|
498afcd222 | ||
|
|
83561bc52d | ||
|
|
67b4681ce7 | ||
|
|
df53f61c64 | ||
|
|
64c8221d35 | ||
|
|
c908963132 | ||
|
|
46db10fc4f | ||
|
|
fadba40a9f | ||
|
|
02023afd74 | ||
|
|
f130817828 | ||
|
|
d2f9013ece | ||
|
|
b8554c8935 | ||
|
|
8ea24df16a | ||
|
|
67bbd93379 | ||
|
|
d09ea21bc9 | ||
|
|
0b72c32400 | ||
|
|
2d137274c4 | ||
|
|
cc30a85d3d | ||
|
|
85a01746a5 | ||
|
|
94f5e765a8 | ||
|
|
4cd71c6409 | ||
|
|
be71d77511 | ||
|
|
92a6f9a3fd | ||
|
|
b9a947aa2f | ||
|
|
110d90d888 | ||
|
|
6bed458925 | ||
|
|
73b3479a3a | ||
|
|
459af1cd39 | ||
|
|
e0d639a1a6 | ||
|
|
b78f35257e | ||
|
|
06e400cb34 | ||
|
|
dd380c5a5e | ||
|
|
ad3151c3f3 | ||
|
|
cca1f7f32a | ||
|
|
3d86b836c3 | ||
|
|
7f48edc254 | ||
|
|
9245b4d39b | ||
|
|
3b363fb531 | ||
|
|
5b39aeb623 | ||
|
|
edc7a538f3 | ||
|
|
d585216153 | ||
|
|
1367beae51 | ||
|
|
944ecf6874 | ||
|
|
2bd10d6010 | ||
|
|
7ff4808be6 | ||
|
|
7bb3c2bf0e | ||
|
|
736e7de600 | ||
|
|
048ac95e8b | ||
|
|
91fff48cb1 | ||
|
|
de3eb0fbf3 | ||
|
|
531e8d0fd1 | ||
|
|
f38cc44694 | ||
|
|
bc7f8668a8 | ||
|
|
cbd12c8f7c | ||
|
|
50968398f9 | ||
|
|
aca6ee3d92 | ||
|
|
85eaa8b043 | ||
|
|
19e5599692 | ||
|
|
96f324e9ed | ||
|
|
0a269d37b7 | ||
|
|
136a251cb6 | ||
|
|
9b8d0bb458 | ||
|
|
59435a9f46 | ||
|
|
ff6d6f4755 | ||
|
|
0847b7f99d | ||
|
|
10bd9bd5a3 | ||
|
|
02be97fc3a | ||
|
|
7ada36f5f6 | ||
|
|
0e7b266adc | ||
|
|
9c10955988 | ||
|
|
9aa77d92c8 | ||
|
|
937bbd0454 | ||
|
|
ce92b87305 | ||
|
|
5be1475204 | ||
|
|
563d65c9ea | ||
|
|
299f9cbf0f | ||
|
|
c85f98ce4d | ||
|
|
b5887ba3f5 | ||
|
|
0cde4e8e98 | ||
|
|
b1b6a94e3c | ||
|
|
84201b43b5 | ||
|
|
070f9477a7 | ||
|
|
935b4ff583 | ||
|
|
7cf4abb99d | ||
|
|
df39b4624a | ||
|
|
68c65f418a | ||
|
|
4b7d0b0c0c | ||
|
|
f8740598a3 | ||
|
|
730b5d8cc0 | ||
|
|
dd54d82000 | ||
|
|
c847a8b61d | ||
|
|
22093ebffe | ||
|
|
7ec9c8772b | ||
|
|
926e519dd3 | ||
|
|
5106fcb287 | ||
|
|
52d3442856 | ||
|
|
4fd84f589b | ||
|
|
ab61e1adc9 | ||
|
|
5983625ff7 | ||
|
|
fe6fcb9950 | ||
|
|
d3ab11a6f0 | ||
|
|
508247ce70 | ||
|
|
dd65119454 | ||
|
|
a87364b839 | ||
|
|
57743e7150 | ||
|
|
80f498c037 | ||
|
|
d13408b4fc | ||
|
|
493fdebea3 | ||
|
|
85675d6fed | ||
|
|
8592ebb5f1 | ||
|
|
a40f39d7ec | ||
|
|
c070bfcd73 | ||
|
|
a32b0a6c06 | ||
|
|
d778f2cd18 | ||
|
|
d36beaf650 | ||
|
|
0634d90f05 | ||
|
|
1a3b0db563 | ||
|
|
fc05d3bfb2 | ||
|
|
8ec8ba5758 | ||
|
|
2def2ca635 | ||
|
|
89cbc06151 | ||
|
|
d2c68f2195 | ||
|
|
b260feafee | ||
|
|
49ebe86dd5 | ||
|
|
8177f81780 | ||
|
|
ebcafd2739 | ||
|
|
651092d08e | ||
|
|
47f36463a8 | ||
|
|
f7e4e5c196 | ||
|
|
2cf0371c0e | ||
|
|
b60e20037d |
19
.babelrc
19
.babelrc
@@ -1,15 +1,14 @@
|
||||
{
|
||||
"presets": [ [
|
||||
"@babel/env",
|
||||
{
|
||||
"targets": {
|
||||
"node": 14
|
||||
"presets": [
|
||||
[
|
||||
"@babel/env",
|
||||
{
|
||||
"targets": {
|
||||
"node": 16
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
],
|
||||
"@babel/typescript"
|
||||
],
|
||||
"ignore": [
|
||||
"**/*.d.ts"
|
||||
]
|
||||
"ignore": ["**/*.d.ts"]
|
||||
}
|
||||
|
||||
5
.changeset/brown-cycles-laugh.md
Normal file
5
.changeset/brown-cycles-laugh.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/cli': patch
|
||||
---
|
||||
|
||||
chore: improve error logger message
|
||||
5
.changeset/brown-pandas-wink.md
Normal file
5
.changeset/brown-pandas-wink.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
---
|
||||
|
||||
add banner support ukraine
|
||||
5
.changeset/dull-monkeys-search.md
Normal file
5
.changeset/dull-monkeys-search.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
---
|
||||
|
||||
show verdaccio logo in the footer even when custom brand is set
|
||||
5
.changeset/fuzzy-drinks-taste.md
Normal file
5
.changeset/fuzzy-drinks-taste.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': minor
|
||||
---
|
||||
|
||||
fix: remove engines from ui-theme
|
||||
5
.changeset/kind-bears-nail.md
Normal file
5
.changeset/kind-bears-nail.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
---
|
||||
|
||||
feat: add types and package module icons on sidebar
|
||||
7
.changeset/light-walls-begin.md
Normal file
7
.changeset/light-walls-begin.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': minor
|
||||
'@verdaccio/server': minor
|
||||
'@verdaccio/web': minor
|
||||
---
|
||||
|
||||
feat: align with v5 ui endpoints and ui small bugfix
|
||||
5
.changeset/loud-shoes-jog.md
Normal file
5
.changeset/loud-shoes-jog.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
---
|
||||
|
||||
chore: force publish
|
||||
5
.changeset/lovely-drinks-argue.md
Normal file
5
.changeset/lovely-drinks-argue.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/loaders': patch
|
||||
---
|
||||
|
||||
always create plugin instance with new
|
||||
5
.changeset/neat-toys-float.md
Normal file
5
.changeset/neat-toys-float.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
---
|
||||
|
||||
fix: replace ts icon by td and fix commonjs icon
|
||||
43
.changeset/orange-flowers-cover.md
Normal file
43
.changeset/orange-flowers-cover.md
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
'@verdaccio/config': minor
|
||||
'@verdaccio/types': minor
|
||||
'@verdaccio/ui-theme': minor
|
||||
---
|
||||
|
||||
feat: rework web header for mobile, add new settings and raw manifest button
|
||||
|
||||
### New set of variables to hide features
|
||||
|
||||
Add set of new variables that allow hide different parts of the UI, buttons, footer or download tarballs. _All are
|
||||
enabled by default_.
|
||||
|
||||
```yaml
|
||||
# login: true <-- already exist but worth the reminder
|
||||
# showInfo: true
|
||||
# showSettings: true
|
||||
# In combination with darkMode you can force specific theme
|
||||
# showThemeSwitch: true
|
||||
# showFooter: true
|
||||
# showSearch: true
|
||||
# showDownloadTarball: true
|
||||
```
|
||||
|
||||
> If you disable `showThemeSwitch` and force `darkMode: true` the local storage settings would be
|
||||
> ignored and force all themes to the one in the configuration file.
|
||||
|
||||
Future could be extended to
|
||||
|
||||
### Raw button to display manifest package
|
||||
|
||||
A new experimental feature (enabled by default), button named RAW to be able navigate on the package manifest directly on the ui, kudos to [react-json-view](https://www.npmjs.com/package/react-json-view) that allows an easy integration, not configurable yet until get more feedback.
|
||||
|
||||
```yaml
|
||||
showRaw: true
|
||||
```
|
||||
|
||||
#### Rework header buttons
|
||||
|
||||
- The header has been rework, the mobile was not looking broken.
|
||||
- Removed info button in the header and moved to a dialog
|
||||
- Info dialog now contains more information about the project, license and the aid content for Ukrania now is inside of the info modal.
|
||||
- Separate settings and info to avoid collapse too much info (for mobile still need some work)
|
||||
@@ -41,23 +41,27 @@
|
||||
"@verdaccio/fastify-migration": "6.0.0-6-next.9",
|
||||
"@verdaccio/eslint-config": "1.0.0",
|
||||
"@verdaccio/benchmark": "1.0.0",
|
||||
"@verdaccio/website": "5.1.3",
|
||||
"@verdaccio/core": "6.0.0-next.0",
|
||||
"@verdaccio/helper": "1.0.0",
|
||||
"docusaurus-plugin-contributors": "1.0.0"
|
||||
"@verdaccio/test-helper": "1.0.0",
|
||||
"docusaurus-plugin-contributors": "1.0.0",
|
||||
"@verdaccio/website": "5.4.0"
|
||||
},
|
||||
"changesets": [
|
||||
"afraid-mice-obey",
|
||||
"big-lobsters-sin",
|
||||
"bright-poems-obey",
|
||||
"brown-cycles-laugh",
|
||||
"brown-pandas-wink",
|
||||
"calm-pants-impress",
|
||||
"dry-planes-tap",
|
||||
"dull-monkeys-search",
|
||||
"eleven-brooms-hunt",
|
||||
"eleven-spoons-matter",
|
||||
"fair-lemons-beam",
|
||||
"few-cooks-destroy",
|
||||
"few-mangos-grow",
|
||||
"fifty-jars-rest",
|
||||
"fuzzy-drinks-taste",
|
||||
"fuzzy-onions-draw",
|
||||
"gentle-parrots-lay",
|
||||
"gentle-trains-switch",
|
||||
@@ -66,13 +70,19 @@
|
||||
"healthy-poets-compare",
|
||||
"heavy-ravens-lay",
|
||||
"hip-hounds-destroy",
|
||||
"kind-bears-nail",
|
||||
"late-adults-love",
|
||||
"late-parents-act",
|
||||
"light-walls-begin",
|
||||
"little-stingrays-rule",
|
||||
"loud-shoes-jog",
|
||||
"lovely-drinks-argue",
|
||||
"many-vans-care",
|
||||
"modern-spies-tell",
|
||||
"neat-toes-report",
|
||||
"neat-toys-float",
|
||||
"olive-candles-speak",
|
||||
"orange-flowers-cover",
|
||||
"perfect-candles-clap",
|
||||
"perfect-emus-clean",
|
||||
"perfect-kangaroos-agree",
|
||||
@@ -81,18 +91,27 @@
|
||||
"plenty-tables-refuse",
|
||||
"pretty-hounds-tap",
|
||||
"proud-jeans-walk",
|
||||
"proud-jobs-hope",
|
||||
"red-chefs-float",
|
||||
"red-yaks-sell",
|
||||
"rich-ghosts-rule",
|
||||
"shaggy-carrots-unite",
|
||||
"shaggy-parrots-smash",
|
||||
"shiny-chefs-heal",
|
||||
"slow-carrots-relate",
|
||||
"smart-apricots-kneel",
|
||||
"smart-beds-cross",
|
||||
"sour-buses-shout",
|
||||
"spicy-frogs-press",
|
||||
"spicy-snakes-sip",
|
||||
"swift-pumpkins-knock",
|
||||
"ten-parents-breathe",
|
||||
"tender-bags-call",
|
||||
"thick-countries-move",
|
||||
"thick-readers-hang",
|
||||
"three-moles-drop",
|
||||
"three-pots-sit",
|
||||
"tiny-seals-join",
|
||||
"two-dolls-check",
|
||||
"wild-jokes-beam"
|
||||
]
|
||||
|
||||
45
.changeset/proud-jobs-hope.md
Normal file
45
.changeset/proud-jobs-hope.md
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
'@verdaccio/api': major
|
||||
'@verdaccio/cli': major
|
||||
'@verdaccio/config': major
|
||||
'@verdaccio/core': major
|
||||
'@verdaccio/types': major
|
||||
'@verdaccio/logger': major
|
||||
'@verdaccio/node-api': major
|
||||
'verdaccio-aws-s3-storage': major
|
||||
'verdaccio-google-cloud': major
|
||||
'verdaccio-htpasswd': major
|
||||
'@verdaccio/local-storage': major
|
||||
'verdaccio-memory': major
|
||||
'@verdaccio/ui-theme': major
|
||||
'@verdaccio/proxy': major
|
||||
'@verdaccio/server': major
|
||||
'@verdaccio/mock': major
|
||||
'verdaccio': major
|
||||
'@verdaccio/web': major
|
||||
'@verdaccio/e2e-cli': major
|
||||
'@verdaccio/website': major
|
||||
---
|
||||
|
||||
feat!: config.logs throw an error, logging config not longer accept array or logs property
|
||||
|
||||
### 💥 Breaking change
|
||||
|
||||
This is valid
|
||||
|
||||
```yaml
|
||||
log: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
This is invalid
|
||||
|
||||
```yaml
|
||||
logs: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```yaml
|
||||
logs:
|
||||
- [{ type: stdout, format: pretty, level: http }]
|
||||
```
|
||||
5
.changeset/red-yaks-sell.md
Normal file
5
.changeset/red-yaks-sell.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/logger': patch
|
||||
---
|
||||
|
||||
Fix re-opening log files using SIGUSR2
|
||||
6
.changeset/slow-carrots-relate.md
Normal file
6
.changeset/slow-carrots-relate.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@verdaccio/config': minor
|
||||
'@verdaccio/web': minor
|
||||
---
|
||||
|
||||
feat(web): add a config item to web,let the developer can select whet……her enable the html cache
|
||||
20
.changeset/smart-beds-cross.md
Normal file
20
.changeset/smart-beds-cross.md
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
'@verdaccio/api': minor
|
||||
'@verdaccio/config': minor
|
||||
'@verdaccio/core': minor
|
||||
'@verdaccio/types': minor
|
||||
'@verdaccio/local-storage': minor
|
||||
'@verdaccio/ui-theme': minor
|
||||
'@verdaccio/proxy': minor
|
||||
'@verdaccio/server': minor
|
||||
'@verdaccio/store': minor
|
||||
'@verdaccio/test-helper': minor
|
||||
'@verdaccio/web': minor
|
||||
---
|
||||
|
||||
feat: ui search support for remote, local and private packages
|
||||
|
||||
The command `npm search` search globally and return all matches, with this improvement the user interface
|
||||
is powered with the same capabilities.
|
||||
|
||||
The UI also tag where is the origin the package with a tag, also provide the latest version and description of the package.
|
||||
5
.changeset/spicy-snakes-sip.md
Normal file
5
.changeset/spicy-snakes-sip.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
---
|
||||
|
||||
fix: specific version package detail page not showing
|
||||
6
.changeset/swift-pumpkins-knock.md
Normal file
6
.changeset/swift-pumpkins-knock.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@verdaccio/auth': patch
|
||||
'verdaccio-htpasswd': patch
|
||||
---
|
||||
|
||||
Refactor htpasswd plugin to use the bcryptjs 'compare' api call instead of 'comparSync'. Add a new configuration value named 'slow_verify_ms' to the htpasswd plugin that when exceeded during password verification will log a warning message.
|
||||
6
.changeset/thick-countries-move.md
Normal file
6
.changeset/thick-countries-move.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@verdaccio/logger': major
|
||||
'@verdaccio/logger-prettify': major
|
||||
---
|
||||
|
||||
feat: upgrade to pino v7
|
||||
5
.changeset/thick-readers-hang.md
Normal file
5
.changeset/thick-readers-hang.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
---
|
||||
|
||||
fix: fixes some style issues on mobile, particularly related to the Ukraine support message - [@s-h-a-d-o-w](https://github.com/s-h-a-d-o-w)
|
||||
5
.changeset/tiny-seals-join.md
Normal file
5
.changeset/tiny-seals-join.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': minor
|
||||
---
|
||||
|
||||
feat: improve registry info dialog and language switch
|
||||
52
.github/workflows/benchmark.yml
vendored
52
.github/workflows/benchmark.yml
vendored
@@ -4,9 +4,9 @@ name: ci - benchmark
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# 3 times day
|
||||
# 1 time peer week
|
||||
# collecting enough data to draw some graphics
|
||||
- cron: '0 1 * * *'
|
||||
- cron: '0 1 * * 1'
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
@@ -15,12 +15,12 @@ jobs:
|
||||
name: Prepare build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14.x
|
||||
node-version: 16.x
|
||||
- name: install pnpm
|
||||
run: sudo npm i pnpm@6.6.1 -g
|
||||
run: sudo npm i pnpm@6.24.1 -g
|
||||
- name: set store
|
||||
run: |
|
||||
mkdir ~/.pnpm-store
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: Cache .pnpm-store
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
- name: tar packages
|
||||
run: |
|
||||
tar -czvf ${{ github.workspace }}/pkg.tar.gz -C ${{ github.workspace }}/packages .
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
path: pkg.tar.gz
|
||||
@@ -57,24 +57,24 @@ jobs:
|
||||
# - local
|
||||
- 3.13.1
|
||||
- 4.12.2
|
||||
- 5.3.0
|
||||
- 6.0.0-6-next.27
|
||||
- 5.7.0
|
||||
- 6.0.0-6-next.35
|
||||
name: Benchmark autocannon
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14.x
|
||||
- uses: actions/download-artifact@v2
|
||||
node-version: 16.x
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: install pnpm
|
||||
# require fixed version
|
||||
run: sudo npm i pnpm@6.6.1 -g
|
||||
- uses: actions/cache@v2
|
||||
run: sudo npm i pnpm@6.24.1 -g
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -87,7 +87,7 @@ jobs:
|
||||
shell: bash
|
||||
env:
|
||||
DEBUG: metrics*
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: verdaccio-metrics-api
|
||||
path: ./api-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
@@ -118,24 +118,24 @@ jobs:
|
||||
# old versions to compare same test along previous releases
|
||||
- 3.13.1
|
||||
- 4.12.2
|
||||
- 5.3.0
|
||||
- 6.0.0-6-next.27
|
||||
- 5.7.0
|
||||
- 6.0.0-6-next.35
|
||||
name: Benchmark hyperfine
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14.x
|
||||
- uses: actions/download-artifact@v2
|
||||
node-version: 16.x
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: install pnpm
|
||||
# require fixed version
|
||||
run: sudo npm i pnpm@6.6.1 -g
|
||||
- uses: actions/cache@v2
|
||||
run: sudo npm i pnpm@6.24.1 -g
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -153,7 +153,7 @@ jobs:
|
||||
shell: bash
|
||||
- name: rename
|
||||
run: mv ./hyper-results.json ./hyper-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: verdaccio-metrics
|
||||
path: ./hyper-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
|
||||
4
.github/workflows/changesets.yml
vendored
4
.github/workflows/changesets.yml
vendored
@@ -20,12 +20,12 @@ jobs:
|
||||
if: github.ref == 'refs/heads/master' && github.repository == 'verdaccio/verdaccio'
|
||||
steps:
|
||||
- name: checkout code repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: setup node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
245
.github/workflows/ci.yml
vendored
245
.github/workflows/ci.yml
vendored
@@ -10,7 +10,7 @@ on:
|
||||
- .changeset/**
|
||||
- .github/workflows/ci.yml
|
||||
- 'packages/**'
|
||||
- 'docker-examples/**'
|
||||
- 'docker-examples/**'
|
||||
- 'jest/**'
|
||||
- 'package.json'
|
||||
- 'pnpm-workspace.yaml'
|
||||
@@ -24,21 +24,21 @@ jobs:
|
||||
ports:
|
||||
- 4873:4873
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- name: Use Node 14
|
||||
uses: actions/setup-node@v1
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
run: npm i pnpm@6.32.3 -g
|
||||
- name: set store
|
||||
run: |
|
||||
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
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -49,17 +49,17 @@ jobs:
|
||||
name: Lint
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
- uses: actions/cache@v2
|
||||
run: npm i pnpm@6.32.3 -g
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: Lint
|
||||
@@ -69,195 +69,126 @@ jobs:
|
||||
name: Format
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
- uses: actions/cache@v2
|
||||
run: npm i pnpm@6.32.3 -g
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
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.4.0
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.10.3 -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: crowdin download
|
||||
env:
|
||||
CROWDIN_VERDACCIO_PROJECT_ID: ${{ secrets.CROWDIN_VERDACCIO_PROJECT_ID }}
|
||||
CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }}
|
||||
CONTEXT: production
|
||||
run: pnpm crowdin:download
|
||||
## this step is optional, translations are not mandatory for PR
|
||||
## secrets keys are not available on forks, the failure here is guaranteed
|
||||
continue-on-error: true
|
||||
- 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
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
## Node 16 breaks UI test, jest issue
|
||||
node_version: [14]
|
||||
node_version: [16, 17]
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v3
|
||||
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@6.10.3 -g
|
||||
- uses: actions/cache@v2
|
||||
run: npm i pnpm@6.32.3 -g
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
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.4.0
|
||||
- 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@6.10.3 -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.4.0
|
||||
- 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@6.10.3 -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
|
||||
env:
|
||||
DEBUG: verdaccio*
|
||||
test-windows:
|
||||
needs: [format, lint]
|
||||
runs-on: windows-latest
|
||||
name: windows test node 14
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- name: Use Node 14
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.10.3 -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
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: build
|
||||
run: pnpm build
|
||||
- name: Test
|
||||
run: pnpm test
|
||||
ci-e2e-ui:
|
||||
needs: [format, lint]
|
||||
runs-on: ubuntu-latest
|
||||
name: UI Test E2E Node 16
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v3
|
||||
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: build
|
||||
run: pnpm build
|
||||
- name: Test UI
|
||||
run: pnpm test:e2e:ui
|
||||
# env:
|
||||
# DEBUG: verdaccio:e2e*
|
||||
# FIXME verify why fails on Node 16 (locally works fine)
|
||||
# ci-e2e-cli:
|
||||
# needs: [format, lint]
|
||||
# runs-on: ubuntu-latest
|
||||
# # TODO: fails on migrate to node 16, we need to check why
|
||||
# name: CLI Test E2E Node 16
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# - uses: actions/setup-node@v3
|
||||
# with:
|
||||
# node-version: 16
|
||||
# - name: Install pnpm
|
||||
# run: npm i pnpm@latest -g
|
||||
# - uses: actions/cache@v3
|
||||
# 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: build
|
||||
# run: pnpm build
|
||||
# - name: Test CLI
|
||||
# run: pnpm test:e2e:cli
|
||||
# env:
|
||||
# DEBUG: verdaccio*
|
||||
sync-translations:
|
||||
needs: [ci-e2e-cli, ci-e2e-ui, test-windows, test]
|
||||
# needs: [ci-e2e-cli, ci-e2e-ui]
|
||||
needs: [ci-e2e-ui]
|
||||
runs-on: ubuntu-latest
|
||||
name: synchronize translations
|
||||
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
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
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
- uses: actions/cache@v2
|
||||
run: npm i pnpm@6.32.3 -g
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
## we need scripts, pupetter downloads aditional content
|
||||
run: pnpm recursive install --frozen-lockfile
|
||||
- name: build
|
||||
run: pnpm build
|
||||
- name: generate website translations
|
||||
run: pnpm write-translations --filter ...@verdaccio/website
|
||||
run: pnpm write-translations --filter ...@verdaccio/website
|
||||
- name: sync
|
||||
env:
|
||||
CROWDIN_VERDACCIO_PROJECT_ID: ${{ secrets.CROWDIN_VERDACCIO_PROJECT_ID }}
|
||||
CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }}
|
||||
CONTEXT: production
|
||||
run: pnpm crowdin:sync
|
||||
run: pnpm crowdin:sync
|
||||
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2.4.0
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
|
||||
48
.github/workflows/contributors.yml
vendored
Normal file
48
.github/workflows/contributors.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
name: contributors
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# twice peer week
|
||||
- cron: '0 0 * * 1,4'
|
||||
# for now, scheduled, we can enable on push master but not make much sense now
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
jobs:
|
||||
prepare:
|
||||
name: Run script
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 17.x
|
||||
- name: install pnpm
|
||||
run: sudo npm i pnpm@6.24.1 -g
|
||||
- name: set store
|
||||
run: |
|
||||
mkdir ~/.pnpm-store
|
||||
pnpm config set store-dir ~/.pnpm-store
|
||||
- name: setup pnpm config registry
|
||||
run: pnpm config set registry https://registry.verdaccio.org
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: update contributors
|
||||
run: pnpm run contributors
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: format
|
||||
run: pnpm format
|
||||
- name: Commit & Push changes
|
||||
uses: actions-js/push@v1.3
|
||||
with:
|
||||
github_token: ${{ secrets.TOKEN_VERDACCIOBOT_GITHUB }}
|
||||
message: "chore: updated contributors list"
|
||||
branch: master
|
||||
author_email: verdaccio.npm@gmail.com
|
||||
author_name: verdacciobot
|
||||
2
.github/workflows/docker-publish.yml
vendored
2
.github/workflows/docker-publish.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
|
||||
22
.github/workflows/website.yml
vendored
22
.github/workflows/website.yml
vendored
@@ -24,15 +24,15 @@ jobs:
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node 14
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Cache pnpm modules
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-pnpm-modules
|
||||
with:
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
|
||||
|
||||
- uses: pnpm/action-setup@v2.0.1
|
||||
- uses: pnpm/action-setup@v2.2.1
|
||||
with:
|
||||
version: 6.10.2
|
||||
run_install: |
|
||||
@@ -49,13 +49,8 @@ jobs:
|
||||
args: [--frozen-lockfile]
|
||||
- name: Build Plugins
|
||||
run: pnpm build --filter "docusaurus-plugin-contributors"
|
||||
- name: Lint And Pretty
|
||||
run: |
|
||||
pnpm eslint:check --filter ...@verdaccio/website
|
||||
pnpm prettier:check --filter ...@verdaccio/website
|
||||
|
||||
- name: Cache Docusaurus Build
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: website/node_modules/.cache/webpack
|
||||
key: cache/webpack-${{github.ref}}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
@@ -102,7 +97,7 @@ jobs:
|
||||
|
||||
- name: Audit preview URL with Lighthouse
|
||||
id: lighthouse_audit
|
||||
uses: treosh/lighthouse-ci-action@v3
|
||||
uses: treosh/lighthouse-ci-action@9.3.0
|
||||
with:
|
||||
urls: |
|
||||
${{ steps.netlify_preview.outputs.preview-url }}
|
||||
@@ -111,7 +106,7 @@ jobs:
|
||||
|
||||
- name: Format lighthouse score
|
||||
id: format_lighthouse_score
|
||||
uses: actions/github-script@v3
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
@@ -135,10 +130,11 @@ jobs:
|
||||
|
||||
- name: Add comment to PR
|
||||
id: comment_to_pr
|
||||
uses: marocchino/sticky-pull-request-comment@v1
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
number: ${{ github.event.issue.number }}
|
||||
delete: true
|
||||
header: lighthouse
|
||||
message: |
|
||||
${{ steps.format_lighthouse_score.outputs.comment }}
|
||||
|
||||
@@ -138,10 +138,8 @@ output to the code. Each package has it owns namespace.
|
||||
|
||||
To run the application from the source code, ensure the project has been built with `pnpm build`, once this is done, there are few commands that helps to run server:
|
||||
|
||||
- `pnpm start`: Run the server and the UI with `concurrently`, the
|
||||
server runs in the port `8000` and the UI on the port `4873`. This command
|
||||
is useful if you want to contribute mostly on the UI.
|
||||
- `pnpm debug`: Run the server in debug mode `--inspect`, the UI is included but does not have hot reload. For automatic break use `pnpm debug:break`.
|
||||
- `pnpm start`: Runs server on port `8000` and UI on port `4873`. This is particularly useful if you want to contribute to the UI, since it runs with hot reload.
|
||||
- `pnpm debug`: Run the server in debug mode `--inspect`. UI runs too but without hot reload. For automatic break use `pnpm debug:break`.
|
||||
- `pnpm debug:fastify`: To contribute on the [fastify migration](https://github.com/verdaccio/verdaccio/discussions/2155) this is a temporary command for such purpose.
|
||||
- `pnpm website`: Build the website, for more commands to run the _website_, run `cd website` and then `pnpm serve`, website will run on port `3000`.
|
||||
- `pnpm docker`: Build the docker image. Requires `docker` command available in your system.
|
||||
@@ -333,8 +331,8 @@ We use [changesets](https://github.com/atlassian/changesets) in order to
|
||||
generate a detailed Changelog as possible.
|
||||
|
||||
Adding a changeset with your Pull Request is essential if you want your
|
||||
contribution to get merged (unless is a change that does not affect library
|
||||
functionality, eg: typo, docs, readme, add additional test or linting code). To
|
||||
contribution to get merged (unless it does not affect functionality or
|
||||
user-facing content, eg: docs, readme, adding test or typo/lint fixes). To
|
||||
create a changeset please run:
|
||||
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:14.18.1-alpine as builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:16.14.2-alpine as builder
|
||||
|
||||
ENV NODE_ENV=development \
|
||||
VERDACCIO_BUILD_REGISTRY=https://registry.verdaccio.org
|
||||
@@ -11,7 +11,7 @@ RUN apk --no-cache add openssl ca-certificates wget && \
|
||||
|
||||
WORKDIR /opt/verdaccio-build
|
||||
COPY . .
|
||||
RUN npm -g i pnpm@6.10.3 && \
|
||||
RUN npm -g i pnpm@6.24.1 && \
|
||||
pnpm config set registry $VERDACCIO_BUILD_REGISTRY && \
|
||||
pnpm recursive install --frozen-lockfile --ignore-scripts && \
|
||||
rm -Rf test && \
|
||||
@@ -20,7 +20,7 @@ RUN npm -g i pnpm@6.10.3 && \
|
||||
# FIXME: need to remove devDependencies from the build
|
||||
# RUN pnpm install --prod --ignore-scripts
|
||||
|
||||
FROM node:14.18.1-alpine
|
||||
FROM node:16.14.2-alpine
|
||||
LABEL maintainer="https://github.com/verdaccio/verdaccio"
|
||||
|
||||
ENV VERDACCIO_APPDIR=/opt/verdaccio \
|
||||
|
||||
34
README.md
34
README.md
@@ -1,10 +1,14 @@
|
||||
[](https://donate.redcrossredcrescent.org/ua/donate/~my-donation?_cv=1)
|
||||
|
||||
> Verdaccio stands for **peace**, stop the war, we will be yellow / blue 🇺🇦 until that happens.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
# Version 6 (Development branch)
|
||||
|
||||
> Looking for Verdaccio 5? Check branch `5.x`.
|
||||
> Looking for Verdaccio 5? Check branch `5.x`
|
||||
|
||||
[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
|
||||
@@ -26,10 +30,11 @@ Google Cloud Storage** or create your own plugin.
|
||||
|
||||
[](https://twitter.com/verdaccio_npm)
|
||||
[](https://github.com/verdaccio/verdaccio/stargazers)
|
||||
[](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
|
||||
|
||||
## Install
|
||||
|
||||
> Latest Node.js v14
|
||||
> Latest Node.js v16 required
|
||||
|
||||
Install with npm:
|
||||
|
||||
@@ -45,7 +50,7 @@ docker pull verdaccio/verdaccio:nightly-master
|
||||
|
||||
## 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.** 😉
|
||||
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 do a long support donation - **and your logo will be on this section of the readme.**
|
||||
|
||||
**[Donate](https://github.com/sponsors/verdaccio)** 💵👍🏻 starting from _$1/month_ or just one single contribution.
|
||||
|
||||
@@ -73,17 +78,26 @@ If you want to use a modified version of some 3rd-party package (for example, yo
|
||||
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
|
||||
## Watch our Videos
|
||||
|
||||
### **Testing the integrity of your React components by publishing in a private registry - React Finland 2021**.
|
||||
**Node Congress 2022, February 2022, Online Free**
|
||||
|
||||
[](https://www.youtube.com/watch?v=bRKZbrlQqLY&t=16s&ab_channel=ReactFinland)
|
||||
<div>
|
||||
<a href="https://portal.gitnation.org/contents/five-ways-of-taking-advantage-of-verdaccio-your-private-and-proxy-nodejs-registry">
|
||||
<img src="https://cdn.verdaccio.dev/readme/nodejscongress2022.jpg" alt="nodejs" width="300"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
### **Using Docker and Verdaccio to make Integration Testing Easy - Docker All Hands #4 December - 2021**.
|
||||
|
||||
[](https://www.youtube.com/watch?v=zRI0skF1f8I)
|
||||
|
||||
You might want to check out as well our previous talks:
|
||||
|
||||
- [**Juan Picado** – Testing the integrity of React components by publishing in a private registry - React Finland - 2021](https://www.youtube.com/watch?v=bRKZbrlQqLY&t=16s&ab_channel=ReactFinland)
|
||||
- [BeerJS Cba Meetup No. 53 May 2021 - **Juan Picado**](https://www.youtube.com/watch?v=6SyjqBmS49Y&ab_channel=BeerJSCba)
|
||||
- [Node.js Dependency Confusion Attacks - April 2021 - **Juan Picado\***](https://www.youtube.com/watch?v=qTRADSp3Hpo)
|
||||
- [**OpenJS World 2020** about \*Cover your Projects with a Multi purpose Lightweight Node.js Registry - **Juan Picado\***](https://www.youtube.com/watch?v=oVCjDWeehAQ)
|
||||
- [Node.js Dependency Confusion Attacks - April 2021 - **Juan Picado**](https://www.youtube.com/watch?v=qTRADSp3Hpo)
|
||||
- [**OpenJS World 2020** about \*Cover your Projects with a Multi purpose Lightweight Node.js Registry - **Juan Picado**](https://www.youtube.com/watch?v=oVCjDWeehAQ)
|
||||
- [ViennaJS Meetup - Introduction to Verdaccio by **Priscila Olivera** and **Juan Picado**](https://www.youtube.com/watch?v=hDIFKzmoCa)
|
||||
- [Open Source? trivago - Verdaccio (**Ayush** and **Juan Picado**) January 2020](https://www.youtube.com/watch?v=A5CWxJC9xzc)
|
||||
- [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)
|
||||
@@ -100,7 +114,7 @@ verdaccio
|
||||
You would need set some npm configuration, this is optional.
|
||||
|
||||
```bash
|
||||
$ npm set registry http://localhost:4873/
|
||||
npm set registry http://localhost:4873/
|
||||
```
|
||||
|
||||
For one-off commands or to avoid setting the registry globally:
|
||||
@@ -124,7 +138,7 @@ 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
|
||||
npm set ca null
|
||||
```
|
||||
|
||||
#### 2. publish your package
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration
|
||||
#
|
||||
# Look here for more config file examples:
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
||||
#
|
||||
|
||||
# path to a directory with all packages
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration
|
||||
#
|
||||
# Look here for more config file examples:
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
||||
#
|
||||
|
||||
# path to a directory with all packages
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration
|
||||
#
|
||||
# Look here for more config file examples:
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
||||
#
|
||||
|
||||
# path to a directory with all packages
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration
|
||||
#
|
||||
# Look here for more config file examples:
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
||||
#
|
||||
|
||||
# path to a directory with all packages
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration
|
||||
#
|
||||
# Look here for more config file examples:
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
||||
#
|
||||
|
||||
# path to a directory with all packages
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration
|
||||
#
|
||||
# Look here for more config file examples:
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
||||
#
|
||||
|
||||
# path to a directory with all packages
|
||||
|
||||
@@ -46,4 +46,4 @@ middlewares:
|
||||
audit:
|
||||
enabled: true
|
||||
|
||||
logs: { type: stdout, format: pretty, level: trace }
|
||||
log: { type: stdout, format: pretty, level: trace }
|
||||
|
||||
@@ -42,4 +42,4 @@ middlewares:
|
||||
audit:
|
||||
enabled: true
|
||||
|
||||
logs: { type: stdout, format: json, level: trace }
|
||||
log: { type: stdout, format: json, level: trace }
|
||||
|
||||
@@ -22,7 +22,8 @@ invalid address - xxxxxx, we expect a port (e.g. "4873"),
|
||||
|
||||
## VERDEP002
|
||||
|
||||
'deprecate: multiple logger configuration is deprecated, please check the migration guide.'
|
||||
> After version `verdaccio@6.0.0-6-next.38` this is not longer a warning and
|
||||
> will crash your application
|
||||
|
||||
## VERDEP003
|
||||
|
||||
|
||||
105
package.json
105
package.json
@@ -15,91 +15,95 @@
|
||||
"url": "https://opencollective.com/verdaccio"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.16.0",
|
||||
"@babel/core": "7.16.0",
|
||||
"@babel/node": "7.16.0",
|
||||
"@babel/plugin-proposal-class-properties": "7.16.0",
|
||||
"@babel/plugin-proposal-decorators": "7.16.4",
|
||||
"@babel/plugin-proposal-export-namespace-from": "7.16.0",
|
||||
"@babel/plugin-proposal-function-sent": "7.16.0",
|
||||
"@babel/plugin-proposal-json-strings": "7.16.0",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.16.0",
|
||||
"@babel/plugin-proposal-numeric-separator": "7.16.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.16.0",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.16.0",
|
||||
"@babel/plugin-proposal-throw-expressions": "7.16.0",
|
||||
"@babel/cli": "7.16.8",
|
||||
"@babel/core": "7.16.12",
|
||||
"@babel/node": "7.16.8",
|
||||
"@babel/plugin-proposal-class-properties": "7.16.7",
|
||||
"@babel/plugin-proposal-decorators": "7.16.7",
|
||||
"@babel/plugin-proposal-export-namespace-from": "7.16.7",
|
||||
"@babel/plugin-proposal-function-sent": "7.16.7",
|
||||
"@babel/plugin-proposal-json-strings": "7.16.7",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.16.7",
|
||||
"@babel/plugin-proposal-numeric-separator": "7.16.7",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.16.7",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.16.7",
|
||||
"@babel/plugin-proposal-throw-expressions": "7.16.7",
|
||||
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
||||
"@babel/plugin-syntax-import-meta": "7.10.4",
|
||||
"@babel/plugin-transform-async-to-generator": "7.16.0",
|
||||
"@babel/plugin-transform-classes": "7.16.0",
|
||||
"@babel/plugin-transform-runtime": "7.16.4",
|
||||
"@babel/preset-env": "7.16.4",
|
||||
"@babel/preset-react": "7.16.0",
|
||||
"@babel/preset-typescript": "7.16.0",
|
||||
"@babel/register": "7.16.0",
|
||||
"@babel/runtime": "7.16.3",
|
||||
"@changesets/changelog-github": "0.2.8",
|
||||
"@babel/plugin-transform-async-to-generator": "7.16.8",
|
||||
"@babel/plugin-transform-classes": "7.16.7",
|
||||
"@babel/plugin-transform-runtime": "7.16.10",
|
||||
"@babel/preset-env": "7.16.11",
|
||||
"@babel/preset-react": "7.16.7",
|
||||
"@babel/preset-typescript": "7.16.7",
|
||||
"@babel/register": "7.16.9",
|
||||
"@babel/runtime": "7.16.7",
|
||||
"@dianmora/contributors": "2.0.2",
|
||||
"@changesets/changelog-github": "0.4.2",
|
||||
"@changesets/cli": "2.15.0",
|
||||
"@changesets/get-dependents-graph": "1.2.4",
|
||||
"@crowdin/cli": "3.7.2",
|
||||
"@trivago/prettier-plugin-sort-imports": "3.1.1",
|
||||
"@types/async": "3.2.7",
|
||||
"@crowdin/cli": "3.7.7",
|
||||
"@trivago/prettier-plugin-sort-imports": "3.2.0",
|
||||
"@types/async": "3.2.12",
|
||||
"@types/autocannon": "4.1.1",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/http-errors": "1.8.1",
|
||||
"@types/jest": "27.0.3",
|
||||
"@types/http-errors": "1.8.2",
|
||||
"@types/jest": "27.4.0",
|
||||
"@types/lodash": "4.14.178",
|
||||
"@types/mime": "2.0.3",
|
||||
"@types/minimatch": "3.0.5",
|
||||
"@types/node": "14.6.0",
|
||||
"@types/request": "2.48.7",
|
||||
"@types/node": "16.11.21",
|
||||
"@types/jsonwebtoken": "8.5.1",
|
||||
"@types/request": "2.48.8",
|
||||
"@types/semver": "7.3.9",
|
||||
"@types/supertest": "2.0.11",
|
||||
"@types/supertest": "2.0.12",
|
||||
"@types/testing-library__jest-dom": "5.14.2",
|
||||
"@types/validator": "13.7.0",
|
||||
"@types/validator": "13.7.1",
|
||||
"@types/webpack": "5.28.0",
|
||||
"@types/webpack-env": "1.16.3",
|
||||
"@typescript-eslint/eslint-plugin": "4.33.0",
|
||||
"@typescript-eslint/parser": "4.33.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.16.0",
|
||||
"@typescript-eslint/parser": "5.16.0",
|
||||
"@verdaccio/benchmark": "workspace:*",
|
||||
"@verdaccio/eslint-config": "workspace:*",
|
||||
"@verdaccio/types": "workspace:*",
|
||||
"@verdaccio/ui-theme": "workspace:*",
|
||||
"autocannon": "7.5.0",
|
||||
"autocannon": "7.6.0",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"babel-eslint": "10.1.0",
|
||||
"babel-jest": "27.3.1",
|
||||
"babel-jest": "27.4.6",
|
||||
"babel-plugin-dynamic-import-node": "2.3.3",
|
||||
"babel-plugin-emotion": "10.2.2",
|
||||
"codecov": "3.8.3",
|
||||
"concurrently": "6.4.0",
|
||||
"core-js": "3.17.2",
|
||||
"concurrently": "6.5.1",
|
||||
"core-js": "3.20.3",
|
||||
"cross-env": "7.0.3",
|
||||
"debug": "4.3.3",
|
||||
"detect-secrets": "1.0.6",
|
||||
"eslint": "7.32.0",
|
||||
"pretty-format": "27.5.1",
|
||||
"jest-diff": "27.5.1",
|
||||
"eslint": "8.11.0",
|
||||
"fs-extra": "10.0.0",
|
||||
"husky": "7.0.4",
|
||||
"in-publish": "2.0.1",
|
||||
"jest": "27.3.1",
|
||||
"jest-environment-jsdom": "27.3.1",
|
||||
"jest": "27.4.7",
|
||||
"jest-environment-jsdom": "27.4.6",
|
||||
"jest-environment-jsdom-global": "3.0.0",
|
||||
"jest-environment-node": "27.3.1",
|
||||
"jest-environment-node": "27.4.6",
|
||||
"jest-junit": "12.3.0",
|
||||
"kleur": "3.0.3",
|
||||
"lint-staged": "11.1.2",
|
||||
"lint-staged": "11.2.6",
|
||||
"nock": "12.0.3",
|
||||
"node-fetch": "3.0.0-beta.6-exportfix",
|
||||
"node-fetch": "cjs",
|
||||
"nodemon": "2.0.15",
|
||||
"npm-run-all": "4.1.5",
|
||||
"prettier": "2.3.2",
|
||||
"prettier": "2.6.0",
|
||||
"rimraf": "3.0.2",
|
||||
"selfsigned": "1.10.11",
|
||||
"supertest": "6.1.6",
|
||||
"ts-node": "10.2.1",
|
||||
"typescript": "4.4.4",
|
||||
"selfsigned": "1.10.14",
|
||||
"supertest": "6.2.2",
|
||||
"ts-node": "10.4.0",
|
||||
"typescript": "4.5.5",
|
||||
"update-ts-references": "2.4.1",
|
||||
"verdaccio": "5.3.1",
|
||||
"verdaccio": "5.5.0",
|
||||
"verdaccio-audit": "workspace:*",
|
||||
"verdaccio-auth-memory": "workspace:*",
|
||||
"verdaccio-htpasswd": "workspace:*",
|
||||
@@ -112,7 +116,7 @@
|
||||
"docker": "docker build -t verdaccio/verdaccio:local . --no-cache",
|
||||
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md}\"",
|
||||
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md}\"",
|
||||
"lint": "eslint --max-warnings 47 \"**/*.{js,jsx,ts,tsx}\"",
|
||||
"lint": "eslint --max-warnings 46 \"**/*.{js,jsx,ts,tsx}\"",
|
||||
"test": "pnpm recursive test --filter ./packages",
|
||||
"test:e2e:cli": "pnpm test --filter ...@verdaccio/e2e-cli",
|
||||
"test:e2e:ui": "pnpm test --filter ...@verdaccio/e2e-ui",
|
||||
@@ -120,6 +124,7 @@
|
||||
"benchmark:hyper": "verdaccio-benchmark hyper -r ./hyper-results.json",
|
||||
"benchmark:api": "verdaccio-benchmark api",
|
||||
"benchmark:submit": "pnpm ts-node ./scripts/submit-metrics.ts",
|
||||
"contributors": "ts-node ./scripts/contributors-update.ts",
|
||||
"start:watch": "concurrently --kill-others \"pnpm _build:watch\" \"pnpm _start:server\" \"pnpm _debug:reload\"",
|
||||
"_build:watch": "pnpm run --parallel watch --filter ./packages",
|
||||
"_start:server": "node --inspect packages/verdaccio/debug/bootstrap.js --listen 8000",
|
||||
|
||||
@@ -1,5 +1,108 @@
|
||||
# @verdaccio/api
|
||||
|
||||
## 6.0.0-6-next.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d43894e8]
|
||||
- Updated dependencies [d08fe29d]
|
||||
- @verdaccio/config@6.0.0-6-next.14
|
||||
- @verdaccio/auth@6.0.0-6-next.22
|
||||
- @verdaccio/hooks@6.0.0-6-next.13
|
||||
- @verdaccio/store@6.0.0-6-next.22
|
||||
- @verdaccio/core@6.0.0-6-next.5
|
||||
- @verdaccio/logger@6.0.0-6-next.11
|
||||
- @verdaccio/middleware@6.0.0-6-next.22
|
||||
|
||||
## 6.0.0-6-next.24
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 82cb0f2b: feat!: config.logs throw an error, logging config not longer accept array or logs property
|
||||
|
||||
### 💥 Breaking change
|
||||
|
||||
This is valid
|
||||
|
||||
```yaml
|
||||
log: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
This is invalid
|
||||
|
||||
```yaml
|
||||
logs: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```yaml
|
||||
logs:
|
||||
- [{ type: stdout, format: pretty, level: http }]
|
||||
```
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 5167bb52: feat: ui search support for remote, local and private packages
|
||||
|
||||
The command `npm search` search globally and return all matches, with this improvement the user interface
|
||||
is powered with the same capabilities.
|
||||
|
||||
The UI also tag where is the origin the package with a tag, also provide the latest version and description of the package.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [82cb0f2b]
|
||||
- Updated dependencies [5167bb52]
|
||||
- @verdaccio/config@6.0.0-6-next.13
|
||||
- @verdaccio/core@6.0.0-6-next.5
|
||||
- @verdaccio/logger@6.0.0-6-next.11
|
||||
- @verdaccio/store@6.0.0-6-next.21
|
||||
- @verdaccio/auth@6.0.0-6-next.21
|
||||
- @verdaccio/hooks@6.0.0-6-next.13
|
||||
- @verdaccio/middleware@6.0.0-6-next.21
|
||||
- @verdaccio/utils@6.0.0-6-next.11
|
||||
|
||||
## 6.0.0-6-next.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/auth@6.0.0-6-next.20
|
||||
- @verdaccio/store@6.0.0-6-next.20
|
||||
- @verdaccio/hooks@6.0.0-6-next.12
|
||||
- @verdaccio/middleware@6.0.0-6-next.20
|
||||
|
||||
## 6.0.0-6-next.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [aeff267d]
|
||||
- @verdaccio/auth@6.0.0-6-next.19
|
||||
- @verdaccio/hooks@6.0.0-6-next.12
|
||||
- @verdaccio/middleware@6.0.0-6-next.19
|
||||
|
||||
## 6.0.0-6-next.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b78f3525]
|
||||
- @verdaccio/logger@6.0.0-6-next.10
|
||||
- @verdaccio/auth@6.0.0-6-next.18
|
||||
- @verdaccio/hooks@6.0.0-6-next.12
|
||||
- @verdaccio/middleware@6.0.0-6-next.18
|
||||
- @verdaccio/store@6.0.0-6-next.19
|
||||
|
||||
## 6.0.0-6-next.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [730b5d8c]
|
||||
- @verdaccio/logger@6.0.0-6-next.9
|
||||
- @verdaccio/auth@6.0.0-6-next.17
|
||||
- @verdaccio/hooks@6.0.0-6-next.11
|
||||
- @verdaccio/middleware@6.0.0-6-next.17
|
||||
- @verdaccio/store@6.0.0-6-next.18
|
||||
|
||||
## 6.0.0-6-next.19
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/api",
|
||||
"version": "6.0.0-6-next.19",
|
||||
"version": "6.0.0-6-next.25",
|
||||
"description": "loaders logic",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -39,29 +39,29 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.16",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/hooks": "workspace:6.0.0-6-next.10",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.8",
|
||||
"@verdaccio/middleware": "workspace:6.0.0-6-next.16",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.17",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.10",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.22",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.14",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/hooks": "workspace:6.0.0-6-next.13",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.11",
|
||||
"@verdaccio/middleware": "workspace:6.0.0-6-next.22",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.22",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.11",
|
||||
"abortcontroller-polyfill": "1.7.3",
|
||||
"cookies": "0.8.0",
|
||||
"debug": "4.3.3",
|
||||
"body-parser": "1.19.1",
|
||||
"express": "4.17.1",
|
||||
"express": "4.17.2",
|
||||
"lodash": "4.17.21",
|
||||
"mime": "2.6.0",
|
||||
"semver": "7.3.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "16.11.12",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.24",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.10",
|
||||
"@verdaccio/helper": "1.0.0",
|
||||
"supertest": "6.1.6"
|
||||
"@types/node": "16.11.21",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.30",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.12",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.0",
|
||||
"supertest": "6.2.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -55,13 +55,13 @@ export default function (route: Router, auth: IAuth, storage: Storage): void {
|
||||
try {
|
||||
// TODO: this is just temporary while I migrate all plugins to use the new API
|
||||
// the method will be renamed to getPackage again but Promise Based.
|
||||
if (!storage.getPackageNext) {
|
||||
if (!storage.getPackageByOptions) {
|
||||
throw errorUtils.getInternalError(
|
||||
'getPackageNext not implemented, check pr-2750 for more details'
|
||||
'getPackageByOptions not implemented, check pr-2750 for more details'
|
||||
);
|
||||
}
|
||||
|
||||
const manifest = await storage.getPackageNext({
|
||||
const manifest = await storage.getPackageByOptions({
|
||||
name,
|
||||
uplinksLook: true,
|
||||
req,
|
||||
|
||||
@@ -8,6 +8,7 @@ import { Package } from '@verdaccio/types';
|
||||
*/
|
||||
|
||||
export function isPublishablePackage(pkg: Package): boolean {
|
||||
// TODO: we can do better, no need get keys
|
||||
const keys: string[] = Object.keys(pkg);
|
||||
|
||||
return _.includes(keys, 'versions');
|
||||
|
||||
@@ -6,9 +6,9 @@ import supertest from 'supertest';
|
||||
import { Auth, IAuth } from '@verdaccio/auth';
|
||||
import { Config, parseConfigFile } from '@verdaccio/config';
|
||||
import { HEADERS, HEADER_TYPE, HTTP_STATUS } from '@verdaccio/core';
|
||||
import { generatePackageMetadata } from '@verdaccio/helper';
|
||||
import { errorReportingMiddleware, final, handleError } from '@verdaccio/middleware';
|
||||
import { Storage } from '@verdaccio/store';
|
||||
import { generatePackageMetadata } from '@verdaccio/test-helper';
|
||||
|
||||
import apiEndpoints from '../../src';
|
||||
|
||||
@@ -18,6 +18,7 @@ const getConf = (conf) => {
|
||||
return parseConfigFile(configPath);
|
||||
};
|
||||
|
||||
// TODO: replace by @verdaccio/test-helper
|
||||
export async function initializeServer(configName): Promise<Application> {
|
||||
const app = express();
|
||||
const config = new Config(getConf(configName));
|
||||
|
||||
@@ -18,7 +18,7 @@ publish:
|
||||
|
||||
uplinks:
|
||||
|
||||
logs: { type: stdout, format: pretty, level: trace }
|
||||
log: { type: stdout, format: pretty, level: trace }
|
||||
|
||||
packages:
|
||||
'@*/*':
|
||||
|
||||
@@ -11,7 +11,7 @@ web:
|
||||
|
||||
uplinks:
|
||||
|
||||
logs: { type: stdout, format: pretty, level: trace }
|
||||
log: { type: stdout, format: pretty, level: trace }
|
||||
|
||||
packages:
|
||||
'@*/*':
|
||||
|
||||
@@ -18,7 +18,7 @@ publish:
|
||||
|
||||
uplinks:
|
||||
|
||||
logs: { type: stdout, format: pretty, level: trace }
|
||||
log: { type: stdout, format: pretty, level: trace }
|
||||
|
||||
packages:
|
||||
'@*/*':
|
||||
|
||||
@@ -17,7 +17,7 @@ uplinks:
|
||||
npmjs:
|
||||
url: https://registry.npmjs.org/
|
||||
|
||||
logs: { type: stdout, format: pretty, level: trace }
|
||||
log: { type: stdout, format: pretty, level: trace }
|
||||
|
||||
packages:
|
||||
'@*/*':
|
||||
|
||||
@@ -17,7 +17,7 @@ uplinks:
|
||||
npmjs:
|
||||
url: https://registry.npmjs.org/
|
||||
|
||||
logs: { type: stdout, format: pretty, level: trace }
|
||||
log: { type: stdout, format: pretty, level: trace }
|
||||
|
||||
packages:
|
||||
'@*/*':
|
||||
|
||||
@@ -2,7 +2,7 @@ import supertest from 'supertest';
|
||||
|
||||
import { HTTP_STATUS } from '@verdaccio/core';
|
||||
import { API_ERROR, API_MESSAGE, HEADERS, HEADER_TYPE } from '@verdaccio/core';
|
||||
import { generatePackageMetadata } from '@verdaccio/helper';
|
||||
import { generatePackageMetadata } from '@verdaccio/test-helper';
|
||||
|
||||
import { $RequestExtend, $ResponseExtend } from '../../types/custom';
|
||||
import { initializeServer, publishVersion } from './_helper';
|
||||
|
||||
@@ -1,5 +1,61 @@
|
||||
# @verdaccio/auth
|
||||
|
||||
## 6.0.0-6-next.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d43894e8]
|
||||
- Updated dependencies [d08fe29d]
|
||||
- @verdaccio/config@6.0.0-6-next.14
|
||||
- @verdaccio/loaders@6.0.0-6-next.12
|
||||
- @verdaccio/core@6.0.0-6-next.5
|
||||
- @verdaccio/logger@6.0.0-6-next.11
|
||||
- verdaccio-htpasswd@11.0.0-6-next.13
|
||||
|
||||
## 6.0.0-6-next.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [82cb0f2b]
|
||||
- Updated dependencies [5167bb52]
|
||||
- @verdaccio/config@6.0.0-6-next.13
|
||||
- @verdaccio/core@6.0.0-6-next.5
|
||||
- @verdaccio/logger@6.0.0-6-next.11
|
||||
- verdaccio-htpasswd@11.0.0-6-next.13
|
||||
- @verdaccio/loaders@6.0.0-6-next.12
|
||||
- @verdaccio/utils@6.0.0-6-next.11
|
||||
|
||||
## 6.0.0-6-next.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [31d661c7]
|
||||
- @verdaccio/loaders@6.0.0-6-next.11
|
||||
|
||||
## 6.0.0-6-next.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- aeff267d: Refactor htpasswd plugin to use the bcryptjs 'compare' api call instead of 'comparSync'. Add a new configuration value named 'slow_verify_ms' to the htpasswd plugin that when exceeded during password verification will log a warning message.
|
||||
- Updated dependencies [aeff267d]
|
||||
- verdaccio-htpasswd@11.0.0-6-next.12
|
||||
|
||||
## 6.0.0-6-next.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b78f3525]
|
||||
- @verdaccio/logger@6.0.0-6-next.10
|
||||
- @verdaccio/loaders@6.0.0-6-next.10
|
||||
|
||||
## 6.0.0-6-next.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [730b5d8c]
|
||||
- @verdaccio/logger@6.0.0-6-next.9
|
||||
- @verdaccio/loaders@6.0.0-6-next.9
|
||||
|
||||
## 6.0.0-6-next.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/auth",
|
||||
"version": "6.0.0-6-next.16",
|
||||
"version": "6.0.0-6-next.22",
|
||||
"description": "logger",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -39,20 +39,20 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/loaders": "workspace:6.0.0-6-next.8",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.8",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.10",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.14",
|
||||
"@verdaccio/loaders": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.11",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.11",
|
||||
"debug": "4.3.3",
|
||||
"express": "4.17.1",
|
||||
"express": "4.17.2",
|
||||
"jsonwebtoken": "8.5.1",
|
||||
"lodash": "4.17.21",
|
||||
"verdaccio-htpasswd": "workspace:11.0.0-6-next.11"
|
||||
"verdaccio-htpasswd": "workspace:11.0.0-6-next.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.13",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.10"
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.15",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.12"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -111,7 +111,7 @@ class Auth implements IAuth {
|
||||
};
|
||||
let authPlugin;
|
||||
try {
|
||||
authPlugin = new HTPasswd(plugingConf, pluginOptions);
|
||||
authPlugin = new HTPasswd(plugingConf, pluginOptions as any as PluginOptions<HTPasswdConfig>);
|
||||
} catch (error: any) {
|
||||
debug('error on loading auth htpasswd plugin stack: %o', error);
|
||||
return [];
|
||||
|
||||
@@ -21,12 +21,14 @@ export async function signPayload(
|
||||
return jwt.sign(
|
||||
payload,
|
||||
secretOrPrivateKey,
|
||||
// FIXME: upgrade to the latest library and types
|
||||
// @ts-ignore
|
||||
{
|
||||
// 1 === 1ms (one millisecond)
|
||||
notBefore: '1', // Make sure the time will not rollback :)
|
||||
...options,
|
||||
},
|
||||
(error, token) => {
|
||||
(error, token: string) => {
|
||||
debug('error on sign jwt token');
|
||||
return error ? reject(error) : resolve(token);
|
||||
}
|
||||
@@ -36,5 +38,5 @@ export async function signPayload(
|
||||
|
||||
export function verifyPayload(token: string, secretOrPrivateKey: string): RemoteUser {
|
||||
debug('verify jwt token');
|
||||
return jwt.verify(token, secretOrPrivateKey);
|
||||
return jwt.verify(token, secretOrPrivateKey) as RemoteUser;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
HexBase64BinaryEncoding,
|
||||
Utf8AsciiBinaryEncoding,
|
||||
BinaryToTextEncoding,
|
||||
CharacterEncoding,
|
||||
createCipheriv,
|
||||
createDecipheriv,
|
||||
randomBytes,
|
||||
@@ -12,8 +12,8 @@ import { TOKEN_VALID_LENGTH } from '@verdaccio/config';
|
||||
const debug = buildDebug('verdaccio:auth:token:legacy');
|
||||
|
||||
export const defaultAlgorithm = process.env.VERDACCIO_LEGACY_ALGORITHM || 'aes-256-ctr';
|
||||
const inputEncoding: Utf8AsciiBinaryEncoding = 'utf8';
|
||||
const outputEncoding: HexBase64BinaryEncoding = 'hex';
|
||||
const inputEncoding: CharacterEncoding = 'utf8';
|
||||
const outputEncoding: BinaryToTextEncoding = 'hex';
|
||||
// For AES, this is always 16
|
||||
const IV_LENGTH = 16;
|
||||
// Must be 256 bits (32 characters)
|
||||
@@ -56,7 +56,8 @@ export function aesDecrypt(value: string, key: string): string | void {
|
||||
const secretKey = VERDACCIO_LEGACY_ENCRYPTION_KEY || key;
|
||||
// decipher the string
|
||||
const decipher = createDecipheriv(defaultAlgorithm, secretKey, IV);
|
||||
let decrypted = decipher.update(encryptedText, outputEncoding, inputEncoding);
|
||||
// FIXME: fix type here should allow Buffer
|
||||
let decrypted = decipher.update(encryptedText as any, outputEncoding, inputEncoding);
|
||||
decrypted += decipher.final(inputEncoding);
|
||||
debug('token decrypted successfully');
|
||||
return decrypted.toString();
|
||||
|
||||
@@ -1,5 +1,92 @@
|
||||
# @verdaccio/cli
|
||||
|
||||
## 6.0.0-6-next.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [d43894e8]
|
||||
- Updated dependencies [d08fe29d]
|
||||
- @verdaccio/config@6.0.0-6-next.14
|
||||
- @verdaccio/fastify-migration@6.0.0-6-next.23
|
||||
- @verdaccio/node-api@6.0.0-6-next.31
|
||||
- @verdaccio/core@6.0.0-6-next.5
|
||||
- @verdaccio/logger@6.0.0-6-next.11
|
||||
|
||||
## 6.0.0-6-next.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- d78c8b51: chore: improve error logger message
|
||||
|
||||
## 6.0.0-6-next.31
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 82cb0f2b: feat!: config.logs throw an error, logging config not longer accept array or logs property
|
||||
|
||||
### 💥 Breaking change
|
||||
|
||||
This is valid
|
||||
|
||||
```yaml
|
||||
log: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
This is invalid
|
||||
|
||||
```yaml
|
||||
logs: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```yaml
|
||||
logs:
|
||||
- [{ type: stdout, format: pretty, level: http }]
|
||||
```
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [82cb0f2b]
|
||||
- Updated dependencies [5167bb52]
|
||||
- @verdaccio/config@6.0.0-6-next.13
|
||||
- @verdaccio/core@6.0.0-6-next.5
|
||||
- @verdaccio/logger@6.0.0-6-next.11
|
||||
- @verdaccio/node-api@6.0.0-6-next.30
|
||||
- @verdaccio/fastify-migration@6.0.0-6-next.22
|
||||
|
||||
## 6.0.0-6-next.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/fastify-migration@6.0.0-6-next.21
|
||||
- @verdaccio/node-api@6.0.0-6-next.29
|
||||
|
||||
## 6.0.0-6-next.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/fastify-migration@6.0.0-6-next.20
|
||||
- @verdaccio/node-api@6.0.0-6-next.28
|
||||
|
||||
## 6.0.0-6-next.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b78f3525]
|
||||
- @verdaccio/logger@6.0.0-6-next.10
|
||||
- @verdaccio/fastify-migration@6.0.0-6-next.19
|
||||
- @verdaccio/node-api@6.0.0-6-next.27
|
||||
|
||||
## 6.0.0-6-next.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [730b5d8c]
|
||||
- @verdaccio/logger@6.0.0-6-next.9
|
||||
- @verdaccio/node-api@6.0.0-6-next.26
|
||||
- @verdaccio/fastify-migration@6.0.0-6-next.18
|
||||
|
||||
## 6.0.0-6-next.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/cli",
|
||||
"version": "6.0.0-6-next.26",
|
||||
"version": "6.0.0-6-next.33",
|
||||
"author": {
|
||||
"name": "Juan Picado",
|
||||
"email": "juanpicado19@gmail.com"
|
||||
@@ -44,18 +44,18 @@
|
||||
"start": "ts-node src/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.12",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.8",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.25",
|
||||
"@verdaccio/fastify-migration": "workspace:6.0.0-6-next.17",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.14",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.11",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.31",
|
||||
"@verdaccio/fastify-migration": "workspace:6.0.0-6-next.23",
|
||||
"clipanion": "3.1.0",
|
||||
"envinfo": "7.8.1",
|
||||
"kleur": "3.0.3",
|
||||
"semver": "7.3.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ts-node": "10.2.1"
|
||||
"ts-node": "10.4.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Command, Option } from 'clipanion';
|
||||
|
||||
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
||||
import { warningUtils } from '@verdaccio/core';
|
||||
import server from '@verdaccio/fastify-migration';
|
||||
import { logger, setup } from '@verdaccio/logger';
|
||||
import { ConfigRuntime } from '@verdaccio/types';
|
||||
@@ -28,13 +27,13 @@ export class FastifyServer extends Command {
|
||||
|
||||
private initLogger(logConfig: ConfigRuntime) {
|
||||
try {
|
||||
if (logConfig.logs) {
|
||||
warningUtils.emit(warningUtils.Codes.VERDEP001);
|
||||
if (logConfig.log) {
|
||||
throw Error('logger as array not longer supported');
|
||||
}
|
||||
// FUTURE: remove fallback when is ready
|
||||
setup(logConfig.log || logConfig.logs);
|
||||
} catch {
|
||||
throw new Error('error on init logger');
|
||||
setup(logConfig.log);
|
||||
} catch (err: any) {
|
||||
throw new Error(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Command, Option } from 'clipanion';
|
||||
|
||||
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
||||
import { warningUtils } from '@verdaccio/core';
|
||||
import { logger, setup } from '@verdaccio/logger';
|
||||
import { LoggerConfigItem } from '@verdaccio/logger/src/logger';
|
||||
import { initServer } from '@verdaccio/node-api';
|
||||
import { ConfigRuntime } from '@verdaccio/types';
|
||||
|
||||
@@ -47,13 +47,15 @@ export class InitCommand extends Command {
|
||||
|
||||
private initLogger(logConfig: ConfigRuntime) {
|
||||
try {
|
||||
// @ts-expect-error
|
||||
if (logConfig.logs) {
|
||||
warningUtils.emit(warningUtils.Codes.VERDEP001);
|
||||
throw Error(
|
||||
'the property config "logs" property is longer supported, rename to "log" and use object instead'
|
||||
);
|
||||
}
|
||||
// FUTURE: remove fallback when is ready
|
||||
setup(logConfig.log || logConfig.logs);
|
||||
} catch {
|
||||
throw new Error('error on init logger');
|
||||
setup(logConfig.log as LoggerConfigItem);
|
||||
} catch (err: any) {
|
||||
throw new Error(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@ import semver from 'semver';
|
||||
export const MIN_NODE_VERSION = '14.0.0';
|
||||
|
||||
export function isVersionValid(processVersion) {
|
||||
const version = processVersion.substr(1);
|
||||
const version = processVersion.slice(1);
|
||||
return semver.satisfies(version, `>=${MIN_NODE_VERSION}`);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,96 @@
|
||||
# @verdaccio/config
|
||||
|
||||
## 6.0.0-6-next.14
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- d43894e8: feat: rework web header for mobile, add new settings and raw manifest button
|
||||
|
||||
### New set of variables to hide features
|
||||
|
||||
Add set of new variables that allow hide different parts of the UI, buttons, footer or download tarballs. _All are
|
||||
enabled by default_.
|
||||
|
||||
```yaml
|
||||
# login: true <-- already exist but worth the reminder
|
||||
# showInfo: true
|
||||
# showSettings: true
|
||||
# In combination with darkMode you can force specific theme
|
||||
# showThemeSwitch: true
|
||||
# showFooter: true
|
||||
# showSearch: true
|
||||
# showDownloadTarball: true
|
||||
```
|
||||
|
||||
> If you disable `showThemeSwitch` and force `darkMode: true` the local storage settings would be
|
||||
> ignored and force all themes to the one in the configuration file.
|
||||
|
||||
Future could be extended to
|
||||
|
||||
### Raw button to display manifest package
|
||||
|
||||
A new experimental feature (enabled by default), button named RAW to be able navigate on the package manifest directly on the ui, kudos to [react-json-view](https://www.npmjs.com/package/react-json-view) that allows an easy integration, not configurable yet until get more feedback.
|
||||
|
||||
```yaml
|
||||
showRaw: true
|
||||
```
|
||||
|
||||
#### Rework header buttons
|
||||
|
||||
- The header has been rework, the mobile was not looking broken.
|
||||
- Removed info button in the header and moved to a dialog
|
||||
- Info dialog now contains more information about the project, license and the aid content for Ukrania now is inside of the info modal.
|
||||
- Separate settings and info to avoid collapse too much info (for mobile still need some work)
|
||||
|
||||
- d08fe29d: feat(web): add a config item to web,let the developer can select whet……her enable the html cache
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/core@6.0.0-6-next.5
|
||||
|
||||
## 6.0.0-6-next.13
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 82cb0f2b: feat!: config.logs throw an error, logging config not longer accept array or logs property
|
||||
|
||||
### 💥 Breaking change
|
||||
|
||||
This is valid
|
||||
|
||||
```yaml
|
||||
log: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
This is invalid
|
||||
|
||||
```yaml
|
||||
logs: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```yaml
|
||||
logs:
|
||||
- [{ type: stdout, format: pretty, level: http }]
|
||||
```
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 5167bb52: feat: ui search support for remote, local and private packages
|
||||
|
||||
The command `npm search` search globally and return all matches, with this improvement the user interface
|
||||
is powered with the same capabilities.
|
||||
|
||||
The UI also tag where is the origin the package with a tag, also provide the latest version and description of the package.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [82cb0f2b]
|
||||
- Updated dependencies [5167bb52]
|
||||
- @verdaccio/core@6.0.0-6-next.5
|
||||
- @verdaccio/utils@6.0.0-6-next.11
|
||||
|
||||
## 6.0.0-6-next.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/config",
|
||||
"version": "6.0.0-6-next.12",
|
||||
"version": "6.0.0-6-next.14",
|
||||
"description": "logger",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -39,8 +39,8 @@
|
||||
"build": "pnpm run build:js && pnpm run build:types"
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.10",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.11",
|
||||
"debug": "4.3.3",
|
||||
"js-yaml": "3.14.1",
|
||||
"lodash": "4.17.21",
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
# so don't use it on production systems.
|
||||
#
|
||||
# Look here for more config file examples:
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
||||
#
|
||||
|
||||
# path to a directory with all packages
|
||||
storage: ./storage
|
||||
# path to a directory with plugins to include
|
||||
plugins: ./plugins
|
||||
# print logs
|
||||
# logs: ./logs
|
||||
|
||||
web:
|
||||
title: Verdaccio
|
||||
@@ -21,6 +19,17 @@ web:
|
||||
# sort_packages: asc
|
||||
# convert your UI to the dark side
|
||||
# darkMode: true
|
||||
# html_cache: true
|
||||
# by default all features are displayed
|
||||
# login: true
|
||||
# showInfo: true
|
||||
# showSettings: true
|
||||
# In combination with darkMode you can force specific theme
|
||||
# showThemeSwitch: true
|
||||
# showFooter: true
|
||||
# showSearch: true
|
||||
# showRaw: true
|
||||
# showDownloadTarball: true
|
||||
# HTML tags injected after manifest <scripts/>
|
||||
# scriptsBodyAfter:
|
||||
# - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'
|
||||
@@ -67,7 +76,7 @@ packages:
|
||||
# and three keywords: "$all", "$anonymous", "$authenticated"
|
||||
access: $all
|
||||
|
||||
# allow all known users to publish/publish packages
|
||||
# allow all known users to publish/unpublish packages
|
||||
# (anyone can register by default, remember?)
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
@@ -87,7 +96,7 @@ middlewares:
|
||||
enabled: true
|
||||
|
||||
# log settings
|
||||
logs:
|
||||
log:
|
||||
# Logger as STDOUT
|
||||
{ type: stdout, format: pretty, level: http }
|
||||
# Logger as STDOUT as JSON
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# see https://verdaccio.org/docs/en/docker#docker-and-custom-port-configuration
|
||||
#
|
||||
# Look here for more config file examples:
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
||||
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
||||
#
|
||||
|
||||
# path to a directory with all packages
|
||||
@@ -23,7 +23,32 @@ web:
|
||||
# gravatar: false
|
||||
# by default packages are ordercer ascendant (asc|desc)
|
||||
# sort_packages: asc
|
||||
# convert your UI to the dark side
|
||||
# darkMode: true
|
||||
# html_cache: true
|
||||
# by default all features are displayed
|
||||
# login: true
|
||||
# showInfo: true
|
||||
# showSettings: true
|
||||
# In combination with darkMode you can force specific theme
|
||||
# showThemeSwitch: true
|
||||
# showFooter: true
|
||||
# showSearch: true
|
||||
# showRaw: true
|
||||
# showDownloadTarball: true
|
||||
# HTML tags injected after manifest <scripts/>
|
||||
# scriptsBodyAfter:
|
||||
# - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'
|
||||
# HTML tags injected before ends </head>
|
||||
# metaScripts:
|
||||
# - '<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>'
|
||||
# - '<script type="text/javascript" src="https://browser.sentry-cdn.com/5.15.5/bundle.min.js"></script>'
|
||||
# - '<meta name="robots" content="noindex" />'
|
||||
# HTML tags injected first child at <body/>
|
||||
# bodyBefore:
|
||||
# - '<div id="myId">html before webpack scripts</div>'
|
||||
# Public path for template manifest scripts (only manifest)
|
||||
# publicPath: http://somedomain.org/
|
||||
|
||||
# translate your registry, api i18n not available yet
|
||||
# i18n:
|
||||
@@ -58,7 +83,7 @@ packages:
|
||||
# and three keywords: "$all", "$anonymous", "$authenticated"
|
||||
access: $all
|
||||
|
||||
# allow all known users to publish/publish packages
|
||||
# allow all known users to publish/unpublish packages
|
||||
# (anyone can register by default, remember?)
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
@@ -72,7 +97,7 @@ middlewares:
|
||||
|
||||
# log settings
|
||||
# log settings
|
||||
logs:
|
||||
log:
|
||||
# Logger as STDOUT
|
||||
{ type: stdout, format: pretty, level: http }
|
||||
# Logger as STDOUT as JSON
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
Config as AppConfig,
|
||||
AuthConf,
|
||||
ConfigRuntime,
|
||||
FlagsConfig,
|
||||
PackageAccess,
|
||||
PackageList,
|
||||
Security,
|
||||
@@ -44,6 +45,7 @@ class Config implements AppConfig {
|
||||
public serverSettings: ServerSettingsConf;
|
||||
// @ts-ignore
|
||||
public secret: string;
|
||||
public flags: FlagsConfig;
|
||||
|
||||
public constructor(config: ConfigRuntime) {
|
||||
const self = this;
|
||||
@@ -52,6 +54,9 @@ class Config implements AppConfig {
|
||||
this.plugins = config.plugins;
|
||||
this.security = _.merge(defaultSecurity, config.security);
|
||||
this.serverSettings = serverSettings;
|
||||
this.flags = {
|
||||
searchRemote: config.flags?.searchRemote ?? true,
|
||||
};
|
||||
|
||||
for (const configProp in config) {
|
||||
if (self[configProp] == null) {
|
||||
|
||||
@@ -57,11 +57,11 @@ describe('check basic content parsed file', () => {
|
||||
expect(config.middlewares).toBeDefined();
|
||||
expect(config.middlewares.audit).toBeDefined();
|
||||
expect(config.middlewares.audit.enabled).toBeTruthy();
|
||||
// logs
|
||||
expect(config.logs).toBeDefined();
|
||||
expect(config.logs.type).toEqual('stdout');
|
||||
expect(config.logs.format).toEqual('pretty');
|
||||
expect(config.logs.level).toEqual('http');
|
||||
// log
|
||||
expect(config.log).toBeDefined();
|
||||
expect(config.log.type).toEqual('stdout');
|
||||
expect(config.log.format).toEqual('pretty');
|
||||
expect(config.log.level).toEqual('http');
|
||||
// must not be enabled by default
|
||||
expect(config.notify).toBeUndefined();
|
||||
expect(config.store).toBeUndefined();
|
||||
|
||||
@@ -11,5 +11,5 @@ module.exports = {
|
||||
vue: { access: '$authenticated', publish: '$authenticated', proxy: 'npmjs' },
|
||||
'*': { access: '$all', publish: '$all', proxy: 'npmjs' },
|
||||
},
|
||||
logs: [{ type: 'stdout', format: 'pretty', level: 'warn' }],
|
||||
log: { type: 'stdout', format: 'pretty', level: 'warn' },
|
||||
};
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
---
|
||||
storage: './storage_default_storage'
|
||||
|
||||
logs:
|
||||
- type: stdout
|
||||
format: pretty
|
||||
level: warn
|
||||
log: { type: stdout, format: pretty, level: warn }
|
||||
|
||||
@@ -1,5 +1,41 @@
|
||||
# @verdaccio/core
|
||||
|
||||
## 6.0.0-6-next.5
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 82cb0f2b: feat!: config.logs throw an error, logging config not longer accept array or logs property
|
||||
|
||||
### 💥 Breaking change
|
||||
|
||||
This is valid
|
||||
|
||||
```yaml
|
||||
log: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
This is invalid
|
||||
|
||||
```yaml
|
||||
logs: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```yaml
|
||||
logs:
|
||||
- [{ type: stdout, format: pretty, level: http }]
|
||||
```
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 5167bb52: feat: ui search support for remote, local and private packages
|
||||
|
||||
The command `npm search` search globally and return all matches, with this improvement the user interface
|
||||
is powered with the same capabilities.
|
||||
|
||||
The UI also tag where is the origin the package with a tag, also provide the latest version and description of the package.
|
||||
|
||||
## 6.0.0-6-next.4
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/core",
|
||||
"version": "6.0.0-6-next.4",
|
||||
"version": "6.0.0-6-next.5",
|
||||
"description": "core utilities",
|
||||
"keywords": [
|
||||
"private",
|
||||
@@ -35,13 +35,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"http-errors": "1.8.1",
|
||||
"http-status-codes": "2.1.4",
|
||||
"http-status-codes": "2.2.0",
|
||||
"semver": "7.3.5",
|
||||
"fastify-warning": "0.2.0",
|
||||
"core-js": "3.17.2"
|
||||
"process-warning": "1.0.0",
|
||||
"core-js": "3.20.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.10"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.12"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -16,10 +16,19 @@ export type SearchItemPkg = {
|
||||
time?: number | Date;
|
||||
};
|
||||
|
||||
export type SearchItem = {
|
||||
type PrivatePackage = {
|
||||
// note: prefixed to avoid external conflicts
|
||||
|
||||
// the package is published as private
|
||||
verdaccioPrivate?: boolean;
|
||||
// if the package is not private but is cached
|
||||
verdaccioPkgCached?: boolean;
|
||||
};
|
||||
|
||||
export interface SearchItem extends UnStable, PrivatePackage {
|
||||
package: SearchItemPkg;
|
||||
score: Score;
|
||||
} & UnStable;
|
||||
}
|
||||
|
||||
export type Score = {
|
||||
final: number;
|
||||
@@ -32,11 +41,13 @@ export type SearchResults = {
|
||||
time: string;
|
||||
};
|
||||
|
||||
// @deprecated use @verdaccio/types
|
||||
type PublisherMaintainer = {
|
||||
username: string;
|
||||
email: string;
|
||||
};
|
||||
|
||||
// @deprecated use @verdaccio/types
|
||||
export type SearchPackageBody = {
|
||||
name: string;
|
||||
scope: string;
|
||||
@@ -55,11 +66,11 @@ export type SearchPackageBody = {
|
||||
maintainers?: PublisherMaintainer[];
|
||||
};
|
||||
|
||||
export type SearchPackageItem = {
|
||||
export interface SearchPackageItem extends UnStable, PrivatePackage {
|
||||
package: SearchPackageBody;
|
||||
score: Score;
|
||||
searchScore?: number;
|
||||
} & UnStable;
|
||||
}
|
||||
|
||||
export const UNSCOPED = 'unscoped';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import warning from 'fastify-warning';
|
||||
import warning from 'process-warning';
|
||||
|
||||
const warningInstance = warning();
|
||||
const verdaccioWarning = 'VerdaccioWarning';
|
||||
@@ -9,8 +9,7 @@ export enum Codes {
|
||||
VERWAR002 = 'VERWAR002',
|
||||
VERWAR003 = 'VERWAR003',
|
||||
VERWAR004 = 'VERWAR004',
|
||||
VERDEP001 = 'VERDEP001',
|
||||
VERDEP002 = 'VERDEP002',
|
||||
// deprecation warnings
|
||||
VERDEP003 = 'VERDEP003',
|
||||
}
|
||||
|
||||
@@ -36,18 +35,6 @@ host:port (e.g. "localhost:4873") or full url '(e.g. "http://localhost:4873/")
|
||||
https://verdaccio.org/docs/en/configuration#listen-port`
|
||||
);
|
||||
|
||||
warningInstance.create(
|
||||
verdaccioDeprecation,
|
||||
Codes.VERDEP001,
|
||||
'config.logs is deprecated, rename configuration to "config.log" in singular'
|
||||
);
|
||||
|
||||
warningInstance.create(
|
||||
verdaccioDeprecation,
|
||||
Codes.VERDEP002,
|
||||
'deprecate: multiple logger configuration is deprecated, please check the migration guide.'
|
||||
);
|
||||
|
||||
warningInstance.create(
|
||||
verdaccioDeprecation,
|
||||
Codes.VERDEP003,
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"lockfile": "1.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.10"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.12"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
export * from './unclock';
|
||||
export * from './readFile';
|
||||
export * from './lockfile';
|
||||
// callback support
|
||||
export * from './legacy/unclock';
|
||||
export * from './legacy/readFile';
|
||||
export * from './legacy/lockfile';
|
||||
// promsie support
|
||||
export { readFileNext } from './readFile';
|
||||
export { lockFileNext } from './lockfile';
|
||||
export { unlockFileNext } from './utils';
|
||||
|
||||
29
packages/core/file-locking/src/legacy/lockfile.ts
Normal file
29
packages/core/file-locking/src/legacy/lockfile.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Callback } from '@verdaccio/types';
|
||||
|
||||
import { lockfile, statDir, statfile } from './utils';
|
||||
|
||||
/**
|
||||
* locks a file by creating a lock file
|
||||
* @param name
|
||||
* @param callback
|
||||
*/
|
||||
const lockFile = function (name: string, callback: Callback): void {
|
||||
Promise.resolve()
|
||||
.then(() => {
|
||||
return statDir(name);
|
||||
})
|
||||
.then(() => {
|
||||
return statfile(name);
|
||||
})
|
||||
.then(() => {
|
||||
return lockfile(name);
|
||||
})
|
||||
.then(() => {
|
||||
callback(null);
|
||||
})
|
||||
.catch((err) => {
|
||||
callback(err);
|
||||
});
|
||||
};
|
||||
|
||||
export { lockFile };
|
||||
87
packages/core/file-locking/src/legacy/readFile.ts
Normal file
87
packages/core/file-locking/src/legacy/readFile.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
/* eslint-disable no-undef */
|
||||
import fs from 'fs';
|
||||
|
||||
import { Callback } from '@verdaccio/types';
|
||||
|
||||
import { lockFile } from './lockfile';
|
||||
|
||||
export type ReadFileOptions = {
|
||||
parse?: boolean;
|
||||
lock?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reads a local file, which involves
|
||||
* optionally taking a lock
|
||||
* reading the file contents
|
||||
* optionally parsing JSON contents
|
||||
* @param {*} name
|
||||
* @param {*} options
|
||||
* @param {*} callback
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
function readFile(
|
||||
name: string,
|
||||
options: ReadFileOptions = {},
|
||||
callback: Callback = (): void => {}
|
||||
): void {
|
||||
if (typeof options === 'function') {
|
||||
callback = options;
|
||||
options = {};
|
||||
}
|
||||
|
||||
options.lock = options.lock || false;
|
||||
options.parse = options.parse || false;
|
||||
|
||||
const lock = function (options: ReadFileOptions): Promise<null | NodeJS.ErrnoException> {
|
||||
return new Promise((resolve, reject): void => {
|
||||
if (!options.lock) {
|
||||
return resolve(null);
|
||||
}
|
||||
|
||||
lockFile(name, function (err: NodeJS.ErrnoException | null) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
return resolve(null);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const read = function (): Promise<NodeJS.ErrnoException | string> {
|
||||
return new Promise((resolve, reject): void => {
|
||||
fs.readFile(name, 'utf8', function (err, contents) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
resolve(contents);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const parseJSON = function (contents: string): Promise<unknown> {
|
||||
return new Promise((resolve, reject): void => {
|
||||
if (!options.parse) {
|
||||
return resolve(contents);
|
||||
}
|
||||
try {
|
||||
contents = JSON.parse(contents);
|
||||
return resolve(contents);
|
||||
} catch (err: any) {
|
||||
return reject(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Promise.resolve()
|
||||
.then(() => lock(options))
|
||||
.then(() => read())
|
||||
.then((content) => parseJSON(content as string))
|
||||
.then(
|
||||
(result) => callback(null, result),
|
||||
(err) => callback(err)
|
||||
);
|
||||
}
|
||||
|
||||
export { readFile };
|
||||
55
packages/core/file-locking/src/legacy/utils.ts
Normal file
55
packages/core/file-locking/src/legacy/utils.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import fs from 'fs';
|
||||
import locker from 'lockfile';
|
||||
import path from 'path';
|
||||
|
||||
export const statDir = (name: string): Promise<Error | null> => {
|
||||
return new Promise((resolve, reject): void => {
|
||||
// test to see if the directory exists
|
||||
const dirPath = path.dirname(name);
|
||||
fs.stat(dirPath, function (err, stats) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
} else if (!stats.isDirectory()) {
|
||||
return resolve(new Error(`${path.dirname(name)} is not a directory`));
|
||||
} else {
|
||||
return resolve(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
export const statfile = (name: string): Promise<Error | null> => {
|
||||
return new Promise((resolve, reject): void => {
|
||||
// test to see if the directory exists
|
||||
fs.stat(name, function (err, stats) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
} else if (!stats.isFile()) {
|
||||
return resolve(new Error(`${path.dirname(name)} is not a file`));
|
||||
} else {
|
||||
return resolve(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
export const lockfile = (name: string): Promise<unknown> => {
|
||||
return new Promise<void>((resolve): void => {
|
||||
const lockOpts = {
|
||||
// time (ms) to wait when checking for stale locks
|
||||
wait: 1000,
|
||||
// how often (ms) to re-check stale locks
|
||||
pollPeriod: 100,
|
||||
// locks are considered stale after 5 minutes
|
||||
stale: 5 * 60 * 1000,
|
||||
// number of times to attempt to create a lock
|
||||
retries: 100,
|
||||
// time (ms) between tries
|
||||
retryWait: 100,
|
||||
};
|
||||
const lockFileName = `${name}.lock`;
|
||||
locker.lock(lockFileName, lockOpts, () => {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -1,29 +1,15 @@
|
||||
import { Callback } from '@verdaccio/types';
|
||||
|
||||
import { lockfile, statDir, statfile } from './utils';
|
||||
import { lockFileWithOptions, statDir, statFile } from './utils';
|
||||
|
||||
/**
|
||||
* locks a file by creating a lock file
|
||||
* @param name
|
||||
* @param callback
|
||||
*/
|
||||
const lockFile = function (name: string, callback: Callback): void {
|
||||
Promise.resolve()
|
||||
.then(() => {
|
||||
return statDir(name);
|
||||
})
|
||||
.then(() => {
|
||||
return statfile(name);
|
||||
})
|
||||
.then(() => {
|
||||
return lockfile(name);
|
||||
})
|
||||
.then(() => {
|
||||
callback(null);
|
||||
})
|
||||
.catch((err) => {
|
||||
callback(err);
|
||||
});
|
||||
};
|
||||
|
||||
export { lockFile };
|
||||
export async function lockFileNext(name: string): Promise<void> {
|
||||
// check if dir exist
|
||||
await statDir(name);
|
||||
// check if file exist
|
||||
await statFile(name);
|
||||
// lock fhe the file
|
||||
await lockFileWithOptions(name);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,37 @@
|
||||
/* eslint-disable no-undef */
|
||||
import fs from 'fs';
|
||||
|
||||
import { Callback } from '@verdaccio/types';
|
||||
|
||||
import { lockFile } from './lockfile';
|
||||
import { lockFileNext } from './lockfile';
|
||||
import { readFile } from './utils';
|
||||
|
||||
export type ReadFileOptions = {
|
||||
parse?: boolean;
|
||||
lock?: boolean;
|
||||
};
|
||||
|
||||
async function lock(name: string, options: ReadFileOptions): Promise<null | void> {
|
||||
if (!options.lock) {
|
||||
return null;
|
||||
}
|
||||
|
||||
await lockFileNext(name);
|
||||
}
|
||||
|
||||
async function read(name: string): Promise<string> {
|
||||
return readFile(name, 'utf8');
|
||||
}
|
||||
|
||||
function parseJSON(contents: string, options): Promise<unknown> {
|
||||
return new Promise((resolve, reject): void => {
|
||||
if (!options.parse) {
|
||||
return resolve(contents);
|
||||
}
|
||||
try {
|
||||
contents = JSON.parse(contents);
|
||||
return resolve(contents);
|
||||
} catch (err: any) {
|
||||
return reject(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a local file, which involves
|
||||
* optionally taking a lock
|
||||
@@ -19,69 +41,13 @@ export type ReadFileOptions = {
|
||||
* @param {*} options
|
||||
* @param {*} callback
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
function readFile(
|
||||
name: string,
|
||||
options: ReadFileOptions = {},
|
||||
callback: Callback = (): void => {}
|
||||
): void {
|
||||
if (typeof options === 'function') {
|
||||
callback = options;
|
||||
options = {};
|
||||
}
|
||||
|
||||
options.lock = options.lock || false;
|
||||
options.parse = options.parse || false;
|
||||
|
||||
const lock = function (options: ReadFileOptions): Promise<null | NodeJS.ErrnoException> {
|
||||
return new Promise((resolve, reject): void => {
|
||||
if (!options.lock) {
|
||||
return resolve(null);
|
||||
}
|
||||
|
||||
lockFile(name, function (err: NodeJS.ErrnoException | null) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
return resolve(null);
|
||||
});
|
||||
});
|
||||
export async function readFileNext<T>(name: string, options: ReadFileOptions = {}): Promise<T> {
|
||||
const _options = {
|
||||
lock: options?.lock || false,
|
||||
parse: options?.parse || false,
|
||||
};
|
||||
|
||||
const read = function (): Promise<NodeJS.ErrnoException | string> {
|
||||
return new Promise((resolve, reject): void => {
|
||||
fs.readFile(name, 'utf8', function (err, contents) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
resolve(contents);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const parseJSON = function (contents: string): Promise<unknown> {
|
||||
return new Promise((resolve, reject): void => {
|
||||
if (!options.parse) {
|
||||
return resolve(contents);
|
||||
}
|
||||
try {
|
||||
contents = JSON.parse(contents);
|
||||
return resolve(contents);
|
||||
} catch (err: any) {
|
||||
return reject(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Promise.resolve()
|
||||
.then(() => lock(options))
|
||||
.then(() => read())
|
||||
.then((content) => parseJSON(content as string))
|
||||
.then(
|
||||
(result) => callback(null, result),
|
||||
(err) => callback(err)
|
||||
);
|
||||
await lock(name, _options);
|
||||
const content = await read(name);
|
||||
const parsed = await parseJSON(content, options);
|
||||
return parsed as T;
|
||||
}
|
||||
|
||||
export { readFile };
|
||||
|
||||
@@ -1,55 +1,64 @@
|
||||
import fs from 'fs';
|
||||
import fs from 'fs/promises';
|
||||
import locker from 'lockfile';
|
||||
import path from 'path';
|
||||
import { promisify } from 'util';
|
||||
|
||||
export const statDir = (name: string): Promise<Error | null> => {
|
||||
return new Promise((resolve, reject): void => {
|
||||
// test to see if the directory exists
|
||||
const dirPath = path.dirname(name);
|
||||
fs.stat(dirPath, function (err, stats) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
} else if (!stats.isDirectory()) {
|
||||
return resolve(new Error(`${path.dirname(name)} is not a directory`));
|
||||
} else {
|
||||
return resolve(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
export const readFile = fs.readFile;
|
||||
const statPromise = fs.stat;
|
||||
// https://github.com/npm/lockfile/issues/33
|
||||
const lfLock = promisify(locker.lock);
|
||||
const lfUnlock = promisify(locker.unlock);
|
||||
|
||||
export const statfile = (name: string): Promise<Error | null> => {
|
||||
return new Promise((resolve, reject): void => {
|
||||
// test to see if the directory exists
|
||||
fs.stat(name, function (err, stats) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
} else if (!stats.isFile()) {
|
||||
return resolve(new Error(`${path.dirname(name)} is not a file`));
|
||||
} else {
|
||||
return resolve(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Test to see if the directory exists
|
||||
* @param name
|
||||
* @returns
|
||||
*/
|
||||
export async function statDir(name: string): Promise<void> {
|
||||
const dirPath = path.dirname(name);
|
||||
const stats = await statPromise(dirPath);
|
||||
if (!stats.isDirectory()) {
|
||||
throw new Error(`${path.dirname(name)} is not a directory`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
export const lockfile = (name: string): Promise<unknown> => {
|
||||
return new Promise<void>((resolve): void => {
|
||||
const lockOpts = {
|
||||
// time (ms) to wait when checking for stale locks
|
||||
wait: 1000,
|
||||
// how often (ms) to re-check stale locks
|
||||
pollPeriod: 100,
|
||||
// locks are considered stale after 5 minutes
|
||||
stale: 5 * 60 * 1000,
|
||||
// number of times to attempt to create a lock
|
||||
retries: 100,
|
||||
// time (ms) between tries
|
||||
retryWait: 100,
|
||||
};
|
||||
const lockFileName = `${name}.lock`;
|
||||
locker.lock(lockFileName, lockOpts, () => {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
};
|
||||
/**
|
||||
* test to see if the directory exists
|
||||
* @param name
|
||||
* @returns
|
||||
*/
|
||||
export async function statFile(name: string): Promise<void> {
|
||||
const stats = await statPromise(name);
|
||||
if (!stats.isFile()) {
|
||||
throw new Error(`${path.dirname(name)} is not a file`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock a file
|
||||
* @param name name of the file to lock
|
||||
*/
|
||||
export async function lockFileWithOptions(name: string, options?: any): Promise<void> {
|
||||
const lockOpts = {
|
||||
// time (ms) to wait when checking for stale locks
|
||||
wait: 1000,
|
||||
// how often (ms) to re-check stale locks
|
||||
pollPeriod: 100,
|
||||
// locks are considered stale after 5 minutes
|
||||
stale: 5 * 60 * 1000,
|
||||
// number of times to attempt to create a lock
|
||||
retries: 100,
|
||||
// time (ms) between tries
|
||||
retryWait: 100,
|
||||
...options,
|
||||
};
|
||||
await lfLock(`${name}.lock`, lockOpts);
|
||||
}
|
||||
|
||||
// unlocks file by removing existing lock file
|
||||
export async function unlockFileNext(name: string): Promise<void> {
|
||||
const lockFileName = `${name}.lock`;
|
||||
return lfUnlock(lockFileName);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "assets",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "assets",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "assets",
|
||||
"version": "0.0.1",
|
||||
}
|
||||
138
packages/core/file-locking/tests/lock.legacy.spec.ts
Normal file
138
packages/core/file-locking/tests/lock.legacy.spec.ts
Normal file
@@ -0,0 +1,138 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { lockFile, readFile, unlockFile } from '../src/index';
|
||||
|
||||
interface Error {
|
||||
message: string;
|
||||
}
|
||||
|
||||
const getFilePath = (filename: string): string => {
|
||||
return path.resolve(__dirname, `assets/legacy/${filename}`);
|
||||
};
|
||||
|
||||
const removeTempFile = (filename: string): void => {
|
||||
const filepath = getFilePath(filename);
|
||||
fs.unlink(filepath, (error) => {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
describe('testing locking', () => {
|
||||
describe('lockFile', () => {
|
||||
test('file should be found to be locked', (done) => {
|
||||
lockFile(getFilePath('package.json'), (error: Error) => {
|
||||
expect(error).toBeNull();
|
||||
removeTempFile('package.json.lock');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('file should fail to be found to be locked', (done) => {
|
||||
lockFile(getFilePath('package.fail.json'), (error: Error) => {
|
||||
expect(error.message).toMatch(
|
||||
/ENOENT: no such file or directory, stat '(.*)package.fail.json'/
|
||||
);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('unlockFile', () => {
|
||||
test('file should to be found to be unLock', (done) => {
|
||||
unlockFile(getFilePath('package.json.lock'), (error: Error) => {
|
||||
expect(error).toBeNull();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('readFile', () => {
|
||||
test('read file with no options should to be found to be read it as string', (done) => {
|
||||
readFile(getFilePath('package.json'), {}, (error: Error, data: string) => {
|
||||
expect(error).toBeNull();
|
||||
expect(data).toMatchInlineSnapshot(`
|
||||
"{
|
||||
\\"name\\": \\"assets\\",
|
||||
\\"version\\": \\"0.0.1\\"
|
||||
}
|
||||
"
|
||||
`);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('read file with no options should to be found to be read it as object', (done) => {
|
||||
const options = {
|
||||
parse: true,
|
||||
};
|
||||
readFile(getFilePath('package.json'), options, (error: Error, data: string) => {
|
||||
expect(error).toBeNull();
|
||||
expect(data).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"name": "assets",
|
||||
"version": "0.0.1",
|
||||
}
|
||||
`);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('read file with options (parse) should to be not found to be read it', (done) => {
|
||||
const options = {
|
||||
parse: true,
|
||||
};
|
||||
readFile(getFilePath('package.fail.json'), options, (error: Error) => {
|
||||
expect(error.message).toMatch(
|
||||
/ENOENT: no such file or directory, open '(.*)package.fail.json'/
|
||||
);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('read file with options should be found to be read it and fails to be parsed', (done) => {
|
||||
const options = {
|
||||
parse: true,
|
||||
};
|
||||
readFile(getFilePath('wrong.package.json'), options, (error: Error) => {
|
||||
expect(error.message).toMatch(/Unexpected token } in JSON at position \d+/);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('read file with options (parse, lock) should be found to be read it as object', (done) => {
|
||||
const options = {
|
||||
parse: true,
|
||||
lock: true,
|
||||
};
|
||||
readFile(getFilePath('package2.json'), options, (error: Error, data: string) => {
|
||||
expect(error).toBeNull();
|
||||
expect(data).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"name": "assets",
|
||||
"version": "0.0.1",
|
||||
}
|
||||
`);
|
||||
removeTempFile('package2.json.lock');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test(
|
||||
'read file with options (parse, lock) should be found to be read and ' + 'fails to be parsed',
|
||||
(done) => {
|
||||
const options = {
|
||||
parse: true,
|
||||
lock: true,
|
||||
};
|
||||
readFile(getFilePath('wrong.package.json'), options, (error: Error) => {
|
||||
expect(error.message).toMatch(/Unexpected token } in JSON at position \d+/);
|
||||
removeTempFile('wrong.package.json.lock');
|
||||
done();
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -1,11 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { lockFile, readFile, unlockFile } from '../src/index';
|
||||
|
||||
interface Error {
|
||||
message: string;
|
||||
}
|
||||
import { lockFileNext, readFileNext, unlockFileNext } from '../src/index';
|
||||
import { statDir, statFile } from '../src/utils';
|
||||
|
||||
const getFilePath = (filename: string): string => {
|
||||
return path.resolve(__dirname, `assets/${filename}`);
|
||||
@@ -22,116 +19,110 @@ const removeTempFile = (filename: string): void => {
|
||||
|
||||
describe('testing locking', () => {
|
||||
describe('lockFile', () => {
|
||||
test('file should be found to be locked', (done) => {
|
||||
lockFile(getFilePath('package.json'), (error: Error) => {
|
||||
expect(error).toBeNull();
|
||||
removeTempFile('package.json.lock');
|
||||
done();
|
||||
});
|
||||
test('file should be found to be locked', async () => {
|
||||
await lockFileNext(getFilePath('package.json'));
|
||||
removeTempFile('package.json.lock');
|
||||
});
|
||||
|
||||
test('file should fail to be found to be locked', (done) => {
|
||||
lockFile(getFilePath('package.fail.json'), (error: Error) => {
|
||||
expect(error.message).toMatch(
|
||||
/ENOENT: no such file or directory, stat '(.*)package.fail.json'/
|
||||
);
|
||||
done();
|
||||
});
|
||||
test('file should fail to be found to be locked', async () => {
|
||||
await expect(lockFileNext(getFilePath('package.fail.json'))).rejects.toThrow(
|
||||
'ENOENT: no such file or directory'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('unlockFile', () => {
|
||||
test('file should to be found to be unLock', (done) => {
|
||||
unlockFile(getFilePath('package.json.lock'), (error: Error) => {
|
||||
expect(error).toBeNull();
|
||||
done();
|
||||
});
|
||||
test('file should to be found to be unLock', async () => {
|
||||
await expect(unlockFileNext(getFilePath('package.json.lock'))).resolves.toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('statDir', () => {
|
||||
test('error on missing dir', async () => {
|
||||
await expect(statDir(getFilePath('package.json/package.json'))).rejects.toThrow(
|
||||
'is not a directory'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('statFile', () => {
|
||||
test('error on missing dir', async () => {
|
||||
await expect(statFile(getFilePath(''))).rejects.toThrow('is not a file');
|
||||
});
|
||||
});
|
||||
|
||||
describe('readFile', () => {
|
||||
test('read file with no options should to be found to be read it as string', (done) => {
|
||||
readFile(getFilePath('package.json'), {}, (error: Error, data: string) => {
|
||||
expect(error).toBeNull();
|
||||
expect(data).toMatchInlineSnapshot(`
|
||||
test('read file with no options should to be found to be read it as string', async () => {
|
||||
const data = await readFileNext(getFilePath('package.json'), {});
|
||||
expect(data).toMatchInlineSnapshot(`
|
||||
"{
|
||||
\\"name\\": \\"assets\\",
|
||||
\\"version\\": \\"0.0.1\\"
|
||||
}
|
||||
"
|
||||
`);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('read file with no options should to be found to be read it as object', (done) => {
|
||||
test('read file with no options should to be found to be read it as object', async () => {
|
||||
const options = {
|
||||
parse: true,
|
||||
};
|
||||
readFile(getFilePath('package.json'), options, (error: Error, data: string) => {
|
||||
expect(error).toBeNull();
|
||||
expect(data).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"name": "assets",
|
||||
"version": "0.0.1",
|
||||
}
|
||||
`);
|
||||
done();
|
||||
});
|
||||
const data = await readFileNext(getFilePath('package.json'), options);
|
||||
expect(data).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"name": "assets",
|
||||
"version": "0.0.1",
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
test('read file with options (parse) should to be not found to be read it', (done) => {
|
||||
test('read file with options (parse) should to be not found to be read it', async () => {
|
||||
const options = {
|
||||
parse: true,
|
||||
};
|
||||
readFile(getFilePath('package.fail.json'), options, (error: Error) => {
|
||||
expect(error.message).toMatch(
|
||||
/ENOENT: no such file or directory, open '(.*)package.fail.json'/
|
||||
);
|
||||
done();
|
||||
});
|
||||
await expect(readFileNext(getFilePath('package.fail.json'), options)).rejects.toThrow(
|
||||
/ENOENT: no such file or directory, open '(.*)package.fail.json'/
|
||||
);
|
||||
});
|
||||
|
||||
test('read file with options should be found to be read it and fails to be parsed', (done) => {
|
||||
test('read file with options should be found to be read it and fails to be parsed', async () => {
|
||||
const options = {
|
||||
parse: true,
|
||||
};
|
||||
readFile(getFilePath('wrong.package.json'), options, (error: Error) => {
|
||||
expect(error.message).toMatch(/Unexpected token } in JSON at position \d+/);
|
||||
done();
|
||||
});
|
||||
await expect(readFileNext(getFilePath('wrong.package.json'), options)).rejects.toThrow(
|
||||
'Unexpected token } in JSON at position 44'
|
||||
);
|
||||
});
|
||||
|
||||
test('read file with options (parse, lock) should be found to be read it as object', (done) => {
|
||||
test('read file with options (parse, lock) should be found to be read it as object', async () => {
|
||||
const options = {
|
||||
parse: true,
|
||||
lock: true,
|
||||
};
|
||||
readFile(getFilePath('package2.json'), options, (error: Error, data: string) => {
|
||||
expect(error).toBeNull();
|
||||
expect(data).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"name": "assets",
|
||||
"version": "0.0.1",
|
||||
}
|
||||
`);
|
||||
removeTempFile('package2.json.lock');
|
||||
done();
|
||||
});
|
||||
await expect(
|
||||
readFileNext(getFilePath('package2.json'), options)
|
||||
).resolves.toMatchInlineSnapshot(
|
||||
`
|
||||
Object {
|
||||
"name": "assets",
|
||||
"version": "0.0.1",
|
||||
}
|
||||
`
|
||||
);
|
||||
removeTempFile('package2.json.lock');
|
||||
});
|
||||
|
||||
test(
|
||||
'read file with options (parse, lock) should be found to be read and ' + 'fails to be parsed',
|
||||
(done) => {
|
||||
async () => {
|
||||
const options = {
|
||||
parse: true,
|
||||
lock: true,
|
||||
};
|
||||
readFile(getFilePath('wrong.package.json'), options, (error: Error) => {
|
||||
expect(error.message).toMatch(/Unexpected token } in JSON at position \d+/);
|
||||
removeTempFile('wrong.package.json.lock');
|
||||
done();
|
||||
});
|
||||
await expect(readFileNext(getFilePath('wrong.package.json'), options)).rejects.toThrow(
|
||||
'Unexpected token } in JSON at position 44'
|
||||
);
|
||||
removeTempFile('wrong.package.json.lock');
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
"marked": "3.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.10"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.12"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import semver from 'semver';
|
||||
|
||||
// FUTURE: remove when v15 is the minimum requirement
|
||||
if (semver.lte(process.version, 'v15.0.0')) {
|
||||
global.AbortController = require('abortcontroller-polyfill/dist/cjs-ponyfill').AbortController;
|
||||
}
|
||||
|
||||
export { default } from './server';
|
||||
@@ -34,7 +34,7 @@
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.10"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.12"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# Change Log
|
||||
|
||||
## 11.0.0-6-next.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [82cb0f2b]
|
||||
- Updated dependencies [5167bb52]
|
||||
- @verdaccio/core@6.0.0-6-next.5
|
||||
- @verdaccio/url@11.0.0-6-next.9
|
||||
- @verdaccio/utils@6.0.0-6-next.11
|
||||
|
||||
## 11.0.0-6-next.11
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/tarball",
|
||||
"version": "11.0.0-6-next.11",
|
||||
"version": "11.0.0-6-next.12",
|
||||
"description": "tarball utilities resolver",
|
||||
"keywords": [
|
||||
"private",
|
||||
@@ -35,14 +35,14 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "4.3.3",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/url": "workspace:11.0.0-6-next.8",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.10",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/url": "workspace:11.0.0-6-next.9",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.11",
|
||||
"lodash": "4.17.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.10",
|
||||
"node-mocks-http": "1.10.1"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.12",
|
||||
"node-mocks-http": "1.11.0"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
import { Package } from '@verdaccio/types';
|
||||
import { Package, Version } from '@verdaccio/types';
|
||||
import { RequestOptions } from '@verdaccio/url';
|
||||
|
||||
import { getLocalRegistryTarballUri } from './getLocalRegistryTarballUri';
|
||||
@@ -17,19 +17,47 @@ export function convertDistRemoteToLocalTarballUrls(
|
||||
request: RequestOptions,
|
||||
urlPrefix: string | void
|
||||
): Package {
|
||||
const { name, versions } = pkg;
|
||||
const convertedPkg = { ...pkg };
|
||||
const convertedVersions = versions;
|
||||
for (const ver in pkg.versions) {
|
||||
if (Object.prototype.hasOwnProperty.call(pkg.versions, ver)) {
|
||||
const distName = pkg.versions[ver].dist;
|
||||
|
||||
if (_.isNull(distName) === false && _.isNull(distName.tarball) === false) {
|
||||
distName.tarball = getLocalRegistryTarballUri(
|
||||
distName.tarball,
|
||||
pkg.name,
|
||||
request,
|
||||
urlPrefix
|
||||
);
|
||||
}
|
||||
const version = versions[ver];
|
||||
convertedVersions[ver] = convertDistVersionToLocalTarballsUrl(
|
||||
name,
|
||||
version,
|
||||
request,
|
||||
urlPrefix
|
||||
);
|
||||
}
|
||||
}
|
||||
return pkg;
|
||||
|
||||
return {
|
||||
...convertedPkg,
|
||||
versions: convertedVersions,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert single Version disst tarball
|
||||
* @param name
|
||||
* @param version
|
||||
* @param request
|
||||
* @param urlPrefix
|
||||
* @returns
|
||||
*/
|
||||
export function convertDistVersionToLocalTarballsUrl(name, version: Version, request, urlPrefix) {
|
||||
const distName = version.dist;
|
||||
|
||||
if (_.isNull(distName) === false && _.isNull(distName.tarball) === false) {
|
||||
return {
|
||||
...version,
|
||||
dist: {
|
||||
...distName,
|
||||
tarball: getLocalRegistryTarballUri(distName.tarball, name, request, urlPrefix),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { RequestOptions } from '@verdaccio/url';
|
||||
|
||||
export { convertDistRemoteToLocalTarballUrls } from './convertDistRemoteToLocalTarballUrls';
|
||||
export {
|
||||
convertDistRemoteToLocalTarballUrls,
|
||||
convertDistVersionToLocalTarballsUrl,
|
||||
} from './convertDistRemoteToLocalTarballUrls';
|
||||
export { getLocalRegistryTarballUri } from './getLocalRegistryTarballUri';
|
||||
|
||||
export { RequestOptions };
|
||||
|
||||
@@ -1,5 +1,83 @@
|
||||
# Change Log
|
||||
|
||||
## 11.0.0-6-next.12
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- d43894e8: feat: rework web header for mobile, add new settings and raw manifest button
|
||||
|
||||
### New set of variables to hide features
|
||||
|
||||
Add set of new variables that allow hide different parts of the UI, buttons, footer or download tarballs. _All are
|
||||
enabled by default_.
|
||||
|
||||
```yaml
|
||||
# login: true <-- already exist but worth the reminder
|
||||
# showInfo: true
|
||||
# showSettings: true
|
||||
# In combination with darkMode you can force specific theme
|
||||
# showThemeSwitch: true
|
||||
# showFooter: true
|
||||
# showSearch: true
|
||||
# showDownloadTarball: true
|
||||
```
|
||||
|
||||
> If you disable `showThemeSwitch` and force `darkMode: true` the local storage settings would be
|
||||
> ignored and force all themes to the one in the configuration file.
|
||||
|
||||
Future could be extended to
|
||||
|
||||
### Raw button to display manifest package
|
||||
|
||||
A new experimental feature (enabled by default), button named RAW to be able navigate on the package manifest directly on the ui, kudos to [react-json-view](https://www.npmjs.com/package/react-json-view) that allows an easy integration, not configurable yet until get more feedback.
|
||||
|
||||
```yaml
|
||||
showRaw: true
|
||||
```
|
||||
|
||||
#### Rework header buttons
|
||||
|
||||
- The header has been rework, the mobile was not looking broken.
|
||||
- Removed info button in the header and moved to a dialog
|
||||
- Info dialog now contains more information about the project, license and the aid content for Ukrania now is inside of the info modal.
|
||||
- Separate settings and info to avoid collapse too much info (for mobile still need some work)
|
||||
|
||||
## 11.0.0-6-next.11
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 82cb0f2b: feat!: config.logs throw an error, logging config not longer accept array or logs property
|
||||
|
||||
### 💥 Breaking change
|
||||
|
||||
This is valid
|
||||
|
||||
```yaml
|
||||
log: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
This is invalid
|
||||
|
||||
```yaml
|
||||
logs: { type: stdout, format: pretty, level: http }
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```yaml
|
||||
logs:
|
||||
- [{ type: stdout, format: pretty, level: http }]
|
||||
```
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 5167bb52: feat: ui search support for remote, local and private packages
|
||||
|
||||
The command `npm search` search globally and return all matches, with this improvement the user interface
|
||||
is powered with the same capabilities.
|
||||
|
||||
The UI also tag where is the origin the package with a tag, also provide the latest version and description of the package.
|
||||
|
||||
## 11.0.0-6-next.10
|
||||
|
||||
### Major Changes
|
||||
|
||||
77
packages/core/types/index.d.ts
vendored
77
packages/core/types/index.d.ts
vendored
@@ -40,11 +40,21 @@ declare module '@verdaccio/types' {
|
||||
darkMode?: boolean;
|
||||
protocol?: string;
|
||||
host?: string;
|
||||
// deprecated
|
||||
basename?: string;
|
||||
scope?: string;
|
||||
showInfo?: boolean;
|
||||
showSettings?: boolean;
|
||||
showSearch?: boolean;
|
||||
showFooter?: boolean;
|
||||
showThemeSwitch?: boolean;
|
||||
showDownloadTarball?: boolean;
|
||||
showRaw?: boolean;
|
||||
base: string;
|
||||
primaryColor?: string;
|
||||
version?: string;
|
||||
logoURI?: string;
|
||||
flags: FlagsConfig;
|
||||
} & CommonWebConf;
|
||||
|
||||
/**
|
||||
@@ -178,6 +188,9 @@ declare module '@verdaccio/types' {
|
||||
[key: string]: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use Manifest instead
|
||||
*/
|
||||
interface Package {
|
||||
_id?: string;
|
||||
name: string;
|
||||
@@ -192,6 +205,20 @@ declare module '@verdaccio/types' {
|
||||
_rev: string;
|
||||
}
|
||||
|
||||
interface Manifest {
|
||||
_id?: string;
|
||||
name: string;
|
||||
versions: Versions;
|
||||
'dist-tags': GenericBody;
|
||||
time: GenericBody;
|
||||
readme?: string;
|
||||
users?: PackageUsers;
|
||||
_distfiles: DistFiles;
|
||||
_attachments: AttachMents;
|
||||
_uplinks: UpLinks;
|
||||
_rev: string;
|
||||
}
|
||||
|
||||
interface IUploadTarball extends PassThrough {
|
||||
abort(): void;
|
||||
done(): void;
|
||||
@@ -315,10 +342,6 @@ declare module '@verdaccio/types' {
|
||||
sync(): void;
|
||||
}
|
||||
|
||||
interface LoggerConf {
|
||||
[key: string]: LoggerConfItem;
|
||||
}
|
||||
|
||||
interface ListenAddress {
|
||||
[key: string]: string;
|
||||
}
|
||||
@@ -368,11 +391,11 @@ declare module '@verdaccio/types' {
|
||||
api: APITokenOptions;
|
||||
}
|
||||
|
||||
interface ConfigFlags {
|
||||
token?: boolean;
|
||||
search?: boolean;
|
||||
export type FlagsConfig = {
|
||||
searchRemote?: boolean;
|
||||
changePassword?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
export type RateLimit = {
|
||||
windowMs: number;
|
||||
max: number;
|
||||
@@ -400,9 +423,8 @@ declare module '@verdaccio/types' {
|
||||
storage?: string | void;
|
||||
packages: PackageList;
|
||||
uplinks: UpLinksConfList;
|
||||
// @deprecated in favor of log
|
||||
logs?: LoggerConf[];
|
||||
log?: LoggerConf[];
|
||||
// FUTURE: log should be mandatory
|
||||
log?: LoggerConfItem;
|
||||
web?: WebConf;
|
||||
auth?: AuthConf;
|
||||
security: Security;
|
||||
@@ -421,7 +443,7 @@ declare module '@verdaccio/types' {
|
||||
filters?: any;
|
||||
url_prefix?: string;
|
||||
server?: ServerSettingsConf;
|
||||
flags?: ConfigFlags;
|
||||
flags?: FlagsConfig;
|
||||
}
|
||||
|
||||
interface ConfigRuntime extends ConfigYaml {
|
||||
@@ -438,6 +460,29 @@ declare module '@verdaccio/types' {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
type PublisherMaintainer = {
|
||||
username: string;
|
||||
email: string;
|
||||
};
|
||||
|
||||
type SearchPackageBody = {
|
||||
name: string;
|
||||
scope: string;
|
||||
description: string;
|
||||
author: string | PublisherMaintainer;
|
||||
version: string;
|
||||
keywords: string | string[] | undefined;
|
||||
date: string;
|
||||
links?: {
|
||||
npm: string; // only include placeholder for URL eg: {url}/{packageName}
|
||||
homepage?: string;
|
||||
repository?: string;
|
||||
bugs?: string;
|
||||
};
|
||||
publisher?: any;
|
||||
maintainers?: PublisherMaintainer[];
|
||||
};
|
||||
|
||||
interface ConfigWithHttps extends Config {
|
||||
https: HttpsConf;
|
||||
}
|
||||
@@ -477,6 +522,7 @@ declare module '@verdaccio/types' {
|
||||
createPackage(pkgName: string, value: Package, cb: CallbackAction): void;
|
||||
deletePackage(fileName: string): Promise<void>;
|
||||
removePackage(): Promise<void>;
|
||||
// @deprecated
|
||||
updatePackage(
|
||||
pkgFileName: string,
|
||||
updateHandler: StorageUpdateCallback,
|
||||
@@ -484,7 +530,14 @@ declare module '@verdaccio/types' {
|
||||
transformPackage: PackageTransformer,
|
||||
onEnd: Callback
|
||||
): void;
|
||||
// @deprecated
|
||||
savePackage(fileName: string, json: Package, callback: CallbackAction): void;
|
||||
// next packages migration (this list is meant to replace the callback parent functions)
|
||||
updatePackageNext(
|
||||
packageName: string,
|
||||
handleUpdate: (manifest: Package) => Promise<Package>
|
||||
): Promise<Package>;
|
||||
savePackageNext(name: string, value: Package): Promise<void>;
|
||||
}
|
||||
|
||||
interface TarballActions {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/types",
|
||||
"version": "11.0.0-6-next.10",
|
||||
"version": "11.0.0-6-next.12",
|
||||
"description": "verdaccio types definitions",
|
||||
"keywords": [
|
||||
"private",
|
||||
@@ -38,8 +38,8 @@
|
||||
"build": "exit 0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "14.6.0",
|
||||
"tsd": "0.18.0"
|
||||
"@types/node": "16.11.21",
|
||||
"tsd": "0.19.1"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Change Log
|
||||
|
||||
## 11.0.0-6-next.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [82cb0f2b]
|
||||
- Updated dependencies [5167bb52]
|
||||
- @verdaccio/core@6.0.0-6-next.5
|
||||
|
||||
## 11.0.0-6-next.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/url",
|
||||
"version": "11.0.0-6-next.8",
|
||||
"version": "11.0.0-6-next.9",
|
||||
"description": "url utilities resolver",
|
||||
"keywords": [
|
||||
"private",
|
||||
@@ -34,14 +34,14 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.5",
|
||||
"debug": "4.3.3",
|
||||
"lodash": "4.17.21",
|
||||
"validator": "13.7.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.10",
|
||||
"node-mocks-http": "1.10.1"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.12",
|
||||
"node-mocks-http": "1.11.0"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user