@vue-skuilder/cli 0.1.4 → 0.1.6

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.
@@ -1,10 +1,122 @@
1
1
  import inquirer from 'inquirer';
2
2
  import chalk from 'chalk';
3
+ import PouchDB from 'pouchdb';
3
4
  import { PREDEFINED_THEMES } from '../types.js';
5
+ /**
6
+ * Fetch available courses from a CouchDB server
7
+ */
8
+ async function fetchAvailableCourses(serverUrl, username, password) {
9
+ const dbUrl = `${serverUrl}/coursedb-lookup`;
10
+ const dbOptions = {};
11
+ if (username && password) {
12
+ dbOptions.auth = {
13
+ username,
14
+ password,
15
+ };
16
+ }
17
+ console.log(chalk.gray(`📡 Connecting to: ${dbUrl}`));
18
+ const lookupDB = new PouchDB(dbUrl, dbOptions);
19
+ try {
20
+ await lookupDB.info();
21
+ console.log(chalk.green('✅ Connected to course lookup database'));
22
+ }
23
+ catch (error) {
24
+ let errorMessage = 'Unknown error';
25
+ if (error instanceof Error) {
26
+ errorMessage = error.message;
27
+ }
28
+ else if (typeof error === 'string') {
29
+ errorMessage = error;
30
+ }
31
+ else if (error && typeof error === 'object' && 'message' in error) {
32
+ errorMessage = String(error.message);
33
+ }
34
+ throw new Error(`Failed to connect to course lookup database: ${errorMessage}`);
35
+ }
36
+ try {
37
+ const result = await lookupDB.allDocs({ include_docs: true });
38
+ const courses = result.rows
39
+ .filter((row) => row.doc && !row.id.startsWith('_'))
40
+ .map((row) => {
41
+ const doc = row.doc;
42
+ return {
43
+ id: row.id,
44
+ name: doc.name || doc.title || `Course ${row.id}`,
45
+ description: doc.description || undefined,
46
+ };
47
+ });
48
+ console.log(chalk.green(`✅ Found ${courses.length} available courses`));
49
+ return courses;
50
+ }
51
+ catch {
52
+ console.warn(chalk.yellow('⚠️ Could not list courses from lookup database'));
53
+ return [];
54
+ }
55
+ }
56
+ /**
57
+ * Convert hex color to closest ANSI color code
58
+ */
59
+ function hexToAnsi(hex) {
60
+ // Remove # if present
61
+ hex = hex.replace('#', '');
62
+ // Convert hex to RGB
63
+ const r = parseInt(hex.substr(0, 2), 16);
64
+ const g = parseInt(hex.substr(2, 2), 16);
65
+ const b = parseInt(hex.substr(4, 2), 16);
66
+ // Convert to 256-color ANSI
67
+ const ansiCode = 16 + 36 * Math.round((r / 255) * 5) + 6 * Math.round((g / 255) * 5) + Math.round((b / 255) * 5);
68
+ return `\x1b[48;5;${ansiCode}m`;
69
+ }
70
+ /**
71
+ * Create a color swatch for terminal display
72
+ */
73
+ function createColorSwatch(hex, label) {
74
+ const colorCode = hexToAnsi(hex);
75
+ const reset = '\x1b[0m';
76
+ return `${colorCode} ${reset} ${label}`;
77
+ }
78
+ /**
79
+ * Create theme preview with color swatches
80
+ */
81
+ function createThemePreview(themeName) {
82
+ const theme = PREDEFINED_THEMES[themeName];
83
+ const lightColors = theme.light.colors;
84
+ const primarySwatch = createColorSwatch(lightColors.primary, 'Primary');
85
+ const secondarySwatch = createColorSwatch(lightColors.secondary, 'Secondary');
86
+ const accentSwatch = createColorSwatch(lightColors.accent, 'Accent');
87
+ return `${primarySwatch} ${secondarySwatch} ${accentSwatch}`;
88
+ }
89
+ /**
90
+ * Display comprehensive theme preview after selection
91
+ */
92
+ export function displayThemePreview(themeName) {
93
+ const theme = PREDEFINED_THEMES[themeName];
94
+ console.log(chalk.cyan('\n🎨 Theme Color Palette:'));
95
+ console.log(chalk.white(` ${theme.name.toUpperCase()} THEME`));
96
+ // Light theme colors
97
+ console.log(chalk.white('\n Light Mode:'));
98
+ const lightColors = theme.light.colors;
99
+ console.log(` ${createColorSwatch(lightColors.primary, `Primary: ${lightColors.primary}`)}`);
100
+ console.log(` ${createColorSwatch(lightColors.secondary, `Secondary: ${lightColors.secondary}`)}`);
101
+ console.log(` ${createColorSwatch(lightColors.accent, `Accent: ${lightColors.accent}`)}`);
102
+ console.log(` ${createColorSwatch(lightColors.success, `Success: ${lightColors.success}`)}`);
103
+ console.log(` ${createColorSwatch(lightColors.warning, `Warning: ${lightColors.warning}`)}`);
104
+ console.log(` ${createColorSwatch(lightColors.error, `Error: ${lightColors.error}`)}`);
105
+ // Dark theme colors
106
+ console.log(chalk.white('\n Dark Mode:'));
107
+ const darkColors = theme.dark.colors;
108
+ console.log(` ${createColorSwatch(darkColors.primary, `Primary: ${darkColors.primary}`)}`);
109
+ console.log(` ${createColorSwatch(darkColors.secondary, `Secondary: ${darkColors.secondary}`)}`);
110
+ console.log(` ${createColorSwatch(darkColors.accent, `Accent: ${darkColors.accent}`)}`);
111
+ console.log(` ${createColorSwatch(darkColors.success, `Success: ${darkColors.success}`)}`);
112
+ console.log(` ${createColorSwatch(darkColors.warning, `Warning: ${darkColors.warning}`)}`);
113
+ console.log(` ${createColorSwatch(darkColors.error, `Error: ${darkColors.error}`)}`);
114
+ console.log(chalk.gray(`\n Default mode: ${theme.defaultMode}`));
115
+ }
4
116
  export async function gatherProjectConfig(projectName, options) {
5
117
  console.log(chalk.cyan('\n🚀 Creating a new Skuilder course application\n'));
6
118
  let config = {
7
- projectName
119
+ projectName,
8
120
  };
9
121
  if (options.interactive) {
10
122
  const answers = await inquirer.prompt([
@@ -13,7 +125,7 @@ export async function gatherProjectConfig(projectName, options) {
13
125
  name: 'title',
14
126
  message: 'Course title:',
15
127
  default: formatProjectName(projectName),
16
- validate: (input) => input.trim().length > 0 || 'Course title is required'
128
+ validate: (input) => input.trim().length > 0 || 'Course title is required',
17
129
  },
18
130
  {
19
131
  type: 'list',
@@ -22,14 +134,14 @@ export async function gatherProjectConfig(projectName, options) {
22
134
  choices: [
23
135
  {
24
136
  name: 'Dynamic (Connect to CouchDB server)',
25
- value: 'couch'
137
+ value: 'couch',
26
138
  },
27
139
  {
28
140
  name: 'Static (Self-contained JSON files)',
29
- value: 'static'
30
- }
141
+ value: 'static',
142
+ },
31
143
  ],
32
- default: options.dataLayer === 'dynamic' ? 'couch' : 'static'
144
+ default: options.dataLayer === 'dynamic' ? 'couch' : 'static',
33
145
  },
34
146
  {
35
147
  type: 'input',
@@ -47,13 +159,50 @@ export async function gatherProjectConfig(projectName, options) {
47
159
  catch {
48
160
  return 'Please enter a valid URL';
49
161
  }
50
- }
162
+ },
51
163
  },
52
164
  {
53
165
  type: 'input',
54
166
  name: 'courseId',
55
167
  message: 'Course ID to import (optional):',
56
- when: (answers) => answers.dataLayerType === 'couch'
168
+ when: (answers) => answers.dataLayerType === 'couch',
169
+ },
170
+ {
171
+ type: 'confirm',
172
+ name: 'importCourseData',
173
+ message: 'Would you like to import course data from a CouchDB server?',
174
+ default: false,
175
+ when: (answers) => answers.dataLayerType === 'static',
176
+ },
177
+ {
178
+ type: 'input',
179
+ name: 'importServerUrl',
180
+ message: 'CouchDB server URL:',
181
+ default: 'http://localhost:5984',
182
+ when: (answers) => answers.dataLayerType === 'static' && answers.importCourseData,
183
+ validate: (input) => {
184
+ if (!input.trim())
185
+ return 'CouchDB URL is required';
186
+ try {
187
+ new URL(input);
188
+ return true;
189
+ }
190
+ catch {
191
+ return 'Please enter a valid URL';
192
+ }
193
+ },
194
+ },
195
+ {
196
+ type: 'input',
197
+ name: 'importUsername',
198
+ message: 'Username:',
199
+ when: (answers) => answers.dataLayerType === 'static' && answers.importCourseData,
200
+ },
201
+ {
202
+ type: 'password',
203
+ name: 'importPassword',
204
+ message: 'Password:',
205
+ when: (answers) => answers.dataLayerType === 'static' && answers.importCourseData,
57
206
  },
58
207
  {
59
208
  type: 'list',
@@ -61,24 +210,24 @@ export async function gatherProjectConfig(projectName, options) {
61
210
  message: 'Select theme:',
62
211
  choices: [
63
212
  {
64
- name: 'Default (Material Blue)',
65
- value: 'default'
213
+ name: `Default (Material Blue) ${createThemePreview('default')}`,
214
+ value: 'default',
66
215
  },
67
216
  {
68
- name: 'Medical (Healthcare Green)',
69
- value: 'medical'
217
+ name: `Medical (Healthcare Green) ${createThemePreview('medical')}`,
218
+ value: 'medical',
70
219
  },
71
220
  {
72
- name: 'Educational (Academic Orange)',
73
- value: 'educational'
221
+ name: `Educational (Academic Orange) ${createThemePreview('educational')}`,
222
+ value: 'educational',
74
223
  },
75
224
  {
76
- name: 'Corporate (Professional Gray)',
77
- value: 'corporate'
78
- }
225
+ name: `Corporate (Professional Gray) ${createThemePreview('corporate')}`,
226
+ value: 'corporate',
227
+ },
79
228
  ],
80
- default: options.theme
81
- }
229
+ default: options.theme,
230
+ },
82
231
  ]);
83
232
  config = {
84
233
  ...config,
@@ -86,8 +235,106 @@ export async function gatherProjectConfig(projectName, options) {
86
235
  dataLayerType: answers.dataLayerType,
87
236
  couchdbUrl: answers.couchdbUrl,
88
237
  course: answers.courseId,
89
- theme: PREDEFINED_THEMES[answers.themeName]
238
+ theme: PREDEFINED_THEMES[answers.themeName],
239
+ importCourseData: answers.importCourseData,
240
+ importServerUrl: answers.importServerUrl,
241
+ importUsername: answers.importUsername,
242
+ importPassword: answers.importPassword,
90
243
  };
244
+ // If user wants to import course data, fetch available courses and let them select
245
+ if (answers.importCourseData && answers.importServerUrl) {
246
+ try {
247
+ console.log(chalk.cyan('\n📚 Fetching available courses...'));
248
+ const availableCourses = await fetchAvailableCourses(answers.importServerUrl, answers.importUsername, answers.importPassword);
249
+ if (availableCourses.length > 0) {
250
+ const courseSelectionAnswers = await inquirer.prompt([
251
+ {
252
+ type: 'checkbox',
253
+ name: 'selectedCourseIds',
254
+ message: 'Select courses to import:',
255
+ choices: availableCourses.map((course) => ({
256
+ name: `${course.name} (${course.id})`,
257
+ value: course.id,
258
+ short: course.name,
259
+ })),
260
+ validate: (selected) => {
261
+ if (selected.length === 0) {
262
+ return 'Please select at least one course to import';
263
+ }
264
+ return true;
265
+ },
266
+ },
267
+ ]);
268
+ config.importCourseIds = courseSelectionAnswers.selectedCourseIds;
269
+ }
270
+ else {
271
+ console.log(chalk.yellow('⚠️ No courses found in the lookup database.'));
272
+ const manualCourseAnswers = await inquirer.prompt([
273
+ {
274
+ type: 'input',
275
+ name: 'manualCourseIds',
276
+ message: 'Enter course IDs to import (comma-separated):',
277
+ validate: (input) => {
278
+ if (!input.trim()) {
279
+ return 'Please enter at least one course ID';
280
+ }
281
+ return true;
282
+ },
283
+ },
284
+ ]);
285
+ config.importCourseIds = manualCourseAnswers.manualCourseIds
286
+ .split(',')
287
+ .map((id) => id.trim())
288
+ .filter((id) => id.length > 0);
289
+ }
290
+ }
291
+ catch (error) {
292
+ console.error(chalk.red('❌ Failed to fetch courses:'));
293
+ let errorMessage = 'Unknown error';
294
+ if (error instanceof Error) {
295
+ errorMessage = error.message;
296
+ }
297
+ else if (typeof error === 'string') {
298
+ errorMessage = error;
299
+ }
300
+ else if (error && typeof error === 'object' && 'message' in error) {
301
+ errorMessage = String(error.message);
302
+ }
303
+ console.error(chalk.red(errorMessage));
304
+ const fallbackAnswers = await inquirer.prompt([
305
+ {
306
+ type: 'confirm',
307
+ name: 'continueAnyway',
308
+ message: 'Continue with manual course ID entry?',
309
+ default: true,
310
+ },
311
+ ]);
312
+ if (fallbackAnswers.continueAnyway) {
313
+ const manualCourseAnswers = await inquirer.prompt([
314
+ {
315
+ type: 'input',
316
+ name: 'manualCourseIds',
317
+ message: 'Enter course IDs to import (comma-separated):',
318
+ validate: (input) => {
319
+ if (!input.trim()) {
320
+ return 'Please enter at least one course ID';
321
+ }
322
+ return true;
323
+ },
324
+ },
325
+ ]);
326
+ config.importCourseIds = manualCourseAnswers.manualCourseIds
327
+ .split(',')
328
+ .map((id) => id.trim())
329
+ .filter((id) => id.length > 0);
330
+ }
331
+ else {
332
+ config.importCourseData = false;
333
+ }
334
+ }
335
+ }
336
+ // Show comprehensive theme preview
337
+ displayThemePreview(answers.themeName);
91
338
  }
92
339
  else {
93
340
  // Non-interactive mode: use provided options
@@ -97,7 +344,7 @@ export async function gatherProjectConfig(projectName, options) {
97
344
  dataLayerType: options.dataLayer === 'dynamic' ? 'couch' : 'static',
98
345
  couchdbUrl: options.couchdbUrl,
99
346
  course: options.courseId,
100
- theme: PREDEFINED_THEMES[options.theme]
347
+ theme: PREDEFINED_THEMES[options.theme],
101
348
  };
102
349
  // Validate required fields for non-interactive mode
103
350
  if (config.dataLayerType === 'couch' && !config.couchdbUrl) {
@@ -117,69 +364,22 @@ export async function confirmProjectCreation(config, projectPath) {
117
364
  if (config.course) {
118
365
  console.log(` Course ID: ${chalk.white(config.course)}`);
119
366
  }
120
- console.log(` Theme: ${chalk.white(config.theme.name)}`);
367
+ console.log(` Theme: ${chalk.white(config.theme.name)} ${createThemePreview(config.theme.name)}`);
121
368
  console.log(` Directory: ${chalk.white(projectPath)}`);
122
369
  const { confirmed } = await inquirer.prompt([
123
370
  {
124
371
  type: 'confirm',
125
372
  name: 'confirmed',
126
373
  message: 'Create project with these settings?',
127
- default: true
128
- }
129
- ]);
130
- return confirmed;
131
- }
132
- export async function promptForCustomTheme() {
133
- console.log(chalk.cyan('\n🎨 Custom Theme Configuration\n'));
134
- const answers = await inquirer.prompt([
135
- {
136
- type: 'input',
137
- name: 'name',
138
- message: 'Theme name:',
139
- validate: (input) => input.trim().length > 0 || 'Theme name is required'
140
- },
141
- {
142
- type: 'input',
143
- name: 'primary',
144
- message: 'Primary color (hex):',
145
- default: '#1976D2',
146
- validate: validateHexColor
374
+ default: true,
147
375
  },
148
- {
149
- type: 'input',
150
- name: 'secondary',
151
- message: 'Secondary color (hex):',
152
- default: '#424242',
153
- validate: validateHexColor
154
- },
155
- {
156
- type: 'input',
157
- name: 'accent',
158
- message: 'Accent color (hex):',
159
- default: '#82B1FF',
160
- validate: validateHexColor
161
- }
162
376
  ]);
163
- return {
164
- name: answers.name,
165
- colors: {
166
- primary: answers.primary,
167
- secondary: answers.secondary,
168
- accent: answers.accent
169
- }
170
- };
377
+ return confirmed;
171
378
  }
172
379
  function formatProjectName(projectName) {
173
380
  return projectName
174
381
  .split(/[-_\s]+/)
175
- .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
382
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
176
383
  .join(' ');
177
384
  }
178
- function validateHexColor(input) {
179
- const hexColorRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
180
- if (!hexColorRegex.test(input)) {
181
- return 'Please enter a valid hex color (e.g., #1976D2)';
182
- }
183
- return true;
184
- }
185
385
  //# sourceMappingURL=prompts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/utils/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA6B,iBAAiB,EAAe,MAAM,aAAa,CAAC;AAExF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,WAAmB,EACnB,OAAmB;IAEnB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC,CAAC;IAE7E,IAAI,MAAM,GAA2B;QACnC,WAAW;KACZ,CAAC;IAEF,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;YACpC;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,eAAe;gBACxB,OAAO,EAAE,iBAAiB,CAAC,WAAW,CAAC;gBACvC,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,IAAI,0BAA0B;aACnF;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,kBAAkB;gBAC3B,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,qCAAqC;wBAC3C,KAAK,EAAE,OAAO;qBACf;oBACD;wBACE,IAAI,EAAE,oCAAoC;wBAC1C,KAAK,EAAE,QAAQ;qBAChB;iBACF;gBACD,OAAO,EAAE,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CA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;SACzE,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
@@ -21,6 +21,10 @@ export declare function createViteConfig(viteConfigPath: string): Promise<void>;
21
21
  * Generate skuilder.config.json based on project configuration
22
22
  */
23
23
  export declare function generateSkuilderConfig(configPath: string, config: ProjectConfig): Promise<void>;
24
+ /**
25
+ * Transform tsconfig.json to be standalone (remove base config reference)
26
+ */
27
+ export declare function transformTsConfig(tsconfigPath: string): Promise<void>;
24
28
  /**
25
29
  * Generate .gitignore file for the project
26
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/utils/template.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAC;AAK5D;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAa5D;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,eAAe,GAAE,MAAM,EAAgD,GACtE,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CA4Bf;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8D5E;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsH5E;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,aAAa,GACpB,OAAO,C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AAM,EACnB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAoCf"}
@@ -29,7 +29,7 @@ export async function copyDirectory(source, destination, excludePatterns = ['nod
29
29
  const sourcePath = path.join(source, entry.name);
30
30
  const destPath = path.join(destination, entry.name);
31
31
  // Skip excluded patterns
32
- if (excludePatterns.some(pattern => entry.name.includes(pattern))) {
32
+ if (excludePatterns.some((pattern) => entry.name.includes(pattern))) {
33
33
  continue;
34
34
  }
35
35
  if (entry.isDirectory()) {
@@ -85,7 +85,7 @@ export default defineConfig({
85
85
  alias: {
86
86
  // Alias for internal src paths
87
87
  '@': fileURLToPath(new URL('./src', import.meta.url)),
88
-
88
+
89
89
  // Add events alias if needed (often required by dependencies)
90
90
  events: 'events',
91
91
  },
@@ -140,11 +140,16 @@ export default defineConfig({
140
140
  export async function generateSkuilderConfig(configPath, config) {
141
141
  const skuilderConfig = {
142
142
  title: config.title,
143
- dataLayerType: config.dataLayerType
143
+ dataLayerType: config.dataLayerType,
144
144
  };
145
- if (config.course) {
145
+ // For dynamic data layer, use the specified course ID
146
+ if (config.dataLayerType === 'couch' && config.course) {
146
147
  skuilderConfig.course = config.course;
147
148
  }
149
+ // For static data layer with imported courses, use the first course as primary
150
+ if (config.dataLayerType === 'static' && config.importCourseIds && config.importCourseIds.length > 0) {
151
+ skuilderConfig.course = config.importCourseIds[0];
152
+ }
148
153
  if (config.couchdbUrl) {
149
154
  skuilderConfig.couchdbUrl = config.couchdbUrl;
150
155
  }
@@ -153,6 +158,38 @@ export async function generateSkuilderConfig(configPath, config) {
153
158
  }
154
159
  await fs.writeFile(configPath, JSON.stringify(skuilderConfig, null, 2));
155
160
  }
161
+ /**
162
+ * Transform tsconfig.json to be standalone (remove base config reference)
163
+ */
164
+ export async function transformTsConfig(tsconfigPath) {
165
+ const content = await fs.readFile(tsconfigPath, 'utf-8');
166
+ const tsconfig = JSON.parse(content);
167
+ // Remove the extends reference to the monorepo base config
168
+ delete tsconfig.extends;
169
+ // Merge in the essential settings from the base config that scaffolded apps need
170
+ tsconfig.compilerOptions = {
171
+ ...tsconfig.compilerOptions,
172
+ // Essential TypeScript settings from base config
173
+ strict: true,
174
+ skipLibCheck: true,
175
+ forceConsistentCasingInFileNames: true,
176
+ esModuleInterop: true,
177
+ allowSyntheticDefaultImports: true,
178
+ // Keep existing Vue/Vite-specific settings
179
+ target: tsconfig.compilerOptions.target || 'ESNext',
180
+ useDefineForClassFields: tsconfig.compilerOptions.useDefineForClassFields,
181
+ module: tsconfig.compilerOptions.module || 'ESNext',
182
+ moduleResolution: tsconfig.compilerOptions.moduleResolution || 'bundler',
183
+ jsx: tsconfig.compilerOptions.jsx || 'preserve',
184
+ resolveJsonModule: tsconfig.compilerOptions.resolveJsonModule,
185
+ isolatedModules: tsconfig.compilerOptions.isolatedModules,
186
+ lib: tsconfig.compilerOptions.lib || ['ESNext', 'DOM'],
187
+ noEmit: tsconfig.compilerOptions.noEmit,
188
+ baseUrl: tsconfig.compilerOptions.baseUrl || '.',
189
+ types: tsconfig.compilerOptions.types || ['vite/client'],
190
+ };
191
+ await fs.writeFile(tsconfigPath, JSON.stringify(tsconfig, null, 2));
192
+ }
156
193
  /**
157
194
  * Generate .gitignore file for the project
158
195
  */
@@ -278,9 +315,17 @@ Thumbs.db
278
315
  * Generate project README.md
279
316
  */
280
317
  export async function generateReadme(readmePath, config) {
281
- const dataLayerInfo = config.dataLayerType === 'static'
282
- ? 'This project uses a static data layer with JSON files.'
283
- : `This project connects to CouchDB at: ${config.couchdbUrl || '[URL not specified]'}`;
318
+ let dataLayerInfo = '';
319
+ if (config.dataLayerType === 'static') {
320
+ dataLayerInfo = 'This project uses a static data layer with JSON files.';
321
+ if (config.importCourseIds && config.importCourseIds.length > 0) {
322
+ const courseList = config.importCourseIds.map(id => `- ${id}`).join('\n');
323
+ dataLayerInfo += `\n\n**Imported Courses:**\n${courseList}\n\nCourse data is stored in \`public/static-courses/\` and loaded automatically.`;
324
+ }
325
+ }
326
+ else {
327
+ dataLayerInfo = `This project connects to CouchDB at: ${config.couchdbUrl || '[URL not specified]'}`;
328
+ }
284
329
  const readme = `# ${config.title}
285
330
 
286
331
  A Skuilder course application built with Vue 3, Vuetify, and Pinia.
@@ -316,10 +361,42 @@ Course configuration is managed in \`skuilder.config.json\`. You can modify:
316
361
 
317
362
  ## Theme
318
363
 
319
- Current theme: **${config.theme.name}**
320
- - Primary: ${config.theme.colors.primary}
321
- - Secondary: ${config.theme.colors.secondary}
322
- - Accent: ${config.theme.colors.accent}
364
+ Current theme: **${config.theme.name}** (${config.theme.defaultMode} mode)
365
+ - Primary: ${config.theme.light.colors.primary}
366
+ - Secondary: ${config.theme.light.colors.secondary}
367
+ - Accent: ${config.theme.light.colors.accent}
368
+
369
+ This theme includes both light and dark variants. The application will use the ${config.theme.defaultMode} theme by default, but users can toggle between light and dark modes in their settings.
370
+
371
+ ### Theme Customization
372
+
373
+ To customize the theme colors, edit the \`theme\` section in \`skuilder.config.json\`:
374
+
375
+ \`\`\`json
376
+ {
377
+ "theme": {
378
+ "name": "custom",
379
+ "defaultMode": "light",
380
+ "light": {
381
+ "dark": false,
382
+ "colors": {
383
+ "primary": "#your-color",
384
+ "secondary": "#your-color",
385
+ "accent": "#your-color"
386
+ // ... other semantic colors
387
+ }
388
+ },
389
+ "dark": {
390
+ "dark": true,
391
+ "colors": {
392
+ // ... dark variant colors
393
+ }
394
+ }
395
+ }
396
+ }
397
+ \`\`\`
398
+
399
+ The theme system supports all Vuetify semantic colors including error, success, warning, info, background, surface, and text colors. Changes to the configuration file are applied automatically on restart.
323
400
 
324
401
  ## Testing
325
402
 
@@ -355,6 +432,11 @@ export async function processTemplate(projectPath, config, cliVersion) {
355
432
  if (existsSync(viteConfigPath)) {
356
433
  await createViteConfig(viteConfigPath);
357
434
  }
435
+ console.log(chalk.blue('🔧 Transforming tsconfig.json...'));
436
+ const tsconfigPath = path.join(projectPath, 'tsconfig.json');
437
+ if (existsSync(tsconfigPath)) {
438
+ await transformTsConfig(tsconfigPath);
439
+ }
358
440
  console.log(chalk.blue('🔧 Generating configuration...'));
359
441
  const configPath = path.join(projectPath, 'skuilder.config.json');
360
442
  await generateSkuilderConfig(configPath, config);