Skip to content

Config

Project configuration is stored in jurassic.json file in your project root directory. It looks something like this:

json
{
  "nbsPath": "nbs",
  "outputPath": "hellojurassic",
  "docsInputPath": "docs",
  "docsOutputPath": "_docs",
  "vitepress": {
    "title": "hellojurassic",
    "description": "hellojurassic docs",
    "base": "/jurassic/",
    "cleanUrls": true,
    "themeConfig": {
      "search": { "provider": "local" },
      "logo": "/logo.png",
      "nav": [],
      "sidebar": [
        {
          "text": "Guides",
          "items": [{ "text": "Get started", "link": "/get-started" }]
        }
      ],
      "socialLinks": [
        { "icon": "github", "link": "https://github.com/callmephilip/jurassic" }
      ]
    }
  }
}
ConfigDescription
nbsPathNotebooks go here
outputPathGenerated typescript code goes here
docsInputPathAdditional docs content goes here
docsOutputPathGenerated documentation goes here
vitepressVitepress site config goes here

Config

typescript
export type Config = z.infer<typeof configSchema>;

findConfig

typescript
const findConfig = (dir: string, d: any, config: any, maxD: any) => Promise<string>

🕵️‍♀️ Looking for config. Start from cwd and keep going up if needed looking for jurassic.json. When running notebooks, it seems like cwd points to notebook's directory (at least when running in VS Code). Hence this extra gymnastics, just to be on the safe side. Notice d (depth) and maxD (max depth) to make sure things don't get out of control

getTestConfig

typescript
const getTestConfig = (baseDir: string) => Config

Test config used in unit tests

getConfig

typescript
const getConfig = () => Promise<Config>

Load and parse config.