-
Notifications
You must be signed in to change notification settings - Fork 99
Dev to release #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev to release #136
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |||||||||||||||||||||||||||
| # Creates a single universal package for both Chrome Web Store and Edge Add-ons | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| param( | ||||||||||||||||||||||||||||
| [string]$Version = '1.1.0', | ||||||||||||||||||||||||||||
| [string]$Version = '1.2.0', | ||||||||||||||||||||||||||||
| [string]$OutputPath = 'store-packages' | ||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
@@ -16,127 +16,161 @@ if (!(Test-Path $OutputPath)) { | |||||||||||||||||||||||||||
| # Determine source directory based on script location | ||||||||||||||||||||||||||||
| $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path | ||||||||||||||||||||||||||||
| $sourceDir = $scriptDir # Script is in the root directory | ||||||||||||||||||||||||||||
| $tempDir = Join-Path $env:TEMP 'check-extension-package' | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Write-Host '📦 Preparing universal store package...' -ForegroundColor Yellow | ||||||||||||||||||||||||||||
| $devFilesToRemove = @( | ||||||||||||||||||||||||||||
| '*.md', | ||||||||||||||||||||||||||||
| '*.log', | ||||||||||||||||||||||||||||
| '.DS_Store', | ||||||||||||||||||||||||||||
| 'Thumbs.db', | ||||||||||||||||||||||||||||
| '*.tmp' | ||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Clean temp directory | ||||||||||||||||||||||||||||
| if (Test-Path $tempDir) { | ||||||||||||||||||||||||||||
| Remove-Item $tempDir -Recurse -Force | ||||||||||||||||||||||||||||
| function Remove-DevelopmentFiles { | ||||||||||||||||||||||||||||
| param( | ||||||||||||||||||||||||||||
| [string]$TargetDir | ||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| foreach ($pattern in $devFilesToRemove) { | ||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||
|
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 | |
| 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
AI
Apr 7, 2026
There was a problem hiding this comment.
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.
| $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
AI
Apr 7, 2026
There was a problem hiding this comment.
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.
| $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
AI
Apr 7, 2026
There was a problem hiding this comment.
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
AI
Apr 7, 2026
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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.