@khester/create-dynamics-app 1.0.8 → 1.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 (107) hide show
  1. package/bin/create-dynamics-app.js +1 -1
  2. package/dist/index.js +140 -15
  3. package/dist/index.js.map +1 -1
  4. package/dist/utils/consultingHelpers.d.ts +13 -0
  5. package/dist/utils/consultingHelpers.d.ts.map +1 -0
  6. package/dist/utils/consultingHelpers.js +569 -0
  7. package/dist/utils/consultingHelpers.js.map +1 -0
  8. package/dist/utils/copyTemplate.d.ts.map +1 -1
  9. package/dist/utils/copyTemplate.js.map +1 -1
  10. package/dist/utils/initGit.d.ts.map +1 -1
  11. package/dist/utils/initGit.js.map +1 -1
  12. package/dist/utils/installDependencies.d.ts.map +1 -1
  13. package/dist/utils/installDependencies.js +3 -2
  14. package/dist/utils/installDependencies.js.map +1 -1
  15. package/dist/utils/updatePackageJson.d.ts +1 -1
  16. package/dist/utils/updatePackageJson.d.ts.map +1 -1
  17. package/dist/utils/updatePackageJson.js +11 -1
  18. package/dist/utils/updatePackageJson.js.map +1 -1
  19. package/package.json +1 -1
  20. package/templates/dynamics-365-starter/INTEGRATION_TEST_RESULTS.md +302 -0
  21. package/templates/dynamics-365-starter/PHASE_4_COMPLETION_SUMMARY.md +305 -0
  22. package/templates/dynamics-365-starter/README.md +566 -137
  23. package/templates/dynamics-365-starter/deployment/QUICKSTART-MAC.md +507 -0
  24. package/templates/dynamics-365-starter/deployment/QUICKSTART-WINDOWS.md +372 -0
  25. package/templates/dynamics-365-starter/deployment/README.md +484 -0
  26. package/templates/dynamics-365-starter/deployment/pipelines/README.md +375 -0
  27. package/templates/dynamics-365-starter/deployment/pipelines/azure-pipelines.yml +330 -0
  28. package/templates/dynamics-365-starter/deployment/pipelines/github-actions.yml +422 -0
  29. package/templates/dynamics-365-starter/deployment/pipelines/jenkins.groovy +636 -0
  30. package/templates/dynamics-365-starter/deployment/scripts/deploy.ps1 +417 -0
  31. package/templates/dynamics-365-starter/deployment/scripts/deploy.sh +582 -0
  32. package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.ps1 +486 -0
  33. package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.sh +567 -0
  34. package/templates/dynamics-365-starter/deployment/scripts/validate-setup.ps1 +703 -0
  35. package/templates/dynamics-365-starter/deployment/scripts/validate-setup.sh +671 -0
  36. package/templates/dynamics-365-starter/docs/ARCHITECTURE_OVERVIEW.md +506 -0
  37. package/templates/dynamics-365-starter/docs/BEST_PRACTICES.md +723 -0
  38. package/templates/dynamics-365-starter/docs/MIGRATION_GUIDE.md +447 -0
  39. package/templates/dynamics-365-starter/docs/team-standards/README.md +273 -0
  40. package/templates/dynamics-365-starter/docs/team-standards/client-onboarding.md +577 -0
  41. package/templates/dynamics-365-starter/docs/team-standards/code-review-checklist.md +359 -0
  42. package/templates/dynamics-365-starter/docs/team-standards/coding-standards.md +700 -0
  43. package/templates/dynamics-365-starter/docs/team-standards/cross-platform-team-guide.md +736 -0
  44. package/templates/dynamics-365-starter/docs/team-standards/development-workflows.md +727 -0
  45. package/templates/dynamics-365-starter/docs/troubleshooting/common-errors.md +758 -0
  46. package/templates/dynamics-365-starter/docs/troubleshooting/platform-specific-issues.md +878 -0
  47. package/templates/dynamics-365-starter/package.json +22 -1
  48. package/templates/dynamics-365-starter/public/index.html +8 -11
  49. package/templates/dynamics-365-starter/scripts/custom-build.js +255 -0
  50. package/templates/dynamics-365-starter/src/client-project-template/README.md +234 -0
  51. package/templates/dynamics-365-starter/src/client-project-template/config/client.template.json +114 -0
  52. package/templates/dynamics-365-starter/src/client-project-template/config/environments/template.json +186 -0
  53. package/templates/dynamics-365-starter/src/client-project-template/scripts/client-setup.js +667 -0
  54. package/templates/dynamics-365-starter/src/components/AccountForm.css +71 -0
  55. package/templates/dynamics-365-starter/src/components/AccountForm.tsx +541 -0
  56. package/templates/dynamics-365-starter/src/components/AccountManagement.css +86 -0
  57. package/templates/dynamics-365-starter/src/components/AccountManagement.tsx +370 -0
  58. package/templates/dynamics-365-starter/src/components/ContactForm.tsx +149 -63
  59. package/templates/dynamics-365-starter/src/components/ContactManagement.tsx +153 -63
  60. package/templates/dynamics-365-starter/src/components/Logging/LogDialog.tsx +291 -0
  61. package/templates/dynamics-365-starter/src/components/Logging/LoggingContext.tsx +166 -0
  62. package/templates/dynamics-365-starter/src/components/Logging/LoggingDebugPanel.css +192 -0
  63. package/templates/dynamics-365-starter/src/components/Logging/LoggingDebugPanel.tsx +177 -0
  64. package/templates/dynamics-365-starter/src/components/Logging/LoggingProvider.tsx +3 -0
  65. package/templates/dynamics-365-starter/src/components/Logging/logger.ts +193 -0
  66. package/templates/dynamics-365-starter/src/constants/account.ts +410 -0
  67. package/templates/dynamics-365-starter/src/constants/contact.ts +362 -0
  68. package/templates/dynamics-365-starter/src/examples/README.md +52 -0
  69. package/templates/dynamics-365-starter/src/examples/component-examples/opportunity-management.tsx +625 -0
  70. package/templates/dynamics-365-starter/src/examples/entity-examples/opportunity-model.ts +545 -0
  71. package/templates/dynamics-365-starter/src/examples/integration-examples/custom-pcf-wrapper.tsx +722 -0
  72. package/templates/dynamics-365-starter/src/examples/workflow-examples/sales-workflow.ts +662 -0
  73. package/templates/dynamics-365-starter/src/index.tsx +107 -19
  74. package/templates/dynamics-365-starter/src/models/Account.ts +480 -0
  75. package/templates/dynamics-365-starter/src/models/BaseEntity.ts +204 -0
  76. package/templates/dynamics-365-starter/src/models/Contact.ts +580 -0
  77. package/templates/dynamics-365-starter/src/page-templates/EntityDashboard.tsx +519 -0
  78. package/templates/dynamics-365-starter/src/page-templates/EntityDetailPage.tsx +456 -0
  79. package/templates/dynamics-365-starter/src/page-templates/EntityListPage.tsx +406 -0
  80. package/templates/dynamics-365-starter/src/page-templates/RelatedEntitiesPage.tsx +578 -0
  81. package/templates/dynamics-365-starter/src/page-templates/SearchPage.tsx +629 -0
  82. package/templates/dynamics-365-starter/src/pcf/ContactControlWrapper.tsx +75 -22
  83. package/templates/dynamics-365-starter/src/pcf/MultiEntityControlWrapper.tsx +205 -0
  84. package/templates/dynamics-365-starter/src/providers/DynamicsProvider.tsx +297 -80
  85. package/templates/dynamics-365-starter/src/services/MockApiService.ts +260 -0
  86. package/templates/dynamics-365-starter/src/services/ServiceFactory.ts +65 -0
  87. package/templates/dynamics-365-starter/src/services/XrmApiService.ts +213 -0
  88. package/templates/dynamics-365-starter/src/styles/index.css +74 -7
  89. package/templates/dynamics-365-starter/tools/entity-generator/index.js +168 -0
  90. package/templates/dynamics-365-starter/tools/entity-generator/templates/constants.template.ts +124 -0
  91. package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.css +283 -0
  92. package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.tsx +275 -0
  93. package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.css +204 -0
  94. package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.tsx +413 -0
  95. package/templates/dynamics-365-starter/tools/entity-generator/templates/model.template.ts +250 -0
  96. package/templates/dynamics-365-starter/tools/metadata-sync/d365-client.js +410 -0
  97. package/templates/dynamics-365-starter/tools/metadata-sync/index.js +512 -0
  98. package/templates/dynamics-365-starter/tools/metadata-sync/type-generator.js +675 -0
  99. package/templates/dynamics-365-starter/tsconfig.json +11 -8
  100. package/templates/dynamics-365-starter/webpack.config.js +8 -9
  101. package/templates/power-pages-starter/README.md +7 -1
  102. package/templates/power-pages-starter/public/index.html +8 -11
  103. package/templates/power-pages-starter/src/components/ContactForm.tsx +60 -41
  104. package/templates/power-pages-starter/src/index.tsx +3 -3
  105. package/templates/power-pages-starter/src/providers/PowerPagesProvider.tsx +46 -23
  106. package/templates/power-pages-starter/tsconfig.json +3 -9
  107. package/templates/power-pages-starter/webpack.config.js +8 -3
@@ -0,0 +1,372 @@
1
+ # Quick Start Guide - Windows Developers
2
+
3
+ 🖥️ **Platform-specific setup for Windows developers using PowerShell**
4
+
5
+ ## Prerequisites
6
+
7
+ ### Required Software
8
+
9
+ - **Windows 10/11** or **Windows Server 2019+**
10
+ - **PowerShell 5.1** or **PowerShell 7+** (recommended)
11
+ - **Node.js 18+** and **npm**
12
+ - **Git for Windows**
13
+
14
+ ### PowerShell Modules
15
+
16
+ ```powershell
17
+ # Install required modules (run as Administrator)
18
+ Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Force
19
+ Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber -Force
20
+
21
+ # Verify installation
22
+ Get-Module -Name Microsoft.PowerApps* -ListAvailable
23
+ ```
24
+
25
+ ### Development Tools
26
+
27
+ ```powershell
28
+ # Install Node.js (if not already installed)
29
+ choco install nodejs
30
+
31
+ # Install Git (if not already installed)
32
+ choco install git
33
+
34
+ # Verify installations
35
+ node --version
36
+ npm --version
37
+ git --version
38
+ ```
39
+
40
+ ## Project Setup
41
+
42
+ ### 1. Clone and Setup Project
43
+
44
+ ```powershell
45
+ # Clone the project
46
+ git clone https://github.com/your-org/your-dynamics-project.git
47
+ cd your-dynamics-project
48
+
49
+ # Install dependencies
50
+ npm install
51
+
52
+ # Build the project
53
+ npm run build:prod
54
+ ```
55
+
56
+ ### 2. Configure Environment
57
+
58
+ ```powershell
59
+ # Copy environment template
60
+ Copy-Item "config\environments\template.json" "config\environments\dev.json"
61
+
62
+ # Edit configuration (use your preferred editor)
63
+ notepad "config\environments\dev.json"
64
+ ```
65
+
66
+ ### 3. Validate Setup
67
+
68
+ ```powershell
69
+ # Run validation script
70
+ .\deployment\scripts\validate-setup.ps1
71
+
72
+ # Test connection to D365
73
+ .\deployment\scripts\test-connection.ps1 -Environment dev
74
+ ```
75
+
76
+ ## Daily Deployment Workflow
77
+
78
+ ### Development Deployment
79
+
80
+ ```powershell
81
+ # Quick development deployment
82
+ .\deployment\scripts\deploy.ps1 -Environment dev
83
+
84
+ # With verbose output
85
+ .\deployment\scripts\deploy.ps1 -Environment dev -Verbose
86
+
87
+ # Dry run (test without changes)
88
+ .\deployment\scripts\deploy.ps1 -Environment dev -DryRun
89
+ ```
90
+
91
+ ### Production Deployment
92
+
93
+ ```powershell
94
+ # Production deployment with backup
95
+ .\deployment\scripts\deploy.ps1 -Environment prod
96
+
97
+ # Force deployment (skip some validations)
98
+ .\deployment\scripts\deploy.ps1 -Environment prod -Force
99
+
100
+ # Skip backup (faster deployment)
101
+ .\deployment\scripts\deploy.ps1 -Environment prod -SkipBackup
102
+ ```
103
+
104
+ ### Entity Generation
105
+
106
+ ```powershell
107
+ # Generate new entity
108
+ npm run generate:entity -- --entity "salesorder" --display-name "Sales Order"
109
+
110
+ # Generate multiple entities
111
+ npm run generate:entity -- --entity "product" --display-name "Product"
112
+ npm run generate:entity -- --entity "pricing" --display-name "Pricing Rule"
113
+ ```
114
+
115
+ ## Common Commands Reference
116
+
117
+ ### Build Commands
118
+
119
+ ```powershell
120
+ npm run build:dev # Development build (unminified)
121
+ npm run build:prod # Production build (optimized)
122
+ npm run build:d365 # Dynamics 365 optimized build
123
+ npm run clean # Clean build artifacts
124
+ ```
125
+
126
+ ### Quality Checks
127
+
128
+ ```powershell
129
+ npm run lint # Check code style
130
+ npm run lint:fix # Fix code style issues
131
+ npm run typecheck # TypeScript validation
132
+ npm run quality # Run all quality checks
133
+ npm run test # Run unit tests
134
+ ```
135
+
136
+ ### Metadata Operations
137
+
138
+ ```powershell
139
+ npm run metadata:pull -- --environment dev --entities "account,contact"
140
+ npm run metadata:generate
141
+ npm run metadata:validate -- --environment dev
142
+ npm run metadata:sync -- --environment dev --all
143
+ ```
144
+
145
+ ### Deployment Operations
146
+
147
+ ```powershell
148
+ # Deploy to specific environment
149
+ .\deployment\scripts\deploy.ps1 -Environment <env>
150
+
151
+ # Rollback deployment
152
+ .\deployment\scripts\rollback.ps1 -Environment <env> -BackupFile "backup-file.zip"
153
+
154
+ # Health check
155
+ .\deployment\scripts\health-check.ps1 -Environment <env>
156
+
157
+ # Monitor deployment
158
+ .\deployment\scripts\monitor.ps1 -Environment <env>
159
+ ```
160
+
161
+ ## PowerShell Configuration
162
+
163
+ ### Execution Policy
164
+
165
+ ```powershell
166
+ # Check current execution policy
167
+ Get-ExecutionPolicy
168
+
169
+ # Set execution policy (if needed)
170
+ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
171
+ ```
172
+
173
+ ### PowerShell Profile Setup
174
+
175
+ ```powershell
176
+ # Create profile if it doesn't exist
177
+ if (!(Test-Path $PROFILE)) {
178
+ New-Item -Type File -Path $PROFILE -Force
179
+ }
180
+
181
+ # Add helpful aliases
182
+ Add-Content $PROFILE @"
183
+ # Dynamics 365 Development Aliases
184
+ Set-Alias d365deploy '.\deployment\scripts\deploy.ps1'
185
+ Set-Alias d365health '.\deployment\scripts\health-check.ps1'
186
+ Set-Alias d365rollback '.\deployment\scripts\rollback.ps1'
187
+
188
+ # Quick navigation
189
+ function Set-D365Project { Set-Location 'C:\Code\YourProject' }
190
+ Set-Alias d365cd Set-D365Project
191
+ "@
192
+
193
+ # Reload profile
194
+ . $PROFILE
195
+ ```
196
+
197
+ ## Windows-Specific Tips
198
+
199
+ ### File Path Handling
200
+
201
+ ```powershell
202
+ # Use backslashes for Windows paths
203
+ .\deployment\scripts\deploy.ps1
204
+
205
+ # Or use forward slashes (PowerShell accepts both)
206
+ ./deployment/scripts/deploy.ps1
207
+ ```
208
+
209
+ ### Environment Variables
210
+
211
+ ```powershell
212
+ # Set environment variables for session
213
+ $env:D365_ENVIRONMENT = "dev"
214
+ $env:D365_CLIENT_ID = "your-client-id"
215
+
216
+ # Set permanently (requires restart)
217
+ [Environment]::SetEnvironmentVariable("D365_ENVIRONMENT", "dev", "User")
218
+ ```
219
+
220
+ ### Windows Terminal Configuration
221
+
222
+ ```json
223
+ // Add to Windows Terminal settings.json
224
+ {
225
+ "name": "D365 PowerShell",
226
+ "commandline": "pwsh.exe",
227
+ "startingDirectory": "C:\\Code\\YourProject",
228
+ "icon": "ms-appx:///ProfileIcons/{574e775e-4f2a-5b96-ac1e-a2962a402336}.png"
229
+ }
230
+ ```
231
+
232
+ ## Troubleshooting
233
+
234
+ ### Common Issues
235
+
236
+ #### PowerShell Modules Not Loading
237
+
238
+ ```powershell
239
+ # Check module path
240
+ $env:PSModulePath -split ';'
241
+
242
+ # Manually import modules
243
+ Import-Module Microsoft.PowerApps.Administration.PowerShell -Force
244
+ Import-Module Microsoft.PowerApps.PowerShell -Force
245
+ ```
246
+
247
+ #### Authentication Issues
248
+
249
+ ```powershell
250
+ # Clear cached credentials
251
+ Clear-AzContext -Force
252
+
253
+ # Test authentication
254
+ .\deployment\scripts\test-auth.ps1 -Environment dev
255
+ ```
256
+
257
+ #### Build Failures
258
+
259
+ ```powershell
260
+ # Clear npm cache
261
+ npm cache clean --force
262
+
263
+ # Remove node_modules and reinstall
264
+ Remove-Item -Recurse -Force node_modules
265
+ npm install
266
+ ```
267
+
268
+ #### File Permission Issues
269
+
270
+ ```powershell
271
+ # Run as Administrator if needed
272
+ Start-Process powershell -Verb runAs
273
+
274
+ # Check file permissions
275
+ Get-Acl .\deployment\scripts\deploy.ps1
276
+ ```
277
+
278
+ ### Performance Optimization
279
+
280
+ ```powershell
281
+ # Increase PowerShell memory limit
282
+ $MaximumVariableCount = 32768
283
+ $MaximumFunctionCount = 8192
284
+
285
+ # Enable PowerShell parallel execution
286
+ .\deployment\scripts\deploy.ps1 -Environment dev -Parallel
287
+ ```
288
+
289
+ ## VS Code Integration
290
+
291
+ ### Recommended Extensions
292
+
293
+ - **PowerShell** - Microsoft PowerShell support
294
+ - **TypeScript** - Enhanced TypeScript support
295
+ - **Dynamics 365** - D365 development tools
296
+ - **REST Client** - Test D365 APIs
297
+
298
+ ### Launch Configuration
299
+
300
+ ```json
301
+ // .vscode/launch.json
302
+ {
303
+ "version": "0.2.0",
304
+ "configurations": [
305
+ {
306
+ "name": "Deploy to Dev",
307
+ "type": "PowerShell",
308
+ "request": "launch",
309
+ "script": "${workspaceFolder}/deployment/scripts/deploy.ps1",
310
+ "args": ["-Environment", "dev", "-Verbose"],
311
+ "cwd": "${workspaceFolder}"
312
+ }
313
+ ]
314
+ }
315
+ ```
316
+
317
+ ### Tasks Configuration
318
+
319
+ ```json
320
+ // .vscode/tasks.json
321
+ {
322
+ "version": "2.0.0",
323
+ "tasks": [
324
+ {
325
+ "label": "Deploy to Dev",
326
+ "type": "shell",
327
+ "command": ".\\deployment\\scripts\\deploy.ps1",
328
+ "args": ["-Environment", "dev"],
329
+ "group": "build",
330
+ "presentation": {
331
+ "echo": true,
332
+ "reveal": "always",
333
+ "focus": false,
334
+ "panel": "shared"
335
+ }
336
+ }
337
+ ]
338
+ }
339
+ ```
340
+
341
+ ## Team Collaboration
342
+
343
+ ### Shared Scripts Location
344
+
345
+ All PowerShell scripts are in `deployment/scripts/` and work identically across all Windows
346
+ machines.
347
+
348
+ ### Configuration Sharing
349
+
350
+ - Environment configs in `config/environments/` are shared across team
351
+ - Personal settings go in `.env.local` (not committed to git)
352
+
353
+ ### Log Files
354
+
355
+ - Deployment logs: `deployment/logs/`
356
+ - Build logs: `build/logs/`
357
+ - Share log files when troubleshooting with team
358
+
359
+ ## Next Steps
360
+
361
+ 1. ✅ **Complete environment setup** using this guide
362
+ 2. ✅ **Run first deployment** to development environment
363
+ 3. ✅ **Generate your first entity** using the entity generator
364
+ 4. ✅ **Deploy to test environment** when ready
365
+ 5. ✅ **Set up CI/CD pipeline** for automated deployments
366
+
367
+ For Mac team members, refer to `QUICKSTART-MAC.md` for their platform-specific setup.
368
+
369
+ ---
370
+
371
+ 💡 **Tip**: Bookmark this guide and refer to the **Common Commands Reference** section for daily
372
+ workflows!