@funnelsgrove/cli 0.1.396 → 0.1.398
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 +9 -0
- package/dist/bugReportCommands.d.ts +2 -0
- package/dist/bugReportCommands.js +7 -3
- package/dist/cli.js +23 -10
- package/funnel-contract-compatibility.json +28 -28
- package/package.json +1 -1
- package/template_docs/.funnelsgrove-docs.json +3 -3
- package/template_docs/docs/funnelsgrove/migrations/step-contract-v3.md +1 -1
- package/template_docs/funnel-docs.config.json +1 -1
- package/template_scaffold/.funnelsgrove-docs.json +3 -3
- package/template_scaffold/.funnelsgrove-scaffold.json +7 -7
- package/template_scaffold/docs/funnelsgrove/migrations/step-contract-v3.md +1 -1
- package/template_scaffold/funnel-docs.config.json +1 -1
- package/template_scaffold/funnel.runtime-capabilities.json +2 -1
- package/template_scaffold/src/steps/step-32-paywall.tsx +63 -14
package/README.md
CHANGED
|
@@ -326,6 +326,15 @@ workspace, project and funnel chosen with `fgrove use`). `--log` attaches the
|
|
|
326
326
|
last 20,000 characters of a log file as-is, so remove secrets first. The
|
|
327
327
|
command prints the reference of the filed report.
|
|
328
328
|
|
|
329
|
+
Request a feature the same way:
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
fgrove feature request "export funnel analytics as CSV" --dry-run # show what would be sent
|
|
333
|
+
fgrove feature request "export funnel analytics as CSV"
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
A feature request carries the same context, without a log.
|
|
337
|
+
|
|
329
338
|
Use `--api-url` or `FUNNELSGROVE_API_URL` for non-production APIs.
|
|
330
339
|
Use `--config` or `FUNNELSGROVE_CONFIG` to keep test credentials separate from the default `~/.funnelsgrove/config.json`.
|
|
331
340
|
|
|
@@ -6,6 +6,7 @@ type CallApi = <T>(input: {
|
|
|
6
6
|
}) => Promise<T>;
|
|
7
7
|
export declare const BUG_REPORT_MAX_LOG_CHARS = 20000;
|
|
8
8
|
export type BugReport = {
|
|
9
|
+
kind?: 'feature';
|
|
9
10
|
message: string;
|
|
10
11
|
logs?: string;
|
|
11
12
|
cliVersion: string;
|
|
@@ -29,6 +30,7 @@ export declare const resolveBugReportContext: (input: {
|
|
|
29
30
|
active: BugReportContext | null;
|
|
30
31
|
}) => BugReportContext;
|
|
31
32
|
export declare const buildBugReport: (input: {
|
|
33
|
+
kind?: "feature";
|
|
32
34
|
message: string;
|
|
33
35
|
logPath?: string;
|
|
34
36
|
cliVersion: string;
|
|
@@ -13,14 +13,18 @@ export const resolveBugReportContext = (input) => {
|
|
|
13
13
|
};
|
|
14
14
|
export const buildBugReport = async (input) => {
|
|
15
15
|
const message = input.message.trim();
|
|
16
|
-
if (!message)
|
|
17
|
-
throw new Error(
|
|
16
|
+
if (!message) {
|
|
17
|
+
throw new Error(input.kind === 'feature'
|
|
18
|
+
? 'Describe the feature: fgrove feature request "what you need".'
|
|
19
|
+
: 'Describe the bug: fgrove bug report "what happened".');
|
|
20
|
+
}
|
|
18
21
|
const readText = input.readText ?? ((path) => readFile(path, 'utf8'));
|
|
19
22
|
const logs = input.logPath ? tailLog(await readText(input.logPath)) : undefined;
|
|
20
|
-
return { message, ...(logs ? { logs } : {}), cliVersion: input.cliVersion, environment: input.environment, ...input.context };
|
|
23
|
+
return { ...(input.kind ? { kind: input.kind } : {}), message, ...(logs ? { logs } : {}), cliVersion: input.cliVersion, environment: input.environment, ...input.context };
|
|
21
24
|
};
|
|
22
25
|
export const submitBugReport = (input, report) => (input.callApi({ path: 'bugReports.create', type: 'mutation', token: input.token, data: report }));
|
|
23
26
|
export const formatBugReportPreview = (report) => [
|
|
27
|
+
...(report.kind === 'feature' ? ['Type\tfeature request'] : []),
|
|
24
28
|
`CLI\t${report.cliVersion} (${report.environment})`,
|
|
25
29
|
`Workspace\t${report.workspaceId ?? 'not set'}`,
|
|
26
30
|
`Project\t${report.projectId ?? 'not set'}`,
|
package/dist/cli.js
CHANGED
|
@@ -2890,16 +2890,10 @@ const bugCommand = addExamples(program.command('bug').description('Report a Funn
|
|
|
2890
2890
|
'fgrove bug report "publish hangs at image optimization" --log ./publish.log --dir ./claimbee-ios',
|
|
2891
2891
|
'fgrove bug report "users find misses a project" --dry-run',
|
|
2892
2892
|
]);
|
|
2893
|
-
|
|
2894
|
-
.command('report <message>')
|
|
2895
|
-
.description('Send a bug report with your CLI version, environment and current workspace, project and funnel; --log attaches the last 20,000 characters of a log file')
|
|
2896
|
-
.option('--log <file>', 'Log file to attach (sent as-is; remove secrets first)')
|
|
2897
|
-
.option('--dir <path>', 'Local funnel directory whose sync manifest names the funnel', '.')
|
|
2898
|
-
.option('--dry-run', 'Print what would be sent without sending it')
|
|
2899
|
-
.option('--json', 'Print machine-readable JSON')
|
|
2900
|
-
.action(async (message, options) => {
|
|
2893
|
+
const sendBugReport = async (kind, message, options) => {
|
|
2901
2894
|
const [manifest, active] = await Promise.all([loadManifestForDir(options.dir), loadActiveContext(getConfigPath())]);
|
|
2902
2895
|
const report = await buildBugReport({
|
|
2896
|
+
kind,
|
|
2903
2897
|
message,
|
|
2904
2898
|
logPath: options.log && path.resolve(process.cwd(), options.log),
|
|
2905
2899
|
cliVersion: cliReleaseIdentity.cliVersion,
|
|
@@ -2918,8 +2912,27 @@ bugCommand
|
|
|
2918
2912
|
console.log(JSON.stringify(result, null, 2));
|
|
2919
2913
|
return;
|
|
2920
2914
|
}
|
|
2921
|
-
console.log(
|
|
2922
|
-
}
|
|
2915
|
+
console.log(`${kind === 'feature' ? 'Feature request' : 'Bug report'} sent\t${result.reference}`);
|
|
2916
|
+
};
|
|
2917
|
+
bugCommand
|
|
2918
|
+
.command('report <message>')
|
|
2919
|
+
.description('Send a bug report with your CLI version, environment and current workspace, project and funnel; --log attaches the last 20,000 characters of a log file')
|
|
2920
|
+
.option('--log <file>', 'Log file to attach (sent as-is; remove secrets first)')
|
|
2921
|
+
.option('--dir <path>', 'Local funnel directory whose sync manifest names the funnel', '.')
|
|
2922
|
+
.option('--dry-run', 'Print what would be sent without sending it')
|
|
2923
|
+
.option('--json', 'Print machine-readable JSON')
|
|
2924
|
+
.action((message, options) => sendBugReport(undefined, message, options));
|
|
2925
|
+
const featureCommand = addExamples(program.command('feature').description('Request a FunnelsGrove feature from the FunnelsGrove team'), [
|
|
2926
|
+
'fgrove feature request "export funnel analytics as CSV"',
|
|
2927
|
+
'fgrove feature request "bulk-edit prices across funnels" --dry-run',
|
|
2928
|
+
]);
|
|
2929
|
+
featureCommand
|
|
2930
|
+
.command('request <message>')
|
|
2931
|
+
.description('Send a feature request with your CLI version, environment and current workspace, project and funnel')
|
|
2932
|
+
.option('--dir <path>', 'Local funnel directory whose sync manifest names the funnel', '.')
|
|
2933
|
+
.option('--dry-run', 'Print what would be sent without sending it')
|
|
2934
|
+
.option('--json', 'Print machine-readable JSON')
|
|
2935
|
+
.action((message, options) => sendBugReport('feature', message, options));
|
|
2923
2936
|
const funnelsCommand = addExamples(program.command('funnels').description('Manage funnels'), [
|
|
2924
2937
|
'fgrove funnels list',
|
|
2925
2938
|
'fgrove funnels clone --funnel claimbee --name claimbee-ios',
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"minimumCliVersion": "0.1.20",
|
|
5
5
|
"entries": [
|
|
6
6
|
{
|
|
7
|
-
"repositoryCliVersion": "0.1.
|
|
7
|
+
"repositoryCliVersion": "0.1.398",
|
|
8
8
|
"manifest": {
|
|
9
9
|
"schemaVersion": 1,
|
|
10
|
-
"bundleVersion": "2.0.
|
|
10
|
+
"bundleVersion": "2.0.391",
|
|
11
11
|
"stepContractVersion": 3,
|
|
12
12
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
13
13
|
"managedFiles": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
48
|
-
"sha256": "
|
|
48
|
+
"sha256": "502d91c2c9ca9a3b41b3b46b3e965a5651ec14bde6a5ff4e617df62e873b835b"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -145,16 +145,16 @@
|
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
"path": "funnel-docs.config.json",
|
|
148
|
-
"sha256": "
|
|
148
|
+
"sha256": "cbcba371bd3082cd467a40a6dfb11c181ab0a77caaafc6b28d4512ae8fb6770b"
|
|
149
149
|
}
|
|
150
150
|
]
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
|
-
"repositoryCliVersion": "0.1.
|
|
154
|
+
"repositoryCliVersion": "0.1.397",
|
|
155
155
|
"manifest": {
|
|
156
156
|
"schemaVersion": 1,
|
|
157
|
-
"bundleVersion": "2.0.
|
|
157
|
+
"bundleVersion": "2.0.390",
|
|
158
158
|
"stepContractVersion": 3,
|
|
159
159
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
160
160
|
"managedFiles": [
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
195
|
-
"sha256": "
|
|
195
|
+
"sha256": "31a69ec0c7ed48cba36e7b470f499b3bd484bd78550fd5248ce1efc0af472348"
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
198
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -292,16 +292,16 @@
|
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
294
|
"path": "funnel-docs.config.json",
|
|
295
|
-
"sha256": "
|
|
295
|
+
"sha256": "75ef0d4be50021d59c15097ee33f467bb30f0862ad11fa5447cf7a9ede50e38a"
|
|
296
296
|
}
|
|
297
297
|
]
|
|
298
298
|
}
|
|
299
299
|
},
|
|
300
300
|
{
|
|
301
|
-
"repositoryCliVersion": "0.1.
|
|
301
|
+
"repositoryCliVersion": "0.1.396",
|
|
302
302
|
"manifest": {
|
|
303
303
|
"schemaVersion": 1,
|
|
304
|
-
"bundleVersion": "2.0.
|
|
304
|
+
"bundleVersion": "2.0.389",
|
|
305
305
|
"stepContractVersion": 3,
|
|
306
306
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
307
307
|
"managedFiles": [
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
},
|
|
340
340
|
{
|
|
341
341
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
342
|
-
"sha256": "
|
|
342
|
+
"sha256": "7ab93d7a8f249494fa0c2d7bae90ad9dd58e8f292cdf80662a824efe18cb682d"
|
|
343
343
|
},
|
|
344
344
|
{
|
|
345
345
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -439,16 +439,16 @@
|
|
|
439
439
|
},
|
|
440
440
|
{
|
|
441
441
|
"path": "funnel-docs.config.json",
|
|
442
|
-
"sha256": "
|
|
442
|
+
"sha256": "e305826722a12102979fbd7dec46471875f09f8397cb97917109f090f505443f"
|
|
443
443
|
}
|
|
444
444
|
]
|
|
445
445
|
}
|
|
446
446
|
},
|
|
447
447
|
{
|
|
448
|
-
"repositoryCliVersion": "0.1.
|
|
448
|
+
"repositoryCliVersion": "0.1.395",
|
|
449
449
|
"manifest": {
|
|
450
450
|
"schemaVersion": 1,
|
|
451
|
-
"bundleVersion": "2.0.
|
|
451
|
+
"bundleVersion": "2.0.388",
|
|
452
452
|
"stepContractVersion": 3,
|
|
453
453
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
454
454
|
"managedFiles": [
|
|
@@ -486,7 +486,7 @@
|
|
|
486
486
|
},
|
|
487
487
|
{
|
|
488
488
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
489
|
-
"sha256": "
|
|
489
|
+
"sha256": "d1eddcd89db6e20b6a054dbe8c43282fd9b0c4988e1e01f05c4a7c69081e1093"
|
|
490
490
|
},
|
|
491
491
|
{
|
|
492
492
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -586,16 +586,16 @@
|
|
|
586
586
|
},
|
|
587
587
|
{
|
|
588
588
|
"path": "funnel-docs.config.json",
|
|
589
|
-
"sha256": "
|
|
589
|
+
"sha256": "bef986565046d4615b543a21cbe7e0de64567ee3a777a385a0a7072b94c55b5d"
|
|
590
590
|
}
|
|
591
591
|
]
|
|
592
592
|
}
|
|
593
593
|
},
|
|
594
594
|
{
|
|
595
|
-
"repositoryCliVersion": "0.1.
|
|
595
|
+
"repositoryCliVersion": "0.1.394",
|
|
596
596
|
"manifest": {
|
|
597
597
|
"schemaVersion": 1,
|
|
598
|
-
"bundleVersion": "2.0.
|
|
598
|
+
"bundleVersion": "2.0.387",
|
|
599
599
|
"stepContractVersion": 3,
|
|
600
600
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
601
601
|
"managedFiles": [
|
|
@@ -633,7 +633,7 @@
|
|
|
633
633
|
},
|
|
634
634
|
{
|
|
635
635
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
636
|
-
"sha256": "
|
|
636
|
+
"sha256": "831c1168ae9f1def454e495a92e19974ff8de7b54b8e6665f4f8d427ee1f0154"
|
|
637
637
|
},
|
|
638
638
|
{
|
|
639
639
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -733,16 +733,16 @@
|
|
|
733
733
|
},
|
|
734
734
|
{
|
|
735
735
|
"path": "funnel-docs.config.json",
|
|
736
|
-
"sha256": "
|
|
736
|
+
"sha256": "bdedcb98d0fabb5c659eb9105e1b10306bbd3cbee58897c3a05ccda7d2f06fff"
|
|
737
737
|
}
|
|
738
738
|
]
|
|
739
739
|
}
|
|
740
740
|
},
|
|
741
741
|
{
|
|
742
|
-
"repositoryCliVersion": "0.1.
|
|
742
|
+
"repositoryCliVersion": "0.1.393",
|
|
743
743
|
"manifest": {
|
|
744
744
|
"schemaVersion": 1,
|
|
745
|
-
"bundleVersion": "2.0.
|
|
745
|
+
"bundleVersion": "2.0.386",
|
|
746
746
|
"stepContractVersion": 3,
|
|
747
747
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
748
748
|
"managedFiles": [
|
|
@@ -780,7 +780,7 @@
|
|
|
780
780
|
},
|
|
781
781
|
{
|
|
782
782
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
783
|
-
"sha256": "
|
|
783
|
+
"sha256": "7ce50d62b61683fa35a54f61d0ce5b5add484676d6eea75704b24d5e0ffba678"
|
|
784
784
|
},
|
|
785
785
|
{
|
|
786
786
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -880,16 +880,16 @@
|
|
|
880
880
|
},
|
|
881
881
|
{
|
|
882
882
|
"path": "funnel-docs.config.json",
|
|
883
|
-
"sha256": "
|
|
883
|
+
"sha256": "b0d2b5fc0cfc06cfbb29f4845b520349cd09bfca5cad8aaa2da463adaf41a9ad"
|
|
884
884
|
}
|
|
885
885
|
]
|
|
886
886
|
}
|
|
887
887
|
},
|
|
888
888
|
{
|
|
889
|
-
"repositoryCliVersion": "0.1.
|
|
889
|
+
"repositoryCliVersion": "0.1.392",
|
|
890
890
|
"manifest": {
|
|
891
891
|
"schemaVersion": 1,
|
|
892
|
-
"bundleVersion": "2.0.
|
|
892
|
+
"bundleVersion": "2.0.385",
|
|
893
893
|
"stepContractVersion": 3,
|
|
894
894
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
895
895
|
"managedFiles": [
|
|
@@ -927,7 +927,7 @@
|
|
|
927
927
|
},
|
|
928
928
|
{
|
|
929
929
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
930
|
-
"sha256": "
|
|
930
|
+
"sha256": "d5606e76d2e25344d0d67f2443772722ef85c1104416b58ed6433f7a5ce798ba"
|
|
931
931
|
},
|
|
932
932
|
{
|
|
933
933
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -1027,7 +1027,7 @@
|
|
|
1027
1027
|
},
|
|
1028
1028
|
{
|
|
1029
1029
|
"path": "funnel-docs.config.json",
|
|
1030
|
-
"sha256": "
|
|
1030
|
+
"sha256": "dd341d481aff2f0fe7431b8747fb11325f8cfba1b9f1cc77659fbcc481f6c86f"
|
|
1031
1031
|
}
|
|
1032
1032
|
]
|
|
1033
1033
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"bundleVersion": "2.0.
|
|
3
|
+
"bundleVersion": "2.0.391",
|
|
4
4
|
"stepContractVersion": 3,
|
|
5
5
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
6
6
|
"managedFiles": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
41
|
-
"sha256": "
|
|
41
|
+
"sha256": "502d91c2c9ca9a3b41b3b46b3e965a5651ec14bde6a5ff4e617df62e873b835b"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"path": "funnel-docs.config.json",
|
|
141
|
-
"sha256": "
|
|
141
|
+
"sha256": "cbcba371bd3082cd467a40a6dfb11c181ab0a77caaafc6b28d4512ae8fb6770b"
|
|
142
142
|
}
|
|
143
143
|
]
|
|
144
144
|
}
|
|
@@ -17,7 +17,7 @@ Supported read versions: `1`, `2`, `3`. Authoring and publish target version `3`
|
|
|
17
17
|
|
|
18
18
|
### Package release order
|
|
19
19
|
|
|
20
|
-
Release `@funnelsgrove/sdk` `0.5.0` first, then `@funnelsgrove/runtime` `0.49.0`, then `@funnelsgrove/analytics` `0.32.0`, then `@funnelsgrove/payments` `0.
|
|
20
|
+
Release `@funnelsgrove/sdk` `0.5.0` first, then `@funnelsgrove/runtime` `0.49.0`, then `@funnelsgrove/analytics` `0.32.0`, then `@funnelsgrove/payments` `0.80.0`. The production deploy verifies the zero-traffic API candidate, publishes and verifies `@funnelsgrove/cli` `0.1.398`, and only then promotes the candidate to production traffic. The serving API must never advertise an unpublished preferred CLI. Publishing packages and deploying production remain separately approved operational actions.
|
|
21
21
|
<!-- funnelsgrove:generated:end contract-v3/migration/step-contract-v3 -->
|
|
22
22
|
|
|
23
23
|
## Version-last policy
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"bundleVersion": "2.0.
|
|
3
|
+
"bundleVersion": "2.0.391",
|
|
4
4
|
"stepContractVersion": 3,
|
|
5
5
|
"contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
|
|
6
6
|
"managedFiles": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
41
|
-
"sha256": "
|
|
41
|
+
"sha256": "502d91c2c9ca9a3b41b3b46b3e965a5651ec14bde6a5ff4e617df62e873b835b"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"path": "funnel-docs.config.json",
|
|
141
|
-
"sha256": "
|
|
141
|
+
"sha256": "cbcba371bd3082cd467a40a6dfb11c181ab0a77caaafc6b28d4512ae8fb6770b"
|
|
142
142
|
}
|
|
143
143
|
]
|
|
144
144
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"sourceTreeHash": "
|
|
3
|
+
"sourceTreeHash": "3579a9b174411cc83f237e3f2dd1e7fccc3402d1aee699f2f5e13e87d6fee666",
|
|
4
4
|
"stepContractVersion": 3,
|
|
5
|
-
"docsBundleVersion": "2.0.
|
|
5
|
+
"docsBundleVersion": "2.0.391",
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": ".env.example",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"path": ".funnelsgrove-docs.json",
|
|
19
|
-
"sha256": "
|
|
19
|
+
"sha256": "0a0672b5c47df989063c86b32c9ef1bf5f7755ac7e2e4b159cc4920dc391b5bd",
|
|
20
20
|
"mode": "100644"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"path": "docs/funnelsgrove/migrations/step-contract-v3.md",
|
|
79
|
-
"sha256": "
|
|
79
|
+
"sha256": "502d91c2c9ca9a3b41b3b46b3e965a5651ec14bde6a5ff4e617df62e873b835b",
|
|
80
80
|
"mode": "100644"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
208
|
"path": "funnel-docs.config.json",
|
|
209
|
-
"sha256": "
|
|
209
|
+
"sha256": "cbcba371bd3082cd467a40a6dfb11c181ab0a77caaafc6b28d4512ae8fb6770b",
|
|
210
210
|
"mode": "100644"
|
|
211
211
|
},
|
|
212
212
|
{
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
218
|
"path": "funnel.runtime-capabilities.json",
|
|
219
|
-
"sha256": "
|
|
219
|
+
"sha256": "190b64b86782bb5e9cfed0ef66688ef14310182f8a8a64e58bc08aef76f19bf8",
|
|
220
220
|
"mode": "100644"
|
|
221
221
|
},
|
|
222
222
|
{
|
|
@@ -531,7 +531,7 @@
|
|
|
531
531
|
},
|
|
532
532
|
{
|
|
533
533
|
"path": "src/steps/step-32-paywall.tsx",
|
|
534
|
-
"sha256": "
|
|
534
|
+
"sha256": "234af980716f9092ccf1557ca04ad2ec53c35f7b1fbde67329b4e562f552ab5b",
|
|
535
535
|
"mode": "100644"
|
|
536
536
|
},
|
|
537
537
|
{
|
|
@@ -17,7 +17,7 @@ Supported read versions: `1`, `2`, `3`. Authoring and publish target version `3`
|
|
|
17
17
|
|
|
18
18
|
### Package release order
|
|
19
19
|
|
|
20
|
-
Release `@funnelsgrove/sdk` `0.5.0` first, then `@funnelsgrove/runtime` `0.49.0`, then `@funnelsgrove/analytics` `0.32.0`, then `@funnelsgrove/payments` `0.
|
|
20
|
+
Release `@funnelsgrove/sdk` `0.5.0` first, then `@funnelsgrove/runtime` `0.49.0`, then `@funnelsgrove/analytics` `0.32.0`, then `@funnelsgrove/payments` `0.80.0`. The production deploy verifies the zero-traffic API candidate, publishes and verifies `@funnelsgrove/cli` `0.1.398`, and only then promotes the candidate to production traffic. The serving API must never advertise an unpublished preferred CLI. Publishing packages and deploying production remain separately approved operational actions.
|
|
21
21
|
<!-- funnelsgrove:generated:end contract-v3/migration/step-contract-v3 -->
|
|
22
22
|
|
|
23
23
|
## Version-last policy
|
|
@@ -36,6 +36,9 @@ import {
|
|
|
36
36
|
PayPalCheckout,
|
|
37
37
|
PayPalCheckoutDialog,
|
|
38
38
|
readPendingPayPalCheckout,
|
|
39
|
+
PaddleCheckout,
|
|
40
|
+
PaddleCheckoutDialog,
|
|
41
|
+
readPendingPaddleCheckout,
|
|
39
42
|
SharedStripeCheckoutV2Dialog,
|
|
40
43
|
StripeSubscriptionWalletSurface,
|
|
41
44
|
activateSecondPaywallDiscount,
|
|
@@ -182,7 +185,7 @@ function StepPaywallRuntime({
|
|
|
182
185
|
activeBillingRuntime.sourceVersionId,
|
|
183
186
|
]);
|
|
184
187
|
const activeBillingDiscounts = useMemo(
|
|
185
|
-
() => activeBillingRuntime.provider === 'paypal' ? inactiveBillingDiscounts : activeBillingRuntime.discounts ?? (
|
|
188
|
+
() => activeBillingRuntime.provider === 'paypal' || activeBillingRuntime.provider === 'paddle' ? inactiveBillingDiscounts : activeBillingRuntime.discounts ?? (
|
|
186
189
|
activeBillingRuntime.provider === 'stripe'
|
|
187
190
|
? buildBillingDiscountCatalog(billingDiscountList)
|
|
188
191
|
: inactiveBillingDiscounts
|
|
@@ -225,11 +228,17 @@ function StepPaywallRuntime({
|
|
|
225
228
|
);
|
|
226
229
|
const pendingPayPal = readPendingPayPalCheckout({ environment: checkoutMode, funnelEndUserId: user.id, runtimeConfig: activeCheckoutRuntimeConfig });
|
|
227
230
|
const hasPendingPayPal = Boolean(pendingPayPal);
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
// A paid Paddle checkout awaiting server confirmation keeps its plan, like a pending PayPal approval.
|
|
232
|
+
const pendingPaddle = readPendingPaddleCheckout({ environment: checkoutMode, funnelEndUserId: user.id, runtimeConfig: activeCheckoutRuntimeConfig });
|
|
233
|
+
const hasPendingPaddle = Boolean(pendingPaddle);
|
|
234
|
+
const pendingPlanKey = pendingPayPal?.funnelPlanKey || pendingPaddle?.funnelPlanKey;
|
|
235
|
+
const selectedPlanId = pendingPlanKey
|
|
236
|
+
? availablePlans.find(plan => plan.funnelPlanKey === pendingPlanKey)?.id ?? null
|
|
230
237
|
: requestedPlanId;
|
|
231
|
-
const [checkoutDialogOpen, setCheckoutDialogOpen] = useState(Boolean(
|
|
238
|
+
const [checkoutDialogOpen, setCheckoutDialogOpen] = useState(Boolean(pendingPlanKey));
|
|
232
239
|
const [paypalPending, setPayPalPending] = useState(false);
|
|
240
|
+
const [paddlePending, setPaddlePending] = useState(false);
|
|
241
|
+
const nativeCheckoutPending = hasPendingPayPal || paypalPending || hasPendingPaddle || paddlePending;
|
|
233
242
|
const [solidgateAttemptKey, setSolidgateAttemptKey] = useState<string | null>(null);
|
|
234
243
|
const [specialOfferDialogOpen, setSpecialOfferDialogOpen] = useState(() => {
|
|
235
244
|
if (typeof window === 'undefined') {
|
|
@@ -297,6 +306,8 @@ function StepPaywallRuntime({
|
|
|
297
306
|
selectedDisplayPlan?.checkoutSummaryLabel?.trim() || selectedDisplayPlan?.title || content.selectedPlanLabel;
|
|
298
307
|
const checkoutProvider = activeBillingRuntime.provider;
|
|
299
308
|
const paypalOption = pendingPayPal?.option || (selectedPlan?.funnelPlanKey ? activeBillingRuntime.paypalOptionsByPlanKey?.[selectedPlan.funnelPlanKey] : null);
|
|
309
|
+
// Paddle is the only checkout of a Paddle-owned Offer Set, never an alternative next to Stripe.
|
|
310
|
+
const paddleOption = pendingPaddle?.option || (checkoutProvider === 'paddle' && selectedPlan?.funnelPlanKey ? activeBillingRuntime.paddleOptionsByPlanKey?.[selectedPlan.funnelPlanKey] : null);
|
|
300
311
|
const storyOptions = useMemo<readonly StoryOption[]>(
|
|
301
312
|
() =>
|
|
302
313
|
content.stories.items.map((item, index) => ({
|
|
@@ -493,10 +504,11 @@ function StepPaywallRuntime({
|
|
|
493
504
|
&& activeBillingRuntime.offerSetId.trim()
|
|
494
505
|
&& selectedPlan?.funnelPlanKey?.trim(),
|
|
495
506
|
);
|
|
496
|
-
const checkoutDisabled =
|
|
507
|
+
const checkoutDisabled = nativeCheckoutPending || !checkoutSelectionReady || !userBootstrapped || !selectedPlan || !selectedDisplayPlan || (
|
|
497
508
|
checkoutProvider === 'solidgate'
|
|
498
509
|
? !solidgateCheckoutConfigured
|
|
499
|
-
: checkoutProvider === 'paypal' ? !paypalOption
|
|
510
|
+
: checkoutProvider === 'paypal' ? !paypalOption
|
|
511
|
+
: checkoutProvider === 'paddle' ? !paddleOption : !checkoutSession.configured
|
|
500
512
|
);
|
|
501
513
|
const checkoutDialogReady =
|
|
502
514
|
checkoutProvider === 'stripe' &&
|
|
@@ -554,10 +566,10 @@ function StepPaywallRuntime({
|
|
|
554
566
|
}, [user.email]);
|
|
555
567
|
|
|
556
568
|
useEffect(() => {
|
|
557
|
-
setCheckoutDialogOpen(hasPendingPayPal);
|
|
569
|
+
setCheckoutDialogOpen(hasPendingPayPal || hasPendingPaddle);
|
|
558
570
|
setSolidgateAttemptKey(null);
|
|
559
571
|
setError(null);
|
|
560
|
-
}, [selectedPlanId, hasPendingPayPal]);
|
|
572
|
+
}, [selectedPlanId, hasPendingPayPal, hasPendingPaddle]);
|
|
561
573
|
|
|
562
574
|
useEffect(() => {
|
|
563
575
|
if (
|
|
@@ -648,7 +660,7 @@ function StepPaywallRuntime({
|
|
|
648
660
|
paywallWalletMethodWrapperClassNames[method];
|
|
649
661
|
|
|
650
662
|
const startCheckout = async () => {
|
|
651
|
-
if (
|
|
663
|
+
if (nativeCheckoutPending) { setCheckoutDialogOpen(true); return; }
|
|
652
664
|
if (checkoutDisabled) {
|
|
653
665
|
return;
|
|
654
666
|
}
|
|
@@ -660,6 +672,13 @@ function StepPaywallRuntime({
|
|
|
660
672
|
|
|
661
673
|
if (checkoutProvider === 'paypal') { setCheckoutDialogOpen(true); return; }
|
|
662
674
|
|
|
675
|
+
if (checkoutProvider === 'paddle') {
|
|
676
|
+
// Mounting the checkout prepares the attempt, so the published snapshot is pinned first.
|
|
677
|
+
billingSelection.pin();
|
|
678
|
+
setCheckoutDialogOpen(true);
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
|
|
663
682
|
if (checkoutProvider === 'solidgate') {
|
|
664
683
|
setSolidgateAttemptKey(crypto.randomUUID());
|
|
665
684
|
setCheckoutDialogOpen(true);
|
|
@@ -702,7 +721,7 @@ function StepPaywallRuntime({
|
|
|
702
721
|
};
|
|
703
722
|
|
|
704
723
|
const openCardCheckoutFromUnavailableWallet = async () => {
|
|
705
|
-
if (
|
|
724
|
+
if (nativeCheckoutPending) { setCheckoutDialogOpen(true); return; }
|
|
706
725
|
if (checkoutDisabled) {
|
|
707
726
|
return;
|
|
708
727
|
}
|
|
@@ -794,6 +813,31 @@ function StepPaywallRuntime({
|
|
|
794
813
|
/>
|
|
795
814
|
) : undefined;
|
|
796
815
|
|
|
816
|
+
const closePaddleCheckout = () => {
|
|
817
|
+
if (!paddlePending && !pendingPaddle) billingSelection.reset();
|
|
818
|
+
setCheckoutDialogOpen(false);
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
const paddleCheckout = (checkoutSelectionReady || pendingPaddle) && userBootstrapped && paddleOption && (selectedPlan?.funnelPlanKey || pendingPaddle) ? (
|
|
822
|
+
<PaddleCheckout
|
|
823
|
+
key={`${paddleOption.paymentProfileId}:${paddleOption.providerPlanId}:${checkoutMode}:${pendingPaddle?.funnelPlanKey || selectedPlan?.funnelPlanKey}`}
|
|
824
|
+
option={paddleOption}
|
|
825
|
+
environment={checkoutMode}
|
|
826
|
+
funnelEndUserId={user.id}
|
|
827
|
+
offerSetId={pendingPaddle?.offerSetId || activeBillingRuntime.offerSetId}
|
|
828
|
+
funnelPlanKey={pendingPaddle?.funnelPlanKey || selectedPlan?.funnelPlanKey || ''}
|
|
829
|
+
checkoutType={selectedPlan && !selectedPlan.billingInterval ? 'one_time' : 'subscription'}
|
|
830
|
+
runtimeConfig={activeCheckoutRuntimeConfig}
|
|
831
|
+
customerEmail={checkoutEmail || user.email}
|
|
832
|
+
onPendingChange={setPaddlePending}
|
|
833
|
+
onClose={closePaddleCheckout}
|
|
834
|
+
onSuccess={() => {
|
|
835
|
+
completeStep(analyticsStepId, { planId: selectedDisplayPlan?.id ?? pendingPaddle?.funnelPlanKey });
|
|
836
|
+
goNext();
|
|
837
|
+
}}
|
|
838
|
+
/>
|
|
839
|
+
) : undefined;
|
|
840
|
+
|
|
797
841
|
const closeCheckoutDialog = () => {
|
|
798
842
|
if (checkoutProvider === 'stripe') checkoutSession.reset();
|
|
799
843
|
else billingSelection.reset();
|
|
@@ -948,6 +992,11 @@ function StepPaywallRuntime({
|
|
|
948
992
|
onClose={() => setCheckoutDialogOpen(false)}>{paypalCheckout}</PayPalCheckoutDialog>
|
|
949
993
|
) : null}
|
|
950
994
|
|
|
995
|
+
{checkoutDialogOpen && paddleCheckout ? (
|
|
996
|
+
<PaddleCheckoutDialog title={content.checkout.title} closeAriaLabel={content.checkout.closeAriaLabel}
|
|
997
|
+
onClose={closePaddleCheckout}>{paddleCheckout}</PaddleCheckoutDialog>
|
|
998
|
+
) : null}
|
|
999
|
+
|
|
951
1000
|
{checkoutDialogOpen &&
|
|
952
1001
|
checkoutProvider === 'stripe' &&
|
|
953
1002
|
checkoutSession.activeClientSecret &&
|
|
@@ -1005,7 +1054,7 @@ function StepPaywallRuntime({
|
|
|
1005
1054
|
/>
|
|
1006
1055
|
) : null}
|
|
1007
1056
|
|
|
1008
|
-
{specialOfferDialogOpen ? (
|
|
1057
|
+
{specialOfferDialogOpen && checkoutProvider !== 'paddle' ? (
|
|
1009
1058
|
<SharedCheckoutSpecialOfferDialog
|
|
1010
1059
|
buttonColor='var(--color-secondary-text)'
|
|
1011
1060
|
buttonLabel={content.checkout.specialOffer.buttonLabel}
|
|
@@ -1147,7 +1196,7 @@ function StepPaywallRuntime({
|
|
|
1147
1196
|
]
|
|
1148
1197
|
.filter(Boolean)
|
|
1149
1198
|
.join(' ')}
|
|
1150
|
-
disabled={
|
|
1199
|
+
disabled={nativeCheckoutPending}
|
|
1151
1200
|
onClick={() => setSelectedPlanId(plan.id)}
|
|
1152
1201
|
>
|
|
1153
1202
|
{plan.featuredTag ? <span className='paywall-v2-plan-tag'>{plan.featuredTag}</span> : null}
|
|
@@ -1218,11 +1267,11 @@ function StepPaywallRuntime({
|
|
|
1218
1267
|
type='button'
|
|
1219
1268
|
className='paywall-v2-card-button paywall-v2-vibe-cta'
|
|
1220
1269
|
onClick={() => void startCheckout()}
|
|
1221
|
-
disabled={checkoutDisabled && !
|
|
1270
|
+
disabled={checkoutDisabled && !nativeCheckoutPending}
|
|
1222
1271
|
>
|
|
1223
1272
|
{content.plans.cardButtonLabel}
|
|
1224
1273
|
</button>
|
|
1225
|
-
{checkoutProvider !== 'paypal' && !pendingPayPal ? (
|
|
1274
|
+
{checkoutProvider !== 'paypal' && checkoutProvider !== 'paddle' && !pendingPayPal && !pendingPaddle ? (
|
|
1226
1275
|
<div aria-label='Card and wallet billing terms'>
|
|
1227
1276
|
{paypalOption ? <p className='paywall-v2-alt-meta'>Card and wallet terms</p> : null}
|
|
1228
1277
|
<PaywallRenewalDisclaimer plan={selectedPlan} hasActiveDiscount={Boolean(activeCouponId)} copy={content.checkout} catalogLabels={content.catalogLabels} />
|