Skip to content
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

Add MV3 types and JSON schema #89

Merged
merged 9 commits into from
Aug 4, 2021
Merged

Add MV3 types and JSON schema #89

merged 9 commits into from
Aug 4, 2021

Conversation

jacksteamdev
Copy link
Contributor

This PR adds a JSON schema for Manifest Version 3 and upgrades @types/chrome to support MV3 in TypeScript files.

JSON Schema

The schema uses Draft 7 instead of Draft 4 to support conditional subschemas.

TypeScript

Some refactoring was required to use the upgraded chrome types.

  • chrome.runtime.Manifest is used in contexts unaffected by the transition.
  • chrome.runtime.ManifestV2 is used in MV2 specific contexts.
  • chrome.runtime.ManifestV3 is for MV3 specific contexts.

The final goal is to use chrome.runtime.Manifest in source code, and only use the more specific interfaces for version specific tests.

@jacksteamdev jacksteamdev added enhancement New feature or request mv3 labels Aug 4, 2021
@jacksteamdev jacksteamdev merged commit fc83a2f into beta Aug 4, 2021
@jacksteamdev jacksteamdev deleted the mv3-manifest-schema branch August 4, 2021 15:15
This was referenced Aug 4, 2021
jacksteamdev added a commit that referenced this pull request Aug 18, 2021
* fix: delay reload by 100ms

* tests: wait for reloader delay
skip delay if delay is 0

* 3.6.0-0

* Add MV3 types and JSON schema (#89)

* Fix integration bugs with new schema (#90)

* fix: add strict schema and fix schema bugs

* feat: upgrade manifest validation errors

* tests: upgrade TS and Jest
fix a bazillion ts-eslint errors
increase jest beforeAll timeout

* fix bug where pkg version could be undefined

* fix: use strict manifest for build validation

* chore: one more time!

* chore: again

* chore: include schema on npm

* chore: support node >= 12

* chore: remove comment from rollup config

* chore: fix types build step

* chore: add alias to jest

* chore: remove aliases

* 3.6.0-1

* chore: fix tsconfig one last time

* Update test fixtures for MV3 (#92)

* tests: rename mv2 parser test
use readJSONSync instead of require

* refactor: rename manifest types file

* chore: rename tests and fix test paths

* tests: create mv3 copies of all crx's

* tests: format test fixture manifest.json files

* chore: add mv2 to all mv3 manifests

* chore: upgrade all fixture manifests to mv3

* chore: ignore script files

* tests: remove junk files from google's conversion script

* tests: make scripts into modules

* tests: rename background file

* tests: rename fixture background files to service_worker

* chore: move and rename background sw files

* tests: remove mv3 irrelevant fixtures

* tests: rename fixture

* tests: side effect

* MV3 Parser (#93)

* tests: rename mv2 parser test
use readJSONSync instead of require

* refactor: rename manifest types file

* chore: rename tests and fix test paths

* tests: create mv3 copies of all crx's

* tests: format test fixture manifest.json files

* chore: add mv2 to all mv3 manifests

* chore: upgrade all fixture manifests to mv3

* chore: ignore script files

* tests: remove junk files from google's conversion script

* tests: make scripts into modules

* tests: rename background file

* tests: rename fixture background files to service_worker

* chore: move and rename background sw files

* tests: remove mv3 irrelevant fixtures

* tests: rename fixture

* feat: parse mv3

* 3.6.0-2

* Support locales (#95)

* tests: add locales fixtures

* feat: support locales in both mv2 and mv3

* fix: tighten filename validation to commonjs chunk

* Remove prettier (#96)

* refactor: remove prettier usage

* chore: make prettier a devDependency

* 3.6.0-3

* Build MV3 extensions (#98)

* 3.6.0-5

* chore: fix build error

* fix: allow ports in schema url match patterns

* 3.6.0-6

* fix: remove debugging line

* fix: warn deprecated feature correctly

* Manifest as ts files (#99)

* refactor deprecation warnings into own file

* refactor manifest v3 update into own file

* tests: add tests for manifest as ts file

* feat: support manifest as TS files

* fix build errors

* 3.6.0-7

* fix deprecation warning condition

* fix: convert content script match patterns (#100)

* fix duplicate match patterns

* fix duplicate map calls

* feat: simplify MV3 content script approach

* 3.6.0-8

* fix manifest v2 schema bug

* MV3 simple reloader (#103)

* refactor: switch to lodash

* feat: add mv3 support to simpleReloader

* fix manifest json schema bug

* refactor simple reloader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant