Skip to content
Draft
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
33 changes: 33 additions & 0 deletions .config/.vsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
"Microsoft.Component.MSBuild",
"Microsoft.VisualStudio.Component.CoreBuildTools",
"Microsoft.VisualStudio.Workload.MSBuildTools",
"Microsoft.VisualStudio.Component.Windows10SDK",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Windows10SDK and Windows10SDK.20348 can be removed. Other scan definitely be removed as well, but I"m not sure that we need 3 windows SDK's installed.

For the record this is the winget command I used to install only the essentials: winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre --add Microsoft.VisualStudio.Component.VC.ATL.Spectre --add Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TylerLeonhardt found that we needed Windows10 SDK for arm machines, i'm not sure if anyone knows why.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I got the idea from @amunger , not sure if he knows why

Copy link
Contributor

@amunger amunger Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During the node-gyp run, there was a log saying I didn't have the win SDK, despite win11 SDK being installed, so I tried win10 and that worked. That's the best explanation I have.
but yes, seems to be particular to win on ARM

"Microsoft.VisualStudio.Component.VC.CoreBuildTools",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.VC.Redist.14.Latest",
"Microsoft.VisualStudio.Component.Windows11SDK.26100",
"Microsoft.VisualStudio.Component.VC.CMake.Project",
"Microsoft.VisualStudio.Component.TestTools.BuildTools",
"Microsoft.VisualStudio.Component.VC.ASAN",
"Microsoft.VisualStudio.Component.TextTemplating",
"Microsoft.VisualStudio.Component.VC.CoreIde",
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
"Microsoft.VisualStudio.Component.Vcpkg",
"Microsoft.VisualStudio.Component.Windows10SDK.20348",
"Microsoft.VisualStudio.Workload.VCTools",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64EC",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.VC.ATL.ARM64.Spectre",
"Microsoft.VisualStudio.Component.VC.ATL.Spectre",
"Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre",
"Microsoft.VisualStudio.Component.VC.MFC.ARM64.Spectre",
"Microsoft.VisualStudio.Component.VC.Runtimes.ARM64EC.Spectre",
"Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre",
"Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre"
],
"extensions": []
}
150 changes: 150 additions & 0 deletions .config/configuration.winget
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
assertions:
- resource: Microsoft.Windows.Developer/OsVersion
directives:
description: Verify Windows 11 for VS Code development
allowPrerelease: true
settings:
MinVersion: '10.0.22000'
resources:
# Enable Developer Mode for Windows development
- resource: Microsoft.Windows.Settings/WindowsSettings
id: developerMode
directives:
description: Enable Developer Mode for development tools and debugging
allowPrerelease: true
securityContext: elevated
settings:
DeveloperMode: true

# Install Git version control sgsystem
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: gitPackage
directives:
description: Install Git for version control
allowPrerelease: true
settings:
id: Git.Git
source: winget

# Install Node.js (LTS version >=20.x)
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: nodePackage
directives:
description: Install Node.js LTS for VS Code development
allowPrerelease: true
settings:
id: OpenJS.NodeJS.LTS
source: winget

# Install Python for node-gyp
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: pythonPackage
directives:
description: Install Python for node-gyp native module compilation
allowPrerelease: true
settings:
id: Python.Python.3.12
source: winget

# Install Visual Studio Build Tools 2022
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: vsBuildTools
directives:
description: Install Visual Studio Build Tools 2022 for C++ compilation
allowPrerelease: true
securityContext: elevated
settings:
id: Microsoft.VisualStudio.2022.BuildTools
source: winget

# Configure Visual Studio components using .vsconfig
- resource: Microsoft.VisualStudio.DSC/VSComponents
dependsOn:
- vsBuildTools
directives:
description: Install required VS workloads and components for VS Code development
allowPrerelease: true
securityContext: elevated
settings:
productId: Microsoft.VisualStudio.Product.BuildTools
channelId: VisualStudio.17.Release
vsConfigFile: '${WinGetConfigRoot}\.vsconfig'
includeRecommended: true

# Set npm Visual Studio version configuration
- resource: PSDesiredStateConfiguration/Script
dependsOn:
- nodePackage
- vsBuildTools
directives:
description: Configure npm to use Visual Studio 2022
allowPrerelease: true
settings:
GetScript: |
$config = npm config get msvs_version
return @{ Result = $config }
TestScript: |
$config = npm config get msvs_version
return $config -eq "2022"
SetScript: |
npm config set msvs_version 2022
npm config set python python
Comment on lines +92 to +93
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm config set msvs_version 2022
npm config set python python
$npmrc = "$env:USERPROFILE\.npmrc"
if (Test-Path $npmrc) {
(Get-Content $npmrc) -replace '^msvs_version=.*$', 'msvs_version=2022' | Set-Content $npmrc
if (-not (Select-String -Path $npmrc -Pattern '^msvs_version=')) {
Add-Content $npmrc "`nmsvs_version=2022"
}
} else {
Set-Content $npmrc "msvs_version=2022"
}

npm config set msvs_version throws an error every time (I saw this while coming up with the AI script as well). I suggested the solution I came up with. Also I noticed you don't need to set python to get the build & run to work. Is that needed for something else?


# Install Visual Studio Code (optional but helpful)
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: vscodePackage
directives:
description: Install Visual Studio Code editor
allowPrerelease: true
settings:
id: Microsoft.VisualStudioCode
source: winget

# Install Windows Terminal (modern terminal experience)
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: terminalPackage
directives:
description: Install Windows Terminal for better command line experience
allowPrerelease: true
settings:
id: Microsoft.WindowsTerminal
source: winget

# Install PowerShell 7+ (modern PowerShell)
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: powershellPackage
directives:
description: Install PowerShell 7+ for modern shell experience
allowPrerelease: true
settings:
id: Microsoft.PowerShell
source: winget

# Set up Python setuptools (recommended in the guide)
- resource: PSDesiredStateConfiguration/Script
dependsOn:
- pythonPackage
directives:
description: Install Python setuptools for better node-gyp compatibility
allowPrerelease: true
settings:
GetScript: |
try {
$result = python -m pip show setuptools
return @{ Result = "installed" }
} catch {
return @{ Result = "not installed" }
}
TestScript: |
try {
$result = python -m pip show setuptools
return $true
} catch {
return $false
}
Comment on lines +141 to +146
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
try {
$result = python -m pip show setuptools
return $true
} catch {
return $false
}
$result = python -m pip show setuptools 2>&1
if ($result -notmatch "not found") {
return $true
} else {
return $false
}

The try catch solution was throwing errors when installing

SetScript: |
python -m pip install setuptools

configurationVersion: 0.2.0