@metricinsights/pp-dev 0.9.0 → 0.10.1

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +144 -0
  2. package/README.md +152 -232
  3. package/dist/cjs/cli.js +1 -1200
  4. package/dist/cjs/cli.js.map +1 -1
  5. package/dist/cjs/helpers.js +1 -28
  6. package/dist/cjs/helpers.js.map +1 -1
  7. package/dist/cjs/index-DRre2UkM.js +2 -0
  8. package/dist/cjs/index-DRre2UkM.js.map +1 -0
  9. package/dist/cjs/index.js +1 -26
  10. package/dist/cjs/index.js.map +1 -1
  11. package/dist/cjs/package.json +19 -14
  12. package/dist/cjs/plugin-Dx9CDaej.js +2 -0
  13. package/dist/cjs/plugin-Dx9CDaej.js.map +1 -0
  14. package/dist/cjs/plugin.js +1 -25
  15. package/dist/cjs/plugin.js.map +1 -1
  16. package/dist/client/client.css +3 -287
  17. package/dist/client/client.css.map +1 -0
  18. package/dist/client/client.js +110 -14
  19. package/dist/client/client.js.map +1 -1
  20. package/dist/client/index.html +39 -26
  21. package/dist/esm/cli.js +1 -1173
  22. package/dist/esm/cli.js.map +1 -1
  23. package/dist/esm/helpers.js +1 -24
  24. package/dist/esm/helpers.js.map +1 -1
  25. package/dist/esm/index-kmS_-y6Z.js +2 -0
  26. package/dist/esm/index-kmS_-y6Z.js.map +1 -0
  27. package/dist/esm/index.js +1 -19
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/package.json +19 -14
  30. package/dist/esm/plugin-H4ccpQoX.js +2 -0
  31. package/dist/esm/plugin-H4ccpQoX.js.map +1 -0
  32. package/dist/esm/plugin.js +1 -16
  33. package/dist/esm/plugin.js.map +1 -1
  34. package/dist/types/index.d.ts +104 -3
  35. package/package.json +19 -14
  36. package/dist/cjs/index-BE4YF5iw.js +0 -331
  37. package/dist/cjs/index-BE4YF5iw.js.map +0 -1
  38. package/dist/cjs/plugin-DZS4Taov.js +0 -1315
  39. package/dist/cjs/plugin-DZS4Taov.js.map +0 -1
  40. package/dist/client/index.d.ts +0 -2
  41. package/dist/esm/index-7YgmP5z7.js +0 -308
  42. package/dist/esm/index-7YgmP5z7.js.map +0 -1
  43. package/dist/esm/plugin-BeHiwpzF.js +0 -1277
  44. package/dist/esm/plugin-BeHiwpzF.js.map +0 -1
  45. package/dist/types/cli.d.ts +0 -3
  46. package/dist/types/helpers.d.ts +0 -24
  47. package/dist/types/plugin.d.ts +0 -86
package/CHANGELOG.md ADDED
@@ -0,0 +1,144 @@
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)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update build configuration and fix type issues ([cffcff4](https://github.com/mi-examples/pp-dev-js/commit/cffcff4e493d3268aa3973a9e58c55c28c839a52))
7
+
8
+ # Changelog
9
+
10
+ All notable changes to the `@metricinsights/pp-dev` package will be documented in this file.
11
+
12
+ ## [0.10.0] - 2024-03-21
13
+
14
+ ### Changed
15
+ - Removed unused `pino` and `pino-pretty` dependencies
16
+
17
+ ## [0.9.0] - 2025-01-31
18
+
19
+ ### Added
20
+ - Added support for MI v7.1.0 instances
21
+ - Added new API endpoints for v7 instances
22
+
23
+ ## [0.8.0] - 2024-11-15
24
+
25
+ ### Changed
26
+ - Updated package dependencies to latest versions
27
+ - Improved template loading mechanism
28
+
29
+ ## [0.7.0] - 2024-02-28
30
+
31
+ ### Added
32
+ - Added icon font generation tool
33
+ - Added changelog generator for assets
34
+ - Added image optimization tool
35
+
36
+ ### Changed
37
+ - Improved helper logging system
38
+
39
+ ## [0.6.0] - 2024-01-18
40
+
41
+ ### Added
42
+ - Added support for React.js, TypeScript, and Next.js templates
43
+ - Added new npm package structure
44
+ - Added documentation for templates
45
+
46
+ ### Changed
47
+ - Updated template code structure
48
+ - Improved helper info panel
49
+
50
+ ## [0.5.0] - 2023-10-16
51
+
52
+ ### Added
53
+ - Added Next.js support (beta)
54
+ - Added SSL validation support
55
+ - Added shields for package information
56
+
57
+ ### Changed
58
+ - Fixed Next.js dependency versions
59
+ - Improved helper UI
60
+
61
+ ## [0.4.0] - 2023-05-29
62
+
63
+ ### Added
64
+ - Added CI/CD support
65
+ - Added package for CI/CD
66
+ - Added documentation
67
+
68
+ ### Changed
69
+ - Updated publish configuration
70
+ - Improved installation command
71
+
72
+ ## [0.3.3] - 2023-11-14
73
+
74
+ ### Changed
75
+ - Fixed URL parameters handling in helper
76
+ - Improved helper UI
77
+
78
+ ## [0.3.2] - 2023-11-14
79
+
80
+ ### Changed
81
+ - Fixed Next.js dependency versions
82
+ - Improved helper UI
83
+
84
+ ## [0.3.1] - 2023-12-04
85
+
86
+ ### Changed
87
+ - Fixed URL parameters handling in helper
88
+ - Improved helper UI
89
+
90
+ ## [0.3.0] - 2023-11-08
91
+
92
+ ### Added
93
+ - Added Next.js support
94
+ - Added helper info panel
95
+ - Added support for React.js templates
96
+
97
+ ### Changed
98
+ - Improved helper UI
99
+ - Updated template loading mechanism
100
+
101
+ ## [0.2.0] - 2023-05-25
102
+
103
+ ### Added
104
+ - Added support for React.js templates
105
+ - Added helper info panel
106
+ - Added documentation
107
+
108
+ ### Changed
109
+ - Improved template loading mechanism
110
+ - Updated package structure
111
+
112
+ ## [0.1.1] - 2023-05-23
113
+
114
+ ### Changed
115
+ - Fixed template loading issues
116
+ - Improved helper UI
117
+
118
+ ## [0.1.0] - 2023-05-17
119
+
120
+ ### Added
121
+ - Initial release
122
+ - Basic template support
123
+ - Helper UI implementation
124
+
125
+ ## [0.0.3] - 2023-05-17
126
+
127
+ ### Added
128
+ - Added basic template support
129
+ - Added helper UI
130
+
131
+ ### Changed
132
+ - Improved package structure
133
+
134
+ ## [0.0.2] - 2023-05-17
135
+
136
+ ### Added
137
+ - Added basic package structure
138
+ - Added helper implementation
139
+
140
+ ## [0.0.1] - 2023-05-17
141
+
142
+ ### Added
143
+ - Initial package setup
144
+ - Basic helper functionality
package/README.md CHANGED
@@ -8,30 +8,35 @@
8
8
  The PP Dev Helper is a development framework and build tool for Metric Insights' Portal Pages, designed to make the
9
9
  lives of PP developers easier:
10
10
 
11
- - build your Portal Page
12
- - run/test locally with API requests proxied to a Metric Insights server
13
- - a lot more (to be documented soon!)
11
+ - Build and test Portal Pages locally
12
+ - Proxy API requests to a Metric Insights server
13
+ - Hot module replacement for faster development
14
+ - Image optimization and asset management
15
+ - Template variable transformation
16
+ - Code synchronization with Metric Insights instances
14
17
 
15
18
  pp-dev is based on [Vite](https://vitejs.dev/).
16
19
 
17
- ## Usage
20
+ ## Installation
18
21
 
19
- Package installation
20
-
21
- ```shell
22
- $ npm i @metricinsights/pp-dev
22
+ ```bash
23
+ npm install @metricinsights/pp-dev
23
24
  ```
24
25
 
25
- ### Define Configuration
26
+ ## Configuration
27
+
28
+ ### Configuration File
26
29
 
27
- You'll need to create a file with the name `pp-dev.config` and extension `js` or
28
- `cjs` (if you define type `module` in package.json), or `ts` if you want to use TypeScript, or `json`.
30
+ Create a configuration file named `pp-dev.config` with one of these extensions:
31
+ - `.js` or `.cjs` (for CommonJS)
32
+ - `.ts` (for TypeScript)
33
+ - `.json`
29
34
 
30
- Alternatively, you can define configuration in your `package.json` via the `pp-dev` key
35
+ Alternatively, you can define configuration in your `package.json` using the `pp-dev` key.
31
36
 
32
- Generic configuration examples:
37
+ ### Configuration Examples
33
38
 
34
- - JavaScript
39
+ #### JavaScript (CommonJS)
35
40
 
36
41
  ```javascript
37
42
  // pp-dev.config.js
@@ -45,7 +50,7 @@ module.exports = {
45
50
  };
46
51
  ```
47
52
 
48
- - TypeScript
53
+ #### TypeScript
49
54
 
50
55
  ```typescript
51
56
  // pp-dev.config.ts
@@ -54,273 +59,188 @@ import { PPDevConfig } from '@metricinsights/pp-dev';
54
59
 
55
60
  const config: PPDevConfig = {
56
61
  backendBaseURL: 'https://mi.company.com',
57
- portalPageId: 1,
62
+ appId: 1,
63
+ v7Features: true,
58
64
  };
59
65
 
60
66
  export default config;
61
67
  ```
62
68
 
63
- - JSON as `pp-dev.config.json`
69
+ #### JSON
64
70
 
65
71
  ```json
72
+ // pp-dev.config.json
66
73
  {
67
74
  "backendBaseURL": "https://mi.company.com",
68
- "portalPageId": 1
75
+ "appId": 1,
76
+ "v7Features": true
69
77
  }
70
78
  ```
71
79
 
72
- - JSON as `package.json`
80
+ #### package.json
73
81
 
74
82
  ```json
75
83
  {
76
- "name": "<project-name>",
84
+ "name": "my-portal-page",
77
85
  "version": "1.0.0",
78
- "scripts": {},
79
86
  "pp-dev": {
80
87
  "backendBaseURL": "https://mi.company.com",
81
- "portalPageId": 1
88
+ "appId": 1,
89
+ "v7Features": true
82
90
  }
83
91
  }
84
92
  ```
85
93
 
86
- ## [Next.js](https://nextjs.org/) Configuration
87
-
88
- To use the PP Dev Helper with Next.js:
89
-
90
- 1. Add pp-dev config to your root directory.
91
-
92
- 2. Change your `dev` script in `package.json` to `pp-dev next`.
93
-
94
- 3. Finally, wrap your next.config with a `withPPDev` function.
95
-
96
- ```javascript
97
- // next.config.js
98
-
99
- const { withPPDev } = require('@metricinsights/pp-dev');
100
-
101
- module.exports = withPPDev({
102
- // your next config
103
- });
104
- ```
105
-
106
- ### Vite configuration
107
-
108
- If you need to change something in the build you can define a `vite.config` file.
109
- More details [Vite Confighere](https://vitejs.dev/config/)
110
-
111
- ### Configuration API description
112
-
113
- #### `backendBaseURL`
114
-
115
- Type: String
116
-
117
- Example: `https://mi.company.com`
118
-
119
- Description: Defines the backend URL (Metric Insights instance) that is used for proxying requests to the MI backend
120
-
121
- #### `portalPageId`
122
-
123
- Type: Number
124
-
125
- Example: `1`
126
-
127
- Description: Defines the Portal Page ID that used to get Portal Page Variable values.
128
-
129
- #### `miHudLess`
130
-
131
- Type: Boolean
132
-
133
- Default: `false`
134
-
135
- Example: `true`
136
-
137
- Description: Disables Metric Insights navigation bar for local development
138
-
139
- #### `templateLess`
140
-
141
- Type: Boolean
142
-
143
- Default: `false`
144
-
145
- Example: `true`
146
-
147
- Description: Disables Template Variables transformation. Used when developing a Portal Page without a template
148
-
149
- #### `enableProxyCache`
150
-
151
- Type: Boolean
152
-
153
- Default: `true`
154
-
155
- Description: Enables proxy cache. If you want to disable proxy cache, you need to set this option to `false`
156
-
157
- #### `proxyCacheTTL`
158
-
159
- Type: Number
160
-
161
- Default: `10 * 60 * 1000`
162
-
163
- Description: Defines proxy cache TTL in milliseconds
164
-
165
- #### `disableSSLValidation`
94
+ ## Configuration Options
166
95
 
167
- Type: Boolean
96
+ ### Required Options
168
97
 
169
- Default: `false`
98
+ | Option | Type | Description |
99
+ |--------|------|-------------|
100
+ | `backendBaseURL` | string | URL of the Metric Insights instance for API proxying |
101
+ | `portalPageId` | number | ID of the Portal Page for variable values (deprecated, use `appId` instead) |
102
+ | `appId` | number | ID of the Portal Page for variable values (synonym for `portalPageId`) |
170
103
 
171
- Description: Disables SSL certificate validation for proxy requests. Useful for self-signed certificates
104
+ ### Optional Options
172
105
 
173
- #### `imageOptimizer`
106
+ | Option | Type | Default | Description |
107
+ |--------|------|---------|-------------|
108
+ | `miHudLess` | boolean | `false` | Disables Metric Insights navigation bar in development |
109
+ | `templateLess` | boolean | `false` | Disables template variable transformation |
110
+ | `enableProxyCache` | boolean | `true` | Enables caching of proxied requests |
111
+ | `proxyCacheTTL` | number | `600000` | Cache TTL in milliseconds (10 minutes) |
112
+ | `disableSSLValidation` | boolean | `false` | Disables SSL certificate validation for proxy requests |
113
+ | `imageOptimizer` | boolean \| object | `true` | Controls image optimization. See [vite-plugin-image-optimizer](https://www.npmjs.com/package/vite-plugin-image-optimizer#plugin-options) for object options |
114
+ | `outDir` | string | `dist` | Output directory for builds |
115
+ | `distZip` | boolean \| object | `true` | Controls build output zipping. Object options: `{ outDir?: string, outFileName?: string }` |
116
+ | `syncBackupsDir` | string | `backups` | Directory for asset backups from MI server |
117
+ | `v7Features` | boolean | `false` | Enables Metric Insights v7 features |
118
+ | `personalAccessToken` | string | `process.env.MI_ACCESS_TOKEN` | Personal Access Token for the MI instance |
174
119
 
175
- Type: Boolean | Object
120
+ ### v7Features Details
176
121
 
177
- Default: `true`
122
+ When enabled (`true`), this option:
123
+ 1. Changes development path from `/pt/<portal-page-name>` to `/pl/<portal-page-name>`
124
+ 2. Updates Code Sync feature to use v7.1.0+ URLs
178
125
 
179
- Description: Enables image optimization for build.
180
- If you want to disable image optimization, you need to set this option to `false`.
181
- If you want to customize image optimization, you need to set this option to an object with properties that are described
182
- in the [vite-plugin-image-optimizer](https://www.npmjs.com/package/vite-plugin-image-optimizer#plugin-options)
126
+ ### Personal Access Token
183
127
 
184
- #### `outDir`
128
+ 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.
185
129
 
186
- Type: String
187
-
188
- Default: `dist`
189
-
190
- Description: Define the output directory for the build
191
-
192
- #### `distZip`
193
-
194
- Type: Boolean | { outDir?: string, outFileName?: string }
195
-
196
- Default: `true`
197
-
198
- Description: Enables zipping the build output.
199
- If you want to disable zipping the build output, you need to set this option to `false`.
200
- If you want to customize zipping the build output,
201
- you need to set this option to an object with properties `outDir` and `outFileName`.
202
-
203
- - `outDir` defines the output directory for the zipped build.
204
- - `outFileName` defines the output file name for the zipped build.
205
- You can use placeholder `[templateName]` in the file name to replace it with the template name.
206
-
207
- #### `syncBackupsDir`
208
-
209
- Type: String
210
-
211
- Default: `backups`
212
-
213
- Description: Define the directory for the asset backups that are used for backup assets from the MI server
214
-
215
- #### `v7Features`
216
-
217
- Type: Boolean
218
-
219
- Default: `false`
220
-
221
- Description: Enables V7 features.
222
- If you want to enable V7 features, you need to set this option to `true`.
223
- This option is used for enabling new features that are available only on the Metric Insights v7 instances.
224
- When setting this option to `true`, the CLI will use apply changes:
225
- 1. Default development path will be changed from `/pt/<portal-page-name>` to `/pl/<portal-page-name>`. This will avoid conflicts with the Metric Insights v7 features when developing a Portal Page with the Metric Insights toolbar.
226
- 2. The Code Sync feature will use the new URLs of the Metric Insights v7 instances (available only on the Metric Insights v7.1.0 instances or higher).
227
-
228
- ### CLI API description
229
-
230
- `pp-dev help` - show CLI's help
231
-
232
- Global options:
233
-
234
- - `-c, --config <configFile>` - define the path to the configuration file. Default is `pp-dev.config.js`
235
- - `--base <path>` - public base path (default: `/`)
236
- - `-l, --logLevel <level>` - define the log level. Default is `info`. Available options: `trace`, `debug`, `info`, `warn`, `error`, `silent`
237
- - `--clearScreen` - clear the screen before logging
238
- - `--mode <mode>` - define the environment mode. Default is `development`. Available options: `development`, `production`, `test`
239
-
240
- #### `pp-dev`
241
-
242
- Aliases: `pp-dev dev`, `pp-dev serve`
243
-
244
- Runs application in development mode with hot-reload. Also, its proxies requests to the MI server.
245
-
246
- Available options and arguments:
247
-
248
- - `[root]` - define the root directory for the application. Default is `.`
249
- - `--host <host>` - define the host for the application. Default is `localhost`
250
- - `--port <port>` - define the port for the application. Default is `3000`
251
- - `--open [path]` - open the application in the default browser. You can define the path to open the browser with the specific page
252
- - `--strictPort` - enable strict port checking. If the port is already in use, the application will exit with an error
253
-
254
- #### `pp-dev next`
255
-
256
- Aliases: `pp-dev next-server`, `pp-dev next-dev`
257
-
258
- Runs the Next.js application in development mode with hot-reload. Also, its proxies requests to the MI server.
130
+ Example:
131
+ ```javascript
132
+ // pp-dev.config.js
133
+ module.exports = {
134
+ backendBaseURL: 'https://mi.company.com',
135
+ appId: 1,
136
+ personalAccessToken: process.env.MI_ACCESS_TOKEN,
137
+ };
138
+ ```
259
139
 
260
- Available options and arguments:
140
+ ## CLI Commands
261
141
 
262
- - `[root]` - define the root directory for the application. Default is `.`
263
- - `--port <port>` - define the port for the application. Default is `3000`
264
- - `--host <host>` - define the host for the application. Default is `localhost`
142
+ ### Global Options
265
143
 
266
- #### `pp-dev build`
144
+ | Option | Description |
145
+ |--------|-------------|
146
+ | `-c, --config <file>` | Path to configuration file (default: `pp-dev.config.js`) |
147
+ | `--base <path>` | Public base path (default: `/`) |
148
+ | `-l, --logLevel <level>` | Log level: `trace`, `debug`, `info`, `warn`, `error`, `silent` (default: `info`) |
149
+ | `--clearScreen` | Clear screen before logging |
150
+ | `--mode <mode>` | Environment mode: `development`, `production`, `test` (default: `development`) |
267
151
 
268
- Runs the application build. Will create `dist` and `dist-zip` folders. `dist` folder contains unzipped build files. `dist-zip` contains file `<package-name>.zip` with files from the `dist` folder
152
+ ### Development Server
269
153
 
270
- Available options and arguments:
154
+ ```bash
155
+ pp-dev [root] [options]
156
+ # Aliases: pp-dev dev, pp-dev serve
157
+ ```
271
158
 
272
- - `[root]` - define the root directory for the application. Default is `.`
273
- - `--target <target>` - transpile target. Default is `modules`.
274
- - `--outDir <outDir>` - define the output directory for the build. Default is `dist`
275
- - `--assetsDir <dir>` - directory under outDir to place assets in Default is `assets`
276
- - `--changelog [assetsFile]` - create a changelog file. You can define the path to the assets file or set `true` to use the default path. Default is `true`. Default path is `backups/<latest>.zip` where `<latest>` is the latest backup file
159
+ | Option | Default | Description |
160
+ |--------|---------|-------------|
161
+ | `[root]` | `.` | Root directory of the application |
162
+ | `--host <host>` | `localhost` | Server hostname |
163
+ | `--port <port>` | `3000` | Server port |
164
+ | `--open [path]` | - | Open browser on server start |
165
+ | `--strictPort` | - | Exit if port is already in use |
277
166
 
278
- #### `pp-dev changelog [oldAssetPath] [newAssetPath]`
167
+ ### Next.js Development
279
168
 
280
- Create a changelog file. You can define the path to the previous and current assets files. If you don't define the path to the previous assets and current assets file, the CLI will try to get it from options. If you don't define the path to the current assets file, the CLI will throw an error.
169
+ ```bash
170
+ pp-dev next [options]
171
+ # Aliases: pp-dev next-server, pp-dev next-dev
172
+ ```
281
173
 
282
- Available options and arguments:
174
+ | Option | Default | Description |
175
+ |--------|---------|-------------|
176
+ | `[root]` | `.` | Root directory of the application |
177
+ | `--port <port>` | `3000` | Server port |
178
+ | `--host <host>` | `localhost` | Server hostname |
283
179
 
284
- - `[oldAssetPath]` - define the path to the current assets file. Can accept path to the folder or path to the zip file
285
- - `[newAssetPath]` - define the path to the previous assets file. Can accept path to the folder or path to the zip file
286
- - `--oldAssetsPath <oldAssetsPath>` - define the path to the previous assets file. Can accept path to the folder or path to the zip file
287
- - `--newAssetsPath <newAssetsPath>` - define the path to the current assets file. Can accept path to the folder or path to the zip file
288
- - `--destination <destination>` - define the destination path for the changelog file. Default is `.`
289
- - `--filename <filename>` - define the filename for the changelog file. Default is `CHANGELOG.html`
180
+ ### Build
290
181
 
291
- #### `pp-dev generate-icon-font [source] [destination]`
182
+ ```bash
183
+ pp-dev build [options]
184
+ ```
292
185
 
293
- Generate an icon font from the source folder. You can define the path to the source folder and the destination folder. If you don't define the path to the source folder, the CLI will try to get it from options. If you don't define the path to the destination folder, the CLI will throw an error.
186
+ | Option | Default | Description |
187
+ |--------|---------|-------------|
188
+ | `[root]` | `.` | Root directory of the application |
189
+ | `--target <target>` | `modules` | Transpile target |
190
+ | `--outDir <dir>` | `dist` | Output directory |
191
+ | `--assetsDir <dir>` | `assets` | Assets directory under outDir |
192
+ | `--changelog [file]` | `true` | Create changelog file |
294
193
 
295
- Available options and arguments:
194
+ ### Changelog Generation
296
195
 
297
- - `[source]` - define the path to the source folder with SVG icons
298
- - `[destination]` - define the path to the destination folder for the generated icon font and styles
299
- - `--source <source>` - define the path to the source folder with SVG icons
300
- - `--destination <destination>` - define the path to the destination folder for the generated icon font and styles
301
- - `--fontName <fontName>` - define the font name. Default is `icon-font`
196
+ ```bash
197
+ pp-dev changelog [oldAssetPath] [newAssetPath] [options]
198
+ ```
302
199
 
303
- ## Migration guide from old Portal Page Helper to new
200
+ | Option | Default | Description |
201
+ |--------|---------|-------------|
202
+ | `[oldAssetPath]` | - | Path to previous assets |
203
+ | `[newAssetPath]` | - | Path to current assets |
204
+ | `--oldAssetsPath <path>` | - | Path to previous assets |
205
+ | `--newAssetsPath <path>` | - | Path to current assets |
206
+ | `--destination <path>` | `.` | Changelog output directory |
207
+ | `--filename <name>` | `CHANGELOG.html` | Changelog filename |
304
208
 
305
- 1. Initialize npm in your portal page repository (if you have `package.json` file in PP folder, you can skip this step):
209
+ ### Icon Font Generation
306
210
 
307
- Go to portal page folder and run command. This command will create `package.json` file in your folder
211
+ ```bash
212
+ pp-dev generate-icon-font [source] [destination] [options]
213
+ ```
308
214
 
309
- ```shell
310
- $ npm init
215
+ | Option | Default | Description |
216
+ |--------|---------|-------------|
217
+ | `[source]` | - | Source directory with SVG icons |
218
+ | `[destination]` | - | Output directory |
219
+ | `--source <path>` | - | Source directory with SVG icons |
220
+ | `--destination <path>` | - | Output directory |
221
+ | `--fontName <name>` | `icon-font` | Font name |
222
+
223
+ ## Next.js Integration
224
+
225
+ 1. Add pp-dev configuration to your project root
226
+ 2. Update `package.json` scripts:
227
+ ```json
228
+ {
229
+ "scripts": {
230
+ "dev": "pp-dev next"
231
+ }
232
+ }
311
233
  ```
234
+ 3. Wrap your Next.js config:
235
+ ```javascript
236
+ // next.config.js
237
+ const { withPPDev } = require('@metricinsights/pp-dev');
312
238
 
313
- 2. Install this package by this command:
314
- ```shell
315
- $ npm i @metricinsights/pp-dev
316
- ```
317
- 3. Create two scripts in `package.json` script section.
239
+ module.exports = withPPDev({
240
+ // your Next.js config
241
+ });
242
+ ```
318
243
 
319
- - `start` script: `"start": "pp-dev"`
320
- - `build` script: `"build": "pp-dev build"`
244
+ ## Vite Configuration
321
245
 
322
- 4. Change all paths to the file in index.html to the absolute path.
323
- If you have a path like `/pt/main.js` this must be changed to `/main.js`.
324
- Also, you may need to add `type="module"` to every script that is added by the `script` tag with the `src` property.
325
- Actually would be good to have only one `script` tag with the `src` tag.
326
- Every other JS file will be imported with construction like this `import helper from './helpers';`
246
+ For custom build configuration, create a `vite.config` file. See [Vite Configuration](https://vitejs.dev/config/) for details.