@ms-cloudpack/api-server 0.62.1 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/lib/apis/getLinkConfig.d.ts +3 -5
  2. package/lib/apis/getLinkConfig.d.ts.map +1 -1
  3. package/lib/apis/getLinkConfig.js +1 -9
  4. package/lib/apis/getLinkConfig.js.map +1 -1
  5. package/lib/apis/linkPath.d.ts +1 -1
  6. package/lib/apis/linkPath.js +1 -1
  7. package/lib/apis/linkPath.js.map +1 -1
  8. package/lib/apis/notifyLinkChange.d.ts +2 -0
  9. package/lib/apis/unlinkPath.d.ts +1 -1
  10. package/lib/apis/unlinkPath.js +1 -1
  11. package/lib/apis/unlinkPath.js.map +1 -1
  12. package/lib/common/createSession.d.ts +2 -2
  13. package/lib/common/createSession.d.ts.map +1 -1
  14. package/lib/common/createSession.js +4 -4
  15. package/lib/common/createSession.js.map +1 -1
  16. package/lib/data/busSources.d.ts +83 -0
  17. package/lib/data/busSources.d.ts.map +1 -1
  18. package/lib/data/busSources.js +32 -0
  19. package/lib/data/busSources.js.map +1 -1
  20. package/lib/index.browser.d.ts +4 -1
  21. package/lib/index.browser.d.ts.map +1 -1
  22. package/lib/index.browser.js +1 -1
  23. package/lib/index.browser.js.map +1 -1
  24. package/lib/index.d.ts +2 -1
  25. package/lib/index.d.ts.map +1 -1
  26. package/lib/index.js +2 -1
  27. package/lib/index.js.map +1 -1
  28. package/lib/types/LinkPath.d.ts +6 -0
  29. package/lib/types/LinkPath.d.ts.map +1 -1
  30. package/lib/types/LinkPath.js +11 -1
  31. package/lib/types/LinkPath.js.map +1 -1
  32. package/lib/types/ZodGetLinkConfigOutput.d.ts +4 -0
  33. package/lib/types/ZodGetLinkConfigOutput.d.ts.map +1 -0
  34. package/lib/types/ZodGetLinkConfigOutput.js +13 -0
  35. package/lib/types/ZodGetLinkConfigOutput.js.map +1 -0
  36. package/lib/types/ZodNotifyLinkChangeInput.d.ts +10 -0
  37. package/lib/types/ZodNotifyLinkChangeInput.d.ts.map +1 -1
  38. package/lib/utilities/createResolveMapTask.d.ts +3 -11
  39. package/lib/utilities/createResolveMapTask.d.ts.map +1 -1
  40. package/lib/utilities/createResolveMapTask.js +9 -6
  41. package/lib/utilities/createResolveMapTask.js.map +1 -1
  42. package/lib/utilities/waitForBusData.d.ts +14 -0
  43. package/lib/utilities/waitForBusData.d.ts.map +1 -0
  44. package/lib/utilities/waitForBusData.js +20 -0
  45. package/lib/utilities/waitForBusData.js.map +1 -0
  46. package/package.json +3 -3
@@ -1,7 +1,6 @@
1
- import { z, type ZodSchema } from 'zod';
1
+ import type { z } from 'zod';
2
2
  import type { ApiParams } from '../types/ApiParams.js';
3
- import type { CloudpackLinkConfig } from '@ms-cloudpack/common-types';
4
- declare const ZodGetLinkConfigOutput: ZodSchema<CloudpackLinkConfig>;
3
+ import { ZodGetLinkConfigOutput } from '../types/ZodGetLinkConfigOutput.js';
5
4
  export type GetLinkConfigOutput = z.infer<typeof ZodGetLinkConfigOutput>;
6
5
  /**
7
6
  * Returns the host's config required for linking.
@@ -10,8 +9,7 @@ export declare function getLinkConfig(params: ApiParams<void, 'session', 'config
10
9
  export declare namespace getLinkConfig {
11
10
  var procedure: import("@trpc/server").TRPCQueryProcedure<{
12
11
  input: void;
13
- output: CloudpackLinkConfig;
12
+ output: import("@ms-cloudpack/common-types").CloudpackLinkConfig;
14
13
  }>;
15
14
  }
16
- export {};
17
15
  //# sourceMappingURL=getLinkConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getLinkConfig.d.ts","sourceRoot":"","sources":["../../src/apis/getLinkConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AAExC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAOtE,QAAA,MAAM,sBAAsB,EAAE,SAAS,CAAC,mBAAmB,CAG3C,CAAC;AAEjB,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEzE;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,mBAAmB,CAE/F;yBAFe,aAAa"}
1
+ {"version":3,"file":"getLinkConfig.d.ts","sourceRoot":"","sources":["../../src/apis/getLinkConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEzE;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,mBAAmB,CAE/F;yBAFe,aAAa"}
@@ -1,13 +1,5 @@
1
- import { z } from 'zod';
2
1
  import { publicProcedure } from '../trpc/common.js';
3
- import { matchingZodObject } from '../utilities/matchingZodObject.js';
4
- const ZodMatch = z.union([z.string(), z.object({ name: z.string(), version: z.string() })]);
5
- // Minimum acceptable match object for a low maintenance burden.
6
- const zodPackageSettings = z.array(z.object({ match: ZodMatch }).passthrough());
7
- const ZodGetLinkConfigOutput = matchingZodObject({
8
- packageSettings: zodPackageSettings,
9
- generated: z.object({ packageSettings: zodPackageSettings }),
10
- }).passthrough();
2
+ import { ZodGetLinkConfigOutput } from '../types/ZodGetLinkConfigOutput.js';
11
3
  /**
12
4
  * Returns the host's config required for linking.
13
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"getLinkConfig.js","sourceRoot":"","sources":["../../src/apis/getLinkConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAkB,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5F,gEAAgE;AAChE,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAEhF,MAAM,sBAAsB,GAAmC,iBAAiB,CAAsB;IACpG,eAAe,EAAE,kBAAkB;IACnC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;CAC7D,CAAC,CAAC,WAAW,EAAE,CAAC;AAIjB;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAA4C;IACxE,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;AACnC,CAAC;AAED,2CAA2C;AAC3C,aAAa,CAAC,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { z, type ZodSchema } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport type { CloudpackLinkConfig } from '@ms-cloudpack/common-types';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\n\nconst ZodMatch = z.union([z.string(), z.object({ name: z.string(), version: z.string() })]);\n// Minimum acceptable match object for a low maintenance burden.\nconst zodPackageSettings = z.array(z.object({ match: ZodMatch }).passthrough());\n\nconst ZodGetLinkConfigOutput: ZodSchema<CloudpackLinkConfig> = matchingZodObject<CloudpackLinkConfig>({\n packageSettings: zodPackageSettings,\n generated: z.object({ packageSettings: zodPackageSettings }),\n}).passthrough();\n\nexport type GetLinkConfigOutput = z.infer<typeof ZodGetLinkConfigOutput>;\n\n/**\n * Returns the host's config required for linking.\n */\nexport function getLinkConfig(params: ApiParams<void, 'session', 'config'>): GetLinkConfigOutput {\n return params.ctx.session.config;\n}\n\n// Attach a trpc procedure to the function.\ngetLinkConfig.procedure = publicProcedure.output(ZodGetLinkConfigOutput).query(getLinkConfig);\n"]}
1
+ {"version":3,"file":"getLinkConfig.js","sourceRoot":"","sources":["../../src/apis/getLinkConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAI5E;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAA4C;IACxE,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;AACnC,CAAC;AAED,2CAA2C;AAC3C,aAAa,CAAC,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import type { z } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { ZodGetLinkConfigOutput } from '../types/ZodGetLinkConfigOutput.js';\n\nexport type GetLinkConfigOutput = z.infer<typeof ZodGetLinkConfigOutput>;\n\n/**\n * Returns the host's config required for linking.\n */\nexport function getLinkConfig(params: ApiParams<void, 'session', 'config'>): GetLinkConfigOutput {\n return params.ctx.session.config;\n}\n\n// Attach a trpc procedure to the function.\ngetLinkConfig.procedure = publicProcedure.output(ZodGetLinkConfigOutput).query(getLinkConfig);\n"]}
@@ -5,7 +5,7 @@ import { type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';
5
5
  */
6
6
  export declare function linkPath(params: ApiParams<LinkPathInput, 'bus' | 'reporter' | 'telemetryClient' | 'packages' | 'packageHashes', 'addLinkedPath' | 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'resolveMap' | 'sequence'>): Promise<LinkPathOutput>;
7
7
  export declare namespace linkPath {
8
- var procedure: import("@trpc/server").TRPCQueryProcedure<{
8
+ var procedure: import("@trpc/server").TRPCMutationProcedure<{
9
9
  input: {
10
10
  linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
11
11
  };
@@ -28,5 +28,5 @@ export async function linkPath(params) {
28
28
  }
29
29
  return result;
30
30
  }
31
- linkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).query(linkPath);
31
+ linkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).mutation(linkPath);
32
32
  //# sourceMappingURL=linkPath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"linkPath.js","sourceRoot":"","sources":["../../src/apis/linkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA2C,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,MAIC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC7B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC;IAEjF,IAAI,MAAM,GAAG,EAAE,UAAU,EAAE,O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ams } from '../types/ApiParams.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput, type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\n\n/**\n * Links a path to the session.\n */\nexport async function linkPath(\n params: ApiParams<\n LinkPathInput,\n 'bus' | 'reporter' | 'telemetryClient' | 'packages' | 'packageHashes',\n 'addLinkedPath' | 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'resolveMap' | 'sequence'\n >,\n): Promise<LinkPathOutput> {\n const { input, ctx } = params;\n const { linkedPath } = input;\n const { session, reporter, bus, telemetryClient, packages, packageHashes } = ctx;\n\n let result = { resolveMap: session.resolveMap, linkedPaths: session.linkedPaths };\n const task = reporter.addTask(`Linking paths in ${session.projectName}`);\n try {\n await telemetryClient.tracer.startActiveSpan('LINK_PATH', async () => {\n if (linkedPath.remote) {\n packageHashes.extend(linkedPath.remote.packageHashes);\n packages.extend(linkedPath.remote.packages);\n }\n\n // Add linked paths to session\n result = await session.addLinkedPath(linkedPath);\n task.complete({ status: 'complete', message: `Linked paths`, forceShow: true });\n session.incrementSessionVersion();\n await notifyReload({ reason: 'link-path' }, { bus, session, telemetryClient });\n });\n } catch (e) {\n task.complete({ status: 'fail', message: `Failed to link paths`, forceShow: true });\n }\n return result;\n}\n\nlinkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).query(linkPath);\n"]}
1
+ {"version":3,"file":"linkPath.js","sourceRoot":"","sources":["../../src/apis/linkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA2C,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,MAIC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAA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;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,QAAQ,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput, type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\n\n/**\n * Links a path to the session.\n */\nexport async function linkPath(\n params: ApiParams<\n LinkPathInput,\n 'bus' | 'reporter' | 'telemetryClient' | 'packages' | 'packageHashes',\n 'addLinkedPath' | 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'resolveMap' | 'sequence'\n >,\n): Promise<LinkPathOutput> {\n const { input, ctx } = params;\n const { linkedPath } = input;\n const { session, reporter, bus, telemetryClient, packages, packageHashes } = ctx;\n\n let result = { resolveMap: session.resolveMap, linkedPaths: session.linkedPaths };\n const task = reporter.addTask(`Linking paths in ${session.projectName}`);\n try {\n await telemetryClient.tracer.startActiveSpan('LINK_PATH', async () => {\n if (linkedPath.remote) {\n packageHashes.extend(linkedPath.remote.packageHashes);\n packages.extend(linkedPath.remote.packages);\n }\n\n // Add linked paths to session\n result = await session.addLinkedPath(linkedPath);\n task.complete({ status: 'complete', message: `Linked paths`, forceShow: true });\n session.incrementSessionVersion();\n await notifyReload({ reason: 'link-path' }, { bus, session, telemetryClient });\n });\n } catch (e) {\n task.complete({ status: 'fail', message: `Failed to link paths`, forceShow: true });\n }\n return result;\n}\n\nlinkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).mutation(linkPath);\n"]}
@@ -16,6 +16,8 @@ export declare namespace notifyLinkChange {
16
16
  name: string;
17
17
  version: string;
18
18
  exports?: any;
19
+ dependencies?: Record<string, string | undefined> | undefined;
20
+ peerDependencies?: Record<string, string | undefined> | undefined;
19
21
  } | undefined;
20
22
  };
21
23
  output: void;
@@ -5,7 +5,7 @@ import { type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';
5
5
  */
6
6
  export declare function unlinkPath(params: ApiParams<LinkPathInput, 'bus' | 'reporter' | 'telemetryClient', 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'removeLinkedPath' | 'resolveMap' | 'sequence'>): Promise<LinkPathOutput>;
7
7
  export declare namespace unlinkPath {
8
- var procedure: import("@trpc/server").TRPCQueryProcedure<{
8
+ var procedure: import("@trpc/server").TRPCMutationProcedure<{
9
9
  input: {
10
10
  linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
11
11
  };
@@ -24,5 +24,5 @@ export async function unlinkPath(params) {
24
24
  }
25
25
  return result;
26
26
  }
27
- unlinkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).query(unlinkPath);
27
+ unlinkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).mutation(unlinkPath);
28
28
  //# sourceMappingURL=unlinkPath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unlinkPath.js","sourceRoot":"","sources":["../../src/apis/unlinkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA2C,MAAM,sBAAsB,CAAC;AAEpH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAIC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC7B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,GAAG,CAAC;IACxD,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,sBAAsB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3E,IAAI,MAAM,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;IAClF,IAAI,CAAC;QACH,MAAM,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;YACrE,mCAAmC;YACnC,MAAM,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACpD,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAClF,OAAO,CAAC,uBAAuB,EAAE,CAAC;YAClC,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,UAAU,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput, type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';\n\n/**\n * Unlinks a path to the session.\n */\nexport async function unlinkPath(\n params: ApiParams<\n LinkPathInput,\n 'bus' | 'reporter' | 'telemetryClient',\n 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'removeLinkedPath' | 'resolveMap' | 'sequence'\n >,\n): Promise<LinkPathOutput> {\n const { input, ctx } = params;\n const { linkedPath } = input;\n const { session, reporter, bus, telemetryClient } = ctx;\n const task = reporter.addTask(`Unlinking paths in ${session.projectName}`);\n let result = { resolveMap: session.resolveMap, linkedPaths: session.linkedPaths };\n try {\n await telemetryClient.tracer.startActiveSpan('UNLINK_PATH', async () => {\n // Remove linked paths from session\n result = await session.removeLinkedPath(linkedPath);\n task.complete({ status: 'complete', message: `Unlinked paths`, forceShow: true });\n session.incrementSessionVersion();\n await notifyReload({ reason: 'unlink-path' }, { bus, session, telemetryClient });\n });\n } catch (e) {\n task.complete({ status: 'fail', message: `Failed to unlink paths`, forceShow: true });\n }\n\n return result;\n}\n\nunlinkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).query(unlinkPath);\n"]}
1
+ {"version":3,"file":"unlinkPath.js","sourceRoot":"","sources":["../../src/apis/unlinkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA2C,MAAM,sBAAsB,CAAC;AAEpH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAIC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC7B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,GAAG,CAAC;IACxD,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,sBAAsB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3E,IAAI,MAAM,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;IAClF,IAAI,CAAC;QACH,MAAM,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;YACrE,mCAAmC;YACnC,MAAM,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACpD,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAClF,OAAO,CAAC,uBAAuB,EAAE,CAAC;YAClC,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,UAAU,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput, type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';\n\n/**\n * Unlinks a path to the session.\n */\nexport async function unlinkPath(\n params: ApiParams<\n LinkPathInput,\n 'bus' | 'reporter' | 'telemetryClient',\n 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'removeLinkedPath' | 'resolveMap' | 'sequence'\n >,\n): Promise<LinkPathOutput> {\n const { input, ctx } = params;\n const { linkedPath } = input;\n const { session, reporter, bus, telemetryClient } = ctx;\n const task = reporter.addTask(`Unlinking paths in ${session.projectName}`);\n let result = { resolveMap: session.resolveMap, linkedPaths: session.linkedPaths };\n try {\n await telemetryClient.tracer.startActiveSpan('UNLINK_PATH', async () => {\n // Remove linked paths from session\n result = await session.removeLinkedPath(linkedPath);\n task.complete({ status: 'complete', message: `Unlinked paths`, forceShow: true });\n session.incrementSessionVersion();\n await notifyReload({ reason: 'unlink-path' }, { bus, session, telemetryClient });\n });\n } catch (e) {\n task.complete({ status: 'fail', message: `Failed to unlink paths`, forceShow: true });\n }\n\n return result;\n}\n\nunlinkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).mutation(unlinkPath);\n"]}
@@ -7,9 +7,9 @@ export type SessionVersions = {
7
7
  export interface CreateSessionOptions {
8
8
  config: CloudpackConfig;
9
9
  /**
10
- * Path to the `@ms-cloudpack/overlay` package root directory.
10
+ * Any additional packages whose dependencies we want to resolve, such as the overlay.
11
11
  */
12
- overlayPath?: string;
12
+ additionalPaths?: string[];
13
13
  /**
14
14
  * Custom cache folder for the session.
15
15
  * If not provided, will use the one from user preferences if set, or the default cache path.
@@ -1 +1 @@
1
- {"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAc,MAAM,4BAA4B,CAAC;AAMvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAInD,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,eAAe,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAClE,OAAO,CAAC,OAAO,CAAC,CAmGlB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/D"}
1
+ {"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAc,MAAM,4BAA4B,CAAC;AAMvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAInD,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,eAAe,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAClE,OAAO,CAAC,OAAO,CAAC,CAmGlB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/D"}
@@ -5,11 +5,11 @@ import path from 'path';
5
5
  import { createResolveMapTask } from '../utilities/createResolveMapTask.js';
6
6
  import { randomUUID } from 'crypto';
7
7
  export async function createSession(options, context) {
8
- const { config, overlayPath, skipResolveDependencies } = options;
8
+ const { config, additionalPaths, skipResolveDependencies } = options;
9
9
  const { appPath } = config;
10
10
  const projectName = path.basename(appPath);
11
11
  const id = randomUUID();
12
- let resolveMap = await createResolveMapTask({ appPath, overlayPath, skipResolveDependencies }, context);
12
+ let resolveMap = await createResolveMapTask({ appPath, additionalPaths, skipResolveDependencies }, context);
13
13
  let importMap = undefined;
14
14
  const versionsPath = _getSessionVersionsPath(appPath);
15
15
  const previousVersions = await readJson(versionsPath);
@@ -68,7 +68,7 @@ export async function createSession(options, context) {
68
68
  return { resolveMap, linkedPaths };
69
69
  }
70
70
  linkedPaths.push(linkedPath);
71
- resolveMap = await createResolveMapTask({ appPath, overlayPath, linkedPaths, skipResolveDependencies: false }, context);
71
+ resolveMap = await createResolveMapTask({ appPath, additionalPaths, linkedPaths, skipResolveDependencies: false }, context);
72
72
  return { resolveMap, linkedPaths };
73
73
  },
74
74
  removeLinkedPath: async (linkedPath) => {
@@ -80,7 +80,7 @@ export async function createSession(options, context) {
80
80
  return { resolveMap, linkedPaths };
81
81
  }
82
82
  linkedPaths.splice(index, 1);
83
- resolveMap = await createResolveMapTask({ appPath, overlayPath, linkedPaths, skipResolveDependencies: false }, context);
83
+ resolveMap = await createResolveMapTask({ appPath, additionalPaths, linkedPaths, skipResolveDependencies: false }, context);
84
84
  return { resolveMap, linkedPaths };
85
85
  },
86
86
  cachePath,
@@ -1 +1 @@
1
- {"version":3,"file":"createSession.js","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,O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,GAAG,MAAM,oBAAoB,CACrC,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,uBAAuB,EAAE,KAAK,EAAE,EACrE,OAAO,CACR,CAAC;YAEF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;QACrC,CAAC;QACD,gBAAgB,EAAE,KAAK,EAAE,UAAsB,EAAE,EAAE;YACjD,IAAI,uBAAuB,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;YAClF,CAAC;YAED,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC;YACvE,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;gBACjB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;YACrC,CAAC;YAED,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC7B,UAAU,GAAG,MAAM,oBAAoB,CACrC,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,uBAAuB,EAAE,KAAK,EAAE,EACrE,OAAO,CACR,CAAC;YAEF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;QACrC,CAAC;QACD,SAAS;KACV,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import type { CloudpackConfig, Session, LinkedPath } from '@ms-cloudpack/common-types';\nimport { getCachePath, getLocalCachePath } from '@ms-cloudpack/config';\nimport type { ImportMap } from '@ms-cloudpack/import-map';\nimport { readJson, writeJson, writeJsonSync } from '@ms-cloudpack/json-utilities';\nimport fs from 'fs';\nimport path from 'path';\nimport type { Context } from '../types/Context.js';\nimport { createResolveMapTask } from '../utilities/createResolveMapTask.js';\nimport { randomUUID } from 'crypto';\n\nexport type SessionVersions = {\n sessionVersion: number;\n targetVersions: Record<string, number>;\n};\n\nexport interface CreateSessionOptions {\n config: CloudpackConfig;\n /**\n * Path to the `@ms-cloudpack/overlay` package root directory.\n */\n overlayPath?: string;\n /**\n * Custom cache folder for the session.\n * If not provided, will use the one from user preferences if set, or the default cache path.\n */\n cachePath?: string;\n /**\n * Skip full dependency resolution (`resolveMap` will only contain the package at `config.appPath`).\n * This should only be used for the `bundle` command when it's bundling the current package.\n */\n skipResolveDependencies?: boolean;\n}\n\nexport async function createSession(\n options: CreateSessionOptions,\n context: Pick<Context, 'reporter' | 'packages' | 'telemetryClient'>,\n): Promise<Session> {\n const { config, overlayPath, skipResolveDependencies } = options;\n const { appPath } = config;\n\n const projectName = path.basename(appPath);\n const id = randomUUID();\n let resolveMap = await createResolveMapTask({ appPath, overlayPath, skipResolveDependencies }, context);\n\n let importMap: ImportMap | undefined = undefined;\n\n const versionsPath = _getSessionVersionsPath(appPath);\n const previousVersions = await readJson<SessionVersions>(versionsPath);\n const versions = previousVersions || { sessionVersion: 0, targetVersions: {} };\n if (!previousVersions) {\n await writeJson(versionsPath, versions);\n }\n\n // In the future, we might put all the user preferences in the session, but right now the only\n // preference is cachePath, so we just read that and save the custom or default value.\n const cachePath = await getCachePath(options.cachePath);\n\n const linkedPaths: LinkedPath[] = [];\n\n return {\n id,\n config,\n projectName,\n get resolveMap() {\n return resolveMap;\n },\n set resolveMap(newResolveMap) {\n // If the resolve map changes, clear the import map\n // so that it is regenerated on the next request\n importMap = undefined;\n resolveMap = newResolveMap;\n },\n sequence: 0,\n urls: {},\n targetVersions: versions.targetVersions,\n get sessionVersion() {\n return versions.sessionVersion;\n },\n incrementSessionVersion: () => {\n versions.sessionVersion++;\n importMap = undefined;\n // Write the new session version to the file\n fs.writeFileSync(versionsPath, JSON.stringify(versions, null, 2));\n },\n incrementTargetVersion: (inputPath: string) => {\n versions.targetVersions[inputPath] ??= 0;\n versions.targetVersions[inputPath]++;\n importMap = undefined;\n writeJsonSync(versionsPath, versions);\n },\n get importMap() {\n return importMap;\n },\n set importMap(newImportMap) {\n importMap = newImportMap;\n },\n packageImportPaths: new Map(),\n linkedPaths,\n addLinkedPath: async (linkedPath: LinkedPath) => {\n if (skipResolveDependencies) {\n throw new Error('Cannot use `addLinkedPath` with `skipResolveDependencies`');\n }\n\n if (linkedPaths.some((p) => p.path === linkedPath.path)) {\n return { resolveMap, linkedPaths };\n }\n\n linkedPaths.push(linkedPath);\n resolveMap = await createResolveMapTask(\n { appPath, overlayPath, linkedPaths, skipResolveDependencies: false },\n context,\n );\n\n return { resolveMap, linkedPaths };\n },\n removeLinkedPath: async (linkedPath: LinkedPath) => {\n if (skipResolveDependencies) {\n throw new Error('Cannot use `removeLinkedPath` with `skipResolveDependencies`');\n }\n\n const index = linkedPaths.findIndex((p) => p.path === linkedPath.path);\n if (index === -1) {\n return { resolveMap, linkedPaths };\n }\n\n linkedPaths.splice(index, 1);\n resolveMap = await createResolveMapTask(\n { appPath, overlayPath, linkedPaths, skipResolveDependencies: false },\n context,\n );\n\n return { resolveMap, linkedPaths };\n },\n cachePath,\n };\n}\n\n/**\n * Get `sessionVersions.json` path. Exported for the test.\n * @internal\n */\nexport function _getSessionVersionsPath(appPath: string): string {\n return path.join(getLocalCachePath(appPath), 'sessionVersions.json');\n}\n"]}
1
+ {"version":3,"file":"createSession.js","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,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WAAW,EAAE,uBAAuB,EAAE,KAAK,EAAE,EACzE,OAAO,CACR,CAAC;YAEF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;QACrC,CAAC;QACD,gBAAgB,EAAE,KAAK,EAAE,UAAsB,EAAE,EAAE;YACjD,IAAI,uBAAuB,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;YAClF,CAAC;YAED,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC;YACvE,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;gBACjB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;YACrC,CAAC;YAED,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC7B,UAAU,GAAG,MAAM,oBAAoB,CACrC,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,uBAAuB,EAAE,KAAK,EAAE,EACzE,OAAO,CACR,CAAC;YAEF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;QACrC,CAAC;QACD,SAAS;KACV,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import type { CloudpackConfig, Session, LinkedPath } from '@ms-cloudpack/common-types';\nimport { getCachePath, getLocalCachePath } from '@ms-cloudpack/config';\nimport type { ImportMap } from '@ms-cloudpack/import-map';\nimport { readJson, writeJson, writeJsonSync } from '@ms-cloudpack/json-utilities';\nimport fs from 'fs';\nimport path from 'path';\nimport type { Context } from '../types/Context.js';\nimport { createResolveMapTask } from '../utilities/createResolveMapTask.js';\nimport { randomUUID } from 'crypto';\n\nexport type SessionVersions = {\n sessionVersion: number;\n targetVersions: Record<string, number>;\n};\n\nexport interface CreateSessionOptions {\n config: CloudpackConfig;\n /**\n * Any additional packages whose dependencies we want to resolve, such as the overlay.\n */\n additionalPaths?: string[];\n /**\n * Custom cache folder for the session.\n * If not provided, will use the one from user preferences if set, or the default cache path.\n */\n cachePath?: string;\n /**\n * Skip full dependency resolution (`resolveMap` will only contain the package at `config.appPath`).\n * This should only be used for the `bundle` command when it's bundling the current package.\n */\n skipResolveDependencies?: boolean;\n}\n\nexport async function createSession(\n options: CreateSessionOptions,\n context: Pick<Context, 'reporter' | 'packages' | 'telemetryClient'>,\n): Promise<Session> {\n const { config, additionalPaths, skipResolveDependencies } = options;\n const { appPath } = config;\n\n const projectName = path.basename(appPath);\n const id = randomUUID();\n let resolveMap = await createResolveMapTask({ appPath, additionalPaths, skipResolveDependencies }, context);\n\n let importMap: ImportMap | undefined = undefined;\n\n const versionsPath = _getSessionVersionsPath(appPath);\n const previousVersions = await readJson<SessionVersions>(versionsPath);\n const versions = previousVersions || { sessionVersion: 0, targetVersions: {} };\n if (!previousVersions) {\n await writeJson(versionsPath, versions);\n }\n\n // In the future, we might put all the user preferences in the session, but right now the only\n // preference is cachePath, so we just read that and save the custom or default value.\n const cachePath = await getCachePath(options.cachePath);\n\n const linkedPaths: LinkedPath[] = [];\n\n return {\n id,\n config,\n projectName,\n get resolveMap() {\n return resolveMap;\n },\n set resolveMap(newResolveMap) {\n // If the resolve map changes, clear the import map\n // so that it is regenerated on the next request\n importMap = undefined;\n resolveMap = newResolveMap;\n },\n sequence: 0,\n urls: {},\n targetVersions: versions.targetVersions,\n get sessionVersion() {\n return versions.sessionVersion;\n },\n incrementSessionVersion: () => {\n versions.sessionVersion++;\n importMap = undefined;\n // Write the new session version to the file\n fs.writeFileSync(versionsPath, JSON.stringify(versions, null, 2));\n },\n incrementTargetVersion: (inputPath: string) => {\n versions.targetVersions[inputPath] ??= 0;\n versions.targetVersions[inputPath]++;\n importMap = undefined;\n writeJsonSync(versionsPath, versions);\n },\n get importMap() {\n return importMap;\n },\n set importMap(newImportMap) {\n importMap = newImportMap;\n },\n packageImportPaths: new Map(),\n linkedPaths,\n addLinkedPath: async (linkedPath: LinkedPath) => {\n if (skipResolveDependencies) {\n throw new Error('Cannot use `addLinkedPath` with `skipResolveDependencies`');\n }\n\n if (linkedPaths.some((p) => p.path === linkedPath.path)) {\n return { resolveMap, linkedPaths };\n }\n\n linkedPaths.push(linkedPath);\n resolveMap = await createResolveMapTask(\n { appPath, additionalPaths, linkedPaths, skipResolveDependencies: false },\n context,\n );\n\n return { resolveMap, linkedPaths };\n },\n removeLinkedPath: async (linkedPath: LinkedPath) => {\n if (skipResolveDependencies) {\n throw new Error('Cannot use `removeLinkedPath` with `skipResolveDependencies`');\n }\n\n const index = linkedPaths.findIndex((p) => p.path === linkedPath.path);\n if (index === -1) {\n return { resolveMap, linkedPaths };\n }\n\n linkedPaths.splice(index, 1);\n resolveMap = await createResolveMapTask(\n { appPath, additionalPaths, linkedPaths, skipResolveDependencies: false },\n context,\n );\n\n return { resolveMap, linkedPaths };\n },\n cachePath,\n };\n}\n\n/**\n * Get `sessionVersions.json` path. Exported for the test.\n * @internal\n */\nexport function _getSessionVersionsPath(appPath: string): string {\n return path.join(getLocalCachePath(appPath), 'sessionVersions.json');\n}\n"]}
@@ -157,14 +157,20 @@ export declare const linkUpdateSource: DataBusPath<z.ZodObject<{
157
157
  name: z.ZodString;
158
158
  version: z.ZodString;
159
159
  exports: z.ZodAny;
160
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUndefined, z.ZodString]>>>;
161
+ peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUndefined, z.ZodString]>>>;
160
162
  }, "strip", z.ZodTypeAny, {
161
163
  name: string;
162
164
  version: string;
163
165
  exports?: any;
166
+ dependencies?: Record<string, string | undefined> | undefined;
167
+ peerDependencies?: Record<string, string | undefined> | undefined;
164
168
  }, {
165
169
  name: string;
166
170
  version: string;
167
171
  exports?: any;
172
+ dependencies?: Record<string, string | undefined> | undefined;
173
+ peerDependencies?: Record<string, string | undefined> | undefined;
168
174
  }>>;
169
175
  }, "strip", z.ZodTypeAny, {
170
176
  packagePath: string;
@@ -173,6 +179,8 @@ export declare const linkUpdateSource: DataBusPath<z.ZodObject<{
173
179
  name: string;
174
180
  version: string;
175
181
  exports?: any;
182
+ dependencies?: Record<string, string | undefined> | undefined;
183
+ peerDependencies?: Record<string, string | undefined> | undefined;
176
184
  } | undefined;
177
185
  }, {
178
186
  packagePath: string;
@@ -181,6 +189,81 @@ export declare const linkUpdateSource: DataBusPath<z.ZodObject<{
181
189
  name: string;
182
190
  version: string;
183
191
  exports?: any;
192
+ dependencies?: Record<string, string | undefined> | undefined;
193
+ peerDependencies?: Record<string, string | undefined> | undefined;
184
194
  } | undefined;
185
195
  }>>;
196
+ /**
197
+ * Used for fetching the host configuration.
198
+ */
199
+ export declare const linkConfigSource: DataBusPath<z.ZodType<import("@ms-cloudpack/common-types").CloudpackLinkConfig, z.ZodTypeDef, import("@ms-cloudpack/common-types").CloudpackLinkConfig>>;
200
+ /**
201
+ * Used for tracking linked paths.
202
+ */
203
+ export declare const linkPathsSource: DataBusPath<z.ZodObject<{
204
+ linkedPath: z.ZodObject<{
205
+ path: z.ZodType<string, z.ZodTypeDef, string>;
206
+ rootPath: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
207
+ includeAll: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
208
+ ignoredPackages: z.ZodType<string[] | undefined, z.ZodTypeDef, string[] | undefined>;
209
+ ignoreResolutions: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
210
+ resolveStrategy: z.ZodType<"dedupe" | "duplicate" | undefined, z.ZodTypeDef, "dedupe" | "duplicate" | undefined>;
211
+ remote: z.ZodType<{
212
+ resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
213
+ hostUrl: string;
214
+ packages: import("@ms-cloudpack/common-types").SerializablePackageDefinitionsCache;
215
+ packageHashes: import("@ms-cloudpack/common-types").SerializablePackageHashesCache;
216
+ } | undefined, z.ZodTypeDef, {
217
+ resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
218
+ hostUrl: string;
219
+ packages: import("@ms-cloudpack/common-types").SerializablePackageDefinitionsCache;
220
+ packageHashes: import("@ms-cloudpack/common-types").SerializablePackageHashesCache;
221
+ } | undefined>;
222
+ }, "strict", z.ZodTypeAny, import("@ms-cloudpack/common-types").LinkedPath, import("@ms-cloudpack/common-types").LinkedPath>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
225
+ }, {
226
+ linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
227
+ }>>;
228
+ /**
229
+ * Used for tracking when linking is done.
230
+ */
231
+ export declare const linkDoneSource: DataBusPath<z.ZodObject<{
232
+ resolveMap: z.ZodType<import("@ms-cloudpack/common-types").ResolveMap, z.ZodTypeDef, import("@ms-cloudpack/common-types").ResolveMap>;
233
+ linkedPaths: z.ZodArray<z.ZodObject<{
234
+ path: z.ZodType<string, z.ZodTypeDef, string>;
235
+ rootPath: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
236
+ includeAll: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
237
+ ignoredPackages: z.ZodType<string[] | undefined, z.ZodTypeDef, string[] | undefined>;
238
+ ignoreResolutions: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
239
+ resolveStrategy: z.ZodType<"dedupe" | "duplicate" | undefined, z.ZodTypeDef, "dedupe" | "duplicate" | undefined>;
240
+ remote: z.ZodType<{
241
+ resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
242
+ hostUrl: string;
243
+ packages: import("@ms-cloudpack/common-types").SerializablePackageDefinitionsCache;
244
+ packageHashes: import("@ms-cloudpack/common-types").SerializablePackageHashesCache;
245
+ } | undefined, z.ZodTypeDef, {
246
+ resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
247
+ hostUrl: string;
248
+ packages: import("@ms-cloudpack/common-types").SerializablePackageDefinitionsCache;
249
+ packageHashes: import("@ms-cloudpack/common-types").SerializablePackageHashesCache;
250
+ } | undefined>;
251
+ }, "strict", z.ZodTypeAny, import("@ms-cloudpack/common-types").LinkedPath, import("@ms-cloudpack/common-types").LinkedPath>, "many">;
252
+ }, "strip", z.ZodTypeAny, {
253
+ resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
254
+ linkedPaths: import("@ms-cloudpack/common-types").LinkedPath[];
255
+ }, {
256
+ resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
257
+ linkedPaths: import("@ms-cloudpack/common-types").LinkedPath[];
258
+ }>>;
259
+ /**
260
+ * Used for detecting host disconnection on link.
261
+ */
262
+ export declare const linkDisconnectedSource: DataBusPath<z.ZodObject<{
263
+ reason: z.ZodEnum<["lost", "unreachable"]>;
264
+ }, "strip", z.ZodTypeAny, {
265
+ reason: "lost" | "unreachable";
266
+ }, {
267
+ reason: "lost" | "unreachable";
268
+ }>>;
186
269
  //# sourceMappingURL=busSources.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"busSources.d.ts","sourceRoot":"","sources":["../../src/data/busSources.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1E;;GAEG;AACH,eAAO,MAAM,iBAAiB,0BAG5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;GAG1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGzB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC,SAAS,CAGpD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAG3B,CAAC"}
1
+ {"version":3,"file":"busSources.d.ts","sourceRoot":"","sources":["../../src/data/busSources.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAK1E;;GAEG;AACH,eAAO,MAAM,iBAAiB,0BAG5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;GAG1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGzB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC,SAAS,CAGpD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAG3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,0JAG3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;GAG1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;GAGjC,CAAC"}
@@ -1,8 +1,12 @@
1
+ // This file is used in the browser,
2
+ // so it must only import types (ts and zod) to not trigger a trpc server error due to bad tree shaking.
1
3
  import z from 'zod';
2
4
  import { ZodTaskStats } from '../types/TaskStats.js';
3
5
  import { ZodTaskList } from '../types/TaskList.js';
4
6
  import { createDataPath } from '@ms-cloudpack/data-bus';
5
7
  import { ZodNotifyLinkChangeInput } from '../types/ZodNotifyLinkChangeInput.js';
8
+ import { ZodLinkPathInput, ZodLinkPathOutput } from '../types/LinkPath.js';
9
+ import { ZodGetLinkConfigOutput } from '../types/ZodGetLinkConfigOutput.js';
6
10
  /**
7
11
  * Used for tracking the reload count.
8
12
  */
@@ -39,4 +43,32 @@ export const linkUpdateSource = createDataPath({
39
43
  path: ['link', 'update'],
40
44
  type: ZodNotifyLinkChangeInput,
41
45
  });
46
+ /**
47
+ * Used for fetching the host configuration.
48
+ */
49
+ export const linkConfigSource = createDataPath({
50
+ path: ['link', 'config'],
51
+ type: ZodGetLinkConfigOutput,
52
+ });
53
+ /**
54
+ * Used for tracking linked paths.
55
+ */
56
+ export const linkPathsSource = createDataPath({
57
+ path: ['link', 'paths'],
58
+ type: ZodLinkPathInput,
59
+ });
60
+ /**
61
+ * Used for tracking when linking is done.
62
+ */
63
+ export const linkDoneSource = createDataPath({
64
+ path: ['link', 'done'],
65
+ type: ZodLinkPathOutput,
66
+ });
67
+ /**
68
+ * Used for detecting host disconnection on link.
69
+ */
70
+ export const linkDisconnectedSource = createDataPath({
71
+ path: ['link', 'disconnected'],
72
+ type: z.object({ reason: z.enum(['lost', 'unreachable']) }),
73
+ });
42
74
  //# sourceMappingURL=busSources.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"busSources.js","sourceRoot":"","sources":["../../src/data/busSources.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAoB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;IAC9C,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,YAAY;CACnB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;IAC3C,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,WAAW;CAClB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6B,cAAc,CAAC;IACvE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;IAC7C,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;IACxB,IAAI,EAAE,wBAAwB;CAC/B,CAAC,CAAC","sourcesContent":["import z from 'zod';\nimport { ZodTaskStats } from '../types/TaskStats.js';\nimport { ZodTaskList } from '../types/TaskList.js';\nimport { createDataPath, type DataBusPath } from '@ms-cloudpack/data-bus';\nimport { ZodNotifyLinkChangeInput } from '../types/ZodNotifyLinkChangeInput.js';\n\n/**\n * Used for tracking the reload count.\n */\nexport const reloadCountSource = createDataPath({\n path: ['session', 'version'],\n type: z.number(),\n});\n\n/**\n * Used for tracking the task stats displayed in the badge.\n */\nexport const taskStatsSource = createDataPath({\n path: ['task', 'stats'],\n type: ZodTaskStats,\n});\n\n/**\n * Used for tracking the list of tasks.\n */\nexport const taskListSource = createDataPath({\n path: ['task', 'list'],\n type: ZodTaskList,\n});\n\n/**\n * Used for tracking entry errors: `Failed to resolve module specifier \"${packageName}@${version}${filePath}\".`\n * This is used to display errors in the UI and to notify the user of the error when autoUpdateEntries is enabled.\n */\nexport const errorEntrySource: DataBusPath<z.ZodString> = createDataPath({\n path: ['error', 'entry'],\n type: z.string(),\n});\n\n/**\n * Used for tracking link updates.\n */\nexport const linkUpdateSource = createDataPath({\n path: ['link', 'update'],\n type: ZodNotifyLinkChangeInput,\n});\n"]}
1
+ {"version":3,"file":"busSources.js","sourceRoot":"","sources":["../../src/data/busSources.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,wGAAwG;AACxG,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAoB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;IAC9C,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,YAAY;CACnB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;IAC3C,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,WAAW;CAClB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA6B,cAAc,CAAC;IACvE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;IAC7C,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;IACxB,IAAI,EAAE,wBAAwB;CAC/B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;IAC7C,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;IACxB,IAAI,EAAE,sBAAsB;CAC7B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,gBAAgB;CACvB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;IAC3C,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,iBAAiB;CACxB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAC;IACnD,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC;CAC5D,CAAC,CAAC","sourcesContent":["// This file is used in the browser,\n// so it must only import types (ts and zod) to not trigger a trpc server error due to bad tree shaking.\nimport z from 'zod';\nimport { ZodTaskStats } from '../types/TaskStats.js';\nimport { ZodTaskList } from '../types/TaskList.js';\nimport { createDataPath, type DataBusPath } from '@ms-cloudpack/data-bus';\nimport { ZodNotifyLinkChangeInput } from '../types/ZodNotifyLinkChangeInput.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput } from '../types/LinkPath.js';\nimport { ZodGetLinkConfigOutput } from '../types/ZodGetLinkConfigOutput.js';\n\n/**\n * Used for tracking the reload count.\n */\nexport const reloadCountSource = createDataPath({\n path: ['session', 'version'],\n type: z.number(),\n});\n\n/**\n * Used for tracking the task stats displayed in the badge.\n */\nexport const taskStatsSource = createDataPath({\n path: ['task', 'stats'],\n type: ZodTaskStats,\n});\n\n/**\n * Used for tracking the list of tasks.\n */\nexport const taskListSource = createDataPath({\n path: ['task', 'list'],\n type: ZodTaskList,\n});\n\n/**\n * Used for tracking entry errors: `Failed to resolve module specifier \"${packageName}@${version}${filePath}\".`\n * This is used to display errors in the UI and to notify the user of the error when autoUpdateEntries is enabled.\n */\nexport const errorEntrySource: DataBusPath<z.ZodString> = createDataPath({\n path: ['error', 'entry'],\n type: z.string(),\n});\n\n/**\n * Used for tracking link updates.\n */\nexport const linkUpdateSource = createDataPath({\n path: ['link', 'update'],\n type: ZodNotifyLinkChangeInput,\n});\n\n/**\n * Used for fetching the host configuration.\n */\nexport const linkConfigSource = createDataPath({\n path: ['link', 'config'],\n type: ZodGetLinkConfigOutput,\n});\n\n/**\n * Used for tracking linked paths.\n */\nexport const linkPathsSource = createDataPath({\n path: ['link', 'paths'],\n type: ZodLinkPathInput,\n});\n\n/**\n * Used for tracking when linking is done.\n */\nexport const linkDoneSource = createDataPath({\n path: ['link', 'done'],\n type: ZodLinkPathOutput,\n});\n\n/**\n * Used for detecting host disconnection on link.\n */\nexport const linkDisconnectedSource = createDataPath({\n path: ['link', 'disconnected'],\n type: z.object({ reason: z.enum(['lost', 'unreachable']) }),\n});\n"]}
@@ -3,5 +3,8 @@ export type { TaskDescription } from './types/TaskDescription.js';
3
3
  export type { TaskMessage } from './types/TaskMessage.js';
4
4
  export type { TaskList } from './types/TaskList.js';
5
5
  export { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';
6
- export { taskListSource, taskStatsSource, reloadCountSource, errorEntrySource, linkUpdateSource, } from './data/busSources.js';
6
+ export { taskListSource, taskStatsSource, reloadCountSource, errorEntrySource, linkUpdateSource, linkConfigSource, linkPathsSource, linkDoneSource, linkDisconnectedSource, } from './data/busSources.js';
7
+ export type { NotifyLinkChangeInput } from './apis/notifyLinkChange.js';
8
+ export type { LinkPathInput } from './types/LinkPath.js';
9
+ export type { GetLinkConfigOutput } from './apis/getLinkConfig.js';
7
10
  //# sourceMappingURL=index.browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { createCloudpackClient } from './trpc/createCloudpackClient.js';
2
- export { taskListSource, taskStatsSource, reloadCountSource, errorEntrySource, linkUpdateSource, } from './data/busSources.js';
2
+ export { taskListSource, taskStatsSource, reloadCountSource, errorEntrySource, linkUpdateSource, linkConfigSource, linkPathsSource, linkDoneSource, linkDisconnectedSource, } from './data/busSources.js';
3
3
  //# sourceMappingURL=index.browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC","sourcesContent":["export type { TaskStats } from './types/TaskStats.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskList } from './types/TaskList.js';\n\nexport { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';\n\nexport {\n taskListSource,\n taskStatsSource,\n reloadCountSource,\n errorEntrySource,\n linkUpdateSource,\n} from './data/busSources.js';\n"]}
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,sBAAsB,GACvB,MAAM,sBAAsB,CAAC","sourcesContent":["export type { TaskStats } from './types/TaskStats.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskList } from './types/TaskList.js';\n\nexport { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';\n\nexport {\n taskListSource,\n taskStatsSource,\n reloadCountSource,\n errorEntrySource,\n linkUpdateSource,\n linkConfigSource,\n linkPathsSource,\n linkDoneSource,\n linkDisconnectedSource,\n} from './data/busSources.js';\n\n// Link proxy required types\nexport type { NotifyLinkChangeInput } from './apis/notifyLinkChange.js';\nexport type { LinkPathInput } from './types/LinkPath.js';\nexport type { GetLinkConfigOutput } from './apis/getLinkConfig.js';\n"]}
package/lib/index.d.ts CHANGED
@@ -11,12 +11,13 @@ export type { EnsurePackageBundledContext, EnsurePackageBundledResult } from './
11
11
  export type { CloudAppContext } from './types/CloudAppContext.js';
12
12
  export type { LinkPathInput, LinkPathOutput } from './types/LinkPath.js';
13
13
  export { TaskRunner } from './utilities/TaskRunner.js';
14
- export { taskListSource, taskStatsSource, errorEntrySource } from './data/busSources.js';
14
+ export { taskListSource, taskStatsSource, errorEntrySource, linkConfigSource, linkPathsSource, linkDoneSource, linkDisconnectedSource, } from './data/busSources.js';
15
15
  export { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';
16
16
  export { createCloudpackServer, type CloudpackServer, apiServerPort } from './trpc/createCloudpackServer.js';
17
17
  export { getActiveSessionsPath } from './utilities/getActiveSessionsPath.js';
18
18
  export { getConsumedDependencies } from './utilities/getConsumedDependencies.js';
19
19
  export { getConsumedPaths } from './utilities/getConsumedPaths.js';
20
+ export { waitForBusData } from './utilities/waitForBusData.js';
20
21
  export { createApiContext, createPartialApiContext, type CreateApiContextOptions } from './common/createApiContext.js';
21
22
  export { createMockContext, createPartialMockContext } from './common/createMockContext.js';
22
23
  export { createMockSession, createMockSessionNoFS } from './common/createMockSession.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC9F,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,YAAY,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC7G,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAg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,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC7G,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG/D,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,KAAK,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvH,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAGzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC"}
package/lib/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  export { TaskRunner } from './utilities/TaskRunner.js';
2
- export { taskListSource, taskStatsSource, errorEntrySource } from './data/busSources.js';
2
+ export { taskListSource, taskStatsSource, errorEntrySource, linkConfigSource, linkPathsSource, linkDoneSource, linkDisconnectedSource, } from './data/busSources.js';
3
3
  export { createCloudpackClient } from './trpc/createCloudpackClient.js';
4
4
  export { createCloudpackServer, apiServerPort } from './trpc/createCloudpackServer.js';
5
5
  export { getActiveSessionsPath } from './utilities/getActiveSessionsPath.js';
6
6
  export { getConsumedDependencies } from './utilities/getConsumedDependencies.js';
7
7
  export { getConsumedPaths } from './utilities/getConsumedPaths.js';
8
+ export { waitForBusData } from './utilities/waitForBusData.js';
8
9
  // Utilities
9
10
  export { createApiContext, createPartialApiContext } from './common/createApiContext.js';
10
11
  export { createMockContext, createPartialMockContext } from './common/createMockContext.js';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAwB,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC7G,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAgC,MAAM,8BAA8B,CAAC;AACvH,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEzF,iDAAiD;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export type { Context, PartialContext } from './types/Context.js';\nexport type { BundleInfo, BundleEntryInfo, BundleEntryConsumes } from './types/BundleInfo.js';\nexport type { TaskStats } from './types/TaskStats.js';\nexport type { Task } from './types/Task.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskEndDescription } from './types/TaskEndDescription.js';\nexport type { TaskList } from './types/TaskList.js';\nexport type { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\nexport type { EnsurePackageBundledContext, EnsurePackageBundledResult } from './apis/ensurePackageBundled.js';\nexport type { CloudAppContext } from './types/CloudAppContext.js';\nexport type { LinkPathInput, LinkPathOutput } from './types/LinkPath.js';\n\nexport { TaskRunner } from './utilities/TaskRunner.js';\nexport { taskListSource, taskStatsSource, errorEntrySource } from './data/busSources.js';\nexport { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer, type CloudpackServer, apiServerPort } from './trpc/createCloudpackServer.js';\nexport { getActiveSessionsPath } from './utilities/getActiveSessionsPath.js';\nexport { getConsumedDependencies } from './utilities/getConsumedDependencies.js';\nexport { getConsumedPaths } from './utilities/getConsumedPaths.js';\n\n// Utilities\nexport { createApiContext, createPartialApiContext, type CreateApiContextOptions } from './common/createApiContext.js';\nexport { createMockContext, createPartialMockContext } from './common/createMockContext.js';\nexport { createMockSession, createMockSessionNoFS } from './common/createMockSession.js';\n\n// API methods directly used outside this package\nexport { addPackageOverride } from './apis/addPackageOverride.js';\nexport { ensurePackageBundled } from './apis/ensurePackageBundled.js';\nexport { syncDownload } from './apis/syncDownload.js';\nexport { syncUpload } from './apis/syncUpload.js';\nexport type { SyncResult } from './types/SyncResult.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAwB,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC7G,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAgC,MAAM,8BAA8B,CAAC;AACvH,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEzF,iDAAiD;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export type { Context, PartialContext } from './types/Context.js';\nexport type { BundleInfo, BundleEntryInfo, BundleEntryConsumes } from './types/BundleInfo.js';\nexport type { TaskStats } from './types/TaskStats.js';\nexport type { Task } from './types/Task.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskEndDescription } from './types/TaskEndDescription.js';\nexport type { TaskList } from './types/TaskList.js';\nexport type { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\nexport type { EnsurePackageBundledContext, EnsurePackageBundledResult } from './apis/ensurePackageBundled.js';\nexport type { CloudAppContext } from './types/CloudAppContext.js';\nexport type { LinkPathInput, LinkPathOutput } from './types/LinkPath.js';\n\nexport { TaskRunner } from './utilities/TaskRunner.js';\nexport {\n taskListSource,\n taskStatsSource,\n errorEntrySource,\n linkConfigSource,\n linkPathsSource,\n linkDoneSource,\n linkDisconnectedSource,\n} from './data/busSources.js';\nexport { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer, type CloudpackServer, apiServerPort } from './trpc/createCloudpackServer.js';\nexport { getActiveSessionsPath } from './utilities/getActiveSessionsPath.js';\nexport { getConsumedDependencies } from './utilities/getConsumedDependencies.js';\nexport { getConsumedPaths } from './utilities/getConsumedPaths.js';\nexport { waitForBusData } from './utilities/waitForBusData.js';\n\n// Utilities\nexport { createApiContext, createPartialApiContext, type CreateApiContextOptions } from './common/createApiContext.js';\nexport { createMockContext, createPartialMockContext } from './common/createMockContext.js';\nexport { createMockSession, createMockSessionNoFS } from './common/createMockSession.js';\n\n// API methods directly used outside this package\nexport { addPackageOverride } from './apis/addPackageOverride.js';\nexport { ensurePackageBundled } from './apis/ensurePackageBundled.js';\nexport { syncDownload } from './apis/syncDownload.js';\nexport { syncUpload } from './apis/syncUpload.js';\nexport type { SyncResult } from './types/SyncResult.js';\n"]}
@@ -4,14 +4,20 @@ export declare const ZodLinkPackageDefinition: z.ZodObject<{
4
4
  name: z.ZodString;
5
5
  version: z.ZodString;
6
6
  exports: z.ZodAny;
7
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUndefined, z.ZodString]>>>;
8
+ peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUndefined, z.ZodString]>>>;
7
9
  }, "strip", z.ZodTypeAny, {
8
10
  name: string;
9
11
  version: string;
10
12
  exports?: any;
13
+ dependencies?: Record<string, string | undefined> | undefined;
14
+ peerDependencies?: Record<string, string | undefined> | undefined;
11
15
  }, {
12
16
  name: string;
13
17
  version: string;
14
18
  exports?: any;
19
+ dependencies?: Record<string, string | undefined> | undefined;
20
+ peerDependencies?: Record<string, string | undefined> | undefined;
15
21
  }>;
16
22
  export declare const ZodLinkedPath: z.ZodObject<{
17
23
  path: z.ZodType<string, z.ZodTypeDef, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"LinkPath.d.ts","sourceRoot":"","sources":["../../src/types/LinkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAmB,MAAM,KAAK,CAAC;AAEzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAU7D,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAAwE,CAAC;AAE9G,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;kDAuBxB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;EAA0C,CAAC;AAExE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG5B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"LinkPath.d.ts","sourceRoot":"","sources":["../../src/types/LinkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAmB,MAAM,KAAK,CAAC;AAEzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAW7D,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;EASnC,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;kDAuBxB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;EAA0C,CAAC;AAExE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG5B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -6,7 +6,17 @@ const ZodPackageHashesEntry = z.object({
6
6
  browser: z.record(z.string()),
7
7
  node: z.record(z.string()),
8
8
  });
9
- export const ZodLinkPackageDefinition = z.object({ name: z.string(), version: z.string(), exports: z.any() });
9
+ const ZodDependency = z.record(z.string(), z.union([z.undefined(), z.string()])).optional();
10
+ export const ZodLinkPackageDefinition = z.object({
11
+ // Name and version are required for the import map.
12
+ name: z.string(),
13
+ version: z.string(),
14
+ // The exports are also required for the import map.
15
+ exports: z.any(),
16
+ // Dependencies are required for the resolve map.
17
+ dependencies: ZodDependency,
18
+ peerDependencies: ZodDependency,
19
+ });
10
20
  export const ZodLinkedPath = matchingZodObject({
11
21
  path: z.string(),
12
22
  rootPath: z.string().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"LinkPath.js","sourceRoot":"","sources":["../../src/types/LinkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAmB,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,gBAAgB,GAAG,CAAC,cAA0B,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AAE5G,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,M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AE;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC,CAAC;AAIxE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;CACpC,CAAC,CAAC","sourcesContent":["import { z, type ZodTypeAny } from 'zod';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nimport type { LinkedPath } from '@ms-cloudpack/common-types';\nimport { ZodResolveMap } from '../types/ZodResolveMap.js';\n\nconst ZodPackageRecord = (ZodPackageJson: ZodTypeAny) => z.record(z.union([ZodPackageJson, z.undefined()]));\n\nconst ZodPackageHashesEntry = z.object({\n browser: z.record(z.string()),\n node: z.record(z.string()),\n});\n\nexport const ZodLinkPackageDefinition = z.object({ name: z.string(), version: z.string(), exports: z.any() });\n\nexport const ZodLinkedPath = matchingZodObject<LinkedPath>({\n path: z.string(),\n rootPath: z.string().optional(),\n includeAll: z.boolean().optional(),\n ignoredPackages: z.string().array().optional(),\n ignoreResolutions: z.boolean().optional(),\n resolveStrategy: z.enum(['dedupe', 'duplicate']).optional(),\n remote: z\n .object({\n resolveMap: ZodResolveMap,\n hostUrl: z.string(),\n packages: z.object({\n // Dummy package json as start should not require any non transformed package definitions\n definitions: ZodPackageRecord(z.object({})),\n // For linked packages, we need name and version across Cloudpack, and the exports for the import map.\n transformedDefinitions: ZodPackageRecord(ZodLinkPackageDefinition),\n }),\n packageHashes: z.object({\n hashesWithSource: ZodPackageHashesEntry,\n hashesWithNoSource: ZodPackageHashesEntry,\n }),\n })\n .optional(),\n});\n\nexport const ZodLinkPathInput = z.object({ linkedPath: ZodLinkedPath });\n\nexport type LinkPathInput = z.infer<typeof ZodLinkPathInput>;\n\nexport const ZodLinkPathOutput = z.object({\n resolveMap: ZodResolveMap,\n linkedPaths: z.array(ZodLinkedPath),\n});\n\nexport type LinkPathOutput = z.infer<typeof ZodLinkPathOutput>;\n"]}
1
+ {"version":3,"file":"LinkPath.js","sourceRoot":"","sources":["../../src/types/LinkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAmB,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,gBAAgB,GAAG,CAAC,cAA0B,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;AAE5G,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC5F,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,oDAAoD;IACpD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,oDAAoD;IACpD,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE;IAChB,iDAAiD;IACjD,YAAY,EAAE,aAAa;IAC3B,gBAAgB,EAAE,aAAa;CAChC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,a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matchingZodObject.js';\nimport type { LinkedPath } from '@ms-cloudpack/common-types';\nimport { ZodResolveMap } from '../types/ZodResolveMap.js';\n\nconst ZodPackageRecord = (ZodPackageJson: ZodTypeAny) => z.record(z.union([ZodPackageJson, z.undefined()]));\n\nconst ZodPackageHashesEntry = z.object({\n browser: z.record(z.string()),\n node: z.record(z.string()),\n});\n\nconst ZodDependency = z.record(z.string(), z.union([z.undefined(), z.string()])).optional();\nexport const ZodLinkPackageDefinition = z.object({\n // Name and version are required for the import map.\n name: z.string(),\n version: z.string(),\n // The exports are also required for the import map.\n exports: z.any(),\n // Dependencies are required for the resolve map.\n dependencies: ZodDependency,\n peerDependencies: ZodDependency,\n});\n\nexport const ZodLinkedPath = matchingZodObject<LinkedPath>({\n path: z.string(),\n rootPath: z.string().optional(),\n includeAll: z.boolean().optional(),\n ignoredPackages: z.string().array().optional(),\n ignoreResolutions: z.boolean().optional(),\n resolveStrategy: z.enum(['dedupe', 'duplicate']).optional(),\n remote: z\n .object({\n resolveMap: ZodResolveMap,\n hostUrl: z.string(),\n packages: z.object({\n // Dummy package json as start should not require any non transformed package definitions\n definitions: ZodPackageRecord(z.object({})),\n // For linked packages, we need name and version across Cloudpack, and the exports for the import map.\n transformedDefinitions: ZodPackageRecord(ZodLinkPackageDefinition),\n }),\n packageHashes: z.object({\n hashesWithSource: ZodPackageHashesEntry,\n hashesWithNoSource: ZodPackageHashesEntry,\n }),\n })\n .optional(),\n});\n\nexport const ZodLinkPathInput = z.object({ linkedPath: ZodLinkedPath });\n\nexport type LinkPathInput = z.infer<typeof ZodLinkPathInput>;\n\nexport const ZodLinkPathOutput = z.object({\n resolveMap: ZodResolveMap,\n linkedPaths: z.array(ZodLinkedPath),\n});\n\nexport type LinkPathOutput = z.infer<typeof ZodLinkPathOutput>;\n"]}
@@ -0,0 +1,4 @@
1
+ import { type ZodSchema } from 'zod';
2
+ import type { CloudpackLinkConfig } from '@ms-cloudpack/common-types';
3
+ export declare const ZodGetLinkConfigOutput: ZodSchema<CloudpackLinkConfig>;
4
+ //# sourceMappingURL=ZodGetLinkConfigOutput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZodGetLinkConfigOutput.d.ts","sourceRoot":"","sources":["../../src/types/ZodGetLinkConfigOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAQtE,eAAO,MAAM,sBAAsB,EAAE,SAAS,CAAC,mBAAmB,CAOlD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { matchingZodObject } from '../utilities/matchingZodObject.js';
3
+ // Minimum acceptable match object for a low maintenance burden.
4
+ const ZodPackageSettingsMatchObject = z.object({ name: z.string(), version: z.string().optional() });
5
+ const ZodPackageSettingsMatch = z.union([z.string(), ZodPackageSettingsMatchObject]);
6
+ const ZodGeneratedPackageSettingsMatch = z.union([z.string(), ZodPackageSettingsMatchObject.required()]);
7
+ export const ZodGetLinkConfigOutput = matchingZodObject({
8
+ packageSettings: z.array(z.object({ match: z.union([ZodPackageSettingsMatch, z.array(ZodPackageSettingsMatch)]) }).passthrough()),
9
+ generated: z
10
+ .object({ packageSettings: z.array(z.object({ match: ZodGeneratedPackageSettingsMatch }).passthrough()) })
11
+ .passthrough(),
12
+ }).passthrough();
13
+ //# sourceMappingURL=ZodGetLinkConfigOutput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZodGetLinkConfigOutput.js","sourceRoot":"","sources":["../../src/types/ZodGetLinkConfigOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAkB,MAAM,KAAK,CAAC;AAExC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,gEAAgE;AAChE,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AACrG,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,6BAA6B,CAAC,CAAC,CAAC;AACrF,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,6BAA6B,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AAEzG,MAAM,CAAC,MAAM,sBAAsB,GAAmC,iBAAiB,CAAsB;IAC3G,eAAe,EAAE,CAAC,CAAC,KAAK,CACtB,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAuB,EAAE,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CACxG;IACD,SAAS,EAAE,CAAC;SACT,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,gCAAgC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;SACzG,WAAW,EAAE;CACjB,CAAC,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { z, type ZodSchema } from 'zod';\nimport type { CloudpackLinkConfig } from '@ms-cloudpack/common-types';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\n\n// Minimum acceptable match object for a low maintenance burden.\nconst ZodPackageSettingsMatchObject = z.object({ name: z.string(), version: z.string().optional() });\nconst ZodPackageSettingsMatch = z.union([z.string(), ZodPackageSettingsMatchObject]);\nconst ZodGeneratedPackageSettingsMatch = z.union([z.string(), ZodPackageSettingsMatchObject.required()]);\n\nexport const ZodGetLinkConfigOutput: ZodSchema<CloudpackLinkConfig> = matchingZodObject<CloudpackLinkConfig>({\n packageSettings: z.array(\n z.object({ match: z.union([ZodPackageSettingsMatch, z.array(ZodPackageSettingsMatch)]) }).passthrough(),\n ),\n generated: z\n .object({ packageSettings: z.array(z.object({ match: ZodGeneratedPackageSettingsMatch }).passthrough()) })\n .passthrough(),\n}).passthrough();\n"]}
@@ -6,14 +6,20 @@ export declare const ZodNotifyLinkChangeInput: z.ZodObject<{
6
6
  name: z.ZodString;
7
7
  version: z.ZodString;
8
8
  exports: z.ZodAny;
9
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUndefined, z.ZodString]>>>;
10
+ peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUndefined, z.ZodString]>>>;
9
11
  }, "strip", z.ZodTypeAny, {
10
12
  name: string;
11
13
  version: string;
12
14
  exports?: any;
15
+ dependencies?: Record<string, string | undefined> | undefined;
16
+ peerDependencies?: Record<string, string | undefined> | undefined;
13
17
  }, {
14
18
  name: string;
15
19
  version: string;
16
20
  exports?: any;
21
+ dependencies?: Record<string, string | undefined> | undefined;
22
+ peerDependencies?: Record<string, string | undefined> | undefined;
17
23
  }>>;
18
24
  }, "strip", z.ZodTypeAny, {
19
25
  packagePath: string;
@@ -22,6 +28,8 @@ export declare const ZodNotifyLinkChangeInput: z.ZodObject<{
22
28
  name: string;
23
29
  version: string;
24
30
  exports?: any;
31
+ dependencies?: Record<string, string | undefined> | undefined;
32
+ peerDependencies?: Record<string, string | undefined> | undefined;
25
33
  } | undefined;
26
34
  }, {
27
35
  packagePath: string;
@@ -30,6 +38,8 @@ export declare const ZodNotifyLinkChangeInput: z.ZodObject<{
30
38
  name: string;
31
39
  version: string;
32
40
  exports?: any;
41
+ dependencies?: Record<string, string | undefined> | undefined;
42
+ peerDependencies?: Record<string, string | undefined> | undefined;
33
43
  } | undefined;
34
44
  }>;
35
45
  //# sourceMappingURL=ZodNotifyLinkChangeInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ZodNotifyLinkChangeInput.d.ts","sourceRoot":"","sources":["../../src/types/ZodNotifyLinkChangeInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAInC,CAAC"}
1
+ {"version":3,"file":"ZodNotifyLinkChangeInput.d.ts","sourceRoot":"","sources":["../../src/types/ZodNotifyLinkChangeInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAInC,CAAC"}
@@ -1,4 +1,5 @@
1
- import type { LinkedPath, ResolveMap } from '@ms-cloudpack/common-types';
1
+ import type { ResolveMap } from '@ms-cloudpack/common-types';
2
+ import { createResolveMap } from '@ms-cloudpack/package-utilities';
2
3
  import type { Context } from '../types/Context.js';
3
4
  /**
4
5
  * Create the resolve map, logging the results to the task reporter.
@@ -7,14 +8,5 @@ import type { Context } from '../types/Context.js';
7
8
  * Usually this will contain all dependencies of `appPath` (and other paths if specified),
8
9
  * but if `skipResolveDependencies` is true, it will only contain the package at `appPath`.
9
10
  */
10
- export declare function createResolveMapTask(options: {
11
- appPath: string;
12
- overlayPath: string | undefined;
13
- linkedPaths?: LinkedPath[];
14
- /**
15
- * Skip the actual resolution of dependencies. The returned resolve map will only contain
16
- * the package at `appPath`. Not compatible with `linkedPaths`.
17
- */
18
- skipResolveDependencies: boolean | undefined;
19
- }, context: Pick<Context, 'reporter' | 'packages' | 'telemetryClient'>): Promise<ResolveMap>;
11
+ export declare function createResolveMapTask(options: Pick<Parameters<typeof createResolveMap>[0], 'appPath' | 'additionalPaths' | 'linkedPaths' | 'skipResolveDependencies'>, context: Pick<Context, 'reporter' | 'packages' | 'telemetryClient'>): Promise<ResolveMap>;
20
12
  //# sourceMappingURL=createResolveMapTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createResolveMapTask.d.ts","sourceRoot":"","sources":["../../src/utilities/createResolveMapTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAmB,MAAM,4BAA4B,CAAC;AAI1F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B;;;OAGG;IACH,uBAAuB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9C,EACD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAClE,OAAO,CAAC,UAAU,CAAC,CA8DrB"}
1
+ {"version":3,"file":"createResolveMapTask.d.ts","sourceRoot":"","sources":["../../src/utilities/createResolveMapTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAmB,MAAM,4BAA4B,CAAC;AAE9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,IAAI,CACX,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,EACtC,SAAS,GAAG,iBAAiB,GAAG,aAAa,GAAG,yBAAyB,CAC1E,EACD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAClE,OAAO,CAAC,UAAU,CAAC,CAiErB"}
@@ -1,6 +1,6 @@
1
1
  import { environmentInfo } from '@ms-cloudpack/environment';
2
2
  import { createResolveMap } from '@ms-cloudpack/package-utilities';
3
- import { bold, bulletedList, cyan, yellow } from '@ms-cloudpack/task-reporter';
3
+ import { bold, bulletedList, cyan, plural, yellow } from '@ms-cloudpack/task-reporter';
4
4
  /**
5
5
  * Create the resolve map, logging the results to the task reporter.
6
6
  * Throws if dependencies could not be resolved.
@@ -9,7 +9,7 @@ import { bold, bulletedList, cyan, yellow } from '@ms-cloudpack/task-reporter';
9
9
  * but if `skipResolveDependencies` is true, it will only contain the package at `appPath`.
10
10
  */
11
11
  export async function createResolveMapTask(options, context) {
12
- const { appPath, overlayPath, linkedPaths, skipResolveDependencies } = options;
12
+ const { appPath, additionalPaths, linkedPaths, skipResolveDependencies } = options;
13
13
  const { reporter, packages, telemetryClient } = context;
14
14
  let resolveMap;
15
15
  if (skipResolveDependencies && linkedPaths?.length) {
@@ -19,16 +19,19 @@ export async function createResolveMapTask(options, context) {
19
19
  try {
20
20
  resolveMap = await telemetryClient.tracer.startActiveSpan('CREATE_RESOLVE_MAP', async (span) => {
21
21
  span.setAttributes({ linkedPaths: linkedPaths?.length || 0, skipResolveDependencies });
22
- const additionalPaths = overlayPath ? [overlayPath] : [];
23
22
  // await is required here to report telemetry correctly
24
23
  return await createResolveMap({ appPath, additionalPaths, linkedPaths, skipResolveDependencies }, { packages });
25
24
  });
26
25
  let message;
27
26
  let extended;
28
27
  if (skipResolveDependencies) {
29
- // In theory this could include the overlay too, but overlayPath and skipResolveDependencies
30
- // are for unrelated scenarios, so it's not likely to happen (and not a problem if it does).
31
- message = 'Created resolve map with the current package only.';
28
+ message = 'Created resolve map with the current package';
29
+ if (additionalPaths?.length) {
30
+ message += ` and ${plural(additionalPaths.length, 'additional path')}.`;
31
+ }
32
+ else {
33
+ message += ' only.';
34
+ }
32
35
  }
33
36
  else {
34
37
  const { allPackages, duplicatedPackages } = getPackagesFromResolveMap(resolveMap);
@@ -1 +1 @@
1
- {"version":3,"file":"createResolveMapTask.js","sourceRoot":"","sources":["../../src/utilities/createResolveMapTask.ts"],"names":[],"mappings":"AACA,OAAO,E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loudpack/common-types';\nimport { environmentInfo } from '@ms-cloudpack/environment';\nimport { createResolveMap } from '@ms-cloudpack/package-utilities';\nimport { bold, bulletedList, cyan, yellow } from '@ms-cloudpack/task-reporter';\nimport type { Context } from '../types/Context.js';\n\n/**\n * Create the resolve map, logging the results to the task reporter.\n * Throws if dependencies could not be resolved.\n *\n * Usually this will contain all dependencies of `appPath` (and other paths if specified),\n * but if `skipResolveDependencies` is true, it will only contain the package at `appPath`.\n */\nexport async function createResolveMapTask(\n options: {\n appPath: string;\n overlayPath: string | undefined;\n linkedPaths?: LinkedPath[];\n /**\n * Skip the actual resolution of dependencies. The returned resolve map will only contain\n * the package at `appPath`. Not compatible with `linkedPaths`.\n */\n skipResolveDependencies: boolean | undefined;\n },\n context: Pick<Context, 'reporter' | 'packages' | 'telemetryClient'>,\n): Promise<ResolveMap> {\n const { appPath, overlayPath, linkedPaths, skipResolveDependencies } = options;\n const { reporter, packages, telemetryClient } = context;\n let resolveMap: ResolveMap | undefined;\n\n if (skipResolveDependencies && linkedPaths?.length) {\n throw new Error('Cannot use `linkedPaths` with `skipResolveDependencies`');\n }\n\n const task = reporter.addTask(skipResolveDependencies ? 'Creating resolve map' : 'Resolving dependencies');\n\n try {\n resolveMap = await telemetryClient.tracer.startActiveSpan('CREATE_RESOLVE_MAP', async (span) => {\n span.setAttributes({ linkedPaths: linkedPaths?.length || 0, skipResolveDependencies });\n\n const additionalPaths = overlayPath ? [overlayPath] : [];\n // await is required here to report telemetry correctly\n return await createResolveMap({ appPath, additionalPaths, linkedPaths, skipResolveDependencies }, { packages });\n });\n\n let message: string;\n let extended: string | undefined;\n\n if (skipResolveDependencies) {\n // In theory this could include the overlay too, but overlayPath and skipResolveDependencies\n // are for unrelated scenarios, so it's not likely to happen (and not a problem if it does).\n message = 'Created resolve map with the current package only.';\n } else {\n const { allPackages, duplicatedPackages } = getPackagesFromResolveMap(resolveMap);\n\n message = `Found ${cyan(allPackages.size)} total packages, ${\n duplicatedPackages.size ? `${yellow(duplicatedPackages.size)} with multiple versions.` : `no duplicates.`\n }`;\n extended = bulletedList(\n Array.from(\n duplicatedPackages.entries(),\n ([name, versions]) => `${bold(name)}: ${Array.from(versions).join(', ')}`,\n ),\n );\n }\n\n task.complete({ message, extended, forceShow: true });\n\n return resolveMap;\n } catch (err) {\n task.complete({\n status: 'fail',\n message: 'Failed to resolve dependencies',\n errors: [String(err)],\n forceShow: true,\n // Don't use the message as \"details\" because this will cause the message to be logged twice\n extended: (err as Error).stack,\n });\n\n if (err instanceof Error && !environmentInfo.isJest) {\n // Remove the call stack because we already logged it in the extended details of the task\n // (unless running in a test, because it prevents the error from being logged in an understandable way)\n err.stack = undefined;\n }\n\n throw err;\n }\n}\n\n/**\n * Given a resolveMap, returns a map of all packages and a map of packages with multiple versions.\n * This is used to log the results of the resolve task.\n */\nfunction getPackagesFromResolveMap(resolveMap: ResolveMap): {\n allPackages: Map<string, ResolveMapEntry>;\n duplicatedPackages: Map<string, Set<string>>;\n} {\n const allPackages = new Map<string, ResolveMapEntry>();\n const duplicatedPackages = new Map<string, Set<string>>();\n\n function addEntry(entry: ResolveMapEntry): void {\n const existingEntry = allPackages.get(entry.name);\n if (existingEntry) {\n let dupeSet = duplicatedPackages.get(entry.name);\n if (!dupeSet) {\n dupeSet = new Set([existingEntry.version]);\n duplicatedPackages.set(entry.name, dupeSet);\n }\n dupeSet.add(entry.version);\n } else {\n allPackages.set(entry.name, entry);\n }\n }\n\n for (const currentEntry of Object.values(resolveMap)) {\n addEntry(currentEntry);\n\n if (currentEntry.scopedVersions) {\n for (const scopedEntry of Object.values(currentEntry.scopedVersions)) {\n addEntry(scopedEntry);\n }\n }\n }\n\n return {\n allPackages,\n duplicatedPackages,\n };\n}\n"]}
1
+ {"version":3,"file":"createResolveMapTask.js","sourceRoot":"","sources":["../../src/utilities/createResolveMapTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,gBAAg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MapEntry } from '@ms-cloudpack/common-types';\nimport { environmentInfo } from '@ms-cloudpack/environment';\nimport { createResolveMap } from '@ms-cloudpack/package-utilities';\nimport { bold, bulletedList, cyan, plural, yellow } from '@ms-cloudpack/task-reporter';\nimport type { Context } from '../types/Context.js';\n\n/**\n * Create the resolve map, logging the results to the task reporter.\n * Throws if dependencies could not be resolved.\n *\n * Usually this will contain all dependencies of `appPath` (and other paths if specified),\n * but if `skipResolveDependencies` is true, it will only contain the package at `appPath`.\n */\nexport async function createResolveMapTask(\n options: Pick<\n Parameters<typeof createResolveMap>[0],\n 'appPath' | 'additionalPaths' | 'linkedPaths' | 'skipResolveDependencies'\n >,\n context: Pick<Context, 'reporter' | 'packages' | 'telemetryClient'>,\n): Promise<ResolveMap> {\n const { appPath, additionalPaths, linkedPaths, skipResolveDependencies } = options;\n const { reporter, packages, telemetryClient } = context;\n let resolveMap: ResolveMap | undefined;\n\n if (skipResolveDependencies && linkedPaths?.length) {\n throw new Error('Cannot use `linkedPaths` with `skipResolveDependencies`');\n }\n\n const task = reporter.addTask(skipResolveDependencies ? 'Creating resolve map' : 'Resolving dependencies');\n\n try {\n resolveMap = await telemetryClient.tracer.startActiveSpan('CREATE_RESOLVE_MAP', async (span) => {\n span.setAttributes({ linkedPaths: linkedPaths?.length || 0, skipResolveDependencies });\n\n // await is required here to report telemetry correctly\n return await createResolveMap({ appPath, additionalPaths, linkedPaths, skipResolveDependencies }, { packages });\n });\n\n let message: string;\n let extended: string | undefined;\n\n if (skipResolveDependencies) {\n message = 'Created resolve map with the current package';\n\n if (additionalPaths?.length) {\n message += ` and ${plural(additionalPaths.length, 'additional path')}.`;\n } else {\n message += ' only.';\n }\n } else {\n const { allPackages, duplicatedPackages } = getPackagesFromResolveMap(resolveMap);\n\n message = `Found ${cyan(allPackages.size)} total packages, ${\n duplicatedPackages.size ? `${yellow(duplicatedPackages.size)} with multiple versions.` : `no duplicates.`\n }`;\n extended = bulletedList(\n Array.from(\n duplicatedPackages.entries(),\n ([name, versions]) => `${bold(name)}: ${Array.from(versions).join(', ')}`,\n ),\n );\n }\n\n task.complete({ message, extended, forceShow: true });\n\n return resolveMap;\n } catch (err) {\n task.complete({\n status: 'fail',\n message: 'Failed to resolve dependencies',\n errors: [String(err)],\n forceShow: true,\n // Don't use the message as \"details\" because this will cause the message to be logged twice\n extended: (err as Error).stack,\n });\n\n if (err instanceof Error && !environmentInfo.isJest) {\n // Remove the call stack because we already logged it in the extended details of the task\n // (unless running in a test, because it prevents the error from being logged in an understandable way)\n err.stack = undefined;\n }\n\n throw err;\n }\n}\n\n/**\n * Given a resolveMap, returns a map of all packages and a map of packages with multiple versions.\n * This is used to log the results of the resolve task.\n */\nfunction getPackagesFromResolveMap(resolveMap: ResolveMap): {\n allPackages: Map<string, ResolveMapEntry>;\n duplicatedPackages: Map<string, Set<string>>;\n} {\n const allPackages = new Map<string, ResolveMapEntry>();\n const duplicatedPackages = new Map<string, Set<string>>();\n\n function addEntry(entry: ResolveMapEntry): void {\n const existingEntry = allPackages.get(entry.name);\n if (existingEntry) {\n let dupeSet = duplicatedPackages.get(entry.name);\n if (!dupeSet) {\n dupeSet = new Set([existingEntry.version]);\n duplicatedPackages.set(entry.name, dupeSet);\n }\n dupeSet.add(entry.version);\n } else {\n allPackages.set(entry.name, entry);\n }\n }\n\n for (const currentEntry of Object.values(resolveMap)) {\n addEntry(currentEntry);\n\n if (currentEntry.scopedVersions) {\n for (const scopedEntry of Object.values(currentEntry.scopedVersions)) {\n addEntry(scopedEntry);\n }\n }\n }\n\n return {\n allPackages,\n duplicatedPackages,\n };\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import type z from 'zod';
2
+ import type { DataBus, DataBusPath } from '@ms-cloudpack/data-bus';
3
+ /**
4
+ * Waits for data to be published on a specific bus path, with a timeout.
5
+ */
6
+ export declare function waitForBusData<T>(params: {
7
+ /** Data bus to listen on */
8
+ bus: DataBus;
9
+ /** Path to subscribe to */
10
+ source: DataBusPath<z.ZodType>;
11
+ /** Timeout in milliseconds */
12
+ timeoutMs?: number;
13
+ }): Promise<T>;
14
+ //# sourceMappingURL=waitForBusData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForBusData.d.ts","sourceRoot":"","sources":["../../src/utilities/waitForBusData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE;IAC9C,4BAA4B;IAC5B,GAAG,EAAE,OAAO,CAAC;IACb,2BAA2B;IAC3B,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC/B,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,CAAC,CAAC,CAgBb"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Waits for data to be published on a specific bus path, with a timeout.
3
+ */
4
+ export async function waitForBusData(params) {
5
+ const { bus, source, timeoutMs = 120000 } = params;
6
+ return new Promise((res, rej) => {
7
+ // Set up subscription to the bus path
8
+ const unsubscribe = bus.subscribe(source, (value) => {
9
+ clearTimeout(timeoutId);
10
+ res(value);
11
+ unsubscribe();
12
+ });
13
+ // Set up timeout
14
+ const timeoutId = setTimeout(() => {
15
+ unsubscribe();
16
+ rej(new Error(`Timeout waiting for bus data on path ${source.path.join('.')}`));
17
+ }, timeoutMs);
18
+ });
19
+ }
20
+ //# sourceMappingURL=waitForBusData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForBusData.js","sourceRoot":"","sources":["../../src/utilities/waitForBusData.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAI,MAOvC;IACC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACnD,OAAO,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACjC,sCAAsC;QACtC,MAAM,WAAW,GAAe,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,KAAc,EAAE,EAAE;YACvE,YAAY,CAAC,SAAS,CAAC,CAAC;YACxB,GAAG,CAAC,KAAU,CAAC,CAAC;YAChB,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,iBAAiB;QACjB,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAChC,WAAW,EAAE,CAAC;YACd,GAAG,CAAC,IAAI,KAAK,CAAC,wCAAwC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAClF,CAAC,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type z from 'zod';\nimport type { DataBus, DataBusPath } from '@ms-cloudpack/data-bus';\n\n/**\n * Waits for data to be published on a specific bus path, with a timeout.\n */\nexport async function waitForBusData<T>(params: {\n /** Data bus to listen on */\n bus: DataBus;\n /** Path to subscribe to */\n source: DataBusPath<z.ZodType>;\n /** Timeout in milliseconds */\n timeoutMs?: number;\n}): Promise<T> {\n const { bus, source, timeoutMs = 120000 } = params;\n return new Promise<T>((res, rej) => {\n // Set up subscription to the bus path\n const unsubscribe: () => void = bus.subscribe(source, (value: unknown) => {\n clearTimeout(timeoutId);\n res(value as T);\n unsubscribe();\n });\n\n // Set up timeout\n const timeoutId = setTimeout(() => {\n unsubscribe();\n rej(new Error(`Timeout waiting for bus data on path ${source.path.join('.')}`));\n }, timeoutMs);\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/api-server",
3
- "version": "0.62.1",
3
+ "version": "0.63.0",
4
4
  "description": "An implementation of the API server that does interacts with a task scheduler.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@ms-cloudpack/bundler": "^0.25.1",
26
+ "@ms-cloudpack/bundler": "^0.25.2",
27
27
  "@ms-cloudpack/common-types": "^0.24.17",
28
28
  "@ms-cloudpack/config": "^0.35.3",
29
29
  "@ms-cloudpack/create-express-app": "^1.10.31",
@@ -33,7 +33,7 @@
33
33
  "@ms-cloudpack/file-watcher": "^0.3.2",
34
34
  "@ms-cloudpack/import-map": "^0.10.21",
35
35
  "@ms-cloudpack/json-utilities": "^0.1.10",
36
- "@ms-cloudpack/package-hashes": "^0.8.3",
36
+ "@ms-cloudpack/package-hashes": "^0.8.4",
37
37
  "@ms-cloudpack/package-utilities": "^12.3.5",
38
38
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
39
39
  "@ms-cloudpack/path-utilities": "^3.1.2",