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
2 changes: 1 addition & 1 deletion apps/cli/lib/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function archiveSiteContent(
const archiveBuilder = archiver( 'zip', {
zlib: { level: ZIP_COMPRESSION_LEVEL },
followSymlinks: true,
} );
} as archiver.ArchiverOptions );

output.on( 'close', () => {
resolve( archiveBuilder );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class DefaultExporter extends EventEmitter implements Exporter {
this.emit( ExportEvents.BACKUP_CREATE_START );
const isZip = this.options.backupFile.endsWith( '.zip' );
const format = isZip ? 'zip' : 'tar';
return archiver( format, ARCHIVER_OPTIONS[ format ] );
return archiver( format, ARCHIVER_OPTIONS[ format ] as archiver.ArchiverOptions );
}

private setupArchiveListeners( output: fs.WriteStream ): Promise< void > {
Expand Down
4 changes: 2 additions & 2 deletions apps/cli/lib/import-export/export/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SiteData } from 'cli/lib/cli-config/core';
import type { ProgressData } from 'archiver';
import type archiver from 'archiver';
import type { EventEmitter } from 'events';

export interface ExportOptions {
Expand All @@ -24,7 +24,7 @@ export interface Exporter extends Partial< EventEmitter > {
}

export interface BackupCreateProgressEventData {
progress: ProgressData;
progress: archiver.ProgressData;
}

export type NewExporter = new ( options: ExportOptions ) => Exporter;
Expand Down
4 changes: 2 additions & 2 deletions apps/cli/lib/tests/archive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ describe( 'Archive Module', () => {
vi.clearAllMocks();
mockArchiver = createMockArchiver();
mockWriteStream = createMockWriteStream();
vi.mocked( archiver ).mockReturnValue(
mockArchiver as unknown as ReturnType< typeof archiver >
vi.mocked( archiver as unknown as ( ...args: unknown[] ) => unknown ).mockReturnValue(
mockArchiver
);
vi.mocked( fs.createWriteStream ).mockReturnValue(
mockWriteStream as unknown as ReturnType< typeof fs.createWriteStream >
Expand Down
4 changes: 2 additions & 2 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@wp-playground/common": "3.1.18",
"@wp-playground/storage": "3.1.18",
"@wp-playground/wordpress": "3.1.18",
"archiver": "^6.0.2",
"archiver": "^7.0.1",
"atomically": "^2.1.1",
"chalk": "^5.6.2",
"cli-table3": "^0.6.5",
Expand Down Expand Up @@ -68,7 +68,7 @@
},
"devDependencies": {
"@studio/common": "file:../../tools/common",
"@types/archiver": "^6.0.4",
"@types/archiver": "^7.0.0",
"@types/http-proxy": "^1.17.17",
"@types/node-forge": "^1.3.14",
"@types/yargs": "^17.0.35",
Expand Down
4 changes: 2 additions & 2 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^11.4.0",
"@wordpress/react-i18n": "^4.41.0",
"archiver": "^6.0.2",
"archiver": "^7.0.1",
"atomically": "^2.1.0",
"cli-table3": "^0.6.5",
"compressible": "2.0.18",
Expand Down Expand Up @@ -86,7 +86,7 @@
"@electron-forge/maker-zip": "^7.11.1",
"@electron-forge/plugin-auto-unpack-natives": "^7.11.1",
"@sentry/vite-plugin": "^5.1.1",
"@types/archiver": "^6.0.4",
"@types/archiver": "^7.0.0",
"@types/follow-redirects": "^1.14.4",
"@types/fs-extra": "^11.0.4",
"@types/http-proxy": "^1.17.17",
Expand Down
12 changes: 0 additions & 12 deletions apps/studio/patches/@types+archiver+6.0.4.patch

This file was deleted.

14 changes: 0 additions & 14 deletions apps/studio/patches/archiver+6.0.2.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class DefaultExporter extends EventEmitter implements Exporter {
this.emit( ExportEvents.BACKUP_CREATE_START );
const isZip = this.options.backupFile.endsWith( '.zip' );
const format = isZip ? 'zip' : 'tar';
return archiver( format, ARCHIVER_OPTIONS[ format ] );
return archiver( format, ARCHIVER_OPTIONS[ format ] as archiver.ArchiverOptions );
}

private setupArchiveListeners( output: fs.WriteStream ): Promise< void > {
Expand Down
4 changes: 2 additions & 2 deletions apps/studio/src/lib/import-export/export/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ProgressData } from 'archiver';
import type archiver from 'archiver';
import type { EventEmitter } from 'events';

export interface ExportOptions {
Expand All @@ -23,7 +23,7 @@ export interface Exporter extends Partial< EventEmitter > {
}

export interface BackupCreateProgressEventData {
progress: ProgressData;
progress: archiver.ProgressData;
}

export type NewExporter = new ( options: ExportOptions ) => Exporter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ platformTestSuite( 'DefaultExporter', ( { normalize } ) => {
} );

mockArchiver = createMockArchiver();
( archiver as MockedFunction< typeof archiver > ).mockReturnValue(
mockArchiver as unknown as archiver.Archiver
( archiver as unknown as MockedFunction< ( ...args: unknown[] ) => unknown > ).mockReturnValue(
mockArchiver
);
mockWriteStream = {
on: vi.fn(),
Expand Down
Loading
Loading