@ms-cloudpack/api-server 0.46.5 → 0.47.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.
@@ -3,7 +3,7 @@ import type { ApiParams } from '../types/ApiParams.js';
3
3
  /**
4
4
  * Input for `ensurePackageBundled`.
5
5
  */
6
- export interface EnsurePackageBundledInput extends Pick<BundleRequest, 'outputPath' | 'version' | 'bundlerType' | 'disableSourceMaps' | 'shouldGetBundleInfo'> {
6
+ export interface EnsurePackageBundledInput extends Pick<BundleRequest, 'outputPath' | 'version' | 'bundler' | 'disableSourceMaps' | 'shouldGetBundleInfo'> {
7
7
  /** Package name */
8
8
  name: string;
9
9
  /** Whether to also ensure dependencies are bundled */
@@ -30,7 +30,7 @@ export interface EnsurePackageBundledInput extends Pick<BundleRequest, 'outputPa
30
30
  /**
31
31
  * Result of ensuring a single package is bundled.
32
32
  */
33
- export interface EnsurePackageBundledResult extends Omit<NonNullable<BundleRequest['result']>, 'rebuild' | 'dispose'> {
33
+ export interface EnsurePackageBundledResult extends Omit<NonNullable<BundleRequest['result']>, 'rebuild' | 'dispose' | 'bundlerName'> {
34
34
  /** Package name */
35
35
  name: string;
36
36
  /** Package version */
@@ -1 +1 @@
1
- {"version":3,"file":"ensurePackageBundled.d.ts","sourceRoot":"","sources":["../../src/apis/ensurePackageBundled.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAKvD;;GAEG;AACH,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,YAAY,GAAG,SAAS,GAAG,aAAa,GAAG,mBAAmB,GAAG,qBAAqB,CAAC;IACnH,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,wCAAwC;IACxC,WAAW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CAAC,0BAA0B,EAAE,CAAC,CAAC;CACrD;AAOD;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,SAAS,CACf,yBAAyB,EACvB,KAAK,GACL,YAAY,GACZ,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,iBAAiB,GACjB,oBAAoB,GACpB,eAAe,CAClB,GACA,OAAO,CAAC,0BAA0B,CAAC,CAmCrC;yBAhDqB,oBAAoB;;;;;;;;;;;;;;;;AAmM1C,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC"}
@@ -11,7 +11,7 @@ const ZodEnsurePackageBundledInput = matchingZodObject({
11
11
  name: z.string(),
12
12
  version: z.string(),
13
13
  outputPath: z.string().optional(),
14
- bundlerType: z.string().optional(),
14
+ bundler: z.string().optional(),
15
15
  disableSourceMaps: z.boolean().optional(),
16
16
  enqueueDependencies: z.boolean().optional(),
17
17
  shouldGetBundleInfo: z.boolean().optional(),
@@ -26,7 +26,7 @@ const ZodEnsurePackageBundledInput = matchingZodObject({
26
26
  const ZodEnsurePackageBundledResult = matchingZodObject({
27
27
  name: z.string(),
28
28
  version: z.string(),
29
- bundlerName: z.string().optional(),
29
+ bundler: z.string().optional(),
30
30
  inputPath: z.string(),
31
31
  outputPath: z.string(),
32
32
  entries: z.record(z.string()).optional(),
@@ -97,7 +97,7 @@ export async function ensurePackageBundled(params) {
97
97
  }
98
98
  async function ensurePackageBundledInternal(params) {
99
99
  const { input, ctx, visited } = params;
100
- const { name, version, shouldWatch, bundlerType, disableSourceMaps, outputPath, shouldGetBundleInfo, shouldRerun, shouldForce, disableCache, isIncremental, useHashAsId, priority, } = input;
100
+ const { name, version, shouldWatch, bundler, disableSourceMaps, outputPath, shouldGetBundleInfo, shouldRerun, shouldForce, disableCache, isIncremental, useHashAsId, priority, } = input;
101
101
  const { taskRunner, session, watcher, packageHashes } = ctx;
102
102
  const { resolveMap, config } = session;
103
103
  const { features } = config;
@@ -133,7 +133,7 @@ async function ensurePackageBundledInternal(params) {
133
133
  // Use the hash as the id if useHashAsId is enabled.
134
134
  id: hash ?? packageEntry.path,
135
135
  packageEntry,
136
- bundlerType,
136
+ bundler,
137
137
  disableSourceMaps,
138
138
  outputPath,
139
139
  shouldGetBundleInfo: shouldGetBundleInfo || enqueueDependencies,
@@ -1 +1 @@
1
- {"version":3,"file":"ensurePackageBundled.js","sourceRoot":"","sources":["../../src/apis/ensurePackageBundled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AA+BlF,MAAM,4BAA4B,GAAG,iBAAiB,CAA4B;IAChF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACzC,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC3C,mBAAmB,EAAE,CAAC,CAAC,OAA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C,YAAY,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,GAAG,CAAC,CAAC;YACrD,CAAC;QACH,CAAC,CAAC;QACF,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,GAAG,EAAE;YAC/B,KAAK,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,oCAAoC;IACpC,IAAI,mBAAmB,IAAI,MAAM,EAAE,IAAI,EAAE,CAAC;QACxC,KAAK,MAAM,cAAc,IAAI,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YAClE,MAAM,iBAAiB,GAAG,YAAY,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;YAEpE,uEAAuE;YACvE,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,cAAc,IAAI,iBAAiB,EAAE,CAAC,EAAE,CAAC;gBAC1D,SAAS;YACX,CAAC;YAED,gBAAgB,CAAC,IAAI,CAAC;gBACpB,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,iBAAiB;gBAC1B,WAAW;gBACX,mBAAmB;aACpB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE;YACN,OAAO;YACP,IAAI;YACJ,UAAU;YACV,GAAG,MAAM;SACV;QACD,gBAAgB;KACjB,CAAC;AACJ,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 { z } from 'zod';\nimport { findResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport { publicProcedure } from '../trpc/common.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport { createBundleTask } from '../utilities/createBundleTask.js';\nimport { createBundleRequestForPackage } from '../utilities/createBundleRequestForPackage.js';\nimport { ZodTaskMessage } from '../types/TaskMessage.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nimport type { WatchOptions } from '@ms-cloudpack/file-watcher';\nimport { getConsumedDependencies } from '../utilities/getConsumedDependencies.js';\n\n/**\n * Input for `ensurePackageBundled`.\n */\nexport interface EnsurePackageBundledInput\n extends Pick<BundleRequest, 'outputPath' | 'version' | 'bundlerType' | 'disableSourceMaps' | 'shouldGetBundleInfo'> {\n /** Package name */\n name: string;\n /** Whether to also ensure dependencies are bundled */\n enqueueDependencies?: boolean;\n /** Whether to re-run the bundle task */\n shouldRerun?: boolean;\n /** Whether to watch for changes (internal packages only) */\n shouldWatch?: boolean;\n /** Whether to force re-bundling */\n shouldForce?: boolean;\n /** Whether to disable caching. */\n disableCache?: boolean;\n /** Whether to support incremental rebuilds. Defaults to true for internal libraries. */\n isIncremental?: boolean;\n /**\n * Whether to use a hash as the bundle id instead of the path.\n * Reduces performance when used with shouldForce as it hashes twice,\n * but eliminates task cache artifacts when handling many apps.\n */\n useHashAsId?: boolean;\n /** Priority for bundling. Greater priority will be scheduled first (defaults to 0). */\n priority?: number;\n}\n\nconst ZodEnsurePackageBundledInput = matchingZodObject<EnsurePackageBundledInput>({\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 shouldGetBundleInfo: z.boolean().optional(),\n shouldRerun: z.boolean().optional(),\n shouldWatch: z.boolean().optional(),\n shouldForce: z.boolean().optional(),\n disableCache: z.boolean().optional(),\n isIncremental: z.boolean().optional(),\n useHashAsId: z.boolean().optional(),\n priority: z.number().optional(),\n});\n\n/**\n * Result of ensuring a single package is bundled.\n */\nexport interface EnsurePackageBundledResult extends Omit<NonNullable<BundleRequest['result']>, 'rebuild' | 'dispose'> {\n /** Package name */\n name: string;\n /** Package version */\n version: string;\n /** Package dependency names (prod and peer) */\n dependencies?: string[];\n /** Whether the package is external (not defined in this repo) */\n isExternal: boolean;\n}\n\nconst ZodEnsurePackageBundledResult = matchingZodObject<EnsurePackageBundledResult>({\n name: z.string(),\n version: z.string(),\n bundlerName: z.string().optional(),\n inputPath: z.string(),\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(ZodTaskMessage).optional(),\n warnings: z.array(ZodTaskMessage).optional(),\n isExternal: z.boolean(),\n info: z\n .record(\n z.object({\n bundlePath: z.string(),\n produces: z.array(z.string()),\n consumes: z.array(\n z.object({\n packageName: z.string(),\n importPath: z.string(),\n names: z.array(z.string()),\n }),\n ),\n }),\n )\n .optional(),\n});\n\n/**\n * Complete output for `ensurePackageBundled`.\n */\nexport interface EnsurePackageBundledOutput {\n /** Result of bundling this package */\n result: EnsurePackageBundledResult;\n /** Results of bundling dependencies */\n dependencies: Promise<EnsurePackageBundledResult[]>;\n}\n\nconst ZodEnsurePackageBundledOutput = matchingZodObject<EnsurePackageBundledOutput>({\n result: ZodEnsurePackageBundledResult,\n dependencies: z.promise(ZodEnsurePackageBundledResult.array()),\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 params: ApiParams<\n EnsurePackageBundledInput,\n | 'bus'\n | 'taskRunner'\n | 'session'\n | 'watcher'\n | 'packages'\n | 'reporter'\n | 'telemetryClient'\n | 'packageImportPaths'\n | 'packageHashes'\n >,\n): Promise<EnsurePackageBundledOutput> {\n const { input, ctx } = params;\n const results: EnsurePackageBundledResult[] = [];\n const visited = new Set<`${string}@${string}`>();\n const bundleResult = await ensurePackageBundledInternal({ input, ctx, visited });\n const { result } = bundleResult;\n const mainDependencies = bundleResult.dependencyInputs;\n\n let pending = 0;\n const dependencies = new Promise<EnsurePackageBundledResult[]>((resolve) => {\n const enqueue = (dependencyInputs: EnsurePackageBundledInput[]) => {\n for (const dependencyInput of dependencyInputs) {\n pending++;\n void ensurePackageBundledInternal({\n input: dependencyInput,\n ctx,\n visited,\n }).then((dependencyBundleResult) => {\n pending--;\n results.push(dependencyBundleResult.result);\n enqueue(dependencyBundleResult.dependencyInputs);\n if (!pending) {\n resolve(results);\n }\n });\n }\n };\n\n enqueue(mainDependencies);\n });\n\n return {\n result,\n dependencies,\n };\n}\n\nasync function ensurePackageBundledInternal(\n params: Parameters<typeof ensurePackageBundled>[0] & {\n visited: Set<`${string}@${string}`>;\n },\n): Promise<{ result: EnsurePackageBundledResult; dependencyInputs: EnsurePackageBundledInput[] }> {\n const { input, ctx, visited } = params;\n const {\n name,\n version,\n shouldWatch,\n bundlerType,\n disableSourceMaps,\n outputPath,\n shouldGetBundleInfo,\n shouldRerun,\n shouldForce,\n disableCache,\n isIncremental,\n useHashAsId,\n priority,\n } = input;\n const { taskRunner, session, watcher, packageHashes } = ctx;\n const { resolveMap, config } = session;\n const { features } = config;\n const enqueueDependencies = input.enqueueDependencies ?? features?.enqueueDependencies;\n const dependencyInputs: EnsurePackageBundledInput[] = [];\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 let hash: string | undefined = undefined;\n let sourceHash: string | undefined = undefined;\n\n if (useHashAsId) {\n // If we are using the hash as the task id, we need to calculate it once and pass it to the task\n // to prevent a race condition in which we get a different hash than the one used in the task id.\n hash = await packageHashes.get({\n packagePath: packageEntry.path,\n isSourceHashingEnabled: false,\n shouldRecalculate: true,\n });\n\n if (!packageEntry.isExternal) {\n // We only need the source hash for internal packages for cache validation.\n sourceHash = await packageHashes.get({\n packagePath: packageEntry.path,\n isSourceHashingEnabled: true,\n shouldRecalculate: true,\n });\n }\n }\n\n const bundleRequest = createBundleRequestForPackage(\n {\n // Use the hash as the id if useHashAsId is enabled.\n id: hash ?? packageEntry.path,\n packageEntry,\n bundlerType,\n disableSourceMaps,\n outputPath,\n shouldGetBundleInfo: shouldGetBundleInfo || enqueueDependencies,\n disableCache,\n isIncremental,\n },\n { config },\n );\n\n // Make priority negative to have retry count set to positive values.\n const retryCount = priority ? -1 * priority : undefined;\n\n const task = createBundleTask({ bundleRequest, force: shouldForce, hash, sourceHash, retryCount }, ctx);\n\n // TODO: Add lage scheduling back.\n const { result } = await taskRunner.add<BundleRequest>(task, { rerun: shouldRerun, priority });\n\n if (!result) {\n throw new Error('Bundle failed, no result');\n }\n\n const { isExternal } = bundleRequest;\n const definition = await ctx.packages.get(packageEntry.path);\n const { inputPaths } = definition?.cloudpack || {};\n const watchOptions: WatchOptions = {\n path: packageEntry.path,\n watchPaths: inputPaths,\n };\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 === 0) {\n notifyReload({ reason: 'on-package-change' }, ctx);\n }\n };\n watcher.watch(watchOptions, () => {\n void onPackageChange();\n });\n }\n\n // If enabled, enqueue dependencies.\n if (enqueueDependencies && result?.info) {\n for (const dependencyName of getConsumedDependencies(result.info)) {\n const dependencyVersion = packageEntry.dependencies[dependencyName];\n\n // If we've already visited this package from another package, skip it.\n if (visited.has(`${dependencyName}@${dependencyVersion}`)) {\n continue;\n }\n\n dependencyInputs.push({\n name: dependencyName,\n version: dependencyVersion,\n shouldWatch,\n enqueueDependencies,\n });\n }\n }\n\n return {\n result: {\n version,\n name,\n isExternal,\n ...result,\n },\n dependencyInputs,\n };\n}\n\n// Attach a trpc procedure to the function.\nensurePackageBundled.procedure = publicProcedure\n .input(ZodEnsurePackageBundledInput)\n .output(ZodEnsurePackageBundledOutput)\n .mutation(ensurePackageBundled);\n\nexport type EnsurePackageBundledContext = Parameters<typeof ensurePackageBundled>[0]['ctx'];\n"]}
1
+ {"version":3,"file":"ensurePackageBundled.js","sourceRoot":"","sources":["../../src/apis/ensurePackageBundled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AA+BlF,MAAM,4BAA4B,GAAG,iBAAiB,CAA4B;IAChF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACzC,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC3C,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC3C,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACnC,WAAW,EAAE,CAAC,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AC,KAAK,CAAC,YAAY,EAAE,GAAG,EAAE;YAC/B,KAAK,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,oCAAoC;IACpC,IAAI,mBAAmB,IAAI,MAAM,EAAE,IAAI,EAAE,CAAC;QACxC,KAAK,MAAM,cAAc,IAAI,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YAClE,MAAM,iBAAiB,GAAG,YAAY,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;YAEpE,uEAAuE;YACvE,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,cAAc,IAAI,iBAAiB,EAAE,CAAC,EAAE,CAAC;gBAC1D,SAAS;YACX,CAAC;YAED,gBAAgB,CAAC,IAAI,CAAC;gBACpB,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,iBAAiB;gBAC1B,WAAW;gBACX,mBAAmB;aACpB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE;YACN,OAAO;YACP,IAAI;YACJ,UAAU;YACV,GAAG,MAAM;SACV;QACD,gBAAgB;KACjB,CAAC;AACJ,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 { z } from 'zod';\nimport { findResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport { publicProcedure } from '../trpc/common.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport { createBundleTask } from '../utilities/createBundleTask.js';\nimport { createBundleRequestForPackage } from '../utilities/createBundleRequestForPackage.js';\nimport { ZodTaskMessage } from '../types/TaskMessage.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nimport type { WatchOptions } from '@ms-cloudpack/file-watcher';\nimport { getConsumedDependencies } from '../utilities/getConsumedDependencies.js';\n\n/**\n * Input for `ensurePackageBundled`.\n */\nexport interface EnsurePackageBundledInput\n extends Pick<BundleRequest, 'outputPath' | 'version' | 'bundler' | 'disableSourceMaps' | 'shouldGetBundleInfo'> {\n /** Package name */\n name: string;\n /** Whether to also ensure dependencies are bundled */\n enqueueDependencies?: boolean;\n /** Whether to re-run the bundle task */\n shouldRerun?: boolean;\n /** Whether to watch for changes (internal packages only) */\n shouldWatch?: boolean;\n /** Whether to force re-bundling */\n shouldForce?: boolean;\n /** Whether to disable caching. */\n disableCache?: boolean;\n /** Whether to support incremental rebuilds. Defaults to true for internal libraries. */\n isIncremental?: boolean;\n /**\n * Whether to use a hash as the bundle id instead of the path.\n * Reduces performance when used with shouldForce as it hashes twice,\n * but eliminates task cache artifacts when handling many apps.\n */\n useHashAsId?: boolean;\n /** Priority for bundling. Greater priority will be scheduled first (defaults to 0). */\n priority?: number;\n}\n\nconst ZodEnsurePackageBundledInput = matchingZodObject<EnsurePackageBundledInput>({\n name: z.string(),\n version: z.string(),\n outputPath: z.string().optional(),\n bundler: z.string().optional(),\n disableSourceMaps: z.boolean().optional(),\n enqueueDependencies: z.boolean().optional(),\n shouldGetBundleInfo: z.boolean().optional(),\n shouldRerun: z.boolean().optional(),\n shouldWatch: z.boolean().optional(),\n shouldForce: z.boolean().optional(),\n disableCache: z.boolean().optional(),\n isIncremental: z.boolean().optional(),\n useHashAsId: z.boolean().optional(),\n priority: z.number().optional(),\n});\n\n/**\n * Result of ensuring a single package is bundled.\n */\nexport interface EnsurePackageBundledResult\n extends Omit<NonNullable<BundleRequest['result']>, 'rebuild' | 'dispose' | 'bundlerName'> {\n /** Package name */\n name: string;\n /** Package version */\n version: string;\n /** Package dependency names (prod and peer) */\n dependencies?: string[];\n /** Whether the package is external (not defined in this repo) */\n isExternal: boolean;\n}\n\nconst ZodEnsurePackageBundledResult = matchingZodObject<EnsurePackageBundledResult>({\n name: z.string(),\n version: z.string(),\n bundler: z.string().optional(),\n inputPath: z.string(),\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(ZodTaskMessage).optional(),\n warnings: z.array(ZodTaskMessage).optional(),\n isExternal: z.boolean(),\n info: z\n .record(\n z.object({\n bundlePath: z.string(),\n produces: z.array(z.string()),\n consumes: z.array(\n z.object({\n packageName: z.string(),\n importPath: z.string(),\n names: z.array(z.string()),\n }),\n ),\n }),\n )\n .optional(),\n});\n\n/**\n * Complete output for `ensurePackageBundled`.\n */\nexport interface EnsurePackageBundledOutput {\n /** Result of bundling this package */\n result: EnsurePackageBundledResult;\n /** Results of bundling dependencies */\n dependencies: Promise<EnsurePackageBundledResult[]>;\n}\n\nconst ZodEnsurePackageBundledOutput = matchingZodObject<EnsurePackageBundledOutput>({\n result: ZodEnsurePackageBundledResult,\n dependencies: z.promise(ZodEnsurePackageBundledResult.array()),\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 params: ApiParams<\n EnsurePackageBundledInput,\n | 'bus'\n | 'taskRunner'\n | 'session'\n | 'watcher'\n | 'packages'\n | 'reporter'\n | 'telemetryClient'\n | 'packageImportPaths'\n | 'packageHashes'\n >,\n): Promise<EnsurePackageBundledOutput> {\n const { input, ctx } = params;\n const results: EnsurePackageBundledResult[] = [];\n const visited = new Set<`${string}@${string}`>();\n const bundleResult = await ensurePackageBundledInternal({ input, ctx, visited });\n const { result } = bundleResult;\n const mainDependencies = bundleResult.dependencyInputs;\n\n let pending = 0;\n const dependencies = new Promise<EnsurePackageBundledResult[]>((resolve) => {\n const enqueue = (dependencyInputs: EnsurePackageBundledInput[]) => {\n for (const dependencyInput of dependencyInputs) {\n pending++;\n void ensurePackageBundledInternal({\n input: dependencyInput,\n ctx,\n visited,\n }).then((dependencyBundleResult) => {\n pending--;\n results.push(dependencyBundleResult.result);\n enqueue(dependencyBundleResult.dependencyInputs);\n if (!pending) {\n resolve(results);\n }\n });\n }\n };\n\n enqueue(mainDependencies);\n });\n\n return {\n result,\n dependencies,\n };\n}\n\nasync function ensurePackageBundledInternal(\n params: Parameters<typeof ensurePackageBundled>[0] & {\n visited: Set<`${string}@${string}`>;\n },\n): Promise<{ result: EnsurePackageBundledResult; dependencyInputs: EnsurePackageBundledInput[] }> {\n const { input, ctx, visited } = params;\n const {\n name,\n version,\n shouldWatch,\n bundler,\n disableSourceMaps,\n outputPath,\n shouldGetBundleInfo,\n shouldRerun,\n shouldForce,\n disableCache,\n isIncremental,\n useHashAsId,\n priority,\n } = input;\n const { taskRunner, session, watcher, packageHashes } = ctx;\n const { resolveMap, config } = session;\n const { features } = config;\n const enqueueDependencies = input.enqueueDependencies ?? features?.enqueueDependencies;\n const dependencyInputs: EnsurePackageBundledInput[] = [];\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 let hash: string | undefined = undefined;\n let sourceHash: string | undefined = undefined;\n\n if (useHashAsId) {\n // If we are using the hash as the task id, we need to calculate it once and pass it to the task\n // to prevent a race condition in which we get a different hash than the one used in the task id.\n hash = await packageHashes.get({\n packagePath: packageEntry.path,\n isSourceHashingEnabled: false,\n shouldRecalculate: true,\n });\n\n if (!packageEntry.isExternal) {\n // We only need the source hash for internal packages for cache validation.\n sourceHash = await packageHashes.get({\n packagePath: packageEntry.path,\n isSourceHashingEnabled: true,\n shouldRecalculate: true,\n });\n }\n }\n\n const bundleRequest = createBundleRequestForPackage(\n {\n // Use the hash as the id if useHashAsId is enabled.\n id: hash ?? packageEntry.path,\n packageEntry,\n bundler,\n disableSourceMaps,\n outputPath,\n shouldGetBundleInfo: shouldGetBundleInfo || enqueueDependencies,\n disableCache,\n isIncremental,\n },\n { config },\n );\n\n // Make priority negative to have retry count set to positive values.\n const retryCount = priority ? -1 * priority : undefined;\n\n const task = createBundleTask({ bundleRequest, force: shouldForce, hash, sourceHash, retryCount }, ctx);\n\n // TODO: Add lage scheduling back.\n const { result } = await taskRunner.add<BundleRequest>(task, { rerun: shouldRerun, priority });\n\n if (!result) {\n throw new Error('Bundle failed, no result');\n }\n\n const { isExternal } = bundleRequest;\n const definition = await ctx.packages.get(packageEntry.path);\n const { inputPaths } = definition?.cloudpack || {};\n const watchOptions: WatchOptions = {\n path: packageEntry.path,\n watchPaths: inputPaths,\n };\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 === 0) {\n notifyReload({ reason: 'on-package-change' }, ctx);\n }\n };\n watcher.watch(watchOptions, () => {\n void onPackageChange();\n });\n }\n\n // If enabled, enqueue dependencies.\n if (enqueueDependencies && result?.info) {\n for (const dependencyName of getConsumedDependencies(result.info)) {\n const dependencyVersion = packageEntry.dependencies[dependencyName];\n\n // If we've already visited this package from another package, skip it.\n if (visited.has(`${dependencyName}@${dependencyVersion}`)) {\n continue;\n }\n\n dependencyInputs.push({\n name: dependencyName,\n version: dependencyVersion,\n shouldWatch,\n enqueueDependencies,\n });\n }\n }\n\n return {\n result: {\n version,\n name,\n isExternal,\n ...result,\n },\n dependencyInputs,\n };\n}\n\n// Attach a trpc procedure to the function.\nensurePackageBundled.procedure = publicProcedure\n .input(ZodEnsurePackageBundledInput)\n .output(ZodEnsurePackageBundledOutput)\n .mutation(ensurePackageBundled);\n\nexport type EnsurePackageBundledContext = Parameters<typeof ensurePackageBundled>[0]['ctx'];\n"]}
@@ -19,7 +19,7 @@ export interface BundleRequest {
19
19
  /** Whether we should force the incremental flag. */
20
20
  isIncremental?: boolean;
21
21
  /** Force using this bundler */
22
- bundlerType?: string;
22
+ bundler?: string;
23
23
  /** Bundle mode */
24
24
  mode: BundleMode;
25
25
  /** Result of bundling */
@@ -1 +1 @@
1
- {"version":3,"file":"BundleRequest.d.ts","sourceRoot":"","sources":["../../src/types/BundleRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,UAAU,EAAE,OAAO,CAAC;IACpB,oDAAoD;IACpD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,yBAAyB;IACzB,MAAM,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,GACvC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,GAAG;QAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,UAAU,CAAC;KACnB,CAAC;IACJ,2EAA2E;IAE3E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5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1 @@
1
- {"version":3,"file":"BundleRequest.js","sourceRoot":"","sources":["../../src/types/BundleRequest.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMode, BundleResult } from '@ms-cloudpack/common-types';\nimport type { BundleInfo } from './BundleInfo.js';\n\n/**\n * Tracks a given bundle request and its result.\n */\nexport interface BundleRequest {\n /** ID for the bundle */\n id: string;\n /** Package name being bundled */\n packageName: string;\n /** Package version being bundled */\n version: string;\n /** Absolute path to the package */\n packagePath: string;\n /** Absolute path for the bundle output */\n outputPath?: string;\n /** Whether this is an external package (in node_modules) */\n isExternal: boolean;\n /** Whether we should force the incremental flag. */\n isIncremental?: boolean;\n /** Force using this bundler */\n bundlerType?: string;\n /** Bundle mode */\n mode: BundleMode;\n /** Result of bundling */\n result?: Omit<BundleResult, 'outputPath'> &\n Required<Pick<BundleRequest, 'outputPath'>> & {\n hash?: string;\n info?: BundleInfo;\n };\n /** Whether the result was retrieved from the cache (set while bundling) */\n // TODO: this seems like it should be a property of the result?\n resultFromCache?: boolean;\n /** Whether to disable source maps */\n disableSourceMaps?: boolean;\n /** Whether to scan the bundled code for imports and exports */\n shouldGetBundleInfo?: boolean;\n /** Whether to disable caching */\n disableCache?: boolean;\n}\n"]}
1
+ {"version":3,"file":"BundleRequest.js","sourceRoot":"","sources":["../../src/types/BundleRequest.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMode, BundleResult } from '@ms-cloudpack/common-types';\nimport type { BundleInfo } from './BundleInfo.js';\n\n/**\n * Tracks a given bundle request and its result.\n */\nexport interface BundleRequest {\n /** ID for the bundle */\n id: string;\n /** Package name being bundled */\n packageName: string;\n /** Package version being bundled */\n version: string;\n /** Absolute path to the package */\n packagePath: string;\n /** Absolute path for the bundle output */\n outputPath?: string;\n /** Whether this is an external package (in node_modules) */\n isExternal: boolean;\n /** Whether we should force the incremental flag. */\n isIncremental?: boolean;\n /** Force using this bundler */\n bundler?: string;\n /** Bundle mode */\n mode: BundleMode;\n /** Result of bundling */\n result?: Omit<BundleResult, 'outputPath'> &\n Required<Pick<BundleRequest, 'outputPath'>> & {\n hash?: string;\n info?: BundleInfo;\n };\n /** Whether the result was retrieved from the cache (set while bundling) */\n // TODO: this seems like it should be a property of the result?\n resultFromCache?: boolean;\n /** Whether to disable source maps */\n disableSourceMaps?: boolean;\n /** Whether to scan the bundled code for imports and exports */\n shouldGetBundleInfo?: boolean;\n /** Whether to disable caching */\n disableCache?: boolean;\n}\n"]}
@@ -2,5 +2,5 @@ import type { BundleRequest } from './BundleRequest.js';
2
2
  /**
3
3
  * The result object that is written to the cache. This is a subset of the BundleRequest.result object.
4
4
  */
5
- export type ResultJson = Pick<Exclude<BundleRequest['result'], undefined>, 'bundlerName' | 'entries' | 'hash' | 'outputFiles' | 'warnings' | 'errors'>;
5
+ export type ResultJson = Pick<NonNullable<BundleRequest['result']>, 'bundler' | 'entries' | 'hash' | 'outputFiles' | 'warnings' | 'errors'>;
6
6
  //# sourceMappingURL=ResultJson.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResultJson.d.ts","sourceRoot":"","sources":["../../src/types/ResultJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,EAC3C,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,QAAQ,CAC3E,CAAC"}
1
+ {"version":3,"file":"ResultJson.d.ts","sourceRoot":"","sources":["../../src/types/ResultJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,EACpC,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,QAAQ,CACvE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ResultJson.js","sourceRoot":"","sources":["../../src/types/ResultJson.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleRequest } from './BundleRequest.js';\n\n/**\n * The result object that is written to the cache. This is a subset of the BundleRequest.result object.\n */\nexport type ResultJson = Pick<\n Exclude<BundleRequest['result'], undefined>,\n 'bundlerName' | 'entries' | 'hash' | 'outputFiles' | 'warnings' | 'errors'\n>;\n"]}
1
+ {"version":3,"file":"ResultJson.js","sourceRoot":"","sources":["../../src/types/ResultJson.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleRequest } from './BundleRequest.js';\n\n/**\n * The result object that is written to the cache. This is a subset of the BundleRequest.result object.\n */\nexport type ResultJson = Pick<\n NonNullable<BundleRequest['result']>,\n 'bundler' | 'entries' | 'hash' | 'outputFiles' | 'warnings' | 'errors'\n>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bundleTask.d.ts","sourceRoot":"","sources":["../../src/utilities/bundleTask.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAQvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,GAAG;IAAE,aAAa,EAAE,aAAa,CAAA;CAAE,CAAC;AAC7F,MAAM,MAAM,yBAAyB,GAAG,cAAc,CACpD,UAAU,GAAG,eAAe,GAAG,UAAU,GAAG,iBAAiB,EAC7D,YAAY,GAAG,QAAQ,CACxB,CAAC;AAEF;;GAEG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CAsHf"}
1
+ {"version":3,"file":"bundleTask.d.ts","sourceRoot":"","sources":["../../src/utilities/bundleTask.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAQvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,GAAG;IAAE,aAAa,EAAE,aAAa,CAAA;CAAE,CAAC;AAC7F,MAAM,MAAM,yBAAyB,GAAG,cAAc,CACpD,UAAU,GAAG,eAAe,GAAG,UAAU,GAAG,iBAAiB,EAC7D,YAAY,GAAG,QAAQ,CACxB,CAAC;AAEF;;GAEG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CAuHf"}
@@ -62,11 +62,11 @@ export async function bundleTask(options, context) {
62
62
  }
63
63
  else {
64
64
  const settings = (await packages.get(packagePath))?.cloudpack;
65
- const { bundlerType, bundlerOptions, inlinedDependencies, dynamicImports } = settings || {};
65
+ const { bundler, bundlerOptions, inlinedDependencies, dynamicImports, bundlerCapabilities } = settings || {};
66
66
  const bundleOptions = {
67
- bundlerType: bundleRequest.bundlerType || bundlerType,
67
+ bundler: bundleRequest.bundler || bundler,
68
68
  minify: mode === 'production',
69
- overrideOptions: bundlerOptions,
69
+ bundlerOptions,
70
70
  inputPath: packagePath,
71
71
  outputPath,
72
72
  incremental: isIncremental !== undefined ? isIncremental : false,
@@ -76,6 +76,7 @@ export async function bundleTask(options, context) {
76
76
  external: await getExternalsFromPackage({ inputPath: packagePath }, { packages, config }),
77
77
  dynamicImports,
78
78
  ignoredBundlerWarnings: settings?.ignoredBundlerWarnings,
79
+ bundlerCapabilities,
79
80
  };
80
81
  const bundleInternalResult = await bundle(bundleOptions, { config });
81
82
  bundleRequest.result = {
@@ -1 +1 @@
1
- {"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U,CAAC,CAAC;QACxC,CAAC;QAED,mCAAmC,EAAE,MAAM,CAAC;YAC1C,UAAU,EAAE,CAAC,CAAC,aAAa,CAAC,eAAe;YAC3C,UAAU,EAAE,aAAa,CAAC,UAAU;SACrC,CAAC,CAAC;QAEH,OAAO,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { bundle, getEntriesMapFromPackage, getExternalsFromPackage } from '@ms-cloudpack/bundler';\nimport type { BundleOptions } from '@ms-cloudpack/common-types';\nimport { writeJson } from '@ms-cloudpack/json-utilities';\nimport { getExportsMap } from '@ms-cloudpack/package-utilities';\nimport { formatPackageName } from '@ms-cloudpack/task-reporter';\nimport path from 'path';\nimport { prepareOutputPath } from '../common/prepareOutputPath.js';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { BundleTaskOptions } from '../types/BundleTaskOptions.js';\nimport { diskCacheRatioMetricEventAggregator } from './diskCacheRatioMetricEventAggregator.js';\nimport { getBundleInfo } from './getBundleInfo.js';\nimport { getBundleLocation } from './getBundleLocation.js';\nimport { isCachedResultValid } from './isCachedResultValid.js';\nimport { readResultFromCache } from './readResultFromCache.js';\nimport { saveResultToCache } from './saveResultToCache.js';\nimport { formatBundleTaskResult } from './formatBundleTaskResult.js';\nimport type { PartialContext } from '../types/Context.js';\n\nexport type BundleTaskInternalOptions = BundleTaskOptions & { bundleRequest: BundleRequest };\nexport type BundleTaskInternalContext = PartialContext<\n 'packages' | 'packageHashes' | 'reporter' | 'telemetryClient',\n 'resolveMap' | 'config'\n>;\n\n/**\n * Create and run a TaskReporter task which calls `bundle()` from `@ms-cloudpack/bundler` and formats the result.\n */\nexport async function bundleTask(\n options: BundleTaskInternalOptions,\n context: BundleTaskInternalContext,\n): Promise<void> {\n const { bundleRequest, force, hash, sourceHash } = options;\n const { packageName, version } = bundleRequest;\n const { reporter, telemetryClient, packageHashes, packages, session } = context;\n const { config } = session;\n const { mode } = config;\n const { retryCount } = options;\n\n telemetryClient?.performance.registerAggregator(diskCacheRatioMetricEventAggregator);\n\n const taskName = `Bundle ${formatPackageName({\n name: packageName,\n version,\n })}${retryCount ? ` (retry ${retryCount})` : ''}`;\n\n await reporter.runTask(taskName, async () => {\n // If force is set, dispose the existing result.\n if (force && bundleRequest?.result?.dispose) {\n bundleRequest.result.dispose();\n bundleRequest.result = undefined;\n }\n\n const { packagePath, isExternal, isIncremental, disableSourceMaps, shouldGetBundleInfo } = bundleRequest;\n\n const outputPath =\n bundleRequest.outputPath ??\n (await getBundleLocation({ packagePath, shouldRecalculate: force, hash }, context)).path;\n\n // Rehydrate the result if not incremental.\n if (bundleRequest.result === undefined && !force) {\n bundleRequest.result = await readResultFromCache(outputPath, {\n inputPath: packagePath,\n });\n }\n\n const cacheValidationHash = !isExternal\n ? sourceHash || (await packageHashes.get({ packagePath, isSourceHashingEnabled: true, shouldRecalculate: true }))\n : undefined;\n\n // if the cached result is valid, use it.\n if (!force && isCachedResultValid({ bundleRequest, hash: cacheValidationHash })) {\n console.debug(`Using cached result for ${bundleRequest.packageName}@${bundleRequest.version}`);\n bundleRequest.resultFromCache = true;\n } else {\n bundleRequest.resultFromCache = false;\n\n // Only use cached result if it's successful.\n await prepareOutputPath(outputPath);\n\n if (bundleRequest.result?.rebuild) {\n bundleRequest.result = {\n ...(await bundleRequest.result.rebuild()),\n outputPath: bundleRequest.result.outputPath,\n hash: cacheValidationHash,\n };\n } else {\n const settings = (await packages.get(packagePath))?.cloudpack;\n const { bundlerType, bundlerOptions, inlinedDependencies, dynamicImports } = settings || {};\n\n const bundleOptions: BundleOptions = {\n bundlerType: bundleRequest.bundlerType || bundlerType,\n minify: mode === 'production',\n overrideOptions: bundlerOptions,\n inputPath: packagePath,\n outputPath,\n incremental: isIncremental !== undefined ? isIncremental : false,\n sourcemap: !disableSourceMaps,\n entries: await getEntriesMapFromPackage({ inputPath: packagePath }, { packages, config }),\n inlined: inlinedDependencies,\n external: await getExternalsFromPackage({ inputPath: packagePath }, { packages, config }),\n dynamicImports,\n ignoredBundlerWarnings: settings?.ignoredBundlerWarnings,\n };\n\n const bundleInternalResult = await bundle(bundleOptions, { config });\n bundleRequest.result = {\n ...bundleInternalResult,\n outputPath: bundleOptions.outputPath ?? outputPath,\n hash: cacheValidationHash,\n };\n }\n\n // Write the result to disk.\n await saveResultToCache(bundleRequest.result);\n }\n\n // If we should find required imports and exports per bundle\n if (shouldGetBundleInfo && !bundleRequest.result?.errors?.length && bundleRequest.result?.outputFiles?.length) {\n const bundleInfoPath = path.join(outputPath, 'bundle-info.json');\n\n // Exports map is needed to find the bundle info per entry we intend to bundle.\n // Exports map is used instead of bundleRequest.entries since it is easier to use\n // because it contains the paths other packages use to import the entry and\n // the relative location of the bundled files.\n const exportsMap = await getExportsMap({ packagePath }, { packages, config });\n\n const bundleInfo = await getBundleInfo({\n outputPath,\n outputFiles: bundleRequest.result.outputFiles,\n exportsMap,\n isExternal,\n packagePath,\n });\n\n bundleRequest.result.info = bundleInfo;\n\n // Write to cache for future use. (Ignore the promise result.)\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n writeJson(bundleInfoPath, bundleInfo);\n }\n\n diskCacheRatioMetricEventAggregator?.record({\n isCacheHit: !!bundleRequest.resultFromCache,\n isExternal: bundleRequest.isExternal,\n });\n\n return formatBundleTaskResult(bundleRequest);\n });\n}\n"]}
1
+ {"version":3,"file":"bundleTask.js","sourceRoot":"","sources":["../../src/utilities/bundleTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAElG,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MA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oB;oBACvB,UAAU,EAAE,aAAa,CAAC,UAAU,IAAI,UAAU;oBAClD,IAAI,EAAE,mBAAmB;iBAC1B,CAAC;YACJ,CAAC;YAED,4BAA4B;YAC5B,MAAM,iBAAiB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAChD,CAAC;QAED,4DAA4D;QAC5D,IAAI,mBAAmB,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;YAC9G,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;YAEjE,+EAA+E;YAC/E,iFAAiF;YACjF,2EAA2E;YAC3E,8CAA8C;YAC9C,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAE9E,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC;gBACrC,UAAU;gBACV,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,WAAW;gBAC7C,UAAU;gBACV,UAAU;gBACV,WAAW;aACZ,CAAC,CAAC;YAEH,aAAa,CAAC,MAAM,CAAC,IAAI,GAAG,UAAU,CAAC;YAEvC,8DAA8D;YAC9D,mEAAmE;YACnE,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QACxC,CAAC;QAED,mCAAmC,EAAE,MAAM,CAAC;YAC1C,UAAU,EAAE,CAAC,CAAC,aAAa,CAAC,eAAe;YAC3C,UAAU,EAAE,aAAa,CAAC,UAAU;SACrC,CAAC,CAAC;QAEH,OAAO,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { bundle, getEntriesMapFromPackage, getExternalsFromPackage } from '@ms-cloudpack/bundler';\nimport type { BundleOptions } from '@ms-cloudpack/common-types';\nimport { writeJson } from '@ms-cloudpack/json-utilities';\nimport { getExportsMap } from '@ms-cloudpack/package-utilities';\nimport { formatPackageName } from '@ms-cloudpack/task-reporter';\nimport path from 'path';\nimport { prepareOutputPath } from '../common/prepareOutputPath.js';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { BundleTaskOptions } from '../types/BundleTaskOptions.js';\nimport { diskCacheRatioMetricEventAggregator } from './diskCacheRatioMetricEventAggregator.js';\nimport { getBundleInfo } from './getBundleInfo.js';\nimport { getBundleLocation } from './getBundleLocation.js';\nimport { isCachedResultValid } from './isCachedResultValid.js';\nimport { readResultFromCache } from './readResultFromCache.js';\nimport { saveResultToCache } from './saveResultToCache.js';\nimport { formatBundleTaskResult } from './formatBundleTaskResult.js';\nimport type { PartialContext } from '../types/Context.js';\n\nexport type BundleTaskInternalOptions = BundleTaskOptions & { bundleRequest: BundleRequest };\nexport type BundleTaskInternalContext = PartialContext<\n 'packages' | 'packageHashes' | 'reporter' | 'telemetryClient',\n 'resolveMap' | 'config'\n>;\n\n/**\n * Create and run a TaskReporter task which calls `bundle()` from `@ms-cloudpack/bundler` and formats the result.\n */\nexport async function bundleTask(\n options: BundleTaskInternalOptions,\n context: BundleTaskInternalContext,\n): Promise<void> {\n const { bundleRequest, force, hash, sourceHash } = options;\n const { packageName, version } = bundleRequest;\n const { reporter, telemetryClient, packageHashes, packages, session } = context;\n const { config } = session;\n const { mode } = config;\n const { retryCount } = options;\n\n telemetryClient?.performance.registerAggregator(diskCacheRatioMetricEventAggregator);\n\n const taskName = `Bundle ${formatPackageName({\n name: packageName,\n version,\n })}${retryCount ? ` (retry ${retryCount})` : ''}`;\n\n await reporter.runTask(taskName, async () => {\n // If force is set, dispose the existing result.\n if (force && bundleRequest?.result?.dispose) {\n bundleRequest.result.dispose();\n bundleRequest.result = undefined;\n }\n\n const { packagePath, isExternal, isIncremental, disableSourceMaps, shouldGetBundleInfo } = bundleRequest;\n\n const outputPath =\n bundleRequest.outputPath ??\n (await getBundleLocation({ packagePath, shouldRecalculate: force, hash }, context)).path;\n\n // Rehydrate the result if not incremental.\n if (bundleRequest.result === undefined && !force) {\n bundleRequest.result = await readResultFromCache(outputPath, {\n inputPath: packagePath,\n });\n }\n\n const cacheValidationHash = !isExternal\n ? sourceHash || (await packageHashes.get({ packagePath, isSourceHashingEnabled: true, shouldRecalculate: true }))\n : undefined;\n\n // if the cached result is valid, use it.\n if (!force && isCachedResultValid({ bundleRequest, hash: cacheValidationHash })) {\n console.debug(`Using cached result for ${bundleRequest.packageName}@${bundleRequest.version}`);\n bundleRequest.resultFromCache = true;\n } else {\n bundleRequest.resultFromCache = false;\n\n // Only use cached result if it's successful.\n await prepareOutputPath(outputPath);\n\n if (bundleRequest.result?.rebuild) {\n bundleRequest.result = {\n ...(await bundleRequest.result.rebuild()),\n outputPath: bundleRequest.result.outputPath,\n hash: cacheValidationHash,\n };\n } else {\n const settings = (await packages.get(packagePath))?.cloudpack;\n const { bundler, bundlerOptions, inlinedDependencies, dynamicImports, bundlerCapabilities } = settings || {};\n\n const bundleOptions: BundleOptions = {\n bundler: bundleRequest.bundler || bundler,\n minify: mode === 'production',\n bundlerOptions,\n inputPath: packagePath,\n outputPath,\n incremental: isIncremental !== undefined ? isIncremental : false,\n sourcemap: !disableSourceMaps,\n entries: await getEntriesMapFromPackage({ inputPath: packagePath }, { packages, config }),\n inlined: inlinedDependencies,\n external: await getExternalsFromPackage({ inputPath: packagePath }, { packages, config }),\n dynamicImports,\n ignoredBundlerWarnings: settings?.ignoredBundlerWarnings,\n bundlerCapabilities,\n };\n\n const bundleInternalResult = await bundle(bundleOptions, { config });\n bundleRequest.result = {\n ...bundleInternalResult,\n outputPath: bundleOptions.outputPath ?? outputPath,\n hash: cacheValidationHash,\n };\n }\n\n // Write the result to disk.\n await saveResultToCache(bundleRequest.result);\n }\n\n // If we should find required imports and exports per bundle\n if (shouldGetBundleInfo && !bundleRequest.result?.errors?.length && bundleRequest.result?.outputFiles?.length) {\n const bundleInfoPath = path.join(outputPath, 'bundle-info.json');\n\n // Exports map is needed to find the bundle info per entry we intend to bundle.\n // Exports map is used instead of bundleRequest.entries since it is easier to use\n // because it contains the paths other packages use to import the entry and\n // the relative location of the bundled files.\n const exportsMap = await getExportsMap({ packagePath }, { packages, config });\n\n const bundleInfo = await getBundleInfo({\n outputPath,\n outputFiles: bundleRequest.result.outputFiles,\n exportsMap,\n isExternal,\n packagePath,\n });\n\n bundleRequest.result.info = bundleInfo;\n\n // Write to cache for future use. (Ignore the promise result.)\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n writeJson(bundleInfoPath, bundleInfo);\n }\n\n diskCacheRatioMetricEventAggregator?.record({\n isCacheHit: !!bundleRequest.resultFromCache,\n isExternal: bundleRequest.isExternal,\n });\n\n return formatBundleTaskResult(bundleRequest);\n });\n}\n"]}
@@ -5,7 +5,7 @@ export declare function createBundleRequestForPackage(options: {
5
5
  id: string;
6
6
  packageEntry: ResolveMapEntry;
7
7
  outputPath?: string;
8
- bundlerType?: string;
8
+ bundler?: string;
9
9
  disableSourceMaps?: boolean;
10
10
  shouldGetBundleInfo?: boolean;
11
11
  disableCache?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"createBundleRequestForPackage.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleRequestForPackage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE;IACP,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,EACD,OAAO,EAAE;IACP,MAAM,EAAE,eAAe,CAAC;CACzB,GACA,aAAa,CA6Bf"}
1
+ {"version":3,"file":"createBundleRequestForPackage.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleRequestForPackage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE;IACP,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,EACD,OAAO,EAAE;IACP,MAAM,EAAE,eAAe,CAAC;CACzB,GACA,aAAa,CAqBf"}
@@ -1,5 +1,5 @@
1
1
  export function createBundleRequestForPackage(options, context) {
2
- const { id, packageEntry, isIncremental, bundlerType, disableCache, disableSourceMaps, shouldGetBundleInfo, outputPath, } = options;
2
+ const { id, packageEntry, isIncremental, bundler, disableCache, disableSourceMaps, shouldGetBundleInfo, outputPath } = options;
3
3
  const { config } = context;
4
4
  const { mode, features = {} } = config;
5
5
  const { path, version, name, isExternal } = packageEntry;
@@ -14,7 +14,7 @@ export function createBundleRequestForPackage(options, context) {
14
14
  disableSourceMaps: disableSourceMaps ?? features.disableSourceMaps,
15
15
  shouldGetBundleInfo: shouldGetBundleInfo ?? features.enqueueDependencies,
16
16
  disableCache,
17
- bundlerType,
17
+ bundler,
18
18
  mode,
19
19
  };
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createBundleRequestForPackage.js","sourceRoot":"","sources":["../../src/utilities/createBundleRequestForPackage.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,6BAA6B,CAC3C,OASC,EACD,OAEC;IAED,MAAM,EACJ,EAAE,EACF,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,GACX,GAAG,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IACvC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC;IAEzD,OAAO;QACL,EAAE;QACF,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,aAAa,EAAE,aAAa;QAC5B,UAAU;QACV,OAAO;QACP,iBAAiB,EAAE,iBAAiB,IAAI,QAAQ,CAAC,iBAAiB;QAClE,mBAAmB,EAAE,mBAAmB,IAAI,QAAQ,CAAC,mBAAmB;QACxE,YAAY;QACZ,WAAW;QACX,IAAI;KACL,CAAC;AACJ,CAAC","sourcesContent":["import type { CloudpackConfig } from '@ms-cloudpack/common-types';\nimport type { ResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport type { BundleRequest } from '../types/BundleRequest.js';\n\nexport function createBundleRequestForPackage(\n options: {\n id: string;\n packageEntry: ResolveMapEntry;\n outputPath?: string;\n bundlerType?: string;\n disableSourceMaps?: boolean;\n shouldGetBundleInfo?: boolean;\n disableCache?: boolean;\n isIncremental?: boolean;\n },\n context: {\n config: CloudpackConfig;\n },\n): BundleRequest {\n const {\n id,\n packageEntry,\n isIncremental,\n bundlerType,\n disableCache,\n disableSourceMaps,\n shouldGetBundleInfo,\n outputPath,\n } = options;\n const { config } = context;\n const { mode, features = {} } = config;\n const { path, version, name, isExternal } = packageEntry;\n\n return {\n id,\n packagePath: path,\n packageName: name,\n isExternal: !!isExternal,\n isIncremental: isIncremental,\n outputPath,\n version,\n disableSourceMaps: disableSourceMaps ?? features.disableSourceMaps,\n shouldGetBundleInfo: shouldGetBundleInfo ?? features.enqueueDependencies,\n disableCache,\n bundlerType,\n mode,\n };\n}\n"]}
1
+ {"version":3,"file":"createBundleRequestForPackage.js","sourceRoot":"","sources":["../../src/utilities/createBundleRequestForPackage.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,6BAA6B,CAC3C,OASC,EACD,OAEC;IAED,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,UAAU,EAAE,GAClH,OAAO,CAAC;IACV,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IACvC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC;IAEzD,OAAO;QACL,EAAE;QACF,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,aAAa,EAAE,aAAa;QAC5B,UAAU;QACV,OAAO;QACP,iBAAiB,EAAE,iBAAiB,IAAI,QAAQ,CAAC,iBAAiB;QAClE,mBAAmB,EAAE,mBAAmB,IAAI,QAAQ,CAAC,mBAAmB;QACxE,YAAY;QACZ,OAAO;QACP,IAAI;KACL,CAAC;AACJ,CAAC","sourcesContent":["import type { CloudpackConfig } from '@ms-cloudpack/common-types';\nimport type { ResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport type { BundleRequest } from '../types/BundleRequest.js';\n\nexport function createBundleRequestForPackage(\n options: {\n id: string;\n packageEntry: ResolveMapEntry;\n outputPath?: string;\n bundler?: string;\n disableSourceMaps?: boolean;\n shouldGetBundleInfo?: boolean;\n disableCache?: boolean;\n isIncremental?: boolean;\n },\n context: {\n config: CloudpackConfig;\n },\n): BundleRequest {\n const { id, packageEntry, isIncremental, bundler, disableCache, disableSourceMaps, shouldGetBundleInfo, outputPath } =\n options;\n const { config } = context;\n const { mode, features = {} } = config;\n const { path, version, name, isExternal } = packageEntry;\n\n return {\n id,\n packagePath: path,\n packageName: name,\n isExternal: !!isExternal,\n isIncremental: isIncremental,\n outputPath,\n version,\n disableSourceMaps: disableSourceMaps ?? features.disableSourceMaps,\n shouldGetBundleInfo: shouldGetBundleInfo ?? features.enqueueDependencies,\n disableCache,\n bundler,\n mode,\n };\n}\n"]}
@@ -30,7 +30,7 @@ export function formatBundleTaskResult(bundleRequest) {
30
30
  const message = hasErrors ? plural(result.errors.length, 'error$s found') : undefined;
31
31
  const details = bulletedList([
32
32
  `Package: ${bundleRequest.packageName}@${bundleRequest.version}`,
33
- `Bundler: ${result.bundlerName || 'unknown'}`,
33
+ `Bundler: ${result.bundler || 'unknown'}`,
34
34
  `From cache: ${bundleRequest.resultFromCache}`,
35
35
  `Input path: ${bundleRequest.packagePath}`,
36
36
  `Entries:`,
@@ -1 +1 @@
1
- {"version":3,"file":"formatBundleTaskResult.js","sourceRoot":"","sources":["../../src/utilities/formatBundleTaskResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAA+B,MAAM,6BAA6B,CAAC;AAE7G,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,UAAU,sBAAsB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C,UAAU,CAAC;IAC/C,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACtF,MAAM,OAAO,GAAG,YAAY,CAAC;QAC3B,YAAY,aAAa,CAAC,WAAW,IAAI,aAAa,CAAC,OAAO,EAAE;QAChE,YAAY,MAAM,CAAC,WAAW,IAAI,SAAS,EAAE;QAC7C,eAAe,aAAa,CAAC,eAAe,EAAE;QAC9C,eAAe,aAAa,CAAC,WAAW,EAAE;QAC1C,UAAU;QACV,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QACnC,gBAAgB,MAAM,CAAC,UAAU,EAAE;QACnC,eAAe;QACf,MAAM,CAAC,WAAW,CAAC,GAAG,CACpB,CAAC,IAAI,EAAE,EAAE,CACP,GAAG,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,eAAe,CAC3D,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CACjD,GAAG,CACP;KACF,CAAC,CAAC;IAEH,OAAO;QACL,MAAM;QACN,OAAO;QACP,MAAM;QACN,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["import { formatLocation } from '@ms-cloudpack/path-utilities';\nimport { red, bulletedList, plural, indent, type TaskReporterTaskResult } from '@ms-cloudpack/task-reporter';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport { normalizeRelativePath } from '@ms-cloudpack/path-string-parsing';\nimport { getFileSizeSync } from './getFileSizeSync.js';\nimport path from 'path';\n\nexport function formatBundleTaskResult(bundleRequest: BundleRequest): TaskReporterTaskResult {\n const { result, packageName, version, packagePath } = bundleRequest;\n\n if (!result) {\n return {\n status: 'fail',\n details: `[bundleTask] No result was found for \"${packageName}@${version}\"`,\n };\n }\n\n result.outputFiles ??= [];\n result.errors ??= [];\n result.warnings ??= [];\n\n if (!result.outputFiles.length && !result.errors?.length) {\n result.warnings.push({\n text: `No output files were found for \"${packageName}\" in \"${result.outputPath}\"`,\n source: 'bundleTask',\n });\n }\n\n const errors = result.errors?.map((error) => {\n const { text, source, location } = error;\n const filePath = location ? ' ' + formatLocation({ ...location, fromPath: packagePath }) : '';\n return `[${source}]${filePath}\\n${red(indent(text, 1))}`;\n });\n const hasErrors = result.errors.length > 0;\n const status = hasErrors ? 'fail' : 'complete';\n const message = hasErrors ? plural(result.errors.length, 'error$s found') : undefined;\n const details = bulletedList([\n `Package: ${bundleRequest.packageName}@${bundleRequest.version}`,\n `Bundler: ${result.bundlerName || 'unknown'}`,\n `From cache: ${bundleRequest.resultFromCache}`,\n `Input path: ${bundleRequest.packagePath}`,\n `Entries:`,\n Object.values(result.entries || {}),\n `Output path: ${result.outputPath}`,\n `Output files:`,\n result.outputFiles.map(\n (file) =>\n `${normalizeRelativePath(file.outputPath)} (${getFileSizeSync(\n path.resolve(result.outputPath, file.outputPath),\n )})`,\n ),\n ]);\n\n return {\n status,\n message,\n errors,\n details,\n };\n}\n"]}
1
+ {"version":3,"file":"formatBundleTaskResult.js","sourceRoot":"","sources":["../../src/utilities/formatBundleTaskResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAA+B,MAAM,6BAA6B,CAAC;AAE7G,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,UAAU,sBAAsB,CAAC,aAA4B;IACjE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,aAAa,CAAC;IAEpE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,O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AAS,CAAC;IACtF,MAAM,OAAO,GAAG,YAAY,CAAC;QAC3B,YAAY,aAAa,CAAC,WAAW,IAAI,aAAa,CAAC,OAAO,EAAE;QAChE,YAAY,MAAM,CAAC,OAAO,IAAI,SAAS,EAAE;QACzC,eAAe,aAAa,CAAC,eAAe,EAAE;QAC9C,eAAe,aAAa,CAAC,WAAW,EAAE;QAC1C,UAAU;QACV,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QACnC,gBAAgB,MAAM,CAAC,UAAU,EAAE;QACnC,eAAe;QACf,MAAM,CAAC,WAAW,CAAC,GAAG,CACpB,CAAC,IAAI,EAAE,EAAE,CACP,GAAG,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,eAAe,CAC3D,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CACjD,GAAG,CACP;KACF,CAAC,CAAC;IAEH,OAAO;QACL,MAAM;QACN,OAAO;QACP,MAAM;QACN,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["import { formatLocation } from '@ms-cloudpack/path-utilities';\nimport { red, bulletedList, plural, indent, type TaskReporterTaskResult } from '@ms-cloudpack/task-reporter';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport { normalizeRelativePath } from '@ms-cloudpack/path-string-parsing';\nimport { getFileSizeSync } from './getFileSizeSync.js';\nimport path from 'path';\n\nexport function formatBundleTaskResult(bundleRequest: BundleRequest): TaskReporterTaskResult {\n const { result, packageName, version, packagePath } = bundleRequest;\n\n if (!result) {\n return {\n status: 'fail',\n details: `[bundleTask] No result was found for \"${packageName}@${version}\"`,\n };\n }\n\n result.outputFiles ??= [];\n result.errors ??= [];\n result.warnings ??= [];\n\n if (!result.outputFiles.length && !result.errors?.length) {\n result.warnings.push({\n text: `No output files were found for \"${packageName}\" in \"${result.outputPath}\"`,\n source: 'bundleTask',\n });\n }\n\n const errors = result.errors?.map((error) => {\n const { text, source, location } = error;\n const filePath = location ? ' ' + formatLocation({ ...location, fromPath: packagePath }) : '';\n return `[${source}]${filePath}\\n${red(indent(text, 1))}`;\n });\n const hasErrors = result.errors.length > 0;\n const status = hasErrors ? 'fail' : 'complete';\n const message = hasErrors ? plural(result.errors.length, 'error$s found') : undefined;\n const details = bulletedList([\n `Package: ${bundleRequest.packageName}@${bundleRequest.version}`,\n `Bundler: ${result.bundler || 'unknown'}`,\n `From cache: ${bundleRequest.resultFromCache}`,\n `Input path: ${bundleRequest.packagePath}`,\n `Entries:`,\n Object.values(result.entries || {}),\n `Output path: ${result.outputPath}`,\n `Output files:`,\n result.outputFiles.map(\n (file) =>\n `${normalizeRelativePath(file.outputPath)} (${getFileSizeSync(\n path.resolve(result.outputPath, file.outputPath),\n )})`,\n ),\n ]);\n\n return {\n status,\n message,\n errors,\n details,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"readResultFromCache.d.ts","sourceRoot":"","sources":["../../src/utilities/readResultFromCache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/D;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,oBAAoB,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAC1C,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAYlC"}
1
+ {"version":3,"file":"readResultFromCache.d.ts","sourceRoot":"","sources":["../../src/utilities/readResultFromCache.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG/D;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,oBAAoB,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAC1C,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAsBlC"}
@@ -10,10 +10,18 @@ export async function readResultFromCache(outputPath, additionalProperties) {
10
10
  if (!resultFromFile) {
11
11
  return undefined;
12
12
  }
13
- return {
13
+ const result = {
14
14
  ...resultFromFile,
15
15
  ...additionalProperties,
16
16
  outputPath,
17
17
  };
18
+ // Rename deprecated bundlerName to bundler to avoid bumping the hash version.
19
+ /* eslint-disable etc/no-deprecated */
20
+ if (result.bundlerName) {
21
+ result.bundler = result.bundlerName;
22
+ delete result.bundlerName;
23
+ }
24
+ /* eslint-enable etc/no-deprecated */
25
+ return result;
18
26
  }
19
27
  //# sourceMappingURL=readResultFromCache.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"readResultFromCache.js","sourceRoot":"","sources":["../../src/utilities/readResultFromCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,UAAkB,EAClB,oBAA2C;IAE3C,MAAM,cAAc,GAAG,MAAM,QAAQ,CAAa,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;IAExF,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,GAAG,cAAc;QACjB,GAAG,oBAAoB;QACvB,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["import { readJson } from '@ms-cloudpack/json-utilities';\nimport path from 'path';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { ResultJson } from '../types/ResultJson.js';\n\n/**\n * Reads the 'results.json' file from the cache, and construct a BundleRequest.result object from it.\n * @param outputPath - The path to the cache directory.\n * @param additionalProperties - Additional properties to add to the result object.\n */\nexport async function readResultFromCache(\n outputPath: string,\n additionalProperties: { inputPath: string },\n): Promise<BundleRequest['result']> {\n const resultFromFile = await readJson<ResultJson>(path.join(outputPath, 'result.json'));\n\n if (!resultFromFile) {\n return undefined;\n }\n\n return {\n ...resultFromFile,\n ...additionalProperties,\n outputPath,\n };\n}\n"]}
1
+ {"version":3,"file":"readResultFromCache.js","sourceRoot":"","sources":["../../src/utilities/readResultFromCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,UAAkB,EAClB,oBAA2C;IAE3C,MAAM,cAAc,GAAG,MAAM,QAAQ,CAAa,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;IAExF,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,MAAM,GAA4B;QACtC,GAAG,cAAc;QACjB,GAAG,oBAAoB;QACvB,UAAU;KACX,CAAC;IAEF,8EAA8E;IAC9E,sCAAsC;IACtC,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC;QACpC,OAAO,MAAM,CAAC,WAAW,CAAC;IAC5B,CAAC;IACD,qCAAqC;IAErC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { readJson } from '@ms-cloudpack/json-utilities';\nimport path from 'path';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { ResultJson } from '../types/ResultJson.js';\n\n/**\n * Reads the 'results.json' file from the cache, and construct a BundleRequest.result object from it.\n * @param outputPath - The path to the cache directory.\n * @param additionalProperties - Additional properties to add to the result object.\n */\nexport async function readResultFromCache(\n outputPath: string,\n additionalProperties: { inputPath: string },\n): Promise<BundleRequest['result']> {\n const resultFromFile = await readJson<ResultJson>(path.join(outputPath, 'result.json'));\n\n if (!resultFromFile) {\n return undefined;\n }\n\n const result: BundleRequest['result'] = {\n ...resultFromFile,\n ...additionalProperties,\n outputPath,\n };\n\n // Rename deprecated bundlerName to bundler to avoid bumping the hash version.\n /* eslint-disable etc/no-deprecated */\n if (result.bundlerName) {\n result.bundler = result.bundlerName;\n delete result.bundlerName;\n }\n /* eslint-enable etc/no-deprecated */\n\n return result;\n}\n"]}
@@ -5,9 +5,9 @@ import path from 'path';
5
5
  * @param bundleRequestResult - The result object to write to the cache.
6
6
  */
7
7
  export function saveResultToCache(bundleRequestResult) {
8
- const { outputPath, bundlerName, entries, hash, outputFiles, warnings, errors } = bundleRequestResult;
8
+ const { outputPath, bundler, entries, hash, outputFiles, warnings, errors } = bundleRequestResult;
9
9
  const result = {
10
- bundlerName,
10
+ bundler,
11
11
  entries,
12
12
  hash,
13
13
  outputFiles,
@@ -1 +1 @@
1
- {"version":3,"file":"saveResultToCache.js","sourceRoot":"","sources":["../../src/utilities/saveResultToCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,mBAAyD;IACzF,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAAC;IAEtG,MAAM,MAAM,GAAe;QACzB,WAAW;QACX,OAAO;QACP,IAAI;QACJ,WAAW;QACX,QAAQ;QACR,MAAM;KACP,CAAC;IAEF,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC","sourcesContent":["import { writeJson } from '@ms-cloudpack/json-utilities';\nimport path from 'path';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { ResultJson } from '../types/ResultJson.js';\n\n/**\n * Writes the bundleRequestResults to a 'results.json' file.\n * @param bundleRequestResult - The result object to write to the cache.\n */\nexport function saveResultToCache(bundleRequestResult: NonNullable<BundleRequest['result']>) {\n const { outputPath, bundlerName, entries, hash, outputFiles, warnings, errors } = bundleRequestResult;\n\n const result: ResultJson = {\n bundlerName,\n entries,\n hash,\n outputFiles,\n warnings,\n errors,\n };\n\n return writeJson(path.join(outputPath, 'result.json'), result);\n}\n"]}
1
+ {"version":3,"file":"saveResultToCache.js","sourceRoot":"","sources":["../../src/utilities/saveResultToCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,mBAAyD;IACzF,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAAC;IAElG,MAAM,MAAM,GAAe;QACzB,OAAO;QACP,OAAO;QACP,IAAI;QACJ,WAAW;QACX,QAAQ;QACR,MAAM;KACP,CAAC;IAEF,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC","sourcesContent":["import { writeJson } from '@ms-cloudpack/json-utilities';\nimport path from 'path';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { ResultJson } from '../types/ResultJson.js';\n\n/**\n * Writes the bundleRequestResults to a 'results.json' file.\n * @param bundleRequestResult - The result object to write to the cache.\n */\nexport function saveResultToCache(bundleRequestResult: NonNullable<BundleRequest['result']>) {\n const { outputPath, bundler, entries, hash, outputFiles, warnings, errors } = bundleRequestResult;\n\n const result: ResultJson = {\n bundler,\n entries,\n hash,\n outputFiles,\n warnings,\n errors,\n };\n\n return writeJson(path.join(outputPath, 'result.json'), result);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/api-server",
3
- "version": "0.46.5",
3
+ "version": "0.47.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",
@@ -27,18 +27,18 @@
27
27
  "@lage-run/logger": "^1.3.0",
28
28
  "@lage-run/scheduler": "^1.2.1",
29
29
  "@lage-run/target-graph": "^0.8.9",
30
- "@ms-cloudpack/bundler": "^0.21.8",
31
- "@ms-cloudpack/common-types": "^0.11.0",
32
- "@ms-cloudpack/config": "^0.23.1",
33
- "@ms-cloudpack/create-express-app": "^1.6.26",
30
+ "@ms-cloudpack/bundler": "^0.22.0",
31
+ "@ms-cloudpack/common-types": "^0.12.0",
32
+ "@ms-cloudpack/config": "^0.23.2",
33
+ "@ms-cloudpack/create-express-app": "^1.6.27",
34
34
  "@ms-cloudpack/data-bus": "^0.4.2",
35
35
  "@ms-cloudpack/file-watcher": "^0.1.2",
36
- "@ms-cloudpack/import-map": "^0.5.20",
36
+ "@ms-cloudpack/import-map": "^0.5.21",
37
37
  "@ms-cloudpack/json-utilities": "^0.1.4",
38
- "@ms-cloudpack/package-hashes": "^0.6.6",
39
- "@ms-cloudpack/package-utilities": "^7.8.2",
38
+ "@ms-cloudpack/package-hashes": "^0.6.7",
39
+ "@ms-cloudpack/package-utilities": "^7.8.3",
40
40
  "@ms-cloudpack/path-string-parsing": "^1.2.3",
41
- "@ms-cloudpack/path-utilities": "^2.7.23",
41
+ "@ms-cloudpack/path-utilities": "^2.7.24",
42
42
  "@ms-cloudpack/remote-cache": "^0.8.0",
43
43
  "@ms-cloudpack/task-reporter": "^0.14.1",
44
44
  "@ms-cloudpack/telemetry": "^0.6.0",
@@ -1,5 +0,0 @@
1
- /**
2
- * Gets the cookies dictionary from the browser.
3
- */
4
- export declare function getCookies(): Record<string, string>;
5
- //# sourceMappingURL=getCookies.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCookies.d.ts","sourceRoot":"","sources":["../../src/utilities/getCookies.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBnD"}
@@ -1,20 +0,0 @@
1
- /**
2
- * Gets the cookies dictionary from the browser.
3
- */
4
- export function getCookies() {
5
- if (typeof document === 'undefined') {
6
- return {};
7
- }
8
- return document.cookie
9
- .split(';')
10
- .map((s) => s.split('='))
11
- .reduce((current, nextValue) => {
12
- const name = nextValue[0]?.trim();
13
- const value = decodeURIComponent(nextValue[1]?.trim());
14
- if (name && value) {
15
- current[name] = value;
16
- }
17
- return current;
18
- }, {});
19
- }
20
- //# sourceMappingURL=getCookies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCookies.js","sourceRoot":"","sources":["../../src/utilities/getCookies.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM;SACnB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACxB,MAAM,CAAyB,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE;QACrD,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QAEvD,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACxB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;AACX,CAAC","sourcesContent":["/**\n * Gets the cookies dictionary from the browser.\n */\nexport function getCookies(): Record<string, string> {\n if (typeof document === 'undefined') {\n return {};\n }\n\n return document.cookie\n .split(';')\n .map((s) => s.split('='))\n .reduce<Record<string, string>>((current, nextValue) => {\n const name = nextValue[0]?.trim();\n const value = decodeURIComponent(nextValue[1]?.trim());\n\n if (name && value) {\n current[name] = value;\n }\n\n return current;\n }, {});\n}\n"]}