Skip to content

Commit

Permalink
fix(jszip-cli): Import fs-extra correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflorian committed Aug 25, 2024
1 parent 2436820 commit 47057ec
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ spec/.temp
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# System files
.DS_Store
2 changes: 1 addition & 1 deletion packages/electron-icon-generator/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

import path from 'node:path';
import * as fs from 'fs-extra';
import fs from 'fs-extra';
import Jimp from 'jimp';
import icongen from 'icon-gen';

Expand Down
2 changes: 1 addition & 1 deletion packages/electron-info/src/ElectronInfo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {randomUUID} from 'node:crypto';
import {expect, describe, test, beforeEach, beforeAll, afterAll, afterEach} from 'vitest';
import {StatusCodes as HTTP_STATUS} from 'http-status-codes';
import nock from 'nock';
import * as fs from 'fs-extra';
import fs from 'fs-extra';

import {ElectronInfo, RawReleaseInfo} from './ElectronInfo.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/jszip-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"build": "tsc -p tsconfig.json",
"clean": "rimraf dist",
"dist": "yarn clean && yarn build",
"start": "cross-env NODE_DEBUG=\"jszip-cli/*\" node --loader ts-node/esm src/cli.ts",
"start": "node --loader ts-node/esm src/cli.ts -V",
"test": "vitest run"
},
"type": "module",
Expand Down
6 changes: 4 additions & 2 deletions packages/jszip-cli/src/BuildService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ describe('BuildService', () => {

beforeAll(() => {
vi.mock('fs-extra', () => ({
lstat: () => Promise.resolve({isDirectory: () => false, isFile: () => true}),
readFile: () => {},
default: {
lstat: () => Promise.resolve({isDirectory: () => false, isFile: () => true}),
readFile: () => {},
},
}));
vi.mock('glob', () => ({
globSync: (params: string | string[]) => (typeof params === 'string' ? [params] : params),
Expand Down
2 changes: 1 addition & 1 deletion packages/jszip-cli/src/BuildService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'node:path';
import * as fs from 'fs-extra';
import fs from 'fs-extra';
import JSZip from 'jszip';
import logdown from 'logdown';
import progress from 'progress';
Expand Down
2 changes: 1 addition & 1 deletion packages/jszip-cli/src/JSZipCLI.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from 'node:path';
import {expect, describe, test, vi, beforeAll, afterAll} from 'vitest';
import * as fs from 'fs-extra';
import fs from 'fs-extra';
import {ConfigFileOptions, JSZipCLI, TerminalOptions} from '.';

const tempDir = path.resolve(__dirname, '.temp');
Expand Down

0 comments on commit 47057ec

Please sign in to comment.