Skip to content

Commit 4664bc7

Browse files
committed
refactor: clean up unused lesson imports and improve code consistency
1 parent 223cb2d commit 4664bc7

File tree

3 files changed

+4
-29
lines changed

3 files changed

+4
-29
lines changed

src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async function initializeModules() {
9292
const progressData = lessonEngine.loadUserProgress();
9393
const lastModuleId = progressData?.lastModuleId;
9494

95-
if (lastModuleId && modules.find(m => m.id === lastModuleId)) {
95+
if (lastModuleId && modules.find((m) => m.id === lastModuleId)) {
9696
selectModule(lastModuleId);
9797
} else if (modules.length > 0) {
9898
selectModule(modules[0].id);

src/config/lessons.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,10 @@
55
// Import lesson configs
66
import basicSelectorsConfig from "../../lessons/00-basic-selectors.json";
77
import advancedSelectorsConfig from "../../lessons/01-advanced-selectors.json";
8-
import carouselConfig from "../../lessons/02-css-only-carousel.json";
9-
// import basicsConfig from "../../lessons/00-basics.json";
10-
// import boxModelConfig from "../../lessons/01-box-model.json";
11-
// import selectorsConfig from "../../lessons/02-selectors.json";
12-
// import colorsConfig from "../../lessons/03-colors.json";
13-
// import typographyConfig from "../../lessons/04-typography.json";
14-
import unitVariablesConfig from "../../lessons/05-units-variables.json";
15-
// import transitionsAnimationsConfig from "../../lessons/06-transitions-animations.json";
16-
// import layoutConfig from "../../lessons/07-layouts.json";
17-
// import responsiveConfig from "../../lessons/08-responsive.json";
188
import tailwindConfig from "../../lessons/10-tailwind-basics.json";
199

2010
// Module store
21-
const moduleStore = [
22-
// basicsConfig,
23-
basicSelectorsConfig,
24-
advancedSelectorsConfig,
25-
tailwindConfig
26-
// carouselConfig
27-
// boxModelConfig,
28-
// selectorsConfig,
29-
// colorsConfig
30-
// typographyConfig,
31-
// unitVariablesConfig
32-
// transitionsAnimationsConfig,
33-
// layoutConfig,
34-
// responsiveConfig
35-
];
11+
const moduleStore = [basicSelectorsConfig, advancedSelectorsConfig, tailwindConfig];
3612

3713
/**
3814
* Load all available modules

src/impl/LessonEngine.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Single source of truth for lesson state and progress
44
*/
55
import { validateUserCode } from "../helpers/validator.js";
6-
import { showFeedback } from "../helpers/renderer.js";
76

87
export class LessonEngine {
98
constructor() {
@@ -55,7 +54,7 @@ export class LessonEngine {
5554
* @returns {boolean} Whether the operation was successful
5655
*/
5756
setModuleById(moduleId) {
58-
const module = this.modules.find(m => m.id === moduleId);
57+
const module = this.modules.find((m) => m.id === moduleId);
5958
if (!module) return false;
6059

6160
this.setModule(module);
@@ -393,4 +392,4 @@ export class LessonEngine {
393392
localStorage.removeItem("codeCrispies.userCode");
394393
localStorage.removeItem("codeCrispies.lastModuleId");
395394
}
396-
}
395+
}

0 commit comments

Comments
 (0)