Skip to content

Commit

Permalink
fix relative path on windows (using posix) (Fix #643) (#644)
Browse files Browse the repository at this point in the history
* fix relative path on windows (using posix) (Fix #643)

* fix playwright version
  • Loading branch information
jycouet authored Apr 16, 2024
1 parent 3340916 commit 35568fb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-ligers-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'vite-plugin-kit-routes': patch
---

fix relative path on windows (using posix)
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
cd packages/create-kitql && pnpm dev test-${{ matrix.template }} -t ${{ matrix.template }}

- name: 🧑‍💻 Install playwright
run: cd packages/create-kitql/test-${{ matrix.template }} && npx playwright install
run: cd packages/create-kitql/test-${{ matrix.template }} && npx playwright@1.42.1 install

- name: 🛠️ e2e install
run: cd packages/create-kitql/test-${{ matrix.template }} && pnpm i --no-frozen-lockfile
Expand Down
4 changes: 2 additions & 2 deletions packages/vite-plugin-kit-routes/src/lib/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { PluginOption } from 'vite'
import { watchAndRun } from 'vite-plugin-watch-and-run'

import { cyan, gray, green, italic, Log, red, stry0, yellow } from '@kitql/helpers'
import { dirname, getFilesUnder, read, relative, write } from '@kitql/internals'
import { dirname, getFilesUnder, read, write } from '@kitql/internals'

import { getActionsOfServerPages, getMethodsOfServerFiles } from './ast.js'
import { appendSp, format, routeFn } from './format.js'
Expand Down Expand Up @@ -683,7 +683,7 @@ export function extractParamsFromPath(path: string, o: Options): Param[] {
const paramPattern = /\[+([^\]]+)]+/g
const params: Param[] = []

const relToParams = relative(dirname(options.generated_file_path), options.path_params)
const relToParams = posix.relative(dirname(options.generated_file_path), options.path_params)

let match
while ((match = paramPattern.exec(path)) !== null) {
Expand Down

0 comments on commit 35568fb

Please sign in to comment.