Преглед изворни кода

Merge pull request #9812 from weseek/fix/growi-pluginkit-growifacade-typo

fix: growi pluginkit growifacade typo
Yuki Takei пре 1 година
родитељ
комит
a758da0516

+ 5 - 0
.changeset/violet-ties-draw.md

@@ -0,0 +1,5 @@
+---
+'@growi/pluginkit': patch
+---
+
+Fix growifacade typo

+ 3 - 3
packages/pluginkit/src/v4/client/utils/growi-facade/growi-react.spec.ts

@@ -8,16 +8,16 @@ describe('growiReact()', () => {
 
   afterEach(() => {
     process.env.NODE_ENV = originalNodeEnv;
-    delete (global as any).window.GrowiFacade;
+    delete (global as any).window.growiFacade;
   });
 
-  it('returns window.GrowiFacade.react in production mode', () => {
+  it('returns window.growiFacade.react in production mode', () => {
     // given
     process.env.NODE_ENV = 'production';
     const mockProductionReact = { useEffect: () => {} } as unknown as typeof React;
 
     (global as any).window = {
-      GrowiFacade: {
+      growiFacade: {
         react: mockProductionReact,
       },
     };

+ 3 - 3
packages/pluginkit/src/v4/client/utils/growi-facade/growi-react.ts

@@ -5,14 +5,14 @@ import type { GrowiFacade } from '@growi/core';
 
 declare global {
   interface Window {
-    GrowiFacade: GrowiFacade
+    growiFacade: GrowiFacade
   }
 }
 
 /**
  * Retrieves the React instance that this package should use.
  *
- * - **Production Mode**: Returns the React instance from `window.GrowiFacade.react`
+ * - **Production Mode**: Returns the React instance from `window.growiFacade.react`
  *   to ensure a single shared React instance across the app.
  * - **Development Mode**: Returns the React instance passed as an argument,
  *   which allows local development and hot reload without issues.
@@ -28,7 +28,7 @@ declare global {
  */
 export const growiReact = (react: typeof React): typeof React => {
   if (process.env.NODE_ENV === 'production') {
-    return window.GrowiFacade.react as typeof React;
+    return window.growiFacade.react as typeof React;
   }
   return react as typeof React;
 };