@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,878 +0,0 @@
1
- # Platform-Specific Troubleshooting Guide
2
-
3
- ## Overview
4
-
5
- This guide provides solutions for common issues encountered when developing Dynamics 365
6
- applications in mixed Windows/Mac environments. It's organized by platform and includes
7
- cross-platform compatibility troubleshooting.
8
-
9
- ## Table of Contents
10
-
11
- 1. [Windows-Specific Issues](#windows-specific-issues)
12
- 2. [Mac-Specific Issues](#mac-specific-issues)
13
- 3. [Cross-Platform Compatibility Issues](#cross-platform-compatibility-issues)
14
- 4. [Deployment Issues](#deployment-issues)
15
- 5. [Development Environment Issues](#development-environment-issues)
16
- 6. [CI/CD Pipeline Issues](#cicd-pipeline-issues)
17
- 7. [Quick Reference](#quick-reference)
18
-
19
- ## Windows-Specific Issues
20
-
21
- ### 🖥️ PowerShell Issues
22
-
23
- #### Issue: PowerShell Execution Policy Prevents Script Running
24
-
25
- **Error:**
26
-
27
- ```powershell
28
- .\deploy.ps1 : File cannot be loaded because running scripts is disabled on this system.
29
- ```
30
-
31
- **Solution:**
32
-
33
- ```powershell
34
- # Check current execution policy
35
- Get-ExecutionPolicy
36
-
37
- # Set execution policy for current user
38
- Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
39
-
40
- # Alternative: Bypass for single session
41
- Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
42
-
43
- # Verify change
44
- Get-ExecutionPolicy -List
45
- ```
46
-
47
- **Prevention:** Add to team onboarding checklist and PowerShell profile:
48
-
49
- ```powershell
50
- # Add to $PROFILE
51
- if ((Get-ExecutionPolicy) -eq 'Restricted') {
52
- Write-Warning "PowerShell execution policy is restricted. Run: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser"
53
- }
54
- ```
55
-
56
- #### Issue: PowerShell Module Not Found
57
-
58
- **Error:**
59
-
60
- ```powershell
61
- Import-Module : The specified module 'Microsoft.PowerApps.PowerShell' was not loaded because no valid module file was found.
62
- ```
63
-
64
- **Solution:**
65
-
66
- ```powershell
67
- # Install required modules (run as Administrator)
68
- Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Force -AllowClobber
69
- Install-Module -Name Microsoft.PowerApps.PowerShell -Force -AllowClobber
70
-
71
- # For current user only (no admin required)
72
- Install-Module -Name Microsoft.PowerApps.PowerShell -Scope CurrentUser -Force
73
-
74
- # Verify installation
75
- Get-Module -Name Microsoft.PowerApps* -ListAvailable
76
-
77
- # Import manually if needed
78
- Import-Module Microsoft.PowerApps.PowerShell -Force
79
- ```
80
-
81
- **Prevention:**
82
-
83
- ```powershell
84
- # Add to deployment scripts
85
- if (-not (Get-Module -Name Microsoft.PowerApps.PowerShell -ListAvailable)) {
86
- Write-Host "Installing required PowerShell modules..." -ForegroundColor Yellow
87
- Install-Module -Name Microsoft.PowerApps.PowerShell -Scope CurrentUser -Force
88
- }
89
- ```
90
-
91
- #### Issue: PowerShell Version Compatibility
92
-
93
- **Error:**
94
-
95
- ```powershell
96
- The term 'ConvertTo-Json' is not recognized as the name of a cmdlet
97
- ```
98
-
99
- **Solution:**
100
-
101
- ```powershell
102
- # Check PowerShell version
103
- $PSVersionTable
104
-
105
- # Update to PowerShell 7+ (recommended)
106
- winget install Microsoft.PowerShell
107
-
108
- # Alternative: Use Windows PowerShell 5.1 compatible syntax
109
- if ($PSVersionTable.PSVersion.Major -lt 6) {
110
- # Use .NET methods for JSON
111
- [System.Web.Script.Serialization.JavaScriptSerializer]::new().Serialize($object)
112
- } else {
113
- # Use modern PowerShell
114
- $object | ConvertTo-Json
115
- }
116
- ```
117
-
118
- ### 🔧 Windows Environment Issues
119
-
120
- #### Issue: Node.js Path Issues
121
-
122
- **Error:**
123
-
124
- ```cmd
125
- 'node' is not recognized as an internal or external command
126
- ```
127
-
128
- **Solution:**
129
-
130
- ```powershell
131
- # Check if Node.js is installed
132
- node --version
133
-
134
- # If not found, check PATH
135
- $env:PATH -split ';' | Where-Object { $_ -like '*node*' }
136
-
137
- # Install Node.js
138
- choco install nodejs
139
-
140
- # Or using winget
141
- winget install OpenJS.NodeJS
142
-
143
- # Refresh environment variables
144
- refreshenv
145
-
146
- # Verify installation
147
- node --version
148
- npm --version
149
- ```
150
-
151
- #### Issue: npm Permission Errors
152
-
153
- **Error:**
154
-
155
- ```cmd
156
- npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Users\...\AppData\Roaming\npm'
157
- ```
158
-
159
- **Solution:**
160
-
161
- ```powershell
162
- # Run as Administrator (temporary fix)
163
- Start-Process powershell -Verb runAs
164
-
165
- # Better solution: Configure npm for current user
166
- npm config set prefix $env:USERPROFILE\npm-global
167
- npm config set cache $env:USERPROFILE\.npm-cache
168
-
169
- # Add to PATH
170
- $npmPath = "$env:USERPROFILE\npm-global"
171
- if ($env:PATH -notlike "*$npmPath*") {
172
- [Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";$npmPath", "User")
173
- }
174
- ```
175
-
176
- #### Issue: Git Line Ending Problems
177
-
178
- **Error:**
179
-
180
- ```
181
- warning: LF will be replaced by CRLF in package.json
182
- ```
183
-
184
- **Solution:**
185
-
186
- ```powershell
187
- # Configure Git for Windows line endings
188
- git config --global core.autocrlf true
189
- git config --global core.eol crlf
190
-
191
- # For cross-platform teams (recommended)
192
- git config --global core.autocrlf input
193
- git config --global core.eol lf
194
-
195
- # Add .gitattributes file to project root
196
- echo "* text=auto eol=lf" | Out-File -FilePath .gitattributes -Encoding utf8
197
-
198
- # Refresh repository
199
- git rm --cached -r .
200
- git reset --hard
201
- ```
202
-
203
- ### 🔒 Windows Security Issues
204
-
205
- #### Issue: Windows Defender Blocking Execution
206
-
207
- **Error:**
208
-
209
- ```
210
- Windows Defender SmartScreen prevented an unrecognized app from starting
211
- ```
212
-
213
- **Solution:**
214
-
215
- ```powershell
216
- # Add project folder to Windows Defender exclusions
217
- Add-MpPreference -ExclusionPath "C:\path\to\your\project"
218
-
219
- # Or add via Windows Security app:
220
- # Windows Security > Virus & threat protection > Exclusions > Add exclusion
221
-
222
- # For development tools
223
- Add-MpPreference -ExclusionPath $env:USERPROFILE\.npm
224
- Add-MpPreference -ExclusionPath $env:USERPROFILE\node_modules
225
- ```
226
-
227
- ## Mac-Specific Issues
228
-
229
- ### 🍎 Terminal and Shell Issues
230
-
231
- #### Issue: Command Not Found
232
-
233
- **Error:**
234
-
235
- ```bash
236
- bash: node: command not found
237
- ```
238
-
239
- **Solution:**
240
-
241
- ```bash
242
- # Check if Node.js is installed
243
- which node
244
-
245
- # Install using Homebrew
246
- brew install node
247
-
248
- # Install Homebrew if not available
249
- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
250
-
251
- # Add Homebrew to PATH (for Apple Silicon Macs)
252
- echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
253
- source ~/.zshrc
254
-
255
- # Verify installation
256
- node --version
257
- npm --version
258
- ```
259
-
260
- #### Issue: Shell Script Not Executable
261
-
262
- **Error:**
263
-
264
- ```bash
265
- bash: ./deploy.sh: Permission denied
266
- ```
267
-
268
- **Solution:**
269
-
270
- ```bash
271
- # Make script executable
272
- chmod +x deployment/scripts/deploy.sh
273
-
274
- # Make all scripts executable
275
- find deployment/scripts -name "*.sh" -exec chmod +x {} \;
276
-
277
- # Check permissions
278
- ls -la deployment/scripts/
279
-
280
- # Add to Git to preserve permissions
281
- git update-index --chmod=+x deployment/scripts/deploy.sh
282
- git commit -m "fix: make deployment scripts executable"
283
- ```
284
-
285
- #### Issue: Zsh vs Bash Compatibility
286
-
287
- **Error:**
288
-
289
- ```bash
290
- zsh: bad pattern: *.json
291
- ```
292
-
293
- **Solution:**
294
-
295
- ```bash
296
- # Check current shell
297
- echo $SHELL
298
-
299
- # For Zsh compatibility in scripts
300
- #!/bin/zsh
301
- setopt BASH_REMATCH
302
- setopt KSH_GLOB
303
-
304
- # Or force Bash in script
305
- #!/bin/bash
306
-
307
- # Configure Zsh for better Bash compatibility
308
- echo 'setopt BASH_REMATCH' >> ~/.zshrc
309
- echo 'setopt KSH_GLOB' >> ~/.zshrc
310
- source ~/.zshrc
311
- ```
312
-
313
- ### 🔧 Mac System Issues
314
-
315
- #### Issue: Xcode Command Line Tools Missing
316
-
317
- **Error:**
318
-
319
- ```bash
320
- xcrun: error: invalid active developer path
321
- ```
322
-
323
- **Solution:**
324
-
325
- ```bash
326
- # Install Xcode Command Line Tools
327
- xcode-select --install
328
-
329
- # Reset if already installed but broken
330
- sudo xcode-select --reset
331
- sudo xcode-select --install
332
-
333
- # Verify installation
334
- xcode-select -p
335
- gcc --version
336
- ```
337
-
338
- #### Issue: MacOS Catalina+ Security Restrictions
339
-
340
- **Error:**
341
-
342
- ```bash
343
- "deploy.sh" cannot be opened because the developer cannot be verified
344
- ```
345
-
346
- **Solution:**
347
-
348
- ```bash
349
- # Remove quarantine attribute
350
- xattr -dr com.apple.quarantine deployment/scripts/deploy.sh
351
-
352
- # Or for entire project
353
- find . -name "*.sh" -exec xattr -dr com.apple.quarantine {} \;
354
-
355
- # Allow in System Preferences
356
- # System Preferences > Security & Privacy > General > Allow anyway
357
-
358
- # Alternative: Use spctl
359
- sudo spctl --master-disable # Disable Gatekeeper (not recommended)
360
- sudo spctl --master-enable # Re-enable when done
361
- ```
362
-
363
- #### Issue: Homebrew Path Issues
364
-
365
- **Error:**
366
-
367
- ```bash
368
- brew: command not found
369
- ```
370
-
371
- **Solution:**
372
-
373
- ```bash
374
- # For Intel Macs
375
- echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc
376
-
377
- # For Apple Silicon Macs
378
- echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
379
-
380
- # Reload shell configuration
381
- source ~/.zshrc
382
-
383
- # Alternative: Add Homebrew to path manually
384
- eval "$(/opt/homebrew/bin/brew shellenv)" # Apple Silicon
385
- eval "$(/usr/local/bin/brew shellenv)" # Intel
386
-
387
- # Verify Homebrew is working
388
- brew --version
389
- brew doctor
390
- ```
391
-
392
- ### 🔒 Mac Security Issues
393
-
394
- #### Issue: Gatekeeper Blocking Scripts
395
-
396
- **Error:**
397
-
398
- ```bash
399
- "script.sh" is damaged and can't be opened
400
- ```
401
-
402
- **Solution:**
403
-
404
- ```bash
405
- # Remove quarantine for specific file
406
- xattr -d com.apple.quarantine script.sh
407
-
408
- # Remove quarantine for project directory
409
- find . -type f -exec xattr -d com.apple.quarantine {} \; 2>/dev/null
410
-
411
- # Check quarantine status
412
- xattr -l script.sh
413
-
414
- # Whitelist script
415
- sudo spctl --add script.sh
416
- ```
417
-
418
- ## Cross-Platform Compatibility Issues
419
-
420
- ### 🌍 File Path Issues
421
-
422
- #### Issue: Hardcoded Path Separators
423
-
424
- **Problem:**
425
-
426
- ```typescript
427
- // This breaks on different platforms
428
- const configPath = 'config\\environments\\dev.json'; // Windows only
429
- const configPath = 'config/environments/dev.json'; // Unix only
430
- ```
431
-
432
- **Solution:**
433
-
434
- ```typescript
435
- import path from 'path';
436
-
437
- // Cross-platform compatible
438
- const configPath = path.join('config', 'environments', 'dev.json');
439
-
440
- // For dynamic paths
441
- const buildPath = path.resolve(process.cwd(), 'dist', 'build');
442
-
443
- // For URLs (always forward slashes)
444
- const apiPath = ['api', 'v1', 'users'].join('/');
445
- ```
446
-
447
- #### Issue: Case Sensitivity Differences
448
-
449
- **Problem:**
450
-
451
- ```typescript
452
- // This might work on Windows but fail on Mac/Linux
453
- import Component from './MyComponent'; // File: mycomponent.tsx
454
- ```
455
-
456
- **Solution:**
457
-
458
- ```typescript
459
- // Always match exact case
460
- import Component from './mycomponent'; // Correct case
461
-
462
- // Use consistent naming convention
463
- // PascalCase for components: MyComponent.tsx
464
- // camelCase for utilities: myUtility.ts
465
- // kebab-case for assets: my-image.png
466
- ```
467
-
468
- ### 🔄 Environment Variable Issues
469
-
470
- #### Issue: Different Environment Variable Syntax
471
-
472
- **Problem:**
473
-
474
- ```bash
475
- # Windows
476
- echo %NODE_ENV%
477
-
478
- # Mac/Linux
479
- echo $NODE_ENV
480
- ```
481
-
482
- **Solution:**
483
-
484
- ```javascript
485
- // Use Node.js process.env (works everywhere)
486
- const environment = process.env.NODE_ENV || 'development';
487
-
488
- // For scripts, detect platform
489
- const isWindows = process.platform === 'win32';
490
- const envVar = isWindows ? '%NODE_ENV%' : '$NODE_ENV';
491
- ```
492
-
493
- #### Issue: Line Ending Inconsistencies
494
-
495
- **Problem:**
496
-
497
- ```
498
- Files created on Windows have CRLF (\r\n)
499
- Files created on Mac/Linux have LF (\n)
500
- ```
501
-
502
- **Solution:**
503
-
504
- ```bash
505
- # Add .gitattributes to project root
506
- echo "* text=auto eol=lf" > .gitattributes
507
- echo "*.sh text eol=lf" >> .gitattributes
508
- echo "*.ps1 text eol=crlf" >> .gitattributes
509
-
510
- # Configure Git globally
511
- git config --global core.autocrlf input # Mac/Linux
512
- git config --global core.autocrlf true # Windows
513
-
514
- # Fix existing files
515
- git add --renormalize .
516
- git commit -m "fix: normalize line endings"
517
- ```
518
-
519
- ## Deployment Issues
520
-
521
- ### 🚀 Platform-Specific Deployment Problems
522
-
523
- #### Issue: PowerShell Script Fails on Mac
524
-
525
- **Error:**
526
-
527
- ```bash
528
- ./deploy.ps1: line 1: param: command not found
529
- ```
530
-
531
- **Solution:**
532
-
533
- ```bash
534
- # Use the correct script for your platform
535
- ./deployment/scripts/deploy.sh dev # Mac/Linux
536
- .\deployment\scripts\deploy.ps1 -Environment dev # Windows
537
-
538
- # Or use platform-agnostic npm script
539
- npm run deploy:dev
540
- ```
541
-
542
- #### Issue: Bash Script Fails on Windows
543
-
544
- **Error:**
545
-
546
- ```cmd
547
- './deploy.sh' is not recognized as an internal or external command
548
- ```
549
-
550
- **Solution:**
551
-
552
- ```powershell
553
- # Use Git Bash or WSL
554
- & "C:\Program Files\Git\bin\bash.exe" ./deploy.sh dev
555
-
556
- # Or use PowerShell script
557
- .\deployment\scripts\deploy.ps1 -Environment dev
558
-
559
- # Or use npm script
560
- npm run deploy:dev
561
- ```
562
-
563
- #### Issue: Different Command Outputs
564
-
565
- **Problem:** Scripts expect different output formats between platforms.
566
-
567
- **Solution:**
568
-
569
- ```javascript
570
- // Create platform-agnostic deployment script
571
- const os = require('os');
572
- const { spawn } = require('child_process');
573
-
574
- function deploy(environment) {
575
- const isWindows = os.platform() === 'win32';
576
-
577
- const command = isWindows ? 'powershell' : 'bash';
578
- const script = isWindows ? `./deployment/scripts/deploy.ps1` : `./deployment/scripts/deploy.sh`;
579
- const args = isWindows ? ['-File', script, '-Environment', environment] : [script, environment];
580
-
581
- const child = spawn(command, args, { stdio: 'inherit' });
582
-
583
- return new Promise((resolve, reject) => {
584
- child.on('close', (code) => {
585
- code === 0 ? resolve() : reject(new Error(`Deployment failed with code ${code}`));
586
- });
587
- });
588
- }
589
- ```
590
-
591
- ### 🔒 Authentication Issues
592
-
593
- #### Issue: Certificate Store Differences
594
-
595
- **Problem:** Windows and Mac handle certificates differently.
596
-
597
- **Windows Solution:**
598
-
599
- ```powershell
600
- # Use Windows Certificate Store
601
- $cert = Get-ChildItem -Path Cert:\CurrentUser\My | Where-Object {$_.Subject -like "*YourCert*"}
602
- ```
603
-
604
- **Mac Solution:**
605
-
606
- ```bash
607
- # Use Keychain
608
- security find-certificate -c "YourCert" -p > cert.pem
609
- ```
610
-
611
- **Cross-Platform Solution:**
612
-
613
- ```javascript
614
- // Use environment variables for certificate paths
615
- const certPath = process.env.CERT_PATH || './certificates/default.pem';
616
- const fs = require('fs');
617
-
618
- if (fs.existsSync(certPath)) {
619
- const cert = fs.readFileSync(certPath);
620
- // Use certificate
621
- } else {
622
- console.error('Certificate not found:', certPath);
623
- }
624
- ```
625
-
626
- ## Development Environment Issues
627
-
628
- ### 🛠️ IDE and Editor Issues
629
-
630
- #### Issue: VS Code Extensions Not Syncing
631
-
632
- **Problem:** Extensions work on one platform but not another.
633
-
634
- **Solution:**
635
-
636
- ```json
637
- // .vscode/extensions.json
638
- {
639
- "recommendations": [
640
- "ms-vscode.powershell", // Windows PowerShell
641
- "ms-vscode.vscode-typescript-next", // Cross-platform TypeScript
642
- "esbenp.prettier-vscode", // Cross-platform formatting
643
- "ms-vscode.vscode-json", // JSON support
644
- "ms-azuretools.vscode-azurefunctions" // Azure development
645
- ]
646
- }
647
- ```
648
-
649
- #### Issue: Terminal Integration Problems
650
-
651
- **Problem:** VS Code terminal behaves differently on Windows vs Mac.
652
-
653
- **Solution:**
654
-
655
- ```json
656
- // .vscode/settings.json
657
- {
658
- "terminal.integrated.defaultProfile.windows": "PowerShell",
659
- "terminal.integrated.defaultProfile.osx": "zsh",
660
- "terminal.integrated.env.windows": {
661
- "PATH": "${env:PATH};${workspaceFolder}\\node_modules\\.bin"
662
- },
663
- "terminal.integrated.env.osx": {
664
- "PATH": "${env:PATH}:${workspaceFolder}/node_modules/.bin"
665
- }
666
- }
667
- ```
668
-
669
- ### 📦 Package Management Issues
670
-
671
- #### Issue: npm install Fails with Different Errors
672
-
673
- **Windows Errors:**
674
-
675
- ```cmd
676
- npm ERR! Error: EPERM: operation not permitted
677
- npm ERR! Error: ENOENT: no such file or directory
678
- ```
679
-
680
- **Windows Solution:**
681
-
682
- ```powershell
683
- # Run as Administrator
684
- Start-Process powershell -Verb runAs
685
-
686
- # Or fix npm permissions
687
- npm config set prefix $env:USERPROFILE\npm-global
688
- npm config set cache $env:USERPROFILE\.npm-cache
689
-
690
- # Clear cache
691
- npm cache clean --force
692
- ```
693
-
694
- **Mac Errors:**
695
-
696
- ```bash
697
- npm ERR! Error: EACCES: permission denied
698
- npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
699
- ```
700
-
701
- **Mac Solution:**
702
-
703
- ```bash
704
- # Install Xcode Command Line Tools
705
- xcode-select --install
706
-
707
- # Fix npm permissions
708
- sudo chown -R $(whoami) ~/.npm
709
- sudo chown -R $(whoami) /usr/local/lib/node_modules
710
-
711
- # Use nvm for better Node.js management
712
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
713
- ```
714
-
715
- ## CI/CD Pipeline Issues
716
-
717
- ### ⚙️ Platform-Specific CI/CD Problems
718
-
719
- #### Issue: Different Build Outputs
720
-
721
- **Problem:** Build artifacts differ between Windows and Mac CI runners.
722
-
723
- **Solution:**
724
-
725
- ```yaml
726
- # GitHub Actions - Ensure consistent builds
727
- jobs:
728
- build:
729
- runs-on: ubuntu-latest # Use Linux for consistency
730
- steps:
731
- - uses: actions/checkout@v4
732
- - uses: actions/setup-node@v4
733
- with:
734
- node-version: '18'
735
- cache: 'npm'
736
- - run: npm ci
737
- - run: npm run build:prod
738
-
739
- test-windows:
740
- runs-on: windows-latest
741
- needs: build
742
- steps:
743
- - uses: actions/checkout@v4
744
- - uses: actions/download-artifact@v4
745
- - run: ./test-deployment.ps1
746
-
747
- test-mac:
748
- runs-on: macos-latest
749
- needs: build
750
- steps:
751
- - uses: actions/checkout@v4
752
- - uses: actions/download-artifact@v4
753
- - run: ./test-deployment.sh
754
- ```
755
-
756
- #### Issue: Environment Variables Not Available
757
-
758
- **Problem:** Environment variables set differently on different platforms.
759
-
760
- **Solution:**
761
-
762
- ```yaml
763
- # Set environment variables consistently
764
- env:
765
- NODE_ENV: production
766
- D365_API_URL: ${{ vars.D365_API_URL }}
767
-
768
- jobs:
769
- deploy:
770
- runs-on: ubuntu-latest
771
- env:
772
- DEPLOYMENT_KEY: ${{ secrets.DEPLOYMENT_KEY }}
773
- steps:
774
- - name: Deploy (Cross-platform)
775
- run: npm run deploy:prod
776
- env:
777
- D365_CLIENT_ID: ${{ secrets.D365_CLIENT_ID }}
778
- D365_CLIENT_SECRET: ${{ secrets.D365_CLIENT_SECRET }}
779
- ```
780
-
781
- ## Quick Reference
782
-
783
- ### 🔧 Platform Detection
784
-
785
- ```javascript
786
- // JavaScript/Node.js
787
- const isWindows = process.platform === 'win32';
788
- const isMac = process.platform === 'darwin';
789
- const isLinux = process.platform === 'linux';
790
- ```
791
-
792
- ```powershell
793
- # PowerShell
794
- $IsWindows = $true # Always true in Windows PowerShell
795
- $IsMacOS = $false # Always false in Windows PowerShell
796
- ```
797
-
798
- ```bash
799
- # Bash
800
- case "$(uname -s)" in
801
- Darwin*) echo "Mac" ;;
802
- Linux*) echo "Linux" ;;
803
- CYGWIN*|MINGW*) echo "Windows" ;;
804
- esac
805
- ```
806
-
807
- ### 📁 Cross-Platform Paths
808
-
809
- ```javascript
810
- // Node.js - Always use path module
811
- const path = require('path');
812
-
813
- const configPath = path.join('config', 'environments', 'dev.json');
814
- const absolutePath = path.resolve(process.cwd(), 'dist');
815
- const relativePath = path.relative(process.cwd(), targetPath);
816
- ```
817
-
818
- ### 🔄 Command Equivalents
819
-
820
- | Task | Windows | Mac/Linux | Cross-Platform |
821
- | ------------------------ | ------- | --------- | ------------------------------------------------------- |
822
- | **List files** | `dir` | `ls` | `node -e "console.log(require('fs').readdirSync('.'))"` |
823
- | **Copy files** | `copy` | `cp` | `node -e "require('fs').copyFileSync(src, dest)"` |
824
- | **Environment variable** | `%VAR%` | `$VAR` | `process.env.VAR` |
825
- | **Path separator** | `\` | `/` | `path.sep` |
826
-
827
- ### 🚀 Emergency Commands
828
-
829
- #### Get System Information
830
-
831
- ```bash
832
- # Windows
833
- systeminfo | findstr "OS Name"
834
- Get-ComputerInfo | Select-Object WindowsProductName
835
-
836
- # Mac
837
- sw_vers
838
- system_profiler SPSoftwareDataType
839
-
840
- # Cross-platform (Node.js)
841
- node -e "console.log(process.platform, process.arch, process.version)"
842
- ```
843
-
844
- #### Reset Development Environment
845
-
846
- ```bash
847
- # All platforms
848
- npm cache clean --force
849
- rm -rf node_modules # Mac/Linux
850
- rmdir /s node_modules # Windows
851
- npm install
852
-
853
- # Git reset
854
- git clean -fdx
855
- git reset --hard HEAD
856
- ```
857
-
858
- #### Check Tool Versions
859
-
860
- ```bash
861
- # All platforms (if tools installed)
862
- node --version
863
- npm --version
864
- git --version
865
-
866
- # Windows specific
867
- powershell $PSVersionTable
868
-
869
- # Mac specific
870
- bash --version
871
- zsh --version
872
- ```
873
-
874
- ---
875
-
876
- This troubleshooting guide covers the most common platform-specific issues encountered in
877
- cross-platform Dynamics 365 development. For issues not covered here, consult the team-specific
878
- documentation or escalate to the platform champions on your team.