@metricinsights/pp-dev 1.5.0-beta.3 → 1.5.0-beta.30
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 +198 -145
- package/dist/cjs/auth.provider-BT1sgf1x.js +2 -0
- package/dist/cjs/auth.provider-BT1sgf1x.js.map +1 -0
- package/dist/cjs/cli.js +1 -1
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/index-D9zJqX2X.js +2 -0
- package/dist/cjs/index-D9zJqX2X.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/migrate-CuzJuHC1.js +2 -0
- package/dist/cjs/migrate-CuzJuHC1.js.map +1 -0
- package/dist/cjs/package.json +2 -135
- package/dist/cjs/plugin.js +1 -1
- package/dist/cjs/plugin.js.map +1 -1
- package/dist/cjs/request-capture.middleware-Bihrs8O-.js +2 -0
- package/dist/cjs/request-capture.middleware-Bihrs8O-.js.map +1 -0
- package/dist/cjs/version-manifest-5tqQXsyA.js +2 -0
- package/dist/cjs/version-manifest-5tqQXsyA.js.map +1 -0
- package/dist/cjs/version-plugin-JOQRBtAn.js +2 -0
- package/dist/cjs/version-plugin-JOQRBtAn.js.map +1 -0
- package/dist/client/client.js +269 -125
- package/dist/client/client.js.map +1 -1
- package/dist/client/request-inspector.css +3 -0
- package/dist/client/request-inspector.css.map +1 -0
- package/dist/client/request-inspector.html +87 -0
- package/dist/client/request-inspector.js +527 -0
- package/dist/client/request-inspector.js.map +1 -0
- package/dist/client/variables-editor.css +3 -0
- package/dist/client/variables-editor.css.map +1 -0
- package/dist/client/variables-editor.html +44 -0
- package/dist/client/variables-editor.js +3474 -0
- package/dist/client/variables-editor.js.map +1 -0
- package/dist/esm/auth.provider-CMlTFLKr.js +2 -0
- package/dist/esm/auth.provider-CMlTFLKr.js.map +1 -0
- package/dist/esm/cli.js +1 -1
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/index-B4F5_U6S.js +2 -0
- package/dist/esm/index-B4F5_U6S.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/migrate-r4PvE5UL.js +2 -0
- package/dist/esm/{migrate-B2gJ62fm.js.map → migrate-r4PvE5UL.js.map} +1 -1
- package/dist/esm/package.json +2 -135
- package/dist/esm/plugin.js +1 -1
- package/dist/esm/plugin.js.map +1 -1
- package/dist/esm/request-capture.middleware-CYtDXIxP.js +2 -0
- package/dist/esm/request-capture.middleware-CYtDXIxP.js.map +1 -0
- package/dist/esm/version-manifest-BG-RUMD6.js +2 -0
- package/dist/esm/version-manifest-BG-RUMD6.js.map +1 -0
- package/dist/esm/version-plugin-BtTT_xRU.js +2 -0
- package/dist/esm/version-plugin-BtTT_xRU.js.map +1 -0
- package/dist/types/helpers.d.ts +29 -0
- package/dist/types/index.d.ts +15 -155
- package/dist/types/plugin.d.ts +8 -0
- package/dist/types/pp-dev-config-D889A-PO.d.ts +189 -0
- package/docs/features.md +2 -1
- package/package.json +26 -35
- package/dist/CHANGELOG.md +0 -442
- package/dist/README.md +0 -724
- package/dist/cjs/index-CCUrjlJE.js +0 -2
- package/dist/cjs/index-CCUrjlJE.js.map +0 -1
- package/dist/cjs/migrate-BYno__sx.js +0 -2
- package/dist/cjs/migrate-BYno__sx.js.map +0 -1
- package/dist/cjs/plugin-D_RXI7ru.js +0 -2
- package/dist/cjs/plugin-D_RXI7ru.js.map +0 -1
- package/dist/cjs/version-plugin-Bf4jLh17.js +0 -2
- package/dist/cjs/version-plugin-Bf4jLh17.js.map +0 -1
- package/dist/esm/index-BazQY12s.js +0 -2
- package/dist/esm/index-BazQY12s.js.map +0 -1
- package/dist/esm/migrate-B2gJ62fm.js +0 -2
- package/dist/esm/plugin-NIWxLreC.js +0 -2
- package/dist/esm/plugin-NIWxLreC.js.map +0 -1
- package/dist/esm/version-plugin-DwuZCHob.js +0 -2
- package/dist/esm/version-plugin-DwuZCHob.js.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,150 +1,11 @@
|
|
|
1
1
|
import { InlineConfig } from 'vite';
|
|
2
|
-
import {
|
|
2
|
+
import { P as PPDevConfig } from './pp-dev-config-D889A-PO.js';
|
|
3
|
+
import { NormalizedVitePPDevOptions } from './plugin.js';
|
|
4
|
+
export { A as AppConfig, a as AppType, B as BuildConfig, D as DevPanelConfig, b as DevPanelPosition, M as MiConfig, c as MiInclude, d as MiMode, e as ProxyConfig, S as SyncConfig, V as VersionPluginOptions, n as normalizePPDevConfig, v as validatePPDevConfig } from './pp-dev-config-D889A-PO.js';
|
|
3
5
|
import next, { NextConfig } from 'next';
|
|
6
|
+
export { defineConfig } from './helpers.js';
|
|
4
7
|
import * as nextConstants from 'next/constants';
|
|
5
|
-
|
|
6
|
-
type MiMode = 'standalone' | 'embedding';
|
|
7
|
-
type MiInclude = 'shared-components' | 'top-bar';
|
|
8
|
-
type AppType = 'page' | 'template';
|
|
9
|
-
interface MiConfig {
|
|
10
|
-
/** MI instance base URL. Falls back to process.env.MI_BACKEND_URL. */
|
|
11
|
-
url?: string;
|
|
12
|
-
/** Personal Access Token. Falls back to process.env.MI_ACCESS_TOKEN. */
|
|
13
|
-
token?: string;
|
|
14
|
-
/** How the page integrates into MI. @default 'standalone' */
|
|
15
|
-
mode?: MiMode;
|
|
16
|
-
/** Optional MI shared resources. Only valid when mode === 'standalone'. */
|
|
17
|
-
include?: MiInclude;
|
|
18
|
-
/** MI API/routing version. @default 7 */
|
|
19
|
-
apiVersion?: 6 | 7;
|
|
20
|
-
}
|
|
21
|
-
interface AppConfig {
|
|
22
|
-
/** Portal page / app ID on MI. Required for type=template and type=page+standalone. */
|
|
23
|
-
id?: number;
|
|
24
|
-
/** Internal asset name. @default package.json#name */
|
|
25
|
-
name?: string;
|
|
26
|
-
/** App type affecting routing and data loading. @default 'template' */
|
|
27
|
-
type?: AppType;
|
|
28
|
-
}
|
|
29
|
-
interface ProxyConfig {
|
|
30
|
-
/** Enable request caching to the backend. @default true */
|
|
31
|
-
cache?: boolean;
|
|
32
|
-
/** Cache TTL in milliseconds. @default 600000 */
|
|
33
|
-
cacheTtl?: number;
|
|
34
|
-
tls?: {
|
|
35
|
-
/** Allow self-signed TLS certificates. @default false */
|
|
36
|
-
allowSelfSigned?: boolean;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
interface DistZipBuildConfig {
|
|
40
|
-
/** Output ZIP file name. @default '<app.name>.zip' */
|
|
41
|
-
fileName?: string;
|
|
42
|
-
/** Output directory for the ZIP archive. @default 'dist-zip' */
|
|
43
|
-
outDir?: string;
|
|
44
|
-
/** Input directory to zip. @default value of build.outDir */
|
|
45
|
-
inDir?: string;
|
|
46
|
-
}
|
|
47
|
-
interface VersionFileBuildConfig {
|
|
48
|
-
/** @default true */
|
|
49
|
-
enabled?: boolean;
|
|
50
|
-
/** @default 'VERSION-v{packageversion}-{currentDate}.json' */
|
|
51
|
-
fileNameTemplate?: string;
|
|
52
|
-
}
|
|
53
|
-
interface BuildConfig {
|
|
54
|
-
/** Build output directory. @default 'dist' */
|
|
55
|
-
outDir?: string;
|
|
56
|
-
/** Pack build output into a ZIP archive. @default true */
|
|
57
|
-
zip?: boolean | DistZipBuildConfig;
|
|
58
|
-
/** Create a VERSION JSON file with SHA256 hashes. @default true */
|
|
59
|
-
versionFile?: boolean | VersionFileBuildConfig;
|
|
60
|
-
/** Image optimisation options. @default true */
|
|
61
|
-
imageOptimisations?: boolean | Record<string, unknown>;
|
|
62
|
-
}
|
|
63
|
-
interface SyncConfig {
|
|
64
|
-
/** Directory for sync backups. @default 'backups' */
|
|
65
|
-
backupsDir?: string;
|
|
66
|
-
}
|
|
67
|
-
interface InspectorConfig {
|
|
68
|
-
/** Enable the request inspector web UI at /@pp-dev/inspector. @default true */
|
|
69
|
-
enabled?: boolean;
|
|
70
|
-
/** Maximum RAM for stored request/response payloads in bytes. @default 1073741824 (1 GB) */
|
|
71
|
-
maxMemory?: number;
|
|
72
|
-
/** Maximum bytes captured per individual request/response body. @default 10485760 (10 MB) */
|
|
73
|
-
captureLimit?: number;
|
|
74
|
-
}
|
|
75
|
-
type DevPanelPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
76
|
-
interface DevPanelConfig {
|
|
77
|
-
/** Screen corner the dev panel is anchored to. @default 'bottom-right' */
|
|
78
|
-
position?: DevPanelPosition;
|
|
79
|
-
/** Fully hide the panel. Restore in the browser with ?pp-dev-panel=show. @default false */
|
|
80
|
-
hidden?: boolean;
|
|
81
|
-
/** Auto-hide: the panel slides behind the screen edge leaving a thin strip; hover reveals it. @default false */
|
|
82
|
-
autoHide?: boolean;
|
|
83
|
-
}
|
|
84
|
-
interface UsersConfig {
|
|
85
|
-
/**
|
|
86
|
-
* Keep the users added with an API token between dev server runs, in a file in your home
|
|
87
|
-
* directory (`~/.pp-dev/users/`) that only you can read. Passwords and MI sessions are never kept.
|
|
88
|
-
* @default false
|
|
89
|
-
*/
|
|
90
|
-
persist?: boolean;
|
|
91
|
-
}
|
|
92
|
-
interface PPDevConfig {
|
|
93
|
-
mi?: MiConfig;
|
|
94
|
-
app?: AppConfig;
|
|
95
|
-
proxy?: ProxyConfig;
|
|
96
|
-
build?: BuildConfig;
|
|
97
|
-
sync?: SyncConfig;
|
|
98
|
-
inspector?: InspectorConfig;
|
|
99
|
-
devPanel?: DevPanelConfig;
|
|
100
|
-
/** Working as other MI users (the dev panel's Users section). */
|
|
101
|
-
users?: UsersConfig;
|
|
102
|
-
}
|
|
103
|
-
interface VersionPluginOptions {
|
|
104
|
-
/**
|
|
105
|
-
* Version file filename template.
|
|
106
|
-
* Placeholders: {packageversion}, {currentDate}
|
|
107
|
-
* @default "VERSION-v{packageversion}-{currentDate}.json"
|
|
108
|
-
*/
|
|
109
|
-
versionFileTemplate?: string;
|
|
110
|
-
/** @default true */
|
|
111
|
-
enabled?: boolean;
|
|
112
|
-
}
|
|
113
|
-
/** @internal — used by the Vite plugin and CLI; not part of the public API. */
|
|
114
|
-
interface NormalizedVitePPDevOptions {
|
|
115
|
-
templateName: string;
|
|
116
|
-
backendBaseURL?: string;
|
|
117
|
-
appId?: number;
|
|
118
|
-
templateLess: boolean;
|
|
119
|
-
miHudLess: boolean;
|
|
120
|
-
integrateMiTopBar: boolean | {
|
|
121
|
-
addRootElement?: boolean;
|
|
122
|
-
addSharedComponentsScripts?: boolean;
|
|
123
|
-
};
|
|
124
|
-
enableProxyCache: boolean;
|
|
125
|
-
proxyCacheTTL: number;
|
|
126
|
-
disableSSLValidation: boolean;
|
|
127
|
-
imageOptimizer: boolean | Parameters<typeof ViteImageOptimizer>[0];
|
|
128
|
-
outDir: string;
|
|
129
|
-
distZip: false | {
|
|
130
|
-
outFileName: string;
|
|
131
|
-
outDir: string;
|
|
132
|
-
inDir?: string;
|
|
133
|
-
};
|
|
134
|
-
versionPlugin: false | VersionPluginOptions;
|
|
135
|
-
syncBackupsDir: string;
|
|
136
|
-
v7Features: boolean;
|
|
137
|
-
personalAccessToken?: string;
|
|
138
|
-
inspectorEnabled: boolean;
|
|
139
|
-
inspectorMaxMemory: number;
|
|
140
|
-
inspectorCaptureLimit: number;
|
|
141
|
-
devPanelPosition: DevPanelPosition;
|
|
142
|
-
devPanelHidden: boolean;
|
|
143
|
-
devPanelAutoHide: boolean;
|
|
144
|
-
persistUsers: boolean;
|
|
145
|
-
}
|
|
146
|
-
declare function validatePPDevConfig(config: PPDevConfig, templateName: string): void;
|
|
147
|
-
declare function normalizePPDevConfig(config: PPDevConfig, templateName: string): NormalizedVitePPDevOptions;
|
|
8
|
+
import 'vite-plugin-image-optimizer';
|
|
148
9
|
|
|
149
10
|
interface ResolvedBuildCliOverrides {
|
|
150
11
|
distZipEnabled?: boolean;
|
|
@@ -154,8 +15,6 @@ interface ResolvedBuildCliOverrides {
|
|
|
154
15
|
versionFileTemplate?: string;
|
|
155
16
|
}
|
|
156
17
|
|
|
157
|
-
declare function defineConfig(config: PPDevConfig): PPDevConfig;
|
|
158
|
-
|
|
159
18
|
/**
|
|
160
19
|
* Safe Next.js import utility
|
|
161
20
|
* Handles peer dependency availability and provides helpful error messages
|
|
@@ -170,7 +29,8 @@ interface NextJSImports {
|
|
|
170
29
|
*/
|
|
171
30
|
declare function safeNextImport(): Promise<NextJSImports>;
|
|
172
31
|
/**
|
|
173
|
-
* Checks if Next.js is available without importing it
|
|
32
|
+
* Checks if Next.js is available without importing it: resolving its entry is enough, and loading
|
|
33
|
+
* Next.js itself takes seconds.
|
|
174
34
|
*/
|
|
175
35
|
declare function isNextAvailable(): Promise<boolean>;
|
|
176
36
|
/**
|
|
@@ -178,12 +38,6 @@ declare function isNextAvailable(): Promise<boolean>;
|
|
|
178
38
|
*/
|
|
179
39
|
declare function getNextVersion(): Promise<string | null>;
|
|
180
40
|
|
|
181
|
-
/**
|
|
182
|
-
* Global Authentication Provider
|
|
183
|
-
*
|
|
184
|
-
* This provider manages the global authentication state across the application.
|
|
185
|
-
* It provides a centralized way to track and manage authentication status.
|
|
186
|
-
*/
|
|
187
41
|
interface AuthState {
|
|
188
42
|
isAuthenticated: boolean;
|
|
189
43
|
isRedirected: boolean;
|
|
@@ -240,6 +94,12 @@ declare module 'next' {
|
|
|
240
94
|
interface NextConfig {
|
|
241
95
|
/** PP-Dev config. Prefer pp-dev.config.js to avoid Next.js validation warnings. */
|
|
242
96
|
ppDev?: PPDevConfig;
|
|
97
|
+
/**
|
|
98
|
+
* Set by `withPPDev()` on the config it returns (non-enumerable, as `ppDev`): `pp-dev next`
|
|
99
|
+
* reads it to tell a wrapped config from a plain one that carries `ppDev` itself, since only a
|
|
100
|
+
* wrapped one takes the build-directory override of a template sync.
|
|
101
|
+
*/
|
|
102
|
+
ppDevWrapped?: true;
|
|
243
103
|
}
|
|
244
104
|
}
|
|
245
105
|
interface ViteConfigEnvironment {
|
|
@@ -287,5 +147,5 @@ declare function withPPDev(nextjsConfig: NextConfig | ((phase: string, nextConfi
|
|
|
287
147
|
defaultConfig?: any;
|
|
288
148
|
}) => Promise<NextConfig>;
|
|
289
149
|
|
|
290
|
-
export { AuthProvider,
|
|
291
|
-
export type {
|
|
150
|
+
export { AuthProvider, PPDevConfig, authProvider, getNextVersion, getPPDevConfigFromNextConfig, getViteConfig, isNextAvailable, safeNextImport, withPPDev };
|
|
151
|
+
export type { AuthState, ResolvedBuildCliOverrides, ViteConfigEnvironment };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { N as NormalizedVitePPDevOptions } from './pp-dev-config-D889A-PO.js';
|
|
3
|
+
export { A as AppConfig, a as AppType, B as BuildConfig, D as DevPanelConfig, b as DevPanelPosition, I as InspectorConfig, M as MiConfig, c as MiInclude, d as MiMode, P as PPDevConfig, e as ProxyConfig, f as ServerConfig, S as SyncConfig, U as UsersConfig, V as VersionPluginOptions, n as normalizePPDevConfig, v as validatePPDevConfig } from './pp-dev-config-D889A-PO.js';
|
|
4
|
+
import 'vite-plugin-image-optimizer';
|
|
5
|
+
|
|
6
|
+
declare function vitePPDev(options: NormalizedVitePPDevOptions): Plugin;
|
|
7
|
+
|
|
8
|
+
export { NormalizedVitePPDevOptions, vitePPDev as default, vitePPDev };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* pp-dev's config: its public types, validation and normalization.
|
|
5
|
+
*
|
|
6
|
+
* Kept free of the dev server's dependencies (express, axios, the proxy, jsdom, …): `withPPDev()`
|
|
7
|
+
* runs while Next.js evaluates next.config, and the CLI reads the config before it knows whether
|
|
8
|
+
* it will serve, so loading the config must not load the server.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
type MiMode = 'standalone' | 'embedding';
|
|
12
|
+
type MiInclude = 'shared-components' | 'top-bar';
|
|
13
|
+
type AppType = 'page' | 'template';
|
|
14
|
+
interface MiConfig {
|
|
15
|
+
/** MI instance base URL. Falls back to process.env.MI_BACKEND_URL. */
|
|
16
|
+
url?: string;
|
|
17
|
+
/** Personal Access Token. Falls back to process.env.MI_ACCESS_TOKEN. */
|
|
18
|
+
token?: string;
|
|
19
|
+
/** How the page integrates into MI. @default 'standalone' */
|
|
20
|
+
mode?: MiMode;
|
|
21
|
+
/** Optional MI shared resources. Only valid when mode === 'standalone'. */
|
|
22
|
+
include?: MiInclude;
|
|
23
|
+
/** MI API/routing version. @default 7 */
|
|
24
|
+
apiVersion?: 6 | 7;
|
|
25
|
+
}
|
|
26
|
+
interface AppConfig {
|
|
27
|
+
/** Portal page / app ID on MI. Required for type=template and type=page+standalone. */
|
|
28
|
+
id?: number;
|
|
29
|
+
/** Internal asset name. @default package.json#name */
|
|
30
|
+
name?: string;
|
|
31
|
+
/** App type affecting routing and data loading. @default 'template' */
|
|
32
|
+
type?: AppType;
|
|
33
|
+
}
|
|
34
|
+
interface ProxyConfig {
|
|
35
|
+
/** Enable request caching to the backend. @default true */
|
|
36
|
+
cache?: boolean;
|
|
37
|
+
/** Cache TTL in milliseconds. @default 600000 */
|
|
38
|
+
cacheTtl?: number;
|
|
39
|
+
tls?: {
|
|
40
|
+
/** Allow self-signed TLS certificates. @default false */
|
|
41
|
+
allowSelfSigned?: boolean;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
interface DistZipBuildConfig {
|
|
45
|
+
/** Output ZIP file name. @default '<app.name>.zip' */
|
|
46
|
+
fileName?: string;
|
|
47
|
+
/** Output directory for the ZIP archive. @default 'dist-zip' */
|
|
48
|
+
outDir?: string;
|
|
49
|
+
/** Input directory to zip. @default value of build.outDir */
|
|
50
|
+
inDir?: string;
|
|
51
|
+
}
|
|
52
|
+
interface VersionFileBuildConfig {
|
|
53
|
+
/** @default true */
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
/** @default 'VERSION-v{packageversion}-{currentDate}.json' */
|
|
56
|
+
fileNameTemplate?: string;
|
|
57
|
+
}
|
|
58
|
+
interface BuildConfig {
|
|
59
|
+
/** Build output directory. @default 'dist' */
|
|
60
|
+
outDir?: string;
|
|
61
|
+
/** Pack build output into a ZIP archive. @default true */
|
|
62
|
+
zip?: boolean | DistZipBuildConfig;
|
|
63
|
+
/** Create a VERSION JSON file with SHA256 hashes. @default true */
|
|
64
|
+
versionFile?: boolean | VersionFileBuildConfig;
|
|
65
|
+
/** Image optimisation options. @default true */
|
|
66
|
+
imageOptimisations?: boolean | Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
interface SyncConfig {
|
|
69
|
+
/** Directory for sync backups. @default 'backups' */
|
|
70
|
+
backupsDir?: string;
|
|
71
|
+
/**
|
|
72
|
+
* How many backups of this page to keep; each new backup deletes the oldest beyond that.
|
|
73
|
+
* `false` or `0` keeps them all. @default 20
|
|
74
|
+
*/
|
|
75
|
+
maxBackups?: number | false;
|
|
76
|
+
/**
|
|
77
|
+
* How long the build a sync starts (`pp-dev build`, `next build`) may run, in milliseconds,
|
|
78
|
+
* before it is stopped and the sync fails. @default 600000 (10 minutes)
|
|
79
|
+
*/
|
|
80
|
+
buildTimeoutMs?: number;
|
|
81
|
+
}
|
|
82
|
+
interface InspectorConfig {
|
|
83
|
+
/** Enable the request inspector web UI at /@pp-dev/inspector. @default true */
|
|
84
|
+
enabled?: boolean;
|
|
85
|
+
/** Maximum RAM for stored request/response payloads in bytes. @default 1073741824 (1 GB) */
|
|
86
|
+
maxMemory?: number;
|
|
87
|
+
/** Maximum bytes captured per individual request/response body. @default 10485760 (10 MB) */
|
|
88
|
+
captureLimit?: number;
|
|
89
|
+
}
|
|
90
|
+
type DevPanelPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
91
|
+
interface DevPanelConfig {
|
|
92
|
+
/** Screen corner the dev panel is anchored to. @default 'bottom-right' */
|
|
93
|
+
position?: DevPanelPosition;
|
|
94
|
+
/** Fully hide the panel. Restore in the browser with ?pp-dev-panel=show. @default false */
|
|
95
|
+
hidden?: boolean;
|
|
96
|
+
/** Auto-hide: the panel slides behind the screen edge leaving a thin strip; hover reveals it. @default false */
|
|
97
|
+
autoHide?: boolean;
|
|
98
|
+
}
|
|
99
|
+
interface UsersConfig {
|
|
100
|
+
/**
|
|
101
|
+
* Keep the users added with an API token between dev server runs, in a file in your home
|
|
102
|
+
* directory (`~/.pp-dev/users/`) that only you can read. Passwords and MI sessions are never kept.
|
|
103
|
+
* @default false
|
|
104
|
+
*/
|
|
105
|
+
persist?: boolean;
|
|
106
|
+
}
|
|
107
|
+
interface ServerConfig {
|
|
108
|
+
/**
|
|
109
|
+
* Host names the dev server answers besides `localhost`, `*.localhost` and IP addresses, as
|
|
110
|
+
* Vite's `server.allowedHosts`: `'my-app.ngrok.app'`, or `'.ngrok.app'` for that domain and its
|
|
111
|
+
* subdomains. Any other `Host` is refused (DNS rebinding). The value of `--host` is allowed too.
|
|
112
|
+
* Pages on the names listed without a leading dot may also use the dev server's API, its
|
|
113
|
+
* WebSocket and, under `pp-dev next`, Next's HMR (`withPPDev()` adds them to Next's
|
|
114
|
+
* `allowedDevOrigins` in development): a page through a tunnel. `true` answers any host; avoid it.
|
|
115
|
+
* @default []
|
|
116
|
+
*/
|
|
117
|
+
allowedHosts?: string[] | true;
|
|
118
|
+
}
|
|
119
|
+
interface PPDevConfig {
|
|
120
|
+
mi?: MiConfig;
|
|
121
|
+
app?: AppConfig;
|
|
122
|
+
proxy?: ProxyConfig;
|
|
123
|
+
build?: BuildConfig;
|
|
124
|
+
sync?: SyncConfig;
|
|
125
|
+
inspector?: InspectorConfig;
|
|
126
|
+
devPanel?: DevPanelConfig;
|
|
127
|
+
/** Working as other MI users (the dev panel's Users section). */
|
|
128
|
+
users?: UsersConfig;
|
|
129
|
+
/** The dev server itself (`pp-dev` and `pp-dev next`). */
|
|
130
|
+
server?: ServerConfig;
|
|
131
|
+
}
|
|
132
|
+
interface VersionPluginOptions {
|
|
133
|
+
/**
|
|
134
|
+
* Version file filename template.
|
|
135
|
+
* Placeholders: {packageversion}, {currentDate}
|
|
136
|
+
* @default "VERSION-v{packageversion}-{currentDate}.json"
|
|
137
|
+
*/
|
|
138
|
+
versionFileTemplate?: string;
|
|
139
|
+
/** @default true */
|
|
140
|
+
enabled?: boolean;
|
|
141
|
+
}
|
|
142
|
+
/** @internal — used by the Vite plugin and CLI; not part of the public API. */
|
|
143
|
+
interface NormalizedVitePPDevOptions {
|
|
144
|
+
templateName: string;
|
|
145
|
+
backendBaseURL?: string;
|
|
146
|
+
appId?: number;
|
|
147
|
+
templateLess: boolean;
|
|
148
|
+
miHudLess: boolean;
|
|
149
|
+
integrateMiTopBar: boolean | {
|
|
150
|
+
addRootElement?: boolean;
|
|
151
|
+
addSharedComponentsScripts?: boolean;
|
|
152
|
+
};
|
|
153
|
+
enableProxyCache: boolean;
|
|
154
|
+
proxyCacheTTL: number;
|
|
155
|
+
disableSSLValidation: boolean;
|
|
156
|
+
imageOptimizer: boolean | Parameters<typeof ViteImageOptimizer>[0];
|
|
157
|
+
outDir: string;
|
|
158
|
+
distZip: false | {
|
|
159
|
+
outFileName: string;
|
|
160
|
+
outDir: string;
|
|
161
|
+
inDir?: string;
|
|
162
|
+
};
|
|
163
|
+
versionPlugin: false | VersionPluginOptions;
|
|
164
|
+
syncBackupsDir: string;
|
|
165
|
+
/** `undefined` leaves DistService's default. */
|
|
166
|
+
syncMaxBackups?: number | false;
|
|
167
|
+
/** `undefined` leaves DistService's default. */
|
|
168
|
+
syncBuildTimeoutMs?: number;
|
|
169
|
+
v7Features: boolean;
|
|
170
|
+
personalAccessToken?: string;
|
|
171
|
+
inspectorEnabled: boolean;
|
|
172
|
+
inspectorMaxMemory: number;
|
|
173
|
+
inspectorCaptureLimit: number;
|
|
174
|
+
devPanelPosition: DevPanelPosition;
|
|
175
|
+
devPanelHidden: boolean;
|
|
176
|
+
devPanelAutoHide: boolean;
|
|
177
|
+
persistUsers: boolean;
|
|
178
|
+
/** `server.allowedHosts`, lowercased. */
|
|
179
|
+
allowedHosts: string[] | true;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* @param templateName - package.json's `name`; `app.name` takes precedence over it, here and in
|
|
183
|
+
* {@link normalizePPDevConfig} (whose `templateName` is the one name to use from then on).
|
|
184
|
+
*/
|
|
185
|
+
declare function validatePPDevConfig(config: PPDevConfig, templateName: string | undefined): void;
|
|
186
|
+
declare function normalizePPDevConfig(config: PPDevConfig, templateName: string | undefined): NormalizedVitePPDevOptions;
|
|
187
|
+
|
|
188
|
+
export { normalizePPDevConfig as n, validatePPDevConfig as v };
|
|
189
|
+
export type { AppConfig as A, BuildConfig as B, DevPanelConfig as D, InspectorConfig as I, MiConfig as M, NormalizedVitePPDevOptions as N, PPDevConfig as P, SyncConfig as S, UsersConfig as U, VersionPluginOptions as V, AppType as a, DevPanelPosition as b, MiInclude as c, MiMode as d, ProxyConfig as e, ServerConfig as f };
|
package/docs/features.md
CHANGED
|
@@ -91,7 +91,8 @@ version):
|
|
|
91
91
|
|
|
92
92
|
Edit the page's live variable values in place, with a widget per type: a searchable combobox for
|
|
93
93
|
`select`/`multiselect` with static options, a per-item form for `list` (flat or column-defined
|
|
94
|
-
objects), a checkbox for `boolean`, a color picker, and so on.
|
|
94
|
+
objects), a checkbox for `boolean`, a color picker, and so on. Descriptions are shown as markdown,
|
|
95
|
+
as in MI. **Save** also updates the values the
|
|
95
96
|
local pages substitute for `[VarName]`; when they differ from MI anyway (changed in MI itself), an
|
|
96
97
|
**Update local pages** button in the bottom-right corner lists the differences and updates them:
|
|
97
98
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metricinsights/pp-dev",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.0-beta.
|
|
4
|
+
"version": "1.5.0-beta.30",
|
|
5
5
|
"description": "Portal Page dev build tool",
|
|
6
6
|
"bin": {
|
|
7
7
|
"pp-dev": "bin/pp-dev.js"
|
|
@@ -11,16 +11,12 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"clean": "rimraf ./dist",
|
|
13
13
|
"prebuild": "npm run clean",
|
|
14
|
-
"build": "npm run build:
|
|
15
|
-
"build:parallel": "npm run build:node && npm run build:client",
|
|
14
|
+
"build": "npm run build:node && npm run build:client",
|
|
16
15
|
"build:node": "rollup --config rollup.config.ts --configPlugin typescript && node scripts/postbuild.js && node scripts/build-types.mjs",
|
|
17
16
|
"build:client": "rollup --config src/client/rollup.config.ts --configPlugin typescript",
|
|
18
17
|
"build:watch": "rollup --config rollup.config.ts --configPlugin typescript --watch",
|
|
19
18
|
"build:analyze": "rollup --config rollup.config.ts --configPlugin typescript --configPlugin rollup-plugin-visualizer",
|
|
20
|
-
"build:fast": "npm run build:parallel",
|
|
21
|
-
"build:optimize": "tsx scripts/build-optimizer.js",
|
|
22
19
|
"postbuild": "npm pack && node scripts/rename-pack.js",
|
|
23
|
-
"startup:optimize": "tsx scripts/startup-optimizer.js",
|
|
24
20
|
"startup:profile": "node --prof bin/pp-dev.js",
|
|
25
21
|
"test": "npm run test:all",
|
|
26
22
|
"test:unit": "vitest run --config vitest.config.ts",
|
|
@@ -33,8 +29,9 @@
|
|
|
33
29
|
"test:integration:watch": "vitest --config vitest.integration.config.ts",
|
|
34
30
|
"test:e2e:ui": "npx playwright test --ui",
|
|
35
31
|
"test:all": "npm run test:unit && npm run test:integration",
|
|
36
|
-
"lint": "eslint src",
|
|
37
|
-
"lint:fix": "eslint src --fix",
|
|
32
|
+
"lint": "eslint src tests e2e",
|
|
33
|
+
"lint:fix": "eslint src tests e2e --fix",
|
|
34
|
+
"typecheck": "tsc --noEmit -p tsconfig.json && tsc -p tests/tsconfig.json && tsc -p e2e/tsconfig.json",
|
|
38
35
|
"audit:all": "node scripts/audit-all.mjs",
|
|
39
36
|
"prereinstall:all": "npm run build",
|
|
40
37
|
"reinstall:all": "node scripts/reinstall-all.mjs"
|
|
@@ -77,16 +74,17 @@
|
|
|
77
74
|
"undici": "^6.28.1"
|
|
78
75
|
},
|
|
79
76
|
"chokidar": "^5.0.0",
|
|
80
|
-
"file-type": "^22.
|
|
77
|
+
"file-type": "^22.2.0",
|
|
78
|
+
"glob": "^14.0.3",
|
|
81
79
|
"http-cache-semantics": ">=4.3.0",
|
|
82
80
|
"ip-address": ">=10.7.1",
|
|
83
81
|
"js-yaml": ">=4.3.1",
|
|
84
|
-
"minimatch": "
|
|
82
|
+
"minimatch": "11.0.4",
|
|
85
83
|
"nanoid": "3.3.18",
|
|
86
84
|
"next@*": {
|
|
87
85
|
"postcss": "8.5.23"
|
|
88
86
|
},
|
|
89
|
-
"qs": ">=6.
|
|
87
|
+
"qs": ">=6.16.1",
|
|
90
88
|
"serialize-javascript": ">=7.1.2",
|
|
91
89
|
"sharp": "^0.35.5",
|
|
92
90
|
"tar": "^7.5.22",
|
|
@@ -105,34 +103,30 @@
|
|
|
105
103
|
},
|
|
106
104
|
"dependencies": {
|
|
107
105
|
"axios": "^1.20.0",
|
|
108
|
-
"cac": "^7.
|
|
106
|
+
"cac": "^7.1.0",
|
|
109
107
|
"chokidar": "^5.0.0",
|
|
110
|
-
"deepmerge-ts": "^8.0.2",
|
|
111
108
|
"diff-match-patch": "^1.0.5",
|
|
112
109
|
"dir-compare": "^5.0.0",
|
|
113
|
-
"ejs": "^
|
|
110
|
+
"ejs": "^7.0.2",
|
|
114
111
|
"esbuild": "^0.28.2",
|
|
115
|
-
"express": "^5.
|
|
116
|
-
"file-type": "^22.
|
|
112
|
+
"express": "^5.3.0",
|
|
113
|
+
"file-type": "^22.2.0",
|
|
117
114
|
"http-proxy-middleware": "^4.2.0",
|
|
118
115
|
"isbinaryfile": "^6.0.0",
|
|
119
|
-
"jsdom": "30.1.
|
|
116
|
+
"jsdom": "30.1.3",
|
|
120
117
|
"jszip": "^3.10.2",
|
|
121
118
|
"picocolors": "^1.1.1",
|
|
122
|
-
"
|
|
123
|
-
"sass": "^1.105.1",
|
|
119
|
+
"sass": "^1.105.2",
|
|
124
120
|
"sharp": "^0.35.5",
|
|
125
121
|
"svgo": "^4.1.0",
|
|
126
122
|
"svgtofont": "^6.5.3",
|
|
127
|
-
"typescript": "^6.0.3",
|
|
128
123
|
"vite": "^8.3.4",
|
|
129
124
|
"vite-plugin-image-optimizer": "^2.0.3",
|
|
130
125
|
"vite-plugin-zip-pack": "^1.2.4",
|
|
131
|
-
"winston": "^3.19.0",
|
|
132
126
|
"ws": "^8.22.0"
|
|
133
127
|
},
|
|
134
128
|
"devDependencies": {
|
|
135
|
-
"@playwright/test": "^1.
|
|
129
|
+
"@playwright/test": "^1.64.1",
|
|
136
130
|
"@rollup/plugin-terser": "^1.0.0",
|
|
137
131
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
138
132
|
"@rollup/plugin-url": "^8.0.2",
|
|
@@ -140,38 +134,35 @@
|
|
|
140
134
|
"@types/ejs": "^3.1.5",
|
|
141
135
|
"@types/express": "^5.0.6",
|
|
142
136
|
"@types/jsdom": "^30.0.0",
|
|
143
|
-
"@types/node": "^26.6.
|
|
137
|
+
"@types/node": "^26.6.5",
|
|
144
138
|
"@types/ws": "^8.18.2",
|
|
145
|
-
"@vitest/coverage-v8": "^5.0.
|
|
146
|
-
"eslint": "^10.
|
|
139
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
140
|
+
"eslint": "^10.13.0",
|
|
147
141
|
"next": "^16.4.2",
|
|
148
|
-
"prettier": "^3.9.
|
|
142
|
+
"prettier": "^3.9.10",
|
|
149
143
|
"rimraf": "^6.1.3",
|
|
144
|
+
"rollup": "^4.64.10",
|
|
150
145
|
"rollup-plugin-dts": "^6.5.1",
|
|
151
146
|
"rollup-plugin-scss": "^4.0.1",
|
|
152
|
-
"rollup-plugin-visualizer": "7.
|
|
147
|
+
"rollup-plugin-visualizer": "7.1.1",
|
|
153
148
|
"tslib": "^2.8.1",
|
|
154
149
|
"tsx": "^4.23.15",
|
|
155
|
-
"typescript
|
|
156
|
-
"
|
|
157
|
-
"
|
|
150
|
+
"typescript": "^6.0.3",
|
|
151
|
+
"typescript-eslint": "^8.72.0",
|
|
152
|
+
"vitest": "^5.0.5"
|
|
158
153
|
},
|
|
159
154
|
"files": [
|
|
160
155
|
"bin",
|
|
161
156
|
"dist",
|
|
162
157
|
"package.json",
|
|
163
158
|
"README.md",
|
|
164
|
-
"LICENSE
|
|
159
|
+
"LICENSE",
|
|
165
160
|
"pp-dev.d.ts",
|
|
166
|
-
"assets",
|
|
167
161
|
"CHANGELOG.md",
|
|
168
162
|
"TEMPLATE_VARIABLES.md",
|
|
169
163
|
"docs/features.md",
|
|
170
164
|
"docs/screenshots"
|
|
171
165
|
],
|
|
172
|
-
"directories": {
|
|
173
|
-
"test": "test"
|
|
174
|
-
},
|
|
175
166
|
"repository": {
|
|
176
167
|
"type": "git",
|
|
177
168
|
"url": "git+https://github.com/mi-examples/pp-dev.git"
|