Skip to content

Commit ebdff15

Browse files
chore: revert caching to see if it fixes NUT
1 parent 42a9c8d commit ebdff15

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

Diff for: src/resolve/sourceComponent.ts

+6-9
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export class SourceComponent implements MetadataComponent {
5454
private markedForDelete = false;
5555
private destructiveChangesType?: DestructiveChangesType;
5656
private pathContentMap = new Map<string, string>();
57-
private calculatedContent: string[] = [];
5857

5958
public constructor(
6059
props: ComponentProperties,
@@ -147,17 +146,15 @@ export class SourceComponent implements MetadataComponent {
147146
}
148147

149148
public walkContent(): string[] {
150-
if (!this.calculatedContent.length) {
151-
if (this.content) {
152-
for (const fsPath of this.walk(this.content)) {
153-
if (fsPath !== this.xml) {
154-
this.calculatedContent.push(fsPath);
155-
}
149+
const sources: string[] = [];
150+
if (this.content) {
151+
for (const fsPath of this.walk(this.content)) {
152+
if (fsPath !== this.xml) {
153+
sources.push(fsPath);
156154
}
157155
}
158156
}
159-
160-
return this.calculatedContent;
157+
return sources;
161158
}
162159
/**
163160
* returns the children of a parent SourceComponent

Diff for: test/resolve/adapters/bundleSourceAdapter.test.ts

-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ import { CONTENT_PATH as LWC_CONTENT_PATH } from '../../mock/type-constants/lwcB
1313
import { RegistryAccess } from '../../../src';
1414

1515
describe('BundleSourceAdapter with AuraBundle', () => {
16-
beforeEach(() => {
17-
// @ts-ignore reset cache
18-
bundle.COMPONENT.calculatedContent = [];
19-
// @ts-ignore reset cache
20-
lwcBundle.COMPONENT.calculatedContent = [];
21-
});
2216
const registryAccess = new RegistryAccess();
2317
const adapter = new BundleSourceAdapter(bundle.COMPONENT.type, registryAccess, undefined, bundle.COMPONENT.tree);
2418

0 commit comments

Comments
 (0)