From 56e1a8c992af3ca0d48538c7bd226fb9ab7479b3 Mon Sep 17 00:00:00 2001 From: Alexander Paramonov Date: Fri, 28 Aug 2026 14:26:05 +0100 Subject: [PATCH] Tutorials: Rename Tutorial.run to start The u2 refactor put a run(fn) helper on the Component base, which Widget now inherits, so Tutorial's own run(): Promise stopped matching the base signature and the package build died: TS2416: Property 'run' in type 'Tutorial' is not assignable to the same property in base type 'Widget' No signature satisfies both. A subclass may drop parameters, but it cannot return Promise where the base returns T, so the method has to be named something else. start() is free on Component, Control and Widget, and it reads correctly next to the "Start" button that launches the next tutorial. Subclasses are untouched: they implement the protected _run() hook, which does not collide, and only the base declares the public entry point. Three call sites move with it. Verified against the current js-api sources: TS2416 at tutorial.ts:127 before, none after. Co-Authored-By: Claude Opus 5 (1M context) --- libraries/tutorials/src/tutorial.ts | 4 ++-- packages/Tutorials/CHANGELOG.md | 1 + packages/Tutorials/src/tests/tutorial-test.ts | 2 +- packages/Tutorials/src/tutorial-runner.ts | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/tutorials/src/tutorial.ts b/libraries/tutorials/src/tutorial.ts index 8eb2c9cb37..3cf23d619d 100644 --- a/libraries/tutorials/src/tutorial.ts +++ b/libraries/tutorials/src/tutorial.ts @@ -124,7 +124,7 @@ export abstract class Tutorial extends DG.Widget { grok.shell.windows.showBrowse = true; } - async run(): Promise { + async start(): Promise { this._addHeader(); const tutorials = this.track?.tutorials; @@ -232,7 +232,7 @@ export abstract class Tutorial extends DG.Widget { this.clearRoot(); tutorialNode.html(''); tutorialNode.append(nextTutorial.root); - nextTutorial.run(); + nextTutorial.start(); }), ui.button('Cancel', () => { this.updateProgress(this.track); diff --git a/packages/Tutorials/CHANGELOG.md b/packages/Tutorials/CHANGELOG.md index 94bc7a33c4..c717e033e1 100644 --- a/packages/Tutorials/CHANGELOG.md +++ b/packages/Tutorials/CHANGELOG.md @@ -2,6 +2,7 @@ ## v.next +* Fixed the package build failing on `TS2416` — the u2 `Component` base introduced `run(fn)`, which every widget now inherits, so `Tutorial`'s own `run()` no longer matched; it is now `start()` * GROK-20602: BREAKING regen — `grok api` codegen v2 for the Northwind demo schema: datetime fields are dayjs, typed expand/transaction surface, lazy db.ts clients * Demo app: Added a Domain Databases demo (Data Access | Domain Databases) — ships the classic Northwind schema and data as a plugin-declared domain database (databases/northwind) and walks through browsing, security, audit history, and the JS API diff --git a/packages/Tutorials/src/tests/tutorial-test.ts b/packages/Tutorials/src/tests/tutorial-test.ts index a4e1073d48..24bd7efa69 100644 --- a/packages/Tutorials/src/tests/tutorial-test.ts +++ b/packages/Tutorials/src/tests/tutorial-test.ts @@ -29,7 +29,7 @@ category('Tutorials', () => { test('Run a tutorial', async () => { try { - await tutorial.run(); + await tutorial.start(); } catch (e) { expect(e instanceof Error ? e.message : e, 'Method "_run" not implemented.'); } diff --git a/packages/Tutorials/src/tutorial-runner.ts b/packages/Tutorials/src/tutorial-runner.ts index 925996644a..3a4a7991e0 100644 --- a/packages/Tutorials/src/tutorial-runner.ts +++ b/packages/Tutorials/src/tutorial-runner.ts @@ -19,7 +19,7 @@ export class TutorialRunner { $('#tutorial-child-node').html(''); $('#tutorial-child-node').append(t.root); t.clearRoot(); - await t.run(); + await t.start(); } async getCompleted(tutorials: Tutorial[]) {