Compare commits
156 Commits
@verdaccio
...
@verdaccio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d22673c61d | ||
|
|
2f835ac09e | ||
|
|
852324c321 | ||
|
|
54606976c3 | ||
|
|
484ecae3d2 | ||
|
|
235d350dc1 | ||
|
|
af90e35cd1 | ||
|
|
791988a9aa | ||
|
|
64cfedb805 | ||
|
|
bf36b9477c | ||
|
|
737684e592 | ||
|
|
e6fc774d44 | ||
|
|
1adb22553a | ||
|
|
93dd256b21 | ||
|
|
404ab31e06 | ||
|
|
8897bdeb5d | ||
|
|
717a36dd94 | ||
|
|
25e0d4cb67 | ||
|
|
7ab5f0167e | ||
|
|
07488a9ddb | ||
|
|
96d7295e55 | ||
|
|
af7d493b80 | ||
|
|
9d93a9a6b2 | ||
|
|
4d44a91d89 | ||
|
|
52be1eccb0 | ||
|
|
00942e6d20 | ||
|
|
0041d9407d | ||
|
|
3dc8591e26 | ||
|
|
ce013d2fcc | ||
|
|
6ad13de884 | ||
|
|
0783eeec1e | ||
|
|
d4e6a6e2bf | ||
|
|
0ebac198ce | ||
|
|
269105ff4b | ||
|
|
0277180576 | ||
|
|
d4019f6349 | ||
|
|
2c0d5ceab8 | ||
|
|
810bf8c40c | ||
|
|
979d6639d3 | ||
|
|
fd970b30d5 | ||
|
|
722c88b1d6 | ||
|
|
bd3ae17971 | ||
|
|
69d0c621e7 | ||
|
|
e364d073d7 | ||
|
|
40ceb59d76 | ||
|
|
18348940c4 | ||
|
|
f62dadc223 | ||
|
|
031bcf0b14 | ||
|
|
a249ab7b5a | ||
|
|
62c24b6321 | ||
|
|
8adee83d51 | ||
|
|
ccabb4b876 | ||
|
|
c3f287bc04 | ||
|
|
9fc2e79611 | ||
|
|
98afd48378 | ||
|
|
399538fd4d | ||
|
|
97c464faa6 | ||
|
|
7771955c6a | ||
|
|
d0e24756f0 | ||
|
|
820e5a905a | ||
|
|
19a33b4072 | ||
|
|
f21a9ee7ab | ||
|
|
6d2bf05036 | ||
|
|
43f32687cd | ||
|
|
97078c9084 | ||
|
|
e9846ba468 | ||
|
|
3c2f5741f4 | ||
|
|
85413ae8b6 | ||
|
|
cbff8e4e31 | ||
|
|
e24eb59237 | ||
|
|
8297e2b36e | ||
|
|
020ede43f6 | ||
|
|
dd177d7166 | ||
|
|
5e53e168d4 | ||
|
|
e9ff724b68 | ||
|
|
5a61cdd0cf | ||
|
|
b849128ded | ||
|
|
efa2efe531 | ||
|
|
62ef397df1 | ||
|
|
e8fd4daf78 | ||
|
|
acc5862323 | ||
|
|
43c164efe0 | ||
|
|
cd02e8d56a | ||
|
|
5b270bdd06 | ||
|
|
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 |
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
|
||||
|
||||
8
.changeset/chilly-glasses-occur.md
Normal file
8
.changeset/chilly-glasses-occur.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
'@verdaccio/api': patch
|
||||
'@verdaccio/core': patch
|
||||
'@verdaccio/server-fastify': patch
|
||||
'@verdaccio/store': patch
|
||||
---
|
||||
|
||||
fix: abbreviated headers handle quality values
|
||||
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
|
||||
@@ -2,9 +2,17 @@
|
||||
"$schema": "https://unpkg.com/@changesets/config@1.3.0/schema.json",
|
||||
"changelog": "@changesets/cli/changelog",
|
||||
"commit": false,
|
||||
"linked": [],
|
||||
"fixed": [
|
||||
[
|
||||
"verdaccio",
|
||||
"@verdaccio/cli",
|
||||
"@verdaccio/core",
|
||||
"@verdaccio/config",
|
||||
"@verdaccio/node-api",
|
||||
"@verdaccio/ui-theme"
|
||||
]
|
||||
],
|
||||
"access": "public",
|
||||
"baseBranch": "master",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": []
|
||||
"updateInternalDependencies": "patch"
|
||||
}
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
'@verdaccio/auth': major
|
||||
'@verdaccio/cli': major
|
||||
'@verdaccio/config': major
|
||||
'@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
|
||||
@@ -19,7 +18,6 @@
|
||||
'@verdaccio/server': major
|
||||
'@verdaccio/store': major
|
||||
'@verdaccio/eslint-config': major
|
||||
'@verdaccio/dev-types': major
|
||||
'@verdaccio/utils': major
|
||||
'verdaccio': major
|
||||
'@verdaccio/web': major
|
||||
|
||||
76
.changeset/early-jokes-nail.md
Normal file
76
.changeset/early-jokes-nail.md
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
'@verdaccio/api': major
|
||||
'@verdaccio/auth': major
|
||||
'@verdaccio/config': major
|
||||
'@verdaccio/types': major
|
||||
'@verdaccio/loaders': major
|
||||
'@verdaccio/node-api': major
|
||||
'verdaccio-audit': major
|
||||
'verdaccio-auth-memory': major
|
||||
'verdaccio-htpasswd': major
|
||||
'@verdaccio/local-storage': major
|
||||
'verdaccio-memory': major
|
||||
'@verdaccio/server': major
|
||||
'@verdaccio/server-fastify': major
|
||||
'@verdaccio/store': major
|
||||
'@verdaccio/test-helper': major
|
||||
'customprefix-auth': major
|
||||
'verdaccio': major
|
||||
'@verdaccio/web': major
|
||||
---
|
||||
|
||||
feat(plugins): improve plugin loader
|
||||
|
||||
### Changes
|
||||
|
||||
- Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
|
||||
- Avoid config collisions https://github.com/verdaccio/verdaccio/issues/928
|
||||
- https://github.com/verdaccio/verdaccio/issues/1394
|
||||
- `config.plugins` plugin path validations
|
||||
- Updated algorithm for plugin loader.
|
||||
- improved documentation (included dev)
|
||||
|
||||
## Features
|
||||
|
||||
- Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
|
||||
- Custom prefix:
|
||||
|
||||
```
|
||||
// config.yaml
|
||||
server:
|
||||
pluginPrefix: mycompany
|
||||
middleware:
|
||||
audit:
|
||||
foo: 1
|
||||
```
|
||||
|
||||
This configuration will look up for `mycompany-audit` instead `Verdaccio-audit`.
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
### sinopia plugins
|
||||
|
||||
- `sinopia` fallback support is removed, but can be restored using `pluginPrefix`
|
||||
|
||||
### plugin filter
|
||||
|
||||
- method rename `filter_metadata`->`filterMetadata`
|
||||
|
||||
### Plugin constructor does not merge configs anymore https://github.com/verdaccio/verdaccio/issues/928
|
||||
|
||||
The plugin receives as first argument `config`, which represents the config of the plugin. Example:
|
||||
|
||||
```
|
||||
// config.yaml
|
||||
auth:
|
||||
plugin:
|
||||
foo: 1
|
||||
bar: 2
|
||||
|
||||
export class Plugin<T> {
|
||||
public constructor(config: T, options: PluginOptions) {
|
||||
console.log(config);
|
||||
// {foo:1, bar: 2}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -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
|
||||
@@ -28,7 +27,6 @@
|
||||
'@verdaccio/server': major
|
||||
'@verdaccio/cli-standalone': major
|
||||
'@verdaccio/store': major
|
||||
'@verdaccio/dev-types': major
|
||||
'@verdaccio/utils': major
|
||||
'verdaccio': major
|
||||
'@verdaccio/web': 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
|
||||
@@ -3,7 +3,6 @@
|
||||
'@verdaccio/auth': major
|
||||
'@verdaccio/cli': major
|
||||
'@verdaccio/config': major
|
||||
'@verdaccio/commons-api': major
|
||||
'@verdaccio/file-locking': major
|
||||
'verdaccio-htpasswd': major
|
||||
'@verdaccio/local-storage': major
|
||||
@@ -15,7 +14,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
|
||||
@@ -26,11 +24,9 @@
|
||||
'@verdaccio/proxy': major
|
||||
'@verdaccio/server': major
|
||||
'@verdaccio/store': major
|
||||
'@verdaccio/dev-types': major
|
||||
'@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
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
'@verdaccio/auth': major
|
||||
'@verdaccio/cli': major
|
||||
'@verdaccio/config': major
|
||||
'@verdaccio/commons-api': major
|
||||
'@verdaccio/file-locking': major
|
||||
'verdaccio-htpasswd': major
|
||||
'@verdaccio/local-storage': major
|
||||
@@ -15,12 +14,10 @@
|
||||
'@verdaccio/logger': major
|
||||
'@verdaccio/logger-prettify': major
|
||||
'@verdaccio/middleware': major
|
||||
'@verdaccio/mock': major
|
||||
'@verdaccio/node-api': major
|
||||
'@verdaccio/proxy': major
|
||||
'@verdaccio/server': major
|
||||
'@verdaccio/store': major
|
||||
'@verdaccio/dev-types': major
|
||||
'@verdaccio/utils': major
|
||||
'verdaccio': major
|
||||
'@verdaccio/web': 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
|
||||
```
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
'@verdaccio/cli': minor
|
||||
'@verdaccio/fastify-migration': minor
|
||||
'@verdaccio/server-fastify': minor
|
||||
---
|
||||
|
||||
[Fastify] Add ping endpoint
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
'@verdaccio/auth': patch
|
||||
'@verdaccio/cli': patch
|
||||
'@verdaccio/config': patch
|
||||
'@verdaccio/commons-api': patch
|
||||
'@verdaccio/file-locking': patch
|
||||
'verdaccio-htpasswd': patch
|
||||
'@verdaccio/readme': patch
|
||||
@@ -17,7 +16,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
|
||||
@@ -27,13 +25,9 @@
|
||||
'verdaccio-memory': patch
|
||||
'@verdaccio/proxy': patch
|
||||
'@verdaccio/store': patch
|
||||
'@verdaccio/dev-types': patch
|
||||
'@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
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
'@verdaccio/tarball': patch
|
||||
'@verdaccio/mock': patch
|
||||
'@verdaccio/ui-theme': patch
|
||||
'@verdaccio/server': patch
|
||||
'@verdaccio/utils': patch
|
||||
|
||||
5
.changeset/modern-maps-lie.md
Normal file
5
.changeset/modern-maps-lie.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
---
|
||||
|
||||
Hide search icon on medium or larger devices
|
||||
5
.changeset/moody-clocks-roll.md
Normal file
5
.changeset/moody-clocks-roll.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/cli': patch
|
||||
---
|
||||
|
||||
fix: version with breakline
|
||||
@@ -3,7 +3,6 @@
|
||||
'@verdaccio/auth': minor
|
||||
'@verdaccio/cli': minor
|
||||
'@verdaccio/config': minor
|
||||
'@verdaccio/commons-api': minor
|
||||
'@verdaccio/file-locking': minor
|
||||
'verdaccio-htpasswd': minor
|
||||
'@verdaccio/local-storage': minor
|
||||
@@ -15,7 +14,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
|
||||
@@ -27,7 +25,6 @@
|
||||
'@verdaccio/proxy': minor
|
||||
'@verdaccio/server': minor
|
||||
'@verdaccio/store': minor
|
||||
'@verdaccio/dev-types': minor
|
||||
'@verdaccio/utils': minor
|
||||
'verdaccio': minor
|
||||
'@verdaccio/web': minor
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
'@verdaccio/auth': minor
|
||||
'@verdaccio/cli': minor
|
||||
'@verdaccio/config': minor
|
||||
'@verdaccio/commons-api': minor
|
||||
'@verdaccio/file-locking': minor
|
||||
'verdaccio-htpasswd': minor
|
||||
'@verdaccio/local-storage': minor
|
||||
@@ -15,16 +14,13 @@
|
||||
'@verdaccio/logger': minor
|
||||
'@verdaccio/logger-prettify': minor
|
||||
'@verdaccio/middleware': minor
|
||||
'@verdaccio/mock': minor
|
||||
'@verdaccio/node-api': minor
|
||||
'@verdaccio/proxy': minor
|
||||
'@verdaccio/server': minor
|
||||
'@verdaccio/store': minor
|
||||
'@verdaccio/dev-types': minor
|
||||
'@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,32 +31,50 @@
|
||||
"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/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",
|
||||
"@verdaccio/local-publish": "0.0.1",
|
||||
"@verdaccio/e2e-cli-npm9": "1.0.1-6-next.5",
|
||||
"@verdaccio/e2e-ui": "2.0.0-6-next.3",
|
||||
"customprefix-auth": "0.0.1",
|
||||
"@verdaccio/crowdin-translations": "1.0.0"
|
||||
},
|
||||
"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",
|
||||
"chilly-glasses-occur",
|
||||
"clever-pugs-warn",
|
||||
"dry-planes-tap",
|
||||
"dull-monkeys-search",
|
||||
"early-jokes-nail",
|
||||
"eleven-brooms-hunt",
|
||||
"eleven-spoons-matter",
|
||||
"fair-lemons-beam",
|
||||
"famous-tigers-doubt",
|
||||
"few-cooks-destroy",
|
||||
"few-mangos-grow",
|
||||
"fifty-jars-rest",
|
||||
@@ -67,6 +83,7 @@
|
||||
"gentle-parrots-lay",
|
||||
"gentle-trains-switch",
|
||||
"gold-vans-tease",
|
||||
"green-yaks-divide",
|
||||
"healthy-bikes-behave",
|
||||
"healthy-pants-smash",
|
||||
"healthy-poets-compare",
|
||||
@@ -80,7 +97,9 @@
|
||||
"loud-shoes-jog",
|
||||
"lovely-drinks-argue",
|
||||
"many-vans-care",
|
||||
"modern-maps-lie",
|
||||
"modern-spies-tell",
|
||||
"moody-clocks-roll",
|
||||
"neat-toes-report",
|
||||
"neat-toys-float",
|
||||
"olive-candles-speak",
|
||||
@@ -96,16 +115,21 @@
|
||||
"proud-jobs-hope",
|
||||
"red-chefs-float",
|
||||
"red-yaks-sell",
|
||||
"rich-badgers-begin",
|
||||
"rich-ghosts-rule",
|
||||
"shaggy-carrots-unite",
|
||||
"shaggy-parrots-smash",
|
||||
"shiny-chefs-heal",
|
||||
"shy-ducks-cover",
|
||||
"slow-carrots-relate",
|
||||
"smart-apricots-kneel",
|
||||
"smart-beds-cross",
|
||||
"smooth-owls-pump",
|
||||
"sour-buses-shout",
|
||||
"sour-maps-live",
|
||||
"spicy-frogs-press",
|
||||
"spicy-snakes-sip",
|
||||
"strange-ladybugs-nail",
|
||||
"swift-pumpkins-knock",
|
||||
"ten-parents-breathe",
|
||||
"tender-bags-call",
|
||||
@@ -114,7 +138,10 @@
|
||||
"three-moles-drop",
|
||||
"three-pots-sit",
|
||||
"tiny-seals-join",
|
||||
"tricky-taxis-watch",
|
||||
"two-dolls-check",
|
||||
"wild-jokes-beam"
|
||||
"unlucky-hairs-wonder",
|
||||
"wild-jokes-beam",
|
||||
"witty-ties-speak"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
'@verdaccio/auth': patch
|
||||
'@verdaccio/cli': patch
|
||||
'@verdaccio/config': patch
|
||||
'@verdaccio/commons-api': patch
|
||||
'@verdaccio/file-locking': patch
|
||||
'verdaccio-htpasswd': patch
|
||||
'@verdaccio/local-storage': patch
|
||||
@@ -19,7 +18,6 @@
|
||||
'@verdaccio/proxy': patch
|
||||
'@verdaccio/server': patch
|
||||
'@verdaccio/store': patch
|
||||
'@verdaccio/dev-types': patch
|
||||
'@verdaccio/utils': patch
|
||||
'verdaccio': patch
|
||||
'@verdaccio/web': patch
|
||||
|
||||
@@ -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
|
||||
---
|
||||
|
||||
|
||||
@@ -14,11 +14,8 @@
|
||||
'@verdaccio/ui-theme': major
|
||||
'@verdaccio/proxy': major
|
||||
'@verdaccio/server': major
|
||||
'@verdaccio/mock': major
|
||||
'verdaccio': major
|
||||
'@verdaccio/web': major
|
||||
'@verdaccio/e2e-cli': major
|
||||
'@verdaccio/website': major
|
||||
---
|
||||
|
||||
feat!: config.logs throw an error, logging config not longer accept array or logs property
|
||||
|
||||
9
.changeset/rich-badgers-begin.md
Normal file
9
.changeset/rich-badgers-begin.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
'@verdaccio/api': minor
|
||||
'@verdaccio/url': minor
|
||||
'@verdaccio/store': minor
|
||||
'@verdaccio/test-helper': minor
|
||||
'verdaccio': minor
|
||||
---
|
||||
|
||||
refactor: npm star command support reimplemented
|
||||
@@ -1,10 +1,8 @@
|
||||
---
|
||||
'@verdaccio/types': major
|
||||
'@verdaccio/ui-theme': major
|
||||
'@verdaccio/dev-types': major
|
||||
'@verdaccio/web': major
|
||||
'@verdaccio/e2e-ui': major
|
||||
'@verdaccio/website': major
|
||||
---
|
||||
|
||||
feat: upgrade to material ui 5
|
||||
|
||||
13
.changeset/shy-ducks-cover.md
Normal file
13
.changeset/shy-ducks-cover.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
'@verdaccio/api': minor
|
||||
'@verdaccio/auth': minor
|
||||
'@verdaccio/config': minor
|
||||
'@verdaccio/core': minor
|
||||
'@verdaccio/types': minor
|
||||
'@verdaccio/server-fastify': minor
|
||||
'@verdaccio/store': minor
|
||||
'@verdaccio/utils': minor
|
||||
'@verdaccio/web': minor
|
||||
---
|
||||
|
||||
feat: add passwordValidationRegex property
|
||||
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
|
||||
|
||||
5
.changeset/sour-maps-live.md
Normal file
5
.changeset/sour-maps-live.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
---
|
||||
|
||||
Add links to "Current Tags" and sort them in descending order
|
||||
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
|
||||
---
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
'@verdaccio/auth': patch
|
||||
'@verdaccio/cli': patch
|
||||
'@verdaccio/config': patch
|
||||
'@verdaccio/commons-api': patch
|
||||
'@verdaccio/file-locking': patch
|
||||
'verdaccio-htpasswd': patch
|
||||
'@verdaccio/local-storage': patch
|
||||
@@ -14,12 +13,10 @@
|
||||
'@verdaccio/logger': patch
|
||||
'@verdaccio/logger-prettify': patch
|
||||
'@verdaccio/middleware': patch
|
||||
'@verdaccio/mock': patch
|
||||
'@verdaccio/node-api': patch
|
||||
'@verdaccio/proxy': patch
|
||||
'@verdaccio/server': patch
|
||||
'@verdaccio/store': patch
|
||||
'@verdaccio/dev-types': patch
|
||||
'@verdaccio/utils': patch
|
||||
'verdaccio': 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
|
||||
5
.changeset/unlucky-hairs-wonder.md
Normal file
5
.changeset/unlucky-hairs-wonder.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@verdaccio/ui-theme': patch
|
||||
---
|
||||
|
||||
feat: Display publication time on sidebar
|
||||
11
.changeset/witty-ties-speak.md
Normal file
11
.changeset/witty-ties-speak.md
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
'@verdaccio/api': patch
|
||||
'@verdaccio/cli': patch
|
||||
'@verdaccio/core': patch
|
||||
'@verdaccio/types': patch
|
||||
'@verdaccio/store': patch
|
||||
'@verdaccio/test-helper': patch
|
||||
'@verdaccio/local-publish': patch
|
||||
---
|
||||
|
||||
fix: handle upload scoped tarball
|
||||
@@ -12,3 +12,5 @@ dist/
|
||||
docs/
|
||||
test/functional/store/*
|
||||
docker-examples/**/lib/**/*.js
|
||||
test/cli/e2e-yarn4/bin/yarn-4.0.0-rc.14.cjs
|
||||
yarn.js
|
||||
|
||||
28
.github/workflows/benchmark.yml
vendored
28
.github/workflows/benchmark.yml
vendored
@@ -18,8 +18,8 @@ jobs:
|
||||
name: Prepare build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
- name: install pnpm
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: Cache .pnpm-store
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
- name: tar packages
|
||||
run: |
|
||||
tar -czvf ${{ github.workspace }}/pkg.tar.gz -C ${{ github.workspace }}/packages .
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
path: pkg.tar.gz
|
||||
@@ -65,11 +65,11 @@ jobs:
|
||||
name: Benchmark autocannon
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # tag=v3
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
- name: install pnpm
|
||||
# require fixed version
|
||||
run: sudo npm i pnpm@latest-6 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -90,7 +90,7 @@ jobs:
|
||||
shell: bash
|
||||
env:
|
||||
DEBUG: metrics*
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
|
||||
with:
|
||||
name: verdaccio-metrics-api
|
||||
path: ./api-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
@@ -126,11 +126,11 @@ jobs:
|
||||
name: Benchmark hyperfine
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: 16.x
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # tag=v3
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
- name: install pnpm
|
||||
# require fixed version
|
||||
run: sudo npm i pnpm@latest-6 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -156,7 +156,7 @@ jobs:
|
||||
shell: bash
|
||||
- name: rename
|
||||
run: mv ./hyper-results.json ./hyper-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3
|
||||
with:
|
||||
name: verdaccio-metrics
|
||||
path: ./hyper-results-${{matrix.verdaccioVersion}}-${{matrix.benchmark}}.json
|
||||
|
||||
13
.github/workflows/changesets.yml
vendored
13
.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@v3
|
||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: setup node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: 14
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
@@ -47,8 +47,7 @@ jobs:
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}
|
||||
- name: crowdin download
|
||||
env:
|
||||
CROWDIN_VERDACCIO_PROJECT_ID: ${{ secrets.CROWDIN_VERDACCIO_PROJECT_ID }}
|
||||
env:
|
||||
CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }}
|
||||
CONTEXT: production
|
||||
run: pnpm crowdin:download
|
||||
@@ -56,14 +55,16 @@ jobs:
|
||||
run: pnpm build
|
||||
|
||||
- name: create versions
|
||||
uses: verdaccio/changeset-action@master
|
||||
uses: changesets/action@master
|
||||
with:
|
||||
version: pnpm ci:version
|
||||
commit: 'chore: update versions'
|
||||
title: 'chore: update versions'
|
||||
publish: pnpm ci:publish
|
||||
createGithubReleases: false
|
||||
setupGitUser: false
|
||||
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
|
||||
|
||||
104
.github/workflows/ci.yml
vendored
104
.github/workflows/ci.yml
vendored
@@ -2,14 +2,12 @@ name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'changeset-release/master'
|
||||
pull_request:
|
||||
paths:
|
||||
- .changeset/**
|
||||
- .github/workflows/ci.yml
|
||||
- 'packages/**'
|
||||
- 'test/**'
|
||||
- 'docker-examples/**'
|
||||
- 'jest/**'
|
||||
- 'package.json'
|
||||
@@ -26,12 +24,14 @@ jobs:
|
||||
image: verdaccio/verdaccio:nightly-master
|
||||
ports:
|
||||
- 4873:4873
|
||||
env:
|
||||
NODE_ENV: production
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- name: Node
|
||||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- name: set store
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
|
||||
- name: Cache .pnpm-store
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
@@ -52,19 +52,19 @@ jobs:
|
||||
name: Lint
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- name: Node
|
||||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
run: pnpm recursive install --offline --frozen-lockfile --reporter=silence --ignore-scripts
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
format:
|
||||
@@ -72,19 +72,19 @@ jobs:
|
||||
name: Format
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- name: Use Node
|
||||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
run: pnpm recursive install --offline --frozen-lockfile --reporter=silence --ignore-scripts
|
||||
- name: Lint
|
||||
run: pnpm format:check
|
||||
build:
|
||||
@@ -92,25 +92,24 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
## Node 16 breaks UI test, jest issue
|
||||
node_version: [16, 17]
|
||||
os: [ubuntu-latest]
|
||||
node_version: [16, 18]
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
run: pnpm recursive install --offline --frozen-lockfile --reporter=silence --ignore-scripts --registry http://localhost:4873
|
||||
- name: build
|
||||
run: pnpm build
|
||||
- name: Test
|
||||
@@ -118,80 +117,51 @@ jobs:
|
||||
ci-e2e-ui:
|
||||
needs: [format, lint]
|
||||
runs-on: ubuntu-latest
|
||||
name: UI Test E2E Node 16
|
||||
name: UI Test E2E
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # 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
|
||||
run: pnpm recursive install --offline --frozen-lockfile --reporter=silence --registry http://localhost:4873
|
||||
- name: build
|
||||
run: pnpm build
|
||||
- name: Test UI
|
||||
run: pnpm test:e2e:ui
|
||||
# env:
|
||||
# DEBUG: verdaccio:e2e*
|
||||
# FIXME verify why fails on Node 16 (locally works fine)
|
||||
# ci-e2e-cli:
|
||||
# needs: [format, lint]
|
||||
# runs-on: ubuntu-latest
|
||||
# # TODO: fails on migrate to node 16, we need to check why
|
||||
# name: CLI Test E2E Node 16
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# - uses: actions/setup-node@v3
|
||||
# with:
|
||||
# node-version: 16
|
||||
# - name: Install pnpm
|
||||
# run: npm i pnpm@latest -g
|
||||
# - uses: actions/cache@v3
|
||||
# with:
|
||||
# path: ~/.pnpm-store
|
||||
# key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
# - name: Install
|
||||
# ## we need scripts, pupetter downloads aditional content
|
||||
# run: pnpm recursive install --frozen-lockfile
|
||||
# - name: build
|
||||
# run: pnpm build
|
||||
# - name: Test CLI
|
||||
# run: pnpm test:e2e:cli
|
||||
# env:
|
||||
# DEBUG: verdaccio*
|
||||
sync-translations:
|
||||
# needs: [ci-e2e-cli, ci-e2e-ui]
|
||||
needs: [ci-e2e-ui]
|
||||
runs-on: ubuntu-latest
|
||||
name: synchronize translations
|
||||
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # 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
|
||||
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
|
||||
- name: build
|
||||
run: pnpm build
|
||||
- name: generate website translations
|
||||
run: pnpm write-translations --filter ...@verdaccio/website
|
||||
- name: sync
|
||||
env:
|
||||
CROWDIN_VERDACCIO_PROJECT_ID: ${{ secrets.CROWDIN_VERDACCIO_PROJECT_ID }}
|
||||
CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }}
|
||||
CONTEXT: production
|
||||
run: pnpm crowdin:sync
|
||||
|
||||
8
.github/workflows/codeql-analysis.yml
vendored
8
.github/workflows/codeql-analysis.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2
|
||||
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
# with:
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -56,4 +56,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2
|
||||
|
||||
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@v3
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # tag=v1
|
||||
- uses: docker/setup-buildx-action@v1
|
||||
with:
|
||||
driver-opts: network=host
|
||||
|
||||
105
.github/workflows/e2e-ci.yml
vendored
Normal file
105
.github/workflows/e2e-ci.yml
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
name: E2E CLI
|
||||
|
||||
on: [pull_request]
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
name: setup e2e verdaccio
|
||||
services:
|
||||
verdaccio:
|
||||
image: verdaccio/verdaccio:nightly-master
|
||||
ports:
|
||||
- 4873:4873
|
||||
env:
|
||||
NODE_ENV: production
|
||||
steps:
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- name: Use Node
|
||||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- name: set store
|
||||
run: |
|
||||
mkdir ~/.pnpm-store
|
||||
pnpm config set store-dir ~/.pnpm-store
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --reporter=silence --ignore-scripts --registry http://localhost:4873
|
||||
- name: Cache .pnpm-store
|
||||
uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
pnpm-
|
||||
build:
|
||||
needs: [prepare]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --reporter=silence --registry http://localhost:4873
|
||||
- name: build
|
||||
run: pnpm build
|
||||
- name: Cache packages
|
||||
uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
id: cache-packages
|
||||
with:
|
||||
path: ./packages/
|
||||
key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
packages-
|
||||
# - name: Cache test
|
||||
# uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
# id: cache-test
|
||||
# with:
|
||||
# path: ./e2e/
|
||||
# key: test-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
||||
# restore-keys: |
|
||||
# test-
|
||||
e2e-cli:
|
||||
needs: [prepare, build]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
pkg: [npm6, npm7, npm8, npm9, pnpm6, pnpm7, yarn1, yarn2, yarn3, yarn4]
|
||||
name: ${{ matrix.pkg }} / ${{ matrix.os }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@6.32.15 -g
|
||||
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --offline --frozen-lockfile --reporter=silence --ignore-scripts --registry http://localhost:4873
|
||||
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: ./packages/
|
||||
key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
||||
# - uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
# with:
|
||||
# path: ./e2e/
|
||||
# key: test-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
|
||||
- name: build e2e
|
||||
run: pnpm run build --filter=./e2e
|
||||
- name: Test CLI
|
||||
run: NODE_ENV=production pnpm test --filter ...@verdaccio/e2e-cli-${{matrix.pkg}}
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: contributors
|
||||
name: static data
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -15,13 +15,13 @@ jobs:
|
||||
name: Run script
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v3
|
||||
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: 17.x
|
||||
node-version: 18.x
|
||||
- name: install pnpm
|
||||
run: sudo npm i pnpm@latest-6 -g
|
||||
- name: set store
|
||||
@@ -32,17 +32,23 @@ jobs:
|
||||
run: pnpm config set registry https://registry.verdaccio.org
|
||||
- name: install dependencies
|
||||
run: pnpm install
|
||||
- name: Build Translations percentage
|
||||
run: pnpm build --filter "@verdaccio/crowdin-translations"
|
||||
- name: update contributors
|
||||
run: pnpm run contributors
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: update translations
|
||||
run: pnpm run translations
|
||||
env:
|
||||
TOKEN: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }}
|
||||
- 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"
|
||||
message: "chore: updated static data"
|
||||
branch: master
|
||||
author_email: verdaccio.npm@gmail.com
|
||||
author_name: verdacciobot
|
||||
39
.github/workflows/website.yml
vendored
39
.github/workflows/website.yml
vendored
@@ -3,29 +3,26 @@ name: Verdaccio Website CI
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- 'website/**'
|
||||
- 'package.json'
|
||||
- './.github/workflows/website.yml'
|
||||
|
||||
- 'website/**'
|
||||
- './.github/workflows/website.yml'
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
|
||||
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Cache pnpm modules
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
env:
|
||||
cache-name: cache-pnpm-modules
|
||||
with:
|
||||
@@ -34,16 +31,18 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
|
||||
|
||||
- uses: pnpm/action-setup@v2.2.2
|
||||
- uses: pnpm/action-setup@10693b3829bf86eb2572aef5f3571dcf5ca9287d # tag=v2.2.2
|
||||
with:
|
||||
version: 6.32.15
|
||||
run_install: |
|
||||
- recursive: true
|
||||
args: [--frozen-lockfile]
|
||||
- name: Build Plugins
|
||||
run: pnpm build --filter "docusaurus-plugin-contributors"
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
- name: Build Translations percentage
|
||||
run: pnpm build --filter "@verdaccio/crowdin-translations"
|
||||
- name: Cache Docusaurus Build
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
|
||||
with:
|
||||
path: website/node_modules/.cache/webpack
|
||||
key: cache/webpack-${{github.ref}}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
@@ -55,14 +54,14 @@ jobs:
|
||||
- name: Build Production
|
||||
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
||||
env:
|
||||
CROWDIN_VERDACCIO_PROJECT_ID: ${{ secrets.CROWDIN_VERDACCIO_PROJECT_ID }}
|
||||
CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }}
|
||||
SENTRY_KEY: ${{ secrets.SENTRY_KEY }}
|
||||
CONTEXT: production
|
||||
run: pnpm netlify:build:production --filter ...@verdaccio/website
|
||||
|
||||
- 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 }}
|
||||
@@ -77,7 +76,7 @@ jobs:
|
||||
|
||||
- name: 🤖 Deploy Preview Netlify
|
||||
if: github.repository == 'verdaccio/verdaccio'
|
||||
uses: semoal/action-netlify-deploy@master
|
||||
uses: semoal/action-netlify-deploy@1a53f098745bf78555d11b436f5ee3af87e6b566
|
||||
id: netlify_preview
|
||||
with:
|
||||
draft: true
|
||||
@@ -92,7 +91,7 @@ jobs:
|
||||
- name: Audit preview URL with Lighthouse
|
||||
if: github.repository == 'verdaccio/verdaccio'
|
||||
id: lighthouse_audit
|
||||
uses: treosh/lighthouse-ci-action@9.3.0
|
||||
uses: treosh/lighthouse-ci-action@b4dfae3eb959c5226e2c5c6afd563d493188bfaf # tag=9.3.0
|
||||
with:
|
||||
urls: |
|
||||
${{ steps.netlify_preview.outputs.preview-url }}
|
||||
@@ -101,7 +100,7 @@ jobs:
|
||||
|
||||
- name: Format lighthouse score
|
||||
id: format_lighthouse_score
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@7dff1a87643417cf3b95bb10b29f4c4bc60d8ebd # tag=v6
|
||||
with:
|
||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||
script: |
|
||||
@@ -126,7 +125,7 @@ jobs:
|
||||
- name: Add comment to PR
|
||||
if: github.repository == 'verdaccio/verdaccio'
|
||||
id: comment_to_pr
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 # tag=v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
number: ${{ github.event.issue.number }}
|
||||
|
||||
11
.gitignore
vendored
11
.gitignore
vendored
@@ -46,7 +46,14 @@ api-results.json
|
||||
hyper-results.json
|
||||
hyper-results*.json
|
||||
api-results*.json
|
||||
.clinic/
|
||||
|
||||
#docs
|
||||
./api
|
||||
packages/core/core/docs
|
||||
website/docs/api/**/*.md
|
||||
website/docs/api/**/*.yml
|
||||
!website/docs/api/index.md
|
||||
packages/**/docs
|
||||
|
||||
# cypress
|
||||
e2e/ui/cypress/videos/**/*
|
||||
e2e/ui/cypress/screenshots/**/*
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@@ -8,5 +8,6 @@
|
||||
"storage_default_storage": true,
|
||||
".yarn": true
|
||||
},
|
||||
"editor.formatOnSave": true,
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
}
|
||||
|
||||
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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -183,7 +183,7 @@ a report in our [issue tracker](https://github.com/verdaccio/verdaccio/issues).
|
||||
- _Features clearly flagged as not supported_
|
||||
- _Node.js issues installation in any platform_: If you cannot install the
|
||||
global package (this is considered external issue)
|
||||
- Any ticket which has beed flagged as an [external issue
|
||||
- Any ticket which has been flagged as an [external issue
|
||||
](https://github.com/verdaccio/verdaccio/labels/external-issue)
|
||||
|
||||
If you intend to report a **security** issue, please follow our [Security policy
|
||||
@@ -234,7 +234,7 @@ the project. Adding in context and the use-case will really help!
|
||||
|
||||
- A detailed description the advantages of your request
|
||||
- Whether or not it's compatible with `npm`, `pnpm` and [_yarn classic_
|
||||
](https://github.com/yarnpkg/yarn) or [_yarn berry_
|
||||
](https://github.com/yarnpkg/yarn) or [_yarn modern_
|
||||
](https://github.com/yarnpkg/berry).
|
||||
- A potential implementation or design
|
||||
- Whatever else is on your mind! 🤓
|
||||
@@ -278,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
|
||||
@@ -420,3 +420,25 @@ If you want to develop your own plugin:
|
||||
3. You are free to host your plugin in your repository
|
||||
4. Provide a detailed description of your plugin to help users understand how to
|
||||
use it
|
||||
|
||||
## Testing your changes in a local registry
|
||||
|
||||
Once you have perform your changes in the code base, the build and tests passes you can publish a local version:
|
||||
|
||||
- Ensure you have build all modules (or the one you have modified)
|
||||
- Run `pnpm local:publish:release` to launch a local registry and publish all packages into it. This command will be alive until server is killed (Control Key + C)
|
||||
|
||||
```
|
||||
pnpm build
|
||||
pnpm local:publish:release
|
||||
```
|
||||
|
||||
The last step consist on install globally the package from the local registry.
|
||||
|
||||
```
|
||||
npm i -g verdaccio --registry=http://localhost:4873
|
||||
|
||||
verdaccio
|
||||
```
|
||||
|
||||
If you perform more changes in the source code, repeat this process, there is not _hot reloading_ support.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:16.15.0-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
|
||||
@@ -20,7 +20,7 @@ RUN npm -g i pnpm@6.32.15 && \
|
||||
# FIXME: need to remove devDependencies from the build
|
||||
# RUN pnpm install --prod --ignore-scripts
|
||||
|
||||
FROM node:16.15.0-alpine
|
||||
FROM node:16-alpine
|
||||
LABEL maintainer="https://github.com/verdaccio/verdaccio"
|
||||
|
||||
ENV VERDACCIO_APPDIR=/opt/verdaccio \
|
||||
|
||||
18
README.md
18
README.md
@@ -44,7 +44,19 @@ Google Cloud Storage** or create your own plugin.
|
||||
Install with npm:
|
||||
|
||||
```bash
|
||||
npm install --global verdaccio@6-next
|
||||
npm install --location=global verdaccio@6-next
|
||||
```
|
||||
|
||||
With `yarn`
|
||||
|
||||
```bash
|
||||
yarn global add verdaccio@6-next
|
||||
```
|
||||
|
||||
With `pnpm`
|
||||
|
||||
```bash
|
||||
pnpm i -g verdaccio@6-next
|
||||
```
|
||||
|
||||
or
|
||||
@@ -68,8 +80,8 @@ Furthermore, you can read the [**Debugging Guidelines**](https://github.com/verd
|
||||
You can develop your own [plugins](https://verdaccio.org/docs/plugins) with the [verdaccio generator](https://github.com/verdaccio/generator-verdaccio-plugin). Installing [Yeoman](https://yeoman.io/) is required.
|
||||
|
||||
```
|
||||
npm install -g yo
|
||||
npm install -g generator-verdaccio-plugin
|
||||
npm install --location=global yo
|
||||
npm install --location=global generator-verdaccio-plugin
|
||||
```
|
||||
|
||||
Learn more [here](https://verdaccio.org/docs/dev-plugins) how to develop plugins. Share your plugins with the community.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.4 KiB |
29
crowdin.yaml
29
crowdin.yaml
@@ -1,20 +1,19 @@
|
||||
project_id_env: CROWDIN_VERDACCIO_PROJECT_ID
|
||||
project_id: 295539
|
||||
api_token_env: CROWDIN_VERDACCIO_API_KEY
|
||||
# token local testing
|
||||
# api_token: token_secret
|
||||
|
||||
preserve_hierarchy: true
|
||||
|
||||
files:
|
||||
[
|
||||
{
|
||||
source: 'packages/plugins/ui-theme/src/i18n/crowdin/**/*',
|
||||
translation: '/packages/plugins/ui-theme/src/i18n/download_translations/%locale%/**/%original_file_name%',
|
||||
},
|
||||
{
|
||||
source: '/website/i18n/en/**/*',
|
||||
translation: '/website/i18n/%locale%/**/%original_file_name%',
|
||||
},
|
||||
{
|
||||
source: '/website/docs/**/*',
|
||||
translation: '/website/i18n/%locale%/docusaurus-plugin-content-docs/current/**/%original_file_name%',
|
||||
}
|
||||
]
|
||||
- source: /packages/plugins/ui-theme/src/i18n/crowdin/*.json
|
||||
translation: '/packages/plugins/ui-theme/src/i18n/download_translations/%locale%/%original_file_name%'
|
||||
- source: /website/i18n/en/**/*
|
||||
translation: '/website/i18n/%locale%/**/%original_file_name%'
|
||||
- source: /website/docs/**/*
|
||||
translation: '/website/i18n/%locale%/docusaurus-plugin-content-docs/current/**/%original_file_name%'
|
||||
ignore: [/website/docs/api/**/*]
|
||||
- source: /website/versioned_docs/**/*
|
||||
translation: /website/i18n/%locale%/docusaurus-plugin-content-docs/**/%original_file_name%
|
||||
ignore: [/website/versioned_docs/version-5.x/api/**/*]
|
||||
|
||||
@@ -66,6 +66,6 @@ middlewares:
|
||||
enabled: true
|
||||
|
||||
# log settings
|
||||
logs:
|
||||
log:
|
||||
- { type: stdout, format: pretty, level: trace }
|
||||
#- {type: file, path: verdaccio.log, level: info}
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
## Development notes
|
||||
|
||||
The `5.x` still under development, key points:
|
||||
|
||||
Ensure you have `nvm` installed or the latest Node.js (check `.nvmrc`
|
||||
for mode details).
|
||||
|
||||
```bash
|
||||
nvm install
|
||||
```
|
||||
|
||||
Verdaccio uses **pnpm** as monorepo management. To install
|
||||
|
||||
```bash
|
||||
npm i -g pnpm@latest-6
|
||||
```
|
||||
|
||||
Install all needed packages
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
```
|
||||
|
||||
For building the application:
|
||||
|
||||
```bash
|
||||
pnpm build
|
||||
```
|
||||
|
||||
Running the test
|
||||
|
||||
```
|
||||
pnpm test
|
||||
```
|
||||
|
||||
### Running the application (with UI hot reloading)
|
||||
|
||||
```bash
|
||||
pnpm start
|
||||
```
|
||||
|
||||
with hot reloading (server and UI), `nodemon` will restart the server and `babel` runs
|
||||
in watch mode.
|
||||
|
||||
```bash
|
||||
pnpm start:watch
|
||||
```
|
||||
|
||||
Running with `ts-node`
|
||||
|
||||
```
|
||||
pnpm start:ts
|
||||
```
|
||||
|
||||
### Running the Website
|
||||
|
||||
We use _Gatsbyjs_ as development stack for website,
|
||||
please [for more information check their official guidelines.](https://www.gatsbyjs.com/docs/quick-start/)
|
||||
|
||||
```
|
||||
pnpm website:develop
|
||||
```
|
||||
|
||||
### Running E2E
|
||||
|
||||
For running the CLI test
|
||||
|
||||
```
|
||||
pnpm test:e2e:cli
|
||||
```
|
||||
|
||||
For running the UI test
|
||||
|
||||
```
|
||||
pnpm test:e2e:ui
|
||||
```
|
||||
|
||||
### Linting
|
||||
|
||||
Linting the code.
|
||||
|
||||
```bash
|
||||
pnpm lint
|
||||
```
|
||||
|
||||
For website runs
|
||||
|
||||
```bash
|
||||
pnpm website:lint
|
||||
```
|
||||
|
||||
Formatting the code with prettier
|
||||
|
||||
```bash
|
||||
pnpm prettier
|
||||
```
|
||||
|
||||
### Debugging
|
||||
|
||||
Run the server in debug mode (it does not include UI hot reload)
|
||||
with `--inspect` support.
|
||||
|
||||
```
|
||||
pnpm debug
|
||||
pnpm debug:break
|
||||
```
|
||||
|
||||
> requires `pnpm build` previously
|
||||
|
||||
#### debug internal output
|
||||
|
||||
Each verdaccio module uses `debug`, use the namespaces in combination with filters to get a verbose output about each action, for example:
|
||||
|
||||
```
|
||||
DEBUG=verdaccio:* pnpm start
|
||||
```
|
||||
3
docs/plugins.md
Normal file
3
docs/plugins.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## Developing plugins
|
||||
|
||||
TBA
|
||||
@@ -3,4 +3,4 @@
|
||||
This folder is composed of two strategies:
|
||||
|
||||
- E2E for CLI
|
||||
- E2E for the UI (puppeteer)
|
||||
- E2E for the UI (cypress)
|
||||
79
e2e/cli/README.md
Normal file
79
e2e/cli/README.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# E2E CLI Testing
|
||||
|
||||
## What is included on these test?
|
||||
|
||||
- Default configuration only
|
||||
- Test with all popular package managers:
|
||||
- `yarn classic` and `yarn modern (2, 3, 4 RC)`
|
||||
- `pnpm 6, 7`
|
||||
- `npm 6, 7, 8 and 9`
|
||||
|
||||
### Commands Tested
|
||||
|
||||
| cmd | npm6 | npm7 | npm8 | npm9 | pnpm6 | pnpm7 | yarn1 | yarn2 | yarn3 | yarn4 |
|
||||
| --------- | ---- | ---- | ---- | ---- | ----- | ----- | ----- | ----- | ----- | ----- |
|
||||
| publish | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| info | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| audit | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
|
||||
| install | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| deprecate | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ | ⛔ |
|
||||
| ping | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ | ⛔ |
|
||||
| search | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ | ⛔ |
|
||||
| star | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ | ⛔ |
|
||||
| dist-tag | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
|
||||
|
||||
> notes:
|
||||
>
|
||||
> - yarn search cmd exist in _modern_ but, it do not uses the search registry endpoint.
|
||||
> - yarn _modern_ has two info commands, the one used here is `yarn npm info`
|
||||
|
||||
❌ = no tested
|
||||
✅ = tested
|
||||
⛔ = no supported
|
||||
|
||||
## How it works?
|
||||
|
||||
Every package manager + version is a package in the monorepo.
|
||||
|
||||
The package `@verdaccio/test-cli-commons` contains helpers used for each package manager.
|
||||
|
||||
```ts
|
||||
import { addRegistry, initialSetup, prepareGenericEmptyProject } from '@verdaccio/test-cli-commons';
|
||||
```
|
||||
|
||||
The registry can be executed with the following commands, the port is automatically assigned.
|
||||
|
||||
```ts
|
||||
// setup
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
// teardown
|
||||
registry.stop();
|
||||
```
|
||||
|
||||
The full url can be get from `registry.getRegistryUrl()`. The yarn modern does not allows the `--registry` so need a more complex step, while others is just enough adding the following to every command.
|
||||
|
||||
```ts
|
||||
await yarn({ cwd: tempFolder }, 'install', ...addRegistry(registry.getRegistryUrl()));
|
||||
```
|
||||
|
||||
The most of the command allow return output in JSON format which helps with the expects.
|
||||
|
||||
```ts
|
||||
const resp = await yarn(
|
||||
{ cwd: tempFolder },
|
||||
'audit',
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
const parsedBody = JSON.parse(resp.stdout as string);
|
||||
expect(parsedBody.type).toEqual('auditSummary');
|
||||
```
|
||||
|
||||
Every command should test either console output or in special cases look up the storage manually.
|
||||
|
||||
### What should not included on these tests?
|
||||
|
||||
- Anything is unrelated with client commands usage, eg: (auth permissions, third party integrations,
|
||||
hooks, plugins)
|
||||
58
e2e/cli/cli-commons/CHANGELOG.md
Normal file
58
e2e/cli/cli-commons/CHANGELOG.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# @verdaccio/test-cli-commons
|
||||
|
||||
## 1.0.1-6-next.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- verdaccio@6.0.0-6-next.47
|
||||
- @verdaccio/core@6.0.0-6-next.47
|
||||
- @verdaccio/config@6.0.0-6-next.47
|
||||
- @verdaccio/test-helper@1.1.0-6-next.4
|
||||
|
||||
## 1.0.1-6-next.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b849128d]
|
||||
- @verdaccio/core@6.0.0-6-next.8
|
||||
- @verdaccio/test-helper@1.1.0-6-next.4
|
||||
- verdaccio@6.0.0-6-next.46
|
||||
- @verdaccio/config@6.0.0-6-next.17
|
||||
|
||||
## 1.0.1-6-next.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
|
||||
- Updated dependencies [351aeeaa]
|
||||
- @verdaccio/core@6.0.0-6-next.7
|
||||
- @verdaccio/test-helper@1.1.0-6-next.3
|
||||
- verdaccio@6.0.0-6-next.45
|
||||
- @verdaccio/config@6.0.0-6-next.16
|
||||
|
||||
## 1.0.1-6-next.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- verdaccio@6.0.0-6-next.44
|
||||
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [37274e4c]
|
||||
- @verdaccio/test-helper@1.1.0-6-next.2
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- verdaccio@6.0.0-6-next.43
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [292c0a37]
|
||||
- Updated dependencies [a3a209b5]
|
||||
- Updated dependencies [00d1d2a1]
|
||||
- @verdaccio/config@6.0.0-6-next.15
|
||||
- @verdaccio/core@6.0.0-6-next.6
|
||||
- verdaccio@6.0.0-6-next.42
|
||||
- @verdaccio/test-helper@1.1.0-6-next.1
|
||||
25
e2e/cli/cli-commons/package.json
Normal file
25
e2e/cli/cli-commons/package.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/test-cli-commons",
|
||||
"version": "1.0.1-6-next.5",
|
||||
"main": "./build/index.js",
|
||||
"types": "./build/index.d.ts",
|
||||
"devDependencies": {
|
||||
"verdaccio": "workspace:6.0.0-6-next.49",
|
||||
"@verdaccio/core": "workspace:6.0.0-6-next.49",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.49",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.17",
|
||||
"yaml": "2.1.1",
|
||||
"debug": "4.3.4",
|
||||
"fs-extra": "10.1.0",
|
||||
"got": "11.8.5",
|
||||
"lodash": "4.17.21"
|
||||
},
|
||||
"scripts": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
17
e2e/cli/cli-commons/src/index.ts
Normal file
17
e2e/cli/cli-commons/src/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export { getDefaultConfig, ConfigBuilder } from '@verdaccio/config';
|
||||
export { constants } from '@verdaccio/core';
|
||||
export { Registry } from 'verdaccio';
|
||||
export { initialSetup, getConfigPath, Setup } from './registry';
|
||||
export {
|
||||
addNpmPrefix,
|
||||
addYarnClassicPrefix,
|
||||
addRegistry,
|
||||
prepareYarnModernProject,
|
||||
prepareGenericEmptyProject,
|
||||
nJSONParse,
|
||||
} from './utils';
|
||||
export { exec, ExecOutput } from './process';
|
||||
export { callRegistry } from './web';
|
||||
export * as npmUtils from './npm-utils';
|
||||
export * as pnpmUtils from './npm-utils';
|
||||
export * as yarnModernUtils from './yarn-modern-utils';
|
||||
29
e2e/cli/cli-commons/src/npm-utils.ts
Normal file
29
e2e/cli/cli-commons/src/npm-utils.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { addRegistry } from './utils';
|
||||
|
||||
export async function bumbUp(cmd, tempFolder, registry) {
|
||||
await cmd({ cwd: tempFolder }, 'version', 'minor', ...addRegistry(registry.getRegistryUrl()));
|
||||
}
|
||||
|
||||
export async function publish(cmd, tempFolder, pkgName, registry, arg: string[] = []) {
|
||||
const resp = await cmd(
|
||||
{ cwd: tempFolder },
|
||||
'publish',
|
||||
...arg,
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
const parsedBody = JSON.parse(resp.stdout as string);
|
||||
expect(parsedBody.name).toEqual(pkgName);
|
||||
}
|
||||
|
||||
export async function getInfoVersions(cmd, pkgName, registry) {
|
||||
const infoResp = await cmd(
|
||||
{},
|
||||
'info',
|
||||
pkgName,
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
const infoBody = JSON.parse(infoResp.stdout as string);
|
||||
return infoBody;
|
||||
}
|
||||
58
e2e/cli/cli-commons/src/process.ts
Normal file
58
e2e/cli/cli-commons/src/process.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import { spawn } from 'child_process';
|
||||
import { SpawnOptions } from 'child_process';
|
||||
import buildDebug from 'debug';
|
||||
import { createInterface } from 'readline';
|
||||
|
||||
const debug = buildDebug('verdaccio:e2e:process');
|
||||
|
||||
export type ExecOutput = {
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
};
|
||||
|
||||
export async function exec(options: SpawnOptions, cmd, args): Promise<ExecOutput> {
|
||||
debug('start _exec %o %o %o', options, cmd, args);
|
||||
let stdout = '';
|
||||
let stderr;
|
||||
const env = options.env;
|
||||
debug(`Running \`${cmd} ${args.join(' ')}`);
|
||||
debug(`CWD: %o`, options.cwd);
|
||||
debug(`ENV: ${JSON.stringify(env)}`);
|
||||
const spawnOptions = {
|
||||
cwd: options.cwd,
|
||||
stdio: options.stdio || 'pipe',
|
||||
env: process.env,
|
||||
};
|
||||
|
||||
if (process.platform.startsWith('win')) {
|
||||
args.unshift('/c', cmd);
|
||||
cmd = 'cmd.exe';
|
||||
spawnOptions['stdio'] = 'pipe';
|
||||
}
|
||||
|
||||
const childProcess = spawn(cmd, args, spawnOptions);
|
||||
// @ts-ignore
|
||||
const rl = createInterface({ input: childProcess.stdout });
|
||||
|
||||
rl.on('line', function (line) {
|
||||
stdout += line;
|
||||
});
|
||||
|
||||
const err = new Error(`Running "${cmd} ${args.join(' ')}" returned error code `);
|
||||
return new Promise((resolve, reject) => {
|
||||
childProcess.on('exit', (error) => {
|
||||
if (!error) {
|
||||
resolve({ stdout, stderr });
|
||||
} else {
|
||||
err.message += `${error}...\n\nSTDOUT:\n${stdout}\n\nSTDERR:\n${stderr}\n`;
|
||||
return reject({ stdout, stderr: err });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function silentNpm(...args): Promise<ExecOutput> {
|
||||
debug('run silent npm %o', args);
|
||||
// @ts-ignore
|
||||
return exec({ silent: true }, 'npm', args);
|
||||
}
|
||||
40
e2e/cli/cli-commons/src/registry.ts
Normal file
40
e2e/cli/cli-commons/src/registry.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
/* eslint-disable prefer-promise-reject-errors */
|
||||
import buildDebug from 'debug';
|
||||
import { merge } from 'lodash';
|
||||
import { Registry } from 'verdaccio';
|
||||
|
||||
import { getDefaultConfig } from '@verdaccio/config';
|
||||
import { ConfigYaml } from '@verdaccio/types';
|
||||
|
||||
const debug = buildDebug('verdaccio:e2e:registry-utils');
|
||||
|
||||
export type Setup = {
|
||||
registry: Registry;
|
||||
tempFolder: string;
|
||||
};
|
||||
|
||||
const log =
|
||||
process.env.NODE_ENV === 'production'
|
||||
? { type: 'stdout', format: 'json', level: 'warn' }
|
||||
: { type: 'stdout', format: 'pretty', level: 'info' };
|
||||
|
||||
const defaultConfig = {
|
||||
...getDefaultConfig(),
|
||||
log,
|
||||
};
|
||||
|
||||
export function getConfigPath(customConfig) {
|
||||
return Registry.fromConfigToPath({
|
||||
...customConfig,
|
||||
_debug: true,
|
||||
});
|
||||
}
|
||||
|
||||
export async function initialSetup(customConfig?: ConfigYaml): Promise<Setup> {
|
||||
const config = merge(defaultConfig, customConfig);
|
||||
const { configPath, tempFolder } = await getConfigPath(config);
|
||||
debug(`configPath %o`, configPath);
|
||||
debug(`tempFolder %o`, tempFolder);
|
||||
const registry = new Registry(configPath, { createUser: true });
|
||||
return { registry, tempFolder };
|
||||
}
|
||||
126
e2e/cli/cli-commons/src/utils.ts
Normal file
126
e2e/cli/cli-commons/src/utils.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import fs from 'fs-extra';
|
||||
import { cp, readFile, writeFile } from 'fs/promises';
|
||||
import { join } from 'path';
|
||||
|
||||
import { fileUtils } from '@verdaccio/core';
|
||||
|
||||
export function createProject(projectName: string) {
|
||||
// @ts-ignore
|
||||
const tempRootFolder = global.__namespace.getItem('dir-suite-root');
|
||||
const verdaccioInstall = join(tempRootFolder, projectName);
|
||||
fs.mkdirSync(verdaccioInstall);
|
||||
|
||||
return verdaccioInstall;
|
||||
}
|
||||
export function copyConfigFile(rootFolder, configTemplate): string {
|
||||
const configPath = join(rootFolder, 'config.yaml');
|
||||
copyTo(join(__dirname, configTemplate), configPath);
|
||||
|
||||
return configPath;
|
||||
}
|
||||
|
||||
export async function createTempFolder(prefix: string) {
|
||||
return fileUtils.createTempFolder(prefix);
|
||||
}
|
||||
|
||||
export function copyTo(from, to) {
|
||||
fs.copyFileSync(from, to);
|
||||
}
|
||||
|
||||
export function cleanUpTemp(tmpFolder) {
|
||||
fs.rmdirSync(tmpFolder, { recursive: true });
|
||||
}
|
||||
|
||||
export function addRegistry(registryUrl) {
|
||||
return ['--registry', registryUrl];
|
||||
}
|
||||
|
||||
export function addNpmPrefix(installFolder) {
|
||||
return ['--prefix', installFolder];
|
||||
}
|
||||
|
||||
export function addYarnClassicPrefix(installFolder) {
|
||||
// info regarding cwd flag
|
||||
// https://github.com/yarnpkg/yarn/pull/4174
|
||||
return ['--cwd', installFolder];
|
||||
}
|
||||
|
||||
export async function prepareYarnModernProject(
|
||||
templatePath: string,
|
||||
projectName: string,
|
||||
registryDomain: string,
|
||||
yarnPath: string
|
||||
) {
|
||||
const tempFolder = await createTempFolder(projectName);
|
||||
// FUTURE: native copy folder instead fs-extra
|
||||
fs.copySync(templatePath, tempFolder);
|
||||
const yamlPath = join(tempFolder, '.yarnrc.yml');
|
||||
const yamlContent = await readFile(yamlPath, 'utf8');
|
||||
const finalYamlContent = yamlContent.replace('${registry}', registryDomain);
|
||||
await writeFile(yamlPath, finalYamlContent);
|
||||
await cp(yarnPath, join(tempFolder, '.yarn/releases/yarn.js'), { dereference: true });
|
||||
return { tempFolder };
|
||||
}
|
||||
|
||||
export const getPackageJSON = (
|
||||
packageName,
|
||||
version = '1.0.0',
|
||||
dependencies = {},
|
||||
devDependencies = {}
|
||||
) => {
|
||||
const json = {
|
||||
name: packageName,
|
||||
version,
|
||||
description: 'some cool project',
|
||||
main: 'index.js',
|
||||
scripts: {
|
||||
test: 'echo exit 1',
|
||||
},
|
||||
dependencies,
|
||||
devDependencies,
|
||||
keywords: ['foo', 'bar'],
|
||||
author: 'Yoooooo <jota@some.org>',
|
||||
license: 'MIT',
|
||||
};
|
||||
return JSON.stringify(json);
|
||||
};
|
||||
|
||||
export const getREADME = (packageName) => `
|
||||
# My README ${packageName}
|
||||
|
||||
some text
|
||||
|
||||
## subtitle
|
||||
|
||||
more text
|
||||
`;
|
||||
|
||||
export async function prepareGenericEmptyProject(
|
||||
packageName: string,
|
||||
version: string,
|
||||
port: number,
|
||||
token: string,
|
||||
registryDomain: string,
|
||||
dependencies: any = {},
|
||||
devDependencies: any = {}
|
||||
) {
|
||||
const getNPMrc = (port, token, registry) => `//localhost:${port}/:_authToken=${token}
|
||||
registry=${registry}`;
|
||||
const tempFolder = await createTempFolder('temp-folder');
|
||||
await writeFile(
|
||||
join(tempFolder, 'package.json'),
|
||||
getPackageJSON(packageName, version, dependencies, devDependencies)
|
||||
);
|
||||
await writeFile(join(tempFolder, 'README.md'), getREADME(packageName));
|
||||
await writeFile(join(tempFolder, '.npmrc'), getNPMrc(port, token, registryDomain));
|
||||
return { tempFolder };
|
||||
}
|
||||
|
||||
export function nJSONParse(jsonString) {
|
||||
const type = typeof jsonString;
|
||||
if (type !== 'string') throw new Error(`Input have to be string but got ${type}`);
|
||||
|
||||
const jsonRows = jsonString.split(/\n|\n\r/).filter(Boolean);
|
||||
console.log('--jsonRows', jsonRows);
|
||||
return jsonRows.map((jsonStringRow) => JSON.parse(jsonStringRow));
|
||||
}
|
||||
5
e2e/cli/cli-commons/src/web.ts
Normal file
5
e2e/cli/cli-commons/src/web.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import got from 'got';
|
||||
|
||||
export function callRegistry(url: string): Promise<string> {
|
||||
return got.get(url, { headers: { Accept: 'application/json' } }).json();
|
||||
}
|
||||
54
e2e/cli/cli-commons/src/yarn-modern-utils.ts
Normal file
54
e2e/cli/cli-commons/src/yarn-modern-utils.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { cp, writeFile } from 'fs/promises';
|
||||
import { join } from 'path';
|
||||
import { URL } from 'url';
|
||||
import YAML from 'yaml';
|
||||
|
||||
import { Dependencies } from '@verdaccio/types';
|
||||
|
||||
import { createTempFolder, getPackageJSON, getREADME } from './utils';
|
||||
|
||||
export function createYamlConfig(registry: string, token?: string) {
|
||||
const defaultYaml: any = {
|
||||
npmRegistryServer: registry,
|
||||
yarnPath: '.yarn/releases/yarn.js',
|
||||
enableImmutableInstalls: false,
|
||||
unsafeHttpWhitelist: ['localhost'],
|
||||
};
|
||||
|
||||
if (typeof token === 'string') {
|
||||
const url = new URL(registry);
|
||||
defaultYaml.npmRegistries = {
|
||||
[`//${url.hostname}:${url.port}`]: {
|
||||
npmAlwaysAuth: true,
|
||||
npmAuthToken: token,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return YAML.stringify(defaultYaml);
|
||||
}
|
||||
|
||||
export async function prepareYarnModernProject(
|
||||
projectName: string,
|
||||
registryDomain: string,
|
||||
yarnBinPath: string,
|
||||
pkgJson: {
|
||||
packageName: string;
|
||||
version: string;
|
||||
dependencies: Dependencies;
|
||||
devDependencies: Dependencies;
|
||||
},
|
||||
token?: string
|
||||
) {
|
||||
const tempFolder = await createTempFolder(projectName);
|
||||
const yamlContent = createYamlConfig(registryDomain, token);
|
||||
await writeFile(join(tempFolder, '.yarnrc.yml'), yamlContent);
|
||||
const { packageName, version, dependencies, devDependencies } = pkgJson;
|
||||
await writeFile(
|
||||
join(tempFolder, 'package.json'),
|
||||
getPackageJSON(packageName, version, dependencies, devDependencies)
|
||||
);
|
||||
await writeFile(join(tempFolder, 'README.md'), getREADME(packageName));
|
||||
await cp(yarnBinPath, join(tempFolder, '.yarn/releases/yarn.js'), { dereference: true });
|
||||
return { tempFolder };
|
||||
}
|
||||
21
e2e/cli/cli-commons/tsconfig.json
Normal file
21
e2e/cli/cli-commons/tsconfig.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.reference.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./build"
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../packages/core/core"
|
||||
},
|
||||
{
|
||||
"path": "../../../packages/verdaccio"
|
||||
},
|
||||
{
|
||||
"path": "../../../packages/config"
|
||||
},
|
||||
{
|
||||
"path": "../../../packages/tools/helpers"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"@typescript-eslint/no-var-requires": 0,
|
||||
"@typescript-eslint/explicit-member-accessibility": 0
|
||||
}
|
||||
}
|
||||
39
e2e/cli/e2e-npm6/CHANGELOG.md
Normal file
39
e2e/cli/e2e-npm6/CHANGELOG.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# @verdaccio/e2e-cli-npm6
|
||||
|
||||
## 1.0.1-6-next.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.5
|
||||
|
||||
## 1.0.1-6-next.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.4
|
||||
|
||||
## 1.0.1-6-next.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
|
||||
- Updated dependencies [351aeeaa]
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.3
|
||||
|
||||
## 1.0.1-6-next.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.2
|
||||
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
45
e2e/cli/e2e-npm6/audit.spec.ts
Normal file
45
e2e/cli/e2e-npm6/audit.spec.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { addRegistry, initialSetup, prepareGenericEmptyProject } from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('audit a package', () => {
|
||||
jest.setTimeout(20000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test.each([['verdaccio-memory', '@verdaccio/cli']])(
|
||||
'should audit a package %s',
|
||||
async (pkgName) => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0-patch',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl(),
|
||||
{ jquery: '3.6.1' }
|
||||
);
|
||||
// install is required to create package lock file
|
||||
await npm({ cwd: tempFolder }, 'install', ...addRegistry(registry.getRegistryUrl()));
|
||||
const resp = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'audit',
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
const parsedBody = JSON.parse(resp.stdout as string);
|
||||
expect(parsedBody.metadata).toBeDefined();
|
||||
expect(parsedBody.actions).toBeDefined();
|
||||
expect(parsedBody.advisories).toBeDefined();
|
||||
expect(parsedBody.muted).toBeDefined();
|
||||
}
|
||||
);
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
115
e2e/cli/e2e-npm6/deprecate.spec.ts
Normal file
115
e2e/cli/e2e-npm6/deprecate.spec.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import {
|
||||
addRegistry,
|
||||
initialSetup,
|
||||
npmUtils,
|
||||
prepareGenericEmptyProject,
|
||||
} from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('deprecate a package', () => {
|
||||
jest.setTimeout(20000);
|
||||
let registry;
|
||||
|
||||
async function deprecate(tempFolder, packageVersion, registry, message) {
|
||||
await npm(
|
||||
{ cwd: tempFolder },
|
||||
'deprecate',
|
||||
packageVersion,
|
||||
message,
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
}
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test.each([['@verdaccio/deprecated-1']])(
|
||||
'should deprecate a single package %s',
|
||||
async (pkgName) => {
|
||||
const message = 'some message';
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// deprecate one version
|
||||
await deprecate(tempFolder, `${pkgName}@1.0.0`, registry, message);
|
||||
// verify is deprecated
|
||||
const infoBody = await npmUtils.getInfoVersions(npm, `${pkgName}`, registry);
|
||||
expect(infoBody.name).toEqual(pkgName);
|
||||
expect(infoBody.deprecated).toEqual(message);
|
||||
}
|
||||
);
|
||||
|
||||
test.each([['@verdaccio/deprecated-2']])('should un-deprecate a package %s', async (pkgName) => {
|
||||
const message = 'some message';
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// deprecate one version
|
||||
await deprecate(tempFolder, `${pkgName}@1.0.0`, registry, message);
|
||||
// verify is deprecated
|
||||
const infoBody = await npmUtils.getInfoVersions(npm, `${pkgName}`, registry);
|
||||
expect(infoBody.deprecated).toEqual(message);
|
||||
// empty string is same as undeprecate
|
||||
await deprecate(tempFolder, `${pkgName}@1.0.0`, registry, '');
|
||||
const infoBody2 = await npmUtils.getInfoVersions(npm, `${pkgName}`, registry);
|
||||
expect(infoBody2.deprecated).toBeUndefined();
|
||||
});
|
||||
|
||||
test.each([['@verdaccio/deprecated-3']])(
|
||||
'should deprecate a multiple packages %s',
|
||||
async (pkgName) => {
|
||||
const message = 'some message';
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
// publish 1.0.0
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// publish 1.1.0
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// publish 1.2.0
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// publish 1.3.0
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// // deprecate all version
|
||||
await deprecate(tempFolder, pkgName, registry, message);
|
||||
// verify is deprecated
|
||||
for (let v of ['1.0.0', '1.1.0', '1.2.0', '1.3.0']) {
|
||||
const infoResp = await npmUtils.getInfoVersions(npm, `${pkgName}@${v}`, registry);
|
||||
expect(infoResp.deprecated).toEqual(message);
|
||||
}
|
||||
// publish normal version
|
||||
// publish 1.4.0
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
const infoResp = await npmUtils.getInfoVersions(npm, `${pkgName}@1.4.0`, registry);
|
||||
// must be not deprecated
|
||||
expect(infoResp.deprecated).toBeUndefined();
|
||||
}
|
||||
);
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
91
e2e/cli/e2e-npm6/dist-tags.spec.ts
Normal file
91
e2e/cli/e2e-npm6/dist-tags.spec.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import {
|
||||
addRegistry,
|
||||
initialSetup,
|
||||
npmUtils,
|
||||
prepareGenericEmptyProject,
|
||||
} from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('publish a package', () => {
|
||||
jest.setTimeout(20000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test.each([['@foo/foo', 'foo']])('should list dist-tags for %s', async (pkgName) => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry, ['--tag', 'beta']);
|
||||
const resp2 = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'dist-tag',
|
||||
'ls',
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
expect(resp2.stdout).toEqual('beta: 1.1.0latest: 1.0.0');
|
||||
});
|
||||
|
||||
test.each([['@verdaccio/bar']])('should remove tag with dist-tags for %s', async (pkgName) => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry, ['--tag', 'beta']);
|
||||
const resp2 = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'dist-tag',
|
||||
'rm',
|
||||
`${pkgName}@1.1.0`,
|
||||
'beta',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
expect(resp2.stdout).toEqual('-beta: @verdaccio/bar@1.1.0');
|
||||
});
|
||||
|
||||
test.each([['@verdaccio/five']])(
|
||||
'should add tag to package and version with dist-tags for %s',
|
||||
async (pkgName) => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
const resp2 = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'dist-tag',
|
||||
'add',
|
||||
`${pkgName}@1.1.0`,
|
||||
'alfa',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
expect(resp2.stdout).toEqual(`+alfa: ${pkgName}@1.1.0`);
|
||||
}
|
||||
);
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
31
e2e/cli/e2e-npm6/info.spec.ts
Normal file
31
e2e/cli/e2e-npm6/info.spec.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { addRegistry, initialSetup } from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('install a package', () => {
|
||||
jest.setTimeout(20000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test('should run npm info json body', async () => {
|
||||
const resp = await npm(
|
||||
{},
|
||||
'info',
|
||||
'verdaccio',
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
const parsedBody = JSON.parse(resp.stdout as string);
|
||||
expect(parsedBody.name).toEqual('verdaccio');
|
||||
expect(parsedBody.dependencies).toBeDefined();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
38
e2e/cli/e2e-npm6/install.spec.ts
Normal file
38
e2e/cli/e2e-npm6/install.spec.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { addRegistry, initialSetup, prepareGenericEmptyProject } from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('install a project packages', () => {
|
||||
jest.setTimeout(80000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test('should run npm install json body', async () => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
'something',
|
||||
'1.0.0-patch',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl(),
|
||||
{ react: '18.2.0' }
|
||||
);
|
||||
const resp = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'install',
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
const parsedBody = JSON.parse(resp.stdout as string);
|
||||
expect(parsedBody.added).toBeDefined();
|
||||
expect(parsedBody.audit).toBeDefined();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
3
e2e/cli/e2e-npm6/jest.config.js
Normal file
3
e2e/cli/e2e-npm6/jest.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const config = require('../jest.config');
|
||||
|
||||
module.exports = { ...config };
|
||||
12
e2e/cli/e2e-npm6/package.json
Normal file
12
e2e/cli/e2e-npm6/package.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/e2e-cli-npm6",
|
||||
"version": "1.0.1-6-next.5",
|
||||
"dependencies": {
|
||||
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
|
||||
"npm": "6.14.17"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest"
|
||||
}
|
||||
}
|
||||
24
e2e/cli/e2e-npm6/ping.spec.ts
Normal file
24
e2e/cli/e2e-npm6/ping.spec.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { addRegistry, initialSetup } from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('ping registry', () => {
|
||||
jest.setTimeout(20000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test('should ping registry', async () => {
|
||||
const resp = await npm({}, 'ping', '--json', ...addRegistry(registry.getRegistryUrl()));
|
||||
const parsedBody = JSON.parse(resp.stdout as string);
|
||||
expect(parsedBody.registry).toEqual(registry.getRegistryUrl() + '/');
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
42
e2e/cli/e2e-npm6/publish.spec.ts
Normal file
42
e2e/cli/e2e-npm6/publish.spec.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { addRegistry, initialSetup, prepareGenericEmptyProject } from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('publish a package', () => {
|
||||
jest.setTimeout(20000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test.each([['verdaccio-memory', 'verdaccio', '@verdaccio/foo', '@verdaccio/some-foo']])(
|
||||
'should publish a package %s',
|
||||
async (pkgName) => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0-patch',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
|
||||
const resp = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'publish',
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
const parsedBody = JSON.parse(resp.stdout as string);
|
||||
expect(parsedBody.name).toEqual(pkgName);
|
||||
expect(parsedBody.files).toBeDefined();
|
||||
expect(parsedBody.files).toBeDefined();
|
||||
}
|
||||
);
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
33
e2e/cli/e2e-npm6/search.spec.ts
Normal file
33
e2e/cli/e2e-npm6/search.spec.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { addRegistry, initialSetup } from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('search a package', () => {
|
||||
jest.setTimeout(20000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test('should search a package', async () => {
|
||||
const resp = await npm(
|
||||
{},
|
||||
'search',
|
||||
'@verdaccio/cli',
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
const parsedBody = JSON.parse(resp.stdout as string);
|
||||
const pkgFind = parsedBody.find((item) => {
|
||||
return item.name === '@verdaccio/cli';
|
||||
});
|
||||
expect(pkgFind.name).toEqual('@verdaccio/cli');
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
69
e2e/cli/e2e-npm6/star.spec.ts
Normal file
69
e2e/cli/e2e-npm6/star.spec.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
import {
|
||||
addRegistry,
|
||||
initialSetup,
|
||||
npmUtils,
|
||||
prepareGenericEmptyProject,
|
||||
} from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('star a package', () => {
|
||||
jest.setTimeout(20000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test.each([['@verdaccio/foo']])('should star a package %s', async (pkgName) => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0-patch',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
const resp = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'star',
|
||||
pkgName,
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
expect(resp.stdout).toEqual(`★ ${pkgName}`);
|
||||
});
|
||||
|
||||
test.each([['@verdaccio/bar']])('should unstar a package %s', async (pkgName) => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0-patch',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
const resp = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'star',
|
||||
pkgName,
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
expect(resp.stdout).toEqual(`★ ${pkgName}`);
|
||||
|
||||
const resp1 = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'unstar',
|
||||
pkgName,
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
expect(resp1.stdout).toEqual(`☆ ${pkgName}`);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
8
e2e/cli/e2e-npm6/tsconfig.json
Normal file
8
e2e/cli/e2e-npm6/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.reference.json",
|
||||
"references": [
|
||||
{
|
||||
"path": "../cli-commons"
|
||||
}
|
||||
]
|
||||
}
|
||||
12
e2e/cli/e2e-npm6/utils.ts
Normal file
12
e2e/cli/e2e-npm6/utils.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { SpawnOptions } from 'child_process';
|
||||
import { join } from 'path';
|
||||
|
||||
import { exec } from '@verdaccio/test-cli-commons';
|
||||
|
||||
export function getCommand() {
|
||||
return join(__dirname, './node_modules/.bin/npm');
|
||||
}
|
||||
|
||||
export function npm(options: SpawnOptions, ...args: string[]) {
|
||||
return exec(options, getCommand(), args);
|
||||
}
|
||||
7
e2e/cli/e2e-npm7/.eslintrc
Normal file
7
e2e/cli/e2e-npm7/.eslintrc
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"@typescript-eslint/no-var-requires": 0,
|
||||
"@typescript-eslint/explicit-member-accessibility": 0
|
||||
}
|
||||
}
|
||||
39
e2e/cli/e2e-npm7/CHANGELOG.md
Normal file
39
e2e/cli/e2e-npm7/CHANGELOG.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# @verdaccio/e2e-cli-npm7
|
||||
|
||||
## 1.0.1-6-next.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.5
|
||||
|
||||
## 1.0.1-6-next.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.4
|
||||
|
||||
## 1.0.1-6-next.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
|
||||
- Updated dependencies [351aeeaa]
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.3
|
||||
|
||||
## 1.0.1-6-next.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.2
|
||||
|
||||
## 1.0.1-6-next.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.1
|
||||
|
||||
## 1.0.1-6-next.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- @verdaccio/test-cli-commons@1.0.1-6-next.0
|
||||
44
e2e/cli/e2e-npm7/audit.spec.ts
Normal file
44
e2e/cli/e2e-npm7/audit.spec.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { addRegistry, initialSetup, prepareGenericEmptyProject } from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('audit a package', () => {
|
||||
jest.setTimeout(10000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test.each([['verdaccio-memory', '@verdaccio/cli']])(
|
||||
'should audit a package %s',
|
||||
async (pkgName) => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0-patch',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl(),
|
||||
{ jquery: '3.6.1' }
|
||||
);
|
||||
// install is required to create package lock file
|
||||
await npm({ cwd: tempFolder }, 'install', ...addRegistry(registry.getRegistryUrl()));
|
||||
const resp = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'audit',
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
const parsedBody = JSON.parse(resp.stdout as string);
|
||||
expect(parsedBody.metadata).toBeDefined();
|
||||
expect(parsedBody.auditReportVersion).toBeDefined();
|
||||
expect(parsedBody.vulnerabilities).toBeDefined();
|
||||
}
|
||||
);
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
115
e2e/cli/e2e-npm7/deprecate.spec.ts
Normal file
115
e2e/cli/e2e-npm7/deprecate.spec.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import {
|
||||
addRegistry,
|
||||
initialSetup,
|
||||
npmUtils,
|
||||
prepareGenericEmptyProject,
|
||||
} from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('deprecate a package', () => {
|
||||
jest.setTimeout(20000);
|
||||
let registry;
|
||||
|
||||
async function deprecate(tempFolder, packageVersion, registry, message) {
|
||||
await npm(
|
||||
{ cwd: tempFolder },
|
||||
'deprecate',
|
||||
packageVersion,
|
||||
message,
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
}
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test.each([['@verdaccio/deprecated-1']])(
|
||||
'should deprecate a single package %s',
|
||||
async (pkgName) => {
|
||||
const message = 'some message';
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// deprecate one version
|
||||
await deprecate(tempFolder, `${pkgName}@1.0.0`, registry, message);
|
||||
// verify is deprecated
|
||||
const infoBody = await npmUtils.getInfoVersions(npm, `${pkgName}`, registry);
|
||||
expect(infoBody.name).toEqual(pkgName);
|
||||
expect(infoBody.deprecated).toEqual(message);
|
||||
}
|
||||
);
|
||||
|
||||
test.each([['@verdaccio/deprecated-2']])('should un-deprecate a package %s', async (pkgName) => {
|
||||
const message = 'some message';
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// deprecate one version
|
||||
await deprecate(tempFolder, `${pkgName}@1.0.0`, registry, message);
|
||||
// verify is deprecated
|
||||
const infoBody = await npmUtils.getInfoVersions(npm, `${pkgName}`, registry);
|
||||
expect(infoBody.deprecated).toEqual(message);
|
||||
// empty string is same as undeprecate
|
||||
await deprecate(tempFolder, `${pkgName}@1.0.0`, registry, '');
|
||||
const infoBody2 = await npmUtils.getInfoVersions(npm, `${pkgName}`, registry);
|
||||
expect(infoBody2.deprecated).toBeUndefined();
|
||||
});
|
||||
|
||||
test.each([['@verdaccio/deprecated-3']])(
|
||||
'should deprecate a multiple packages %s',
|
||||
async (pkgName) => {
|
||||
const message = 'some message';
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
// publish 1.0.0
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// publish 1.1.0
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// publish 1.2.0
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// publish 1.3.0
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
// // deprecate all version
|
||||
await deprecate(tempFolder, pkgName, registry, message);
|
||||
// verify is deprecated
|
||||
for (let v of ['1.0.0', '1.1.0', '1.2.0', '1.3.0']) {
|
||||
const infoResp = await npmUtils.getInfoVersions(npm, `${pkgName}@${v}`, registry);
|
||||
expect(infoResp.deprecated).toEqual(message);
|
||||
}
|
||||
// publish normal version
|
||||
// publish 1.4.0
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
const infoResp = await npmUtils.getInfoVersions(npm, `${pkgName}@1.4.0`, registry);
|
||||
// must be not deprecated
|
||||
expect(infoResp.deprecated).toBeUndefined();
|
||||
}
|
||||
);
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
91
e2e/cli/e2e-npm7/dist-tags.spec.ts
Normal file
91
e2e/cli/e2e-npm7/dist-tags.spec.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import {
|
||||
addRegistry,
|
||||
initialSetup,
|
||||
npmUtils,
|
||||
prepareGenericEmptyProject,
|
||||
} from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('publish a package', () => {
|
||||
jest.setTimeout(20000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test.each([['@foo/foo', 'foo']])('should list dist-tags for %s', async (pkgName) => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry, ['--tag', 'beta']);
|
||||
const resp2 = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'dist-tag',
|
||||
'ls',
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
expect(resp2.stdout).toEqual('beta: 1.1.0latest: 1.0.0');
|
||||
});
|
||||
|
||||
test.each([['@verdaccio/bar']])('should remove tag with dist-tags for %s', async (pkgName) => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry, ['--tag', 'beta']);
|
||||
const resp2 = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'dist-tag',
|
||||
'rm',
|
||||
`${pkgName}@1.1.0`,
|
||||
'beta',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
expect(resp2.stdout).toEqual('-beta: @verdaccio/bar@1.1.0');
|
||||
});
|
||||
|
||||
test.each([['@verdaccio/five']])(
|
||||
'should add tag to package and version with dist-tags for %s',
|
||||
async (pkgName) => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
pkgName,
|
||||
'1.0.0',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl()
|
||||
);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
await npmUtils.bumbUp(npm, tempFolder, registry);
|
||||
await npmUtils.publish(npm, tempFolder, pkgName, registry);
|
||||
const resp2 = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'dist-tag',
|
||||
'add',
|
||||
`${pkgName}@1.1.0`,
|
||||
'alfa',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
expect(resp2.stdout).toEqual(`+alfa: ${pkgName}@1.1.0`);
|
||||
}
|
||||
);
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
31
e2e/cli/e2e-npm7/info.spec.ts
Normal file
31
e2e/cli/e2e-npm7/info.spec.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { addRegistry, initialSetup } from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('install a package', () => {
|
||||
jest.setTimeout(10000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test('should run npm info json body', async () => {
|
||||
const resp = await npm(
|
||||
{},
|
||||
'info',
|
||||
'verdaccio',
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
const parsedBody = JSON.parse(resp.stdout as string);
|
||||
expect(parsedBody.name).toEqual('verdaccio');
|
||||
expect(parsedBody.dependencies).toBeDefined();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
38
e2e/cli/e2e-npm7/install.spec.ts
Normal file
38
e2e/cli/e2e-npm7/install.spec.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { addRegistry, initialSetup, prepareGenericEmptyProject } from '@verdaccio/test-cli-commons';
|
||||
|
||||
import { npm } from './utils';
|
||||
|
||||
describe('install a project packages', () => {
|
||||
jest.setTimeout(80000);
|
||||
let registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
const setup = await initialSetup();
|
||||
registry = setup.registry;
|
||||
await registry.init();
|
||||
});
|
||||
|
||||
test('should run npm install json body', async () => {
|
||||
const { tempFolder } = await prepareGenericEmptyProject(
|
||||
'something',
|
||||
'1.0.0-patch',
|
||||
registry.port,
|
||||
registry.getToken(),
|
||||
registry.getRegistryUrl(),
|
||||
{ react: '18.2.0' }
|
||||
);
|
||||
const resp = await npm(
|
||||
{ cwd: tempFolder },
|
||||
'install',
|
||||
'--json',
|
||||
...addRegistry(registry.getRegistryUrl())
|
||||
);
|
||||
const parsedBody = JSON.parse(resp.stdout as string);
|
||||
expect(parsedBody.added).toBeDefined();
|
||||
expect(parsedBody.audit).toBeDefined();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
registry.stop();
|
||||
});
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user