Skip to content

Commit 4442cfc

Browse files
authored
Feat update dependancy (#30)
1 parent eaed929 commit 4442cfc

114 files changed

Lines changed: 6475 additions & 577 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ coverage/
1515

1616

1717

18+
19+
20+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ import { TemplateRegistry } from 'create-react-forge/templates';
139139
const registry = new TemplateRegistry();
140140
const templates = registry.loadTemplatesForConfig({
141141
runtime: 'vite',
142-
styling: { solution: 'tailwind' },
142+
styling: { solution: 'styled-components' },
143143
stateManagement: 'zustand',
144144
testing: { enabled: true, unit: { runner: 'vitest' }, e2e: { enabled: true, runner: 'playwright' } },
145145
dataFetching: { enabled: true },

src/__tests__/integration/build-verification.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('Build Verification Tests', () => {
5858
it('should generate and build a minimal Next.js project', async () => {
5959
const config = createConfig('nextjs-build-minimal', {
6060
runtime: 'nextjs',
61-
styling: { solution: 'css' },
61+
styling: { solution: 'none' },
6262
});
6363
projectPaths.push(config.path);
6464

@@ -122,7 +122,7 @@ describe('Build Verification Tests', () => {
122122
it('should generate and build Next.js with state management', async () => {
123123
const config = createConfig('nextjs-build-zustand', {
124124
runtime: 'nextjs',
125-
styling: { solution: 'css' },
125+
styling: { solution: 'none' },
126126
stateManagement: 'zustand',
127127
});
128128
projectPaths.push(config.path);
@@ -156,7 +156,7 @@ describe('Build Verification Tests', () => {
156156
it('should generate and build a minimal Vite project', async () => {
157157
const config = createConfig('vite-build-minimal', {
158158
runtime: 'vite',
159-
styling: { solution: 'css' },
159+
styling: { solution: 'styled-components' },
160160
});
161161
projectPaths.push(config.path);
162162

src/__tests__/integration/generator.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ describe('ProjectGenerator Integration', () => {
192192
expect(devDeps).toHaveProperty('@playwright/test');
193193
});
194194

195-
it.skip('should generate Next.js + CSS Modules + Redux', async () => {
195+
it.skip('should generate Next.js + None styling + Redux', async () => {
196196
const config = createBaseConfig({
197197
name: 'nextjs-redux',
198198
runtime: 'nextjs',
199-
styling: { solution: 'css-modules' },
199+
styling: { solution: 'none' },
200200
stateManagement: 'redux',
201201
testing: {
202202
enabled: true,
@@ -231,7 +231,7 @@ describe('ProjectGenerator Integration', () => {
231231
const config = createBaseConfig({
232232
name: 'vite-jest-pw',
233233
runtime: 'vite',
234-
styling: { solution: 'css-modules' },
234+
styling: { solution: 'styled-components' },
235235
testing: {
236236
enabled: true,
237237
unit: { enabled: true, runner: 'jest' },

src/__tests__/integration/package-json.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,10 @@ describe('Package.json Generation', () => {
165165
expect(devDeps).toHaveProperty('autoprefixer');
166166
});
167167

168-
it.skip('should not include tailwind when css-modules selected', async () => {
169-
const config = createConfig('css-modules-deps', {
170-
styling: { solution: 'css-modules' },
168+
it.skip('should not include tailwind when none styling selected', async () => {
169+
const config = createConfig('none-styling-deps', {
170+
runtime: 'nextjs',
171+
styling: { solution: 'none' },
171172
});
172173
projectPaths.push(config.path);
173174

src/__tests__/integration/scenarios.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ describe('Real-World Scenarios', () => {
6363
});
6464

6565
describe('Scenario: Minimal SPA (Learning/Prototyping)', () => {
66-
it('should generate minimal Vite + CSS project', async () => {
66+
it('should generate minimal Vite + styled-components project', async () => {
6767
const config = createConfig('minimal-spa', {
6868
runtime: 'vite',
69-
styling: { solution: 'css' },
69+
styling: { solution: 'styled-components' },
7070
stateManagement: 'none',
7171
dataFetching: { enabled: false, library: 'tanstack-query' },
7272
testing: {
@@ -230,10 +230,10 @@ describe('Real-World Scenarios', () => {
230230
});
231231

232232
describe.skip('Scenario: Next.js with Redux', () => {
233-
it('should generate Next.js + CSS Modules + Redux', async () => {
233+
it('should generate Next.js + None styling + Redux', async () => {
234234
const config = createConfig('nextjs-redux', {
235235
runtime: 'nextjs',
236-
styling: { solution: 'css-modules' },
236+
styling: { solution: 'none' },
237237
stateManagement: 'redux',
238238
dataFetching: { enabled: false, library: 'tanstack-query' },
239239
testing: {
Lines changed: 52 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { execa } from 'execa';
12
import { existsSync, rmSync } from 'fs';
23
import { tmpdir } from 'os';
34
import { join } from 'path';
45
import { afterEach, describe, expect, it } from 'vitest';
5-
import { execa } from 'execa';
66
import { ProjectConfig } from '../../config/schema.js';
77
import { ProjectGenerator } from '../../generator/index.js';
88

@@ -28,7 +28,7 @@ function createConfig(name: string, overrides: Partial<ProjectConfig>): ProjectC
2828
path: basePath,
2929
runtime: 'vite',
3030
language: 'typescript',
31-
styling: { solution: 'tailwind' },
31+
styling: { solution: 'styled-components' },
3232
stateManagement: 'none',
3333
dataFetching: { enabled: false, library: 'tanstack-query' },
3434
testing: {
@@ -53,11 +53,11 @@ describe('Styling Solutions Verification', () => {
5353
projectPaths.length = 0;
5454
});
5555

56-
describe('Plain CSS', () => {
57-
it('should generate and build with plain CSS', async () => {
58-
const config = createConfig('css-plain', {
56+
describe('Styled Components (Vite)', () => {
57+
it('should generate project with Styled Components file structure', async () => {
58+
const config = createConfig('styled-vite-structure', {
5959
runtime: 'vite',
60-
styling: { solution: 'css' },
60+
styling: { solution: 'styled-components' },
6161
});
6262
projectPaths.push(config.path);
6363

@@ -66,50 +66,37 @@ describe('Styling Solutions Verification', () => {
6666

6767
expect(result.success).toBe(true);
6868

69-
// Install dependencies
70-
console.log('Installing dependencies for plain CSS project...');
71-
const installResult = await execa('npm', ['install'], {
72-
cwd: config.path,
73-
timeout: 120000,
74-
});
75-
expect(installResult.exitCode).toBe(0);
76-
77-
// Build the project
78-
console.log('Building plain CSS project...');
79-
const buildResult = await execa('npm', ['run', 'build'], {
80-
cwd: config.path,
81-
timeout: 120000,
82-
});
83-
expect(buildResult.exitCode).toBe(0);
84-
85-
expect(existsSync(join(config.path, 'dist'))).toBe(true);
86-
}, 300000);
87-
});
69+
// Verify Styled Components files exist
70+
expect(existsSync(join(config.path, 'src/styles/globals.ts'))).toBe(true);
71+
expect(existsSync(join(config.path, 'src/components/ui/Button.styled.ts'))).toBe(true);
72+
expect(existsSync(join(config.path, 'src/app/provider.tsx'))).toBe(true);
73+
expect(existsSync(join(config.path, 'src/main.tsx'))).toBe(true);
74+
}, 60000);
8875

89-
describe.skip('CSS Modules', () => {
90-
it('should generate and build with CSS Modules', async () => {
91-
const config = createConfig('css-modules', {
76+
it('should generate and build with Styled Components', async () => {
77+
const config = createConfig('styled-vite', {
9278
runtime: 'vite',
93-
styling: { solution: 'css-modules' },
79+
styling: { solution: 'styled-components' },
9480
});
9581
projectPaths.push(config.path);
9682

9783
const generator = new ProjectGenerator(config);
9884
const result = await generator.generate();
9985

10086
expect(result.success).toBe(true);
101-
expect(existsSync(join(config.path, 'src/components/ui/Button.module.css'))).toBe(true);
87+
expect(existsSync(join(config.path, 'src/styles/globals.ts'))).toBe(true);
88+
expect(existsSync(join(config.path, 'src/components/ui/Button.styled.ts'))).toBe(true);
10289

10390
// Install dependencies
104-
console.log('Installing dependencies for CSS Modules project...');
91+
console.log('Installing dependencies for Styled Components project...');
10592
const installResult = await execa('npm', ['install'], {
10693
cwd: config.path,
10794
timeout: 120000,
10895
});
10996
expect(installResult.exitCode).toBe(0);
11097

11198
// Build the project
112-
console.log('Building CSS Modules project...');
99+
console.log('Building Styled Components project...');
113100
const buildResult = await execa('npm', ['run', 'build'], {
114101
cwd: config.path,
115102
timeout: 120000,
@@ -120,106 +107,92 @@ describe('Styling Solutions Verification', () => {
120107
}, 300000);
121108
});
122109

123-
describe.skip('Styled Components', () => {
124-
it('should generate and build with Styled Components (Vite)', async () => {
125-
const config = createConfig('styled-vite', {
126-
runtime: 'vite',
127-
styling: { solution: 'styled-components' },
110+
describe('Tailwind CSS (Next.js)', () => {
111+
it('should generate and build with Tailwind', async () => {
112+
const config = createConfig('tailwind-nextjs', {
113+
runtime: 'nextjs',
114+
styling: { solution: 'tailwind' },
128115
});
129116
projectPaths.push(config.path);
130117

131118
const generator = new ProjectGenerator(config);
132119
const result = await generator.generate();
133120

134121
expect(result.success).toBe(true);
135-
expect(existsSync(join(config.path, 'src/styles/globals.ts'))).toBe(true);
136-
expect(existsSync(join(config.path, 'src/components/ui/Button.styled.ts'))).toBe(true);
122+
expect(existsSync(join(config.path, 'tailwind.config.js'))).toBe(true);
123+
expect(existsSync(join(config.path, 'postcss.config.js'))).toBe(true);
137124

138125
// Install dependencies
139-
console.log('Installing dependencies for Styled Components project...');
126+
console.log('Installing dependencies for Tailwind project...');
140127
const installResult = await execa('npm', ['install'], {
141128
cwd: config.path,
142129
timeout: 120000,
143130
});
144131
expect(installResult.exitCode).toBe(0);
145132

146133
// Build the project
147-
console.log('Building Styled Components project...');
134+
console.log('Building Tailwind project...');
148135
const buildResult = await execa('npm', ['run', 'build'], {
149136
cwd: config.path,
150-
timeout: 120000,
137+
timeout: 180000,
151138
});
152139
expect(buildResult.exitCode).toBe(0);
153140

154-
expect(existsSync(join(config.path, 'dist'))).toBe(true);
155-
}, 300000);
141+
expect(existsSync(join(config.path, '.next'))).toBe(true);
142+
}, 360000);
143+
});
156144

157-
it('should generate and build with Styled Components (Next.js)', async () => {
158-
const config = createConfig('styled-nextjs', {
145+
describe('None Styling (Next.js)', () => {
146+
it('should generate project with no styling framework', async () => {
147+
const config = createConfig('none-nextjs-structure', {
159148
runtime: 'nextjs',
160-
styling: { solution: 'styled-components' },
149+
styling: { solution: 'none' },
161150
});
162151
projectPaths.push(config.path);
163152

164153
const generator = new ProjectGenerator(config);
165154
const result = await generator.generate();
166155

167156
expect(result.success).toBe(true);
168-
expect(existsSync(join(config.path, 'src/styles/globals.ts'))).toBe(true);
169157

170-
// Install dependencies
171-
console.log('Installing dependencies for Next.js + Styled Components...');
172-
const installResult = await execa('npm', ['install'], {
173-
cwd: config.path,
174-
timeout: 120000,
175-
});
176-
expect(installResult.exitCode).toBe(0);
158+
// Verify no Tailwind config files
159+
expect(existsSync(join(config.path, 'tailwind.config.js'))).toBe(false);
160+
expect(existsSync(join(config.path, 'postcss.config.js'))).toBe(false);
177161

178-
// Build the project
179-
console.log('Building Next.js + Styled Components...');
180-
const buildResult = await execa('npm', ['run', 'build'], {
181-
cwd: config.path,
182-
timeout: 180000,
183-
});
184-
expect(buildResult.exitCode).toBe(0);
185-
186-
expect(existsSync(join(config.path, '.next'))).toBe(true);
187-
}, 360000);
188-
});
162+
// Verify base files exist
163+
expect(existsSync(join(config.path, 'src/app/page.tsx'))).toBe(true);
164+
expect(existsSync(join(config.path, 'src/styles/globals.css'))).toBe(true);
165+
}, 60000);
189166

190-
describe('Tailwind CSS', () => {
191-
it('should generate and build with Tailwind', async () => {
192-
const config = createConfig('tailwind', {
193-
runtime: 'vite',
194-
styling: { solution: 'tailwind' },
167+
it('should generate and build with no styling framework', async () => {
168+
const config = createConfig('none-nextjs', {
169+
runtime: 'nextjs',
170+
styling: { solution: 'none' },
195171
});
196172
projectPaths.push(config.path);
197173

198174
const generator = new ProjectGenerator(config);
199175
const result = await generator.generate();
200176

201177
expect(result.success).toBe(true);
202-
expect(existsSync(join(config.path, 'tailwind.config.js'))).toBe(true);
203-
expect(existsSync(join(config.path, 'postcss.config.js'))).toBe(true);
204178

205179
// Install dependencies
206-
console.log('Installing dependencies for Tailwind project...');
180+
console.log('Installing dependencies for None styling project...');
207181
const installResult = await execa('npm', ['install'], {
208182
cwd: config.path,
209183
timeout: 120000,
210184
});
211185
expect(installResult.exitCode).toBe(0);
212186

213187
// Build the project
214-
console.log('Building Tailwind project...');
188+
console.log('Building None styling project...');
215189
const buildResult = await execa('npm', ['run', 'build'], {
216190
cwd: config.path,
217-
timeout: 120000,
191+
timeout: 180000,
218192
});
219193
expect(buildResult.exitCode).toBe(0);
220194

221-
expect(existsSync(join(config.path, 'dist'))).toBe(true);
222-
}, 300000);
195+
expect(existsSync(join(config.path, '.next'))).toBe(true);
196+
}, 360000);
223197
});
224198
});
225-

0 commit comments

Comments
 (0)