Skip to content
Draft

Deglob #2136

Show file tree
Hide file tree
Changes from 1 commit
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: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
"eslint": "^9.11.1",
"eslint-config-skuba": "workspace:*",
"execa": "^5.0.0",
"fast-glob": "^3.3.2",
"find-up": "^5.0.0",
"fs-extra": "^11.0.0",
"function-arguments": "^1.0.9",
Expand Down
183 changes: 107 additions & 76 deletions pnpm-lock.yaml

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

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ import { tryRemoveYarnIgnoreOptionalFlags } from './removeYarnIgnoreOptionalFlag
const volToJson = () => vol.toJSON(process.cwd(), undefined, true);

jest.mock('fs', () => memfs);
jest.mock('fast-glob', () => ({
glob: (pat: any, opts: any) =>
jest.requireActual('fast-glob').glob(pat, { ...opts, fs: memfs }),
jest.mock('node:fs/promises', () => ({
...jest.requireActual('node:fs/promises'),
glob: async function* (pat: string, opts?: any) {
const actualGlob = jest.requireActual('node:fs/promises').glob;
yield* actualGlob(pat, { ...opts, fs: memfs as any });
},
Comment on lines +11 to +16
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ew

}));

beforeEach(() => vol.reset());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { inspect } from 'util';

import { glob } from 'fast-glob';
import { glob } from 'node:fs/promises';
import fs from 'fs-extra';

import { log } from '../../../../../../utils/logging.js';
Expand Down Expand Up @@ -62,7 +62,7 @@ const removeYarnIgnoreFlag = (contents: string) => {
const removeYarnIgnoreOptionalFlags: PatchFunction = async ({
mode,
}): Promise<PatchReturnType> => {
const maybeDockerFilesPaths = await glob(['Dockerfile*']);
const maybeDockerFilesPaths = await Array.fromAsync(glob('Dockerfile*'));

if (!maybeDockerFilesPaths.length) {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ import { tryMigrateNpmrcToPnpmWorkspace } from './migrateNpmrcToPnpmWorkspace.js
const volToJson = () => vol.toJSON(process.cwd(), undefined, true);

jest.mock('fs', () => memfs);
jest.mock('fast-glob', () => ({
glob: (pat: any, opts: any) =>
jest.requireActual('fast-glob').glob(pat, { ...opts, fs: memfs }),
jest.mock('node:fs/promises', () => ({
...jest.requireActual('node:fs/promises'),
glob: async function* (pat: string, opts?: any) {
const actualGlob = jest.requireActual('node:fs/promises').glob;
yield* actualGlob(pat, { ...opts, fs: memfs as any });
},
}));

beforeEach(() => vol.reset());
Expand Down
Loading