@khester/create-dynamics-app 1.1.0 → 2.1.0

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 (210) hide show
  1. package/README.md +74 -0
  2. package/dist/artifacts/registry.d.ts +18 -0
  3. package/dist/artifacts/registry.d.ts.map +1 -0
  4. package/dist/artifacts/registry.js +340 -0
  5. package/dist/artifacts/registry.js.map +1 -0
  6. package/dist/artifacts/types.d.ts +122 -0
  7. package/dist/artifacts/types.d.ts.map +1 -0
  8. package/dist/artifacts/types.js +7 -0
  9. package/dist/artifacts/types.js.map +1 -0
  10. package/dist/artifacts/validators.d.ts +16 -0
  11. package/dist/artifacts/validators.d.ts.map +1 -0
  12. package/dist/artifacts/validators.js +45 -0
  13. package/dist/artifacts/validators.js.map +1 -0
  14. package/dist/fromDesign.d.ts +5 -0
  15. package/dist/fromDesign.d.ts.map +1 -0
  16. package/dist/fromDesign.js +98 -0
  17. package/dist/fromDesign.js.map +1 -0
  18. package/dist/index.js +129 -177
  19. package/dist/index.js.map +1 -1
  20. package/dist/injectDevTools.d.ts +28 -0
  21. package/dist/injectDevTools.d.ts.map +1 -0
  22. package/dist/injectDevTools.js +148 -0
  23. package/dist/injectDevTools.js.map +1 -0
  24. package/dist/scaffold.d.ts +48 -0
  25. package/dist/scaffold.d.ts.map +1 -0
  26. package/dist/scaffold.js +180 -0
  27. package/dist/scaffold.js.map +1 -0
  28. package/dist/templatePlan.d.ts +3 -0
  29. package/dist/templatePlan.d.ts.map +1 -0
  30. package/dist/templatePlan.js +43 -0
  31. package/dist/templatePlan.js.map +1 -0
  32. package/dist/utils/copyTemplate.d.ts +13 -1
  33. package/dist/utils/copyTemplate.d.ts.map +1 -1
  34. package/dist/utils/copyTemplate.js +98 -4
  35. package/dist/utils/copyTemplate.js.map +1 -1
  36. package/dist/utils/updatePackageJson.d.ts +11 -1
  37. package/dist/utils/updatePackageJson.d.ts.map +1 -1
  38. package/dist/utils/updatePackageJson.js +12 -10
  39. package/dist/utils/updatePackageJson.js.map +1 -1
  40. package/package.json +10 -7
  41. package/templates/_shared/dev-tools/auth/get-token.js +72 -0
  42. package/templates/_shared/dev-tools/dev/mock-xrm.js +42 -0
  43. package/templates/_shared/dev-tools/metadata-sync/index.js +152 -0
  44. package/templates/_shared/dev-tools/smoke/test-retrieve.js +44 -0
  45. package/templates/dialog-form/README.md +27 -0
  46. package/templates/dialog-form/_variants/App.v8.tsx +39 -0
  47. package/templates/dialog-form/_variants/App.v9.tsx +41 -0
  48. package/templates/dialog-form/gitignore +5 -0
  49. package/templates/dialog-form/package.json +27 -0
  50. package/templates/dialog-form/public/index.html +11 -0
  51. package/templates/dialog-form/src/index.tsx +10 -0
  52. package/templates/dialog-form/src/services/dataverse.ts +30 -0
  53. package/templates/dialog-form/tsconfig.json +15 -0
  54. package/templates/dialog-form/webpack.config.js +17 -0
  55. package/templates/grid-customizer/README.md +28 -0
  56. package/templates/grid-customizer/gitignore +4 -0
  57. package/templates/grid-customizer/package.json +25 -0
  58. package/templates/grid-customizer/src/GridCustomizer.ts +28 -0
  59. package/templates/grid-customizer/src/cell-renderers.tsx +35 -0
  60. package/templates/grid-customizer/src/index.ts +4 -0
  61. package/templates/grid-customizer/src/types/grid-types.ts +30 -0
  62. package/templates/grid-customizer/src/utils/color-utils.ts +24 -0
  63. package/templates/grid-customizer/tsconfig.json +15 -0
  64. package/templates/grid-customizer/webpack.config.js +17 -0
  65. package/templates/pcf-dataset/ControlManifest.Input.xml +16 -0
  66. package/templates/pcf-dataset/README.md +21 -0
  67. package/templates/pcf-dataset/gitignore +5 -0
  68. package/templates/pcf-dataset/index.ts +39 -0
  69. package/templates/pcf-dataset/package.json +30 -0
  70. package/templates/pcf-dataset/strings/{{componentName}}.1033.resx +47 -0
  71. package/templates/pcf-dataset/tsconfig.json +8 -0
  72. package/templates/pcf-dataset/{{componentName}}Component.tsx +39 -0
  73. package/templates/pcf-field/ControlManifest.Input.xml +17 -0
  74. package/templates/pcf-field/README.md +95 -0
  75. package/templates/pcf-field/_variants/ValueInput.boolean.tsx +24 -0
  76. package/templates/pcf-field/_variants/ValueInput.date.tsx +27 -0
  77. package/templates/pcf-field/_variants/ValueInput.number.tsx +35 -0
  78. package/templates/pcf-field/_variants/ValueInput.text.tsx +27 -0
  79. package/templates/pcf-field/gitignore +5 -0
  80. package/templates/pcf-field/index.ts +61 -0
  81. package/templates/pcf-field/package.json +30 -0
  82. package/templates/pcf-field/strings/{{componentName}}.1033.resx +47 -0
  83. package/templates/pcf-field/tsconfig.json +8 -0
  84. package/templates/pcf-field/{{componentName}}Component.tsx +35 -0
  85. package/templates/power-pages-starter/gitignore +5 -0
  86. package/templates/react-custom-page/gitignore +5 -0
  87. package/templates/{dynamics-365-starter → react-custom-page}/package.json +3 -3
  88. package/templates/react-custom-page/tools/metadata-sync/index.js +152 -0
  89. package/templates/static-web-app/README.md +36 -0
  90. package/templates/static-web-app/_variants/App.v8.tsx +32 -0
  91. package/templates/static-web-app/_variants/App.v9.tsx +31 -0
  92. package/templates/static-web-app/api/host.json +12 -0
  93. package/templates/static-web-app/api/package.json +19 -0
  94. package/templates/static-web-app/api/src/functions/hello.ts +16 -0
  95. package/templates/static-web-app/api/tsconfig.json +14 -0
  96. package/templates/static-web-app/frontend/index.html +12 -0
  97. package/templates/static-web-app/frontend/package.json +23 -0
  98. package/templates/static-web-app/frontend/src/index.tsx +8 -0
  99. package/templates/static-web-app/frontend/tsconfig.json +16 -0
  100. package/templates/static-web-app/frontend/vite.config.ts +13 -0
  101. package/templates/static-web-app/gitignore +8 -0
  102. package/templates/static-web-app/package.json +15 -0
  103. package/templates/static-web-app/staticwebapp.config.json +7 -0
  104. package/templates/teams-app/README.md +27 -0
  105. package/templates/teams-app/_variants/graph.off.ts +7 -0
  106. package/templates/teams-app/_variants/graph.on.ts +22 -0
  107. package/templates/teams-app/appPackage/manifest.json +26 -0
  108. package/templates/teams-app/gitignore +5 -0
  109. package/templates/teams-app/index.html +12 -0
  110. package/templates/teams-app/package.json +26 -0
  111. package/templates/teams-app/src/App.tsx +25 -0
  112. package/templates/teams-app/src/index.tsx +8 -0
  113. package/templates/teams-app/tsconfig.json +16 -0
  114. package/templates/teams-app/vite.config.ts +9 -0
  115. package/templates/web-resource/README.md +39 -0
  116. package/templates/web-resource/_variants/App.v8.tsx +29 -0
  117. package/templates/web-resource/_variants/App.v9.tsx +28 -0
  118. package/templates/web-resource/gitignore +5 -0
  119. package/templates/web-resource/package.json +27 -0
  120. package/templates/web-resource/public/index.html +11 -0
  121. package/templates/web-resource/src/index.tsx +10 -0
  122. package/templates/web-resource/src/services/dataverse.ts +30 -0
  123. package/templates/web-resource/tsconfig.json +15 -0
  124. package/templates/web-resource/webpack.config.js +17 -0
  125. package/dist/utils/consultingHelpers.d.ts +0 -13
  126. package/dist/utils/consultingHelpers.d.ts.map +0 -1
  127. package/dist/utils/consultingHelpers.js +0 -569
  128. package/dist/utils/consultingHelpers.js.map +0 -1
  129. package/templates/dynamics-365-starter/INTEGRATION_TEST_RESULTS.md +0 -302
  130. package/templates/dynamics-365-starter/PHASE_4_COMPLETION_SUMMARY.md +0 -305
  131. package/templates/dynamics-365-starter/deployment/QUICKSTART-MAC.md +0 -507
  132. package/templates/dynamics-365-starter/deployment/QUICKSTART-WINDOWS.md +0 -372
  133. package/templates/dynamics-365-starter/deployment/pipelines/README.md +0 -375
  134. package/templates/dynamics-365-starter/deployment/pipelines/azure-pipelines.yml +0 -330
  135. package/templates/dynamics-365-starter/deployment/pipelines/github-actions.yml +0 -422
  136. package/templates/dynamics-365-starter/deployment/pipelines/jenkins.groovy +0 -636
  137. package/templates/dynamics-365-starter/deployment/scripts/deploy.ps1 +0 -417
  138. package/templates/dynamics-365-starter/deployment/scripts/deploy.sh +0 -582
  139. package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.ps1 +0 -486
  140. package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.sh +0 -567
  141. package/templates/dynamics-365-starter/deployment/scripts/validate-setup.ps1 +0 -703
  142. package/templates/dynamics-365-starter/deployment/scripts/validate-setup.sh +0 -671
  143. package/templates/dynamics-365-starter/docs/team-standards/README.md +0 -273
  144. package/templates/dynamics-365-starter/docs/team-standards/client-onboarding.md +0 -577
  145. package/templates/dynamics-365-starter/docs/team-standards/code-review-checklist.md +0 -359
  146. package/templates/dynamics-365-starter/docs/team-standards/coding-standards.md +0 -700
  147. package/templates/dynamics-365-starter/docs/team-standards/cross-platform-team-guide.md +0 -736
  148. package/templates/dynamics-365-starter/docs/team-standards/development-workflows.md +0 -727
  149. package/templates/dynamics-365-starter/docs/troubleshooting/common-errors.md +0 -758
  150. package/templates/dynamics-365-starter/docs/troubleshooting/platform-specific-issues.md +0 -878
  151. package/templates/dynamics-365-starter/src/client-project-template/README.md +0 -234
  152. package/templates/dynamics-365-starter/src/client-project-template/config/client.template.json +0 -114
  153. package/templates/dynamics-365-starter/src/client-project-template/config/environments/template.json +0 -186
  154. package/templates/dynamics-365-starter/src/client-project-template/scripts/client-setup.js +0 -667
  155. package/templates/dynamics-365-starter/src/examples/README.md +0 -52
  156. package/templates/dynamics-365-starter/src/examples/component-examples/opportunity-management.tsx +0 -625
  157. package/templates/dynamics-365-starter/src/examples/entity-examples/opportunity-model.ts +0 -545
  158. package/templates/dynamics-365-starter/src/examples/integration-examples/custom-pcf-wrapper.tsx +0 -722
  159. package/templates/dynamics-365-starter/src/examples/workflow-examples/sales-workflow.ts +0 -662
  160. package/templates/dynamics-365-starter/src/page-templates/EntityDashboard.tsx +0 -519
  161. package/templates/dynamics-365-starter/src/page-templates/EntityDetailPage.tsx +0 -456
  162. package/templates/dynamics-365-starter/src/page-templates/EntityListPage.tsx +0 -406
  163. package/templates/dynamics-365-starter/src/page-templates/RelatedEntitiesPage.tsx +0 -578
  164. package/templates/dynamics-365-starter/src/page-templates/SearchPage.tsx +0 -629
  165. package/templates/dynamics-365-starter/tools/entity-generator/index.js +0 -168
  166. package/templates/dynamics-365-starter/tools/entity-generator/templates/constants.template.ts +0 -124
  167. package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.css +0 -283
  168. package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.tsx +0 -275
  169. package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.css +0 -204
  170. package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.tsx +0 -413
  171. package/templates/dynamics-365-starter/tools/entity-generator/templates/model.template.ts +0 -250
  172. package/templates/dynamics-365-starter/tools/metadata-sync/d365-client.js +0 -410
  173. package/templates/dynamics-365-starter/tools/metadata-sync/index.js +0 -512
  174. package/templates/dynamics-365-starter/tools/metadata-sync/type-generator.js +0 -675
  175. /package/templates/{dynamics-365-starter → react-custom-page}/README.md +0 -0
  176. /package/templates/{dynamics-365-starter → react-custom-page}/deployment/README.md +0 -0
  177. /package/templates/{dynamics-365-starter → react-custom-page}/docs/ARCHITECTURE_OVERVIEW.md +0 -0
  178. /package/templates/{dynamics-365-starter → react-custom-page}/docs/BEST_PRACTICES.md +0 -0
  179. /package/templates/{dynamics-365-starter → react-custom-page}/docs/MIGRATION_GUIDE.md +0 -0
  180. /package/templates/{dynamics-365-starter → react-custom-page}/public/index.html +0 -0
  181. /package/templates/{dynamics-365-starter → react-custom-page}/scripts/custom-build.js +0 -0
  182. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountForm.css +0 -0
  183. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountForm.tsx +0 -0
  184. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountManagement.css +0 -0
  185. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountManagement.tsx +0 -0
  186. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactForm.css +0 -0
  187. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactForm.tsx +0 -0
  188. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactManagement.css +0 -0
  189. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactManagement.tsx +0 -0
  190. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LogDialog.tsx +0 -0
  191. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingContext.tsx +0 -0
  192. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingDebugPanel.css +0 -0
  193. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingDebugPanel.tsx +0 -0
  194. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingProvider.tsx +0 -0
  195. /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/logger.ts +0 -0
  196. /package/templates/{dynamics-365-starter → react-custom-page}/src/constants/account.ts +0 -0
  197. /package/templates/{dynamics-365-starter → react-custom-page}/src/constants/contact.ts +0 -0
  198. /package/templates/{dynamics-365-starter → react-custom-page}/src/index.tsx +0 -0
  199. /package/templates/{dynamics-365-starter → react-custom-page}/src/models/Account.ts +0 -0
  200. /package/templates/{dynamics-365-starter → react-custom-page}/src/models/BaseEntity.ts +0 -0
  201. /package/templates/{dynamics-365-starter → react-custom-page}/src/models/Contact.ts +0 -0
  202. /package/templates/{dynamics-365-starter → react-custom-page}/src/pcf/ContactControlWrapper.tsx +0 -0
  203. /package/templates/{dynamics-365-starter → react-custom-page}/src/pcf/MultiEntityControlWrapper.tsx +0 -0
  204. /package/templates/{dynamics-365-starter → react-custom-page}/src/providers/DynamicsProvider.tsx +0 -0
  205. /package/templates/{dynamics-365-starter → react-custom-page}/src/services/MockApiService.ts +0 -0
  206. /package/templates/{dynamics-365-starter → react-custom-page}/src/services/ServiceFactory.ts +0 -0
  207. /package/templates/{dynamics-365-starter → react-custom-page}/src/services/XrmApiService.ts +0 -0
  208. /package/templates/{dynamics-365-starter → react-custom-page}/src/styles/index.css +0 -0
  209. /package/templates/{dynamics-365-starter → react-custom-page}/tsconfig.json +0 -0
  210. /package/templates/{dynamics-365-starter → react-custom-page}/webpack.config.js +0 -0
@@ -1,671 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Developer Environment Validation Script
4
- # Cross-platform validation for Dynamics 365 development setup
5
-
6
- set -euo pipefail
7
-
8
- # Colors for output
9
- RED='\033[0;31m'
10
- GREEN='\033[0;32m'
11
- YELLOW='\033[1;33m'
12
- BLUE='\033[0;34m'
13
- MAGENTA='\033[0;35m'
14
- CYAN='\033[0;36m'
15
- NC='\033[0m' # No Color
16
-
17
- # Script configuration
18
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19
- PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
20
-
21
- # Validation results
22
- VALIDATION_PASSED=true
23
- ERRORS=()
24
- WARNINGS=()
25
-
26
- # Platform detection
27
- detect_platform() {
28
- case "$(uname -s)" in
29
- Darwin*) echo "mac" ;;
30
- Linux*) echo "linux" ;;
31
- CYGWIN*|MINGW32*|MSYS*|MINGW*) echo "windows" ;;
32
- *) echo "unknown" ;;
33
- esac
34
- }
35
-
36
- # Architecture detection
37
- detect_arch() {
38
- case "$(uname -m)" in
39
- x86_64|amd64) echo "x64" ;;
40
- arm64|aarch64) echo "arm64" ;;
41
- *) echo "unknown" ;;
42
- esac
43
- }
44
-
45
- show_banner() {
46
- echo -e "${CYAN}"
47
- echo "╔══════════════════════════════════════════════════════════════╗"
48
- echo "║ Developer Environment Validation Tool ║"
49
- echo "║ Cross-Platform Compatibility Check ║"
50
- echo "╚══════════════════════════════════════════════════════════════╝"
51
- echo -e "${NC}"
52
- }
53
-
54
- log_info() {
55
- echo -e "${BLUE}ℹ️ $1${NC}"
56
- }
57
-
58
- log_success() {
59
- echo -e "${GREEN}✅ $1${NC}"
60
- }
61
-
62
- log_warning() {
63
- echo -e "${YELLOW}⚠️ $1${NC}"
64
- WARNINGS+=("$1")
65
- }
66
-
67
- log_error() {
68
- echo -e "${RED}❌ $1${NC}"
69
- ERRORS+=("$1")
70
- VALIDATION_PASSED=false
71
- }
72
-
73
- check_command() {
74
- local cmd="$1"
75
- local required="$2"
76
- local min_version="$3"
77
-
78
- if command -v "$cmd" &> /dev/null; then
79
- local version=$(eval "$cmd --version" 2>/dev/null | head -n1 || echo "unknown")
80
- log_success "$cmd is installed - $version"
81
-
82
- # Version checking for critical tools
83
- if [ "$cmd" = "node" ] && [ -n "$min_version" ]; then
84
- local current_version=$(node --version | sed 's/v//')
85
- if ! version_gte "$current_version" "$min_version"; then
86
- log_warning "$cmd version $current_version is below recommended $min_version"
87
- fi
88
- fi
89
-
90
- return 0
91
- else
92
- if [ "$required" = "true" ]; then
93
- log_error "$cmd is required but not installed"
94
- else
95
- log_warning "$cmd is not installed (optional)"
96
- fi
97
- return 1
98
- fi
99
- }
100
-
101
- version_gte() {
102
- printf '%s\n%s\n' "$2" "$1" | sort -V -C 2>/dev/null
103
- }
104
-
105
- validate_prerequisites() {
106
- local platform="$1"
107
-
108
- log_info "Checking prerequisites for $platform platform..."
109
- echo
110
-
111
- # Core development tools
112
- check_command "node" "true" "18.0.0"
113
- check_command "npm" "true" ""
114
- check_command "git" "true" ""
115
-
116
- # Platform-specific tools
117
- case "$platform" in
118
- mac|linux)
119
- check_command "jq" "false" ""
120
- check_command "curl" "true" ""
121
- check_command "bash" "true" ""
122
- ;;
123
- windows)
124
- check_command "jq" "false" ""
125
- check_command "curl" "false" ""
126
- if command -v pwsh &> /dev/null; then
127
- log_success "PowerShell Core is available"
128
- elif command -v powershell &> /dev/null; then
129
- log_success "Windows PowerShell is available"
130
- else
131
- log_warning "PowerShell not detected (recommended for Windows)"
132
- fi
133
- ;;
134
- esac
135
-
136
- # Optional development tools
137
- check_command "code" "false" ""
138
- check_command "docker" "false" ""
139
-
140
- echo
141
- }
142
-
143
- validate_project_structure() {
144
- log_info "Validating project structure..."
145
- echo
146
-
147
- # Core project files
148
- local required_files=(
149
- "package.json"
150
- "tsconfig.json"
151
- "src/index.tsx"
152
- "deployment/README.md"
153
- )
154
-
155
- for file in "${required_files[@]}"; do
156
- local file_path="$PROJECT_ROOT/$file"
157
- if [ -f "$file_path" ]; then
158
- log_success "Found required file: $file"
159
- else
160
- log_error "Missing required file: $file"
161
- fi
162
- done
163
-
164
- # Deployment scripts
165
- local script_types=("sh" "ps1")
166
- for script_type in "${script_types[@]}"; do
167
- local script_count=$(find "$PROJECT_ROOT/deployment/scripts" -name "*.$script_type" 2>/dev/null | wc -l)
168
- if [ "$script_count" -gt 0 ]; then
169
- log_success "Found $script_count .$script_type deployment scripts"
170
- else
171
- log_warning "No .$script_type deployment scripts found"
172
- fi
173
- done
174
-
175
- # Configuration directories
176
- local config_dirs=(
177
- "config/environments"
178
- "deployment/scripts"
179
- "src/models"
180
- "src/services"
181
- )
182
-
183
- for dir in "${config_dirs[@]}"; do
184
- local dir_path="$PROJECT_ROOT/$dir"
185
- if [ -d "$dir_path" ]; then
186
- log_success "Found directory: $dir"
187
- else
188
- log_error "Missing directory: $dir"
189
- fi
190
- done
191
-
192
- echo
193
- }
194
-
195
- validate_dependencies() {
196
- log_info "Validating npm dependencies..."
197
- echo
198
-
199
- if [ ! -f "$PROJECT_ROOT/package.json" ]; then
200
- log_error "package.json not found"
201
- return
202
- fi
203
-
204
- # Check if node_modules exists
205
- if [ -d "$PROJECT_ROOT/node_modules" ]; then
206
- log_success "node_modules directory exists"
207
-
208
- # Check package-lock.json
209
- if [ -f "$PROJECT_ROOT/package-lock.json" ]; then
210
- log_success "package-lock.json exists (good for reproducible builds)"
211
- else
212
- log_warning "package-lock.json missing (consider running 'npm install')"
213
- fi
214
-
215
- # Validate key dependencies
216
- local key_deps=("react" "typescript" "@types/react")
217
- for dep in "${key_deps[@]}"; do
218
- if [ -d "$PROJECT_ROOT/node_modules/$dep" ]; then
219
- log_success "Dependency installed: $dep"
220
- else
221
- log_warning "Dependency missing: $dep"
222
- fi
223
- done
224
- else
225
- log_error "node_modules directory missing - run 'npm install'"
226
- fi
227
-
228
- # Check for outdated packages
229
- if command -v npm &> /dev/null; then
230
- local outdated_output
231
- if outdated_output=$(npm outdated --silent 2>/dev/null); then
232
- if [ -n "$outdated_output" ]; then
233
- log_warning "Some packages are outdated - consider running 'npm update'"
234
- else
235
- log_success "All packages are up to date"
236
- fi
237
- fi
238
- fi
239
-
240
- echo
241
- }
242
-
243
- validate_configuration() {
244
- log_info "Validating environment configuration..."
245
- echo
246
-
247
- local config_dir="$PROJECT_ROOT/config/environments"
248
-
249
- if [ ! -d "$config_dir" ]; then
250
- log_error "Configuration directory missing: config/environments"
251
- return
252
- fi
253
-
254
- # Check for template file
255
- if [ -f "$config_dir/template.json" ]; then
256
- log_success "Template configuration file exists"
257
- else
258
- log_warning "Template configuration file missing"
259
- fi
260
-
261
- # Check for environment-specific files
262
- local env_files=($(find "$config_dir" -name "*.json" -not -name "template.json" 2>/dev/null | wc -l))
263
- if [ "$env_files" -gt 0 ]; then
264
- log_success "Found $env_files environment configuration files"
265
-
266
- # List environment files
267
- for env_file in "$config_dir"/*.json; do
268
- if [ -f "$env_file" ] && [[ ! "$env_file" =~ template\.json$ ]]; then
269
- local env_name=$(basename "$env_file" .json)
270
- log_info " Environment: $env_name"
271
- fi
272
- done
273
- else
274
- log_warning "No environment-specific configuration files found"
275
- log_info "Create environment configs from template.json"
276
- fi
277
-
278
- # Check .env files
279
- if [ -f "$PROJECT_ROOT/.env.local" ]; then
280
- log_success "Local environment file (.env.local) exists"
281
- else
282
- log_warning "Local environment file (.env.local) missing"
283
- log_info "Create .env.local for personal configuration"
284
- fi
285
-
286
- if [ -f "$PROJECT_ROOT/.env" ]; then
287
- log_warning "Found .env file - ensure it doesn't contain secrets"
288
- fi
289
-
290
- echo
291
- }
292
-
293
- validate_build_system() {
294
- log_info "Validating build system..."
295
- echo
296
-
297
- # Check TypeScript configuration
298
- if [ -f "$PROJECT_ROOT/tsconfig.json" ]; then
299
- log_success "TypeScript configuration exists"
300
-
301
- # Validate TypeScript can compile
302
- if command -v npx &> /dev/null; then
303
- if npx tsc --noEmit --skipLibCheck &>/dev/null; then
304
- log_success "TypeScript compilation check passed"
305
- else
306
- log_warning "TypeScript compilation issues detected"
307
- fi
308
- fi
309
- else
310
- log_error "TypeScript configuration missing (tsconfig.json)"
311
- fi
312
-
313
- # Check package.json scripts
314
- if [ -f "$PROJECT_ROOT/package.json" ]; then
315
- local required_scripts=("build" "build:prod" "lint" "typecheck")
316
- for script in "${required_scripts[@]}"; do
317
- if jq -e ".scripts.\"$script\"" "$PROJECT_ROOT/package.json" &>/dev/null; then
318
- log_success "npm script exists: $script"
319
- else
320
- log_warning "npm script missing: $script"
321
- fi
322
- done
323
- fi
324
-
325
- # Check if project builds
326
- if command -v npm &> /dev/null && [ -f "$PROJECT_ROOT/package.json" ]; then
327
- log_info "Testing build process..."
328
- cd "$PROJECT_ROOT"
329
- if npm run build:dev &>/dev/null; then
330
- log_success "Development build successful"
331
- else
332
- log_warning "Development build failed - check npm run build:dev"
333
- fi
334
- fi
335
-
336
- echo
337
- }
338
-
339
- validate_deployment_setup() {
340
- log_info "Validating deployment setup..."
341
- echo
342
-
343
- local deployment_dir="$PROJECT_ROOT/deployment"
344
-
345
- if [ ! -d "$deployment_dir" ]; then
346
- log_error "Deployment directory missing"
347
- return
348
- fi
349
-
350
- # Check deployment scripts
351
- local script_dir="$deployment_dir/scripts"
352
- if [ -d "$script_dir" ]; then
353
- log_success "Deployment scripts directory exists"
354
-
355
- # Check script permissions (Unix-like systems)
356
- if [ "$(uname -s)" != "Windows" ]; then
357
- local executable_scripts=($(find "$script_dir" -name "*.sh" -executable 2>/dev/null | wc -l))
358
- local total_scripts=($(find "$script_dir" -name "*.sh" 2>/dev/null | wc -l))
359
-
360
- if [ "$total_scripts" -gt 0 ]; then
361
- if [ "$executable_scripts" -eq "$total_scripts" ]; then
362
- log_success "All Bash scripts are executable"
363
- else
364
- log_warning "Some Bash scripts are not executable - run 'chmod +x deployment/scripts/*.sh'"
365
- fi
366
- fi
367
- fi
368
-
369
- # Check for required scripts
370
- local required_scripts=("deploy" "health-check" "team-onboarding")
371
- for script in "${required_scripts[@]}"; do
372
- if [ -f "$script_dir/$script.sh" ] || [ -f "$script_dir/$script.ps1" ]; then
373
- log_success "Required script exists: $script"
374
- else
375
- log_warning "Required script missing: $script"
376
- fi
377
- done
378
- else
379
- log_error "Deployment scripts directory missing"
380
- fi
381
-
382
- # Check deployment configuration
383
- if [ -f "$deployment_dir/README.md" ]; then
384
- log_success "Deployment documentation exists"
385
- else
386
- log_warning "Deployment documentation missing"
387
- fi
388
-
389
- echo
390
- }
391
-
392
- validate_development_tools() {
393
- log_info "Validating development tools and IDE setup..."
394
- echo
395
-
396
- # Check VS Code extensions (if VS Code is available)
397
- if command -v code &> /dev/null; then
398
- log_success "VS Code is available"
399
-
400
- # Check for workspace configuration
401
- if [ -f "$PROJECT_ROOT/.vscode/settings.json" ]; then
402
- log_success "VS Code workspace settings exist"
403
- else
404
- log_warning "VS Code workspace settings missing"
405
- fi
406
-
407
- if [ -f "$PROJECT_ROOT/.vscode/extensions.json" ]; then
408
- log_success "VS Code extension recommendations exist"
409
- else
410
- log_warning "VS Code extension recommendations missing"
411
- fi
412
- fi
413
-
414
- # Check Git configuration
415
- if command -v git &> /dev/null; then
416
- if git config --get user.name &>/dev/null && git config --get user.email &>/dev/null; then
417
- log_success "Git user configuration exists"
418
- else
419
- log_warning "Git user configuration incomplete"
420
- fi
421
-
422
- # Check for Git hooks
423
- if [ -d "$PROJECT_ROOT/.git/hooks" ]; then
424
- local hook_count=$(find "$PROJECT_ROOT/.git/hooks" -type f -not -name "*.sample" 2>/dev/null | wc -l)
425
- if [ "$hook_count" -gt 0 ]; then
426
- log_success "Git hooks are configured"
427
- else
428
- log_info "No custom Git hooks found"
429
- fi
430
- fi
431
- fi
432
-
433
- echo
434
- }
435
-
436
- validate_team_compatibility() {
437
- local platform="$1"
438
-
439
- log_info "Validating cross-platform team compatibility..."
440
- echo
441
-
442
- # Check for platform-specific quick start guides
443
- local guides_dir="$PROJECT_ROOT/deployment"
444
- if [ -f "$guides_dir/QUICKSTART-WINDOWS.md" ]; then
445
- log_success "Windows quick start guide exists"
446
- else
447
- log_warning "Windows quick start guide missing"
448
- fi
449
-
450
- if [ -f "$guides_dir/QUICKSTART-MAC.md" ]; then
451
- log_success "Mac quick start guide exists"
452
- else
453
- log_warning "Mac quick start guide missing"
454
- fi
455
-
456
- # Check for dual-platform scripts
457
- local scripts_dir="$PROJECT_ROOT/deployment/scripts"
458
- local script_pairs=(
459
- "deploy.sh:deploy.ps1"
460
- "health-check.sh:health-check.ps1"
461
- "team-onboarding.sh:team-onboarding.ps1"
462
- )
463
-
464
- for pair in "${script_pairs[@]}"; do
465
- IFS=':' read -r bash_script ps_script <<< "$pair"
466
- local has_bash=false
467
- local has_ps=false
468
-
469
- if [ -f "$scripts_dir/$bash_script" ]; then
470
- has_bash=true
471
- fi
472
-
473
- if [ -f "$scripts_dir/$ps_script" ]; then
474
- has_ps=true
475
- fi
476
-
477
- if [ "$has_bash" = true ] && [ "$has_ps" = true ]; then
478
- log_success "Cross-platform scripts available: ${bash_script%.*}"
479
- elif [ "$has_bash" = true ] || [ "$has_ps" = true ]; then
480
- log_warning "Only one platform script available: ${bash_script%.*}"
481
- else
482
- log_warning "No platform scripts found: ${bash_script%.*}"
483
- fi
484
- done
485
-
486
- # Check for shared configuration compatibility
487
- local config_files=($(find "$PROJECT_ROOT/config" -name "*.json" 2>/dev/null | wc -l))
488
- if [ "$config_files" -gt 0 ]; then
489
- log_success "JSON configuration files are cross-platform compatible"
490
- else
491
- log_warning "No JSON configuration files found"
492
- fi
493
-
494
- echo
495
- }
496
-
497
- run_quality_checks() {
498
- log_info "Running code quality checks..."
499
- echo
500
-
501
- if [ ! -f "$PROJECT_ROOT/package.json" ]; then
502
- log_warning "package.json not found - skipping quality checks"
503
- return
504
- fi
505
-
506
- cd "$PROJECT_ROOT"
507
-
508
- # Run linting
509
- if npm run lint &>/dev/null; then
510
- log_success "Linting passed"
511
- else
512
- log_warning "Linting issues detected - run 'npm run lint' to see details"
513
- fi
514
-
515
- # Run type checking
516
- if npm run typecheck &>/dev/null; then
517
- log_success "Type checking passed"
518
- else
519
- log_warning "Type checking issues detected - run 'npm run typecheck' to see details"
520
- fi
521
-
522
- # Run tests if available
523
- if jq -e '.scripts.test' package.json &>/dev/null; then
524
- if npm test &>/dev/null; then
525
- log_success "Tests passed"
526
- else
527
- log_warning "Tests failed - run 'npm test' to see details"
528
- fi
529
- else
530
- log_info "No test script configured"
531
- fi
532
-
533
- echo
534
- }
535
-
536
- generate_report() {
537
- echo
538
- echo -e "${CYAN}╔══════════════════════════════════════════════════════════════╗${NC}"
539
- echo -e "${CYAN}║ VALIDATION REPORT ║${NC}"
540
- echo -e "${CYAN}╚══════════════════════════════════════════════════════════════╝${NC}"
541
- echo
542
-
543
- # Summary
544
- if [ "$VALIDATION_PASSED" = true ]; then
545
- echo -e "${GREEN}🎉 VALIDATION PASSED${NC}"
546
- echo "Your development environment is properly configured!"
547
- else
548
- echo -e "${RED}❌ VALIDATION FAILED${NC}"
549
- echo "Please address the errors below before proceeding."
550
- fi
551
-
552
- echo
553
-
554
- # Error summary
555
- if [ ${#ERRORS[@]} -gt 0 ]; then
556
- echo -e "${RED}🚨 ERRORS (${#ERRORS[@]}):${NC}"
557
- for error in "${ERRORS[@]}"; do
558
- echo " • $error"
559
- done
560
- echo
561
- fi
562
-
563
- # Warning summary
564
- if [ ${#WARNINGS[@]} -gt 0 ]; then
565
- echo -e "${YELLOW}⚠️ WARNINGS (${#WARNINGS[@]}):${NC}"
566
- for warning in "${WARNINGS[@]}"; do
567
- echo " • $warning"
568
- done
569
- echo
570
- fi
571
-
572
- # Platform information
573
- local platform=$(detect_platform)
574
- local arch=$(detect_arch)
575
- echo -e "${BLUE}📋 PLATFORM INFORMATION:${NC}"
576
- echo " Platform: $platform"
577
- echo " Architecture: $arch"
578
- echo " Scripts: $([ "$platform" = "windows" ] && echo "PowerShell (.ps1)" || echo "Bash (.sh)")"
579
- echo
580
-
581
- # Next steps
582
- echo -e "${CYAN}🚀 NEXT STEPS:${NC}"
583
- if [ "$VALIDATION_PASSED" = true ]; then
584
- echo " 1. Run team onboarding script for your platform"
585
- echo " 2. Configure your first environment"
586
- echo " 3. Test deployment to development environment"
587
- echo " 4. Generate your first entity"
588
- else
589
- echo " 1. Fix all errors listed above"
590
- echo " 2. Address any warnings that apply to your workflow"
591
- echo " 3. Re-run this validation script"
592
- echo " 4. Proceed with team onboarding when validation passes"
593
- fi
594
-
595
- echo
596
- echo -e "${MAGENTA}📚 HELPFUL COMMANDS:${NC}"
597
- case "$platform" in
598
- windows)
599
- echo " Team Onboarding: .\\deployment\\scripts\\team-onboarding.ps1"
600
- echo " Quick Start: start deployment\\QUICKSTART-WINDOWS.md"
601
- echo " Deploy Dev: .\\deployment\\scripts\\deploy.ps1 -Environment dev"
602
- ;;
603
- *)
604
- echo " Team Onboarding: ./deployment/scripts/team-onboarding.sh"
605
- echo " Quick Start: open deployment/QUICKSTART-MAC.md"
606
- echo " Deploy Dev: ./deployment/scripts/deploy.sh dev"
607
- ;;
608
- esac
609
- echo
610
- }
611
-
612
- # Main execution
613
- main() {
614
- show_banner
615
-
616
- local platform=$(detect_platform)
617
- local arch=$(detect_arch)
618
-
619
- echo -e "${BLUE}Platform: $platform ($arch)${NC}"
620
- echo -e "${BLUE}Project: $(basename "$PROJECT_ROOT")${NC}"
621
- echo
622
-
623
- # Run all validation checks
624
- validate_prerequisites "$platform"
625
- validate_project_structure
626
- validate_dependencies
627
- validate_configuration
628
- validate_build_system
629
- validate_deployment_setup
630
- validate_development_tools
631
- validate_team_compatibility "$platform"
632
- run_quality_checks
633
-
634
- # Generate final report
635
- generate_report
636
-
637
- # Exit with appropriate code
638
- if [ "$VALIDATION_PASSED" = true ]; then
639
- exit 0
640
- else
641
- exit 1
642
- fi
643
- }
644
-
645
- # Handle script arguments
646
- case "${1:-}" in
647
- --help|-h)
648
- echo "Developer Environment Validation Tool"
649
- echo "Usage: $0 [options]"
650
- echo ""
651
- echo "Options:"
652
- echo " --help, -h Show this help message"
653
- echo " --quiet, -q Suppress informational output"
654
- echo " --verbose, -v Enable verbose output"
655
- echo ""
656
- echo "This script validates your development environment setup"
657
- echo "for cross-platform Dynamics 365 development."
658
- exit 0
659
- ;;
660
- --quiet|-q)
661
- # Suppress info messages in quiet mode
662
- log_info() { :; }
663
- ;;
664
- --verbose|-v)
665
- # Enable verbose output
666
- set -x
667
- ;;
668
- esac
669
-
670
- # Run main function
671
- main "$@"