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

GrowiFacade to growiFacade

NaokiHigashi28 пре 1 година
родитељ
комит
fdde5ad90f

+ 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(() => {
   afterEach(() => {
     process.env.NODE_ENV = originalNodeEnv;
     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
     // given
     process.env.NODE_ENV = 'production';
     process.env.NODE_ENV = 'production';
     const mockProductionReact = { useEffect: () => {} } as unknown as typeof React;
     const mockProductionReact = { useEffect: () => {} } as unknown as typeof React;
 
 
     (global as any).window = {
     (global as any).window = {
-      GrowiFacade: {
+      growiFacade: {
         react: mockProductionReact,
         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 {
 declare global {
   interface Window {
   interface Window {
-    GrowiFacade: GrowiFacade
+    growiFacade: GrowiFacade
   }
   }
 }
 }
 
 
 /**
 /**
  * Retrieves the React instance that this package should use.
  * 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.
  *   to ensure a single shared React instance across the app.
  * - **Development Mode**: Returns the React instance passed as an argument,
  * - **Development Mode**: Returns the React instance passed as an argument,
  *   which allows local development and hot reload without issues.
  *   which allows local development and hot reload without issues.
@@ -28,7 +28,7 @@ declare global {
  */
  */
 export const growiReact = (react: typeof React): typeof React => {
 export const growiReact = (react: typeof React): typeof React => {
   if (process.env.NODE_ENV === 'production') {
   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;
   return react as typeof React;
 };
 };