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
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import type {
import type { ConsoleTerminalProvider } from '@rushstack/terminal/lib/ConsoleTerminalProvider';
import type { ITerminal } from '@rushstack/terminal/lib/ITerminal';

import type { IZipSyncMode, ZipSyncOptionCompression } from './zipSyncUtils';
import { pack, unpack } from './index';
import type { IZipSyncMode, ZipSyncOptionCompression } from '../zipSyncUtils';
import { pack, unpack } from '../index';

export class ZipSyncCommandLineParser extends CommandLineParser {
private readonly _debugParameter: CommandLineFlagParameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`CLI Tool Tests should display help for "zipsync --help" 1`] = `
"
zipsync 0.0.0 - https://rushstack.io
zipsync {version} - https://rushstack.io

usage: zipsync [-h] [-d] [-v] -m {pack,unpack} -a ARCHIVE_PATH -t
TARGET_DIRECTORIES -b BASE_DIR -z {store,deflate,zstd,auto}
Expand Down
17 changes: 17 additions & 0 deletions apps/zipsync/src/cli/test/start.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

import path from 'node:path';
import { execSync } from 'node:child_process';

describe('CLI Tool Tests', () => {
it('should display help for "zipsync --help"', () => {
const packageFolder: string = path.resolve(__dirname, '../../..');
const startOutput = execSync('node lib/start.js --help', { encoding: 'utf-8', cwd: packageFolder });
const normalized = startOutput.replace(
/zipsync \d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)? - https:\/\/rushstack\.io/,
'zipsync {version} - https://rushstack.io'
);
expect(normalized).toMatchSnapshot();
});
});
11 changes: 0 additions & 11 deletions apps/zipsync/src/start.test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion apps/zipsync/src/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ConsoleTerminalProvider } from '@rushstack/terminal/lib/ConsoleTerminal
import { Terminal } from '@rushstack/terminal/lib/Terminal';

import { version } from '../package.json';
import { ZipSyncCommandLineParser } from './ZipSyncCommandLineParser';
import { ZipSyncCommandLineParser } from './cli/ZipSyncCommandLineParser';

const toolVersion: string = version;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
// See LICENSE in the project root for license information.
/* eslint-disable no-console */

import { execSync } from 'child_process';
import { tmpdir, cpus, platform, release, arch, totalmem } from 'os';
import * as path from 'path';
import * as fs from 'fs';
import { createHash, randomUUID } from 'crypto';
import { execSync } from 'node:child_process';
import { tmpdir, cpus, platform, release, arch, totalmem } from 'node:os';
import * as path from 'node:path';
import * as fs from 'node:fs';
import { createHash, randomUUID } from 'node:crypto';

import { NoOpTerminalProvider, Terminal } from '@rushstack/terminal';

import type { ZipSyncOptionCompression } from './zipSyncUtils';
import { pack } from './pack';
import { unpack } from './unpack';
import type { ZipSyncOptionCompression } from '../zipSyncUtils';
import { pack } from '../pack';
import { unpack } from '../unpack';

const compressionOptions = ['store', 'deflate', 'zstd', 'auto'] satisfies ZipSyncOptionCompression[];

Expand Down Expand Up @@ -461,7 +461,9 @@ zipsync internally handles cleaning as part of its operation.
outputLines.push('| OS | Arch | Node | CPU | Logical Cores | Memory |');
outputLines.push('| --- | --- | --- | --- | ---: | --- |');
outputLines.push(
`| ${platform()} ${release()} | ${arch()} | ${process.version} | ${cpuModel} | ${logicalCores} | ${memGB} GB |`
`| ${platform()} ${release()} | ${arch()} | ${
process.version
} | ${cpuModel} | ${logicalCores} | ${memGB} GB |`
);
outputLines.push('');
} catch {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

import * as zlib from 'zlib';
import * as zlib from 'node:zlib';

import { fallbackCrc32 } from './crc32';
import { fallbackCrc32 } from '../crc32';

describe('crc32', () => {
it('fallbackCrc32 should match zlib.crc32', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import * as fs from 'node:fs';
import { NoOpTerminalProvider } from '@rushstack/terminal/lib/NoOpTerminalProvider';
import { Terminal } from '@rushstack/terminal/lib/Terminal';

import { pack } from './pack';
import { unpack } from './unpack';
import { pack } from '../pack';
import { unpack } from '../unpack';
import { getDemoDataDirectoryDisposable } from './testUtils';
import type { ZipSyncOptionCompression } from './zipSyncUtils';
import type { ZipSyncOptionCompression } from '../zipSyncUtils';

describe('zipSync tests', () => {
it(`basic pack test`, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { tmpdir } from 'node:os';
import * as path from 'node:path';
import * as fs from 'node:fs';
import * as crypto from 'node:crypto';
import type { IMetadata } from './zipSyncUtils';
import type { IMetadata } from '../zipSyncUtils';

export function getTempDir(): string {
const randomId: string = crypto.randomUUID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import * as path from 'node:path';
import * as fs from 'node:fs';

import { unpackWorkerAsync } from './unpackWorkerAsync';
import { packWorkerAsync } from './packWorkerAsync';
import { unpackWorkerAsync } from '../unpackWorkerAsync';
import { packWorkerAsync } from '../packWorkerAsync';
import { getDemoDataDirectoryDisposable } from './testUtils';

describe('zipSyncWorkerAsync tests', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/zipsync",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/zipsync"
}