popeye-cli 2.2.0 → 2.7.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/adapters/gemini.d.ts +14 -0
- package/dist/adapters/gemini.d.ts.map +1 -1
- package/dist/adapters/gemini.js +41 -6
- package/dist/adapters/gemini.js.map +1 -1
- package/dist/adapters/grok.d.ts +14 -0
- package/dist/adapters/grok.d.ts.map +1 -1
- package/dist/adapters/grok.js +42 -6
- package/dist/adapters/grok.js.map +1 -1
- package/dist/adapters/openai.d.ts +10 -0
- package/dist/adapters/openai.d.ts.map +1 -1
- package/dist/adapters/openai.js +44 -5
- package/dist/adapters/openai.js.map +1 -1
- package/dist/cli/commands/create.js +1 -1
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/interactive.d.ts.map +1 -1
- package/dist/cli/interactive.js +324 -20
- package/dist/cli/interactive.js.map +1 -1
- package/dist/generators/all.d.ts.map +1 -1
- package/dist/generators/all.js +3 -2
- package/dist/generators/all.js.map +1 -1
- package/dist/generators/doc-parser.d.ts +21 -6
- package/dist/generators/doc-parser.d.ts.map +1 -1
- package/dist/generators/doc-parser.js +55 -4
- package/dist/generators/doc-parser.js.map +1 -1
- package/dist/generators/templates/fullstack.js +1 -1
- package/dist/generators/templates/website-components.js +1 -1
- package/dist/generators/templates/website-components.js.map +1 -1
- package/dist/generators/templates/website-config.d.ts +4 -1
- package/dist/generators/templates/website-config.d.ts.map +1 -1
- package/dist/generators/templates/website-config.js +17 -11
- package/dist/generators/templates/website-config.js.map +1 -1
- package/dist/generators/templates/website-conversion.js +1 -1
- package/dist/generators/templates/website-conversion.js.map +1 -1
- package/dist/generators/templates/website-landing.js +1 -1
- package/dist/generators/templates/website-landing.js.map +1 -1
- package/dist/generators/templates/website-layout.d.ts +36 -4
- package/dist/generators/templates/website-layout.d.ts.map +1 -1
- package/dist/generators/templates/website-layout.js +466 -23
- package/dist/generators/templates/website-layout.js.map +1 -1
- package/dist/generators/templates/website-pricing.js +1 -1
- package/dist/generators/templates/website-pricing.js.map +1 -1
- package/dist/generators/templates/website-sections.js +1 -1
- package/dist/generators/templates/website-sections.js.map +1 -1
- package/dist/generators/templates/website-seo.d.ts.map +1 -1
- package/dist/generators/templates/website-seo.js +4 -1
- package/dist/generators/templates/website-seo.js.map +1 -1
- package/dist/generators/templates/website.d.ts +1 -1
- package/dist/generators/templates/website.d.ts.map +1 -1
- package/dist/generators/templates/website.js +1 -1
- package/dist/generators/templates/website.js.map +1 -1
- package/dist/generators/website-content-ai.d.ts +52 -0
- package/dist/generators/website-content-ai.d.ts.map +1 -0
- package/dist/generators/website-content-ai.js +141 -0
- package/dist/generators/website-content-ai.js.map +1 -0
- package/dist/generators/website-content-scanner.d.ts +1 -1
- package/dist/generators/website-content-scanner.d.ts.map +1 -1
- package/dist/generators/website-content-scanner.js +98 -1
- package/dist/generators/website-content-scanner.js.map +1 -1
- package/dist/generators/website-context.d.ts +34 -1
- package/dist/generators/website-context.d.ts.map +1 -1
- package/dist/generators/website-context.js +131 -9
- package/dist/generators/website-context.js.map +1 -1
- package/dist/generators/website-debug.d.ts +12 -0
- package/dist/generators/website-debug.d.ts.map +1 -1
- package/dist/generators/website-debug.js +16 -0
- package/dist/generators/website-debug.js.map +1 -1
- package/dist/generators/website.d.ts.map +1 -1
- package/dist/generators/website.js +26 -4
- package/dist/generators/website.js.map +1 -1
- package/dist/pipeline/auto-recovery.d.ts +56 -0
- package/dist/pipeline/auto-recovery.d.ts.map +1 -0
- package/dist/pipeline/auto-recovery.js +185 -0
- package/dist/pipeline/auto-recovery.js.map +1 -0
- package/dist/pipeline/change-request.d.ts +39 -0
- package/dist/pipeline/change-request.d.ts.map +1 -1
- package/dist/pipeline/change-request.js +40 -1
- package/dist/pipeline/change-request.js.map +1 -1
- package/dist/pipeline/check-runner.d.ts +30 -1
- package/dist/pipeline/check-runner.d.ts.map +1 -1
- package/dist/pipeline/check-runner.js +122 -1
- package/dist/pipeline/check-runner.js.map +1 -1
- package/dist/pipeline/command-resolver.d.ts.map +1 -1
- package/dist/pipeline/command-resolver.js +33 -2
- package/dist/pipeline/command-resolver.js.map +1 -1
- package/dist/pipeline/consensus/arbitrator-query.d.ts +22 -0
- package/dist/pipeline/consensus/arbitrator-query.d.ts.map +1 -0
- package/dist/pipeline/consensus/arbitrator-query.js +70 -0
- package/dist/pipeline/consensus/arbitrator-query.js.map +1 -0
- package/dist/pipeline/consensus/consensus-runner.d.ts +131 -7
- package/dist/pipeline/consensus/consensus-runner.d.ts.map +1 -1
- package/dist/pipeline/consensus/consensus-runner.js +809 -35
- package/dist/pipeline/consensus/consensus-runner.js.map +1 -1
- package/dist/pipeline/cr-lifecycle.d.ts +42 -0
- package/dist/pipeline/cr-lifecycle.d.ts.map +1 -0
- package/dist/pipeline/cr-lifecycle.js +89 -0
- package/dist/pipeline/cr-lifecycle.js.map +1 -0
- package/dist/pipeline/gate-engine.d.ts +1 -0
- package/dist/pipeline/gate-engine.d.ts.map +1 -1
- package/dist/pipeline/gate-engine.js +26 -7
- package/dist/pipeline/gate-engine.js.map +1 -1
- package/dist/pipeline/orchestrator.d.ts +1 -1
- package/dist/pipeline/orchestrator.d.ts.map +1 -1
- package/dist/pipeline/orchestrator.js +306 -16
- package/dist/pipeline/orchestrator.js.map +1 -1
- package/dist/pipeline/packets/consensus-packet-builder.d.ts +15 -4
- package/dist/pipeline/packets/consensus-packet-builder.d.ts.map +1 -1
- package/dist/pipeline/packets/consensus-packet-builder.js +29 -17
- package/dist/pipeline/packets/consensus-packet-builder.js.map +1 -1
- package/dist/pipeline/phases/architecture.d.ts.map +1 -1
- package/dist/pipeline/phases/architecture.js +5 -3
- package/dist/pipeline/phases/architecture.js.map +1 -1
- package/dist/pipeline/phases/audit.d.ts.map +1 -1
- package/dist/pipeline/phases/audit.js +5 -3
- package/dist/pipeline/phases/audit.js.map +1 -1
- package/dist/pipeline/phases/consensus-architecture.d.ts.map +1 -1
- package/dist/pipeline/phases/consensus-architecture.js +10 -1
- package/dist/pipeline/phases/consensus-architecture.js.map +1 -1
- package/dist/pipeline/phases/consensus-master-plan.d.ts.map +1 -1
- package/dist/pipeline/phases/consensus-master-plan.js +10 -3
- package/dist/pipeline/phases/consensus-master-plan.js.map +1 -1
- package/dist/pipeline/phases/consensus-role-plans.d.ts.map +1 -1
- package/dist/pipeline/phases/consensus-role-plans.js +10 -1
- package/dist/pipeline/phases/consensus-role-plans.js.map +1 -1
- package/dist/pipeline/phases/done.d.ts.map +1 -1
- package/dist/pipeline/phases/done.js +9 -4
- package/dist/pipeline/phases/done.js.map +1 -1
- package/dist/pipeline/phases/intake.d.ts.map +1 -1
- package/dist/pipeline/phases/intake.js +7 -3
- package/dist/pipeline/phases/intake.js.map +1 -1
- package/dist/pipeline/phases/phase-context.d.ts +2 -0
- package/dist/pipeline/phases/phase-context.d.ts.map +1 -1
- package/dist/pipeline/phases/phase-context.js +3 -1
- package/dist/pipeline/phases/phase-context.js.map +1 -1
- package/dist/pipeline/phases/production-gate.d.ts.map +1 -1
- package/dist/pipeline/phases/production-gate.js +28 -3
- package/dist/pipeline/phases/production-gate.js.map +1 -1
- package/dist/pipeline/phases/qa-validation.d.ts.map +1 -1
- package/dist/pipeline/phases/qa-validation.js +38 -5
- package/dist/pipeline/phases/qa-validation.js.map +1 -1
- package/dist/pipeline/phases/recovery-loop.d.ts +2 -0
- package/dist/pipeline/phases/recovery-loop.d.ts.map +1 -1
- package/dist/pipeline/phases/recovery-loop.js +200 -6
- package/dist/pipeline/phases/recovery-loop.js.map +1 -1
- package/dist/pipeline/phases/review.d.ts.map +1 -1
- package/dist/pipeline/phases/review.js +58 -28
- package/dist/pipeline/phases/review.js.map +1 -1
- package/dist/pipeline/phases/role-planning.d.ts.map +1 -1
- package/dist/pipeline/phases/role-planning.js +18 -2
- package/dist/pipeline/phases/role-planning.js.map +1 -1
- package/dist/pipeline/phases/stuck.d.ts.map +1 -1
- package/dist/pipeline/phases/stuck.js +10 -0
- package/dist/pipeline/phases/stuck.js.map +1 -1
- package/dist/pipeline/repo-snapshot.d.ts.map +1 -1
- package/dist/pipeline/repo-snapshot.js +3 -0
- package/dist/pipeline/repo-snapshot.js.map +1 -1
- package/dist/pipeline/role-execution-adapter.d.ts +2 -1
- package/dist/pipeline/role-execution-adapter.d.ts.map +1 -1
- package/dist/pipeline/role-execution-adapter.js +22 -7
- package/dist/pipeline/role-execution-adapter.js.map +1 -1
- package/dist/pipeline/skill-loader.d.ts +19 -0
- package/dist/pipeline/skill-loader.d.ts.map +1 -1
- package/dist/pipeline/skill-loader.js +22 -0
- package/dist/pipeline/skill-loader.js.map +1 -1
- package/dist/pipeline/skills/coverage-gate.d.ts +44 -0
- package/dist/pipeline/skills/coverage-gate.d.ts.map +1 -0
- package/dist/pipeline/skills/coverage-gate.js +143 -0
- package/dist/pipeline/skills/coverage-gate.js.map +1 -0
- package/dist/pipeline/skills/usage-registry.d.ts +48 -0
- package/dist/pipeline/skills/usage-registry.d.ts.map +1 -0
- package/dist/pipeline/skills/usage-registry.js +55 -0
- package/dist/pipeline/skills/usage-registry.js.map +1 -0
- package/dist/pipeline/strategy-context.d.ts +20 -0
- package/dist/pipeline/strategy-context.d.ts.map +1 -0
- package/dist/pipeline/strategy-context.js +55 -0
- package/dist/pipeline/strategy-context.js.map +1 -0
- package/dist/pipeline/type-defs/artifacts.d.ts +25 -5
- package/dist/pipeline/type-defs/artifacts.d.ts.map +1 -1
- package/dist/pipeline/type-defs/artifacts.js +4 -0
- package/dist/pipeline/type-defs/artifacts.js.map +1 -1
- package/dist/pipeline/type-defs/audit.d.ts +25 -13
- package/dist/pipeline/type-defs/audit.d.ts.map +1 -1
- package/dist/pipeline/type-defs/checks.d.ts +18 -8
- package/dist/pipeline/type-defs/checks.d.ts.map +1 -1
- package/dist/pipeline/type-defs/checks.js +4 -0
- package/dist/pipeline/type-defs/checks.js.map +1 -1
- package/dist/pipeline/type-defs/packets.d.ts +104 -18
- package/dist/pipeline/type-defs/packets.d.ts.map +1 -1
- package/dist/pipeline/type-defs/packets.js +17 -1
- package/dist/pipeline/type-defs/packets.js.map +1 -1
- package/dist/pipeline/type-defs/state.d.ts +160 -16
- package/dist/pipeline/type-defs/state.d.ts.map +1 -1
- package/dist/pipeline/type-defs/state.js +26 -1
- package/dist/pipeline/type-defs/state.js.map +1 -1
- package/dist/shared/text-utils.d.ts +23 -0
- package/dist/shared/text-utils.d.ts.map +1 -0
- package/dist/shared/text-utils.js +66 -0
- package/dist/shared/text-utils.js.map +1 -0
- package/dist/shared/website-strategy-format.d.ts +18 -0
- package/dist/shared/website-strategy-format.d.ts.map +1 -0
- package/dist/shared/website-strategy-format.js +47 -0
- package/dist/shared/website-strategy-format.js.map +1 -0
- package/dist/state/index.d.ts +2 -0
- package/dist/state/index.d.ts.map +1 -1
- package/dist/state/index.js +57 -8
- package/dist/state/index.js.map +1 -1
- package/dist/types/consensus.d.ts +1 -0
- package/dist/types/consensus.d.ts.map +1 -1
- package/dist/types/consensus.js.map +1 -1
- package/dist/types/website-strategy.d.ts +1 -1
- package/dist/types/workflow.d.ts +447 -0
- package/dist/types/workflow.d.ts.map +1 -1
- package/dist/types/workflow.js +3 -0
- package/dist/types/workflow.js.map +1 -1
- package/dist/upgrade/handlers.d.ts.map +1 -1
- package/dist/upgrade/handlers.js +6 -3
- package/dist/upgrade/handlers.js.map +1 -1
- package/dist/workflow/consensus.d.ts.map +1 -1
- package/dist/workflow/consensus.js +1 -0
- package/dist/workflow/consensus.js.map +1 -1
- package/dist/workflow/website-strategy.d.ts.map +1 -1
- package/dist/workflow/website-strategy.js +2 -29
- package/dist/workflow/website-strategy.js.map +1 -1
- package/dist/workflow/website-updater.d.ts.map +1 -1
- package/dist/workflow/website-updater.js +3 -2
- package/dist/workflow/website-updater.js.map +1 -1
- package/package.json +1 -1
- package/src/adapters/gemini.ts +51 -6
- package/src/adapters/grok.ts +51 -6
- package/src/adapters/openai.ts +53 -5
- package/src/cli/commands/create.ts +1 -1
- package/src/cli/interactive.ts +333 -19
- package/src/generators/all.ts +3 -2
- package/src/generators/doc-parser.ts +75 -15
- package/src/generators/templates/fullstack.ts +1 -1
- package/src/generators/templates/website-components.ts +1 -1
- package/src/generators/templates/website-config.ts +23 -11
- package/src/generators/templates/website-conversion.ts +1 -1
- package/src/generators/templates/website-landing.ts +1 -1
- package/src/generators/templates/website-layout.ts +491 -23
- package/src/generators/templates/website-pricing.ts +1 -1
- package/src/generators/templates/website-sections.ts +1 -1
- package/src/generators/templates/website-seo.ts +4 -1
- package/src/generators/templates/website.ts +3 -0
- package/src/generators/website-content-ai.ts +186 -0
- package/src/generators/website-content-scanner.ts +113 -1
- package/src/generators/website-context.ts +151 -12
- package/src/generators/website-debug.ts +26 -0
- package/src/generators/website.ts +28 -3
- package/src/pipeline/auto-recovery.ts +283 -0
- package/src/pipeline/change-request.ts +63 -1
- package/src/pipeline/check-runner.ts +141 -2
- package/src/pipeline/command-resolver.ts +34 -2
- package/src/pipeline/consensus/arbitrator-query.ts +101 -0
- package/src/pipeline/consensus/consensus-runner.ts +1099 -42
- package/src/pipeline/cr-lifecycle.ts +103 -0
- package/src/pipeline/gate-engine.ts +35 -7
- package/src/pipeline/orchestrator.ts +361 -16
- package/src/pipeline/packets/consensus-packet-builder.ts +44 -18
- package/src/pipeline/phases/architecture.ts +6 -3
- package/src/pipeline/phases/audit.ts +6 -3
- package/src/pipeline/phases/consensus-architecture.ts +10 -1
- package/src/pipeline/phases/consensus-master-plan.ts +10 -3
- package/src/pipeline/phases/consensus-role-plans.ts +10 -1
- package/src/pipeline/phases/done.ts +15 -4
- package/src/pipeline/phases/intake.ts +7 -3
- package/src/pipeline/phases/phase-context.ts +6 -1
- package/src/pipeline/phases/production-gate.ts +41 -3
- package/src/pipeline/phases/qa-validation.ts +51 -5
- package/src/pipeline/phases/recovery-loop.ts +229 -7
- package/src/pipeline/phases/review.ts +73 -30
- package/src/pipeline/phases/role-planning.ts +21 -2
- package/src/pipeline/phases/stuck.ts +10 -0
- package/src/pipeline/repo-snapshot.ts +3 -0
- package/src/pipeline/role-execution-adapter.ts +30 -4
- package/src/pipeline/skill-loader.ts +33 -0
- package/src/pipeline/skills/coverage-gate.ts +199 -0
- package/src/pipeline/skills/usage-registry.ts +87 -0
- package/src/pipeline/strategy-context.ts +60 -0
- package/src/pipeline/type-defs/artifacts.ts +4 -0
- package/src/pipeline/type-defs/checks.ts +4 -0
- package/src/pipeline/type-defs/packets.ts +18 -1
- package/src/pipeline/type-defs/state.ts +26 -1
- package/src/shared/text-utils.ts +70 -0
- package/src/shared/website-strategy-format.ts +56 -0
- package/src/state/index.ts +60 -8
- package/src/types/consensus.ts +1 -0
- package/src/types/workflow.ts +6 -0
- package/src/upgrade/handlers.ts +9 -3
- package/src/workflow/consensus.ts +1 -0
- package/src/workflow/website-strategy.ts +2 -36
- package/src/workflow/website-updater.ts +4 -2
- package/tests/adapters/gemini.test.ts +165 -0
- package/tests/adapters/grok.test.ts +137 -0
- package/tests/adapters/openai.test.ts +128 -0
- package/tests/generators/doc-parser.test.ts +88 -9
- package/tests/generators/quality-gate.test.ts +19 -3
- package/tests/generators/website-components.test.ts +34 -0
- package/tests/generators/website-content-ai.test.ts +308 -0
- package/tests/generators/website-content-scanner.test.ts +86 -0
- package/tests/generators/website-context.test.ts +3 -2
- package/tests/integration/smokestack-scaffold.test.ts +385 -0
- package/tests/pipeline/auto-recovery.test.ts +337 -0
- package/tests/pipeline/change-request.test.ts +70 -0
- package/tests/pipeline/command-resolver.test.ts +42 -0
- package/tests/pipeline/consensus/arbitrator-query.test.ts +107 -0
- package/tests/pipeline/consensus-runner.test.ts +1333 -10
- package/tests/pipeline/consensus-scoring.test.ts +602 -18
- package/tests/pipeline/gate-engine.test.ts +34 -0
- package/tests/pipeline/install-check.test.ts +261 -0
- package/tests/pipeline/orchestrator.test.ts +1506 -15
- package/tests/pipeline/packets/builders.test.ts +29 -6
- package/tests/pipeline/phases/role-planning.strategy.test.ts +204 -0
- package/tests/pipeline/pipeline-persistence.test.ts +230 -0
- package/tests/pipeline/recovery-loop-guidance.test.ts +280 -0
- package/tests/pipeline/role-execution-adapter.test.ts +88 -0
- package/tests/pipeline/skills/coverage-gate.test.ts +370 -0
- package/tests/pipeline/skills/usage-registry.test.ts +114 -0
- package/tests/pipeline/strategy-context.test.ts +148 -0
- package/tests/shared/text-utils.test.ts +155 -0
- package/tests/state/progress-analysis.test.ts +375 -0
- package/tests/upgrade/handlers.test.ts +33 -2
- package/tests/workflow/consensus.test.ts +6 -0
- package/tsconfig.json +1 -1
package/src/generators/all.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { GenerationResult } from './python.js';
|
|
|
10
10
|
import { generateFullstackProject } from './fullstack.js';
|
|
11
11
|
import { generateWebsiteProject } from './website.js';
|
|
12
12
|
import type { WebsiteContentContext } from './website-context.js';
|
|
13
|
-
import { buildWebsiteContext, validateWebsiteContext, resolveBrandAssets } from './website-context.js';
|
|
13
|
+
import { buildWebsiteContext, validateWebsiteContext, resolveBrandAssets, extractDocPathsFromText } from './website-context.js';
|
|
14
14
|
import { loadWebsiteStrategy } from '../workflow/website-strategy.js';
|
|
15
15
|
import {
|
|
16
16
|
generateDesignTokensPackage as generateDesignTokensPackageImpl,
|
|
@@ -393,7 +393,8 @@ export async function generateAllProject(
|
|
|
393
393
|
let contextWarning: string | undefined;
|
|
394
394
|
if (!contentContext) {
|
|
395
395
|
try {
|
|
396
|
-
|
|
396
|
+
const extraDocPaths = spec.idea ? extractDocPathsFromText(spec.idea) : [];
|
|
397
|
+
contentContext = await buildWebsiteContext(projectDir, projectName, spec.idea, extraDocPaths);
|
|
397
398
|
} catch (e) {
|
|
398
399
|
contextWarning = e instanceof Error ? e.message : 'Unknown error building website context';
|
|
399
400
|
// Proceed with defaults, but warning is logged below
|
|
@@ -281,22 +281,33 @@ function extractFeaturesFromSource(
|
|
|
281
281
|
return features;
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
/**
|
|
285
|
-
|
|
286
|
-
* Parses markdown tables and "Plan Positioning" sections
|
|
287
|
-
*/
|
|
288
|
-
export function extractPricing(
|
|
289
|
-
docs: string
|
|
290
|
-
): Array<{
|
|
284
|
+
/** Pricing tier as extracted from docs */
|
|
285
|
+
export interface PricingTier {
|
|
291
286
|
name: string; price: string; period?: string;
|
|
292
287
|
description: string; features: string[];
|
|
293
288
|
cta: string; featured?: boolean;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/** Result of pricing extraction with provenance tracking */
|
|
292
|
+
export interface PricingExtractionResult {
|
|
293
|
+
tiers: PricingTier[];
|
|
294
|
+
source: 'docs' | 'none';
|
|
295
|
+
evidence?: {
|
|
296
|
+
matchedSection?: string;
|
|
297
|
+
matchedRows: number;
|
|
298
|
+
extractionMethod: 'known_plan_names' | 'table_fallback';
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Extract pricing tiers from docs with provenance tracking
|
|
304
|
+
* Parses markdown tables and "Plan Positioning" sections
|
|
305
|
+
*
|
|
306
|
+
* @param docs - Combined documentation text
|
|
307
|
+
* @returns Extraction result with tiers, source provenance, and evidence
|
|
308
|
+
*/
|
|
309
|
+
export function extractPricing(docs: string): PricingExtractionResult {
|
|
310
|
+
const tiers: PricingTier[] = [];
|
|
300
311
|
|
|
301
312
|
// Find the pricing section to avoid matching design token tables
|
|
302
313
|
// Reason: "Plan-Based Color Usage" matches "Plans?" - require "Pricing" keyword
|
|
@@ -307,8 +318,11 @@ export function extractPricing(
|
|
|
307
318
|
|
|
308
319
|
// Look for pricing overview table rows with plan names and actual prices
|
|
309
320
|
const priceMap = new Map<string, string>();
|
|
321
|
+
let extractionMethod: 'known_plan_names' | 'table_fallback' | undefined;
|
|
322
|
+
|
|
310
323
|
const tableRows = searchArea.match(/^\|[^|]*(?:Free|Pro|Enterprise|Starter|Growth|Team|Business)[^|]*\|.+\|$/gm);
|
|
311
324
|
if (tableRows) {
|
|
325
|
+
extractionMethod = 'known_plan_names';
|
|
312
326
|
for (const row of tableRows) {
|
|
313
327
|
const cells = row.split('|').map((c) => c.trim()).filter(Boolean);
|
|
314
328
|
if (cells.length >= 2) {
|
|
@@ -325,7 +339,41 @@ export function extractPricing(
|
|
|
325
339
|
}
|
|
326
340
|
}
|
|
327
341
|
|
|
328
|
-
if
|
|
342
|
+
// Fallback: if no known plan names found, scan pricing section for any row with price-like cell
|
|
343
|
+
if (priceMap.size === 0 && pricingSection) {
|
|
344
|
+
const allRows = pricingSection[0].match(/^\|.+\|$/gm);
|
|
345
|
+
if (allRows && allRows.length >= 3) {
|
|
346
|
+
// Detect which column is the price column from the header row
|
|
347
|
+
const headerCells = allRows[0].split('|').map((c) => c.trim()).filter(Boolean);
|
|
348
|
+
let priceColIndex = headerCells.findIndex((h) => /price|cost|monthly|\$/i.test(h));
|
|
349
|
+
if (priceColIndex < 0) priceColIndex = 1; // default: 2nd column
|
|
350
|
+
|
|
351
|
+
for (const row of allRows.slice(2)) {
|
|
352
|
+
const cells = row.split('|').map((c) => c.trim()).filter(Boolean);
|
|
353
|
+
if (cells.length < 2) continue;
|
|
354
|
+
const planName = cells[0].replace(/[🟢🔵🟣⚪🟡🟠🔴]\s*/g, '').replace(/\*\*/g, '').trim();
|
|
355
|
+
// Skip separator rows and header-like rows
|
|
356
|
+
if (/^[-=\s]+$/.test(planName) || /^(Plan|Tier|Name|Feature)/i.test(planName)) continue;
|
|
357
|
+
|
|
358
|
+
// Check price column and adjacent column for price-like content
|
|
359
|
+
for (const idx of [priceColIndex, priceColIndex === 1 ? 2 : 1]) {
|
|
360
|
+
if (idx >= cells.length) continue;
|
|
361
|
+
const price = cells[idx].replace(/<br>/g, ' / ').replace(/\*\*/g, '').trim();
|
|
362
|
+
const looksLikePrice = /^free$/i.test(price) || /^\$/.test(price)
|
|
363
|
+
|| /^custom/i.test(price) || /^contact/i.test(price);
|
|
364
|
+
if (looksLikePrice && !priceMap.has(planName)) {
|
|
365
|
+
priceMap.set(planName, price);
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (priceMap.size > 0) extractionMethod = 'table_fallback';
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
if (priceMap.size === 0) {
|
|
375
|
+
return { tiers: [], source: 'none' };
|
|
376
|
+
}
|
|
329
377
|
|
|
330
378
|
// Look for plan descriptions
|
|
331
379
|
const descMap = new Map<string, string>();
|
|
@@ -410,7 +458,19 @@ export function extractPricing(
|
|
|
410
458
|
tier.features = tier.features.slice(0, 6);
|
|
411
459
|
}
|
|
412
460
|
|
|
413
|
-
|
|
461
|
+
if (tiers.length === 0) {
|
|
462
|
+
return { tiers: [], source: 'none' };
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
return {
|
|
466
|
+
tiers,
|
|
467
|
+
source: 'docs',
|
|
468
|
+
evidence: {
|
|
469
|
+
matchedSection: pricingSection ? pricingSection[0].split('\n')[0] : undefined,
|
|
470
|
+
matchedRows: priceMap.size,
|
|
471
|
+
extractionMethod: extractionMethod!,
|
|
472
|
+
},
|
|
473
|
+
};
|
|
414
474
|
}
|
|
415
475
|
|
|
416
476
|
/**
|
|
@@ -765,7 +765,7 @@ export function generateFrontendPackageJson(projectName: string): string {
|
|
|
765
765
|
'@vitest/coverage-v8': '^2.0.0',
|
|
766
766
|
autoprefixer: '^10.4.0',
|
|
767
767
|
eslint: '^9.0.0',
|
|
768
|
-
'eslint-plugin-react-hooks': '^
|
|
768
|
+
'eslint-plugin-react-hooks': '^5.0.0',
|
|
769
769
|
'eslint-plugin-react-refresh': '^0.4.0',
|
|
770
770
|
postcss: '^8.4.0',
|
|
771
771
|
tailwindcss: '^3.4.0',
|
|
@@ -93,7 +93,24 @@ module.exports = nextConfig;
|
|
|
93
93
|
/**
|
|
94
94
|
* Generate website tsconfig.json
|
|
95
95
|
*/
|
|
96
|
-
export function generateWebsiteTsconfig(
|
|
96
|
+
export function generateWebsiteTsconfig(options?: {
|
|
97
|
+
workspaceMode?: boolean;
|
|
98
|
+
projectName?: string;
|
|
99
|
+
}): string {
|
|
100
|
+
const paths: Record<string, string[]> = {
|
|
101
|
+
'@/*': ['./src/*'],
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// Add workspace package path aliases so tsc can resolve imports
|
|
105
|
+
if (options?.workspaceMode && options?.projectName) {
|
|
106
|
+
paths[`@${options.projectName}/design-tokens/*`] = ['../../packages/design-tokens/src/*'];
|
|
107
|
+
paths[`@${options.projectName}/design-tokens`] = ['../../packages/design-tokens/src/index.ts'];
|
|
108
|
+
paths[`@${options.projectName}/ui/*`] = ['../../packages/ui/src/*'];
|
|
109
|
+
paths[`@${options.projectName}/ui`] = ['../../packages/ui/src/index.ts'];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const pathsJson = JSON.stringify(paths, null, 6).replace(/\n/g, '\n ');
|
|
113
|
+
|
|
97
114
|
return `{
|
|
98
115
|
"compilerOptions": {
|
|
99
116
|
"target": "ES2017",
|
|
@@ -114,12 +131,10 @@ export function generateWebsiteTsconfig(): string {
|
|
|
114
131
|
"name": "next"
|
|
115
132
|
}
|
|
116
133
|
],
|
|
117
|
-
"paths": {
|
|
118
|
-
"@/*": ["./src/*"]
|
|
119
|
-
}
|
|
134
|
+
"paths": ${pathsJson}
|
|
120
135
|
},
|
|
121
|
-
"include": ["next-env.d.ts", "
|
|
122
|
-
"exclude": ["node_modules"]
|
|
136
|
+
"include": ["next-env.d.ts", "src/**/*.ts", "src/**/*.tsx", ".next/types/**/*.ts"],
|
|
137
|
+
"exclude": ["node_modules", "tests"]
|
|
123
138
|
}
|
|
124
139
|
`;
|
|
125
140
|
}
|
|
@@ -421,12 +436,9 @@ vi.mock('next/navigation', () => ({
|
|
|
421
436
|
usePathname: () => '/',
|
|
422
437
|
}));
|
|
423
438
|
|
|
424
|
-
// Mock next/image
|
|
439
|
+
// Mock next/image (plain object mock, no JSX in .ts files)
|
|
425
440
|
vi.mock('next/image', () => ({
|
|
426
|
-
default: (props: Record<string, unknown>) =>
|
|
427
|
-
// eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text
|
|
428
|
-
return <img {...props} />;
|
|
429
|
-
},
|
|
441
|
+
default: (props: Record<string, unknown>) => props,
|
|
430
442
|
}));
|
|
431
443
|
`;
|
|
432
444
|
}
|