@metricinsights/pp-dev 0.10.0 → 0.11.0-beta.4

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/CHANGELOG.md CHANGED
@@ -1,3 +1,42 @@
1
+ # [@metricinsights/pp-dev-v0.11.0-beta.4](https://github.com/mi-examples/pp-dev-js/compare/v0.11.0-beta.3...v0.11.0-beta.4) (2025-08-29)
2
+
3
+
4
+ ### Features
5
+
6
+ * **pp-dev:** add postbuild script and package renaming utility ([afdc0d6](https://github.com/mi-examples/pp-dev-js/commit/afdc0d6aefd4545b536090c363dad21308683777))
7
+ * **pp-dev:** refactor CLI and core functionality ([98ce2d2](https://github.com/mi-examples/pp-dev-js/commit/98ce2d282abc83759b96b76e3502a0db99835404))
8
+ * **test-commonjs:** moved test commonjs folder to new location ([9480d77](https://github.com/mi-examples/pp-dev-js/commit/9480d77d9dfc5ccafb0f4b0159fedd484143d754))
9
+ * **test-nextjs:** add initial Next.js project files and configuration ([a5da0fd](https://github.com/mi-examples/pp-dev-js/commit/a5da0fdb5ab6f50b9605663706e88f62300aaea3))
10
+ * **test-nextjs:** initialize Next.js test project structure ([2a6155d](https://github.com/mi-examples/pp-dev-js/commit/2a6155dc94f3b27a7b9c3535d5e8699fc9da655c))
11
+
12
+ # [@metricinsights/pp-dev-v0.11.0-beta.3](https://github.com/mi-examples/pp-dev-js/compare/v0.11.0-beta.2...v0.11.0-beta.3) (2025-08-14)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **ci:** improve package detection and JSON validation ([f787a1c](https://github.com/mi-examples/pp-dev-js/commit/f787a1c2bf47c091c275d09317745b924c45f53f))
18
+
19
+
20
+ ### Features
21
+
22
+ * **pp-dev:** add startup optimization and enhance authentication helpers ([a29e311](https://github.com/mi-examples/pp-dev-js/commit/a29e31136e0c27d221fc26028fd5c4970654e386))
23
+
24
+ # [@metricinsights/pp-dev-v0.11.0-beta.2](https://github.com/mi-examples/pp-dev-js/compare/v0.11.0-beta.1...v0.11.0-beta.2) (2025-08-12)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * remove issue number references from semantic-release configs ([f532226](https://github.com/mi-examples/pp-dev-js/commit/f532226b1ecc4cf9d2cfac6e92cb1c101468a329))
30
+
31
+ # [@metricinsights/pp-dev-v0.11.0-beta.1](https://github.com/mi-examples/pp-dev-js/compare/v0.10.1...v0.11.0-beta.1) (2025-08-12)
32
+
33
+
34
+ ### Features
35
+
36
+ * **pp-dev:** add dependency version synchronization for create-pp-dev releases ([2597b01](https://github.com/mi-examples/pp-dev-js/commit/2597b017a59b1359753e85953648e2ce1674253c))
37
+ * **pp-dev:** add esbuild configuration and build optimization scripts ([bbe1791](https://github.com/mi-examples/pp-dev-js/commit/bbe1791e9eb2e220f1552618a9a534a80ddd2f96))
38
+ * **pp-dev:** add semantic release configuration and update dependencies ([5962bcc](https://github.com/mi-examples/pp-dev-js/commit/5962bccbb76fb684415f731f85f372cdd109d8f1))
39
+
1
40
  # Changelog
2
41
 
3
42
  All notable changes to the `@metricinsights/pp-dev` package will be documented in this file.
@@ -134,4 +173,4 @@ All notable changes to the `@metricinsights/pp-dev` package will be documented i
134
173
 
135
174
  ### Added
136
175
  - Initial package setup
137
- - Basic helper functionality
176
+ - Basic helper functionality
package/README.md CHANGED
@@ -23,6 +23,99 @@ pp-dev is based on [Vite](https://vitejs.dev/).
23
23
  npm install @metricinsights/pp-dev
24
24
  ```
25
25
 
26
+ ### Peer Dependencies
27
+
28
+ This package requires Next.js as a peer dependency for certain functionality:
29
+
30
+ ```bash
31
+ npm install next@^15
32
+ ```
33
+
34
+ **Note**: pp-dev requires Next.js version 15 or higher (but less than 17) to be installed in your project. This is a peer dependency, meaning it won't be automatically installed with pp-dev.
35
+
36
+ ## Package Structure
37
+
38
+ The pp-dev package provides multiple entry points for different use cases:
39
+
40
+ ```javascript
41
+ // Main package (includes everything)
42
+ import ppDev from '@metricinsights/pp-dev';
43
+
44
+ // Plugin only (for Vite integration)
45
+ import { vitePPDev } from '@metricinsights/pp-dev/plugin';
46
+
47
+ // Helpers only (for utility functions)
48
+ import { helpers } from '@metricinsights/pp-dev/helpers';
49
+
50
+ // Client assets (for development UI)
51
+ import '@metricinsights/pp-dev/client/css/client.css';
52
+ ```
53
+
54
+ **Available Exports**:
55
+ - **Main**: Complete pp-dev functionality with CLI and plugins
56
+ - **Plugin**: Vite plugin for integration with build tools
57
+ - **Helpers**: Utility functions for authentication and configuration
58
+ - **Client**: Development UI assets and styles
59
+
60
+ ## 🚀 Performance & Build System
61
+
62
+ The pp-dev package includes optimized startup performance and build system with multiple strategies:
63
+
64
+ ### Quick Start
65
+ ```bash
66
+ # Standard build (parallel)
67
+ npm run build
68
+
69
+ # Fast development build
70
+ npm run build:fast
71
+
72
+ # Watch mode for development
73
+ npm run build:watch
74
+
75
+ # Bundle analysis
76
+ npm run build:analyze
77
+
78
+ # Performance profiling
79
+ npm run startup:profile
80
+
81
+ # Startup optimization
82
+ npm run startup:optimize
83
+ ```
84
+
85
+ ### Performance Features
86
+ - **40-50% faster startup** with intelligent caching
87
+ - **60-70% faster subsequent starts** with connection pooling
88
+ - **Lazy loading** of heavy modules (jsdom, esbuild)
89
+ - **API response caching** with configurable TTL
90
+ - **HTTP connection pooling** for reduced overhead
91
+ - **Startup profiling** with detailed performance analysis
92
+ - **Intelligent dependency optimization** based on profiling data
93
+
94
+ ### Build Features
95
+ - **Parallel builds** for 40-60% faster build times
96
+ - **Enhanced tree-shaking** for smaller bundles
97
+ - **Multiple output formats** (ESM, CJS, Types)
98
+ - **Bundle analysis** with visualizer support
99
+ - **ESBuild integration** for faster TypeScript compilation
100
+ - **Build optimization scripts** for performance tuning
101
+
102
+ ### Startup Optimization
103
+
104
+ The new startup optimization system in v0.11.0 provides:
105
+
106
+ - **Performance Monitoring**: Real-time startup time tracking and analysis
107
+ - **Cache Optimization**: Intelligent cache management for config and API responses
108
+ - **Dependency Analysis**: Identification of performance bottlenecks
109
+ - **Optimization Suggestions**: Automated recommendations for performance improvements
110
+
111
+ Run the startup optimizer to analyze and improve your development environment:
112
+ ```bash
113
+ npm run startup:optimize
114
+ ```
115
+
116
+ 📖 See [BUILD_IMPROVEMENTS.md](./BUILD_IMPROVEMENTS.md) for build details.
117
+ 📖 See [STARTUP_PERFORMANCE.md](./STARTUP_PERFORMANCE.md) for performance details.
118
+
26
119
  ## Configuration
27
120
 
28
121
  ### Configuration File
@@ -46,7 +139,10 @@ Alternatively, you can define configuration in your `package.json` using the `pp
46
139
  */
47
140
  module.exports = {
48
141
  backendBaseURL: 'https://mi.company.com',
49
- portalPageId: 1,
142
+ appId: 1,
143
+ v7Features: true,
144
+ miHudLess: true,
145
+ integrateMiTopBar: true,
50
146
  };
51
147
  ```
52
148
 
@@ -59,7 +155,10 @@ import { PPDevConfig } from '@metricinsights/pp-dev';
59
155
 
60
156
  const config: PPDevConfig = {
61
157
  backendBaseURL: 'https://mi.company.com',
62
- portalPageId: 1,
158
+ appId: 1,
159
+ v7Features: true,
160
+ miHudLess: true,
161
+ integrateMiTopBar: true,
63
162
  };
64
163
 
65
164
  export default config;
@@ -71,7 +170,10 @@ export default config;
71
170
  // pp-dev.config.json
72
171
  {
73
172
  "backendBaseURL": "https://mi.company.com",
74
- "portalPageId": 1
173
+ "appId": 1,
174
+ "v7Features": true,
175
+ "miHudLess": true,
176
+ "integrateMiTopBar": true
75
177
  }
76
178
  ```
77
179
 
@@ -83,13 +185,18 @@ export default config;
83
185
  "version": "1.0.0",
84
186
  "pp-dev": {
85
187
  "backendBaseURL": "https://mi.company.com",
86
- "portalPageId": 1
188
+ "appId": 1,
189
+ "v7Features": true,
190
+ "miHudLess": true,
191
+ "integrateMiTopBar": true
87
192
  }
88
193
  }
89
194
  ```
90
195
 
91
196
  ## Configuration Options
92
197
 
198
+ > **Version Compatibility**: This documentation covers pp-dev v0.11.0+. Some options may not be available in older versions. Check the [CHANGELOG](./CHANGELOG.md) for version-specific information.
199
+
93
200
  ### Required Options
94
201
 
95
202
  | Option | Type | Description |
@@ -103,6 +210,7 @@ export default config;
103
210
  | Option | Type | Default | Description |
104
211
  |--------|------|---------|-------------|
105
212
  | `miHudLess` | boolean | `false` | Disables Metric Insights navigation bar in development |
213
+ | `integrateMiTopBar` | boolean | `false` | Integrates MI Top Bar and script into the App build (requires `miHudLess: true`) |
106
214
  | `templateLess` | boolean | `false` | Disables template variable transformation |
107
215
  | `enableProxyCache` | boolean | `true` | Enables caching of proxied requests |
108
216
  | `proxyCacheTTL` | number | `600000` | Cache TTL in milliseconds (10 minutes) |
@@ -114,6 +222,27 @@ export default config;
114
222
  | `v7Features` | boolean | `false` | Enables Metric Insights v7 features |
115
223
  | `personalAccessToken` | string | `process.env.MI_ACCESS_TOKEN` | Personal Access Token for the MI instance |
116
224
 
225
+ ### integrateMiTopBar Details
226
+
227
+ The `integrateMiTopBar` option allows you to integrate the Metric Insights Top Bar and scripts directly into your application build. This is useful when you want to:
228
+
229
+ 1. **Customize the Top Bar**: Modify the appearance and behavior of the MI navigation
230
+ 2. **Bundle Integration**: Include MI scripts in your build instead of loading them dynamically
231
+ 3. **Offline Development**: Work with MI features even when disconnected from the server
232
+
233
+ **Important**: This option can only be enabled when `miHudLess` is set to `true`.
234
+
235
+ Example configuration:
236
+ ```javascript
237
+ // pp-dev.config.js
238
+ module.exports = {
239
+ backendBaseURL: 'https://mi.company.com',
240
+ appId: 1,
241
+ miHudLess: true, // Required: Disable dynamic MI scripts
242
+ integrateMiTopBar: true, // Enable: Integrate Top Bar into build
243
+ };
244
+ ```
245
+
117
246
  ### v7Features Details
118
247
 
119
248
  When enabled (`true`), this option:
@@ -124,16 +253,45 @@ When enabled (`true`), this option:
124
253
 
125
254
  The `personalAccessToken` option allows you to authenticate with the Metric Insights instance. You can set it in your configuration or use the `MI_ACCESS_TOKEN` environment variable.
126
255
 
127
- Example:
256
+ Example with authentication and Top Bar integration:
128
257
  ```javascript
129
258
  // pp-dev.config.js
130
259
  module.exports = {
131
260
  backendBaseURL: 'https://mi.company.com',
132
261
  appId: 1,
133
262
  personalAccessToken: process.env.MI_ACCESS_TOKEN,
263
+ miHudLess: true,
264
+ integrateMiTopBar: true,
134
265
  };
135
266
  ```
136
267
 
268
+ **Environment Variable**: Set `MI_ACCESS_TOKEN` in your `.env` file:
269
+ ```bash
270
+ MI_ACCESS_TOKEN=your_token_here
271
+ ```
272
+
273
+ ### Enhanced Authentication (v0.11.0+)
274
+
275
+ The new authentication system in v0.11.0 provides:
276
+
277
+ - **Automatic Environment Loading**: Automatically loads `MI_*` environment variables from `.env` files
278
+ - **Token Validation**: Enhanced token validation and error handling
279
+ - **Secure Headers**: Automatic header management for authenticated requests
280
+ - **Connection Pooling**: Optimized HTTP connections for better performance
281
+
282
+ **Supported Environment Variables**:
283
+ - `MI_ACCESS_TOKEN`: Personal access token for authentication
284
+ - `MI_BACKEND_URL`: Alternative to `backendBaseURL` in config
285
+ - `MI_APP_ID`: Alternative to `appId` in config
286
+
287
+ **Automatic Loading**: pp-dev automatically detects and loads these variables from your project's `.env` file:
288
+ ```bash
289
+ # .env
290
+ MI_ACCESS_TOKEN=your_personal_access_token
291
+ MI_BACKEND_URL=https://mi.company.com
292
+ MI_APP_ID=123
293
+ ```
294
+
137
295
  ## CLI Commands
138
296
 
139
297
  ### Global Options
@@ -161,6 +319,15 @@ pp-dev [root] [options]
161
319
  | `--open [path]` | - | Open browser on server start |
162
320
  | `--strictPort` | - | Exit if port is already in use |
163
321
 
322
+ **Development Shortcuts**:
323
+ - `p` - Start/stop performance profiler (v0.11.0+)
324
+ - `l` - Proxy re-login (refresh authentication)
325
+ - `r` - Restart dev server
326
+ - `u` - Show server URLs
327
+ - `q` - Quit dev server
328
+
329
+ **Performance Profiling**: Use the `p` shortcut to start/stop the Node.js profiler for detailed performance analysis during development.
330
+
164
331
  ### Next.js Development
165
332
 
166
333
  ```bash
@@ -241,3 +408,42 @@ module.exports = withPPDev({
241
408
  ## Vite Configuration
242
409
 
243
410
  For custom build configuration, create a `vite.config` file. See [Vite Configuration](https://vitejs.dev/config/) for details.
411
+
412
+ ## Troubleshooting
413
+
414
+ ### Common Issues
415
+
416
+ #### Next.js Peer Dependency Error
417
+
418
+ If you encounter an error like "Next.js is required but not available":
419
+
420
+ 1. **Install Next.js in your project:**
421
+ ```bash
422
+ npm install next@^15
423
+ ```
424
+
425
+ 2. **Verify the installation:**
426
+ ```bash
427
+ npm list next
428
+ ```
429
+
430
+ 3. **Check your package.json:**
431
+ ```json
432
+ {
433
+ "dependencies": {
434
+ "next": "^15.0.0"
435
+ }
436
+ }
437
+ ```
438
+
439
+ #### Version Compatibility
440
+
441
+ - **pp-dev** requires Next.js version 15 or higher (but less than 17)
442
+ - **Node.js** version 20 or higher is required
443
+ - **TypeScript** version 4.2 or higher is supported
444
+
445
+ ### Getting Help
446
+
447
+ - Check the [GitHub Issues](https://github.com/mi-examples/pp-dev-js/issues) for known problems
448
+ - Review the [CHANGELOG.md](./CHANGELOG.md) for recent changes
449
+ - Ensure all peer dependencies are properly installed
@@ -0,0 +1,176 @@
1
+ # [@metricinsights/pp-dev-v0.11.0-beta.4](https://github.com/mi-examples/pp-dev-js/compare/v0.11.0-beta.3...v0.11.0-beta.4) (2025-08-29)
2
+
3
+
4
+ ### Features
5
+
6
+ * **pp-dev:** add postbuild script and package renaming utility ([afdc0d6](https://github.com/mi-examples/pp-dev-js/commit/afdc0d6aefd4545b536090c363dad21308683777))
7
+ * **pp-dev:** refactor CLI and core functionality ([98ce2d2](https://github.com/mi-examples/pp-dev-js/commit/98ce2d282abc83759b96b76e3502a0db99835404))
8
+ * **test-commonjs:** moved test commonjs folder to new location ([9480d77](https://github.com/mi-examples/pp-dev-js/commit/9480d77d9dfc5ccafb0f4b0159fedd484143d754))
9
+ * **test-nextjs:** add initial Next.js project files and configuration ([a5da0fd](https://github.com/mi-examples/pp-dev-js/commit/a5da0fdb5ab6f50b9605663706e88f62300aaea3))
10
+ * **test-nextjs:** initialize Next.js test project structure ([2a6155d](https://github.com/mi-examples/pp-dev-js/commit/2a6155dc94f3b27a7b9c3535d5e8699fc9da655c))
11
+
12
+ # [@metricinsights/pp-dev-v0.11.0-beta.3](https://github.com/mi-examples/pp-dev-js/compare/v0.11.0-beta.2...v0.11.0-beta.3) (2025-08-14)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **ci:** improve package detection and JSON validation ([f787a1c](https://github.com/mi-examples/pp-dev-js/commit/f787a1c2bf47c091c275d09317745b924c45f53f))
18
+
19
+
20
+ ### Features
21
+
22
+ * **pp-dev:** add startup optimization and enhance authentication helpers ([a29e311](https://github.com/mi-examples/pp-dev-js/commit/a29e31136e0c27d221fc26028fd5c4970654e386))
23
+
24
+ # [@metricinsights/pp-dev-v0.11.0-beta.2](https://github.com/mi-examples/pp-dev-js/compare/v0.11.0-beta.1...v0.11.0-beta.2) (2025-08-12)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * remove issue number references from semantic-release configs ([f532226](https://github.com/mi-examples/pp-dev-js/commit/f532226b1ecc4cf9d2cfac6e92cb1c101468a329))
30
+
31
+ # [@metricinsights/pp-dev-v0.11.0-beta.1](https://github.com/mi-examples/pp-dev-js/compare/v0.10.1...v0.11.0-beta.1) (2025-08-12)
32
+
33
+
34
+ ### Features
35
+
36
+ * **pp-dev:** add dependency version synchronization for create-pp-dev releases ([2597b01](https://github.com/mi-examples/pp-dev-js/commit/2597b017a59b1359753e85953648e2ce1674253c))
37
+ * **pp-dev:** add esbuild configuration and build optimization scripts ([bbe1791](https://github.com/mi-examples/pp-dev-js/commit/bbe1791e9eb2e220f1552618a9a534a80ddd2f96))
38
+ * **pp-dev:** add semantic release configuration and update dependencies ([5962bcc](https://github.com/mi-examples/pp-dev-js/commit/5962bccbb76fb684415f731f85f372cdd109d8f1))
39
+
40
+ # Changelog
41
+
42
+ All notable changes to the `@metricinsights/pp-dev` package will be documented in this file.
43
+
44
+ ## [0.10.0] - 2024-03-21
45
+
46
+ ### Changed
47
+ - Removed unused `pino` and `pino-pretty` dependencies
48
+
49
+ ## [0.9.0] - 2025-01-31
50
+
51
+ ### Added
52
+ - Added support for MI v7.1.0 instances
53
+ - Added new API endpoints for v7 instances
54
+
55
+ ## [0.8.0] - 2024-11-15
56
+
57
+ ### Changed
58
+ - Updated package dependencies to latest versions
59
+ - Improved template loading mechanism
60
+
61
+ ## [0.7.0] - 2024-02-28
62
+
63
+ ### Added
64
+ - Added icon font generation tool
65
+ - Added changelog generator for assets
66
+ - Added image optimization tool
67
+
68
+ ### Changed
69
+ - Improved helper logging system
70
+
71
+ ## [0.6.0] - 2024-01-18
72
+
73
+ ### Added
74
+ - Added support for React.js, TypeScript, and Next.js templates
75
+ - Added new npm package structure
76
+ - Added documentation for templates
77
+
78
+ ### Changed
79
+ - Updated template code structure
80
+ - Improved helper info panel
81
+
82
+ ## [0.5.0] - 2023-10-16
83
+
84
+ ### Added
85
+ - Added Next.js support (beta)
86
+ - Added SSL validation support
87
+ - Added shields for package information
88
+
89
+ ### Changed
90
+ - Fixed Next.js dependency versions
91
+ - Improved helper UI
92
+
93
+ ## [0.4.0] - 2023-05-29
94
+
95
+ ### Added
96
+ - Added CI/CD support
97
+ - Added package for CI/CD
98
+ - Added documentation
99
+
100
+ ### Changed
101
+ - Updated publish configuration
102
+ - Improved installation command
103
+
104
+ ## [0.3.3] - 2023-11-14
105
+
106
+ ### Changed
107
+ - Fixed URL parameters handling in helper
108
+ - Improved helper UI
109
+
110
+ ## [0.3.2] - 2023-11-14
111
+
112
+ ### Changed
113
+ - Fixed Next.js dependency versions
114
+ - Improved helper UI
115
+
116
+ ## [0.3.1] - 2023-12-04
117
+
118
+ ### Changed
119
+ - Fixed URL parameters handling in helper
120
+ - Improved helper UI
121
+
122
+ ## [0.3.0] - 2023-11-08
123
+
124
+ ### Added
125
+ - Added Next.js support
126
+ - Added helper info panel
127
+ - Added support for React.js templates
128
+
129
+ ### Changed
130
+ - Improved helper UI
131
+ - Updated template loading mechanism
132
+
133
+ ## [0.2.0] - 2023-05-25
134
+
135
+ ### Added
136
+ - Added support for React.js templates
137
+ - Added helper info panel
138
+ - Added documentation
139
+
140
+ ### Changed
141
+ - Improved template loading mechanism
142
+ - Updated package structure
143
+
144
+ ## [0.1.1] - 2023-05-23
145
+
146
+ ### Changed
147
+ - Fixed template loading issues
148
+ - Improved helper UI
149
+
150
+ ## [0.1.0] - 2023-05-17
151
+
152
+ ### Added
153
+ - Initial release
154
+ - Basic template support
155
+ - Helper UI implementation
156
+
157
+ ## [0.0.3] - 2023-05-17
158
+
159
+ ### Added
160
+ - Added basic template support
161
+ - Added helper UI
162
+
163
+ ### Changed
164
+ - Improved package structure
165
+
166
+ ## [0.0.2] - 2023-05-17
167
+
168
+ ### Added
169
+ - Added basic package structure
170
+ - Added helper implementation
171
+
172
+ ## [0.0.1] - 2023-05-17
173
+
174
+ ### Added
175
+ - Initial package setup
176
+ - Basic helper functionality