Skip to content
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

Enhance windows support #30148

Open
wants to merge 2 commits into
base: next
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions code/core/scripts/helpers/generateTypesMapperFiles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync } from 'node:fs';
import { mkdir, writeFile } from 'node:fs/promises';
import { dirname, join, relative } from 'node:path';
import { dirname, join, relative, sep } from 'node:path';

import { dedent } from '../../../../scripts/prepare/tools';
import type { getEntries } from '../entries';
Expand All @@ -13,8 +13,8 @@ async function generateTypesMapperContent(filePath: string) {

return dedent`
// auto generated file from ${__filename}, do not edit
export * from '${join(upwards, downwards)}';
export type * from '${join(upwards, downwards)}';
export * from '${join(upwards, downwards).replaceAll(sep, '/')}';
export type * from '${join(upwards, downwards).replaceAll(sep, '/')}';
Comment on lines +16 to +17
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider using path.posix.join() instead of join().replaceAll(sep, '/') for more idiomatic path normalization in module specifiers

Copy link
Author

Choose a reason for hiding this comment

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

bad greptile - that only works if both paths are already posix paths. otherwise you end up with

export * from '../src\index.ts';

`;
}

Expand Down
Loading