Skip to content

Commit 6e71f03

Browse files
committed
feat: never track utam
1 parent 9b5c073 commit 6e71f03

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/shared/functions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export const getKeyFromObject = (element: RemoteChangeElement | ChangeResult): s
2222
};
2323

2424
export const isBundle = (cmp: SourceComponent): boolean => cmp.type.strategies?.adapter === 'bundle';
25+
export const isLwcLocalOnlyTest = (filePath: string): boolean =>
26+
filePath.includes('__utam__') || filePath.includes('__tests__');
2527

2628
/**
2729
* Verify that a filepath starts exactly with a complete parent path

src/shared/localShadowRepo.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as os from 'os';
1010
import * as fs from 'graceful-fs';
1111
import { NamedPackageDir, Logger, SfError } from '@salesforce/core';
1212
import * as git from 'isomorphic-git';
13-
import { chunkArray, pathIsInFolder } from './functions';
13+
import { chunkArray, isLwcLocalOnlyTest, pathIsInFolder } from './functions';
1414

1515
/** returns the full path to where we store the shadow repo */
1616
const getGitDir = (orgId: string, projectPath: string, useSfdxTrackingFiles = false): string => {
@@ -134,7 +134,7 @@ export class ShadowRepo {
134134
// no hidden files
135135
!f.includes(`${path.sep}.`) &&
136136
// no lwc tests
137-
!f.includes('__tests__') &&
137+
!isLwcLocalOnlyTest(f) &&
138138
// no gitignore files
139139
!f.endsWith('.gitignore') &&
140140
// isogit uses `startsWith` for filepaths so it's possible to get a false positive

src/shared/populateTypesAndNames.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { isString } from '@salesforce/ts-types';
99
import { MetadataResolver, VirtualTreeContainer, ForceIgnore } from '@salesforce/source-deploy-retrieve';
1010
import { ChangeResult } from './types';
1111
import { sourceComponentGuard } from './guards';
12-
import { ensureRelative } from './functions';
12+
import { ensureRelative, isLwcLocalOnlyTest } from './functions';
1313
const logger = Logger.childFromRoot('SourceTracking.PopulateTypesAndNames');
1414

1515
/**
@@ -74,8 +74,8 @@ export const populateTypesAndNames = ({
7474
const filenamesFromMatchingComponent = [matchingComponent.xml, ...matchingComponent.walkContent()];
7575
const ignored = filenamesFromMatchingComponent
7676
.filter(isString)
77-
.filter((filename) => !filename.includes('__tests__'))
78-
.some((filename) => forceIgnore?.denies(filename));
77+
.filter((f) => !isLwcLocalOnlyTest(f))
78+
.some((f) => forceIgnore?.denies(f));
7979
filenamesFromMatchingComponent.map((filename) => {
8080
if (filename && elementMap.has(filename)) {
8181
// add the type/name from the componentSet onto the element

0 commit comments

Comments
 (0)