From 572ff80fb1667f371c6bde1d42159e2256875095 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. --- .../snippets/en/download/zeroinstall.bash | 12 + apps/site/types/release.ts | 3 +- apps/site/util/download/constants.json | 10 + packages/i18n/src/locales/en.json | 3 +- .../__design__/platform-logos.stories.tsx | 11 +- .../Icons/InstallationMethod/ZeroInstall.tsx | 282 ++++++++++++++++++ .../src/Icons/InstallationMethod/index.ts | 3 +- 7 files changed, 320 insertions(+), 4 deletions(-) create mode 100644 apps/site/snippets/en/download/zeroinstall.bash create mode 100644 packages/ui-components/src/Icons/InstallationMethod/ZeroInstall.tsx diff --git a/apps/site/snippets/en/download/zeroinstall.bash b/apps/site/snippets/en/download/zeroinstall.bash new file mode 100644 index 0000000000000..d69b3be8e6e6d --- /dev/null +++ b/apps/site/snippets/en/download/zeroinstall.bash @@ -0,0 +1,12 @@ +# For instructions how to get 0install, please see https://get.0install.net/. +${props.os === 'WIN' ? '\n# Download specific Node.js version:\n0install download https://apps.0install.net/javascript/node.xml --version=' + props.release.version + ' --pin\n' : ''} +# Add Node.js and NPM to PATH: +0install add node https://apps.0install.net/javascript/node.xml${props.os === 'WIN' ? '' : ' --version=' + props.release.version} +0install add npm https://apps.0install.net/javascript/node.xml --command=npm${props.os === 'WIN' ? '' : ' --version=' + props.release.version} +0install add npx https://apps.0install.net/javascript/node.xml --command=npx${props.os === 'WIN' ? '' : ' --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 9ffc705f73490..7a47036e0f576 100644 --- a/apps/site/types/release.ts +++ b/apps/site/types/release.ts @@ -9,7 +9,8 @@ export type InstallationMethod = | 'DOCKER' | 'CHOCO' | 'N' - | 'ASDF'; + | 'ASDF' + | '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 1a349025d003c..17102b92984d2 100644 --- a/apps/site/util/download/constants.json +++ b/apps/site/util/download/constants.json @@ -196,6 +196,16 @@ }, "url": "https://asdf-vm.com/guide/getting-started.html", "info": "layouts.download.codeBox.platformInfo.asdf" + }, + { + "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 72694ac172947..a85677b55e910 100644 --- a/packages/i18n/src/locales/en.json +++ b/packages/i18n/src/locales/en.json @@ -302,7 +302,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.", - "volta": "\"Volta\" is a cross-platform Node.js version manager." + "volta": "\"Volta\" is a cross-platform Node.js version manager.", + "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 650a9a9b21b5e..d30380a99c625 100644 --- a/packages/ui-components/__design__/platform-logos.stories.tsx +++ b/packages/ui-components/__design__/platform-logos.stories.tsx @@ -5,13 +5,22 @@ import { Choco, N, 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, Volta]; +const installMethodIcons = [ + Docker, + Homebrew, + NVM, + Choco, + N, + 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..60315b92ea869 --- /dev/null +++ b/packages/ui-components/src/Icons/InstallationMethod/ZeroInstall.tsx @@ -0,0 +1,282 @@ +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 5e8bd693bb9a1..657801da0824d 100644 --- a/packages/ui-components/src/Icons/InstallationMethod/index.ts +++ b/packages/ui-components/src/Icons/InstallationMethod/index.ts @@ -5,5 +5,6 @@ import Homebrew from '#ui/Icons/InstallationMethod/Homebrew'; import N from '#ui/Icons/InstallationMethod/N'; import NVM from '#ui/Icons/InstallationMethod/NVM'; import Volta from '#ui/Icons/InstallationMethod/Volta'; +import ZeroInstall from '#ui/Icons/InstallationMethod/ZeroInstall'; -export { Choco, Docker, FNM, Homebrew, N, NVM, Volta }; +export { Choco, Docker, FNM, Homebrew, N, NVM, Volta, ZeroInstall };