Skip to content

ref: Deprecate deepReadDirSync #10016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 3, 2024
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
1 change: 1 addition & 0 deletions packages/astro/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export {
addRequestDataToEvent,
DEFAULT_USER_INCLUDES,
extractRequestData,
// eslint-disable-next-line deprecation/deprecation
deepReadDirSync,
Integrations,
Handlers,
Expand Down
1 change: 1 addition & 0 deletions packages/nextjs/test/buildProcess/tests/nft.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ it('excludes build-time SDK dependencies from nft files', () => {
expect(rollupEntries.length).toEqual(0);

// We don't want to accidentally remove the wrappers
// eslint-disable-next-line deprecation/deprecation
const wrapperFiles = deepReadDirSync('src/config/wrappers/').filter(filename => filename !== 'types.ts');
expect(sentryWrapperEntries.length).toEqual(wrapperFiles.length);
});
1 change: 1 addition & 0 deletions packages/node-experimental/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export {
addRequestDataToEvent,
DEFAULT_USER_INCLUDES,
extractRequestData,
// eslint-disable-next-line deprecation/deprecation
deepReadDirSync,
getModuleFromFilename,
close,
Expand Down
1 change: 1 addition & 0 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export { NodeClient } from './client';
export { makeNodeTransport } from './transports';
export { defaultIntegrations, init, defaultStackParser, getSentryRelease } from './sdk';
export { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData } from '@sentry/utils';
// eslint-disable-next-line deprecation/deprecation
export { deepReadDirSync } from './utils';
export { getModuleFromFilename } from './module';
// eslint-disable-next-line deprecation/deprecation
Expand Down
1 change: 1 addition & 0 deletions packages/node/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as path from 'path';
* @param targetDir Absolute or relative path of the directory to scan. All returned paths will be relative to this
* directory.
* @returns Array holding all relative paths
* @deprecated This function will be removed in the next major version.
*/
export function deepReadDirSync(targetDir: string): string[] {
const targetDirAbsPath = path.resolve(targetDir);
Expand Down
4 changes: 4 additions & 0 deletions packages/node/test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('deepReadDirSync', () => {
].map(p => (process.platform === 'win32' ? p.replace(/\//g, '\\') : p));

// compare sets so that order doesn't matter
// eslint-disable-next-line deprecation/deprecation
expect(new Set(deepReadDirSync('./test/fixtures/testDeepReadDirSync'))).toEqual(new Set(expected));
});

Expand All @@ -35,6 +36,7 @@ describe('deepReadDirSync', () => {
fs.mkdtemp(`${tmpDir}${path.sep}`, (err, dirPath) => {
if (err) throw err;
try {
// eslint-disable-next-line deprecation/deprecation
expect(deepReadDirSync(dirPath)).toEqual([]);
done();
} catch (error) {
Expand All @@ -44,10 +46,12 @@ describe('deepReadDirSync', () => {
});

it('errors if directory does not exist', () => {
// eslint-disable-next-line deprecation/deprecation
expect(() => deepReadDirSync('./IDontExist')).toThrowError('Directory does not exist.');
});

it('errors if given path is not a directory', () => {
// eslint-disable-next-line deprecation/deprecation
expect(() => deepReadDirSync('package.json')).toThrowError('it is not a directory');
});
});
1 change: 1 addition & 0 deletions packages/remix/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export {
addRequestDataToEvent,
DEFAULT_USER_INCLUDES,
extractRequestData,
// eslint-disable-next-line deprecation/deprecation
deepReadDirSync,
Integrations,
Handlers,
Expand Down
1 change: 1 addition & 0 deletions packages/serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export {
DEFAULT_USER_INCLUDES,
addRequestDataToEvent,
extractRequestData,
// eslint-disable-next-line deprecation/deprecation
deepReadDirSync,
Handlers,
Integrations,
Expand Down
1 change: 1 addition & 0 deletions packages/sveltekit/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export {
addRequestDataToEvent,
DEFAULT_USER_INCLUDES,
extractRequestData,
// eslint-disable-next-line deprecation/deprecation
deepReadDirSync,
Integrations,
Handlers,
Expand Down