From 4416976057072107a8bf1ef7ddb1e30442767ac6 Mon Sep 17 00:00:00 2001 From: Chirag Date: Fri, 20 Feb 2026 14:24:11 +0530 Subject: [PATCH] fix pipeline --- package-lock.json | 15 ++++++++++++--- src/cli/parser.ts | 4 +++- src/config/defaults.ts | 4 ++-- src/config/schema.ts | 7 ++++--- .../overlays/styling/css-modules/manifest.json | 17 +++++++++++++++++ src/templates/registry.ts | 17 ++++++++++------- 6 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 src/templates/overlays/styling/css-modules/manifest.json diff --git a/package-lock.json b/package-lock.json index 51f11c8..c4d515e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "vitest": "^2.1.8" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.9.0" } }, "node_modules/@ampproject/remapping": { @@ -1666,8 +1666,9 @@ "version": "22.19.7", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.7.tgz", "integrity": "sha512-MciR4AKGHWl7xwxkBa6xUGxQJ4VBOmPTF7sL+iGzuahOFaO0jHCsuEfS80pan1ef4gWId1oWOweIhrDEYLuaOw==", - "dev": true, + "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~6.21.0" } @@ -1707,6 +1708,7 @@ "integrity": "sha512-BtE0k6cjwjLZoZixN0t5AKP0kSzlGu7FctRXYuPAm//aaiZhmfq1JwdYpYr1brzEspYyFeF+8XF5j2VK6oalrA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.54.0", "@typescript-eslint/types": "8.54.0", @@ -2042,6 +2044,7 @@ "integrity": "sha512-izzd2zmnk8Nl5ECYkW27328RbQ1nKvkm6Bb5DAaz1Gk59EbLkiCMa6OLT0NoaAYTjOFS6N+SMYW1nh4/9ljPiw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@vitest/utils": "2.1.9", "fflate": "^0.8.2", @@ -2079,6 +2082,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2585,6 +2589,7 @@ "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -3865,6 +3870,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -4436,6 +4442,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -4472,7 +4479,7 @@ "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/unicorn-magic": { @@ -4512,6 +4519,7 @@ "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", @@ -5025,6 +5033,7 @@ "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@vitest/expect": "2.1.9", "@vitest/mocker": "2.1.9", diff --git a/src/cli/parser.ts b/src/cli/parser.ts index c73dbca..dc63572 100644 --- a/src/cli/parser.ts +++ b/src/cli/parser.ts @@ -39,10 +39,12 @@ export function createCommand(): Command { 'none', 'tailwind', 'styled-components', + 'css-modules', + 'css', ]) ) .addOption( - new Option('--state ', 'State management').choices(['none', 'redux', 'zustand']) + new Option('--state ', 'State management').choices(['none', 'redux', 'zustand', 'jotai']) ) .addOption( new Option('--testing ', 'Testing setup').choices(['full', 'unit-component', 'custom', 'none']) diff --git a/src/config/defaults.ts b/src/config/defaults.ts index aa1fade..eebaacc 100644 --- a/src/config/defaults.ts +++ b/src/config/defaults.ts @@ -8,9 +8,10 @@ export const RUNTIME_DESCRIPTIONS: Record = { }; export const STYLING_DESCRIPTIONS: Record = { - none: 'None - Plain CSS classes', tailwind: 'Tailwind CSS - Utility-first framework', 'styled-components': 'Styled Components - CSS-in-JS', + 'css-modules': 'CSS Modules - Scoped component styles', + css: 'Plain CSS - Traditional stylesheet approach', }; export const STATE_DESCRIPTIONS: Record = { @@ -48,4 +49,3 @@ export const PACKAGE_MANAGER_COMMANDS: Record; export const LanguageSchema = z.enum(['javascript', 'typescript']); export type Language = z.infer; -export const StylingSchema = z.enum(['none', 'tailwind', 'styled-components']); +export const StylingSchema = z.enum(['tailwind', 'styled-components', 'css-modules', 'css']); export type Styling = z.infer; +export const StylingSolutionSchema = z.union([StylingSchema, z.literal('none')]); +export type StylingSolution = z.infer; export const StateManagementSchema = z.enum(['none', 'redux', 'zustand', 'jotai']); export type StateManagement = z.infer; @@ -61,7 +63,7 @@ export const GitConfigSchema = z.object({ export type GitConfig = z.infer; export const StylingConfigSchema = z.object({ - solution: StylingSchema.default('styled-components'), + solution: StylingSolutionSchema.default('styled-components'), }); export type StylingConfigType = z.infer; @@ -129,4 +131,3 @@ export const DEFAULT_CONFIG: ProjectConfig = { - diff --git a/src/templates/overlays/styling/css-modules/manifest.json b/src/templates/overlays/styling/css-modules/manifest.json new file mode 100644 index 0000000..c3577aa --- /dev/null +++ b/src/templates/overlays/styling/css-modules/manifest.json @@ -0,0 +1,17 @@ +{ + "name": "styling-css-modules", + "version": "1.0.0", + "description": "CSS Modules styling solution", + "compatibleWith": ["runtime-vite", "runtime-nextjs"], + "dependencies": {}, + "devDependencies": {}, + "scripts": {}, + "filePatterns": { + "include": ["**/*"], + "exclude": ["manifest.json", "_vite", "_nextjs"] + }, + "runtimeOverrides": { + "vite": "_vite", + "nextjs": "_nextjs" + } +} diff --git a/src/templates/registry.ts b/src/templates/registry.ts index 037d80c..d5301fe 100644 --- a/src/templates/registry.ts +++ b/src/templates/registry.ts @@ -239,14 +239,17 @@ export class TemplateRegistry { templates.push(this.loadAndRegister(`runtime/${config.runtime}`)); // Load styling template (pass runtime for runtime-specific overlays) - // Vite: always styled-components - // Next.js: tailwind or none (none = no styling overlay, use runtime defaults) - if (config.styling.solution === 'tailwind') { - templates.push(this.loadAndRegister('styling/tailwind', config.runtime)); - } else if (config.styling.solution === 'styled-components') { - templates.push(this.loadAndRegister('styling/styled-components', config.runtime)); + // 'none' intentionally skips adding a styling overlay. + const stylingTemplateMap: Record = { + tailwind: 'styling/tailwind', + 'styled-components': 'styling/styled-components', + 'css-modules': 'styling/css-modules', + css: 'styling/css', + }; + const stylingTemplate = stylingTemplateMap[config.styling.solution]; + if (stylingTemplate) { + templates.push(this.loadAndRegister(stylingTemplate, config.runtime)); } - // 'none' - don't load any styling overlay, use runtime defaults // Load state management template if (config.stateManagement && config.stateManagement !== 'none') {