Skip to content

Commit

Permalink
WIP - rwd Tue, Dec 03 08:20 pm
Browse files Browse the repository at this point in the history
[no-changelog-required]
  • Loading branch information
airhorns committed Dec 4, 2024
1 parent 2022b7c commit 96e5986
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
1 change: 1 addition & 0 deletions integration-test/reload-cross-workspace-lazy/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
set -e

export WDS_DEBUG=1

# kill the server when this script exits
trap "kill -9 0" INT TERM
Expand Down
2 changes: 2 additions & 0 deletions integration-test/reload-cross-workspace/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
set -e
export WDS_DEBUG=1


# kill the server when this script exits
Expand All @@ -14,6 +15,7 @@ pnpm install
# make a copy of the run.ts file in the side package for us to modify
cp $DIR/side/run.ts $DIR/side/run-scratch.ts


# run a server in the main package in the background
$DIR/../../pkg/wds.bin.js $@ --watch --commands $DIR/main/run.ts &

Expand Down
26 changes: 16 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,22 @@ const startFilesystemWatcher = (project: Project) => {
ignoreInitial: true,
recursive: true,
ignore: (filePath: string) => {
if (filePath.includes(nodeModulesDir)) return true;
if (filePath == project.workspaceRoot) return false;
if (filePath == project.config.root) return false;
if (filePath.endsWith(".d.ts")) return true;
if (filePath.endsWith(".map")) return true;
if (filePath.includes(gitDir)) return true;
if (filePath.endsWith(".DS_Store")) return true;
if (filePath.endsWith(".tsbuildinfo")) return true;

return !project.config.includedMatcher(filePath);
const fn = () => {
if (filePath.includes(nodeModulesDir)) return true;
if (filePath == project.workspaceRoot) return false;
if (filePath == project.config.root) return false;
if (filePath.endsWith(".d.ts")) return true;
if (filePath.endsWith(".map")) return true;
if (filePath.includes(gitDir)) return true;
if (filePath.endsWith(".DS_Store")) return true;
if (filePath.endsWith(".tsbuildinfo")) return true;
if (!path.extname(filePath)) return true; // allow directories to be watched

return !project.config.includedMatcher(filePath);
};
const result = fn();
console.error(`${filePath} ignore result`, result);
return result;
},
});

Expand Down

0 comments on commit 96e5986

Please sign in to comment.