@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.
- package/README.md +74 -0
- package/dist/artifacts/registry.d.ts +18 -0
- package/dist/artifacts/registry.d.ts.map +1 -0
- package/dist/artifacts/registry.js +340 -0
- package/dist/artifacts/registry.js.map +1 -0
- package/dist/artifacts/types.d.ts +122 -0
- package/dist/artifacts/types.d.ts.map +1 -0
- package/dist/artifacts/types.js +7 -0
- package/dist/artifacts/types.js.map +1 -0
- package/dist/artifacts/validators.d.ts +16 -0
- package/dist/artifacts/validators.d.ts.map +1 -0
- package/dist/artifacts/validators.js +45 -0
- package/dist/artifacts/validators.js.map +1 -0
- package/dist/fromDesign.d.ts +5 -0
- package/dist/fromDesign.d.ts.map +1 -0
- package/dist/fromDesign.js +98 -0
- package/dist/fromDesign.js.map +1 -0
- package/dist/index.js +129 -177
- package/dist/index.js.map +1 -1
- package/dist/injectDevTools.d.ts +28 -0
- package/dist/injectDevTools.d.ts.map +1 -0
- package/dist/injectDevTools.js +148 -0
- package/dist/injectDevTools.js.map +1 -0
- package/dist/scaffold.d.ts +48 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +180 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/templatePlan.d.ts +3 -0
- package/dist/templatePlan.d.ts.map +1 -0
- package/dist/templatePlan.js +43 -0
- package/dist/templatePlan.js.map +1 -0
- package/dist/utils/copyTemplate.d.ts +13 -1
- package/dist/utils/copyTemplate.d.ts.map +1 -1
- package/dist/utils/copyTemplate.js +98 -4
- package/dist/utils/copyTemplate.js.map +1 -1
- package/dist/utils/updatePackageJson.d.ts +11 -1
- package/dist/utils/updatePackageJson.d.ts.map +1 -1
- package/dist/utils/updatePackageJson.js +12 -10
- package/dist/utils/updatePackageJson.js.map +1 -1
- package/package.json +10 -7
- package/templates/_shared/dev-tools/auth/get-token.js +72 -0
- package/templates/_shared/dev-tools/dev/mock-xrm.js +42 -0
- package/templates/_shared/dev-tools/metadata-sync/index.js +152 -0
- package/templates/_shared/dev-tools/smoke/test-retrieve.js +44 -0
- package/templates/dialog-form/README.md +27 -0
- package/templates/dialog-form/_variants/App.v8.tsx +39 -0
- package/templates/dialog-form/_variants/App.v9.tsx +41 -0
- package/templates/dialog-form/gitignore +5 -0
- package/templates/dialog-form/package.json +27 -0
- package/templates/dialog-form/public/index.html +11 -0
- package/templates/dialog-form/src/index.tsx +10 -0
- package/templates/dialog-form/src/services/dataverse.ts +30 -0
- package/templates/dialog-form/tsconfig.json +15 -0
- package/templates/dialog-form/webpack.config.js +17 -0
- package/templates/grid-customizer/README.md +28 -0
- package/templates/grid-customizer/gitignore +4 -0
- package/templates/grid-customizer/package.json +25 -0
- package/templates/grid-customizer/src/GridCustomizer.ts +28 -0
- package/templates/grid-customizer/src/cell-renderers.tsx +35 -0
- package/templates/grid-customizer/src/index.ts +4 -0
- package/templates/grid-customizer/src/types/grid-types.ts +30 -0
- package/templates/grid-customizer/src/utils/color-utils.ts +24 -0
- package/templates/grid-customizer/tsconfig.json +15 -0
- package/templates/grid-customizer/webpack.config.js +17 -0
- package/templates/pcf-dataset/ControlManifest.Input.xml +16 -0
- package/templates/pcf-dataset/README.md +21 -0
- package/templates/pcf-dataset/gitignore +5 -0
- package/templates/pcf-dataset/index.ts +39 -0
- package/templates/pcf-dataset/package.json +30 -0
- package/templates/pcf-dataset/strings/{{componentName}}.1033.resx +47 -0
- package/templates/pcf-dataset/tsconfig.json +8 -0
- package/templates/pcf-dataset/{{componentName}}Component.tsx +39 -0
- package/templates/pcf-field/ControlManifest.Input.xml +17 -0
- package/templates/pcf-field/README.md +95 -0
- package/templates/pcf-field/_variants/ValueInput.boolean.tsx +24 -0
- package/templates/pcf-field/_variants/ValueInput.date.tsx +27 -0
- package/templates/pcf-field/_variants/ValueInput.number.tsx +35 -0
- package/templates/pcf-field/_variants/ValueInput.text.tsx +27 -0
- package/templates/pcf-field/gitignore +5 -0
- package/templates/pcf-field/index.ts +61 -0
- package/templates/pcf-field/package.json +30 -0
- package/templates/pcf-field/strings/{{componentName}}.1033.resx +47 -0
- package/templates/pcf-field/tsconfig.json +8 -0
- package/templates/pcf-field/{{componentName}}Component.tsx +35 -0
- package/templates/power-pages-starter/gitignore +5 -0
- package/templates/react-custom-page/gitignore +5 -0
- package/templates/{dynamics-365-starter โ react-custom-page}/package.json +3 -3
- package/templates/react-custom-page/tools/metadata-sync/index.js +152 -0
- package/templates/static-web-app/README.md +36 -0
- package/templates/static-web-app/_variants/App.v8.tsx +32 -0
- package/templates/static-web-app/_variants/App.v9.tsx +31 -0
- package/templates/static-web-app/api/host.json +12 -0
- package/templates/static-web-app/api/package.json +19 -0
- package/templates/static-web-app/api/src/functions/hello.ts +16 -0
- package/templates/static-web-app/api/tsconfig.json +14 -0
- package/templates/static-web-app/frontend/index.html +12 -0
- package/templates/static-web-app/frontend/package.json +23 -0
- package/templates/static-web-app/frontend/src/index.tsx +8 -0
- package/templates/static-web-app/frontend/tsconfig.json +16 -0
- package/templates/static-web-app/frontend/vite.config.ts +13 -0
- package/templates/static-web-app/gitignore +8 -0
- package/templates/static-web-app/package.json +15 -0
- package/templates/static-web-app/staticwebapp.config.json +7 -0
- package/templates/teams-app/README.md +27 -0
- package/templates/teams-app/_variants/graph.off.ts +7 -0
- package/templates/teams-app/_variants/graph.on.ts +22 -0
- package/templates/teams-app/appPackage/manifest.json +26 -0
- package/templates/teams-app/gitignore +5 -0
- package/templates/teams-app/index.html +12 -0
- package/templates/teams-app/package.json +26 -0
- package/templates/teams-app/src/App.tsx +25 -0
- package/templates/teams-app/src/index.tsx +8 -0
- package/templates/teams-app/tsconfig.json +16 -0
- package/templates/teams-app/vite.config.ts +9 -0
- package/templates/web-resource/README.md +39 -0
- package/templates/web-resource/_variants/App.v8.tsx +29 -0
- package/templates/web-resource/_variants/App.v9.tsx +28 -0
- package/templates/web-resource/gitignore +5 -0
- package/templates/web-resource/package.json +27 -0
- package/templates/web-resource/public/index.html +11 -0
- package/templates/web-resource/src/index.tsx +10 -0
- package/templates/web-resource/src/services/dataverse.ts +30 -0
- package/templates/web-resource/tsconfig.json +15 -0
- package/templates/web-resource/webpack.config.js +17 -0
- package/dist/utils/consultingHelpers.d.ts +0 -13
- package/dist/utils/consultingHelpers.d.ts.map +0 -1
- package/dist/utils/consultingHelpers.js +0 -569
- package/dist/utils/consultingHelpers.js.map +0 -1
- package/templates/dynamics-365-starter/INTEGRATION_TEST_RESULTS.md +0 -302
- package/templates/dynamics-365-starter/PHASE_4_COMPLETION_SUMMARY.md +0 -305
- package/templates/dynamics-365-starter/deployment/QUICKSTART-MAC.md +0 -507
- package/templates/dynamics-365-starter/deployment/QUICKSTART-WINDOWS.md +0 -372
- package/templates/dynamics-365-starter/deployment/pipelines/README.md +0 -375
- package/templates/dynamics-365-starter/deployment/pipelines/azure-pipelines.yml +0 -330
- package/templates/dynamics-365-starter/deployment/pipelines/github-actions.yml +0 -422
- package/templates/dynamics-365-starter/deployment/pipelines/jenkins.groovy +0 -636
- package/templates/dynamics-365-starter/deployment/scripts/deploy.ps1 +0 -417
- package/templates/dynamics-365-starter/deployment/scripts/deploy.sh +0 -582
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.ps1 +0 -486
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.sh +0 -567
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.ps1 +0 -703
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.sh +0 -671
- package/templates/dynamics-365-starter/docs/team-standards/README.md +0 -273
- package/templates/dynamics-365-starter/docs/team-standards/client-onboarding.md +0 -577
- package/templates/dynamics-365-starter/docs/team-standards/code-review-checklist.md +0 -359
- package/templates/dynamics-365-starter/docs/team-standards/coding-standards.md +0 -700
- package/templates/dynamics-365-starter/docs/team-standards/cross-platform-team-guide.md +0 -736
- package/templates/dynamics-365-starter/docs/team-standards/development-workflows.md +0 -727
- package/templates/dynamics-365-starter/docs/troubleshooting/common-errors.md +0 -758
- package/templates/dynamics-365-starter/docs/troubleshooting/platform-specific-issues.md +0 -878
- package/templates/dynamics-365-starter/src/client-project-template/README.md +0 -234
- package/templates/dynamics-365-starter/src/client-project-template/config/client.template.json +0 -114
- package/templates/dynamics-365-starter/src/client-project-template/config/environments/template.json +0 -186
- package/templates/dynamics-365-starter/src/client-project-template/scripts/client-setup.js +0 -667
- package/templates/dynamics-365-starter/src/examples/README.md +0 -52
- package/templates/dynamics-365-starter/src/examples/component-examples/opportunity-management.tsx +0 -625
- package/templates/dynamics-365-starter/src/examples/entity-examples/opportunity-model.ts +0 -545
- package/templates/dynamics-365-starter/src/examples/integration-examples/custom-pcf-wrapper.tsx +0 -722
- package/templates/dynamics-365-starter/src/examples/workflow-examples/sales-workflow.ts +0 -662
- package/templates/dynamics-365-starter/src/page-templates/EntityDashboard.tsx +0 -519
- package/templates/dynamics-365-starter/src/page-templates/EntityDetailPage.tsx +0 -456
- package/templates/dynamics-365-starter/src/page-templates/EntityListPage.tsx +0 -406
- package/templates/dynamics-365-starter/src/page-templates/RelatedEntitiesPage.tsx +0 -578
- package/templates/dynamics-365-starter/src/page-templates/SearchPage.tsx +0 -629
- package/templates/dynamics-365-starter/tools/entity-generator/index.js +0 -168
- package/templates/dynamics-365-starter/tools/entity-generator/templates/constants.template.ts +0 -124
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.css +0 -283
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.tsx +0 -275
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.css +0 -204
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.tsx +0 -413
- package/templates/dynamics-365-starter/tools/entity-generator/templates/model.template.ts +0 -250
- package/templates/dynamics-365-starter/tools/metadata-sync/d365-client.js +0 -410
- package/templates/dynamics-365-starter/tools/metadata-sync/index.js +0 -512
- package/templates/dynamics-365-starter/tools/metadata-sync/type-generator.js +0 -675
- /package/templates/{dynamics-365-starter โ react-custom-page}/README.md +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/deployment/README.md +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/docs/ARCHITECTURE_OVERVIEW.md +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/docs/BEST_PRACTICES.md +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/docs/MIGRATION_GUIDE.md +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/public/index.html +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/scripts/custom-build.js +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/AccountForm.css +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/AccountForm.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/AccountManagement.css +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/AccountManagement.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/ContactForm.css +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/ContactForm.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/ContactManagement.css +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/ContactManagement.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/Logging/LogDialog.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/Logging/LoggingContext.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/Logging/LoggingDebugPanel.css +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/Logging/LoggingDebugPanel.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/Logging/LoggingProvider.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/components/Logging/logger.ts +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/constants/account.ts +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/constants/contact.ts +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/index.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/models/Account.ts +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/models/BaseEntity.ts +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/models/Contact.ts +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/pcf/ContactControlWrapper.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/pcf/MultiEntityControlWrapper.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/providers/DynamicsProvider.tsx +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/services/MockApiService.ts +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/services/ServiceFactory.ts +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/services/XrmApiService.ts +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/src/styles/index.css +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/tsconfig.json +0 -0
- /package/templates/{dynamics-365-starter โ react-custom-page}/webpack.config.js +0 -0
|
@@ -1,486 +0,0 @@
|
|
|
1
|
-
# Team Onboarding Script with Platform Detection (PowerShell)
|
|
2
|
-
# Automatically detects platform and guides developer through setup
|
|
3
|
-
|
|
4
|
-
param(
|
|
5
|
-
[switch]$Interactive,
|
|
6
|
-
[switch]$SkipPrerequisites,
|
|
7
|
-
[switch]$Verbose
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
# Set error action preference
|
|
11
|
-
$ErrorActionPreference = "Stop"
|
|
12
|
-
|
|
13
|
-
# Script configuration
|
|
14
|
-
$ScriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
15
|
-
$ProjectRoot = Split-Path -Parent (Split-Path -Parent $ScriptRoot)
|
|
16
|
-
|
|
17
|
-
function Show-Banner {
|
|
18
|
-
Write-Host "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ" -ForegroundColor Cyan
|
|
19
|
-
Write-Host "โ Dynamics 365 Team Onboarding Assistant โ" -ForegroundColor Cyan
|
|
20
|
-
Write-Host "โ Enterprise Consulting Edition โ" -ForegroundColor Cyan
|
|
21
|
-
Write-Host "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ" -ForegroundColor Cyan
|
|
22
|
-
Write-Host ""
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function Get-PlatformInfo {
|
|
26
|
-
$platform = [System.Environment]::OSVersion.Platform
|
|
27
|
-
$architecture = [System.Environment]::GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")
|
|
28
|
-
$osVersion = [System.Environment]::OSVersion.Version
|
|
29
|
-
|
|
30
|
-
return @{
|
|
31
|
-
Platform = "Windows"
|
|
32
|
-
Architecture = $architecture
|
|
33
|
-
Version = $osVersion.ToString()
|
|
34
|
-
PowerShellVersion = $PSVersionTable.PSVersion.ToString()
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function Show-PlatformInfo {
|
|
39
|
-
param([hashtable]$PlatformInfo)
|
|
40
|
-
|
|
41
|
-
Write-Host "๐ Platform Detection:" -ForegroundColor Blue
|
|
42
|
-
Write-Host " Platform: $($PlatformInfo.Platform)"
|
|
43
|
-
Write-Host " Architecture: $($PlatformInfo.Architecture)"
|
|
44
|
-
Write-Host " OS Version: $($PlatformInfo.Version)"
|
|
45
|
-
Write-Host " PowerShell: $($PlatformInfo.PowerShellVersion)"
|
|
46
|
-
Write-Host ""
|
|
47
|
-
|
|
48
|
-
Write-Host "โ
Windows detected - You can use PowerShell or Bash scripts" -ForegroundColor Green
|
|
49
|
-
Write-Host " ๐ PowerShell Guide: deployment/QUICKSTART-WINDOWS.md"
|
|
50
|
-
Write-Host " ๐ Bash Alternative: deployment/QUICKSTART-MAC.md"
|
|
51
|
-
Write-Host ""
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function Test-Prerequisites {
|
|
55
|
-
Write-Host "๐ง Checking Prerequisites..." -ForegroundColor Blue
|
|
56
|
-
Write-Host ""
|
|
57
|
-
|
|
58
|
-
$allGood = $true
|
|
59
|
-
$missingTools = @()
|
|
60
|
-
|
|
61
|
-
# Check Node.js
|
|
62
|
-
try {
|
|
63
|
-
$nodeVersion = node --version 2>$null
|
|
64
|
-
Write-Host " โ
Node.js - $nodeVersion" -ForegroundColor Green
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
Write-Host " โ Node.js - Not installed" -ForegroundColor Red
|
|
68
|
-
$missingTools += "Node.js"
|
|
69
|
-
$allGood = $false
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
# Check npm
|
|
73
|
-
try {
|
|
74
|
-
$npmVersion = npm --version 2>$null
|
|
75
|
-
Write-Host " โ
npm - $npmVersion" -ForegroundColor Green
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
Write-Host " โ npm - Not installed" -ForegroundColor Red
|
|
79
|
-
$missingTools += "npm"
|
|
80
|
-
$allGood = $false
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
# Check Git
|
|
84
|
-
try {
|
|
85
|
-
$gitVersion = git --version 2>$null
|
|
86
|
-
Write-Host " โ
Git - $gitVersion" -ForegroundColor Green
|
|
87
|
-
}
|
|
88
|
-
catch {
|
|
89
|
-
Write-Host " โ Git - Not installed" -ForegroundColor Red
|
|
90
|
-
$missingTools += "Git"
|
|
91
|
-
$allGood = $false
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
# Check PowerShell modules
|
|
95
|
-
$requiredModules = @(
|
|
96
|
-
"Microsoft.PowerApps.Administration.PowerShell",
|
|
97
|
-
"Microsoft.PowerApps.PowerShell"
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
foreach ($module in $requiredModules) {
|
|
101
|
-
if (Get-Module -Name $module -ListAvailable -ErrorAction SilentlyContinue) {
|
|
102
|
-
Write-Host " โ
$module - Installed" -ForegroundColor Green
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
Write-Host " โ $module - Not installed" -ForegroundColor Red
|
|
106
|
-
$missingTools += $module
|
|
107
|
-
$allGood = $false
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
# Check optional tools
|
|
112
|
-
try {
|
|
113
|
-
$jqVersion = jq --version 2>$null
|
|
114
|
-
Write-Host " โ
jq - $jqVersion" -ForegroundColor Green
|
|
115
|
-
}
|
|
116
|
-
catch {
|
|
117
|
-
Write-Host " โ ๏ธ jq - Not installed (optional)" -ForegroundColor Yellow
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
Write-Host ""
|
|
121
|
-
|
|
122
|
-
if ($allGood) {
|
|
123
|
-
Write-Host "๐ All prerequisites are installed!" -ForegroundColor Green
|
|
124
|
-
return $true
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
Write-Host "โ Missing tools detected" -ForegroundColor Red
|
|
128
|
-
Show-InstallationInstructions -MissingTools $missingTools
|
|
129
|
-
return $false
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function Show-InstallationInstructions {
|
|
134
|
-
param([array]$MissingTools)
|
|
135
|
-
|
|
136
|
-
Write-Host "๐ฆ Installation Instructions:" -ForegroundColor Yellow
|
|
137
|
-
Write-Host ""
|
|
138
|
-
|
|
139
|
-
Write-Host "Install missing tools using Chocolatey (recommended):" -ForegroundColor White
|
|
140
|
-
Write-Host ""
|
|
141
|
-
|
|
142
|
-
if ($MissingTools -contains "Node.js" -or $MissingTools -contains "npm") {
|
|
143
|
-
Write-Host " choco install nodejs" -ForegroundColor Cyan
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if ($MissingTools -contains "Git") {
|
|
147
|
-
Write-Host " choco install git" -ForegroundColor Cyan
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if ($MissingTools -contains "jq") {
|
|
151
|
-
Write-Host " choco install jq" -ForegroundColor Cyan
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
foreach ($module in $MissingTools | Where-Object { $_ -like "Microsoft.PowerApps*" }) {
|
|
155
|
-
Write-Host " Install-Module -Name $module -Force" -ForegroundColor Cyan
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
Write-Host ""
|
|
159
|
-
Write-Host "If Chocolatey is not installed:" -ForegroundColor White
|
|
160
|
-
Write-Host " Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" -ForegroundColor Cyan
|
|
161
|
-
Write-Host ""
|
|
162
|
-
Write-Host "Alternative manual installations:" -ForegroundColor White
|
|
163
|
-
Write-Host " Node.js: https://nodejs.org/"
|
|
164
|
-
Write-Host " Git: https://git-scm.com/"
|
|
165
|
-
Write-Host ""
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function Test-ProjectSetup {
|
|
169
|
-
Write-Host "๐ Checking Project Setup..." -ForegroundColor Blue
|
|
170
|
-
Write-Host ""
|
|
171
|
-
|
|
172
|
-
# Check if we're in a project directory
|
|
173
|
-
$packageJsonPath = Join-Path $ProjectRoot "package.json"
|
|
174
|
-
if (-not (Test-Path $packageJsonPath)) {
|
|
175
|
-
Write-Host "โ Not in a Dynamics 365 project directory" -ForegroundColor Red
|
|
176
|
-
Write-Host " Please navigate to your project root directory"
|
|
177
|
-
return $false
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
Write-Host "โ
Project directory detected" -ForegroundColor Green
|
|
181
|
-
|
|
182
|
-
# Check package.json
|
|
183
|
-
if (Test-Path $packageJsonPath) {
|
|
184
|
-
Write-Host "โ
package.json found" -ForegroundColor Green
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
Write-Host "โ package.json not found" -ForegroundColor Red
|
|
188
|
-
return $false
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
# Check node_modules
|
|
192
|
-
$nodeModulesPath = Join-Path $ProjectRoot "node_modules"
|
|
193
|
-
if (Test-Path $nodeModulesPath) {
|
|
194
|
-
Write-Host "โ
node_modules exists" -ForegroundColor Green
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
Write-Host "โ ๏ธ node_modules not found - run 'npm install'" -ForegroundColor Yellow
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
# Check deployment scripts
|
|
201
|
-
$bashScriptPath = Join-Path $ProjectRoot "deployment\scripts\deploy.sh"
|
|
202
|
-
$psScriptPath = Join-Path $ProjectRoot "deployment\scripts\deploy.ps1"
|
|
203
|
-
|
|
204
|
-
if (Test-Path $psScriptPath) {
|
|
205
|
-
Write-Host "โ
PowerShell deployment script found" -ForegroundColor Green
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
Write-Host "โ PowerShell deployment script missing" -ForegroundColor Red
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if (Test-Path $bashScriptPath) {
|
|
212
|
-
Write-Host "โ
Bash deployment script found" -ForegroundColor Green
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
Write-Host "โ ๏ธ Bash deployment script missing" -ForegroundColor Yellow
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
# Check configuration directory
|
|
219
|
-
$configPath = Join-Path $ProjectRoot "config\environments"
|
|
220
|
-
if (Test-Path $configPath) {
|
|
221
|
-
Write-Host "โ
Environment configuration directory found" -ForegroundColor Green
|
|
222
|
-
|
|
223
|
-
# List available environments
|
|
224
|
-
$envFiles = Get-ChildItem -Path $configPath -Filter "*.json" | ForEach-Object { $_.BaseName }
|
|
225
|
-
if ($envFiles.Count -gt 0) {
|
|
226
|
-
Write-Host " Available environments: $($envFiles -join ', ')"
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
Write-Host " โ ๏ธ No environment configurations found" -ForegroundColor Yellow
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
Write-Host "โ Environment configuration directory missing" -ForegroundColor Red
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
Write-Host ""
|
|
237
|
-
return $true
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
function Initialize-DeveloperEnvironment {
|
|
241
|
-
Write-Host "โ๏ธ Setting up developer environment..." -ForegroundColor Blue
|
|
242
|
-
Write-Host ""
|
|
243
|
-
|
|
244
|
-
# Install npm dependencies if needed
|
|
245
|
-
$nodeModulesPath = Join-Path $ProjectRoot "node_modules"
|
|
246
|
-
if (-not (Test-Path $nodeModulesPath)) {
|
|
247
|
-
Write-Host "Installing npm dependencies..."
|
|
248
|
-
Push-Location $ProjectRoot
|
|
249
|
-
try {
|
|
250
|
-
npm install
|
|
251
|
-
Write-Host "โ
Dependencies installed" -ForegroundColor Green
|
|
252
|
-
}
|
|
253
|
-
catch {
|
|
254
|
-
Write-Host "โ Failed to install dependencies: $_" -ForegroundColor Red
|
|
255
|
-
}
|
|
256
|
-
finally {
|
|
257
|
-
Pop-Location
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
# Create .env.local template if it doesn't exist
|
|
262
|
-
$envLocalPath = Join-Path $ProjectRoot ".env.local"
|
|
263
|
-
if (-not (Test-Path $envLocalPath)) {
|
|
264
|
-
Write-Host "Creating .env.local template..."
|
|
265
|
-
|
|
266
|
-
$envContent = @"
|
|
267
|
-
# Local environment variables (not committed to git)
|
|
268
|
-
# Add your personal configuration here
|
|
269
|
-
|
|
270
|
-
# Development environment
|
|
271
|
-
D365_ENVIRONMENT=dev
|
|
272
|
-
D365_CLIENT_ID=your-client-id-here
|
|
273
|
-
D365_CLIENT_SECRET=your-client-secret-here
|
|
274
|
-
|
|
275
|
-
# Optional: Custom settings
|
|
276
|
-
NODE_ENV=development
|
|
277
|
-
DEBUG=true
|
|
278
|
-
"@
|
|
279
|
-
|
|
280
|
-
Set-Content -Path $envLocalPath -Value $envContent -Encoding UTF8
|
|
281
|
-
Write-Host "โ
.env.local template created" -ForegroundColor Green
|
|
282
|
-
Write-Host " ๐ Please edit .env.local with your configuration" -ForegroundColor Yellow
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
Write-Host ""
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
function New-PowerShellAliases {
|
|
289
|
-
Write-Host "๐ง Setting up PowerShell aliases..." -ForegroundColor Blue
|
|
290
|
-
Write-Host ""
|
|
291
|
-
|
|
292
|
-
# Check if profile exists
|
|
293
|
-
if (-not (Test-Path $PROFILE)) {
|
|
294
|
-
Write-Host "Creating PowerShell profile..."
|
|
295
|
-
New-Item -Type File -Path $PROFILE -Force | Out-Null
|
|
296
|
-
Write-Host "โ
PowerShell profile created" -ForegroundColor Green
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
# Check if aliases already exist
|
|
300
|
-
$profileContent = Get-Content $PROFILE -ErrorAction SilentlyContinue
|
|
301
|
-
if ($profileContent -notcontains "# Dynamics 365 Development Aliases") {
|
|
302
|
-
Write-Host "Adding aliases to PowerShell profile..."
|
|
303
|
-
|
|
304
|
-
$aliases = @"
|
|
305
|
-
|
|
306
|
-
# Dynamics 365 Development Aliases
|
|
307
|
-
Set-Alias d365deploy '$ProjectRoot\deployment\scripts\deploy.ps1'
|
|
308
|
-
Set-Alias d365health '$ProjectRoot\deployment\scripts\health-check.ps1'
|
|
309
|
-
Set-Alias d365rollback '$ProjectRoot\deployment\scripts\rollback.ps1'
|
|
310
|
-
|
|
311
|
-
function Set-D365Project { Set-Location '$ProjectRoot' }
|
|
312
|
-
Set-Alias d365cd Set-D365Project
|
|
313
|
-
|
|
314
|
-
function Start-D365Build { npm run build:prod }
|
|
315
|
-
Set-Alias d365build Start-D365Build
|
|
316
|
-
|
|
317
|
-
function Start-D365Dev { npm run build:dev }
|
|
318
|
-
Set-Alias d365dev Start-D365Dev
|
|
319
|
-
|
|
320
|
-
function Start-D365Quality { npm run quality }
|
|
321
|
-
Set-Alias d365quality Start-D365Quality
|
|
322
|
-
"@
|
|
323
|
-
|
|
324
|
-
Add-Content -Path $PROFILE -Value $aliases
|
|
325
|
-
Write-Host "โ
Aliases added to PowerShell profile" -ForegroundColor Green
|
|
326
|
-
Write-Host " ๐ Restart PowerShell or run '. `$PROFILE' to load aliases" -ForegroundColor Yellow
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
Write-Host " โ ๏ธ Aliases already exist in PowerShell profile" -ForegroundColor Yellow
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
Write-Host ""
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
function Show-NextSteps {
|
|
336
|
-
Write-Host "๐ Next Steps:" -ForegroundColor Cyan
|
|
337
|
-
Write-Host ""
|
|
338
|
-
|
|
339
|
-
Write-Host "1. ๐ Read the Windows Quick Start Guide:"
|
|
340
|
-
Write-Host " start deployment\QUICKSTART-WINDOWS.md" -ForegroundColor Cyan
|
|
341
|
-
Write-Host ""
|
|
342
|
-
|
|
343
|
-
Write-Host "2. ๐ง Install PowerShell modules (run as Administrator):"
|
|
344
|
-
Write-Host " Install-Module Microsoft.PowerApps.Administration.PowerShell" -ForegroundColor Cyan
|
|
345
|
-
Write-Host " Install-Module Microsoft.PowerApps.PowerShell" -ForegroundColor Cyan
|
|
346
|
-
Write-Host ""
|
|
347
|
-
|
|
348
|
-
Write-Host "3. โ๏ธ Configure your environment:"
|
|
349
|
-
Write-Host " Copy-Item config\environments\template.json config\environments\dev.json" -ForegroundColor Cyan
|
|
350
|
-
Write-Host " # Edit dev.json with your D365 settings"
|
|
351
|
-
Write-Host ""
|
|
352
|
-
|
|
353
|
-
Write-Host "4. ๐งช Test your setup:"
|
|
354
|
-
Write-Host " .\deployment\scripts\test-connection.ps1 -Environment dev" -ForegroundColor Cyan
|
|
355
|
-
Write-Host ""
|
|
356
|
-
|
|
357
|
-
Write-Host "5. ๐ Deploy to development:"
|
|
358
|
-
Write-Host " .\deployment\scripts\deploy.ps1 -Environment dev -DryRun" -ForegroundColor Cyan
|
|
359
|
-
Write-Host " .\deployment\scripts\deploy.ps1 -Environment dev" -ForegroundColor Cyan
|
|
360
|
-
Write-Host ""
|
|
361
|
-
|
|
362
|
-
Write-Host "6. ๐จ Generate your first entity:"
|
|
363
|
-
Write-Host ' npm run generate:entity -- --entity "customentity" --display-name "Custom Entity"' -ForegroundColor Cyan
|
|
364
|
-
Write-Host ""
|
|
365
|
-
|
|
366
|
-
Write-Host "๐ Additional Resources:" -ForegroundColor Magenta
|
|
367
|
-
Write-Host " โข Team Standards: docs\team-standards\"
|
|
368
|
-
Write-Host " โข Deployment Guide: deployment\README.md"
|
|
369
|
-
Write-Host " โข Architecture Overview: docs\ARCHITECTURE_OVERVIEW.md"
|
|
370
|
-
Write-Host " โข Code Review Checklist: docs\team-standards\code-review-checklist.md"
|
|
371
|
-
Write-Host ""
|
|
372
|
-
|
|
373
|
-
Write-Host "๐ Welcome to the team! Happy coding!" -ForegroundColor Green
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
function Start-InteractiveSetup {
|
|
377
|
-
if ($Interactive) {
|
|
378
|
-
Write-Host "๐งโโ๏ธ Starting interactive setup wizard..." -ForegroundColor Blue
|
|
379
|
-
Write-Host ""
|
|
380
|
-
|
|
381
|
-
# Environment configuration
|
|
382
|
-
Write-Host "Environment Configuration:" -ForegroundColor Yellow
|
|
383
|
-
Write-Host "Which environment would you like to configure first?"
|
|
384
|
-
Write-Host "1) Development (dev)"
|
|
385
|
-
Write-Host "2) Testing (test)"
|
|
386
|
-
Write-Host "3) Production (prod)"
|
|
387
|
-
Write-Host "4) Skip for now"
|
|
388
|
-
|
|
389
|
-
$choice = Read-Host "Enter your choice (1-4)"
|
|
390
|
-
|
|
391
|
-
switch ($choice) {
|
|
392
|
-
"1" {
|
|
393
|
-
Write-Host "Setting up development environment..."
|
|
394
|
-
New-EnvironmentConfig -Environment "dev"
|
|
395
|
-
}
|
|
396
|
-
"2" {
|
|
397
|
-
Write-Host "Setting up testing environment..."
|
|
398
|
-
New-EnvironmentConfig -Environment "test"
|
|
399
|
-
}
|
|
400
|
-
"3" {
|
|
401
|
-
Write-Host "Setting up production environment..."
|
|
402
|
-
New-EnvironmentConfig -Environment "prod"
|
|
403
|
-
}
|
|
404
|
-
default {
|
|
405
|
-
Write-Host "Skipping environment configuration"
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
function New-EnvironmentConfig {
|
|
412
|
-
param([string]$Environment)
|
|
413
|
-
|
|
414
|
-
$configFile = Join-Path $ProjectRoot "config\environments\$Environment.json"
|
|
415
|
-
|
|
416
|
-
if (Test-Path $configFile) {
|
|
417
|
-
Write-Host "Configuration file already exists: $configFile" -ForegroundColor Yellow
|
|
418
|
-
$overwrite = Read-Host "Would you like to overwrite it? (y/n)"
|
|
419
|
-
if ($overwrite -ne "y" -and $overwrite -ne "Y") {
|
|
420
|
-
return
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
Write-Host "Please provide the following information for $Environment environment:"
|
|
425
|
-
|
|
426
|
-
# Get basic information
|
|
427
|
-
$orgUrl = Read-Host "Organization URL (e.g., https://yourorg.crm.dynamics.com)"
|
|
428
|
-
$tenantId = Read-Host "Tenant ID"
|
|
429
|
-
$clientId = Read-Host "Client ID"
|
|
430
|
-
$clientSecret = Read-Host "Client Secret" -AsSecureString
|
|
431
|
-
$clientSecretPlain = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($clientSecret))
|
|
432
|
-
|
|
433
|
-
# Create configuration
|
|
434
|
-
$config = @{
|
|
435
|
-
name = $Environment.Substring(0,1).ToUpper() + $Environment.Substring(1)
|
|
436
|
-
type = $Environment
|
|
437
|
-
dynamics365 = @{
|
|
438
|
-
orgUrl = $orgUrl
|
|
439
|
-
webApiUrl = "$orgUrl/api/data/v9.2"
|
|
440
|
-
tenantId = $tenantId
|
|
441
|
-
}
|
|
442
|
-
authentication = @{
|
|
443
|
-
type = "oauth2"
|
|
444
|
-
clientId = $clientId
|
|
445
|
-
clientSecret = $clientSecretPlain
|
|
446
|
-
}
|
|
447
|
-
deployment = @{
|
|
448
|
-
strategy = "blue-green"
|
|
449
|
-
rollbackEnabled = $true
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
$config | ConvertTo-Json -Depth 3 | Set-Content -Path $configFile -Encoding UTF8
|
|
454
|
-
Write-Host "โ
Configuration created: $configFile" -ForegroundColor Green
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
# Main execution
|
|
458
|
-
function Main {
|
|
459
|
-
Show-Banner
|
|
460
|
-
|
|
461
|
-
$platformInfo = Get-PlatformInfo
|
|
462
|
-
Show-PlatformInfo -PlatformInfo $platformInfo
|
|
463
|
-
|
|
464
|
-
if (-not $SkipPrerequisites) {
|
|
465
|
-
if (-not (Test-Prerequisites)) {
|
|
466
|
-
Write-Host "Please install missing prerequisites and run this script again." -ForegroundColor Red
|
|
467
|
-
return
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
if (-not (Test-ProjectSetup)) {
|
|
472
|
-
Write-Host "Project setup issues detected. Please resolve them and try again." -ForegroundColor Red
|
|
473
|
-
return
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
Initialize-DeveloperEnvironment
|
|
477
|
-
New-PowerShellAliases
|
|
478
|
-
|
|
479
|
-
# Run interactive setup if requested
|
|
480
|
-
Start-InteractiveSetup
|
|
481
|
-
|
|
482
|
-
Show-NextSteps
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
# Run main function
|
|
486
|
-
Main
|