Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/ripe-papers-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@node-core/ui-components': minor
'@node-core/website-i18n': patch
---

Add the Vite+ installation method icon and description.
27 changes: 14 additions & 13 deletions apps/site/components/Downloads/Release/ReleaseCodeBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,20 @@ const useSnippetProcessor = (
context.release.major >= 25 &&
snippets.find(({ name }) => name === 'corepack');

// Combine and parse snippets
const parsedContent = parseSnippet(
[
installMethodSnippet,
verifyNodeSnippet,
installCorepackSnippet,
packageManagerSnippet,
]
.filter(Boolean)
.map(snippet => (snippet as DownloadSnippet).content)
.join('\n'),
context
);
// Parse snippets individually, skipping those that render empty
const parsedContent = [
installMethodSnippet,
verifyNodeSnippet,
installCorepackSnippet,
packageManagerSnippet,
]
.filter(Boolean)
.map(snippet =>
parseSnippet((snippet as DownloadSnippet).content, context)
)
.map(content => content.trim())
.filter(Boolean)
.join('\n\n');

// Convert to HTML using Shiki's highlighter
// This is faster than JSX rendering as it avoids React runtime overhead
Expand Down
7 changes: 5 additions & 2 deletions apps/site/snippets/en/download/corepack.bash
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Install Corepack:
npm install -g corepack
${props.installMethod === 'VP' ?
'' :
`# Install Corepack:
npm install -g corepack`
}
7 changes: 5 additions & 2 deletions apps/site/snippets/en/download/pnpm.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Download and install pnpm:
corepack enable pnpm
${props.installMethod === 'VP' ?
'' :
`# Download and install pnpm:
corepack enable pnpm`
}

# Verify pnpm version:
pnpm -v
14 changes: 14 additions & 0 deletions apps/site/snippets/en/download/vp.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Download and install Vite+
${props.os === 'WIN' ?
'$env:VP_NODE_MANAGER = "yes"\nirm https://vite.plus/ps1 | iex' :
'curl -fsSL https://vite.plus | VP_NODE_MANAGER=yes bash'
}

# In lieu of restarting the shell
${props.os === 'WIN'
? '. "$env:APPDATA\\vite-plus\\env.ps1"'
: '. "${XDG_CONFIG_HOME:-$HOME/.config}/vite-plus/env"'
}

# Download and install Node.js:
vp env default ${props.release.version}
7 changes: 5 additions & 2 deletions apps/site/snippets/en/download/yarn.bash
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Download and install Yarn:
corepack enable yarn
${props.installMethod === 'VP' ?
'' :
`# Download and install Yarn:
corepack enable yarn`
}

# Verify Yarn version:
yarn -v
2 changes: 1 addition & 1 deletion apps/site/types/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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';
'NVM' | 'FNM' | 'BREW' | 'DOCKER' | 'CHOCO' | 'N' | 'ASDF' | 'VP';
export type PackageManager = 'NPM' | 'YARN' | 'PNPM';

// Items with a pipe/default value mean that they are auto inferred
Expand Down
10 changes: 10 additions & 0 deletions apps/site/util/download/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@
},
"url": "https://asdf-vm.com/guide/getting-started.html",
"info": "layouts.download.codeBox.platformInfo.asdf"
},
{
"id": "VP",
"icon": "VitePlus",
"name": "Vite+",
"compatibility": {
"os": ["WIN", "MAC", "LINUX"]
},
"url": "https://viteplus.dev/",
"info": "layouts.download.codeBox.platformInfo.vp"
}
],
"packageManagers": [
Expand Down
3 changes: 2 additions & 1 deletion packages/i18n/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@
"choco": "Chocolatey is a package manager for Windows.",
"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."
"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."
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import {
NVM,
Choco,
N,
VitePlus,
Volta,
} 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, VitePlus, Volta];

export const PlatformLogos: StoryObj = {
render: () => (
Expand Down
Loading
Loading