CLI

Project file

Describes a BAQ app project and the types it uses.

This file can be created and managed with the help of the BAQ CLI­, but it can also be edited by hand when needed.

This file is always named baq.json.

{
  "name": "Super App 3000",
  "type": "ts-react",
  "path": "src/baq",
  "record_types": {...}
}

Properties

  • name string

    • Name of the app.
  • type enum

    • Project type. One of the following:

      • js: JavaScript project.
      • js-react: JavaScript + React project.
      • ts: TypeScript project.
      • ts-react: TypeScript + React project.
  • path string

    • Filesystem path where files should be generated.
  • description string optional

    • Brief overview of the app.
  • website_url URL optional

    • Public website of the app.
  • record_types : {[string]: RecordType}

    • Record types used by the app.

    • The keys will be the friendly names used when generating types.

Union of LocalRecordType­ and RemoteRecordType­.

New record type created for the app and available as a local file.

Properties

  • path string

  • record_id RecordId

    • Unique identifier for this record type.
  • version_hash VersionHash optional

    • Hash of the latest published version.
  • content_hash string optional

    • Truncated SHA256 hash of the latest published type record.

    • Used to detect changes and publish a new version if needed.

Existing public record type published outside of the app.

Properties

  • entity Entity

    • Entity of the record type’s author.
  • record_id RecordId

    • Unique identifier of this record type.
  • version_hash VersionHash

    • Hash of the record type version currently in use in the app.

This is what the full content of a BAQ project file might look like. Here we have an app that manages tasks (local record type), while also accessing the user’s files (remote record type).

{
  "name": "Daily Todo",
  "type": "ts-react",
  "path": "src/baq",
  "description": "Manage your daily tasks with ease.",
  "website_url": "https://dailytodo.com",
  "record_types": {
    "task": {
      "path": "src/types/record.task.json",
      "record_id": "4ad29d48f55a409e8d25b0d03b23b6eb"
    },
    "file": {
      "entity": "types.baq.run",
      "record_id": "2b6f7bc8ffd54c8db8062700c040e04f",
      "version_hash": "8f41675ff4f0165c2768b4b7f829df5768e8cd1d21e3cd0b3c9cd0fd73c7f151"
    }
  }
}
© 2024 Quentez