Compare commits
202 Commits
@verdaccio
...
@verdaccio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e06d8a0956 | ||
|
|
44b7a0f300 | ||
|
|
351aeeaa88 | ||
|
|
3089c1c9cb | ||
|
|
d202128a06 | ||
|
|
3c81bf8945 | ||
|
|
20d63dc30e | ||
|
|
5e22a52d9d | ||
|
|
f332927f02 | ||
|
|
4137a96c20 | ||
|
|
37274e4c8d | ||
|
|
f1527f5f20 | ||
|
|
a32a7e617e | ||
|
|
08c36e688e | ||
|
|
ba3d100b63 | ||
|
|
37da9e0f61 | ||
|
|
e630954923 | ||
|
|
4b61029718 | ||
|
|
13398c6ab8 | ||
|
|
16f847fd7d | ||
|
|
225b5235a9 | ||
|
|
1b5bcfeac6 | ||
|
|
eaebffaf9e | ||
|
|
dc4fa8e20d | ||
|
|
99b947a2a5 | ||
|
|
83c4705821 | ||
|
|
3f5a1ee22a | ||
|
|
bf0f331dfc | ||
|
|
89b2b9104f | ||
|
|
21478f3221 | ||
|
|
12a05875c7 | ||
|
|
24c5d7ede5 | ||
|
|
b179541e66 | ||
|
|
353c9f386f | ||
|
|
f42db638eb | ||
|
|
a3a209b5e2 | ||
|
|
9bff9045f8 | ||
|
|
df7600d08a | ||
|
|
a136cefd49 | ||
|
|
93102eacc5 | ||
|
|
7d05f03525 | ||
|
|
04cc86374d | ||
|
|
bbf897d05a | ||
|
|
e21ccea3a1 | ||
|
|
5cf041a1a5 | ||
|
|
57908e24ba | ||
|
|
00d1d2a179 | ||
|
|
8db9cf93ce | ||
|
|
a6c88932a2 | ||
|
|
399343c6f9 | ||
|
|
6f8a2d37e6 | ||
|
|
0773e2ee2e | ||
|
|
a4c17858bf | ||
|
|
313c71c938 | ||
|
|
8342abde70 | ||
|
|
1755840cd3 | ||
|
|
a123775f20 | ||
|
|
292c0a37fc | ||
|
|
743ccff5ef | ||
|
|
4afb06347a | ||
|
|
bfe996735a | ||
|
|
1c7eb368ee | ||
|
|
09125ff004 | ||
|
|
43dd445200 | ||
|
|
63f8a8aa2e | ||
|
|
fcbc4bb781 | ||
|
|
d964353cb8 | ||
|
|
c5a6ff89bb | ||
|
|
d7dec2695f | ||
|
|
9beb77a44e | ||
|
|
cfcdbf6282 | ||
|
|
f75ddf8231 | ||
|
|
73d545b812 | ||
|
|
a828a5f6c0 | ||
|
|
aa61d256de | ||
|
|
7a99b11be3 | ||
|
|
353aa62fff | ||
|
|
278eaa409b | ||
|
|
49b3120ded | ||
|
|
2cc65d2503 | ||
|
|
2aef5203a4 | ||
|
|
a022b4a337 | ||
|
|
02e11e929a | ||
|
|
9fea291ebc | ||
|
|
27899ab9d8 | ||
|
|
47ec52d03f | ||
|
|
0e74d5ea52 | ||
|
|
a6be85ac3a | ||
|
|
8fdfacdbf7 | ||
|
|
28b97ec16b | ||
|
|
aea3b9ddaf | ||
|
|
6d8aa9817c | ||
|
|
1916dbc1a5 | ||
|
|
2b9882643d | ||
|
|
853489896c | ||
|
|
99c3960f74 | ||
|
|
fd4be1a21a | ||
|
|
a6491dcd7c | ||
|
|
1c077c32d7 | ||
|
|
d7db93b143 | ||
|
|
c306a2f1cb | ||
|
|
a6d9743c06 | ||
|
|
b48edd980c | ||
|
|
b8981136b0 | ||
|
|
ef793182d5 | ||
|
|
3f98448566 | ||
|
|
bcffca15ac | ||
|
|
52ec6b41e3 | ||
|
|
cfba19d622 | ||
|
|
b055c193b8 | ||
|
|
cbb8adc075 | ||
|
|
840aa9fe39 | ||
|
|
f591a71d74 | ||
|
|
c98bc8dc3e | ||
|
|
d3ce9c1b0a | ||
|
|
11bff60610 | ||
|
|
a75f5c97dd | ||
|
|
e3184ed185 | ||
|
|
6d00f3ed2c | ||
|
|
06d6c82d61 | ||
|
|
ff49f7df03 | ||
|
|
1cfb52d414 | ||
|
|
fe11b334fc | ||
|
|
321703512a | ||
|
|
e9d1e82666 | ||
|
|
f8a7fc94a8 | ||
|
|
1a605054a8 | ||
|
|
f9a58dce98 | ||
|
|
0d1dd136eb | ||
|
|
a4eedfe070 | ||
|
|
a11f8aa0d4 | ||
|
|
23fb97b2e1 | ||
|
|
4cf3687d0f | ||
|
|
1ebddae402 | ||
|
|
9127082cff | ||
|
|
174250449d | ||
|
|
c5750b51b4 | ||
|
|
91a8b13442 | ||
|
|
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 |
52
.changeset/angry-nails-appear.md
Normal file
52
.changeset/angry-nails-appear.md
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
'@verdaccio/api': major
|
||||
'@verdaccio/auth': major
|
||||
'@verdaccio/cli': major
|
||||
'@verdaccio/config': major
|
||||
'@verdaccio/core': major
|
||||
'@verdaccio/file-locking': major
|
||||
'@verdaccio/readme': major
|
||||
'@verdaccio/tarball': major
|
||||
'@verdaccio/types': major
|
||||
'@verdaccio/url': major
|
||||
'@verdaccio/hooks': major
|
||||
'@verdaccio/loaders': major
|
||||
'@verdaccio/logger': major
|
||||
'@verdaccio/logger-prettify': major
|
||||
'@verdaccio/middleware': major
|
||||
'@verdaccio/node-api': major
|
||||
'verdaccio-audit': major
|
||||
'verdaccio-auth-memory': major
|
||||
'verdaccio-htpasswd': major
|
||||
'@verdaccio/local-storage': major
|
||||
'verdaccio-memory': major
|
||||
'@verdaccio/ui-theme': major
|
||||
'@verdaccio/proxy': major
|
||||
'@verdaccio/server': major
|
||||
'@verdaccio/store': major
|
||||
'@verdaccio/utils': major
|
||||
'verdaccio': major
|
||||
'@verdaccio/web': major
|
||||
---
|
||||
|
||||
feat!: replace deprecated request dependency by got
|
||||
|
||||
This is a big refactoring of the core, fetching dependencies, improve code, more tests and better stability. This is essential for the next release, will take some time but would allow modularize more the core.
|
||||
|
||||
## Notes
|
||||
|
||||
- Remove deprecated `request` by other `got`, retry improved, custom Agent ( got does not include it built-in)
|
||||
- Remove `async` dependency from storage (used by core) it was linked with proxy somehow safe to remove now
|
||||
- Refactor with promises instead callback wherever is possible
|
||||
- ~Document the API~
|
||||
- Improve testing, integration tests
|
||||
- Bugfix
|
||||
- Clean up old validations
|
||||
- Improve performance
|
||||
|
||||
## 💥 Breaking changes
|
||||
|
||||
- Plugin API methods were callbacks based are returning promises, this will break current storage plugins, check documentation for upgrade.
|
||||
- Write Tarball, Read Tarball methods parameters change, a new set of options like `AbortController` signals are being provided to the `addAbortSignal` can be internally used with Streams when a request is aborted. eg: `addAbortSignal(signal, fs.createReadStream(pathName));`
|
||||
- `@verdaccio/streams` stream abort support is legacy is being deprecated removed
|
||||
- Remove AWS and Google Cloud packages for future refactoring [#2574](https://github.com/verdaccio/verdaccio/pull/2574).
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
'@verdaccio/api': major
|
||||
'@verdaccio/fastify-migration': major
|
||||
'@verdaccio/server-fastify': major
|
||||
'@verdaccio/tarball': major
|
||||
'@verdaccio/local-storage': major
|
||||
'verdaccio-memory': major
|
||||
|
||||
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/chilled-ways-fetch.md
Normal file
5
.changeset/chilled-ways-fetch.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'verdaccio-memory': patch
|
||||
---
|
||||
|
||||
Fix storing tarballs with identical names from different packages in memory plugin
|
||||
11
.changeset/clever-pugs-warn.md
Normal file
11
.changeset/clever-pugs-warn.md
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
'@verdaccio/cli': major
|
||||
'@verdaccio/core': major
|
||||
'@verdaccio/types': major
|
||||
'@verdaccio/logger': major
|
||||
'@verdaccio/logger-prettify': major
|
||||
'verdaccio-audit': major
|
||||
'@verdaccio/eslint-config': major
|
||||
---
|
||||
|
||||
feat: migrate to pino.js 8
|
||||
@@ -6,7 +6,7 @@
|
||||
'@verdaccio/commons-api': major
|
||||
'@verdaccio/core': major
|
||||
'@verdaccio/local-storage': major
|
||||
'@verdaccio/fastify-migration': major
|
||||
'@verdaccio/server-fastify': major
|
||||
'@verdaccio/streams': major
|
||||
'@verdaccio/types': major
|
||||
'@verdaccio/hooks': major
|
||||
|
||||
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
|
||||
@@ -7,7 +7,7 @@
|
||||
'@verdaccio/file-locking': major
|
||||
'verdaccio-htpasswd': major
|
||||
'@verdaccio/readme': major
|
||||
'@verdaccio/fastify-migration': major
|
||||
'@verdaccio/server-fastify': major
|
||||
'@verdaccio/streams': major
|
||||
'@verdaccio/tarball': major
|
||||
'@verdaccio/types': major
|
||||
@@ -16,7 +16,6 @@
|
||||
'@verdaccio/loaders': major
|
||||
'@verdaccio/logger': major
|
||||
'@verdaccio/middleware': major
|
||||
'@verdaccio/mock': major
|
||||
'@verdaccio/node-api': major
|
||||
'@verdaccio/active-directory': major
|
||||
'verdaccio-audit': major
|
||||
|
||||
42
.changeset/famous-tigers-doubt.md
Normal file
42
.changeset/famous-tigers-doubt.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
'@verdaccio/api': patch
|
||||
'@verdaccio/auth': patch
|
||||
'@verdaccio/cli': patch
|
||||
'@verdaccio/core': patch
|
||||
'@verdaccio/file-locking': patch
|
||||
'@verdaccio/readme': patch
|
||||
'@verdaccio/tarball': patch
|
||||
'@verdaccio/types': patch
|
||||
'@verdaccio/url': patch
|
||||
'@verdaccio/hooks': patch
|
||||
'@verdaccio/loaders': patch
|
||||
'@verdaccio/logger': patch
|
||||
'@verdaccio/node-api': patch
|
||||
'verdaccio-audit': patch
|
||||
'verdaccio-auth-memory': patch
|
||||
'verdaccio-htpasswd': patch
|
||||
'@verdaccio/local-storage': patch
|
||||
'verdaccio-memory': patch
|
||||
'@verdaccio/ui-theme': patch
|
||||
'@verdaccio/proxy': patch
|
||||
'@verdaccio/server': patch
|
||||
'@verdaccio/server-fastify': patch
|
||||
'@verdaccio/cli-standalone': patch
|
||||
'@verdaccio/store': patch
|
||||
'docusaurus-plugin-contributors': patch
|
||||
'@verdaccio/test-helper': patch
|
||||
'verdaccio': patch
|
||||
'@verdaccio/web': patch
|
||||
'@verdaccio/test-cli-commons': patch
|
||||
'@verdaccio/e2e-cli-npm6': patch
|
||||
'@verdaccio/e2e-cli-npm7': patch
|
||||
'@verdaccio/e2e-cli-npm8': patch
|
||||
'@verdaccio/e2e-cli-pnpm6': patch
|
||||
'@verdaccio/e2e-cli-pnpm7': patch
|
||||
'@verdaccio/e2e-cli-yarn1': patch
|
||||
'@verdaccio/e2e-cli-yarn2': patch
|
||||
'@verdaccio/e2e-cli-yarn3': patch
|
||||
'@verdaccio/e2e-cli-yarn4': patch
|
||||
---
|
||||
|
||||
fix(deps): @verdaccio/utils should be a prod dep of local-storage
|
||||
@@ -15,7 +15,6 @@
|
||||
'@verdaccio/logger': major
|
||||
'@verdaccio/logger-prettify': major
|
||||
'@verdaccio/middleware': major
|
||||
'@verdaccio/mock': major
|
||||
'@verdaccio/node-api': major
|
||||
'@verdaccio/active-directory': major
|
||||
'verdaccio-audit': major
|
||||
@@ -30,7 +29,6 @@
|
||||
'@verdaccio/utils': major
|
||||
'verdaccio': major
|
||||
'@verdaccio/web': major
|
||||
'@verdaccio/website': major
|
||||
---
|
||||
|
||||
feat!: experiments config renamed to flags
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
'@verdaccio/api': minor
|
||||
'@verdaccio/fastify-migration': minor
|
||||
'@verdaccio/server-fastify': minor
|
||||
'@verdaccio/hooks': minor
|
||||
'@verdaccio/logger-prettify': minor
|
||||
'@verdaccio/proxy': minor
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
'@verdaccio/logger': major
|
||||
'@verdaccio/logger-prettify': major
|
||||
'@verdaccio/middleware': major
|
||||
'@verdaccio/mock': major
|
||||
'@verdaccio/node-api': major
|
||||
'@verdaccio/proxy': major
|
||||
'@verdaccio/server': major
|
||||
|
||||
29
.changeset/green-yaks-divide.md
Normal file
29
.changeset/green-yaks-divide.md
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
'@verdaccio/api': minor
|
||||
'@verdaccio/cli': minor
|
||||
'@verdaccio/core': minor
|
||||
'@verdaccio/node-api': minor
|
||||
'@verdaccio/server': minor
|
||||
'@verdaccio/server-fastify': minor
|
||||
'verdaccio': minor
|
||||
---
|
||||
|
||||
chore: env variable for launch fastify
|
||||
|
||||
- Update fastify to major release `v4.3.0`
|
||||
- Update CLI launcher
|
||||
|
||||
via CLI
|
||||
|
||||
```
|
||||
VERDACCIO_SERVER=fastify verdaccio
|
||||
```
|
||||
|
||||
with docker
|
||||
|
||||
```
|
||||
docker run -it --rm --name verdaccio \
|
||||
-e "VERDACCIO_SERVER=8080" -p 8080:8080 \
|
||||
-e "VERDACCIO_SERVER=fastify" \
|
||||
verdaccio/verdaccio
|
||||
```
|
||||
7
.changeset/healthy-pants-smash.md
Normal file
7
.changeset/healthy-pants-smash.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
'@verdaccio/test-helper': patch
|
||||
'@verdaccio/web': patch
|
||||
---
|
||||
|
||||
fix: #3174 set correctly ui values to html render
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
'@verdaccio/cli': minor
|
||||
'@verdaccio/fastify-migration': minor
|
||||
'@verdaccio/server-fastify': minor
|
||||
---
|
||||
|
||||
[Fastify] Add ping endpoint
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
'@verdaccio/logger': patch
|
||||
'@verdaccio/logger-prettify': patch
|
||||
'@verdaccio/middleware': patch
|
||||
'@verdaccio/mock': patch
|
||||
'@verdaccio/node-api': patch
|
||||
'@verdaccio/active-directory': patch
|
||||
'verdaccio-audit': patch
|
||||
@@ -31,9 +30,6 @@
|
||||
'@verdaccio/utils': patch
|
||||
'verdaccio': patch
|
||||
'@verdaccio/web': patch
|
||||
'@verdaccio/e2e-cli': patch
|
||||
'@verdaccio/e2e-ui': patch
|
||||
'@verdaccio/website': patch
|
||||
---
|
||||
|
||||
chore: add release step to private regisry on merge changeset pr
|
||||
|
||||
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
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
'@verdaccio/tarball': patch
|
||||
'@verdaccio/mock': patch
|
||||
'@verdaccio/ui-theme': patch
|
||||
'@verdaccio/server': patch
|
||||
'@verdaccio/utils': patch
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
'@verdaccio/logger': minor
|
||||
'@verdaccio/logger-prettify': minor
|
||||
'@verdaccio/middleware': minor
|
||||
'@verdaccio/mock': minor
|
||||
'@verdaccio/node-api': minor
|
||||
'@verdaccio/active-directory': minor
|
||||
'verdaccio-audit': minor
|
||||
|
||||
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)
|
||||
@@ -6,7 +6,7 @@
|
||||
'@verdaccio/core': minor
|
||||
'verdaccio-htpasswd': minor
|
||||
'@verdaccio/local-storage': minor
|
||||
'@verdaccio/fastify-migration': minor
|
||||
'@verdaccio/server-fastify': minor
|
||||
'@verdaccio/tarball': minor
|
||||
'@verdaccio/types': minor
|
||||
'@verdaccio/url': minor
|
||||
@@ -14,7 +14,6 @@
|
||||
'@verdaccio/loaders': minor
|
||||
'@verdaccio/logger': minor
|
||||
'@verdaccio/middleware': minor
|
||||
'@verdaccio/mock': minor
|
||||
'@verdaccio/node-api': minor
|
||||
'@verdaccio/active-directory': minor
|
||||
'verdaccio-auth-memory': minor
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
'@verdaccio/logger': minor
|
||||
'@verdaccio/logger-prettify': minor
|
||||
'@verdaccio/middleware': minor
|
||||
'@verdaccio/mock': minor
|
||||
'@verdaccio/node-api': minor
|
||||
'@verdaccio/proxy': minor
|
||||
'@verdaccio/server': minor
|
||||
@@ -24,7 +23,6 @@
|
||||
'@verdaccio/utils': minor
|
||||
'verdaccio': minor
|
||||
'@verdaccio/web': minor
|
||||
'@verdaccio/website': minor
|
||||
---
|
||||
|
||||
feat: add typescript project references settings
|
||||
|
||||
@@ -10,14 +10,12 @@
|
||||
"verdaccio-htpasswd": "11.0.0-alpha.0",
|
||||
"@verdaccio/local-storage": "11.0.0-alpha.0",
|
||||
"@verdaccio/readme": "11.0.0-alpha.0",
|
||||
"@verdaccio/streams": "11.0.0-alpha.0",
|
||||
"@verdaccio/types": "11.0.0-alpha.0",
|
||||
"@verdaccio/hooks": "6.0.0-alpha.0",
|
||||
"@verdaccio/loaders": "6.0.0-alpha.0",
|
||||
"@verdaccio/logger": "6.0.0-alpha.0",
|
||||
"@verdaccio/logger-prettify": "6.0.0-alpha.0",
|
||||
"@verdaccio/middleware": "6.0.0-alpha.0",
|
||||
"@verdaccio/mock": "6.0.0-alpha.0",
|
||||
"@verdaccio/node-api": "6.0.0-alpha.0",
|
||||
"@verdaccio/proxy": "6.0.0-alpha.0",
|
||||
"@verdaccio/server": "6.0.0-alpha.0",
|
||||
@@ -33,28 +31,43 @@
|
||||
"verdaccio-google-cloud": "11.0.0-alpha.0",
|
||||
"verdaccio-memory": "11.0.0-alpha.0",
|
||||
"@verdaccio/ui-theme": "6.0.0-alpha.1",
|
||||
"@verdaccio/e2e-cli": "1.0.0",
|
||||
"@verdaccio/e2e-ui": "1.0.0",
|
||||
"@verdaccio/cli-standalone": "6.0.0-alpha.3",
|
||||
"@verdaccio/tarball": "11.0.0-alpha.3",
|
||||
"@verdaccio/url": "11.0.0-alpha.3",
|
||||
"@verdaccio/fastify-migration": "6.0.0-6-next.9",
|
||||
"@verdaccio/server-fastify": "6.0.0-6-next.9",
|
||||
"@verdaccio/eslint-config": "1.0.0",
|
||||
"@verdaccio/benchmark": "1.0.0",
|
||||
"@verdaccio/core": "6.0.0-next.0",
|
||||
"@verdaccio/helper": "1.0.0",
|
||||
"@verdaccio/test-helper": "1.0.0",
|
||||
"docusaurus-plugin-contributors": "1.0.0",
|
||||
"@verdaccio/website": "5.4.0"
|
||||
"@verdaccio/website": "5.4.0",
|
||||
"@verdaccio/test-cli-commons": "1.0.1-6-next.1",
|
||||
"@verdaccio/e2e-cli-npm6": "1.0.1-6-next.1",
|
||||
"@verdaccio/e2e-cli-npm7": "1.0.1-6-next.1",
|
||||
"@verdaccio/e2e-cli-npm8": "1.0.1-6-next.1",
|
||||
"@verdaccio/e2e-cli-pnpm6": "1.0.1-6-next.1",
|
||||
"@verdaccio/e2e-cli-pnpm7": "1.0.1-6-next.1",
|
||||
"@verdaccio/e2e-cli-yarn1": "1.0.1-6-next.1",
|
||||
"@verdaccio/e2e-cli-yarn2": "1.0.1-6-next.1",
|
||||
"@verdaccio/e2e-cli-yarn3": "1.0.1-6-next.1",
|
||||
"@verdaccio/e2e-cli-yarn4": "1.0.1-6-next.1"
|
||||
},
|
||||
"changesets": [
|
||||
"afraid-mice-obey",
|
||||
"angry-nails-appear",
|
||||
"big-lobsters-sin",
|
||||
"bright-poems-obey",
|
||||
"brown-cycles-laugh",
|
||||
"brown-pandas-wink",
|
||||
"calm-pants-impress",
|
||||
"chilled-ways-fetch",
|
||||
"clever-pugs-warn",
|
||||
"dry-planes-tap",
|
||||
"dull-monkeys-search",
|
||||
"eleven-brooms-hunt",
|
||||
"eleven-spoons-matter",
|
||||
"fair-lemons-beam",
|
||||
"famous-tigers-doubt",
|
||||
"few-cooks-destroy",
|
||||
"few-mangos-grow",
|
||||
"fifty-jars-rest",
|
||||
@@ -63,7 +76,9 @@
|
||||
"gentle-parrots-lay",
|
||||
"gentle-trains-switch",
|
||||
"gold-vans-tease",
|
||||
"green-yaks-divide",
|
||||
"healthy-bikes-behave",
|
||||
"healthy-pants-smash",
|
||||
"healthy-poets-compare",
|
||||
"heavy-ravens-lay",
|
||||
"hip-hounds-destroy",
|
||||
@@ -73,11 +88,13 @@
|
||||
"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",
|
||||
@@ -86,23 +103,30 @@
|
||||
"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",
|
||||
"smooth-owls-pump",
|
||||
"sour-buses-shout",
|
||||
"spicy-frogs-press",
|
||||
"spicy-snakes-sip",
|
||||
"strange-ladybugs-nail",
|
||||
"swift-pumpkins-knock",
|
||||
"ten-parents-breathe",
|
||||
"tender-bags-call",
|
||||
"thick-countries-move",
|
||||
"thick-readers-hang",
|
||||
"three-moles-drop",
|
||||
"three-pots-sit",
|
||||
"tiny-seals-join",
|
||||
"tricky-taxis-watch",
|
||||
"two-dolls-check",
|
||||
"wild-jokes-beam"
|
||||
]
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
'verdaccio-htpasswd': patch
|
||||
'@verdaccio/local-storage': patch
|
||||
'@verdaccio/fastify-migration': patch
|
||||
'@verdaccio/server-fastify': patch
|
||||
'@verdaccio/hooks': patch
|
||||
'@verdaccio/mock': patch
|
||||
'@verdaccio/node-api': patch
|
||||
---
|
||||
|
||||
|
||||
42
.changeset/proud-jobs-hope.md
Normal file
42
.changeset/proud-jobs-hope.md
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
'@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': major
|
||||
'@verdaccio/web': 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 }]
|
||||
```
|
||||
@@ -4,7 +4,6 @@
|
||||
'@verdaccio/dev-types': major
|
||||
'@verdaccio/web': major
|
||||
'@verdaccio/e2e-ui': major
|
||||
'@verdaccio/website': major
|
||||
---
|
||||
|
||||
feat: upgrade to material ui 5
|
||||
|
||||
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/smooth-owls-pump.md
Normal file
5
.changeset/smooth-owls-pump.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
---
|
||||
|
||||
ui: basic grammatical fixes in the Ukraine Message
|
||||
@@ -1,9 +1,8 @@
|
||||
---
|
||||
'@verdaccio/fastify-migration': minor
|
||||
'@verdaccio/server-fastify': minor
|
||||
'@verdaccio/store': minor
|
||||
'@verdaccio/utils': minor
|
||||
'@verdaccio/web': minor
|
||||
'@verdaccio/website': minor
|
||||
---
|
||||
|
||||
feat: migrate web sidebar endpoint to fastify
|
||||
|
||||
9
.changeset/strange-ladybugs-nail.md
Normal file
9
.changeset/strange-ladybugs-nail.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
'@verdaccio/types': minor
|
||||
---
|
||||
|
||||
feat: add dist.signatures to core/types
|
||||
|
||||
According to [`npm`](https://docs.npmjs.com/about-registry-signatures): _"Signatures are provided in the package's `packument` in each published version within the `dist` object"_
|
||||
|
||||
Here's an [example of a package version from the public npm registry with `dist.signatures`](https://registry.npmjs.org/light-cycle/1.4.3).
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
'@verdaccio/auth': minor
|
||||
'@verdaccio/fastify-migration': minor
|
||||
'@verdaccio/server-fastify': minor
|
||||
'@verdaccio/web': minor
|
||||
---
|
||||
|
||||
|
||||
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)
|
||||
@@ -14,7 +14,6 @@
|
||||
'@verdaccio/logger': patch
|
||||
'@verdaccio/logger-prettify': patch
|
||||
'@verdaccio/middleware': patch
|
||||
'@verdaccio/mock': patch
|
||||
'@verdaccio/node-api': patch
|
||||
'@verdaccio/proxy': patch
|
||||
'@verdaccio/server': patch
|
||||
|
||||
28
.changeset/tricky-taxis-watch.md
Normal file
28
.changeset/tricky-taxis-watch.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
'@verdaccio/api': minor
|
||||
'@verdaccio/types': minor
|
||||
'@verdaccio/local-storage': minor
|
||||
'@verdaccio/server-fastify': minor
|
||||
'@verdaccio/store': minor
|
||||
'@verdaccio/test-helper': minor
|
||||
'@verdaccio/web': minor
|
||||
---
|
||||
|
||||
feat: implement abbreviated manifest
|
||||
|
||||
Enable abbreviated manifest data by adding the header:
|
||||
|
||||
```
|
||||
curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
|
||||
```
|
||||
|
||||
It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
|
||||
|
||||
Current support for packages managers:
|
||||
|
||||
- npm: yes
|
||||
- pnpm: yes
|
||||
- yarn classic: yes
|
||||
- yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
|
||||
|
||||
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
|
||||
@@ -11,3 +11,6 @@ wiki/
|
||||
dist/
|
||||
docs/
|
||||
test/functional/store/*
|
||||
docker-examples/**/lib/**/*.js
|
||||
test/cli/e2e-yarn4/bin/yarn-4.0.0-rc.14.cjs
|
||||
yarn.js
|
||||
|
||||
55
.github/workflows/benchmark.yml
vendored
55
.github/workflows/benchmark.yml
vendored
@@ -4,23 +4,26 @@ 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
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
name: Prepare build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 14.x
|
||||
node-version: 16.x
|
||||
- name: install pnpm
|
||||
run: sudo npm i pnpm@6.24.1 -g
|
||||
run: sudo npm i pnpm@latest-6 -g
|
||||
- name: set store
|
||||
run: |
|
||||
mkdir ~/.pnpm-store
|
||||
@@ -30,7 +33,7 @@ jobs:
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: Cache .pnpm-store
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -41,7 +44,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@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
path: pkg.tar.gz
|
||||
@@ -57,24 +60,24 @@ jobs:
|
||||
# - local
|
||||
- 3.13.1
|
||||
- 4.12.2
|
||||
- 5.5.2
|
||||
- 6.0.0-6-next.31
|
||||
- 5.10.2
|
||||
- 6.0.0-6-next.40
|
||||
name: Benchmark autocannon
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 14.x
|
||||
- uses: actions/download-artifact@v2
|
||||
node-version: 16.x
|
||||
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # tag=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.24.1 -g
|
||||
- uses: actions/cache@v2
|
||||
run: sudo npm i pnpm@latest-6 -g
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -87,7 +90,7 @@ jobs:
|
||||
shell: bash
|
||||
env:
|
||||
DEBUG: metrics*
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
|
||||
with:
|
||||
name: verdaccio-metrics-api
|
||||
path: ./api-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
@@ -118,24 +121,24 @@ jobs:
|
||||
# old versions to compare same test along previous releases
|
||||
- 3.13.1
|
||||
- 4.12.2
|
||||
- 5.5.2
|
||||
- 6.0.0-6-next.31
|
||||
- 5.10.2
|
||||
- 6.0.0-6-next.40
|
||||
name: Benchmark hyperfine
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 14.x
|
||||
- uses: actions/download-artifact@v2
|
||||
node-version: 16.x
|
||||
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # tag=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.24.1 -g
|
||||
- uses: actions/cache@v2
|
||||
run: sudo npm i pnpm@latest-6 -g
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -153,7 +156,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@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
|
||||
with:
|
||||
name: verdaccio-metrics
|
||||
path: ./hyper-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
|
||||
8
.github/workflows/changesets.yml
vendored
8
.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@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: setup node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 14
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}
|
||||
|
||||
- name: install pnpm
|
||||
run: npm i pnpm@6.10.3 -g
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}
|
||||
|
||||
@@ -63,7 +63,7 @@ jobs:
|
||||
title: 'chore: update versions'
|
||||
publish: pnpm ci:publish
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.CHANGESET_RELEASE_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}
|
||||
NPM_CONFIG_REGISTRY: https://registry.npmjs.org
|
||||
|
||||
76
.github/workflows/ci.yml
vendored
76
.github/workflows/ci.yml
vendored
@@ -2,18 +2,19 @@ name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'changeset-release/master'
|
||||
pull_request:
|
||||
paths:
|
||||
- .changeset/**
|
||||
- .github/workflows/ci.yml
|
||||
- 'packages/**'
|
||||
- 'test/**'
|
||||
- 'docker-examples/**'
|
||||
- 'jest/**'
|
||||
- 'package.json'
|
||||
- 'pnpm-workspace.yaml'
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -24,13 +25,13 @@ jobs:
|
||||
ports:
|
||||
- 4873:4873
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.24.1 -g
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- name: set store
|
||||
run: |
|
||||
mkdir ~/.pnpm-store
|
||||
@@ -38,7 +39,7 @@ jobs:
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
|
||||
- name: Cache .pnpm-store
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -49,14 +50,14 @@ jobs:
|
||||
name: Lint
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.24.1 -g
|
||||
- uses: actions/cache@v2
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -69,14 +70,14 @@ jobs:
|
||||
name: Format
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.24.1 -g
|
||||
- uses: actions/cache@v2
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -90,19 +91,18 @@ jobs:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
## Node 16 breaks UI test, jest issue
|
||||
node_version: [16, 17]
|
||||
node_version: [16, 18]
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.24.1 -g
|
||||
- uses: actions/cache@v2
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -117,18 +117,17 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
name: UI Test E2E Node 16
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.24.1 -g
|
||||
- uses: actions/cache@v2
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=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
|
||||
@@ -139,16 +138,15 @@ jobs:
|
||||
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 14
|
||||
name: CLI Test E2E Node 16
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 14
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.24.1 -g
|
||||
- uses: actions/cache@v2
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -159,21 +157,21 @@ jobs:
|
||||
run: pnpm build
|
||||
- name: Test CLI
|
||||
run: pnpm test:e2e:cli
|
||||
env:
|
||||
DEBUG: verdaccio*
|
||||
# env:
|
||||
# DEBUG: verdaccio*
|
||||
sync-translations:
|
||||
needs: [ci-e2e-cli, 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@v3
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.24.1 -g
|
||||
- uses: actions/cache@v2
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
|
||||
15
.github/workflows/codeql-analysis.yml
vendored
15
.github/workflows/codeql-analysis.yml
vendored
@@ -8,13 +8,20 @@ on:
|
||||
schedule:
|
||||
- cron: '0 2 * * 4'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
permissions:
|
||||
actions: read # for github/codeql-action/init to get workflow details
|
||||
contents: read # for actions/checkout to fetch code
|
||||
security-events: write # for github/codeql-action/autobuild to send a status report
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2.4.0
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
@@ -27,7 +34,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: github/codeql-action/init@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=v2
|
||||
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
# with:
|
||||
@@ -35,7 +42,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
uses: github/codeql-action/autobuild@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=v2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -49,4 +56,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
uses: github/codeql-action/analyze@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=v2
|
||||
|
||||
8
.github/workflows/contributors.yml
vendored
8
.github/workflows/contributors.yml
vendored
@@ -15,15 +15,15 @@ jobs:
|
||||
name: Run script
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 17.x
|
||||
- name: install pnpm
|
||||
run: sudo npm i pnpm@6.24.1 -g
|
||||
run: sudo npm i pnpm@latest-6 -g
|
||||
- name: set store
|
||||
run: |
|
||||
mkdir ~/.pnpm-store
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
- name: format
|
||||
run: pnpm format
|
||||
- name: Commit & Push changes
|
||||
uses: actions-js/push@v1.3
|
||||
uses: actions-js/push@a52398fac807b0c1e5f1492c969b477c8560a0ba # tag=v1.3
|
||||
with:
|
||||
github_token: ${{ secrets.TOKEN_VERDACCIOBOT_GITHUB }}
|
||||
message: "chore: updated contributors list"
|
||||
|
||||
4
.github/workflows/docker-publish.yml
vendored
4
.github/workflows/docker-publish.yml
vendored
@@ -19,8 +19,8 @@ jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
- uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # tag=v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
driver-opts: network=host
|
||||
|
||||
44
.github/workflows/website.yml
vendored
44
.github/workflows/website.yml
vendored
@@ -3,20 +3,12 @@ name: Verdaccio Website CI
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
paths:
|
||||
- 'website/**'
|
||||
- 'package.json'
|
||||
- './.github/workflows/website.yml'
|
||||
- 'website/**'
|
||||
- './.github/workflows/website.yml'
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- 'website/**'
|
||||
- 'package.json'
|
||||
- './.github/workflows/website.yml'
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -24,15 +16,15 @@ jobs:
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
steps:
|
||||
- uses: actions/checkout@v2.4.0
|
||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
|
||||
|
||||
- name: Use Node 14
|
||||
uses: actions/setup-node@v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
|
||||
with:
|
||||
node-version: 14
|
||||
node-version: 16
|
||||
|
||||
- name: Cache pnpm modules
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
env:
|
||||
cache-name: cache-pnpm-modules
|
||||
with:
|
||||
@@ -41,16 +33,16 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
|
||||
|
||||
- uses: pnpm/action-setup@v2.1.0
|
||||
- uses: pnpm/action-setup@10693b3829bf86eb2572aef5f3571dcf5ca9287d # tag=v2.2.2
|
||||
with:
|
||||
version: 6.10.2
|
||||
version: 6.32.15
|
||||
run_install: |
|
||||
- recursive: true
|
||||
args: [--frozen-lockfile]
|
||||
- name: Build Plugins
|
||||
run: pnpm build --filter "docusaurus-plugin-contributors"
|
||||
- name: Cache Docusaurus Build
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
|
||||
with:
|
||||
path: website/node_modules/.cache/webpack
|
||||
key: cache/webpack-${{github.ref}}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
@@ -69,7 +61,7 @@ jobs:
|
||||
|
||||
- name: 🔥 Deploy Production Netlify
|
||||
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
||||
uses: semoal/action-netlify-deploy@master
|
||||
uses: semoal/action-netlify-deploy@1a53f098745bf78555d11b436f5ee3af87e6b566
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
@@ -83,7 +75,8 @@ jobs:
|
||||
run: pnpm netlify:build:deployPreview --filter ...@verdaccio/website
|
||||
|
||||
- name: 🤖 Deploy Preview Netlify
|
||||
uses: semoal/action-netlify-deploy@master
|
||||
if: github.repository == 'verdaccio/verdaccio'
|
||||
uses: semoal/action-netlify-deploy@1a53f098745bf78555d11b436f5ee3af87e6b566
|
||||
id: netlify_preview
|
||||
with:
|
||||
draft: true
|
||||
@@ -96,8 +89,9 @@ jobs:
|
||||
build-dir: './website/build'
|
||||
|
||||
- name: Audit preview URL with Lighthouse
|
||||
if: github.repository == 'verdaccio/verdaccio'
|
||||
id: lighthouse_audit
|
||||
uses: treosh/lighthouse-ci-action@v9.3.0
|
||||
uses: treosh/lighthouse-ci-action@b4dfae3eb959c5226e2c5c6afd563d493188bfaf # tag=9.3.0
|
||||
with:
|
||||
urls: |
|
||||
${{ steps.netlify_preview.outputs.preview-url }}
|
||||
@@ -106,7 +100,7 @@ jobs:
|
||||
|
||||
- name: Format lighthouse score
|
||||
id: format_lighthouse_score
|
||||
uses: actions/github-script@v3
|
||||
uses: actions/github-script@d50f485531ba88479582bc2da03ff424389af5c1 # tag=v6
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
@@ -129,11 +123,13 @@ jobs:
|
||||
core.setOutput("comment", comment);
|
||||
|
||||
- name: Add comment to PR
|
||||
if: github.repository == 'verdaccio/verdaccio'
|
||||
id: comment_to_pr
|
||||
uses: marocchino/sticky-pull-request-comment@v1
|
||||
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 # tag=v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
number: ${{ github.event.issue.number }}
|
||||
delete: true
|
||||
header: lighthouse
|
||||
message: |
|
||||
${{ steps.format_lighthouse_score.outputs.comment }}
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -46,7 +46,8 @@ api-results.json
|
||||
hyper-results.json
|
||||
hyper-results*.json
|
||||
api-results*.json
|
||||
.clinic/
|
||||
|
||||
#docs
|
||||
./api
|
||||
packages/core/core/docs
|
||||
**/docs/**
|
||||
|
||||
@@ -31,3 +31,5 @@ api/**
|
||||
packages/core/local-storage/tests/__fixtures__/test-storage/
|
||||
packages/plugins/ui-theme/static/
|
||||
.verdaccio-db.json
|
||||
test/cli/e2e-yarn4/bin/yarn-4.0.0-rc.14.cjs
|
||||
yarn.js
|
||||
|
||||
78
.vscode/launch.json
vendored
78
.vscode/launch.json
vendored
@@ -4,88 +4,12 @@
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
"name": "Attach",
|
||||
"port": 9229,
|
||||
"request": "attach",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"type": "pwa-node"
|
||||
},
|
||||
{
|
||||
"name": "Verdaccio Debug",
|
||||
"name": "Attach",
|
||||
"port": 9229,
|
||||
"request": "attach",
|
||||
"skipFiles": ["<node_internals>/**"],
|
||||
"type": "pwa-node"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "CLI Babel Registry",
|
||||
"stopOnEntry": false,
|
||||
"program": "${workspaceFolder}/debug/bootstrap.js",
|
||||
"args": ["-l", "0.0.0.0:4873"],
|
||||
"env": {
|
||||
"BABEL_ENV": "registry"
|
||||
},
|
||||
"preLaunchTask": "npm: build:webui",
|
||||
"console": "integratedTerminal"
|
||||
},
|
||||
{
|
||||
"name": "Unit Tests",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/node_modules/bin/jest",
|
||||
"stopOnEntry": false,
|
||||
"args": ["--debug=true"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"runtimeExecutable": null,
|
||||
"runtimeArgs": ["--nolazy"],
|
||||
"env": {
|
||||
"NODE_ENV": "test",
|
||||
"TZ": "UTC"
|
||||
},
|
||||
"console": "integratedTerminal"
|
||||
},
|
||||
{
|
||||
"name": "Functional Tests",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/node_modules/.bin/jest",
|
||||
"stopOnEntry": false,
|
||||
"args": [
|
||||
"--config",
|
||||
"./test/jest.config.functional.js",
|
||||
"--testPathPattern",
|
||||
"./test/functional/index*",
|
||||
"--debug=false",
|
||||
"--verbose",
|
||||
"--useStderr",
|
||||
"--detectOpenHandles"
|
||||
],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"env": {
|
||||
"BABEL_ENV": "testOldEnv",
|
||||
"VERDACCIO_DEBUG": "true",
|
||||
"VERDACCIO_DEBUG_INJECT": "true",
|
||||
"NODE_DEBUG": "TO_DEBUG_REQUEST_REMOVE_THIS_request"
|
||||
},
|
||||
"preLaunchTask": "pre-test",
|
||||
"console": "integratedTerminal",
|
||||
"runtimeExecutable": null,
|
||||
"runtimeArgs": ["--nolazy"]
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Verdaccio Compiled",
|
||||
"preLaunchTask": "npm: code:build",
|
||||
"program": "${workspaceRoot}/bin/verdaccio",
|
||||
"args": ["-l", "0.0.0.0:4873"],
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
21
.vscode/tasks.json
vendored
21
.vscode/tasks.json
vendored
@@ -1,21 +0,0 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "build:webui",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "code:build",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "pre-test",
|
||||
"dependsOn": ["npm: code:build", "npm: test:clean"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -70,7 +70,7 @@ This setting would cause the `pnpm install` command to install incorrect version
|
||||
To begin your development setup, please install the latest version of pnpm globally:
|
||||
|
||||
```
|
||||
npm i -g pnpm
|
||||
npm i -g pnpm@latest-6
|
||||
```
|
||||
|
||||
With pnpm installed, the first step is installing all dependencies:
|
||||
@@ -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.
|
||||
@@ -280,7 +278,7 @@ clean git history.
|
||||
#### Before Commit
|
||||
|
||||
Before committing, **you must ensure there are no linting errors and
|
||||
all tests pass.** To do this, run these commands before create the PR:
|
||||
all tests pass.** To do this, run these commands before creating the PR:
|
||||
|
||||
```bash
|
||||
pnpm lint
|
||||
@@ -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,17 +1,17 @@
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:16.13.2-alpine as builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:16-alpine as builder
|
||||
|
||||
ENV NODE_ENV=development \
|
||||
VERDACCIO_BUILD_REGISTRY=https://registry.verdaccio.org
|
||||
|
||||
RUN apk --no-cache add openssl ca-certificates wget && \
|
||||
apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python2 && \
|
||||
apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python3 && \
|
||||
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
|
||||
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \
|
||||
apk add glibc-2.25-r0.apk
|
||||
|
||||
WORKDIR /opt/verdaccio-build
|
||||
COPY . .
|
||||
RUN npm -g i pnpm@6.24.1 && \
|
||||
RUN npm -g i pnpm@6.32.15 && \
|
||||
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.24.1 && \
|
||||
# FIXME: need to remove devDependencies from the build
|
||||
# RUN pnpm install --prod --ignore-scripts
|
||||
|
||||
FROM node:16.13.2-alpine
|
||||
FROM node:16-alpine
|
||||
LABEL maintainer="https://github.com/verdaccio/verdaccio"
|
||||
|
||||
ENV VERDACCIO_APPDIR=/opt/verdaccio \
|
||||
|
||||
69
README.md
69
README.md
@@ -1,10 +1,19 @@
|
||||
[](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 version? Check the branch `5.x`
|
||||
> The plugins for the `v5.x` that are hosted within this organization are located
|
||||
> at the [`verdaccio/monorepo`](https://github.com/verdaccio/monorepo) repository, while for the v6.x
|
||||
> are hosted on this project `./packages/plugins`, keep on mind `v6.x` plugins will eventually would be
|
||||
> incompatible with `v5.x` versions.
|
||||
> Note that contributing guidelines might be different based on the branch.
|
||||
|
||||
[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,6 +35,7 @@ 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
|
||||
|
||||
@@ -34,7 +44,19 @@ Google Cloud Storage** or create your own plugin.
|
||||
Install with npm:
|
||||
|
||||
```bash
|
||||
npm install --global verdaccio@6-next
|
||||
npm install --location=global verdaccio@6-next
|
||||
```
|
||||
|
||||
With `yarn`
|
||||
|
||||
```bash
|
||||
yarn global add verdaccio@6-next
|
||||
```
|
||||
|
||||
With `pnpm`
|
||||
|
||||
```bash
|
||||
pnpm i -g verdaccio@6-next
|
||||
```
|
||||
|
||||
or
|
||||
@@ -43,6 +65,27 @@ or
|
||||
docker pull verdaccio/verdaccio:nightly-master
|
||||
```
|
||||
|
||||
or with _helm_ [official chart](https://github.com/verdaccio/charts).
|
||||
|
||||
```bash
|
||||
helm repo add verdaccio https://charts.verdaccio.org
|
||||
helm repo update
|
||||
helm install verdaccio/verdaccio
|
||||
```
|
||||
|
||||
Furthermore, you can read the [**Debugging Guidelines**](https://github.com/verdaccio/verdaccio/wiki/Debugging-Verdaccio) and the [**Docker Examples**](https://github.com/verdaccio/verdaccio/tree/master/docker-examples) for more advanced development.
|
||||
|
||||
## Plugins
|
||||
|
||||
You can develop your own [plugins](https://verdaccio.org/docs/plugins) with the [verdaccio generator](https://github.com/verdaccio/generator-verdaccio-plugin). Installing [Yeoman](https://yeoman.io/) is required.
|
||||
|
||||
```
|
||||
npm install --location=global yo
|
||||
npm install --location=global generator-verdaccio-plugin
|
||||
```
|
||||
|
||||
Learn more [here](https://verdaccio.org/docs/dev-plugins) how to develop plugins. Share your plugins with the community.
|
||||
|
||||
## 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 do a long support donation - **and your logo will be on this section of the readme.**
|
||||
@@ -71,24 +114,27 @@ If you want to use a modified version of some 3rd-party package (for example, yo
|
||||
### E2E Testing
|
||||
|
||||
Verdaccio has proved to be a lightweight registry that can be
|
||||
booted in a couple of seconds, fast enough for any CI. Many open source projects use verdaccio for end to end testing, to mention some examples, **create-react-app**, **mozilla neutrino**, **pnpm**, **storybook**, **alfresco** or **eclipse theia**. You can read more in dedicated article to E2E in our blog.
|
||||
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**, **babel.js**, **angular-cli** or **docusaurus**. You can read more in [here](https://verdaccio.org/docs/e2e).
|
||||
|
||||
Furthermore, here few examples how to start:
|
||||
|
||||
- [e2e-ci-example-gh-actions](https://github.com/juanpicado/e2e-ci-example-gh-actions)
|
||||
- [verdaccio-end-to-end-tests](https://github.com/juanpicado/verdaccio-end-to-end-tests)
|
||||
- [verdaccio-fork](https://github.com/juanpicado/verdaccio-fork)
|
||||
|
||||
## Watch our Videos
|
||||
|
||||
**Node Congress 2022, February 2022, Online Free**
|
||||
|
||||
<div>
|
||||
<a href="https://nodecongress.com/">
|
||||
<img src="https://cdn.verdaccio.dev/readme/nodejscongress2022.jpg" alt="nodejs" width="300"/>
|
||||
<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="200"/>
|
||||
</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:
|
||||
|
||||
- [Using Docker and Verdaccio to make Integration Testing Easy - **Docker All Hands #4 December - 2021**](https://www.youtube.com/watch?v=zRI0skF1f8I)
|
||||
- [**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)
|
||||
@@ -163,7 +209,7 @@ To run the docker container:
|
||||
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio
|
||||
```
|
||||
|
||||
Docker examples are available [in this repository](https://github.com/verdaccio/docker-examples).
|
||||
Docker examples are available [in this repository](https://github.com/verdaccio/verdaccio/tree/master/docker-examples).
|
||||
|
||||
## Compatibility
|
||||
|
||||
@@ -231,6 +277,7 @@ You can find and chat with then over Discord, click [here](http://chat.verdaccio
|
||||
- [create-react-app](https://github.com/facebook/create-react-app/blob/master/CONTRIBUTING.md#customizing-e2e-registry-configuration) _(+86.2k ⭐️)_
|
||||
- [Gatsby](https://github.com/gatsbyjs/gatsby) _(+49.2k ⭐️)_
|
||||
- [Babel.js](https://github.com/babel/babel) _(+38.5k ⭐️)_
|
||||
- [Docusaurus](https://github.com/facebook/docusaurus) _(+34k ⭐️)_
|
||||
- [Vue CLI](https://github.com/vuejs/vue-cli) _(+27.4k ⭐️)_
|
||||
- [Angular CLI](https://github.com/angular/angular-cli) _(+24.3k ⭐️)_
|
||||
- [Uppy](https://github.com/transloadit/uppy) _(+23.8k ⭐️)_
|
||||
@@ -245,7 +292,7 @@ You can find and chat with then over Discord, click [here](http://chat.verdaccio
|
||||
- [Amazon SDK v3](https://github.com/aws/aws-sdk-js-v3)
|
||||
- [Amazon Encryption SDK for Javascript](https://github.com/aws/aws-encryption-sdk-javascript)
|
||||
|
||||
🤓 Don't be shy, you also can be in [the list](https://github.com/verdaccio/website/blob/master/docs/who-is-using.md).
|
||||
🤓 Don't be shy, add yourself to this readme.
|
||||
|
||||
## Open Collective Sponsors
|
||||
|
||||
|
||||
@@ -3,3 +3,12 @@
|
||||
> Before run examples, build the local image by running `pnpm docker`.
|
||||
|
||||
- [Docker + Nginx + Verdaccio](reverse_proxy/nginx/README.md)
|
||||
|
||||
## Using Plugins with Docker
|
||||
|
||||
List of different approaches
|
||||
|
||||
> Note these options could be improved, feel free to submit upgrades
|
||||
|
||||
- [Docker + Install plugins from a registry](plugins/docker-build-install-plugin/README.md)
|
||||
- [Docker + Install local plugin](plugins/docker-local-plugin/README.md)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# Docs based on https://github.com/xlts-dev/verdaccio-prometheus-middleware#installation
|
||||
|
||||
# Docker multi-stage build - https://docs.docker.com/develop/develop-images/multistage-build/
|
||||
# Use an alpine node image to install the plugin
|
||||
FROM node:lts-alpine as builder
|
||||
|
||||
# Install the metrics middleware plugin
|
||||
# npm docs
|
||||
# --global-style https://docs.npmjs.com/cli/v7/commands/npm-install#global-style
|
||||
# --no-bin-links https://docs.npmjs.com/cli/v7/commands/npm-install#bin-links
|
||||
# --omit=optional
|
||||
RUN mkdir -p /verdaccio/plugins \
|
||||
&& cd /verdaccio/plugins \
|
||||
&& npm install --global-style --no-bin-links --omit=optional verdaccio-auth-memory@latest
|
||||
|
||||
# The final built image will be based on the standard Verdaccio docker image.
|
||||
FROM verdaccio/verdaccio:5
|
||||
|
||||
# Copy the plugin files over from the 'builder' node image.
|
||||
# The `$VERDACCIO_USER_UID` env variable is defined in the base `verdaccio/verdaccio` image.
|
||||
# Refer to: https://github.com/verdaccio/verdaccio/blob/v5.2.0/Dockerfile#L32
|
||||
ADD docker.yaml /verdaccio/conf/config.yaml
|
||||
COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
|
||||
/verdaccio/plugins/node_modules/verdaccio-auth-memory \
|
||||
/verdaccio/plugins/verdaccio-auth-memory
|
||||
@@ -0,0 +1,46 @@
|
||||
# Installing a plugin with Docker build
|
||||
|
||||
On this small tutorial (based on [`verdaccio-prometheus-middleware`](https://github.com/xlts-dev/verdaccio-prometheus-middleware) example) you will be able to use a published package in any random registry (npmjs by default) and use it withing a docker image without mapping need it.
|
||||
|
||||
> Since verdaccio:5 uses `yarn@2` to run the application, this tutorial is a workaround but future prove since verdaccio 6 uses `pnpm` to build the docker image.
|
||||
|
||||
There are two main steps to highlight:
|
||||
|
||||
- `docker.yaml`: This is a copy of the original configuration file for docker and with small modifications to use the plugin [`verdaccio-auth-memory`](https://www.npmjs.com/package/verdaccio-auth-memory) and custom web title for demonstration.
|
||||
- The `Dockerfile` take advance of the docker multi-stage build to install the plugin into the `verdaccio/plugins` folder withing the image, then we apply the right permissions `--chown=$VERDACCIO_USER_UID:root` so the plugin is recognized.
|
||||
|
||||
## Run it
|
||||
|
||||
Build this image.
|
||||
|
||||
```bash
|
||||
docker build -t verdaccio/verdaccio:local .
|
||||
```
|
||||
|
||||
and to run it
|
||||
|
||||
```bash
|
||||
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio:local
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```dockerfile
|
||||
# Docker multi-stage build - https://docs.docker.com/develop/develop-images/multistage-build/
|
||||
# Use an alpine node image to install the plugin
|
||||
FROM node:lts-alpine as builder
|
||||
|
||||
RUN mkdir -p /verdaccio/plugins \
|
||||
&& cd /verdaccio/plugins \
|
||||
&& npm install --global-style --no-bin-links --omit=optional verdaccio-auth-memory@latest
|
||||
|
||||
FROM verdaccio/verdaccio:5
|
||||
|
||||
# copy your modified config.yaml into the image
|
||||
ADD docker.yaml /verdaccio/conf/config.yaml
|
||||
|
||||
COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
|
||||
/verdaccio/plugins/node_modules/verdaccio-auth-memory \
|
||||
/verdaccio/plugins/verdaccio-auth-memory
|
||||
|
||||
```
|
||||
@@ -0,0 +1,197 @@
|
||||
#
|
||||
# This is the default configuration file. It allows all users to do anything,
|
||||
# please read carefully the documentation and best practices to
|
||||
# improve security.
|
||||
#
|
||||
# Do not configure host and port under `listen` in this file
|
||||
# as it will be ignored when using docker.
|
||||
# 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/5.x/conf
|
||||
#
|
||||
# Read about the best practices
|
||||
# https://verdaccio.org/docs/best
|
||||
|
||||
# path to a directory with all packages
|
||||
storage: /verdaccio/storage/data
|
||||
# path to a directory with plugins to include
|
||||
plugins: /verdaccio/plugins
|
||||
|
||||
# https://verdaccio.org/docs/webui
|
||||
web:
|
||||
title: Verdaccio Publish Config Test
|
||||
# comment out to disable gravatar support
|
||||
# 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/
|
||||
|
||||
# https://verdaccio.org/docs/configuration#authentication
|
||||
auth:
|
||||
auth-memory:
|
||||
users:
|
||||
foo:
|
||||
name: foo
|
||||
password: s3cret
|
||||
bar:
|
||||
name: bar
|
||||
password: s3cret
|
||||
|
||||
# https://verdaccio.org/docs/configuration#uplinks
|
||||
# a list of other known repositories we can talk to
|
||||
uplinks:
|
||||
npmjs:
|
||||
url: https://registry.npmjs.org/
|
||||
|
||||
# Learn how to protect your packages
|
||||
# https://verdaccio.org/docs/protect-your-dependencies/
|
||||
# https://verdaccio.org/docs/configuration#packages
|
||||
packages:
|
||||
'@*/*':
|
||||
# scoped packages
|
||||
access: $all
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
proxy: npmjs
|
||||
|
||||
'**':
|
||||
# allow all users (including non-authenticated users) to read and
|
||||
# publish all packages
|
||||
#
|
||||
# you can specify usernames/groupnames (depending on your auth plugin)
|
||||
# and three keywords: "$all", "$anonymous", "$authenticated"
|
||||
access: $all
|
||||
|
||||
# allow all known users to publish/publish packages
|
||||
# (anyone can register by default, remember?)
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
|
||||
# if package is not available locally, proxy requests to 'npmjs' registry
|
||||
proxy: npmjs
|
||||
|
||||
# To improve your security configuration and avoid dependency confusion
|
||||
# consider removing the proxy property for private packages
|
||||
# https://verdaccio.org/docs/best#remove-proxy-to-increase-security-at-private-packages
|
||||
|
||||
# https://verdaccio.org/docs/configuration#server
|
||||
# You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections.
|
||||
# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout.
|
||||
# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
|
||||
server:
|
||||
keepAliveTimeout: 60
|
||||
|
||||
# https://verdaccio.org/docs/configuration#offline-publish
|
||||
# publish:
|
||||
# allow_offline: false
|
||||
|
||||
# https://verdaccio.org/docs/configuration#url-prefix
|
||||
# url_prefix: /verdaccio/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org';
|
||||
# url_prefix: '/my_prefix'
|
||||
# // url -> https://somedomain.org/my_prefix/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org';
|
||||
# url_prefix: '/'
|
||||
# // url -> https://somedomain.org/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org/first_prefix';
|
||||
# url_prefix: '/second_prefix'
|
||||
# // url -> https://somedomain.org/second_prefix/'
|
||||
|
||||
# https://verdaccio.org/docs/configuration#security
|
||||
# security:
|
||||
# api:
|
||||
# legacy: true
|
||||
# jwt:
|
||||
# sign:
|
||||
# expiresIn: 29d
|
||||
# verify:
|
||||
# someProp: [value]
|
||||
# web:
|
||||
# sign:
|
||||
# expiresIn: 1h # 1 hour by default
|
||||
# verify:
|
||||
# someProp: [value]
|
||||
|
||||
# https://verdaccio.org/docs/configuration#user-rate-limit
|
||||
# userRateLimit:
|
||||
# windowMs: 50000
|
||||
# max: 1000
|
||||
|
||||
# https://verdaccio.org/docs/configuration#max-body-size
|
||||
# max_body_size: 10mb
|
||||
|
||||
# https://verdaccio.org/docs/configuration#listen-port
|
||||
# listen:
|
||||
# - localhost:4873 # default value
|
||||
# - http://localhost:4873 # same thing
|
||||
# - 0.0.0.0:4873 # listen on all addresses (INADDR_ANY)
|
||||
# - https://example.org:4873 # if you want to use https
|
||||
# - "[::1]:4873" # ipv6
|
||||
# - unix:/tmp/verdaccio.sock # unix socket
|
||||
|
||||
# The HTTPS configuration is useful if you do not consider use a HTTP Proxy
|
||||
# https://verdaccio.org/docs/configuration#https
|
||||
# https:
|
||||
# key: ./path/verdaccio-key.pem
|
||||
# cert: ./path/verdaccio-cert.pem
|
||||
# ca: ./path/verdaccio-csr.pem
|
||||
|
||||
# https://verdaccio.org/docs/configuration#proxy
|
||||
# http_proxy: http://something.local/
|
||||
# https_proxy: https://something.local/
|
||||
|
||||
# https://verdaccio.org/docs/configuration#notifications
|
||||
# notify:
|
||||
# method: POST
|
||||
# headers: [{ "Content-Type": "application/json" }]
|
||||
# endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken
|
||||
# content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}'
|
||||
|
||||
middlewares:
|
||||
audit:
|
||||
enabled: true
|
||||
|
||||
# https://verdaccio.org/docs/logger
|
||||
# log settings
|
||||
logs: { type: stdout, format: pretty, level: http }
|
||||
#experiments:
|
||||
# # support for npm token command
|
||||
# token: false
|
||||
# # enable tarball URL redirect for hosting tarball with a different server, the tarball_url_redirect can be a template string
|
||||
# tarball_url_redirect: 'https://mycdn.com/verdaccio/${packageName}/${filename}'
|
||||
# # the tarball_url_redirect can be a function, takes packageName and filename and returns the url, when working with a js configuration file
|
||||
# tarball_url_redirect(packageName, filename) {
|
||||
# const signedUrl = // generate a signed url
|
||||
# return signedUrl;
|
||||
# }
|
||||
|
||||
# translate your registry, api i18n not available yet
|
||||
# i18n:
|
||||
# list of the available translations https://github.com/verdaccio/verdaccio/blob/master/packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.md
|
||||
# web: en-US
|
||||
26
docker-examples/v5/plugins/docker-local-plugin/Dockerfile
Normal file
26
docker-examples/v5/plugins/docker-local-plugin/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
# Docs based on https://github.com/xlts-dev/verdaccio-prometheus-middleware#installation
|
||||
# Docker multi-stage build - https://docs.docker.com/develop/develop-images/multistage-build/
|
||||
# Use an alpine node image to install the plugin
|
||||
FROM node:lts-alpine as builder
|
||||
|
||||
RUN mkdir -p /verdaccio/plugins
|
||||
|
||||
# Copy the local plugin into the docker image
|
||||
ADD plugins/verdaccio-docker-memory /verdaccio/plugins/verdaccio-docker-memory
|
||||
# Install the production dependencies (be careful install devDependencies here)
|
||||
RUN cd /verdaccio/plugins/verdaccio-docker-memory \
|
||||
&& npm install --production
|
||||
|
||||
# The final built image will be based on the standard Verdaccio docker image.
|
||||
FROM verdaccio/verdaccio:5
|
||||
|
||||
# Copy the plugin files over from the 'builder' node image.
|
||||
# The `$VERDACCIO_USER_UID` env variable is defined in the base `verdaccio/verdaccio` image.
|
||||
# Refer to: https://github.com/verdaccio/verdaccio/blob/v5.2.0/Dockerfile#L32
|
||||
# The local verdaccio-docker-memory is setup as storage
|
||||
ADD docker.yaml /verdaccio/conf/config.yaml
|
||||
|
||||
# Copy the plugin into the /verdaccio/plugins
|
||||
COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
|
||||
/verdaccio/plugins/verdaccio-docker-memory \
|
||||
/verdaccio/plugins/verdaccio-docker-memory
|
||||
42
docker-examples/v5/plugins/docker-local-plugin/README.md
Normal file
42
docker-examples/v5/plugins/docker-local-plugin/README.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Installing a local plugin with Docker build
|
||||
|
||||
On this small tutorial (based on [`verdaccio-prometheus-middleware`](https://github.com/xlts-dev/verdaccio-prometheus-middleware) example) you will be able to use a published package in any random registry (npmjs by default) and use it withing a docker image without mapping need it.
|
||||
|
||||
> Since verdaccio:5 uses `yarn@2` to run the application, this tutorial is a workaround but future prove since verdaccio 6 uses `pnpm` to build the docker image.
|
||||
|
||||
There are three main steps to highlight:
|
||||
|
||||
- Note the custom plugin at `plugins/verdaccio-docker-memory` under the name `verdaccio-docker-memory`.
|
||||
- Install the _production_ dependencies for the plugin `verdaccio-docker-memory`
|
||||
- `docker.yaml`: This is a copy of the original configuration file for docker and with small modifications to use the local plugin `verdaccio-docker-memory`.
|
||||
- The `Dockerfile` take advance of the docker multi-stage build to copy the local plugin into the `verdaccio/plugins` folder withing the image, then we apply the right permissions `--chown=$VERDACCIO_USER_UID:root` so the plugin is recognized.
|
||||
|
||||
## Run it
|
||||
|
||||
Build this image.
|
||||
|
||||
```bash
|
||||
docker build -t verdaccio/verdaccio:local .
|
||||
```
|
||||
|
||||
and to run it
|
||||
|
||||
```bash
|
||||
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio:local
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```dockerfile
|
||||
FROM node:lts-alpine as builder
|
||||
RUN mkdir -p /verdaccio/plugins
|
||||
ADD plugins/verdaccio-docker-memory /verdaccio/plugins/verdaccio-docker-memory
|
||||
RUN cd /verdaccio/plugins/verdaccio-docker-memory \
|
||||
&& ls -ls \
|
||||
&& npm install --production
|
||||
FROM verdaccio/verdaccio:5
|
||||
ADD docker.yaml /verdaccio/conf/config.yaml
|
||||
COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
|
||||
/verdaccio/plugins/verdaccio-docker-memory \
|
||||
/verdaccio/plugins/verdaccio-docker-memory
|
||||
```
|
||||
199
docker-examples/v5/plugins/docker-local-plugin/docker.yaml
Normal file
199
docker-examples/v5/plugins/docker-local-plugin/docker.yaml
Normal file
@@ -0,0 +1,199 @@
|
||||
#
|
||||
# This is the default configuration file. It allows all users to do anything,
|
||||
# please read carefully the documentation and best practices to
|
||||
# improve security.
|
||||
#
|
||||
# Do not configure host and port under `listen` in this file
|
||||
# as it will be ignored when using docker.
|
||||
# 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/5.x/conf
|
||||
#
|
||||
# Read about the best practices
|
||||
# https://verdaccio.org/docs/best
|
||||
|
||||
# path to a directory with all packages
|
||||
storage: /verdaccio/storage/data
|
||||
|
||||
store:
|
||||
# dummy copy of https://www.npmjs.com/package/verdaccio-memory
|
||||
docker-memory:
|
||||
limit: 1000
|
||||
|
||||
# path to a directory with plugins to include
|
||||
plugins: /verdaccio/plugins
|
||||
|
||||
# https://verdaccio.org/docs/webui
|
||||
web:
|
||||
title: Verdaccio This is a Test
|
||||
# comment out to disable gravatar support
|
||||
# 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/
|
||||
|
||||
auth:
|
||||
htpasswd:
|
||||
file: ./htpasswd
|
||||
# Maximum amount of users allowed to register, defaults to "+inf".
|
||||
# You can set this to -1 to disable registration.
|
||||
# max_users: 1000
|
||||
|
||||
# https://verdaccio.org/docs/configuration#uplinks
|
||||
# a list of other known repositories we can talk to
|
||||
uplinks:
|
||||
npmjs:
|
||||
url: https://registry.npmjs.org/
|
||||
|
||||
# Learn how to protect your packages
|
||||
# https://verdaccio.org/docs/protect-your-dependencies/
|
||||
# https://verdaccio.org/docs/configuration#packages
|
||||
packages:
|
||||
'@*/*':
|
||||
# scoped packages
|
||||
access: $all
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
proxy: npmjs
|
||||
|
||||
'**':
|
||||
# allow all users (including non-authenticated users) to read and
|
||||
# publish all packages
|
||||
#
|
||||
# you can specify usernames/groupnames (depending on your auth plugin)
|
||||
# and three keywords: "$all", "$anonymous", "$authenticated"
|
||||
access: $all
|
||||
|
||||
# allow all known users to publish/publish packages
|
||||
# (anyone can register by default, remember?)
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
|
||||
# if package is not available locally, proxy requests to 'npmjs' registry
|
||||
proxy: npmjs
|
||||
|
||||
# To improve your security configuration and avoid dependency confusion
|
||||
# consider removing the proxy property for private packages
|
||||
# https://verdaccio.org/docs/best#remove-proxy-to-increase-security-at-private-packages
|
||||
|
||||
# https://verdaccio.org/docs/configuration#server
|
||||
# You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections.
|
||||
# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout.
|
||||
# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
|
||||
server:
|
||||
keepAliveTimeout: 60
|
||||
|
||||
# https://verdaccio.org/docs/configuration#offline-publish
|
||||
# publish:
|
||||
# allow_offline: false
|
||||
|
||||
# https://verdaccio.org/docs/configuration#url-prefix
|
||||
# url_prefix: /verdaccio/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org';
|
||||
# url_prefix: '/my_prefix'
|
||||
# // url -> https://somedomain.org/my_prefix/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org';
|
||||
# url_prefix: '/'
|
||||
# // url -> https://somedomain.org/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org/first_prefix';
|
||||
# url_prefix: '/second_prefix'
|
||||
# // url -> https://somedomain.org/second_prefix/'
|
||||
|
||||
# https://verdaccio.org/docs/configuration#security
|
||||
# security:
|
||||
# api:
|
||||
# legacy: true
|
||||
# jwt:
|
||||
# sign:
|
||||
# expiresIn: 29d
|
||||
# verify:
|
||||
# someProp: [value]
|
||||
# web:
|
||||
# sign:
|
||||
# expiresIn: 1h # 1 hour by default
|
||||
# verify:
|
||||
# someProp: [value]
|
||||
|
||||
# https://verdaccio.org/docs/configuration#user-rate-limit
|
||||
# userRateLimit:
|
||||
# windowMs: 50000
|
||||
# max: 1000
|
||||
|
||||
# https://verdaccio.org/docs/configuration#max-body-size
|
||||
# max_body_size: 10mb
|
||||
|
||||
# https://verdaccio.org/docs/configuration#listen-port
|
||||
# listen:
|
||||
# - localhost:4873 # default value
|
||||
# - http://localhost:4873 # same thing
|
||||
# - 0.0.0.0:4873 # listen on all addresses (INADDR_ANY)
|
||||
# - https://example.org:4873 # if you want to use https
|
||||
# - "[::1]:4873" # ipv6
|
||||
# - unix:/tmp/verdaccio.sock # unix socket
|
||||
|
||||
# The HTTPS configuration is useful if you do not consider use a HTTP Proxy
|
||||
# https://verdaccio.org/docs/configuration#https
|
||||
# https:
|
||||
# key: ./path/verdaccio-key.pem
|
||||
# cert: ./path/verdaccio-cert.pem
|
||||
# ca: ./path/verdaccio-csr.pem
|
||||
|
||||
# https://verdaccio.org/docs/configuration#proxy
|
||||
# http_proxy: http://something.local/
|
||||
# https_proxy: https://something.local/
|
||||
|
||||
# https://verdaccio.org/docs/configuration#notifications
|
||||
# notify:
|
||||
# method: POST
|
||||
# headers: [{ "Content-Type": "application/json" }]
|
||||
# endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken
|
||||
# content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}'
|
||||
|
||||
middlewares:
|
||||
audit:
|
||||
enabled: true
|
||||
|
||||
# https://verdaccio.org/docs/logger
|
||||
# log settings
|
||||
logs: { type: stdout, format: pretty, level: http }
|
||||
#experiments:
|
||||
# # support for npm token command
|
||||
# token: false
|
||||
# # enable tarball URL redirect for hosting tarball with a different server, the tarball_url_redirect can be a template string
|
||||
# tarball_url_redirect: 'https://mycdn.com/verdaccio/${packageName}/${filename}'
|
||||
# # the tarball_url_redirect can be a function, takes packageName and filename and returns the url, when working with a js configuration file
|
||||
# tarball_url_redirect(packageName, filename) {
|
||||
# const signedUrl = // generate a signed url
|
||||
# return signedUrl;
|
||||
# }
|
||||
|
||||
# translate your registry, api i18n not available yet
|
||||
# i18n:
|
||||
# list of the available translations https://github.com/verdaccio/verdaccio/blob/master/packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.md
|
||||
# web: en-US
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"rules": {
|
||||
"max-len": 0,
|
||||
"@typescript-eslint/prefer-optional-chain": 0,
|
||||
"@typescript-eslint/no-unused-vars": 0,
|
||||
"@typescript-eslint/explicit-member-accessibility": 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true,
|
||||
});
|
||||
exports.LocalMemory = undefined;
|
||||
|
||||
let _localMemory = require('./local-memory');
|
||||
|
||||
let _localMemory2 = _interopRequireDefault(_localMemory);
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : { default: obj };
|
||||
}
|
||||
|
||||
exports.LocalMemory = _localMemory2.default;
|
||||
exports.default = _localMemory2.default;
|
||||
@@ -0,0 +1,96 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true,
|
||||
});
|
||||
|
||||
let _memoryHandler = require('./memory-handler');
|
||||
|
||||
let _memoryHandler2 = _interopRequireDefault(_memoryHandler);
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : { default: obj };
|
||||
}
|
||||
|
||||
const DEFAULT_LIMIT = 1000;
|
||||
|
||||
class LocalMemory {
|
||||
constructor(config, options) {
|
||||
this.config = config;
|
||||
this.limit = config.limit || DEFAULT_LIMIT;
|
||||
this.logger = options.logger;
|
||||
this.data = this._createEmtpyDatabase();
|
||||
}
|
||||
|
||||
getSecret() {
|
||||
return Promise.resolve(this.data.secret);
|
||||
}
|
||||
|
||||
setSecret(secret) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.data.secret = secret;
|
||||
resolve(null);
|
||||
});
|
||||
}
|
||||
|
||||
add(name, cb) {
|
||||
const list = this.data.list;
|
||||
|
||||
if (list.length < this.limit) {
|
||||
if (list.indexOf(name) === -1) {
|
||||
list.push(name);
|
||||
}
|
||||
cb(null);
|
||||
} else {
|
||||
this.logger.info(
|
||||
{ limit: this.limit },
|
||||
'Storage memory has reached limit of @{limit} packages'
|
||||
);
|
||||
cb(new Error('Storage memory has reached limit of limit packages'));
|
||||
}
|
||||
}
|
||||
|
||||
search(onPackage, onEnd, validateName) {
|
||||
// TODO: pending to implement
|
||||
onEnd();
|
||||
}
|
||||
|
||||
remove(name, cb) {
|
||||
const list = this.data.list;
|
||||
|
||||
const item = list.indexOf(name);
|
||||
|
||||
if (item !== -1) {
|
||||
list.splice(item, 1);
|
||||
}
|
||||
|
||||
cb(null);
|
||||
}
|
||||
|
||||
get(cb) {
|
||||
cb(null, this.data.list);
|
||||
}
|
||||
|
||||
sync() {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
getPackageStorage(packageInfo) {
|
||||
// eslint-disable-next-line new-cap
|
||||
return new _memoryHandler2.default(packageInfo, this.data.files, this.logger);
|
||||
}
|
||||
|
||||
_createEmtpyDatabase() {
|
||||
const list = [];
|
||||
const files = {};
|
||||
const emptyDatabase = {
|
||||
list,
|
||||
files,
|
||||
secret: '',
|
||||
};
|
||||
|
||||
return emptyDatabase;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = LocalMemory;
|
||||
@@ -0,0 +1,182 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true,
|
||||
});
|
||||
exports.fileExist = exports.noSuchFile = undefined;
|
||||
|
||||
let _httpErrors = require('http-errors');
|
||||
|
||||
let _httpErrors2 = _interopRequireDefault(_httpErrors);
|
||||
|
||||
let _memoryFs = require('memory-fs');
|
||||
|
||||
let _memoryFs2 = _interopRequireDefault(_memoryFs);
|
||||
|
||||
let _streams = require('@verdaccio/streams');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : { default: obj };
|
||||
}
|
||||
|
||||
// $FlowFixMe
|
||||
const noSuchFile = (exports.noSuchFile = 'ENOENT');
|
||||
|
||||
const fileExist = (exports.fileExist = 'EEXISTS');
|
||||
|
||||
const fSError = function fSError(message, code = 404) {
|
||||
const err = (0, _httpErrors2.default)(code, message);
|
||||
// $FlowFixMe
|
||||
err.code = message;
|
||||
|
||||
return err;
|
||||
};
|
||||
|
||||
const noPackageFoundError = function noPackageFoundError(message = 'no such package') {
|
||||
const err = (0, _httpErrors2.default)(404, message);
|
||||
// $FlowFixMe
|
||||
err.code = noSuchFile;
|
||||
return err;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line new-cap
|
||||
const fs = new _memoryFs2.default();
|
||||
|
||||
class MemoryHandler {
|
||||
constructor(packageName, data, logger) {
|
||||
// this is not need it
|
||||
this.data = data;
|
||||
this.name = packageName;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
updatePackage(pkgFileName, updateHandler, onWrite, transformPackage, onEnd) {
|
||||
let json = this._getStorage(pkgFileName);
|
||||
|
||||
try {
|
||||
json = JSON.parse(json);
|
||||
} catch (err) {
|
||||
return onEnd(err);
|
||||
}
|
||||
|
||||
updateHandler(json, (err) => {
|
||||
if (err) {
|
||||
return onEnd(err);
|
||||
}
|
||||
try {
|
||||
onWrite(pkgFileName, transformPackage(json), onEnd);
|
||||
} catch (err) {
|
||||
return onEnd(fSError('error on parse', 500));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
deletePackage(pkgName, callback) {
|
||||
delete this.data[pkgName];
|
||||
callback(null);
|
||||
}
|
||||
|
||||
removePackage(callback) {
|
||||
callback(null);
|
||||
}
|
||||
|
||||
createPackage(name, value, cb) {
|
||||
this.savePackage(name, value, cb);
|
||||
}
|
||||
|
||||
savePackage(name, value, cb) {
|
||||
try {
|
||||
const json = JSON.stringify(value, null, '\t');
|
||||
|
||||
this.data[name] = json;
|
||||
} catch (err) {
|
||||
cb(fSError(err.message, 500));
|
||||
}
|
||||
|
||||
cb(null);
|
||||
}
|
||||
|
||||
readPackage(name, cb) {
|
||||
const json = this._getStorage(name);
|
||||
const isJson = typeof json === 'undefined';
|
||||
|
||||
try {
|
||||
cb(isJson ? noPackageFoundError() : null, JSON.parse(json));
|
||||
} catch (err) {
|
||||
cb(noPackageFoundError());
|
||||
}
|
||||
}
|
||||
|
||||
writeTarball(name) {
|
||||
const uploadStream = new _streams.UploadTarball();
|
||||
const temporalName = `/${name}`;
|
||||
|
||||
process.nextTick(function () {
|
||||
fs.exists(temporalName, function (exists) {
|
||||
if (exists) {
|
||||
return uploadStream.emit('error', fSError(fileExist));
|
||||
}
|
||||
|
||||
try {
|
||||
const file = fs.createWriteStream(temporalName);
|
||||
|
||||
uploadStream.pipe(file);
|
||||
|
||||
uploadStream.done = function () {
|
||||
const onEnd = function onEnd() {
|
||||
uploadStream.emit('success');
|
||||
};
|
||||
|
||||
uploadStream.on('end', onEnd);
|
||||
};
|
||||
|
||||
uploadStream.abort = function () {
|
||||
uploadStream.emit('error', fSError('transmision aborted', 400));
|
||||
file.end();
|
||||
};
|
||||
|
||||
uploadStream.emit('open');
|
||||
} catch (err) {
|
||||
uploadStream.emit('error', err);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return uploadStream;
|
||||
}
|
||||
|
||||
readTarball(name) {
|
||||
const pathName = `/${name}`;
|
||||
|
||||
const readTarballStream = new _streams.ReadTarball();
|
||||
|
||||
process.nextTick(function () {
|
||||
fs.exists(pathName, function (exists) {
|
||||
if (!exists) {
|
||||
readTarballStream.emit('error', noPackageFoundError());
|
||||
} else {
|
||||
const readStream = fs.createReadStream(pathName);
|
||||
|
||||
readTarballStream.emit('content-length', fs.data[name].length);
|
||||
readTarballStream.emit('open');
|
||||
readStream.pipe(readTarballStream);
|
||||
readStream.on('error', (error) => {
|
||||
readTarballStream.emit('error', error);
|
||||
});
|
||||
|
||||
readTarballStream.abort = function () {
|
||||
readStream.destroy(fSError('read has been aborted', 400));
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return readTarballStream;
|
||||
}
|
||||
|
||||
_getStorage(name = '') {
|
||||
return this.data[name];
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = MemoryHandler;
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "verdaccio-docker-memory",
|
||||
"version": "1.0.3",
|
||||
"description": "storage implementation in memory",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@verdaccio/streams": "1.0.0",
|
||||
"http-errors": "1.6.3",
|
||||
"memory-fs": "0.4.1"
|
||||
},
|
||||
"keywords": [
|
||||
"verdaccio",
|
||||
"plugin",
|
||||
"storage"
|
||||
],
|
||||
"author": "Juan Picado <juanpicado19@gmail.com>",
|
||||
"private": true,
|
||||
"license": "MIT"
|
||||
}
|
||||
@@ -1,8 +1,22 @@
|
||||
# Verdaccio 6
|
||||
# Verdaccio 6 Examples
|
||||
|
||||
> We recommend to have installed [docker-compose >= 1.29.0](https://github.com/docker/compose/releases/tag/1.29.2)
|
||||
|
||||
- [Docker + Nginx + Verdaccio](reverse_proxy/nginx/README.md)
|
||||
- [Docker + Apache + Verdaccio](apache-verdaccio/README.md)
|
||||
## Mapping Volumes
|
||||
|
||||
- [Docker + Local Storage Volume + Verdaccio](docker-local-storage-volume/README.md)
|
||||
- [Docker + HTTPS Portal + Verdaccio](https-portal-example/README.md)
|
||||
|
||||
## Proxy
|
||||
|
||||
- [Docker + Nginx + Verdaccio](proxy/reverse_proxy/nginx/README.md)
|
||||
- [Docker + Apache + Verdaccio](proxy/apache-verdaccio/README.md)
|
||||
- [Docker + HTTPS Portal + Verdaccio](proxy/https-portal-example/README.md)
|
||||
|
||||
> Looking forward more examples with proxies.
|
||||
|
||||
## Plugins
|
||||
|
||||
Using plugins without `docker-compose` mapping volumes, all withing the `Dockerfile`.
|
||||
|
||||
- [Docker + Local Build Auth Plugin (local development)](plugins/docker-build-install-plugin/README.md)
|
||||
- [Docker + Auth Plugin (from a registry)](plugins/docker-local-plugin/README.md)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# Docs based on https://github.com/xlts-dev/verdaccio-prometheus-middleware#installation
|
||||
|
||||
# Docker multi-stage build - https://docs.docker.com/develop/develop-images/multistage-build/
|
||||
# Use an alpine node image to install the plugin
|
||||
FROM node:lts-alpine as builder
|
||||
|
||||
# Install the metrics middleware plugin
|
||||
# npm docs
|
||||
# --global-style https://docs.npmjs.com/cli/v7/commands/npm-install#global-style
|
||||
# --no-bin-links https://docs.npmjs.com/cli/v7/commands/npm-install#bin-links
|
||||
# --omit=optional
|
||||
RUN mkdir -p /verdaccio/plugins \
|
||||
&& cd /verdaccio/plugins \
|
||||
&& npm install --global-style --no-bin-links --omit=optional verdaccio-auth-memory@latest
|
||||
|
||||
# The final built image will be based on the standard Verdaccio docker image.
|
||||
FROM verdaccio/verdaccio:nightly-master
|
||||
|
||||
# Copy the plugin files over from the 'builder' node image.
|
||||
# The `$VERDACCIO_USER_UID` env variable is defined in the base `verdaccio/verdaccio` image.
|
||||
# Refer to: https://github.com/verdaccio/verdaccio/blob/v5.2.0/Dockerfile#L32
|
||||
ADD docker.yaml /verdaccio/conf/config.yaml
|
||||
COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
|
||||
/verdaccio/plugins/node_modules/verdaccio-auth-memory \
|
||||
/verdaccio/plugins/verdaccio-auth-memory
|
||||
@@ -0,0 +1,46 @@
|
||||
# Installing a plugin with Docker build
|
||||
|
||||
On this small tutorial (based on [`verdaccio-prometheus-middleware`](https://github.com/xlts-dev/verdaccio-prometheus-middleware) example) you will be able to use a published package in any random registry (npmjs by default) and use it withing a docker image without mapping need it.
|
||||
|
||||
> Since verdaccio:5 uses `yarn@2` to run the application, this tutorial is a workaround but future prove since verdaccio 6 uses `pnpm` to build the docker image.
|
||||
|
||||
There are two main steps to highlight:
|
||||
|
||||
- `docker.yaml`: This is a copy of the original configuration file for docker and with small modifications to use the plugin [`verdaccio-auth-memory`](https://www.npmjs.com/package/verdaccio-auth-memory) and custom web title for demonstration.
|
||||
- The `Dockerfile` take advance of the docker multi-stage build to install the plugin into the `verdaccio/plugins` folder withing the image, then we apply the right permissions `--chown=$VERDACCIO_USER_UID:root` so the plugin is recognized.
|
||||
|
||||
## Run it
|
||||
|
||||
Build this image.
|
||||
|
||||
```bash
|
||||
docker build -t verdaccio/verdaccio:local .
|
||||
```
|
||||
|
||||
and to run it
|
||||
|
||||
```bash
|
||||
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio:local
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```dockerfile
|
||||
# Docker multi-stage build - https://docs.docker.com/develop/develop-images/multistage-build/
|
||||
# Use an alpine node image to install the plugin
|
||||
FROM node:lts-alpine as builder
|
||||
|
||||
RUN mkdir -p /verdaccio/plugins \
|
||||
&& cd /verdaccio/plugins \
|
||||
&& npm install --global-style --no-bin-links --omit=optional verdaccio-auth-memory@latest
|
||||
|
||||
FROM verdaccio/verdaccio:5
|
||||
|
||||
# copy your modified config.yaml into the image
|
||||
ADD docker.yaml /verdaccio/conf/config.yaml
|
||||
|
||||
COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
|
||||
/verdaccio/plugins/node_modules/verdaccio-auth-memory \
|
||||
/verdaccio/plugins/verdaccio-auth-memory
|
||||
|
||||
```
|
||||
@@ -0,0 +1,197 @@
|
||||
#
|
||||
# This is the default configuration file. It allows all users to do anything,
|
||||
# please read carefully the documentation and best practices to
|
||||
# improve security.
|
||||
#
|
||||
# Do not configure host and port under `listen` in this file
|
||||
# as it will be ignored when using docker.
|
||||
# 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/5.x/conf
|
||||
#
|
||||
# Read about the best practices
|
||||
# https://verdaccio.org/docs/best
|
||||
|
||||
# path to a directory with all packages
|
||||
storage: /verdaccio/storage/data
|
||||
# path to a directory with plugins to include
|
||||
plugins: /verdaccio/plugins
|
||||
|
||||
# https://verdaccio.org/docs/webui
|
||||
web:
|
||||
title: Verdaccio Publish Config Test
|
||||
# comment out to disable gravatar support
|
||||
# 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/
|
||||
|
||||
# https://verdaccio.org/docs/configuration#authentication
|
||||
auth:
|
||||
auth-memory:
|
||||
users:
|
||||
foo:
|
||||
name: foo
|
||||
password: s3cret
|
||||
bar:
|
||||
name: bar
|
||||
password: s3cret
|
||||
|
||||
# https://verdaccio.org/docs/configuration#uplinks
|
||||
# a list of other known repositories we can talk to
|
||||
uplinks:
|
||||
npmjs:
|
||||
url: https://registry.npmjs.org/
|
||||
|
||||
# Learn how to protect your packages
|
||||
# https://verdaccio.org/docs/protect-your-dependencies/
|
||||
# https://verdaccio.org/docs/configuration#packages
|
||||
packages:
|
||||
'@*/*':
|
||||
# scoped packages
|
||||
access: $all
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
proxy: npmjs
|
||||
|
||||
'**':
|
||||
# allow all users (including non-authenticated users) to read and
|
||||
# publish all packages
|
||||
#
|
||||
# you can specify usernames/groupnames (depending on your auth plugin)
|
||||
# and three keywords: "$all", "$anonymous", "$authenticated"
|
||||
access: $all
|
||||
|
||||
# allow all known users to publish/publish packages
|
||||
# (anyone can register by default, remember?)
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
|
||||
# if package is not available locally, proxy requests to 'npmjs' registry
|
||||
proxy: npmjs
|
||||
|
||||
# To improve your security configuration and avoid dependency confusion
|
||||
# consider removing the proxy property for private packages
|
||||
# https://verdaccio.org/docs/best#remove-proxy-to-increase-security-at-private-packages
|
||||
|
||||
# https://verdaccio.org/docs/configuration#server
|
||||
# You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections.
|
||||
# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout.
|
||||
# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
|
||||
server:
|
||||
keepAliveTimeout: 60
|
||||
|
||||
# https://verdaccio.org/docs/configuration#offline-publish
|
||||
# publish:
|
||||
# allow_offline: false
|
||||
|
||||
# https://verdaccio.org/docs/configuration#url-prefix
|
||||
# url_prefix: /verdaccio/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org';
|
||||
# url_prefix: '/my_prefix'
|
||||
# // url -> https://somedomain.org/my_prefix/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org';
|
||||
# url_prefix: '/'
|
||||
# // url -> https://somedomain.org/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org/first_prefix';
|
||||
# url_prefix: '/second_prefix'
|
||||
# // url -> https://somedomain.org/second_prefix/'
|
||||
|
||||
# https://verdaccio.org/docs/configuration#security
|
||||
# security:
|
||||
# api:
|
||||
# legacy: true
|
||||
# jwt:
|
||||
# sign:
|
||||
# expiresIn: 29d
|
||||
# verify:
|
||||
# someProp: [value]
|
||||
# web:
|
||||
# sign:
|
||||
# expiresIn: 1h # 1 hour by default
|
||||
# verify:
|
||||
# someProp: [value]
|
||||
|
||||
# https://verdaccio.org/docs/configuration#user-rate-limit
|
||||
# userRateLimit:
|
||||
# windowMs: 50000
|
||||
# max: 1000
|
||||
|
||||
# https://verdaccio.org/docs/configuration#max-body-size
|
||||
# max_body_size: 10mb
|
||||
|
||||
# https://verdaccio.org/docs/configuration#listen-port
|
||||
# listen:
|
||||
# - localhost:4873 # default value
|
||||
# - http://localhost:4873 # same thing
|
||||
# - 0.0.0.0:4873 # listen on all addresses (INADDR_ANY)
|
||||
# - https://example.org:4873 # if you want to use https
|
||||
# - "[::1]:4873" # ipv6
|
||||
# - unix:/tmp/verdaccio.sock # unix socket
|
||||
|
||||
# The HTTPS configuration is useful if you do not consider use a HTTP Proxy
|
||||
# https://verdaccio.org/docs/configuration#https
|
||||
# https:
|
||||
# key: ./path/verdaccio-key.pem
|
||||
# cert: ./path/verdaccio-cert.pem
|
||||
# ca: ./path/verdaccio-csr.pem
|
||||
|
||||
# https://verdaccio.org/docs/configuration#proxy
|
||||
# http_proxy: http://something.local/
|
||||
# https_proxy: https://something.local/
|
||||
|
||||
# https://verdaccio.org/docs/configuration#notifications
|
||||
# notify:
|
||||
# method: POST
|
||||
# headers: [{ "Content-Type": "application/json" }]
|
||||
# endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken
|
||||
# content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}'
|
||||
|
||||
middlewares:
|
||||
audit:
|
||||
enabled: true
|
||||
|
||||
# https://verdaccio.org/docs/logger
|
||||
# log settings
|
||||
logs: { type: stdout, format: pretty, level: http }
|
||||
#experiments:
|
||||
# # support for npm token command
|
||||
# token: false
|
||||
# # enable tarball URL redirect for hosting tarball with a different server, the tarball_url_redirect can be a template string
|
||||
# tarball_url_redirect: 'https://mycdn.com/verdaccio/${packageName}/${filename}'
|
||||
# # the tarball_url_redirect can be a function, takes packageName and filename and returns the url, when working with a js configuration file
|
||||
# tarball_url_redirect(packageName, filename) {
|
||||
# const signedUrl = // generate a signed url
|
||||
# return signedUrl;
|
||||
# }
|
||||
|
||||
# translate your registry, api i18n not available yet
|
||||
# i18n:
|
||||
# list of the available translations https://github.com/verdaccio/verdaccio/blob/master/packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.md
|
||||
# web: en-US
|
||||
26
docker-examples/v6/plugins/docker-local-plugin/Dockerfile
Normal file
26
docker-examples/v6/plugins/docker-local-plugin/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
# Docs based on https://github.com/xlts-dev/verdaccio-prometheus-middleware#installation
|
||||
# Docker multi-stage build - https://docs.docker.com/develop/develop-images/multistage-build/
|
||||
# Use an alpine node image to install the plugin
|
||||
FROM node:lts-alpine as builder
|
||||
|
||||
RUN mkdir -p /verdaccio/plugins
|
||||
|
||||
# Copy the local plugin into the docker image
|
||||
ADD plugins/verdaccio-docker-memory /verdaccio/plugins/verdaccio-docker-memory
|
||||
# Install the production dependencies (be careful install devDependencies here)
|
||||
RUN cd /verdaccio/plugins/verdaccio-docker-memory \
|
||||
&& npm install --production
|
||||
|
||||
# The final built image will be based on the standard Verdaccio docker image.
|
||||
FROM verdaccio/verdaccio:nightly-master
|
||||
|
||||
# Copy the plugin files over from the 'builder' node image.
|
||||
# The `$VERDACCIO_USER_UID` env variable is defined in the base `verdaccio/verdaccio` image.
|
||||
# Refer to: https://github.com/verdaccio/verdaccio/blob/v5.2.0/Dockerfile#L32
|
||||
# The local verdaccio-docker-memory is setup as storage
|
||||
ADD docker.yaml /verdaccio/conf/config.yaml
|
||||
|
||||
# Copy the plugin into the /verdaccio/plugins
|
||||
COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
|
||||
/verdaccio/plugins/verdaccio-docker-memory \
|
||||
/verdaccio/plugins/verdaccio-docker-memory
|
||||
42
docker-examples/v6/plugins/docker-local-plugin/README.md
Normal file
42
docker-examples/v6/plugins/docker-local-plugin/README.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Installing a local plugin with Docker build
|
||||
|
||||
On this small tutorial (based on [`verdaccio-prometheus-middleware`](https://github.com/xlts-dev/verdaccio-prometheus-middleware) example) you will be able to use a published package in any random registry (npmjs by default) and use it withing a docker image without mapping need it.
|
||||
|
||||
> Since verdaccio:5 uses `yarn@2` to run the application, this tutorial is a workaround but future prove since verdaccio 6 uses `pnpm` to build the docker image.
|
||||
|
||||
There are three main steps to highlight:
|
||||
|
||||
- Note the custom plugin at `plugins/verdaccio-docker-memory` under the name `verdaccio-docker-memory`.
|
||||
- Install the _production_ dependencies for the plugin `verdaccio-docker-memory`
|
||||
- `docker.yaml`: This is a copy of the original configuration file for docker and with small modifications to use the local plugin `verdaccio-docker-memory`.
|
||||
- The `Dockerfile` take advance of the docker multi-stage build to copy the local plugin into the `verdaccio/plugins` folder withing the image, then we apply the right permissions `--chown=$VERDACCIO_USER_UID:root` so the plugin is recognized.
|
||||
|
||||
## Run it
|
||||
|
||||
Build this image.
|
||||
|
||||
```bash
|
||||
docker build -t verdaccio/verdaccio:local .
|
||||
```
|
||||
|
||||
and to run it
|
||||
|
||||
```bash
|
||||
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio:local
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```dockerfile
|
||||
FROM node:lts-alpine as builder
|
||||
RUN mkdir -p /verdaccio/plugins
|
||||
ADD plugins/verdaccio-docker-memory /verdaccio/plugins/verdaccio-docker-memory
|
||||
RUN cd /verdaccio/plugins/verdaccio-docker-memory \
|
||||
&& ls -ls \
|
||||
&& npm install --production
|
||||
FROM verdaccio/verdaccio:5
|
||||
ADD docker.yaml /verdaccio/conf/config.yaml
|
||||
COPY --chown=$VERDACCIO_USER_UID:root --from=builder \
|
||||
/verdaccio/plugins/verdaccio-docker-memory \
|
||||
/verdaccio/plugins/verdaccio-docker-memory
|
||||
```
|
||||
199
docker-examples/v6/plugins/docker-local-plugin/docker.yaml
Normal file
199
docker-examples/v6/plugins/docker-local-plugin/docker.yaml
Normal file
@@ -0,0 +1,199 @@
|
||||
#
|
||||
# This is the default configuration file. It allows all users to do anything,
|
||||
# please read carefully the documentation and best practices to
|
||||
# improve security.
|
||||
#
|
||||
# Do not configure host and port under `listen` in this file
|
||||
# as it will be ignored when using docker.
|
||||
# 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/5.x/conf
|
||||
#
|
||||
# Read about the best practices
|
||||
# https://verdaccio.org/docs/best
|
||||
|
||||
# path to a directory with all packages
|
||||
storage: /verdaccio/storage/data
|
||||
|
||||
store:
|
||||
# dummy copy of https://www.npmjs.com/package/verdaccio-memory
|
||||
docker-memory:
|
||||
limit: 1000
|
||||
|
||||
# path to a directory with plugins to include
|
||||
plugins: /verdaccio/plugins
|
||||
|
||||
# https://verdaccio.org/docs/webui
|
||||
web:
|
||||
title: Verdaccio This is a Test
|
||||
# comment out to disable gravatar support
|
||||
# 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/
|
||||
|
||||
auth:
|
||||
htpasswd:
|
||||
file: ./htpasswd
|
||||
# Maximum amount of users allowed to register, defaults to "+inf".
|
||||
# You can set this to -1 to disable registration.
|
||||
# max_users: 1000
|
||||
|
||||
# https://verdaccio.org/docs/configuration#uplinks
|
||||
# a list of other known repositories we can talk to
|
||||
uplinks:
|
||||
npmjs:
|
||||
url: https://registry.npmjs.org/
|
||||
|
||||
# Learn how to protect your packages
|
||||
# https://verdaccio.org/docs/protect-your-dependencies/
|
||||
# https://verdaccio.org/docs/configuration#packages
|
||||
packages:
|
||||
'@*/*':
|
||||
# scoped packages
|
||||
access: $all
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
proxy: npmjs
|
||||
|
||||
'**':
|
||||
# allow all users (including non-authenticated users) to read and
|
||||
# publish all packages
|
||||
#
|
||||
# you can specify usernames/groupnames (depending on your auth plugin)
|
||||
# and three keywords: "$all", "$anonymous", "$authenticated"
|
||||
access: $all
|
||||
|
||||
# allow all known users to publish/publish packages
|
||||
# (anyone can register by default, remember?)
|
||||
publish: $authenticated
|
||||
unpublish: $authenticated
|
||||
|
||||
# if package is not available locally, proxy requests to 'npmjs' registry
|
||||
proxy: npmjs
|
||||
|
||||
# To improve your security configuration and avoid dependency confusion
|
||||
# consider removing the proxy property for private packages
|
||||
# https://verdaccio.org/docs/best#remove-proxy-to-increase-security-at-private-packages
|
||||
|
||||
# https://verdaccio.org/docs/configuration#server
|
||||
# You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections.
|
||||
# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout.
|
||||
# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
|
||||
server:
|
||||
keepAliveTimeout: 60
|
||||
|
||||
# https://verdaccio.org/docs/configuration#offline-publish
|
||||
# publish:
|
||||
# allow_offline: false
|
||||
|
||||
# https://verdaccio.org/docs/configuration#url-prefix
|
||||
# url_prefix: /verdaccio/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org';
|
||||
# url_prefix: '/my_prefix'
|
||||
# // url -> https://somedomain.org/my_prefix/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org';
|
||||
# url_prefix: '/'
|
||||
# // url -> https://somedomain.org/
|
||||
# VERDACCIO_PUBLIC_URL='https://somedomain.org/first_prefix';
|
||||
# url_prefix: '/second_prefix'
|
||||
# // url -> https://somedomain.org/second_prefix/'
|
||||
|
||||
# https://verdaccio.org/docs/configuration#security
|
||||
# security:
|
||||
# api:
|
||||
# legacy: true
|
||||
# jwt:
|
||||
# sign:
|
||||
# expiresIn: 29d
|
||||
# verify:
|
||||
# someProp: [value]
|
||||
# web:
|
||||
# sign:
|
||||
# expiresIn: 1h # 1 hour by default
|
||||
# verify:
|
||||
# someProp: [value]
|
||||
|
||||
# https://verdaccio.org/docs/configuration#user-rate-limit
|
||||
# userRateLimit:
|
||||
# windowMs: 50000
|
||||
# max: 1000
|
||||
|
||||
# https://verdaccio.org/docs/configuration#max-body-size
|
||||
# max_body_size: 10mb
|
||||
|
||||
# https://verdaccio.org/docs/configuration#listen-port
|
||||
# listen:
|
||||
# - localhost:4873 # default value
|
||||
# - http://localhost:4873 # same thing
|
||||
# - 0.0.0.0:4873 # listen on all addresses (INADDR_ANY)
|
||||
# - https://example.org:4873 # if you want to use https
|
||||
# - "[::1]:4873" # ipv6
|
||||
# - unix:/tmp/verdaccio.sock # unix socket
|
||||
|
||||
# The HTTPS configuration is useful if you do not consider use a HTTP Proxy
|
||||
# https://verdaccio.org/docs/configuration#https
|
||||
# https:
|
||||
# key: ./path/verdaccio-key.pem
|
||||
# cert: ./path/verdaccio-cert.pem
|
||||
# ca: ./path/verdaccio-csr.pem
|
||||
|
||||
# https://verdaccio.org/docs/configuration#proxy
|
||||
# http_proxy: http://something.local/
|
||||
# https_proxy: https://something.local/
|
||||
|
||||
# https://verdaccio.org/docs/configuration#notifications
|
||||
# notify:
|
||||
# method: POST
|
||||
# headers: [{ "Content-Type": "application/json" }]
|
||||
# endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken
|
||||
# content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}'
|
||||
|
||||
middlewares:
|
||||
audit:
|
||||
enabled: true
|
||||
|
||||
# https://verdaccio.org/docs/logger
|
||||
# log settings
|
||||
log: { type: stdout, format: pretty, level: http }
|
||||
#experiments:
|
||||
# # support for npm token command
|
||||
# token: false
|
||||
# # enable tarball URL redirect for hosting tarball with a different server, the tarball_url_redirect can be a template string
|
||||
# tarball_url_redirect: 'https://mycdn.com/verdaccio/${packageName}/${filename}'
|
||||
# # the tarball_url_redirect can be a function, takes packageName and filename and returns the url, when working with a js configuration file
|
||||
# tarball_url_redirect(packageName, filename) {
|
||||
# const signedUrl = // generate a signed url
|
||||
# return signedUrl;
|
||||
# }
|
||||
|
||||
# translate your registry, api i18n not available yet
|
||||
# i18n:
|
||||
# list of the available translations https://github.com/verdaccio/verdaccio/blob/master/packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.md
|
||||
# web: en-US
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"rules": {
|
||||
"max-len": 0,
|
||||
"@typescript-eslint/prefer-optional-chain": 0,
|
||||
"@typescript-eslint/no-unused-vars": 0,
|
||||
"@typescript-eslint/explicit-member-accessibility": 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true,
|
||||
});
|
||||
Object.defineProperty(exports, 'LocalMemory', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _localMemory.default;
|
||||
},
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _localMemory = _interopRequireDefault(require('./local-memory'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : { default: obj };
|
||||
}
|
||||
|
||||
var _default = _localMemory.default;
|
||||
exports.default = _default;
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1,141 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true,
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _debug = _interopRequireDefault(require('debug'));
|
||||
|
||||
var _core = require('@verdaccio/core');
|
||||
|
||||
var _memoryHandler = _interopRequireDefault(require('./memory-handler'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : { default: obj };
|
||||
}
|
||||
|
||||
const debug = (0, _debug.default)('verdaccio:plugin:storage:local-memory');
|
||||
const DEFAULT_LIMIT = 1000;
|
||||
|
||||
class LocalMemory {
|
||||
constructor(config, options) {
|
||||
this.config = config;
|
||||
this.limit = config.limit || DEFAULT_LIMIT;
|
||||
this.logger = options.logger;
|
||||
this.data = this._createEmtpyDatabase();
|
||||
this.path = '/';
|
||||
debug('start plugin');
|
||||
}
|
||||
|
||||
init() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
getSecret() {
|
||||
return Promise.resolve(this.data.secret);
|
||||
}
|
||||
|
||||
setSecret(secret) {
|
||||
return new Promise((resolve) => {
|
||||
this.data.secret = secret;
|
||||
resolve(null);
|
||||
});
|
||||
}
|
||||
|
||||
async add(name) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const { list } = this.data;
|
||||
|
||||
if (list.length < this.limit) {
|
||||
if (list.indexOf(name) === -1) {
|
||||
list.push(name);
|
||||
}
|
||||
|
||||
resolve();
|
||||
} else {
|
||||
this.logger.info(
|
||||
{
|
||||
limit: this.limit,
|
||||
},
|
||||
'Storage memory has reached limit of @{limit} packages'
|
||||
);
|
||||
reject(new Error('Storage memory has reached limit of limit packages'));
|
||||
}
|
||||
});
|
||||
} // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
||||
search(onPackage, onEnd) {
|
||||
this.logger.warn('[verdaccio/memory]: search method not implemented, PR is welcome');
|
||||
onEnd();
|
||||
}
|
||||
|
||||
async remove(name) {
|
||||
return new Promise((resolve) => {
|
||||
const { list } = this.data;
|
||||
const item = list.indexOf(name);
|
||||
|
||||
if (item !== -1) {
|
||||
list.splice(item, 1);
|
||||
}
|
||||
|
||||
return resolve();
|
||||
});
|
||||
}
|
||||
|
||||
async get() {
|
||||
var _this$data, _this$data$list, _this$data2;
|
||||
|
||||
debug(
|
||||
'data list length %o',
|
||||
(_this$data = this.data) === null || _this$data === void 0
|
||||
? void 0
|
||||
: (_this$data$list = _this$data.list) === null || _this$data$list === void 0
|
||||
? void 0
|
||||
: _this$data$list.length
|
||||
);
|
||||
return Promise.resolve(
|
||||
(_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2.list
|
||||
);
|
||||
}
|
||||
|
||||
getPackageStorage(packageInfo) {
|
||||
return new _memoryHandler.default(packageInfo, this.data.files, this.logger);
|
||||
}
|
||||
|
||||
_createEmtpyDatabase() {
|
||||
const list = [];
|
||||
const files = {};
|
||||
const emptyDatabase = {
|
||||
list,
|
||||
files,
|
||||
secret: '',
|
||||
};
|
||||
return emptyDatabase;
|
||||
}
|
||||
|
||||
saveToken() {
|
||||
this.logger.warn('[verdaccio/memory][saveToken] save token has not been implemented yet');
|
||||
return Promise.reject(_core.errorUtils.getServiceUnavailable('method not implemented'));
|
||||
}
|
||||
|
||||
deleteToken(user, tokenKey) {
|
||||
this.logger.warn(
|
||||
{
|
||||
tokenKey,
|
||||
user,
|
||||
},
|
||||
'[verdaccio/memory][deleteToken] delete token has not been implemented yet @{user}'
|
||||
);
|
||||
return Promise.reject(_core.errorUtils.getServiceUnavailable('method not implemented'));
|
||||
}
|
||||
|
||||
readTokens() {
|
||||
this.logger.warn('[verdaccio/memory][readTokens] read tokens has not been implemented yet ');
|
||||
return Promise.reject(_core.errorUtils.getServiceUnavailable('method not implemented'));
|
||||
}
|
||||
}
|
||||
|
||||
var _default = LocalMemory;
|
||||
exports.default = _default;
|
||||
//# sourceMappingURL=local-memory.js.map
|
||||
@@ -0,0 +1,214 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true,
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _debug = _interopRequireDefault(require('debug'));
|
||||
|
||||
var _memfs = require('memfs');
|
||||
|
||||
var _path = _interopRequireDefault(require('path'));
|
||||
|
||||
var _core = require('@verdaccio/core');
|
||||
|
||||
var _streams = require('@verdaccio/streams');
|
||||
|
||||
var _utils = require('./utils');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : { default: obj };
|
||||
}
|
||||
|
||||
const debug = (0, _debug.default)('verdaccio:plugin:storage:memory-storage');
|
||||
|
||||
class MemoryHandler {
|
||||
constructor(packageName, data, logger) {
|
||||
// this is not need it
|
||||
this.data = data;
|
||||
this.name = packageName;
|
||||
this.logger = logger;
|
||||
this.path = `/${packageName}`;
|
||||
debug('initialized');
|
||||
}
|
||||
|
||||
updatePackage(pkgFileName, updateHandler, onWrite, transformPackage, onEnd) {
|
||||
const json = this._getStorage(pkgFileName);
|
||||
|
||||
let pkg;
|
||||
|
||||
try {
|
||||
pkg = (0, _utils.parsePackage)(json);
|
||||
} catch (err) {
|
||||
return onEnd(err);
|
||||
}
|
||||
|
||||
updateHandler(pkg, (err) => {
|
||||
if (err) {
|
||||
return onEnd(err);
|
||||
}
|
||||
|
||||
try {
|
||||
onWrite(pkgFileName, transformPackage(pkg), onEnd);
|
||||
} catch (err) {
|
||||
return onEnd(_core.errorUtils.getInternalError('error on parse the metadata'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
deletePackage(pkgName) {
|
||||
delete this.data[pkgName];
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
removePackage() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
createPackage(name, value, cb) {
|
||||
debug('create package %o', name);
|
||||
this.savePackage(name, value, cb);
|
||||
}
|
||||
|
||||
savePackage(name, value, cb) {
|
||||
try {
|
||||
debug('save package %o', name);
|
||||
this.data[name] = (0, _utils.stringifyPackage)(value);
|
||||
return cb(null);
|
||||
} catch (err) {
|
||||
return cb(_core.errorUtils.getInternalError(err.message));
|
||||
}
|
||||
}
|
||||
|
||||
async readPackageNext(name) {
|
||||
const json = this._getStorage(name);
|
||||
|
||||
try {
|
||||
return (
|
||||
typeof json === 'undefined' ? _core.errorUtils.getNotFound() : null,
|
||||
(0, _utils.parsePackage)(json)
|
||||
);
|
||||
} catch (err) {
|
||||
throw _core.errorUtils.getNotFound();
|
||||
}
|
||||
}
|
||||
|
||||
readPackage(name, cb) {
|
||||
debug('read package %o', name);
|
||||
|
||||
const json = this._getStorage(name);
|
||||
|
||||
const isJson = typeof json === 'undefined';
|
||||
|
||||
try {
|
||||
return cb(isJson ? _core.errorUtils.getNotFound() : null, (0, _utils.parsePackage)(json));
|
||||
} catch (err) {
|
||||
return cb(_core.errorUtils.getNotFound());
|
||||
}
|
||||
}
|
||||
|
||||
writeTarball(name) {
|
||||
const uploadStream = new _streams.UploadTarball({});
|
||||
const temporalName = `${this.path}/${name}`;
|
||||
debug('write tarball %o', temporalName);
|
||||
process.nextTick(function () {
|
||||
_memfs.fs.mkdirp(_path.default.dirname(temporalName), (mkdirpError) => {
|
||||
if (mkdirpError) {
|
||||
return uploadStream.emit('error', mkdirpError);
|
||||
}
|
||||
|
||||
_memfs.fs.stat(temporalName, function (fileError, stats) {
|
||||
if (!fileError && stats) {
|
||||
return uploadStream.emit('error', _core.errorUtils.getConflict());
|
||||
}
|
||||
|
||||
try {
|
||||
const file = _memfs.fs.createWriteStream(temporalName);
|
||||
|
||||
uploadStream.pipe(file);
|
||||
|
||||
uploadStream.done = function () {
|
||||
const onEnd = function () {
|
||||
uploadStream.emit('success');
|
||||
};
|
||||
|
||||
uploadStream.on('end', onEnd);
|
||||
};
|
||||
|
||||
uploadStream.abort = function () {
|
||||
uploadStream.emit('error', _core.errorUtils.getBadRequest('transmision aborted'));
|
||||
file.end();
|
||||
};
|
||||
|
||||
uploadStream.emit('open');
|
||||
return;
|
||||
} catch (err) {
|
||||
uploadStream.emit('error', err);
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
return uploadStream;
|
||||
}
|
||||
|
||||
readTarball(name) {
|
||||
const pathName = `${this.path}/${name}`;
|
||||
debug('read tarball %o', pathName);
|
||||
const readTarballStream = new _streams.ReadTarball({});
|
||||
process.nextTick(function () {
|
||||
_memfs.fs.stat(pathName, function (error, stats) {
|
||||
if (error && !stats) {
|
||||
return readTarballStream.emit('error', _core.errorUtils.getNotFound());
|
||||
}
|
||||
|
||||
try {
|
||||
const readStream = _memfs.fs.createReadStream(pathName);
|
||||
|
||||
readTarballStream.emit(
|
||||
'content-length',
|
||||
stats === null || stats === void 0 ? void 0 : stats.size
|
||||
);
|
||||
readTarballStream.emit('open');
|
||||
readStream.pipe(readTarballStream);
|
||||
readStream.on('error', (error) => {
|
||||
readTarballStream.emit('error', error);
|
||||
});
|
||||
|
||||
readTarballStream.abort = function () {
|
||||
readStream.destroy(_core.errorUtils.getBadRequest('read has been aborted'));
|
||||
};
|
||||
|
||||
return;
|
||||
} catch (err) {
|
||||
readTarballStream.emit('error', err);
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
return readTarballStream;
|
||||
}
|
||||
|
||||
_getStorage(name = '') {
|
||||
debug('get storage %o', name);
|
||||
return this.data[name];
|
||||
} // migration pending
|
||||
|
||||
async updatePackageNext(packageName, handleUpdate) {
|
||||
debug(packageName); // @ts-expect-error
|
||||
|
||||
await handleUpdate({}); // @ts-expect-error
|
||||
|
||||
return Promise.resolve({});
|
||||
}
|
||||
|
||||
async savePackageNext(name, value) {
|
||||
debug(name);
|
||||
debug(value);
|
||||
}
|
||||
}
|
||||
|
||||
var _default = MemoryHandler;
|
||||
exports.default = _default;
|
||||
//# sourceMappingURL=memory-handler.js.map
|
||||
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true,
|
||||
});
|
||||
exports.parsePackage = parsePackage;
|
||||
exports.stringifyPackage = stringifyPackage;
|
||||
|
||||
function stringifyPackage(pkg) {
|
||||
return JSON.stringify(pkg, null, '\t');
|
||||
}
|
||||
|
||||
function parsePackage(pkg) {
|
||||
return JSON.parse(pkg);
|
||||
}
|
||||
//# sourceMappingURL=utils.js.map
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@verdaccio/streams",
|
||||
"version": "11.0.0-6-next.5",
|
||||
"description": "Stream extension for Verdaccio",
|
||||
"name": "verdaccio-docker-memory",
|
||||
"version": "11.0.0-6-next.10",
|
||||
"description": "Storage implementation in memory",
|
||||
"keywords": [
|
||||
"private",
|
||||
"package",
|
||||
@@ -13,37 +13,41 @@
|
||||
"server",
|
||||
"verdaccio"
|
||||
],
|
||||
"main": "./build/index.js",
|
||||
"types": "./build/index.d.ts",
|
||||
"author": "Juan Picado <juanpicado19@gmail.com>",
|
||||
"license": "MIT",
|
||||
"homepage": "https://verdaccio.org",
|
||||
"engines": {
|
||||
"node": ">=14",
|
||||
"npm": ">=6"
|
||||
},
|
||||
"repository": {
|
||||
"type": "https",
|
||||
"url": "https://github.com/verdaccio/verdaccio",
|
||||
"directory": "packages/core/streams"
|
||||
"directory": "packages/plugins/memory"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/verdaccio/verdaccio/issues"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"engines": {
|
||||
"node": ">=14",
|
||||
"npm": ">=6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/core": "6.0.0-6-next.5",
|
||||
"@verdaccio/streams": "11.0.0-6-next.5",
|
||||
"memory-fs": "0.5.0",
|
||||
"debug": "4.3.3",
|
||||
"memfs": "3.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.10"
|
||||
"@verdaccio/types": "11.0.0-6-next.12"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
"test": "cross-env NODE_ENV=test BABEL_ENV=test jest",
|
||||
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
||||
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
||||
"build:js": "babel src/ --out-dir build/ --copy-files --extensions \".ts,.tsx\" --source-maps",
|
||||
"build": "pnpm run build:js && pnpm run build:types",
|
||||
"watch": "pnpm build:js -- --watch",
|
||||
"build": "pnpm run build:js && pnpm run build:types"
|
||||
"test": "cross-env NODE_ENV=test BABEL_ENV=test jest"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@@ -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 }
|
||||
|
||||
@@ -12,7 +12,7 @@ nvm install
|
||||
Verdaccio uses **pnpm** as monorepo management. To install
|
||||
|
||||
```bash
|
||||
npm i -g pnpm@latest
|
||||
npm i -g pnpm@latest-6
|
||||
```
|
||||
|
||||
Install all needed packages
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -7,4 +7,9 @@ module.exports = {
|
||||
collectCoverage: true,
|
||||
collectCoverageFrom: ['src/**/*.ts', '!**/node_modules/**', '!**/partials/**', '!**/fixture/**'],
|
||||
coveragePathIgnorePatterns: ['node_modules', 'fixtures'],
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
lines: 90,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
121
package.json
121
package.json
@@ -15,108 +15,111 @@
|
||||
"url": "https://opencollective.com/verdaccio"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@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/cli": "7.18.10",
|
||||
"@babel/core": "7.18.13",
|
||||
"@babel/node": "7.18.10",
|
||||
"@babel/plugin-proposal-class-properties": "7.18.6",
|
||||
"@babel/plugin-proposal-decorators": "7.18.10",
|
||||
"@babel/plugin-proposal-export-namespace-from": "7.18.9",
|
||||
"@babel/plugin-proposal-function-sent": "7.18.6",
|
||||
"@babel/plugin-proposal-json-strings": "7.18.6",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
|
||||
"@babel/plugin-proposal-numeric-separator": "7.18.6",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.18.9",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.18.9",
|
||||
"@babel/plugin-proposal-throw-expressions": "7.18.6",
|
||||
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
||||
"@babel/plugin-syntax-import-meta": "7.10.4",
|
||||
"@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",
|
||||
"@babel/plugin-transform-async-to-generator": "7.18.6",
|
||||
"@babel/plugin-transform-classes": "7.18.9",
|
||||
"@babel/plugin-transform-runtime": "7.18.10",
|
||||
"@babel/preset-env": "7.18.10",
|
||||
"@babel/preset-react": "7.18.6",
|
||||
"@babel/preset-typescript": "7.18.6",
|
||||
"@babel/register": "7.18.9",
|
||||
"@babel/runtime": "7.18.9",
|
||||
"@dianmora/contributors": "5.0.0",
|
||||
"@changesets/changelog-github": "0.4.6",
|
||||
"@changesets/cli": "2.15.0",
|
||||
"@changesets/get-dependents-graph": "1.2.4",
|
||||
"@crowdin/cli": "3.7.7",
|
||||
"@trivago/prettier-plugin-sort-imports": "3.2.0",
|
||||
"@types/async": "3.2.12",
|
||||
"@changesets/get-dependents-graph": "1.3.3",
|
||||
"@crowdin/cli": "3.7.10",
|
||||
"@trivago/prettier-plugin-sort-imports": "3.3.0",
|
||||
"@types/async": "3.2.15",
|
||||
"@types/autocannon": "4.1.1",
|
||||
"@types/express": "4.17.13",
|
||||
"@types/http-errors": "1.8.2",
|
||||
"@types/jest": "27.4.0",
|
||||
"@types/lodash": "4.14.178",
|
||||
"@types/jest": "27.5.2",
|
||||
"@types/lodash": "4.14.184",
|
||||
"@types/mime": "2.0.3",
|
||||
"@types/minimatch": "3.0.5",
|
||||
"@types/node": "16.11.21",
|
||||
"@types/jsonwebtoken": "8.5.1",
|
||||
"@types/node": "16.11.56",
|
||||
"@types/jsonwebtoken": "8.5.9",
|
||||
"@types/request": "2.48.8",
|
||||
"@types/semver": "7.3.9",
|
||||
"@types/supertest": "2.0.11",
|
||||
"@types/testing-library__jest-dom": "5.14.2",
|
||||
"@types/validator": "13.7.1",
|
||||
"@types/semver": "7.3.12",
|
||||
"@types/node-fetch": "2.6.2",
|
||||
"@types/supertest": "2.0.12",
|
||||
"@types/testing-library__jest-dom": "5.14.5",
|
||||
"@types/validator": "13.7.5",
|
||||
"@types/webpack": "5.28.0",
|
||||
"@types/webpack-env": "1.16.3",
|
||||
"@typescript-eslint/eslint-plugin": "5.10.2",
|
||||
"@typescript-eslint/parser": "5.10.2",
|
||||
"@types/webpack-env": "1.18.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.33.1",
|
||||
"@typescript-eslint/parser": "5.33.1",
|
||||
"@verdaccio/benchmark": "workspace:*",
|
||||
"@verdaccio/eslint-config": "workspace:*",
|
||||
"@verdaccio/types": "workspace:*",
|
||||
"@verdaccio/ui-theme": "workspace:*",
|
||||
"autocannon": "7.6.0",
|
||||
"autocannon": "7.9.0",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"babel-eslint": "10.1.0",
|
||||
"babel-jest": "27.4.6",
|
||||
"babel-jest": "27.5.1",
|
||||
"babel-plugin-dynamic-import-node": "2.3.3",
|
||||
"babel-plugin-emotion": "10.2.2",
|
||||
"codecov": "3.8.3",
|
||||
"concurrently": "6.5.1",
|
||||
"core-js": "3.20.3",
|
||||
"core-js": "3.25.0",
|
||||
"cross-env": "7.0.3",
|
||||
"debug": "4.3.3",
|
||||
"debug": "4.3.4",
|
||||
"detect-secrets": "1.0.6",
|
||||
"eslint": "8.8.0",
|
||||
"fs-extra": "10.0.0",
|
||||
"pretty-format": "27.5.1",
|
||||
"jest-diff": "27.5.1",
|
||||
"eslint": "8.22.0",
|
||||
"fs-extra": "10.1.0",
|
||||
"husky": "7.0.4",
|
||||
"in-publish": "2.0.1",
|
||||
"jest": "27.4.7",
|
||||
"jest-environment-jsdom": "27.4.6",
|
||||
"jest-environment-jsdom-global": "3.0.0",
|
||||
"jest-environment-node": "27.4.6",
|
||||
"jest": "27.5.1",
|
||||
"jest-environment-jsdom": "27.5.1",
|
||||
"jest-environment-jsdom-global": "3.1.2",
|
||||
"jest-environment-node": "27.5.1",
|
||||
"jest-junit": "12.3.0",
|
||||
"kleur": "3.0.3",
|
||||
"lint-staged": "11.2.6",
|
||||
"nock": "12.0.3",
|
||||
"node-fetch": "cjs",
|
||||
"nodemon": "2.0.15",
|
||||
"nodemon": "2.0.19",
|
||||
"npm-run-all": "4.1.5",
|
||||
"prettier": "2.5.1",
|
||||
"prettier": "2.7.1",
|
||||
"rimraf": "3.0.2",
|
||||
"selfsigned": "1.10.14",
|
||||
"supertest": "6.2.2",
|
||||
"ts-node": "10.4.0",
|
||||
"typescript": "4.5.5",
|
||||
"supertest": "6.2.4",
|
||||
"ts-node": "10.9.1",
|
||||
"typescript": "4.8.2",
|
||||
"update-ts-references": "2.4.1",
|
||||
"verdaccio": "5.5.0",
|
||||
"verdaccio-audit": "workspace:*",
|
||||
"verdaccio-auth-memory": "workspace:*",
|
||||
"verdaccio-htpasswd": "workspace:*",
|
||||
"verdaccio-memory": "workspace:*"
|
||||
},
|
||||
"scripts": {
|
||||
"prepare": "husky install",
|
||||
"husky:pre-commit": "lint-staged",
|
||||
"clean": "pnpm recursive run clean",
|
||||
"build": "pnpm recursive run build --filter=!@verdaccio/website",
|
||||
"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 44 \"**/*.{js,jsx,ts,tsx}\"",
|
||||
"lint": "eslint --max-warnings 100 \"**/*.{js,jsx,ts,tsx}\"",
|
||||
"test": "pnpm recursive test --filter ./packages",
|
||||
"test:e2e:cli": "pnpm test --filter ...@verdaccio/e2e-cli",
|
||||
"test:e2e:cli": "pnpm test --filter ...@verdaccio/e2e-* -- --coverage=false",
|
||||
"test:e2e:ui": "pnpm test --filter ...@verdaccio/e2e-ui",
|
||||
"start": "concurrently --kill-others \"pnpm _start:server\" \"pnpm _start:web\"",
|
||||
"benchmark:hyper": "verdaccio-benchmark hyper -r ./hyper-results.json",
|
||||
@@ -130,7 +133,7 @@
|
||||
"_debug:reload": "nodemon -d 3 packages/verdaccio/debug/bootstrap.js",
|
||||
"start:ts": "ts-node packages/verdaccio/src/start.ts -- --listen 8000",
|
||||
"debug": "node --trace-warnings --trace-uncaught --inspect packages/verdaccio/debug/bootstrap.js",
|
||||
"debug:fastify": "node --trace-warnings --trace-uncaught --inspect packages/verdaccio/debug/bootstrap.js -- fastify-server",
|
||||
"debug:fastify": "cross-env VERDACCIO_SERVER=fastify node --trace-warnings --trace-uncaught --inspect packages/verdaccio/debug/bootstrap.js",
|
||||
"debug:break": "node --trace-warnings --trace-uncaught --inspect-brk packages/verdaccio/debug/bootstrap.js",
|
||||
"changeset": "changeset",
|
||||
"changeset:check": "changeset status --since-master",
|
||||
@@ -145,6 +148,10 @@
|
||||
"crowdin:sync": "pnpm crowdin:upload && pnpm crowdin:download --verbose",
|
||||
"postinstall": "husky install"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.5",
|
||||
"pnpm": ">=6.32.3 <7.0.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,ts,tsx,json,yml,yaml,md}": "prettier --write",
|
||||
|
||||
@@ -1,5 +1,183 @@
|
||||
# @verdaccio/api
|
||||
|
||||
## 6.0.0-6-next.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
|
||||
- Updated dependencies [351aeeaa]
|
||||
- @verdaccio/auth@6.0.0-6-next.24
|
||||
- @verdaccio/core@6.0.0-6-next.7
|
||||
- @verdaccio/logger@6.0.0-6-next.13
|
||||
- @verdaccio/store@6.0.0-6-next.25
|
||||
- @verdaccio/middleware@6.0.0-6-next.24
|
||||
- @verdaccio/config@6.0.0-6-next.16
|
||||
- @verdaccio/utils@6.0.0-6-next.13
|
||||
|
||||
## 6.0.0-6-next.27
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 37274e4c: feat: implement abbreviated manifest
|
||||
|
||||
Enable abbreviated manifest data by adding the header:
|
||||
|
||||
```
|
||||
curl -H "Accept: application/vnd.npm.install-v1+json" https://registry.npmjs.org/verdaccio
|
||||
```
|
||||
|
||||
It returns a filtered manifest, additionally includes the [time](https://github.com/pnpm/rfcs/pull/2) field by request.
|
||||
|
||||
Current support for packages managers:
|
||||
|
||||
- npm: yes
|
||||
- pnpm: yes
|
||||
- yarn classic: yes
|
||||
- yarn modern (+2.x): [no](https://github.com/yarnpkg/berry/pull/3981#issuecomment-1076566096)
|
||||
|
||||
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [37274e4c]
|
||||
- @verdaccio/store@6.0.0-6-next.24
|
||||
- @verdaccio/auth@6.0.0-6-next.23
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- @verdaccio/logger@6.0.0-6-next.12
|
||||
|
||||
## 6.0.0-6-next.26
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 292c0a37: feat!: replace deprecated request dependency by got
|
||||
|
||||
This is a big refactoring of the core, fetching dependencies, improve code, more tests and better stability. This is essential for the next release, will take some time but would allow modularize more the core.
|
||||
|
||||
## Notes
|
||||
|
||||
- Remove deprecated `request` by other `got`, retry improved, custom Agent ( got does not include it built-in)
|
||||
- Remove `async` dependency from storage (used by core) it was linked with proxy somehow safe to remove now
|
||||
- Refactor with promises instead callback wherever is possible
|
||||
- ~Document the API~
|
||||
- Improve testing, integration tests
|
||||
- Bugfix
|
||||
- Clean up old validations
|
||||
- Improve performance
|
||||
|
||||
## 💥 Breaking changes
|
||||
|
||||
- Plugin API methods were callbacks based are returning promises, this will break current storage plugins, check documentation for upgrade.
|
||||
- Write Tarball, Read Tarball methods parameters change, a new set of options like `AbortController` signals are being provided to the `addAbortSignal` can be internally used with Streams when a request is aborted. eg: `addAbortSignal(signal, fs.createReadStream(pathName));`
|
||||
- `@verdaccio/streams` stream abort support is legacy is being deprecated removed
|
||||
- Remove AWS and Google Cloud packages for future refactoring [#2574](https://github.com/verdaccio/verdaccio/pull/2574).
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 00d1d2a1: chore: env variable for launch fastify
|
||||
|
||||
- Update fastify to major release `v4.3.0`
|
||||
- Update CLI launcher
|
||||
|
||||
via CLI
|
||||
|
||||
```
|
||||
VERDACCIO_SERVER=fastify verdaccio
|
||||
```
|
||||
|
||||
with docker
|
||||
|
||||
```
|
||||
docker run -it --rm --name verdaccio \
|
||||
-e "VERDACCIO_SERVER=8080" -p 8080:8080 \
|
||||
-e "VERDACCIO_SERVER=fastify" \
|
||||
verdaccio/verdaccio
|
||||
```
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [292c0a37]
|
||||
- Updated dependencies [a3a209b5]
|
||||
- Updated dependencies [00d1d2a1]
|
||||
- @verdaccio/auth@6.0.0-6-next.23
|
||||
- @verdaccio/config@6.0.0-6-next.15
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- @verdaccio/logger@6.0.0-6-next.12
|
||||
- @verdaccio/middleware@6.0.0-6-next.23
|
||||
- @verdaccio/store@6.0.0-6-next.23
|
||||
- @verdaccio/utils@6.0.0-6-next.12
|
||||
|
||||
## 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
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
const debug = require('debug')('verdaccio:test');
|
||||
|
||||
const setup = debug;
|
||||
const logger = {
|
||||
child: jest.fn(() => ({
|
||||
debug,
|
||||
trace: debug,
|
||||
warn: debug,
|
||||
info: debug,
|
||||
error: debug,
|
||||
fatal: debug,
|
||||
})),
|
||||
debug: debug,
|
||||
trace: debug,
|
||||
warn: debug,
|
||||
info: debug,
|
||||
error: debug,
|
||||
fatal: debug,
|
||||
};
|
||||
|
||||
export { setup, logger };
|
||||
@@ -1,3 +1,10 @@
|
||||
const config = require('../../jest/config');
|
||||
|
||||
module.exports = Object.assign({}, config, {});
|
||||
module.exports = Object.assign({}, config, {
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
// FIXME: increase to 90
|
||||
lines: 60,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/api",
|
||||
"version": "6.0.0-6-next.22",
|
||||
"version": "6.0.0-6-next.28",
|
||||
"description": "loaders logic",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
"test": "cross-env NODE_ENV=test BABEL_ENV=test jest",
|
||||
"test": "jest",
|
||||
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
||||
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
||||
"build:js": "babel src/ --out-dir build/ --copy-files --extensions \".ts,.tsx\" --source-maps",
|
||||
@@ -39,29 +39,30 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.19",
|
||||
"@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.12",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.10",
|
||||
"@verdaccio/middleware": "workspace:6.0.0-6-next.19",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.19",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.10",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.24",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.16",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.13",
|
||||
"@verdaccio/middleware": "workspace:6.0.0-6-next.24",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.25",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.13",
|
||||
"abortcontroller-polyfill": "1.7.3",
|
||||
"cookies": "0.8.0",
|
||||
"debug": "4.3.3",
|
||||
"body-parser": "1.19.1",
|
||||
"express": "4.17.2",
|
||||
"debug": "4.3.4",
|
||||
"body-parser": "1.20.0",
|
||||
"express": "4.18.1",
|
||||
"lodash": "4.17.21",
|
||||
"mime": "2.6.0",
|
||||
"semver": "7.3.5"
|
||||
"semver": "7.3.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "16.11.21",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.27",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.10",
|
||||
"@verdaccio/helper": "1.0.0",
|
||||
"supertest": "6.2.2"
|
||||
"@types/node": "16.11.56",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.34",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.15",
|
||||
"@verdaccio/test-helper": "workspace:1.1.0-6-next.3",
|
||||
"supertest": "6.2.4",
|
||||
"nock": "13.2.9",
|
||||
"mockdate": "3.0.5"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -3,106 +3,119 @@ import _ from 'lodash';
|
||||
import mime from 'mime';
|
||||
|
||||
import { IAuth } from '@verdaccio/auth';
|
||||
import { VerdaccioError, constants } from '@verdaccio/core';
|
||||
import { constants, errorUtils } from '@verdaccio/core';
|
||||
import { allow, media } from '@verdaccio/middleware';
|
||||
import { Storage } from '@verdaccio/store';
|
||||
import { Package } from '@verdaccio/types';
|
||||
|
||||
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types/custom';
|
||||
|
||||
export default function (route: Router, auth: IAuth, storage: Storage): void {
|
||||
const can = allow(auth);
|
||||
const tag_package_version = function (
|
||||
const addTagPackageVersionMiddleware = async function (
|
||||
req: $RequestExtend,
|
||||
res: $ResponseExtend,
|
||||
next: $NextFunctionVer
|
||||
): $NextFunctionVer {
|
||||
): Promise<$NextFunctionVer> {
|
||||
if (_.isString(req.body) === false) {
|
||||
return next('route');
|
||||
return next(errorUtils.getBadRequest('version is missing'));
|
||||
}
|
||||
|
||||
const tags = {};
|
||||
tags[req.params.tag] = req.body;
|
||||
storage.mergeTags(req.params.package, tags, function (err: Error): $NextFunctionVer {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
try {
|
||||
await storage.mergeTagsNext(req.params.package, tags);
|
||||
res.status(constants.HTTP_STATUS.CREATED);
|
||||
return next({ ok: constants.API_MESSAGE.TAG_ADDED });
|
||||
});
|
||||
return next({
|
||||
ok: constants.API_MESSAGE.TAG_ADDED,
|
||||
});
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
};
|
||||
|
||||
// tagging a package.
|
||||
route.put('/:package/:tag', can('publish'), media(mime.getType('json')), tag_package_version);
|
||||
|
||||
route.post(
|
||||
'/-/package/:package/dist-tags/:tag',
|
||||
route.put(
|
||||
'/:package/:tag',
|
||||
can('publish'),
|
||||
media(mime.getType('json')),
|
||||
tag_package_version
|
||||
addTagPackageVersionMiddleware
|
||||
);
|
||||
|
||||
route.put(
|
||||
'/-/package/:package/dist-tags/:tag',
|
||||
can('publish'),
|
||||
media(mime.getType('json')),
|
||||
tag_package_version
|
||||
addTagPackageVersionMiddleware
|
||||
);
|
||||
|
||||
route.delete(
|
||||
'/-/package/:package/dist-tags/:tag',
|
||||
can('publish'),
|
||||
function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
|
||||
async function (
|
||||
req: $RequestExtend,
|
||||
res: $ResponseExtend,
|
||||
next: $NextFunctionVer
|
||||
): Promise<void> {
|
||||
const tags = {};
|
||||
tags[req.params.tag] = null;
|
||||
storage.mergeTags(req.params.package, tags, function (err: VerdaccioError): $NextFunctionVer {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
try {
|
||||
await storage.mergeTagsNext(req.params.package, tags);
|
||||
res.status(constants.HTTP_STATUS.CREATED);
|
||||
return next({
|
||||
ok: constants.API_MESSAGE.TAG_REMOVED,
|
||||
});
|
||||
});
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
route.get(
|
||||
'/-/package/:package/dist-tags',
|
||||
can('access'),
|
||||
function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
|
||||
storage.getPackage({
|
||||
name: req.params.package,
|
||||
uplinksLook: true,
|
||||
req,
|
||||
callback: function (err: VerdaccioError, info: Package): $NextFunctionVer {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
next(info[constants.DIST_TAGS]);
|
||||
},
|
||||
});
|
||||
async function (
|
||||
req: $RequestExtend,
|
||||
res: $ResponseExtend,
|
||||
next: $NextFunctionVer
|
||||
): Promise<void> {
|
||||
const name = req.params.package;
|
||||
const requestOptions = {
|
||||
protocol: req.protocol,
|
||||
headers: req.headers as any,
|
||||
// FIXME: if we migrate to req.hostname, the port is not longer included.
|
||||
host: req.host,
|
||||
remoteAddress: req.socket.remoteAddress,
|
||||
};
|
||||
try {
|
||||
const manifest = await storage.getPackageByOptions({
|
||||
name,
|
||||
uplinksLook: true,
|
||||
requestOptions,
|
||||
});
|
||||
next(manifest[constants.DIST_TAGS]);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
route.post(
|
||||
'/-/package/:package/dist-tags',
|
||||
can('publish'),
|
||||
function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
|
||||
storage.mergeTags(
|
||||
req.params.package,
|
||||
req.body,
|
||||
function (err: VerdaccioError): $NextFunctionVer {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
res.status(constants.HTTP_STATUS.CREATED);
|
||||
return next({
|
||||
ok: constants.API_MESSAGE.TAG_UPDATED,
|
||||
});
|
||||
}
|
||||
);
|
||||
async function (
|
||||
req: $RequestExtend,
|
||||
res: $ResponseExtend,
|
||||
next: $NextFunctionVer
|
||||
): Promise<void> {
|
||||
try {
|
||||
await storage.mergeTagsNext(req.params.package, req.body);
|
||||
res.status(constants.HTTP_STATUS.CREATED);
|
||||
return next({
|
||||
ok: constants.API_MESSAGE.TAG_UPDATED,
|
||||
});
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user