@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.
- package/bin/create-dynamics-app.js +1 -1
- package/dist/index.js +140 -15
- package/dist/index.js.map +1 -1
- package/dist/utils/consultingHelpers.d.ts +13 -0
- package/dist/utils/consultingHelpers.d.ts.map +1 -0
- package/dist/utils/consultingHelpers.js +569 -0
- package/dist/utils/consultingHelpers.js.map +1 -0
- package/dist/utils/copyTemplate.d.ts.map +1 -1
- package/dist/utils/copyTemplate.js.map +1 -1
- package/dist/utils/initGit.d.ts.map +1 -1
- package/dist/utils/initGit.js.map +1 -1
- package/dist/utils/installDependencies.d.ts.map +1 -1
- package/dist/utils/installDependencies.js +3 -2
- package/dist/utils/installDependencies.js.map +1 -1
- package/dist/utils/updatePackageJson.d.ts +1 -1
- package/dist/utils/updatePackageJson.d.ts.map +1 -1
- package/dist/utils/updatePackageJson.js +11 -1
- package/dist/utils/updatePackageJson.js.map +1 -1
- package/package.json +1 -1
- package/templates/dynamics-365-starter/INTEGRATION_TEST_RESULTS.md +302 -0
- package/templates/dynamics-365-starter/PHASE_4_COMPLETION_SUMMARY.md +305 -0
- package/templates/dynamics-365-starter/README.md +566 -137
- package/templates/dynamics-365-starter/deployment/QUICKSTART-MAC.md +507 -0
- package/templates/dynamics-365-starter/deployment/QUICKSTART-WINDOWS.md +372 -0
- package/templates/dynamics-365-starter/deployment/README.md +484 -0
- package/templates/dynamics-365-starter/deployment/pipelines/README.md +375 -0
- package/templates/dynamics-365-starter/deployment/pipelines/azure-pipelines.yml +330 -0
- package/templates/dynamics-365-starter/deployment/pipelines/github-actions.yml +422 -0
- package/templates/dynamics-365-starter/deployment/pipelines/jenkins.groovy +636 -0
- package/templates/dynamics-365-starter/deployment/scripts/deploy.ps1 +417 -0
- package/templates/dynamics-365-starter/deployment/scripts/deploy.sh +582 -0
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.ps1 +486 -0
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.sh +567 -0
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.ps1 +703 -0
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.sh +671 -0
- package/templates/dynamics-365-starter/docs/ARCHITECTURE_OVERVIEW.md +506 -0
- package/templates/dynamics-365-starter/docs/BEST_PRACTICES.md +723 -0
- package/templates/dynamics-365-starter/docs/MIGRATION_GUIDE.md +447 -0
- package/templates/dynamics-365-starter/docs/team-standards/README.md +273 -0
- package/templates/dynamics-365-starter/docs/team-standards/client-onboarding.md +577 -0
- package/templates/dynamics-365-starter/docs/team-standards/code-review-checklist.md +359 -0
- package/templates/dynamics-365-starter/docs/team-standards/coding-standards.md +700 -0
- package/templates/dynamics-365-starter/docs/team-standards/cross-platform-team-guide.md +736 -0
- package/templates/dynamics-365-starter/docs/team-standards/development-workflows.md +727 -0
- package/templates/dynamics-365-starter/docs/troubleshooting/common-errors.md +758 -0
- package/templates/dynamics-365-starter/docs/troubleshooting/platform-specific-issues.md +878 -0
- package/templates/dynamics-365-starter/package.json +22 -1
- package/templates/dynamics-365-starter/public/index.html +8 -11
- package/templates/dynamics-365-starter/scripts/custom-build.js +255 -0
- package/templates/dynamics-365-starter/src/client-project-template/README.md +234 -0
- package/templates/dynamics-365-starter/src/client-project-template/config/client.template.json +114 -0
- package/templates/dynamics-365-starter/src/client-project-template/config/environments/template.json +186 -0
- package/templates/dynamics-365-starter/src/client-project-template/scripts/client-setup.js +667 -0
- package/templates/dynamics-365-starter/src/components/AccountForm.css +71 -0
- package/templates/dynamics-365-starter/src/components/AccountForm.tsx +541 -0
- package/templates/dynamics-365-starter/src/components/AccountManagement.css +86 -0
- package/templates/dynamics-365-starter/src/components/AccountManagement.tsx +370 -0
- package/templates/dynamics-365-starter/src/components/ContactForm.tsx +149 -63
- package/templates/dynamics-365-starter/src/components/ContactManagement.tsx +153 -63
- package/templates/dynamics-365-starter/src/components/Logging/LogDialog.tsx +291 -0
- package/templates/dynamics-365-starter/src/components/Logging/LoggingContext.tsx +166 -0
- package/templates/dynamics-365-starter/src/components/Logging/LoggingDebugPanel.css +192 -0
- package/templates/dynamics-365-starter/src/components/Logging/LoggingDebugPanel.tsx +177 -0
- package/templates/dynamics-365-starter/src/components/Logging/LoggingProvider.tsx +3 -0
- package/templates/dynamics-365-starter/src/components/Logging/logger.ts +193 -0
- package/templates/dynamics-365-starter/src/constants/account.ts +410 -0
- package/templates/dynamics-365-starter/src/constants/contact.ts +362 -0
- package/templates/dynamics-365-starter/src/examples/README.md +52 -0
- package/templates/dynamics-365-starter/src/examples/component-examples/opportunity-management.tsx +625 -0
- package/templates/dynamics-365-starter/src/examples/entity-examples/opportunity-model.ts +545 -0
- package/templates/dynamics-365-starter/src/examples/integration-examples/custom-pcf-wrapper.tsx +722 -0
- package/templates/dynamics-365-starter/src/examples/workflow-examples/sales-workflow.ts +662 -0
- package/templates/dynamics-365-starter/src/index.tsx +107 -19
- package/templates/dynamics-365-starter/src/models/Account.ts +480 -0
- package/templates/dynamics-365-starter/src/models/BaseEntity.ts +204 -0
- package/templates/dynamics-365-starter/src/models/Contact.ts +580 -0
- package/templates/dynamics-365-starter/src/page-templates/EntityDashboard.tsx +519 -0
- package/templates/dynamics-365-starter/src/page-templates/EntityDetailPage.tsx +456 -0
- package/templates/dynamics-365-starter/src/page-templates/EntityListPage.tsx +406 -0
- package/templates/dynamics-365-starter/src/page-templates/RelatedEntitiesPage.tsx +578 -0
- package/templates/dynamics-365-starter/src/page-templates/SearchPage.tsx +629 -0
- package/templates/dynamics-365-starter/src/pcf/ContactControlWrapper.tsx +75 -22
- package/templates/dynamics-365-starter/src/pcf/MultiEntityControlWrapper.tsx +205 -0
- package/templates/dynamics-365-starter/src/providers/DynamicsProvider.tsx +297 -80
- package/templates/dynamics-365-starter/src/services/MockApiService.ts +260 -0
- package/templates/dynamics-365-starter/src/services/ServiceFactory.ts +65 -0
- package/templates/dynamics-365-starter/src/services/XrmApiService.ts +213 -0
- package/templates/dynamics-365-starter/src/styles/index.css +74 -7
- package/templates/dynamics-365-starter/tools/entity-generator/index.js +168 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/constants.template.ts +124 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.css +283 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.tsx +275 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.css +204 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.tsx +413 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/model.template.ts +250 -0
- package/templates/dynamics-365-starter/tools/metadata-sync/d365-client.js +410 -0
- package/templates/dynamics-365-starter/tools/metadata-sync/index.js +512 -0
- package/templates/dynamics-365-starter/tools/metadata-sync/type-generator.js +675 -0
- package/templates/dynamics-365-starter/tsconfig.json +11 -8
- package/templates/dynamics-365-starter/webpack.config.js +8 -9
- package/templates/power-pages-starter/README.md +7 -1
- package/templates/power-pages-starter/public/index.html +8 -11
- package/templates/power-pages-starter/src/components/ContactForm.tsx +60 -41
- package/templates/power-pages-starter/src/index.tsx +3 -3
- package/templates/power-pages-starter/src/providers/PowerPagesProvider.tsx +46 -23
- package/templates/power-pages-starter/tsconfig.json +3 -9
- package/templates/power-pages-starter/webpack.config.js +8 -3
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
# Migration Guide - Dynamics 365 Template
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This guide helps you migrate existing Dynamics 365 projects to use the enhanced template patterns
|
|
6
|
+
and architecture.
|
|
7
|
+
|
|
8
|
+
## Migration Scenarios
|
|
9
|
+
|
|
10
|
+
### 1. From Basic React D365 Apps
|
|
11
|
+
|
|
12
|
+
If you have a basic React application for Dynamics 365:
|
|
13
|
+
|
|
14
|
+
#### Before (Basic Pattern)
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
// Direct API calls without abstraction
|
|
18
|
+
function createAccount(data) {
|
|
19
|
+
return Xrm.WebApi.createRecord('account', data);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Component with inline API logic
|
|
23
|
+
function AccountForm() {
|
|
24
|
+
const handleSubmit = async () => {
|
|
25
|
+
try {
|
|
26
|
+
await Xrm.WebApi.createRecord('account', formData);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error(error);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### After (Enhanced Pattern)
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
// Entity model with validation and logging
|
|
38
|
+
export class Account extends BaseEntity {
|
|
39
|
+
public static async create(apiService: IApiService, account: Account): Promise<Account> {
|
|
40
|
+
return await this.createEntity<Account>(
|
|
41
|
+
apiService,
|
|
42
|
+
account,
|
|
43
|
+
AccountConstants.EntityCollectionName,
|
|
44
|
+
'Account.create'
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Component using service layer
|
|
50
|
+
function AccountForm() {
|
|
51
|
+
const { apiService } = useDynamicsApi();
|
|
52
|
+
|
|
53
|
+
const handleSubmit = async () => {
|
|
54
|
+
try {
|
|
55
|
+
const account = new Account(formData);
|
|
56
|
+
await Account.create(apiService, account);
|
|
57
|
+
Logger.userAction('Account created', { name: formData.name });
|
|
58
|
+
} catch (error) {
|
|
59
|
+
Logger.error('Failed to create account', 'AccountForm', error);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### Migration Steps
|
|
66
|
+
|
|
67
|
+
1. **Install the Template Dependencies**
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm install @khester/dynamics-ui-components @khester/dynamics-ui-api-client
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
2. **Create Entity Models**
|
|
74
|
+
- Copy `src/models/BaseEntity.ts` to your project
|
|
75
|
+
- Create entity models extending BaseEntity
|
|
76
|
+
- Add constants files for field definitions
|
|
77
|
+
|
|
78
|
+
3. **Implement Service Layer**
|
|
79
|
+
- Copy `src/services/ServiceFactory.ts`
|
|
80
|
+
- Copy API service implementations
|
|
81
|
+
- Update components to use the service layer
|
|
82
|
+
|
|
83
|
+
4. **Add Logging System**
|
|
84
|
+
- Copy `src/components/Logging/` directory
|
|
85
|
+
- Wrap your app with `LoggingProvider`
|
|
86
|
+
- Replace console calls with Logger methods
|
|
87
|
+
|
|
88
|
+
### 2. From PCF Controls to Template
|
|
89
|
+
|
|
90
|
+
If you're building PCF controls:
|
|
91
|
+
|
|
92
|
+
#### Before (Basic PCF)
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
export class MyControl implements ComponentFramework.StandardControl<IInputs, IOutputs> {
|
|
96
|
+
public init(context: ComponentFramework.Context<IInputs>): void {
|
|
97
|
+
// Direct DOM manipulation or basic React
|
|
98
|
+
this.container.innerHTML = '<div>Basic Content</div>';
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### After (Template PCF)
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
export class MyControl implements ComponentFramework.StandardControl<IInputs, IOutputs> {
|
|
107
|
+
public init(context: ComponentFramework.Context<IInputs>): void {
|
|
108
|
+
// Use sophisticated wrapper components
|
|
109
|
+
ReactDOM.render(
|
|
110
|
+
React.createElement(CustomPCFWrapper, {
|
|
111
|
+
context,
|
|
112
|
+
entityType: 'contact',
|
|
113
|
+
enableLogging: true,
|
|
114
|
+
showTabs: true,
|
|
115
|
+
}),
|
|
116
|
+
this.container
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### Migration Steps
|
|
123
|
+
|
|
124
|
+
1. **Copy PCF Wrapper Components**
|
|
125
|
+
- Copy `src/pcf/` directory to your PCF project
|
|
126
|
+
- Update your PCF control to use the wrappers
|
|
127
|
+
|
|
128
|
+
2. **Integrate with Entity Models**
|
|
129
|
+
- Copy entity models and constants
|
|
130
|
+
- Use the service factory for API access
|
|
131
|
+
|
|
132
|
+
3. **Update PCF Configuration**
|
|
133
|
+
- Update your `ControlManifest.Input.xml`
|
|
134
|
+
- Ensure React dependencies are included
|
|
135
|
+
|
|
136
|
+
### 3. From Web Resources to Template
|
|
137
|
+
|
|
138
|
+
If you're using traditional web resources:
|
|
139
|
+
|
|
140
|
+
#### Before (Traditional Web Resources)
|
|
141
|
+
|
|
142
|
+
```html
|
|
143
|
+
<!-- HTML Web Resource -->
|
|
144
|
+
<script src="/scripts/jquery.min.js"></script>
|
|
145
|
+
<script src="/scripts/custom.js"></script>
|
|
146
|
+
<div id="myApp">
|
|
147
|
+
<!-- Static HTML content -->
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
<script>
|
|
151
|
+
// Direct Xrm calls
|
|
152
|
+
function loadAccounts() {
|
|
153
|
+
Xrm.WebApi.retrieveMultipleRecords('account', '?$select=name,accountid').then(
|
|
154
|
+
function (result) {
|
|
155
|
+
// Manual DOM manipulation
|
|
156
|
+
var html = '';
|
|
157
|
+
result.entities.forEach(function (account) {
|
|
158
|
+
html += '<div>' + account.name + '</div>';
|
|
159
|
+
});
|
|
160
|
+
document.getElementById('accountList').innerHTML = html;
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
</script>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### After (Template Web Resources)
|
|
168
|
+
|
|
169
|
+
```html
|
|
170
|
+
<!-- Modern React Web Resource -->
|
|
171
|
+
<div id="root"></div>
|
|
172
|
+
<script src="/scripts/main.js"></script>
|
|
173
|
+
|
|
174
|
+
<!-- main.js contains the compiled React app -->
|
|
175
|
+
<script>
|
|
176
|
+
// Sophisticated React application with:
|
|
177
|
+
// - Entity models and validation
|
|
178
|
+
// - Service layer abstraction
|
|
179
|
+
// - Comprehensive logging
|
|
180
|
+
// - Error handling
|
|
181
|
+
// - Type safety
|
|
182
|
+
</script>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
#### Migration Steps
|
|
186
|
+
|
|
187
|
+
1. **Generate Template Application**
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
npx @khester/create-dynamics-app my-app --template dynamics-365
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
2. **Copy Existing Business Logic**
|
|
194
|
+
- Convert existing functions to entity model methods
|
|
195
|
+
- Move validation to model classes
|
|
196
|
+
- Replace direct DOM manipulation with React components
|
|
197
|
+
|
|
198
|
+
3. **Build and Deploy**
|
|
199
|
+
```bash
|
|
200
|
+
npm run build:prod
|
|
201
|
+
# Upload dist/main.js as Script (JScript) web resource
|
|
202
|
+
# Upload dist/index.html as Web Page (HTML) web resource
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Best Practices for Migration
|
|
206
|
+
|
|
207
|
+
### 1. Incremental Migration
|
|
208
|
+
|
|
209
|
+
Don't migrate everything at once. Start with:
|
|
210
|
+
|
|
211
|
+
1. **Core Infrastructure**
|
|
212
|
+
- Service factory and API services
|
|
213
|
+
- Logging system
|
|
214
|
+
- Base entity class
|
|
215
|
+
|
|
216
|
+
2. **One Entity at a Time**
|
|
217
|
+
- Pick the most important entity
|
|
218
|
+
- Create model, constants, and components
|
|
219
|
+
- Test thoroughly before moving to next entity
|
|
220
|
+
|
|
221
|
+
3. **Component by Component**
|
|
222
|
+
- Replace existing forms with template components
|
|
223
|
+
- Update list views to use DetailsList patterns
|
|
224
|
+
- Add proper error handling and validation
|
|
225
|
+
|
|
226
|
+
### 2. Data Validation Migration
|
|
227
|
+
|
|
228
|
+
#### Before
|
|
229
|
+
|
|
230
|
+
```typescript
|
|
231
|
+
function validateAccount(data) {
|
|
232
|
+
var errors = [];
|
|
233
|
+
if (!data.name) {
|
|
234
|
+
errors.push('Name is required');
|
|
235
|
+
}
|
|
236
|
+
return errors;
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
#### After
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
export class Account extends BaseEntity {
|
|
244
|
+
public validate(): boolean {
|
|
245
|
+
const errors: string[] = [];
|
|
246
|
+
|
|
247
|
+
if (!this.name?.trim()) {
|
|
248
|
+
errors.push('Account name is required');
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (this.name && this.name.length > 160) {
|
|
252
|
+
errors.push('Account name cannot exceed 160 characters');
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (errors.length > 0) {
|
|
256
|
+
Logger.validation('Account', errors, 'Account.validate');
|
|
257
|
+
throw new Error(`Validation failed: ${errors.join(', ')}`);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### 3. Error Handling Migration
|
|
266
|
+
|
|
267
|
+
#### Before
|
|
268
|
+
|
|
269
|
+
```typescript
|
|
270
|
+
try {
|
|
271
|
+
await Xrm.WebApi.createRecord('account', data);
|
|
272
|
+
alert('Success');
|
|
273
|
+
} catch (error) {
|
|
274
|
+
alert('Error: ' + error.message);
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
#### After
|
|
279
|
+
|
|
280
|
+
```typescript
|
|
281
|
+
try {
|
|
282
|
+
const account = new Account(data);
|
|
283
|
+
const result = await Account.create(apiService, account);
|
|
284
|
+
Logger.userAction('Account created successfully', { accountId: result.accountid });
|
|
285
|
+
// Use proper UI notifications instead of alerts
|
|
286
|
+
} catch (error) {
|
|
287
|
+
Logger.error('Failed to create account', 'AccountForm.handleSubmit', error);
|
|
288
|
+
// Show user-friendly error message
|
|
289
|
+
setErrorMessage('Unable to create account. Please try again.');
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### 4. Environment Detection Migration
|
|
294
|
+
|
|
295
|
+
#### Before
|
|
296
|
+
|
|
297
|
+
```typescript
|
|
298
|
+
// Hard-coded environment logic
|
|
299
|
+
if (window.location.hostname === 'localhost') {
|
|
300
|
+
// Use mock data
|
|
301
|
+
} else {
|
|
302
|
+
// Use Xrm.WebApi
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
#### After
|
|
307
|
+
|
|
308
|
+
```typescript
|
|
309
|
+
// Sophisticated environment detection
|
|
310
|
+
const apiService = ServiceFactory.createApiService();
|
|
311
|
+
// Automatically detects environment and provides appropriate service
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## Common Migration Challenges
|
|
315
|
+
|
|
316
|
+
### 1. TypeScript Adoption
|
|
317
|
+
|
|
318
|
+
**Challenge**: Existing JavaScript code needs TypeScript conversion
|
|
319
|
+
|
|
320
|
+
**Solution**:
|
|
321
|
+
|
|
322
|
+
1. Start with `.ts` files and `any` types
|
|
323
|
+
2. Gradually add proper type definitions
|
|
324
|
+
3. Use the template's interface definitions as examples
|
|
325
|
+
|
|
326
|
+
### 2. Bundle Size Concerns
|
|
327
|
+
|
|
328
|
+
**Challenge**: React app may be larger than traditional web resources
|
|
329
|
+
|
|
330
|
+
**Solution**:
|
|
331
|
+
|
|
332
|
+
- Use the template's optimized build configuration
|
|
333
|
+
- Production build is only ~726KB
|
|
334
|
+
- Enable compression in IIS for web resources
|
|
335
|
+
- Consider code splitting for large applications
|
|
336
|
+
|
|
337
|
+
### 3. PCF Framework Limitations
|
|
338
|
+
|
|
339
|
+
**Challenge**: PCF has restrictions on external dependencies
|
|
340
|
+
|
|
341
|
+
**Solution**:
|
|
342
|
+
|
|
343
|
+
- Use the template's PCF wrapper patterns
|
|
344
|
+
- Bundle dependencies in the control
|
|
345
|
+
- Use the provided ComponentFramework type definitions
|
|
346
|
+
|
|
347
|
+
### 4. Dynamics 365 API Differences
|
|
348
|
+
|
|
349
|
+
**Challenge**: Different API behaviors between environments
|
|
350
|
+
|
|
351
|
+
**Solution**:
|
|
352
|
+
|
|
353
|
+
- Use the ServiceFactory to abstract differences
|
|
354
|
+
- Implement environment-specific logic in service classes
|
|
355
|
+
- Test thoroughly in both development and production
|
|
356
|
+
|
|
357
|
+
## Migration Checklist
|
|
358
|
+
|
|
359
|
+
### Pre-Migration Assessment
|
|
360
|
+
|
|
361
|
+
- [ ] Inventory existing entities and operations
|
|
362
|
+
- [ ] Identify current validation logic
|
|
363
|
+
- [ ] Document existing API usage patterns
|
|
364
|
+
- [ ] Assess current error handling approaches
|
|
365
|
+
|
|
366
|
+
### Migration Implementation
|
|
367
|
+
|
|
368
|
+
- [ ] Set up development environment with template
|
|
369
|
+
- [ ] Create entity models for core entities
|
|
370
|
+
- [ ] Implement service layer abstraction
|
|
371
|
+
- [ ] Add logging throughout application
|
|
372
|
+
- [ ] Create management components
|
|
373
|
+
- [ ] Implement proper error handling
|
|
374
|
+
- [ ] Add comprehensive validation
|
|
375
|
+
|
|
376
|
+
### Testing and Validation
|
|
377
|
+
|
|
378
|
+
- [ ] Test in development environment
|
|
379
|
+
- [ ] Validate all CRUD operations
|
|
380
|
+
- [ ] Test error scenarios
|
|
381
|
+
- [ ] Verify logging functionality
|
|
382
|
+
- [ ] Test build and deployment process
|
|
383
|
+
- [ ] User acceptance testing
|
|
384
|
+
|
|
385
|
+
### Production Deployment
|
|
386
|
+
|
|
387
|
+
- [ ] Build production bundle
|
|
388
|
+
- [ ] Upload web resources to D365
|
|
389
|
+
- [ ] Configure security roles
|
|
390
|
+
- [ ] Train users on new interface
|
|
391
|
+
- [ ] Monitor for issues
|
|
392
|
+
|
|
393
|
+
## Support and Resources
|
|
394
|
+
|
|
395
|
+
### Template Resources
|
|
396
|
+
|
|
397
|
+
- **Documentation**: README.md in template root
|
|
398
|
+
- **Examples**: `/src/examples/` directory
|
|
399
|
+
- **Integration Tests**: INTEGRATION_TEST_RESULTS.md
|
|
400
|
+
|
|
401
|
+
### Development Tools
|
|
402
|
+
|
|
403
|
+
- **Quality Scripts**: `npm run quality`
|
|
404
|
+
- **Build Validation**: `npm run validate`
|
|
405
|
+
- **Type Checking**: `npm run typecheck`
|
|
406
|
+
|
|
407
|
+
### Community and Support
|
|
408
|
+
|
|
409
|
+
- **GitHub Issues**: Report problems or ask questions
|
|
410
|
+
- **Documentation**: Comprehensive inline documentation
|
|
411
|
+
- **Examples**: Real-world implementation patterns
|
|
412
|
+
|
|
413
|
+
## Version Compatibility
|
|
414
|
+
|
|
415
|
+
### Dynamics 365 Versions
|
|
416
|
+
|
|
417
|
+
- **Online**: Fully supported
|
|
418
|
+
- **On-Premises**: Compatible with modern browsers
|
|
419
|
+
- **Government Cloud**: Supported
|
|
420
|
+
|
|
421
|
+
### Browser Support
|
|
422
|
+
|
|
423
|
+
- **Chrome**: 70+
|
|
424
|
+
- **Edge**: 79+
|
|
425
|
+
- **Firefox**: 65+
|
|
426
|
+
- **Safari**: 12+
|
|
427
|
+
|
|
428
|
+
### Node.js Versions
|
|
429
|
+
|
|
430
|
+
- **Minimum**: Node 16+
|
|
431
|
+
- **Recommended**: Node 18+
|
|
432
|
+
- **Latest**: Node 20+
|
|
433
|
+
|
|
434
|
+
## Conclusion
|
|
435
|
+
|
|
436
|
+
Migrating to the enhanced Dynamics 365 template provides significant benefits:
|
|
437
|
+
|
|
438
|
+
- **Type Safety**: Full TypeScript support
|
|
439
|
+
- **Error Handling**: Comprehensive error management
|
|
440
|
+
- **Logging**: Detailed operation tracking
|
|
441
|
+
- **Validation**: Client-side and business rule validation
|
|
442
|
+
- **Performance**: Optimized build process
|
|
443
|
+
- **Maintainability**: Clean architecture patterns
|
|
444
|
+
- **Developer Experience**: Modern tooling and documentation
|
|
445
|
+
|
|
446
|
+
The migration process, while requiring initial effort, results in more robust, maintainable, and
|
|
447
|
+
scalable Dynamics 365 applications.
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# Developer Team Standards
|
|
2
|
+
|
|
3
|
+
This directory contains standards, guidelines, and best practices for the development team working
|
|
4
|
+
on Dynamics 365 consulting projects.
|
|
5
|
+
|
|
6
|
+
## Table of Contents
|
|
7
|
+
|
|
8
|
+
1. [Coding Standards](./coding-standards.md) - Code style, naming conventions, and structure
|
|
9
|
+
2. [Entity Development Guidelines](./entity-development.md) - Standards for entity model development
|
|
10
|
+
3. [Code Review Checklist](./code-review-checklist.md) - Comprehensive review checklist
|
|
11
|
+
4. [Client Onboarding Procedures](./client-onboarding.md) - Process for new client projects
|
|
12
|
+
5. [Quality Assurance Standards](./quality-assurance.md) - Testing and QA requirements
|
|
13
|
+
6. [Deployment Best Practices](./deployment-practices.md) - Deployment procedures and standards
|
|
14
|
+
7. [Security Guidelines](./security-guidelines.md) - Security requirements and best practices
|
|
15
|
+
8. [Performance Standards](./performance-standards.md) - Performance optimization guidelines
|
|
16
|
+
9. [Documentation Standards](./documentation-standards.md) - Documentation requirements
|
|
17
|
+
10. [Team Workflows](./team-workflows.md) - Development team processes
|
|
18
|
+
|
|
19
|
+
## Quick Reference
|
|
20
|
+
|
|
21
|
+
### Before Starting Development
|
|
22
|
+
|
|
23
|
+
- [ ] Review client requirements and configuration
|
|
24
|
+
- [ ] Set up development environment
|
|
25
|
+
- [ ] Understand entity relationships and business logic
|
|
26
|
+
- [ ] Review existing codebase and patterns
|
|
27
|
+
|
|
28
|
+
### During Development
|
|
29
|
+
|
|
30
|
+
- [ ] Follow coding standards and naming conventions
|
|
31
|
+
- [ ] Write comprehensive unit tests
|
|
32
|
+
- [ ] Document all public APIs and complex logic
|
|
33
|
+
- [ ] Use the entity generator for new entities
|
|
34
|
+
- [ ] Implement proper error handling and logging
|
|
35
|
+
|
|
36
|
+
### Before Code Review
|
|
37
|
+
|
|
38
|
+
- [ ] Run all quality checks: `npm run quality`
|
|
39
|
+
- [ ] Ensure all tests pass
|
|
40
|
+
- [ ] Update documentation if needed
|
|
41
|
+
- [ ] Test in development environment
|
|
42
|
+
- [ ] Verify client-specific requirements are met
|
|
43
|
+
|
|
44
|
+
### Before Deployment
|
|
45
|
+
|
|
46
|
+
- [ ] Complete code review process
|
|
47
|
+
- [ ] Verify deployment checklist
|
|
48
|
+
- [ ] Test in staging environment
|
|
49
|
+
- [ ] Get client approval
|
|
50
|
+
- [ ] Execute deployment plan
|
|
51
|
+
|
|
52
|
+
## Tools and Automation
|
|
53
|
+
|
|
54
|
+
### Available Scripts
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Quality checks
|
|
58
|
+
npm run quality # Run all quality checks
|
|
59
|
+
npm run lint # Code linting
|
|
60
|
+
npm run typecheck # TypeScript type checking
|
|
61
|
+
npm run test # Run unit tests
|
|
62
|
+
|
|
63
|
+
# Code generation
|
|
64
|
+
npm run generate:entity -- --entity customentity --display-name "Custom Entity"
|
|
65
|
+
|
|
66
|
+
# Building
|
|
67
|
+
npm run build:dev # Development build
|
|
68
|
+
npm run build:prod # Production build
|
|
69
|
+
npm run build:d365 # Dynamics 365 optimized build
|
|
70
|
+
|
|
71
|
+
# Development
|
|
72
|
+
npm run start # Start development server
|
|
73
|
+
npm run dev # Development mode with hot reload
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Automated Quality Gates
|
|
77
|
+
|
|
78
|
+
All projects include automated quality gates:
|
|
79
|
+
|
|
80
|
+
- **ESLint** - Code style and potential error detection
|
|
81
|
+
- **TypeScript** - Type safety and compile-time error checking
|
|
82
|
+
- **Prettier** - Code formatting consistency
|
|
83
|
+
- **Jest** - Unit testing framework
|
|
84
|
+
- **Husky** - Git hooks for pre-commit quality checks
|
|
85
|
+
|
|
86
|
+
## Team Structure
|
|
87
|
+
|
|
88
|
+
### Roles and Responsibilities
|
|
89
|
+
|
|
90
|
+
**Technical Lead**
|
|
91
|
+
|
|
92
|
+
- Architecture decisions
|
|
93
|
+
- Code review oversight
|
|
94
|
+
- Client technical discussions
|
|
95
|
+
- Team mentoring
|
|
96
|
+
|
|
97
|
+
**Senior Developers**
|
|
98
|
+
|
|
99
|
+
- Feature implementation
|
|
100
|
+
- Code reviews
|
|
101
|
+
- Junior developer mentoring
|
|
102
|
+
- Technical documentation
|
|
103
|
+
|
|
104
|
+
**Developers**
|
|
105
|
+
|
|
106
|
+
- Feature development
|
|
107
|
+
- Unit testing
|
|
108
|
+
- Bug fixes
|
|
109
|
+
- Documentation updates
|
|
110
|
+
|
|
111
|
+
**QA Engineer**
|
|
112
|
+
|
|
113
|
+
- Test plan creation
|
|
114
|
+
- Manual testing
|
|
115
|
+
- Automated test development
|
|
116
|
+
- Client acceptance testing
|
|
117
|
+
|
|
118
|
+
**DevOps Engineer**
|
|
119
|
+
|
|
120
|
+
- Deployment automation
|
|
121
|
+
- Environment management
|
|
122
|
+
- CI/CD pipeline maintenance
|
|
123
|
+
- Infrastructure monitoring
|
|
124
|
+
|
|
125
|
+
## Communication Standards
|
|
126
|
+
|
|
127
|
+
### Daily Standups
|
|
128
|
+
|
|
129
|
+
- Progress since last standup
|
|
130
|
+
- Plans for today
|
|
131
|
+
- Any blockers or issues
|
|
132
|
+
- Client-specific updates
|
|
133
|
+
|
|
134
|
+
### Code Reviews
|
|
135
|
+
|
|
136
|
+
- All code must be reviewed by at least one senior developer
|
|
137
|
+
- Use GitHub pull request process
|
|
138
|
+
- Follow code review checklist
|
|
139
|
+
- Provide constructive feedback
|
|
140
|
+
|
|
141
|
+
### Client Communication
|
|
142
|
+
|
|
143
|
+
- Weekly status updates
|
|
144
|
+
- Demo sessions for new features
|
|
145
|
+
- Issue escalation procedures
|
|
146
|
+
- Change request processes
|
|
147
|
+
|
|
148
|
+
## Emergency Procedures
|
|
149
|
+
|
|
150
|
+
### Production Issues
|
|
151
|
+
|
|
152
|
+
1. Immediately notify Technical Lead
|
|
153
|
+
2. Create incident ticket
|
|
154
|
+
3. Assess impact and severity
|
|
155
|
+
4. Implement hotfix if needed
|
|
156
|
+
5. Communicate with client
|
|
157
|
+
6. Post-incident review
|
|
158
|
+
|
|
159
|
+
### Data Loss Prevention
|
|
160
|
+
|
|
161
|
+
- Daily automated backups
|
|
162
|
+
- Point-in-time recovery capability
|
|
163
|
+
- Data validation procedures
|
|
164
|
+
- Access control and audit logging
|
|
165
|
+
|
|
166
|
+
## Training and Development
|
|
167
|
+
|
|
168
|
+
### New Team Member Onboarding
|
|
169
|
+
|
|
170
|
+
1. Environment setup and access
|
|
171
|
+
2. Codebase walkthrough
|
|
172
|
+
3. Client background and requirements
|
|
173
|
+
4. Pair programming session
|
|
174
|
+
5. First feature assignment with mentoring
|
|
175
|
+
|
|
176
|
+
### Continuous Learning
|
|
177
|
+
|
|
178
|
+
- Monthly tech talks
|
|
179
|
+
- Code kata sessions
|
|
180
|
+
- Conference attendance budget
|
|
181
|
+
- Certification support
|
|
182
|
+
- Knowledge sharing sessions
|
|
183
|
+
|
|
184
|
+
## Metrics and KPIs
|
|
185
|
+
|
|
186
|
+
### Code Quality Metrics
|
|
187
|
+
|
|
188
|
+
- Code coverage percentage (target: >80%)
|
|
189
|
+
- Technical debt ratio
|
|
190
|
+
- Bug report rate
|
|
191
|
+
- Code review cycle time
|
|
192
|
+
|
|
193
|
+
### Client Satisfaction Metrics
|
|
194
|
+
|
|
195
|
+
- Feature delivery on time
|
|
196
|
+
- Bug resolution time
|
|
197
|
+
- Client feedback scores
|
|
198
|
+
- Change request turnaround
|
|
199
|
+
|
|
200
|
+
### Team Performance Metrics
|
|
201
|
+
|
|
202
|
+
- Sprint velocity
|
|
203
|
+
- Burndown accuracy
|
|
204
|
+
- Code review participation
|
|
205
|
+
- Knowledge sharing activities
|
|
206
|
+
|
|
207
|
+
## Resources
|
|
208
|
+
|
|
209
|
+
### Internal Resources
|
|
210
|
+
|
|
211
|
+
- [Internal Wiki](https://wiki.company.com/dynamics365)
|
|
212
|
+
- [Code Templates](https://github.com/company/dynamics-templates)
|
|
213
|
+
- [Best Practices Repository](https://github.com/company/best-practices)
|
|
214
|
+
|
|
215
|
+
### External Resources
|
|
216
|
+
|
|
217
|
+
- [Microsoft Dynamics 365 Documentation](https://docs.microsoft.com/dynamics365/)
|
|
218
|
+
- [Power Platform Documentation](https://docs.microsoft.com/power-platform/)
|
|
219
|
+
- [TypeScript Documentation](https://www.typescriptlang.org/docs/)
|
|
220
|
+
- [React Documentation](https://reactjs.org/docs/)
|
|
221
|
+
- [Fluent UI Documentation](https://developer.microsoft.com/fluentui/)
|
|
222
|
+
|
|
223
|
+
## Getting Help
|
|
224
|
+
|
|
225
|
+
### Technical Issues
|
|
226
|
+
|
|
227
|
+
1. Check documentation and existing solutions
|
|
228
|
+
2. Ask team members in Slack
|
|
229
|
+
3. Escalate to Technical Lead if needed
|
|
230
|
+
4. Create knowledge base entry for solution
|
|
231
|
+
|
|
232
|
+
### Client Issues
|
|
233
|
+
|
|
234
|
+
1. Review client requirements and SOW
|
|
235
|
+
2. Discuss with Account Manager
|
|
236
|
+
3. Schedule client meeting if needed
|
|
237
|
+
4. Document resolution for future reference
|
|
238
|
+
|
|
239
|
+
## Version Control
|
|
240
|
+
|
|
241
|
+
### Branch Naming
|
|
242
|
+
|
|
243
|
+
- `feature/client-feature-name` - New features
|
|
244
|
+
- `bugfix/issue-description` - Bug fixes
|
|
245
|
+
- `hotfix/critical-issue` - Emergency fixes
|
|
246
|
+
- `release/version-number` - Release branches
|
|
247
|
+
|
|
248
|
+
### Commit Messages
|
|
249
|
+
|
|
250
|
+
Follow conventional commit format:
|
|
251
|
+
|
|
252
|
+
```
|
|
253
|
+
type(scope): description
|
|
254
|
+
|
|
255
|
+
Examples:
|
|
256
|
+
feat(entities): add Opportunity entity with validation
|
|
257
|
+
fix(auth): resolve token refresh issue
|
|
258
|
+
docs(readme): update deployment instructions
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Release Process
|
|
262
|
+
|
|
263
|
+
1. Create release branch
|
|
264
|
+
2. Update version numbers
|
|
265
|
+
3. Generate changelog
|
|
266
|
+
4. Test in staging environment
|
|
267
|
+
5. Deploy to production
|
|
268
|
+
6. Tag release
|
|
269
|
+
7. Merge to main branch
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
For questions about these standards, contact the Technical Lead or refer to the team wiki.
|