Skip to content

@example seems to fail to parse whole snippet when using decorators #995

Open
@andykais

Description

@andykais

I have the following class docstring: https://jsr.io/@torm/sqlite/1.6.0/drivers/sqlite.ts#L158

/**
  * Migrations are used to upgrade your database structure as you roll out new versions of code. These can be ran automatically, programatically. Torm currently only supports forward migrations. At the end of the day, this class essentially just wraps logic around version numbers and a function call with access to a database driver.
  * @example
  * ```ts
  * const migrations = new MigrationRegistry()
  *
  * @migrations.register()
  * class AddNewColumnMigration extends Migration {
  *   version = '1.1.0'
  *
  *   call() {
  *     this.driver.exec(`ALTER TABLE book ADD COLUMN genre TEXT`)
  *   }
  * }
  *
  * class BookORM extends Torm {}
  *
  * const db = new BookORM('books.db', {migrations})
  * db.init({auto_migrate: false}) // this will prevent torm from automatically running migrations upon startup
  * // this is the general workflow for migrating manually:
  * const current_db_version = db.schemas.version()
  * if (db.migrations.is_database_outdated()) {
  *   db.migrations.upgrade_database()
  * }
  *
  * ```
  */

but the generated example https://jsr.io/@torm/[email protected]/doc/~/Migration only shows the first line. If I had to guess, this probably has to do with the javascript decorator @migrations
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Needs Plan

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions