@hackwaly/task 0.3.10 → 0.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackwaly/task",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/cli.js CHANGED
@@ -47,7 +47,20 @@ export async function cliMain() {
47
47
  }
48
48
  const watcher = chokidar.watch([...watchTargets], {
49
49
  ignoreInitial: true,
50
- ignored: (path) => /\bnode_modules\b/.test(path),
50
+ ignored: (path, stats) => {
51
+ if (/\bnode_modules\b/.test(path) || !micromatch.isMatch(path, "**/*", { dot: false })) {
52
+ return true;
53
+ }
54
+ if (stats !== undefined && stats.isFile()) {
55
+ for (const task of watchSet) {
56
+ const relPath = NodePath.relative(task.meta.cwd, path);
57
+ if (!micromatch.isMatch(relPath, task.meta.inputs)) {
58
+ return true;
59
+ }
60
+ }
61
+ }
62
+ return false;
63
+ },
51
64
  });
52
65
  const dirtySeedSet = new Set();
53
66
  const flush = () => {
package/src/scheduler.js CHANGED
@@ -71,7 +71,7 @@ export async function start(taskChan, options) {
71
71
  }
72
72
  await Promise.allSettled([promise]);
73
73
  }
74
- await task.run({ abort });
74
+ await task.run({ cwd: task.meta.cwd, abort });
75
75
  upToDateSet.add(task);
76
76
  for (const invDep of task.invDeps) {
77
77
  if (pendingSet.has(invDep)) {
package/src/types.d.ts CHANGED
@@ -3,6 +3,7 @@ export interface Command {
3
3
  args: string[];
4
4
  }
5
5
  export interface TaskRunContext {
6
+ cwd: string;
6
7
  abort: AbortSignal;
7
8
  }
8
9
  export interface TaskMeta {