@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.
package/src/types.ts CHANGED
@@ -13,17 +13,53 @@ export interface ProjectConfig {
13
13
  course?: string;
14
14
  couchdbUrl?: string;
15
15
  theme: ThemeConfig;
16
+ // Course import configuration for static data layer
17
+ importCourseData?: boolean;
18
+ importServerUrl?: string;
19
+ importUsername?: string;
20
+ importPassword?: string;
21
+ importCourseIds?: string[];
16
22
  }
17
23
 
18
- export interface ThemeConfig {
19
- name: string;
24
+ export interface VuetifyThemeDefinition {
25
+ dark: boolean;
20
26
  colors: {
27
+ // Core semantic colors
21
28
  primary: string;
22
29
  secondary: string;
23
30
  accent: string;
31
+ error: string;
32
+ info: string;
33
+ success: string;
34
+ warning: string;
35
+
36
+ // Surface colors
37
+ background: string;
38
+ surface: string;
39
+ 'surface-bright': string;
40
+ 'surface-light': string;
41
+ 'surface-variant': string;
42
+ 'on-surface-variant': string;
43
+
44
+ // Derived colors
45
+ 'primary-darken-1': string;
46
+ 'secondary-darken-1': string;
47
+
48
+ // Text colors
49
+ 'on-primary': string;
50
+ 'on-secondary': string;
51
+ 'on-background': string;
52
+ 'on-surface': string;
24
53
  };
25
54
  }
26
55
 
56
+ export interface ThemeConfig {
57
+ name: string;
58
+ light: VuetifyThemeDefinition;
59
+ dark: VuetifyThemeDefinition;
60
+ defaultMode: 'light' | 'dark';
61
+ }
62
+
27
63
  export interface SkuilderConfig {
28
64
  title: string;
29
65
  course?: string;
@@ -39,34 +75,210 @@ export interface InitCommandOptions extends CliOptions {
39
75
  export const PREDEFINED_THEMES: Record<string, ThemeConfig> = {
40
76
  default: {
41
77
  name: 'default',
42
- colors: {
43
- primary: '#1976D2',
44
- secondary: '#424242',
45
- accent: '#82B1FF'
78
+ defaultMode: 'light',
79
+ light: {
80
+ dark: false,
81
+ colors: {
82
+ primary: '#1976D2',
83
+ secondary: '#424242',
84
+ accent: '#82B1FF',
85
+ error: '#F44336',
86
+ info: '#2196F3',
87
+ success: '#4CAF50',
88
+ warning: '#FF9800',
89
+ background: '#FFFFFF',
90
+ surface: '#FFFFFF',
91
+ 'surface-bright': '#FFFFFF',
92
+ 'surface-light': '#EEEEEE',
93
+ 'surface-variant': '#E3F2FD',
94
+ 'on-surface-variant': '#1976D2',
95
+ 'primary-darken-1': '#1565C0',
96
+ 'secondary-darken-1': '#212121',
97
+ 'on-primary': '#FFFFFF',
98
+ 'on-secondary': '#FFFFFF',
99
+ 'on-background': '#212121',
100
+ 'on-surface': '#212121',
101
+ }
102
+ },
103
+ dark: {
104
+ dark: true,
105
+ colors: {
106
+ primary: '#2196F3',
107
+ secondary: '#90A4AE',
108
+ accent: '#82B1FF',
109
+ error: '#FF5252',
110
+ info: '#2196F3',
111
+ success: '#4CAF50',
112
+ warning: '#FFC107',
113
+ background: '#121212',
114
+ surface: '#1E1E1E',
115
+ 'surface-bright': '#2C2C2C',
116
+ 'surface-light': '#2C2C2C',
117
+ 'surface-variant': '#1A237E',
118
+ 'on-surface-variant': '#82B1FF',
119
+ 'primary-darken-1': '#1976D2',
120
+ 'secondary-darken-1': '#546E7A',
121
+ 'on-primary': '#000000',
122
+ 'on-secondary': '#000000',
123
+ 'on-background': '#FFFFFF',
124
+ 'on-surface': '#FFFFFF',
125
+ }
46
126
  }
47
127
  },
48
128
  medical: {
49
129
  name: 'medical',
50
- colors: {
51
- primary: '#2E7D32',
52
- secondary: '#558B2F',
53
- accent: '#66BB6A'
130
+ defaultMode: 'light',
131
+ light: {
132
+ dark: false,
133
+ colors: {
134
+ primary: '#2E7D32',
135
+ secondary: '#558B2F',
136
+ accent: '#66BB6A',
137
+ error: '#D32F2F',
138
+ info: '#1976D2',
139
+ success: '#388E3C',
140
+ warning: '#F57C00',
141
+ background: '#FAFAFA',
142
+ surface: '#FFFFFF',
143
+ 'surface-bright': '#FFFFFF',
144
+ 'surface-light': '#F5F5F5',
145
+ 'surface-variant': '#E8F5E8',
146
+ 'on-surface-variant': '#2E7D32',
147
+ 'primary-darken-1': '#1B5E20',
148
+ 'secondary-darken-1': '#33691E',
149
+ 'on-primary': '#FFFFFF',
150
+ 'on-secondary': '#FFFFFF',
151
+ 'on-background': '#212121',
152
+ 'on-surface': '#212121',
153
+ }
154
+ },
155
+ dark: {
156
+ dark: true,
157
+ colors: {
158
+ primary: '#4CAF50',
159
+ secondary: '#8BC34A',
160
+ accent: '#81C784',
161
+ error: '#F44336',
162
+ info: '#2196F3',
163
+ success: '#4CAF50',
164
+ warning: '#FF9800',
165
+ background: '#121212',
166
+ surface: '#1E1E1E',
167
+ 'surface-bright': '#2C2C2C',
168
+ 'surface-light': '#2C2C2C',
169
+ 'surface-variant': '#1B2E1B',
170
+ 'on-surface-variant': '#81C784',
171
+ 'primary-darken-1': '#388E3C',
172
+ 'secondary-darken-1': '#689F38',
173
+ 'on-primary': '#000000',
174
+ 'on-secondary': '#000000',
175
+ 'on-background': '#FFFFFF',
176
+ 'on-surface': '#FFFFFF',
177
+ }
54
178
  }
55
179
  },
56
180
  educational: {
57
181
  name: 'educational',
58
- colors: {
59
- primary: '#F57C00',
60
- secondary: '#FF9800',
61
- accent: '#FFB74D'
182
+ defaultMode: 'light',
183
+ light: {
184
+ dark: false,
185
+ colors: {
186
+ primary: '#F57C00',
187
+ secondary: '#FF9800',
188
+ accent: '#FFB74D',
189
+ error: '#F44336',
190
+ info: '#2196F3',
191
+ success: '#4CAF50',
192
+ warning: '#FF9800',
193
+ background: '#FFFEF7',
194
+ surface: '#FFFFFF',
195
+ 'surface-bright': '#FFFFFF',
196
+ 'surface-light': '#FFF8E1',
197
+ 'surface-variant': '#FFF3E0',
198
+ 'on-surface-variant': '#F57C00',
199
+ 'primary-darken-1': '#E65100',
200
+ 'secondary-darken-1': '#F57C00',
201
+ 'on-primary': '#FFFFFF',
202
+ 'on-secondary': '#000000',
203
+ 'on-background': '#212121',
204
+ 'on-surface': '#212121',
205
+ }
206
+ },
207
+ dark: {
208
+ dark: true,
209
+ colors: {
210
+ primary: '#FF9800',
211
+ secondary: '#FFB74D',
212
+ accent: '#FFCC02',
213
+ error: '#FF5252',
214
+ info: '#2196F3',
215
+ success: '#4CAF50',
216
+ warning: '#FF9800',
217
+ background: '#121212',
218
+ surface: '#1E1E1E',
219
+ 'surface-bright': '#2C2C2C',
220
+ 'surface-light': '#2C2C2C',
221
+ 'surface-variant': '#2E1A00',
222
+ 'on-surface-variant': '#FFCC02',
223
+ 'primary-darken-1': '#F57C00',
224
+ 'secondary-darken-1': '#FF9800',
225
+ 'on-primary': '#000000',
226
+ 'on-secondary': '#000000',
227
+ 'on-background': '#FFFFFF',
228
+ 'on-surface': '#FFFFFF',
229
+ }
62
230
  }
63
231
  },
64
232
  corporate: {
65
233
  name: 'corporate',
66
- colors: {
67
- primary: '#37474F',
68
- secondary: '#546E7A',
69
- accent: '#78909C'
234
+ defaultMode: 'light',
235
+ light: {
236
+ dark: false,
237
+ colors: {
238
+ primary: '#37474F',
239
+ secondary: '#546E7A',
240
+ accent: '#78909C',
241
+ error: '#F44336',
242
+ info: '#2196F3',
243
+ success: '#4CAF50',
244
+ warning: '#FF9800',
245
+ background: '#FAFAFA',
246
+ surface: '#FFFFFF',
247
+ 'surface-bright': '#FFFFFF',
248
+ 'surface-light': '#F5F5F5',
249
+ 'surface-variant': '#ECEFF1',
250
+ 'on-surface-variant': '#37474F',
251
+ 'primary-darken-1': '#263238',
252
+ 'secondary-darken-1': '#455A64',
253
+ 'on-primary': '#FFFFFF',
254
+ 'on-secondary': '#FFFFFF',
255
+ 'on-background': '#212121',
256
+ 'on-surface': '#212121',
257
+ }
258
+ },
259
+ dark: {
260
+ dark: true,
261
+ colors: {
262
+ primary: '#607D8B',
263
+ secondary: '#78909C',
264
+ accent: '#90A4AE',
265
+ error: '#FF5252',
266
+ info: '#2196F3',
267
+ success: '#4CAF50',
268
+ warning: '#FFC107',
269
+ background: '#121212',
270
+ surface: '#1E1E1E',
271
+ 'surface-bright': '#2C2C2C',
272
+ 'surface-light': '#2C2C2C',
273
+ 'surface-variant': '#1C2429',
274
+ 'on-surface-variant': '#90A4AE',
275
+ 'primary-darken-1': '#455A64',
276
+ 'secondary-darken-1': '#546E7A',
277
+ 'on-primary': '#FFFFFF',
278
+ 'on-secondary': '#FFFFFF',
279
+ 'on-background': '#FFFFFF',
280
+ 'on-surface': '#FFFFFF',
281
+ }
70
282
  }
71
283
  }
72
284
  };
@@ -0,0 +1,77 @@
1
+ import { execFile } from 'child_process';
2
+ import { promisify } from 'util';
3
+ import chalk from 'chalk';
4
+ import path from 'path';
5
+
6
+ const execFileAsync = promisify(execFile);
7
+
8
+ export interface PackCoursesOptions {
9
+ server: string;
10
+ username?: string;
11
+ password?: string;
12
+ courseIds: string[];
13
+ targetProjectDir: string;
14
+ }
15
+
16
+ /**
17
+ * Pack courses using the existing CLI pack command
18
+ * Outputs to targetProjectDir/public/static-courses/
19
+ */
20
+ export async function packCourses(options: PackCoursesOptions): Promise<void> {
21
+ const { server, username, password, courseIds, targetProjectDir } = options;
22
+
23
+ // Output directory will be public/static-courses in the target project
24
+ const outputDir = path.join(targetProjectDir, 'public', 'static-courses');
25
+
26
+ console.log(chalk.cyan(`\nšŸ“¦ Packing ${courseIds.length} course(s) to ${outputDir}...`));
27
+
28
+ for (const courseId of courseIds) {
29
+ const args = ['pack', courseId, '--server', server, '--output', outputDir];
30
+
31
+ if (username) {
32
+ args.push('--username', username);
33
+ }
34
+
35
+ if (password) {
36
+ args.push('--password', password);
37
+ }
38
+
39
+ const cliPath = path.join(process.cwd(), 'dist', 'cli.js');
40
+ const commandArgs = ['pack', courseId, '--server', server, '--output', outputDir];
41
+
42
+ if (username) {
43
+ commandArgs.push('--username', username);
44
+ }
45
+
46
+ if (password) {
47
+ commandArgs.push('--password', password);
48
+ }
49
+
50
+ try {
51
+ console.log(chalk.gray(`šŸ”„ Packing course: ${courseId}`));
52
+
53
+ const { stdout, stderr } = await execFileAsync('node', [cliPath, ...commandArgs], {
54
+ cwd: process.cwd(),
55
+ maxBuffer: 1024 * 1024 * 10, // 10MB buffer for large outputs
56
+ });
57
+
58
+ if (stdout) {
59
+ console.log(stdout);
60
+ }
61
+
62
+ if (stderr) {
63
+ console.error(chalk.yellow(stderr));
64
+ }
65
+
66
+ console.log(chalk.green(`āœ… Successfully packed course: ${courseId}`));
67
+ } catch (error: unknown) {
68
+ console.error(chalk.red(`āŒ Failed to pack course ${courseId}:`));
69
+ console.error(chalk.red(error instanceof Error ? error.message : String(error)));
70
+
71
+ // Continue with other courses instead of failing completely
72
+ continue;
73
+ }
74
+ }
75
+
76
+ console.log(chalk.green(`\nšŸŽ‰ All courses packed to: ${outputDir}`));
77
+ }