Skip to content

Commit b90c3f7

Browse files
committed
fix retrieve log file cmd not working
Caused by the minification step and dynamic imports but the easiest fix is to remove the dynamic imports. Dev and test is done on un minified code which is why it was not spotted.
1 parent 6a82a8f commit b90c3f7

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

lana/src/salesforce/logs/GetLogFile.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
* Copyright (c) 2020 Certinia Inc. All rights reserved.
33
*/
44

5+
import { AuthHelper } from '@apexdevtools/sfdx-auth-helper';
6+
import { LogService } from '@salesforce/apex-node';
7+
58
export class GetLogFile {
69
static async apply(wsPath: string, logDir: string, logId: string): Promise<void> {
7-
// eslint-disable-next-line @typescript-eslint/naming-convention
8-
const { AuthHelper } = await import('@apexdevtools/sfdx-auth-helper');
910
const ah = await AuthHelper.instance(wsPath);
1011
const connection = await ah.connect(await ah.getDefaultUsername());
1112

1213
if (connection) {
13-
// eslint-disable-next-line @typescript-eslint/naming-convention
14-
const { LogService } = await import('@salesforce/apex-node');
1514
await new LogService(connection).getLogs({ logId: logId, outputDir: logDir });
1615
}
1716
return new Promise((resolve) => resolve());

lana/src/salesforce/logs/GetLogFiles.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
/*
22
* Copyright (c) 2020 Certinia Inc. All rights reserved.
33
*/
4-
import { type LogRecord } from '@salesforce/apex-node';
4+
import { AuthHelper } from '@apexdevtools/sfdx-auth-helper';
5+
import { LogService, type LogRecord } from '@salesforce/apex-node';
56

67
export class GetLogFiles {
78
static async apply(wsPath: string): Promise<LogRecord[]> {
8-
// eslint-disable-next-line @typescript-eslint/naming-convention
9-
const { AuthHelper } = await import('@apexdevtools/sfdx-auth-helper');
109
const ah = await AuthHelper.instance(wsPath);
1110
const connection = await ah.connect(await ah.getDefaultUsername());
1211

1312
if (connection) {
14-
// eslint-disable-next-line @typescript-eslint/naming-convention
15-
const { LogService } = await import('@salesforce/apex-node');
1613
return new LogService(connection).getLogRecords();
1714
}
1815
return [];

rollup.config.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ export default [
2020
input: './lana/src/Main.ts',
2121
output: {
2222
format: 'cjs',
23-
dir: './lana/out',
24-
chunkFileNames: '[name].js',
23+
file: './lana/out/Main.js',
2524
sourcemap: false,
2625
},
2726
external: ['vscode'],

0 commit comments

Comments
 (0)