@metricinsights/pp-dev 0.10.1 → 0.12.0

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,9 +1,49 @@
1
- # [@metricinsights/pp-dev-v0.10.1](https://github.com/mi-examples/pp-dev-js/compare/v0.10.0...v0.10.1) (2025-04-25)
1
+ # [@metricinsights/pp-dev-v0.12.0](https://github.com/mi-examples/pp-dev-js/compare/v0.11.0...v0.12.0) (2025-01-15)
2
+
3
+
4
+ ### Features
5
+
6
+ * **auth:** add global authentication provider ([2b1e00d](https://github.com/mi-examples/pp-dev-js/commit/2b1e00d20cbfd21284aa871c47bc149829a2f865))
7
+ * **pp-dev:** enhance CLI and core functionality ([14a3772](https://github.com/mi-examples/pp-dev-js/commit/14a3772a4955aabad6b0fa0986a7047445e0cc5b))
8
+
9
+ # [@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)
10
+
11
+
12
+ ### Features
13
+
14
+ * **pp-dev:** add postbuild script and package renaming utility ([afdc0d6](https://github.com/mi-examples/pp-dev-js/commit/afdc0d6aefd4545b536090c363dad21308683777))
15
+ * **pp-dev:** refactor CLI and core functionality ([98ce2d2](https://github.com/mi-examples/pp-dev-js/commit/98ce2d282abc83759b96b76e3502a0db99835404))
16
+ * **test-commonjs:** moved test commonjs folder to new location ([9480d77](https://github.com/mi-examples/pp-dev-js/commit/9480d77d9dfc5ccafb0f4b0159fedd484143d754))
17
+ * **test-nextjs:** add initial Next.js project files and configuration ([a5da0fd](https://github.com/mi-examples/pp-dev-js/commit/a5da0fdb5ab6f50b9605663706e88f62300aaea3))
18
+ * **test-nextjs:** initialize Next.js test project structure ([2a6155d](https://github.com/mi-examples/pp-dev-js/commit/2a6155dc94f3b27a7b9c3535d5e8699fc9da655c))
19
+
20
+ # [@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)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **ci:** improve package detection and JSON validation ([f787a1c](https://github.com/mi-examples/pp-dev-js/commit/f787a1c2bf47c091c275d09317745b924c45f53f))
26
+
27
+
28
+ ### Features
29
+
30
+ * **pp-dev:** add startup optimization and enhance authentication helpers ([a29e311](https://github.com/mi-examples/pp-dev-js/commit/a29e31136e0c27d221fc26028fd5c4970654e386))
31
+
32
+ # [@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)
2
33
 
3
34
 
4
35
  ### Bug Fixes
5
36
 
6
- * update build configuration and fix type issues ([cffcff4](https://github.com/mi-examples/pp-dev-js/commit/cffcff4e493d3268aa3973a9e58c55c28c839a52))
37
+ * remove issue number references from semantic-release configs ([f532226](https://github.com/mi-examples/pp-dev-js/commit/f532226b1ecc4cf9d2cfac6e92cb1c101468a329))
38
+
39
+ # [@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)
40
+
41
+
42
+ ### Features
43
+
44
+ * **pp-dev:** add dependency version synchronization for create-pp-dev releases ([2597b01](https://github.com/mi-examples/pp-dev-js/commit/2597b017a59b1359753e85953648e2ce1674253c))
45
+ * **pp-dev:** add esbuild configuration and build optimization scripts ([bbe1791](https://github.com/mi-examples/pp-dev-js/commit/bbe1791e9eb2e220f1552618a9a534a80ddd2f96))
46
+ * **pp-dev:** add semantic release configuration and update dependencies ([5962bcc](https://github.com/mi-examples/pp-dev-js/commit/5962bccbb76fb684415f731f85f372cdd109d8f1))
7
47
 
8
48
  # Changelog
9
49
 
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
 
@@ -61,6 +157,8 @@ const config: PPDevConfig = {
61
157
  backendBaseURL: 'https://mi.company.com',
62
158
  appId: 1,
63
159
  v7Features: true,
160
+ miHudLess: true,
161
+ integrateMiTopBar: true,
64
162
  };
65
163
 
66
164
  export default config;
@@ -73,7 +171,9 @@ export default config;
73
171
  {
74
172
  "backendBaseURL": "https://mi.company.com",
75
173
  "appId": 1,
76
- "v7Features": true
174
+ "v7Features": true,
175
+ "miHudLess": true,
176
+ "integrateMiTopBar": true
77
177
  }
78
178
  ```
79
179
 
@@ -86,13 +186,17 @@ export default config;
86
186
  "pp-dev": {
87
187
  "backendBaseURL": "https://mi.company.com",
88
188
  "appId": 1,
89
- "v7Features": true
189
+ "v7Features": true,
190
+ "miHudLess": true,
191
+ "integrateMiTopBar": true
90
192
  }
91
193
  }
92
194
  ```
93
195
 
94
196
  ## Configuration Options
95
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
+
96
200
  ### Required Options
97
201
 
98
202
  | Option | Type | Description |
@@ -106,6 +210,7 @@ export default config;
106
210
  | Option | Type | Default | Description |
107
211
  |--------|------|---------|-------------|
108
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`) |
109
214
  | `templateLess` | boolean | `false` | Disables template variable transformation |
110
215
  | `enableProxyCache` | boolean | `true` | Enables caching of proxied requests |
111
216
  | `proxyCacheTTL` | number | `600000` | Cache TTL in milliseconds (10 minutes) |
@@ -117,6 +222,27 @@ export default config;
117
222
  | `v7Features` | boolean | `false` | Enables Metric Insights v7 features |
118
223
  | `personalAccessToken` | string | `process.env.MI_ACCESS_TOKEN` | Personal Access Token for the MI instance |
119
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
+
120
246
  ### v7Features Details
121
247
 
122
248
  When enabled (`true`), this option:
@@ -127,16 +253,45 @@ When enabled (`true`), this option:
127
253
 
128
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.
129
255
 
130
- Example:
256
+ Example with authentication and Top Bar integration:
131
257
  ```javascript
132
258
  // pp-dev.config.js
133
259
  module.exports = {
134
260
  backendBaseURL: 'https://mi.company.com',
135
261
  appId: 1,
136
262
  personalAccessToken: process.env.MI_ACCESS_TOKEN,
263
+ miHudLess: true,
264
+ integrateMiTopBar: true,
137
265
  };
138
266
  ```
139
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
+
140
295
  ## CLI Commands
141
296
 
142
297
  ### Global Options
@@ -164,6 +319,15 @@ pp-dev [root] [options]
164
319
  | `--open [path]` | - | Open browser on server start |
165
320
  | `--strictPort` | - | Exit if port is already in use |
166
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
+
167
331
  ### Next.js Development
168
332
 
169
333
  ```bash
@@ -244,3 +408,42 @@ module.exports = withPPDev({
244
408
  ## Vite Configuration
245
409
 
246
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,184 @@
1
+ # [@metricinsights/pp-dev-v0.12.0](https://github.com/mi-examples/pp-dev-js/compare/v0.11.0...v0.12.0) (2025-01-15)
2
+
3
+
4
+ ### Features
5
+
6
+ * **auth:** add global authentication provider ([2b1e00d](https://github.com/mi-examples/pp-dev-js/commit/2b1e00d20cbfd21284aa871c47bc149829a2f865))
7
+ * **pp-dev:** enhance CLI and core functionality ([14a3772](https://github.com/mi-examples/pp-dev-js/commit/14a3772a4955aabad6b0fa0986a7047445e0cc5b))
8
+
9
+ # [@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)
10
+
11
+
12
+ ### Features
13
+
14
+ * **pp-dev:** add postbuild script and package renaming utility ([afdc0d6](https://github.com/mi-examples/pp-dev-js/commit/afdc0d6aefd4545b536090c363dad21308683777))
15
+ * **pp-dev:** refactor CLI and core functionality ([98ce2d2](https://github.com/mi-examples/pp-dev-js/commit/98ce2d282abc83759b96b76e3502a0db99835404))
16
+ * **test-commonjs:** moved test commonjs folder to new location ([9480d77](https://github.com/mi-examples/pp-dev-js/commit/9480d77d9dfc5ccafb0f4b0159fedd484143d754))
17
+ * **test-nextjs:** add initial Next.js project files and configuration ([a5da0fd](https://github.com/mi-examples/pp-dev-js/commit/a5da0fdb5ab6f50b9605663706e88f62300aaea3))
18
+ * **test-nextjs:** initialize Next.js test project structure ([2a6155d](https://github.com/mi-examples/pp-dev-js/commit/2a6155dc94f3b27a7b9c3535d5e8699fc9da655c))
19
+
20
+ # [@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)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **ci:** improve package detection and JSON validation ([f787a1c](https://github.com/mi-examples/pp-dev-js/commit/f787a1c2bf47c091c275d09317745b924c45f53f))
26
+
27
+
28
+ ### Features
29
+
30
+ * **pp-dev:** add startup optimization and enhance authentication helpers ([a29e311](https://github.com/mi-examples/pp-dev-js/commit/a29e31136e0c27d221fc26028fd5c4970654e386))
31
+
32
+ # [@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)
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * remove issue number references from semantic-release configs ([f532226](https://github.com/mi-examples/pp-dev-js/commit/f532226b1ecc4cf9d2cfac6e92cb1c101468a329))
38
+
39
+ # [@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)
40
+
41
+
42
+ ### Features
43
+
44
+ * **pp-dev:** add dependency version synchronization for create-pp-dev releases ([2597b01](https://github.com/mi-examples/pp-dev-js/commit/2597b017a59b1359753e85953648e2ce1674253c))
45
+ * **pp-dev:** add esbuild configuration and build optimization scripts ([bbe1791](https://github.com/mi-examples/pp-dev-js/commit/bbe1791e9eb2e220f1552618a9a534a80ddd2f96))
46
+ * **pp-dev:** add semantic release configuration and update dependencies ([5962bcc](https://github.com/mi-examples/pp-dev-js/commit/5962bccbb76fb684415f731f85f372cdd109d8f1))
47
+
48
+ # Changelog
49
+
50
+ All notable changes to the `@metricinsights/pp-dev` package will be documented in this file.
51
+
52
+ ## [0.10.0] - 2024-03-21
53
+
54
+ ### Changed
55
+ - Removed unused `pino` and `pino-pretty` dependencies
56
+
57
+ ## [0.9.0] - 2025-01-31
58
+
59
+ ### Added
60
+ - Added support for MI v7.1.0 instances
61
+ - Added new API endpoints for v7 instances
62
+
63
+ ## [0.8.0] - 2024-11-15
64
+
65
+ ### Changed
66
+ - Updated package dependencies to latest versions
67
+ - Improved template loading mechanism
68
+
69
+ ## [0.7.0] - 2024-02-28
70
+
71
+ ### Added
72
+ - Added icon font generation tool
73
+ - Added changelog generator for assets
74
+ - Added image optimization tool
75
+
76
+ ### Changed
77
+ - Improved helper logging system
78
+
79
+ ## [0.6.0] - 2024-01-18
80
+
81
+ ### Added
82
+ - Added support for React.js, TypeScript, and Next.js templates
83
+ - Added new npm package structure
84
+ - Added documentation for templates
85
+
86
+ ### Changed
87
+ - Updated template code structure
88
+ - Improved helper info panel
89
+
90
+ ## [0.5.0] - 2023-10-16
91
+
92
+ ### Added
93
+ - Added Next.js support (beta)
94
+ - Added SSL validation support
95
+ - Added shields for package information
96
+
97
+ ### Changed
98
+ - Fixed Next.js dependency versions
99
+ - Improved helper UI
100
+
101
+ ## [0.4.0] - 2023-05-29
102
+
103
+ ### Added
104
+ - Added CI/CD support
105
+ - Added package for CI/CD
106
+ - Added documentation
107
+
108
+ ### Changed
109
+ - Updated publish configuration
110
+ - Improved installation command
111
+
112
+ ## [0.3.3] - 2023-11-14
113
+
114
+ ### Changed
115
+ - Fixed URL parameters handling in helper
116
+ - Improved helper UI
117
+
118
+ ## [0.3.2] - 2023-11-14
119
+
120
+ ### Changed
121
+ - Fixed Next.js dependency versions
122
+ - Improved helper UI
123
+
124
+ ## [0.3.1] - 2023-12-04
125
+
126
+ ### Changed
127
+ - Fixed URL parameters handling in helper
128
+ - Improved helper UI
129
+
130
+ ## [0.3.0] - 2023-11-08
131
+
132
+ ### Added
133
+ - Added Next.js support
134
+ - Added helper info panel
135
+ - Added support for React.js templates
136
+
137
+ ### Changed
138
+ - Improved helper UI
139
+ - Updated template loading mechanism
140
+
141
+ ## [0.2.0] - 2023-05-25
142
+
143
+ ### Added
144
+ - Added support for React.js templates
145
+ - Added helper info panel
146
+ - Added documentation
147
+
148
+ ### Changed
149
+ - Improved template loading mechanism
150
+ - Updated package structure
151
+
152
+ ## [0.1.1] - 2023-05-23
153
+
154
+ ### Changed
155
+ - Fixed template loading issues
156
+ - Improved helper UI
157
+
158
+ ## [0.1.0] - 2023-05-17
159
+
160
+ ### Added
161
+ - Initial release
162
+ - Basic template support
163
+ - Helper UI implementation
164
+
165
+ ## [0.0.3] - 2023-05-17
166
+
167
+ ### Added
168
+ - Added basic template support
169
+ - Added helper UI
170
+
171
+ ### Changed
172
+ - Improved package structure
173
+
174
+ ## [0.0.2] - 2023-05-17
175
+
176
+ ### Added
177
+ - Added basic package structure
178
+ - Added helper implementation
179
+
180
+ ## [0.0.1] - 2023-05-17
181
+
182
+ ### Added
183
+ - Initial package setup
184
+ - Basic helper functionality