Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-R44 committed Apr 20, 2024
1 parent e22a9b9 commit cf87377
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 39 deletions.
70 changes: 35 additions & 35 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,56 @@ name: CI
on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
# lint:
# runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
# steps:
# - uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 21
# - name: Setup Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 21

- name: Install pnpm
run: |
corepack enable
corepack prepare pnpm@latest --activate
# - name: Install pnpm
# run: |
# corepack enable
# corepack prepare pnpm@latest --activate

- name: Install dependencies
run: pnpm install
# - name: Install dependencies
# run: pnpm install

- name: Lint
run: pnpm lint
# - name: Lint
# run: pnpm lint

typecheck:
runs-on: ubuntu-latest
# typecheck:
# runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
# steps:
# - uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 21
# - name: Setup Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 21

- name: Install pnpm
run: |
corepack enable
corepack prepare pnpm@latest --activate
# - name: Install pnpm
# run: |
# corepack enable
# corepack prepare pnpm@latest --activate

- name: Install dependencies
run: |
pnpm install
pnpm -r build
# - name: Install dependencies
# run: |
# pnpm install
# pnpm -r build

- name: Typecheck
run: pnpm typecheck
# - name: Typecheck
# run: pnpm typecheck

tests:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 10

Expand Down
4 changes: 4 additions & 0 deletions packages/hot_hook/src/matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class Matcher {
})
.map((path) => path.replace(/\\/g, '/'))

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

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

console.log('filePath', filePath)
console.log('this.#matcher(filePath)', this.#matcher(filePath))

return this.#matcher(filePath)
}
}
4 changes: 2 additions & 2 deletions packages/hot_hook/tests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export function runProcess(scriptPath: string, options?: NodeOptions) {
const child = execaNode(scriptPath, { nodeOptions: [], buffer: false, ...options })
activeTest.cleanup(() => void child.kill())

// child.stdout?.pipe(process.stdout)
// child.stderr?.pipe(process.stderr)
child.stdout?.pipe(process.stdout)
child.stderr?.pipe(process.stderr)

return {
child,
Expand Down
11 changes: 9 additions & 2 deletions packages/hot_hook/tests/matcher.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ test.group('Matcher', () => {
'/home/foo/bar/config/test/index.js',
]

assert.isTrue(matches.every((match) => matcher.match(match)))
assert.isFalse(notMatches.some((match) => matcher.match(match)))
for (const match of matches) {
assert.isTrue(matcher.match(match))
}

for (const match of notMatches) {
assert.isFalse(matcher.match(match))
}
// assert.isTrue(matches.every((match) => matcher.match(match)))
// assert.isFalse(notMatches.some((match) => matcher.match(match)))
})
})

0 comments on commit cf87377

Please sign in to comment.