@djangocfg/nextjs 2.1.138 → 2.1.140

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 CHANGED
@@ -179,141 +179,6 @@ export default createBaseNextConfig({
179
179
 
180
180
  See [PWA.md](./PWA.md) for complete guide.
181
181
 
182
- ### Push Notifications
183
-
184
- **Zero-config push notifications** using standard Web Push Protocol (no Firebase needed).
185
-
186
- #### PWA CLI
187
-
188
- Quick commands for managing push notifications:
189
-
190
- ```bash
191
- # Generate VAPID keys
192
- pnpm pwa vapid
193
-
194
- # Check PWA status
195
- pnpm pwa status
196
-
197
- # Send test push
198
- pnpm pwa send '<subscription-json>'
199
-
200
- # Show help
201
- pnpm pwa info
202
- ```
203
-
204
- #### 1. Generate VAPID keys
205
-
206
- ```bash
207
- pnpm pwa vapid
208
- ```
209
-
210
- Add to `.env.local`:
211
-
212
- ```bash
213
- NEXT_PUBLIC_VAPID_PUBLIC_KEY=your_public_key_here
214
- VAPID_PRIVATE_KEY=your_private_key_here
215
- VAPID_MAILTO=mailto:your-email@example.com
216
- ```
217
-
218
- #### 2. Add API routes
219
-
220
- ```tsx
221
- // app/api/push/subscribe/route.ts
222
- export { POST, GET } from '@djangocfg/nextjs/pwa/server/routes';
223
-
224
- // app/api/push/send/route.ts
225
- export { handleSend as POST } from '@djangocfg/nextjs/pwa/server/routes';
226
- ```
227
-
228
- #### 3. Enable push in service worker
229
-
230
- ```tsx
231
- // app/sw.ts
232
- import { createServiceWorker } from '@djangocfg/nextjs/pwa/worker';
233
- import { settings } from '@core/settings';
234
-
235
- createServiceWorker({
236
- offlineFallback: '/_offline',
237
- enablePushNotifications: true,
238
- notificationIcon: settings.app.icons.logo192,
239
- notificationBadge: settings.app.icons.logo192,
240
- });
241
- ```
242
-
243
- #### 4. Subscribe from client
244
-
245
- ```tsx
246
- import { subscribeToPushNotifications } from '@djangocfg/nextjs/pwa';
247
-
248
- const subscription = await subscribeToPushNotifications({
249
- vapidPublicKey: process.env.NEXT_PUBLIC_VAPID_PUBLIC_KEY!,
250
- });
251
-
252
- // Save subscription to server
253
- await fetch('/api/push/subscribe', {
254
- method: 'POST',
255
- headers: { 'Content-Type': 'application/json' },
256
- body: JSON.stringify(subscription),
257
- });
258
- ```
259
-
260
- #### Testing with CLI
261
-
262
- ```bash
263
- # 1. Start dev server
264
- pnpm dev
265
-
266
- # 2. Open browser console at http://localhost:3000
267
- # 3. Subscribe to push notifications:
268
- await (async () => {
269
- const { subscribeToPushNotifications } = await import('@djangocfg/nextjs/pwa');
270
- const sub = await subscribeToPushNotifications({
271
- vapidPublicKey: 'YOUR_PUBLIC_KEY'
272
- });
273
- await fetch('/api/push/subscribe', {
274
- method: 'POST',
275
- headers: { 'Content-Type': 'application/json' },
276
- body: JSON.stringify(sub)
277
- });
278
- console.log('Subscribed!', sub);
279
- })();
280
-
281
- # 4. Send test notification (from another console tab or curl):
282
- fetch('/api/push/send', {
283
- method: 'POST',
284
- headers: { 'Content-Type': 'application/json' },
285
- body: JSON.stringify({
286
- subscription: { /* paste subscription object */ },
287
- notification: {
288
- title: 'Test Push',
289
- body: 'Hello from CLI!',
290
- icon: '/static/logos/192x192.png'
291
- }
292
- })
293
- });
294
- ```
295
-
296
- Or use curl:
297
-
298
- ```bash
299
- curl -X POST http://localhost:3000/api/push/send \
300
- -H "Content-Type: application/json" \
301
- -d '{
302
- "subscription": {...},
303
- "notification": {
304
- "title": "Test",
305
- "body": "Hello!"
306
- }
307
- }'
308
- ```
309
-
310
- **Features:**
311
- - Standard Web Push Protocol (VAPID)
312
- - No Firebase or external services required
313
- - Auto-configuration with helpful warnings
314
- - Ready-to-use route handlers
315
- - Built-in subscription management
316
-
317
182
  ### i18n (Internationalization)
318
183
 
319
184
  Full next-intl integration for multilingual Next.js apps.
@@ -561,10 +426,8 @@ import { RedirectPage } from '@djangocfg/layouts/components/RedirectPage';
561
426
  | `@djangocfg/nextjs/i18n/components` | LocaleSwitcher and i18n components |
562
427
  | `@djangocfg/nextjs/ai` | AI documentation search and MCP config |
563
428
  | `@djangocfg/nextjs/config` | Base Next.js configuration factory |
564
- | `@djangocfg/nextjs/pwa` | PWA client utilities (service worker registration, push subscriptions) |
429
+ | `@djangocfg/nextjs/pwa` | PWA client utilities (service worker registration) |
565
430
  | `@djangocfg/nextjs/pwa/worker` | Service worker creation helpers |
566
- | `@djangocfg/nextjs/pwa/server` | Server-side push notification utilities |
567
- | `@djangocfg/nextjs/pwa/server/routes` | Ready-to-use API route handlers for push |
568
431
  | `@djangocfg/nextjs/sitemap` | Sitemap generation with i18n hreflang support |
569
432
  | `@djangocfg/nextjs/health` | Health check handlers |
570
433
  | `@djangocfg/nextjs/og-image` | OG image generation |
@@ -14,7 +14,7 @@ var require_package = __commonJS({
14
14
  "package.json"(exports, module) {
15
15
  module.exports = {
16
16
  name: "@djangocfg/nextjs",
17
- version: "2.1.138",
17
+ version: "2.1.140",
18
18
  description: "Next.js server utilities: sitemap, health, OG images, contact forms, navigation, config",
19
19
  keywords: [
20
20
  "nextjs",
@@ -103,16 +103,6 @@ var require_package = __commonJS({
103
103
  import: "./dist/pwa/worker/index.mjs",
104
104
  default: "./dist/pwa/worker/index.mjs"
105
105
  },
106
- "./pwa/server": {
107
- types: "./dist/pwa/server/index.d.mts",
108
- import: "./dist/pwa/server/index.mjs",
109
- default: "./dist/pwa/server/index.mjs"
110
- },
111
- "./pwa/server/routes": {
112
- types: "./dist/pwa/server/routes.d.mts",
113
- import: "./dist/pwa/server/routes.mjs",
114
- default: "./dist/pwa/server/routes.mjs"
115
- },
116
106
  "./i18n": {
117
107
  types: "./dist/i18n/index.d.mts",
118
108
  import: "./dist/i18n/index.mjs",
@@ -161,8 +151,7 @@ var require_package = __commonJS({
161
151
  "LICENSE"
162
152
  ],
163
153
  bin: {
164
- "djangocfg-docs": "./dist/ai/cli.mjs",
165
- "djangocfg-pwa": "./dist/pwa/cli.mjs"
154
+ "djangocfg-docs": "./dist/ai/cli.mjs"
166
155
  },
167
156
  scripts: {
168
157
  build: "tsup",
@@ -170,8 +159,7 @@ var require_package = __commonJS({
170
159
  clean: "rm -rf dist",
171
160
  lint: "eslint .",
172
161
  check: "tsc --noEmit",
173
- "ai-docs": "tsx src/ai/cli.ts",
174
- pwa: "tsx src/pwa/cli.ts"
162
+ "ai-docs": "tsx src/ai/cli.ts"
175
163
  },
176
164
  peerDependencies: {
177
165
  "@djangocfg/i18n": "workspace:*",
@@ -191,8 +179,7 @@ var require_package = __commonJS({
191
179
  consola: "^3.4.2",
192
180
  "next-intl": "^4.1.0",
193
181
  semver: "^7.7.3",
194
- serwist: "^9.2.3",
195
- "web-push": "^3.6.7"
182
+ serwist: "^9.2.3"
196
183
  },
197
184
  devDependencies: {
198
185
  "@djangocfg/i18n": "workspace:*",
@@ -204,7 +191,6 @@ var require_package = __commonJS({
204
191
  "@types/react": "19.2.2",
205
192
  "@types/react-dom": "19.2.1",
206
193
  "@types/semver": "^7.7.1",
207
- "@types/web-push": "^3.6.4",
208
194
  "@types/webpack": "^5.28.5",
209
195
  "@vercel/og": "^0.8.5",
210
196
  eslint: "^9.37.0",