Skip to content

Commit a0f0069

Browse files
Merge pull request certinia#718 from lukecotter/feat-move-log-parser
feat: move log parser to own package
2 parents cf18589 + 3de3b88 commit a0f0069

52 files changed

Lines changed: 152 additions & 68 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

log-viewer/src/__tests__/ApexLogParser.test.ts renamed to apex-log-parser/__tests__/ApexLogParser.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
* Copyright (c) 2020 Certinia Inc. All rights reserved.
33
*/
44
import {
5+
ApexLogParser,
56
CodeUnitStartedLine,
67
ExecutionStartedLine,
8+
lineTypeMap,
79
LogEvent,
810
MethodEntryLine,
9-
SOQLExecuteBeginLine,
10-
SOQLExecuteExplainLine,
11+
parse,
1112
parseObjectNamespace,
1213
parseRows,
1314
parseVfNamespace,
14-
} from '../core/log-parser/LogEvents.js';
15-
import { lineTypeMap } from '../core/log-parser/LogLineMapping.js';
16-
17-
import { ApexLogParser, parse } from '../core/log-parser/ApexLogParser.js';
15+
SOQLExecuteBeginLine,
16+
SOQLExecuteExplainLine,
17+
} from '../src/index.js';
1818

1919
class DummyLine extends LogEvent {
2020
constructor(parser: ApexLogParser, parts: string[]) {

apex-log-parser/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "apex-log-parser",
3+
"version": "0.1.0",
4+
"private": true,
5+
"description": "Apex debug log parser for Salesforce",
6+
"type": "module"
7+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

apex-log-parser/src/index.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2020 Certinia Inc. All rights reserved.
3+
*/
4+
5+
// Parser
6+
export { ApexLogParser, DebugLevel, parse } from './ApexLogParser.js';
7+
8+
// Types
9+
export type {
10+
CPUType,
11+
GovernorLimits,
12+
GovernorSnapshot,
13+
IssueType,
14+
Limits,
15+
LineNumber,
16+
LogEventType,
17+
LogIssue,
18+
LogLineConstructor,
19+
LogSubCategory,
20+
SelfTotal,
21+
} from './types.js';
22+
23+
// Events - classes and utilities used by consumers
24+
export {
25+
ApexLog,
26+
CodeUnitStartedLine,
27+
DMLBeginLine,
28+
ExecutionStartedLine,
29+
LogEvent,
30+
MethodEntryLine,
31+
SOQLExecuteBeginLine,
32+
SOQLExecuteExplainLine,
33+
parseObjectNamespace,
34+
parseRows,
35+
parseVfNamespace,
36+
} from './LogEvents.js';
37+
38+
// Mapping
39+
export { getLogEventClass, lineTypeMap } from './LogLineMapping.js';

apex-log-parser/tsconfig.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"compilerOptions": {
3+
"lib": ["ES2022"],
4+
5+
"outDir": "dist",
6+
"rootDir": "src",
7+
8+
"esModuleInterop": true,
9+
"skipLibCheck": true,
10+
"target": "es2022",
11+
"verbatimModuleSyntax": true,
12+
"allowJs": true,
13+
"resolveJsonModule": true,
14+
"moduleDetection": "force",
15+
16+
"strict": true,
17+
"noUncheckedIndexedAccess": true,
18+
"erasableSyntaxOnly": true,
19+
20+
"moduleResolution": "Bundler",
21+
"module": "ESNext",
22+
"noEmit": true,
23+
"declaration": true,
24+
"declarationMap": true,
25+
26+
"strictFunctionTypes": true,
27+
28+
"allowSyntheticDefaultImports": true,
29+
"experimentalDecorators": true,
30+
"useDefineForClassFields": false,
31+
"forceConsistentCasingInFileNames": true,
32+
"importHelpers": true,
33+
"isolatedModules": true,
34+
"noEmitOnError": true,
35+
"noUnusedLocals": false,
36+
"noUnusedParameters": false,
37+
"removeComments": true,
38+
"sourceMap": false
39+
},
40+
"include": ["./src/**/*.ts"],
41+
"exclude": ["**/node_modules", "**/.*/"]
42+
}

jest.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,19 @@ const defaultConfig = {
2222
/** @type {import('@jest/types').Config.InitialOptions} */
2323
export default {
2424
projects: [
25+
{
26+
...defaultConfig,
27+
displayName: 'apex-log-parser',
28+
rootDir: '<rootDir>/apex-log-parser',
29+
},
2530
{
2631
...defaultConfig,
2732
displayName: 'log-viewer',
2833
rootDir: '<rootDir>/log-viewer',
34+
moduleNameMapper: {
35+
...defaultConfig.moduleNameMapper,
36+
'^apex-log-parser$': '<rootDir>/../apex-log-parser/src/index.ts',
37+
},
2938
transformIgnorePatterns: [
3039
// allow transformation of pixi.js and its dependencies
3140
'<rootDir>/node_modules/(?!pixi\\.js)',

lana-docs-site/docusaurus.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const config: Config = {
140140
{
141141
href: `https://github.com/${organizationName}/${projectName}`,
142142
position: 'right',
143-
'aria-label': 'GitHub Repository',
143+
'aria-label': 'GitHub Repository', // eslint-disable-line @typescript-eslint/naming-convention
144144
className: 'header-github-link',
145145
},
146146
{

0 commit comments

Comments
 (0)