Skip to content

Commit a779254

Browse files
authored
fix: setup pipeline (#31)
1 parent 4442cfc commit a779254

6 files changed

Lines changed: 48 additions & 16 deletions

File tree

package-lock.json

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cli/parser.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ export function createCommand(): Command {
3939
'none',
4040
'tailwind',
4141
'styled-components',
42+
'css-modules',
43+
'css',
4244
])
4345
)
4446
.addOption(
45-
new Option('--state <state>', 'State management').choices(['none', 'redux', 'zustand'])
47+
new Option('--state <state>', 'State management').choices(['none', 'redux', 'zustand', 'jotai'])
4648
)
4749
.addOption(
4850
new Option('--testing <testing>', 'Testing setup').choices(['full', 'unit-component', 'custom', 'none'])

src/config/defaults.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ export const RUNTIME_DESCRIPTIONS: Record<string, string> = {
88
};
99

1010
export const STYLING_DESCRIPTIONS: Record<string, string> = {
11-
none: 'None - Plain CSS classes',
1211
tailwind: 'Tailwind CSS - Utility-first framework',
1312
'styled-components': 'Styled Components - CSS-in-JS',
13+
'css-modules': 'CSS Modules - Scoped component styles',
14+
css: 'Plain CSS - Traditional stylesheet approach',
1415
};
1516

1617
export const STATE_DESCRIPTIONS: Record<string, string> = {
@@ -48,4 +49,3 @@ export const PACKAGE_MANAGER_COMMANDS: Record<string, { install: string; exec: s
4849

4950

5051

51-

src/config/schema.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ export type Runtime = z.infer<typeof RuntimeSchema>;
1111
export const LanguageSchema = z.enum(['javascript', 'typescript']);
1212
export type Language = z.infer<typeof LanguageSchema>;
1313

14-
export const StylingSchema = z.enum(['none', 'tailwind', 'styled-components']);
14+
export const StylingSchema = z.enum(['tailwind', 'styled-components', 'css-modules', 'css']);
1515
export type Styling = z.infer<typeof StylingSchema>;
16+
export const StylingSolutionSchema = z.union([StylingSchema, z.literal('none')]);
17+
export type StylingSolution = z.infer<typeof StylingSolutionSchema>;
1618

1719
export const StateManagementSchema = z.enum(['none', 'redux', 'zustand', 'jotai']);
1820
export type StateManagement = z.infer<typeof StateManagementSchema>;
@@ -61,7 +63,7 @@ export const GitConfigSchema = z.object({
6163
export type GitConfig = z.infer<typeof GitConfigSchema>;
6264

6365
export const StylingConfigSchema = z.object({
64-
solution: StylingSchema.default('styled-components'),
66+
solution: StylingSolutionSchema.default('styled-components'),
6567
});
6668
export type StylingConfigType = z.infer<typeof StylingConfigSchema>;
6769

@@ -129,4 +131,3 @@ export const DEFAULT_CONFIG: ProjectConfig = {
129131

130132

131133

132-
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "styling-css-modules",
3+
"version": "1.0.0",
4+
"description": "CSS Modules styling solution",
5+
"compatibleWith": ["runtime-vite", "runtime-nextjs"],
6+
"dependencies": {},
7+
"devDependencies": {},
8+
"scripts": {},
9+
"filePatterns": {
10+
"include": ["**/*"],
11+
"exclude": ["manifest.json", "_vite", "_nextjs"]
12+
},
13+
"runtimeOverrides": {
14+
"vite": "_vite",
15+
"nextjs": "_nextjs"
16+
}
17+
}

src/templates/registry.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,17 @@ export class TemplateRegistry {
239239
templates.push(this.loadAndRegister(`runtime/${config.runtime}`));
240240

241241
// Load styling template (pass runtime for runtime-specific overlays)
242-
// Vite: always styled-components
243-
// Next.js: tailwind or none (none = no styling overlay, use runtime defaults)
244-
if (config.styling.solution === 'tailwind') {
245-
templates.push(this.loadAndRegister('styling/tailwind', config.runtime));
246-
} else if (config.styling.solution === 'styled-components') {
247-
templates.push(this.loadAndRegister('styling/styled-components', config.runtime));
242+
// 'none' intentionally skips adding a styling overlay.
243+
const stylingTemplateMap: Record<string, string> = {
244+
tailwind: 'styling/tailwind',
245+
'styled-components': 'styling/styled-components',
246+
'css-modules': 'styling/css-modules',
247+
css: 'styling/css',
248+
};
249+
const stylingTemplate = stylingTemplateMap[config.styling.solution];
250+
if (stylingTemplate) {
251+
templates.push(this.loadAndRegister(stylingTemplate, config.runtime));
248252
}
249-
// 'none' - don't load any styling overlay, use runtime defaults
250253

251254
// Load state management template
252255
if (config.stateManagement && config.stateManagement !== 'none') {

0 commit comments

Comments
 (0)