@ms-cloudpack/api-server 0.6.8 → 0.6.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TaskScheduler.d.ts","sourceRoot":"","sources":["../../src/task-scheduler/TaskScheduler.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM/D,eAAO,MAAM,OAAO,aAAiC,CAAC;AAEtD,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,YAAY,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,qBAAa,aAAa;;gBAIZ,OAAO,EAAE,oBAAoB;IAOnC,YAAY,CAAC,CAAC,SAAS,aAAa,EACxC,aAAa,EAAE,CAAC,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,OAAO,EAAE;QACP,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CAmBJ"}
1
+ {"version":3,"file":"TaskScheduler.d.ts","sourceRoot":"","sources":["../../src/task-scheduler/TaskScheduler.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM/D,eAAO,MAAM,OAAO,aAAiC,CAAC;AAEtD,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,YAAY,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,qBAAa,aAAa;;gBAGZ,OAAO,EAAE,oBAAoB;IAMnC,YAAY,CAAC,CAAC,SAAS,aAAa,EACxC,aAAa,EAAE,CAAC,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,OAAO,EAAE;QACP,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CAmBJ"}
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _TaskScheduler_scheduler, _TaskScheduler_targetGraphBuilder;
12
+ var _TaskScheduler_scheduler;
13
13
  import targetGraph from '@lage-run/target-graph';
14
14
  import { createRequire } from 'node:module';
15
15
  import { createSimpleScheduler } from './createSimpleScheduler.js';
@@ -21,16 +21,15 @@ export const require = createRequire(import.meta.url);
21
21
  export class TaskScheduler {
22
22
  constructor(options) {
23
23
  _TaskScheduler_scheduler.set(this, void 0);
24
- _TaskScheduler_targetGraphBuilder.set(this, void 0);
25
- __classPrivateFieldSet(this, _TaskScheduler_targetGraphBuilder, new targetGraph.TargetGraphBuilder(), "f");
26
24
  __classPrivateFieldSet(this, _TaskScheduler_scheduler, createSimpleScheduler(options), "f");
27
25
  }
28
26
  // Schedules task to be run according to the bundle request that came through from the bundler server
29
27
  // TODO: from a bundle request, we should be able to determine if we need to auto add several targets into the graph
30
28
  async scheduleTask(bundleRequest, scripts, options) {
31
29
  const target = createBundleTarget(scripts, bundleRequest);
32
- __classPrivateFieldGet(this, _TaskScheduler_targetGraphBuilder, "f").addTarget(target);
33
- const graph = __classPrivateFieldGet(this, _TaskScheduler_targetGraphBuilder, "f").build();
30
+ const targetGraphBuilder = new targetGraph.TargetGraphBuilder();
31
+ targetGraphBuilder.addTarget(target);
32
+ const graph = targetGraphBuilder.build();
34
33
  try {
35
34
  await __classPrivateFieldGet(this, _TaskScheduler_scheduler, "f").run(target.cwd, graph, options.rerun);
36
35
  }
@@ -45,5 +44,5 @@ export class TaskScheduler {
45
44
  }
46
45
  }
47
46
  }
48
- _TaskScheduler_scheduler = new WeakMap(), _TaskScheduler_targetGraphBuilder = new WeakMap();
47
+ _TaskScheduler_scheduler = new WeakMap();
49
48
  //# sourceMappingURL=TaskScheduler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TaskScheduler.js","sourceRoot":"","sources":["../../src/task-scheduler/TaskScheduler.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,WAAW,MAAM,wBAAwB,CAAC;AAIjD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAOtD;;GAEG;AACH,MAAM,OAAO,aAAa;IAIxB,YAAY,OAA6B;QAHzC,2CAA4B;QAC5B,oDAAoD;QAGlD,uBAAA,IAAI,qCAAuB,IAAI,WAAW,CAAC,kBAAkB,EAAE,MAAA,CAAC;QAChE,uBAAA,IAAI,4BAAc,qBAAqB,CAAC,OAAO,CAAC,MAAA,CAAC;IACnD,CAAC;IAED,qGAAqG;IACrG,oHAAoH;IACpH,KAAK,CAAC,YAAY,CAChB,aAAgB,EAChB,OAA+B,EAC/B,OAEC;QAED,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAE1D,uBAAA,IAAI,yCAAoB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAE3C,MAAM,KAAK,GAAG,uBAAA,IAAI,yCAAoB,CAAC,KAAK,EAAE,CAAC;QAE/C,IAAI;YACF,MAAM,uBAAA,IAAI,gCAAW,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;SAC7D;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,YAAY,KAAK,EAAE;gBACtB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBACzB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;aACxB;iBAAM;gBACL,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;aAC1B;SACF;IACH,CAAC;CACF","sourcesContent":["import type { SimpleScheduler } from '@lage-run/scheduler';\nimport targetGraph from '@lage-run/target-graph';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { BundleRequest } from '../types/BundleRequest.js';\n\nimport { createRequire } from 'node:module';\nimport { createSimpleScheduler } from './createSimpleScheduler.js';\nimport { createBundleTarget } from './createBundleTarget.js';\n\nexport const require = createRequire(import.meta.url);\n\ninterface TaskSchedulerOptions {\n reporter: TaskReporter;\n root: string;\n}\n\n/**\n * A class to abstract the creation of the lage scheduler and scheduling tasks\n */\nexport class TaskScheduler {\n #scheduler: SimpleScheduler;\n #targetGraphBuilder: targetGraph.TargetGraphBuilder;\n\n constructor(options: TaskSchedulerOptions) {\n this.#targetGraphBuilder = new targetGraph.TargetGraphBuilder();\n this.#scheduler = createSimpleScheduler(options);\n }\n\n // Schedules task to be run according to the bundle request that came through from the bundler server\n // TODO: from a bundle request, we should be able to determine if we need to auto add several targets into the graph\n async scheduleTask<T extends BundleRequest>(\n bundleRequest: T,\n scripts: Record<string, string>,\n options: {\n rerun?: boolean;\n },\n ) {\n const target = createBundleTarget(scripts, bundleRequest);\n\n this.#targetGraphBuilder.addTarget(target);\n\n const graph = this.#targetGraphBuilder.build();\n\n try {\n await this.#scheduler.run(target.cwd, graph, options.rerun);\n } catch (e) {\n if (e instanceof Error) {\n console.error(e.message);\n console.error(e.stack);\n } else {\n console.error(String(e));\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"TaskScheduler.js","sourceRoot":"","sources":["../../src/task-scheduler/TaskScheduler.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,WAAW,MAAM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target-graph';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { BundleRequest } from '../types/BundleRequest.js';\n\nimport { createRequire } from 'node:module';\nimport { createSimpleScheduler } from './createSimpleScheduler.js';\nimport { createBundleTarget } from './createBundleTarget.js';\n\nexport const require = createRequire(import.meta.url);\n\ninterface TaskSchedulerOptions {\n reporter: TaskReporter;\n root: string;\n}\n\n/**\n * A class to abstract the creation of the lage scheduler and scheduling tasks\n */\nexport class TaskScheduler {\n #scheduler: SimpleScheduler;\n\n constructor(options: TaskSchedulerOptions) {\n this.#scheduler = createSimpleScheduler(options);\n }\n\n // Schedules task to be run according to the bundle request that came through from the bundler server\n // TODO: from a bundle request, we should be able to determine if we need to auto add several targets into the graph\n async scheduleTask<T extends BundleRequest>(\n bundleRequest: T,\n scripts: Record<string, string>,\n options: {\n rerun?: boolean;\n },\n ) {\n const target = createBundleTarget(scripts, bundleRequest);\n\n const targetGraphBuilder = new targetGraph.TargetGraphBuilder();\n targetGraphBuilder.addTarget(target);\n const graph = targetGraphBuilder.build();\n\n try {\n await this.#scheduler.run(target.cwd, graph, options.rerun);\n } catch (e) {\n if (e instanceof Error) {\n console.error(e.message);\n console.error(e.stack);\n } else {\n console.error(String(e));\n }\n }\n }\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.34.8"
8
+ "packageVersion": "7.35.2"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/api-server",
3
- "version": "0.6.8",
3
+ "version": "0.6.10",
4
4
  "description": "An implementation of the API server that does interacts with a task scheduler.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,19 +17,19 @@
17
17
  "@lage-run/scheduler": "^1.0.0",
18
18
  "@lage-run/target-graph": "^0.8.6",
19
19
  "@lage-run/hasher": "^1.0.0",
20
- "@ms-cloudpack/bundler-types": "^0.13.0",
21
- "@ms-cloudpack/config": "^0.7.1",
22
- "@ms-cloudpack/create-express-app": "^1.3.5",
20
+ "@ms-cloudpack/bundler-types": "^0.13.1",
21
+ "@ms-cloudpack/config": "^0.7.2",
22
+ "@ms-cloudpack/create-express-app": "^1.3.6",
23
23
  "@ms-cloudpack/data-bus": "^0.2.1",
24
- "@ms-cloudpack/package-utilities": "^3.1.2",
25
- "@ms-cloudpack/path-string-parsing": "^1.0.1",
24
+ "@ms-cloudpack/package-utilities": "^3.1.3",
25
+ "@ms-cloudpack/path-string-parsing": "^1.0.2",
26
26
  "@ms-cloudpack/task-reporter": "^0.4.1",
27
27
  "@ms-cloudpack/telemetry": "^0.3.2",
28
28
  "@trpc/client": "^10.21.1",
29
29
  "@trpc/server": "^10.21.1",
30
30
  "chokidar": "^3.5.3",
31
31
  "fs-extra": "^11.0.0",
32
- "get-port": "^6.1.2",
32
+ "get-port": "^7.0.0",
33
33
  "p-queue": "^7.3.0",
34
34
  "semver": "^7.3.7",
35
35
  "ws": "^8.9.0",