@markupai/sidebar-adapter 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,484 @@
1
+ # @markupai/sidebar-adapter
2
+
3
+ TypeScript library for **structured `postMessage` communication** between your **host application** (the page that embeds the sidebar) and the **Markup AI sidebar** (a web app loaded in an `<iframe>`).
4
+
5
+ You do **not** need prior knowledge of how the sidebar is built internally. As an integrator, you provide a **sidebar URL** (from Markup AI), an **iframe**, and a small set of **callbacks** that read and update the user’s document in your editor or viewer.
6
+
7
+ ## Contents
8
+
9
+ 1. [Host integration checklist](#host-integration-checklist)
10
+ 2. [How the pieces fit together](#how-the-pieces-fit-together)
11
+ 3. [Installation](#installation)
12
+ 4. [Architecture options](#architecture-options)
13
+ 5. [PluginAdapter](#pluginadapter-sidebar--editor) (inside the sidebar app → calls the host)
14
+ 6. [SidebarAdapter](#sidebaradapter-editor--sidebar) (host page → serves the sidebar)
15
+ 7. [Host shell & HTML helpers](#sidebar-host-shell-shared-htmldom)
16
+ 8. [createSidebarHost](#createsidebarhost) (iframe + overlay + adapter in one step)
17
+ 9. [Sidebar load overlay (standalone)](#sidebarloadoverlay-editor-ui)
18
+ 10. [API reference](#api-reference) · [Development](#development)
19
+
20
+ ## Features
21
+
22
+ - **Bidirectional IPC** — Promise-based calls with timeouts and typed method names
23
+ - **PluginAdapter** — Used **inside** the sidebar app to call into the host (`getContent`, `replaceContent`, …)
24
+ - **SidebarAdapter** — Used **in the host page** to expose `PluginInterface` to the iframe
25
+ - **createSidebarHost** — Optional one-shot setup: create/mount iframe, optional load-failed overlay, and `SidebarAdapter` (or iframe-only when your UI and document logic run in separate contexts)
26
+ - **Host shell helpers** — `ensureSidebarHostShell` / `buildSidebarHostHtmlDocument` so you don’t duplicate container markup and layout CSS
27
+ - **MIME helpers** — `MimeType` enum plus arbitrary MIME strings for `ContentInfo`
28
+ - **Errors** — `TextLookupError` and guards for editor lookup failures
29
+ - **Cleanup** — `destroy()` / teardown functions on adapters and hosts
30
+
31
+ ## Host integration checklist
32
+
33
+ Use this if you are **embedding Markup AI’s sidebar** in your product for the first time.
34
+
35
+ 1. **Get the sidebar URL from Markup AI** — Base URL plus any required **hash route** (for example `#/agentic` for the agentic experience). The exact URL and routing are part of your integration agreement.
36
+ 2. **Add an iframe** on your host page whose `src` is that URL (or let **`createSidebarHost`** create the iframe for you).
37
+ 3. **Implement `PluginInterface`** — Async functions that return document text, apply replacements, open/close dialogs, etc. The sidebar calls these over `postMessage`; your code performs the real work in your editor model.
38
+ 4. **Create a `SidebarAdapter`** (or call **`createSidebarHost`**) with:
39
+ - your `PluginInterface` implementation, and
40
+ - **`adapterOptions.targetOrigin`** set to **`sidebarPostMessageTargetOrigin(sidebarUrl)`** so messages are scoped to the sidebar origin (safer than `"*"`).
41
+ 5. **Test the basics** — After load, the sidebar will request **`getInitConfig`** and **`getContent`**. Confirm your app returns sensible values before testing edits and dialogs.
42
+ 6. **Tear down on exit** — Call **`destroy()`** on the host returned by `createSidebarHost`, or on your `SidebarAdapter`, when the user leaves the screen or you remove the iframe.
43
+
44
+ If you use the **agentic** layout, implement the optional hooks **`onAgenticAgentResults`** and **`onAgenticStreamComplete`** on `PluginInterface` when you need streaming results or completion signals in your host UI (see [PluginInterface](#plugininterface)).
45
+
46
+ ## How the pieces fit together
47
+
48
+ ```text
49
+ ┌────────────────────────────── Host page (your app) ──────────────────────────────┐
50
+ │ Your editor / viewer logic │
51
+ │ ▲ │
52
+ │ │ PluginInterface (getContent, replaceContent, …) │
53
+ │ │ │
54
+ │ SidebarAdapter ◄──── postMessage ────► PluginAdapter (inside iframe) │
55
+ │ │ │
56
+ │ │ ┌──────────────────────────┐ │
57
+ │ └──────────────│ <iframe src="sidebar URL"> │ │
58
+ │ │ Markup AI sidebar UI │ │
59
+ │ └──────────────────────────┘ │
60
+ └────────────────────────────────────────────────────────────────────────────────┘
61
+ ```
62
+
63
+ - **`SidebarAdapter` + `PluginInterface`** live on the **host**. They answer requests from the iframe.
64
+ - **`PluginAdapter`** lives **inside the sidebar** (Markup’s app or a compatible build). It is what **calls** your host. You only import it if you maintain sidebar code.
65
+
66
+ ## Installation
67
+
68
+ ```bash
69
+ npm install @markupai/sidebar-adapter
70
+ ```
71
+
72
+ ## Architecture options
73
+
74
+ | Integration style | Where the sidebar iframe runs | Where your document/editor code runs | Typical approach |
75
+ | ----------------------------- | ------------------------------------------------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
76
+ | **Same window** (most common) | Same browser tab as your host UI | Same tab / same JavaScript context | Implement `PluginInterface` in that page; use **`createSidebarHost`** (or `SidebarAdapter` + your own iframe) and optional **`ensureSidebarHostShell`**. |
77
+ | **Split contexts** (advanced) | Often a separate UI surface that only hosts the iframe | Another realm (worker, native bridge, backend) | Use **`createSidebarHost`** **without** `plugin`, then **forward** raw `postMessage` events between the iframe and the realm where you implement **`PluginInterface`**. That realm can use **`IPCCore`** and related exports from this package to decode/encode the same protocol. |
78
+
79
+ **Split-context** setups are uncommon; most integrations use **same-window** (host UI and document logic together in one page).
80
+
81
+ ## Usage
82
+
83
+ ### PluginAdapter (Sidebar → Editor)
84
+
85
+ Use **`PluginAdapter` inside the sidebar application** (the code running in the iframe) to call into the host page. Host-only integrators can skip this section.
86
+
87
+ ```typescript
88
+ import { PluginAdapter, type ContentInfo } from "@markupai/sidebar-adapter";
89
+
90
+ // Create the adapter (no interface needed - using PULL pattern)
91
+ const adapter = new PluginAdapter();
92
+
93
+ // Get initialization config from the editor
94
+ const config = await adapter.getInitConfig();
95
+ console.log("Sidebar initialized", config);
96
+
97
+ // Get content from the editor
98
+ // Integration provides content in its preferred format
99
+ const content = await adapter.getContent();
100
+ console.log("Received content:", content.content);
101
+ console.log("Document reference:", content.documentReference); // Required from integration
102
+ console.log("MIME type:", content.mimeType); // Optional from integration
103
+
104
+ // Get selected content from the editor
105
+ // No MIME type parameter - integration decides the format
106
+ const selectedContent = await adapter.getSelectedContent();
107
+ console.log("Selected content:", selectedContent.content);
108
+ console.log("Document reference:", selectedContent.documentReference);
109
+
110
+ // Select content in the editor
111
+ await adapter.selectContent("Hello world", 0);
112
+
113
+ // Replace content in the editor
114
+ await adapter.replaceContent("Hello world", "Hello universe", { start: 0 });
115
+
116
+ // Replace multiple contents in the editor
117
+ await adapter.replaceMultipleContents([
118
+ { original: "Hello world", suggestion: "Hello universe", range: { start: 0 } },
119
+ { original: "foo", suggestion: "bar", range: { start: 20 } },
120
+ ]);
121
+
122
+ // Show a dialog
123
+ adapter.showDialog("<div>Custom dialog content</div>", 400, 300, "My Dialog");
124
+
125
+ // Request initialization
126
+ adapter.requestInit();
127
+
128
+ // Clean up when done
129
+ adapter.destroy();
130
+ ```
131
+
132
+ ### SidebarAdapter (Editor → Sidebar)
133
+
134
+ Use **`SidebarAdapter` on the host page** (parent of the iframe) to connect your `PluginInterface` implementation to the sidebar:
135
+
136
+ ```typescript
137
+ import {
138
+ SidebarAdapter,
139
+ MimeType,
140
+ type PluginInterface,
141
+ type ContentReplacement,
142
+ type ContentInfo,
143
+ } from "@markupai/sidebar-adapter";
144
+
145
+ // Implement the PluginInterface
146
+ const pluginInterface: PluginInterface = {
147
+ // Get current document content
148
+ // Return content in your preferred format with required documentReference
149
+ getContent: async (): Promise<ContentInfo> => {
150
+ const content = getContentFromEditor();
151
+ return {
152
+ content: content,
153
+ documentReference: "my-document.md", // Required: unique identifier for the document
154
+ mimeType: MimeType.TEXT_MARKDOWN, // Optional: can use MimeType enum or any string
155
+ };
156
+ },
157
+
158
+ // Get selected content
159
+ // Return selected content with required documentReference
160
+ getSelectedContent: async (): Promise<ContentInfo> => {
161
+ const selectedText = getSelectedContentFromEditor();
162
+ return {
163
+ content: selectedText,
164
+ documentReference: "selection.txt", // Required
165
+ mimeType: "text/plain", // Optional: can be omitted if not applicable
166
+ };
167
+ },
168
+
169
+ // Get initialization configuration
170
+ getInitConfig: async () => {
171
+ return {
172
+ integrationName: "My Editor",
173
+ integrationVersion: "1.0.0",
174
+ integrationId: "my-editor",
175
+ useCheckPreviewDialog: true,
176
+ supportCheckSelection: true,
177
+ pluginOrigin: globalThis.location.origin,
178
+ };
179
+ },
180
+
181
+ // Select content in the editor
182
+ selectContent: async (original: string, startIndex: number) => {
183
+ console.log("Select content:", original, "at index:", startIndex);
184
+ selectContentInEditor(original, startIndex);
185
+ },
186
+
187
+ // Replace content in the editor
188
+ replaceContent: async (original: string, suggestion: string, range?: ContentRange) => {
189
+ console.log("Replace content:", original, "with:", suggestion);
190
+ replaceContentInEditor(original, suggestion, range);
191
+ },
192
+
193
+ // Replace multiple contents in the editor
194
+ replaceMultipleContents: async (replacements: ContentReplacement[]) => {
195
+ console.log("Replace multiple contents:", replacements);
196
+ replaceMultipleContentsInEditor(replacements);
197
+ },
198
+
199
+ // Show a dialog
200
+ showDialog: async (dialogHtml: string, width?: number, height?: number, title?: string) => {
201
+ console.log("Show dialog:", title);
202
+ showDialogInEditor(dialogHtml, width, height, title);
203
+ },
204
+
205
+ // Close the dialog
206
+ closeDialog: async () => {
207
+ console.log("Close dialog");
208
+ closeDialogInEditor();
209
+ },
210
+ };
211
+
212
+ // Create the adapter with an iframe reference
213
+ const iframe = document.getElementById("sidebar-iframe") as HTMLIFrameElement;
214
+ const sidebarAdapter = new SidebarAdapter(pluginInterface, iframe);
215
+
216
+ // The adapter listens to sidebar requests and routes them to your plugin interface
217
+ // Your plugin interface methods (getContent, getSelectedContent, etc.) return the data
218
+
219
+ // Clean up when done
220
+ sidebarAdapter.destroy();
221
+ ```
222
+
223
+ ### SidebarLoadOverlay (Editor UI)
224
+
225
+ Use `setupSidebarLoadOverlay` when you manage the iframe yourself and only want the **failed-to-load / retry** UI. Styles are injected automatically.
226
+
227
+ ![Sidebar failed to load overlay](./.docs/sidebar_failed_to_load_overlay.png)
228
+
229
+ ```typescript
230
+ import { setupSidebarLoadOverlay } from "@markupai/sidebar-adapter";
231
+
232
+ const container = document.getElementById("sidebar-root") as HTMLElement;
233
+ const iframe = document.getElementById("sidebar-iframe") as HTMLIFrameElement;
234
+
235
+ const teardownLoadOverlay = setupSidebarLoadOverlay(container, iframe, {
236
+ timeoutMs: 8000,
237
+ retryIntervalMs: 12000,
238
+ });
239
+
240
+ // Later:
241
+ teardownLoadOverlay();
242
+ ```
243
+
244
+ Prefer **`createSidebarHost`** if you also want **`SidebarAdapter`** and/or **`iframeMount`** in one place.
245
+
246
+ ### createSidebarHost
247
+
248
+ Creates the sidebar iframe (or uses yours), optionally mounts the **load overlay**, and optionally constructs **`SidebarAdapter`**.
249
+
250
+ **Iframe:** pass exactly one of **`iframe`** or **`iframeMount`** (`container`, `src`, optional `allow`). Adapter-created iframes use a fixed accessible title (**`SIDEBAR_IFRAME_DEFAULT_TITLE`**) and set **`allow`** to **`SIDEBAR_IFRAME_DEFAULT_ALLOW`** (`clipboard-read; clipboard-write`) unless you pass **`allow: ""`** to omit it or override the string. **`destroy()`** removes a mounted iframe from the DOM.
251
+
252
+ **Return type:** `createSidebarHost` returns `{ iframe, adapter, destroy }`. When **`plugin`** is set, `adapter` is a `SidebarAdapter`; when **`plugin`** is omitted (split-context integration), `adapter` is `null` and only the overlay runs (if `loadOverlayContainer` is set).
253
+
254
+ **Shared helpers**
255
+
256
+ - **`SIDEBAR_DEFAULT_PRODUCTION_BASE_URL`** — canonical prod sidebar base URL (`https://sidebar.markup.ai/`); pass to **`getSidebarBaseUrlWithOverride`** when you have no env-specific default.
257
+ - **`SIDEBAR_URL_OVERRIDE_STORAGE_KEY`** — `localStorage` key for the override; use **`getSidebarBaseUrlWithOverride(defaultUrl)`** to resolve the base URL (reads override when set, otherwise `defaultUrl`; safe when `localStorage` is missing or throws).
258
+ - **`sidebarPostMessageTargetOrigin(sidebarUrl, options?)`** — derives **`adapterOptions.targetOrigin`** from the sidebar URL (falls back to `"*"`; optional **`onInvalidUrl`** callback).
259
+ - **`assertSidebarHostAdapter(host, message?)`** — type-narrows **`host`** after **`createSidebarHost`** when you passed **`plugin`** (throws if **`adapter`** is **`null`**).
260
+
261
+ ```typescript
262
+ import {
263
+ assertSidebarHostAdapter,
264
+ createSidebarHost,
265
+ sidebarPostMessageTargetOrigin,
266
+ type PluginInterface,
267
+ } from "@markupai/sidebar-adapter";
268
+
269
+ const container = document.getElementById("sidebar-container") as HTMLElement;
270
+ // Use the URL Markup AI provides; append the agreed hash route (e.g. #/agentic) if required.
271
+ const sidebarUrl = "https://your-sidebar-host/#/agentic";
272
+
273
+ // `myPlugin` is your PluginInterface implementation (see SidebarAdapter example above).
274
+ const host = createSidebarHost({
275
+ iframeMount: {
276
+ container,
277
+ src: sidebarUrl,
278
+ },
279
+ plugin: myPlugin,
280
+ loadOverlayContainer: container,
281
+ loadOverlayOptions: { timeoutMs: 8000, retryIntervalMs: 12000 },
282
+ adapterOptions: { targetOrigin: sidebarPostMessageTargetOrigin(sidebarUrl) },
283
+ });
284
+
285
+ assertSidebarHostAdapter(host, "Expected adapter when plugin is set");
286
+
287
+ // Use host.iframe for extra wiring (e.g. message forwarders). Later:
288
+ host.destroy();
289
+ ```
290
+
291
+ - If you already have an iframe, pass **`iframe`** and omit **`iframeMount`**.
292
+ - If you omit **`loadOverlayContainer`**, no overlay is mounted (same as using `new SidebarAdapter` only, plus optional iframe creation).
293
+ - **Split-context integration:** omit **`plugin`**, set **`loadOverlayContainer`** + **`iframeMount`** (or **`iframe`**), then forward **`postMessage`** traffic between `host.iframe` and the context where your `PluginInterface` runs (see [Architecture options](#architecture-options)).
294
+
295
+ ### Sidebar host shell (shared HTML/DOM)
296
+
297
+ Avoid copying the same **`#sidebarContainer`** + full-height layout CSS into every host HTML file.
298
+
299
+ **Runtime (most hosts)**
300
+
301
+ ```typescript
302
+ import {
303
+ createSidebarHost,
304
+ ensureSidebarHostShell,
305
+ sidebarPostMessageTargetOrigin,
306
+ } from "@markupai/sidebar-adapter";
307
+
308
+ const container = ensureSidebarHostShell({ root: document });
309
+
310
+ createSidebarHost({
311
+ iframeMount: { container, src: sidebarUrl },
312
+ plugin: myPlugin,
313
+ loadOverlayContainer: container,
314
+ adapterOptions: { targetOrigin: sidebarPostMessageTargetOrigin(sidebarUrl) },
315
+ });
316
+ ```
317
+
318
+ **Build time (single emitted HTML file)** — when your bundler produces one static HTML file for the host UI:
319
+
320
+ ```typescript
321
+ import { buildSidebarHostHtmlDocument } from "@markupai/sidebar-adapter";
322
+
323
+ const html = buildSidebarHostHtmlDocument({
324
+ title: "My app — Markup AI sidebar host",
325
+ includePluginHostHead: true,
326
+ bodyScriptsHtml: `<script type="module" src="./host-entry.js"></script>`,
327
+ });
328
+ ```
329
+
330
+ Use **`includePluginHostHead: true`** for a sensible viewport `<meta>` block, or **`buildSidebarPluginHostHeadInnerHtml()`** if you only need that fragment for a template you control. Point **`bodyScriptsHtml`** at the script URL your build tool emits for the host page.
331
+
332
+ Also exported: **`SIDEBAR_HOST_CONTAINER_ID`** (default `sidebarContainer`), **`buildSidebarHostShellCss`**, **`SIDEBAR_HOST_SHELL_CSS`** (default id), **`SIDEBAR_DEFAULT_PRODUCTION_BASE_URL`**, **`getSidebarBaseUrlWithOverride`**, **`SIDEBAR_URL_OVERRIDE_STORAGE_KEY`**, **`sidebarPostMessageTargetOrigin`**, **`assertSidebarHostAdapter`**, **`SIDEBAR_IFRAME_DEFAULT_TITLE`**, **`SIDEBAR_IFRAME_DEFAULT_ALLOW`** (default `iframeMount` clipboard policy).
333
+
334
+ ## API Reference
335
+
336
+ ### Types
337
+
338
+ #### MimeType
339
+
340
+ Convenience enum for common MIME types. Integrations are not limited to these values and can use any valid MIME type string.
341
+
342
+ ```typescript
343
+ enum MimeType {
344
+ TEXT_PLAIN = "text/plain",
345
+ TEXT_MARKDOWN = "text/markdown",
346
+ TEXT_HTML = "text/html",
347
+ APPLICATION_DITA_XML = "application/dita+xml",
348
+ }
349
+ ```
350
+
351
+ #### ContentInfo
352
+
353
+ Content information returned by integration methods. The integration must provide `content` and `documentReference`, while `mimeType` is optional.
354
+
355
+ ```typescript
356
+ interface ContentInfo {
357
+ content: string | number[]; // Text content or binary content as byte array
358
+ documentReference: string; // Required: Unique identifier for the document (e.g., filename, path, ID)
359
+ mimeType?: string; // Optional: Any valid MIME type string (not limited to MimeType enum)
360
+ }
361
+ ```
362
+
363
+ #### ContentReplacement
364
+
365
+ Structure for batch content replacement operations.
366
+
367
+ ```typescript
368
+ type ContentReplacement = {
369
+ original: string;
370
+ suggestion: string;
371
+ range: ContentRange;
372
+ };
373
+
374
+ type ContentRange = {
375
+ start: number;
376
+ };
377
+ ```
378
+
379
+ For agentic streaming callbacks, issue objects match the exported **`AgenticIssuePayload`** shape (stable `id` plus fields the sidebar sends per issue).
380
+
381
+ #### PluginInterface
382
+
383
+ Implement these **on the host** as async functions. The sidebar calls them over IPC and waits on the returned promises (pull style):
384
+
385
+ - `getInitConfig(): Promise<SidebarConfig>` — Integration name, version, feature flags, dialog closing script, etc.
386
+ - `getContent(): Promise<ContentInfo>` — Full document (or main buffer) text; must include `documentReference`; `mimeType` optional
387
+ - `getSelectedContent(): Promise<ContentInfo>` — Current selection; same `ContentInfo` rules as `getContent`
388
+ - `selectContent(original: string, startIndex: number): Promise<void>` — Focus/highlight a range in the editor
389
+ - `replaceContent(original: string, suggestion: string, range?: ContentRange): Promise<void>` — Apply a single edit
390
+ - `replaceMultipleContents(replacements: ContentReplacement[]): Promise<void>` — Batch edits
391
+ - `showDialog(dialogHtml: string, width?: number, height?: number, title?: string): Promise<void>` — Host-rendered dialog chrome around HTML from the sidebar
392
+ - `closeDialog(): Promise<void>` — Dismiss that dialog
393
+
394
+ Optional (agentic / streaming flows):
395
+
396
+ - `onAgenticAgentResults?(agentName: string, issues: AgenticIssuePayload[]): Promise<void>` — Per-agent results as they stream
397
+ - `onAgenticStreamComplete?(): Promise<void>` — Stream finished (success or terminal state)
398
+
399
+ #### Error control flows
400
+
401
+ When implementing `selectContent` or `replaceContent`, throw `TextLookupError` from this package when text lookup (e.g. locating the selection or target range) fails. The sidebar will treat it as a selection failure and can invalidate the issue card with the error message.
402
+
403
+ ```typescript
404
+ import { TextLookupError } from "@markupai/sidebar-adapter";
405
+
406
+ // In selectContent or replaceContent:
407
+ if (!found) {
408
+ throw new TextLookupError("Check text again to locate this issue.");
409
+ }
410
+ ```
411
+
412
+ Errors sent over IPC are reconstructed on the sidebar, so you can type-check with `instanceof` or the `isTextLookupError` guard:
413
+
414
+ ```typescript
415
+ import { isTextLookupError, type TextLookupError } from "@markupai/sidebar-adapter";
416
+
417
+ try {
418
+ await adapter.selectContent(original, startIndex);
419
+ } catch (error) {
420
+ if (isTextLookupError(error)) {
421
+ // error is TextLookupError; e.g. invalidate issue card with error.message
422
+ invalidateIssueWithError(issueId, error.message);
423
+ } else {
424
+ throw error;
425
+ }
426
+ }
427
+ ```
428
+
429
+ Note: We document thrown errors via JSDoc `@throws` on the plugin interface and export union types `SelectContentError` and `ReplaceContentError` for control-flow typing when catching.
430
+
431
+ ### Message Format
432
+
433
+ The adapter uses a promise-based IPC system with automatic request/response correlation:
434
+
435
+ ```typescript
436
+ // Call message (sidebar → editor)
437
+ {
438
+ type: 'call';
439
+ id: number;
440
+ name: string; // Method name (e.g., 'getContent')
441
+ data: any[]; // Method arguments
442
+ }
443
+
444
+ // Response message (editor → sidebar)
445
+ {
446
+ type: 'response';
447
+ id: number; // Matches the call id
448
+ name: string;
449
+ data: any; // Return value
450
+ }
451
+
452
+ // Error message
453
+ {
454
+ type: 'error';
455
+ id: number;
456
+ name: string;
457
+ error: string;
458
+ }
459
+ ```
460
+
461
+ ## Development
462
+
463
+ The commands below are for **contributors** working on this npm package’s source. If you only consume **`@markupai/sidebar-adapter`** from your app, you do not need to run them.
464
+
465
+ ### Building
466
+
467
+ ```bash
468
+ npm run build
469
+ ```
470
+
471
+ ### Testing
472
+
473
+ ```bash
474
+ npm test
475
+ npm run test:watch
476
+ npm run test:coverage
477
+ ```
478
+
479
+ ### Formatting
480
+
481
+ ```bash
482
+ npm run format:fix
483
+ npm run format:check
484
+ ```