Skip to content

Instantly share code, notes, and snippets.

@jaredhirsch
Created October 24, 2017 18:22
Show Gist options
  • Save jaredhirsch/8412b6af9e4fca35bd5ebad6baa494d8 to your computer and use it in GitHub Desktop.
Save jaredhirsch/8412b6af9e4fca35bd5ebad6baa494d8 to your computer and use it in GitHub Desktop.
debugging is fun yay

this is webpack require 8 in studyutils.jsm, beautified:

module.exports = {
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "study setup",
    "type": "object",
    "definitions": {
        "idString": {
            "description": "between 1,100 chars, no spaces, unicode ok.",
            "type": "string",
            "pattern": "^\\S+$",
            "minLength": 1,
            "maxLength": 100
        },
        "ending": {
            "type": "object",
            "properties": {
                "study_state": {
                    "type": "string",
                    "enum": ["installed", "ineligible", "expired", "user-disable", "ended-positive", "ended-neutral", "ended-negative"]
                },
                "study_state_fullname": {
                    "type": "string",
                    "description": "Second part of name of state, if any.  Study-specific for study-defined endings."
                },
                "url": {
                    "type": "string"
                }
            }
        }
    },
    "properties": {
        "study": {
            "type": "object",
            "properties": {
                "studyName": {
                    "$ref": "#/definitions/idString",
                    "description": "Name of a particular study.  Usually the addon_id."
                },
                "endings": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/ending"
                    }
                },
                "telemetry": {
                    "type": "object",
                    "properties": {
                        "removeTestingFlag": {
                            "type": "boolean"
                        },
                        "send": {
                            "type": "boolean"
                        },
                        "onInvalid": {
                            "type": "string",
                            "enum": ["throw", "log"]
                        }
                    },
                    "required": ["removeTestingFlag", "send"]
                }
            },
            "required": ["studyName", "endings", "telemetry"]
        },
        "addon": {
            "type": "object",
            "properties": {
                "id": {
                    "$ref": "#/definitions/idString",
                    "description": "id of the addon."
                },
                "version": {
                    "$ref": "#/definitions/idString",
                    "description": "Semantic version of the addon."
                }
            },
            "required": ["id", "version"]
        }
    },
    "required": ["study", "addon"]
}```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment