Skip to content

Latest commit

 

History

History
51 lines (41 loc) · 2.09 KB

CONTRIBUTING.md

File metadata and controls

51 lines (41 loc) · 2.09 KB

Contributing

Roadmap in TODO.md. 👈 This is where to contribute if you'd like to help!

ℹ️ https://spacetelescope.github.io/ is the best source I've found for info on authoring JSONSchemas. I recommend looking it over to familiarize yourself with JSONSchema if you've never used them before and keeping it open for reference!

1. Setup

  1. Clone this repository
  2. npm install

2. Working on schemas

  1. Work on schemas in src. Use localhost URLs for references (these will be replaced before publish)
  2. Serve them from localhost using npm run serve.
  3. To try them out with a JSON document in vscode, create a document like this:
    {
      "$schema": "http://localhost:8090/loopback-datasources-config.json",
      "db": {
        "name": "db",
        "connector": "memory"
      },
      "mysql": {
        "host": "localhost",
        "url": "",
        "database": "boston",
        "name": "mysql",
        "connector": "mysql",
        "user": "root"
      }
    }
    
  4. To get VSCode to reload your schema after changing it, add a query string to the end of the $schema URL:
  5. Edit schema in src
  6. in your test project window: "$schema": "http://localhost:8090/loopback-datasources-config.json?x=1"
  7. Edit schema in src
  8. in your test project window: "$schema": "http://localhost:8090/loopback-datasources-config.jsonx=2"
  9. etc.

3. Publishing/Submitting PR

  1. run npm run build in order to get your changes into the dist directory
  2. commit, push, submit PR

Production schemas are served from the dist directory. The build npm script does the following:

  1. copies files from src to dist
  2. replaces http://localhost:8090 with the real base url for the schemas. This is currently github but will likely be schema store later.

⚠️ PRs must have changes committed to both the src & dist directories.