@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,567 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Team Onboarding Script with Platform Detection
|
|
4
|
-
# Automatically detects platform and guides developer through setup
|
|
5
|
-
|
|
6
|
-
set -euo pipefail
|
|
7
|
-
|
|
8
|
-
# Colors for output
|
|
9
|
-
RED='\033[0;31m'
|
|
10
|
-
GREEN='\033[0;32m'
|
|
11
|
-
YELLOW='\033[1;33m'
|
|
12
|
-
BLUE='\033[0;34m'
|
|
13
|
-
MAGENTA='\033[0;35m'
|
|
14
|
-
CYAN='\033[0;36m'
|
|
15
|
-
NC='\033[0m' # No Color
|
|
16
|
-
|
|
17
|
-
# Script configuration
|
|
18
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
19
|
-
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
|
|
20
|
-
|
|
21
|
-
# Platform detection
|
|
22
|
-
detect_platform() {
|
|
23
|
-
case "$(uname -s)" in
|
|
24
|
-
Darwin*) echo "mac" ;;
|
|
25
|
-
Linux*) echo "linux" ;;
|
|
26
|
-
CYGWIN*|MINGW32*|MSYS*|MINGW*) echo "windows" ;;
|
|
27
|
-
*) echo "unknown" ;;
|
|
28
|
-
esac
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
# Architecture detection
|
|
32
|
-
detect_arch() {
|
|
33
|
-
case "$(uname -m)" in
|
|
34
|
-
x86_64|amd64) echo "x64" ;;
|
|
35
|
-
arm64|aarch64) echo "arm64" ;;
|
|
36
|
-
*) echo "unknown" ;;
|
|
37
|
-
esac
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
show_banner() {
|
|
41
|
-
echo -e "${CYAN}"
|
|
42
|
-
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|
|
43
|
-
echo "โ Dynamics 365 Team Onboarding Assistant โ"
|
|
44
|
-
echo "โ Enterprise Consulting Edition โ"
|
|
45
|
-
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|
|
46
|
-
echo -e "${NC}"
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
show_platform_info() {
|
|
50
|
-
local platform="$1"
|
|
51
|
-
local arch="$2"
|
|
52
|
-
|
|
53
|
-
echo -e "${BLUE}๐ Platform Detection:${NC}"
|
|
54
|
-
echo " Platform: $platform"
|
|
55
|
-
echo " Architecture: $arch"
|
|
56
|
-
echo
|
|
57
|
-
|
|
58
|
-
case "$platform" in
|
|
59
|
-
mac)
|
|
60
|
-
echo -e "${GREEN}โ
macOS detected - You'll use Bash scripts${NC}"
|
|
61
|
-
echo " ๐ Quick Start Guide: deployment/QUICKSTART-MAC.md"
|
|
62
|
-
;;
|
|
63
|
-
linux)
|
|
64
|
-
echo -e "${GREEN}โ
Linux detected - You'll use Bash scripts${NC}"
|
|
65
|
-
echo " ๐ Quick Start Guide: deployment/QUICKSTART-MAC.md (compatible)"
|
|
66
|
-
;;
|
|
67
|
-
windows)
|
|
68
|
-
echo -e "${GREEN}โ
Windows detected - You can use PowerShell or Bash scripts${NC}"
|
|
69
|
-
echo " ๐ PowerShell Guide: deployment/QUICKSTART-WINDOWS.md"
|
|
70
|
-
echo " ๐ Bash Alternative: deployment/QUICKSTART-MAC.md"
|
|
71
|
-
;;
|
|
72
|
-
*)
|
|
73
|
-
echo -e "${YELLOW}โ ๏ธ Unknown platform - Please check system requirements${NC}"
|
|
74
|
-
;;
|
|
75
|
-
esac
|
|
76
|
-
echo
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
check_prerequisites() {
|
|
80
|
-
local platform="$1"
|
|
81
|
-
local missing_tools=()
|
|
82
|
-
local all_good=true
|
|
83
|
-
|
|
84
|
-
echo -e "${BLUE}๐ง Checking Prerequisites...${NC}"
|
|
85
|
-
echo
|
|
86
|
-
|
|
87
|
-
# Common tools
|
|
88
|
-
local common_tools=("node" "npm" "git")
|
|
89
|
-
|
|
90
|
-
# Platform-specific tools
|
|
91
|
-
case "$platform" in
|
|
92
|
-
mac|linux)
|
|
93
|
-
local platform_tools=("jq" "curl")
|
|
94
|
-
;;
|
|
95
|
-
windows)
|
|
96
|
-
local platform_tools=("jq" "curl")
|
|
97
|
-
;;
|
|
98
|
-
*)
|
|
99
|
-
local platform_tools=()
|
|
100
|
-
;;
|
|
101
|
-
esac
|
|
102
|
-
|
|
103
|
-
# Check common tools
|
|
104
|
-
for tool in "${common_tools[@]}"; do
|
|
105
|
-
if command -v "$tool" &> /dev/null; then
|
|
106
|
-
local version=$(eval "$tool --version" 2>/dev/null | head -n1 || echo "unknown")
|
|
107
|
-
echo -e " ${GREEN}โ
$tool${NC} - $version"
|
|
108
|
-
else
|
|
109
|
-
echo -e " ${RED}โ $tool${NC} - Not installed"
|
|
110
|
-
missing_tools+=("$tool")
|
|
111
|
-
all_good=false
|
|
112
|
-
fi
|
|
113
|
-
done
|
|
114
|
-
|
|
115
|
-
# Check platform-specific tools
|
|
116
|
-
for tool in "${platform_tools[@]}"; do
|
|
117
|
-
if command -v "$tool" &> /dev/null; then
|
|
118
|
-
local version=$(eval "$tool --version" 2>/dev/null | head -n1 || echo "unknown")
|
|
119
|
-
echo -e " ${GREEN}โ
$tool${NC} - $version"
|
|
120
|
-
else
|
|
121
|
-
echo -e " ${RED}โ $tool${NC} - Not installed"
|
|
122
|
-
missing_tools+=("$tool")
|
|
123
|
-
all_good=false
|
|
124
|
-
fi
|
|
125
|
-
done
|
|
126
|
-
|
|
127
|
-
# Check PowerShell on Windows
|
|
128
|
-
if [ "$platform" = "windows" ]; then
|
|
129
|
-
if command -v pwsh &> /dev/null; then
|
|
130
|
-
local ps_version=$(pwsh -c '$PSVersionTable.PSVersion.ToString()' 2>/dev/null || echo "unknown")
|
|
131
|
-
echo -e " ${GREEN}โ
PowerShell Core${NC} - $ps_version"
|
|
132
|
-
elif command -v powershell &> /dev/null; then
|
|
133
|
-
local ps_version=$(powershell -c '$PSVersionTable.PSVersion.ToString()' 2>/dev/null || echo "unknown")
|
|
134
|
-
echo -e " ${GREEN}โ
Windows PowerShell${NC} - $ps_version"
|
|
135
|
-
else
|
|
136
|
-
echo -e " ${YELLOW}โ ๏ธ PowerShell${NC} - Not detected (optional)"
|
|
137
|
-
fi
|
|
138
|
-
fi
|
|
139
|
-
|
|
140
|
-
echo
|
|
141
|
-
|
|
142
|
-
if [ "$all_good" = true ]; then
|
|
143
|
-
echo -e "${GREEN}๐ All prerequisites are installed!${NC}"
|
|
144
|
-
return 0
|
|
145
|
-
else
|
|
146
|
-
echo -e "${RED}โ Missing tools detected${NC}"
|
|
147
|
-
show_installation_instructions "$platform" "${missing_tools[@]}"
|
|
148
|
-
return 1
|
|
149
|
-
fi
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
show_installation_instructions() {
|
|
153
|
-
local platform="$1"
|
|
154
|
-
shift
|
|
155
|
-
local missing_tools=("$@")
|
|
156
|
-
|
|
157
|
-
echo -e "${YELLOW}๐ฆ Installation Instructions:${NC}"
|
|
158
|
-
echo
|
|
159
|
-
|
|
160
|
-
case "$platform" in
|
|
161
|
-
mac)
|
|
162
|
-
echo "Install missing tools using Homebrew:"
|
|
163
|
-
echo
|
|
164
|
-
if [[ " ${missing_tools[*]} " =~ " node " ]] || [[ " ${missing_tools[*]} " =~ " npm " ]]; then
|
|
165
|
-
echo " brew install node"
|
|
166
|
-
fi
|
|
167
|
-
if [[ " ${missing_tools[*]} " =~ " git " ]]; then
|
|
168
|
-
echo " brew install git"
|
|
169
|
-
fi
|
|
170
|
-
if [[ " ${missing_tools[*]} " =~ " jq " ]]; then
|
|
171
|
-
echo " brew install jq"
|
|
172
|
-
fi
|
|
173
|
-
if [[ " ${missing_tools[*]} " =~ " curl " ]]; then
|
|
174
|
-
echo " brew install curl"
|
|
175
|
-
fi
|
|
176
|
-
echo
|
|
177
|
-
echo "If Homebrew is not installed:"
|
|
178
|
-
echo ' /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
|
|
179
|
-
;;
|
|
180
|
-
linux)
|
|
181
|
-
echo "Install missing tools using your package manager:"
|
|
182
|
-
echo
|
|
183
|
-
echo "Ubuntu/Debian:"
|
|
184
|
-
if [[ " ${missing_tools[*]} " =~ " node " ]] || [[ " ${missing_tools[*]} " =~ " npm " ]]; then
|
|
185
|
-
echo " sudo apt-get install nodejs npm"
|
|
186
|
-
fi
|
|
187
|
-
if [[ " ${missing_tools[*]} " =~ " git " ]]; then
|
|
188
|
-
echo " sudo apt-get install git"
|
|
189
|
-
fi
|
|
190
|
-
if [[ " ${missing_tools[*]} " =~ " jq " ]]; then
|
|
191
|
-
echo " sudo apt-get install jq"
|
|
192
|
-
fi
|
|
193
|
-
if [[ " ${missing_tools[*]} " =~ " curl " ]]; then
|
|
194
|
-
echo " sudo apt-get install curl"
|
|
195
|
-
fi
|
|
196
|
-
echo
|
|
197
|
-
echo "CentOS/RHEL:"
|
|
198
|
-
if [[ " ${missing_tools[*]} " =~ " node " ]] || [[ " ${missing_tools[*]} " =~ " npm " ]]; then
|
|
199
|
-
echo " sudo yum install nodejs npm"
|
|
200
|
-
fi
|
|
201
|
-
if [[ " ${missing_tools[*]} " =~ " git " ]]; then
|
|
202
|
-
echo " sudo yum install git"
|
|
203
|
-
fi
|
|
204
|
-
if [[ " ${missing_tools[*]} " =~ " jq " ]]; then
|
|
205
|
-
echo " sudo yum install jq"
|
|
206
|
-
fi
|
|
207
|
-
if [[ " ${missing_tools[*]} " =~ " curl " ]]; then
|
|
208
|
-
echo " sudo yum install curl"
|
|
209
|
-
fi
|
|
210
|
-
;;
|
|
211
|
-
windows)
|
|
212
|
-
echo "Install missing tools using Chocolatey or manual installation:"
|
|
213
|
-
echo
|
|
214
|
-
echo "Using Chocolatey (recommended):"
|
|
215
|
-
if [[ " ${missing_tools[*]} " =~ " node " ]] || [[ " ${missing_tools[*]} " =~ " npm " ]]; then
|
|
216
|
-
echo " choco install nodejs"
|
|
217
|
-
fi
|
|
218
|
-
if [[ " ${missing_tools[*]} " =~ " git " ]]; then
|
|
219
|
-
echo " choco install git"
|
|
220
|
-
fi
|
|
221
|
-
if [[ " ${missing_tools[*]} " =~ " jq " ]]; then
|
|
222
|
-
echo " choco install jq"
|
|
223
|
-
fi
|
|
224
|
-
if [[ " ${missing_tools[*]} " =~ " curl " ]]; then
|
|
225
|
-
echo " choco install curl"
|
|
226
|
-
fi
|
|
227
|
-
echo
|
|
228
|
-
echo "Or download from official websites:"
|
|
229
|
-
echo " Node.js: https://nodejs.org/"
|
|
230
|
-
echo " Git: https://git-scm.com/"
|
|
231
|
-
;;
|
|
232
|
-
esac
|
|
233
|
-
echo
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
check_project_setup() {
|
|
237
|
-
echo -e "${BLUE}๐ Checking Project Setup...${NC}"
|
|
238
|
-
echo
|
|
239
|
-
|
|
240
|
-
# Check if we're in a project directory
|
|
241
|
-
if [ ! -f "$PROJECT_ROOT/package.json" ]; then
|
|
242
|
-
echo -e "${RED}โ Not in a Dynamics 365 project directory${NC}"
|
|
243
|
-
echo " Please navigate to your project root directory"
|
|
244
|
-
return 1
|
|
245
|
-
fi
|
|
246
|
-
|
|
247
|
-
echo -e "${GREEN}โ
Project directory detected${NC}"
|
|
248
|
-
|
|
249
|
-
# Check package.json
|
|
250
|
-
if [ -f "$PROJECT_ROOT/package.json" ]; then
|
|
251
|
-
echo -e "${GREEN}โ
package.json found${NC}"
|
|
252
|
-
else
|
|
253
|
-
echo -e "${RED}โ package.json not found${NC}"
|
|
254
|
-
return 1
|
|
255
|
-
fi
|
|
256
|
-
|
|
257
|
-
# Check node_modules
|
|
258
|
-
if [ -d "$PROJECT_ROOT/node_modules" ]; then
|
|
259
|
-
echo -e "${GREEN}โ
node_modules exists${NC}"
|
|
260
|
-
else
|
|
261
|
-
echo -e "${YELLOW}โ ๏ธ node_modules not found - run 'npm install'${NC}"
|
|
262
|
-
fi
|
|
263
|
-
|
|
264
|
-
# Check deployment scripts
|
|
265
|
-
if [ -f "$PROJECT_ROOT/deployment/scripts/deploy.sh" ]; then
|
|
266
|
-
echo -e "${GREEN}โ
Bash deployment script found${NC}"
|
|
267
|
-
else
|
|
268
|
-
echo -e "${RED}โ Bash deployment script missing${NC}"
|
|
269
|
-
fi
|
|
270
|
-
|
|
271
|
-
if [ -f "$PROJECT_ROOT/deployment/scripts/deploy.ps1" ]; then
|
|
272
|
-
echo -e "${GREEN}โ
PowerShell deployment script found${NC}"
|
|
273
|
-
else
|
|
274
|
-
echo -e "${YELLOW}โ ๏ธ PowerShell deployment script missing${NC}"
|
|
275
|
-
fi
|
|
276
|
-
|
|
277
|
-
# Check configuration directory
|
|
278
|
-
if [ -d "$PROJECT_ROOT/config/environments" ]; then
|
|
279
|
-
echo -e "${GREEN}โ
Environment configuration directory found${NC}"
|
|
280
|
-
|
|
281
|
-
# List available environments
|
|
282
|
-
local env_files=($(find "$PROJECT_ROOT/config/environments" -name "*.json" -exec basename {} .json \; 2>/dev/null || true))
|
|
283
|
-
if [ ${#env_files[@]} -gt 0 ]; then
|
|
284
|
-
echo " Available environments: ${env_files[*]}"
|
|
285
|
-
else
|
|
286
|
-
echo -e "${YELLOW} โ ๏ธ No environment configurations found${NC}"
|
|
287
|
-
fi
|
|
288
|
-
else
|
|
289
|
-
echo -e "${RED}โ Environment configuration directory missing${NC}"
|
|
290
|
-
fi
|
|
291
|
-
|
|
292
|
-
echo
|
|
293
|
-
return 0
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
setup_developer_environment() {
|
|
297
|
-
local platform="$1"
|
|
298
|
-
|
|
299
|
-
echo -e "${BLUE}โ๏ธ Setting up developer environment...${NC}"
|
|
300
|
-
echo
|
|
301
|
-
|
|
302
|
-
# Make scripts executable (Unix-like systems)
|
|
303
|
-
if [ "$platform" != "windows" ]; then
|
|
304
|
-
echo "Making deployment scripts executable..."
|
|
305
|
-
find "$PROJECT_ROOT/deployment/scripts" -name "*.sh" -exec chmod +x {} \; 2>/dev/null || true
|
|
306
|
-
echo -e "${GREEN}โ
Scripts are now executable${NC}"
|
|
307
|
-
fi
|
|
308
|
-
|
|
309
|
-
# Install npm dependencies if needed
|
|
310
|
-
if [ ! -d "$PROJECT_ROOT/node_modules" ]; then
|
|
311
|
-
echo "Installing npm dependencies..."
|
|
312
|
-
cd "$PROJECT_ROOT"
|
|
313
|
-
npm install
|
|
314
|
-
echo -e "${GREEN}โ
Dependencies installed${NC}"
|
|
315
|
-
fi
|
|
316
|
-
|
|
317
|
-
# Create .env.local template if it doesn't exist
|
|
318
|
-
if [ ! -f "$PROJECT_ROOT/.env.local" ]; then
|
|
319
|
-
echo "Creating .env.local template..."
|
|
320
|
-
cat > "$PROJECT_ROOT/.env.local" << 'EOF'
|
|
321
|
-
# Local environment variables (not committed to git)
|
|
322
|
-
# Add your personal configuration here
|
|
323
|
-
|
|
324
|
-
# Development environment
|
|
325
|
-
D365_ENVIRONMENT=dev
|
|
326
|
-
D365_CLIENT_ID=your-client-id-here
|
|
327
|
-
D365_CLIENT_SECRET=your-client-secret-here
|
|
328
|
-
|
|
329
|
-
# Optional: Custom settings
|
|
330
|
-
NODE_ENV=development
|
|
331
|
-
DEBUG=true
|
|
332
|
-
EOF
|
|
333
|
-
echo -e "${GREEN}โ
.env.local template created${NC}"
|
|
334
|
-
echo -e "${YELLOW} ๐ Please edit .env.local with your configuration${NC}"
|
|
335
|
-
fi
|
|
336
|
-
|
|
337
|
-
echo
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
create_platform_aliases() {
|
|
341
|
-
local platform="$1"
|
|
342
|
-
|
|
343
|
-
echo -e "${BLUE}๐ง Setting up platform-specific aliases...${NC}"
|
|
344
|
-
echo
|
|
345
|
-
|
|
346
|
-
case "$platform" in
|
|
347
|
-
mac)
|
|
348
|
-
local shell_config=""
|
|
349
|
-
if [ -n "${ZSH_VERSION:-}" ] || [ "$SHELL" = "/bin/zsh" ]; then
|
|
350
|
-
shell_config="$HOME/.zshrc"
|
|
351
|
-
elif [ -n "${BASH_VERSION:-}" ] || [ "$SHELL" = "/bin/bash" ]; then
|
|
352
|
-
shell_config="$HOME/.bash_profile"
|
|
353
|
-
fi
|
|
354
|
-
|
|
355
|
-
if [ -n "$shell_config" ]; then
|
|
356
|
-
echo "Adding aliases to $shell_config..."
|
|
357
|
-
|
|
358
|
-
# Check if aliases already exist
|
|
359
|
-
if ! grep -q "# Dynamics 365 Development Aliases" "$shell_config" 2>/dev/null; then
|
|
360
|
-
cat >> "$shell_config" << EOF
|
|
361
|
-
|
|
362
|
-
# Dynamics 365 Development Aliases
|
|
363
|
-
alias d365deploy="./deployment/scripts/deploy.sh"
|
|
364
|
-
alias d365health="./deployment/scripts/health-check.sh"
|
|
365
|
-
alias d365rollback="./deployment/scripts/rollback.sh"
|
|
366
|
-
alias d365cd="cd $PROJECT_ROOT"
|
|
367
|
-
alias d365build="npm run build:prod"
|
|
368
|
-
alias d365dev="npm run build:dev"
|
|
369
|
-
alias d365quality="npm run quality"
|
|
370
|
-
|
|
371
|
-
EOF
|
|
372
|
-
echo -e "${GREEN}โ
Aliases added to $shell_config${NC}"
|
|
373
|
-
echo -e "${YELLOW} ๐ Run 'source $shell_config' or restart your terminal${NC}"
|
|
374
|
-
else
|
|
375
|
-
echo -e "${YELLOW} โ ๏ธ Aliases already exist in $shell_config${NC}"
|
|
376
|
-
fi
|
|
377
|
-
fi
|
|
378
|
-
;;
|
|
379
|
-
windows)
|
|
380
|
-
echo "For Windows, you can create PowerShell aliases in your profile:"
|
|
381
|
-
echo
|
|
382
|
-
echo "PowerShell Profile Setup:"
|
|
383
|
-
echo ' if (!(Test-Path $PROFILE)) { New-Item -Type File -Path $PROFILE -Force }'
|
|
384
|
-
echo ' Add-Content $PROFILE "Set-Alias d365deploy .\deployment\scripts\deploy.ps1"'
|
|
385
|
-
echo ' Add-Content $PROFILE "Set-Alias d365health .\deployment\scripts\health-check.ps1"'
|
|
386
|
-
echo
|
|
387
|
-
;;
|
|
388
|
-
esac
|
|
389
|
-
|
|
390
|
-
echo
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
show_next_steps() {
|
|
394
|
-
local platform="$1"
|
|
395
|
-
|
|
396
|
-
echo -e "${CYAN}๐ Next Steps:${NC}"
|
|
397
|
-
echo
|
|
398
|
-
|
|
399
|
-
case "$platform" in
|
|
400
|
-
mac|linux)
|
|
401
|
-
echo "1. ๐ Read the Mac/Linux Quick Start Guide:"
|
|
402
|
-
echo " open deployment/QUICKSTART-MAC.md"
|
|
403
|
-
echo
|
|
404
|
-
echo "2. ๐ง Configure your environment:"
|
|
405
|
-
echo " cp config/environments/template.json config/environments/dev.json"
|
|
406
|
-
echo " # Edit dev.json with your D365 settings"
|
|
407
|
-
echo
|
|
408
|
-
echo "3. ๐งช Test your setup:"
|
|
409
|
-
echo " ./deployment/scripts/test-connection.sh dev"
|
|
410
|
-
echo
|
|
411
|
-
echo "4. ๐ Deploy to development:"
|
|
412
|
-
echo " ./deployment/scripts/deploy.sh dev --dry-run"
|
|
413
|
-
echo " ./deployment/scripts/deploy.sh dev"
|
|
414
|
-
echo
|
|
415
|
-
echo "5. ๐จ Generate your first entity:"
|
|
416
|
-
echo ' npm run generate:entity -- --entity "customentity" --display-name "Custom Entity"'
|
|
417
|
-
;;
|
|
418
|
-
windows)
|
|
419
|
-
echo "1. ๐ Read the Windows Quick Start Guide:"
|
|
420
|
-
echo " start deployment/QUICKSTART-WINDOWS.md"
|
|
421
|
-
echo
|
|
422
|
-
echo "2. ๐ง Install PowerShell modules (run as Administrator):"
|
|
423
|
-
echo " Install-Module Microsoft.PowerApps.Administration.PowerShell"
|
|
424
|
-
echo " Install-Module Microsoft.PowerApps.PowerShell"
|
|
425
|
-
echo
|
|
426
|
-
echo "3. โ๏ธ Configure your environment:"
|
|
427
|
-
echo " Copy-Item config\\environments\\template.json config\\environments\\dev.json"
|
|
428
|
-
echo " # Edit dev.json with your D365 settings"
|
|
429
|
-
echo
|
|
430
|
-
echo "4. ๐งช Test your setup:"
|
|
431
|
-
echo " .\\deployment\\scripts\\test-connection.ps1 -Environment dev"
|
|
432
|
-
echo
|
|
433
|
-
echo "5. ๐ Deploy to development:"
|
|
434
|
-
echo " .\\deployment\\scripts\\deploy.ps1 -Environment dev -DryRun"
|
|
435
|
-
echo " .\\deployment\\scripts\\deploy.ps1 -Environment dev"
|
|
436
|
-
echo
|
|
437
|
-
echo "6. ๐จ Generate your first entity:"
|
|
438
|
-
echo ' npm run generate:entity -- --entity "customentity" --display-name "Custom Entity"'
|
|
439
|
-
;;
|
|
440
|
-
esac
|
|
441
|
-
|
|
442
|
-
echo
|
|
443
|
-
echo -e "${MAGENTA}๐ Additional Resources:${NC}"
|
|
444
|
-
echo " โข Team Standards: docs/team-standards/"
|
|
445
|
-
echo " โข Deployment Guide: deployment/README.md"
|
|
446
|
-
echo " โข Architecture Overview: docs/ARCHITECTURE_OVERVIEW.md"
|
|
447
|
-
echo " โข Code Review Checklist: docs/team-standards/code-review-checklist.md"
|
|
448
|
-
echo
|
|
449
|
-
echo -e "${GREEN}๐ Welcome to the team! Happy coding!${NC}"
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
run_interactive_setup() {
|
|
453
|
-
echo -e "${YELLOW}Would you like to run the interactive setup wizard? (y/n)${NC}"
|
|
454
|
-
read -r response
|
|
455
|
-
|
|
456
|
-
if [[ "$response" =~ ^[Yy]$ ]]; then
|
|
457
|
-
echo
|
|
458
|
-
echo -e "${BLUE}๐งโโ๏ธ Starting interactive setup wizard...${NC}"
|
|
459
|
-
echo
|
|
460
|
-
|
|
461
|
-
# Environment configuration
|
|
462
|
-
echo -e "${YELLOW}Environment Configuration:${NC}"
|
|
463
|
-
echo "Which environment would you like to configure first?"
|
|
464
|
-
echo "1) Development (dev)"
|
|
465
|
-
echo "2) Testing (test)"
|
|
466
|
-
echo "3) Production (prod)"
|
|
467
|
-
echo "4) Skip for now"
|
|
468
|
-
|
|
469
|
-
read -r env_choice
|
|
470
|
-
|
|
471
|
-
case "$env_choice" in
|
|
472
|
-
1)
|
|
473
|
-
echo "Setting up development environment..."
|
|
474
|
-
setup_environment_config "dev"
|
|
475
|
-
;;
|
|
476
|
-
2)
|
|
477
|
-
echo "Setting up testing environment..."
|
|
478
|
-
setup_environment_config "test"
|
|
479
|
-
;;
|
|
480
|
-
3)
|
|
481
|
-
echo "Setting up production environment..."
|
|
482
|
-
setup_environment_config "prod"
|
|
483
|
-
;;
|
|
484
|
-
*)
|
|
485
|
-
echo "Skipping environment configuration"
|
|
486
|
-
;;
|
|
487
|
-
esac
|
|
488
|
-
fi
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
setup_environment_config() {
|
|
492
|
-
local env="$1"
|
|
493
|
-
local config_file="$PROJECT_ROOT/config/environments/$env.json"
|
|
494
|
-
|
|
495
|
-
if [ -f "$config_file" ]; then
|
|
496
|
-
echo -e "${YELLOW}Configuration file already exists: $config_file${NC}"
|
|
497
|
-
echo "Would you like to overwrite it? (y/n)"
|
|
498
|
-
read -r overwrite
|
|
499
|
-
if [[ ! "$overwrite" =~ ^[Yy]$ ]]; then
|
|
500
|
-
return
|
|
501
|
-
fi
|
|
502
|
-
fi
|
|
503
|
-
|
|
504
|
-
echo "Please provide the following information for $env environment:"
|
|
505
|
-
|
|
506
|
-
# Get basic information
|
|
507
|
-
read -p "Organization URL (e.g., https://yourorg.crm.dynamics.com): " org_url
|
|
508
|
-
read -p "Tenant ID: " tenant_id
|
|
509
|
-
read -p "Client ID: " client_id
|
|
510
|
-
read -s -p "Client Secret: " client_secret
|
|
511
|
-
echo
|
|
512
|
-
|
|
513
|
-
# Create configuration
|
|
514
|
-
cat > "$config_file" << EOF
|
|
515
|
-
{
|
|
516
|
-
"name": "${env^}",
|
|
517
|
-
"type": "$env",
|
|
518
|
-
"dynamics365": {
|
|
519
|
-
"orgUrl": "$org_url",
|
|
520
|
-
"webApiUrl": "${org_url}/api/data/v9.2",
|
|
521
|
-
"tenantId": "$tenant_id"
|
|
522
|
-
},
|
|
523
|
-
"authentication": {
|
|
524
|
-
"type": "oauth2",
|
|
525
|
-
"clientId": "$client_id",
|
|
526
|
-
"clientSecret": "$client_secret"
|
|
527
|
-
},
|
|
528
|
-
"deployment": {
|
|
529
|
-
"strategy": "blue-green",
|
|
530
|
-
"rollbackEnabled": true
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
EOF
|
|
534
|
-
|
|
535
|
-
echo -e "${GREEN}โ
Configuration created: $config_file${NC}"
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
# Main execution
|
|
539
|
-
main() {
|
|
540
|
-
show_banner
|
|
541
|
-
|
|
542
|
-
local platform=$(detect_platform)
|
|
543
|
-
local arch=$(detect_arch)
|
|
544
|
-
|
|
545
|
-
show_platform_info "$platform" "$arch"
|
|
546
|
-
|
|
547
|
-
if ! check_prerequisites "$platform"; then
|
|
548
|
-
echo -e "${RED}Please install missing prerequisites and run this script again.${NC}"
|
|
549
|
-
exit 1
|
|
550
|
-
fi
|
|
551
|
-
|
|
552
|
-
if ! check_project_setup; then
|
|
553
|
-
echo -e "${RED}Project setup issues detected. Please resolve them and try again.${NC}"
|
|
554
|
-
exit 1
|
|
555
|
-
fi
|
|
556
|
-
|
|
557
|
-
setup_developer_environment "$platform"
|
|
558
|
-
create_platform_aliases "$platform"
|
|
559
|
-
|
|
560
|
-
# Run interactive setup if requested
|
|
561
|
-
run_interactive_setup
|
|
562
|
-
|
|
563
|
-
show_next_steps "$platform"
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
# Run main function
|
|
567
|
-
main "$@"
|