From 9a7522f844c7dc4e6acea6c3538c8931639953de Mon Sep 17 00:00:00 2001 From: Joren Broekema Date: Mon, 7 Dec 2020 16:20:58 +0100 Subject: [PATCH 1/2] chore: update verify workflow to run node tests on windows --- .github/workflows/verify.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 59b9ab57e..ca66be255 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -68,10 +68,11 @@ jobs: node-tests: name: Node tests - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: node-version: [12.x, 14.x] + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 From 3cd1cf95e0d5121bf6f441912fa739ee1bfb9462 Mon Sep 17 00:00:00 2001 From: Joren Broekema Date: Mon, 7 Dec 2020 20:12:01 +0100 Subject: [PATCH 2/2] fix(providence-analytics): fix relative source path util for windows --- .changeset/spicy-terms-grin.md | 5 +++++ .../src/program/utils/relative-source-path.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/spicy-terms-grin.md diff --git a/.changeset/spicy-terms-grin.md b/.changeset/spicy-terms-grin.md new file mode 100644 index 000000000..5394ac0e9 --- /dev/null +++ b/.changeset/spicy-terms-grin.md @@ -0,0 +1,5 @@ +--- +'providence-analytics': patch +--- + +Relative source path util take posix path for both full path and root path, to ensure the replace happens properly. diff --git a/packages/providence-analytics/src/program/utils/relative-source-path.js b/packages/providence-analytics/src/program/utils/relative-source-path.js index 74bfcd6c3..347b7aacd 100644 --- a/packages/providence-analytics/src/program/utils/relative-source-path.js +++ b/packages/providence-analytics/src/program/utils/relative-source-path.js @@ -20,7 +20,7 @@ function isRelativeSourcePath(source) { * @param {string} rootPath like '/path/to/repo' */ function toRelativeSourcePath(fullPath, rootPath) { - return toPosixPath(fullPath).replace(rootPath, '.'); + return toPosixPath(fullPath).replace(toPosixPath(rootPath), '.'); } module.exports = { isRelativeSourcePath, toRelativeSourcePath };