@ms-cloudpack/api-server 0.63.10 → 0.64.0

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.
Files changed (164) hide show
  1. package/lib/apis/addPackageOverride.d.ts +1 -1
  2. package/lib/apis/addPackageOverride.js +7 -7
  3. package/lib/apis/addPackageOverride.js.map +1 -1
  4. package/lib/apis/ensurePackageBundled.js.map +1 -1
  5. package/lib/apis/getData.d.ts +7 -13
  6. package/lib/apis/getData.d.ts.map +1 -1
  7. package/lib/apis/getData.js +3 -4
  8. package/lib/apis/getData.js.map +1 -1
  9. package/lib/apis/getLinkConfig.d.ts +2 -2
  10. package/lib/apis/getLinkConfig.d.ts.map +1 -1
  11. package/lib/apis/getLinkConfig.js +3 -2
  12. package/lib/apis/getLinkConfig.js.map +1 -1
  13. package/lib/apis/getSessionId.d.ts +2 -6
  14. package/lib/apis/getSessionId.d.ts.map +1 -1
  15. package/lib/apis/getSessionId.js +3 -4
  16. package/lib/apis/getSessionId.js.map +1 -1
  17. package/lib/apis/linkPath.d.ts +29 -3
  18. package/lib/apis/linkPath.js +2 -2
  19. package/lib/apis/linkPath.js.map +1 -1
  20. package/lib/apis/notifyLinkChange.d.ts +2 -2
  21. package/lib/apis/notifyLinkChange.d.ts.map +1 -1
  22. package/lib/apis/notifyLinkChange.js +3 -2
  23. package/lib/apis/notifyLinkChange.js.map +1 -1
  24. package/lib/apis/onDataChanged.d.ts +7 -13
  25. package/lib/apis/onDataChanged.d.ts.map +1 -1
  26. package/lib/apis/onDataChanged.js +3 -7
  27. package/lib/apis/onDataChanged.js.map +1 -1
  28. package/lib/apis/openCodeEditor.d.ts +9 -19
  29. package/lib/apis/openCodeEditor.d.ts.map +1 -1
  30. package/lib/apis/openCodeEditor.js +6 -6
  31. package/lib/apis/openCodeEditor.js.map +1 -1
  32. package/lib/apis/openConfigEditor.d.ts +1 -1
  33. package/lib/apis/openConfigEditor.d.ts.map +1 -1
  34. package/lib/apis/openConfigEditor.js +3 -2
  35. package/lib/apis/openConfigEditor.js.map +1 -1
  36. package/lib/apis/openFilePath.d.ts +6 -12
  37. package/lib/apis/openFilePath.d.ts.map +1 -1
  38. package/lib/apis/openFilePath.js +4 -4
  39. package/lib/apis/openFilePath.js.map +1 -1
  40. package/lib/apis/publishData.d.ts +7 -13
  41. package/lib/apis/publishData.d.ts.map +1 -1
  42. package/lib/apis/publishData.js +3 -3
  43. package/lib/apis/publishData.js.map +1 -1
  44. package/lib/apis/reportSpan.d.ts +10 -20
  45. package/lib/apis/reportSpan.d.ts.map +1 -1
  46. package/lib/apis/reportSpan.js +5 -5
  47. package/lib/apis/reportSpan.js.map +1 -1
  48. package/lib/apis/restartAllTasks.d.ts +1 -1
  49. package/lib/apis/restartAllTasks.d.ts.map +1 -1
  50. package/lib/apis/restartAllTasks.js +14 -7
  51. package/lib/apis/restartAllTasks.js.map +1 -1
  52. package/lib/apis/restartTask.d.ts +4 -18
  53. package/lib/apis/restartTask.d.ts.map +1 -1
  54. package/lib/apis/restartTask.js +6 -5
  55. package/lib/apis/restartTask.js.map +1 -1
  56. package/lib/apis/unlinkPath.d.ts +29 -3
  57. package/lib/apis/unlinkPath.js +2 -2
  58. package/lib/apis/unlinkPath.js.map +1 -1
  59. package/lib/apis/validatePackageOverride.d.ts +1 -1
  60. package/lib/apis/validatePackageOverride.js +5 -8
  61. package/lib/apis/validatePackageOverride.js.map +1 -1
  62. package/lib/common/createApiContext.d.ts.map +1 -1
  63. package/lib/common/createApiContext.js +4 -1
  64. package/lib/common/createApiContext.js.map +1 -1
  65. package/lib/common/createMockContext.d.ts +16 -9
  66. package/lib/common/createMockContext.d.ts.map +1 -1
  67. package/lib/common/createMockContext.js +21 -16
  68. package/lib/common/createMockContext.js.map +1 -1
  69. package/lib/common/createMockSession.d.ts +1 -1
  70. package/lib/common/createMockSession.d.ts.map +1 -1
  71. package/lib/common/createMockSession.js.map +1 -1
  72. package/lib/common/createSession.d.ts +5 -1
  73. package/lib/common/createSession.d.ts.map +1 -1
  74. package/lib/common/createSession.js +1 -1
  75. package/lib/common/createSession.js.map +1 -1
  76. package/lib/data/busSources.d.ts +27 -240
  77. package/lib/data/busSources.d.ts.map +1 -1
  78. package/lib/data/busSources.js +2 -2
  79. package/lib/data/busSources.js.map +1 -1
  80. package/lib/index.d.ts +0 -2
  81. package/lib/index.d.ts.map +1 -1
  82. package/lib/index.js.map +1 -1
  83. package/lib/trpc/common.d.ts +41 -2
  84. package/lib/trpc/common.d.ts.map +1 -1
  85. package/lib/trpc/common.js +44 -3
  86. package/lib/trpc/common.js.map +1 -1
  87. package/lib/types/BundleInfo.d.ts +1 -1
  88. package/lib/types/BundleInfo.d.ts.map +1 -1
  89. package/lib/types/BundleInfo.js.map +1 -1
  90. package/lib/types/LinkPath.d.ts +16 -92
  91. package/lib/types/LinkPath.d.ts.map +1 -1
  92. package/lib/types/LinkPath.js +21 -17
  93. package/lib/types/LinkPath.js.map +1 -1
  94. package/lib/types/Task.d.ts +20 -12
  95. package/lib/types/Task.d.ts.map +1 -1
  96. package/lib/types/Task.js.map +1 -1
  97. package/lib/types/TaskDescription.d.ts +19 -73
  98. package/lib/types/TaskDescription.d.ts.map +1 -1
  99. package/lib/types/TaskDescription.js +15 -12
  100. package/lib/types/TaskDescription.js.map +1 -1
  101. package/lib/types/TaskList.d.ts +6 -115
  102. package/lib/types/TaskList.d.ts.map +1 -1
  103. package/lib/types/TaskList.js +3 -2
  104. package/lib/types/TaskList.js.map +1 -1
  105. package/lib/types/TaskMessage.d.ts +3 -11
  106. package/lib/types/TaskMessage.d.ts.map +1 -1
  107. package/lib/types/TaskMessage.js +4 -4
  108. package/lib/types/TaskMessage.js.map +1 -1
  109. package/lib/types/TaskMessageLocation.d.ts +2 -6
  110. package/lib/types/TaskMessageLocation.d.ts.map +1 -1
  111. package/lib/types/TaskMessageLocation.js +3 -3
  112. package/lib/types/TaskMessageLocation.js.map +1 -1
  113. package/lib/types/TaskStats.d.ts +26 -17
  114. package/lib/types/TaskStats.d.ts.map +1 -1
  115. package/lib/types/TaskStats.js +4 -3
  116. package/lib/types/TaskStats.js.map +1 -1
  117. package/lib/types/Timing.d.ts +8 -18
  118. package/lib/types/Timing.d.ts.map +1 -1
  119. package/lib/types/Timing.js +5 -8
  120. package/lib/types/Timing.js.map +1 -1
  121. package/lib/types/ZodGetLinkConfigOutput.d.ts +2 -2
  122. package/lib/types/ZodGetLinkConfigOutput.d.ts.map +1 -1
  123. package/lib/types/ZodGetLinkConfigOutput.js +12 -10
  124. package/lib/types/ZodGetLinkConfigOutput.js.map +1 -1
  125. package/lib/types/ZodNotifyLinkChangeInput.d.ts +12 -44
  126. package/lib/types/ZodNotifyLinkChangeInput.d.ts.map +1 -1
  127. package/lib/types/ZodNotifyLinkChangeInput.js +7 -3
  128. package/lib/types/ZodNotifyLinkChangeInput.js.map +1 -1
  129. package/lib/types/ZodResolveMap.d.ts +2 -2
  130. package/lib/types/ZodResolveMap.d.ts.map +1 -1
  131. package/lib/types/ZodResolveMap.js +6 -6
  132. package/lib/types/ZodResolveMap.js.map +1 -1
  133. package/lib/utilities/TaskRunner.d.ts +56 -18
  134. package/lib/utilities/TaskRunner.d.ts.map +1 -1
  135. package/lib/utilities/TaskRunner.js +176 -98
  136. package/lib/utilities/TaskRunner.js.map +1 -1
  137. package/lib/utilities/createBundleTask.d.ts.map +1 -1
  138. package/lib/utilities/createBundleTask.js +9 -15
  139. package/lib/utilities/createBundleTask.js.map +1 -1
  140. package/lib/utilities/getConsumedDependencies.d.ts.map +1 -1
  141. package/lib/utilities/getConsumedDependencies.js +3 -0
  142. package/lib/utilities/getConsumedDependencies.js.map +1 -1
  143. package/lib/utilities/getConsumedPaths.d.ts.map +1 -1
  144. package/lib/utilities/getConsumedPaths.js +3 -0
  145. package/lib/utilities/getConsumedPaths.js.map +1 -1
  146. package/lib/utilities/matchingZodObject.d.ts +15 -9
  147. package/lib/utilities/matchingZodObject.d.ts.map +1 -1
  148. package/lib/utilities/matchingZodObject.js +16 -6
  149. package/lib/utilities/matchingZodObject.js.map +1 -1
  150. package/lib/utilities/notifyReload.d.ts.map +1 -1
  151. package/lib/utilities/notifyReload.js +2 -1
  152. package/lib/utilities/notifyReload.js.map +1 -1
  153. package/lib/utilities/waitForBusData.d.ts +2 -2
  154. package/lib/utilities/waitForBusData.d.ts.map +1 -1
  155. package/lib/utilities/waitForBusData.js.map +1 -1
  156. package/package.json +16 -16
  157. package/lib/types/TaskEndDescription.d.ts +0 -26
  158. package/lib/types/TaskEndDescription.d.ts.map +0 -1
  159. package/lib/types/TaskEndDescription.js +0 -8
  160. package/lib/types/TaskEndDescription.js.map +0 -1
  161. package/lib/types/TaskStartDescription.d.ts +0 -19
  162. package/lib/types/TaskStartDescription.d.ts.map +0 -1
  163. package/lib/types/TaskStartDescription.js +0 -8
  164. package/lib/types/TaskStartDescription.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TaskRunner.js","sourceRoot":"","sources":["../../src/utilities/TaskRunner.ts"],"names":[],"mappings":"AAKA,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAwB,MAAM,qBAAqB,CAAC;AAG5F;;;;;;GAMG;AACH,MAAM,OAAO,UAAU;IACb,IAAI,CAAsB;IAC1B,MAAM,CAAS;IACf,UAAU,CAAY;IACtB,aAAa,CAAgC;IAC7C,eAAe,CAAuB;IACtC,cAAc,CAAc;IAC5B,UAAU,CAA6B;IAE/C;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,UAAU,GAAG,mBAAmB,EAAE,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,IAAI,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,IAAI,CA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AAc,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;CACF;AAED,MAAM,mBAAmB,GAAoB,GAAG,EAAE,CAAC,CAAC;IAClD,MAAM,EAAE,MAAM;IACd,cAAc,EAAE,CAAC;IACjB,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,CAAC;CACjB,CAAC,CAAC","sourcesContent":["import type { TaskStartDescription } from '../types/TaskStartDescription.js';\nimport type { TaskEndDescription } from '../types/TaskEndDescription.js';\nimport type { Task } from '../types/Task.js';\nimport type { TaskStats } from '../types/TaskStats.js';\nimport type { TaskList } from '../types/TaskList.js';\nimport PQueue from 'p-queue';\nimport { taskListSource, taskStatsSource, type TaskDescription } from '../index.browser.js';\nimport type { DataBus } from '@ms-cloudpack/data-bus';\n\n/**\n * TaskRunner tracks the status of tasks, manages concurrency, allows reusing task results,\n * and sends notifications about task status to the data bus (currently just used for `start`).\n *\n * NOTE: To enable data bus notifications, you must call `connectToBus()`.\n * `createApiContext` does this with the `taskRunner` passed in.\n */\nexport class TaskRunner {\n private _bus: DataBus | undefined;\n private _queue: PQueue;\n private _taskStats: TaskStats;\n private _pendingTasks: Map<string, Promise<unknown>>;\n private _completedTasks: Map<string, unknown>;\n private _requiresRerun: Set<string>;\n private _prevTasks: Map<string, Task<unknown>>;\n\n constructor() {\n this._queue = new PQueue({ concurrency: 10 });\n this._taskStats = getDefaultTaskStats();\n this._pendingTasks = new Map();\n this._completedTasks = new Map();\n this._requiresRerun = new Set();\n this._prevTasks = new Map();\n }\n\n /**\n * Connects the TaskRunner to the data bus. Tasks will still run without this, but they won't\n * send any notifications to a client (which only matters if a client is listening, e.g.\n * the browser while running `start`).\n */\n public connectToBus(bus: DataBus): void {\n this._bus = bus;\n }\n\n /**\n * Enqueue a task and return its result promise.\n *\n * If a task with the same `id` was already added, it returns either the previous result\n * (if completed) or the promise (if pending). Pass `options.rerun` to force re-running.\n */\n add<TReturn>(\n task: Task<TReturn>,\n options?: {\n rerun?: boolean;\n priority?: number;\n },\n ): Promise<TReturn> {\n const { name, id, execute } = task;\n const { rerun, priority } = options || {};\n\n if (!this._prevTasks.has(id)) {\n this._prevTasks.set(id, task as Task<unknown>);\n }\n\n // Check if we are already completed the task with that id.\n const action = this._completedTasks.get(id) as TReturn | undefined;\n if (action !== undefined && !rerun) {\n return Promise.resolve(action);\n }\n\n // Check if we are already running the task with that id.\n const pending = this._pendingTasks.get(id) as Promise<TReturn> | undefined;\n if (pending !== undefined) {\n if (rerun) {\n this._requiresRerun.add(id);\n }\n return pending;\n }\n\n const resultPromise: Promise<TReturn> = (async () => {\n let taskResult: TReturn | undefined;\n\n do {\n // Delete from rerun list (if present).\n this._requiresRerun.delete(id);\n\n taskResult = await this._queue.add(\n execute,\n // Removes void from return type.\n // Read more on: https://github.com/sindresorhus/p-queue/issues/175\n { throwOnTimeout: true, priority },\n );\n } while (this._requiresRerun.has(id));\n\n // Delete from pending list.\n this._pendingTasks.delete(id);\n if (task.getEndDescription) {\n this._reportEnd(id, task.getEndDescription(taskResult));\n }\n\n // Extra check to ensure that the task returned a value.\n // It should never throw, if it does we have a bug.\n if (taskResult === undefined) {\n throw new Error(`Task \"${name}:${id}\" returned undefined, without throwing an error, which was unexpected.`);\n }\n\n // Update finished Tasks.\n this._completedTasks.set(id, taskResult);\n\n return taskResult;\n })();\n\n this._pendingTasks.set(id, resultPromise);\n this._completedTasks.delete(id);\n if (task.getStartDescription) {\n this._reportStart(id, task.getStartDescription());\n }\n\n return resultPromise;\n }\n\n /**\n * The remove method disposes a task if available\n * and then removes it from the TaskRunner.\n *\n * This is useful when the state of a task needs to be cleared.\n *\n * It is intended to be used by the api server\n * to clear the TaskRunner's state before reloading the page.\n */\n remove(id: string): void {\n this._prevTasks\n .get(id)\n ?.dispose?.()\n .catch(() => {\n console.debug(`Error disposing task: ${id}`);\n });\n this._prevTasks.get(id)?.onDispose?.();\n this._prevTasks.delete(id);\n this._requiresRerun.delete(id);\n if (this._pendingTasks.has(id)) {\n this._pendingTasks.delete(id);\n this._taskStats.remainingTasks = this._pendingTasks.size;\n }\n this._completedTasks.delete(id);\n }\n /**\n * The clear method disposes all tasks and clears the TaskRunner.\n */\n clear(): void {\n this._taskStats = getDefaultTaskStats();\n this._bus?.publish(taskListSource, { tasks: [] });\n\n for (const id of this._prevTasks.keys()) {\n this.remove(id);\n }\n }\n\n /** Pauses the TaskRunner (for testing). */\n _pause(): void {\n this._queue.pause();\n }\n\n /** Starts or resumes the TaskRunner (for testing). */\n _start(): void {\n this._queue.start();\n }\n\n /**\n * Internal method to report the start of a task to the bus.\n */\n private _reportStart(id: string, description: TaskStartDescription): void {\n if (!this._bus) return;\n\n const bus = this._bus;\n const { tasks } = bus.getData<TaskList>(taskListSource.path) || { tasks: [] };\n const index = tasks.findIndex((t) => t.id === id);\n const previousDescription = tasks[index];\n const now = new Date().getTime();\n\n if (!previousDescription) {\n this._taskStats.totalTasks++;\n }\n\n if (previousDescription?.status === 'complete') {\n this._taskStats.totalErrors -= previousDescription.errors?.length || 0;\n this._taskStats.totalWarnings -= previousDescription.warnings?.length || 0;\n }\n\n this._taskStats.remainingTasks = this._pendingTasks.size;\n this._taskStats.status = 'pending';\n\n const task: TaskDescription = {\n ...description,\n status: 'pending',\n startTime: now,\n };\n if (index === -1) {\n tasks.push(task);\n } else {\n tasks[index] = task;\n }\n\n bus.publish(taskStatsSource, this._taskStats);\n bus.publish(taskListSource, { tasks });\n }\n\n /**\n * Internal method to report the end of a task to the bus.\n */\n private _reportEnd(id: string, description: TaskEndDescription): void {\n if (!this._bus) return;\n\n const bus = this._bus;\n const { tasks } = bus.getData<TaskList>(taskListSource.path) || { tasks: [] };\n const index = tasks.findIndex((t) => t.id === id);\n const previousDescription = tasks[index];\n const now = new Date().getTime();\n\n if (previousDescription) {\n this._taskStats.remainingTasks = this._pendingTasks.size;\n this._taskStats.totalErrors += description?.errors?.length || 0;\n this._taskStats.totalWarnings += description?.warnings?.length || 0;\n\n tasks[index] = {\n ...previousDescription,\n ...description,\n status: 'complete',\n durationMilliseconds: now - previousDescription.startTime,\n lastUpdated: now,\n };\n\n if (this._taskStats.remainingTasks === 0) {\n this._taskStats.status = 'idle';\n }\n\n bus.publish(taskStatsSource, this._taskStats);\n bus.publish(taskListSource, { tasks });\n }\n }\n}\n\nconst getDefaultTaskStats: () => TaskStats = () => ({\n status: 'idle',\n remainingTasks: 0,\n totalTasks: 0,\n totalErrors: 0,\n totalWarnings: 0,\n});\n"]}
1
+ {"version":3,"file":"TaskRunner.js","sourceRoot":"","sources":["../../src/utilities/TaskRunner.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAaxE;;;;;;;GAOG;AACH,MAAM,OAAO,UAAU;IACb,IAAI,CAAsB;IACjB,MAAM,CAAS;IAChC,2EAA2E;IACnE,WAAW,CAAiB;IACpC;;;OAGG;IACc,aAAa,CAAgC;IAC9D,gCAAgC;IACf,eAAe,CAAuB;IACvD;;;OAGG;IACc,cAAc,CAAc;IAC7C,sDAAsD;IACrC,SAAS,CAA6B;IAEvD;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,EAAE,WAAW,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;QAC1F,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,IAAI,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,IAAI,UA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;IAED,sEAAsE;IAC9D,iBAAiB,CAAC,EAAU;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,OAAO,CAAW,cAAc,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC;QAC7E,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QAClD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACK,eAAe,CAAC,MAAsD;QAC5E,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QAChC,yCAAyC;QACzC,KAAK,IAAI,IAAI,CAAC,IAAI,EAAE,OAAO,CAAY,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9E,KAAK,IAAI,IAAI,CAAC,IAAI,EAAE,OAAO,CAAW,cAAc,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACxE,CAAC;CACF","sourcesContent":["import type { DataBus } from '@ms-cloudpack/data-bus';\nimport PQueue from 'p-queue';\nimport { taskListSource, taskStatsSource } from '../data/busSources.js';\nimport type { Task, TaskEndDescription } from '../types/Task.js';\nimport type { TaskDescription } from '../types/TaskDescription.js';\nimport type { TaskList } from '../types/TaskList.js';\nimport type { TaskStats } from '../types/TaskStats.js';\n\ninterface TaskIssueStats extends Pick<TaskStats, 'totalErrors' | 'totalWarnings'> {\n /** Mapping from ID to count */\n taskWarnings: Record<string, number>;\n /** Mapping from ID to count */\n taskErrors: Record<string, number>;\n}\n\n/**\n * TaskRunner tracks the status of tasks, manages concurrency, allows reusing task results,\n * and sends notifications about task status to the data bus (currently just used for `start`).\n *\n * NOTE: To enable data bus notifications, you must call `connectToBus()`.\n * `createApiContext` does this with the `taskRunner` passed in.\n * (`createPartialApiContext` does not create or connect a data bus.)\n */\nexport class TaskRunner {\n private _bus: DataBus | undefined;\n private readonly _queue: PQueue;\n /** Stats about task errors/warnings, only updated if a bus is connected */\n private _taskIssues: TaskIssueStats;\n /**\n * Tasks that are currently either running or waiting. (Note that `PQeueue`'s definition of\n * \"pending\" is slightly different: it only counts tasks that are currently running.)\n */\n private readonly _pendingTasks: Map<string, Promise<unknown>>;\n /** Tasks that have completed */\n private readonly _completedTasks: Map<string, unknown>;\n /**\n * Task IDs where a re-run was requested while the task was running.\n * We let the current task finish, and then re-run it.\n */\n private readonly _requiresRerun: Set<string>;\n /** All previously-seen tasks (regardless of state) */\n private readonly _allTasks: Map<string, Task<unknown>>;\n\n constructor() {\n this._queue = new PQueue({ concurrency: 10 });\n this._taskIssues = { totalErrors: 0, totalWarnings: 0, taskWarnings: {}, taskErrors: {} };\n this._pendingTasks = new Map();\n this._completedTasks = new Map();\n this._requiresRerun = new Set();\n this._allTasks = new Map();\n }\n\n /**\n * Get current task stats. Public for testing.\n * @internal\n */\n get _taskStats(): Readonly<TaskStats> {\n return {\n status: this._pendingTasks.size ? 'pending' : 'idle',\n remainingTasks: this._pendingTasks.size,\n totalTasks: this._allTasks.size,\n totalErrors: this._taskIssues.totalErrors,\n totalWarnings: this._taskIssues.totalWarnings,\n };\n }\n\n /**\n * Connects the TaskRunner to the data bus. Tasks will still run without this, but they won't\n * send any notifications to a client (which only matters if a client is listening, e.g.\n * the browser while running `start`).\n */\n public connectToBus(bus: DataBus): void {\n this._bus = bus;\n }\n\n /**\n * Enqueue a task and return its result promise.\n *\n * If a task with the same `id` was already added, it returns either the previous result\n * (if completed) or the promise (if pending). Pass `options.rerun` to force re-running.\n *\n * (Note that any re-runs will use the *original* task function, not the new one.\n * If something has changed that requires a new task function, you should incorporate this\n * into the `id`.)\n */\n add<TReturn>(\n task: Task<TReturn>,\n options?: {\n rerun?: boolean;\n priority?: number;\n },\n ): Promise<TReturn> {\n const { name, id, execute } = task;\n const { rerun, priority } = options || {};\n\n if (!this._allTasks.has(id)) {\n this._allTasks.set(id, task as Task<unknown>);\n }\n\n // Check if we are already completed the task with that id.\n const action = this._completedTasks.get(id) as TReturn | undefined;\n if (action !== undefined && !rerun) {\n return Promise.resolve(action);\n }\n\n // Check if we are already running the task with that id.\n const pending = this._pendingTasks.get(id) as Promise<TReturn> | undefined;\n if (pending !== undefined) {\n if (rerun) {\n this._requiresRerun.add(id);\n }\n return pending;\n }\n\n const resultPromise: Promise<TReturn> = (async () => {\n let taskResult: TReturn | undefined;\n let taskError: unknown;\n\n try {\n do {\n // Delete from rerun list (if present).\n this._requiresRerun.delete(id);\n\n taskResult = await this._queue.add(\n execute,\n // Removes void from return type.\n // Read more on: https://github.com/sindresorhus/p-queue/issues/175\n { throwOnTimeout: true, priority },\n );\n } while (this._requiresRerun.has(id));\n } catch (error) {\n taskError = error;\n // Re-throw the error, but `finally` will handle completion\n throw error;\n } finally {\n // Delete from pending list.\n this._pendingTasks.delete(id);\n\n this._reportEnd(task, taskResult, taskError);\n }\n\n // Extra check to ensure that the task returned a value.\n // It should never throw, if it does we have a bug.\n if (taskResult === undefined) {\n throw new Error(`Task \"${name}:${id}\" returned undefined, without throwing an error, which was unexpected.`);\n }\n\n // Update finished Tasks.\n this._completedTasks.set(id, taskResult);\n\n return taskResult;\n })();\n\n this._pendingTasks.set(id, resultPromise);\n const wasCompleted = this._completedTasks.delete(id);\n if (wasCompleted) {\n this._removeTaskIssues(task.id);\n }\n\n this._reportStart<TReturn>(task);\n\n return resultPromise;\n }\n\n /**\n * Dispose in-memory resources of all tasks and clear the TaskRunner's state.\n */\n // NOTE: This is also used by clearAllResults(), so if it's updated to do anything that\n // renders the TaskRunner unusable/finished, the common parts should be refactored out.\n dispose(): void {\n this._queue.clear();\n for (const task of this._allTasks.values()) {\n task.dispose?.();\n }\n this._allTasks.clear();\n this._pendingTasks.clear();\n this._completedTasks.clear();\n this._requiresRerun.clear();\n this._taskIssues = { totalErrors: 0, totalWarnings: 0, taskWarnings: {}, taskErrors: {} };\n }\n\n /**\n * Clear the result of a specific task (could involve deleting files from disk) and remove\n * it from the TaskRunner's task records.\n */\n async clearResult(id: string): Promise<void> {\n const task = this._allTasks.get(id);\n task?.dispose?.();\n await task?.clear?.();\n\n this._allTasks.delete(id);\n this._requiresRerun.delete(id);\n this._pendingTasks.delete(id);\n this._completedTasks.delete(id);\n this._removeTaskIssues(id);\n\n if (this._bus) {\n const { tasks, index } = this._findFromTaskList(id);\n if (index !== -1) {\n tasks.splice(index, 1);\n this._publishUpdates({ tasks, stats: true });\n }\n }\n }\n\n /**\n * Clear the results of all tasks (might include deleting files on disk) and clear the\n * TaskRunner's task records.\n *\n * (To only dispose in-memory resources, use `dispose()`.)\n */\n async clearAllResults(): Promise<void> {\n // Publish the empty task list first since deleting things might take awhile.\n this._publishUpdates({ tasks: [] });\n\n for (const task of this._allTasks.values()) {\n task.dispose?.();\n await task.clear?.();\n }\n this.dispose();\n\n // Publish new stats after clearing everything (otherwise the calculated values will be wrong)\n this._publishUpdates({ stats: true });\n }\n\n /**\n * Pauses the TaskRunner (for testing).\n * @internal\n */\n _pause(): void {\n this._queue.pause();\n }\n\n /**\n * Starts or resumes the TaskRunner (for testing).\n * @internal\n */\n _start(): void {\n this._queue.start();\n }\n\n /** Remove any records of previous issues with this task from the totals */\n private _removeTaskIssues(id: string): void {\n this._taskIssues.totalErrors -= this._taskIssues.taskErrors[id] || 0;\n this._taskIssues.totalWarnings -= this._taskIssues.taskWarnings[id] || 0;\n delete this._taskIssues.taskErrors[id];\n delete this._taskIssues.taskWarnings[id];\n }\n\n /**\n * Internal method to report the start of a task to the bus.\n */\n private _reportStart<TReturn>(task: Task<TReturn>): void {\n if (!this._bus || !task.getStartDescription) return;\n\n const { tasks, index } = this._findFromTaskList(task.id);\n\n const taskDesc: TaskDescription = {\n id: task.id,\n name: task.name,\n ...task.getStartDescription(),\n status: 'pending',\n startTime: Date.now(),\n };\n if (index === -1) {\n tasks.push(taskDesc);\n } else {\n tasks[index] = taskDesc;\n }\n\n this._publishUpdates({ tasks, stats: true });\n }\n\n /**\n * Internal method to report the end of a task to the bus.\n */\n private _reportEnd<TReturn>(task: Task<TReturn>, taskResult: TReturn | undefined, taskError: unknown): void {\n if (!this._bus || !task.getEndDescription) return;\n\n // Replace the usual description with an error if relevant\n const description: TaskEndDescription = taskError\n ? {\n errors: [\n {\n source: 'running task',\n text: taskError instanceof Error ? taskError.stack || taskError.message : String(taskError),\n },\n ],\n }\n : task.getEndDescription(taskResult);\n const errorCount = description.errors?.length || 0;\n const warningCount = description.warnings?.length || 0;\n if (errorCount) {\n this._taskIssues.taskErrors[task.id] = errorCount;\n this._taskIssues.totalErrors += errorCount;\n }\n if (warningCount) {\n this._taskIssues.taskWarnings[task.id] = warningCount;\n this._taskIssues.totalWarnings += warningCount;\n }\n\n const { tasks, index } = this._findFromTaskList(task.id);\n const startDescription = tasks[index];\n\n if (startDescription) {\n const now = Date.now();\n tasks[index] = {\n ...startDescription,\n ...description,\n status: 'complete',\n duration: now - startDescription.startTime,\n lastUpdated: now,\n };\n\n this._publishUpdates({ tasks, stats: true });\n }\n }\n\n /** Get the task list from the data bus, and find the task's index. */\n private _findFromTaskList(id: string): { tasks: TaskDescription[]; index: number } {\n const tasks = this._bus?.getData<TaskList>(taskListSource.path)?.tasks || [];\n const index = tasks.findIndex((t) => t.id === id);\n return { tasks, index };\n }\n\n /**\n * Publish tasks and/or stats to the data bus.\n */\n private _publishUpdates(params: { tasks?: TaskDescription[]; stats?: boolean }): void {\n const { tasks, stats } = params;\n // Publish using .path for easier testing\n stats && this._bus?.publish<TaskStats>(taskStatsSource.path, this._taskStats);\n tasks && this._bus?.publish<TaskList>(taskListSource.path, { tasks });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"createBundleTask.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAc,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,iBAAiB,GACxB,cAAc,CAAC,eAAe,EAAE,MAAM,iBAAiB,CAAC,SAAS,CAAC,GAAG,WAAW,GAAG,oBAAoB,GAAG,MAAM,CAAC,GAClH,IAAI,CAAC,aAAa,CAAC,CAkErB"}
1
+ {"version":3,"file":"createBundleTask.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAc,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,iBAAiB,GACxB,cAAc,CAAC,eAAe,EAAE,MAAM,iBAAiB,CAAC,SAAS,CAAC,GAAG,WAAW,GAAG,oBAAoB,GAAG,MAAM,CAAC,GAClH,IAAI,CAAC,aAAa,CAAC,CA6DrB"}
@@ -1,6 +1,5 @@
1
1
  import { addImportMapHash } from '@ms-cloudpack/import-map';
2
- import fs from 'fs';
3
- import path from 'path';
2
+ import fsPromises from 'fs/promises';
4
3
  import { bundleTask } from './bundleTask.js';
5
4
  /**
6
5
  * Create a bundle task (internally calls `bundleTask()`) that can be executed by the server's TaskRunner.
@@ -16,8 +15,6 @@ export function createBundleTask(options, context) {
16
15
  // Name for task runner logging.
17
16
  name,
18
17
  id,
19
- dir: `${path.join(packagePath, 'src')}`,
20
- watch: !isExternal,
21
18
  async execute() {
22
19
  await bundleTask(options, context);
23
20
  try {
@@ -35,34 +32,31 @@ export function createBundleTask(options, context) {
35
32
  }
36
33
  return bundleRequest;
37
34
  },
38
- clear: () => {
39
- if (!bundleRequest.result?.outputPath) {
35
+ clear: async () => {
36
+ if (!bundleRequest.result) {
40
37
  return;
41
38
  }
42
39
  bundleRequest.result.dispose?.();
43
40
  try {
44
- fs.rmSync(bundleRequest.result.outputPath, { recursive: true, force: true });
41
+ if (bundleRequest.result.outputPath) {
42
+ await fsPromises.rm(bundleRequest.result.outputPath, { recursive: true, force: true, maxRetries: 2 });
43
+ }
45
44
  }
46
45
  catch {
47
46
  console.warn(`Error clearing bundle output path (likely due to a file lock): ${bundleRequest.result.outputPath}`);
48
47
  }
49
48
  bundleRequest.result = undefined;
50
49
  },
51
- onDispose: () => {
50
+ dispose: () => {
52
51
  bundleRequest.result?.dispose?.();
53
52
  },
54
- getErrors: () => bundleRequest.result?.errors,
55
53
  getStartDescription: () => ({
56
- id,
57
- // Name to display in the overlay.
58
- name,
59
- inputPath: packagePath || '',
54
+ inputPath: packagePath,
60
55
  }),
61
56
  getEndDescription: (taskResult) => ({
62
- id,
63
57
  errors: taskResult?.result?.errors,
64
58
  warnings: taskResult?.result?.warnings,
65
- outputPath: bundleRequest.result?.outputPath || '',
59
+ outputPath: bundleRequest.result?.outputPath,
66
60
  }),
67
61
  };
68
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAkD,MAAM,iBAAiB,CAAC;AAG7F;;;GAGG;AACH,MAA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CAAC;YAED,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,KAAK,EAAE,GAAG,EAAE;YACV,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC;gBACtC,OAAO;YACT,CAAC;YAED,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YAEjC,IAAI,CAAC;gBACH,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC/E,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,CAAC,IAAI,CACV,kEAAkE,aAAa,CAAC,MAAM,CAAC,UAAU,EAAE,CACpG,CAAC;YACJ,CAAC;YAED,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;QACnC,CAAC;QACD,SAAS,EAAE,GAAG,EAAE;YACd,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;QACpC,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM;QAC7C,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC1B,EAAE;YACF,kCAAkC;YAClC,IAAI;YACJ,SAAS,EAAE,WAAW,IAAI,EAAE;SAC7B,CAAC;QACF,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAClC,EAAE;YACF,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM;YAClC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ;YACtC,UAAU,EAAE,aAAa,CAAC,MAAM,EAAE,UAAU,IAAI,EAAE;SACnD,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import { addImportMapHash } from '@ms-cloudpack/import-map';\nimport fs from 'fs';\nimport path from 'path';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { Task } from '../types/Task.js';\nimport { bundleTask, type BundleTaskContext, type BundleTaskOptions } from './bundleTask.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Create a bundle task (internally calls `bundleTask()`) that can be executed by the server's TaskRunner.\n * This allows active tasks to be tracked remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(\n options: BundleTaskOptions,\n context: BundleTaskContext &\n PartialContext<'packageHashes', keyof BundleTaskContext['session'] | 'importMap' | 'packageImportPaths' | 'urls'>,\n): Task<BundleRequest> {\n const { bundleRequest } = options;\n const { id, packageName, version, packagePath, isExternal, targetEnvironment } = bundleRequest;\n const { packageHashes, session } = context;\n const { hash, sourceHash } = options;\n const name = `Bundle ${packageName}@${version}`;\n\n return {\n // Name for task runner logging.\n name,\n id,\n dir: `${path.join(packagePath, 'src')}`,\n watch: !isExternal,\n async execute(): Promise<BundleRequest> {\n await bundleTask(options, context);\n\n try {\n // Add a hash to the import map for this package.\n // (Read the session properties here rather than above because they might not be set yet.)\n if (session.importMap && session.urls.bundleServer && session.urls.appServer) {\n const importMapHash =\n sourceHash ||\n hash ||\n (await packageHashes.get({ packagePath, isSourceHashingEnabled: !isExternal, targetEnvironment }));\n addImportMapHash({ packageName, version, hash: importMapHash }, context);\n }\n } catch (e) {\n console.error(`Error adding hash to import map for ${bundleRequest.packagePath}:`, (e as Error).stack || e);\n }\n\n return bundleRequest;\n },\n clear: () => {\n if (!bundleRequest.result?.outputPath) {\n return;\n }\n\n bundleRequest.result.dispose?.();\n\n try {\n fs.rmSync(bundleRequest.result.outputPath, { recursive: true, force: true });\n } catch {\n console.warn(\n `Error clearing bundle output path (likely due to a file lock): ${bundleRequest.result.outputPath}`,\n );\n }\n\n bundleRequest.result = undefined;\n },\n onDispose: () => {\n bundleRequest.result?.dispose?.();\n },\n getErrors: () => bundleRequest.result?.errors,\n getStartDescription: () => ({\n id,\n // Name to display in the overlay.\n name,\n inputPath: packagePath || '',\n }),\n getEndDescription: (taskResult) => ({\n id,\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n outputPath: bundleRequest.result?.outputPath || '',\n }),\n };\n}\n"]}
1
+ {"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,UAAU,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,UAAU,EAAkD,MAAM,iBAAiB,CAAC;AAG7F;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAA0B,EAC1B,OACmH;IAEnH,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,aAAa,CAAC;IAC/F,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC3C,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACrC,MAAM,IAAI,GAAG,UAAU,WAAW,IAAI,OAAO,EAAE,CAAC;IAEhD,OAAO;QACL,gCAAgC;QAChC,IAAI;QACJ,EAAE;QACF,KAAK,CAAC,OAAO;YACX,MAAM,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAEnC,IAAI,CAAC;gBACH,iDAAiD;gBACjD,0FAA0F;gBAC1F,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;oBAC7E,MAAM,aAAa,GACjB,UAAU;wBACV,IAAI;wBACJ,CAAC,MAAM,aAAa,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC;oBACrG,gBAAgB,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAA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;AACJ,CAAC","sourcesContent":["import { addImportMapHash } from '@ms-cloudpack/import-map';\nimport fsPromises from 'fs/promises';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { Task } from '../types/Task.js';\nimport { bundleTask, type BundleTaskContext, type BundleTaskOptions } from './bundleTask.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Create a bundle task (internally calls `bundleTask()`) that can be executed by the server's TaskRunner.\n * This allows active tasks to be tracked remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(\n options: BundleTaskOptions,\n context: BundleTaskContext &\n PartialContext<'packageHashes', keyof BundleTaskContext['session'] | 'importMap' | 'packageImportPaths' | 'urls'>,\n): Task<BundleRequest> {\n const { bundleRequest } = options;\n const { id, packageName, version, packagePath, isExternal, targetEnvironment } = bundleRequest;\n const { packageHashes, session } = context;\n const { hash, sourceHash } = options;\n const name = `Bundle ${packageName}@${version}`;\n\n return {\n // Name for task runner logging.\n name,\n id,\n async execute(): Promise<BundleRequest> {\n await bundleTask(options, context);\n\n try {\n // Add a hash to the import map for this package.\n // (Read the session properties here rather than above because they might not be set yet.)\n if (session.importMap && session.urls.bundleServer && session.urls.appServer) {\n const importMapHash =\n sourceHash ||\n hash ||\n (await packageHashes.get({ packagePath, isSourceHashingEnabled: !isExternal, targetEnvironment }));\n addImportMapHash({ packageName, version, hash: importMapHash }, context);\n }\n } catch (e) {\n console.error(`Error adding hash to import map for ${bundleRequest.packagePath}:`, (e as Error).stack || e);\n }\n\n return bundleRequest;\n },\n clear: async () => {\n if (!bundleRequest.result) {\n return;\n }\n\n bundleRequest.result.dispose?.();\n\n try {\n if (bundleRequest.result.outputPath) {\n await fsPromises.rm(bundleRequest.result.outputPath, { recursive: true, force: true, maxRetries: 2 });\n }\n } catch {\n console.warn(\n `Error clearing bundle output path (likely due to a file lock): ${bundleRequest.result.outputPath}`,\n );\n }\n\n bundleRequest.result = undefined;\n },\n dispose: () => {\n bundleRequest.result?.dispose?.();\n },\n getStartDescription: () => ({\n inputPath: packagePath,\n }),\n getEndDescription: (taskResult) => ({\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n outputPath: bundleRequest.result?.outputPath,\n }),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getConsumedDependencies.d.ts","sourceRoot":"","sources":["../../src/utilities/getConsumedDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAWrE"}
1
+ {"version":3,"file":"getConsumedDependencies.d.ts","sourceRoot":"","sources":["../../src/utilities/getConsumedDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAcrE"}
@@ -7,6 +7,9 @@ export function getConsumedDependencies(info) {
7
7
  const consumedDependencies = new Set();
8
8
  // Iterate through imports and find their path from the resolve map.
9
9
  for (const entryInfo of Object.values(info)) {
10
+ if (!entryInfo) {
11
+ continue; // This is to make type-checking happy
12
+ }
10
13
  // iterate through all package names of result.info.consumes
11
14
  for (const consume of entryInfo.consumes) {
12
15
  consumedDependencies.add(consume.packageName);
@@ -1 +1 @@
1
- {"version":3,"file":"getConsumedDependencies.js","sourceRoot":"","sources":["../../src/utilities/getConsumedDependencies.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAgB;IACtD,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/C,oEAAoE;IACpE,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5C,4DAA4D;QAC5D,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;YACzC,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,OAAO,oBAAoB,CAAC;AAC9B,CAAC","sourcesContent":["import type { BundleInfo } from '../types/BundleInfo.js';\n\n/**\n * Get the set of dependencies consumed by the given bundle info.\n * @param info - The bundle info.\n * @returns The deduplicated set of dependencies consumed by the given bundle info.\n */\nexport function getConsumedDependencies(info: BundleInfo): Set<string> {\n const consumedDependencies = new Set<string>();\n // Iterate through imports and find their path from the resolve map.\n for (const entryInfo of Object.values(info)) {\n // iterate through all package names of result.info.consumes\n for (const consume of entryInfo.consumes) {\n consumedDependencies.add(consume.packageName);\n }\n }\n\n return consumedDependencies;\n}\n"]}
1
+ {"version":3,"file":"getConsumedDependencies.js","sourceRoot":"","sources":["../../src/utilities/getConsumedDependencies.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAgB;IACtD,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/C,oEAAoE;IACpE,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,SAAS,CAAC,sCAAsC;QAClD,CAAC;QACD,4DAA4D;QAC5D,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;YACzC,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,OAAO,oBAAoB,CAAC;AAC9B,CAAC","sourcesContent":["import type { BundleInfo } from '../types/BundleInfo.js';\n\n/**\n * Get the set of dependencies consumed by the given bundle info.\n * @param info - The bundle info.\n * @returns The deduplicated set of dependencies consumed by the given bundle info.\n */\nexport function getConsumedDependencies(info: BundleInfo): Set<string> {\n const consumedDependencies = new Set<string>();\n // Iterate through imports and find their path from the resolve map.\n for (const entryInfo of Object.values(info)) {\n if (!entryInfo) {\n continue; // This is to make type-checking happy\n }\n // iterate through all package names of result.info.consumes\n for (const consume of entryInfo.consumes) {\n consumedDependencies.add(consume.packageName);\n }\n }\n\n return consumedDependencies;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getConsumedPaths.d.ts","sourceRoot":"","sources":["../../src/utilities/getConsumedPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAY9E"}
1
+ {"version":3,"file":"getConsumedPaths.d.ts","sourceRoot":"","sources":["../../src/utilities/getConsumedPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAe9E"}
@@ -7,6 +7,9 @@ export function getConsumedPaths(info) {
7
7
  const consumedPaths = {};
8
8
  // Iterate through imports and find their path from the resolve map.
9
9
  for (const entryInfo of Object.values(info)) {
10
+ if (!entryInfo) {
11
+ continue; // This is to make type-checking happy
12
+ }
10
13
  // iterate through all package names of result.info.consumes
11
14
  for (const consume of entryInfo.consumes) {
12
15
  consumedPaths[consume.packageName] ??= new Set();
@@ -1 +1 @@
1
- {"version":3,"file":"getConsumedPaths.js","sourceRoot":"","sources":["../../src/utilities/getConsumedPaths.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAgB;IAC/C,MAAM,aAAa,GAAgC,EAAE,CAAC;IACtD,oEAAoE;IACpE,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5C,4DAA4D;QAC5D,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;YACzC,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC;YACjD,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import type { BundleInfo } from '../types/BundleInfo.js';\n\n/**\n * Get a record of the consumed dependencies and their import paths by the given bundle info.\n * @param info - The bundle info.\n * @returns The record of consumed dependencies and their import paths.\n */\nexport function getConsumedPaths(info: BundleInfo): Record<string, Set<string>> {\n const consumedPaths: Record<string, Set<string>> = {};\n // Iterate through imports and find their path from the resolve map.\n for (const entryInfo of Object.values(info)) {\n // iterate through all package names of result.info.consumes\n for (const consume of entryInfo.consumes) {\n consumedPaths[consume.packageName] ??= new Set();\n consumedPaths[consume.packageName].add(consume.importPath);\n }\n }\n\n return consumedPaths;\n}\n"]}
1
+ {"version":3,"file":"getConsumedPaths.js","sourceRoot":"","sources":["../../src/utilities/getConsumedPaths.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAgB;IAC/C,MAAM,aAAa,GAAgC,EAAE,CAAC;IACtD,oEAAoE;IACpE,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,SAAS,CAAC,sCAAsC;QAClD,CAAC;QACD,4DAA4D;QAC5D,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;YACzC,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC;YACjD,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import type { BundleInfo } from '../types/BundleInfo.js';\n\n/**\n * Get a record of the consumed dependencies and their import paths by the given bundle info.\n * @param info - The bundle info.\n * @returns The record of consumed dependencies and their import paths.\n */\nexport function getConsumedPaths(info: BundleInfo): Record<string, Set<string>> {\n const consumedPaths: Record<string, Set<string>> = {};\n // Iterate through imports and find their path from the resolve map.\n for (const entryInfo of Object.values(info)) {\n if (!entryInfo) {\n continue; // This is to make type-checking happy\n }\n // iterate through all package names of result.info.consumes\n for (const consume of entryInfo.consumes) {\n consumedPaths[consume.packageName] ??= new Set();\n consumedPaths[consume.packageName].add(consume.importPath);\n }\n }\n\n return consumedPaths;\n}\n"]}
@@ -1,19 +1,25 @@
1
- import { z } from 'zod';
1
+ import { z } from 'zod/v4-mini';
2
2
  /**
3
3
  * Zod shape object matching type `T`, with any optional properties remapped to required properties
4
4
  * with type `originalType | undefined`.
5
5
  */
6
- type MatchingZodShape<T extends object> = {
7
- [k in keyof Required<T>]: z.ZodType<T[k]>;
6
+ export type MatchingZodShape<T extends object> = {
7
+ [K in keyof Required<T>]: Omit<T, K> extends T ? z.ZodMiniOptional<z.ZodMiniType<T[K], T[K]>> : z.ZodMiniType<T[K], T[K]>;
8
8
  };
9
- type MatchingZodObject<T extends object> = z.ZodObject<MatchingZodShape<T>, 'strict', z.ZodTypeAny, T, T>;
10
9
  /**
11
10
  * Get a Zod object that strictly matches the expected type, including any optional properties.
11
+ * (Does not provide the same guarantee for nested object types.)
12
12
  *
13
- * Defining TS types first and using this helper to ensure matching zod objects (rather than
14
- * defining the zod type first and using `infer`) helps reduce type explosion in intellisense
15
- * and API reports, and allows reusing types that are already defined elsewhere.
13
+ * Using this helper instead of `const ZodFoo = z.object({...}); type Foo = z.infer<typeof ZodFoo>;`
14
+ * is recommended in cases where the original type is defined elsewhere (such as in `common-types`),
15
+ * to ensure all the properties stay in sync.
16
16
  */
17
- export declare function matchingZodObject<Expected extends object>(shape: MatchingZodShape<Expected>): MatchingZodObject<Expected>;
18
- export {};
17
+ export declare function matchingZodObject<Expected extends object>(shape: MatchingZodShape<Expected>): z.ZodMiniObject<MatchingZodShape<Expected>, z.core.$strict>;
18
+ /**
19
+ * Like `matchingZodObject`, but pass through any extra properties that aren't defined in the shape.
20
+ * (The return type omits the index signature to ensure that the shape is still strictly typed.)
21
+ *
22
+ * See `matchingZodObject` comment for more details.
23
+ */
24
+ export declare function matchingZodObjectLoose<Expected extends object>(shape: MatchingZodShape<Expected>): z.ZodMiniObject<MatchingZodShape<Expected>, z.core.$loose>;
19
25
  //# sourceMappingURL=matchingZodObject.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"matchingZodObject.d.ts","sourceRoot":"","sources":["../../src/utilities/matchingZodObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,KAAK,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI;KACvC,CAAC,IAAI,MAAM,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC1C,CAAC;AAEF,KAAK,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1G;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,MAAM,EACvD,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC,GAChC,iBAAiB,CAAC,QAAQ,CAAC,CAG7B"}
1
+ {"version":3,"file":"matchingZodObject.d.ts","sourceRoot":"","sources":["../../src/utilities/matchingZodObject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI;KAG9C,CAAC,IAAI,MAAM,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAE1C,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC5C,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAC9B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC,+DAE3F;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC,8DAEhG"}
@@ -1,13 +1,23 @@
1
- import { z } from 'zod';
1
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2
+ import { z } from 'zod/v4-mini';
2
3
  /**
3
4
  * Get a Zod object that strictly matches the expected type, including any optional properties.
5
+ * (Does not provide the same guarantee for nested object types.)
4
6
  *
5
- * Defining TS types first and using this helper to ensure matching zod objects (rather than
6
- * defining the zod type first and using `infer`) helps reduce type explosion in intellisense
7
- * and API reports, and allows reusing types that are already defined elsewhere.
7
+ * Using this helper instead of `const ZodFoo = z.object({...}); type Foo = z.infer<typeof ZodFoo>;`
8
+ * is recommended in cases where the original type is defined elsewhere (such as in `common-types`),
9
+ * to ensure all the properties stay in sync.
8
10
  */
9
11
  export function matchingZodObject(shape) {
10
- // Cast the return value to convert back to the original type with optional properties
11
- return z.object(shape).strict();
12
+ return z.strictObject(shape);
13
+ }
14
+ /**
15
+ * Like `matchingZodObject`, but pass through any extra properties that aren't defined in the shape.
16
+ * (The return type omits the index signature to ensure that the shape is still strictly typed.)
17
+ *
18
+ * See `matchingZodObject` comment for more details.
19
+ */
20
+ export function matchingZodObjectLoose(shape) {
21
+ return z.looseObject(shape);
12
22
  }
13
23
  //# sourceMappingURL=matchingZodObject.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"matchingZodObject.js","sourceRoot":"","sources":["../../src/utilities/matchingZodObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAiC;IAEjC,sFAAsF;IACtF,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAiC,CAAC;AACjE,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Zod shape object matching type `T`, with any optional properties remapped to required properties\n * with type `originalType | undefined`.\n */\ntype MatchingZodShape<T extends object> = {\n [k in keyof Required<T>]: z.ZodType<T[k]>;\n};\n\ntype MatchingZodObject<T extends object> = z.ZodObject<MatchingZodShape<T>, 'strict', z.ZodTypeAny, T, T>;\n\n/**\n * Get a Zod object that strictly matches the expected type, including any optional properties.\n *\n * Defining TS types first and using this helper to ensure matching zod objects (rather than\n * defining the zod type first and using `infer`) helps reduce type explosion in intellisense\n * and API reports, and allows reusing types that are already defined elsewhere.\n */\nexport function matchingZodObject<Expected extends object>(\n shape: MatchingZodShape<Expected>,\n): MatchingZodObject<Expected> {\n // Cast the return value to convert back to the original type with optional properties\n return z.object(shape).strict() as MatchingZodObject<Expected>;\n}\n"]}
1
+ {"version":3,"file":"matchingZodObject.js","sourceRoot":"","sources":["../../src/utilities/matchingZodObject.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAehC;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAA0B,KAAiC;IAC1F,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAA0B,KAAiC;IAC/F,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport { z } from 'zod/v4-mini';\n\n/**\n * Zod shape object matching type `T`, with any optional properties remapped to required properties\n * with type `originalType | undefined`.\n */\nexport type MatchingZodShape<T extends object> = {\n // Use Required<T> in the mapping to ensure that all properties (including optional) are\n // included in the input zod shape.\n [K in keyof Required<T>]: Omit<T, K> extends T\n ? // If K is optional in T, make it a ZodOptional\n z.ZodMiniOptional<z.ZodMiniType<T[K], T[K]>>\n : z.ZodMiniType<T[K], T[K]>;\n};\n\n/**\n * Get a Zod object that strictly matches the expected type, including any optional properties.\n * (Does not provide the same guarantee for nested object types.)\n *\n * Using this helper instead of `const ZodFoo = z.object({...}); type Foo = z.infer<typeof ZodFoo>;`\n * is recommended in cases where the original type is defined elsewhere (such as in `common-types`),\n * to ensure all the properties stay in sync.\n */\nexport function matchingZodObject<Expected extends object>(shape: MatchingZodShape<Expected>) {\n return z.strictObject(shape);\n}\n\n/**\n * Like `matchingZodObject`, but pass through any extra properties that aren't defined in the shape.\n * (The return type omits the index signature to ensure that the shape is still strictly typed.)\n *\n * See `matchingZodObject` comment for more details.\n */\nexport function matchingZodObjectLoose<Expected extends object>(shape: MatchingZodShape<Expected>) {\n return z.looseObject(shape);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"notifyReload.d.ts","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAC3B,OAAO,EAAE,cAAc,CAAC,KAAK,GAAG,iBAAiB,EAAE,UAAU,CAAC,GAC7D,OAAO,CAAC,IAAI,CAAC,CAWf"}
1
+ {"version":3,"file":"notifyReload.d.ts","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAC3B,OAAO,EAAE,cAAc,CAAC,KAAK,GAAG,iBAAiB,EAAE,UAAU,CAAC,GAC7D,OAAO,CAAC,IAAI,CAAC,CAYf"}
@@ -8,7 +8,8 @@ export async function notifyReload(options, context) {
8
8
  await telemetryClient.tracer.startActiveSpan('NOTIFY_RELOAD', (span) => {
9
9
  session.sequence++;
10
10
  span.setAttributes({ sequence: session.sequence, reason });
11
- bus.publish(reloadCountSource, session.sequence);
11
+ // Publish using .path for easier testing
12
+ bus.publish(reloadCountSource.path, session.sequence);
12
13
  });
13
14
  }
14
15
  //# sourceMappingURL=notifyReload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifyReload.js","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA2B,EAC3B,OAA8D;IAE9D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAElD,MAAM,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE;QACrE,OAAO,CAAC,QAAQ,EAAE,CAAC;QAEnB,IAAI,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAE3D,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { reloadCountSource } from '../data/busSources.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Notifies clients that a reload is needed by incrementing the session version.\n */\nexport async function notifyReload(\n options: { reason: string },\n context: PartialContext<'bus' | 'telemetryClient', 'sequence'>,\n): Promise<void> {\n const { reason } = options;\n const { bus, session, telemetryClient } = context;\n\n await telemetryClient.tracer.startActiveSpan('NOTIFY_RELOAD', (span) => {\n session.sequence++;\n\n span.setAttributes({ sequence: session.sequence, reason });\n\n bus.publish(reloadCountSource, session.sequence);\n });\n}\n"]}
1
+ {"version":3,"file":"notifyReload.js","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA2B,EAC3B,OAA8D;IAE9D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAElD,MAAM,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE;QACrE,OAAO,CAAC,QAAQ,EAAE,CAAC;QAEnB,IAAI,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAE3D,yCAAyC;QACzC,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { reloadCountSource } from '../data/busSources.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Notifies clients that a reload is needed by incrementing the session version.\n */\nexport async function notifyReload(\n options: { reason: string },\n context: PartialContext<'bus' | 'telemetryClient', 'sequence'>,\n): Promise<void> {\n const { reason } = options;\n const { bus, session, telemetryClient } = context;\n\n await telemetryClient.tracer.startActiveSpan('NOTIFY_RELOAD', (span) => {\n session.sequence++;\n\n span.setAttributes({ sequence: session.sequence, reason });\n\n // Publish using .path for easier testing\n bus.publish(reloadCountSource.path, session.sequence);\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type z from 'zod';
1
+ import type { z } from 'zod/v4-mini';
2
2
  import type { DataBus, DataBusPath } from '@ms-cloudpack/data-bus';
3
3
  /**
4
4
  * Waits for data to be published on a specific bus path, with a timeout.
@@ -7,7 +7,7 @@ export declare function waitForBusData<T>(params: {
7
7
  /** Data bus to listen on */
8
8
  bus: DataBus;
9
9
  /** Path to subscribe to */
10
- source: DataBusPath<z.ZodType>;
10
+ source: DataBusPath<z.ZodMiniType>;
11
11
  /** Timeout in milliseconds */
12
12
  timeoutMs?: number;
13
13
  }): Promise<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"waitForBusData.d.ts","sourceRoot":"","sources":["../../src/utilities/waitForBusData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE;IAC9C,4BAA4B;IAC5B,GAAG,EAAE,OAAO,CAAC;IACb,2BAA2B;IAC3B,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC/B,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,CAAC,CAAC,CAgBb"}
1
+ {"version":3,"file":"waitForBusData.d.ts","sourceRoot":"","sources":["../../src/utilities/waitForBusData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE;IAC9C,4BAA4B;IAC5B,GAAG,EAAE,OAAO,CAAC;IACb,2BAA2B;IAC3B,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACnC,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,CAAC,CAAC,CAgBb"}
@@ -1 +1 @@
1
- {"version":3,"file":"waitForBusData.js","sourceRoot":"","sources":["../../src/utilities/waitForBusData.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAI,MAOvC;IACC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACnD,OAAO,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACjC,sCAAsC;QACtC,MAAM,WAAW,GAAe,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,KAAc,EAAE,EAAE;YACvE,YAAY,CAAC,SAAS,CAAC,CAAC;YACxB,GAAG,CAAC,KAAU,CAAC,CAAC;YAChB,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,iBAAiB;QACjB,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAChC,WAAW,EAAE,CAAC;YACd,GAAG,CAAC,IAAI,KAAK,CAAC,wCAAwC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAClF,CAAC,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type z from 'zod';\nimport type { DataBus, DataBusPath } from '@ms-cloudpack/data-bus';\n\n/**\n * Waits for data to be published on a specific bus path, with a timeout.\n */\nexport async function waitForBusData<T>(params: {\n /** Data bus to listen on */\n bus: DataBus;\n /** Path to subscribe to */\n source: DataBusPath<z.ZodType>;\n /** Timeout in milliseconds */\n timeoutMs?: number;\n}): Promise<T> {\n const { bus, source, timeoutMs = 120000 } = params;\n return new Promise<T>((res, rej) => {\n // Set up subscription to the bus path\n const unsubscribe: () => void = bus.subscribe(source, (value: unknown) => {\n clearTimeout(timeoutId);\n res(value as T);\n unsubscribe();\n });\n\n // Set up timeout\n const timeoutId = setTimeout(() => {\n unsubscribe();\n rej(new Error(`Timeout waiting for bus data on path ${source.path.join('.')}`));\n }, timeoutMs);\n });\n}\n"]}
1
+ {"version":3,"file":"waitForBusData.js","sourceRoot":"","sources":["../../src/utilities/waitForBusData.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAI,MAOvC;IACC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACnD,OAAO,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACjC,sCAAsC;QACtC,MAAM,WAAW,GAAe,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,KAAc,EAAE,EAAE;YACvE,YAAY,CAAC,SAAS,CAAC,CAAC;YACxB,GAAG,CAAC,KAAU,CAAC,CAAC;YAChB,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,iBAAiB;QACjB,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAChC,WAAW,EAAE,CAAC;YACd,GAAG,CAAC,IAAI,KAAK,CAAC,wCAAwC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAClF,CAAC,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { z } from 'zod/v4-mini';\nimport type { DataBus, DataBusPath } from '@ms-cloudpack/data-bus';\n\n/**\n * Waits for data to be published on a specific bus path, with a timeout.\n */\nexport async function waitForBusData<T>(params: {\n /** Data bus to listen on */\n bus: DataBus;\n /** Path to subscribe to */\n source: DataBusPath<z.ZodMiniType>;\n /** Timeout in milliseconds */\n timeoutMs?: number;\n}): Promise<T> {\n const { bus, source, timeoutMs = 120000 } = params;\n return new Promise<T>((res, rej) => {\n // Set up subscription to the bus path\n const unsubscribe: () => void = bus.subscribe(source, (value: unknown) => {\n clearTimeout(timeoutId);\n res(value as T);\n unsubscribe();\n });\n\n // Set up timeout\n const timeoutId = setTimeout(() => {\n unsubscribe();\n rej(new Error(`Timeout waiting for bus data on path ${source.path.join('.')}`));\n }, timeoutMs);\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/api-server",
3
- "version": "0.63.10",
3
+ "version": "0.64.0",
4
4
  "description": "An implementation of the API server that does interacts with a task scheduler.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,23 +23,23 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@ms-cloudpack/bundler": "^0.25.12",
27
- "@ms-cloudpack/common-types": "^0.24.20",
28
- "@ms-cloudpack/config": "^0.35.9",
29
- "@ms-cloudpack/create-express-app": "^1.10.34",
30
- "@ms-cloudpack/data-bus": "^0.4.3",
26
+ "@ms-cloudpack/bundler": "^0.25.14",
27
+ "@ms-cloudpack/common-types": "^0.25.0",
28
+ "@ms-cloudpack/config": "^0.35.11",
29
+ "@ms-cloudpack/create-express-app": "^1.10.36",
30
+ "@ms-cloudpack/data-bus": "^0.5.0",
31
31
  "@ms-cloudpack/environment": "^0.1.1",
32
- "@ms-cloudpack/esm-stub-utilities": "^0.14.36",
33
- "@ms-cloudpack/file-watcher": "^0.3.5",
34
- "@ms-cloudpack/import-map": "^0.10.27",
32
+ "@ms-cloudpack/esm-stub-utilities": "^0.15.0",
33
+ "@ms-cloudpack/file-watcher": "^0.3.7",
34
+ "@ms-cloudpack/import-map": "^0.10.29",
35
35
  "@ms-cloudpack/json-utilities": "^0.1.10",
36
- "@ms-cloudpack/package-hashes": "^0.8.10",
37
- "@ms-cloudpack/package-utilities": "^12.3.11",
36
+ "@ms-cloudpack/package-hashes": "^0.8.12",
37
+ "@ms-cloudpack/package-utilities": "^12.3.13",
38
38
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
39
- "@ms-cloudpack/path-utilities": "^3.1.5",
40
- "@ms-cloudpack/remote-cache": "^0.11.21",
41
- "@ms-cloudpack/task-reporter": "^0.17.0",
42
- "@ms-cloudpack/telemetry": "^0.11.23",
39
+ "@ms-cloudpack/path-utilities": "^3.1.7",
40
+ "@ms-cloudpack/remote-cache": "^0.11.23",
41
+ "@ms-cloudpack/task-reporter": "^0.17.1",
42
+ "@ms-cloudpack/telemetry": "^0.11.25",
43
43
  "@trpc/client": "^11.1.1",
44
44
  "@trpc/server": "^11.1.1",
45
45
  "cors": "^2.8.5",
@@ -50,7 +50,7 @@
50
50
  "p-queue": "^8.0.1",
51
51
  "source-map": "^0.7.0",
52
52
  "ws": "^8.16.0",
53
- "zod": "^3.21.4"
53
+ "zod": "^3.25.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
@@ -1,26 +0,0 @@
1
- import z from 'zod';
2
- export declare const ZodTaskEndDescription: z.ZodObject<{
3
- id: z.ZodString;
4
- errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
5
- text: z.ZodType<string, z.ZodTypeDef, string>;
6
- source: z.ZodType<string, z.ZodTypeDef, string>;
7
- location: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageLocation | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageLocation | undefined>;
8
- notes: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined>;
9
- }, "strict", z.ZodTypeAny, import("@ms-cloudpack/common-types").BundleMessage, import("@ms-cloudpack/common-types").BundleMessage>, "many">>;
10
- warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
11
- text: z.ZodType<string, z.ZodTypeDef, string>;
12
- source: z.ZodType<string, z.ZodTypeDef, string>;
13
- location: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageLocation | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageLocation | undefined>;
14
- notes: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined>;
15
- }, "strict", z.ZodTypeAny, import("@ms-cloudpack/common-types").BundleMessage, import("@ms-cloudpack/common-types").BundleMessage>, "many">>;
16
- }, "strip", z.ZodTypeAny, {
17
- id: string;
18
- errors?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
19
- warnings?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
20
- }, {
21
- id: string;
22
- errors?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
23
- warnings?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
24
- }>;
25
- export type TaskEndDescription = z.infer<typeof ZodTaskEndDescription>;
26
- //# sourceMappingURL=TaskEndDescription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TaskEndDescription.d.ts","sourceRoot":"","sources":["../../src/types/TaskEndDescription.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import z from 'zod';
2
- import { ZodTaskMessage } from './TaskMessage.js';
3
- export const ZodTaskEndDescription = z.object({
4
- id: z.string(),
5
- errors: z.array(ZodTaskMessage).optional(),
6
- warnings: z.array(ZodTaskMessage).optional(),
7
- });
8
- //# sourceMappingURL=TaskEndDescription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TaskEndDescription.js","sourceRoot":"","sources":["../../src/types/TaskEndDescription.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;IAC1C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC","sourcesContent":["import z from 'zod';\nimport { ZodTaskMessage } from './TaskMessage.js';\n\nexport const ZodTaskEndDescription = z.object({\n id: z.string(),\n errors: z.array(ZodTaskMessage).optional(),\n warnings: z.array(ZodTaskMessage).optional(),\n});\n\nexport type TaskEndDescription = z.infer<typeof ZodTaskEndDescription>;\n"]}
@@ -1,19 +0,0 @@
1
- import z from 'zod';
2
- export declare const ZodTaskStartDescription: z.ZodObject<{
3
- id: z.ZodString;
4
- name: z.ZodOptional<z.ZodString>;
5
- inputPath: z.ZodOptional<z.ZodString>;
6
- outputPath: z.ZodOptional<z.ZodString>;
7
- }, "strip", z.ZodTypeAny, {
8
- id: string;
9
- name?: string | undefined;
10
- inputPath?: string | undefined;
11
- outputPath?: string | undefined;
12
- }, {
13
- id: string;
14
- name?: string | undefined;
15
- inputPath?: string | undefined;
16
- outputPath?: string | undefined;
17
- }>;
18
- export type TaskStartDescription = z.infer<typeof ZodTaskStartDescription>;
19
- //# sourceMappingURL=TaskStartDescription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TaskStartDescription.d.ts","sourceRoot":"","sources":["../../src/types/TaskStartDescription.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAKlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import z from 'zod';
2
- export const ZodTaskStartDescription = z.object({
3
- id: z.string(),
4
- name: z.string().optional(),
5
- inputPath: z.string().optional(),
6
- outputPath: z.string().optional(),
7
- });
8
- //# sourceMappingURL=TaskStartDescription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TaskStartDescription.js","sourceRoot":"","sources":["../../src/types/TaskStartDescription.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC","sourcesContent":["import z from 'zod';\n\nexport const ZodTaskStartDescription = z.object({\n id: z.string(),\n name: z.string().optional(),\n inputPath: z.string().optional(),\n outputPath: z.string().optional(),\n});\n\nexport type TaskStartDescription = z.infer<typeof ZodTaskStartDescription>;\n"]}