Compare commits

..

84 Commits

Author SHA1 Message Date
Juan Picado
d22673c61d chore: update versions (6-next) (#3409)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-10-15 09:02:41 +02:00
Juan Picado
2f835ac09e chore: migrate to cypress for ui e2e (#3434) 2022-10-15 07:43:42 +02:00
verdacciobot
852324c321 chore: updated static data 2022-10-13 00:18:16 +00:00
Juan Picado
54606976c3 chore(website): improve api docs part 2 (#3431)
* chore: remove unused package

* Update pnpm-lock.yaml

* chore: improve types in general plugins
2022-10-11 23:06:55 +02:00
renovate[bot]
484ecae3d2 chore(deps): update github/codeql-action digest to 8075783 (#3426)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-10 17:59:44 +02:00
dependabot[bot]
235d350dc1 chore(deps): bump github/codeql-action from 2.1.26 to 2.1.27 (#3430)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.26 to 2.1.27.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](e0e5ded33c...807578363a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-10 17:59:31 +02:00
dependabot[bot]
af90e35cd1 chore(deps): bump actions/checkout from 3.0.2 to 3.1.0 (#3429)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.0.2 to 3.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](2541b1294d...93ea575cb5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-10 17:59:20 +02:00
Juan Picado
791988a9aa chore(website): fix broken link 2022-10-10 08:31:38 +02:00
Juan Picado
64cfedb805 chore(website): add api section (#3424)
* chore: add api section

* chore: fix build

* Update website.yml

* chore: improve types plugin

clean up others stuff

* Update crowdin.yaml

* clean up
2022-10-10 08:00:09 +02:00
verdacciobot
bf36b9477c chore: updated static data 2022-10-10 00:18:45 +00:00
verdacciobot
737684e592 chore: updated static data 2022-10-06 00:19:47 +00:00
dependabot[bot]
e6fc774d44 chore(deps): bump github/codeql-action from 2.1.25 to 2.1.26 (#3419)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.25 to 2.1.26.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](86f3159a69...e0e5ded33c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:50:22 +02:00
dependabot[bot]
1adb22553a chore(deps): bump actions/github-script from 6.2.0 to 6.3.1 (#3420)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.2.0 to 6.3.1.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](c713e510db...7dff1a8764)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:50:12 +02:00
dependabot[bot]
93dd256b21 chore(deps): bump actions/setup-node from 3.4.1 to 3.5.0 (#3421)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](2fddd8803e...969bd26639)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:49:58 +02:00
dependabot[bot]
404ab31e06 chore(deps): bump actions/cache from 3.0.8 to 3.0.10 (#3422)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.8 to 3.0.10.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](fd5de65bc8...56461b9eb0)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-03 13:49:41 +02:00
Andrii Bodnar
8897bdeb5d docs: Update Crowdin logo (#3418) 2022-10-03 10:48:51 +02:00
verdacciobot
717a36dd94 chore: updated static data 2022-10-03 00:18:28 +00:00
Juan Picado
25e0d4cb67 Update docusaurus.config.js 2022-10-02 22:12:30 +02:00
Juan Picado
7ab5f0167e chore(website): migrate GA 4 2022-10-02 09:18:45 +02:00
Juan Picado
07488a9ddb chore: fix website version deployment 2022-10-02 08:25:13 +02:00
Juan Picado
96d7295e55 chore: crowdin mapping (#3414)
* chore: crowdin mapping

* Update docusaurus.config.js

* Update docusaurus.config.js
2022-10-01 20:18:43 +02:00
verdacciobot
af7d493b80 chore: updated static data 2022-10-01 16:01:37 +00:00
Juan Picado
9d93a9a6b2 chore: update ci workflow 2022-10-01 17:59:23 +02:00
verdacciobot
4d44a91d89 chore: updated contributors list 2022-10-01 15:55:11 +00:00
Juan Picado
52be1eccb0 Update translations.yml 2022-10-01 17:49:12 +02:00
Juan Picado
00942e6d20 Update translations.yml 2022-10-01 17:46:55 +02:00
Juan Picado
0041d9407d chore: add versioning website (#3320)
* chore: add versioning website

* Update docusaurus.config.js

* chore: updated versions

* Update docusaurus.config.js
2022-10-01 17:21:26 +02:00
Juan Picado
3dc8591e26 chore: website small improvements (#3412)
* chore: website small improvements

* fix website build

* Update docusaurus.config.js
2022-10-01 14:08:40 +02:00
Juan Picado
ce013d2fcc refactor: reimplement star command (#3410) 2022-10-01 00:14:20 +02:00
Marc Bernard
6ad13de884 feat: display publication time on sidebar (#3408)
- Show the publication time next to the version on the sidebar
- Bonus: display the full date and time on hover
2022-09-30 19:53:46 +02:00
renovate[bot]
0783eeec1e fix(deps): update all core dependencies (master) (#3406)
* fix(deps): update all core dependencies

* chore: fix tests

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Juan Picado <juanpicado19@gmail.com>
2022-09-29 18:37:39 +02:00
verdacciobot
d4e6a6e2bf chore: updated contributors list 2022-09-29 00:21:55 +00:00
verdacciobot
0ebac198ce chore: updated contributors list 2022-09-28 07:30:12 +00:00
Juan Picado
269105ff4b chore: update versions (6-next) (#3362)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-28 07:39:59 +02:00
Marc Bernard
0277180576 fix: hide search icon on medium or larger devices (#3398)
* fix: hide search icon on larger devices

Avoids showing two search options 

Regression of d43894e8f6

Closes #3396

* Changeset
2022-09-28 07:26:38 +02:00
Marc Bernard
d4019f6349 feat: improve "Current Tags" version list (#3401) 2022-09-28 07:26:18 +02:00
Juan Picado
2c0d5ceab8 e2e: yarn publish (#3393)
* Update audit.spec.ts

* Update README.md

* chore: e2e yarn refactor

* chore: add yarn publish tests

* Update e2e-ci.yml

* Update e2e-ci.yml

* Update e2e-ci.yml

* Update e2e-ci.yml
2022-09-27 22:56:17 +02:00
Marc Bernard
810bf8c40c fix link to TypeScript type definitions (#3395)
* Fix link to TypeScript type definitions

* Update link
2022-09-27 17:27:31 +02:00
renovate[bot]
979d6639d3 chore(deps): update github/codeql-action digest to 86f3159 (#3397)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-26 08:52:05 +02:00
verdacciobot
fd970b30d5 chore: updated contributors list 2022-09-26 00:17:14 +00:00
renovate[bot]
722c88b1d6 fix(deps): update all core dependencies (master) (#3391)
* fix(deps): update all core dependencies

* fix test

* Update audit.spec.ts

* Update e2e-ci.yml

* test

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Juan Picado <juanpicado19@gmail.com>
2022-09-24 13:44:34 +02:00
Juan Picado
bd3ae17971 chore: refactor e2e utilities (#3392)
* chore: refactor e2e utilities

* chore: specific versions for pkg manager

* Update e2e-ci.yml
2022-09-24 11:30:16 +02:00
Juan Picado
69d0c621e7 chore: update renovate 2022-09-24 09:52:11 +02:00
Juan Picado
e364d073d7 e2e: command dist-tag (#3390)
* clean up tests

* add dist-tag

* chore: add npm 9

* Update CHANGELOG.md

* Update publish.spec.js

* add pnpm

* yarn 1

* Update tag.spec.ts

* Update README.md

* more timeout

* chore fix build

* chore: fix export

* chore: fix test

* chore: fix tests
2022-09-24 08:53:03 +02:00
verdacciobot
40ceb59d76 chore: updated contributors list 2022-09-22 00:15:17 +00:00
Juan Picado
18348940c4 e2e: npm search and ping commands (#3386)
* chore: rename folders

* chore: add search tests

* chore: remove old files

* Update pnpm-workspace.yaml

* chore: fix ui

* Update e2e-ci.yml

* chore: renovate deps

* fix build

* chore: add tests
2022-09-19 23:10:38 +02:00
renovate[bot]
f62dadc223 chore(deps): update github/codeql-action digest to 904260d (#3387)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-19 07:58:27 +02:00
verdacciobot
031bcf0b14 chore: updated contributors list 2022-09-19 00:14:00 +00:00
Juan Picado
a249ab7b5a chore: re-stablished deprecated support (#3385)
* chore: re-stablished deprecated support

* chore: add e2e

* chore: add more tests

* chore: improve setup

* chore: improve buildcache

* Update e2e-ci.yml

* Update e2e-ci.yml

* Update e2e-ci.yml

* Update e2e-ci.yml

* chore: add more steps

* chore: improve speed

* chore: fix ci

* chore: improve cache

* Update ci.yml

* Update registry.ts

* Update ci.yml

* Update ci.yml
2022-09-18 21:47:23 +02:00
Juan Picado
62c24b6321 feat: add passwordValidationRegex property (#3384)
* feat: add passwordValidationRegex property

* chore: improve validation

* Update validation-utilts.spec.ts

* Update validation-utilts.spec.ts

* chore: remove code
2022-09-17 19:29:40 +02:00
Juan Picado
8adee83d51 test: add e2e for install (#3383)
* test: add e2e for install

* chore: e2e for install

* chore: fix test
2022-09-17 11:35:10 +02:00
Juan Picado
ccabb4b876 test: e2e audit cmd (#3382)
* test: e2e audit

* Update process.ts

* Update audit.spec.ts

* Update package.json

* chore: test

* test

* test

* chore: add docs
2022-09-17 00:33:55 +02:00
Juan Picado
c3f287bc04 chore: deploy website once peer day instead on merge 2022-09-16 08:11:31 +02:00
Juan Picado
9fc2e79611 feat(plugin): improve plugin loader (#3370)
* feat(plugin): implement scope package support plugins

* feat(plugin): improve plugin loader

* chore: fix build

* chore: cover config path case

* chore: async ui thene plugin

* chore: store async plugin

* chore: refactor plugin loader auth

* feat: filter refactoring

* chore: remove old plugin loader

* chore: add changeset

* chore: add docs

* chore: refactor relative plugin loader

* Update user.jwt.spec.ts

* Update user.jwt.spec.ts
2022-09-16 08:02:08 +02:00
renovate[bot]
98afd48378 fix(deps): update all linting dependencies (#3378)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-15 21:10:46 +02:00
verdacciobot
399538fd4d chore: updated contributors list 2022-09-15 00:15:28 +00:00
renovate[bot]
97c464faa6 fix(deps): update all core dependencies (#3377) 2022-09-14 07:46:28 +02:00
verdacciobot
7771955c6a chore: updated contributors list 2022-09-12 00:14:25 +00:00
renovate[bot]
d0e24756f0 fix(deps): update all linting dependencies (#3373)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-11 18:54:02 +02:00
renovate[bot]
820e5a905a fix(deps): update all core dependencies (#3372)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-11 18:26:14 +02:00
Snyk bot
19a33b4072 fix: upgrade aws-sdk from 2.981.0 to 2.1199.0 (#3369)
Snyk has created this PR to upgrade aws-sdk from 2.981.0 to 2.1199.0.

See this package in npm:
https://www.npmjs.com/package/aws-sdk

See this project in Snyk:
https://app.snyk.io/org/scoe/project/726e6b57-2242-446b-ba71-7bff4b5b8e2c?utm_source=github&utm_medium=referral&page=upgrade-pr
2022-09-10 08:48:17 +02:00
Teos
f21a9ee7ab docs: update docker.md (#3368)
* Update docker.md

Update outdated docker-examples link

* Update docker.md
2022-09-09 16:18:03 +02:00
verdacciobot
6d2bf05036 chore: updated contributors list 2022-09-08 00:15:43 +00:00
Juan Picado
43f32687cd fix: abbreviated headers handle quality values (#3361) 2022-09-06 08:25:17 +02:00
dependabot[bot]
97078c9084 chore(deps): bump github/codeql-action from 2.1.21 to 2.1.22 (#3358)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.21 to 2.1.22.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](c7f292ea4f...b398f525a5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-05 18:31:58 +02:00
verdacciobot
e9846ba468 chore: updated contributors list 2022-09-05 00:17:08 +00:00
Juan Picado
3c2f5741f4 chore: update versions (6-next) (#3350)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-04 11:56:23 +02:00
Juan Picado
85413ae8b6 Update changesets.yml 2022-09-04 11:50:28 +02:00
Juan Picado
cbff8e4e31 chore: update jest major (#3351)
* chore: update jest major

* remove unused deps
2022-09-04 11:48:51 +02:00
Juan Picado
e24eb59237 Update changesets.yml 2022-09-04 11:42:46 +02:00
Juan Picado
8297e2b36e chore: remove unused dep 2022-09-04 10:49:41 +02:00
Juan Picado
020ede43f6 fix: version output with breakline (#3349) 2022-09-04 10:46:57 +02:00
renovate[bot]
dd177d7166 fix(deps): update dependency msw to v0.47.0 (#3348)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-04 10:14:14 +02:00
Juan Picado
5e53e168d4 chore: fix packages release config 2022-09-04 07:58:26 +02:00
renovate[bot]
e9ff724b68 fix(deps): update all core dependencies (master) (#3342)
* fix(deps): update all core dependencies

* Update Search.test.tsx.snap

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Juan Picado <juanpicado19@gmail.com>
2022-09-03 18:47:59 +02:00
Juan Picado
5a61cdd0cf chore: update versions (6-next) (#3341)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-02 20:52:37 +02:00
Juan Picado
b849128ded fix: handle upload scoped tarball and add new deprecations (#3340)
* chore: add local publish support

* chore: fix upload scoped tarball

* add e2e
2022-09-02 20:40:12 +02:00
verdacciobot
efa2efe531 chore: updated contributors list 2022-09-01 00:14:39 +00:00
renovate[bot]
62ef397df1 chore(deps): update actions/github-script digest to c713e51 (#3336)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-31 08:09:06 +02:00
dependabot[bot]
e8fd4daf78 chore(deps): bump actions/github-script from 6.1.1 to 6.2.0 (#3337)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.1.1 to 6.2.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](d50f485531...c713e510db)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-31 08:08:19 +02:00
dependabot[bot]
acc5862323 chore(deps): bump github/codeql-action from 2.1.20 to 2.1.21 (#3338)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.20 to 2.1.21.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](7fee4ca032...c7f292ea4f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-31 08:08:00 +02:00
Aron Hafner
43c164efe0 docs: update config to use log property (#3339)
Update config.yaml to use log property instead of the depreciated logs

When using logs the following error occurs

```
Error: Error: the property config "logs" property is longer supported, rename to "log" and use object instead
```
2022-08-31 08:07:25 +02:00
verdacciobot
cd02e8d56a chore: updated contributors list 2022-08-29 00:14:20 +00:00
Juan Picado
5b270bdd06 Update package.json 2022-08-28 17:18:29 +02:00
684 changed files with 20346 additions and 8846 deletions

View File

@@ -0,0 +1,8 @@
---
'@verdaccio/api': patch
'@verdaccio/core': patch
'@verdaccio/server-fastify': patch
'@verdaccio/store': patch
---
fix: abbreviated headers handle quality values

View File

@@ -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"
}

View File

@@ -3,7 +3,6 @@
'@verdaccio/auth': major
'@verdaccio/cli': major
'@verdaccio/config': major
'@verdaccio/commons-api': major
'@verdaccio/core': major
'@verdaccio/local-storage': major
'@verdaccio/server-fastify': 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

View 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}
}
}
```

View File

@@ -27,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

View File

@@ -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
@@ -25,7 +24,6 @@
'@verdaccio/proxy': major
'@verdaccio/server': major
'@verdaccio/store': major
'@verdaccio/dev-types': major
'@verdaccio/utils': major
'verdaccio': major
'@verdaccio/web': major

View File

@@ -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
@@ -19,7 +18,6 @@
'@verdaccio/proxy': major
'@verdaccio/server': major
'@verdaccio/store': major
'@verdaccio/dev-types': major
'@verdaccio/utils': major
'verdaccio': major
'@verdaccio/web': major

View File

@@ -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
@@ -26,7 +25,6 @@
'verdaccio-memory': patch
'@verdaccio/proxy': patch
'@verdaccio/store': patch
'@verdaccio/dev-types': patch
'@verdaccio/utils': patch
'verdaccio': patch
'@verdaccio/web': patch

View File

@@ -0,0 +1,5 @@
---
'@verdaccio/ui-theme': patch
---
Hide search icon on medium or larger devices

View File

@@ -0,0 +1,5 @@
---
'@verdaccio/cli': patch
---
fix: version with breakline

View File

@@ -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
@@ -26,7 +25,6 @@
'@verdaccio/proxy': minor
'@verdaccio/server': minor
'@verdaccio/store': minor
'@verdaccio/dev-types': minor
'@verdaccio/utils': minor
'verdaccio': minor
'@verdaccio/web': minor

View File

@@ -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
@@ -19,7 +18,6 @@
'@verdaccio/proxy': minor
'@verdaccio/server': minor
'@verdaccio/store': minor
'@verdaccio/dev-types': minor
'@verdaccio/utils': minor
'verdaccio': minor
'@verdaccio/web': minor

View File

@@ -50,7 +50,12 @@
"@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/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",
@@ -61,9 +66,11 @@
"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",
@@ -90,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",
@@ -106,15 +115,18 @@
"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",
@@ -128,6 +140,8 @@
"tiny-seals-join",
"tricky-taxis-watch",
"two-dolls-check",
"wild-jokes-beam"
"unlucky-hairs-wonder",
"wild-jokes-beam",
"witty-ties-speak"
]
}

View File

@@ -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

View 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

View File

@@ -1,7 +1,6 @@
---
'@verdaccio/types': major
'@verdaccio/ui-theme': major
'@verdaccio/dev-types': major
'@verdaccio/web': major
'@verdaccio/e2e-ui': major
---

View 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

View File

@@ -0,0 +1,5 @@
---
'@verdaccio/ui-theme': patch
---
Add links to "Current Tags" and sort them in descending order

View File

@@ -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
@@ -18,7 +17,6 @@
'@verdaccio/proxy': patch
'@verdaccio/server': patch
'@verdaccio/store': patch
'@verdaccio/dev-types': patch
'@verdaccio/utils': patch
'verdaccio': patch
---

View File

@@ -0,0 +1,5 @@
---
'@verdaccio/ui-theme': patch
---
feat: Display publication time on sidebar

View 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

View File

@@ -18,8 +18,8 @@ jobs:
name: Prepare build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=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@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
@@ -65,8 +65,8 @@ jobs:
name: Benchmark autocannon
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
with:
node-version: 16.x
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # tag=v3
@@ -77,7 +77,7 @@ jobs:
- name: install pnpm
# require fixed version
run: sudo npm i pnpm@latest-6 -g
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
@@ -126,8 +126,8 @@ jobs:
name: Benchmark hyperfine
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
with:
node-version: 16.x
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # tag=v3
@@ -138,7 +138,7 @@ jobs:
- name: install pnpm
# require fixed version
run: sudo npm i pnpm@latest-6 -g
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}

View File

@@ -20,12 +20,12 @@ jobs:
if: github.ref == 'refs/heads/master' && github.repository == 'verdaccio/verdaccio'
steps:
- name: checkout code repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
with:
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=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,12 +55,14 @@ 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.CHANGESET_RELEASE_TOKEN }}
NPM_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}

View File

@@ -24,12 +24,14 @@ jobs:
image: verdaccio/verdaccio:nightly-master
ports:
- 4873:4873
env:
NODE_ENV: production
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Use Node 16
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=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
@@ -39,7 +41,7 @@ jobs:
- name: Install
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
- name: Cache .pnpm-store
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
@@ -50,19 +52,19 @@ jobs:
name: Lint
needs: prepare
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Use Node 16
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=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@fd5de65bc895cf536527842281bea11763fefd77 # tag=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:
@@ -70,19 +72,19 @@ jobs:
name: Format
needs: prepare
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Use Node 16
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=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@fd5de65bc895cf536527842281bea11763fefd77 # tag=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:
@@ -90,24 +92,24 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
node_version: [16, 18]
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
- name: Use Node ${{ matrix.node_version }}
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=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@fd5de65bc895cf536527842281bea11763fefd77 # tag=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
@@ -115,76 +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@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=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@fd5de65bc895cf536527842281bea11763fefd77 # tag=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
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*
ci-e2e-cli:
needs: [format, lint]
runs-on: ubuntu-latest
name: CLI Test E2E Node 16
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
with:
node-version: 16
- name: Install pnpm
run: npm i pnpm@6.32.15 -g
- uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install
## we need scripts, pupetter downloads aditional content
run: pnpm recursive install --frozen-lockfile
- name: build
run: pnpm build
- 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@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=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@fd5de65bc895cf536527842281bea11763fefd77 # tag=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

View File

@@ -21,7 +21,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=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@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=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@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=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@7fee4ca032ac341c12486c4c06822c5221c76533 # tag=v2
uses: github/codeql-action/analyze@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2

View File

@@ -19,7 +19,7 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
- uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # tag=v1
- uses: docker/setup-buildx-action@v1
with:

105
.github/workflows/e2e-ci.yml vendored Normal file
View 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}}

View File

@@ -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@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=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@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

View File

@@ -6,25 +6,23 @@ on:
paths:
- 'website/**'
- './.github/workflows/website.yml'
push:
branches:
- 'master'
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
- name: Use Node 16
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3
with:
node-version: 16
- name: Cache pnpm modules
uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
env:
cache-name: cache-pnpm-modules
with:
@@ -39,10 +37,12 @@ jobs:
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@fd5de65bc895cf536527842281bea11763fefd77 # tag=v3
uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # tag=v3
with:
path: website/node_modules/.cache/webpack
key: cache/webpack-${{github.ref}}-${{ hashFiles('**/pnpm-lock.yaml') }}
@@ -54,8 +54,8 @@ 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
@@ -100,7 +100,7 @@ jobs:
- name: Format lighthouse score
id: format_lighthouse_score
uses: actions/github-script@d50f485531ba88479582bc2da03ff424389af5c1 # tag=v6
uses: actions/github-script@7dff1a87643417cf3b95bb10b29f4c4bc60d8ebd # tag=v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |

10
.gitignore vendored
View File

@@ -49,5 +49,11 @@ api-results*.json
.clinic/
#docs
./api
**/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/**/*

View File

@@ -8,5 +8,6 @@
"storage_default_storage": true,
".yarn": true
},
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib"
}

View File

@@ -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! 🤓
@@ -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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -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/**/*]

View File

@@ -66,6 +66,6 @@ middlewares:
enabled: true
# log settings
logs:
log:
- { type: stdout, format: pretty, level: trace }
#- {type: file, path: verdaccio.log, level: info}

View File

@@ -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
View File

@@ -0,0 +1,3 @@
## Developing plugins
TBA

View File

@@ -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
View 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)

View File

@@ -1,5 +1,24 @@
# @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

View File

@@ -1,21 +1,19 @@
{
"private": true,
"name": "@verdaccio/test-cli-commons",
"version": "1.0.1-6-next.3",
"version": "1.0.1-6-next.5",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"dependencies": {
"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",
"npm": "6.14.17",
"get-port": "5.1.1",
"wait-on": "^6.0.0",
"fs-extra": "10.1.0",
"semver": "7.3.7",
"got": "11.8.5",
"verdaccio": "workspace:6.0.0-6-next.45",
"@verdaccio/core": "workspace:6.0.0-6-next.7",
"@verdaccio/config": "workspace:6.0.0-6-next.16",
"@verdaccio/test-helper": "workspace:1.1.0-6-next.3"
"lodash": "4.17.21"
},
"scripts": {
"test": "jest",

View 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';

View 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;
}

View File

@@ -21,7 +21,7 @@ export async function exec(options: SpawnOptions, cmd, args): Promise<ExecOutput
const spawnOptions = {
cwd: options.cwd,
stdio: options.stdio || 'pipe',
...(env ? { env } : {}),
env: process.env,
};
if (process.platform.startsWith('win')) {

View 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 };
}

View File

@@ -61,3 +61,66 @@ export async function prepareYarnModernProject(
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));
}

View 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 };
}

View File

@@ -1,5 +1,17 @@
# @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

View 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();
});
});

View 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();
});
});

View 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();
});
});

View 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();
});
});

View 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();
});
});

View File

@@ -0,0 +1,3 @@
const config = require('../jest.config');
module.exports = { ...config };

View File

@@ -1,10 +1,10 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-npm6",
"version": "1.0.1-6-next.3",
"version": "1.0.1-6-next.5",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.3",
"npm": "latest-6"
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
"npm": "6.14.17"
},
"scripts": {
"test": "jest"

View 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();
});
});

View 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();
});
});

View 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();
});
});

View 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();
});
});

View File

@@ -1,3 +1,4 @@
import { SpawnOptions } from 'child_process';
import { join } from 'path';
import { exec } from '@verdaccio/test-cli-commons';
@@ -6,6 +7,6 @@ export function getCommand() {
return join(__dirname, './node_modules/.bin/npm');
}
export function npm(...args: string[]) {
return exec({}, getCommand(), args);
export function npm(options: SpawnOptions, ...args: string[]) {
return exec(options, getCommand(), args);
}

View File

@@ -1,5 +1,17 @@
# @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

View 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();
});
});

View 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();
});
});

View 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();
});
});

View File

@@ -14,6 +14,7 @@ describe('install a package', () => {
test('should run npm info json body', async () => {
const resp = await npm(
{},
'info',
'verdaccio',
'--json',

View 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();
});
});

View File

@@ -0,0 +1,3 @@
const config = require('../jest.config');
module.exports = { ...config };

View File

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

View File

@@ -0,0 +1,24 @@
import { addRegistry, initialSetup } from '@verdaccio/test-cli-commons';
import { npm } from './utils';
describe('ping registry', () => {
jest.setTimeout(10000);
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();
});
});

View File

@@ -0,0 +1,41 @@
import { addRegistry, initialSetup, prepareGenericEmptyProject } 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.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();
});
});

View File

@@ -0,0 +1,33 @@
import { addRegistry, initialSetup } from '@verdaccio/test-cli-commons';
import { npm } from './utils';
describe('search a package', () => {
jest.setTimeout(10000);
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();
});
});

View 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();
});
});

View File

@@ -1,3 +1,4 @@
import { SpawnOptions } from 'child_process';
import { join } from 'path';
import { exec } from '@verdaccio/test-cli-commons';
@@ -6,6 +7,6 @@ export function getCommand() {
return join(__dirname, './node_modules/.bin/npm');
}
export function npm(...args: string[]) {
return exec({}, getCommand(), args);
export function npm(options: SpawnOptions, ...args: string[]) {
return exec(options, getCommand(), args);
}

View File

@@ -1,5 +1,17 @@
# @verdaccio/e2e-cli-npm8
## 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

View File

@@ -0,0 +1,44 @@
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.auditReportVersion).toBeDefined();
expect(parsedBody.vulnerabilities).toBeDefined();
}
);
afterAll(async () => {
registry.stop();
});
});

View 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();
});
});

View 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();
});
});

View File

@@ -14,6 +14,7 @@ describe('install a package', () => {
test('should run npm info json body', async () => {
const resp = await npm(
{},
'info',
'verdaccio',
'--json',

View 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(100000);
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();
});
});

View File

@@ -0,0 +1,3 @@
const config = require('../jest.config');
module.exports = { ...config };

View File

@@ -1,10 +1,10 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-npm8",
"version": "1.0.1-6-next.3",
"version": "1.0.1-6-next.5",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.3",
"npm": "next-8"
"@verdaccio/test-cli-commons": "workspace:1.0.1-6-next.5",
"npm": "8.19.2"
},
"scripts": {
"test": "jest"

View File

@@ -0,0 +1,24 @@
import { addRegistry, initialSetup } from '@verdaccio/test-cli-commons';
import { npm } from './utils';
describe('ping registry', () => {
jest.setTimeout(10000);
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();
});
});

View File

@@ -0,0 +1,41 @@
import { addRegistry, initialSetup, prepareGenericEmptyProject } 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.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();
});
});

View File

@@ -0,0 +1,33 @@
import { addRegistry, initialSetup } from '@verdaccio/test-cli-commons';
import { npm } from './utils';
describe('search a package', () => {
jest.setTimeout(10000);
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();
});
});

View 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();
});
});

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