webspresso 0.0.4 → 0.0.5
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 +25 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ A minimal, file-based SSR framework for Node.js with Nunjucks templating.
|
|
|
11
11
|
- **Lifecycle Hooks**: Global and route-level hooks for request processing
|
|
12
12
|
- **Template Helpers**: Laravel-inspired helper functions available in templates
|
|
13
13
|
- **Plugin System**: Extensible architecture with version control and inter-plugin communication
|
|
14
|
-
- **Built-in Plugins**:
|
|
14
|
+
- **Built-in Plugins**: Development dashboard, sitemap generator, analytics integration (Google, Yandex, Bing)
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
@@ -325,12 +325,13 @@ Webspresso has a built-in plugin system with version control and dependency mana
|
|
|
325
325
|
|
|
326
326
|
```javascript
|
|
327
327
|
const { createApp } = require('webspresso');
|
|
328
|
-
const { sitemapPlugin, analyticsPlugin } = require('webspresso/plugins');
|
|
328
|
+
const { sitemapPlugin, analyticsPlugin, dashboardPlugin } = require('webspresso/plugins');
|
|
329
329
|
|
|
330
330
|
const { app } = createApp({
|
|
331
331
|
pagesDir: './pages',
|
|
332
332
|
viewsDir: './views',
|
|
333
333
|
plugins: [
|
|
334
|
+
dashboardPlugin(), // Dev dashboard at /_webspresso
|
|
334
335
|
sitemapPlugin({
|
|
335
336
|
hostname: 'https://example.com',
|
|
336
337
|
exclude: ['/admin/*', '/api/*'],
|
|
@@ -357,6 +358,28 @@ const { app } = createApp({
|
|
|
357
358
|
|
|
358
359
|
### Built-in Plugins
|
|
359
360
|
|
|
361
|
+
**Dashboard Plugin:**
|
|
362
|
+
- Development dashboard at `/_webspresso`
|
|
363
|
+
- Monitor all routes (SSR pages and API endpoints)
|
|
364
|
+
- View loaded plugins and configuration
|
|
365
|
+
- Filter and search routes
|
|
366
|
+
- Only active in development mode (disabled in production)
|
|
367
|
+
|
|
368
|
+
```javascript
|
|
369
|
+
const { dashboardPlugin } = require('webspresso/plugins');
|
|
370
|
+
|
|
371
|
+
const { app } = createApp({
|
|
372
|
+
pagesDir: './pages',
|
|
373
|
+
plugins: [
|
|
374
|
+
dashboardPlugin() // Available at /_webspresso in dev mode
|
|
375
|
+
]
|
|
376
|
+
});
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Options:
|
|
380
|
+
- `path` - Custom dashboard path (default: `/_webspresso`)
|
|
381
|
+
- `enabled` - Force enable/disable (default: auto based on NODE_ENV)
|
|
382
|
+
|
|
360
383
|
**Sitemap Plugin:**
|
|
361
384
|
- Generates `/sitemap.xml` from routes automatically
|
|
362
385
|
- Excludes dynamic routes and API endpoints
|
package/package.json
CHANGED