create-content-sdk-app 2.0.2 → 2.1.0-canary.1

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 (36) hide show
  1. package/LICENSE.MD +202 -202
  2. package/dist/templates/nextjs/.cursor/rules/general.mdc +81 -81
  3. package/dist/templates/nextjs/.cursor/rules/javascript.mdc +112 -112
  4. package/dist/templates/nextjs/.cursor/rules/project-setup.mdc +100 -100
  5. package/dist/templates/nextjs/.cursor/rules/sitecore.mdc +150 -150
  6. package/dist/templates/nextjs/.env.container.example +27 -27
  7. package/dist/templates/nextjs/.env.remote.example +51 -51
  8. package/dist/templates/nextjs/.gitattributes +11 -11
  9. package/dist/templates/nextjs/.prettierrc +8 -8
  10. package/dist/templates/nextjs/.vscode/extensions.json +8 -8
  11. package/dist/templates/nextjs/.vscode/launch.json +15 -15
  12. package/dist/templates/nextjs/.windsurfrules +186 -186
  13. package/dist/templates/nextjs/LICENSE.txt +202 -202
  14. package/dist/templates/nextjs/eslint.config.mjs +81 -81
  15. package/dist/templates/nextjs/gitignore +28 -28
  16. package/dist/templates/nextjs/package.json +68 -68
  17. package/dist/templates/nextjs/sitecore.config.ts.example +40 -40
  18. package/dist/templates/nextjs/src/proxy.ts +11 -3
  19. package/dist/templates/nextjs/tsconfig.json +40 -40
  20. package/dist/templates/nextjs-app-router/.cursor/rules/app-router-setup.mdc +116 -116
  21. package/dist/templates/nextjs-app-router/.cursor/rules/general.mdc +80 -80
  22. package/dist/templates/nextjs-app-router/.cursor/rules/javascript.mdc +112 -112
  23. package/dist/templates/nextjs-app-router/.cursor/rules/sitecore.mdc +174 -174
  24. package/dist/templates/nextjs-app-router/.env.container.example +27 -27
  25. package/dist/templates/nextjs-app-router/.env.remote.example +51 -51
  26. package/dist/templates/nextjs-app-router/.gitattributes +11 -11
  27. package/dist/templates/nextjs-app-router/.windsurfrules +290 -290
  28. package/dist/templates/nextjs-app-router/eslint.config.mjs +29 -29
  29. package/dist/templates/nextjs-app-router/gitignore +31 -31
  30. package/dist/templates/nextjs-app-router/package.json +55 -55
  31. package/dist/templates/nextjs-app-router/postcss.config.mjs +5 -5
  32. package/dist/templates/nextjs-app-router/sitecore.config.ts.example +40 -40
  33. package/dist/templates/nextjs-app-router/src/app/globals.css +1 -1
  34. package/dist/templates/nextjs-app-router/src/proxy.ts +11 -3
  35. package/dist/templates/nextjs-app-router/tsconfig.json +48 -48
  36. package/package.json +2 -2
@@ -1,80 +1,80 @@
1
- ---
2
- description: Core coding principles for your Sitecore project
3
- alwaysApply: true
4
- globs: []
5
- ---
6
-
7
- # General Coding Principles
8
-
9
- ## Universal Standards
10
-
11
- DRY Principle:
12
-
13
- - Don't Repeat Yourself - extract common functionality
14
- - Create reusable utilities and helper functions
15
- - Use composition over inheritance
16
- - Share types and interfaces across modules
17
-
18
- SOLID Principles:
19
-
20
- - Single Responsibility: each function/class has one purpose
21
- - Open/Closed: extend functionality through composition
22
- - Dependency Inversion: depend on abstractions, not implementations
23
-
24
- Code Clarity:
25
-
26
- - Write self-documenting code with clear intent
27
- - Use meaningful names that express business concepts
28
- - Prefer explicit over implicit behavior
29
- - Make dependencies and requirements obvious
30
-
31
- ## Architecture Patterns
32
-
33
- Modular Design:
34
-
35
- - Organize code into focused, cohesive modules
36
- - Minimize coupling between modules
37
- - Use clear interfaces between layers
38
- - Follow established patterns consistently
39
-
40
- Data Flow:
41
-
42
- - Prefer unidirectional data flow
43
- - Validate inputs at system boundaries
44
- - Transform data at appropriate layers
45
- - Handle errors close to their source
46
-
47
- Testing:
48
-
49
- - Write testable code with minimal dependencies
50
- - Use dependency injection for better testability
51
- - Mock external services and side effects
52
- - Test behavior, not implementation details
53
-
54
- ## Development Standards
55
-
56
- Version Control:
57
-
58
- - Write descriptive commit messages
59
- - Keep commits focused and atomic
60
- - Use branching strategies appropriate to team size
61
- - Review code before merging
62
-
63
- Documentation:
64
-
65
- - Document public APIs and interfaces
66
- - Include usage examples for complex functionality
67
- - Keep documentation close to code
68
- - Update documentation with code changes
69
-
70
- Performance:
71
-
72
- - Optimize for readability first, performance second
73
- - Profile before optimizing
74
- - Cache expensive operations appropriately
75
- - Consider memory usage and cleanup
76
-
77
- Referenced:
78
- @src/app/
79
- @src/components/
80
- @src/lib/
1
+ ---
2
+ description: Core coding principles for your Sitecore project
3
+ alwaysApply: true
4
+ globs: []
5
+ ---
6
+
7
+ # General Coding Principles
8
+
9
+ ## Universal Standards
10
+
11
+ DRY Principle:
12
+
13
+ - Don't Repeat Yourself - extract common functionality
14
+ - Create reusable utilities and helper functions
15
+ - Use composition over inheritance
16
+ - Share types and interfaces across modules
17
+
18
+ SOLID Principles:
19
+
20
+ - Single Responsibility: each function/class has one purpose
21
+ - Open/Closed: extend functionality through composition
22
+ - Dependency Inversion: depend on abstractions, not implementations
23
+
24
+ Code Clarity:
25
+
26
+ - Write self-documenting code with clear intent
27
+ - Use meaningful names that express business concepts
28
+ - Prefer explicit over implicit behavior
29
+ - Make dependencies and requirements obvious
30
+
31
+ ## Architecture Patterns
32
+
33
+ Modular Design:
34
+
35
+ - Organize code into focused, cohesive modules
36
+ - Minimize coupling between modules
37
+ - Use clear interfaces between layers
38
+ - Follow established patterns consistently
39
+
40
+ Data Flow:
41
+
42
+ - Prefer unidirectional data flow
43
+ - Validate inputs at system boundaries
44
+ - Transform data at appropriate layers
45
+ - Handle errors close to their source
46
+
47
+ Testing:
48
+
49
+ - Write testable code with minimal dependencies
50
+ - Use dependency injection for better testability
51
+ - Mock external services and side effects
52
+ - Test behavior, not implementation details
53
+
54
+ ## Development Standards
55
+
56
+ Version Control:
57
+
58
+ - Write descriptive commit messages
59
+ - Keep commits focused and atomic
60
+ - Use branching strategies appropriate to team size
61
+ - Review code before merging
62
+
63
+ Documentation:
64
+
65
+ - Document public APIs and interfaces
66
+ - Include usage examples for complex functionality
67
+ - Keep documentation close to code
68
+ - Update documentation with code changes
69
+
70
+ Performance:
71
+
72
+ - Optimize for readability first, performance second
73
+ - Profile before optimizing
74
+ - Cache expensive operations appropriately
75
+ - Consider memory usage and cleanup
76
+
77
+ Referenced:
78
+ @src/app/
79
+ @src/components/
80
+ @src/lib/
@@ -1,112 +1,112 @@
1
- ---
2
- description: JavaScript/TypeScript rules for your Sitecore App Router project
3
- alwaysApply: false
4
- globs:
5
- - '**/*.js'
6
- - '**/*.ts'
7
- - '**/*.tsx'
8
- - '**/*.mjs'
9
- ---
10
-
11
- # JavaScript/TypeScript Rules
12
-
13
- ## Naming Conventions
14
-
15
- Variables and Functions:
16
-
17
- - Use camelCase: `getUserData()`, `isLoading`, `currentUser`
18
- - Boolean variables: prefix with `is`, `has`, `can`, `should`
19
- - Event handlers: prefix with `handle` or `on`: `handleClick`, `onSubmit`
20
-
21
- Components (React):
22
-
23
- - Use PascalCase: `SitecoreComponent`, `PageLayout`, `ContentBlock`
24
- - File names match component names: `SitecoreComponent.tsx`
25
-
26
- Constants:
27
-
28
- - Use UPPER_SNAKE_CASE: `API_ENDPOINT`, `DEFAULT_TIMEOUT`, `MAX_RETRIES`
29
- - Export at module level when shared
30
-
31
- Directories:
32
-
33
- - Use kebab-case: `src/components`, `src/api-clients`, `src/sitecore-utils`
34
- - Organize by feature when appropriate: `src/content-management/`
35
-
36
- Types and Interfaces:
37
-
38
- - Use PascalCase with descriptive names: `ContentItem`, `LayoutProps`, `SitecoreConfig`
39
- - Prefix interfaces with `I` only when needed for disambiguation
40
-
41
- ## Code Layout and Organization
42
-
43
- Directory Structure:
44
-
45
- ```
46
- src/
47
- app/ # App Router pages and layouts
48
- components/ # UI components (React)
49
- lib/ # Configuration and utilities
50
- i18n/ # Internationalization setup
51
- types/ # TypeScript type definitions
52
- ```
53
-
54
- File Organization:
55
-
56
- - Server Components for data fetching and static content
57
- - Client Components for interactivity (use 'use client')
58
- - Group related functionality in feature directories
59
- - Keep components co-located with their styles and tests
60
-
61
- ## Error Handling
62
-
63
- API Calls:
64
-
65
- - Always wrap in try/catch blocks
66
- - Throw custom errors with context: `SitecoreFetchError`, `ConfigurationError`
67
- - Handle edge cases with guard clauses
68
-
69
- ```typescript
70
- async function fetchContent(id: string): Promise<ContentItem> {
71
- if (!id) {
72
- throw new Error('Content ID is required');
73
- }
74
-
75
- try {
76
- const response = await sitecoreClient.getItem(id);
77
- return response.data;
78
- } catch (error) {
79
- throw new SitecoreFetchError(`Failed to fetch content ${id}`, error);
80
- }
81
- }
82
- ```
83
-
84
- ## Security
85
-
86
- Input Validation:
87
-
88
- - Sanitize user inputs before processing
89
- - Validate data at application boundaries
90
- - Use type guards for runtime type checking
91
- - Escape content when rendering to prevent XSS
92
-
93
- ## Performance
94
-
95
- Optimization Patterns:
96
-
97
- - Cache API responses using React Query or SWR
98
- - Use Server Components for better performance
99
- - Lazy-load non-critical modules: `const Component = lazy(() => import('./Component'))`
100
- - Use useCallback and useMemo for expensive operations in Client Components
101
-
102
- TypeScript:
103
-
104
- - Enable strict mode in tsconfig.json
105
- - Prefer type assertions over any: `value as ContentItem`
106
- - Use discriminated unions for complex state management
107
-
108
- Referenced:
109
- @src/app/
110
- @src/components/
111
- @src/lib/
112
-
1
+ ---
2
+ description: JavaScript/TypeScript rules for your Sitecore App Router project
3
+ alwaysApply: false
4
+ globs:
5
+ - '**/*.js'
6
+ - '**/*.ts'
7
+ - '**/*.tsx'
8
+ - '**/*.mjs'
9
+ ---
10
+
11
+ # JavaScript/TypeScript Rules
12
+
13
+ ## Naming Conventions
14
+
15
+ Variables and Functions:
16
+
17
+ - Use camelCase: `getUserData()`, `isLoading`, `currentUser`
18
+ - Boolean variables: prefix with `is`, `has`, `can`, `should`
19
+ - Event handlers: prefix with `handle` or `on`: `handleClick`, `onSubmit`
20
+
21
+ Components (React):
22
+
23
+ - Use PascalCase: `SitecoreComponent`, `PageLayout`, `ContentBlock`
24
+ - File names match component names: `SitecoreComponent.tsx`
25
+
26
+ Constants:
27
+
28
+ - Use UPPER_SNAKE_CASE: `API_ENDPOINT`, `DEFAULT_TIMEOUT`, `MAX_RETRIES`
29
+ - Export at module level when shared
30
+
31
+ Directories:
32
+
33
+ - Use kebab-case: `src/components`, `src/api-clients`, `src/sitecore-utils`
34
+ - Organize by feature when appropriate: `src/content-management/`
35
+
36
+ Types and Interfaces:
37
+
38
+ - Use PascalCase with descriptive names: `ContentItem`, `LayoutProps`, `SitecoreConfig`
39
+ - Prefix interfaces with `I` only when needed for disambiguation
40
+
41
+ ## Code Layout and Organization
42
+
43
+ Directory Structure:
44
+
45
+ ```
46
+ src/
47
+ app/ # App Router pages and layouts
48
+ components/ # UI components (React)
49
+ lib/ # Configuration and utilities
50
+ i18n/ # Internationalization setup
51
+ types/ # TypeScript type definitions
52
+ ```
53
+
54
+ File Organization:
55
+
56
+ - Server Components for data fetching and static content
57
+ - Client Components for interactivity (use 'use client')
58
+ - Group related functionality in feature directories
59
+ - Keep components co-located with their styles and tests
60
+
61
+ ## Error Handling
62
+
63
+ API Calls:
64
+
65
+ - Always wrap in try/catch blocks
66
+ - Throw custom errors with context: `SitecoreFetchError`, `ConfigurationError`
67
+ - Handle edge cases with guard clauses
68
+
69
+ ```typescript
70
+ async function fetchContent(id: string): Promise<ContentItem> {
71
+ if (!id) {
72
+ throw new Error('Content ID is required');
73
+ }
74
+
75
+ try {
76
+ const response = await sitecoreClient.getItem(id);
77
+ return response.data;
78
+ } catch (error) {
79
+ throw new SitecoreFetchError(`Failed to fetch content ${id}`, error);
80
+ }
81
+ }
82
+ ```
83
+
84
+ ## Security
85
+
86
+ Input Validation:
87
+
88
+ - Sanitize user inputs before processing
89
+ - Validate data at application boundaries
90
+ - Use type guards for runtime type checking
91
+ - Escape content when rendering to prevent XSS
92
+
93
+ ## Performance
94
+
95
+ Optimization Patterns:
96
+
97
+ - Cache API responses using React Query or SWR
98
+ - Use Server Components for better performance
99
+ - Lazy-load non-critical modules: `const Component = lazy(() => import('./Component'))`
100
+ - Use useCallback and useMemo for expensive operations in Client Components
101
+
102
+ TypeScript:
103
+
104
+ - Enable strict mode in tsconfig.json
105
+ - Prefer type assertions over any: `value as ContentItem`
106
+ - Use discriminated unions for complex state management
107
+
108
+ Referenced:
109
+ @src/app/
110
+ @src/components/
111
+ @src/lib/
112
+