From 2cb5804d904bc4415c14b6bfd783b43fb26e3814 Mon Sep 17 00:00:00 2001 From: Ryan Swanson Date: Thu, 30 Apr 2026 09:09:04 -0600 Subject: [PATCH] Dropping npm/yarn install options Signed-off-by: Ryan Swanson --- .github/dependabot.yml | 11 +- .github/workflows/npm.yaml | 59 --- .github/workflows/release.yaml | 25 -- .github/workflows/ui.yaml | 3 - README.md | 1 - dist/npm/.gitignore | 1 - dist/npm/.npmignore | 3 - dist/npm/README.md | 1 - dist/npm/bin/devspace | 56 --- dist/npm/bin/devspace.cmd | 45 --- dist/npm/config/npmrc | 3 - dist/npm/index.js | 544 --------------------------- dist/npm/package-lock.json | 304 --------------- dist/npm/package.json | 27 -- docs/pages/_partials/install-cli.mdx | 18 +- 15 files changed, 2 insertions(+), 1099 deletions(-) delete mode 100644 .github/workflows/npm.yaml delete mode 100644 dist/npm/.gitignore delete mode 100644 dist/npm/.npmignore delete mode 100644 dist/npm/README.md delete mode 100755 dist/npm/bin/devspace delete mode 100644 dist/npm/bin/devspace.cmd delete mode 100644 dist/npm/config/npmrc delete mode 100644 dist/npm/index.js delete mode 100644 dist/npm/package-lock.json delete mode 100644 dist/npm/package.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml index aad91a874a..bca695146b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -26,15 +26,6 @@ updates: - "dependencies" - "javascript" - # Check for npm dependencies in dist/npm - - package-ecosystem: "npm" - directory: "/dist/npm" - schedule: - interval: "weekly" - labels: - - "dependencies" - - "javascript" - # Check for npm dependencies at root level (but exclude docs) - package-ecosystem: "npm" directory: "/" @@ -46,4 +37,4 @@ updates: interval: "weekly" labels: - "dependencies" - - "javascript" \ No newline at end of file + - "javascript" diff --git a/.github/workflows/npm.yaml b/.github/workflows/npm.yaml deleted file mode 100644 index afa083e29b..0000000000 --- a/.github/workflows/npm.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: Test NPM Installer - -on: - pull_request: - branches: - - main - paths: - - "dist/npm/**" - - ".github/workflows/npm.yaml" - -jobs: - linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: https://registry.npmjs.org/ - - run: | - npm install -g - export RELEASE_VERSION=$(node index.js get-latest) - npm run prepare - devspace --version - npm uninstall -g devspace - - npx -p . devspace --version - - export PATH=$PATH:$(yarn global bin) - - yarn global add $PWD - devspace --version - yarn global remove devspace - working-directory: ./dist/npm - windows: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: https://registry.npmjs.org/ - - run: | - npm install -g - $releaseVersion = node index.js get-latest - $env:RELEASE_VERSION = $releaseVersion - npm run prepare - devspace --version - npm uninstall -g devspace - - npx -p . devspace --version - - $yarnGlobalDir = yarn global bin - $env:Path += ";$yarnGlobalDir" - - yarn global add $PWD - devspace --version - yarn global remove devspace - working-directory: ./dist/npm diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 827fec7d1e..ab11f69fc3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -29,7 +29,6 @@ jobs: - uses: actions/setup-node@v1 with: node-version: 20 - registry-url: https://registry.npmjs.org/ - id: get_version run: | RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p') @@ -44,8 +43,6 @@ jobs: - name: Build UI env: VERSION: ${{ steps.get_version.outputs.release_version }} - NPM_CONFIG_GLOBALCONFIG: "dist/npm/config/npmrc" - NPM_REGISTRY_TOKEN: ${{ secrets.NPM_DEVSPACE_REGISTRY_TOKEN }} CI: "false" run: ./hack/build-ui.bash - name: Upload ui tar @@ -90,28 +87,6 @@ jobs: with: pattern: "release/*" github-token: ${{ secrets.GITHUB_TOKEN }} - publish-npm: - if: startsWith(github.ref, 'refs/tags/v') == true - needs: [release, release-ui] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: 20 - registry-url: https://registry.npmjs.org/ - - id: get_version - run: | - RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p') - echo "::set-output name=release_version::$RELEASE_VERSION" - - run: | - npm ci - export NPM_TAG=$(node index.js get-tag) - npm publish --tag $NPM_TAG - working-directory: ./dist/npm - env: - RELEASE_VERSION: ${{ steps.get_version.outputs.release_version }} - NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }} publish-next-image: if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest diff --git a/.github/workflows/ui.yaml b/.github/workflows/ui.yaml index 39704ec7e6..3e4972b492 100644 --- a/.github/workflows/ui.yaml +++ b/.github/workflows/ui.yaml @@ -17,7 +17,6 @@ jobs: - uses: actions/setup-node@v1 with: node-version: 20 - registry-url: https://registry.npmjs.org/ - name: Cache node modules uses: actions/cache@v4 with: @@ -27,7 +26,5 @@ jobs: ${{ runner.os }}-node- - name: Build UI env: - NPM_CONFIG_GLOBALCONFIG: "dist/npm/config/npmrc" - NPM_REGISTRY_TOKEN: ${{ secrets.NPM_DEVSPACE_REGISTRY_TOKEN }} CI: "false" run: ./hack/build-ui.bash diff --git a/README.md b/README.md index ff138f8ba2..99b7e607e0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ ![Latest Release](https://img.shields.io/github/v/release/loft-sh/devspace?style=for-the-badge&label=Latest%20Release&color=%23007ec6) ![License: Apache-2.0](https://img.shields.io/github/license/loft-sh/devspace?style=for-the-badge&color=%23007ec6) ![Total Downloads (GitHub Releases)](https://img.shields.io/github/downloads/loft-sh/devspace/total?style=for-the-badge&label=Total%20Downloads&color=%23007ec6) -![NPM Installs per Month](https://img.shields.io/npm/dm/devspace?label=NPM%20Installs&style=for-the-badge&color=%23007ec6) ![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6945/badge) [![Join us on Slack!](docs/static/img/slack.svg)](https://slack.loft.sh/) diff --git a/dist/npm/.gitignore b/dist/npm/.gitignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/dist/npm/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/dist/npm/.npmignore b/dist/npm/.npmignore deleted file mode 100644 index 4444ecbecf..0000000000 --- a/dist/npm/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -src -config diff --git a/dist/npm/README.md b/dist/npm/README.md deleted file mode 100644 index 1208f03cbd..0000000000 --- a/dist/npm/README.md +++ /dev/null @@ -1 +0,0 @@ -# See [https://github.com/devspace-cloud/devspace](https://github.com/devspace-cloud/devspace) for more info diff --git a/dist/npm/bin/devspace b/dist/npm/bin/devspace deleted file mode 100755 index 75d72f12c0..0000000000 --- a/dist/npm/bin/devspace +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env sh - -BINARY=$(command -v devspace) -STAT=$(stat -L -f%z "$BINARY" 2>/dev/null || stat -c"%s" "$BINARY" 2>/dev/null) - -if [ ! -f "$BINARY" ] || [ "$STAT" -lt 10000 ]; then - echo "Finishing installation of DevSpace CLI" - - BINDIR="$(dirname $0)" - BASEDIR="$(dirname $0)/.." - INDEX_FILE="/index.js" - - if [ ! -f "$BASEDIR/$INDEX_FILE" ]; then - BASEDIR="$(dirname $0)/../devspace" - - if [ ! -f "$BASEDIR/$INDEX_FILE" ]; then - BASEDIR="$(dirname $0)/../lib/node_modules/devspace" - - if [ ! -f "$BASEDIR/$INDEX_FILE" ]; then - BASEDIR="$(dirname $0)/node_modules/devspace" - - if [ ! -f "$BASEDIR/$INDEX_FILE" ]; then - BASEDIR=$(/usr/bin/env npm root -g)/devspace - - if [ ! -f "$BASEDIR/$INDEX_FILE" ]; then - BASEDIR=$(/usr/bin/env yarn global dir)/node_modules/devspace - - if [ ! -f "$BASEDIR/$INDEX_FILE" ]; then - echo "Unable to find global npm/yarn dir" - exit 1 - fi - fi - fi - fi - fi - fi - - echo "Running: node $BASEDIR/$INDEX_FILE finish-install $BINDIR" - /usr/bin/env node "$BASEDIR/$INDEX_FILE" finish-install $BINDIR; - if [ $? -ne 0 ]; then - exit 1 - fi - - CMD_BIN=$(command -v cmd.exe) - - if [ -f "$CMD_BIN" ] && [ "${CMD_BIN#/mnt/}" = "${CMD_BIN}" ]; then - $BINDIR/devspace.exe "$@" 2>/dev/null || $BINDIR/../../.bin/devspace.exe "$@" 2>/dev/null || devspace.exe "$@"; - else - $BINDIR/devspace "$@" 2>/dev/null|| $BINDIR/../../.bin/devspace "$@" 2>/dev/null || devspace "$@"; - fi - - exit $?; -fi - -devspace "$@"; -exit $?; diff --git a/dist/npm/bin/devspace.cmd b/dist/npm/bin/devspace.cmd deleted file mode 100644 index bfd2c4731d..0000000000 --- a/dist/npm/bin/devspace.cmd +++ /dev/null @@ -1,45 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -WHERE devspace.exe >nul 2>nul -IF %ERRORLEVEL% EQU 0 devspace.exe %* && exit /b %errorlevel% - -echo Finishing installation of DevSpace CLI - -SET bindir=%~dp0 -SET basedir=%~dp0\.. -SET indexFile=\index.js - -echo "!basedir!\!indexFile!" - -IF NOT EXIST "!basedir!\!indexFile!" ( - SET basedir=%~dp0\..\devspace - - IF NOT EXIST "!basedir!\!indexFile!" ( - SET basedir=%~dp0\..\lib\node_modules\devspace - - IF NOT EXIST "!basedir!\!indexFile!" ( - SET basedir=%~dp0\node_modules\devspace - - IF NOT EXIST "!basedir!\!indexFile!" ( - FOR /F "tokens=* USEBACKQ" %%F IN (`npm root -g`) DO ( - SET basedir=%%F\devspace - ) - - IF NOT EXIST "!basedir!\!indexFile!" ( - FOR /F "tokens=* USEBACKQ" %%F IN (`yarn global dir`) DO ( - SET basedir=%%F\node_modules\devspace - ) - - IF NOT EXIST "!basedir!\!indexFile!" ( - echo Unable to find global npm/yarn dir - exit /b 1 - ) - ) - ) - ) - ) -) - -echo Running: node "!basedir!\!indexFile!" finish-install "!bindir!\" -node "!basedir!\!indexFile!" finish-install "!bindir!\" && (!bindir!\devspace.exe %* 2> nul || !bindir!\..\..\.bin\devspace.exe %* 2> nul || devspace.exe %*) diff --git a/dist/npm/config/npmrc b/dist/npm/config/npmrc deleted file mode 100644 index a22935c668..0000000000 --- a/dist/npm/config/npmrc +++ /dev/null @@ -1,3 +0,0 @@ -//npm.devspace.cloud/:_authToken=${NPM_REGISTRY_TOKEN} -//npm.devspace.cloud/:always-auth=true -registry=https://npm.devspace.cloud diff --git a/dist/npm/index.js b/dist/npm/index.js deleted file mode 100644 index 292facdbc6..0000000000 --- a/dist/npm/index.js +++ /dev/null @@ -1,544 +0,0 @@ -#!/usr/bin/env node -const fs = require("fs"); -const https = require("https"); -const path = require("path"); -const execSync = require("child_process").execSync; - -const getSpinner = () => require("cli-spinner").Spinner; -const getInquirer = () => require("inquirer"); -const getFindProcess = () => require("find-process"); - -const downloadPathTemplate = - "https://github.com/devspace-sh/devspace/releases/download/v{{version}}/devspace-{{platform}}-{{arch}}"; -const ARCH_MAPPING = { - ia32: "386", - x64: "amd64", - x86_64: "amd64", - arm: "arm", - arm64: "arm64", - aarch64: "arm" -}; -const PLATFORM_MAPPING = { - darwin: "darwin", - linux: "linux", - win32: "windows", - freebsd: "freebsd" -}; - -if ( - !(process.platform in PLATFORM_MAPPING) || - !(process.arch in ARCH_MAPPING) -) { - console.error( - "Installation is not supported for this platform (" + - process.platform + - ") or architecture (" + - process.arch + - ")" - ); - return; -} -let action; - -if (process.argv && process.argv.length > 2) { - action = process.argv[2]; -} else { - console.error("Please specify a version to publish!"); - return; -} - -if (action === "noop") { - console.log("Successfully ran noop command"); - process.exit(0); -} - -const packageJsonPath = path.join(__dirname, "package.json"); -if (!fs.existsSync(packageJsonPath)) { - console.error("Unable to find package.json"); - return; -} - -const requestHeaders = { - "User-Agent": "devspace-npm-script" -}; -let packageJson = JSON.parse(fs.readFileSync(packageJsonPath)); - -const sanitizeVersion = function(version) { - if (version == null) { - return "latest" - } - - if (version === "") { - return "latest" - } - - if (version.startsWith("v")) { - return version.slice(1) - } - - return version -} - -const getLatestVersion = function (callback) { - const releasesURL = "https://github.com/devspace-sh/devspace/releases/latest"; - https.get(releasesURL, { headers: requestHeaders }, function (res) { - const redirectUrl = res.headers.location; - const matches = redirectUrl && /\/tag\/(.*)$/.exec(redirectUrl); - - if (!matches || matches.length !== 2) { - console.error("Error requesting URL " + releasesURL); - process.exit(1); - } - - const latestVersion = matches[1].replace('v', '') - if (latestVersion) { - callback(latestVersion); - } else { - console.error("Unable to identify latest devspace version"); - process.exit(2); - } - }).on("error", function (err) { - console.error("Error requesting URL " + releasesURL); - console.error(err) - process.exit(1); - }) -}; - -const createSpinner = function (text) { - try { - const Spinner = getSpinner(); - const spinner = new Spinner("%s " + text); - spinner.setSpinnerString("|/-\\"); - return spinner; - } catch (err) { - return { - start: function () { - console.log(text); - }, - stop: function () { } - }; - } -}; - -const downloadFile = function (downloadPath, destination, callback) { - let done = false; - const finish = function (err, res) { - if (done) { - return; - } - - done = true; - callback(err, res); - }; - - https.get(downloadPath, { headers: requestHeaders }, function (res) { - if ( - res.statusCode && - res.statusCode >= 300 && - res.statusCode < 400 && - res.headers.location - ) { - res.resume(); - downloadFile(res.headers.location, destination, callback); - return; - } - - if (res.statusCode !== 200) { - finish(null, res); - return; - } - - const writeStream = fs.createWriteStream(destination) - .on("error", function (err) { - finish(err); - }) - .on("finish", function () { - writeStream.close(function () { - finish(null, res); - }); - }); - - res.on("error", function (err) { - finish(err); - }); - - res.pipe(writeStream); - }).on("error", function (err) { - finish(err); - }); -}; - -if (action === "update-version") { - packageJson.version = sanitizeVersion("" + process.env.RELEASE_VERSION); - - fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 4)); - process.exit(0); - return; -} - -if (action === "get-latest") { - getLatestVersion(function (latestVersion) { - process.stdout.write(latestVersion); - process.exit(0); - }); - return; -} - -if (action === "get-tag") { - let latestVersion = sanitizeVersion("" + process.env.RELEASE_VERSION); - let tagRegex = /^.*-([a-z]*)(\.)?([0-9]*)?$/i - let tag = "latest" - - if (latestVersion.match(tagRegex)) { - tag = latestVersion.replace(tagRegex, "$1") - } - process.stdout.write(tag); - process.exit(0); - return; -} - -/** - * Remove directory recursively - * @param {string} dir_path - * @see https://stackoverflow.com/a/42505874/3027390 - */ -function rimraf(dir_path) { - if (fs.existsSync(dir_path)) { - fs.readdirSync(dir_path).forEach(function (entry) { - let entry_path = path.join(dir_path, entry); - if (fs.lstatSync(entry_path).isDirectory()) { - rimraf(entry_path); - } else { - fs.unlinkSync(entry_path); - } - }); - fs.rmdirSync(dir_path); - } -} - -let continueProcess = function (askRemoveGlobalFolder) { - let version = sanitizeVersion("" + packageJson.version); - let platform = PLATFORM_MAPPING[process.platform]; - let arch = ARCH_MAPPING[process.arch]; - let downloadExtension = ".dl"; - let binaryName = packageJson.name; - - if (platform === PLATFORM_MAPPING.win32) { - binaryName += ".exe"; - } - - let normalizePath = function (p) { - let re = path.normalize(p).replace(/(\r)?\n/g, ""); - - try { - return fs.realpathSync(re); - } catch (e) { - return re; - } - } - - let packageDir = normalizePath(__dirname) - let fallbackGlobalDir = "/usr/local/bin"; - let globalInstall = false; - let globalDir = null; - - if (process.argv.length > 3 && fs.existsSync(normalizePath(process.argv[3]))) { - globalDir = normalizePath(process.argv[3]); - dotBinDir = normalizePath(path.join(globalDir, "..", "..", ".bin")); - - if (fs.existsSync(normalizePath(path.join(dotBinDir, "devspace")))) { - globalDir = normalizePath(dotBinDir); - } - } - - try { - let yarnGlobalDir = normalizePath(path.join(execSync('yarn global dir').toString(), "node_modules")); - let yarnLink = normalizePath(path.join(yarnGlobalDir, packageJson.name)); - let yarnLinkExists = fs.existsSync(yarnLink) && yarnLink === packageDir; - - if (yarnLinkExists || packageDir.startsWith(yarnGlobalDir)) { - try { - globalDir = normalizePath(execSync('yarn global bin').toString()); - globalInstall = true; - } catch (e) { - console.log(e); - } - } - } catch (e) { } - - try { - let npmGlobalDir = normalizePath(execSync('npm root -g').toString()); - let npmLink = normalizePath(path.join(npmGlobalDir, packageJson.name)); - let npmLinkExists = fs.existsSync(npmLink) && npmLink === packageDir; - - if (npmLinkExists || !globalDir || packageDir.startsWith(npmGlobalDir)) { - try { - const nodeDir = normalizePath(execSync('npm config get prefix').toString()); - globalDir = path.join(nodeDir, 'bin') - globalInstall = true; - } catch (e) { - console.error(e); - } - } - } catch (e) { } - - if (globalDir === null) { - if (platform === PLATFORM_MAPPING.win32) { - console.error("Error finding binary installation directory"); - process.exit(3); - } - globalDir = fallbackGlobalDir; - } - - try { - fs.mkdirSync(globalDir, { recursive: true }); - } catch (e) { } - - let binaryPath = path.join(globalDir, binaryName); - if (process.argv.length > 3 && fs.existsSync(normalizePath(process.argv[3]))) { - let binaryDir = normalizePath(process.argv[3]); - let possibleBinaryPath = path.join(binaryDir, binaryName) - if (fs.existsSync(possibleBinaryPath)) { - binaryPath = possibleBinaryPath; - } - } - - try { - fs.unlinkSync(binaryPath + downloadExtension); - } catch (e) { } - - try { - fs.unlinkSync(path.join(globalDir, "." + binaryName + ".old")); - } catch (e) { } - - let removeScripts = function (allScripts) { - if (platform === PLATFORM_MAPPING.win32) { - if (allScripts) { - try { - fs.unlinkSync(binaryPath.replace(/\.exe$/i, "")); - } catch (e) { } - } - - // Remove bin/devspace.ps1 file because it can cause issues - try { - fs.unlinkSync(binaryPath.replace(/\.exe$/i, ".ps1")); - } catch (e) { } - } - } - - if (action === "install") { - removeScripts(false); - - if (platform === PLATFORM_MAPPING.win32) { - if (globalInstall) { - // Remove bin/devspace.cmd file because it can cause issues - try { - fs.unlinkSync(binaryPath.replace(/\.exe$/i, ".cmd")); - } catch (e) { } - - // Copy #PROJECT_DIR/bin/devspace.cmd file to $NPM_GLOBAL/bin/devspace.cmd - try { - fs.copyFileSync(path.join(__dirname, "bin", "devspace.cmd"), binaryPath.replace(/\.exe$/i, ".cmd")); - } catch (e) { } - } - } - } - else if (action === "uninstall") { - try { - fs.unlinkSync(binaryPath); - } catch (e) { } - - try { - fs.unlinkSync(path.join(fallbackGlobalDir, binaryName)); - } catch (e) { } - - // Remove bin/devspace.cmd - try { - fs.unlinkSync(binaryPath.replace(/\.exe$/i, ".cmd")); - } catch (e) { } - - removeScripts(true); - - if (askRemoveGlobalFolder && process.stdout.isTTY) { - const inquirer = getInquirer(); - let removeGlobalFolder = function () { - try { - let homedir = require('os').homedir(); - rimraf(homedir + path.sep + ".devspace"); - } catch (e) { - console.error(e) - } - }; - - inquirer - .prompt([ - { - type: "list", - name: "checkRemoveGlobalFolder", - message: "Do you want to remove the global DevSpace config folder ~/.devspace?", - choices: ["no", "yes"], - }, - ]) - .then(answers => { - if (answers.checkRemoveGlobalFolder === "yes") { - removeGlobalFolder(); - } - }); - } else { - console.warn("DevSpace will not remove the global ~/.devspace folder without asking. This uninstall call is being executed in a non-interactive environment.") - } - } else { - if (action === "finish-install") { - cleanPathVar = process.env.PATH.replace(/(^|;)[a-z]:/gi, path.delimiter).replace(/(\\)+/g, '/'); - cleanGlobalDir = globalDir.replace(/(^|;)[a-z]:/gi, '').replace(/(\\)+/g, '/').trimRight("/"); - - if (cleanPathVar.split(path.delimiter).indexOf(cleanGlobalDir) === -1 && cleanPathVar.split(path.delimiter).indexOf(cleanGlobalDir + "/") === -1) { - console.error("\n\n################################################\nWARNING: npm binary directory NOT in $PATH environment variable: " + globalDir + "\n################################################\n\n"); - - if (globalInstall) { - process.exit(4) - } - } - - const showRootError = function (version) { - console.error("\n############################################"); - console.error( - "Failed to download DevSpace CLI due to permission issues!\n" - ); - console.error("There are two options to fix this:"); - console.error("1. Run this command once: 'sudo devspace'"); - console.error( - "2. Run this command: 'sudo npm uninstall -g devspace && npm install --unsafe-perm=true -g devspace@" + version + "'" - ); - console.error(" You may need to run this command using sudo."); - console.error("############################################\n"); - process.exit(5); - }; - - const downloadRelease = function (version) { - let downloadPath = downloadPathTemplate - .replace("{{version}}", version) - .replace("{{platform}}", platform) - .replace("{{arch}}", arch); - - if (platform === PLATFORM_MAPPING.win32) { - downloadPath += ".exe"; - } - - console.log("Download DevSpace CLI release: " + downloadPath + "\n"); - - const spinner = createSpinner( - "Downloading DevSpace CLI... (this may take a minute)" - ); - spinner.start(); - - downloadFile( - downloadPath, - binaryPath + downloadExtension, - function (err, res) { - if (err) { - spinner.stop(true); - - if (err.code === "EACCES" || err.code === "EPERM") { - console.error("Unable to write stream: " + err) - showRootError(version); - return; - } - - console.error("Error requesting URL: " + downloadPath); - console.error(err); - process.exit(6); - } - - if (!res || res.statusCode !== 200) { - spinner.stop(true); - - if (res && res.statusCode === 404) { - res.resume(); - console.error("Release version " + version + " not found.\n"); - - getLatestVersion(function (latestVersion) { - if (latestVersion !== version) { - console.log( - "Downloading latest stable release instead. Latest version is: " + - latestVersion + - "\n" - ); - - downloadRelease(latestVersion); - } - }); - } else { - if (res) { - res.resume(); - } - - console.error( - "Error requesting URL " + - downloadPath + - " (Status Code: " + - (res && res.statusCode) + - ")" - ); - console.error(res && res.statusMessage); - process.exit(7); - } - - return; - } - - spinner.stop(true); - - try { - fs.chmodSync(binaryPath + downloadExtension, "0755"); - } catch (e) { - console.error("Unable to chmod: " + e) - showRootError(version); - } - - try { - fs.renameSync(binaryPath + downloadExtension, binaryPath); - } catch (e) { - console.log(e); - console.error("\nRenaming release binary failed. Please copy file manually:\n from: " + binaryPath + downloadExtension + "\n to: " + binaryPath + "\n"); - process.exit(8); - } - - removeScripts(true); - } - ); - }; - - downloadRelease(version); - } - } -} - -if (process.ppid > 1) { - try { - const findProcess = getFindProcess(); - findProcess('pid', process.ppid) - .then(function (list) { - if (list.length === 1 && list[0].ppid > 1) { - findProcess('pid', list[0].ppid) - .then(function (list) { - if (list.length === 1 && /((npm-cli.js("|')\s+up(date)?)|(yarn.js("|')\s+(global\s+)?upgrade))\s+.*((\/)|(\\)|(\s))devspace((\/)|(\\)|(\s)|$)/.test(list[0].cmd)) { - continueProcess(false); - } else { - continueProcess(true); - } - }, function () { - continueProcess(true); - }) - } else { - continueProcess(true); - } - }, function () { - continueProcess(true); - }) - } catch (e) { - continueProcess(true); - } -} else { - continueProcess(true); -} diff --git a/dist/npm/package-lock.json b/dist/npm/package-lock.json deleted file mode 100644 index d897ac3672..0000000000 --- a/dist/npm/package-lock.json +++ /dev/null @@ -1,304 +0,0 @@ -{ - "name": "devspace", - "version": "6.1.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "requires": { - "type-fest": "^0.21.3" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" - }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "requires": { - "restore-cursor": "^3.1.0" - } - }, - "cli-spinner": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/cli-spinner/-/cli-spinner-0.2.10.tgz", - "integrity": "sha512-U0sSQ+JJvSLi1pAYuJykwiA8Dsr15uHEy85iCJ6A+0DjVxivr3d+N2Wjvodeg89uP5K6TswFkKBfAD7B3YSn/Q==" - }, - "cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==" - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==" - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" - }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - } - }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "find-process": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/find-process/-/find-process-1.4.7.tgz", - "integrity": "sha512-/U4CYp1214Xrp3u3Fqr9yNynUrr5Le4y0SsJh2lMDDSbpwYSz3M2SMWQC+wqcx79cN8PQtHQIL8KnuY9M66fdg==", - "requires": { - "chalk": "^4.0.0", - "commander": "^5.1.0", - "debug": "^4.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "inquirer": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", - "requires": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.19", - "mute-stream": "0.0.8", - "run-async": "^2.4.0", - "rxjs": "^6.6.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6" - } - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" - }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==" - }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, - "run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==" - }, - "rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "requires": { - "tslib": "^1.9.0" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "requires": { - "os-tmpdir": "~1.0.2" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - } - } -} diff --git a/dist/npm/package.json b/dist/npm/package.json deleted file mode 100644 index 03386aa36a..0000000000 --- a/dist/npm/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "devspace", - "version": "undefined", - "description": "DevSpace CLI - the swiss-army knife for Kubernetes. DevSpace CLI accelerates developing, deploying and debugging applications with Docker and Kubernetes.", - "bin": { - "devspace": "bin/devspace" - }, - "main": "index.js", - "repository": { - "type": "git", - "url": "https://github.com/devspace-sh/devspace" - }, - "homepage": "https://github.com/devspace-sh/devspace", - "scripts": { - "postinstall": "node index.js install", - "preuninstall": "node index.js uninstall", - "prepare": "node index.js update-version", - "test": "node index.js noop" - }, - "dependencies": { - "cli-spinner": "^0.2.10", - "find-process": "^1.4.7", - "inquirer": "^7.0.5", - "node-fetch": "^2.6.7" - }, - "license": "Apache-2.0" -} diff --git a/docs/pages/_partials/install-cli.mdx b/docs/pages/_partials/install-cli.mdx index 35ea691f01..a743e7abc7 100644 --- a/docs/pages/_partials/install-cli.mdx +++ b/docs/pages/_partials/install-cli.mdx @@ -5,10 +5,8 @@ import TabItem from '@theme/TabItem'; DevSpace is a client-only binary. It is super lightweight, does not require any server-side component, and it does not have any dependencies. - - -```bash -npm install -g devspace -``` - - - - -```bash -yarn global add devspace -``` - - ```bash