@ms-cloudpack/api-server 0.13.3 → 0.13.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.
@@ -1 +1 @@
1
- {"version":3,"file":"ensurePackageBundled.d.ts","sourceRoot":"","sources":["../../src/apis/ensurePackageBundled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAmB,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAG3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAwBhE,QAAA,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;EAShC,CAAC;AAEH,KAAK,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEjF,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBjC,CAAC;AAEH,KAAK,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGjC,CAAC;AAEH,KAAK,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEnF,KAAK,2BAA2B,GAAG;IACjC,GAAG,EAAE,OAAO,CAAC;IACb,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,uBAAuB,CAAC;IAClC,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,KAAK,EACL,GAAG,GACJ,EAAE;IACD,KAAK,EAAE,4BAA4B,CAAC;IACpC,GAAG,EAAE,2BAA2B,CAAC;CAClC,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAczC;yBApBqB,oBAAoB"}
@@ -26,14 +26,17 @@ const ZodEnsurePackageBundledInput = z.object({
26
26
  outputPath: z.string().optional(),
27
27
  bundlerType: z.string().optional(),
28
28
  disableSourceMaps: z.boolean().optional(),
29
+ enqueueDependencies: z.boolean().optional(),
29
30
  shouldRerun: z.boolean().optional(),
30
31
  shouldWatch: z.boolean().optional(),
31
32
  shouldForce: z.boolean().optional(),
32
33
  });
33
- const ZodEnsurePackageBundledOutput = z.object({
34
+ const ZodEnsurePackageBundledOutputResult = z.object({
35
+ name: z.string(),
36
+ version: z.string(),
34
37
  bundlerName: z.string().optional(),
35
38
  inputPath: z.string().optional(),
36
- outputPath: z.string().optional(),
39
+ outputPath: z.string(),
37
40
  entries: z.record(z.string()).optional(),
38
41
  dependencies: z.array(z.string()).optional(),
39
42
  hash: z.string().optional(),
@@ -48,23 +51,35 @@ const ZodEnsurePackageBundledOutput = z.object({
48
51
  warnings: z.array(ZodBundleMessage).optional(),
49
52
  rawInput: z.record(z.unknown()).optional(),
50
53
  rawOutput: z.record(z.unknown()).optional(),
54
+ isExternal: z.boolean(),
55
+ });
56
+ const ZodEnsurePackageBundledOutput = z.object({
57
+ result: ZodEnsurePackageBundledOutputResult,
58
+ dependencies: z.promise(ZodEnsurePackageBundledOutputResult.array()),
51
59
  });
52
60
  /**
53
61
  * Checks if the package is bundled or needs bundling, and returns the result. For internal packages,
54
62
  * we also notify the watcher to monitor for code changes.
55
63
  */
56
64
  export async function ensurePackageBundled({ input, ctx, }) {
57
- return ensurePackageBundledInternal({
65
+ const promises = [];
66
+ const result = await ensurePackageBundledInternal({
58
67
  input,
59
68
  ctx,
60
69
  visited: new Set(),
70
+ promises,
61
71
  });
72
+ return {
73
+ result,
74
+ dependencies: Promise.all(promises),
75
+ };
62
76
  }
63
- async function ensurePackageBundledInternal({ input, ctx, visited, }) {
77
+ async function ensurePackageBundledInternal({ input, ctx, visited, promises, }) {
64
78
  const { name, version, shouldWatch, bundlerType, disableSourceMaps, outputPath, shouldRerun, shouldForce } = input;
65
79
  const { taskRunner, session, watcher, packages, reporter } = ctx;
66
80
  const { resolveMap, config } = session;
67
81
  const { features } = config;
82
+ const enqueueDependencies = input.enqueueDependencies ?? features?.enqueueDependencies;
68
83
  visited.add(`${name}@${version}`);
69
84
  // First, we find the resolve map entry. This helps us resolve the physical location of the package
70
85
  // according to the resolveMap used in the session. (This can change based on linking.)
@@ -77,6 +92,7 @@ async function ensurePackageBundledInternal({ input, ctx, visited, }) {
77
92
  bundlerType,
78
93
  disableSourceMaps,
79
94
  outputPath,
95
+ enableFindImports: enqueueDependencies,
80
96
  }, { config, packages });
81
97
  const task = createBundleTask(bundleRequest, { force: shouldForce }, reporter);
82
98
  // TODO: Add lage scheduling back.
@@ -99,26 +115,32 @@ async function ensurePackageBundledInternal({ input, ctx, visited, }) {
99
115
  });
100
116
  }
101
117
  // If enabled, enqueue dependencies.
102
- if (features?.enqueueDependencies && result?.dependencies) {
118
+ if (enqueueDependencies && result?.dependencies) {
103
119
  for (const dependencyName of result.dependencies) {
104
120
  // If we've already visited this package, skip it.
105
121
  if (visited.has(`${dependencyName}@${packageEntry.dependencies[dependencyName]}`)) {
106
122
  continue;
107
123
  }
108
- // Don't await for their result, just go go go.
109
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
110
- ensurePackageBundledInternal({
124
+ promises.push(ensurePackageBundledInternal({
111
125
  input: {
112
126
  name: dependencyName,
113
127
  version: packageEntry.dependencies[dependencyName],
114
128
  shouldWatch,
129
+ enqueueDependencies,
115
130
  },
116
131
  ctx,
117
132
  visited,
118
- });
133
+ promises,
134
+ }));
119
135
  }
120
136
  }
121
- return result;
137
+ return {
138
+ version,
139
+ name,
140
+ isExternal,
141
+ outputPath: result.outputPath ?? bundleRequest.outputPath,
142
+ ...result,
143
+ };
122
144
  }
123
145
  // Attach a trpc procedure to the function.
124
146
  ensurePackageBundled.procedure = publicProcedure
@@ -1 +1 @@
1
- {"version":3,"file":"ensurePackageBundled.js","sourceRoot":"","sources":["../../src/apis/ensurePackageBundled.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAIvD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAE9F,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,IAAI,EAAE,CAAC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Aa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;gBACzC,YAAY,CAAC,GAAG,CAAC,CAAC;aACnB;QACH,CAAC,CAAC;QACF,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,EAAE;YAC/B,KAAK,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;KACJ;IAED,oCAAoC;IACpC,IAAI,QAAQ,EAAE,mBAAmB,IAAI,MAAM,EAAE,YAAY,EAAE;QACzD,KAAK,MAAM,cAAc,IAAI,MAAM,CAAC,YAAY,EAAE;YAChD,kDAAkD;YAClD,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,cAAc,IAAI,YAAY,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE;gBACjF,SAAS;aACV;YAED,+CAA+C;YAC/C,mEAAmE;YACnE,4BAA4B,CAAC;gBAC3B,KAAK,EAAE;oBACL,IAAI,EAAE,cAAc;oBACpB,OAAO,EAAE,YAAY,CAAC,YAAY,CAAC,cAAc,CAAC;oBAClD,WAAW;iBACZ;gBACD,GAAG;gBACH,OAAO;aACR,CAAC,CAAC;SACJ;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,2CAA2C;AAC3C,oBAAoB,CAAC,SAAS,GAAG,eAAe;KAC7C,KAAK,CAAC,4BAA4B,CAAC;KACnC,MAAM,CAAC,6BAA6B,CAAC;KACrC,QAAQ,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["import type { DataBus } from '@ms-cloudpack/data-bus';\nimport { findResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport { publicProcedure, z } from '../trpc/common.js';\nimport type { Session } from '../types/Session.js';\nimport type { TaskRunner } from '../utilities/TaskRunner.js';\nimport type { Watcher } from '@ms-cloudpack/file-watcher';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport { createBundleTask } from '../utilities/createBundleTask.js';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { createBundleRequestForPackage } from '../utilities/createBundleRequestForPackage.js';\n\nconst ZodLocation = z.object({\n file: z.string(),\n line: z.number(),\n column: z.number(),\n});\n\nconst ZodBundleMessage = z.object({\n pluginName: z.string().optional(),\n type: z.string().optional(),\n text: z.string(),\n location: ZodLocation.optional(),\n notes: z\n .array(\n z.object({\n text: z.string().optional(),\n location: ZodLocation.optional(),\n }),\n )\n .optional(),\n});\n\nconst ZodEnsurePackageBundledInput = z.object({\n name: z.string(),\n version: z.string(),\n outputPath: z.string().optional(),\n bundlerType: z.string().optional(),\n disableSourceMaps: z.boolean().optional(),\n shouldRerun: z.boolean().optional(),\n shouldWatch: z.boolean().optional(),\n shouldForce: z.boolean().optional(),\n});\n\ntype ZodEnsurePackageBundledInput = z.infer<typeof ZodEnsurePackageBundledInput>;\n\nconst ZodEnsurePackageBundledOutput = z.object({\n bundlerName: z.string().optional(),\n inputPath: z.string().optional(),\n outputPath: z.string().optional(),\n entries: z.record(z.string()).optional(),\n dependencies: z.array(z.string()).optional(),\n hash: z.string().optional(),\n outputFiles: z\n .array(\n z.object({\n outputPath: z.string(),\n entryPoint: z.string().optional(),\n exports: z.array(z.string()).optional(),\n }),\n )\n .optional(),\n errors: z.array(ZodBundleMessage).optional(),\n warnings: z.array(ZodBundleMessage).optional(),\n rawInput: z.record(z.unknown()).optional(),\n rawOutput: z.record(z.unknown()).optional(),\n});\n\ntype ZodEnsurePackageBundledOutput = z.infer<typeof ZodEnsurePackageBundledOutput>;\n\ntype EnsurePackageBundledContext = {\n bus: DataBus;\n taskRunner: TaskRunner;\n session: Session;\n watcher: Watcher;\n packages: PackageDefinitionsCache;\n reporter: TaskReporter;\n};\n\n/**\n * Checks if the package is bundled or needs bundling, and returns the result. For internal packages,\n * we also notify the watcher to monitor for code changes.\n */\nexport async function ensurePackageBundled({\n input,\n ctx,\n}: {\n input: ZodEnsurePackageBundledInput;\n ctx: EnsurePackageBundledContext;\n}): Promise<ZodEnsurePackageBundledOutput> {\n return ensurePackageBundledInternal({\n input,\n ctx,\n visited: new Set(),\n });\n}\n\nasync function ensurePackageBundledInternal({\n input,\n ctx,\n visited,\n}: {\n input: ZodEnsurePackageBundledInput;\n ctx: EnsurePackageBundledContext;\n visited: Set<`${string}@${string}`>;\n}): Promise<ZodEnsurePackageBundledOutput> {\n const { name, version, shouldWatch, bundlerType, disableSourceMaps, outputPath, shouldRerun, shouldForce } = input;\n const { taskRunner, session, watcher, packages, reporter } = ctx;\n const { resolveMap, config } = session;\n const { features } = config;\n\n visited.add(`${name}@${version}`);\n\n // First, we find the resolve map entry. This helps us resolve the physical location of the package\n // according to the resolveMap used in the session. (This can change based on linking.)\n const packageEntry = findResolveMapEntry({ packageName: name, version, resolveMap });\n\n if (!packageEntry) {\n throw new Error(`Could not find package ${name} in the resolve map.`);\n }\n\n const bundleRequest = await createBundleRequestForPackage(\n {\n packageEntry,\n bundlerType,\n disableSourceMaps,\n outputPath,\n },\n { config, packages },\n );\n\n const task = createBundleTask(bundleRequest, { force: shouldForce }, reporter);\n\n // TODO: Add lage scheduling back.\n const { result } = await taskRunner.add<BundleRequest>(task, { rerun: shouldRerun });\n\n if (!result) {\n throw new Error('Bundle failed, no result');\n }\n\n const { isExternal } = bundleRequest;\n\n // For internal packages, make sure we're watching the source to re-trigger bundling.\n if (shouldWatch && !isExternal) {\n const onPackageChange = async () => {\n const watchedResult = await taskRunner.add<BundleRequest>(task, { rerun: true });\n\n // If the result was successful, notify potential clients for reload.\n if (!watchedResult.result?.errors?.length) {\n notifyReload(ctx);\n }\n };\n watcher.watch(packageEntry, () => {\n void onPackageChange();\n });\n }\n\n // If enabled, enqueue dependencies.\n if (features?.enqueueDependencies && result?.dependencies) {\n for (const dependencyName of result.dependencies) {\n // If we've already visited this package, skip it.\n if (visited.has(`${dependencyName}@${packageEntry.dependencies[dependencyName]}`)) {\n continue;\n }\n\n // Don't await for their result, just go go go.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ensurePackageBundledInternal({\n input: {\n name: dependencyName,\n version: packageEntry.dependencies[dependencyName],\n shouldWatch,\n },\n ctx,\n visited,\n });\n }\n }\n\n return result;\n}\n\n// Attach a trpc procedure to the function.\nensurePackageBundled.procedure = publicProcedure\n .input(ZodEnsurePackageBundledInput)\n .output(ZodEnsurePackageBundledOutput)\n .mutation(ensurePackageBundled);\n"]}
1
+ {"version":3,"file":"ensurePackageBundled.js","sourceRoot":"","sources":["../../src/apis/ensurePackageBundled.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAIvD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAE9F,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE;IAChC,KAAK,EAAE,CAAC;SACL,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,QAAQ,EAAE,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AA2C;AAC3C,oBAAoB,CAAC,SAAS,GAAG,eAAe;KAC7C,KAAK,CAAC,4BAA4B,CAAC;KACnC,MAAM,CAAC,6BAA6B,CAAC;KACrC,QAAQ,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["import type { DataBus } from '@ms-cloudpack/data-bus';\nimport { findResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport { publicProcedure, z } from '../trpc/common.js';\nimport type { Session } from '../types/Session.js';\nimport type { TaskRunner } from '../utilities/TaskRunner.js';\nimport type { Watcher } from '@ms-cloudpack/file-watcher';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport { createBundleTask } from '../utilities/createBundleTask.js';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { createBundleRequestForPackage } from '../utilities/createBundleRequestForPackage.js';\n\nconst ZodLocation = z.object({\n file: z.string(),\n line: z.number(),\n column: z.number(),\n});\n\nconst ZodBundleMessage = z.object({\n pluginName: z.string().optional(),\n type: z.string().optional(),\n text: z.string(),\n location: ZodLocation.optional(),\n notes: z\n .array(\n z.object({\n text: z.string().optional(),\n location: ZodLocation.optional(),\n }),\n )\n .optional(),\n});\n\nconst ZodEnsurePackageBundledInput = z.object({\n name: z.string(),\n version: z.string(),\n outputPath: z.string().optional(),\n bundlerType: z.string().optional(),\n disableSourceMaps: z.boolean().optional(),\n enqueueDependencies: z.boolean().optional(),\n shouldRerun: z.boolean().optional(),\n shouldWatch: z.boolean().optional(),\n shouldForce: z.boolean().optional(),\n});\n\ntype ZodEnsurePackageBundledInput = z.infer<typeof ZodEnsurePackageBundledInput>;\n\nconst ZodEnsurePackageBundledOutputResult = z.object({\n name: z.string(),\n version: z.string(),\n bundlerName: z.string().optional(),\n inputPath: z.string().optional(),\n outputPath: z.string(),\n entries: z.record(z.string()).optional(),\n dependencies: z.array(z.string()).optional(),\n hash: z.string().optional(),\n outputFiles: z\n .array(\n z.object({\n outputPath: z.string(),\n entryPoint: z.string().optional(),\n exports: z.array(z.string()).optional(),\n }),\n )\n .optional(),\n errors: z.array(ZodBundleMessage).optional(),\n warnings: z.array(ZodBundleMessage).optional(),\n rawInput: z.record(z.unknown()).optional(),\n rawOutput: z.record(z.unknown()).optional(),\n isExternal: z.boolean(),\n});\n\nexport type ZodEnsurePackageBundledOutputResult = z.infer<typeof ZodEnsurePackageBundledOutputResult>;\n\nconst ZodEnsurePackageBundledOutput = z.object({\n result: ZodEnsurePackageBundledOutputResult,\n dependencies: z.promise(ZodEnsurePackageBundledOutputResult.array()),\n});\n\ntype ZodEnsurePackageBundledOutput = z.infer<typeof ZodEnsurePackageBundledOutput>;\n\ntype EnsurePackageBundledContext = {\n bus: DataBus;\n taskRunner: TaskRunner;\n session: Session;\n watcher: Watcher;\n packages: PackageDefinitionsCache;\n reporter: TaskReporter;\n};\n\n/**\n * Checks if the package is bundled or needs bundling, and returns the result. For internal packages,\n * we also notify the watcher to monitor for code changes.\n */\nexport async function ensurePackageBundled({\n input,\n ctx,\n}: {\n input: ZodEnsurePackageBundledInput;\n ctx: EnsurePackageBundledContext;\n}): Promise<ZodEnsurePackageBundledOutput> {\n const promises: Promise<ZodEnsurePackageBundledOutputResult>[] = [];\n\n const result = await ensurePackageBundledInternal({\n input,\n ctx,\n visited: new Set(),\n promises,\n });\n\n return {\n result,\n dependencies: Promise.all(promises),\n };\n}\n\nasync function ensurePackageBundledInternal({\n input,\n ctx,\n visited,\n promises,\n}: {\n input: ZodEnsurePackageBundledInput;\n ctx: EnsurePackageBundledContext;\n visited: Set<`${string}@${string}`>;\n promises: Promise<ZodEnsurePackageBundledOutputResult>[];\n}): Promise<ZodEnsurePackageBundledOutputResult> {\n const { name, version, shouldWatch, bundlerType, disableSourceMaps, outputPath, shouldRerun, shouldForce } = input;\n const { taskRunner, session, watcher, packages, reporter } = ctx;\n const { resolveMap, config } = session;\n const { features } = config;\n const enqueueDependencies = input.enqueueDependencies ?? features?.enqueueDependencies;\n\n visited.add(`${name}@${version}`);\n\n // First, we find the resolve map entry. This helps us resolve the physical location of the package\n // according to the resolveMap used in the session. (This can change based on linking.)\n const packageEntry = findResolveMapEntry({ packageName: name, version, resolveMap });\n\n if (!packageEntry) {\n throw new Error(`Could not find package ${name} in the resolve map.`);\n }\n\n const bundleRequest = await createBundleRequestForPackage(\n {\n packageEntry,\n bundlerType,\n disableSourceMaps,\n outputPath,\n enableFindImports: enqueueDependencies,\n },\n { config, packages },\n );\n\n const task = createBundleTask(bundleRequest, { force: shouldForce }, reporter);\n\n // TODO: Add lage scheduling back.\n const { result } = await taskRunner.add<BundleRequest>(task, { rerun: shouldRerun });\n\n if (!result) {\n throw new Error('Bundle failed, no result');\n }\n\n const { isExternal } = bundleRequest;\n\n // For internal packages, make sure we're watching the source to re-trigger bundling.\n if (shouldWatch && !isExternal) {\n const onPackageChange = async () => {\n const watchedResult = await taskRunner.add<BundleRequest>(task, { rerun: true });\n\n // If the result was successful, notify potential clients for reload.\n if (!watchedResult.result?.errors?.length) {\n notifyReload(ctx);\n }\n };\n watcher.watch(packageEntry, () => {\n void onPackageChange();\n });\n }\n\n // If enabled, enqueue dependencies.\n if (enqueueDependencies && result?.dependencies) {\n for (const dependencyName of result.dependencies) {\n // If we've already visited this package, skip it.\n if (visited.has(`${dependencyName}@${packageEntry.dependencies[dependencyName]}`)) {\n continue;\n }\n\n promises.push(\n ensurePackageBundledInternal({\n input: {\n name: dependencyName,\n version: packageEntry.dependencies[dependencyName],\n shouldWatch,\n enqueueDependencies,\n },\n ctx,\n visited,\n promises,\n }),\n );\n }\n }\n\n return {\n version,\n name,\n isExternal,\n outputPath: result.outputPath ?? bundleRequest.outputPath,\n ...result,\n };\n}\n\n// Attach a trpc procedure to the function.\nensurePackageBundled.procedure = publicProcedure\n .input(ZodEnsurePackageBundledInput)\n .output(ZodEnsurePackageBundledOutput)\n .mutation(ensurePackageBundled);\n"]}
@@ -1,19 +1,26 @@
1
1
  import type { Session } from '../types/Session.js';
2
2
  import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';
3
3
  import type { TaskReporter } from '@ms-cloudpack/task-reporter';
4
- export declare function syncUpload({ ctx: { reporter, session, packages }, }: {
5
- ctx: {
6
- reporter: TaskReporter;
7
- session: Session;
8
- packages: PackageDefinitionsCache;
9
- };
4
+ import type { DataBus } from '@ms-cloudpack/data-bus';
5
+ import type { TaskRunner } from '../utilities/TaskRunner.js';
6
+ import type { Watcher } from '@ms-cloudpack/file-watcher';
7
+ interface SyncContext {
8
+ bus: DataBus;
9
+ reporter: TaskReporter;
10
+ session: Session;
11
+ packages: PackageDefinitionsCache;
12
+ taskRunner: TaskRunner;
13
+ watcher: Watcher;
14
+ }
15
+ export declare function syncUpload({ ctx }: {
16
+ ctx: SyncContext;
10
17
  }): Promise<void>;
11
18
  export declare namespace syncUpload {
12
19
  var procedure: import("@trpc/server").BuildProcedure<"mutation", {
13
20
  _config: import("@trpc/server").RootConfig<{
14
21
  ctx: {
15
22
  session: Session;
16
- bus: import("@ms-cloudpack/data-bus").DataBus;
23
+ bus: DataBus;
17
24
  rootSpan: import("@opentelemetry/api").Span | undefined;
18
25
  reporter: TaskReporter;
19
26
  watcher: {
@@ -24,7 +31,7 @@ export declare namespace syncUpload {
24
31
  unwatchAll(): Promise<void>;
25
32
  };
26
33
  packages: PackageDefinitionsCache;
27
- taskRunner: import("../index.js").TaskRunner;
34
+ taskRunner: TaskRunner;
28
35
  dispose(): Promise<void>;
29
36
  };
30
37
  meta: object;
@@ -33,7 +40,7 @@ export declare namespace syncUpload {
33
40
  }>;
34
41
  _ctx_out: {
35
42
  session: Session;
36
- bus: import("@ms-cloudpack/data-bus").DataBus;
43
+ bus: DataBus;
37
44
  rootSpan: import("@opentelemetry/api").Span | undefined;
38
45
  reporter: TaskReporter;
39
46
  watcher: {
@@ -44,7 +51,7 @@ export declare namespace syncUpload {
44
51
  unwatchAll(): Promise<void>;
45
52
  };
46
53
  packages: PackageDefinitionsCache;
47
- taskRunner: import("../index.js").TaskRunner;
54
+ taskRunner: TaskRunner;
48
55
  dispose(): Promise<void>;
49
56
  };
50
57
  _input_in: typeof import("@trpc/server").unsetMarker;
@@ -54,4 +61,5 @@ export declare namespace syncUpload {
54
61
  _meta: object;
55
62
  }, void>;
56
63
  }
64
+ export {};
57
65
  //# sourceMappingURL=syncUpload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"syncUpload.d.ts","sourceRoot":"","sources":["../../src/apis/syncUpload.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,wBAAsB,UAAU,CAAC,EAC/B,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GACrC,EAAE;IACD,GAAG,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,uBAAuB,CAAA;KAAE,CAAC;CACtF,iBAOA;yBAXqB,UAAU"}
1
+ {"version":3,"file":"syncUpload.d.ts","sourceRoot":"","sources":["../../src/apis/syncUpload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAK1D,UAAU,WAAW;IACnB,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,uBAAuB,CAAC;IAClC,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;CAClB;AAUD,wBAAsB,UAAU,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,WAAW,CAAA;CAAE,iBA6B7D;yBA7BqB,UAAU"}
@@ -1,11 +1,40 @@
1
1
  import { publicProcedure } from '../trpc/common.js';
2
- import { getBundleDetails } from '../utilities/getBundleDetails.js';
3
2
  import { ensureRemoteCacheEnabled } from '../utilities/ensureRemoteCacheEnabled.js';
4
- export async function syncUpload({ ctx: { reporter, session, packages }, }) {
5
- const { resolveMap } = session;
3
+ import { ensurePackageBundled } from './ensurePackageBundled.js';
4
+ import { delimiter } from 'path';
5
+ import { syncToRemote } from '@ms-cloudpack/remote-cache';
6
+ import { ensureFieldsExist } from '../utilities/ensureFieldsExist.js';
7
+ function getFolderName(path) {
8
+ const folderName = path.split(delimiter).pop();
9
+ if (!folderName) {
10
+ throw new Error(`Could not get folder name from path: ${path}`);
11
+ }
12
+ return folderName;
13
+ }
14
+ export async function syncUpload({ ctx }) {
15
+ const { session, reporter } = ctx;
16
+ const { appPath } = session;
6
17
  const config = ensureRemoteCacheEnabled(session.config);
7
- const { syncToRemote } = await import('@ms-cloudpack/remote-cache');
8
- await syncToRemote({ resolveMap, config, getBundleDetails, packages, reporter });
18
+ const packageDefinition = await ctx.packages.get(appPath);
19
+ const { name, version } = ensureFieldsExist(packageDefinition, 'name', 'version');
20
+ const { dependencies, result } = await ensurePackageBundled({
21
+ input: {
22
+ name,
23
+ version,
24
+ enqueueDependencies: true,
25
+ },
26
+ ctx,
27
+ });
28
+ const bundledPackages = [result, ...(await dependencies)];
29
+ const packages = bundledPackages
30
+ .filter((p) => p.isExternal)
31
+ .map((p) => ({
32
+ path: p.outputPath,
33
+ folderName: getFolderName(p.outputPath),
34
+ packageName: p.name,
35
+ version: p.version,
36
+ }));
37
+ await syncToRemote({ config, packages, reporter });
9
38
  }
10
39
  // Attach a trpc procedure to the function.
11
40
  syncUpload.procedure = publicProcedure.mutation(syncUpload);
@@ -1 +1 @@
1
- {"version":3,"file":"syncUpload.js","sourceRoot":"","sources":["../../src/apis/syncUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAKpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GAGrC;IACC,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAC/B,MAAM,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;IAEpE,MAAM,YAAY,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;AACnF,CAAC;AAED,2CAA2C;AAC3C,UAAU,CAAC,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\nimport { getBundleDetails } from '../utilities/getBundleDetails.js';\n\nimport type { Session } from '../types/Session.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { ensureRemoteCacheEnabled } from '../utilities/ensureRemoteCacheEnabled.js';\n\nexport async function syncUpload({\n ctx: { reporter, session, packages },\n}: {\n ctx: { reporter: TaskReporter; session: Session; packages: PackageDefinitionsCache };\n}) {\n const { resolveMap } = session;\n const config = ensureRemoteCacheEnabled(session.config);\n\n const { syncToRemote } = await import('@ms-cloudpack/remote-cache');\n\n await syncToRemote({ resolveMap, config, getBundleDetails, packages, reporter });\n}\n\n// Attach a trpc procedure to the function.\nsyncUpload.procedure = publicProcedure.mutation(syncUpload);\n"]}
1
+ {"version":3,"file":"syncUpload.js","sourceRoot":"","sources":["../../src/apis/syncUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAWtE,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC;IAC/C,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC;KACjE;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAAE,GAAG,EAAwB;IAC5D,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC;IAClC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,MAAM,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD,MAAM,iBAAiB,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IAElF,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,oBAAoB,CAAC;QAC1D,KAAK,EAAE;YACL,IAAI;YACJ,OAAO;YACP,mBAAmB,EAAE,IAAI;SAC1B;QACD,GAAG;KACJ,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,YAAY,CAAC,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,eAAe;SAC7B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;SAC3B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACX,IAAI,EAAE,CAAC,CAAC,UAAU;QAClB,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC;QACvC,WAAW,EAAE,CAAC,CAAC,IAAI;QACnB,OAAO,EAAE,CAAC,CAAC,OAAO;KACnB,CAAC,CAAC,CAAC;IAEN,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,2CAA2C;AAC3C,UAAU,CAAC,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\n\nimport type { Session } from '../types/Session.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { ensureRemoteCacheEnabled } from '../utilities/ensureRemoteCacheEnabled.js';\nimport { ensurePackageBundled } from './ensurePackageBundled.js';\nimport type { DataBus } from '@ms-cloudpack/data-bus';\nimport type { TaskRunner } from '../utilities/TaskRunner.js';\nimport type { Watcher } from '@ms-cloudpack/file-watcher';\nimport { delimiter } from 'path';\nimport { syncToRemote } from '@ms-cloudpack/remote-cache';\nimport { ensureFieldsExist } from '../utilities/ensureFieldsExist.js';\n\ninterface SyncContext {\n bus: DataBus;\n reporter: TaskReporter;\n session: Session;\n packages: PackageDefinitionsCache;\n taskRunner: TaskRunner;\n watcher: Watcher;\n}\n\nfunction getFolderName(path: string) {\n const folderName = path.split(delimiter).pop();\n if (!folderName) {\n throw new Error(`Could not get folder name from path: ${path}`);\n }\n return folderName;\n}\n\nexport async function syncUpload({ ctx }: { ctx: SyncContext }) {\n const { session, reporter } = ctx;\n const { appPath } = session;\n\n const config = ensureRemoteCacheEnabled(session.config);\n\n const packageDefinition = await ctx.packages.get(appPath);\n const { name, version } = ensureFieldsExist(packageDefinition, 'name', 'version');\n\n const { dependencies, result } = await ensurePackageBundled({\n input: {\n name,\n version,\n enqueueDependencies: true,\n },\n ctx,\n });\n\n const bundledPackages = [result, ...(await dependencies)];\n const packages = bundledPackages\n .filter((p) => p.isExternal)\n .map((p) => ({\n path: p.outputPath,\n folderName: getFolderName(p.outputPath),\n packageName: p.name,\n version: p.version,\n }));\n\n await syncToRemote({ config, packages, reporter });\n}\n\n// Attach a trpc procedure to the function.\nsyncUpload.procedure = publicProcedure.mutation(syncUpload);\n"]}
package/lib/index.d.ts CHANGED
@@ -10,7 +10,8 @@ export type { TaskError } from './types/TaskError.js';
10
10
  export type { TaskOptions } from './types/TaskOptions.js';
11
11
  export type { TaskStartDescription } from './types/TaskStartDescription.js';
12
12
  export type { CloudpackServer } from './trpc/createCloudpackServer.js';
13
- export type { TaskRunner } from './utilities/TaskRunner.js';
13
+ export type { createContextFactory, CreateContext, Context } from './trpc/createContextFactory.js';
14
+ export { TaskRunner } from './utilities/TaskRunner.js';
14
15
  export { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';
15
16
  export { startApiServer } from './startApiServer.js';
16
17
  export { createCloudpackClient } from './trpc/createCloudpackClient.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MA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AAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,kHAAkH;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { TaskRunner } from './utilities/TaskRunner.js';
1
2
  export { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';
2
3
  export { startApiServer } from './startApiServer.js';
3
4
  export { createCloudpackClient } from './trpc/createCloudpackClient.js';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,kHAAkH;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export type { ApiServer } from './types/ApiServer.js';\nexport type { DevServer } from './types/DevServer.js';\nexport type { PackageOverride } from './types/PackageOverride.js';\nexport type { Session } from './types/Session.js';\nexport type { SessionStats } from './types/SessionStats.js';\nexport type { Task } from './types/Task.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskEndDescription } from './types/TaskEndDescription.js';\nexport type { TaskError } from './types/TaskError.js';\nexport type { TaskOptions } from './types/TaskOptions.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\nexport type { CloudpackServer } from './trpc/createCloudpackServer.js';\nexport type { TaskRunner } from './utilities/TaskRunner.js';\n\nexport { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';\nexport { startApiServer } from './startApiServer.js';\nexport { createCloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer } from './trpc/createCloudpackServer.js';\nexport { ZodTaskDescription } from './types/TaskDescription.js';\nexport { ZodTaskEndDescription } from './types/TaskEndDescription.js';\nexport { ZodTaskError } from './types/TaskError.js';\nexport { ZodTaskStartDescription } from './types/TaskStartDescription.js';\nexport { getLocalCachePath } from './utilities/getCachePath.js';\n\n/** Exporting below modules temporarily until we start using ensurePackageBundled api for all bundle operations */\nexport { getBundleDetails } from './utilities/getBundleDetails.js';\nexport { bundleTask } from './utilities/bundleTask.js';\nexport { createBundleTask } from './utilities/createBundleTask.js';\nexport { createBundleRequestForPackage } from './utilities/createBundleRequestForPackage.js';\nexport { findImports } from './utilities/findImports.js';\n\nexport type { BundleRequest } from './types/BundleRequest.js';\nexport type { BundleTaskOptions } from './types/BundleTaskOptions.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,kHAAkH;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["export type { ApiServer } from './types/ApiServer.js';\nexport type { DevServer } from './types/DevServer.js';\nexport type { PackageOverride } from './types/PackageOverride.js';\nexport type { Session } from './types/Session.js';\nexport type { SessionStats } from './types/SessionStats.js';\nexport type { Task } from './types/Task.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskEndDescription } from './types/TaskEndDescription.js';\nexport type { TaskError } from './types/TaskError.js';\nexport type { TaskOptions } from './types/TaskOptions.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\nexport type { CloudpackServer } from './trpc/createCloudpackServer.js';\nexport type { createContextFactory, CreateContext, Context } from './trpc/createContextFactory.js';\n\nexport { TaskRunner } from './utilities/TaskRunner.js';\nexport { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';\nexport { startApiServer } from './startApiServer.js';\nexport { createCloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer } from './trpc/createCloudpackServer.js';\nexport { ZodTaskDescription } from './types/TaskDescription.js';\nexport { ZodTaskEndDescription } from './types/TaskEndDescription.js';\nexport { ZodTaskError } from './types/TaskError.js';\nexport { ZodTaskStartDescription } from './types/TaskStartDescription.js';\nexport { getLocalCachePath } from './utilities/getCachePath.js';\n\n/** Exporting below modules temporarily until we start using ensurePackageBundled api for all bundle operations */\nexport { getBundleDetails } from './utilities/getBundleDetails.js';\nexport { bundleTask } from './utilities/bundleTask.js';\nexport { createBundleTask } from './utilities/createBundleTask.js';\nexport { createBundleRequestForPackage } from './utilities/createBundleRequestForPackage.js';\nexport { findImports } from './utilities/findImports.js';\n\nexport type { BundleRequest } from './types/BundleRequest.js';\nexport type { BundleTaskOptions } from './types/BundleTaskOptions.js';\n"]}