Skip to content

Commit

Permalink
Merge branch 'master' into fs-promises
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Dec 22, 2021
2 parents ca8887e + e17a379 commit 5c4978c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/tests.yml
Expand Up @@ -55,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['10', '12']
node: ['10', '12', '17']
name: Node ${{ matrix.node }} (Linux)
steps:
- name: Checkout Commit
Expand All @@ -71,8 +71,28 @@ jobs:
env:
CI: true

macos:
runs-on: macos-latest
strategy:
matrix:
node: ['12', '16']
name: Node ${{ matrix.node }} (macOS)
steps:
- name: Checkout Commit
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run tests
run: npm run ci:test:only
env:
CI: true

windows:
runs-on: windows-2019
runs-on: windows-latest
strategy:
matrix:
node: ['10', '16']
Expand Down
5 changes: 4 additions & 1 deletion rollup.config.ts
Expand Up @@ -70,7 +70,10 @@ const nodePlugins = [
json(),
conditionalFsEventsImport(),
string({ include: '**/*.md' }),
commonjs({ include: 'node_modules/**' }),
commonjs({
ignoreTryCatch: false,
include: 'node_modules/**'
}),
typescript()
];

Expand Down
14 changes: 6 additions & 8 deletions src/watch/fsevents-importer.ts
@@ -1,16 +1,14 @@
let fsEvents: unknown;
let fsEventsImportError: Error | undefined;

export function loadFsEvents(): Promise<void> {
export async function loadFsEvents(): Promise<void> {
const moduleName = 'fsevents';

return import(moduleName)
.then(namespace => {
fsEvents = namespace.default;
})
.catch(err => {
fsEventsImportError = err;
});
try {
({ default: fsEvents } = await import(moduleName));
} catch (err: any) {
fsEventsImportError = err;
}
}

// A call to this function will be injected into the chokidar code
Expand Down

0 comments on commit 5c4978c

Please sign in to comment.