@verdaccio/e2e-cli 2.1.1 → 2.3.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.
- package/build/adapters/npm.d.ts +1 -1
- package/build/adapters/pnpm.d.ts +1 -1
- package/build/adapters/yarn-classic.d.ts +1 -1
- package/build/adapters/yarn-modern.d.ts +1 -1
- package/build/cjs/adapters/npm.cjs +35 -4
- package/build/cjs/adapters/npm.cjs.map +1 -1
- package/build/cjs/adapters/pnpm.cjs +35 -4
- package/build/cjs/adapters/pnpm.cjs.map +1 -1
- package/build/cjs/adapters/yarn-classic.cjs +42 -8
- package/build/cjs/adapters/yarn-classic.cjs.map +1 -1
- package/build/cjs/adapters/yarn-modern.cjs +60 -6
- package/build/cjs/adapters/yarn-modern.cjs.map +1 -1
- package/build/cjs/index.cjs +30 -14
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/adapters/npm.js +35 -4
- package/build/esm/adapters/npm.js.map +1 -1
- package/build/esm/adapters/pnpm.js +35 -4
- package/build/esm/adapters/pnpm.js.map +1 -1
- package/build/esm/adapters/yarn-classic.js +42 -8
- package/build/esm/adapters/yarn-classic.js.map +1 -1
- package/build/esm/adapters/yarn-modern.js +60 -6
- package/build/esm/adapters/yarn-modern.js.map +1 -1
- package/build/esm/index.js +30 -14
- package/build/esm/index.js.map +1 -1
- package/package.json +1 -1
package/build/adapters/npm.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PackageManagerAdapter } from '../types';
|
|
2
|
-
export declare function createNpmAdapter(binPath?: string): PackageManagerAdapter;
|
|
2
|
+
export declare function createNpmAdapter(binPath?: string, version?: string): PackageManagerAdapter;
|
package/build/adapters/pnpm.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PackageManagerAdapter } from '../types';
|
|
2
|
-
export declare function createPnpmAdapter(binPath?: string): PackageManagerAdapter;
|
|
2
|
+
export declare function createPnpmAdapter(binPath?: string, version?: string): PackageManagerAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PackageManagerAdapter } from '../types';
|
|
2
|
-
export declare function createYarnClassicAdapter(binPath?: string): PackageManagerAdapter;
|
|
2
|
+
export declare function createYarnClassicAdapter(binPath?: string, version?: string): PackageManagerAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { PackageManagerAdapter } from '../types';
|
|
2
|
-
export declare function createYarnModernAdapter(binPath
|
|
2
|
+
export declare function createYarnModernAdapter(binPath?: string, version?: string): PackageManagerAdapter;
|
|
@@ -3,6 +3,7 @@ const require_process = require("../utils/process.cjs");
|
|
|
3
3
|
const require_project = require("../utils/project.cjs");
|
|
4
4
|
let debug = require("debug");
|
|
5
5
|
debug = require_runtime.__toESM(debug);
|
|
6
|
+
let child_process = require("child_process");
|
|
6
7
|
//#region src/adapters/npm.ts
|
|
7
8
|
var debug$1 = (0, debug.default)("verdaccio:e2e-cli:npm");
|
|
8
9
|
var NPM_SUPPORTED_COMMANDS = new Set([
|
|
@@ -19,11 +20,41 @@ var NPM_SUPPORTED_COMMANDS = new Set([
|
|
|
19
20
|
"stars",
|
|
20
21
|
"unstar"
|
|
21
22
|
]);
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
function detectVersion(bin) {
|
|
24
|
+
try {
|
|
25
|
+
return (0, child_process.execSync)(`${bin} --version`, {
|
|
26
|
+
encoding: "utf8",
|
|
27
|
+
timeout: 5e3
|
|
28
|
+
}).trim();
|
|
29
|
+
} catch {
|
|
30
|
+
return "unknown";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function installNpm(version) {
|
|
34
|
+
const pkg = `npm@${version}`;
|
|
35
|
+
debug$1("installing %s into temp dir", pkg);
|
|
36
|
+
const tmpDir = (0, child_process.execSync)("mktemp -d", { encoding: "utf8" }).trim();
|
|
37
|
+
(0, child_process.execSync)(`npm install --prefix "${tmpDir}" ${pkg} --loglevel=error`, {
|
|
38
|
+
encoding: "utf8",
|
|
39
|
+
timeout: 3e4
|
|
40
|
+
});
|
|
41
|
+
const bin = `${tmpDir}/node_modules/.bin/npm`;
|
|
42
|
+
const installed = detectVersion(bin);
|
|
43
|
+
debug$1("installed npm %s at %s", installed, bin);
|
|
44
|
+
console.log(` Auto-installed npm ${installed}`);
|
|
45
|
+
return bin;
|
|
46
|
+
}
|
|
47
|
+
function resolveNpmBin(binPath, version) {
|
|
48
|
+
if (binPath) return binPath;
|
|
49
|
+
if (version) return installNpm(version);
|
|
50
|
+
return "npm";
|
|
51
|
+
}
|
|
52
|
+
function createNpmAdapter(binPath, version) {
|
|
53
|
+
const bin = resolveNpmBin(binPath, version);
|
|
54
|
+
const resolved = detectVersion(bin);
|
|
55
|
+
debug$1("creating npm adapter with bin: %s (%s)", bin, resolved);
|
|
25
56
|
return {
|
|
26
|
-
name: `npm`,
|
|
57
|
+
name: `npm@${resolved}`,
|
|
27
58
|
type: "npm",
|
|
28
59
|
bin,
|
|
29
60
|
supports: NPM_SUPPORTED_COMMANDS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npm.cjs","names":[],"sources":["../../../src/adapters/npm.ts"],"sourcesContent":["import { SpawnOptions } from 'child_process';\nimport buildDebug from 'debug';\
|
|
1
|
+
{"version":3,"file":"npm.cjs","names":[],"sources":["../../../src/adapters/npm.ts"],"sourcesContent":["import { SpawnOptions, execSync } from 'child_process';\nimport buildDebug from 'debug';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { prepareGenericEmptyProject } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:npm');\n\nconst NPM_SUPPORTED_COMMANDS = new Set([\n 'publish',\n 'unpublish',\n 'install',\n 'info',\n 'audit',\n 'deprecate',\n 'dist-tag',\n 'ping',\n 'search',\n 'star',\n 'stars',\n 'unstar',\n]);\n\nfunction detectVersion(bin: string): string {\n try {\n return execSync(`${bin} --version`, { encoding: 'utf8', timeout: 5000 }).trim();\n } catch {\n return 'unknown';\n }\n}\n\nfunction installNpm(version: string): string {\n const pkg = `npm@${version}`;\n debug('installing %s into temp dir', pkg);\n const tmpDir = execSync('mktemp -d', { encoding: 'utf8' }).trim();\n execSync(`npm install --prefix \"${tmpDir}\" ${pkg} --loglevel=error`, {\n encoding: 'utf8',\n timeout: 30000,\n });\n const bin = `${tmpDir}/node_modules/.bin/npm`;\n const installed = detectVersion(bin);\n debug('installed npm %s at %s', installed, bin);\n console.log(` Auto-installed npm ${installed}`);\n return bin;\n}\n\nfunction resolveNpmBin(binPath?: string, version?: string): string {\n if (binPath) return binPath;\n if (version) return installNpm(version);\n return 'npm';\n}\n\nexport function createNpmAdapter(binPath?: string, version?: string): PackageManagerAdapter {\n const bin = resolveNpmBin(binPath, version);\n const resolved = detectVersion(bin);\n debug('creating npm adapter with bin: %s (%s)', bin, resolved);\n\n const adapter: PackageManagerAdapter = {\n name: `npm@${resolved}`,\n type: 'npm',\n bin,\n supports: NPM_SUPPORTED_COMMANDS,\n\n registryArg(url: string): string[] {\n return ['--registry', url];\n },\n\n prefixArg(folder: string): string[] {\n return ['--prefix', folder];\n },\n\n exec(options: SpawnOptions, ...args: string[]): Promise<ExecOutput> {\n return exec(options, bin, args);\n },\n\n async prepareProject(\n packageName: string,\n version: string,\n registryUrl: string,\n port: number,\n token: string,\n dependencies: Record<string, string> = {},\n devDependencies: Record<string, string> = {}\n ): Promise<{ tempFolder: string }> {\n return prepareGenericEmptyProject(\n packageName,\n version,\n port,\n token,\n registryUrl,\n dependencies,\n devDependencies\n );\n },\n };\n\n return adapter;\n}\n"],"mappings":";;;;;;;AAOA,IAAM,WAAA,GAAA,MAAA,SAAmB,wBAAwB;AAEjD,IAAM,yBAAyB,IAAI,IAAI;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAS,cAAc,KAAqB;AAC1C,KAAI;AACF,UAAA,GAAA,cAAA,UAAgB,GAAG,IAAI,aAAa;GAAE,UAAU;GAAQ,SAAS;GAAM,CAAC,CAAC,MAAM;SACzE;AACN,SAAO;;;AAIX,SAAS,WAAW,SAAyB;CAC3C,MAAM,MAAM,OAAO;AACnB,SAAM,+BAA+B,IAAI;CACzC,MAAM,UAAA,GAAA,cAAA,UAAkB,aAAa,EAAE,UAAU,QAAQ,CAAC,CAAC,MAAM;AACjE,EAAA,GAAA,cAAA,UAAS,yBAAyB,OAAO,IAAI,IAAI,oBAAoB;EACnE,UAAU;EACV,SAAS;EACV,CAAC;CACF,MAAM,MAAM,GAAG,OAAO;CACtB,MAAM,YAAY,cAAc,IAAI;AACpC,SAAM,0BAA0B,WAAW,IAAI;AAC/C,SAAQ,IAAI,wBAAwB,YAAY;AAChD,QAAO;;AAGT,SAAS,cAAc,SAAkB,SAA0B;AACjE,KAAI,QAAS,QAAO;AACpB,KAAI,QAAS,QAAO,WAAW,QAAQ;AACvC,QAAO;;AAGT,SAAgB,iBAAiB,SAAkB,SAAyC;CAC1F,MAAM,MAAM,cAAc,SAAS,QAAQ;CAC3C,MAAM,WAAW,cAAc,IAAI;AACnC,SAAM,0CAA0C,KAAK,SAAS;AAyC9D,QAvCuC;EACrC,MAAM,OAAO;EACb,MAAM;EACN;EACA,UAAU;EAEV,YAAY,KAAuB;AACjC,UAAO,CAAC,cAAc,IAAI;;EAG5B,UAAU,QAA0B;AAClC,UAAO,CAAC,YAAY,OAAO;;EAG7B,KAAK,SAAuB,GAAG,MAAqC;AAClE,UAAO,gBAAA,KAAK,SAAS,KAAK,KAAK;;EAGjC,MAAM,eACJ,aACA,SACA,aACA,MACA,OACA,eAAuC,EAAE,EACzC,kBAA0C,EAAE,EACX;AACjC,UAAO,gBAAA,2BACL,aACA,SACA,MACA,OACA,aACA,cACA,gBACD;;EAEJ"}
|
|
@@ -3,6 +3,7 @@ const require_process = require("../utils/process.cjs");
|
|
|
3
3
|
const require_project = require("../utils/project.cjs");
|
|
4
4
|
let debug = require("debug");
|
|
5
5
|
debug = require_runtime.__toESM(debug);
|
|
6
|
+
let child_process = require("child_process");
|
|
6
7
|
//#region src/adapters/pnpm.ts
|
|
7
8
|
var debug$1 = (0, debug.default)("verdaccio:e2e-cli:pnpm");
|
|
8
9
|
var PNPM_SUPPORTED_COMMANDS = new Set([
|
|
@@ -19,11 +20,41 @@ var PNPM_SUPPORTED_COMMANDS = new Set([
|
|
|
19
20
|
"stars",
|
|
20
21
|
"unstar"
|
|
21
22
|
]);
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
function detectVersion(bin) {
|
|
24
|
+
try {
|
|
25
|
+
return (0, child_process.execSync)(`${bin} --version`, {
|
|
26
|
+
encoding: "utf8",
|
|
27
|
+
timeout: 5e3
|
|
28
|
+
}).trim();
|
|
29
|
+
} catch {
|
|
30
|
+
return "unknown";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function installPnpm(version) {
|
|
34
|
+
const pkg = `pnpm@${version}`;
|
|
35
|
+
debug$1("installing %s into temp dir", pkg);
|
|
36
|
+
const tmpDir = (0, child_process.execSync)("mktemp -d", { encoding: "utf8" }).trim();
|
|
37
|
+
(0, child_process.execSync)(`npm install --prefix "${tmpDir}" ${pkg} --loglevel=error`, {
|
|
38
|
+
encoding: "utf8",
|
|
39
|
+
timeout: 3e4
|
|
40
|
+
});
|
|
41
|
+
const bin = `${tmpDir}/node_modules/.bin/pnpm`;
|
|
42
|
+
const installed = detectVersion(bin);
|
|
43
|
+
debug$1("installed pnpm %s at %s", installed, bin);
|
|
44
|
+
console.log(` Auto-installed pnpm ${installed}`);
|
|
45
|
+
return bin;
|
|
46
|
+
}
|
|
47
|
+
function resolvePnpmBin(binPath, version) {
|
|
48
|
+
if (binPath) return binPath;
|
|
49
|
+
if (version) return installPnpm(version);
|
|
50
|
+
return "pnpm";
|
|
51
|
+
}
|
|
52
|
+
function createPnpmAdapter(binPath, version) {
|
|
53
|
+
const bin = resolvePnpmBin(binPath, version);
|
|
54
|
+
const resolved = detectVersion(bin);
|
|
55
|
+
debug$1("creating pnpm adapter with bin: %s (%s)", bin, resolved);
|
|
25
56
|
return {
|
|
26
|
-
name: `pnpm`,
|
|
57
|
+
name: `pnpm@${resolved}`,
|
|
27
58
|
type: "pnpm",
|
|
28
59
|
bin,
|
|
29
60
|
supports: PNPM_SUPPORTED_COMMANDS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pnpm.cjs","names":[],"sources":["../../../src/adapters/pnpm.ts"],"sourcesContent":["import { SpawnOptions } from 'child_process';\nimport buildDebug from 'debug';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { prepareGenericEmptyProject } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:pnpm');\n\nconst PNPM_SUPPORTED_COMMANDS = new Set([\n 'publish',\n 'unpublish',\n 'install',\n 'info',\n 'audit',\n 'deprecate',\n 'dist-tag',\n 'ping',\n 'search',\n 'star',\n 'stars',\n 'unstar',\n]);\n\nexport function createPnpmAdapter(binPath?: string): PackageManagerAdapter {\n const bin = binPath
|
|
1
|
+
{"version":3,"file":"pnpm.cjs","names":[],"sources":["../../../src/adapters/pnpm.ts"],"sourcesContent":["import { SpawnOptions, execSync } from 'child_process';\nimport buildDebug from 'debug';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { prepareGenericEmptyProject } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:pnpm');\n\nconst PNPM_SUPPORTED_COMMANDS = new Set([\n 'publish',\n 'unpublish',\n 'install',\n 'info',\n 'audit',\n 'deprecate',\n 'dist-tag',\n 'ping',\n 'search',\n 'star',\n 'stars',\n 'unstar',\n]);\n\nfunction detectVersion(bin: string): string {\n try {\n return execSync(`${bin} --version`, { encoding: 'utf8', timeout: 5000 }).trim();\n } catch {\n return 'unknown';\n }\n}\n\nfunction installPnpm(version: string): string {\n const pkg = `pnpm@${version}`;\n debug('installing %s into temp dir', pkg);\n const tmpDir = execSync('mktemp -d', { encoding: 'utf8' }).trim();\n execSync(`npm install --prefix \"${tmpDir}\" ${pkg} --loglevel=error`, {\n encoding: 'utf8',\n timeout: 30000,\n });\n const bin = `${tmpDir}/node_modules/.bin/pnpm`;\n const installed = detectVersion(bin);\n debug('installed pnpm %s at %s', installed, bin);\n console.log(` Auto-installed pnpm ${installed}`);\n return bin;\n}\n\nfunction resolvePnpmBin(binPath?: string, version?: string): string {\n if (binPath) return binPath;\n if (version) return installPnpm(version);\n return 'pnpm';\n}\n\nexport function createPnpmAdapter(binPath?: string, version?: string): PackageManagerAdapter {\n const bin = resolvePnpmBin(binPath, version);\n const resolved = detectVersion(bin);\n debug('creating pnpm adapter with bin: %s (%s)', bin, resolved);\n\n const adapter: PackageManagerAdapter = {\n name: `pnpm@${resolved}`,\n type: 'pnpm',\n bin,\n supports: PNPM_SUPPORTED_COMMANDS,\n\n registryArg(url: string): string[] {\n return ['--registry', url];\n },\n\n prefixArg(folder: string): string[] {\n return ['--prefix', folder];\n },\n\n exec(options: SpawnOptions, ...args: string[]): Promise<ExecOutput> {\n return exec(options, bin, args);\n },\n\n async prepareProject(\n packageName: string,\n version: string,\n registryUrl: string,\n port: number,\n token: string,\n dependencies: Record<string, string> = {},\n devDependencies: Record<string, string> = {}\n ): Promise<{ tempFolder: string }> {\n return prepareGenericEmptyProject(\n packageName,\n version,\n port,\n token,\n registryUrl,\n dependencies,\n devDependencies\n );\n },\n };\n\n return adapter;\n}\n"],"mappings":";;;;;;;AAOA,IAAM,WAAA,GAAA,MAAA,SAAmB,yBAAyB;AAElD,IAAM,0BAA0B,IAAI,IAAI;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAS,cAAc,KAAqB;AAC1C,KAAI;AACF,UAAA,GAAA,cAAA,UAAgB,GAAG,IAAI,aAAa;GAAE,UAAU;GAAQ,SAAS;GAAM,CAAC,CAAC,MAAM;SACzE;AACN,SAAO;;;AAIX,SAAS,YAAY,SAAyB;CAC5C,MAAM,MAAM,QAAQ;AACpB,SAAM,+BAA+B,IAAI;CACzC,MAAM,UAAA,GAAA,cAAA,UAAkB,aAAa,EAAE,UAAU,QAAQ,CAAC,CAAC,MAAM;AACjE,EAAA,GAAA,cAAA,UAAS,yBAAyB,OAAO,IAAI,IAAI,oBAAoB;EACnE,UAAU;EACV,SAAS;EACV,CAAC;CACF,MAAM,MAAM,GAAG,OAAO;CACtB,MAAM,YAAY,cAAc,IAAI;AACpC,SAAM,2BAA2B,WAAW,IAAI;AAChD,SAAQ,IAAI,yBAAyB,YAAY;AACjD,QAAO;;AAGT,SAAS,eAAe,SAAkB,SAA0B;AAClE,KAAI,QAAS,QAAO;AACpB,KAAI,QAAS,QAAO,YAAY,QAAQ;AACxC,QAAO;;AAGT,SAAgB,kBAAkB,SAAkB,SAAyC;CAC3F,MAAM,MAAM,eAAe,SAAS,QAAQ;CAC5C,MAAM,WAAW,cAAc,IAAI;AACnC,SAAM,2CAA2C,KAAK,SAAS;AAyC/D,QAvCuC;EACrC,MAAM,QAAQ;EACd,MAAM;EACN;EACA,UAAU;EAEV,YAAY,KAAuB;AACjC,UAAO,CAAC,cAAc,IAAI;;EAG5B,UAAU,QAA0B;AAClC,UAAO,CAAC,YAAY,OAAO;;EAG7B,KAAK,SAAuB,GAAG,MAAqC;AAClE,UAAO,gBAAA,KAAK,SAAS,KAAK,KAAK;;EAGjC,MAAM,eACJ,aACA,SACA,aACA,MACA,OACA,eAAuC,EAAE,EACzC,kBAA0C,EAAE,EACX;AACjC,UAAO,gBAAA,2BACL,aACA,SACA,MACA,OACA,aACA,cACA,gBACD;;EAEJ"}
|
|
@@ -17,7 +17,8 @@ function detectYarnVersion(bin) {
|
|
|
17
17
|
return (0, child_process.execSync)(`${bin} --version`, {
|
|
18
18
|
env: {
|
|
19
19
|
...process.env,
|
|
20
|
-
COREPACK_ENABLE_STRICT: "0"
|
|
20
|
+
COREPACK_ENABLE_STRICT: "0",
|
|
21
|
+
YARN_IGNORE_PATH: "1"
|
|
21
22
|
},
|
|
22
23
|
encoding: "utf8",
|
|
23
24
|
timeout: 5e3
|
|
@@ -26,13 +27,45 @@ function detectYarnVersion(bin) {
|
|
|
26
27
|
return "unknown";
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
debug$1("
|
|
32
|
-
const
|
|
33
|
-
|
|
30
|
+
function installYarnClassic(version = "1") {
|
|
31
|
+
const pkg = version.startsWith("1") ? `yarn@${version}` : `yarn@1`;
|
|
32
|
+
debug$1("installing %s into temp dir", pkg);
|
|
33
|
+
const tmpDir = (0, child_process.execSync)("mktemp -d", { encoding: "utf8" }).trim();
|
|
34
|
+
(0, child_process.execSync)(`npm install --prefix "${tmpDir}" ${pkg} --loglevel=error`, {
|
|
35
|
+
encoding: "utf8",
|
|
36
|
+
timeout: 3e4
|
|
37
|
+
});
|
|
38
|
+
const bin = `${tmpDir}/node_modules/.bin/yarn`;
|
|
39
|
+
const installed = detectYarnVersion(bin);
|
|
40
|
+
debug$1("installed yarn %s at %s", installed, bin);
|
|
41
|
+
console.log(` Auto-installed yarn classic ${installed}`);
|
|
42
|
+
return bin;
|
|
43
|
+
}
|
|
44
|
+
function resolveYarnClassicBin(binPath, version) {
|
|
45
|
+
if (binPath) return binPath;
|
|
46
|
+
if (version) return installYarnClassic(version);
|
|
47
|
+
try {
|
|
48
|
+
const systemYarn = (0, child_process.execSync)("which yarn", {
|
|
49
|
+
encoding: "utf8",
|
|
50
|
+
timeout: 5e3
|
|
51
|
+
}).trim();
|
|
52
|
+
const sysVersion = detectYarnVersion(systemYarn);
|
|
53
|
+
if (sysVersion.split(".")[0] === "1") {
|
|
54
|
+
debug$1("using system yarn classic %s", sysVersion);
|
|
55
|
+
return systemYarn;
|
|
56
|
+
}
|
|
57
|
+
debug$1("system yarn is Berry %s, auto-installing classic", sysVersion);
|
|
58
|
+
} catch {
|
|
59
|
+
debug$1("no system yarn found, auto-installing classic");
|
|
60
|
+
}
|
|
61
|
+
return installYarnClassic();
|
|
62
|
+
}
|
|
63
|
+
function createYarnClassicAdapter(binPath, version) {
|
|
64
|
+
const bin = resolveYarnClassicBin(binPath, version);
|
|
65
|
+
const resolved = detectYarnVersion(bin);
|
|
66
|
+
debug$1("creating yarn classic adapter with bin: %s (%s)", bin, resolved);
|
|
34
67
|
return {
|
|
35
|
-
name: `yarn-classic`,
|
|
68
|
+
name: `yarn-classic@${resolved}`,
|
|
36
69
|
type: "yarn-classic",
|
|
37
70
|
bin,
|
|
38
71
|
supports: YARN_CLASSIC_SUPPORTED_COMMANDS,
|
|
@@ -46,7 +79,8 @@ function createYarnClassicAdapter(binPath) {
|
|
|
46
79
|
const env = {
|
|
47
80
|
...process.env,
|
|
48
81
|
...options.env,
|
|
49
|
-
COREPACK_ENABLE_STRICT: "0"
|
|
82
|
+
COREPACK_ENABLE_STRICT: "0",
|
|
83
|
+
YARN_IGNORE_PATH: "1"
|
|
50
84
|
};
|
|
51
85
|
return require_process.exec({
|
|
52
86
|
...options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yarn-classic.cjs","names":[],"sources":["../../../src/adapters/yarn-classic.ts"],"sourcesContent":["import { SpawnOptions, execSync } from 'child_process';\nimport buildDebug from 'debug';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { prepareGenericEmptyProject } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:yarn-classic');\n\nconst YARN_CLASSIC_SUPPORTED_COMMANDS = new Set([\n 'publish',\n 'install',\n 'info',\n 'audit',\n]);\n\nfunction detectYarnVersion(bin: string): string {\n try {\n return execSync(`${bin} --version`, {\n env: { ...process.env, COREPACK_ENABLE_STRICT: '0' },\n encoding: 'utf8',\n timeout: 5000,\n }).trim();\n } catch {\n return 'unknown';\n }\n}\n\
|
|
1
|
+
{"version":3,"file":"yarn-classic.cjs","names":[],"sources":["../../../src/adapters/yarn-classic.ts"],"sourcesContent":["import { SpawnOptions, execSync } from 'child_process';\nimport buildDebug from 'debug';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { prepareGenericEmptyProject } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:yarn-classic');\n\nconst YARN_CLASSIC_SUPPORTED_COMMANDS = new Set([\n 'publish',\n 'install',\n 'info',\n 'audit',\n]);\n\nfunction detectYarnVersion(bin: string): string {\n try {\n return execSync(`${bin} --version`, {\n env: { ...process.env, COREPACK_ENABLE_STRICT: '0', YARN_IGNORE_PATH: '1' },\n encoding: 'utf8',\n timeout: 5000,\n }).trim();\n } catch {\n return 'unknown';\n }\n}\n\nfunction installYarnClassic(version = '1'): string {\n const pkg = version.startsWith('1') ? `yarn@${version}` : `yarn@1`;\n debug('installing %s into temp dir', pkg);\n const tmpDir = execSync('mktemp -d', { encoding: 'utf8' }).trim();\n execSync(`npm install --prefix \"${tmpDir}\" ${pkg} --loglevel=error`, {\n encoding: 'utf8',\n timeout: 30000,\n });\n const bin = `${tmpDir}/node_modules/.bin/yarn`;\n const installed = detectYarnVersion(bin);\n debug('installed yarn %s at %s', installed, bin);\n console.log(` Auto-installed yarn classic ${installed}`);\n return bin;\n}\n\nfunction resolveYarnClassicBin(binPath?: string, version?: string): string {\n if (binPath) return binPath;\n\n // Always install the requested version to ensure reproducibility\n if (version) {\n return installYarnClassic(version);\n }\n\n // Check if system yarn is 1.x\n try {\n const systemYarn = execSync('which yarn', { encoding: 'utf8', timeout: 5000 }).trim();\n const sysVersion = detectYarnVersion(systemYarn);\n const major = sysVersion.split('.')[0];\n if (major === '1') {\n debug('using system yarn classic %s', sysVersion);\n return systemYarn;\n }\n debug('system yarn is Berry %s, auto-installing classic', sysVersion);\n } catch {\n debug('no system yarn found, auto-installing classic');\n }\n\n return installYarnClassic();\n}\n\nexport function createYarnClassicAdapter(binPath?: string, version?: string): PackageManagerAdapter {\n const bin = resolveYarnClassicBin(binPath, version);\n const resolved = detectYarnVersion(bin);\n debug('creating yarn classic adapter with bin: %s (%s)', bin, resolved);\n\n const adapter: PackageManagerAdapter = {\n name: `yarn-classic@${resolved}`,\n type: 'yarn-classic',\n bin,\n supports: YARN_CLASSIC_SUPPORTED_COMMANDS,\n\n registryArg(url: string): string[] {\n return ['--registry', url];\n },\n\n prefixArg(folder: string): string[] {\n return ['--cwd', folder];\n },\n\n exec(options: SpawnOptions, ...args: string[]): Promise<ExecOutput> {\n const env = {\n ...process.env,\n ...options.env,\n COREPACK_ENABLE_STRICT: '0',\n YARN_IGNORE_PATH: '1',\n };\n return exec({ ...options, env }, bin, args);\n },\n\n async prepareProject(\n packageName: string,\n version: string,\n registryUrl: string,\n port: number,\n token: string,\n dependencies: Record<string, string> = {},\n devDependencies: Record<string, string> = {}\n ): Promise<{ tempFolder: string }> {\n return prepareGenericEmptyProject(\n packageName,\n version,\n port,\n token,\n registryUrl,\n dependencies,\n devDependencies\n );\n },\n };\n\n return adapter;\n}\n"],"mappings":";;;;;;;AAOA,IAAM,WAAA,GAAA,MAAA,SAAmB,iCAAiC;AAE1D,IAAM,kCAAkC,IAAI,IAAI;CAC9C;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAS,kBAAkB,KAAqB;AAC9C,KAAI;AACF,UAAA,GAAA,cAAA,UAAgB,GAAG,IAAI,aAAa;GAClC,KAAK;IAAE,GAAG,QAAQ;IAAK,wBAAwB;IAAK,kBAAkB;IAAK;GAC3E,UAAU;GACV,SAAS;GACV,CAAC,CAAC,MAAM;SACH;AACN,SAAO;;;AAIX,SAAS,mBAAmB,UAAU,KAAa;CACjD,MAAM,MAAM,QAAQ,WAAW,IAAI,GAAG,QAAQ,YAAY;AAC1D,SAAM,+BAA+B,IAAI;CACzC,MAAM,UAAA,GAAA,cAAA,UAAkB,aAAa,EAAE,UAAU,QAAQ,CAAC,CAAC,MAAM;AACjE,EAAA,G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ACA,SACA,MACA,OACA,aACA,cACA,gBACD;;EAEJ"}
|
|
@@ -3,6 +3,7 @@ const require_process = require("../utils/process.cjs");
|
|
|
3
3
|
const require_project = require("../utils/project.cjs");
|
|
4
4
|
let debug = require("debug");
|
|
5
5
|
debug = require_runtime.__toESM(debug);
|
|
6
|
+
let child_process = require("child_process");
|
|
6
7
|
let path = require("path");
|
|
7
8
|
let fs_promises = require("fs/promises");
|
|
8
9
|
let js_yaml = require("js-yaml");
|
|
@@ -15,6 +16,57 @@ var YARN_MODERN_SUPPORTED_COMMANDS = new Set([
|
|
|
15
16
|
"install",
|
|
16
17
|
"info"
|
|
17
18
|
]);
|
|
19
|
+
var YARN_ENV = {
|
|
20
|
+
COREPACK_ENABLE_STRICT: "0",
|
|
21
|
+
YARN_IGNORE_PATH: "1"
|
|
22
|
+
};
|
|
23
|
+
function detectVersion(bin) {
|
|
24
|
+
try {
|
|
25
|
+
return (0, child_process.execSync)(`${bin} --version`, {
|
|
26
|
+
env: {
|
|
27
|
+
...process.env,
|
|
28
|
+
...YARN_ENV
|
|
29
|
+
},
|
|
30
|
+
encoding: "utf8",
|
|
31
|
+
timeout: 5e3
|
|
32
|
+
}).trim();
|
|
33
|
+
} catch {
|
|
34
|
+
return "unknown";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function installYarnModern(version = "4") {
|
|
38
|
+
const pkg = `@yarnpkg/cli-dist@${version}`;
|
|
39
|
+
debug$1("installing %s into temp dir", pkg);
|
|
40
|
+
const tmpDir = (0, child_process.execSync)("mktemp -d", { encoding: "utf8" }).trim();
|
|
41
|
+
(0, child_process.execSync)(`npm install --prefix "${tmpDir}" ${pkg} --loglevel=error`, {
|
|
42
|
+
encoding: "utf8",
|
|
43
|
+
timeout: 3e4
|
|
44
|
+
});
|
|
45
|
+
const bin = `${tmpDir}/node_modules/@yarnpkg/cli-dist/bin/yarn.js`;
|
|
46
|
+
const installed = detectVersion(bin);
|
|
47
|
+
debug$1("installed yarn modern %s at %s", installed, bin);
|
|
48
|
+
console.log(` Auto-installed yarn modern ${installed}`);
|
|
49
|
+
return bin;
|
|
50
|
+
}
|
|
51
|
+
function resolveYarnBin(binPath, version) {
|
|
52
|
+
if (binPath) return binPath;
|
|
53
|
+
if (version) return installYarnModern(version);
|
|
54
|
+
try {
|
|
55
|
+
const systemYarn = (0, child_process.execSync)("which yarn", {
|
|
56
|
+
encoding: "utf8",
|
|
57
|
+
timeout: 5e3
|
|
58
|
+
}).trim();
|
|
59
|
+
const sysVersion = detectVersion(systemYarn);
|
|
60
|
+
if (parseInt(sysVersion.split(".")[0], 10) >= 2) {
|
|
61
|
+
debug$1("using system yarn Berry %s", sysVersion);
|
|
62
|
+
return systemYarn;
|
|
63
|
+
}
|
|
64
|
+
debug$1("system yarn is Classic %s, auto-installing Berry", sysVersion);
|
|
65
|
+
} catch {
|
|
66
|
+
debug$1("no system yarn found, auto-installing Berry");
|
|
67
|
+
}
|
|
68
|
+
return installYarnModern();
|
|
69
|
+
}
|
|
18
70
|
function createYamlConfig(registry, token) {
|
|
19
71
|
const defaultYaml = {
|
|
20
72
|
npmRegistryServer: registry,
|
|
@@ -30,12 +82,14 @@ function createYamlConfig(registry, token) {
|
|
|
30
82
|
}
|
|
31
83
|
return js_yaml.default.dump(defaultYaml);
|
|
32
84
|
}
|
|
33
|
-
function createYarnModernAdapter(binPath) {
|
|
34
|
-
|
|
85
|
+
function createYarnModernAdapter(binPath, version) {
|
|
86
|
+
const bin = resolveYarnBin(binPath, version);
|
|
87
|
+
const resolved = detectVersion(bin);
|
|
88
|
+
debug$1("creating yarn modern adapter with bin: %s (%s)", bin, resolved);
|
|
35
89
|
return {
|
|
36
|
-
name: `yarn-modern`,
|
|
90
|
+
name: `yarn-modern@${resolved}`,
|
|
37
91
|
type: "yarn-modern",
|
|
38
|
-
bin
|
|
92
|
+
bin,
|
|
39
93
|
supports: YARN_MODERN_SUPPORTED_COMMANDS,
|
|
40
94
|
registryArg(_url) {
|
|
41
95
|
return [];
|
|
@@ -47,7 +101,7 @@ function createYarnModernAdapter(binPath) {
|
|
|
47
101
|
const env = {
|
|
48
102
|
...process.env,
|
|
49
103
|
...options.env,
|
|
50
|
-
|
|
104
|
+
...YARN_ENV
|
|
51
105
|
};
|
|
52
106
|
const cmd = args[0];
|
|
53
107
|
let yarnArgs;
|
|
@@ -65,7 +119,7 @@ function createYarnModernAdapter(binPath) {
|
|
|
65
119
|
return require_process.exec({
|
|
66
120
|
...options,
|
|
67
121
|
env
|
|
68
|
-
},
|
|
122
|
+
}, bin, yarnArgs);
|
|
69
123
|
},
|
|
70
124
|
async prepareProject(packageName, version, registryUrl, _port, token, dependencies = {}, devDependencies = {}) {
|
|
71
125
|
const tempFolder = await require_project.createTempFolder(packageName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yarn-modern.cjs","names":[],"sources":["../../../src/adapters/yarn-modern.ts"],"sourcesContent":["import { SpawnOptions } from 'child_process';\nimport buildDebug from 'debug';\nimport { writeFile } from 'fs/promises';\nimport YAML from 'js-yaml';\nimport { join } from 'path';\nimport { URL } from 'url';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { createTempFolder, getPackageJSON, getREADME } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:yarn-modern');\n\nconst YARN_MODERN_SUPPORTED_COMMANDS = new Set(['publish', 'install', 'info']);\n\nfunction createYamlConfig(registry: string, token?: string) {\n const defaultYaml: any = {\n npmRegistryServer: registry,\n enableImmutableInstalls: false,\n unsafeHttpWhitelist: ['localhost'],\n };\n\n if (typeof token === 'string') {\n const url = new URL(registry);\n defaultYaml.npmRegistries = {\n [`//${url.hostname}:${url.port}`]: {\n npmAlwaysAuth: true,\n npmAuthToken: token,\n },\n };\n }\n\n return YAML.dump(defaultYaml);\n}\n\nexport function createYarnModernAdapter(binPath
|
|
1
|
+
{"version":3,"file":"yarn-modern.cjs","names":[],"sources":["../../../src/adapters/yarn-modern.ts"],"sourcesContent":["import { SpawnOptions, execSync } from 'child_process';\nimport buildDebug from 'debug';\nimport { writeFile } from 'fs/promises';\nimport YAML from 'js-yaml';\nimport { join } from 'path';\nimport { URL } from 'url';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { createTempFolder, getPackageJSON, getREADME } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:yarn-modern');\n\nconst YARN_MODERN_SUPPORTED_COMMANDS = new Set(['publish', 'install', 'info']);\n\nconst YARN_ENV = {\n COREPACK_ENABLE_STRICT: '0',\n YARN_IGNORE_PATH: '1',\n};\n\nfunction detectVersion(bin: string): string {\n try {\n return execSync(`${bin} --version`, {\n env: { ...process.env, ...YARN_ENV },\n encoding: 'utf8',\n timeout: 5000,\n }).trim();\n } catch {\n return 'unknown';\n }\n}\n\nfunction installYarnModern(version = '4'): string {\n const pkg = `@yarnpkg/cli-dist@${version}`;\n debug('installing %s into temp dir', pkg);\n const tmpDir = execSync('mktemp -d', { encoding: 'utf8' }).trim();\n execSync(`npm install --prefix \"${tmpDir}\" ${pkg} --loglevel=error`, {\n encoding: 'utf8',\n timeout: 30000,\n });\n const bin = `${tmpDir}/node_modules/@yarnpkg/cli-dist/bin/yarn.js`;\n const installed = detectVersion(bin);\n debug('installed yarn modern %s at %s', installed, bin);\n console.log(` Auto-installed yarn modern ${installed}`);\n return bin;\n}\n\nfunction resolveYarnBin(binPath?: string, version?: string): string {\n if (binPath) return binPath;\n\n if (version) {\n return installYarnModern(version);\n }\n\n try {\n const systemYarn = execSync('which yarn', { encoding: 'utf8', timeout: 5000 }).trim();\n const sysVersion = detectVersion(systemYarn);\n const major = parseInt(sysVersion.split('.')[0], 10);\n if (major >= 2) {\n debug('using system yarn Berry %s', sysVersion);\n return systemYarn;\n }\n debug('system yarn is Classic %s, auto-installing Berry', sysVersion);\n } catch {\n debug('no system yarn found, auto-installing Berry');\n }\n\n return installYarnModern();\n}\n\nfunction createYamlConfig(registry: string, token?: string) {\n const defaultYaml: any = {\n npmRegistryServer: registry,\n enableImmutableInstalls: false,\n unsafeHttpWhitelist: ['localhost'],\n };\n\n if (typeof token === 'string') {\n const url = new URL(registry);\n defaultYaml.npmRegistries = {\n [`//${url.hostname}:${url.port}`]: {\n npmAlwaysAuth: true,\n npmAuthToken: token,\n },\n };\n }\n\n return YAML.dump(defaultYaml);\n}\n\nexport function createYarnModernAdapter(binPath?: string, version?: string): PackageManagerAdapter {\n const bin = resolveYarnBin(binPath, version);\n const resolved = detectVersion(bin);\n debug('creating yarn modern adapter with bin: %s (%s)', bin, resolved);\n\n const adapter: PackageManagerAdapter = {\n name: `yarn-modern@${resolved}`,\n type: 'yarn-modern',\n bin,\n supports: YARN_MODERN_SUPPORTED_COMMANDS,\n\n registryArg(_url: string): string[] {\n return [];\n },\n\n prefixArg(_folder: string): string[] {\n return [];\n },\n\n exec(options: SpawnOptions, ...args: string[]): Promise<ExecOutput> {\n const env = { ...process.env, ...options.env, ...YARN_ENV };\n\n const cmd = args[0];\n let yarnArgs: string[];\n if (cmd === 'publish') {\n const filtered = args.slice(1).filter(\n (a) => a !== '--json' && !a.startsWith('--registry')\n );\n yarnArgs = ['npm', 'publish', ...filtered];\n } else if (cmd === 'info') {\n const filtered = args.slice(1).filter((a) => !a.startsWith('--registry'));\n yarnArgs = ['npm', 'info', ...filtered];\n } else {\n yarnArgs = args.filter((a) => !a.startsWith('--registry'));\n }\n\n return exec({ ...options, env }, bin, yarnArgs);\n },\n\n async prepareProject(\n packageName: string,\n version: string,\n registryUrl: string,\n _port: number,\n token: string,\n dependencies: Record<string, string> = {},\n devDependencies: Record<string, string> = {}\n ): Promise<{ tempFolder: string }> {\n const tempFolder = await createTempFolder(packageName);\n const yamlContent = createYamlConfig(registryUrl, token);\n await writeFile(join(tempFolder, '.yarnrc.yml'), yamlContent);\n await writeFile(\n join(tempFolder, 'package.json'),\n getPackageJSON(packageName, version, dependencies, devDependencies)\n );\n await writeFile(join(tempFolder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BAA0C,EAAE,EACX;GACjC,MAAM,aAAa,MAAM,gBAAA,iBAAiB,YAAY;GACtD,MAAM,cAAc,iBAAiB,aAAa,MAAM;AACxD,UAAA,GAAA,YAAA,YAAA,GAAA,KAAA,MAAqB,YAAY,cAAc,EAAE,YAAY;AAC7D,UAAA,GAAA,YAAA,YAAA,GAAA,KAAA,MACO,YAAY,eAAe,EAChC,gBAAA,eAAe,aAAa,SAAS,cAAc,gBAAgB,CACpE;AACD,UAAA,GAAA,YAAA,YAAA,GAAA,KAAA,MAAqB,YAAY,YAAY,EAAE,gBAAA,UAAU,YAAY,CAAC;AACtE,UAAO,EAAE,YAAY;;EAExB"}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -12,19 +12,29 @@ let debug = require("debug");
|
|
|
12
12
|
debug = require_runtime.__toESM(debug);
|
|
13
13
|
//#region src/index.ts
|
|
14
14
|
(0, debug.default)("verdaccio:e2e-cli");
|
|
15
|
+
function parsePmSpec(filter) {
|
|
16
|
+
const eqIdx = filter.indexOf("=");
|
|
17
|
+
if (eqIdx !== -1) return {
|
|
18
|
+
name: filter.slice(0, eqIdx).toLowerCase(),
|
|
19
|
+
binPath: filter.slice(eqIdx + 1)
|
|
20
|
+
};
|
|
21
|
+
const atIdx = filter.indexOf("@");
|
|
22
|
+
if (atIdx !== -1) return {
|
|
23
|
+
name: filter.slice(0, atIdx).toLowerCase(),
|
|
24
|
+
version: filter.slice(atIdx + 1)
|
|
25
|
+
};
|
|
26
|
+
return { name: filter.toLowerCase() };
|
|
27
|
+
}
|
|
15
28
|
function parseAdapters(pmFilters) {
|
|
16
29
|
if (!pmFilters || pmFilters.length === 0) return [require_npm.createNpmAdapter()];
|
|
17
30
|
const adapters = [];
|
|
18
31
|
for (const filter of pmFilters) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
else if (
|
|
23
|
-
else if (
|
|
24
|
-
else
|
|
25
|
-
if (!binPath) throw new Error(`yarn-modern requires a bin path: --pm yarn-modern=/path/to/yarn.js`);
|
|
26
|
-
adapters.push(require_yarn_modern.createYarnModernAdapter(binPath));
|
|
27
|
-
} else throw new Error(`Unknown package manager: "${name}". Supported: npm, pnpm, yarn-classic, yarn-modern`);
|
|
32
|
+
const { name, version, binPath } = parsePmSpec(filter);
|
|
33
|
+
if (name === "npm") adapters.push(require_npm.createNpmAdapter(binPath, version));
|
|
34
|
+
else if (name === "pnpm") adapters.push(require_pnpm.createPnpmAdapter(binPath, version));
|
|
35
|
+
else if (name === "yarn-classic" || name === "yarn1") adapters.push(require_yarn_classic.createYarnClassicAdapter(binPath, version));
|
|
36
|
+
else if (name === "yarn-modern" || name === "yarn") adapters.push(require_yarn_modern.createYarnModernAdapter(binPath, version));
|
|
37
|
+
else throw new Error(`Unknown package manager: "${name}". Supported: npm, pnpm, yarn-classic, yarn-modern[@version]`);
|
|
28
38
|
}
|
|
29
39
|
return adapters;
|
|
30
40
|
}
|
|
@@ -73,11 +83,14 @@ function printHelp() {
|
|
|
73
83
|
-r, --registry <url> Verdaccio registry URL (e.g. http://localhost:4873)
|
|
74
84
|
|
|
75
85
|
Options:
|
|
76
|
-
--pm <name[
|
|
77
|
-
Supported: npm, pnpm, yarn-classic, yarn-modern
|
|
78
|
-
Examples: --pm npm --pm pnpm
|
|
79
|
-
--pm
|
|
80
|
-
--pm yarn-modern
|
|
86
|
+
--pm <name[@version]> Package manager to test (can be repeated)
|
|
87
|
+
Supported: npm, pnpm, yarn-classic, yarn-modern (or yarn)
|
|
88
|
+
Examples: --pm npm@10 --pm pnpm@9
|
|
89
|
+
--pm yarn-modern@4
|
|
90
|
+
--pm yarn-modern@3
|
|
91
|
+
--pm yarn-classic
|
|
92
|
+
--pm npm --pm pnpm (uses system version)
|
|
93
|
+
Auto-installs the requested yarn version if needed
|
|
81
94
|
Default: npm
|
|
82
95
|
|
|
83
96
|
-t, --test <name> Filter tests by name (can be repeated)
|
|
@@ -98,6 +111,9 @@ async function main(argv = process.argv) {
|
|
|
98
111
|
printHelp();
|
|
99
112
|
process.exit(1);
|
|
100
113
|
}
|
|
114
|
+
const { createTempFolder } = await Promise.resolve().then(() => require("./utils/project.cjs"));
|
|
115
|
+
const runDir = await createTempFolder("e2e-run");
|
|
116
|
+
process.chdir(runDir);
|
|
101
117
|
if (options.verbose) {
|
|
102
118
|
const { setVerbose } = await Promise.resolve().then(() => require("./utils/process.cjs"));
|
|
103
119
|
setVerbose(true);
|
package/build/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import buildDebug from 'debug';\n\nimport {\n createNpmAdapter,\n createPnpmAdapter,\n createYarnClassicAdapter,\n createYarnModernAdapter,\n} from './adapters';\nimport { allTests } from './tests';\nimport { CliOptions, PackageManagerAdapter } from './types';\nimport { createUser, pingRegistry } from './utils/registry-client';\nimport { runAll } from './runner';\n\nconst debug = buildDebug('verdaccio:e2e-cli');\n\nfunction parseAdapters(pmFilters?: string[]): PackageManagerAdapter[] {\n if (!pmFilters || pmFilters.length === 0) {\n // Default: just npm\n return [createNpmAdapter()];\n }\n\n const adapters: PackageManagerAdapter[] = [];\n\n for (const filter of pmFilters) {\n const [name, binPath] = filter.split('=');\n const lowerName = name.toLowerCase();\n\n if (lowerName === 'npm') {\n adapters.push(createNpmAdapter(binPath));\n } else if (lowerName === 'pnpm') {\n adapters.push(createPnpmAdapter(binPath));\n } else if (lowerName === 'yarn-classic' || lowerName === 'yarn1') {\n adapters.push(createYarnClassicAdapter(binPath));\n } else if (lowerName.startsWith('yarn-modern') || lowerName === 'yarn') {\n if (!binPath) {\n throw new Error(\n `yarn-modern requires a bin path: --pm yarn-modern=/path/to/yarn.js`\n );\n }\n adapters.push(createYarnModernAdapter(binPath));\n } else {\n throw new Error(`Unknown package manager: \"${name}\". Supported: npm, pnpm, yarn-classic, yarn-modern`);\n }\n }\n\n return adapters;\n}\n\nfunction parseArgs(argv: string[]): CliOptions {\n const options: CliOptions = {\n registry: '',\n pm: [],\n test: [],\n concurrency: 1,\n timeout: 50000,\n verbose: false,\n };\n\n for (let i = 2; i < argv.length; i++) {\n const arg = argv[i];\n\n if (arg === '--registry' || arg === '-r') {\n options.registry = argv[++i];\n } else if (arg === '--pm') {\n options.pm!.push(argv[++i]);\n } else if (arg === '--test' || arg === '-t') {\n options.test!.push(argv[++i]);\n } else if (arg === '--concurrency' || arg === '-c') {\n options.concurrency = parseInt(argv[++i], 10);\n } else if (arg === '--timeout') {\n options.timeout = parseInt(argv[++i], 10);\n } else if (arg === '--token') {\n options.token = argv[++i];\n } else if (arg === '--verbose' || arg === '-v') {\n options.verbose = true;\n } else if (arg === '--help' || arg === '-h') {\n printHelp();\n process.exit(0);\n } else if (arg.startsWith('--registry=')) {\n options.registry = arg.split('=')[1];\n } else if (arg.startsWith('--pm=')) {\n options.pm!.push(arg.split('=')[1]);\n } else if (arg.startsWith('--test=')) {\n options.test!.push(arg.split('=')[1]);\n } else if (arg.startsWith('--token=')) {\n options.token = arg.split('=')[1];\n } else if (arg.startsWith('--timeout=')) {\n options.timeout = parseInt(arg.split('=')[1], 10);\n } else {\n console.error(`Unknown argument: ${arg}`);\n printHelp();\n process.exit(1);\n }\n }\n\n return options;\n}\n\nfunction printHelp(): void {\n console.log(`\n @verdaccio/e2e-cli - Run Verdaccio e2e tests against any running registry\n\n Usage:\n verdaccio-e2e --registry <url> [options]\n\n Required:\n -r, --registry <url> Verdaccio registry URL (e.g. http://localhost:4873)\n\n Options:\n --pm <name[=path]> Package manager to test (can be repeated)\n Supported: npm, pnpm, yarn-classic, yarn-modern\n Examples: --pm npm --pm pnpm\n --pm npm=/path/to/npm\n --pm yarn-modern=/path/to/yarn.js\n Default: npm\n\n -t, --test <name> Filter tests by name (can be repeated)\n Available: publish, install, audit, info, deprecate,\n dist-tags, ping, search, star, unpublish\n Default: all supported by the PM\n\n --token <token> Auth token (skips user creation)\n --timeout <ms> Per-test timeout (default: 50000)\n -v, --verbose Enable debug output\n -h, --help Show this help\n `);\n}\n\nexport async function main(argv: string[] = process.argv): Promise<void> {\n const options = parseArgs(argv);\n\n if (!options.registry) {\n console.error('Error: --registry is required\\n');\n printHelp();\n process.exit(1);\n }\n\n if (options.verbose) {\n const { setVerbose } = await import('./utils/process');\n setVerbose(true);\n }\n\n // Ensure registry is reachable\n console.log(`Checking registry at ${options.registry}...`);\n const alive = await pingRegistry(options.registry);\n if (!alive) {\n console.error(`Error: Registry at ${options.registry} is not reachable`);\n process.exit(1);\n }\n console.log(`Registry is alive.`);\n\n // Get auth token\n let token = options.token;\n if (!token) {\n console.log('Creating test user...');\n const auth = await createUser(options.registry);\n token = auth.token;\n console.log(`User \"${auth.user}\" created.`);\n }\n\n // Build adapter list\n const adapters = parseAdapters(options.pm);\n console.log(`Adapters: ${adapters.map((a) => a.name).join(', ')}`);\n\n // Filter tests\n const tests = options.test && options.test.length > 0\n ? allTests.filter((t) => options.test!.includes(t.name))\n : allTests;\n\n console.log(`Tests: ${tests.map((t) => t.name).join(', ')}`);\n\n // Run\n const { exitCode } = await runAll(adapters, tests, options.registry, token, {\n timeout: options.timeout,\n concurrency: options.concurrency,\n testFilter: options.test,\n });\n\n process.exit(exitCode);\n}\n\n// Re-export for programmatic usage\nexport { allTests } from './tests';\nexport { createNpmAdapter, createPnpmAdapter, createYarnClassicAdapter, createYarnModernAdapter } from './adapters';\nexport { runAll, runSuite } from './runner';\nexport type { PackageManagerAdapter, TestDefinition, TestContext, CliOptions } from './types';\n"],"mappings":";;;;;;;;;;;;;mBAayB,oBAAoB;AAE7C,SAAS,cAAc,WAA+C;AACpE,KAAI,CAAC,aAAa,UAAU,WAAW,EAErC,QAAO,CAAC,YAAA,kBAAkB,CAAC;CAG7B,MAAM,WAAoC,EAAE;AAE5C,MAAK,MAAM,UAAU,WAAW;EAC9B,MAAM,CAAC,MAAM,WAAW,OAAO,MAAM,IAAI;EACzC,MAAM,YAAY,KAAK,aAAa;AAEpC,MAAI,cAAc,MAChB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QAAQ,QAAQ,KAAK,SAAS,IAChD,gBAAA,SAAS,QAAQ,MAAM,QAAQ,KAAM,SAAS,EAAE,KAAK,CAAC,GACtD,gBAAA;AAEJ,SAAQ,IAAI,UAAU,MAAM,KAAK,MAAM,EAAE,KAAK,CAAC,KAAK,KAAK,GAAG;CAG5D,MAAM,EAAE,aAAa,MAAM,eAAA,OAAO,UAAU,OAAO,QAAQ,UAAU,OAAO;EAC1E,SAAS,QAAQ;EACjB,aAAa,QAAQ;EACrB,YAAY,QAAQ;EACrB,CAAC;AAEF,SAAQ,KAAK,SAAS"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import buildDebug from 'debug';\n\nimport {\n createNpmAdapter,\n createPnpmAdapter,\n createYarnClassicAdapter,\n createYarnModernAdapter,\n} from './adapters';\nimport { allTests } from './tests';\nimport { CliOptions, PackageManagerAdapter } from './types';\nimport { createUser, pingRegistry } from './utils/registry-client';\nimport { runAll } from './runner';\n\nconst debug = buildDebug('verdaccio:e2e-cli');\n\nfunction parsePmSpec(filter: string): { name: string; version?: string; binPath?: string } {\n // --pm yarn-modern@3, --pm yarn-classic@1.22.22, --pm npm=/path/to/bin\n const eqIdx = filter.indexOf('=');\n if (eqIdx !== -1) {\n return { name: filter.slice(0, eqIdx).toLowerCase(), binPath: filter.slice(eqIdx + 1) };\n }\n const atIdx = filter.indexOf('@');\n if (atIdx !== -1) {\n return { name: filter.slice(0, atIdx).toLowerCase(), version: filter.slice(atIdx + 1) };\n }\n return { name: filter.toLowerCase() };\n}\n\nfunction parseAdapters(pmFilters?: string[]): PackageManagerAdapter[] {\n if (!pmFilters || pmFilters.length === 0) {\n return [createNpmAdapter()];\n }\n\n const adapters: PackageManagerAdapter[] = [];\n\n for (const filter of pmFilters) {\n const { name, version, binPath } = parsePmSpec(filter);\n\n if (name === 'npm') {\n adapters.push(createNpmAdapter(binPath, version));\n } else if (name === 'pnpm') {\n adapters.push(createPnpmAdapter(binPath, version));\n } else if (name === 'yarn-classic' || name === 'yarn1') {\n adapters.push(createYarnClassicAdapter(binPath, version));\n } else if (name === 'yarn-modern' || name === 'yarn') {\n adapters.push(createYarnModernAdapter(binPath, version));\n } else {\n throw new Error(\n `Unknown package manager: \"${name}\". Supported: npm, pnpm, yarn-classic, yarn-modern[@version]`\n );\n }\n }\n\n return adapters;\n}\n\nfunction parseArgs(argv: string[]): CliOptions {\n const options: CliOptions = {\n registry: '',\n pm: [],\n test: [],\n concurrency: 1,\n timeout: 50000,\n verbose: false,\n };\n\n for (let i = 2; i < argv.length; i++) {\n const arg = argv[i];\n\n if (arg === '--registry' || arg === '-r') {\n options.registry = argv[++i];\n } else if (arg === '--pm') {\n options.pm!.push(argv[++i]);\n } else if (arg === '--test' || arg === '-t') {\n options.test!.push(argv[++i]);\n } else if (arg === '--concurrency' || arg === '-c') {\n options.concurrency = parseInt(argv[++i], 10);\n } else if (arg === '--timeout') {\n options.timeout = parseInt(argv[++i], 10);\n } else if (arg === '--token') {\n options.token = argv[++i];\n } else if (arg === '--verbose' || arg === '-v') {\n options.verbose = true;\n } else if (arg === '--help' || arg === '-h') {\n printHelp();\n process.exit(0);\n } else if (arg.startsWith('--registry=')) {\n options.registry = arg.split('=')[1];\n } else if (arg.startsWith('--pm=')) {\n options.pm!.push(arg.split('=')[1]);\n } else if (arg.startsWith('--test=')) {\n options.test!.push(arg.split('=')[1]);\n } else if (arg.startsWith('--token=')) {\n options.token = arg.split('=')[1];\n } else if (arg.startsWith('--timeout=')) {\n options.timeout = parseInt(arg.split('=')[1], 10);\n } else {\n console.error(`Unknown argument: ${arg}`);\n printHelp();\n process.exit(1);\n }\n }\n\n return options;\n}\n\nfunction printHelp(): void {\n console.log(`\n @verdaccio/e2e-cli - Run Verdaccio e2e tests against any running registry\n\n Usage:\n verdaccio-e2e --registry <url> [options]\n\n Required:\n -r, --registry <url> Verdaccio registry URL (e.g. http://localhost:4873)\n\n Options:\n --pm <name[@version]> Package manager to test (can be repeated)\n Supported: npm, pnpm, yarn-classic, yarn-modern (or yarn)\n Examples: --pm npm@10 --pm pnpm@9\n --pm yarn-modern@4\n --pm yarn-modern@3\n --pm yarn-classic\n --pm npm --pm pnpm (uses system version)\n Auto-installs the requested yarn version if needed\n Default: npm\n\n -t, --test <name> Filter tests by name (can be repeated)\n Available: publish, install, audit, info, deprecate,\n dist-tags, ping, search, star, unpublish\n Default: all supported by the PM\n\n --token <token> Auth token (skips user creation)\n --timeout <ms> Per-test timeout (default: 50000)\n -v, --verbose Enable debug output\n -h, --help Show this help\n `);\n}\n\nexport async function main(argv: string[] = process.argv): Promise<void> {\n const options = parseArgs(argv);\n\n if (!options.registry) {\n console.error('Error: --registry is required\\n');\n printHelp();\n process.exit(1);\n }\n\n // Run from a temp dir to isolate from the host project's packageManager, .yarnrc.yml, etc.\n const { createTempFolder } = await import('./utils/project');\n const runDir = await createTempFolder('e2e-run');\n process.chdir(runDir);\n\n if (options.verbose) {\n const { setVerbose } = await import('./utils/process');\n setVerbose(true);\n }\n\n // Ensure registry is reachable\n console.log(`Checking registry at ${options.registry}...`);\n const alive = await pingRegistry(options.registry);\n if (!alive) {\n console.error(`Error: Registry at ${options.registry} is not reachable`);\n process.exit(1);\n }\n console.log(`Registry is alive.`);\n\n // Get auth token\n let token = options.token;\n if (!token) {\n console.log('Creating test user...');\n const auth = await createUser(options.registry);\n token = auth.token;\n console.log(`User \"${auth.user}\" created.`);\n }\n\n // Build adapter list\n const adapters = parseAdapters(options.pm);\n console.log(`Adapters: ${adapters.map((a) => a.name).join(', ')}`);\n\n // Filter tests\n const tests = options.test && options.test.length > 0\n ? allTests.filter((t) => options.test!.includes(t.name))\n : allTests;\n\n console.log(`Tests: ${tests.map((t) => t.name).join(', ')}`);\n\n // Run\n const { exitCode } = await runAll(adapters, tests, options.registry, token, {\n timeout: options.timeout,\n concurrency: options.concurrency,\n testFilter: options.test,\n });\n\n process.exit(exitCode);\n}\n\n// Re-export for programmatic usage\nexport { allTests } from './tests';\nexport { createNpmAdapter, createPnpmAdapter, createYarnClassicAdapter, createYarnModernAdapter } from './adapters';\nexport { runAll, runSuite } from './runner';\nexport type { PackageManagerAdapter, TestDefinition, TestContext, CliOptions } from './types';\n"],"mappings":";;;;;;;;;;;;;mBAayB,oBAAoB;AAE7C,SAAS,YAAY,QAAsE;CAEzF,MAAM,QAAQ,OAAO,QAAQ,IAAI;AACjC,KAAI,UAAU,GACZ,QAAO;EAAE,MAAM,OAAO,MAAM,GAAG,MAAM,CAAC,aAAa;EAAE,SAAS,OAAO,MAAM,QAAQ,EAAE;EAAE;CAEzF,MAAM,QAAQ,OAAO,QAAQ,IAAI;AACjC,KAAI,UAAU,GACZ,QAAO;EAAE,MAAM,OAAO,MAAM,GAAG,MAAM,CAAC,aAAa;EAAE,SAAS,OAAO,MAAM,QAAQ,EAAE;EAAE;AAEzF,QAAO,EAAE,MAAM,OAAO,aAAa,EAAE;;AAGvC,SAAS,cAAc,WAA+C;AACpE,KAAI,CAAC,aAAa,UAAU,WAAW,EACrC,QAAO,CAAC,YAAA,kBAAkB,CAAC;CAG7B,MAAM,WAAoC,EAAE;AAE5C,MAAK,MAAM,UAAU,WAAW;EAC9B,MAAM,EAAE,MAAM,SAAS,YAAY,YAAY,OAAO;AAEtD,MAAI,SAAS,MACX,UAAS,KAAK,YAAA,iBAAiB,SAAS,QAAQ,CAAC;WACxC,SAAS,OAClB,UAAS,KAAK,aAAA,kBAAkB,SAAS,QAAQ,CAAC;WACzC,SAAS,kBAAkB,SAAS,QAC7C,UAAS,KAAK,qBAAA,yBAAyB,SAAS,QAAQ,CAAC;WAChD,SAAS,iBAAiB,SAAS,OAC5C,UAAS,KAAK,oBAAA,wBAAwB,SAAS,QAAQ,CAAC;MAExD,OAAM,IAAI,MACR,6BAA6B,KAAK,8DACnC;;AAIL,QAAO;;AAGT,SAAS,UAAU,MAA4B;CAC7C,MAAM,UAAsB;EAC1B,UAAU;EACV,IAAI,EAAE;EACN,MAAM,EAAE;EACR,aAAa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AC;AAEF,SAAQ,KAAK,SAAS"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { exec } from "../utils/process.js";
|
|
2
2
|
import { prepareGenericEmptyProject } from "../utils/project.js";
|
|
3
3
|
import buildDebug from "debug";
|
|
4
|
+
import { execSync } from "child_process";
|
|
4
5
|
//#region src/adapters/npm.ts
|
|
5
6
|
var debug = buildDebug("verdaccio:e2e-cli:npm");
|
|
6
7
|
var NPM_SUPPORTED_COMMANDS = new Set([
|
|
@@ -17,11 +18,41 @@ var NPM_SUPPORTED_COMMANDS = new Set([
|
|
|
17
18
|
"stars",
|
|
18
19
|
"unstar"
|
|
19
20
|
]);
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
function detectVersion(bin) {
|
|
22
|
+
try {
|
|
23
|
+
return execSync(`${bin} --version`, {
|
|
24
|
+
encoding: "utf8",
|
|
25
|
+
timeout: 5e3
|
|
26
|
+
}).trim();
|
|
27
|
+
} catch {
|
|
28
|
+
return "unknown";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function installNpm(version) {
|
|
32
|
+
const pkg = `npm@${version}`;
|
|
33
|
+
debug("installing %s into temp dir", pkg);
|
|
34
|
+
const tmpDir = execSync("mktemp -d", { encoding: "utf8" }).trim();
|
|
35
|
+
execSync(`npm install --prefix "${tmpDir}" ${pkg} --loglevel=error`, {
|
|
36
|
+
encoding: "utf8",
|
|
37
|
+
timeout: 3e4
|
|
38
|
+
});
|
|
39
|
+
const bin = `${tmpDir}/node_modules/.bin/npm`;
|
|
40
|
+
const installed = detectVersion(bin);
|
|
41
|
+
debug("installed npm %s at %s", installed, bin);
|
|
42
|
+
console.log(` Auto-installed npm ${installed}`);
|
|
43
|
+
return bin;
|
|
44
|
+
}
|
|
45
|
+
function resolveNpmBin(binPath, version) {
|
|
46
|
+
if (binPath) return binPath;
|
|
47
|
+
if (version) return installNpm(version);
|
|
48
|
+
return "npm";
|
|
49
|
+
}
|
|
50
|
+
function createNpmAdapter(binPath, version) {
|
|
51
|
+
const bin = resolveNpmBin(binPath, version);
|
|
52
|
+
const resolved = detectVersion(bin);
|
|
53
|
+
debug("creating npm adapter with bin: %s (%s)", bin, resolved);
|
|
23
54
|
return {
|
|
24
|
-
name: `npm`,
|
|
55
|
+
name: `npm@${resolved}`,
|
|
25
56
|
type: "npm",
|
|
26
57
|
bin,
|
|
27
58
|
supports: NPM_SUPPORTED_COMMANDS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npm.js","names":[],"sources":["../../../src/adapters/npm.ts"],"sourcesContent":["import { SpawnOptions } from 'child_process';\nimport buildDebug from 'debug';\
|
|
1
|
+
{"version":3,"file":"npm.js","names":[],"sources":["../../../src/adapters/npm.ts"],"sourcesContent":["import { SpawnOptions, execSync } from 'child_process';\nimport buildDebug from 'debug';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { prepareGenericEmptyProject } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:npm');\n\nconst NPM_SUPPORTED_COMMANDS = new Set([\n 'publish',\n 'unpublish',\n 'install',\n 'info',\n 'audit',\n 'deprecate',\n 'dist-tag',\n 'ping',\n 'search',\n 'star',\n 'stars',\n 'unstar',\n]);\n\nfunction detectVersion(bin: string): string {\n try {\n return execSync(`${bin} --version`, { encoding: 'utf8', timeout: 5000 }).trim();\n } catch {\n return 'unknown';\n }\n}\n\nfunction installNpm(version: string): string {\n const pkg = `npm@${version}`;\n debug('installing %s into temp dir', pkg);\n const tmpDir = execSync('mktemp -d', { encoding: 'utf8' }).trim();\n execSync(`npm install --prefix \"${tmpDir}\" ${pkg} --loglevel=error`, {\n encoding: 'utf8',\n timeout: 30000,\n });\n const bin = `${tmpDir}/node_modules/.bin/npm`;\n const installed = detectVersion(bin);\n debug('installed npm %s at %s', installed, bin);\n console.log(` Auto-installed npm ${installed}`);\n return bin;\n}\n\nfunction resolveNpmBin(binPath?: string, version?: string): string {\n if (binPath) return binPath;\n if (version) return installNpm(version);\n return 'npm';\n}\n\nexport function createNpmAdapter(binPath?: string, version?: string): PackageManagerAdapter {\n const bin = resolveNpmBin(binPath, version);\n const resolved = detectVersion(bin);\n debug('creating npm adapter with bin: %s (%s)', bin, resolved);\n\n const adapter: PackageManagerAdapter = {\n name: `npm@${resolved}`,\n type: 'npm',\n bin,\n supports: NPM_SUPPORTED_COMMANDS,\n\n registryArg(url: string): string[] {\n return ['--registry', url];\n },\n\n prefixArg(folder: string): string[] {\n return ['--prefix', folder];\n },\n\n exec(options: SpawnOptions, ...args: string[]): Promise<ExecOutput> {\n return exec(options, bin, args);\n },\n\n async prepareProject(\n packageName: string,\n version: string,\n registryUrl: string,\n port: number,\n token: string,\n dependencies: Record<string, string> = {},\n devDependencies: Record<string, string> = {}\n ): Promise<{ tempFolder: string }> {\n return prepareGenericEmptyProject(\n packageName,\n version,\n port,\n token,\n registryUrl,\n dependencies,\n devDependencies\n );\n },\n };\n\n return adapter;\n}\n"],"mappings":";;;;;AAOA,IAAM,QAAQ,WAAW,wBAAwB;AAEjD,IAAM,yBAAyB,IAAI,IAAI;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAS,cAAc,KAAqB;AAC1C,KAAI;AACF,SAAO,SAAS,GAAG,IAAI,aAAa;GAAE,UAAU;GAAQ,SAAS;GAAM,CAAC,CAAC,MAAM;SACzE;AACN,SAAO;;;AAIX,SAAS,WAAW,SAAyB;CAC3C,MAAM,MAAM,OAAO;AACnB,OAAM,+BAA+B,IAAI;CACzC,MAAM,SAAS,SAAS,aAAa,EAAE,UAAU,QAAQ,CAAC,CAAC,MAAM;AACjE,UAAS,yBAAyB,OAAO,IAAI,IAAI,oBAAoB;EACnE,UAAU;EACV,SAAS;EACV,CAAC;CACF,MAAM,MAAM,GAAG,OAAO;CACtB,MAAM,YAAY,cAAc,IAAI;AACpC,OAAM,0BAA0B,WAAW,IAAI;AAC/C,SAAQ,IAAI,wBAAwB,YAAY;AAChD,QAAO;;AAGT,SAAS,cAAc,SAAkB,SAA0B;AACjE,KAAI,QAAS,QAAO;AACpB,KAAI,QAAS,QAAO,WAAW,QAAQ;AACvC,QAAO;;AAGT,SAAgB,iBAAiB,SAAkB,SAAyC;CAC1F,MAAM,MAAM,cAAc,SAAS,QAAQ;CAC3C,MAAM,WAAW,cAAc,IAAI;AACnC,OAAM,0CAA0C,KAAK,SAAS;AAyC9D,QAvCuC;EACrC,MAAM,OAAO;EACb,MAAM;EACN;EACA,UAAU;EAEV,YAAY,KAAuB;AACjC,UAAO,CAAC,cAAc,IAAI;;EAG5B,UAAU,QAA0B;AAClC,UAAO,CAAC,YAAY,OAAO;;EAG7B,KAAK,SAAuB,GAAG,MAAqC;AAClE,UAAO,KAAK,SAAS,KAAK,KAAK;;EAGjC,MAAM,eACJ,aACA,SACA,aACA,MACA,OACA,eAAuC,EAAE,EACzC,kBAA0C,EAAE,EACX;AACjC,UAAO,2BACL,aACA,SACA,MACA,OACA,aACA,cACA,gBACD;;EAEJ"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { exec } from "../utils/process.js";
|
|
2
2
|
import { prepareGenericEmptyProject } from "../utils/project.js";
|
|
3
3
|
import buildDebug from "debug";
|
|
4
|
+
import { execSync } from "child_process";
|
|
4
5
|
//#region src/adapters/pnpm.ts
|
|
5
6
|
var debug = buildDebug("verdaccio:e2e-cli:pnpm");
|
|
6
7
|
var PNPM_SUPPORTED_COMMANDS = new Set([
|
|
@@ -17,11 +18,41 @@ var PNPM_SUPPORTED_COMMANDS = new Set([
|
|
|
17
18
|
"stars",
|
|
18
19
|
"unstar"
|
|
19
20
|
]);
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
function detectVersion(bin) {
|
|
22
|
+
try {
|
|
23
|
+
return execSync(`${bin} --version`, {
|
|
24
|
+
encoding: "utf8",
|
|
25
|
+
timeout: 5e3
|
|
26
|
+
}).trim();
|
|
27
|
+
} catch {
|
|
28
|
+
return "unknown";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function installPnpm(version) {
|
|
32
|
+
const pkg = `pnpm@${version}`;
|
|
33
|
+
debug("installing %s into temp dir", pkg);
|
|
34
|
+
const tmpDir = execSync("mktemp -d", { encoding: "utf8" }).trim();
|
|
35
|
+
execSync(`npm install --prefix "${tmpDir}" ${pkg} --loglevel=error`, {
|
|
36
|
+
encoding: "utf8",
|
|
37
|
+
timeout: 3e4
|
|
38
|
+
});
|
|
39
|
+
const bin = `${tmpDir}/node_modules/.bin/pnpm`;
|
|
40
|
+
const installed = detectVersion(bin);
|
|
41
|
+
debug("installed pnpm %s at %s", installed, bin);
|
|
42
|
+
console.log(` Auto-installed pnpm ${installed}`);
|
|
43
|
+
return bin;
|
|
44
|
+
}
|
|
45
|
+
function resolvePnpmBin(binPath, version) {
|
|
46
|
+
if (binPath) return binPath;
|
|
47
|
+
if (version) return installPnpm(version);
|
|
48
|
+
return "pnpm";
|
|
49
|
+
}
|
|
50
|
+
function createPnpmAdapter(binPath, version) {
|
|
51
|
+
const bin = resolvePnpmBin(binPath, version);
|
|
52
|
+
const resolved = detectVersion(bin);
|
|
53
|
+
debug("creating pnpm adapter with bin: %s (%s)", bin, resolved);
|
|
23
54
|
return {
|
|
24
|
-
name: `pnpm`,
|
|
55
|
+
name: `pnpm@${resolved}`,
|
|
25
56
|
type: "pnpm",
|
|
26
57
|
bin,
|
|
27
58
|
supports: PNPM_SUPPORTED_COMMANDS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pnpm.js","names":[],"sources":["../../../src/adapters/pnpm.ts"],"sourcesContent":["import { SpawnOptions } from 'child_process';\nimport buildDebug from 'debug';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { prepareGenericEmptyProject } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:pnpm');\n\nconst PNPM_SUPPORTED_COMMANDS = new Set([\n 'publish',\n 'unpublish',\n 'install',\n 'info',\n 'audit',\n 'deprecate',\n 'dist-tag',\n 'ping',\n 'search',\n 'star',\n 'stars',\n 'unstar',\n]);\n\nexport function createPnpmAdapter(binPath?: string): PackageManagerAdapter {\n const bin = binPath
|
|
1
|
+
{"version":3,"file":"pnpm.js","names":[],"sources":["../../../src/adapters/pnpm.ts"],"sourcesContent":["import { SpawnOptions, execSync } from 'child_process';\nimport buildDebug from 'debug';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { prepareGenericEmptyProject } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:pnpm');\n\nconst PNPM_SUPPORTED_COMMANDS = new Set([\n 'publish',\n 'unpublish',\n 'install',\n 'info',\n 'audit',\n 'deprecate',\n 'dist-tag',\n 'ping',\n 'search',\n 'star',\n 'stars',\n 'unstar',\n]);\n\nfunction detectVersion(bin: string): string {\n try {\n return execSync(`${bin} --version`, { encoding: 'utf8', timeout: 5000 }).trim();\n } catch {\n return 'unknown';\n }\n}\n\nfunction installPnpm(version: string): string {\n const pkg = `pnpm@${version}`;\n debug('installing %s into temp dir', pkg);\n const tmpDir = execSync('mktemp -d', { encoding: 'utf8' }).trim();\n execSync(`npm install --prefix \"${tmpDir}\" ${pkg} --loglevel=error`, {\n encoding: 'utf8',\n timeout: 30000,\n });\n const bin = `${tmpDir}/node_modules/.bin/pnpm`;\n const installed = detectVersion(bin);\n debug('installed pnpm %s at %s', installed, bin);\n console.log(` Auto-installed pnpm ${installed}`);\n return bin;\n}\n\nfunction resolvePnpmBin(binPath?: string, version?: string): string {\n if (binPath) return binPath;\n if (version) return installPnpm(version);\n return 'pnpm';\n}\n\nexport function createPnpmAdapter(binPath?: string, version?: string): PackageManagerAdapter {\n const bin = resolvePnpmBin(binPath, version);\n const resolved = detectVersion(bin);\n debug('creating pnpm adapter with bin: %s (%s)', bin, resolved);\n\n const adapter: PackageManagerAdapter = {\n name: `pnpm@${resolved}`,\n type: 'pnpm',\n bin,\n supports: PNPM_SUPPORTED_COMMANDS,\n\n registryArg(url: string): string[] {\n return ['--registry', url];\n },\n\n prefixArg(folder: string): string[] {\n return ['--prefix', folder];\n },\n\n exec(options: SpawnOptions, ...args: string[]): Promise<ExecOutput> {\n return exec(options, bin, args);\n },\n\n async prepareProject(\n packageName: string,\n version: string,\n registryUrl: string,\n port: number,\n token: string,\n dependencies: Record<string, string> = {},\n devDependencies: Record<string, string> = {}\n ): Promise<{ tempFolder: string }> {\n return prepareGenericEmptyProject(\n packageName,\n version,\n port,\n token,\n registryUrl,\n dependencies,\n devDependencies\n );\n },\n };\n\n return adapter;\n}\n"],"mappings":";;;;;AAOA,IAAM,QAAQ,WAAW,yBAAyB;AAElD,IAAM,0BAA0B,IAAI,IAAI;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAS,cAAc,KAAqB;AAC1C,KAAI;AACF,SAAO,SAAS,GAAG,IAAI,aAAa;GAAE,UAAU;GAAQ,SAAS;GAAM,CAAC,CAAC,MAAM;SACzE;AACN,SAAO;;;AAIX,SAAS,YAAY,SAAyB;CAC5C,MAAM,MAAM,QAAQ;AACpB,OAAM,+BAA+B,IAAI;CACzC,MAAM,SAAS,SAAS,aAAa,EAAE,UAAU,QAAQ,CAAC,CAAC,MAAM;AACjE,UAAS,yBAAyB,OAAO,IAAI,IAAI,oBAAoB;EACnE,UAAU;EACV,SAAS;EACV,CAAC;CACF,MAAM,MAAM,GAAG,OAAO;CACtB,MAAM,YAAY,cAAc,IAAI;AACpC,OAAM,2BAA2B,WAAW,IAAI;AAChD,SAAQ,IAAI,yBAAyB,YAAY;AACjD,QAAO;;AAGT,SAAS,eAAe,SAAkB,SAA0B;AAClE,KAAI,QAAS,QAAO;AACpB,KAAI,QAAS,QAAO,YAAY,QAAQ;AACxC,QAAO;;AAGT,SAAgB,kBAAkB,SAAkB,SAAyC;CAC3F,MAAM,MAAM,eAAe,SAAS,QAAQ;CAC5C,MAAM,WAAW,cAAc,IAAI;AACnC,OAAM,2CAA2C,KAAK,SAAS;AAyC/D,QAvCuC;EACrC,MAAM,QAAQ;EACd,MAAM;EACN;EACA,UAAU;EAEV,YAAY,KAAuB;AACjC,UAAO,CAAC,cAAc,IAAI;;EAG5B,UAAU,QAA0B;AAClC,UAAO,CAAC,YAAY,OAAO;;EAG7B,KAAK,SAAuB,GAAG,MAAqC;AAClE,UAAO,KAAK,SAAS,KAAK,KAAK;;EAGjC,MAAM,eACJ,aACA,SACA,aACA,MACA,OACA,eAAuC,EAAE,EACzC,kBAA0C,EAAE,EACX;AACjC,UAAO,2BACL,aACA,SACA,MACA,OACA,aACA,cACA,gBACD;;EAEJ"}
|
|
@@ -15,7 +15,8 @@ function detectYarnVersion(bin) {
|
|
|
15
15
|
return execSync(`${bin} --version`, {
|
|
16
16
|
env: {
|
|
17
17
|
...process.env,
|
|
18
|
-
COREPACK_ENABLE_STRICT: "0"
|
|
18
|
+
COREPACK_ENABLE_STRICT: "0",
|
|
19
|
+
YARN_IGNORE_PATH: "1"
|
|
19
20
|
},
|
|
20
21
|
encoding: "utf8",
|
|
21
22
|
timeout: 5e3
|
|
@@ -24,13 +25,45 @@ function detectYarnVersion(bin) {
|
|
|
24
25
|
return "unknown";
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
debug("
|
|
30
|
-
const
|
|
31
|
-
|
|
28
|
+
function installYarnClassic(version = "1") {
|
|
29
|
+
const pkg = version.startsWith("1") ? `yarn@${version}` : `yarn@1`;
|
|
30
|
+
debug("installing %s into temp dir", pkg);
|
|
31
|
+
const tmpDir = execSync("mktemp -d", { encoding: "utf8" }).trim();
|
|
32
|
+
execSync(`npm install --prefix "${tmpDir}" ${pkg} --loglevel=error`, {
|
|
33
|
+
encoding: "utf8",
|
|
34
|
+
timeout: 3e4
|
|
35
|
+
});
|
|
36
|
+
const bin = `${tmpDir}/node_modules/.bin/yarn`;
|
|
37
|
+
const installed = detectYarnVersion(bin);
|
|
38
|
+
debug("installed yarn %s at %s", installed, bin);
|
|
39
|
+
console.log(` Auto-installed yarn classic ${installed}`);
|
|
40
|
+
return bin;
|
|
41
|
+
}
|
|
42
|
+
function resolveYarnClassicBin(binPath, version) {
|
|
43
|
+
if (binPath) return binPath;
|
|
44
|
+
if (version) return installYarnClassic(version);
|
|
45
|
+
try {
|
|
46
|
+
const systemYarn = execSync("which yarn", {
|
|
47
|
+
encoding: "utf8",
|
|
48
|
+
timeout: 5e3
|
|
49
|
+
}).trim();
|
|
50
|
+
const sysVersion = detectYarnVersion(systemYarn);
|
|
51
|
+
if (sysVersion.split(".")[0] === "1") {
|
|
52
|
+
debug("using system yarn classic %s", sysVersion);
|
|
53
|
+
return systemYarn;
|
|
54
|
+
}
|
|
55
|
+
debug("system yarn is Berry %s, auto-installing classic", sysVersion);
|
|
56
|
+
} catch {
|
|
57
|
+
debug("no system yarn found, auto-installing classic");
|
|
58
|
+
}
|
|
59
|
+
return installYarnClassic();
|
|
60
|
+
}
|
|
61
|
+
function createYarnClassicAdapter(binPath, version) {
|
|
62
|
+
const bin = resolveYarnClassicBin(binPath, version);
|
|
63
|
+
const resolved = detectYarnVersion(bin);
|
|
64
|
+
debug("creating yarn classic adapter with bin: %s (%s)", bin, resolved);
|
|
32
65
|
return {
|
|
33
|
-
name: `yarn-classic`,
|
|
66
|
+
name: `yarn-classic@${resolved}`,
|
|
34
67
|
type: "yarn-classic",
|
|
35
68
|
bin,
|
|
36
69
|
supports: YARN_CLASSIC_SUPPORTED_COMMANDS,
|
|
@@ -44,7 +77,8 @@ function createYarnClassicAdapter(binPath) {
|
|
|
44
77
|
const env = {
|
|
45
78
|
...process.env,
|
|
46
79
|
...options.env,
|
|
47
|
-
COREPACK_ENABLE_STRICT: "0"
|
|
80
|
+
COREPACK_ENABLE_STRICT: "0",
|
|
81
|
+
YARN_IGNORE_PATH: "1"
|
|
48
82
|
};
|
|
49
83
|
return exec({
|
|
50
84
|
...options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yarn-classic.js","names":[],"sources":["../../../src/adapters/yarn-classic.ts"],"sourcesContent":["import { SpawnOptions, execSync } from 'child_process';\nimport buildDebug from 'debug';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { prepareGenericEmptyProject } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:yarn-classic');\n\nconst YARN_CLASSIC_SUPPORTED_COMMANDS = new Set([\n 'publish',\n 'install',\n 'info',\n 'audit',\n]);\n\nfunction detectYarnVersion(bin: string): string {\n try {\n return execSync(`${bin} --version`, {\n env: { ...process.env, COREPACK_ENABLE_STRICT: '0' },\n encoding: 'utf8',\n timeout: 5000,\n }).trim();\n } catch {\n return 'unknown';\n }\n}\n\
|
|
1
|
+
{"version":3,"file":"yarn-classic.js","names":[],"sources":["../../../src/adapters/yarn-classic.ts"],"sourcesContent":["import { SpawnOptions, execSync } from 'child_process';\nimport buildDebug from 'debug';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { prepareGenericEmptyProject } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:yarn-classic');\n\nconst YARN_CLASSIC_SUPPORTED_COMMANDS = new Set([\n 'publish',\n 'install',\n 'info',\n 'audit',\n]);\n\nfunction detectYarnVersion(bin: string): string {\n try {\n return execSync(`${bin} --version`, {\n env: { ...process.env, COREPACK_ENABLE_STRICT: '0', YARN_IGNORE_PATH: '1' },\n encoding: 'utf8',\n timeout: 5000,\n }).trim();\n } catch {\n return 'unknown';\n }\n}\n\nfunction installYarnClassic(version = '1'): string {\n const pkg = version.startsWith('1') ? `yarn@${version}` : `yarn@1`;\n debug('installing %s into temp dir', pkg);\n const tmpDir = execSync('mktemp -d', { encoding: 'utf8' }).trim();\n execSync(`npm install --prefix \"${tmpDir}\" ${pkg} --loglevel=error`, {\n encoding: 'utf8',\n timeout: 30000,\n });\n const bin = `${tmpDir}/node_modules/.bin/yarn`;\n const installed = detectYarnVersion(bin);\n debug('installed yarn %s at %s', installed, bin);\n console.log(` Auto-installed yarn classic ${installed}`);\n return bin;\n}\n\nfunction resolveYarnClassicBin(binPath?: string, version?: string): string {\n if (binPath) return binPath;\n\n // Always install the requested version to ensure reproducibility\n if (version) {\n return installYarnClassic(version);\n }\n\n // Check if system yarn is 1.x\n try {\n const systemYarn = execSync('which yarn', { encoding: 'utf8', timeout: 5000 }).trim();\n const sysVersion = detectYarnVersion(systemYarn);\n const major = sysVersion.split('.')[0];\n if (major === '1') {\n debug('using system yarn classic %s', sysVersion);\n return systemYarn;\n }\n debug('system yarn is Berry %s, auto-installing classic', sysVersion);\n } catch {\n debug('no system yarn found, auto-installing classic');\n }\n\n return installYarnClassic();\n}\n\nexport function createYarnClassicAdapter(binPath?: string, version?: string): PackageManagerAdapter {\n const bin = resolveYarnClassicBin(binPath, version);\n const resolved = detectYarnVersion(bin);\n debug('creating yarn classic adapter with bin: %s (%s)', bin, resolved);\n\n const adapter: PackageManagerAdapter = {\n name: `yarn-classic@${resolved}`,\n type: 'yarn-classic',\n bin,\n supports: YARN_CLASSIC_SUPPORTED_COMMANDS,\n\n registryArg(url: string): string[] {\n return ['--registry', url];\n },\n\n prefixArg(folder: string): string[] {\n return ['--cwd', folder];\n },\n\n exec(options: SpawnOptions, ...args: string[]): Promise<ExecOutput> {\n const env = {\n ...process.env,\n ...options.env,\n COREPACK_ENABLE_STRICT: '0',\n YARN_IGNORE_PATH: '1',\n };\n return exec({ ...options, env }, bin, args);\n },\n\n async prepareProject(\n packageName: string,\n version: string,\n registryUrl: string,\n port: number,\n token: string,\n dependencies: Record<string, string> = {},\n devDependencies: Record<string, string> = {}\n ): Promise<{ tempFolder: string }> {\n return prepareGenericEmptyProject(\n packageName,\n version,\n port,\n token,\n registryUrl,\n dependencies,\n devDependencies\n );\n },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AkB,IAAI;AACvC,OAAM,mDAAmD,KAAK,SAAS;AA+CvE,QA7CuC;EACrC,MAAM,gBAAgB;EACtB,MAAM;EACN;EACA,UAAU;EAEV,YAAY,KAAuB;AACjC,UAAO,CAAC,cAAc,IAAI;;EAG5B,UAAU,QAA0B;AAClC,UAAO,CAAC,SAAS,OAAO;;EAG1B,KAAK,SAAuB,GAAG,MAAqC;GAClE,MAAM,MAAM;IACV,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,wBAAwB;IACxB,kBAAkB;IACnB;AACD,UAAO,KAAK;IAAE,GAAG;IAAS;IAAK,EAAE,KAAK,KAAK;;EAG7C,MAAM,eACJ,aACA,SACA,aACA,MACA,OACA,eAAuC,EAAE,EACzC,kBAA0C,EAAE,EACX;AACjC,UAAO,2BACL,aACA,SACA,MACA,OACA,aACA,cACA,gBACD;;EAEJ"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { exec } from "../utils/process.js";
|
|
2
2
|
import { createTempFolder, getPackageJSON, getREADME } from "../utils/project.js";
|
|
3
3
|
import buildDebug from "debug";
|
|
4
|
+
import { execSync } from "child_process";
|
|
4
5
|
import { join } from "path";
|
|
5
6
|
import { writeFile } from "fs/promises";
|
|
6
7
|
import YAML from "js-yaml";
|
|
@@ -12,6 +13,57 @@ var YARN_MODERN_SUPPORTED_COMMANDS = new Set([
|
|
|
12
13
|
"install",
|
|
13
14
|
"info"
|
|
14
15
|
]);
|
|
16
|
+
var YARN_ENV = {
|
|
17
|
+
COREPACK_ENABLE_STRICT: "0",
|
|
18
|
+
YARN_IGNORE_PATH: "1"
|
|
19
|
+
};
|
|
20
|
+
function detectVersion(bin) {
|
|
21
|
+
try {
|
|
22
|
+
return execSync(`${bin} --version`, {
|
|
23
|
+
env: {
|
|
24
|
+
...process.env,
|
|
25
|
+
...YARN_ENV
|
|
26
|
+
},
|
|
27
|
+
encoding: "utf8",
|
|
28
|
+
timeout: 5e3
|
|
29
|
+
}).trim();
|
|
30
|
+
} catch {
|
|
31
|
+
return "unknown";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function installYarnModern(version = "4") {
|
|
35
|
+
const pkg = `@yarnpkg/cli-dist@${version}`;
|
|
36
|
+
debug("installing %s into temp dir", pkg);
|
|
37
|
+
const tmpDir = execSync("mktemp -d", { encoding: "utf8" }).trim();
|
|
38
|
+
execSync(`npm install --prefix "${tmpDir}" ${pkg} --loglevel=error`, {
|
|
39
|
+
encoding: "utf8",
|
|
40
|
+
timeout: 3e4
|
|
41
|
+
});
|
|
42
|
+
const bin = `${tmpDir}/node_modules/@yarnpkg/cli-dist/bin/yarn.js`;
|
|
43
|
+
const installed = detectVersion(bin);
|
|
44
|
+
debug("installed yarn modern %s at %s", installed, bin);
|
|
45
|
+
console.log(` Auto-installed yarn modern ${installed}`);
|
|
46
|
+
return bin;
|
|
47
|
+
}
|
|
48
|
+
function resolveYarnBin(binPath, version) {
|
|
49
|
+
if (binPath) return binPath;
|
|
50
|
+
if (version) return installYarnModern(version);
|
|
51
|
+
try {
|
|
52
|
+
const systemYarn = execSync("which yarn", {
|
|
53
|
+
encoding: "utf8",
|
|
54
|
+
timeout: 5e3
|
|
55
|
+
}).trim();
|
|
56
|
+
const sysVersion = detectVersion(systemYarn);
|
|
57
|
+
if (parseInt(sysVersion.split(".")[0], 10) >= 2) {
|
|
58
|
+
debug("using system yarn Berry %s", sysVersion);
|
|
59
|
+
return systemYarn;
|
|
60
|
+
}
|
|
61
|
+
debug("system yarn is Classic %s, auto-installing Berry", sysVersion);
|
|
62
|
+
} catch {
|
|
63
|
+
debug("no system yarn found, auto-installing Berry");
|
|
64
|
+
}
|
|
65
|
+
return installYarnModern();
|
|
66
|
+
}
|
|
15
67
|
function createYamlConfig(registry, token) {
|
|
16
68
|
const defaultYaml = {
|
|
17
69
|
npmRegistryServer: registry,
|
|
@@ -27,12 +79,14 @@ function createYamlConfig(registry, token) {
|
|
|
27
79
|
}
|
|
28
80
|
return YAML.dump(defaultYaml);
|
|
29
81
|
}
|
|
30
|
-
function createYarnModernAdapter(binPath) {
|
|
31
|
-
|
|
82
|
+
function createYarnModernAdapter(binPath, version) {
|
|
83
|
+
const bin = resolveYarnBin(binPath, version);
|
|
84
|
+
const resolved = detectVersion(bin);
|
|
85
|
+
debug("creating yarn modern adapter with bin: %s (%s)", bin, resolved);
|
|
32
86
|
return {
|
|
33
|
-
name: `yarn-modern`,
|
|
87
|
+
name: `yarn-modern@${resolved}`,
|
|
34
88
|
type: "yarn-modern",
|
|
35
|
-
bin
|
|
89
|
+
bin,
|
|
36
90
|
supports: YARN_MODERN_SUPPORTED_COMMANDS,
|
|
37
91
|
registryArg(_url) {
|
|
38
92
|
return [];
|
|
@@ -44,7 +98,7 @@ function createYarnModernAdapter(binPath) {
|
|
|
44
98
|
const env = {
|
|
45
99
|
...process.env,
|
|
46
100
|
...options.env,
|
|
47
|
-
|
|
101
|
+
...YARN_ENV
|
|
48
102
|
};
|
|
49
103
|
const cmd = args[0];
|
|
50
104
|
let yarnArgs;
|
|
@@ -62,7 +116,7 @@ function createYarnModernAdapter(binPath) {
|
|
|
62
116
|
return exec({
|
|
63
117
|
...options,
|
|
64
118
|
env
|
|
65
|
-
},
|
|
119
|
+
}, bin, yarnArgs);
|
|
66
120
|
},
|
|
67
121
|
async prepareProject(packageName, version, registryUrl, _port, token, dependencies = {}, devDependencies = {}) {
|
|
68
122
|
const tempFolder = await createTempFolder(packageName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yarn-modern.js","names":[],"sources":["../../../src/adapters/yarn-modern.ts"],"sourcesContent":["import { SpawnOptions } from 'child_process';\nimport buildDebug from 'debug';\nimport { writeFile } from 'fs/promises';\nimport YAML from 'js-yaml';\nimport { join } from 'path';\nimport { URL } from 'url';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { createTempFolder, getPackageJSON, getREADME } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:yarn-modern');\n\nconst YARN_MODERN_SUPPORTED_COMMANDS = new Set(['publish', 'install', 'info']);\n\nfunction createYamlConfig(registry: string, token?: string) {\n const defaultYaml: any = {\n npmRegistryServer: registry,\n enableImmutableInstalls: false,\n unsafeHttpWhitelist: ['localhost'],\n };\n\n if (typeof token === 'string') {\n const url = new URL(registry);\n defaultYaml.npmRegistries = {\n [`//${url.hostname}:${url.port}`]: {\n npmAlwaysAuth: true,\n npmAuthToken: token,\n },\n };\n }\n\n return YAML.dump(defaultYaml);\n}\n\nexport function createYarnModernAdapter(binPath
|
|
1
|
+
{"version":3,"file":"yarn-modern.js","names":[],"sources":["../../../src/adapters/yarn-modern.ts"],"sourcesContent":["import { SpawnOptions, execSync } from 'child_process';\nimport buildDebug from 'debug';\nimport { writeFile } from 'fs/promises';\nimport YAML from 'js-yaml';\nimport { join } from 'path';\nimport { URL } from 'url';\n\nimport { ExecOutput, PackageManagerAdapter } from '../types';\nimport { exec } from '../utils/process';\nimport { createTempFolder, getPackageJSON, getREADME } from '../utils/project';\n\nconst debug = buildDebug('verdaccio:e2e-cli:yarn-modern');\n\nconst YARN_MODERN_SUPPORTED_COMMANDS = new Set(['publish', 'install', 'info']);\n\nconst YARN_ENV = {\n COREPACK_ENABLE_STRICT: '0',\n YARN_IGNORE_PATH: '1',\n};\n\nfunction detectVersion(bin: string): string {\n try {\n return execSync(`${bin} --version`, {\n env: { ...process.env, ...YARN_ENV },\n encoding: 'utf8',\n timeout: 5000,\n }).trim();\n } catch {\n return 'unknown';\n }\n}\n\nfunction installYarnModern(version = '4'): string {\n const pkg = `@yarnpkg/cli-dist@${version}`;\n debug('installing %s into temp dir', pkg);\n const tmpDir = execSync('mktemp -d', { encoding: 'utf8' }).trim();\n execSync(`npm install --prefix \"${tmpDir}\" ${pkg} --loglevel=error`, {\n encoding: 'utf8',\n timeout: 30000,\n });\n const bin = `${tmpDir}/node_modules/@yarnpkg/cli-dist/bin/yarn.js`;\n const installed = detectVersion(bin);\n debug('installed yarn modern %s at %s', installed, bin);\n console.log(` Auto-installed yarn modern ${installed}`);\n return bin;\n}\n\nfunction resolveYarnBin(binPath?: string, version?: string): string {\n if (binPath) return binPath;\n\n if (version) {\n return installYarnModern(version);\n }\n\n try {\n const systemYarn = execSync('which yarn', { encoding: 'utf8', timeout: 5000 }).trim();\n const sysVersion = detectVersion(systemYarn);\n const major = parseInt(sysVersion.split('.')[0], 10);\n if (major >= 2) {\n debug('using system yarn Berry %s', sysVersion);\n return systemYarn;\n }\n debug('system yarn is Classic %s, auto-installing Berry', sysVersion);\n } catch {\n debug('no system yarn found, auto-installing Berry');\n }\n\n return installYarnModern();\n}\n\nfunction createYamlConfig(registry: string, token?: string) {\n const defaultYaml: any = {\n npmRegistryServer: registry,\n enableImmutableInstalls: false,\n unsafeHttpWhitelist: ['localhost'],\n };\n\n if (typeof token === 'string') {\n const url = new URL(registry);\n defaultYaml.npmRegistries = {\n [`//${url.hostname}:${url.port}`]: {\n npmAlwaysAuth: true,\n npmAuthToken: token,\n },\n };\n }\n\n return YAML.dump(defaultYaml);\n}\n\nexport function createYarnModernAdapter(binPath?: string, version?: string): PackageManagerAdapter {\n const bin = resolveYarnBin(binPath, version);\n const resolved = detectVersion(bin);\n debug('creating yarn modern adapter with bin: %s (%s)', bin, resolved);\n\n const adapter: PackageManagerAdapter = {\n name: `yarn-modern@${resolved}`,\n type: 'yarn-modern',\n bin,\n supports: YARN_MODERN_SUPPORTED_COMMANDS,\n\n registryArg(_url: string): string[] {\n return [];\n },\n\n prefixArg(_folder: string): string[] {\n return [];\n },\n\n exec(options: SpawnOptions, ...args: string[]): Promise<ExecOutput> {\n const env = { ...process.env, ...options.env, ...YARN_ENV };\n\n const cmd = args[0];\n let yarnArgs: string[];\n if (cmd === 'publish') {\n const filtered = args.slice(1).filter(\n (a) => a !== '--json' && !a.startsWith('--registry')\n );\n yarnArgs = ['npm', 'publish', ...filtered];\n } else if (cmd === 'info') {\n const filtered = args.slice(1).filter((a) => !a.startsWith('--registry'));\n yarnArgs = ['npm', 'info', ...filtered];\n } else {\n yarnArgs = args.filter((a) => !a.startsWith('--registry'));\n }\n\n return exec({ ...options, env }, bin, yarnArgs);\n },\n\n async prepareProject(\n packageName: string,\n version: string,\n registryUrl: string,\n _port: number,\n token: string,\n dependencies: Record<string, string> = {},\n devDependencies: Record<string, string> = {}\n ): Promise<{ tempFolder: string }> {\n const tempFolder = await createTempFolder(packageName);\n const yamlContent = createYamlConfig(registryUrl, token);\n await writeFile(join(tempFolder, '.yarnrc.yml'), yamlContent);\n await writeFile(\n join(tempFolder, 'package.json'),\n getPackageJSON(packageName, version, dependencies, devDependencies)\n );\n await writeFile(join(tempFolder, 'README.md'), getREADME(packageName));\n return { tempFolder };\n },\n };\n\n return adapter;\n}\n"],"mappings":";;;;;;;;;AAWA,IAAM,QAAQ,WAAW,gCAAgC;AAEzD,IAAM,iCAAiC,IAAI,IAAI;CAAC;CAAW;CAAW;CAAO,CAAC;AAE9E,IAAM,WAAW;CACf,wBAAwB;CACxB,kBAAkB;CACnB;AAED,SAAS,cAAc,KAAqB;AAC1C,KAAI;AACF,SAAO,SAAS,GAAG,IAAI,aAAa;GAClC,KAAK;IAAE,GAAG,QAAQ;IAAK,GAAG;IAAU;GACpC,UAAU;GACV,SAAS;GACV,CAAC,CAAC,MAAM;SACH;AACN,SAAO;;;AAIX,SAAS,kBAAkB,UAAU,KAAa;CAChD,MAAM,MAAM,qBAAqB;AACjC,OAAM,+BAA+B,IAAI;CACzC,MAAM,SAAS,SAAS,aAAa,EAAE,UAAU,QAAQ,CAAC,CAAC,MAAM;AACjE,UAAS,yBAAyB,OAAO,IAAI,IAAI,oBAAoB;EACnE,UAAU;EACV,SAAS;EACV,CAAC;CACF,MAAM,MAAM,GAAG,OAAO;CACtB,MAAM,YAAY,cAAc,IAAI;AACpC,OAAM,kCAAkC,WAAW,IAAI;AACvD,SAAQ,IAAI,gCAAgC,YAAY;AACxD,QAAO;;AAGT,SAAS,eAAe,SAAkB,SAA0B;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ACrD;IACyC;YACjC,QAAQ,OAEjB,YAAW;IAAC;IAAO;IAAQ,GADV,KAAK,MAAM,EAAE,CAAC,QAAQ,MAAM,CAAC,EAAE,WAAW,aAAa,CAAC;IAClC;OAEvC,YAAW,KAAK,QAAQ,MAAM,CAAC,EAAE,WAAW,aAAa,CAAC;AAG5D,UAAO,KAAK;IAAE,GAAG;IAAS;IAAK,EAAE,KAAK,SAAS;;EAGjD,MAAM,eACJ,aACA,SACA,aACA,OACA,OACA,eAAuC,EAAE,EACzC,kBAA0C,EAAE,EACX;GACjC,MAAM,aAAa,MAAM,iBAAiB,YAAY;GACtD,MAAM,cAAc,iBAAiB,aAAa,MAAM;AACxD,SAAM,UAAU,KAAK,YAAY,cAAc,EAAE,YAAY;AAC7D,SAAM,UACJ,KAAK,YAAY,eAAe,EAChC,eAAe,aAAa,SAAS,cAAc,gBAAgB,CACpE;AACD,SAAM,UAAU,KAAK,YAAY,YAAY,EAAE,UAAU,YAAY,CAAC;AACtE,UAAO,EAAE,YAAY;;EAExB"}
|
package/build/esm/index.js
CHANGED
|
@@ -9,19 +9,29 @@ import { runAll, runSuite } from "./runner.js";
|
|
|
9
9
|
import buildDebug from "debug";
|
|
10
10
|
//#region src/index.ts
|
|
11
11
|
buildDebug("verdaccio:e2e-cli");
|
|
12
|
+
function parsePmSpec(filter) {
|
|
13
|
+
const eqIdx = filter.indexOf("=");
|
|
14
|
+
if (eqIdx !== -1) return {
|
|
15
|
+
name: filter.slice(0, eqIdx).toLowerCase(),
|
|
16
|
+
binPath: filter.slice(eqIdx + 1)
|
|
17
|
+
};
|
|
18
|
+
const atIdx = filter.indexOf("@");
|
|
19
|
+
if (atIdx !== -1) return {
|
|
20
|
+
name: filter.slice(0, atIdx).toLowerCase(),
|
|
21
|
+
version: filter.slice(atIdx + 1)
|
|
22
|
+
};
|
|
23
|
+
return { name: filter.toLowerCase() };
|
|
24
|
+
}
|
|
12
25
|
function parseAdapters(pmFilters) {
|
|
13
26
|
if (!pmFilters || pmFilters.length === 0) return [createNpmAdapter()];
|
|
14
27
|
const adapters = [];
|
|
15
28
|
for (const filter of pmFilters) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
else if (
|
|
20
|
-
else if (
|
|
21
|
-
else
|
|
22
|
-
if (!binPath) throw new Error(`yarn-modern requires a bin path: --pm yarn-modern=/path/to/yarn.js`);
|
|
23
|
-
adapters.push(createYarnModernAdapter(binPath));
|
|
24
|
-
} else throw new Error(`Unknown package manager: "${name}". Supported: npm, pnpm, yarn-classic, yarn-modern`);
|
|
29
|
+
const { name, version, binPath } = parsePmSpec(filter);
|
|
30
|
+
if (name === "npm") adapters.push(createNpmAdapter(binPath, version));
|
|
31
|
+
else if (name === "pnpm") adapters.push(createPnpmAdapter(binPath, version));
|
|
32
|
+
else if (name === "yarn-classic" || name === "yarn1") adapters.push(createYarnClassicAdapter(binPath, version));
|
|
33
|
+
else if (name === "yarn-modern" || name === "yarn") adapters.push(createYarnModernAdapter(binPath, version));
|
|
34
|
+
else throw new Error(`Unknown package manager: "${name}". Supported: npm, pnpm, yarn-classic, yarn-modern[@version]`);
|
|
25
35
|
}
|
|
26
36
|
return adapters;
|
|
27
37
|
}
|
|
@@ -70,11 +80,14 @@ function printHelp() {
|
|
|
70
80
|
-r, --registry <url> Verdaccio registry URL (e.g. http://localhost:4873)
|
|
71
81
|
|
|
72
82
|
Options:
|
|
73
|
-
--pm <name[
|
|
74
|
-
Supported: npm, pnpm, yarn-classic, yarn-modern
|
|
75
|
-
Examples: --pm npm --pm pnpm
|
|
76
|
-
--pm
|
|
77
|
-
--pm yarn-modern
|
|
83
|
+
--pm <name[@version]> Package manager to test (can be repeated)
|
|
84
|
+
Supported: npm, pnpm, yarn-classic, yarn-modern (or yarn)
|
|
85
|
+
Examples: --pm npm@10 --pm pnpm@9
|
|
86
|
+
--pm yarn-modern@4
|
|
87
|
+
--pm yarn-modern@3
|
|
88
|
+
--pm yarn-classic
|
|
89
|
+
--pm npm --pm pnpm (uses system version)
|
|
90
|
+
Auto-installs the requested yarn version if needed
|
|
78
91
|
Default: npm
|
|
79
92
|
|
|
80
93
|
-t, --test <name> Filter tests by name (can be repeated)
|
|
@@ -95,6 +108,9 @@ async function main(argv = process.argv) {
|
|
|
95
108
|
printHelp();
|
|
96
109
|
process.exit(1);
|
|
97
110
|
}
|
|
111
|
+
const { createTempFolder } = await import("./utils/project.js");
|
|
112
|
+
const runDir = await createTempFolder("e2e-run");
|
|
113
|
+
process.chdir(runDir);
|
|
98
114
|
if (options.verbose) {
|
|
99
115
|
const { setVerbose } = await import("./utils/process.js");
|
|
100
116
|
setVerbose(true);
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import buildDebug from 'debug';\n\nimport {\n createNpmAdapter,\n createPnpmAdapter,\n createYarnClassicAdapter,\n createYarnModernAdapter,\n} from './adapters';\nimport { allTests } from './tests';\nimport { CliOptions, PackageManagerAdapter } from './types';\nimport { createUser, pingRegistry } from './utils/registry-client';\nimport { runAll } from './runner';\n\nconst debug = buildDebug('verdaccio:e2e-cli');\n\nfunction parseAdapters(pmFilters?: string[]): PackageManagerAdapter[] {\n if (!pmFilters || pmFilters.length === 0) {\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import buildDebug from 'debug';\n\nimport {\n createNpmAdapter,\n createPnpmAdapter,\n createYarnClassicAdapter,\n createYarnModernAdapter,\n} from './adapters';\nimport { allTests } from './tests';\nimport { CliOptions, PackageManagerAdapter } from './types';\nimport { createUser, pingRegistry } from './utils/registry-client';\nimport { runAll } from './runner';\n\nconst debug = buildDebug('verdaccio:e2e-cli');\n\nfunction parsePmSpec(filter: string): { name: string; version?: string; binPath?: string } {\n // --pm yarn-modern@3, --pm yarn-classic@1.22.22, --pm npm=/path/to/bin\n const eqIdx = filter.indexOf('=');\n if (eqIdx !== -1) {\n return { name: filter.slice(0, eqIdx).toLowerCase(), binPath: filter.slice(eqIdx + 1) };\n }\n const atIdx = filter.indexOf('@');\n if (atIdx !== -1) {\n return { name: filter.slice(0, atIdx).toLowerCase(), version: filter.slice(atIdx + 1) };\n }\n return { name: filter.toLowerCase() };\n}\n\nfunction parseAdapters(pmFilters?: string[]): PackageManagerAdapter[] {\n if (!pmFilters || pmFilters.length === 0) {\n return [createNpmAdapter()];\n }\n\n const adapters: PackageManagerAdapter[] = [];\n\n for (const filter of pmFilters) {\n const { name, version, binPath } = parsePmSpec(filter);\n\n if (name === 'npm') {\n adapters.push(createNpmAdapter(binPath, version));\n } else if (name === 'pnpm') {\n adapters.push(createPnpmAdapter(binPath, version));\n } else if (name === 'yarn-classic' || name === 'yarn1') {\n adapters.push(createYarnClassicAdapter(binPath, version));\n } else if (name === 'yarn-modern' || name === 'yarn') {\n adapters.push(createYarnModernAdapter(binPath, version));\n } else {\n throw new Error(\n `Unknown package manager: \"${name}\". Supported: npm, pnpm, yarn-classic, yarn-modern[@version]`\n );\n }\n }\n\n return adapters;\n}\n\nfunction parseArgs(argv: string[]): CliOptions {\n const options: CliOptions = {\n registry: '',\n pm: [],\n test: [],\n concurrency: 1,\n timeout: 50000,\n verbose: false,\n };\n\n for (let i = 2; i < argv.length; i++) {\n const arg = argv[i];\n\n if (arg === '--registry' || arg === '-r') {\n options.registry = argv[++i];\n } else if (arg === '--pm') {\n options.pm!.push(argv[++i]);\n } else if (arg === '--test' || arg === '-t') {\n options.test!.push(argv[++i]);\n } else if (arg === '--concurrency' || arg === '-c') {\n options.concurrency = parseInt(argv[++i], 10);\n } else if (arg === '--timeout') {\n options.timeout = parseInt(argv[++i], 10);\n } else if (arg === '--token') {\n options.token = argv[++i];\n } else if (arg === '--verbose' || arg === '-v') {\n options.verbose = true;\n } else if (arg === '--help' || arg === '-h') {\n printHelp();\n process.exit(0);\n } else if (arg.startsWith('--registry=')) {\n options.registry = arg.split('=')[1];\n } else if (arg.startsWith('--pm=')) {\n options.pm!.push(arg.split('=')[1]);\n } else if (arg.startsWith('--test=')) {\n options.test!.push(arg.split('=')[1]);\n } else if (arg.startsWith('--token=')) {\n options.token = arg.split('=')[1];\n } else if (arg.startsWith('--timeout=')) {\n options.timeout = parseInt(arg.split('=')[1], 10);\n } else {\n console.error(`Unknown argument: ${arg}`);\n printHelp();\n process.exit(1);\n }\n }\n\n return options;\n}\n\nfunction printHelp(): void {\n console.log(`\n @verdaccio/e2e-cli - Run Verdaccio e2e tests against any running registry\n\n Usage:\n verdaccio-e2e --registry <url> [options]\n\n Required:\n -r, --registry <url> Verdaccio registry URL (e.g. http://localhost:4873)\n\n Options:\n --pm <name[@version]> Package manager to test (can be repeated)\n Supported: npm, pnpm, yarn-classic, yarn-modern (or yarn)\n Examples: --pm npm@10 --pm pnpm@9\n --pm yarn-modern@4\n --pm yarn-modern@3\n --pm yarn-classic\n --pm npm --pm pnpm (uses system version)\n Auto-installs the requested yarn version if needed\n Default: npm\n\n -t, --test <name> Filter tests by name (can be repeated)\n Available: publish, install, audit, info, deprecate,\n dist-tags, ping, search, star, unpublish\n Default: all supported by the PM\n\n --token <token> Auth token (skips user creation)\n --timeout <ms> Per-test timeout (default: 50000)\n -v, --verbose Enable debug output\n -h, --help Show this help\n `);\n}\n\nexport async function main(argv: string[] = process.argv): Promise<void> {\n const options = parseArgs(argv);\n\n if (!options.registry) {\n console.error('Error: --registry is required\\n');\n printHelp();\n process.exit(1);\n }\n\n // Run from a temp dir to isolate from the host project's packageManager, .yarnrc.yml, etc.\n const { createTempFolder } = await import('./utils/project');\n const runDir = await createTempFolder('e2e-run');\n process.chdir(runDir);\n\n if (options.verbose) {\n const { setVerbose } = await import('./utils/process');\n setVerbose(true);\n }\n\n // Ensure registry is reachable\n console.log(`Checking registry at ${options.registry}...`);\n const alive = await pingRegistry(options.registry);\n if (!alive) {\n console.error(`Error: Registry at ${options.registry} is not reachable`);\n process.exit(1);\n }\n console.log(`Registry is alive.`);\n\n // Get auth token\n let token = options.token;\n if (!token) {\n console.log('Creating test user...');\n const auth = await createUser(options.registry);\n token = auth.token;\n console.log(`User \"${auth.user}\" created.`);\n }\n\n // Build adapter list\n const adapters = parseAdapters(options.pm);\n console.log(`Adapters: ${adapters.map((a) => a.name).join(', ')}`);\n\n // Filter tests\n const tests = options.test && options.test.length > 0\n ? allTests.filter((t) => options.test!.includes(t.name))\n : allTests;\n\n console.log(`Tests: ${tests.map((t) => t.name).join(', ')}`);\n\n // Run\n const { exitCode } = await runAll(adapters, tests, options.registry, token, {\n timeout: options.timeout,\n concurrency: options.concurrency,\n testFilter: options.test,\n });\n\n process.exit(exitCode);\n}\n\n// Re-export for programmatic usage\nexport { allTests } from './tests';\nexport { createNpmAdapter, createPnpmAdapter, createYarnClassicAdapter, createYarnModernAdapter } from './adapters';\nexport { runAll, runSuite } from './runner';\nexport type { PackageManagerAdapter, TestDefinition, TestContext, CliOptions } from './types';\n"],"mappings":";;;;;;;;;;AAac,WAAW,oBAAoB;AAE7C,SAAS,YAAY,QAAsE;CAEzF,MAAM,QAAQ,OAAO,QAAQ,IAAI;AACjC,KAAI,UAAU,GACZ,QAAO;EAAE,MAAM,OAAO,MAAM,GAAG,MAAM,CAAC,aAAa;EAAE,SAAS,OAAO,MAAM,QAAQ,EAAE;EAAE;CAEzF,MAAM,QAAQ,OAAO,QAAQ,IAAI;AACjC,KAAI,UAAU,GACZ,QAAO;EAAE,MAAM,OAAO,MAAM,GAAG,MAAM,CAAC,aAAa;EAAE,SAAS,OAAO,MAAM,QAAQ,EAAE;EAAE;AAEzF,QAAO,EAAE,MAAM,OAAO,aAAa,EAAE;;AAGvC,SAAS,cAAc,WAA+C;AACpE,KAAI,CAAC,aAAa,UAAU,WAAW,EACrC,QAAO,CAAC,kBAAkB,CAAC;CAG7B,MAAM,WAAoC,EAAE;AAE5C,MAAK,MAAM,UAAU,WAAW;EAC9B,MAAM,EAAE,MAAM,SAAS,YAAY,YAAY,OAAO;AAEtD,MAAI,SA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