Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed Apr 8, 2024
1 parent 1ef9a11 commit ecae3e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/hot_hook/src/matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export class Matcher {

constructor(rootDirectory: string, patterns: picomatch.Glob = []) {
this.#rootDirectory = rootDirectory
console.log(this.#rootDirectory)

patterns = Array.isArray(patterns) ? patterns : [patterns]
const absolutePatterns = patterns
Expand All @@ -16,6 +17,7 @@ export class Matcher {
})
.map((path) => path.replace(/\\/g, '/'))

console.log(absolutePatterns)
this.#matcher = picomatch(absolutePatterns || [], { dot: true })
}

Expand All @@ -28,6 +30,7 @@ export class Matcher {
filePath = filePath.slice(this.#rootDirectory.length).replace(/^\//, '')
}

console.log({ filePath, match: this.#matcher(filePath) })
return this.#matcher(filePath)
}
}
2 changes: 1 addition & 1 deletion packages/hot_hook/tests/loader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,5 +268,5 @@ test.group('Loader', () => {
await setTimeout(100)
await createHandlerFile({ path: 'app.js', response: 'Hello World! Updated new' })
await supertest('http://localhost:3333').get('/').expect(200).expect('Hello World! Updated new')
})
}).pin()
})

0 comments on commit ecae3e4

Please sign in to comment.