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

JSON Schema #1

Open
stuartpb opened this issue Oct 14, 2015 · 5 comments
Open

JSON Schema #1

stuartpb opened this issue Oct 14, 2015 · 5 comments

Comments

@stuartpb
Copy link
Member

Here's what I'm thinking (using YAML syntax and Tabalanche as an example):

source:
  zip: https://github.com/tabalanche/tabalanche-extension/archive/unstable.zip
extension:
  shim:
    manifest:
      name: Unstable Tabalanche
      icons:
        "16": images/tabalanche-unstable-16px.png
        "48": images/tabalanche-unstable-48px.png
        "128": images/tabalanche-unstable-128px-20pxborder.png
      browser_action:
        default_icon:
          "19": images/tabalanche-unstable-19px.png
          "38": images/tabalanche-unstable-38px.png
        default_title: Unstable Tabalanche
@stuartpb
Copy link
Member Author

Actually, since extension management isn't allowed for Chrome apps (ugh), I'm probably going to do something more like this (which can be generalized):

patch:
  json:
    manifest.json:
      name: Unstable Tabalanche
      icons:
        "16": images/tabalanche-unstable-16px.png
        "48": images/tabalanche-unstable-48px.png
        "128": images/tabalanche-unstable-128px-20pxborder.png
      browser_action:
        default_icon:
          "19": images/tabalanche-unstable-19px.png
          "38": images/tabalanche-unstable-38px.png
        default_title: Unstable Tabalanche

@stuartpb
Copy link
Member Author

Actually, to keep the JSON patching flexible, there should probably be a layer like "set" that sets keys to values (with room for future extensions like "append" and "merge"). Maybe call it "values" or "properties".

@stuartpb
Copy link
Member Author

Okay, so here's the new sample schema:

sources:
- url: https://path/to/whatever.zip
  slice:
  - from: subfolder-in-zip/deeper-subfolder #defaults to root
    to: different-sublocation #defaults to root
tags: [extension]
patch:
  files:
    manifest.json:
      set: {name: "Example (Development)"}
    icon.png:
      color: [invert]

@stuartpb
Copy link
Member Author

Patch items might have a "don't patch in repack" option. Also, repack is somewhere in the future-planned-features list.

@stuartpb
Copy link
Member Author

I'm going to have a layer for the kind of patching, like "json" or "png", and they're going to be items in an array for enforcing order (ie. if you want to do a fulltext patch, and then a JSON patch, and then maybe another fulltext patch). Having each step be an object allows for each step to have patch-operation options placed on it (like "include in repack").

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

No branches or pull requests

1 participant