Add manifest v2->v3 converter + Rollup bundling
Adds a best-effort manifest v2 -> v3 converter, optional service-worker bundling via Rollup, a VS Code workspace file, and a short WORKSPACE_README.md explaining usage.
Files changed:
-
scripts/convert-manifest.js(converter, --bundle-sw support, warnings) -
scripts/rollup.config.js(rollup config to bundle background scripts) -
package.json(bundle script + devDependencies) -
youtube.code-workspace(workspace settings) -
WORKSPACE_README.md(how to open workspace & run converter)
How to test locally:
- Install dev deps (use legacy peer deps if npm complains):
npm install --legacy-peer-deps
- Run the converter with bundling enabled:
node scripts/convert-manifest.js --input build/manifest2.json --output build/manifest3.json --bundle-sw
- Verify outputs (not committed):
-
build/manifest3.json— checkmanifest_version: 3,background.service_workerandhost_permissions. -
build/generated_service_worker.js— review the generated bundle for APIs incompatible with MV3.
Notes & cautions:
- The converter is heuristic. Please review Content Security Policy,
webRequestusage, and any APIs that require adaptation for Manifest V3 (e.g., usedeclarativeNetRequestfor blocking network requests). - The generated service worker is created by Rollup (or a fallback importScripts wrapper). Test thoroughly in Chrome/Chromium with the extension loaded unpacked.
- Build outputs were intentionally not committed. If maintainers want the bundle generated as part of CI, consider adding a CI job that runs
npm ci && npm run bundle-swand artifacts publishing.
CI workflow added:
- A GitHub Actions workflow
.github/workflows/manifest-v3.ymlwas added in this branch. It runs on pull requests andfeature/**pushes and performs:-
npm ci --legacy-peer-deps -
node scripts/convert-manifest.js --input build/manifest2.json --output build/manifest3.json --bundle-sw -
node scripts/validate-manifest3.js build/manifest3.json
-
This workflow bundles the service worker and validates the generated manifest3.json. It fails the check if manifest_version !== 3 or if background.service_worker is missing.
Suggested follow-ups:
- Add an explicit CI artifact upload if maintainers want the generated bundle attached to the job.
- Consider adding
"type": "module"topackage.jsonto avoid a Rollup ES module warning during action runs.
If you prefer, I can add the CI artifact step or adjust triggers to run only for PRs targeting master in the upstream repo.
Testing & review instructions for this PR
Quick test (local):
- Install dev deps (use legacy peer deps if npm complains):
npm install --legacy-peer-deps
- Run the converter with bundling enabled:
node scripts/convert-manifest.js --input build/manifest2.json --output build/manifest3.json --bundle-sw
- Verify outputs (not committed):
-
build/manifest3.json— checkmanifest_version: 3,background.service_workerandhost_permissions. -
build/generated_service_worker.js— review the generated bundle for APIs incompatible with MV3.
Notes & cautions:
- The converter is heuristic. Please review Content Security Policy,
webRequestusage, and any APIs that require adaptation for Manifest V3 (e.g., usedeclarativeNetRequestfor blocking network requests). - The generated service worker is created by Rollup (or a fallback importScripts wrapper). Test thoroughly in Chrome/Chromium with the extension loaded unpacked.
- Build outputs were intentionally not committed. If maintainers want the bundle generated as part of CI, consider adding a CI job that runs
npm ci && npm run bundle-swand artifacts publishing.
Suggested follow-ups:
- Add CI step to validate
manifest3.jsonschema and smoke-test the bundle. - Consider adding
"type": "module"topackage.jsonto remove the Rollup ES-module warning in Node.
If you want, I can add the CI job or update the PR description with this checklist.
Kurzinfo: Die CI-Artefakt-Automation ist nun aktiv.
- Bei PR-Updates oder Pushes auf dieser Branch erzeugt der Workflow ein Bundle und lädt Artefakte hoch.
- Die Action postet einen Kommentar mit dem Download-Link, fügt das Label
artifact-readyhinzu und weist den PR-Autor sowie angeforderte Reviewer als Assignees zu.
Trigger: Push oder Update der PR (z. B. ein zusätzlicher Commit).
Wenn du eine andere Farbe, Namen oder zusätzliche Empfänger möchtest, sag kurz Bescheid.
hi! @simon1st25 https://github.com/code-charity/Bulk-Contributor https://github.com/code-charity/Manifest-v3