From 78e2cab3ea4024acdff13b24751c97459056f4e6 Mon Sep 17 00:00:00 2001 From: Bastian Eicher Date: Tue, 28 Jul 2026 12:43:49 +0200 Subject: [PATCH] feat: add 0install as an installation method on the downloads page 0install is a cross-platform decentralized package manager. Applications are packaged as "feeds": XML files listing available versions, where to download them, and how to extract and execute them. The 0install project maintains a feed for Node.js: https://apps.0install.net/javascript/node.xml This adds 0install alongside the other community installation methods such as asdf and Chocolatey. --- .changeset/jolly-eagles-retire.md | 2 + .../snippets/en/download/zeroinstall.bash | 13 + apps/site/types/release.ts | 10 +- apps/site/util/download/constants.json | 10 + packages/i18n/src/locales/en.json | 3 +- .../__design__/platform-logos.stories.tsx | 12 +- .../Icons/InstallationMethod/ZeroInstall.tsx | 283 ++++++++++++++++++ .../src/Icons/InstallationMethod/index.ts | 3 +- 8 files changed, 332 insertions(+), 4 deletions(-) create mode 100644 .changeset/jolly-eagles-retire.md create mode 100644 apps/site/snippets/en/download/zeroinstall.bash create mode 100644 packages/ui-components/src/Icons/InstallationMethod/ZeroInstall.tsx diff --git a/.changeset/jolly-eagles-retire.md b/.changeset/jolly-eagles-retire.md new file mode 100644 index 0000000000000..a845151cc8400 --- /dev/null +++ b/.changeset/jolly-eagles-retire.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/apps/site/snippets/en/download/zeroinstall.bash b/apps/site/snippets/en/download/zeroinstall.bash new file mode 100644 index 0000000000000..a8e51a5044156 --- /dev/null +++ b/apps/site/snippets/en/download/zeroinstall.bash @@ -0,0 +1,13 @@ +# Get 0install: +${props.os === 'WIN' ? 'winget install 0install' : 'curl -O https://get.0install.net/0install.sh && chmod +x 0install.sh\n./0install.sh\nexport PATH=$HOME/bin:$PATH'} + +# Add Node.js and npm to PATH: +0install add node https://apps.0install.net/javascript/node.xml --version=${props.release.version} +0install add npm https://apps.0install.net/javascript/node.xml --command=npm --version=${props.release.version} +0install add npx https://apps.0install.net/javascript/node.xml --command=npx --version=${props.release.version} + +# Enable global package installation: +npm config set prefix ${props.os === 'WIN' ? '"$env:appdata\\npm"' : '~/.npm-global'} + +# Make globally installed commands runnable (add to your profile to persist): +${props.os === 'WIN' ? '$env:PATH = "$env:appdata\\npm;$env:PATH"' : 'export PATH=~/.npm-global/bin:$PATH'} diff --git a/apps/site/types/release.ts b/apps/site/types/release.ts index c3d3e350993ee..49782c377c020 100644 --- a/apps/site/types/release.ts +++ b/apps/site/types/release.ts @@ -3,7 +3,15 @@ import type { NodeRelease } from '#site/types/releases'; import type { OperatingSystem, Platform } from '#site/types/userAgent'; export type InstallationMethod = - 'NVM' | 'FNM' | 'BREW' | 'DOCKER' | 'CHOCO' | 'N' | 'ASDF' | 'VP'; + | 'NVM' + | 'FNM' + | 'BREW' + | 'DOCKER' + | 'CHOCO' + | 'N' + | 'ASDF' + | 'VP' + | 'ZEROINSTALL'; export type PackageManager = 'NPM' | 'YARN' | 'PNPM'; // Items with a pipe/default value mean that they are auto inferred diff --git a/apps/site/util/download/constants.json b/apps/site/util/download/constants.json index bb6d21570f6e8..0a55162be140a 100644 --- a/apps/site/util/download/constants.json +++ b/apps/site/util/download/constants.json @@ -206,6 +206,16 @@ }, "url": "https://viteplus.dev/", "info": "layouts.download.codeBox.platformInfo.vp" + }, + { + "id": "ZEROINSTALL", + "icon": "ZeroInstall", + "name": "0install", + "compatibility": { + "os": ["WIN", "MAC", "LINUX"] + }, + "url": "https://0install.net/", + "info": "layouts.download.codeBox.platformInfo.zeroinstall" } ], "packageManagers": [ diff --git a/packages/i18n/src/locales/en.json b/packages/i18n/src/locales/en.json index baa59378ee880..e0e60db3cd1f9 100644 --- a/packages/i18n/src/locales/en.json +++ b/packages/i18n/src/locales/en.json @@ -260,7 +260,8 @@ "docker": "Docker is a containerization platform.", "n": "\"n\" is a cross-platform Node.js version manager.", "asdf": "\"asdf\" is a cross-platform version manager that supports multiple languages.", - "vp": "\"Vite+\" is a unified toolchain for web development with Node.js version management." + "vp": "\"Vite+\" is a unified toolchain for web development with Node.js version management.", + "zeroinstall": "0install is a cross-platform decentralized package manager." } } }, diff --git a/packages/ui-components/__design__/platform-logos.stories.tsx b/packages/ui-components/__design__/platform-logos.stories.tsx index 07fb222e5cc63..c330e4aaa3ed8 100644 --- a/packages/ui-components/__design__/platform-logos.stories.tsx +++ b/packages/ui-components/__design__/platform-logos.stories.tsx @@ -6,13 +6,23 @@ import { N, VitePlus, Volta, + ZeroInstall, } from '#ui/Icons/InstallationMethod'; import { Apple, Linux, Microsoft, AIX } from '#ui/Icons/OperatingSystem'; import type { Meta as MetaObj, StoryObj } from '@storybook/react-webpack5'; const osIcons = [Apple, Linux, Microsoft, AIX]; -const installMethodIcons = [Docker, Homebrew, NVM, Choco, N, VitePlus, Volta]; +const installMethodIcons = [ + Docker, + Homebrew, + NVM, + Choco, + N, + VitePlus, + Volta, + ZeroInstall, +]; export const PlatformLogos: StoryObj = { render: () => ( diff --git a/packages/ui-components/src/Icons/InstallationMethod/ZeroInstall.tsx b/packages/ui-components/src/Icons/InstallationMethod/ZeroInstall.tsx new file mode 100644 index 0000000000000..34e5e6fef3b8e --- /dev/null +++ b/packages/ui-components/src/Icons/InstallationMethod/ZeroInstall.tsx @@ -0,0 +1,283 @@ +// Ref: https://github.com/0install/docs/blob/master/docs/img/logo.svg +import type { FC, SVGProps } from 'react'; + +const ZeroInstall: FC> = props => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +); + +export default ZeroInstall; diff --git a/packages/ui-components/src/Icons/InstallationMethod/index.ts b/packages/ui-components/src/Icons/InstallationMethod/index.ts index 5de06821e9d99..df5d0c79f3e83 100644 --- a/packages/ui-components/src/Icons/InstallationMethod/index.ts +++ b/packages/ui-components/src/Icons/InstallationMethod/index.ts @@ -6,5 +6,6 @@ import N from '#ui/Icons/InstallationMethod/N'; import NVM from '#ui/Icons/InstallationMethod/NVM'; import VitePlus from '#ui/Icons/InstallationMethod/VitePlus'; import Volta from '#ui/Icons/InstallationMethod/Volta'; +import ZeroInstall from '#ui/Icons/InstallationMethod/ZeroInstall'; -export { Choco, Docker, FNM, Homebrew, N, NVM, VitePlus, Volta }; +export { Choco, Docker, FNM, Homebrew, N, NVM, VitePlus, Volta, ZeroInstall };