@djangocfg/centrifugo 2.1.232 → 2.1.234
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 +6 -0
- package/package.json +10 -10
- package/src/config.ts +2 -1
- package/src/core/logger/consolaLogger.ts +1 -1
- package/src/core/logger/createLogger.ts +2 -1
- package/src/core/utils/channelValidator.ts +2 -1
- package/src/core/utils/devTips.ts +2 -1
- package/src/hooks/useCodegenTip.ts +1 -1
- package/src/providers/CentrifugoProvider/CentrifugoProvider.tsx +2 -1
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
</div>
|
|
6
|
+
|
|
1
7
|
# @djangocfg/centrifugo
|
|
2
8
|
|
|
3
9
|
> Production-ready Centrifugo WebSocket client for React with real-time subscriptions, RPC patterns, and connection state management
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/centrifugo",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.234",
|
|
4
4
|
"description": "Production-ready Centrifugo WebSocket client for React with real-time subscriptions, RPC patterns, and connection state management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"centrifugo",
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"centrifuge": "^5.2.2"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@djangocfg/api": "^2.1.
|
|
67
|
-
"@djangocfg/i18n": "^2.1.
|
|
68
|
-
"@djangocfg/ui-core": "^2.1.
|
|
69
|
-
"@djangocfg/ui-tools": "^2.1.
|
|
66
|
+
"@djangocfg/api": "^2.1.234",
|
|
67
|
+
"@djangocfg/i18n": "^2.1.234",
|
|
68
|
+
"@djangocfg/ui-core": "^2.1.234",
|
|
69
|
+
"@djangocfg/ui-tools": "^2.1.234",
|
|
70
70
|
"consola": "^3.4.2",
|
|
71
71
|
"lucide-react": "^0.545.0",
|
|
72
72
|
"moment": "^2.30.1",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"react-dom": "^19.1.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@djangocfg/api": "^2.1.
|
|
78
|
-
"@djangocfg/i18n": "^2.1.
|
|
79
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
80
|
-
"@djangocfg/ui-core": "^2.1.
|
|
81
|
-
"@djangocfg/ui-tools": "^2.1.
|
|
77
|
+
"@djangocfg/api": "^2.1.234",
|
|
78
|
+
"@djangocfg/i18n": "^2.1.234",
|
|
79
|
+
"@djangocfg/typescript-config": "^2.1.234",
|
|
80
|
+
"@djangocfg/ui-core": "^2.1.234",
|
|
81
|
+
"@djangocfg/ui-tools": "^2.1.234",
|
|
82
82
|
"@types/node": "^24.7.2",
|
|
83
83
|
"@types/react": "^19.1.0",
|
|
84
84
|
"@types/react-dom": "^19.1.0",
|
package/src/config.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Centrifugo Package Configuration
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { isDev } from '@djangocfg/ui-core/lib';
|
|
6
|
+
export const isDevelopment = isDev;
|
|
6
7
|
export const isProduction = !isDevelopment;
|
|
7
8
|
export const isStaticBuild = process.env.NEXT_PUBLIC_STATIC_BUILD === 'true';
|
|
8
9
|
|
|
@@ -8,7 +8,7 @@ import { createConsola } from 'consola';
|
|
|
8
8
|
|
|
9
9
|
import type { Logger } from './createLogger';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import { isDev as isDevelopment } from '@djangocfg/ui-core/lib';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Shared consola logger for Centrifugo package
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Dual output: developer console + UI logs viewer.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { isDev } from "@djangocfg/ui-core/lib";
|
|
8
9
|
import { createConsola } from 'consola';
|
|
9
10
|
|
|
10
11
|
import { getGlobalLogsStore } from './LogsStore';
|
|
@@ -48,7 +49,7 @@ export function createLogger(configOrPrefix: LoggerConfig | string): Logger {
|
|
|
48
49
|
? { source: 'client', tag: configOrPrefix }
|
|
49
50
|
: configOrPrefix;
|
|
50
51
|
|
|
51
|
-
const { source, isDevelopment =
|
|
52
|
+
const { source, isDevelopment = isDev, tag = 'Centrifugo' } = config;
|
|
52
53
|
|
|
53
54
|
const logsStore = getGlobalLogsStore();
|
|
54
55
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isProd } from "@djangocfg/ui-core/lib";
|
|
1
2
|
/**
|
|
2
3
|
* Channel name validation utilities for Centrifugo
|
|
3
4
|
*
|
|
@@ -93,7 +94,7 @@ export function logChannelWarnings(
|
|
|
93
94
|
channel: string,
|
|
94
95
|
logger?: { warning: (msg: string) => void }
|
|
95
96
|
): void {
|
|
96
|
-
if (
|
|
97
|
+
if (isProd) {
|
|
97
98
|
return; // Skip in production
|
|
98
99
|
}
|
|
99
100
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Used across the package to educate developers about features.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { isDev } from "@djangocfg/ui-core/lib";
|
|
8
9
|
import { getConsolaLogger } from '../logger/consolaLogger';
|
|
9
10
|
|
|
10
11
|
const logger = getConsolaLogger('DevTips');
|
|
@@ -21,7 +22,7 @@ const shownTips = new Set<string>();
|
|
|
21
22
|
* showDevTip('codegen', 'Generate type-safe clients:', 'python manage.py ...');
|
|
22
23
|
*/
|
|
23
24
|
export function showDevTip(id: string, message: string, details?: string): void {
|
|
24
|
-
if (
|
|
25
|
+
if (!isDev) return;
|
|
25
26
|
if (shownTips.has(id)) return;
|
|
26
27
|
|
|
27
28
|
shownTips.add(id);
|
|
@@ -8,7 +8,7 @@ import { useEffect, useRef } from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { consolaLogger } from '../core/logger/consolaLogger';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import { isDev as isDevelopment } from '@djangocfg/ui-core/lib';
|
|
12
12
|
let tipShown = false; // Global flag to show tip once across all components
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
'use client';
|
|
9
9
|
|
|
10
|
+
import { nodeEnv } from "@djangocfg/ui-core/lib";
|
|
10
11
|
import {
|
|
11
12
|
createContext, ReactNode, useCallback, useContext, useEffect, useMemo, useRef, useState
|
|
12
13
|
} from 'react';
|
|
@@ -142,7 +143,7 @@ function CentrifugoProviderInner({
|
|
|
142
143
|
const { url: wsUrl, enabled: wsEnabled, source: wsSource } = useMemo(() => resolveWsUrl({
|
|
143
144
|
urlProp: url,
|
|
144
145
|
tokenUrl: centrifugoToken?.centrifugo_url,
|
|
145
|
-
nodeEnv:
|
|
146
|
+
nodeEnv: nodeEnv,
|
|
146
147
|
envCentrifugoUrl: process.env.NEXT_PUBLIC_CENTRIFUGO_URL,
|
|
147
148
|
envApiUrl: process.env.NEXT_PUBLIC_API_URL,
|
|
148
149
|
}), [url, centrifugoToken?.centrifugo_url]);
|