Skip to content

Commit

Permalink
fix: remove 0. for mobile launch params (#107)
Browse files Browse the repository at this point in the history
* fix: remove 0. for mobile launch params

* ci: Move UT_DISABLE_NODE_CURRENT from env to var
  • Loading branch information
maliroteh-sf authored Jul 26, 2024
1 parent b71f788 commit 6206030
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
branches-ignore: [main]
workflow_dispatch:

env:
UT_DISABLE_NODE_CURRENT: true

jobs:
yarn-lockfile-check:
uses: salesforcecli/github-workflows/.github/workflows/lockFileCheck.yml@main
Expand Down
2 changes: 1 addition & 1 deletion src/shared/configUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ConfigUtils {
}

public static async getCertData(): Promise<SSLCertificateData | undefined> {
const config = await this.getLocalConfig();
const config = await this.getGlobalConfig();
const serializedData = config.get(ConfigVars.LOCAL_DEV_SERVER_HTTPS_CERT_DATA) as SerializedSSLCertificateData;
if (serializedData) {
const deserializedData: SSLCertificateData = {
Expand Down
18 changes: 8 additions & 10 deletions src/shared/previewUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ export class PreviewUtils {
launchArguments.push({ name: 'LightningExperienceAppID', value: appId });
}

launchArguments.push({ name: '0.aura.ldpServerUrl', value: ldpServerUrl });
launchArguments.push({ name: 'aura.ldpServerUrl', value: ldpServerUrl });

launchArguments.push({ name: '0.aura.mode', value: auraMode });
launchArguments.push({ name: 'aura.mode', value: auraMode });

launchArguments.push({ name: '0.aura.ldpServerId', value: entityId });
launchArguments.push({ name: 'aura.ldpServerId', value: entityId });

return launchArguments;
}
Expand Down Expand Up @@ -255,13 +255,11 @@ export class PreviewUtils {
const targetFile =
platform === Platform.ios ? path.join(basePath, 'localhost.der') : path.join(basePath, 'localhost.pem');

// If we have not previously generated the cert files then go ahead and do so
if (!fs.existsSync(targetFile)) {
if (platform === Platform.ios) {
fs.writeFileSync(targetFile, data.derCertificate);
} else {
fs.writeFileSync(targetFile, data.pemCertificate);
}
// save to file
if (platform === Platform.ios) {
fs.writeFileSync(targetFile, data.derCertificate);
} else {
fs.writeFileSync(targetFile, data.pemCertificate);
}

return { certData: data, certFilePath: targetFile };
Expand Down
12 changes: 6 additions & 6 deletions test/shared/previewUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ describe('previewUtils', () => {
).to.deep.equal([
{ name: 'LightningExperienceAppName', value: 'MyAppName' },
{ name: 'LightningExperienceAppID', value: 'MyAppId' },
{ name: '0.aura.ldpServerUrl', value: 'MyLdpServerUrl' },
{ name: '0.aura.mode', value: 'MyAuraMode' },
{ name: '0.aura.ldpServerId', value: fakeEntityId },
{ name: 'aura.ldpServerUrl', value: 'MyLdpServerUrl' },
{ name: 'aura.mode', value: 'MyAuraMode' },
{ name: 'aura.ldpServerId', value: fakeEntityId },
]);

expect(PreviewUtils.generateMobileAppPreviewLaunchArguments('MyLdpServerUrl', fakeEntityId)).to.deep.equal([
{ name: '0.aura.ldpServerUrl', value: 'MyLdpServerUrl' },
{ name: '0.aura.mode', value: 'DEVPREVIEW' },
{ name: '0.aura.ldpServerId', value: fakeEntityId },
{ name: 'aura.ldpServerUrl', value: 'MyLdpServerUrl' },
{ name: 'aura.mode', value: 'DEVPREVIEW' },
{ name: 'aura.ldpServerId', value: fakeEntityId },
]);
});

Expand Down

0 comments on commit 6206030

Please sign in to comment.