create-react-starter-kit 1.0.2 → 1.0.4

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 (87) 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 +32 -1
  23. package/dist/templates/__when_visualTesting_storybook__/.storybook/preview.tsx.ejs +42 -0
  24. package/dist/templates/__when_visualTesting_storybook__/src/components/StackBadge.stories.tsx.ejs +35 -0
  25. package/dist/templates/__when_visualTesting_storybook__/src/components/ui/UiButton.stories.tsx.ejs +24 -1
  26. package/dist/templates/__when_visualTesting_storybook__/src/features/counter/CounterPanel.stories.tsx.ejs +25 -0
  27. package/dist/templates/__when_visualTesting_storybook__/src/features/feedback/FeedbackForm.stories.tsx.ejs +25 -0
  28. package/dist/templates/__when_visualTesting_storybook__/src/features/posts/PostsPanel.stories.tsx.ejs +25 -0
  29. package/dist/templates/__when_visualTesting_storybook__/src/routes/Pages.stories.tsx.ejs +42 -0
  30. package/dist/templates/docs/architecture.md.ejs +32 -34
  31. package/dist/templates/docs/getting-started.md.ejs +1 -1
  32. package/{templates/src/app → dist/templates/src}/App.tsx.ejs +34 -1
  33. package/dist/templates/src/components/layout/AppLayout.tsx.ejs +35 -12
  34. package/dist/templates/src/features/counter/CounterPanel.tsx.ejs +12 -6
  35. package/dist/templates/src/features/feedback/FeedbackForm.tsx.ejs +26 -7
  36. package/dist/templates/src/main.tsx.ejs +2 -2
  37. package/{templates/src/app → dist/templates/src}/providers.tsx.ejs +1 -2
  38. package/dist/templates/src/routes/AboutPage.tsx.ejs +11 -10
  39. package/dist/templates/src/routes/CounterPage.tsx.ejs +17 -0
  40. package/dist/templates/src/routes/FeedbackPage.tsx.ejs +21 -0
  41. package/dist/templates/src/routes/HomePage.tsx.ejs +43 -21
  42. package/dist/templates/src/routes/PostsPage.tsx.ejs +17 -0
  43. package/dist/templates/src/styles/global.css.ejs +14 -33
  44. package/package.json +1 -1
  45. package/templates/README.md.ejs +23 -29
  46. package/templates/__when_e2eTesting_playwright__/playwright.config.ts.ejs +17 -1
  47. package/templates/__when_e2eTesting_playwright__/tests/e2e/counter.spec.ts.ejs +25 -0
  48. package/templates/__when_e2eTesting_playwright__/tests/e2e/feedback.spec.ts.ejs +20 -0
  49. package/templates/__when_e2eTesting_playwright__/tests/e2e/home.spec.ts.ejs +30 -3
  50. package/templates/__when_e2eTesting_playwright__/tests/e2e/posts.spec.ts.ejs +17 -0
  51. package/templates/__when_formatting_prettier__/.prettierignore +28 -0
  52. package/templates/__when_linting_biome__/biome.json +12 -0
  53. package/templates/__when_unitTesting_jest__/tests/App.test.tsx.ejs +10 -1
  54. package/templates/__when_unitTesting_rtl__/tests/App.test.tsx.ejs +10 -1
  55. package/templates/__when_unitTesting_vitest__/tests/counter.test.tsx.ejs +36 -0
  56. package/templates/__when_unitTesting_vitest__/tests/feedback.test.tsx.ejs +49 -0
  57. package/templates/__when_unitTesting_vitest__/tests/pages.test.tsx.ejs +26 -0
  58. package/templates/__when_unitTesting_vitest__/tests/posts.test.tsx.ejs +58 -0
  59. package/templates/__when_unitTesting_vitest__/tests/test-utils.tsx.ejs +50 -0
  60. package/templates/__when_visualTesting_storybook__/.storybook/main.js.ejs +32 -1
  61. package/templates/__when_visualTesting_storybook__/.storybook/preview.tsx.ejs +42 -0
  62. package/templates/__when_visualTesting_storybook__/src/components/StackBadge.stories.tsx.ejs +35 -0
  63. package/templates/__when_visualTesting_storybook__/src/components/ui/UiButton.stories.tsx.ejs +24 -1
  64. package/templates/__when_visualTesting_storybook__/src/features/counter/CounterPanel.stories.tsx.ejs +25 -0
  65. package/templates/__when_visualTesting_storybook__/src/features/feedback/FeedbackForm.stories.tsx.ejs +25 -0
  66. package/templates/__when_visualTesting_storybook__/src/features/posts/PostsPanel.stories.tsx.ejs +25 -0
  67. package/templates/__when_visualTesting_storybook__/src/routes/Pages.stories.tsx.ejs +42 -0
  68. package/templates/docs/architecture.md.ejs +32 -34
  69. package/templates/docs/getting-started.md.ejs +1 -1
  70. package/{dist/templates/src/app → templates/src}/App.tsx.ejs +34 -1
  71. package/templates/src/components/layout/AppLayout.tsx.ejs +35 -12
  72. package/templates/src/features/counter/CounterPanel.tsx.ejs +12 -6
  73. package/templates/src/features/feedback/FeedbackForm.tsx.ejs +26 -7
  74. package/templates/src/main.tsx.ejs +2 -2
  75. package/{dist/templates/src/app → templates/src}/providers.tsx.ejs +1 -2
  76. package/templates/src/routes/AboutPage.tsx.ejs +11 -10
  77. package/templates/src/routes/CounterPage.tsx.ejs +17 -0
  78. package/templates/src/routes/FeedbackPage.tsx.ejs +21 -0
  79. package/templates/src/routes/HomePage.tsx.ejs +43 -21
  80. package/templates/src/routes/PostsPage.tsx.ejs +17 -0
  81. package/templates/src/styles/global.css.ejs +14 -33
  82. package/dist/templates/__when_unitTesting_vitest__/tests/App.test.tsx.ejs +0 -16
  83. package/dist/templates/__when_visualTesting_storybook__/.storybook/preview.js +0 -8
  84. package/dist/templates/src/components/ui/Toast.tsx.ejs +0 -61
  85. package/templates/__when_unitTesting_vitest__/tests/App.test.tsx.ejs +0 -16
  86. package/templates/__when_visualTesting_storybook__/.storybook/preview.js +0 -8
  87. package/templates/src/components/ui/Toast.tsx.ejs +0 -61
@@ -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
- }