diff --git a/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/package.json b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/package.json new file mode 100644 index 0000000000..717838b50e --- /dev/null +++ b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-add-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/packages/app/package.json b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/packages/app/package.json new file mode 100644 index 0000000000..fd1f8f6386 --- /dev/null +++ b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/packages/app/package.json @@ -0,0 +1,3 @@ +{ + "name": "app" +} diff --git a/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/packages/utils/package.json b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/packages/utils/package.json new file mode 100644 index 0000000000..d063b255a7 --- /dev/null +++ b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/packages/utils/package.json @@ -0,0 +1,5 @@ +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true +} diff --git a/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/pnpm-workspace.yaml b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/pnpm-workspace.yaml new file mode 100644 index 0000000000..924b55f42e --- /dev/null +++ b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/snap.txt b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/snap.txt new file mode 100644 index 0000000000..72fd56640c --- /dev/null +++ b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/snap.txt @@ -0,0 +1,218 @@ +> vp add testnpm2 -D -w && cat package.json # should add package to workspace root +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm + +Packages: + ++ +Done in ms using pnpm v +{ + "name": "command-add-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "testnpm2": "^1.0.1" + } +} + +> vp add @vite-plus-test/utils --workspace && cat package.json # should add @vite-plus-test/utils to workspace root +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @vite-plus-test/utils workspace:* + +Already up to date +Done in ms using pnpm v +{ + "name": "command-add-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "testnpm2": "^1.0.1" + }, + "dependencies": { + "@vite-plus-test/utils": "workspace:*" + } +} + +> vp add testnpm2 test-vite-plus-install@1.0.0 --filter app && cat package.json packages/app/package.json packages/utils/package.json # should add packages to packages/app +Progress: resolved , reused , downloaded , added , done +. | +1 + +Done in ms using pnpm v +{ + "name": "command-add-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "testnpm2": "^1.0.1" + }, + "dependencies": { + "@vite-plus-test/utils": "workspace:*" + } +} +{ + "name": "app", + "dependencies": { + "test-vite-plus-install": "1.0.0", + "testnpm2": "^1.0.1" + } +} +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true +} + +> vp add @vite-plus-test/utils --workspace --filter app && cat package.json packages/app/package.json packages/utils/package.json # should add @vite-plus-test/utils to packages/app +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "command-add-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "testnpm2": "^1.0.1" + }, + "dependencies": { + "@vite-plus-test/utils": "workspace:*" + } +} +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "1.0.0", + "testnpm2": "^1.0.1" + } +} +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true +} + +> vp add -E testnpm2 test-vite-plus-install --filter "*" && cat package.json packages/app/package.json packages/utils/package.json # should add testnpm2 test-vite-plus-install to all packages except workspace root +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "command-add-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "testnpm2": "^1.0.1" + }, + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "1.0.0" + } +} +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "1.0.0", + "testnpm2": "^1.0.1" + } +} +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true, + "dependencies": { + "test-vite-plus-install": "1.0.0", + "testnpm2": "^1.0.1" + } +} + +> vp install test-vite-plus-package@1.0.0 --filter "*" --workspace-root --save-catalog && cat package.json packages/app/package.json packages/utils/package.json pnpm-workspace.yaml # should install packages alias for add command +VITE+ - The Unified Toolchain for the Web + +. | +1 + +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "command-add-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "testnpm2": "^1.0.1" + }, + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "1.0.0", + "test-vite-plus-package": "catalog:" + } +} +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "1.0.0", + "test-vite-plus-package": "catalog:", + "testnpm2": "^1.0.1" + } +} +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true, + "dependencies": { + "test-vite-plus-install": "1.0.0", + "test-vite-plus-package": "catalog:", + "testnpm2": "^1.0.1" + } +} +packages: + - packages/* +catalog: + test-vite-plus-package: + +> vp add --filter app test-vite-plus-package-optional --save-catalog-name v1 && cat packages/app/package.json pnpm-workspace.yaml # should add with save-catalog-name +Progress: resolved , reused , downloaded , added , done +. | +1 + +Done in ms using pnpm v +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "1.0.0", + "test-vite-plus-package": "catalog:", + "test-vite-plus-package-optional": "catalog:v1", + "testnpm2": "^1.0.1" + } +} +packages: + - packages/* +catalog: + test-vite-plus-package: +catalogs: + v1: + test-vite-plus-package-optional: ^1.0.0 + +> vp add --filter=./packages/utils test-vite-plus-package-optional -O --save-catalog-name v2 && cat packages/utils/package.json pnpm-workspace.yaml # should add other with save-catalog-name +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true, + "dependencies": { + "test-vite-plus-install": "1.0.0", + "test-vite-plus-package": "catalog:", + "testnpm2": "^1.0.1" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "catalog:v2" + } +} +packages: + - packages/* +catalog: + test-vite-plus-package: +catalogs: + v1: + test-vite-plus-package-optional: ^1.0.0 + v2: + test-vite-plus-package-optional: ^1.0.0 diff --git a/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/steps.json b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/steps.json new file mode 100644 index 0000000000..3400981d3e --- /dev/null +++ b/packages/cli/snap-tests-global/command-add-pnpm11-with-workspace/steps.json @@ -0,0 +1,13 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp add testnpm2 -D -w && cat package.json # should add package to workspace root", + "vp add @vite-plus-test/utils --workspace && cat package.json # should add @vite-plus-test/utils to workspace root", + "vp add testnpm2 test-vite-plus-install@1.0.0 --filter app && cat package.json packages/app/package.json packages/utils/package.json # should add packages to packages/app", + "vp add @vite-plus-test/utils --workspace --filter app && cat package.json packages/app/package.json packages/utils/package.json # should add @vite-plus-test/utils to packages/app", + "vp add -E testnpm2 test-vite-plus-install --filter \"*\" && cat package.json packages/app/package.json packages/utils/package.json # should add testnpm2 test-vite-plus-install to all packages except workspace root", + "vp install test-vite-plus-package@1.0.0 --filter \"*\" --workspace-root --save-catalog && cat package.json packages/app/package.json packages/utils/package.json pnpm-workspace.yaml # should install packages alias for add command", + "vp add --filter app test-vite-plus-package-optional --save-catalog-name v1 && cat packages/app/package.json pnpm-workspace.yaml # should add with save-catalog-name", + "vp add --filter=./packages/utils test-vite-plus-package-optional -O --save-catalog-name v2 && cat packages/utils/package.json pnpm-workspace.yaml # should add other with save-catalog-name" + ] +} diff --git a/packages/cli/snap-tests-global/command-add-pnpm11/package.json b/packages/cli/snap-tests-global/command-add-pnpm11/package.json new file mode 100644 index 0000000000..57a58beee2 --- /dev/null +++ b/packages/cli/snap-tests-global/command-add-pnpm11/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-add-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-add-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-add-pnpm11/snap.txt new file mode 100644 index 0000000000..134fa23ab2 --- /dev/null +++ b/packages/cli/snap-tests-global/command-add-pnpm11/snap.txt @@ -0,0 +1,158 @@ +> vp add --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp add [OPTIONS] ... [-- ...] + +Add packages to dependencies + +Arguments: + ... Packages to add + [PASS_THROUGH_ARGS]... Additional arguments to pass through to the package manager + +Options: + -P, --save-prod Save to `dependencies` (default) + -D, --save-dev Save to `devDependencies` + --save-peer Save to `peerDependencies` and `devDependencies` + -O, --save-optional Save to `optionalDependencies` + -E, --save-exact Save exact version rather than semver range + --save-catalog-name Save the new dependency to the specified catalog name + --save-catalog Save the new dependency to the default catalog + --allow-build A list of package names allowed to run postinstall + --filter Filter packages in monorepo (can be used multiple times) + -w, --workspace-root Add to workspace root + --workspace Only add if package exists in workspace (pnpm-specific) + -g, --global Install globally + --node Node.js version to use for global installation (only with -g) + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +[2]> vp add # should error because no packages specified +error: the following required arguments were not provided: + ... + +Usage: vp add ... [-- ...] + +For more information, try '--help'. + +> vp add testnpm2 -D -- --loglevel=verbose --verbose && cat package.json # should add package as dev dependencies +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm + +devDependencies: ++ testnpm2 + +Done in ms using pnpm v +{ + "name": "command-add-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "testnpm2": "^1.0.1" + } +} + +> vp add testnpm2 test-vite-plus-install --allow-build=test-vite-plus-install && cat package.json # should add packages to dependencies +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ test-vite-plus-install + +Done in ms using pnpm v +{ + "name": "command-add-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "testnpm2": "^1.0.1" + }, + "dependencies": { + "test-vite-plus-install": "^1.0.0" + } +} + +> vp install test-vite-plus-package@1.0.0 --save-peer && cat package.json # should install package alias for add +VITE+ - The Unified Toolchain for the Web + +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +peerDependencies: ++ test-vite-plus-package + +devDependencies: ++ test-vite-plus-package + +Done in ms using pnpm v +{ + "name": "command-add-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "test-vite-plus-package": "1.0.0", + "testnpm2": "^1.0.1" + }, + "dependencies": { + "test-vite-plus-install": "^1.0.0" + }, + "peerDependencies": { + "test-vite-plus-package": "1.0.0" + } +} + +> vp add test-vite-plus-package-optional -O && cat package.json # should add package as optional dependencies +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +optionalDependencies: ++ test-vite-plus-package-optional + +Done in ms using pnpm v +{ + "name": "command-add-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "test-vite-plus-package": "1.0.0", + "testnpm2": "^1.0.1" + }, + "dependencies": { + "test-vite-plus-install": "^1.0.0" + }, + "peerDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0" + } +} + +> vp add test-vite-plus-package-optional -- --loglevel=warn && cat package.json # support pass through arguments +{ + "name": "command-add-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "test-vite-plus-package": "1.0.0", + "testnpm2": "^1.0.1" + }, + "dependencies": { + "test-vite-plus-install": "^1.0.0" + }, + "peerDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0" + } +} diff --git a/packages/cli/snap-tests-global/command-add-pnpm11/steps.json b/packages/cli/snap-tests-global/command-add-pnpm11/steps.json new file mode 100644 index 0000000000..2c0868694e --- /dev/null +++ b/packages/cli/snap-tests-global/command-add-pnpm11/steps.json @@ -0,0 +1,12 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp add --help # should show help", + "vp add # should error because no packages specified", + "vp add testnpm2 -D -- --loglevel=verbose --verbose && cat package.json # should add package as dev dependencies", + "vp add testnpm2 test-vite-plus-install --allow-build=test-vite-plus-install && cat package.json # should add packages to dependencies", + "vp install test-vite-plus-package@1.0.0 --save-peer && cat package.json # should install package alias for add", + "vp add test-vite-plus-package-optional -O && cat package.json # should add package as optional dependencies", + "vp add test-vite-plus-package-optional -- --loglevel=warn && cat package.json # support pass through arguments" + ] +} diff --git a/packages/cli/snap-tests-global/command-cache-pnpm11/package.json b/packages/cli/snap-tests-global/command-cache-pnpm11/package.json new file mode 100644 index 0000000000..b684d85280 --- /dev/null +++ b/packages/cli/snap-tests-global/command-cache-pnpm11/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-cache-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-cache-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-cache-pnpm11/snap.txt new file mode 100644 index 0000000000..2916822b7f --- /dev/null +++ b/packages/cli/snap-tests-global/command-cache-pnpm11/snap.txt @@ -0,0 +1,19 @@ +> vp pm cache --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp pm cache [-- ...] + +Manage package cache + +Arguments: + Subcommand: dir, path, clean + [PASS_THROUGH_ARGS]... Additional arguments + +Options: + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp pm cache dir > /dev/null # should show cache directory (uses pnpm store path) +> vp pm cache path > /dev/null # should show cache path (alias for dir, uses pnpm store path) \ No newline at end of file diff --git a/packages/cli/snap-tests-global/command-cache-pnpm11/steps.json b/packages/cli/snap-tests-global/command-cache-pnpm11/steps.json new file mode 100644 index 0000000000..23198b09c4 --- /dev/null +++ b/packages/cli/snap-tests-global/command-cache-pnpm11/steps.json @@ -0,0 +1,7 @@ +{ + "commands": [ + "vp pm cache --help # should show help", + "vp pm cache dir > /dev/null # should show cache directory (uses pnpm store path)", + "vp pm cache path > /dev/null # should show cache path (alias for dir, uses pnpm store path)" + ] +} diff --git a/packages/cli/snap-tests-global/command-config-pnpm11/package.json b/packages/cli/snap-tests-global/command-config-pnpm11/package.json new file mode 100644 index 0000000000..9826c26709 --- /dev/null +++ b/packages/cli/snap-tests-global/command-config-pnpm11/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-config-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-config-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-config-pnpm11/snap.txt new file mode 100644 index 0000000000..b794c63f87 --- /dev/null +++ b/packages/cli/snap-tests-global/command-config-pnpm11/snap.txt @@ -0,0 +1,32 @@ +> vp pm config --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp pm config + +Manage package manager configuration + +Commands: + list List all configuration + get Get configuration value + set Set configuration value + delete Delete configuration key + +Options: + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp pm config list --location project > /dev/null # should list all project configuration +[1]> vp pm config set vite-plus-pm-config-test-key test-value --location project # should set config value in project scope + ERR_PNPM_CONFIG_SET_UNSUPPORTED_WORKSPACE_KEY  The key "vite-plus-pm-config-test-key" isn't supported by the workspace manifest + +Try "vitePlusPmConfigTestKey" + +> vp pm config get vite-plus-pm-config-test-key --location project # should get config value from project scope +undefined + +[1]> vp pm config delete vite-plus-pm-config-test-key --location project # should delete config key from project scope + ERR_PNPM_CONFIG_SET_UNSUPPORTED_WORKSPACE_KEY  The key "vite-plus-pm-config-test-key" isn't supported by the workspace manifest + +Try "vitePlusPmConfigTestKey" diff --git a/packages/cli/snap-tests-global/command-config-pnpm11/steps.json b/packages/cli/snap-tests-global/command-config-pnpm11/steps.json new file mode 100644 index 0000000000..cc7100f93a --- /dev/null +++ b/packages/cli/snap-tests-global/command-config-pnpm11/steps.json @@ -0,0 +1,9 @@ +{ + "commands": [ + "vp pm config --help # should show help", + "vp pm config list --location project > /dev/null # should list all project configuration", + "vp pm config set vite-plus-pm-config-test-key test-value --location project # should set config value in project scope", + "vp pm config get vite-plus-pm-config-test-key --location project # should get config value from project scope", + "vp pm config delete vite-plus-pm-config-test-key --location project # should delete config key from project scope" + ] +} diff --git a/packages/cli/snap-tests-global/command-dedupe-pnpm11/package.json b/packages/cli/snap-tests-global/command-dedupe-pnpm11/package.json new file mode 100644 index 0000000000..9bf14cac96 --- /dev/null +++ b/packages/cli/snap-tests-global/command-dedupe-pnpm11/package.json @@ -0,0 +1,14 @@ +{ + "name": "command-dedupe-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-dedupe-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-dedupe-pnpm11/snap.txt new file mode 100644 index 0000000000..0dc21cb125 --- /dev/null +++ b/packages/cli/snap-tests-global/command-dedupe-pnpm11/snap.txt @@ -0,0 +1,132 @@ +> vp dedupe --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp dedupe [OPTIONS] [-- ...] + +Deduplicate dependencies + +Arguments: + [PASS_THROUGH_ARGS]... Additional arguments to pass through to the package manager + +Options: + --check Check if deduplication would make changes + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp dedupe && cat package.json # should dedupe dependencies +Already up to date +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm +- testnpm2 + +optionalDependencies: +- test-vite-plus-package-optional + +devDependencies: +- test-vite-plus-package ++ test-vite-plus-package + +{ + "name": "command-dedupe-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@ +} + +> vp dedupe --check && cat package.json # should check if deduplication would make changes +Progress: resolved , reused , downloaded , added , done + +{ + "name": "command-dedupe-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@ +} + +> vp dedupe -- --loglevel=warn && cat package.json # support pass through arguments +{ + "name": "command-dedupe-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@ +} + +[1]> json-edit package.json '_.dependencies = {}' && cat package.json && vp dedupe --check # should check fails because no dependencies +{ + "name": "command-dedupe-pnpm11", + "version": "1.0.0", + "dependencies": {}, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@ +} +Progress: resolved , reused , downloaded , added , done + + ERR_PNPM_DEDUPE_CHECK_ISSUES  Dedupe --check found changes to the lockfile + +Importers +. +└── - testnpm2 + + +Packages +- testnpm2@ + +Run pnpm dedupe to apply the changes above. + + +> vp dedupe && cat package.json && vp dedupe --check # should dedupe fix the change by removing the dependencies +Packages: -1 +- +Progress: resolved , reused , downloaded , added , done + +dependencies: +- testnpm2 + +{ + "name": "command-dedupe-pnpm11", + "version": "1.0.0", + "dependencies": {}, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@ +} +Progress: resolved , reused , downloaded , added , done + diff --git a/packages/cli/snap-tests-global/command-dedupe-pnpm11/steps.json b/packages/cli/snap-tests-global/command-dedupe-pnpm11/steps.json new file mode 100644 index 0000000000..6b161dfdc9 --- /dev/null +++ b/packages/cli/snap-tests-global/command-dedupe-pnpm11/steps.json @@ -0,0 +1,10 @@ +{ + "commands": [ + "vp dedupe --help # should show help", + "vp dedupe && cat package.json # should dedupe dependencies", + "vp dedupe --check && cat package.json # should check if deduplication would make changes", + "vp dedupe -- --loglevel=warn && cat package.json # support pass through arguments", + "json-edit package.json '_.dependencies = {}' && cat package.json && vp dedupe --check # should check fails because no dependencies", + "vp dedupe && cat package.json && vp dedupe --check # should dedupe fix the change by removing the dependencies" + ] +} diff --git a/packages/cli/snap-tests-global/command-dlx-pnpm11/package.json b/packages/cli/snap-tests-global/command-dlx-pnpm11/package.json new file mode 100644 index 0000000000..4b839c1565 --- /dev/null +++ b/packages/cli/snap-tests-global/command-dlx-pnpm11/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-dlx-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-dlx-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-dlx-pnpm11/snap.txt new file mode 100644 index 0000000000..7a3c824f90 --- /dev/null +++ b/packages/cli/snap-tests-global/command-dlx-pnpm11/snap.txt @@ -0,0 +1,38 @@ +> vp dlx --help # should show help message +VITE+ - The Unified Toolchain for the Web + +Usage: vp dlx [OPTIONS] ... + +Execute a package binary without installing it + +Arguments: + ... Package to execute and arguments + +Options: + -p, --package Package(s) to install before running + -c, --shell-mode Execute within a shell environment + -s, --silent Suppress all output except the executed command's output + -h, --help Print help + +Documentation: https://viteplus.dev/guide/vpx + + +> vp dlx -s cowsay hello # should run cowsay with pnpm dlx + _______ +< hello > + ------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || + +> vp dlx -s cowsay@1.6.0 hello # should run specific version + _______ +< hello > + ------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || diff --git a/packages/cli/snap-tests-global/command-dlx-pnpm11/steps.json b/packages/cli/snap-tests-global/command-dlx-pnpm11/steps.json new file mode 100644 index 0000000000..8e2a8b772b --- /dev/null +++ b/packages/cli/snap-tests-global/command-dlx-pnpm11/steps.json @@ -0,0 +1,7 @@ +{ + "commands": [ + "vp dlx --help # should show help message", + "vp dlx -s cowsay hello # should run cowsay with pnpm dlx", + "vp dlx -s cowsay@1.6.0 hello # should run specific version" + ] +} diff --git a/packages/cli/snap-tests-global/command-link-pnpm11/package.json b/packages/cli/snap-tests-global/command-link-pnpm11/package.json new file mode 100644 index 0000000000..688c7754e8 --- /dev/null +++ b/packages/cli/snap-tests-global/command-link-pnpm11/package.json @@ -0,0 +1,8 @@ +{ + "name": "command-link-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "*" + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-link-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-link-pnpm11/snap.txt new file mode 100644 index 0000000000..7b2da1e3c7 --- /dev/null +++ b/packages/cli/snap-tests-global/command-link-pnpm11/snap.txt @@ -0,0 +1,461 @@ +> vp link -h # should show help message +VITE+ - The Unified Toolchain for the Web + +Usage: vp link [PACKAGE|DIR] [ARGS]... + +Link packages for local development + +Arguments: + [PACKAGE|DIR] Package name or directory to link + [ARGS]... Arguments to pass to package manager + +Options: + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp install # install initial dependencies +VITE+ - The Unified Toolchain for the Web + +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm +- testnpm2 * ++ testnpm2 + +Done in ms using pnpm v + +> mkdir -p ../test-lib-pnpm && echo '{"name": "testnpm2", "version": "1.0.0"}' > ../test-lib-pnpm/package.json # create test library +> vp link ../test-lib-pnpm && cat package.json pnpm-lock.yaml # should link local directory +Packages: -1 +- + +dependencies: +- testnpm2 ++ testnpm2 <- ../test-lib-pnpm + +{ + "name": "command-link-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "*" + }, + "packageManager": "pnpm@ +} +--- +lockfileVersion: '9.0' + +importers: + + .: + configDependencies: {} + packageManagerDependencies: + '@pnpm/exe': + specifier: + version: + pnpm: + specifier: + version: + +packages: + + '@pnpm/exe@ + resolution: {integrity: sha512- + hasBin: true + + '@pnpm/linux-arm64@ + resolution: {integrity: sha512- + cpu: [arm64] + os: [linux] + + '@pnpm/linux-x64@ + resolution: {integrity: sha512- + cpu: [x64] + os: [linux] + + '@pnpm/macos-arm64@ + resolution: {integrity: sha512- + cpu: [arm64] + os: [darwin] + + '@pnpm/macos-x64@ + resolution: {integrity: sha512- + cpu: [x64] + os: [darwin] + + '@pnpm/win-arm64@ + resolution: {integrity: sha512- + cpu: [arm64] + os: [win32] + + '@pnpm/win-x64@ + resolution: {integrity: sha512- + cpu: [x64] + os: [win32] + + '@reflink/reflink-darwin-arm64@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@reflink/reflink-darwin-x64@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@reflink/reflink-linux-arm64-gnu@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@reflink/reflink-linux-arm64-musl@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@reflink/reflink-linux-x64-gnu@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@reflink/reflink-linux-x64-musl@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@reflink/reflink-win32-arm64-msvc@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@reflink/reflink-win32-x64-msvc@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@reflink/reflink@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + + pnpm@ + resolution: {integrity: sha512- + engines: {node: '>=22.13'} + hasBin: true + +snapshots: + + '@pnpm/exe@ + dependencies: + '@reflink/reflink': + optionalDependencies: + '@pnpm/linux-arm64': + '@pnpm/linux-x64': + '@pnpm/macos-arm64': + '@pnpm/macos-x64': + '@pnpm/win-arm64': + '@pnpm/win-x64': + + '@pnpm/linux-arm64@ + optional: true + + '@pnpm/linux-x64@ + optional: true + + '@pnpm/macos-arm64@ + optional: true + + '@pnpm/macos-x64@ + optional: true + + '@pnpm/win-arm64@ + optional: true + + '@pnpm/win-x64@ + optional: true + + '@reflink/reflink-darwin-arm64@': + optional: true + + '@reflink/reflink-darwin-x64@': + optional: true + + '@reflink/reflink-linux-arm64-gnu@': + optional: true + + '@reflink/reflink-linux-arm64-musl@': + optional: true + + '@reflink/reflink-linux-x64-gnu@': + optional: true + + '@reflink/reflink-linux-x64-musl@': + optional: true + + '@reflink/reflink-win32-arm64-msvc@': + optional: true + + '@reflink/reflink-win32-x64-msvc@': + optional: true + + '@reflink/reflink@': + optionalDependencies: + '@reflink/reflink-darwin-arm64': + '@reflink/reflink-darwin-x64': + '@reflink/reflink-linux-arm64-gnu': + '@reflink/reflink-linux-arm64-musl': + '@reflink/reflink-linux-x64-gnu': + '@reflink/reflink-linux-x64-musl': + '@reflink/reflink-win32-arm64-msvc': + '@reflink/reflink-win32-x64-msvc': + + pnpm@ + +--- +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +overrides: + testnpm2: link:../test-lib-pnpm + +importers: + + .: + dependencies: + testnpm2: + specifier: link:../test-lib-pnpm + version: link:../test-lib-pnpm + +> vp ln ../test-lib-pnpm && cat package.json pnpm-lock.yaml # should work with ln alias +Lockfile is up to date, resolution step is skipped + +{ + "name": "command-link-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "*" + }, + "packageManager": "pnpm@ +} +--- +lockfileVersion: '9.0' + +importers: + + .: + configDependencies: {} + packageManagerDependencies: + '@pnpm/exe': + specifier: + version: + pnpm: + specifier: + version: + +packages: + + '@pnpm/exe@ + resolution: {integrity: sha512- + hasBin: true + + '@pnpm/linux-arm64@ + resolution: {integrity: sha512- + cpu: [arm64] + os: [linux] + + '@pnpm/linux-x64@ + resolution: {integrity: sha512- + cpu: [x64] + os: [linux] + + '@pnpm/macos-arm64@ + resolution: {integrity: sha512- + cpu: [arm64] + os: [darwin] + + '@pnpm/macos-x64@ + resolution: {integrity: sha512- + cpu: [x64] + os: [darwin] + + '@pnpm/win-arm64@ + resolution: {integrity: sha512- + cpu: [arm64] + os: [win32] + + '@pnpm/win-x64@ + resolution: {integrity: sha512- + cpu: [x64] + os: [win32] + + '@reflink/reflink-darwin-arm64@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@reflink/reflink-darwin-x64@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@reflink/reflink-linux-arm64-gnu@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@reflink/reflink-linux-arm64-musl@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@reflink/reflink-linux-x64-gnu@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@reflink/reflink-linux-x64-musl@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@reflink/reflink-win32-arm64-msvc@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@reflink/reflink-win32-x64-msvc@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@reflink/reflink@': + resolution: {integrity: sha512- + engines: {node: '>= 10'} + + pnpm@ + resolution: {integrity: sha512- + engines: {node: '>=22.13'} + hasBin: true + +snapshots: + + '@pnpm/exe@ + dependencies: + '@reflink/reflink': + optionalDependencies: + '@pnpm/linux-arm64': + '@pnpm/linux-x64': + '@pnpm/macos-arm64': + '@pnpm/macos-x64': + '@pnpm/win-arm64': + '@pnpm/win-x64': + + '@pnpm/linux-arm64@ + optional: true + + '@pnpm/linux-x64@ + optional: true + + '@pnpm/macos-arm64@ + optional: true + + '@pnpm/macos-x64@ + optional: true + + '@pnpm/win-arm64@ + optional: true + + '@pnpm/win-x64@ + optional: true + + '@reflink/reflink-darwin-arm64@': + optional: true + + '@reflink/reflink-darwin-x64@': + optional: true + + '@reflink/reflink-linux-arm64-gnu@': + optional: true + + '@reflink/reflink-linux-arm64-musl@': + optional: true + + '@reflink/reflink-linux-x64-gnu@': + optional: true + + '@reflink/reflink-linux-x64-musl@': + optional: true + + '@reflink/reflink-win32-arm64-msvc@': + optional: true + + '@reflink/reflink-win32-x64-msvc@': + optional: true + + '@reflink/reflink@': + optionalDependencies: + '@reflink/reflink-darwin-arm64': + '@reflink/reflink-darwin-x64': + '@reflink/reflink-linux-arm64-gnu': + '@reflink/reflink-linux-arm64-musl': + '@reflink/reflink-linux-x64-gnu': + '@reflink/reflink-linux-x64-musl': + '@reflink/reflink-win32-arm64-msvc': + '@reflink/reflink-win32-x64-msvc': + + pnpm@ + +--- +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +overrides: + testnpm2: link:../test-lib-pnpm + +importers: + + .: + dependencies: + testnpm2: + specifier: link:../test-lib-pnpm + version: link:../test-lib-pnpm + +[1]> vp unlink ../test-lib-pnpm && vp unlink testnpm2 && cat package.json pnpm-lock.yaml # should unlink the package +Already up to date + ERR_PNPM_LOCKFILE_CONFIG_MISMATCH  Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile + +Update your lockfile using "pnpm install --no-frozen-lockfile" diff --git a/packages/cli/snap-tests-global/command-link-pnpm11/steps.json b/packages/cli/snap-tests-global/command-link-pnpm11/steps.json new file mode 100644 index 0000000000..f56346977c --- /dev/null +++ b/packages/cli/snap-tests-global/command-link-pnpm11/steps.json @@ -0,0 +1,11 @@ +{ + "ignoredPlatforms": ["win32", "linux"], + "commands": [ + "vp link -h # should show help message", + "vp install # install initial dependencies", + "mkdir -p ../test-lib-pnpm && echo '{\"name\": \"testnpm2\", \"version\": \"1.0.0\"}' > ../test-lib-pnpm/package.json # create test library", + "vp link ../test-lib-pnpm && cat package.json pnpm-lock.yaml # should link local directory", + "vp ln ../test-lib-pnpm && cat package.json pnpm-lock.yaml # should work with ln alias", + "vp unlink ../test-lib-pnpm && vp unlink testnpm2 && cat package.json pnpm-lock.yaml # should unlink the package" + ] +} diff --git a/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/package.json b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/package.json new file mode 100644 index 0000000000..eb0cb8f603 --- /dev/null +++ b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-list-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/packages/app/package.json b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/packages/app/package.json new file mode 100644 index 0000000000..8431ea2929 --- /dev/null +++ b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/packages/app/package.json @@ -0,0 +1,10 @@ +{ + "name": "app", + "version": "1.0.0", + "dependencies": { + "@vite-plus-test/utils": "workspace:*" + }, + "peerDependencies": { + "test-vite-plus-package-optional": "1.0.0" + } +} diff --git a/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/packages/utils/package.json b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/packages/utils/package.json new file mode 100644 index 0000000000..8e54c93d99 --- /dev/null +++ b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/packages/utils/package.json @@ -0,0 +1,8 @@ +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true, + "dependencies": { + "testnpm2": "*" + } +} diff --git a/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/pnpm-workspace.yaml b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/pnpm-workspace.yaml new file mode 100644 index 0000000000..924b55f42e --- /dev/null +++ b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/snap.txt b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/snap.txt new file mode 100644 index 0000000000..2f66a6a8d8 --- /dev/null +++ b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/snap.txt @@ -0,0 +1,173 @@ +> vp install # should install packages first +VITE+ - The Unified Toolchain for the Web + +Scope: all workspace projects +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm + +Done in ms using pnpm v + +> vp pm list # should list current workspace root dependencies +Legend: production dependency, optional only, dev only + +app@ /packages/app +│ +│ dependencies: +├── @vite-plus-test/utils@link:../utils +└── test-vite-plus-package-optional@ + +@vite-plus-test/utils@ /packages/utils (PRIVATE) +│ +│ dependencies: +└── testnpm2@ + +3 packages in 3 projects + +> vp pm list --recursive # should list all packages in workspace recursively +Legend: production dependency, optional only, dev only + +app@ /packages/app +│ +│ dependencies: +├── @vite-plus-test/utils@link:../utils +└── test-vite-plus-package-optional@ + +@vite-plus-test/utils@ /packages/utils (PRIVATE) +│ +│ dependencies: +└── testnpm2@ + +3 packages in 3 projects + +> vp pm list --filter app # should list specific workspace package (uses --filter app list) +Legend: production dependency, optional only, dev only + +app@ /packages/app +│ +│ dependencies: +├── @vite-plus-test/utils@link:../utils +└── test-vite-plus-package-optional@ + +2 packages + +> vp pm list --filter app --filter @vite-plus-test/utils # should list multiple workspace packages +Legend: production dependency, optional only, dev only + +app@ /packages/app +│ +│ dependencies: +├── @vite-plus-test/utils@link:../utils +└── test-vite-plus-package-optional@ + +@vite-plus-test/utils@ /packages/utils (PRIVATE) +│ +│ dependencies: +└── testnpm2@ + +3 packages in 2 projects + +> vp pm list --recursive --json # should list all workspace packages in JSON format +[ + { + "name": "command-list-pnpm11-with-workspace", + "version": "1.0.0", + "path": "", + "private": false + }, + { + "name": "app", + "version": "1.0.0", + "path": "/packages/app", + "private": false, + "dependencies": { + "@vite-plus-test/utils": { + "from": "@vite-plus-test/utils", + "version": "link:../utils", + "path": "/packages/utils" + }, + "test-vite-plus-package-optional": { + "from": "test-vite-plus-package-optional", + "version": "1.0.0", + "resolved": "https://registry./test-vite-plus-package-optional/-/test-vite-plus-package-optional-1.0.0.tgz", + "path": "/node_modules/.pnpm/test-vite-plus-package-optional@/node_modules/test-vite-plus-package-optional" + } + } + }, + { + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "path": "/packages/utils", + "private": true, + "dependencies": { + "testnpm2": { + "from": "testnpm2", + "version": "1.0.1", + "resolved": "https://registry./testnpm2/-/testnpm2-1.0.1.tgz", + "path": "/node_modules/.pnpm/testnpm2@/node_modules/testnpm2" + } + } + } +] + +> vp pm list --recursive --depth 0 # should list workspace packages with depth limit +Legend: production dependency, optional only, dev only + +app@ /packages/app +│ +│ dependencies: +├── @vite-plus-test/utils@link:../utils +└── test-vite-plus-package-optional@ + +@vite-plus-test/utils@ /packages/utils (PRIVATE) +│ +│ dependencies: +└── testnpm2@ + +3 packages in 3 projects + +> vp pm list --recursive --only-projects # should list only workspace projects (pnpm-specific) +Legend: production dependency, optional only, dev only + +app@ /packages/app +│ +│ dependencies: +└── @vite-plus-test/utils@link:../utils + +1 package in 3 projects + +> vp pm list --recursive --exclude-peers # should exclude peer dependencies in workspace +Legend: production dependency, optional only, dev only + +app@ /packages/app +│ +│ dependencies: +├── @vite-plus-test/utils@link:../utils +└── test-vite-plus-package-optional@ + +@vite-plus-test/utils@ /packages/utils (PRIVATE) +│ +│ dependencies: +└── testnpm2@ + +3 packages in 3 projects + +> vp pm list --recursive --prod # should list production dependencies in workspace +Legend: production dependency, optional only, dev only + +app@ /packages/app +│ +│ dependencies: +├── @vite-plus-test/utils@link:../utils +└── test-vite-plus-package-optional@ + +@vite-plus-test/utils@ /packages/utils (PRIVATE) +│ +│ dependencies: +└── testnpm2@ + +3 packages in 3 projects diff --git a/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/steps.json b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/steps.json new file mode 100644 index 0000000000..01e66e8a54 --- /dev/null +++ b/packages/cli/snap-tests-global/command-list-pnpm11-with-workspace/steps.json @@ -0,0 +1,15 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp install # should install packages first", + "vp pm list # should list current workspace root dependencies", + "vp pm list --recursive # should list all packages in workspace recursively", + "vp pm list --filter app # should list specific workspace package (uses --filter app list)", + "vp pm list --filter app --filter @vite-plus-test/utils # should list multiple workspace packages", + "vp pm list --recursive --json # should list all workspace packages in JSON format", + "vp pm list --recursive --depth 0 # should list workspace packages with depth limit", + "vp pm list --recursive --only-projects # should list only workspace projects (pnpm-specific)", + "vp pm list --recursive --exclude-peers # should exclude peer dependencies in workspace", + "vp pm list --recursive --prod # should list production dependencies in workspace" + ] +} diff --git a/packages/cli/snap-tests-global/command-list-pnpm11/package.json b/packages/cli/snap-tests-global/command-list-pnpm11/package.json new file mode 100644 index 0000000000..aabe498f0c --- /dev/null +++ b/packages/cli/snap-tests-global/command-list-pnpm11/package.json @@ -0,0 +1,14 @@ +{ + "name": "command-list-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "peerDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-list-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-list-pnpm11/snap.txt new file mode 100644 index 0000000000..01c1c4e04b --- /dev/null +++ b/packages/cli/snap-tests-global/command-list-pnpm11/snap.txt @@ -0,0 +1,227 @@ +> vp install # should install packages first +VITE+ - The Unified Toolchain for the Web + +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm ++ test-vite-plus-package-optional +- testnpm2 + +peerDependencies: +- test-vite-plus-package-optional + +devDependencies: +- test-vite-plus-package ++ test-vite-plus-package + +Done in ms using pnpm v + +> vp pm list --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp pm list [OPTIONS] [PATTERN] [-- ...] + +List installed packages + +Arguments: + [PATTERN] Package pattern to filter + [PASS_THROUGH_ARGS]... Additional arguments + +Options: + --depth Maximum depth of dependency tree + --json Output in JSON format + --long Show extended information + --parseable Parseable output format + -P, --prod Only production dependencies + -D, --dev Only dev dependencies + --no-optional Exclude optional dependencies + --exclude-peers Exclude peer dependencies + --only-projects Show only project packages + --find-by Use a finder function + -r, --recursive List across all workspaces + --filter Filter packages in monorepo + -g, --global List global packages + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp pm list # should list installed packages +Legend: production dependency, optional only, dev only + +command-list-pnpm11@ +│ +│ dependencies: +├── test-vite-plus-package-optional@ +├── testnpm2@ +│ +│ devDependencies: +└── test-vite-plus-package@ + +3 packages + +> vp pm list testnpm2 # should list specific package +Legend: production dependency, optional only, dev only + +command-list-pnpm11@ +│ +│ dependencies: +└── testnpm2@ + +1 package + +> vp pm list --depth 0 # should list packages with depth limit +Legend: production dependency, optional only, dev only + +command-list-pnpm11@ +│ +│ dependencies: +├── test-vite-plus-package-optional@ +├── testnpm2@ +│ +│ devDependencies: +└── test-vite-plus-package@ + +3 packages + +> vp pm list --json # should list packages in JSON format +[ + { + "name": "command-list-pnpm11", + "version": "1.0.0", + "path": "", + "private": false, + "dependencies": { + "test-vite-plus-package-optional": { + "from": "test-vite-plus-package-optional", + "version": "1.0.0", + "resolved": "https://registry./test-vite-plus-package-optional/-/test-vite-plus-package-optional-1.0.0.tgz", + "path": "/node_modules/.pnpm/test-vite-plus-package-optional@/node_modules/test-vite-plus-package-optional" + }, + "testnpm2": { + "from": "testnpm2", + "version": "1.0.1", + "resolved": "https://registry./testnpm2/-/testnpm2-1.0.1.tgz", + "path": "/node_modules/.pnpm/testnpm2@/node_modules/testnpm2" + } + }, + "devDependencies": { + "test-vite-plus-package": { + "from": "test-vite-plus-package", + "version": "1.0.0", + "resolved": "https://registry./test-vite-plus-package/-/test-vite-plus-package-1.0.0.tgz", + "path": "/node_modules/.pnpm/test-vite-plus-package@/node_modules/test-vite-plus-package" + } + } + } +] + +> vp pm list --long # should list packages with extended info +Legend: production dependency, optional only, dev only + +command-list-pnpm11@ +│ +│ dependencies: +├── test-vite-plus-package-optional@ +│ just for snap-test +│ /node_modules/.pnpm/test-vite-plus-package-optional@/node_modules/test-vite-plus-package-optional +├── testnpm2@ +│ /node_modules/.pnpm/testnpm2@/node_modules/testnpm2 +│ +│ devDependencies: +└── test-vite-plus-package@ + just for snap-test + /node_modules/.pnpm/test-vite-plus-package@/node_modules/test-vite-plus-package + +3 packages + +> vp pm list --parseable # should list packages in parseable format + +/node_modules/.pnpm/test-vite-plus-package@/node_modules/test-vite-plus-package +/node_modules/.pnpm/test-vite-plus-package-optional@/node_modules/test-vite-plus-package-optional +/node_modules/.pnpm/testnpm2@/node_modules/testnpm2 + +> vp pm list --prod # should list production dependencies only +Legend: production dependency, optional only, dev only + +command-list-pnpm11@ +│ +│ dependencies: +├── test-vite-plus-package-optional@ +└── testnpm2@ + +2 packages + +> vp pm list --dev # should list development dependencies only +Legend: production dependency, optional only, dev only + +command-list-pnpm11@ +│ +│ devDependencies: +└── test-vite-plus-package@ + +1 package + +> vp pm list --no-optional # should exclude optional dependencies +Legend: production dependency, optional only, dev only + +command-list-pnpm11@ +│ +│ dependencies: +├── test-vite-plus-package-optional@ +├── testnpm2@ +│ +│ devDependencies: +└── test-vite-plus-package@ + +3 packages + +> vp pm list --exclude-peers # should exclude peer dependencies +Legend: production dependency, optional only, dev only + +command-list-pnpm11@ +│ +│ dependencies: +├── test-vite-plus-package-optional@ +├── testnpm2@ +│ +│ devDependencies: +└── test-vite-plus-package@ + +3 packages + +> vp pm list --only-projects # should list only workspace projects (pnpm-specific) +[1]> vp pm list --find-by customFinder # should use custom finder (pnpm-specific) + ERR_PNPM_FINDER_NOT_FOUND  No finder with name customFinder is found + +> vp pm list --recursive # should list packages recursively in workspace +Legend: production dependency, optional only, dev only + +command-list-pnpm11@ +│ +│ dependencies: +├── test-vite-plus-package-optional@ +├── testnpm2@ +│ +│ devDependencies: +└── test-vite-plus-package@ + +3 packages + +> vp pm list -- --loglevel=warn # should support pass through arguments +Legend: production dependency, optional only, dev only + +command-list-pnpm11@ +│ +│ dependencies: +├── test-vite-plus-package-optional@ +├── testnpm2@ +│ +│ devDependencies: +└── test-vite-plus-package@ + +3 packages diff --git a/packages/cli/snap-tests-global/command-list-pnpm11/steps.json b/packages/cli/snap-tests-global/command-list-pnpm11/steps.json new file mode 100644 index 0000000000..5bde08798f --- /dev/null +++ b/packages/cli/snap-tests-global/command-list-pnpm11/steps.json @@ -0,0 +1,21 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp install # should install packages first", + "vp pm list --help # should show help", + "vp pm list # should list installed packages", + "vp pm list testnpm2 # should list specific package", + "vp pm list --depth 0 # should list packages with depth limit", + "vp pm list --json # should list packages in JSON format", + "vp pm list --long # should list packages with extended info", + "vp pm list --parseable # should list packages in parseable format", + "vp pm list --prod # should list production dependencies only", + "vp pm list --dev # should list development dependencies only", + "vp pm list --no-optional # should exclude optional dependencies", + "vp pm list --exclude-peers # should exclude peer dependencies", + "vp pm list --only-projects # should list only workspace projects (pnpm-specific)", + "vp pm list --find-by customFinder # should use custom finder (pnpm-specific)", + "vp pm list --recursive # should list packages recursively in workspace", + "vp pm list -- --loglevel=warn # should support pass through arguments" + ] +} diff --git a/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/package.json b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/package.json new file mode 100644 index 0000000000..0262c85219 --- /dev/null +++ b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/package.json @@ -0,0 +1,8 @@ +{ + "name": "command-outdated-pnpm11-with-workspace", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.0" + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/packages/app/package.json b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/packages/app/package.json new file mode 100644 index 0000000000..9cab9ad683 --- /dev/null +++ b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/packages/app/package.json @@ -0,0 +1,14 @@ +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "1.0.0", + "testnpm2": "1.0.0" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-other-optional": "1.0.0" + } +} diff --git a/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/packages/utils/package.json b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/packages/utils/package.json new file mode 100644 index 0000000000..1825862795 --- /dev/null +++ b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/packages/utils/package.json @@ -0,0 +1,7 @@ +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.0" + } +} diff --git a/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/pnpm-workspace.yaml b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/pnpm-workspace.yaml new file mode 100644 index 0000000000..924b55f42e --- /dev/null +++ b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/snap.txt b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/snap.txt new file mode 100644 index 0000000000..af135a39eb --- /dev/null +++ b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/snap.txt @@ -0,0 +1,79 @@ +> vp install +VITE+ - The Unified Toolchain for the Web + +Scope: all workspace projects +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm +- testnpm2 ++ testnpm2 (1.0.1 is available) + +Done in ms using pnpm v + +[1]> vp outdated testnpm2 -w # should outdated in workspace root +┌──────────┬─────────┬────────┐ +│ Package │ Current │ Latest │ +├──────────┼─────────┼────────┤ +│ testnpm2 │ │ +└──────────┴─────────┴────────┘ + +[1]> vp outdated testnpm2 --filter app # should outdated in specific package +┌──────────┬─────────┬────────┬────────────┐ +│ Package │ Current │ Latest │ Dependents │ +├──────────┼─────────┼────────┼────────────┤ +│ testnpm2 │ │ app │ +└──────────┴─────────┴────────┴────────────┘ + +> vp outdated -D --filter app # should outdated dev dependencies in app +[1]> vp outdated --filter "*" --format json # should outdated in all packages +{ + "testnpm2": { + "current": "1.0.0", + "latest": "1.0.1", + "wanted": "1.0.0", + "isDeprecated": false, + "dependencyType": "dependencies", + "dependentPackages": [ + { + "name": "command-outdated-pnpm11-with-workspace", + "location": "" + }, + { + "name": "app", + "location": "/packages/app" + }, + { + "name": "@vite-plus-test/utils", + "location": "/packages/utils" + } + ] + }, + "test-vite-plus-other-optional": { + "current": "1.0.0", + "latest": "1.1.0", + "wanted": "1.0.0", + "isDeprecated": false, + "dependencyType": "optionalDependencies", + "dependentPackages": [ + { + "name": "app", + "location": "/packages/app" + } + ] + } +} + +[1]> vp outdated -r # should outdated recursively +┌──────────────────────────────────────────┬─────────┬────────┬────────────────────────────────┐ +│ Package │ Current │ Latest │ Dependents │ +├──────────────────────────────────────────┼─────────┼────────┼────────────────────────────────┤ +│ testnpm2 │ │ @vite-plus-test/utils, app, │ +│ │ │ │ command-outdated-pnpm11-with- │ +│ │ │ │ workspace │ +├──────────────────────────────────────────┼─────────┼────────┼────────────────────────────────┤ +│ test-vite-plus-other-optional (optional) │ │ app │ +└──────────────────────────────────────────┴─────────┴────────┴────────────────────────────────┘ diff --git a/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/steps.json b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/steps.json new file mode 100644 index 0000000000..49be7120e4 --- /dev/null +++ b/packages/cli/snap-tests-global/command-outdated-pnpm11-with-workspace/steps.json @@ -0,0 +1,11 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp install", + "vp outdated testnpm2 -w # should outdated in workspace root", + "vp outdated testnpm2 --filter app # should outdated in specific package", + "vp outdated -D --filter app # should outdated dev dependencies in app", + "vp outdated --filter \"*\" --format json # should outdated in all packages", + "vp outdated -r # should outdated recursively" + ] +} diff --git a/packages/cli/snap-tests-global/command-outdated-pnpm11/package.json b/packages/cli/snap-tests-global/command-outdated-pnpm11/package.json new file mode 100644 index 0000000000..39f1d55248 --- /dev/null +++ b/packages/cli/snap-tests-global/command-outdated-pnpm11/package.json @@ -0,0 +1,14 @@ +{ + "name": "command-outdated-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.0" + }, + "devDependencies": { + "test-vite-plus-top-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-other-optional": "1.0.0" + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-outdated-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-outdated-pnpm11/snap.txt new file mode 100644 index 0000000000..2a2c547506 --- /dev/null +++ b/packages/cli/snap-tests-global/command-outdated-pnpm11/snap.txt @@ -0,0 +1,183 @@ +> vp outdated --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp outdated [OPTIONS] [PACKAGES]... [-- ...] + +Check for outdated packages + +Arguments: + [PACKAGES]... Package name(s) to check + [PASS_THROUGH_ARGS]... Additional arguments to pass through to the package manager + +Options: + --long Show extended information + --format Output format: table (default), list, or json + -r, --recursive Check recursively across all workspaces + --filter Filter packages in monorepo + -w, --workspace-root Include workspace root + -P, --prod Only production and optional dependencies + -D, --dev Only dev dependencies + --no-optional Exclude optional dependencies + --compatible Only show compatible versions + --sort-by Sort results by field + -g, --global Check globally installed packages + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp install # should install packages first +VITE+ - The Unified Toolchain for the Web + +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm +- testnpm2 + +optionalDependencies: +- test-vite-plus-other-optional + +devDependencies: +- test-vite-plus-top-package ++ test-vite-plus-top-package (1.1.0 is available) + +Done in ms using pnpm v + +[1]> vp outdated testnpm2 # should outdated package +┌──────────┬─────────┬────────┐ +│ Package │ Current │ Latest │ +├──────────┼─────────┼────────┤ +│ testnpm2 │ │ +└──────────┴─────────┴────────┘ + +[1]> vp outdated test-vite* # should outdated with one glob pattern +┌──────────────────────────────────────────┬─────────┬────────┐ +│ Package │ Current │ Latest │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-other-optional (optional) │ │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-top-package (dev) │ │ +└──────────────────────────────────────────┴─────────┴────────┘ + +[1]> vp outdated test-vite* '*npm*' # should outdated with multiple glob patterns +┌──────────────────────────────────────────┬─────────┬────────┐ +│ Package │ Current │ Latest │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ testnpm2 │ │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-other-optional (optional) │ │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-top-package (dev) │ │ +└──────────────────────────────────────────┴─────────┴────────┘ + +[1]> vp outdated --format json # should support json output +{ + "testnpm2": { + "current": "1.0.0", + "latest": "1.0.1", + "wanted": "1.0.0", + "isDeprecated": false, + "dependencyType": "dependencies" + }, + "test-vite-plus-other-optional": { + "current": "1.0.0", + "latest": "1.1.0", + "wanted": "1.0.0", + "isDeprecated": false, + "dependencyType": "optionalDependencies" + }, + "test-vite-plus-top-package": { + "current": "1.0.0", + "latest": "1.1.0", + "wanted": "1.0.0", + "isDeprecated": false, + "dependencyType": "devDependencies" + } +} + +[1]> vp outdated --format list # should support list output +testnpm2 + => + +test-vite-plus-other-optional (optional) + => + +test-vite-plus-top-package (dev) + => + +[1]> vp outdated --format table # should support table output +┌──────────────────────────────────────────┬─────────┬────────┐ +│ Package │ Current │ Latest │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ testnpm2 │ │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-other-optional (optional) │ │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-top-package (dev) │ │ +└──────────────────────────────────────────┴─────────┴────────┘ + +[1]> vp outdated testnpm2 --long --format list # should support --long +testnpm2 + => + +[1]> vp outdated -r # should support recursive output +┌──────────────────────────────────────────┬─────────┬────────┬─────────────────────────┐ +│ Package │ Current │ Latest │ Dependents │ +├──────────────────────────────────────────┼─────────┼────────┼─────────────────────────┤ +│ testnpm2 │ │ command-outdated-pnpm11 │ +├──────────────────────────────────────────┼─────────┼────────┼─────────────────────────┤ +│ test-vite-plus-other-optional (optional) │ │ command-outdated-pnpm11 │ +├──────────────────────────────────────────┼─────────┼────────┼─────────────────────────┤ +│ test-vite-plus-top-package (dev) │ │ command-outdated-pnpm11 │ +└──────────────────────────────────────────┴─────────┴────────┴─────────────────────────┘ + +[1]> vp outdated -P # should support prod output +┌──────────────────────────────────────────┬─────────┬────────┐ +│ Package │ Current │ Latest │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ testnpm2 │ │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-other-optional (optional) │ │ +└──────────────────────────────────────────┴─────────┴────────┘ + +[1]> vp outdated -D # should support dev output +┌──────────────────────────────────┬─────────┬────────┐ +│ Package │ Current │ Latest │ +├──────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-top-package (dev) │ │ +└──────────────────────────────────┴─────────┴────────┘ + +[1]> vp outdated --no-optional # should support no-optional output +┌──────────────────────────────────┬─────────┬────────┐ +│ Package │ Current │ Latest │ +├──────────────────────────────────┼─────────┼────────┤ +│ testnpm2 │ │ +├──────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-top-package (dev) │ │ +└──────────────────────────────────┴─────────┴────────┘ + +> vp outdated --compatible # should compatible output nothing +[1]> json-edit package.json '_.optionalDependencies["test-vite-plus-other-optional"] = "^1.0.0"' && vp outdated --compatible # should support compatible output with optional dependencies +┌──────────────────────────────────────────┬─────────┬────────┐ +│ Package │ Current │ Latest │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-other-optional (optional) │ │ +└──────────────────────────────────────────┴─────────┴────────┘ + +[1]> vp outdated --sort-by name # should support sort-by output +┌──────────────────────────────────────────┬─────────┬────────┐ +│ Package │ Current │ Latest │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-other-optional (optional) │ │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ test-vite-plus-top-package (dev) │ │ +├──────────────────────────────────────────┼─────────┼────────┤ +│ testnpm2 │ │ +└──────────────────────────────────────────┴─────────┴────────┘ + +> vp outdated testnpm2 -g --format json # should support global output +{} diff --git a/packages/cli/snap-tests-global/command-outdated-pnpm11/steps.json b/packages/cli/snap-tests-global/command-outdated-pnpm11/steps.json new file mode 100644 index 0000000000..b1e9e87cf3 --- /dev/null +++ b/packages/cli/snap-tests-global/command-outdated-pnpm11/steps.json @@ -0,0 +1,22 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp outdated --help # should show help", + "vp install # should install packages first", + "vp outdated testnpm2 # should outdated package", + "vp outdated test-vite* # should outdated with one glob pattern", + "vp outdated test-vite* '*npm*' # should outdated with multiple glob patterns", + "vp outdated --format json # should support json output", + "vp outdated --format list # should support list output", + "vp outdated --format table # should support table output", + "vp outdated testnpm2 --long --format list # should support --long", + "vp outdated -r # should support recursive output", + "vp outdated -P # should support prod output", + "vp outdated -D # should support dev output", + "vp outdated --no-optional # should support no-optional output", + "vp outdated --compatible # should compatible output nothing", + "json-edit package.json '_.optionalDependencies[\"test-vite-plus-other-optional\"] = \"^1.0.0\"' && vp outdated --compatible # should support compatible output with optional dependencies", + "vp outdated --sort-by name # should support sort-by output", + "vp outdated testnpm2 -g --format json # should support global output" + ] +} diff --git a/packages/cli/snap-tests-global/command-owner-pnpm11/package.json b/packages/cli/snap-tests-global/command-owner-pnpm11/package.json new file mode 100644 index 0000000000..30594b04e4 --- /dev/null +++ b/packages/cli/snap-tests-global/command-owner-pnpm11/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-owner-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-owner-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-owner-pnpm11/snap.txt new file mode 100644 index 0000000000..a8f452c954 --- /dev/null +++ b/packages/cli/snap-tests-global/command-owner-pnpm11/snap.txt @@ -0,0 +1,20 @@ +> vp pm owner --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp pm owner + +Manage package owners + +Commands: + list List package owners [aliases: ls] + add Add package owner + rm Remove package owner + +Options: + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp pm owner list testnpm2 # should list package owners (uses npm owner) +fengmk2 diff --git a/packages/cli/snap-tests-global/command-owner-pnpm11/steps.json b/packages/cli/snap-tests-global/command-owner-pnpm11/steps.json new file mode 100644 index 0000000000..e5e626f011 --- /dev/null +++ b/packages/cli/snap-tests-global/command-owner-pnpm11/steps.json @@ -0,0 +1,6 @@ +{ + "commands": [ + "vp pm owner --help # should show help", + "vp pm owner list testnpm2 # should list package owners (uses npm owner)" + ] +} diff --git a/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/package.json b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/package.json new file mode 100644 index 0000000000..d760df719e --- /dev/null +++ b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-pack-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/packages/app/package.json b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/packages/app/package.json new file mode 100644 index 0000000000..33b9c5952a --- /dev/null +++ b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/packages/app/package.json @@ -0,0 +1,4 @@ +{ + "name": "app", + "version": "1.0.0" +} diff --git a/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/packages/utils/package.json b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/packages/utils/package.json new file mode 100644 index 0000000000..d063b255a7 --- /dev/null +++ b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/packages/utils/package.json @@ -0,0 +1,5 @@ +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true +} diff --git a/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/pnpm-workspace.yaml b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/pnpm-workspace.yaml new file mode 100644 index 0000000000..924b55f42e --- /dev/null +++ b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/snap.txt b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/snap.txt new file mode 100644 index 0000000000..0a566d8d59 --- /dev/null +++ b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/snap.txt @@ -0,0 +1,184 @@ +> vp pm pack && rm -rf *.tgz # should pack current workspace root +package: command-pack-pnpm11-with-workspace@ +Tarball Contents +output.log +package.json +packages/app/package.json +packages/utils/package.json +pnpm-workspace.yaml +steps.json +Tarball Details +command-pack-pnpm11-with-workspace-1.0.0.tgz + +> vp pm pack --recursive --json > out.json && tool json-sort out.json '_.name' && cat out.json && rm -rf *.tgz # should pack all packages in workspace +[ + { + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "filename": "/vite-plus-test-utils-1.0.0.tgz", + "files": [ + { + "path": "package.json" + } + ] + }, + { + "name": "app", + "version": "1.0.0", + "filename": "/app-1.0.0.tgz", + "files": [ + { + "path": "package.json" + } + ] + }, + { + "name": "command-pack-pnpm11-with-workspace", + "version": "1.0.0", + "filename": "command-pack-pnpm11-with-workspace-1.0.0.tgz", + "files": [ + { + "path": "command-pack-pnpm11-with-workspace-1.0.0.tgz" + }, + { + "path": "out.json" + }, + { + "path": "output.log" + }, + { + "path": "package.json" + }, + { + "path": "packages/app/package.json" + }, + { + "path": "packages/utils/package.json" + }, + { + "path": "pnpm-workspace.yaml" + }, + { + "path": "steps.json" + } + ] + } +] + +> vp pm pack --filter app && rm -rf *.tgz # should pack specific package (uses --filter app pack) +package: app@ +Tarball Contents +package.json +Tarball Details +/app-1.0.0.tgz + +> vp pm pack --filter app --filter @vite-plus-test/utils --json > out.json && tool json-sort out.json '_.name' && cat out.json && rm -rf *.tgz # should pack multiple packages +[ + { + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "filename": "/vite-plus-test-utils-1.0.0.tgz", + "files": [ + { + "path": "package.json" + } + ] + }, + { + "name": "app", + "version": "1.0.0", + "filename": "/app-1.0.0.tgz", + "files": [ + { + "path": "package.json" + } + ] + } +] + +> vp pm pack --out ./dist/package.tgz && rm -rf ./dist # should pack with output file +package: command-pack-pnpm11-with-workspace@ +Tarball Contents +app-1.0.0.tgz +command-pack-pnpm11-with-workspace-1.0.0.tgz +out.json +output.log +package.json +packages/app/package.json +packages/utils/package.json +pnpm-workspace.yaml +steps.json +vite-plus-test-utils-1.0.0.tgz +Tarball Details +/dist/package.tgz + +> vp pm pack --pack-destination ./dist && rm -rf ./dist # should pack with destination +package: command-pack-pnpm11-with-workspace@ +Tarball Contents +app-1.0.0.tgz +command-pack-pnpm11-with-workspace-1.0.0.tgz +out.json +output.log +package.json +packages/app/package.json +packages/utils/package.json +pnpm-workspace.yaml +steps.json +vite-plus-test-utils-1.0.0.tgz +Tarball Details +/dist/command-pack-pnpm11-with-workspace-1.0.0.tgz + +> vp pm pack --pack-gzip-level 9 && rm -rf *.tgz # should pack with gzip compression level +package: command-pack-pnpm11-with-workspace@ +Tarball Contents +app-1.0.0.tgz +command-pack-pnpm11-with-workspace-1.0.0.tgz +out.json +output.log +package.json +packages/app/package.json +packages/utils/package.json +pnpm-workspace.yaml +steps.json +vite-plus-test-utils-1.0.0.tgz +Tarball Details +command-pack-pnpm11-with-workspace-1.0.0.tgz + +> vp pm pack --json --out 'foo-%s-%v.tgz' && rm -rf *.tgz # should pack with json output +{ + "name": "command-pack-pnpm11-with-workspace", + "version": "1.0.0", + "filename": "foo-command-pack-pnpm11-with-workspace-1.0.0.tgz", + "files": [ + { + "path": "app-1.0.0.tgz" + }, + { + "path": "command-pack-pnpm11-with-workspace-1.0.0.tgz" + }, + { + "path": "out.json" + }, + { + "path": "output.log" + }, + { + "path": "package.json" + }, + { + "path": "packages/app/package.json" + }, + { + "path": "packages/utils/package.json" + }, + { + "path": "pnpm-workspace.yaml" + }, + { + "path": "steps.json" + }, + { + "path": "vite-plus-test-utils-1.0.0.tgz" + } + ] +} diff --git a/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/steps.json b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/steps.json new file mode 100644 index 0000000000..7c6dc4b414 --- /dev/null +++ b/packages/cli/snap-tests-global/command-pack-pnpm11-with-workspace/steps.json @@ -0,0 +1,13 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp pm pack && rm -rf *.tgz # should pack current workspace root", + "vp pm pack --recursive --json > out.json && tool json-sort out.json '_.name' && cat out.json && rm -rf *.tgz # should pack all packages in workspace", + "vp pm pack --filter app && rm -rf *.tgz # should pack specific package (uses --filter app pack)", + "vp pm pack --filter app --filter @vite-plus-test/utils --json > out.json && tool json-sort out.json '_.name' && cat out.json && rm -rf *.tgz # should pack multiple packages", + "vp pm pack --out ./dist/package.tgz && rm -rf ./dist # should pack with output file", + "vp pm pack --pack-destination ./dist && rm -rf ./dist # should pack with destination", + "vp pm pack --pack-gzip-level 9 && rm -rf *.tgz # should pack with gzip compression level", + "vp pm pack --json --out 'foo-%s-%v.tgz' && rm -rf *.tgz # should pack with json output" + ] +} diff --git a/packages/cli/snap-tests-global/command-pack-pnpm11/package.json b/packages/cli/snap-tests-global/command-pack-pnpm11/package.json new file mode 100644 index 0000000000..3de43e86f1 --- /dev/null +++ b/packages/cli/snap-tests-global/command-pack-pnpm11/package.json @@ -0,0 +1,11 @@ +{ + "name": "command-pack-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-pack-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-pack-pnpm11/snap.txt new file mode 100644 index 0000000000..dc454b9b63 --- /dev/null +++ b/packages/cli/snap-tests-global/command-pack-pnpm11/snap.txt @@ -0,0 +1,102 @@ +> vp pm pack --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp pm pack [OPTIONS] [-- ...] + +Create a tarball of the package + +Arguments: + [PASS_THROUGH_ARGS]... Additional arguments + +Options: + -r, --recursive Pack all workspace packages + --filter Filter packages to pack + --out Output path for the tarball + --pack-destination Directory where the tarball will be saved + --pack-gzip-level Gzip compression level (0-9) + --json Output in JSON format + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp pm pack && rm -rf *.tgz # should pack current package +package: command-pack-pnpm11@ +Tarball Contents +output.log +package.json +steps.json +Tarball Details +command-pack-pnpm11-1.0.0.tgz + +> vp pm pack --out ./dist/package.tgz && rm -rf ./dist # should pack with output file +package: command-pack-pnpm11@ +Tarball Contents +command-pack-pnpm11-1.0.0.tgz +output.log +package.json +steps.json +Tarball Details +/dist/package.tgz + +> vp pm pack --pack-destination ./dist && rm -rf ./dist # should pack with destination +package: command-pack-pnpm11@ +Tarball Contents +command-pack-pnpm11-1.0.0.tgz +output.log +package.json +steps.json +Tarball Details +/dist/command-pack-pnpm11-1.0.0.tgz + +> vp pm pack --json --pack-gzip-level 9 && rm -rf *.tgz # should pack with gzip compression level +{ + "name": "command-pack-pnpm11", + "version": "1.0.0", + "filename": "command-pack-pnpm11-1.0.0.tgz", + "files": [ + { + "path": "command-pack-pnpm11-1.0.0.tgz" + }, + { + "path": "output.log" + }, + { + "path": "package.json" + }, + { + "path": "steps.json" + } + ] +} + +> vp pm pack --json && rm -rf *.tgz # should pack with json output +{ + "name": "command-pack-pnpm11", + "version": "1.0.0", + "filename": "command-pack-pnpm11-1.0.0.tgz", + "files": [ + { + "path": "command-pack-pnpm11-1.0.0.tgz" + }, + { + "path": "output.log" + }, + { + "path": "package.json" + }, + { + "path": "steps.json" + } + ] +} + +> vp pm pack -- --loglevel=warn && rm -rf *.tgz # should support pass through arguments +package: command-pack-pnpm11@ +Tarball Contents +command-pack-pnpm11-1.0.0.tgz +output.log +package.json +steps.json +Tarball Details +command-pack-pnpm11-1.0.0.tgz diff --git a/packages/cli/snap-tests-global/command-pack-pnpm11/steps.json b/packages/cli/snap-tests-global/command-pack-pnpm11/steps.json new file mode 100644 index 0000000000..40db7dd3ea --- /dev/null +++ b/packages/cli/snap-tests-global/command-pack-pnpm11/steps.json @@ -0,0 +1,12 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp pm pack --help # should show help", + "vp pm pack && rm -rf *.tgz # should pack current package", + "vp pm pack --out ./dist/package.tgz && rm -rf ./dist # should pack with output file", + "vp pm pack --pack-destination ./dist && rm -rf ./dist # should pack with destination", + "vp pm pack --json --pack-gzip-level 9 && rm -rf *.tgz # should pack with gzip compression level", + "vp pm pack --json && rm -rf *.tgz # should pack with json output", + "vp pm pack -- --loglevel=warn && rm -rf *.tgz # should support pass through arguments" + ] +} diff --git a/packages/cli/snap-tests-global/command-prune-pnpm11/package.json b/packages/cli/snap-tests-global/command-prune-pnpm11/package.json new file mode 100644 index 0000000000..9b43094fea --- /dev/null +++ b/packages/cli/snap-tests-global/command-prune-pnpm11/package.json @@ -0,0 +1,14 @@ +{ + "name": "command-prune-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-prune-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-prune-pnpm11/snap.txt new file mode 100644 index 0000000000..b06e343a20 --- /dev/null +++ b/packages/cli/snap-tests-global/command-prune-pnpm11/snap.txt @@ -0,0 +1,146 @@ +> vp install # should install packages first +VITE+ - The Unified Toolchain for the Web + +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm +- testnpm2 + +optionalDependencies: +- test-vite-plus-package-optional + +devDependencies: +- test-vite-plus-package ++ test-vite-plus-package + +Done in ms using pnpm v + +> vp pm prune --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp pm prune [OPTIONS] [-- ...] + +Remove unnecessary packages + +Arguments: + [PASS_THROUGH_ARGS]... Additional arguments + +Options: + --prod Remove devDependencies + --no-optional Remove optional dependencies + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp pm prune && cat package.json # should prune extraneous dependencies +Already up to date +{ + "name": "command-prune-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@ +} + +> vp pm prune --prod && cat package.json # should prune dev dependencies +Lockfile is up to date, resolution step is skipped +Packages: -1 +- + +devDependencies: +- test-vite-plus-package + +{ + "name": "command-prune-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@ +} + +> vp pm prune --no-optional && cat package.json # should prune optional dependencies +Lockfile is up to date, resolution step is skipped +Packages: -1 +- +Progress: resolved , reused , downloaded , added , done + +optionalDependencies: +- test-vite-plus-package-optional + +devDependencies: ++ test-vite-plus-package + +{ + "name": "command-prune-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@ +} + +> vp pm prune --prod --no-optional && cat package.json # should prune both dev and optional dependencies +Lockfile is up to date, resolution step is skipped +Packages: -1 +- + +optionalDependencies: skipped + +devDependencies: +- test-vite-plus-package + +{ + "name": "command-prune-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@ +} + +> vp pm prune -- --loglevel=warn && cat package.json # should support pass through arguments +{ + "name": "command-prune-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@ +} diff --git a/packages/cli/snap-tests-global/command-prune-pnpm11/steps.json b/packages/cli/snap-tests-global/command-prune-pnpm11/steps.json new file mode 100644 index 0000000000..77481edd61 --- /dev/null +++ b/packages/cli/snap-tests-global/command-prune-pnpm11/steps.json @@ -0,0 +1,11 @@ +{ + "commands": [ + "vp install # should install packages first", + "vp pm prune --help # should show help", + "vp pm prune && cat package.json # should prune extraneous dependencies", + "vp pm prune --prod && cat package.json # should prune dev dependencies", + "vp pm prune --no-optional && cat package.json # should prune optional dependencies", + "vp pm prune --prod --no-optional && cat package.json # should prune both dev and optional dependencies", + "vp pm prune -- --loglevel=warn && cat package.json # should support pass through arguments" + ] +} diff --git a/packages/cli/snap-tests-global/command-publish-pnpm11/package.json b/packages/cli/snap-tests-global/command-publish-pnpm11/package.json new file mode 100644 index 0000000000..07f93e1569 --- /dev/null +++ b/packages/cli/snap-tests-global/command-publish-pnpm11/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-publish-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-publish-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-publish-pnpm11/snap.txt new file mode 100644 index 0000000000..a9a6aaf563 --- /dev/null +++ b/packages/cli/snap-tests-global/command-publish-pnpm11/snap.txt @@ -0,0 +1,29 @@ +> vp pm publish --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp pm publish [OPTIONS] [TARBALL|FOLDER] [-- ...] + +Publish package to registry + +Arguments: + [TARBALL|FOLDER] Tarball or folder to publish + [PASS_THROUGH_ARGS]... Additional arguments + +Options: + --dry-run Preview without publishing + --tag Publish tag + --access Access level (public/restricted) + --otp One-time password for authentication + --no-git-checks Skip git checks + --publish-branch Set the branch name to publish from + --report-summary Save publish summary + --force Force publish + --json Output in JSON format + -r, --recursive Publish all workspace packages + --filter Filter packages in monorepo + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp pm publish --dry-run -- --loglevel error # should preview publish without actually publishing (uses pnpm publish --dry-run) \ No newline at end of file diff --git a/packages/cli/snap-tests-global/command-publish-pnpm11/steps.json b/packages/cli/snap-tests-global/command-publish-pnpm11/steps.json new file mode 100644 index 0000000000..35a46e6d86 --- /dev/null +++ b/packages/cli/snap-tests-global/command-publish-pnpm11/steps.json @@ -0,0 +1,6 @@ +{ + "commands": [ + "vp pm publish --help # should show help", + "vp pm publish --dry-run -- --loglevel error # should preview publish without actually publishing (uses pnpm publish --dry-run)" + ] +} diff --git a/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/package.json b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/package.json new file mode 100644 index 0000000000..37053a14c8 --- /dev/null +++ b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-remove-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/packages/app/package.json b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/packages/app/package.json new file mode 100644 index 0000000000..fd1f8f6386 --- /dev/null +++ b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/packages/app/package.json @@ -0,0 +1,3 @@ +{ + "name": "app" +} diff --git a/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/packages/utils/package.json b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/packages/utils/package.json new file mode 100644 index 0000000000..d063b255a7 --- /dev/null +++ b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/packages/utils/package.json @@ -0,0 +1,5 @@ +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true +} diff --git a/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/pnpm-workspace.yaml b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/pnpm-workspace.yaml new file mode 100644 index 0000000000..924b55f42e --- /dev/null +++ b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/snap.txt b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/snap.txt new file mode 100644 index 0000000000..e0da903a24 --- /dev/null +++ b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/snap.txt @@ -0,0 +1,156 @@ +> vp add testnpm2 -D -w --filter=* && vp add test-vite-plus-install -w --filter=* && vp add test-vite-plus-package-optional -O --filter=* && cat package.json packages/app/package.json packages/utils/package.json # prepare packages +. | +1 + +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +. | +1 + +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +. | +1 + +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "command-remove-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@ + "devDependencies": { + "testnpm2": "^1.0.1" + }, + "dependencies": { + "test-vite-plus-install": "^1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0" + } +} +{ + "name": "app", + "devDependencies": { + "testnpm2": "^1.0.1" + }, + "dependencies": { + "test-vite-plus-install": "^1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0" + } +} +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true, + "devDependencies": { + "testnpm2": "^1.0.1" + }, + "dependencies": { + "test-vite-plus-install": "^1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0" + } +} + +> vp remove testnpm2 -r && cat package.json packages/app/package.json packages/utils/package.json # should remove package from all workspaces and root +Scope: all workspace projects +. | -1 - +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "command-remove-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@ + "dependencies": { + "test-vite-plus-install": "^1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0" + } +} +{ + "name": "app", + "dependencies": { + "test-vite-plus-install": "^1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0" + } +} +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true, + "dependencies": { + "test-vite-plus-install": "^1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0" + } +} + +> vp remove -O test-vite-plus-package-optional -r && cat package.json packages/app/package.json packages/utils/package.json # should remove optional package from all workspaces +Scope: all workspace projects +. | -1 - +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "command-remove-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@ + "dependencies": { + "test-vite-plus-install": "^1.0.0" + } +} +{ + "name": "app", + "dependencies": { + "test-vite-plus-install": "^1.0.0" + } +} +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true, + "dependencies": { + "test-vite-plus-install": "^1.0.0" + } +} + +> vp remove test-vite-plus-install --filter=app && cat package.json packages/app/package.json packages/utils/package.json # should remove package by filter=app +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "command-remove-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@ + "dependencies": { + "test-vite-plus-install": "^1.0.0" + } +} +{ + "name": "app" +} +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true, + "dependencies": { + "test-vite-plus-install": "^1.0.0" + } +} + +> vp remove test-vite-plus-install --filter=* && cat package.json packages/app/package.json packages/utils/package.json # should remove package by filter=* +Scope: all workspace projects +. | -1 - +Done in ms using pnpm v +{ + "name": "command-remove-pnpm11-with-workspace", + "version": "1.0.0", + "packageManager": "pnpm@ +} +{ + "name": "app" +} +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "private": true +} diff --git a/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/steps.json b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/steps.json new file mode 100644 index 0000000000..27265fa59b --- /dev/null +++ b/packages/cli/snap-tests-global/command-remove-pnpm11-with-workspace/steps.json @@ -0,0 +1,10 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp add testnpm2 -D -w --filter=* && vp add test-vite-plus-install -w --filter=* && vp add test-vite-plus-package-optional -O --filter=* && cat package.json packages/app/package.json packages/utils/package.json # prepare packages", + "vp remove testnpm2 -r && cat package.json packages/app/package.json packages/utils/package.json # should remove package from all workspaces and root", + "vp remove -O test-vite-plus-package-optional -r && cat package.json packages/app/package.json packages/utils/package.json # should remove optional package from all workspaces", + "vp remove test-vite-plus-install --filter=app && cat package.json packages/app/package.json packages/utils/package.json # should remove package by filter=app", + "vp remove test-vite-plus-install --filter=* && cat package.json packages/app/package.json packages/utils/package.json # should remove package by filter=*" + ] +} diff --git a/packages/cli/snap-tests-global/command-remove-pnpm11/package.json b/packages/cli/snap-tests-global/command-remove-pnpm11/package.json new file mode 100644 index 0000000000..731b470e76 --- /dev/null +++ b/packages/cli/snap-tests-global/command-remove-pnpm11/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-remove-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-remove-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-remove-pnpm11/snap.txt new file mode 100644 index 0000000000..be47252951 --- /dev/null +++ b/packages/cli/snap-tests-global/command-remove-pnpm11/snap.txt @@ -0,0 +1,113 @@ +> vp remove --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp remove [OPTIONS] ... [-- ...] + +Remove packages from dependencies + +Arguments: + ... Packages to remove + [PASS_THROUGH_ARGS]... Additional arguments to pass through to the package manager + +Options: + -D, --save-dev Only remove from `devDependencies` (pnpm-specific) + -O, --save-optional Only remove from `optionalDependencies` (pnpm-specific) + -P, --save-prod Only remove from `dependencies` (pnpm-specific) + --filter Filter packages in monorepo (can be used multiple times) + -w, --workspace-root Remove from workspace root + -r, --recursive Remove recursively from all workspace packages + -g, --global Remove global packages + --dry-run Preview what would be removed without actually removing (only with -g) + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +[2]> vp remove # should error because no packages specified +error: the following required arguments were not provided: + ... + +Usage: vp remove ... [-- ...] + +For more information, try '--help'. + +[1]> vp remove testnpm2 -D && cat package.json # should error when remove not exists package from dev dependencies + ERR_PNPM_CANNOT_REMOVE_MISSING_DEPS  Cannot remove 'testnpm2': project has no 'devDependencies' + +> vp add testnpm2 && vp add -D test-vite-plus-install && vp add -O test-vite-plus-package-optional && cat package.json # should add packages to dependencies +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ testnpm2 + +Done in ms using pnpm v +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +devDependencies: ++ test-vite-plus-install + +Done in ms using pnpm v +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +optionalDependencies: ++ test-vite-plus-package-optional + +Done in ms using pnpm v +{ + "name": "command-remove-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@ + "dependencies": { + "testnpm2": "^1.0.1" + }, + "devDependencies": { + "test-vite-plus-install": "^1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0" + } +} + +> vp remove testnpm2 test-vite-plus-install && cat package.json # should remove packages from dependencies +Packages: -2 +-- +Progress: resolved , reused , downloaded , added , done + +dependencies: +- testnpm2 + +devDependencies: +- test-vite-plus-install + +Done in ms using pnpm v +{ + "name": "command-remove-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@ + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0" + } +} + +> vp remove -O test-vite-plus-package-optional -- --loglevel=warn && cat package.json # support remove package from optional dependencies and pass through arguments +{ + "name": "command-remove-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@ +} + +[1]> vp remove -g --dry-run testnpm2 && cat package.json # support remove global package with dry-run +Failed to uninstall testnpm2: Configuration error: Package testnpm2 is not installed + +[2]> vp rm --stream foo && should show tips to use pass through arguments when options are not supported +VITE+ - The Unified Toolchain for the Web + +error: Unexpected argument '--stream' + +Use `-- --stream` to pass the argument as a value diff --git a/packages/cli/snap-tests-global/command-remove-pnpm11/steps.json b/packages/cli/snap-tests-global/command-remove-pnpm11/steps.json new file mode 100644 index 0000000000..7a98a5e6b4 --- /dev/null +++ b/packages/cli/snap-tests-global/command-remove-pnpm11/steps.json @@ -0,0 +1,13 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp remove --help # should show help", + "vp remove # should error because no packages specified", + "vp remove testnpm2 -D && cat package.json # should error when remove not exists package from dev dependencies", + "vp add testnpm2 && vp add -D test-vite-plus-install && vp add -O test-vite-plus-package-optional && cat package.json # should add packages to dependencies", + "vp remove testnpm2 test-vite-plus-install && cat package.json # should remove packages from dependencies", + "vp remove -O test-vite-plus-package-optional -- --loglevel=warn && cat package.json # support remove package from optional dependencies and pass through arguments", + "vp remove -g --dry-run testnpm2 && cat package.json # support remove global package with dry-run", + "vp rm --stream foo && should show tips to use pass through arguments when options are not supported" + ] +} diff --git a/packages/cli/snap-tests-global/command-unlink-pnpm11/package.json b/packages/cli/snap-tests-global/command-unlink-pnpm11/package.json new file mode 100644 index 0000000000..54360ce35e --- /dev/null +++ b/packages/cli/snap-tests-global/command-unlink-pnpm11/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-unlink-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-unlink-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-unlink-pnpm11/snap.txt new file mode 100644 index 0000000000..b947451861 --- /dev/null +++ b/packages/cli/snap-tests-global/command-unlink-pnpm11/snap.txt @@ -0,0 +1,49 @@ +> vp unlink -h # should show help message +VITE+ - The Unified Toolchain for the Web + +Usage: vp unlink [OPTIONS] [PACKAGE|DIR] [ARGS]... + +Unlink packages + +Arguments: + [PACKAGE|DIR] Package name to unlink + [ARGS]... Arguments to pass to package manager + +Options: + -r, --recursive Unlink in every workspace package + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> mkdir -p ../unlink-test-lib && echo '{"name": "unlink-test-lib", "version": "1.0.0"}' > ../unlink-test-lib/package.json # create test library +> vp link ../unlink-test-lib && cat package.json # link the library first + +dependencies: ++ @pnpm/exe ++ pnpm +- unlink-test-lib link:../unlink-test-lib ++ unlink-test-lib <- ../unlink-test-lib + +{ + "name": "command-unlink-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@ + "dependencies": { + "unlink-test-lib": "link:../unlink-test-lib" + } +} + +[1]> vp unlink unlink-test-lib && cat package.json # should unlink the package + ERR_PNPM_LOCKFILE_CONFIG_MISMATCH  Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile + +Update your lockfile using "pnpm install --no-frozen-lockfile" + +> vp link ../unlink-test-lib # link again +Lockfile is up to date, resolution step is skipped + + +[1]> vp unlink && cat package.json # should unlink all packages + ERR_PNPM_LOCKFILE_CONFIG_MISMATCH  Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile + +Update your lockfile using "pnpm install --no-frozen-lockfile" diff --git a/packages/cli/snap-tests-global/command-unlink-pnpm11/steps.json b/packages/cli/snap-tests-global/command-unlink-pnpm11/steps.json new file mode 100644 index 0000000000..491581a67b --- /dev/null +++ b/packages/cli/snap-tests-global/command-unlink-pnpm11/steps.json @@ -0,0 +1,11 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp unlink -h # should show help message", + "mkdir -p ../unlink-test-lib && echo '{\"name\": \"unlink-test-lib\", \"version\": \"1.0.0\"}' > ../unlink-test-lib/package.json # create test library", + "vp link ../unlink-test-lib && cat package.json # link the library first", + "vp unlink unlink-test-lib && cat package.json # should unlink the package", + "vp link ../unlink-test-lib # link again", + "vp unlink && cat package.json # should unlink all packages" + ] +} diff --git a/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/package.json b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/package.json new file mode 100644 index 0000000000..1f4b32094b --- /dev/null +++ b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/package.json @@ -0,0 +1,8 @@ +{ + "name": "command-update-pnpm11-with-workspace", + "version": "1.0.0", + "dependencies": { + "testnpm2": "*" + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/packages/app/package.json b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/packages/app/package.json new file mode 100644 index 0000000000..579391133d --- /dev/null +++ b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/packages/app/package.json @@ -0,0 +1,11 @@ +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "*", + "testnpm2": "*" + }, + "devDependencies": { + "test-vite-plus-package": "*" + } +} diff --git a/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/packages/utils/package.json b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/packages/utils/package.json new file mode 100644 index 0000000000..fbce9dda5d --- /dev/null +++ b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/packages/utils/package.json @@ -0,0 +1,7 @@ +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "dependencies": { + "testnpm2": "*" + } +} diff --git a/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/pnpm-workspace.yaml b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/pnpm-workspace.yaml new file mode 100644 index 0000000000..924b55f42e --- /dev/null +++ b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/snap.txt b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/snap.txt new file mode 100644 index 0000000000..11e88593c5 --- /dev/null +++ b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/snap.txt @@ -0,0 +1,112 @@ +> vp update testnpm2 --latest -w && cat package.json # should update in workspace root +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm +- testnpm2 * + +Packages: + ++ +Done in ms using pnpm v +{ + "name": "command-update-pnpm11-with-workspace", + "version": "1.0.0", + "dependencies": { + "testnpm2": "^1.0.1" + }, + "packageManager": "pnpm@ +} + +> vp update testnpm2 --latest --filter app && cat packages/app/package.json # should update in specific package +Progress: resolved , reused , downloaded , added , done +. | +2 + +Done in ms using pnpm v +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "*", + "testnpm2": "^1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "*" + } +} + +> vp up -D --filter app && cat packages/app/package.json # should update dev dependencies in app +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "*", + "testnpm2": "^1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "^1.0.0" + } +} + +> vp update --latest --filter "*" && cat packages/app/package.json packages/utils/package.json # should update in all packages +Scope: all workspace projects +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "^1.0.0", + "testnpm2": "^1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "^1.0.0" + } +} +{ + "name": "@vite-plus-test/utils", + "version": "1.0.0", + "dependencies": { + "testnpm2": "^1.0.1" + } +} + +> vp update -r --no-save && cat package.json packages/app/package.json # should update recursively without saving +Scope: all workspace projects +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "command-update-pnpm11-with-workspace", + "version": "1.0.0", + "dependencies": { + "testnpm2": "^1.0.1" + }, + "packageManager": "pnpm@ +} +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "^1.0.0", + "testnpm2": "^1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "^1.0.0" + } +} + +> vp update --workspace --filter app @vite-plus-test/utils && cat packages/app/package.json # should update workspace dependency +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "^1.0.0", + "testnpm2": "^1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "^1.0.0" + } +} diff --git a/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/steps.json b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/steps.json new file mode 100644 index 0000000000..3bcf5b33b8 --- /dev/null +++ b/packages/cli/snap-tests-global/command-update-pnpm11-with-workspace/steps.json @@ -0,0 +1,11 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp update testnpm2 --latest -w && cat package.json # should update in workspace root", + "vp update testnpm2 --latest --filter app && cat packages/app/package.json # should update in specific package", + "vp up -D --filter app && cat packages/app/package.json # should update dev dependencies in app", + "vp update --latest --filter \"*\" && cat packages/app/package.json packages/utils/package.json # should update in all packages", + "vp update -r --no-save && cat package.json packages/app/package.json # should update recursively without saving", + "vp update --workspace --filter app @vite-plus-test/utils && cat packages/app/package.json # should update workspace dependency" + ] +} diff --git a/packages/cli/snap-tests-global/command-update-pnpm11/package.json b/packages/cli/snap-tests-global/command-update-pnpm11/package.json new file mode 100644 index 0000000000..341557df7e --- /dev/null +++ b/packages/cli/snap-tests-global/command-update-pnpm11/package.json @@ -0,0 +1,14 @@ +{ + "name": "command-update-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "*" + }, + "devDependencies": { + "test-vite-plus-package": "*" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "*" + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-update-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-update-pnpm11/snap.txt new file mode 100644 index 0000000000..c6f43a5738 --- /dev/null +++ b/packages/cli/snap-tests-global/command-update-pnpm11/snap.txt @@ -0,0 +1,180 @@ +> vp update --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp update [OPTIONS] [PACKAGES]... [-- ...] + +Update packages to their latest versions + +Arguments: + [PACKAGES]... Packages to update (optional - updates all if omitted) + [PASS_THROUGH_ARGS]... Additional arguments to pass through to the package manager + +Options: + -L, --latest Update to latest version (ignore semver range) + -g, --global Update global packages + -r, --recursive Update recursively in all workspace packages + --filter Filter packages in monorepo (can be used multiple times) + -w, --workspace-root Include workspace root + -D, --dev Update only devDependencies + -P, --prod Update only dependencies (production) + -i, --interactive Interactive mode + --no-optional Don't update optionalDependencies + --no-save Update lockfile only, don't modify package.json + --workspace Only update if package exists in workspace (pnpm-specific) + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp update testnpm2 && cat package.json # should update package within semver range +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm +- testnpm2 * ++ testnpm2 + +optionalDependencies: +- test-vite-plus-package-optional * ++ test-vite-plus-package-optional + +devDependencies: +- test-vite-plus-package * ++ test-vite-plus-package + +Done in ms using pnpm v +{ + "name": "command-update-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "^1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "*" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "*" + }, + "packageManager": "pnpm@ +} + +> vp up testnpm2 --latest && cat package.json # should to absolute latest version +Already up to date +Progress: resolved , reused , downloaded , added , done + +Done in ms using pnpm v +{ + "name": "command-update-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "^1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "*" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "*" + }, + "packageManager": "pnpm@ +} + +> vp update -D && cat package.json # should update only dev dependencies +Already up to date +Progress: resolved , reused , downloaded , added , done + +dependencies: skipped + +optionalDependencies: skipped + +Done in ms using pnpm v +{ + "name": "command-update-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "^1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "^1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "*" + }, + "packageManager": "pnpm@ +} + +> vp update -P --no-save && cat package.json # should update only dependencies and optionalDependencies without saving +Already up to date +Progress: resolved , reused , downloaded , added , done + +devDependencies: skipped + +Done in ms using pnpm v +{ + "name": "command-update-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "^1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "^1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "*" + }, + "packageManager": "pnpm@ +} + +> vp rm testnpm2 # should remove package from dependencies for the next test +> vp add testnpm2@1.0.0 -O && vp update --no-optional --latest && cat package.json # should skip optional dependencies +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +optionalDependencies: ++ testnpm2 (1.0.1 is available) + +Done in ms using pnpm v +Packages: + -1 ++- +Progress: resolved , reused , downloaded , added , done + +optionalDependencies: +- testnpm2 ++ testnpm2 + +Done in ms using pnpm v +{ + "name": "command-update-pnpm11", + "version": "1.0.0", + "devDependencies": { + "test-vite-plus-package": "^1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0", + "testnpm2": "1.0.1" + }, + "packageManager": "pnpm@ +} + +> vp update && vp update --recursive && cat package.json # should update all packages and change the package.json +Already up to date +Progress: resolved , reused , downloaded , added , done + +Done in ms using pnpm v +Progress: resolved , reused , downloaded , added , done +Done in ms using pnpm v +{ + "name": "command-update-pnpm11", + "version": "1.0.0", + "devDependencies": { + "test-vite-plus-package": "^1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "^1.0.0", + "testnpm2": "1.0.1" + }, + "packageManager": "pnpm@ +} diff --git a/packages/cli/snap-tests-global/command-update-pnpm11/steps.json b/packages/cli/snap-tests-global/command-update-pnpm11/steps.json new file mode 100644 index 0000000000..6e517683eb --- /dev/null +++ b/packages/cli/snap-tests-global/command-update-pnpm11/steps.json @@ -0,0 +1,16 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp update --help # should show help", + "vp update testnpm2 && cat package.json # should update package within semver range", + "vp up testnpm2 --latest && cat package.json # should to absolute latest version", + "vp update -D && cat package.json # should update only dev dependencies", + "vp update -P --no-save && cat package.json # should update only dependencies and optionalDependencies without saving", + { + "command": "vp rm testnpm2 # should remove package from dependencies for the next test", + "ignoreOutput": true + }, + "vp add testnpm2@1.0.0 -O && vp update --no-optional --latest && cat package.json # should skip optional dependencies", + "vp update && vp update --recursive && cat package.json # should update all packages and change the package.json" + ] +} diff --git a/packages/cli/snap-tests-global/command-view-pnpm11/package.json b/packages/cli/snap-tests-global/command-view-pnpm11/package.json new file mode 100644 index 0000000000..16bc817cb1 --- /dev/null +++ b/packages/cli/snap-tests-global/command-view-pnpm11/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-view-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-view-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-view-pnpm11/snap.txt new file mode 100644 index 0000000000..c63988e5d1 --- /dev/null +++ b/packages/cli/snap-tests-global/command-view-pnpm11/snap.txt @@ -0,0 +1,85 @@ +> vp pm view --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp pm view [OPTIONS] [FIELD] [-- ...] + +View package information from the registry + +Arguments: + Package name with optional version + [FIELD] Specific field to view + [PASS_THROUGH_ARGS]... Additional arguments + +Options: + --json Output in JSON format + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp pm view testnpm2 # should view lodash package information (uses npm view) + +testnpm2@ | ISC | deps: none | versions: 2 + +dist +.tarball: https://registry./testnpm2/-/testnpm2-1.0.1.tgz +.shasum: +.integrity: sha512- + +maintainers: +- fengmk2 + +dist-tags: +latest: +release-1: + +published over a year ago by fengmk2 + +> vp pm view testnpm2 version # should view lodash version field (uses npm view) +1.0.1 + +> vp pm view testnpm2@1.0.0 # should view specific version of lodash (uses npm view) + +testnpm2@ | ISC | deps: none | versions: 2 + +dist +.tarball: https://registry./testnpm2/-/testnpm2-1.0.0.tgz +.shasum: +.integrity: sha512- + +maintainers: +- fengmk2 + +dist-tags: +latest: +release-1: + +published over a year ago by fengmk2 + +> vp pm view testnpm2 dist.tarball # should view nested field (uses npm view) +https://registry./testnpm2/-/testnpm2-1.0.1.tgz + +> vp pm view testnpm2 dependencies # should view dependencies object (uses npm view) +> vp pm view testnpm2 dist.tarball --json # should view package.dist.tarball info in JSON format (uses npm view) +"https://registry./testnpm2/-/testnpm2-1.0.1.tgz" + +> vp pm view testnpm2 version --json # should view field in JSON format (uses npm view) +"1.0.1" + +> vp pm view testnpm2 -- --loglevel=warn # should support pass through arguments (uses npm view) + +testnpm2@ | ISC | deps: none | versions: 2 + +dist +.tarball: https://registry./testnpm2/-/testnpm2-1.0.1.tgz +.shasum: +.integrity: sha512- + +maintainers: +- fengmk2 + +dist-tags: +latest: +release-1: + +published over a year ago by fengmk2 diff --git a/packages/cli/snap-tests-global/command-view-pnpm11/steps.json b/packages/cli/snap-tests-global/command-view-pnpm11/steps.json new file mode 100644 index 0000000000..c89aea7830 --- /dev/null +++ b/packages/cli/snap-tests-global/command-view-pnpm11/steps.json @@ -0,0 +1,13 @@ +{ + "commands": [ + "vp pm view --help # should show help", + "vp pm view testnpm2 # should view lodash package information (uses npm view)", + "vp pm view testnpm2 version # should view lodash version field (uses npm view)", + "vp pm view testnpm2@1.0.0 # should view specific version of lodash (uses npm view)", + "vp pm view testnpm2 dist.tarball # should view nested field (uses npm view)", + "vp pm view testnpm2 dependencies # should view dependencies object (uses npm view)", + "vp pm view testnpm2 dist.tarball --json # should view package.dist.tarball info in JSON format (uses npm view)", + "vp pm view testnpm2 version --json # should view field in JSON format (uses npm view)", + "vp pm view testnpm2 -- --loglevel=warn # should support pass through arguments (uses npm view)" + ] +} diff --git a/packages/cli/snap-tests-global/command-vpx-pnpm11/package.json b/packages/cli/snap-tests-global/command-vpx-pnpm11/package.json new file mode 100644 index 0000000000..05514a96c9 --- /dev/null +++ b/packages/cli/snap-tests-global/command-vpx-pnpm11/package.json @@ -0,0 +1,5 @@ +{ + "name": "command-vpx-pnpm11", + "version": "1.0.0", + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-vpx-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-vpx-pnpm11/snap.txt new file mode 100644 index 0000000000..908f9b8cf7 --- /dev/null +++ b/packages/cli/snap-tests-global/command-vpx-pnpm11/snap.txt @@ -0,0 +1,30 @@ +> vpx --help # should show vpx help message +Execute a command from a local or remote npm package + +Usage: vpx [OPTIONS] [args...] + +Arguments: + Package binary to execute + [args...] Arguments to pass to the command + +Options: + -p, --package Package(s) to install if not found locally + -c, --shell-mode Execute the command within a shell environment + -s, --silent Suppress all output except the command's output + -h, --help Print help + +Examples: + vpx eslint . # Run local eslint (or download) + vpx create-vue my-app # Download and run create-vue + vpx typescript@ tsc --version # Run specific version + vpx -p cowsay -c 'echo "hi" | cowsay' # Shell mode with package + +> vpx -s cowsay hello # should run cowsay via dlx fallback + _______ +< hello > + ------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || diff --git a/packages/cli/snap-tests-global/command-vpx-pnpm11/steps.json b/packages/cli/snap-tests-global/command-vpx-pnpm11/steps.json new file mode 100644 index 0000000000..1947f55875 --- /dev/null +++ b/packages/cli/snap-tests-global/command-vpx-pnpm11/steps.json @@ -0,0 +1,6 @@ +{ + "commands": [ + "vpx --help # should show vpx help message", + "vpx -s cowsay hello # should run cowsay via dlx fallback" + ] +} diff --git a/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/package.json b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/package.json new file mode 100644 index 0000000000..359b3210f4 --- /dev/null +++ b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/package.json @@ -0,0 +1,8 @@ +{ + "name": "command-why-pnpm11-with-workspace", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.0" + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/packages/app/package.json b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/packages/app/package.json new file mode 100644 index 0000000000..9cab9ad683 --- /dev/null +++ b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/packages/app/package.json @@ -0,0 +1,14 @@ +{ + "name": "app", + "dependencies": { + "@vite-plus-test/utils": "workspace:*", + "test-vite-plus-install": "1.0.0", + "testnpm2": "1.0.0" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-other-optional": "1.0.0" + } +} diff --git a/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/packages/utils/package.json b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/packages/utils/package.json new file mode 100644 index 0000000000..5089db43d3 --- /dev/null +++ b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/packages/utils/package.json @@ -0,0 +1,6 @@ +{ + "name": "@vite-plus-test/utils", + "dependencies": { + "testnpm2": "1.0.0" + } +} diff --git a/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/pnpm-workspace.yaml b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/pnpm-workspace.yaml new file mode 100644 index 0000000000..924b55f42e --- /dev/null +++ b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - packages/* diff --git a/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/snap.txt b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/snap.txt new file mode 100644 index 0000000000..36cc9ac5e5 --- /dev/null +++ b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/snap.txt @@ -0,0 +1,77 @@ +> vp install +VITE+ - The Unified Toolchain for the Web + +Scope: all workspace projects +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm +- testnpm2 ++ testnpm2 (1.0.1 is available) + +Done in ms using pnpm v + +> vp why testnpm2 -w # should check why in workspace root +testnpm2@ +└── command-why-pnpm11-with-workspace@ (dependencies) + +Found 1 version of testnpm2 + +> vp why testnpm2 --filter app # should check why in specific package +testnpm2@ +├── @vite-plus-test/utils (dependencies) +└── app (dependencies) + +Found 1 version of testnpm2 + +> vp why test-vite-plus-package -D --filter app # should check why dev dependencies in app +test-vite-plus-package@ +└── app (devDependencies) + +Found 1 version of test-vite-plus-package + +> vp why testnpm2 --filter "*" # should check why in all packages +testnpm2@ +├── @vite-plus-test/utils (dependencies) +├── app (dependencies) +└── command-why-pnpm11-with-workspace@ (dependencies) + +Found 1 version of testnpm2 + +> vp why testnpm2 -r # should check why recursively +testnpm2@ +├── @vite-plus-test/utils (dependencies) +├── app (dependencies) +└── command-why-pnpm11-with-workspace@ (dependencies) + +Found 1 version of testnpm2 + +> vp why testnpm2 --filter app --json # should support json output with filter +[ + { + "name": "testnpm2", + "version": "1.0.0", + "path": "/node_modules/.pnpm/testnpm2@/node_modules/testnpm2", + "dependents": [ + { + "name": "@vite-plus-test/utils", + "version": "", + "depField": "dependencies" + }, + { + "name": "app", + "version": "", + "depField": "dependencies" + } + ] + } +] + +> vp why test-vite-plus-install --filter app --depth 1 # should support depth limiting with filter +test-vite-plus-install@ +└── app (dependencies) + +Found 1 version of test-vite-plus-install diff --git a/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/steps.json b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/steps.json new file mode 100644 index 0000000000..52da8c58de --- /dev/null +++ b/packages/cli/snap-tests-global/command-why-pnpm11-with-workspace/steps.json @@ -0,0 +1,13 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp install", + "vp why testnpm2 -w # should check why in workspace root", + "vp why testnpm2 --filter app # should check why in specific package", + "vp why test-vite-plus-package -D --filter app # should check why dev dependencies in app", + "vp why testnpm2 --filter \"*\" # should check why in all packages", + "vp why testnpm2 -r # should check why recursively", + "vp why testnpm2 --filter app --json # should support json output with filter", + "vp why test-vite-plus-install --filter app --depth 1 # should support depth limiting with filter" + ] +} diff --git a/packages/cli/snap-tests-global/command-why-pnpm11/package.json b/packages/cli/snap-tests-global/command-why-pnpm11/package.json new file mode 100644 index 0000000000..7940408c15 --- /dev/null +++ b/packages/cli/snap-tests-global/command-why-pnpm11/package.json @@ -0,0 +1,14 @@ +{ + "name": "command-why-pnpm11", + "version": "1.0.0", + "dependencies": { + "testnpm2": "1.0.1" + }, + "devDependencies": { + "test-vite-plus-package": "1.0.0" + }, + "optionalDependencies": { + "test-vite-plus-package-optional": "1.0.0" + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/command-why-pnpm11/snap.txt b/packages/cli/snap-tests-global/command-why-pnpm11/snap.txt new file mode 100644 index 0000000000..71362128f7 --- /dev/null +++ b/packages/cli/snap-tests-global/command-why-pnpm11/snap.txt @@ -0,0 +1,132 @@ +> vp why --help # should show help +VITE+ - The Unified Toolchain for the Web + +Usage: vp why [OPTIONS] ... [-- ...] + +Show why a package is installed + +Arguments: + ... Package(s) to check + [PASS_THROUGH_ARGS]... Additional arguments to pass through to the package manager + +Options: + --json Output in JSON format + --long Show extended information + --parseable Show parseable output + -r, --recursive Check recursively across all workspaces + --filter Filter packages in monorepo + -w, --workspace-root Check in workspace root + -P, --prod Only production dependencies + -D, --dev Only dev dependencies + --depth Limit tree depth + --no-optional Exclude optional dependencies + -g, --global Check globally installed packages + --exclude-peers Exclude peer dependencies + --find-by Use a finder function defined in .pnpmfile.cjs + -h, --help Print help + +Documentation: https://viteplus.dev/guide/install + + +> vp install # should install packages first +VITE+ - The Unified Toolchain for the Web + +Packages: + ++ +Progress: resolved , reused , downloaded , added , done + +dependencies: ++ @pnpm/exe ++ pnpm +- testnpm2 + +optionalDependencies: +- test-vite-plus-package-optional + +devDependencies: +- test-vite-plus-package ++ test-vite-plus-package + +Done in ms using pnpm v + +> vp why testnpm2 # should show why package is installed +testnpm2@ +└── command-why-pnpm11@ (dependencies) + +Found 1 version of testnpm2 + +> vp explain testnpm2 # should work with explain alias +testnpm2@ +└── command-why-pnpm11@ (dependencies) + +Found 1 version of testnpm2 + +> vp why test-vite-plus-package # should show why dev package is installed +test-vite-plus-package@ +└── command-why-pnpm11@ (devDependencies) + +Found 1 version of test-vite-plus-package + +> vp why testnpm2 test-vite-plus-package # should support multiple packages +test-vite-plus-package@ +└── command-why-pnpm11@ (devDependencies) + +testnpm2@ +└── command-why-pnpm11@ (dependencies) + +Found 1 version of test-vite-plus-package +Found 1 version of testnpm2 + +> vp why testnpm2 --json # should support json output +[ + { + "name": "testnpm2", + "version": "1.0.1", + "path": "/node_modules/.pnpm/testnpm2@/node_modules/testnpm2", + "dependents": [ + { + "name": "command-why-pnpm11", + "version": "1.0.0", + "depField": "dependencies" + } + ] + } +] + +> vp why testnpm2 --long # should support long output +testnpm2@ +│ /node_modules/.pnpm/testnpm2@/node_modules/testnpm2 +└── command-why-pnpm11@ (dependencies) + +Found 1 version of testnpm2 + +> vp why testnpm2 --parseable # should support parseable output +command-why-pnpm11@ > testnpm2@ + +> vp why testnpm2 -P # should support prod dependencies only +testnpm2@ +└── command-why-pnpm11@ (dependencies) + +Found 1 version of testnpm2 + +> vp why test-vite-plus-package -D # should support dev dependencies only +test-vite-plus-package@ +└── command-why-pnpm11@ (devDependencies) + +Found 1 version of test-vite-plus-package + +> vp why testnpm2 --depth 1 # should support depth limiting +testnpm2@ +└── command-why-pnpm11@ (dependencies) + +Found 1 version of testnpm2 + +> vp why test-vite-plus-package-optional --no-optional # should exclude optional dependencies +[1]> vp why testnpm2 --find-by customFinder # should support find-by option (pnpm-specific) + ERR_PNPM_FINDER_NOT_FOUND  No finder with name customFinder is found + +> vp why testnpm2 -- --reporter=silent # should support pass through arguments +testnpm2@ +└── command-why-pnpm11@ (dependencies) + +Found 1 version of testnpm2 diff --git a/packages/cli/snap-tests-global/command-why-pnpm11/steps.json b/packages/cli/snap-tests-global/command-why-pnpm11/steps.json new file mode 100644 index 0000000000..e7b38a4206 --- /dev/null +++ b/packages/cli/snap-tests-global/command-why-pnpm11/steps.json @@ -0,0 +1,20 @@ +{ + "ignoredPlatforms": ["win32"], + "commands": [ + "vp why --help # should show help", + "vp install # should install packages first", + "vp why testnpm2 # should show why package is installed", + "vp explain testnpm2 # should work with explain alias", + "vp why test-vite-plus-package # should show why dev package is installed", + "vp why testnpm2 test-vite-plus-package # should support multiple packages", + "vp why testnpm2 --json # should support json output", + "vp why testnpm2 --long # should support long output", + "vp why testnpm2 --parseable # should support parseable output", + "vp why testnpm2 -P # should support prod dependencies only", + "vp why test-vite-plus-package -D # should support dev dependencies only", + "vp why testnpm2 --depth 1 # should support depth limiting", + "vp why test-vite-plus-package-optional --no-optional # should exclude optional dependencies", + "vp why testnpm2 --find-by customFinder # should support find-by option (pnpm-specific)", + "vp why testnpm2 -- --reporter=silent # should support pass through arguments" + ] +} diff --git a/packages/cli/snap-tests-global/dev-engines-runtime-pnpm11/package.json b/packages/cli/snap-tests-global/dev-engines-runtime-pnpm11/package.json new file mode 100644 index 0000000000..a2682b09fd --- /dev/null +++ b/packages/cli/snap-tests-global/dev-engines-runtime-pnpm11/package.json @@ -0,0 +1,11 @@ +{ + "name": "dev-engines-runtime-pnpm11", + "version": "1.0.0", + "devEngines": { + "runtime": { + "name": "node", + "version": "22.11.0" + } + }, + "packageManager": "pnpm@11.0.0-beta.6" +} diff --git a/packages/cli/snap-tests-global/dev-engines-runtime-pnpm11/snap.txt b/packages/cli/snap-tests-global/dev-engines-runtime-pnpm11/snap.txt new file mode 100644 index 0000000000..e32c99cce5 --- /dev/null +++ b/packages/cli/snap-tests-global/dev-engines-runtime-pnpm11/snap.txt @@ -0,0 +1,4 @@ +[1]> vp dlx -s print-current-version # should print Node.js version 22.11.0 from devEngines.runtime +ERROR: This version of pnpm requires at least Node.js v22.13 +The current version of Node.js is v +Visit https://r.pnpm.io/comp to see the list of past pnpm versions with respective Node.js version support. diff --git a/packages/cli/snap-tests-global/dev-engines-runtime-pnpm11/steps.json b/packages/cli/snap-tests-global/dev-engines-runtime-pnpm11/steps.json new file mode 100644 index 0000000000..2bf71c6544 --- /dev/null +++ b/packages/cli/snap-tests-global/dev-engines-runtime-pnpm11/steps.json @@ -0,0 +1,5 @@ +{ + "commands": [ + "vp dlx -s print-current-version # should print Node.js version 22.11.0 from devEngines.runtime" + ] +}