From 942fca3924ede104eb0550bb481a8b483658b3c3 Mon Sep 17 00:00:00 2001 From: Josephat-S Date: Mon, 25 May 2026 15:57:13 +0200 Subject: [PATCH] =?UTF-8?q?Fixed:=20generate.js=20=20=E2=80=94=20Re-added?= =?UTF-8?q?=20the=20resolveDependencies(projectPath,=20config)=20call=20be?= =?UTF-8?q?tween=20the=20Handlebars=20compilation=20step=20and=20npm=20ins?= =?UTF-8?q?tall.=20Now=20the=20dependency=20injection=20actually=20runs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/ci.yml | 10 +++++++--- package-lock.json | 2 ++ src/generate.js | 5 ++++- templates/blog/nextjs-monolith/app/layout.tsx | 2 +- templates/ecommerce/nextjs-monolith/app/layout.tsx | 2 +- templates/saas/nextjs-monolith/app/layout.tsx | 2 +- templates/saas/vite-react/src/components/Layout.tsx | 2 +- templates/school/nextjs-monolith/app/layout.tsx | 2 +- 8 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a19a51..08c177f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,16 +2,20 @@ name: CI on: pull_request: - branches: [main] + branches: [main, dev] jobs: lint: runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' - - run: npm install - - run: npm run lint + + - run: npm ci + + - run: npm run lint \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7df8a7d..33e29ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -522,6 +522,7 @@ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -815,6 +816,7 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", diff --git a/src/generate.js b/src/generate.js index 435b1bc..f231091 100644 --- a/src/generate.js +++ b/src/generate.js @@ -101,7 +101,10 @@ export async function generateProject(config) { const configFilePath = path.join(projectPath, 'opusify.config.json'); fs.writeFileSync(configFilePath, JSON.stringify(config, null, 2)); - // 5. AUTOMATION PHASE: Install Dependencies + // 5. Resolve dynamic dependencies based on user choices + resolveDependencies(projectPath, config); + + // 6. AUTOMATION PHASE: Install Dependencies const installSpinner = ora({ text: 'Installing dependencies (this might take a minute)...', spinner: 'squareCorners', diff --git a/templates/blog/nextjs-monolith/app/layout.tsx b/templates/blog/nextjs-monolith/app/layout.tsx index e3c4d71..297b2c1 100644 --- a/templates/blog/nextjs-monolith/app/layout.tsx +++ b/templates/blog/nextjs-monolith/app/layout.tsx @@ -92,7 +92,7 @@ export default function RootLayout({ }: { children: React.ReactNode; }) { - const useSidebar = '{{includeSidebar}}' === 'true'; + const useSidebar = ('{{includeSidebar}}' as string) === 'true'; return ( diff --git a/templates/ecommerce/nextjs-monolith/app/layout.tsx b/templates/ecommerce/nextjs-monolith/app/layout.tsx index f51a6dc..23d3441 100644 --- a/templates/ecommerce/nextjs-monolith/app/layout.tsx +++ b/templates/ecommerce/nextjs-monolith/app/layout.tsx @@ -77,7 +77,7 @@ export default function RootLayout({ }: { children: React.ReactNode; }) { - const useSidebar = '{{includeSidebar}}' === 'true'; + const useSidebar = ('{{includeSidebar}}' as string) === 'true'; return ( diff --git a/templates/saas/nextjs-monolith/app/layout.tsx b/templates/saas/nextjs-monolith/app/layout.tsx index 0399294..538ee7f 100644 --- a/templates/saas/nextjs-monolith/app/layout.tsx +++ b/templates/saas/nextjs-monolith/app/layout.tsx @@ -96,7 +96,7 @@ export default function RootLayout({ }: { children: React.ReactNode; }) { - const useSidebar = '{{includeSidebar}}' === 'true'; + const useSidebar = ('{{includeSidebar}}' as string) === 'true'; return ( diff --git a/templates/saas/vite-react/src/components/Layout.tsx b/templates/saas/vite-react/src/components/Layout.tsx index bcb44ba..d3f2553 100644 --- a/templates/saas/vite-react/src/components/Layout.tsx +++ b/templates/saas/vite-react/src/components/Layout.tsx @@ -73,7 +73,7 @@ function Sidebar() { } export default function Layout() { - const useSidebar = '{{includeSidebar}}' === 'true'; + const useSidebar = ('{{includeSidebar}}' as string) === 'true'; if (useSidebar) { return ( diff --git a/templates/school/nextjs-monolith/app/layout.tsx b/templates/school/nextjs-monolith/app/layout.tsx index ce575d6..2bee723 100644 --- a/templates/school/nextjs-monolith/app/layout.tsx +++ b/templates/school/nextjs-monolith/app/layout.tsx @@ -92,7 +92,7 @@ export default function RootLayout({ }: { children: React.ReactNode; }) { - const useSidebar = '{{includeSidebar}}' === 'true'; + const useSidebar = ('{{includeSidebar}}' as string) === 'true'; return (