create-react-starter-kit 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/generator/dependencies.d.ts.map +1 -1
  2. package/dist/generator/dependencies.js +20 -2
  3. package/dist/generator/dependencies.js.map +1 -1
  4. package/dist/generator/index.d.ts.map +1 -1
  5. package/dist/generator/index.js +10 -2
  6. package/dist/generator/index.js.map +1 -1
  7. package/dist/templates/README.md.ejs +23 -29
  8. package/dist/templates/__when_e2eTesting_playwright__/playwright.config.ts.ejs +17 -1
  9. package/dist/templates/__when_e2eTesting_playwright__/tests/e2e/counter.spec.ts.ejs +25 -0
  10. package/dist/templates/__when_e2eTesting_playwright__/tests/e2e/feedback.spec.ts.ejs +20 -0
  11. package/dist/templates/__when_e2eTesting_playwright__/tests/e2e/home.spec.ts.ejs +30 -3
  12. package/dist/templates/__when_e2eTesting_playwright__/tests/e2e/posts.spec.ts.ejs +17 -0
  13. package/dist/templates/__when_formatting_prettier__/.prettierignore +28 -0
  14. package/dist/templates/__when_linting_biome__/biome.json +12 -0
  15. package/dist/templates/__when_unitTesting_jest__/tests/App.test.tsx.ejs +10 -1
  16. package/dist/templates/__when_unitTesting_rtl__/tests/App.test.tsx.ejs +10 -1
  17. package/dist/templates/__when_unitTesting_vitest__/tests/counter.test.tsx.ejs +36 -0
  18. package/dist/templates/__when_unitTesting_vitest__/tests/feedback.test.tsx.ejs +49 -0
  19. package/dist/templates/__when_unitTesting_vitest__/tests/pages.test.tsx.ejs +26 -0
  20. package/dist/templates/__when_unitTesting_vitest__/tests/posts.test.tsx.ejs +58 -0
  21. package/dist/templates/__when_unitTesting_vitest__/tests/test-utils.tsx.ejs +50 -0
  22. package/dist/templates/__when_visualTesting_storybook__/.storybook/main.js.ejs +4 -1
  23. package/dist/templates/__when_visualTesting_storybook__/.storybook/preview.js.ejs +40 -0
  24. package/dist/templates/__when_visualTesting_storybook__/.storybook/preview.tsx.ejs +40 -0
  25. package/dist/templates/__when_visualTesting_storybook__/src/components/StackBadge.stories.tsx.ejs +35 -0
  26. package/dist/templates/__when_visualTesting_storybook__/src/components/ui/UiButton.stories.tsx.ejs +24 -1
  27. package/dist/templates/__when_visualTesting_storybook__/src/features/counter/CounterPanel.stories.tsx.ejs +25 -0
  28. package/dist/templates/__when_visualTesting_storybook__/src/features/feedback/FeedbackForm.stories.tsx.ejs +25 -0
  29. package/dist/templates/__when_visualTesting_storybook__/src/features/posts/PostsPanel.stories.tsx.ejs +25 -0
  30. package/dist/templates/__when_visualTesting_storybook__/src/routes/Pages.stories.tsx.ejs +42 -0
  31. package/dist/templates/docs/architecture.md.ejs +32 -34
  32. package/dist/templates/docs/getting-started.md.ejs +1 -1
  33. package/{templates/src/app → dist/templates/src}/App.tsx.ejs +34 -1
  34. package/dist/templates/src/components/layout/AppLayout.tsx.ejs +35 -12
  35. package/dist/templates/src/features/counter/CounterPanel.tsx.ejs +12 -6
  36. package/dist/templates/src/features/feedback/FeedbackForm.tsx.ejs +26 -7
  37. package/dist/templates/src/main.tsx.ejs +2 -2
  38. package/{templates/src/app → dist/templates/src}/providers.tsx.ejs +1 -2
  39. package/dist/templates/src/routes/AboutPage.tsx.ejs +11 -10
  40. package/dist/templates/src/routes/CounterPage.tsx.ejs +17 -0
  41. package/dist/templates/src/routes/FeedbackPage.tsx.ejs +21 -0
  42. package/dist/templates/src/routes/HomePage.tsx.ejs +43 -21
  43. package/dist/templates/src/routes/PostsPage.tsx.ejs +17 -0
  44. package/dist/templates/src/styles/global.css.ejs +14 -33
  45. package/package.json +1 -1
  46. package/templates/README.md.ejs +23 -29
  47. package/templates/__when_e2eTesting_playwright__/playwright.config.ts.ejs +17 -1
  48. package/templates/__when_e2eTesting_playwright__/tests/e2e/counter.spec.ts.ejs +25 -0
  49. package/templates/__when_e2eTesting_playwright__/tests/e2e/feedback.spec.ts.ejs +20 -0
  50. package/templates/__when_e2eTesting_playwright__/tests/e2e/home.spec.ts.ejs +30 -3
  51. package/templates/__when_e2eTesting_playwright__/tests/e2e/posts.spec.ts.ejs +17 -0
  52. package/templates/__when_formatting_prettier__/.prettierignore +28 -0
  53. package/templates/__when_linting_biome__/biome.json +12 -0
  54. package/templates/__when_unitTesting_jest__/tests/App.test.tsx.ejs +10 -1
  55. package/templates/__when_unitTesting_rtl__/tests/App.test.tsx.ejs +10 -1
  56. package/templates/__when_unitTesting_vitest__/tests/counter.test.tsx.ejs +36 -0
  57. package/templates/__when_unitTesting_vitest__/tests/feedback.test.tsx.ejs +49 -0
  58. package/templates/__when_unitTesting_vitest__/tests/pages.test.tsx.ejs +26 -0
  59. package/templates/__when_unitTesting_vitest__/tests/posts.test.tsx.ejs +58 -0
  60. package/templates/__when_unitTesting_vitest__/tests/test-utils.tsx.ejs +50 -0
  61. package/templates/__when_visualTesting_storybook__/.storybook/main.js.ejs +4 -1
  62. package/templates/__when_visualTesting_storybook__/.storybook/preview.js.ejs +40 -0
  63. package/templates/__when_visualTesting_storybook__/.storybook/preview.tsx.ejs +40 -0
  64. package/templates/__when_visualTesting_storybook__/src/components/StackBadge.stories.tsx.ejs +35 -0
  65. package/templates/__when_visualTesting_storybook__/src/components/ui/UiButton.stories.tsx.ejs +24 -1
  66. package/templates/__when_visualTesting_storybook__/src/features/counter/CounterPanel.stories.tsx.ejs +25 -0
  67. package/templates/__when_visualTesting_storybook__/src/features/feedback/FeedbackForm.stories.tsx.ejs +25 -0
  68. package/templates/__when_visualTesting_storybook__/src/features/posts/PostsPanel.stories.tsx.ejs +25 -0
  69. package/templates/__when_visualTesting_storybook__/src/routes/Pages.stories.tsx.ejs +42 -0
  70. package/templates/docs/architecture.md.ejs +32 -34
  71. package/templates/docs/getting-started.md.ejs +1 -1
  72. package/{dist/templates/src/app → templates/src}/App.tsx.ejs +34 -1
  73. package/templates/src/components/layout/AppLayout.tsx.ejs +35 -12
  74. package/templates/src/features/counter/CounterPanel.tsx.ejs +12 -6
  75. package/templates/src/features/feedback/FeedbackForm.tsx.ejs +26 -7
  76. package/templates/src/main.tsx.ejs +2 -2
  77. package/{dist/templates/src/app → templates/src}/providers.tsx.ejs +1 -2
  78. package/templates/src/routes/AboutPage.tsx.ejs +11 -10
  79. package/templates/src/routes/CounterPage.tsx.ejs +17 -0
  80. package/templates/src/routes/FeedbackPage.tsx.ejs +21 -0
  81. package/templates/src/routes/HomePage.tsx.ejs +43 -21
  82. package/templates/src/routes/PostsPage.tsx.ejs +17 -0
  83. package/templates/src/styles/global.css.ejs +14 -33
  84. package/dist/templates/__when_unitTesting_vitest__/tests/App.test.tsx.ejs +0 -16
  85. package/dist/templates/__when_visualTesting_storybook__/.storybook/preview.js +0 -8
  86. package/dist/templates/src/components/ui/Toast.tsx.ejs +0 -61
  87. package/templates/__when_unitTesting_vitest__/tests/App.test.tsx.ejs +0 -16
  88. package/templates/__when_visualTesting_storybook__/.storybook/preview.js +0 -8
  89. package/templates/src/components/ui/Toast.tsx.ejs +0 -61
@@ -90,10 +90,23 @@ body {
90
90
 
91
91
  .hero h1,
92
92
  .about-page h1,
93
+ .page-intro h1,
93
94
  .panel-header h2 {
94
95
  @apply m-0 font-display tracking-tight text-slate-900;
95
96
  }
96
97
 
98
+ .page-intro {
99
+ @apply mb-6;
100
+ }
101
+
102
+ .page-intro h1 {
103
+ @apply mt-2 text-3xl sm:text-4xl;
104
+ }
105
+
106
+ .success-text {
107
+ @apply text-sm text-[var(--ok)];
108
+ }
109
+
97
110
  .hero h1 {
98
111
  @apply mt-2 text-4xl sm:text-5xl;
99
112
  }
@@ -181,27 +194,7 @@ body {
181
194
  }
182
195
 
183
196
  .ui-button {
184
- @apply inline-flex items-center justify-center rounded-md bg-brand-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-brand-700 disabled:opacity-50;
185
- }
186
-
187
- .toast-viewport {
188
- @apply pointer-events-none fixed bottom-4 right-4 z-50 flex w-80 flex-col gap-2;
189
- }
190
-
191
- .toast {
192
- @apply rounded-xl border px-4 py-3 text-sm shadow-lg;
193
- }
194
-
195
- .toast-info {
196
- @apply border-slate-200 bg-white text-slate-800;
197
- }
198
-
199
- .toast-success {
200
- @apply border-green-200 bg-green-50 text-[var(--ok)];
201
- }
202
-
203
- .toast-error {
204
- @apply border-red-200 bg-red-50 text-[var(--bad)];
197
+ @apply inline-flex items-center justify-center rounded-md bg-brand-600 px-4 py-2 text-sm font-medium text-white no-underline transition hover:bg-brand-700 disabled:opacity-50;
205
198
  }
206
199
 
207
200
  .about-list {
@@ -265,10 +258,6 @@ body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #f8fafc
265
258
  .panel-note { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px dashed #e2e8f0; font-size: 0.75rem; line-height: 1.5; }
266
259
  .ui-button { appearance: none; border: 0; background: var(--brand); color: #fff; border-radius: 0.5rem; padding: 0.55rem 1rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; }
267
260
  .ui-button:disabled { opacity: 0.5; }
268
- .toast-viewport { position: fixed; right: 1rem; bottom: 1rem; width: 20rem; display: grid; gap: 0.5rem; z-index: 50; }
269
- .toast { border-radius: 0.75rem; padding: 0.75rem 1rem; font-size: 0.875rem; box-shadow: var(--shadow); background: #fff; border: 1px solid var(--line); }
270
- .toast-success { background: #f0fdf4; border-color: #bbf7d0; color: var(--ok); }
271
- .toast-error { background: #fef2f2; border-color: #fecaca; color: var(--bad); }
272
261
  .about-list { margin: 1rem 0; padding-left: 1.25rem; }
273
262
  <% } else if (styling === 'styled-components') { -%>
274
263
  /* Global reset — most styling lives in styled components; keep layout tokens here */
@@ -335,10 +324,6 @@ body {
335
324
  .panel-note { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px dashed #e2e8f0; font-size: 0.75rem; line-height: 1.5; }
336
325
  .ui-button { appearance: none; border: 0; background: var(--brand); color: #fff; border-radius: 0.5rem; padding: 0.55rem 1rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; }
337
326
  .ui-button:disabled { opacity: 0.5; }
338
- .toast-viewport { position: fixed; right: 1rem; bottom: 1rem; width: 20rem; display: grid; gap: 0.5rem; z-index: 50; }
339
- .toast { border-radius: 0.75rem; padding: 0.75rem 1rem; font-size: 0.875rem; box-shadow: var(--shadow); background: #fff; border: 1px solid var(--line); }
340
- .toast-success { background: #f0fdf4; border-color: #bbf7d0; color: var(--ok); }
341
- .toast-error { background: #fef2f2; border-color: #fecaca; color: var(--bad); }
342
327
  .about-list { margin: 1rem 0; padding-left: 1.25rem; }
343
328
  <% } else { -%>
344
329
  @import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');
@@ -449,9 +434,5 @@ body {
449
434
  padding: 0.55rem 1rem; font-size: 0.875rem; font-weight: 500; cursor: pointer;
450
435
  &:disabled { opacity: 0.5; }
451
436
  }
452
- .toast-viewport { position: fixed; right: 1rem; bottom: 1rem; width: 20rem; display: grid; gap: 0.5rem; z-index: 50; }
453
- .toast { border-radius: 0.75rem; padding: 0.75rem 1rem; font-size: 0.875rem; box-shadow: $shadow; background: #fff; border: 1px solid $line; }
454
- .toast-success { background: #f0fdf4; border-color: #bbf7d0; color: $ok; }
455
- .toast-error { background: #fef2f2; border-color: #fecaca; color: $bad; }
456
437
  .about-list { margin: 1rem 0; padding-left: 1.25rem; }
457
438
  <% } -%>
@@ -1,16 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { render, screen } from '@testing-library/react';
3
- import { AppProviders } from '@/app/providers';
4
- import { HomePage } from '@/routes/HomePage';
5
-
6
- describe('HomePage', () => {
7
- it('renders the project hero', () => {
8
- render(
9
- <AppProviders>
10
- <HomePage />
11
- </AppProviders>,
12
- );
13
-
14
- expect(screen.getByRole('heading', { name: /<%= projectName %>/i })).toBeInTheDocument();
15
- });
16
- });
@@ -1,8 +0,0 @@
1
- /** @type { import('@storybook/react').Preview } */
2
- const preview = {
3
- parameters: {
4
- controls: { matchers: { color: /(background|color)$/i, date: /Date$/i } },
5
- },
6
- };
7
-
8
- export default preview;
@@ -1,61 +0,0 @@
1
- import {
2
- createContext,
3
- useCallback,
4
- useContext,
5
- useMemo,
6
- useState,
7
- <% if (isTypeScript) { -%>
8
- type ReactNode,
9
- <% } -%>
10
- } from 'react';
11
-
12
- <% if (isTypeScript) { -%>
13
- type ToastTone = 'info' | 'success' | 'error';
14
-
15
- interface ToastItem {
16
- id: string;
17
- message: string;
18
- tone: ToastTone;
19
- }
20
-
21
- interface ToastContextValue {
22
- push: (message: string, tone?: ToastTone) => void;
23
- }
24
- <% } -%>
25
-
26
- const ToastContext = createContext<% if (isTypeScript) { %><ToastContextValue | null><% } %>(null);
27
-
28
- export function ToastProvider({ children }<% if (isTypeScript) { %>: { children: ReactNode }<% } %>) {
29
- const [items, setItems] = useState<% if (isTypeScript) { %><ToastItem[]><% } %>([]);
30
-
31
- const push = useCallback((message<% if (isTypeScript) { %>: string<% } %>, tone<% if (isTypeScript) { %>: ToastTone<% } %> = 'info') => {
32
- const id = crypto.randomUUID();
33
- setItems((prev) => [...prev, { id, message, tone }]);
34
- window.setTimeout(() => {
35
- setItems((prev) => prev.filter((item) => item.id !== id));
36
- }, 3200);
37
- }, []);
38
-
39
- const value = useMemo(() => ({ push }), [push]);
40
-
41
- return (
42
- <ToastContext.Provider value={value}>
43
- {children}
44
- <div className="toast-viewport" aria-live="polite">
45
- {items.map((item) => (
46
- <div key={item.id} className={`toast toast-${item.tone}`}>
47
- {item.message}
48
- </div>
49
- ))}
50
- </div>
51
- </ToastContext.Provider>
52
- );
53
- }
54
-
55
- export function useToast() {
56
- const ctx = useContext(ToastContext);
57
- if (!ctx) {
58
- throw new Error('useToast must be used within ToastProvider');
59
- }
60
- return ctx;
61
- }
@@ -1,16 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { render, screen } from '@testing-library/react';
3
- import { AppProviders } from '@/app/providers';
4
- import { HomePage } from '@/routes/HomePage';
5
-
6
- describe('HomePage', () => {
7
- it('renders the project hero', () => {
8
- render(
9
- <AppProviders>
10
- <HomePage />
11
- </AppProviders>,
12
- );
13
-
14
- expect(screen.getByRole('heading', { name: /<%= projectName %>/i })).toBeInTheDocument();
15
- });
16
- });
@@ -1,8 +0,0 @@
1
- /** @type { import('@storybook/react').Preview } */
2
- const preview = {
3
- parameters: {
4
- controls: { matchers: { color: /(background|color)$/i, date: /Date$/i } },
5
- },
6
- };
7
-
8
- export default preview;
@@ -1,61 +0,0 @@
1
- import {
2
- createContext,
3
- useCallback,
4
- useContext,
5
- useMemo,
6
- useState,
7
- <% if (isTypeScript) { -%>
8
- type ReactNode,
9
- <% } -%>
10
- } from 'react';
11
-
12
- <% if (isTypeScript) { -%>
13
- type ToastTone = 'info' | 'success' | 'error';
14
-
15
- interface ToastItem {
16
- id: string;
17
- message: string;
18
- tone: ToastTone;
19
- }
20
-
21
- interface ToastContextValue {
22
- push: (message: string, tone?: ToastTone) => void;
23
- }
24
- <% } -%>
25
-
26
- const ToastContext = createContext<% if (isTypeScript) { %><ToastContextValue | null><% } %>(null);
27
-
28
- export function ToastProvider({ children }<% if (isTypeScript) { %>: { children: ReactNode }<% } %>) {
29
- const [items, setItems] = useState<% if (isTypeScript) { %><ToastItem[]><% } %>([]);
30
-
31
- const push = useCallback((message<% if (isTypeScript) { %>: string<% } %>, tone<% if (isTypeScript) { %>: ToastTone<% } %> = 'info') => {
32
- const id = crypto.randomUUID();
33
- setItems((prev) => [...prev, { id, message, tone }]);
34
- window.setTimeout(() => {
35
- setItems((prev) => prev.filter((item) => item.id !== id));
36
- }, 3200);
37
- }, []);
38
-
39
- const value = useMemo(() => ({ push }), [push]);
40
-
41
- return (
42
- <ToastContext.Provider value={value}>
43
- {children}
44
- <div className="toast-viewport" aria-live="polite">
45
- {items.map((item) => (
46
- <div key={item.id} className={`toast toast-${item.tone}`}>
47
- {item.message}
48
- </div>
49
- ))}
50
- </div>
51
- </ToastContext.Provider>
52
- );
53
- }
54
-
55
- export function useToast() {
56
- const ctx = useContext(ToastContext);
57
- if (!ctx) {
58
- throw new Error('useToast must be used within ToastProvider');
59
- }
60
- return ctx;
61
- }