0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

chore: enable pnpm e2e ci (#4554)

* enable pnpm ci

* Update ci.yml

* remove pnpm 6 and 7

* update readme ci

* Update SECURITY.md

* Update README.md
This commit is contained in:
Juan Picado 2024-03-23 11:32:13 +01:00 committed by GitHub
parent 9db15542dc
commit ff1bd1ab7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 105 additions and 744 deletions

View file

@ -14,6 +14,9 @@ on:
- 'pnpm-workspace.yaml'
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare:

View file

@ -126,51 +126,50 @@ jobs:
run: pnpm --filter @verdaccio/test-cli-commons build
- name: Test CLI
run: NODE_ENV=production pnpm test --filter ...@verdaccio/e2e-cli-${{matrix.pkg}}
# TODO: fix pnpm setup
# e2e-cli-pnpm:
# needs: [prepare, build]
# strategy:
# fail-fast: true
# matrix:
# pkg:
# [
# pnpm6,
# pnpm7,
# pnpm8
# ]
# node: [20, 21]
# name: ${{ matrix.pkg }}/ ubuntu-latest / ${{ matrix.node }}
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v3
# - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
e2e-cli-pnpm:
needs: [prepare, build]
strategy:
fail-fast: true
matrix:
pkg:
[
pnpm8,
pnpm9,
]
node: [20, 21]
name: ${{ matrix.pkg }}/ ubuntu-latest / ${{ matrix.node }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v3
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
with:
node-version: ${{ matrix.node }}
- name: Install pnpm
run: |
corepack enable
corepack prepare
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
- name: set store
run: |
pnpm config set store-dir ~/.pnpm-store
- name: Install
run: pnpm install --loglevel debug --ignore-scripts --registry http://localhost:4873
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
with:
path: ./packages/
key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
# - uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # tag=v3
# with:
# node-version: ${{ matrix.node }}
# - name: Install pnpm
# run: |
# corepack enable
# corepack prepare
# - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
# with:
# path: ~/.pnpm-store
# key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
# - name: set store
# run: |
# pnpm config set store-dir ~/.pnpm-store
# - name: Install
# run: pnpm install --loglevel debug --ignore-scripts --registry http://localhost:4873
# - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
# with:
# path: ./packages/
# key: pkg-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
# # - uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # tag=v3
# # with:
# # path: ./e2e/
# # key: test-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
# - name: build e2e
# run: pnpm --filter @verdaccio/test-cli-commons build
# - name: Test CLI
# run: NODE_ENV=production pnpm test --filter ...@verdaccio/e2e-cli-${{matrix.pkg}}
# path: ./e2e/
# key: test-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.run_id }}-${{ github.sha }}
- name: build e2e
run: pnpm --filter @verdaccio/test-cli-commons build
- name: Test CLI
run: NODE_ENV=production pnpm test --filter ...@verdaccio/e2e-cli-${{matrix.pkg}}
e2e-cli-yarn:
needs: [prepare, build]
strategy:

View file

@ -85,6 +85,28 @@ npm install --location=global generator-verdaccio-plugin
Learn more [here](https://verdaccio.org/docs/dev-plugins) how to develop plugins. Share your plugins with the community.
## Integration Tests
In our compatibility testing project, we're dedicated to ensuring that your favorite commands work seamlessly across different versions of npm, pnpm, and Yarn. From publishing packages to managing dependencies.
Our goal is to give you the confidence to use your preferred package manager without any issues. So dive in, check out our matrix, and see how your commands fare across the board!
[Learn or contribute here](https://github.com/verdaccio/verdaccio/tree/master/e2e/cli)
### Commands
| cmd | npm6 | npm7 | npm8 | npm9 | npm10 | pnpm8 | pnpm9 (beta) | yarn1 | yarn2 | yarn3 | yarn4 |
| --------- | ---- | ---- | ---- | ---- | ----- | ----- | ------------ | ----- | ----- | ----- | ----- |
| publish | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| info | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| audit | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| install | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| deprecate | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ | ⛔ |
| ping | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ | ⛔ |
| search | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ | ⛔ |
| star | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ | ⛔ |
| stars | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ⛔ | ⛔ | ⛔ | ⛔ |
| dist-tag | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
## Donations
Verdaccio is run by **volunteers**; nobody is working full-time on it. If you find this project to be useful and would like to support its development, consider doing a long support donation - **and your logo will be on this section of the readme.**
@ -123,7 +145,7 @@ Furthermore, here few examples how to start:
## Watch our Videos
**Node Congress 2022, February 2022, Online Free**
**Node 2022, February 2022, Online Free**
<div>
<a href="https://portal.gitnation.org/contents/five-ways-of-taking-advantage-of-verdaccio-your-private-and-proxy-nodejs-registry">

View file

@ -34,7 +34,7 @@ Note that time-frame and processes are subject to each programs own policy.
- Report the security issue to the project maintainers directly at verdaccio@pm.me. If the report contains highly sensitive information, please be advised to encrypt your findings using our [PGP key](https://cdn.verdaccio.dev/gpg/publickey.verdaccio@pm.me.asc) which is also available in this document.
Your efforts to responsibly disclose your findings are sincerely appreciated and will be taken into account to acknowledge your contributions.
Your efforts to responsibly disclose your findings are sincerely appreciated. There isn't a security bounty program available, but any security contributions will be duly acknowledged to recognize your valuable input.
## PGP key

View file

@ -7,8 +7,8 @@
### Commands Tested
| cmd | npm6 | npm7 | npm8 | npm9 | npm10 | pnpm6 | pnpm7 | yarn1 | yarn2 | yarn3 | yarn4 |
| --------- | ---- | ---- | ---- | ---- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
| cmd | npm6 | npm7 | npm8 | npm9 | npm10 | pnpm8 | pnpm9 (beta) | yarn1 | yarn2 | yarn3 | yarn4 |
| --------- | ---- | ---- | ---- | ---- | ----- | ----- | ------------ | ----- | ----- | ----- | ----- |
| publish | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| info | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| audit | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |

View file

@ -1,63 +0,0 @@
# @verdaccio/e2e-cli-pnpm6
## 1.0.1
### Patch Changes
- 351aeeaa8: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa8]
- Updated dependencies [d167f92e1]
- Updated dependencies [c383eb68c]
- @verdaccio/test-cli-commons@1.1.0
## 1.0.1-6-next.7
### Patch Changes
- Updated dependencies [c383eb68]
- @verdaccio/test-cli-commons@1.1.0-6-next.7
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes
- @verdaccio/test-cli-commons@1.0.1-6-next.5
## 1.0.1-6-next.4
### Patch Changes
- @verdaccio/test-cli-commons@1.0.1-6-next.4
## 1.0.1-6-next.3
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/test-cli-commons@1.0.1-6-next.3
## 1.0.1-6-next.2
### Patch Changes
- @verdaccio/test-cli-commons@1.0.1-6-next.2
## 1.0.1-6-next.1
### Patch Changes
- @verdaccio/test-cli-commons@1.0.1-6-next.1
## 1.0.1-6-next.0
### Patch Changes
- @verdaccio/test-cli-commons@1.0.1-6-next.0

View file

@ -1,45 +0,0 @@
import { addRegistry, initialSetup, prepareGenericEmptyProject } from '@verdaccio/test-cli-commons';
import { pnpm } 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 pnpm({ cwd: tempFolder }, 'install', ...addRegistry(registry.getRegistryUrl()));
const resp = await pnpm(
{ 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

@ -1,12 +0,0 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-pnpm6",
"version": "1.0.1",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.1.0",
"pnpm": "^6.35.1"
},
"scripts": {
"test": "jest"
}
}

View file

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

View file

@ -1,3 +0,0 @@
{
"extends": "../../../.babelrc"
}

View file

@ -1,7 +0,0 @@
{
"rules": {
"no-console": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/explicit-member-accessibility": 0
}
}

View file

@ -1,63 +0,0 @@
# @verdaccio/e2e-cli-pnpm7
## 1.0.1
### Patch Changes
- 351aeeaa8: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa8]
- Updated dependencies [d167f92e1]
- Updated dependencies [c383eb68c]
- @verdaccio/test-cli-commons@1.1.0
## 1.0.1-6-next.7
### Patch Changes
- Updated dependencies [c383eb68]
- @verdaccio/test-cli-commons@1.1.0-6-next.7
## 1.0.1-6-next.6
### Patch Changes
- Updated dependencies [d167f92e]
- @verdaccio/test-cli-commons@1.1.0-6-next.6
## 1.0.1-6-next.5
### Patch Changes
- @verdaccio/test-cli-commons@1.0.1-6-next.5
## 1.0.1-6-next.4
### Patch Changes
- @verdaccio/test-cli-commons@1.0.1-6-next.4
## 1.0.1-6-next.3
### Patch Changes
- 351aeeaa: fix(deps): @verdaccio/utils should be a prod dep of local-storage
- Updated dependencies [351aeeaa]
- @verdaccio/test-cli-commons@1.0.1-6-next.3
## 1.0.1-6-next.2
### Patch Changes
- @verdaccio/test-cli-commons@1.0.1-6-next.2
## 1.0.1-6-next.1
### Patch Changes
- @verdaccio/test-cli-commons@1.0.1-6-next.1
## 1.0.1-6-next.0
### Patch Changes
- @verdaccio/test-cli-commons@1.0.1-6-next.0

View file

@ -1,115 +0,0 @@
import {
addRegistry,
initialSetup,
pnpmUtils,
prepareGenericEmptyProject,
} from '@verdaccio/test-cli-commons';
import { pnpm } from './utils';
describe('deprecate a package', () => {
jest.setTimeout(20000);
let registry;
async function deprecate(tempFolder, packageVersion, registry, message) {
await pnpm(
{ 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 pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
// deprecate one version
await deprecate(tempFolder, `${pkgName}@1.0.0`, registry, message);
// verify is deprecated
const infoBody = await pnpmUtils.getInfoVersions(pnpm, `${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 pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
// deprecate one version
await deprecate(tempFolder, `${pkgName}@1.0.0`, registry, message);
// verify is deprecated
const infoBody = await pnpmUtils.getInfoVersions(pnpm, `${pkgName}`, registry);
expect(infoBody.deprecated).toEqual(message);
// empty string is same as undeprecate
await deprecate(tempFolder, `${pkgName}@1.0.0`, registry, '');
const infoBody2 = await pnpmUtils.getInfoVersions(pnpm, `${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 pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
// publish 1.1.0
await pnpmUtils.bumbUp(pnpm, tempFolder, registry);
await pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
// publish 1.2.0
await pnpmUtils.bumbUp(pnpm, tempFolder, registry);
await pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
// publish 1.3.0
await pnpmUtils.bumbUp(pnpm, tempFolder, registry);
await pnpmUtils.publish(pnpm, 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 pnpmUtils.getInfoVersions(pnpm, `${pkgName}@${v}`, registry);
expect(infoResp.deprecated).toEqual(message);
}
// publish normal version
// publish 1.4.0
await pnpmUtils.bumbUp(pnpm, tempFolder, registry);
await pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
const infoResp = await pnpmUtils.getInfoVersions(pnpm, `${pkgName}@1.4.0`, registry);
// must be not deprecated
expect(infoResp.deprecated).toBeUndefined();
}
);
afterAll(async () => {
registry.stop();
});
});

View file

@ -1,91 +0,0 @@
import {
addRegistry,
initialSetup,
pnpmUtils,
prepareGenericEmptyProject,
} from '@verdaccio/test-cli-commons';
import { pnpm } 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 pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
await pnpmUtils.bumbUp(pnpm, tempFolder, registry);
await pnpmUtils.publish(pnpm, tempFolder, pkgName, registry, ['--tag', 'beta']);
const resp2 = await pnpm(
{ 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 pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
await pnpmUtils.bumbUp(pnpm, tempFolder, registry);
await pnpmUtils.publish(pnpm, tempFolder, pkgName, registry, ['--tag', 'beta']);
const resp2 = await pnpm(
{ 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 pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
await pnpmUtils.bumbUp(pnpm, tempFolder, registry);
await pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
const resp2 = await pnpm(
{ 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

@ -1,31 +0,0 @@
import { addRegistry, initialSetup } from '@verdaccio/test-cli-commons';
import { pnpm } from './utils';
describe('install a package', () => {
jest.setTimeout(10000);
let registry;
beforeAll(async () => {
const setup = await initialSetup();
registry = setup.registry;
await registry.init();
});
test('should run pnpm info json body', async () => {
const resp = await pnpm(
{},
'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

@ -1,36 +0,0 @@
import { addRegistry, initialSetup, prepareGenericEmptyProject } from '@verdaccio/test-cli-commons';
import { pnpm } 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 pnpm(
{ cwd: tempFolder },
'install',
'--reporter=default',
...addRegistry(registry.getRegistryUrl())
);
expect(resp.stdout).toMatch(/react/);
});
afterAll(async () => {
registry.stop();
});
});

View file

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

View file

@ -1,24 +0,0 @@
import { addRegistry, initialSetup } from '@verdaccio/test-cli-commons';
import { pnpm } 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 pnpm({}, '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

@ -1,41 +0,0 @@
import { addRegistry, initialSetup, prepareGenericEmptyProject } from '@verdaccio/test-cli-commons';
import { pnpm } 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 pnpm(
{ 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

@ -1,33 +0,0 @@
import { addRegistry, initialSetup } from '@verdaccio/test-cli-commons';
import { pnpm } 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 pnpm(
{},
'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

@ -1,89 +0,0 @@
import {
addRegistry,
initialSetup,
pnpmUtils,
prepareGenericEmptyProject,
} from '@verdaccio/test-cli-commons';
import { pnpm } 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 pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
const resp = await pnpm(
{ 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 pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
const resp = await pnpm(
{ cwd: tempFolder },
'star',
pkgName,
...addRegistry(registry.getRegistryUrl())
);
expect(resp.stdout).toEqual(`${pkgName}`);
const resp1 = await pnpm(
{ cwd: tempFolder },
'unstar',
pkgName,
...addRegistry(registry.getRegistryUrl())
);
expect(resp1.stdout).toEqual(`${pkgName}`);
});
test('should list stars of a user %s', async () => {
const pkgName = '@verdaccio/stars';
const { tempFolder } = await prepareGenericEmptyProject(
pkgName,
'1.0.0-patch',
registry.port,
registry.getToken(),
registry.getRegistryUrl()
);
await pnpmUtils.publish(pnpm, tempFolder, pkgName, registry);
await pnpm({ cwd: tempFolder }, 'star', pkgName, ...addRegistry(registry.getRegistryUrl()));
const resp = await pnpm(
{ cwd: tempFolder },
'stars',
...addRegistry(registry.getRegistryUrl())
);
// side effects: this result is affected the the package published in the previous step
expect(resp.stdout).toEqual(`@verdaccio/foo@verdaccio/stars`);
});
afterAll(async () => {
registry.stop();
});
});

View file

@ -1,8 +0,0 @@
{
"extends": "../../../tsconfig.reference.json",
"references": [
{
"path": "../cli-commons"
}
]
}

View file

@ -4,7 +4,7 @@
"version": "1.0.1",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.1.0",
"pnpm": "^8.0.0-alpha.0"
"pnpm": "8.15.5"
},
"scripts": {
"test": "jest"

View file

@ -1,10 +1,10 @@
{
"private": true,
"name": "@verdaccio/e2e-cli-pnpm7",
"name": "@verdaccio/e2e-cli-pnpm9",
"version": "1.0.1",
"dependencies": {
"@verdaccio/test-cli-commons": "workspace:1.1.0",
"pnpm": "^7.27.1"
"pnpm": "9.0.0-alpha.10"
},
"scripts": {
"test": "jest"

View file

@ -450,8 +450,17 @@ importers:
specifier: workspace:1.1.0
version: link:../cli-commons
pnpm:
specifier: ^8.0.0-alpha.0
version: 8.2.0
specifier: 8.15.5
version: 8.15.5
e2e/cli/e2e-pnpm9:
dependencies:
'@verdaccio/test-cli-commons':
specifier: workspace:1.1.0
version: link:../cli-commons
pnpm:
specifier: 9.0.0-alpha.10
version: 9.0.0-alpha.10
e2e/cli/e2e-yarn1:
dependencies:
@ -24006,12 +24015,18 @@ packages:
hasBin: true
dev: false
/pnpm@8.2.0:
resolution: {integrity: sha512-f2/abl6GycxLgVZQtWA2zBJKMXcv2L86HGRwJ4qnS02gVzLgtFegC25qWKFtUunCY74GUwxq2A7yGAJEyOuCYg==}
/pnpm@8.15.5:
resolution: {integrity: sha512-sFGjLH5pWDO4SSbTspuMylclS1ifBknYmcbp0O22cLkex+KkNFm65zdZu1zmGcMmbxFr+THOItHvF1mn5Fqpbw==}
engines: {node: '>=16.14'}
hasBin: true
dev: false
/pnpm@9.0.0-alpha.10:
resolution: {integrity: sha512-p5tDi5ur9ZKSQjh+6DsWpYFPX4HuWfcMw6L8SAPWm7DE0B9QyBSuN9VnjSOionb7WlQBRS8Z7M4Jfd4S9KIBxw==}
engines: {node: '>=18.12'}
hasBin: true
dev: false
/polished@4.2.2:
resolution: {integrity: sha512-Sz2Lkdxz6F2Pgnpi9U5Ng/WdWAUZxmHrNPoVlm3aAemxoy2Qy7LGjQg4uf8qKelDAUW94F4np3iH2YPf2qefcQ==}
engines: {node: '>=10'}