@walkeros/explorer 2.1.1 → 2.1.3

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/AGENT.md CHANGED
@@ -16,6 +16,15 @@ configuration.
16
16
 
17
17
  - **ALWAYS import modules at the top of files** - Never use inline
18
18
  `typeof import()` or dynamic `await import()`
19
+ - **Exception — `monaco-editor`**: Never import `monaco-editor` at runtime
20
+ (top-level or `require()`). Monaco accesses `window` at module evaluation
21
+ time, which crashes SSR. Instead:
22
+ - Use `useMonaco()` hook from `@monaco-editor/react` in components (returns
23
+ `null` during SSR, the CDN-loaded instance after load)
24
+ - For utility modules, accept the monaco instance as a parameter (see
25
+ `initMonacoJson()` in `monaco-json-schema.ts`)
26
+ - `import type` from `monaco-editor` is always safe (erased at compile time)
27
+ - `@monaco-editor/react` imports are always safe (SSR-aware internally)
19
28
  - Use proper type imports: `import type { Monaco } from '@monaco-editor/react';`
20
29
 
21
30
  ## Development Commands