Merge branch 'feat/uploadingtoS3' of https://github.com/vidhanshah/keyboard-nav-techdocs into feat/uploadingtoS3

This commit is contained in:
Vidhan Shah
2025-11-08 08:02:11 +05:30
3752 changed files with 234385 additions and 87261 deletions
+4 -1
View File
@@ -113,9 +113,12 @@ describe('parseReferenceAnnotation', () => {
});
it('should throw error without annotation', () => {
const logMsgRegex = new RegExp(
`No ${TECHDOCS_ANNOTATION} annotation provided`,
);
expect(() => {
parseReferenceAnnotation(TECHDOCS_ANNOTATION, entityBase);
}).toThrow(/No location annotation/);
}).toThrow(logMsgRegex);
});
it('should throw error with bad annotation', () => {
+1 -1
View File
@@ -52,7 +52,7 @@ export const parseReferenceAnnotation = (
const annotation = entity.metadata.annotations?.[annotationName];
if (!annotation) {
throw new InputError(
`No location annotation provided in entity: ${entity.metadata.name}`,
`No ${annotationName} annotation provided in entity: ${entity.metadata.name}`,
);
}
@@ -129,7 +129,13 @@ export const getRepoUrlFromLocationAnnotation = (
};
class UnknownTag {
constructor(public readonly data: any, public readonly type?: string) {}
public readonly data: any;
public readonly type?: string;
constructor(data: any, type?: string) {
this.data = data;
this.type = type;
}
}
export const MKDOCS_SCHEMA = DEFAULT_SCHEMA.extend([
@@ -39,7 +39,11 @@ jest.mock('@azure/identity', () => ({
jest.mock('@azure/storage-blob', () => {
class BlockBlobClient {
constructor(private readonly blobName: string) {}
private readonly blobName: string;
constructor(blobName: string) {
this.blobName = blobName;
}
uploadFile(source: string): Promise<BlobUploadCommonResponse> {
mockDir.addContent({
@@ -117,7 +121,11 @@ jest.mock('@azure/storage-blob', () => {
}
class ContainerClient {
constructor(private readonly containerName: string) {}
private readonly containerName: string;
constructor(containerName: string) {
this.containerName = containerName;
}
getProperties(): Promise<ContainerGetPropertiesResponse> {
return Promise.resolve({
@@ -173,10 +181,13 @@ jest.mock('@azure/storage-blob', () => {
}
class BlobServiceClient {
constructor(
public readonly url: string,
private readonly credential?: StorageSharedKeyCredential,
) {}
public readonly url: string;
private readonly credential?: StorageSharedKeyCredential;
constructor(url: string, credential?: StorageSharedKeyCredential) {
this.url = url;
this.credential = credential;
}
getContainerClient(containerName: string) {
if (containerName === 'bad_container') {
@@ -34,7 +34,11 @@ let createdStorageOptions: Array<StorageOptions | undefined> = [];
jest.mock('@google-cloud/storage', () => {
class GCSFile {
constructor(private readonly filePath: string) {}
private readonly filePath: string;
constructor(filePath: string) {
this.filePath = filePath;
}
exists() {
return new Promise(async (resolve, reject) => {
@@ -77,7 +81,11 @@ jest.mock('@google-cloud/storage', () => {
}
class Bucket {
constructor(private readonly bucketName: string) {}
private readonly bucketName: string;
constructor(bucketName: string) {
this.bucketName = bucketName;
}
async getMetadata() {
if (this.bucketName === 'bad_bucket_name') {
@@ -121,7 +129,10 @@ jest.mock('@google-cloud/storage', () => {
}
class Storage {
constructor(readonly options?: StorageOptions) {
readonly options?: StorageOptions;
constructor(options?: StorageOptions) {
this.options = options;
createdStorageOptions.push(options);
}