@verdaccio/e2e-cli 2.10.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/Cargo.lock +1591 -0
  2. package/Cargo.toml +19 -0
  3. package/bin/e2e-cli.js +26 -6
  4. package/build/bin/verdaccio-e2e +0 -0
  5. package/build/cjs/index.cjs +11 -166
  6. package/build/esm/index.js +10 -153
  7. package/build/index.d.ts +15 -6
  8. package/package.json +14 -16
  9. package/scripts/build-js-package.mjs +25 -0
  10. package/src/e2e_tests/audit.rs +51 -0
  11. package/src/e2e_tests/ci.rs +32 -0
  12. package/src/e2e_tests/deprecate.rs +64 -0
  13. package/src/e2e_tests/dist_tags.rs +56 -0
  14. package/src/e2e_tests/info.rs +43 -0
  15. package/src/e2e_tests/install.rs +27 -0
  16. package/src/e2e_tests/login.rs +64 -0
  17. package/src/e2e_tests/mod.rs +104 -0
  18. package/src/e2e_tests/ping.rs +33 -0
  19. package/src/e2e_tests/publish.rs +68 -0
  20. package/src/e2e_tests/search.rs +14 -0
  21. package/src/e2e_tests/unpublish.rs +37 -0
  22. package/src/main.rs +1411 -0
  23. package/src/scenarios/install_multiple_deps.rs +99 -0
  24. package/src/scenarios/minimum_release_age.rs +45 -0
  25. package/src/scenarios/mod.rs +11 -0
  26. package/build/adapters/adapter.d.ts +0 -1
  27. package/build/adapters/bun.d.ts +0 -2
  28. package/build/adapters/deno.d.ts +0 -2
  29. package/build/adapters/index.d.ts +0 -6
  30. package/build/adapters/npm.d.ts +0 -2
  31. package/build/adapters/pnpm.d.ts +0 -2
  32. package/build/adapters/yarn-classic.d.ts +0 -2
  33. package/build/adapters/yarn-modern.d.ts +0 -2
  34. package/build/cjs/_virtual/_rolldown/runtime.cjs +0 -23
  35. package/build/cjs/adapters/bun.cjs +0 -63
  36. package/build/cjs/adapters/bun.cjs.map +0 -1
  37. package/build/cjs/adapters/deno.cjs +0 -58
  38. package/build/cjs/adapters/deno.cjs.map +0 -1
  39. package/build/cjs/adapters/index.cjs +0 -6
  40. package/build/cjs/adapters/npm.cjs +0 -75
  41. package/build/cjs/adapters/npm.cjs.map +0 -1
  42. package/build/cjs/adapters/pnpm.cjs +0 -104
  43. package/build/cjs/adapters/pnpm.cjs.map +0 -1
  44. package/build/cjs/adapters/yarn-classic.cjs +0 -98
  45. package/build/cjs/adapters/yarn-classic.cjs.map +0 -1
  46. package/build/cjs/adapters/yarn-modern.cjs +0 -206
  47. package/build/cjs/adapters/yarn-modern.cjs.map +0 -1
  48. package/build/cjs/index.cjs.map +0 -1
  49. package/build/cjs/reporter.cjs +0 -113
  50. package/build/cjs/reporter.cjs.map +0 -1
  51. package/build/cjs/runner.cjs +0 -141
  52. package/build/cjs/runner.cjs.map +0 -1
  53. package/build/cjs/scenarios/index.cjs +0 -8
  54. package/build/cjs/scenarios/index.cjs.map +0 -1
  55. package/build/cjs/scenarios/install-multiple-deps.cjs +0 -117
  56. package/build/cjs/scenarios/install-multiple-deps.cjs.map +0 -1
  57. package/build/cjs/scenarios/minimum-release-age.cjs +0 -112
  58. package/build/cjs/scenarios/minimum-release-age.cjs.map +0 -1
  59. package/build/cjs/tests/audit.cjs +0 -47
  60. package/build/cjs/tests/audit.cjs.map +0 -1
  61. package/build/cjs/tests/ci.cjs +0 -83
  62. package/build/cjs/tests/ci.cjs.map +0 -1
  63. package/build/cjs/tests/deprecate.cjs +0 -107
  64. package/build/cjs/tests/deprecate.cjs.map +0 -1
  65. package/build/cjs/tests/dist-tags.cjs +0 -43
  66. package/build/cjs/tests/dist-tags.cjs.map +0 -1
  67. package/build/cjs/tests/index.cjs +0 -33
  68. package/build/cjs/tests/index.cjs.map +0 -1
  69. package/build/cjs/tests/info.cjs +0 -42
  70. package/build/cjs/tests/info.cjs.map +0 -1
  71. package/build/cjs/tests/install.cjs +0 -27
  72. package/build/cjs/tests/install.cjs.map +0 -1
  73. package/build/cjs/tests/login.cjs +0 -117
  74. package/build/cjs/tests/login.cjs.map +0 -1
  75. package/build/cjs/tests/ping.cjs +0 -30
  76. package/build/cjs/tests/ping.cjs.map +0 -1
  77. package/build/cjs/tests/publish.cjs +0 -37
  78. package/build/cjs/tests/publish.cjs.map +0 -1
  79. package/build/cjs/tests/search.cjs +0 -19
  80. package/build/cjs/tests/search.cjs.map +0 -1
  81. package/build/cjs/tests/unpublish.cjs +0 -40
  82. package/build/cjs/tests/unpublish.cjs.map +0 -1
  83. package/build/cjs/utils/info.cjs +0 -25
  84. package/build/cjs/utils/info.cjs.map +0 -1
  85. package/build/cjs/utils/process.cjs +0 -85
  86. package/build/cjs/utils/process.cjs.map +0 -1
  87. package/build/cjs/utils/project.cjs +0 -55
  88. package/build/cjs/utils/project.cjs.map +0 -1
  89. package/build/cjs/utils/registry-client.cjs +0 -56
  90. package/build/cjs/utils/registry-client.cjs.map +0 -1
  91. package/build/esm/adapters/bun.js +0 -61
  92. package/build/esm/adapters/bun.js.map +0 -1
  93. package/build/esm/adapters/deno.js +0 -56
  94. package/build/esm/adapters/deno.js.map +0 -1
  95. package/build/esm/adapters/index.js +0 -7
  96. package/build/esm/adapters/npm.js +0 -73
  97. package/build/esm/adapters/npm.js.map +0 -1
  98. package/build/esm/adapters/pnpm.js +0 -102
  99. package/build/esm/adapters/pnpm.js.map +0 -1
  100. package/build/esm/adapters/yarn-classic.js +0 -96
  101. package/build/esm/adapters/yarn-classic.js.map +0 -1
  102. package/build/esm/adapters/yarn-modern.js +0 -203
  103. package/build/esm/adapters/yarn-modern.js.map +0 -1
  104. package/build/esm/index.js.map +0 -1
  105. package/build/esm/reporter.js +0 -107
  106. package/build/esm/reporter.js.map +0 -1
  107. package/build/esm/runner.js +0 -138
  108. package/build/esm/runner.js.map +0 -1
  109. package/build/esm/scenarios/index.js +0 -8
  110. package/build/esm/scenarios/index.js.map +0 -1
  111. package/build/esm/scenarios/install-multiple-deps.js +0 -114
  112. package/build/esm/scenarios/install-multiple-deps.js.map +0 -1
  113. package/build/esm/scenarios/minimum-release-age.js +0 -109
  114. package/build/esm/scenarios/minimum-release-age.js.map +0 -1
  115. package/build/esm/tests/audit.js +0 -44
  116. package/build/esm/tests/audit.js.map +0 -1
  117. package/build/esm/tests/ci.js +0 -80
  118. package/build/esm/tests/ci.js.map +0 -1
  119. package/build/esm/tests/deprecate.js +0 -104
  120. package/build/esm/tests/deprecate.js.map +0 -1
  121. package/build/esm/tests/dist-tags.js +0 -41
  122. package/build/esm/tests/dist-tags.js.map +0 -1
  123. package/build/esm/tests/index.js +0 -33
  124. package/build/esm/tests/index.js.map +0 -1
  125. package/build/esm/tests/info.js +0 -40
  126. package/build/esm/tests/info.js.map +0 -1
  127. package/build/esm/tests/install.js +0 -25
  128. package/build/esm/tests/install.js.map +0 -1
  129. package/build/esm/tests/login.js +0 -113
  130. package/build/esm/tests/login.js.map +0 -1
  131. package/build/esm/tests/ping.js +0 -28
  132. package/build/esm/tests/ping.js.map +0 -1
  133. package/build/esm/tests/publish.js +0 -35
  134. package/build/esm/tests/publish.js.map +0 -1
  135. package/build/esm/tests/search.js +0 -17
  136. package/build/esm/tests/search.js.map +0 -1
  137. package/build/esm/tests/unpublish.js +0 -38
  138. package/build/esm/tests/unpublish.js.map +0 -1
  139. package/build/esm/utils/info.js +0 -24
  140. package/build/esm/utils/info.js.map +0 -1
  141. package/build/esm/utils/process.js +0 -82
  142. package/build/esm/utils/process.js.map +0 -1
  143. package/build/esm/utils/project.js +0 -50
  144. package/build/esm/utils/project.js.map +0 -1
  145. package/build/esm/utils/registry-client.js +0 -53
  146. package/build/esm/utils/registry-client.js.map +0 -1
  147. package/build/reporter.d.ts +0 -7
  148. package/build/runner.d.ts +0 -13
  149. package/build/scenarios/index.d.ts +0 -5
  150. package/build/scenarios/install-multiple-deps.d.ts +0 -2
  151. package/build/scenarios/minimum-release-age.d.ts +0 -11
  152. package/build/tests/audit.d.ts +0 -2
  153. package/build/tests/ci.d.ts +0 -2
  154. package/build/tests/deprecate.d.ts +0 -2
  155. package/build/tests/dist-tags.d.ts +0 -2
  156. package/build/tests/index.d.ts +0 -15
  157. package/build/tests/info.d.ts +0 -2
  158. package/build/tests/install.d.ts +0 -2
  159. package/build/tests/login.d.ts +0 -2
  160. package/build/tests/ping.d.ts +0 -2
  161. package/build/tests/publish.d.ts +0 -2
  162. package/build/tests/search.d.ts +0 -2
  163. package/build/tests/unpublish.d.ts +0 -2
  164. package/build/types.d.ts +0 -81
  165. package/build/utils/index.d.ts +0 -4
  166. package/build/utils/info.d.ts +0 -14
  167. package/build/utils/process.d.ts +0 -4
  168. package/build/utils/project.d.ts +0 -6
  169. package/build/utils/registry-client.d.ts +0 -15
package/build/runner.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import { PackageManagerAdapter, SuiteResult, TestDefinition } from './types';
2
- export declare function runSuite(adapter: PackageManagerAdapter, tests: TestDefinition[], registryUrl: string, token: string, options: {
3
- timeout: number;
4
- testFilter?: string[];
5
- }): Promise<SuiteResult>;
6
- export declare function runAll(adapters: PackageManagerAdapter[], tests: TestDefinition[], registryUrl: string, token: string, options: {
7
- timeout: number;
8
- concurrency: number;
9
- testFilter?: string[];
10
- }): Promise<{
11
- results: SuiteResult[];
12
- exitCode: number;
13
- }>;
@@ -1,5 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- import { installMultipleDepsScenario } from './install-multiple-deps';
3
- import { minimumReleaseAgeScenario } from './minimum-release-age';
4
- export declare const allScenarios: TestDefinition[];
5
- export { installMultipleDepsScenario, minimumReleaseAgeScenario };
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const installMultipleDepsScenario: TestDefinition;
@@ -1,11 +0,0 @@
1
- import { PackageManagerAdapter, TestDefinition } from '../types';
2
- /**
3
- * True only for pnpm versions that actually enforce minimumReleaseAge.
4
- *
5
- * The cooldown is honored in pnpm 11.1.0+, but it is silently ignored in
6
- * 11.0.0 / 11.0.1 (and the 11.0.0 release candidates) — those versions install
7
- * brand-new packages regardless of the configured cooldown. We scope this
8
- * scenario to pnpm 11.1.0 and newer so it doesn't false-fail on that regression.
9
- */
10
- export declare function isPnpm11Plus(adapter: PackageManagerAdapter): boolean;
11
- export declare const minimumReleaseAgeScenario: TestDefinition;
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const auditTest: TestDefinition;
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const ciTest: TestDefinition;
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const deprecateTest: TestDefinition;
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const distTagsTest: TestDefinition;
@@ -1,15 +0,0 @@
1
- import { allScenarios, installMultipleDepsScenario, minimumReleaseAgeScenario } from '../scenarios';
2
- import { TestDefinition } from '../types';
3
- import { auditTest } from './audit';
4
- import { ciTest } from './ci';
5
- import { deprecateTest } from './deprecate';
6
- import { distTagsTest } from './dist-tags';
7
- import { infoTest } from './info';
8
- import { installTest } from './install';
9
- import { loginTest } from './login';
10
- import { pingTest } from './ping';
11
- import { publishTest } from './publish';
12
- import { searchTest } from './search';
13
- import { unpublishTest } from './unpublish';
14
- export declare const allTests: TestDefinition[];
15
- export { publishTest, installTest, ciTest, auditTest, infoTest, deprecateTest, distTagsTest, loginTest, pingTest, searchTest, unpublishTest, installMultipleDepsScenario, minimumReleaseAgeScenario, allScenarios, };
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const infoTest: TestDefinition;
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const installTest: TestDefinition;
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const loginTest: TestDefinition;
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const pingTest: TestDefinition;
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const publishTest: TestDefinition;
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const searchTest: TestDefinition;
@@ -1,2 +0,0 @@
1
- import { TestDefinition } from '../types';
2
- export declare const unpublishTest: TestDefinition;
package/build/types.d.ts DELETED
@@ -1,81 +0,0 @@
1
- import { SpawnOptions } from 'child_process';
2
- export type ExecOutput = {
3
- stdout: string;
4
- stderr: string;
5
- };
6
- export type ExecFn = (options: SpawnOptions, ...args: string[]) => Promise<ExecOutput>;
7
- export type TestContext = {
8
- registryUrl: string;
9
- token: string;
10
- port: number;
11
- exec: ExecFn;
12
- adapter: PackageManagerAdapter;
13
- /** Unique suffix for package names to avoid conflicts across runs */
14
- runId: string;
15
- /** Report a sub-test step. Runs the callback and reports pass/fail. */
16
- subTest: (label: string, fn: () => Promise<void>) => Promise<void>;
17
- };
18
- export type SubTestResult = {
19
- label: string;
20
- passed: boolean;
21
- duration: number;
22
- error?: string;
23
- };
24
- export type TestResult = {
25
- name: string;
26
- passed: boolean;
27
- duration: number;
28
- error?: string;
29
- subTests?: SubTestResult[];
30
- };
31
- export type SuiteResult = {
32
- adapter: string;
33
- tests: TestResult[];
34
- passed: number;
35
- failed: number;
36
- skipped: number;
37
- duration: number;
38
- };
39
- export type TestDefinition = {
40
- name: string;
41
- run: (ctx: TestContext) => Promise<void>;
42
- /** Commands required for this test (e.g. 'deprecate', 'search'). Skipped if adapter doesn't support them. */
43
- requires?: string[];
44
- /**
45
- * Predicate to gate a test to specific adapters/versions. Returns false to skip.
46
- * Use for tests that only make sense on a particular package manager or version
47
- * (e.g. pnpm-only settings). Evaluated after the `requires` check.
48
- */
49
- appliesTo?: (adapter: PackageManagerAdapter) => boolean;
50
- };
51
- export interface PackageManagerAdapter {
52
- /** Display name, e.g. "npm@10" */
53
- name: string;
54
- /** Package manager type: npm, pnpm, yarn-classic, yarn-modern, bun, deno */
55
- type: 'npm' | 'pnpm' | 'yarn-classic' | 'yarn-modern' | 'bun' | 'deno';
56
- /** Resolved path to the binary */
57
- bin: string;
58
- /** Commands this PM supports */
59
- supports: Set<string>;
60
- /** Build --registry args */
61
- registryArg(url: string): string[];
62
- /** Build --prefix / --cwd args */
63
- prefixArg(folder: string): string[];
64
- /** Execute a command with this PM */
65
- exec(options: SpawnOptions, ...args: string[]): Promise<ExecOutput>;
66
- /** Prepare a temp project for testing. Returns path to temp folder. */
67
- prepareProject(packageName: string, version: string, registryUrl: string, port: number, token: string, dependencies?: Record<string, string>, devDependencies?: Record<string, string>): Promise<{
68
- tempFolder: string;
69
- }>;
70
- /** Import a Verdaccio yarn plugin into a project (yarn-modern only) */
71
- importPlugin?(cwd: string, pluginName: string): Promise<void>;
72
- }
73
- export type CliOptions = {
74
- registry: string;
75
- pm?: string[];
76
- test?: string[];
77
- concurrency: number;
78
- timeout: number;
79
- token?: string;
80
- verbose: boolean;
81
- };
@@ -1,4 +0,0 @@
1
- export { exec, setVerbose } from './process';
2
- export { createTempFolder, getPackageJSON, getREADME, prepareGenericEmptyProject } from './project';
3
- export { createUser, pingRegistry } from './registry-client';
4
- export { normalizeInfo, parseInfoJson } from './info';
@@ -1,14 +0,0 @@
1
- /**
2
- * Normalize the parsed output of `npm/pnpm info <pkg> --json`.
3
- *
4
- * npm 12+ wraps the result in a single-element JSON array
5
- * (e.g. `[{ "name": "verdaccio", ... }]`) for both full-packument and
6
- * version-specific queries, whereas older npm versions return a bare object.
7
- * When multiple results match a range, the array holds one entry per match;
8
- * the last entry is the highest (latest) version, which is what the tests want.
9
- *
10
- * Returns the bare object as-is for backward compatibility.
11
- */
12
- export declare function normalizeInfo(parsed: any): any;
13
- /** Parse `info --json` stdout and normalize to a single info object. */
14
- export declare function parseInfoJson(stdout: string): any;
@@ -1,4 +0,0 @@
1
- import { SpawnOptions } from 'child_process';
2
- import { ExecOutput } from '../types';
3
- export declare function setVerbose(v: boolean): void;
4
- export declare function exec(options: SpawnOptions, cmd: string, args: string[]): Promise<ExecOutput>;
@@ -1,6 +0,0 @@
1
- export declare function createTempFolder(prefix: string): Promise<string>;
2
- export declare function getPackageJSON(packageName: string, version?: string, dependencies?: Record<string, string>, devDependencies?: Record<string, string>): string;
3
- export declare function getREADME(packageName: string): string;
4
- export declare function prepareGenericEmptyProject(packageName: string, version: string, port: number, token: string, registryDomain: string, dependencies?: Record<string, string>, devDependencies?: Record<string, string>): Promise<{
5
- tempFolder: string;
6
- }>;
@@ -1,15 +0,0 @@
1
- export type RegistryAuth = {
2
- token: string;
3
- user: string;
4
- };
5
- /**
6
- * Creates a user on the registry and returns the auth token.
7
- * Uses a unique username per run to avoid 409 conflicts.
8
- * Works against any running Verdaccio instance with htpasswd auth.
9
- */
10
- export declare function createUser(registryUrl: string, user?: string, password?: string): Promise<RegistryAuth>;
11
- /**
12
- * Ping the registry to check it's alive.
13
- * Uses @verdaccio/registry-cli ping.
14
- */
15
- export declare function pingRegistry(registryUrl: string): Promise<boolean>;