Skip to content

Conversation

@data-douser
Copy link
Collaborator

What This PR Contributes

This pull request enhances cross-platform path handling in the CDS tools, with a focus on ensuring compatibility between Unix and Windows environments. The changes update the codebase to use path.isAbsolute() for path checks, improve detection of direct binary paths for both Windows and POSIX separators, and add comprehensive tests to verify behavior on different platforms. Additionally, development dependencies are updated for improved stability and compatibility.

Cross-platform path handling improvements:

  • Replaced string-based absolute path checks (e.g., startsWith('/')) with path.isAbsolute() in diagnostics.ts and related test files to ensure correct path resolution on both Unix and Windows systems. [1] [2] [3] [4]
  • Improved detection of direct binary paths in compile.ts by checking for both Windows (node_modules\.binThis pull request enhances cross-platform path handling in the CDS tools, with a focus on ensuring compatibility between Unix and Windows environments. The changes update the codebase to use path.isAbsolute()` for path checks, improve detection of direct binary paths for both Windows and POSIX separators, and add comprehensive tests to verify behavior on different platforms. Additionally, development dependencies are updated for improved stability and compatibility.

Cross-platform path handling improvements:

  • Replaced string-based absolute path checks (e.g., startsWith('/')) with path.isAbsolute() in diagnostics.ts and related test files to ensure correct path resolution on both Unix and Windows systems. [1] [2] [3] [4]
    ) and POSIX (node_modules/.bin/) separators, using the platform's native separator for robust compatibility.

Testing enhancements:

  • Added new tests in compile.test.ts and diagnostics.test.ts to verify correct handling of Windows-style paths, UNC paths, mixed separators, and cross-drive scenarios, ensuring the code behaves as expected on all supported platforms. [1] [2]

Dependency updates:

  • Updated several development dependencies in package.json, including ESLint, TypeScript, Prettier, and related plugins, to their latest versions for improved stability and compatibility.

Minor code cleanup:

  • Alphabetized and grouped imports in files affected by the path handling updates for better readability.

These changes collectively ensure the CDS tools work reliably across different operating systems and improve the maintainability of the codebase.

@data-douser data-douser self-assigned this Dec 30, 2025
@data-douser data-douser added bug Something isn't working enhancement New feature or request dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Dec 30, 2025
data-douser and others added 10 commits December 30, 2025 10:22
…tor-windows-os

Update `.github/workflows/*.yml` : YAML Lint, least-privilege `permissions` &  actions versions
…dvanced-security/codeql-sap-js into data-douser/cds-extractor-windows-os-3
This commit:

- renames the actions workflows that run CodeQL unit tests on Linux
  and Windows;

- refactors the Windows workflow to address errors and inefficiencies
  identified after initial run;

- adds a Windows equivalent script for performing CDS compilation
  within an actions workflow on 'windows-latest' OS.
This commit:

- Adds a .gitattributes file in order to force consistent line feed (LF)
  endings for cross platform (Linux, Windows, etc.) testing of custom
  CodeQL queries and libraries.

- Attempts to fix CodeQL query unit tests that are failing when run
  on Windows OS due to different, default LF (character) endings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file enhancement New feature or request javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants