Skip to content

Dev to release#136

Merged
KelvinTegelaar merged 2 commits intomainfrom
dev
Apr 7, 2026
Merged

Dev to release#136
KelvinTegelaar merged 2 commits intomainfrom
dev

Conversation

@KelvinTegelaar
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 7, 2026 11:51
@KelvinTegelaar KelvinTegelaar merged commit 894ecdb into main Apr 7, 2026
3 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the store packaging PowerShell script to support building separate release ZIPs for Chrome/Edge and Firefox, and bumps the default version used for packaging.

Changes:

  • Refactors packaging into reusable functions and introduces a shared include list for packaging.
  • Produces two ZIP artifacts: a universal Chrome/Edge package and a Firefox-specific package (with manifest renaming).
  • Adds a development-file cleanup step and tweaks manifest/options handling during packaging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +34 to +38
Get-ChildItem $TargetDir -Name $pattern -Recurse -Force 2>$null | ForEach-Object {
$fullPath = Join-Path $TargetDir $_
if (Test-Path $fullPath) {
Remove-Item $fullPath -Force
Write-Host "Removed dev file: $_" -ForegroundColor Gray
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

Get-ChildItem $TargetDir -Name $pattern -Recurse does not filter by $pattern (the -Name switch is being given an argument), so this will enumerate essentially all items under $TargetDir. As a result, the loop can end up deleting most of the package contents. Use -Filter $pattern (or -Include $pattern with -File) and avoid passing a value to -Name (or drop -Name entirely and use .FullName).

Suggested change
Get-ChildItem $TargetDir -Name $pattern -Recurse -Force 2>$null | ForEach-Object {
$fullPath = Join-Path $TargetDir $_
if (Test-Path $fullPath) {
Remove-Item $fullPath -Force
Write-Host "Removed dev file: $_" -ForegroundColor Gray
Get-ChildItem -Path $TargetDir -Filter $pattern -Recurse -Force -File 2>$null | ForEach-Object {
if (Test-Path $_.FullName) {
Remove-Item $_.FullName -Force
Write-Host "Removed dev file: $($_.FullName)" -ForegroundColor Gray

Copilot uses AI. Check for mistakes.
Comment on lines +94 to +97
$manifest = Get-Content $manifestPath | ConvertFrom-Json
$manifest.version = $Version
$manifest.content_security_policy = @{
extension_pages = "script-src 'self'; object-src 'self'"
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The script overwrites manifest.content_security_policy with script-src 'self'; object-src 'self', but the checked-in manifests allow Google Fonts (fonts.googleapis.com/fonts.gstatic.com) and style-src 'unsafe-inline', and extension pages (e.g., popup/options/blocked) reference those resources. This packaging step will likely break UI rendering in the store builds unless the pages are updated to self-host assets or the CSP merge preserves the required directives.

Suggested change
$manifest = Get-Content $manifestPath | ConvertFrom-Json
$manifest.version = $Version
$manifest.content_security_policy = @{
extension_pages = "script-src 'self'; object-src 'self'"
$manifest = Get-Content $manifestPath -Raw | ConvertFrom-Json
$manifest.version = $Version
if ($null -eq $manifest.content_security_policy) {
$manifest.content_security_policy = @{
extension_pages = "script-src 'self'; object-src 'self'"
}

Copilot uses AI. Check for mistakes.
Comment on lines +108 to +110
$content = $content -replace 'const DEVELOPMENT_MODE = true', 'const DEVELOPMENT_MODE = false'
$content | Set-Content $optionsPath -Encoding UTF8
Write-Host '✅ Disabled development mode in options.js' -ForegroundColor Green
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The script attempts to disable development mode by replacing const DEVELOPMENT_MODE = true, but options/options.js does not contain that string, so this will not change anything while still logging success. Consider either removing this step, updating it to match the current mechanism, or validating that the replacement actually occurred before writing the "Disabled development mode" message.

Suggested change
$content = $content -replace 'const DEVELOPMENT_MODE = true', 'const DEVELOPMENT_MODE = false'
$content | Set-Content $optionsPath -Encoding UTF8
Write-Host '✅ Disabled development mode in options.js' -ForegroundColor Green
$developmentModeEnabled = 'const DEVELOPMENT_MODE = true'
$developmentModeDisabled = 'const DEVELOPMENT_MODE = false'
if ($content.Contains($developmentModeEnabled)) {
$content = $content.Replace($developmentModeEnabled, $developmentModeDisabled)
$content | Set-Content $optionsPath -Encoding UTF8
Write-Host '✅ Disabled development mode in options.js' -ForegroundColor Green
} else {
Write-Host '⚠️ Could not find development mode flag in options.js; no changes made' -ForegroundColor Yellow
}

Copilot uses AI. Check for mistakes.
Comment on lines +118 to +122
Compress-Archive -Path "$tempDir\*" -DestinationPath $packagePath
Remove-Item $tempDir -Recurse -Force

# Create the package
$packageName = "check-extension-v$Version.zip"
$packagePath = Join-Path $OutputPath $packageName
$size = [math]::Round((Get-Item $packagePath).Length / 1MB, 2)
Write-Host "✅ Created package: $PackageName ($size MB)" -ForegroundColor Green
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

If Compress-Archive fails, the script still removes $tempDir and then calls Get-Item $packagePath, which will throw and also removes the build artifacts needed for debugging. Consider using -ErrorAction Stop plus try/catch/finally so cleanup happens reliably, but only after you’ve confirmed the archive was created (and report a clear error when it isn’t).

Copilot uses AI. Check for mistakes.
Write-Host ' 🦊 Firefox Add-ons: https://addons.mozilla.org/developers/' -ForegroundColor Cyan
Write-Host '3. Note the assigned extension IDs from each store' -ForegroundColor White
Write-Host '4. Update enterprise registry files with store IDs:' -ForegroundColor White
Write-Host ' .\Update-StoreIDs.ps1 -ChromeID <chrome-id> -EdgeID <edge-id>' -ForegroundColor Gray
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

The usage hint for Update-StoreIDs.ps1 uses parameter names -ChromeID / -EdgeID, but Update-StoreIDs.ps1 defines -ChromeExtensionId / -EdgeExtensionId (and -FirefoxExtensionId). Update this line so users can copy/paste a working command.

Suggested change
Write-Host ' .\Update-StoreIDs.ps1 -ChromeID <chrome-id> -EdgeID <edge-id>' -ForegroundColor Gray
Write-Host ' .\Update-StoreIDs.ps1 -ChromeExtensionId <chrome-id> -EdgeExtensionId <edge-id> -FirefoxExtensionId <firefox-id>' -ForegroundColor Gray

Copilot uses AI. Check for mistakes.
@@ -2,7 +2,7 @@
# Creates a single universal package for both Chrome Web Store and Edge Add-ons
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

Header comment says this script "Creates a single universal package for both Chrome Web Store and Edge Add-ons", but the script now also builds a separate Firefox ZIP. Update the header comment to match the current behavior so the script’s purpose is accurate.

Suggested change
# Creates a single universal package for both Chrome Web Store and Edge Add-ons
# Creates a universal package for Chrome Web Store and Edge Add-ons, plus a separate Firefox ZIP

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants