Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ _backup_*
contents/
logs/
oclif.manifest.json
talisman_output.log
4 changes: 3 additions & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ fileignoreconfig:
- filename: snyk_output.log
checksum: dfa9dc093345f006cc3fb107b8495fcbe79c524db51f44c08d959c656bedf2f7
- filename: talisman_output.log
checksum: 50a8928e551f9092dafcf50f531c926ac00e2846c564aafaaab70c1ecaa19490
checksum: d18cb2591eb650ebb3a2d5eb84f57c8f0891cef1987b2a420ab7e29dbe2782a0
- filename: package-lock.json
checksum: 803054eadb6cf0cb4362a175b268ae2d8cbdb2ffc5cbf978d944b4db04a4a562
version: '1.0'
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions src/core/query-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,17 @@ export class QueryExporter {
const exportedContentTypeUIDs: Set<string> = new Set();

// Step 1: Read initial content types and mark them as exported
const contentTypesFilePath = path.join(this.exportQueryConfig.exportDir, 'content_types', 'schema.json');
const contentTypes: any = fsUtil.readFile(sanitizePath(contentTypesFilePath));
// contentTypes.forEach((ct: any) => exportedContentTypeUIDs.add(ct.uid));
const contentTypesFilePath = path.join(
this.exportQueryConfig.exportDir,
this.exportQueryConfig.branchName || '',
'content_types',
'schema.json',
);
const contentTypes: any = fsUtil.readFile(sanitizePath(contentTypesFilePath)) || [];
if (contentTypes.length === 0) {
log(this.exportQueryConfig, 'No content types found, skipping referenced content types export', 'info');
return;
}

// Step 2: Start with initial batch (all currently exported content types)
let currentBatch = [...contentTypes];
Expand Down
2 changes: 0 additions & 2 deletions src/utils/content-type-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import { log } from './logger';

export class ReferencedContentTypesHandler {
private exportQueryConfig: QueryExportConfig;
private contentTypesDir: string;

constructor(exportQueryConfig: QueryExportConfig) {
this.exportQueryConfig = exportQueryConfig;
this.contentTypesDir = path.join(exportQueryConfig.exportDir, 'content-types');
}

/**
Expand Down
18 changes: 16 additions & 2 deletions src/utils/dependency-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,22 @@ export class ContentTypeDependenciesHandler {
taxonomies: Set<string>;
marketplaceApps: Set<string>;
}> {
const contentTypesFilePath = path.join(this.exportQueryConfig.exportDir, 'content_types', 'schema.json');
const allContentTypes = fsUtil.readFile(sanitizePath(contentTypesFilePath)) as any[];
const contentTypesFilePath = path.join(
this.exportQueryConfig.exportDir,
this.exportQueryConfig.branchName || '',
'content_types',
'schema.json',
);
const allContentTypes = (fsUtil.readFile(sanitizePath(contentTypesFilePath)) as any[]) || [];
if (allContentTypes.length === 0) {
log(this.exportQueryConfig, 'No content types found, skipping dependency extraction', 'info');
return {
globalFields: new Set<string>(),
extensions: new Set<string>(),
taxonomies: new Set<string>(),
marketplaceApps: new Set<string>(),
};
}

log(this.exportQueryConfig, `Extracting dependencies from ${allContentTypes.length} content types`, 'info');

Expand Down
2 changes: 1 addition & 1 deletion src/utils/referenced-asset-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class AssetReferenceHandler {

constructor(exportQueryConfig: QueryExportConfig) {
this.exportQueryConfig = exportQueryConfig;
this.entriesDir = path.join(exportQueryConfig.exportDir, 'entries');
this.entriesDir = path.join(exportQueryConfig.exportDir, exportQueryConfig.branchName || '', 'entries');
}

/**
Expand Down