@posthog/plugin-utils 1.2.0 → 2.0.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/dist/config.d.ts +7 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.mjs +1 -1
- package/package.json +3 -3
- package/src/config.ts +8 -6
package/dist/config.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
|
2
2
|
/**
|
|
3
3
|
* How an exception gets associated with a release, mirroring posthog-cli's `--release-mode`.
|
|
4
4
|
*
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
5
|
+
* `event`, the default, leaves the uploaded symbol sets unbound and injects the release id into
|
|
6
|
+
* each chunk, so the release is resolved per exception. `symbol-set` binds the uploaded symbol
|
|
7
|
+
* sets to a release instead.
|
|
7
8
|
*/
|
|
8
9
|
export type ReleaseMode = 'symbol-set' | 'event';
|
|
9
10
|
export interface PluginConfig {
|
|
@@ -26,9 +27,10 @@ export interface PluginConfig {
|
|
|
26
27
|
deleteAfterUpload?: boolean;
|
|
27
28
|
batchSize?: number;
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
30
|
+
* Defaults to the `POSTHOG_RELEASE_MODE` env var, the same one posthog-cli reads, then to
|
|
31
|
+
* `event`. Event mode needs a posthog-cli that supports `release resolve` and
|
|
32
|
+
* `--release-mode`. Set `symbol-set` to bind the uploaded symbol sets to a release
|
|
33
|
+
* instead.
|
|
32
34
|
*/
|
|
33
35
|
releaseMode?: ReleaseMode;
|
|
34
36
|
};
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,G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ACpB,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,iBAAiB,EAAE,OAAO,CAAA;QAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,WAAW,EAAE,WAAW,CAAA;KAC3B,CAAA;CACJ;AAED,MAAM,WAAW,oBAAoB;IACjC,sFAAsF;IACtF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,CAAC,EAAE,oBAAoB,GAAG,oBAAoB,CA0ChH"}
|
package/dist/config.js
CHANGED
|
@@ -40,7 +40,7 @@ const RELEASE_MODES = [
|
|
|
40
40
|
'event'
|
|
41
41
|
];
|
|
42
42
|
function normalizeReleaseMode(value) {
|
|
43
|
-
if (void 0 === value || '' === value) return '
|
|
43
|
+
if (void 0 === value || '' === value) return 'event';
|
|
44
44
|
if (!RELEASE_MODES.includes(value)) throw new Error(`sourcemaps.releaseMode must be one of ${RELEASE_MODES.join(', ')}, got '${value}'`);
|
|
45
45
|
return value;
|
|
46
46
|
}
|
package/dist/config.mjs
CHANGED
|
@@ -12,7 +12,7 @@ const RELEASE_MODES = [
|
|
|
12
12
|
'event'
|
|
13
13
|
];
|
|
14
14
|
function normalizeReleaseMode(value) {
|
|
15
|
-
if (void 0 === value || '' === value) return '
|
|
15
|
+
if (void 0 === value || '' === value) return 'event';
|
|
16
16
|
if (!RELEASE_MODES.includes(value)) throw new Error(`sourcemaps.releaseMode must be one of ${RELEASE_MODES.join(', ')}, got '${value}'`);
|
|
17
17
|
return value;
|
|
18
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@posthog/plugin-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"bugs": {
|
|
5
5
|
"url": "https://github.com/PostHog/posthog-js/issues"
|
|
6
6
|
},
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"clean": "rimraf dist",
|
|
42
|
-
"lint": "
|
|
43
|
-
"lint:fix": "
|
|
42
|
+
"lint": "oxlint --report-unused-disable-directives-severity error src",
|
|
43
|
+
"lint:fix": "oxlint --report-unused-disable-directives-severity error src --fix",
|
|
44
44
|
"build": "rslib build",
|
|
45
45
|
"dev": "rslib build -w",
|
|
46
46
|
"test:unit": "jest",
|
package/src/config.ts
CHANGED
|
@@ -16,8 +16,9 @@ export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent'
|
|
|
16
16
|
/**
|
|
17
17
|
* How an exception gets associated with a release, mirroring posthog-cli's `--release-mode`.
|
|
18
18
|
*
|
|
19
|
-
* `
|
|
20
|
-
*
|
|
19
|
+
* `event`, the default, leaves the uploaded symbol sets unbound and injects the release id into
|
|
20
|
+
* each chunk, so the release is resolved per exception. `symbol-set` binds the uploaded symbol
|
|
21
|
+
* sets to a release instead.
|
|
21
22
|
*/
|
|
22
23
|
export type ReleaseMode = 'symbol-set' | 'event'
|
|
23
24
|
|
|
@@ -25,7 +26,7 @@ const RELEASE_MODES: ReleaseMode[] = ['symbol-set', 'event']
|
|
|
25
26
|
|
|
26
27
|
function normalizeReleaseMode(value: string | undefined): ReleaseMode {
|
|
27
28
|
if (value === undefined || value === '') {
|
|
28
|
-
return '
|
|
29
|
+
return 'event'
|
|
29
30
|
}
|
|
30
31
|
if (!(RELEASE_MODES as string[]).includes(value)) {
|
|
31
32
|
throw new Error(`sourcemaps.releaseMode must be one of ${RELEASE_MODES.join(', ')}, got '${value}'`)
|
|
@@ -53,9 +54,10 @@ export interface PluginConfig {
|
|
|
53
54
|
deleteAfterUpload?: boolean
|
|
54
55
|
batchSize?: number
|
|
55
56
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
57
|
+
* Defaults to the `POSTHOG_RELEASE_MODE` env var, the same one posthog-cli reads, then to
|
|
58
|
+
* `event`. Event mode needs a posthog-cli that supports `release resolve` and
|
|
59
|
+
* `--release-mode`. Set `symbol-set` to bind the uploaded symbol sets to a release
|
|
60
|
+
* instead.
|
|
59
61
|
*/
|
|
60
62
|
releaseMode?: ReleaseMode
|
|
61
63
|
}
|