@lage-run/scheduler 0.5.2 → 0.5.4

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/CHANGELOG.json CHANGED
@@ -2,7 +2,49 @@
2
2
  "name": "@lage-run/scheduler",
3
3
  "entries": [
4
4
  {
5
- "date": "Sat, 29 Oct 2022 18:42:29 GMT",
5
+ "date": "Mon, 31 Oct 2022 21:56:01 GMT",
6
+ "tag": "@lage-run/scheduler_v0.5.4",
7
+ "version": "0.5.4",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "kchau@microsoft.com",
12
+ "package": "@lage-run/scheduler",
13
+ "commit": "6d1d50bdb9245688edd0d7b6061bed2b1cdc3fd1",
14
+ "comment": "adds taskArgs param for worker scripts"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Mon, 31 Oct 2022 21:27:52 GMT",
21
+ "tag": "@lage-run/scheduler_v0.5.3",
22
+ "version": "0.5.3",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "kchau@microsoft.com",
27
+ "package": "@lage-run/scheduler",
28
+ "commit": "e8946dc08fb76dc616d61f3b67b0ca99e15d9a7e",
29
+ "comment": "adds depcheck and fixes"
30
+ },
31
+ {
32
+ "author": "beachball",
33
+ "package": "@lage-run/scheduler",
34
+ "comment": "Bump @lage-run/worker-threads-pool to v0.4.1",
35
+ "commit": "e8946dc08fb76dc616d61f3b67b0ca99e15d9a7e"
36
+ },
37
+ {
38
+ "author": "beachball",
39
+ "package": "@lage-run/scheduler",
40
+ "comment": "Bump @lage-run/scheduler-types to v0.2.3",
41
+ "commit": "e8946dc08fb76dc616d61f3b67b0ca99e15d9a7e"
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "date": "Sat, 29 Oct 2022 18:42:49 GMT",
6
48
  "tag": "@lage-run/scheduler_v0.5.2",
7
49
  "version": "0.5.2",
8
50
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,30 @@
1
1
  # Change Log - @lage-run/scheduler
2
2
 
3
- This log was last generated on Sat, 29 Oct 2022 18:42:29 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 31 Oct 2022 21:56:01 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.5.4
8
+
9
+ Mon, 31 Oct 2022 21:56:01 GMT
10
+
11
+ ### Patches
12
+
13
+ - adds taskArgs param for worker scripts (kchau@microsoft.com)
14
+
15
+ ## 0.5.3
16
+
17
+ Mon, 31 Oct 2022 21:27:52 GMT
18
+
19
+ ### Patches
20
+
21
+ - adds depcheck and fixes (kchau@microsoft.com)
22
+ - Bump @lage-run/worker-threads-pool to v0.4.1
23
+ - Bump @lage-run/scheduler-types to v0.2.3
24
+
7
25
  ## 0.5.2
8
26
 
9
- Sat, 29 Oct 2022 18:42:29 GMT
27
+ Sat, 29 Oct 2022 18:42:49 GMT
10
28
 
11
29
  ### Patches
12
30
 
@@ -1,4 +1,7 @@
1
1
  import type { TargetRunner, TargetRunnerOptions } from "@lage-run/scheduler-types";
2
+ export interface WorkerRunnerOptions {
3
+ taskArgs: string[];
4
+ }
2
5
  /**
3
6
  * Creates a workerpool per target task definition of "type: worker"
4
7
  *
@@ -35,6 +38,8 @@ import type { TargetRunner, TargetRunnerOptions } from "@lage-run/scheduler-type
35
38
  * ```
36
39
  */
37
40
  export declare class WorkerRunner implements TargetRunner {
41
+ private options;
38
42
  static gracefulKillTimeout: number;
43
+ constructor(options: WorkerRunnerOptions);
39
44
  run(runOptions: TargetRunnerOptions): Promise<void>;
40
45
  }
@@ -37,9 +37,13 @@ exports.WorkerRunner = void 0;
37
37
  * ```
38
38
  */
39
39
  class WorkerRunner {
40
+ constructor(options) {
41
+ this.options = options;
42
+ }
40
43
  async run(runOptions) {
41
44
  var _a, _b, _c;
42
45
  const { target, weight, abortSignal } = runOptions;
46
+ const { taskArgs } = this.options;
43
47
  const scriptFile = (_b = (_a = target.options) === null || _a === void 0 ? void 0 : _a.worker) !== null && _b !== void 0 ? _b : (_c = target.options) === null || _c === void 0 ? void 0 : _c.script;
44
48
  if (!scriptFile) {
45
49
  throw new Error('WorkerRunner: "script" configuration is required - e.g. { type: "worker", script: "./worker.js" }');
@@ -50,7 +54,7 @@ class WorkerRunner {
50
54
  if (typeof runFn !== "function") {
51
55
  throw new Error("WorkerRunner: worker script must export a function; you likely need to use `module.exports = function() {...}`");
52
56
  }
53
- await runFn({ target, weight, abortSignal });
57
+ await runFn({ target, weight, taskArgs, abortSignal });
54
58
  }
55
59
  }
56
60
  exports.WorkerRunner = WorkerRunner;
@@ -1 +1 @@
1
- {"version":3,"file":"WorkerRunner.js","sourceRoot":"","sources":["../../src/runners/WorkerRunner.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAa,YAAY;IAGvB,KAAK,CAAC,GAAG,CAAC,UAA+B;;QACvC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC;QACnD,MAAM,UAAU,GAAG,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,MAAM,mCAAI,MAAA,MAAM,CAAC,OAAO,0CAAE,MAAM,CAAC;QAEpE,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,mGAAmG,CAAC,CAAC;SACtH;QAED,8DAA8D;QAC9D,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,OAAO,YAAY,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;QAE/F,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,gHAAgH,CAAC,CAAC;SACnI;QAED,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;IAC/C,CAAC;;AApBH,oCAqBC;AApBQ,gCAAmB,GAAG,IAAI,CAAC"}
1
+ {"version":3,"file":"WorkerRunner.js","sourceRoot":"","sources":["../../src/runners/WorkerRunner.ts"],"names":[],"mappings":";;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAa,YAAY;IAGvB,YAAoB,OAA4B;QAA5B,YAAO,GAAP,OAAO,CAAqB;IAAG,CAAC;IAEpD,KAAK,CAAC,GAAG,CAAC,UAA+B;;QACvC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC;QACnD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAClC,MAAM,UAAU,GAAG,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,MAAM,mCAAI,MAAA,MAAM,CAAC,OAAO,0CAAE,MAAM,CAAC;QAEpE,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,mGAAmG,CAAC,CAAC;SACtH;QAED,8DAA8D;QAC9D,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,OAAO,YAAY,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;QAE/F,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,gHAAgH,CAAC,CAAC;SACnI;QAED,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;IACzD,CAAC;;AAvBH,oCAwBC;AAvBQ,gCAAmB,GAAG,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/scheduler",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "Scheduler for Lage",
5
5
  "repository": {
6
6
  "url": "https://github.com/microsoft/lage"
@@ -18,17 +18,11 @@
18
18
  "@lage-run/target-graph": "^0.5.1",
19
19
  "@lage-run/logger": "^1.2.0",
20
20
  "@lage-run/cache": "^0.1.26",
21
- "@lage-run/worker-threads-pool": "^0.4.0",
22
- "@lage-run/format-hrtime": "^0.1.1",
23
- "p-graph": "^1.1.1",
24
- "p-profiler": "^0.2.1",
25
- "abort-controller": "^3.0.0",
26
- "workspace-tools": "^0.29.0"
21
+ "@lage-run/worker-threads-pool": "^0.4.1",
22
+ "abort-controller": "^3.0.0"
27
23
  },
28
24
  "devDependencies": {
29
- "@lage-run/scheduler-types": "^0.2.2",
30
- "@lage-run/monorepo-fixture": "*",
31
- "@types/workerpool": "6.1.0",
25
+ "@lage-run/scheduler-types": "^0.2.3",
32
26
  "monorepo-scripts": "*"
33
27
  },
34
28
  "publishConfig": {