@funnelsgrove/cli 0.1.14 → 0.1.18
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/contracts/step-contract-v2.json +733 -0
- package/dist/analyticsOutput.d.ts +30 -15
- package/dist/analyticsOutput.js +45 -28
- package/dist/apiClient.d.ts +85 -0
- package/dist/apiClient.js +225 -8
- package/dist/cli.d.ts +149 -1
- package/dist/cli.js +1232 -71
- package/dist/diagnosticOutput.d.ts +42 -0
- package/dist/diagnosticOutput.js +83 -0
- package/dist/docsOutput.d.ts +19 -0
- package/dist/docsOutput.js +73 -0
- package/dist/docsTransaction.d.ts +81 -0
- package/dist/docsTransaction.js +1755 -0
- package/dist/funnelValidation.d.ts +14 -0
- package/dist/funnelValidation.js +297 -0
- package/dist/localSync.d.ts +79 -0
- package/dist/localSync.js +428 -53
- package/dist/projectValidator.d.ts +27 -0
- package/dist/projectValidator.js +208 -0
- package/dist/reskin.js +27 -1
- package/dist/stepContractMigration.d.ts +71 -0
- package/dist/stepContractMigration.js +1323 -0
- package/dist/templateDocs.js +8 -25
- package/docs-release-history.json +66 -0
- package/legacy-docs-catalog.json +1012 -0
- package/package.json +13 -4
- package/template_docs/.funnelsgrove-docs.json +144 -0
- package/template_docs/AGENTS.md +30 -58
- package/template_docs/CLAUDE.md +0 -2
- package/template_docs/docs/funnelsgrove/START-HERE.md +73 -0
- package/template_docs/docs/funnelsgrove/contracts/analytics-events.md +59 -0
- package/template_docs/docs/funnelsgrove/contracts/content-answers.md +44 -0
- package/template_docs/docs/funnelsgrove/contracts/flow-routing.md +41 -0
- package/template_docs/docs/funnelsgrove/contracts/payments.md +42 -0
- package/template_docs/docs/funnelsgrove/contracts/step-metadata.md +57 -0
- package/template_docs/docs/funnelsgrove/migrations/step-contract-v3.md +39 -0
- package/template_docs/docs/funnelsgrove/qa/analytics.md +43 -0
- package/template_docs/docs/funnelsgrove/qa/local.md +42 -0
- package/template_docs/docs/funnelsgrove/qa/paywall-checkout.md +55 -0
- package/template_docs/docs/funnelsgrove/qa/publish.md +32 -0
- package/template_docs/docs/funnelsgrove/recipes/add-experiment.md +34 -0
- package/template_docs/docs/funnelsgrove/recipes/add-step.md +33 -0
- package/template_docs/docs/funnelsgrove/recipes/edit-step.md +31 -0
- package/template_docs/docs/funnelsgrove/steps/INDEX.md +26 -0
- package/template_docs/docs/funnelsgrove/steps/cancellation_offer.md +112 -0
- package/template_docs/docs/funnelsgrove/steps/checkout.md +120 -0
- package/template_docs/docs/funnelsgrove/steps/form_input.md +115 -0
- package/template_docs/docs/funnelsgrove/steps/intro_hero.md +110 -0
- package/template_docs/docs/funnelsgrove/steps/multi_select_choice.md +123 -0
- package/template_docs/docs/funnelsgrove/steps/paywall_offer.md +115 -0
- package/template_docs/docs/funnelsgrove/steps/progress_interstitial.md +111 -0
- package/template_docs/docs/funnelsgrove/steps/purchase_completed.md +117 -0
- package/template_docs/docs/funnelsgrove/steps/single_step_choice.md +122 -0
- package/template_docs/docs/funnelsgrove/steps/single_step_choice_emoji.md +122 -0
- package/template_docs/docs/funnelsgrove/steps/social_proof.md +110 -0
- package/template_docs/docs/funnelsgrove/steps/subscription_handoff.md +113 -0
- package/template_docs/docs/funnelsgrove/steps/subscription_management.md +112 -0
- package/template_docs/docs/funnelsgrove/steps/summary_confirmation.md +110 -0
- package/template_docs/docs/funnelsgrove/steps/upsell_offer.md +112 -0
- package/template_docs/docs/funnelsgrove/steps/value_prop_story.md +110 -0
- package/template_docs/funnel-docs.config.json +43 -0
- package/template_scaffold/.env.example +41 -0
- package/template_scaffold/.funnelsgrove-contract-tools.json +19 -0
- package/template_scaffold/.funnelsgrove-docs.json +144 -0
- package/template_scaffold/.funnelsgrove-scaffold.json +1078 -0
- package/template_scaffold/AGENTS.md +42 -0
- package/template_scaffold/CLAUDE.md +1 -0
- package/template_scaffold/PLAN.md +81 -0
- package/template_scaffold/PRODUCT_SENSE.md +28 -0
- package/template_scaffold/context/build-context.md +34 -0
- package/template_scaffold/docs/AGENT_FUNNEL_IMPLEMENTATION_SPEC.md +5 -0
- package/template_scaffold/docs/ARCHITECTURE.md +5 -0
- package/template_scaffold/docs/FLOW_CONFIG_AND_ROUTING.md +5 -0
- package/template_scaffold/docs/PAYWALL_AND_PAYMENTS.md +5 -0
- package/template_scaffold/docs/README.md +5 -0
- package/template_scaffold/docs/funnelsgrove/START-HERE.md +73 -0
- package/template_scaffold/docs/funnelsgrove/contracts/analytics-events.md +59 -0
- package/template_scaffold/docs/funnelsgrove/contracts/content-answers.md +44 -0
- package/template_scaffold/docs/funnelsgrove/contracts/flow-routing.md +41 -0
- package/template_scaffold/docs/funnelsgrove/contracts/payments.md +42 -0
- package/template_scaffold/docs/funnelsgrove/contracts/step-metadata.md +57 -0
- package/template_scaffold/docs/funnelsgrove/migrations/step-contract-v3.md +39 -0
- package/template_scaffold/docs/funnelsgrove/qa/analytics.md +43 -0
- package/template_scaffold/docs/funnelsgrove/qa/local.md +42 -0
- package/template_scaffold/docs/funnelsgrove/qa/paywall-checkout.md +55 -0
- package/template_scaffold/docs/funnelsgrove/qa/publish.md +32 -0
- package/template_scaffold/docs/funnelsgrove/recipes/add-experiment.md +34 -0
- package/template_scaffold/docs/funnelsgrove/recipes/add-step.md +33 -0
- package/template_scaffold/docs/funnelsgrove/recipes/edit-step.md +31 -0
- package/template_scaffold/docs/funnelsgrove/steps/INDEX.md +26 -0
- package/template_scaffold/docs/funnelsgrove/steps/cancellation_offer.md +112 -0
- package/template_scaffold/docs/funnelsgrove/steps/checkout.md +120 -0
- package/template_scaffold/docs/funnelsgrove/steps/form_input.md +115 -0
- package/template_scaffold/docs/funnelsgrove/steps/intro_hero.md +110 -0
- package/template_scaffold/docs/funnelsgrove/steps/multi_select_choice.md +123 -0
- package/template_scaffold/docs/funnelsgrove/steps/paywall_offer.md +115 -0
- package/template_scaffold/docs/funnelsgrove/steps/progress_interstitial.md +111 -0
- package/template_scaffold/docs/funnelsgrove/steps/purchase_completed.md +117 -0
- package/template_scaffold/docs/funnelsgrove/steps/single_step_choice.md +122 -0
- package/template_scaffold/docs/funnelsgrove/steps/single_step_choice_emoji.md +122 -0
- package/template_scaffold/docs/funnelsgrove/steps/social_proof.md +110 -0
- package/template_scaffold/docs/funnelsgrove/steps/subscription_handoff.md +113 -0
- package/template_scaffold/docs/funnelsgrove/steps/subscription_management.md +112 -0
- package/template_scaffold/docs/funnelsgrove/steps/summary_confirmation.md +110 -0
- package/template_scaffold/docs/funnelsgrove/steps/upsell_offer.md +112 -0
- package/template_scaffold/docs/funnelsgrove/steps/value_prop_story.md +110 -0
- package/template_scaffold/docs/references/funnel-sdk-user-answers.md +5 -0
- package/template_scaffold/eslint.config.mjs +16 -0
- package/template_scaffold/funnel-agent-docs.test.ts +699 -0
- package/template_scaffold/funnel-docs.config.json +43 -0
- package/template_scaffold/funnel.config.json +5 -0
- package/template_scaffold/gitignore.template +5 -0
- package/template_scaffold/next-env.d.ts +6 -0
- package/template_scaffold/next.config.ts +53 -0
- package/template_scaffold/package-lock.json +7737 -0
- package/template_scaffold/package.json +37 -0
- package/template_scaffold/package.test.ts +23 -0
- package/template_scaffold/public/claimbee/bee.png +0 -0
- package/template_scaffold/public/claimbee/device-iphone.png +0 -0
- package/template_scaffold/public/claimbee/device-macbook.png +0 -0
- package/template_scaffold/public/claimbee/device-none.png +0 -0
- package/template_scaffold/public/claimbee/device-watch.png +0 -0
- package/template_scaffold/public/claimbee/glow.svg +3 -0
- package/template_scaffold/public/claimbee/steps-sprite-alt.png +0 -0
- package/template_scaffold/public/claimbee/steps-sprite-default.png +0 -0
- package/template_scaffold/public/claimbee/testimonial-avatar.png +0 -0
- package/template_scaffold/public/claimbee/testimonial-star.svg +3 -0
- package/template_scaffold/public/paywall/ai-claim-assistant.png +0 -0
- package/template_scaffold/public/paywall/claim-history.png +0 -0
- package/template_scaffold/public/paywall/clear-progress.png +0 -0
- package/template_scaffold/public/paywall/hero.png +0 -0
- package/template_scaffold/public/paywall/money-alerts.png +0 -0
- package/template_scaffold/public/paywall/money-back-badge.png +0 -0
- package/template_scaffold/public/paywall/paywall-image.png +0 -0
- package/template_scaffold/public/paywall/r1.png +0 -0
- package/template_scaffold/public/paywall/r2.png +0 -0
- package/template_scaffold/public/paywall/r3.png +0 -0
- package/template_scaffold/public/paywall/r4.png +0 -0
- package/template_scaffold/public/paywall/r5.png +0 -0
- package/template_scaffold/public/paywall/r6.png +0 -0
- package/template_scaffold/public/paywall/special-offer-gift.png +0 -0
- package/template_scaffold/public/please/bee.png +0 -0
- package/template_scaffold/public/please/device-iphone.png +0 -0
- package/template_scaffold/public/please/device-macbook.png +0 -0
- package/template_scaffold/public/please/device-none.png +0 -0
- package/template_scaffold/public/please/device-watch.png +0 -0
- package/template_scaffold/public/please/glow.svg +3 -0
- package/template_scaffold/public/please/steps-sprite-alt.png +0 -0
- package/template_scaffold/public/please/steps-sprite-default.png +0 -0
- package/template_scaffold/public/please/testimonial-avatar.png +0 -0
- package/template_scaffold/public/please/testimonial-star.svg +3 -0
- package/template_scaffold/public/upsell/upgrade-hero.png +0 -0
- package/template_scaffold/src/app/[stepId]/page.test.tsx +59 -0
- package/template_scaffold/src/app/[stepId]/page.tsx +62 -0
- package/template_scaffold/src/app/globals.css +49 -0
- package/template_scaffold/src/app/layout.test.ts +26 -0
- package/template_scaffold/src/app/layout.tsx +61 -0
- package/template_scaffold/src/app/page.tsx +8 -0
- package/template_scaffold/src/app/sdk/page.tsx +673 -0
- package/template_scaffold/src/app/subscription-dashboard/page.tsx +274 -0
- package/template_scaffold/src/assets/claimbee/bee.png +0 -0
- package/template_scaffold/src/assets/claimbee/device-iphone.png +0 -0
- package/template_scaffold/src/assets/claimbee/device-macbook.png +0 -0
- package/template_scaffold/src/assets/claimbee/device-none.png +0 -0
- package/template_scaffold/src/assets/claimbee/device-watch.png +0 -0
- package/template_scaffold/src/assets/claimbee/glow.svg +3 -0
- package/template_scaffold/src/assets/claimbee/steps-sprite-alt.png +0 -0
- package/template_scaffold/src/assets/claimbee/steps-sprite-default.png +0 -0
- package/template_scaffold/src/assets/claimbee/testimonial-avatar.png +0 -0
- package/template_scaffold/src/assets/claimbee/testimonial-star.svg +3 -0
- package/template_scaffold/src/components/FunnelEditorPanel.tsx +194 -0
- package/template_scaffold/src/components/FunnelFlow.test.tsx +17 -0
- package/template_scaffold/src/components/FunnelFlow.tsx +114 -0
- package/template_scaffold/src/components/FunnelStepImage.test.ts +15 -0
- package/template_scaffold/src/components/FunnelStepImage.tsx +28 -0
- package/template_scaffold/src/components/step/FunnelStepHeader.tsx +35 -0
- package/template_scaffold/src/config/billing.plans.test.ts +143 -0
- package/template_scaffold/src/config/billing.plans.ts +69 -0
- package/template_scaffold/src/config/billing.test.plans.ts +32 -0
- package/template_scaffold/src/config/experiments.generated.ts +4 -0
- package/template_scaffold/src/config/experiments.test.ts +12 -0
- package/template_scaffold/src/config/experiments.ts +9 -0
- package/template_scaffold/src/config/funnel.config.ts +12 -0
- package/template_scaffold/src/config/funnel.manifest.test.ts +166 -0
- package/template_scaffold/src/config/funnel.manifest.ts +139 -0
- package/template_scaffold/src/config/offer-sets.generated.ts +4 -0
- package/template_scaffold/src/contract/funnel-project.validation.test.ts +80 -0
- package/template_scaffold/src/contract/funnel-project.validation.ts +44 -0
- package/template_scaffold/src/contract/funnel-validator.vite.config.ts +11 -0
- package/template_scaffold/src/contract/golden/cancellation_offer.fixture.ts +29 -0
- package/template_scaffold/src/contract/golden/checkout.fixture.ts +37 -0
- package/template_scaffold/src/contract/golden/form_input.fixture.ts +28 -0
- package/template_scaffold/src/contract/golden/golden-fixtures.test.ts +190 -0
- package/template_scaffold/src/contract/golden/intro_hero.fixture.ts +27 -0
- package/template_scaffold/src/contract/golden/multi_select_choice.fixture.ts +37 -0
- package/template_scaffold/src/contract/golden/paywall_offer.fixture.ts +30 -0
- package/template_scaffold/src/contract/golden/progress_interstitial.fixture.ts +28 -0
- package/template_scaffold/src/contract/golden/purchase_completed.fixture.ts +33 -0
- package/template_scaffold/src/contract/golden/single_step_choice.fixture.ts +36 -0
- package/template_scaffold/src/contract/golden/single_step_choice_emoji.fixture.ts +36 -0
- package/template_scaffold/src/contract/golden/social_proof.fixture.ts +27 -0
- package/template_scaffold/src/contract/golden/subscription_handoff.fixture.ts +30 -0
- package/template_scaffold/src/contract/golden/subscription_management.fixture.ts +29 -0
- package/template_scaffold/src/contract/golden/summary_confirmation.fixture.ts +27 -0
- package/template_scaffold/src/contract/golden/upsell_offer.fixture.ts +29 -0
- package/template_scaffold/src/contract/golden/value_prop_story.fixture.ts +27 -0
- package/template_scaffold/src/contract/validate-funnel.cli.test.ts +180 -0
- package/template_scaffold/src/contract/validate-funnel.cli.ts +199 -0
- package/template_scaffold/src/runtime/checkout-runtime-config.test.ts +60 -0
- package/template_scaffold/src/runtime/checkout-runtime-config.ts +26 -0
- package/template_scaffold/src/runtime/funnel-runtime.test.ts +25 -0
- package/template_scaffold/src/runtime/funnel-runtime.ts +118 -0
- package/template_scaffold/src/runtime/step-content-context.test.ts +38 -0
- package/template_scaffold/src/runtime/step-content-context.ts +65 -0
- package/template_scaffold/src/runtime/step-registry.ts +66 -0
- package/template_scaffold/src/runtime/step-variable-values.ts +31 -0
- package/template_scaffold/src/runtime/use-funnel-flow-controller.integration.test.ts +203 -0
- package/template_scaffold/src/runtime/use-funnel-flow-controller.test.ts +76 -0
- package/template_scaffold/src/runtime/use-funnel-flow-controller.ts +53 -0
- package/template_scaffold/src/steps/content/email-capture.content.ts +29 -0
- package/template_scaffold/src/steps/content/manage-subscription.content.ts +62 -0
- package/template_scaffold/src/steps/content/paywall.content.ts +191 -0
- package/template_scaffold/src/steps/content/step-01.content.ts +23 -0
- package/template_scaffold/src/steps/content/step-02.content.ts +77 -0
- package/template_scaffold/src/steps/content/step-03.content.ts +40 -0
- package/template_scaffold/src/steps/content/step-04.content.ts +49 -0
- package/template_scaffold/src/steps/content/step-32-paywall.content.ts +352 -0
- package/template_scaffold/src/steps/content/subscription-started.content.ts +68 -0
- package/template_scaffold/src/steps/editor/email-capture.editor.ts +58 -0
- package/template_scaffold/src/steps/editor/manage-subscription.editor.ts +179 -0
- package/template_scaffold/src/steps/editor/paywall.editor.ts +232 -0
- package/template_scaffold/src/steps/editor/step-01.editor.ts +22 -0
- package/template_scaffold/src/steps/editor/step-02.editor.ts +41 -0
- package/template_scaffold/src/steps/editor/step-03.editor.ts +58 -0
- package/template_scaffold/src/steps/editor/step-04.editor.ts +98 -0
- package/template_scaffold/src/steps/editor/step-32-paywall.editor.ts +478 -0
- package/template_scaffold/src/steps/editor/subscription-started.editor.ts +131 -0
- package/template_scaffold/src/steps/index.ts +25 -0
- package/template_scaffold/src/steps/paywall-checkout-options.test.ts +104 -0
- package/template_scaffold/src/steps/paywall-checkout-options.ts +130 -0
- package/template_scaffold/src/steps/pricing/paywall-b.pricing.ts +12 -0
- package/template_scaffold/src/steps/pricing/paywall.pricing.ts +12 -0
- package/template_scaffold/src/steps/pricing/shared-plan-order.ts +17 -0
- package/template_scaffold/src/steps/pricing/upsell-form.pricing.ts +16 -0
- package/template_scaffold/src/steps/shared-header-contract.test.ts +27 -0
- package/template_scaffold/src/steps/step-01.test.ts +38 -0
- package/template_scaffold/src/steps/step-01.tsx +108 -0
- package/template_scaffold/src/steps/step-02.test.ts +43 -0
- package/template_scaffold/src/steps/step-02.tsx +140 -0
- package/template_scaffold/src/steps/step-03.test.ts +15 -0
- package/template_scaffold/src/steps/step-03.tsx +262 -0
- package/template_scaffold/src/steps/step-04.test.ts +32 -0
- package/template_scaffold/src/steps/step-04.tsx +673 -0
- package/template_scaffold/src/steps/step-31-email-capture.test.ts +22 -0
- package/template_scaffold/src/steps/step-31-email-capture.tsx +195 -0
- package/template_scaffold/src/steps/step-32-paywall.test.ts +770 -0
- package/template_scaffold/src/steps/step-32-paywall.tsx +2253 -0
- package/template_scaffold/src/steps/step-32b-paywall-b.tsx +35 -0
- package/template_scaffold/src/steps/step-33-subscription-started.test.ts +26 -0
- package/template_scaffold/src/steps/step-33-subscription-started.tsx +86 -0
- package/template_scaffold/src/steps/step-34-upsell-form.test.ts +27 -0
- package/template_scaffold/src/steps/step-35-manage-subscription.tsx +46 -0
- package/template_scaffold/src/steps/step-content.registry.ts +45 -0
- package/template_scaffold/src/steps/step-image-migration.test.ts +20 -0
- package/template_scaffold/src/steps/styles/index.css +2 -0
- package/template_scaffold/src/steps/styles/shared/final-flow-shared.css +55 -0
- package/template_scaffold/src/steps/styles/shared/funnel-base.css +543 -0
- package/template_scaffold/src/steps/styles/shared/info-shared.css +139 -0
- package/template_scaffold/src/steps/styles/shared/progress-shared.css +117 -0
- package/template_scaffold/src/steps/styles/shared/question-shared.css +76 -0
- package/template_scaffold/src/steps/styles/shared/responsive-container.css +176 -0
- package/template_scaffold/src/steps/types.ts +7 -0
- package/template_scaffold/src/steps/use-claimbee-step-content.ts +15 -0
- package/template_scaffold/src/theme/theme.ts +81 -0
- package/template_scaffold/tsconfig.json +38 -0
- package/template_scaffold/vitest.config.ts +32 -0
- package/template_validation/.funnelsgrove-contract-tools.json +19 -0
- package/template_validation/src/contract/funnel-project.validation.ts +44 -0
- package/template_validation/src/contract/funnel-validator.vite.config.ts +11 -0
- package/template_validation/src/contract/validate-funnel.cli.ts +199 -0
- package/template_docs/docs/ab-experiments.md +0 -55
- package/template_docs/docs/analytics.md +0 -65
- package/template_docs/docs/editing-flow.md +0 -125
- package/template_docs/docs/editing-step.md +0 -125
- package/template_docs/docs/editor-and-content.md +0 -58
- package/template_docs/docs/funnel-runtime-architecture.md +0 -125
- package/template_docs/docs/meta-pixel-conversions-api.md +0 -50
- package/template_docs/docs/payment-plans-and-discounts.md +0 -106
- package/template_docs/docs/publishing-and-versioning.md +0 -117
- package/template_docs/docs/qa-checklist.md +0 -80
- package/template_docs/docs/sdk-api-endpoints.md +0 -78
- package/template_docs/docs/step-ui-guidelines.md +0 -110
- package/template_docs/docs/theme.md +0 -35
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "funnel-template",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev --webpack",
|
|
7
|
+
"dev:turbo": "next dev",
|
|
8
|
+
"build": "next build",
|
|
9
|
+
"start": "next start",
|
|
10
|
+
"lint": "eslint .",
|
|
11
|
+
"test:run": "vitest run --passWithNoTests",
|
|
12
|
+
"validate:funnel": "vite-node --config src/contract/funnel-validator.vite.config.ts src/contract/validate-funnel.cli.ts"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@funnelsgrove/analytics": "^0.1.36",
|
|
16
|
+
"@funnelsgrove/payments": "^0.1.53",
|
|
17
|
+
"@funnelsgrove/runtime": "^0.1.59",
|
|
18
|
+
"@stripe/react-stripe-js": "^5.6.0",
|
|
19
|
+
"@stripe/stripe-js": "^8.7.0",
|
|
20
|
+
"lucide-react": "^0.553.0",
|
|
21
|
+
"next": "16.1.6",
|
|
22
|
+
"posthog-js": "^1.369.2",
|
|
23
|
+
"react": "19.2.3",
|
|
24
|
+
"react-dom": "19.2.3",
|
|
25
|
+
"stripe": "^20.3.1"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^20",
|
|
29
|
+
"@types/react": "^19",
|
|
30
|
+
"@types/react-dom": "^19",
|
|
31
|
+
"eslint": "^9",
|
|
32
|
+
"eslint-config-next": "16.1.6",
|
|
33
|
+
"typescript": "^5",
|
|
34
|
+
"vite-node": "3.2.4",
|
|
35
|
+
"vitest": "^3.2.4"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
|
|
4
|
+
type PackageJson = {
|
|
5
|
+
dependencies?: Record<string, string>;
|
|
6
|
+
version?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const readPackageJson = (url: URL): PackageJson =>
|
|
10
|
+
JSON.parse(readFileSync(url, 'utf8')) as PackageJson;
|
|
11
|
+
|
|
12
|
+
describe('funnel-template shared package dependencies', () => {
|
|
13
|
+
it('tracks the current shared runtime, analytics, and payments package versions', () => {
|
|
14
|
+
const templatePackage = readPackageJson(new URL('./package.json', import.meta.url));
|
|
15
|
+
const runtimePackage = readPackageJson(new URL('../funnel-runtime/package.json', import.meta.url));
|
|
16
|
+
const analyticsPackage = readPackageJson(new URL('../funnel-analytics/package.json', import.meta.url));
|
|
17
|
+
const paymentsPackage = readPackageJson(new URL('../funnel-payments/package.json', import.meta.url));
|
|
18
|
+
|
|
19
|
+
expect(templatePackage.dependencies?.['@funnelsgrove/runtime']).toBe(`^${runtimePackage.version}`);
|
|
20
|
+
expect(templatePackage.dependencies?.['@funnelsgrove/analytics']).toBe(`^${analyticsPackage.version}`);
|
|
21
|
+
expect(templatePackage.dependencies?.['@funnelsgrove/payments']).toBe(`^${paymentsPackage.version}`);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 116 109.5" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path id="Vector 11" d="M0 22.5L51 0H85L116 22.5V54.5V89L74.5 109.5L42 103L9 89L0 61.5V22.5Z" fill="var(--fill-0, #FEFDF5)"/>
|
|
3
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 16.1222 15.4039" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path id="Star 1" d="M7.37895 0.495601C7.59366 -0.165201 8.52852 -0.1652 8.74323 0.495602L10.1545 4.83902C10.2505 5.13454 10.5259 5.33462 10.8366 5.33462H15.4036C16.0984 5.33462 16.3873 6.22372 15.8251 6.63212L12.1304 9.3165C11.879 9.49914 11.7738 9.82288 11.8699 10.1184L13.2811 14.4618C13.4958 15.1226 12.7395 15.6721 12.1774 15.2637L8.48267 12.5793C8.23129 12.3967 7.89089 12.3967 7.63951 12.5793L3.94477 15.2637C3.38266 15.6721 2.62635 15.1226 2.84105 14.4618L4.25232 10.1184C4.34834 9.82288 4.24315 9.49914 3.99176 9.3165L0.297032 6.63212C-0.26508 6.22372 0.0238078 5.33462 0.718616 5.33462H5.28555C5.59628 5.33462 5.87167 5.13454 5.96769 4.83902L7.37895 0.495601Z" fill="var(--fill-0, #F28100)"/>
|
|
3
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 116 109.5" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path id="Vector 11" d="M0 22.5L51 0H85L116 22.5V54.5V89L74.5 109.5L42 103L9 89L0 61.5V22.5Z" fill="var(--fill-0, #FEFDF5)"/>
|
|
3
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg preserveAspectRatio="none" width="100%" height="100%" overflow="visible" style="display: block;" viewBox="0 0 16.1222 15.4039" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path id="Star 1" d="M7.37895 0.495601C7.59366 -0.165201 8.52852 -0.1652 8.74323 0.495602L10.1545 4.83902C10.2505 5.13454 10.5259 5.33462 10.8366 5.33462H15.4036C16.0984 5.33462 16.3873 6.22372 15.8251 6.63212L12.1304 9.3165C11.879 9.49914 11.7738 9.82288 11.8699 10.1184L13.2811 14.4618C13.4958 15.1226 12.7395 15.6721 12.1774 15.2637L8.48267 12.5793C8.23129 12.3967 7.89089 12.3967 7.63951 12.5793L3.94477 15.2637C3.38266 15.6721 2.62635 15.1226 2.84105 14.4618L4.25232 10.1184C4.34834 9.82288 4.24315 9.49914 3.99176 9.3165L0.297032 6.63212C-0.26508 6.22372 0.0238078 5.33462 0.718616 5.33462H5.28555C5.59628 5.33462 5.87167 5.13454 5.96769 4.83902L7.37895 0.495601Z" fill="var(--fill-0, #F28100)"/>
|
|
3
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { vi, describe, expect, it, beforeEach } from 'vitest';
|
|
2
|
+
|
|
3
|
+
const mockRedirect = vi.fn();
|
|
4
|
+
|
|
5
|
+
vi.mock('next/navigation', () => ({
|
|
6
|
+
redirect: (target: string) => {
|
|
7
|
+
mockRedirect(target);
|
|
8
|
+
throw new Error(`redirect:${target}`);
|
|
9
|
+
},
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
vi.mock('@/runtime/funnel-runtime', () => ({
|
|
13
|
+
defaultFunnelStepId: 'step-1',
|
|
14
|
+
funnelStepSequence: ['step-1', 'step-2'],
|
|
15
|
+
getPathForStep: (stepId: string) => `/${stepId}`,
|
|
16
|
+
isFunnelStepId: (stepId: string) => stepId === 'step-1' || stepId === 'step-2',
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
describe('step preview page', () => {
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
mockRedirect.mockReset();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('passes thumbnail preview mode through without top padding', async () => {
|
|
25
|
+
const StepPageModule = await import('@/app/[stepId]/page');
|
|
26
|
+
|
|
27
|
+
const page = await StepPageModule.default({
|
|
28
|
+
params: Promise.resolve({ stepId: 'step-1' }),
|
|
29
|
+
searchParams: Promise.resolve({
|
|
30
|
+
previewFrame: '1',
|
|
31
|
+
previewStepLock: '1',
|
|
32
|
+
previewThumbnail: '1',
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
expect(page.props.style).toEqual({
|
|
37
|
+
justifyContent: 'flex-start',
|
|
38
|
+
});
|
|
39
|
+
expect(page.props.children.props).toEqual({
|
|
40
|
+
initialStepId: 'step-1',
|
|
41
|
+
lockToInitialStep: true,
|
|
42
|
+
isPreviewFrame: true,
|
|
43
|
+
isPreviewThumbnail: true,
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('redirects unknown steps to the first manifest step', async () => {
|
|
48
|
+
const StepPageModule = await import('@/app/[stepId]/page');
|
|
49
|
+
|
|
50
|
+
await expect(
|
|
51
|
+
StepPageModule.default({
|
|
52
|
+
params: Promise.resolve({ stepId: 'missing-step' }),
|
|
53
|
+
searchParams: Promise.resolve({}),
|
|
54
|
+
}),
|
|
55
|
+
).rejects.toThrow('redirect:/step-1');
|
|
56
|
+
|
|
57
|
+
expect(mockRedirect).toHaveBeenCalledWith('/step-1');
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import { redirect } from 'next/navigation';
|
|
3
|
+
import { FunnelFlow } from '@/components/FunnelFlow';
|
|
4
|
+
import {
|
|
5
|
+
defaultFunnelStepId,
|
|
6
|
+
funnelStepSequence,
|
|
7
|
+
getPathForStep,
|
|
8
|
+
isFunnelStepId,
|
|
9
|
+
} from '@/runtime/funnel-runtime';
|
|
10
|
+
|
|
11
|
+
type StepPageProps = {
|
|
12
|
+
params: Promise<{
|
|
13
|
+
stepId: string;
|
|
14
|
+
}>;
|
|
15
|
+
searchParams?: Promise<{
|
|
16
|
+
previewFrame?: string | string[];
|
|
17
|
+
previewStepLock?: string | string[];
|
|
18
|
+
previewThumbnail?: string | string[];
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const dynamic = 'force-static';
|
|
23
|
+
|
|
24
|
+
export function generateStaticParams() {
|
|
25
|
+
return funnelStepSequence.map((stepId) => ({ stepId }));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default async function StepPage({ params, searchParams }: StepPageProps) {
|
|
29
|
+
const { stepId } = await params;
|
|
30
|
+
const resolvedSearchParams = (await searchParams) || {};
|
|
31
|
+
const previewFrameParam = resolvedSearchParams.previewFrame;
|
|
32
|
+
const previewStepLockParam = resolvedSearchParams.previewStepLock;
|
|
33
|
+
const previewThumbnailParam = resolvedSearchParams.previewThumbnail;
|
|
34
|
+
const isPreviewFrame = Array.isArray(previewFrameParam) ? previewFrameParam.includes('1') : previewFrameParam === '1';
|
|
35
|
+
const isPreviewStepLock = Array.isArray(previewStepLockParam)
|
|
36
|
+
? previewStepLockParam.includes('1')
|
|
37
|
+
: previewStepLockParam === '1';
|
|
38
|
+
const isPreviewThumbnail = Array.isArray(previewThumbnailParam)
|
|
39
|
+
? previewThumbnailParam.includes('1')
|
|
40
|
+
: previewThumbnailParam === '1';
|
|
41
|
+
|
|
42
|
+
if (!isFunnelStepId(stepId)) {
|
|
43
|
+
redirect(getPathForStep(defaultFunnelStepId));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const pageStyle: CSSProperties = isPreviewFrame
|
|
47
|
+
? {
|
|
48
|
+
justifyContent: 'flex-start',
|
|
49
|
+
}
|
|
50
|
+
: {};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<main className="page-root" style={pageStyle}>
|
|
54
|
+
<FunnelFlow
|
|
55
|
+
initialStepId={stepId}
|
|
56
|
+
lockToInitialStep={isPreviewStepLock}
|
|
57
|
+
isPreviewFrame={isPreviewFrame}
|
|
58
|
+
isPreviewThumbnail={isPreviewThumbnail}
|
|
59
|
+
/>
|
|
60
|
+
</main>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: light;
|
|
3
|
+
font-family: var(--font-family-base);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
* {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
html,
|
|
11
|
+
body {
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
body {
|
|
17
|
+
font-family: var(--font-family-base);
|
|
18
|
+
background: var(--color-bg);
|
|
19
|
+
color: var(--color-text);
|
|
20
|
+
line-height: var(--line-height-body);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
h1,
|
|
24
|
+
h2,
|
|
25
|
+
h3,
|
|
26
|
+
h4,
|
|
27
|
+
h5,
|
|
28
|
+
h6 {
|
|
29
|
+
margin: 0;
|
|
30
|
+
color: var(--color-text);
|
|
31
|
+
font-family: var(--font-family-display);
|
|
32
|
+
line-height: var(--line-height-heading);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
button,
|
|
36
|
+
input,
|
|
37
|
+
textarea,
|
|
38
|
+
select {
|
|
39
|
+
font: inherit;
|
|
40
|
+
color: inherit;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.page-root {
|
|
44
|
+
min-height: 100svh;
|
|
45
|
+
display: flex;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
align-items: center;
|
|
48
|
+
background: var(--color-bg);
|
|
49
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { describe, expect, it } from 'vitest';
|
|
4
|
+
|
|
5
|
+
describe('RootLayout metadata source', () => {
|
|
6
|
+
it('wires project page metadata settings into Next metadata', () => {
|
|
7
|
+
const layoutSource = readFileSync(path.resolve(__dirname, './layout.tsx'), 'utf8');
|
|
8
|
+
|
|
9
|
+
expect(layoutSource).toContain('runtimePublicConfig.pageTitle');
|
|
10
|
+
expect(layoutSource).toContain('runtimePublicConfig.pageDescription');
|
|
11
|
+
expect(layoutSource).toContain('runtimePublicConfig.faviconUrl');
|
|
12
|
+
expect(layoutSource).toContain('runtimePublicConfig.pagePreviewImageUrl');
|
|
13
|
+
expect(layoutSource).toContain('openGraph');
|
|
14
|
+
expect(layoutSource).toContain('twitter');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('renders Google tag head scripts through the shared analytics package', () => {
|
|
18
|
+
const layoutSource = readFileSync(path.resolve(__dirname, './layout.tsx'), 'utf8');
|
|
19
|
+
|
|
20
|
+
expect(layoutSource).toContain("import { buildGoogleTagHeadScripts } from '@funnelsgrove/analytics'");
|
|
21
|
+
expect(layoutSource).toContain('const googleTagHeadScripts = buildGoogleTagHeadScripts();');
|
|
22
|
+
expect(layoutSource).toContain('<head>');
|
|
23
|
+
expect(layoutSource).toContain('googleTagHeadScripts.map');
|
|
24
|
+
expect(layoutSource).toContain('dangerouslySetInnerHTML');
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { Metadata } from 'next';
|
|
3
|
+
import { buildGoogleTagHeadScripts } from '@funnelsgrove/analytics';
|
|
4
|
+
import { runtimePublicConfig } from '@funnelsgrove/runtime';
|
|
5
|
+
import { funnelConfig } from '@/config/funnel.config';
|
|
6
|
+
import { themeCssVariables } from '@/theme/theme';
|
|
7
|
+
import './globals.css';
|
|
8
|
+
import '../steps/styles/index.css';
|
|
9
|
+
|
|
10
|
+
const metadataTitle = runtimePublicConfig.pageTitle || funnelConfig.meta.title;
|
|
11
|
+
const metadataDescription = runtimePublicConfig.pageDescription || funnelConfig.meta.description;
|
|
12
|
+
const metadataPreviewImages = runtimePublicConfig.pagePreviewImageUrl
|
|
13
|
+
? [{ url: runtimePublicConfig.pagePreviewImageUrl }]
|
|
14
|
+
: undefined;
|
|
15
|
+
const googleTagHeadScripts = buildGoogleTagHeadScripts();
|
|
16
|
+
|
|
17
|
+
export const metadata: Metadata = {
|
|
18
|
+
title: metadataTitle,
|
|
19
|
+
description: metadataDescription,
|
|
20
|
+
icons: runtimePublicConfig.faviconUrl
|
|
21
|
+
? {
|
|
22
|
+
icon: [{ url: runtimePublicConfig.faviconUrl }],
|
|
23
|
+
}
|
|
24
|
+
: undefined,
|
|
25
|
+
openGraph: {
|
|
26
|
+
title: metadataTitle,
|
|
27
|
+
description: metadataDescription,
|
|
28
|
+
images: metadataPreviewImages,
|
|
29
|
+
},
|
|
30
|
+
twitter: {
|
|
31
|
+
card: metadataPreviewImages ? 'summary_large_image' : 'summary',
|
|
32
|
+
title: metadataTitle,
|
|
33
|
+
description: metadataDescription,
|
|
34
|
+
images: runtimePublicConfig.pagePreviewImageUrl ? [runtimePublicConfig.pagePreviewImageUrl] : undefined,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default function RootLayout({
|
|
39
|
+
children,
|
|
40
|
+
}: Readonly<{
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
}>) {
|
|
43
|
+
return (
|
|
44
|
+
<html lang="en">
|
|
45
|
+
<head>
|
|
46
|
+
{googleTagHeadScripts.map((script) =>
|
|
47
|
+
script.src ? (
|
|
48
|
+
<script key={script.id} id={script.id} async src={script.src} />
|
|
49
|
+
) : (
|
|
50
|
+
<script
|
|
51
|
+
key={script.id}
|
|
52
|
+
id={script.id}
|
|
53
|
+
dangerouslySetInnerHTML={{ __html: script.content ?? '' }}
|
|
54
|
+
/>
|
|
55
|
+
),
|
|
56
|
+
)}
|
|
57
|
+
</head>
|
|
58
|
+
<body style={themeCssVariables as CSSProperties}>{children}</body>
|
|
59
|
+
</html>
|
|
60
|
+
);
|
|
61
|
+
}
|