@girardmedia/bootspring 2.0.22 → 2.0.23

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/cli/preseed.js CHANGED
@@ -30,7 +30,6 @@
30
30
 
31
31
  const path = require('path');
32
32
  const fs = require('fs');
33
- const readline = require('readline');
34
33
  const config = require('../core/config');
35
34
  const utils = require('../core/utils');
36
35
  const { PreseedEngine, PRESETS, DOCUMENT_TYPES } = require('../core/preseed');
@@ -46,30 +45,15 @@ const session = require('../core/session');
46
45
  const preseedStart = require('./preseed-start');
47
46
  const tierEnforcement = require('../core/tier-enforcement');
48
47
 
49
- /**
50
- * Create readline interface
51
- */
52
- function createInterface() {
53
- return readline.createInterface({
54
- input: process.stdin,
55
- output: process.stdout
56
- });
57
- }
58
-
59
- /**
60
- * Ask a text question
61
- */
62
- function askText(rl, question, defaultValue = '') {
63
- const prompt = defaultValue
64
- ? `${question} ${utils.COLORS.dim}[${defaultValue}]${utils.COLORS.reset}: `
65
- : `${question}: `;
66
-
67
- return new Promise((resolve) => {
68
- rl.question(prompt, (answer) => {
69
- resolve(answer.trim() || defaultValue);
70
- });
71
- });
72
- }
48
+ // Import from extracted modules
49
+ const {
50
+ createInterface,
51
+ askText,
52
+ askList,
53
+ askChoice,
54
+ displaySection
55
+ } = require('./preseed/interactive');
56
+ const { generateDocumentTemplate } = require('./preseed/templates');
73
57
 
74
58
  /**
75
59
  * Ask a multi-line text question
@@ -96,64 +80,6 @@ function _askMultiLine(rl, question, hint = 'Enter text (empty line to finish)')
96
80
  });
97
81
  }
98
82
 
99
- /**
100
- * Ask a list question (comma-separated)
101
- */
102
- function askList(rl, question, hint = 'Enter comma-separated values') {
103
- return new Promise((resolve) => {
104
- console.log(`\n${utils.COLORS.bold}${question}${utils.COLORS.reset}`);
105
- console.log(`${utils.COLORS.dim}${hint}${utils.COLORS.reset}`);
106
-
107
- rl.question('> ', (answer) => {
108
- const items = answer
109
- .split(',')
110
- .map(s => s.trim())
111
- .filter(s => s.length > 0);
112
- resolve(items);
113
- });
114
- });
115
- }
116
-
117
- /**
118
- * Ask a choice question
119
- */
120
- function askChoice(rl, question, options, defaultIndex = 0) {
121
- return new Promise((resolve) => {
122
- console.log(`\n${utils.COLORS.bold}${question}${utils.COLORS.reset}`);
123
-
124
- options.forEach((opt, i) => {
125
- const marker = i === defaultIndex
126
- ? `${utils.COLORS.cyan}>${utils.COLORS.reset}`
127
- : ' ';
128
- const label = typeof opt === 'object' ? opt.label : opt;
129
- const desc = typeof opt === 'object' && opt.description
130
- ? ` ${utils.COLORS.dim}- ${opt.description}${utils.COLORS.reset}`
131
- : '';
132
- console.log(` ${marker} ${i + 1}. ${label}${desc}`);
133
- });
134
-
135
- rl.question(`\n${utils.COLORS.dim}Select [1-${options.length}]${utils.COLORS.reset}: `, (answer) => {
136
- const index = parseInt(answer, 10) - 1;
137
- const selectedIndex = (index >= 0 && index < options.length) ? index : defaultIndex;
138
- const selected = options[selectedIndex];
139
- resolve(typeof selected === 'object' ? selected.value : selected);
140
- });
141
- });
142
- }
143
-
144
- /**
145
- * Display section header
146
- */
147
- function displaySection(number, total, title, description) {
148
- console.log('\n');
149
- console.log(`${utils.COLORS.cyan}${'━'.repeat(60)}${utils.COLORS.reset}`);
150
- console.log(`${utils.COLORS.bold}Step ${number}/${total}: ${title}${utils.COLORS.reset}`);
151
- if (description) {
152
- console.log(`${utils.COLORS.dim}${description}${utils.COLORS.reset}`);
153
- }
154
- console.log(`${utils.COLORS.cyan}${'━'.repeat(60)}${utils.COLORS.reset}`);
155
- }
156
-
157
83
  /**
158
84
  * Run the preseed wizard
159
85
  */
@@ -1705,224 +1631,6 @@ async function runWorkflowLoop(workflow) {
1705
1631
  }
1706
1632
  }
1707
1633
  }
1708
-
1709
- /**
1710
- * Generate a document template
1711
- */
1712
- function generateDocumentTemplate(docType, name) {
1713
- const date = new Date().toISOString().split('T')[0];
1714
- const templates = {
1715
- vision: `# Vision Document
1716
-
1717
- **Generated:** ${date}
1718
-
1719
- ## The Problem
1720
-
1721
- *Describe the problem you're solving...*
1722
-
1723
- ## Our Solution
1724
-
1725
- *Describe your solution...*
1726
-
1727
- ### Key Features
1728
-
1729
- - Feature 1
1730
- - Feature 2
1731
- - Feature 3
1732
-
1733
- ### Unique Value Proposition
1734
-
1735
- *What makes your solution unique?*
1736
-
1737
- ---
1738
- *This is a draft. Edit and approve to continue.*
1739
- `,
1740
- audience: `# Target Audience
1741
-
1742
- **Generated:** ${date}
1743
-
1744
- ## Primary Audience
1745
-
1746
- *Describe your primary audience...*
1747
-
1748
- ## Market Segments
1749
-
1750
- 1. Segment 1
1751
- 2. Segment 2
1752
-
1753
- ## User Personas
1754
-
1755
- ### Persona 1
1756
-
1757
- **Role:** *Job title*
1758
- **Goals:** *What they want to achieve*
1759
- **Pain Points:** *What frustrates them*
1760
-
1761
- ---
1762
- *This is a draft. Edit and approve to continue.*
1763
- `,
1764
- market: `# Market Analysis
1765
-
1766
- **Generated:** ${date}
1767
-
1768
- ## Market Size
1769
-
1770
- | Metric | Value |
1771
- |--------|-------|
1772
- | TAM | $X billion |
1773
- | SAM | $X million |
1774
- | SOM | $X million |
1775
-
1776
- ## Market Trends
1777
-
1778
- - Trend 1
1779
- - Trend 2
1780
-
1781
- ---
1782
- *This is a draft. Edit and approve to continue.*
1783
- `,
1784
- competitors: `# Competitive Analysis
1785
-
1786
- **Generated:** ${date}
1787
-
1788
- ## Direct Competitors
1789
-
1790
- | Company | Strengths | Weaknesses |
1791
- |---------|-----------|------------|
1792
- | Competitor 1 | ... | ... |
1793
-
1794
- ## Our Positioning
1795
-
1796
- *How we differentiate...*
1797
-
1798
- ## Key Differentiators
1799
-
1800
- 1. Differentiator 1
1801
- 2. Differentiator 2
1802
-
1803
- ---
1804
- *This is a draft. Edit and approve to continue.*
1805
- `,
1806
- 'business-model': `# Business Model
1807
-
1808
- **Generated:** ${date}
1809
-
1810
- ## Model Type
1811
-
1812
- *Subscription / Freemium / Usage-based / etc.*
1813
-
1814
- ## Revenue Streams
1815
-
1816
- 1. Primary revenue source
1817
- 2. Secondary revenue source
1818
-
1819
- ## Pricing Strategy
1820
-
1821
- | Tier | Price | Features |
1822
- |------|-------|----------|
1823
- | Free | $0 | Basic |
1824
- | Pro | $X/mo | Advanced |
1825
-
1826
- ---
1827
- *This is a draft. Edit and approve to continue.*
1828
- `,
1829
- prd: `# Product Requirements Document
1830
-
1831
- **Generated:** ${date}
1832
- **Version:** 1.0
1833
-
1834
- ## Product Vision
1835
-
1836
- *What we're building and why...*
1837
-
1838
- ## MVP Features
1839
-
1840
- | Feature | Priority | Description |
1841
- |---------|----------|-------------|
1842
- | Feature 1 | P1 | ... |
1843
- | Feature 2 | P1 | ... |
1844
-
1845
- ## User Stories
1846
-
1847
- ### US-001: User Login
1848
-
1849
- **As a** user
1850
- **I want to** log in to my account
1851
- **So that** I can access my data
1852
-
1853
- **Acceptance Criteria:**
1854
- - [ ] User can enter email/password
1855
- - [ ] System validates credentials
1856
- - [ ] User is redirected to dashboard
1857
-
1858
- ---
1859
- *This is a draft. Edit and approve to continue.*
1860
- `,
1861
- 'technical-spec': `# Technical Specification
1862
-
1863
- **Generated:** ${date}
1864
-
1865
- ## Technology Stack
1866
-
1867
- | Component | Technology |
1868
- |-----------|------------|
1869
- | Frontend | ... |
1870
- | Backend | ... |
1871
- | Database | ... |
1872
-
1873
- ## Architecture Overview
1874
-
1875
- *High-level architecture description...*
1876
-
1877
- ## Third-Party Integrations
1878
-
1879
- - Integration 1
1880
- - Integration 2
1881
-
1882
- ---
1883
- *This is a draft. Edit and approve to continue.*
1884
- `,
1885
- roadmap: `# Product Roadmap
1886
-
1887
- **Generated:** ${date}
1888
-
1889
- ## Development Phases
1890
-
1891
- ### Phase 1: MVP
1892
-
1893
- **Duration:** X weeks
1894
-
1895
- **Goals:**
1896
- - Launch core features
1897
- - Validate with early users
1898
-
1899
- **Deliverables:**
1900
- - [ ] Core feature 1
1901
- - [ ] Core feature 2
1902
-
1903
- ### Phase 2: Growth
1904
-
1905
- **Duration:** X months
1906
-
1907
- **Goals:**
1908
- - Scale user base
1909
- - Add key features
1910
-
1911
- ## Key Milestones
1912
-
1913
- | Milestone | Target Date | Status |
1914
- |-----------|-------------|--------|
1915
- | MVP Launch | TBD | Planned |
1916
- | Beta | TBD | Planned |
1917
-
1918
- ---
1919
- *This is a draft. Edit and approve to continue.*
1920
- `
1921
- };
1922
-
1923
- return templates[docType] || `# ${name}\n\n**Generated:** ${date}\n\n*Add content here...*\n`;
1924
- }
1925
-
1926
1634
  /**
1927
1635
  * Format quality score with color
1928
1636
  */