Skip to content

Commit 471de26

Browse files
committed
fix: addressed more comments
1 parent a3b6211 commit 471de26

File tree

5 files changed

+27
-14
lines changed

5 files changed

+27
-14
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,14 @@ OPTIONS
168168
os (OmniScripts), fc (FlexCards)
169169
170170
--relatedobjects=relatedobjects specify related objects to assess:
171-
'apex' for Apex classes
172-
```
171+
'apex' for Apex classes
172+
'lwc' for LWC (Lightning Web Components)
173+
'expsites' for Experience Sites
174+
'flexipage' for Lightning record pages
173175
174-
> **Note:** LWC (Lightning Web Components) assessment/migration functionality is temporarily disabled in the current version. LWC features will be re-enabled in a future releases.
176+
```
175177

176-
> Apex migration functionality remains fully available. The `--relatedobjects` flag only accepts values ('apex')
178+
> **Note:** LWC migration auto-deployment needs minimum node version of 18.17.1
177179
178180
Terms:
179181
Notwithstanding anything stated in the terms and conditions agreed between Salesforce (‘SFDC’) and you (‘Customer’), the use of the OmniStudio Migration Assistant (‘Assistant’) is designed to facilitate the migration and it’s going to modify your custom code and by deploying and using the Assistant you hereby provide your consent to automate the migration process and enable a smooth transition. Customer shall access and use the Assistant only as permitted to the Customer and shall not compromise, break or circumvent any technical processes or security measures associated with the services provided by SFDC.

src/commands/omnistudio/migration/migrate.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,16 @@ export default class Migrate extends OmniStudioBaseCommand {
135135
const preMigrate: PreMigrate = new PreMigrate(namespace, conn, this.logger, messages, this.ux);
136136
const isExperienceBundleMetadataAPIProgramaticallyEnabled: { value: boolean } = { value: false };
137137

138+
let actionItems = [];
139+
138140
let deploymentConfig = { autoDeploy: false, authKey: undefined };
139141
if (relatedObjects) {
140142
const relatedObjectMigrationResult = await this.migrateRelatedObjects(
141143
relatedObjects,
142144
preMigrate,
143145
conn,
144-
isExperienceBundleMetadataAPIProgramaticallyEnabled
146+
isExperienceBundleMetadataAPIProgramaticallyEnabled,
147+
actionItems
145148
);
146149
objectsToProcess = relatedObjectMigrationResult.objectsToProcess;
147150
projectPath = relatedObjectMigrationResult.projectPath;
@@ -183,7 +186,7 @@ export default class Migrate extends OmniStudioBaseCommand {
183186
const relatedObjectMigrationResult = omnistudioRelatedObjectsMigration.migrateAll(objectsToProcess);
184187

185188
// POST MIGRATION
186-
let actionItems = [];
189+
187190
const postMigrate: PostMigrate = new PostMigrate(
188191
this.org,
189192
namespace,
@@ -241,7 +244,8 @@ export default class Migrate extends OmniStudioBaseCommand {
241244
relatedObjects: string,
242245
preMigrate: PreMigrate,
243246
conn: Connection,
244-
isExperienceBundleMetadataAPIProgramaticallyEnabled: { value: boolean }
247+
isExperienceBundleMetadataAPIProgramaticallyEnabled: { value: boolean },
248+
actionItems: string[]
245249
): Promise<{
246250
objectsToProcess: string[];
247251
projectPath: string;
@@ -272,7 +276,7 @@ export default class Migrate extends OmniStudioBaseCommand {
272276
conn,
273277
isExperienceBundleMetadataAPIProgramaticallyEnabled
274278
);
275-
deploymentConfig = await preMigrate.getAutoDeployConsent(objectsToProcess.includes(Constants.LWC));
279+
deploymentConfig = await preMigrate.getAutoDeployConsent(objectsToProcess.includes(Constants.LWC), actionItems);
276280
Logger.logVerbose(
277281
'The objects to process after handleExpSitePrerequisite are ' + JSON.stringify(objectsToProcess)
278282
);

src/migration/deployer.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { Logger } from '../utils/logger';
77
export class Deployer {
88
private readonly projectPath: string;
99
private readonly authKey: string;
10-
private readonly requiredNodeDependency = '@omnistudio/[email protected]';
10+
private readonly omniscriptCustomizationPackage = '@omnistudio/omniscript_customization';
11+
private readonly omniscriptCustomizationPackageVersion = '250.0.0';
1112
private readonly username: string;
1213
private readonly messages: Messages;
1314

@@ -26,7 +27,9 @@ export class Deployer {
2627
sfProject.createNPMConfigFile(this.authKey);
2728
Logger.logVerbose(this.messages.getMessage('installingRequiredDependencies'));
2829
sfProject.installDependency();
29-
sfProject.installDependency(this.requiredNodeDependency);
30+
sfProject.installDependency(
31+
`${this.omniscriptCustomizationPackage}@${this.omniscriptCustomizationPackageVersion}`
32+
);
3033
}
3134
Logger.log(path.join(pwd.toString(), 'package.xml'));
3235
sfProject.deployFromManifest(path.join(pwd.toString(), 'package.xml'), this.username);

src/migration/premigrate.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export class PreMigrate extends BaseMigrationTool {
5454
}
5555

5656
public async getAutoDeployConsent(
57-
includeLwc: boolean
57+
includeLwc: boolean,
58+
actionItems: string[]
5859
): Promise<{ autoDeploy: boolean; authKey: string | undefined }> {
5960
const askWithTimeOut = PromptUtil.askWithTimeOut(this.messages);
6061
let validResponse = false;
@@ -91,6 +92,7 @@ export class PreMigrate extends BaseMigrationTool {
9192
deploymentConfig.authKey = process.env[authEnvKey];
9293
if (!deploymentConfig.authKey) {
9394
Logger.warn(this.messages.getMessage('authKeyEnvVarNotSet'));
95+
actionItems.push(this.messages.getMessage('authKeyEnvVarNotSet'));
9496
}
9597
}
9698

test/migration/deployer.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ describe('Deployer', () => {
6060
expect((deployer as any).username).to.equal(testUsername);
6161
expect((deployer as any).authKey).to.equal(testAuthKey);
6262
expect((deployer as any).messages).to.equal(messages);
63-
expect((deployer as any).requiredNodeDependency).to.equal('@omnistudio/[email protected]');
63+
expect((deployer as any).omniscriptCustomizationPackage).to.equal('@omnistudio/omniscript_customization');
64+
expect((deployer as any).omniscriptCustomizationPackageVersion).to.equal('250.0.0');
6465
});
6566
});
6667

@@ -134,8 +135,9 @@ describe('Deployer', () => {
134135
});
135136

136137
describe('private properties', () => {
137-
it('should have correct requiredNodeDependency', () => {
138-
expect((deployer as any).requiredNodeDependency).to.equal('@omnistudio/[email protected]');
138+
it('should have correct omniscript customization package properties', () => {
139+
expect((deployer as any).omniscriptCustomizationPackage).to.equal('@omnistudio/omniscript_customization');
140+
expect((deployer as any).omniscriptCustomizationPackageVersion).to.equal('250.0.0');
139141
});
140142
});
141143

0 commit comments

Comments
 (0)