Fix dependency injection and TypeScript comparison in templates#51
Merged
Conversation
generate.js
— Re-added the resolveDependencies(projectPath, config) call between the Handlebars compilation step and npm install. Now the dependency injection actually runs.
All layout templates (ecommerce, blog, saas, school, vite-react) — Changed '{{includeSidebar}}' === 'true' to ('{{includeSidebar}}' as string) === 'true'. When includeSidebar compiles to 'false', TypeScript's strict mode was flagging the comparison as impossible. The as string cast tells TypeScript the value is dynamic.
Fix dependency injection and TypeScript comparison in templates
Josephat-S
added a commit
that referenced
this pull request
May 25, 2026
Merge pull request #51 from Ebyte-Lab/dev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements across the codebase, mainly focusing on enhancing CI workflow flexibility, improving dependency management during project generation, and ensuring consistent type handling for template sidebar logic.
CI/CD and Automation Improvements:
The GitHub Actions CI workflow in
.github/workflows/ci.ymlis now triggered on bothmainanddevbranches, and switches fromnpm installto the more reliablenpm cifor dependency installation. This ensures faster and more consistent builds.In
src/generate.js, a new step has been added to resolve dynamic dependencies based on user choices before installing them, making project scaffolding more robust and customizable.Template Consistency and Type Handling:
templates/blog/nextjs-monolith/app/layout.tsx,templates/ecommerce/nextjs-monolith/app/layout.tsx,templates/saas/nextjs-monolith/app/layout.tsx,templates/school/nextjs-monolith/app/layout.tsx, andtemplates/saas/vite-react/src/components/Layout.tsx) to explicitly cast the template variable tostringbefore comparison. This improves type safety and prevents potential runtime errors. [1] [2] [3] [4] [5]