@ms-cloudpack/api-server 0.44.5 → 0.44.7

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 (47) hide show
  1. package/lib/apis/addPackageOverride.d.ts +1 -1
  2. package/lib/apis/addPackageOverride.d.ts.map +1 -1
  3. package/lib/apis/addPackageOverride.js +21 -2
  4. package/lib/apis/addPackageOverride.js.map +1 -1
  5. package/lib/apis/index.d.ts +1 -0
  6. package/lib/apis/index.d.ts.map +1 -1
  7. package/lib/apis/index.js +1 -0
  8. package/lib/apis/index.js.map +1 -1
  9. package/lib/apis/linkPath.d.ts +61 -0
  10. package/lib/apis/linkPath.d.ts.map +1 -0
  11. package/lib/apis/linkPath.js +46 -0
  12. package/lib/apis/linkPath.js.map +1 -0
  13. package/lib/apis/validatePackageOverride.d.ts +1 -1
  14. package/lib/apis/validatePackageOverride.d.ts.map +1 -1
  15. package/lib/apis/validatePackageOverride.js +3 -0
  16. package/lib/apis/validatePackageOverride.js.map +1 -1
  17. package/lib/common/createSession.d.ts.map +1 -1
  18. package/lib/common/createSession.js +14 -0
  19. package/lib/common/createSession.js.map +1 -1
  20. package/lib/data/busSources.d.ts +11 -3
  21. package/lib/data/busSources.d.ts.map +1 -1
  22. package/lib/data/busSources.js +9 -0
  23. package/lib/data/busSources.js.map +1 -1
  24. package/lib/index.browser.d.ts +3 -1
  25. package/lib/index.browser.d.ts.map +1 -1
  26. package/lib/index.browser.js +1 -1
  27. package/lib/index.browser.js.map +1 -1
  28. package/lib/index.d.ts +4 -2
  29. package/lib/index.d.ts.map +1 -1
  30. package/lib/index.js +2 -2
  31. package/lib/index.js.map +1 -1
  32. package/lib/trpc/createAppRouter.d.ts +24 -0
  33. package/lib/trpc/createAppRouter.d.ts.map +1 -1
  34. package/lib/trpc/createCloudpackServer.d.ts +6 -0
  35. package/lib/trpc/createCloudpackServer.d.ts.map +1 -1
  36. package/lib/types/ErrorEntry.d.ts +4 -0
  37. package/lib/types/ErrorEntry.d.ts.map +1 -0
  38. package/lib/types/ErrorEntry.js +3 -0
  39. package/lib/types/ErrorEntry.js.map +1 -0
  40. package/lib/types/Session.d.ts +12 -1
  41. package/lib/types/Session.d.ts.map +1 -1
  42. package/lib/types/Session.js.map +1 -1
  43. package/lib/utilities/addOverride.d.ts +8 -6
  44. package/lib/utilities/addOverride.d.ts.map +1 -1
  45. package/lib/utilities/addOverride.js +93 -80
  46. package/lib/utilities/addOverride.js.map +1 -1
  47. package/package.json +10 -10
@@ -32,7 +32,7 @@ export type AddPackageOverrideInput = z.infer<typeof ZodAddPackageOverrideInput>
32
32
  /**
33
33
  * Adds an override to the Cloudpack config.
34
34
  */
35
- export declare function addPackageOverride(params: ApiParams<AddPackageOverrideInput, 'session' | 'bus' | 'packages' | 'taskRunner'>): Promise<boolean>;
35
+ export declare function addPackageOverride(params: ApiParams<AddPackageOverrideInput, 'bus' | 'watcher' | 'taskRunner' | 'packages' | 'session' | 'packageImportPaths' | 'packageHashes'>): Promise<boolean>;
36
36
  export declare namespace addPackageOverride {
37
37
  var procedure: import("@trpc/server").BuildProcedure<"mutation", {
38
38
  _config: import("@trpc/server").RootConfig<{
@@ -1 +1 @@
1
- {"version":3,"file":"addPackageOverride.d.ts","sourceRoot":"","sources":["../../src/apis/addPackageOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,QAAA,MAAM,0BAA0B;IAC9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;EAEH,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEjF;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,SAAS,CAAC,uBAAuB,EAAE,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,YAAY,CAAC,GACxF,OAAO,CAAC,OAAO,CAAC,CAWlB;yBAbqB,kBAAkB"}
1
+ {"version":3,"file":"addPackageOverride.d.ts","sourceRoot":"","sources":["../../src/apis/addPackageOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD,QAAA,MAAM,0BAA0B;IAC9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;EAEH,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEjF;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,SAAS,CACf,uBAAuB,EACvB,KAAK,GAAG,SAAS,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,oBAAoB,GAAG,eAAe,CACnG,GACA,OAAO,CAAC,OAAO,CAAC,CA8BlB;yBAnCqB,kBAAkB"}
@@ -2,6 +2,8 @@ import { z } from 'zod';
2
2
  import { publicProcedure } from '../trpc/common.js';
3
3
  import { addOverride } from '../utilities/addOverride.js';
4
4
  import { notifyReload } from '../utilities/notifyReload.js';
5
+ import { errorEntrySource } from '../data/busSources.js';
6
+ import { addImportMapHash } from '@ms-cloudpack/import-map';
5
7
  const ZodAddPackageOverrideInput = z.object({
6
8
  /**
7
9
  * The package name to override.
@@ -25,11 +27,28 @@ const ZodAddPackageOverrideInput = z.object({
25
27
  */
26
28
  export async function addPackageOverride(params) {
27
29
  const { input, ctx } = params;
28
- const { session, bus, packages, taskRunner } = ctx;
30
+ const { session, bus, packages, taskRunner, packageHashes } = ctx;
29
31
  const { addedOverride, entry } = await addOverride(input, { session, packages });
30
- if (entry) {
32
+ if (entry && addedOverride) {
33
+ const hash = await packageHashes.get({
34
+ packagePath: entry.path,
35
+ isSourceHashingEnabled: !entry.isExternal,
36
+ shouldRecalculate: true,
37
+ });
38
+ const importMap = session.importMap;
39
+ const bundleServer = session.urls.bundleServer;
40
+ // We need to change the import map hash to force a reload.
41
+ if (importMap && bundleServer) {
42
+ addImportMapHash({
43
+ packageName: entry.name,
44
+ version: entry.version,
45
+ hash,
46
+ }, { ...ctx, ...session, importMap, urls: { bundleServer } });
47
+ }
31
48
  taskRunner.remove(entry.path);
32
49
  session.incrementTargetVersion(entry.path);
50
+ // We can clear the error message now that the override has been added.
51
+ bus.publish(errorEntrySource, '');
33
52
  notifyReload({ bus, session });
34
53
  }
35
54
  return addedOverride;
@@ -1 +1 @@
1
- {"version":3,"file":"addPackageOverride.js","sourceRoot":"","sources":["../../src/apis/addPackageOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C;;OAEG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IAEvB;;OAEG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IAEtB;;OAEG;IACH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAE9B;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAGH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAyF;IAEzF,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;IAEnD,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,MAAM,WAAW,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjF,IAAI,KAAK,EAAE,CAAC;QACV,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9B,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,YAAY,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,kBAAkB,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport { addOverride } from '../utilities/addOverride.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport type { ApiParams } from '../types/ApiParams.js';\n\nconst ZodAddPackageOverrideInput = z.object({\n /**\n * The package name to override.\n */\n packageName: z.string(),\n\n /**\n * The import path to add for the package.\n */\n importPath: z.string(),\n\n /**\n * The version of the package to override.\n */\n version: z.string().optional(),\n\n /**\n * URL that issued the import.\n */\n issuerUrl: z.string().optional(),\n});\nexport type AddPackageOverrideInput = z.infer<typeof ZodAddPackageOverrideInput>;\n\n/**\n * Adds an override to the Cloudpack config.\n */\nexport async function addPackageOverride(\n params: ApiParams<AddPackageOverrideInput, 'session' | 'bus' | 'packages' | 'taskRunner'>,\n): Promise<boolean> {\n const { input, ctx } = params;\n const { session, bus, packages, taskRunner } = ctx;\n\n const { addedOverride, entry } = await addOverride(input, { session, packages });\n if (entry) {\n taskRunner.remove(entry.path);\n session.incrementTargetVersion(entry.path);\n notifyReload({ bus, session });\n }\n return addedOverride;\n}\n\naddPackageOverride.procedure = publicProcedure.input(ZodAddPackageOverrideInput).mutation(addPackageOverride);\n"]}
1
+ {"version":3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,iBAAiB,EAAE,IAAI;SACxB,CAAC,CAAC;QACH,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;QAC/C,2DAA2D;QAC3D,IAAI,SAAS,IAAI,YAAY,EAAE,CAAC;YAC9B,gBAAgB,CACd;gBACE,WAAW,EAAE,KAAK,CAAC,IAAI;gBACvB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,IAAI;aACL,EACD,EAAE,GAAG,GAAG,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,EAAE,CAC1D,CAAC;QACJ,CAAC;QACD,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9B,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,uEAAuE;QACvE,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;QAClC,YAAY,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,kBAAkB,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport { addOverride } from '../utilities/addOverride.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { errorEntrySource } from '../data/busSources.js';\nimport { addImportMapHash } from '@ms-cloudpack/import-map';\n\nconst ZodAddPackageOverrideInput = z.object({\n /**\n * The package name to override.\n */\n packageName: z.string(),\n\n /**\n * The import path to add for the package.\n */\n importPath: z.string(),\n\n /**\n * The version of the package to override.\n */\n version: z.string().optional(),\n\n /**\n * URL that issued the import.\n */\n issuerUrl: z.string().optional(),\n});\nexport type AddPackageOverrideInput = z.infer<typeof ZodAddPackageOverrideInput>;\n\n/**\n * Adds an override to the Cloudpack config.\n */\nexport async function addPackageOverride(\n params: ApiParams<\n AddPackageOverrideInput,\n 'bus' | 'watcher' | 'taskRunner' | 'packages' | 'session' | 'packageImportPaths' | 'packageHashes'\n >,\n): Promise<boolean> {\n const { input, ctx } = params;\n const { session, bus, packages, taskRunner, packageHashes } = ctx;\n const { addedOverride, entry } = await addOverride(input, { session, packages });\n if (entry && addedOverride) {\n const hash = await packageHashes.get({\n packagePath: entry.path,\n isSourceHashingEnabled: !entry.isExternal,\n shouldRecalculate: true,\n });\n const importMap = session.importMap;\n const bundleServer = session.urls.bundleServer;\n // We need to change the import map hash to force a reload.\n if (importMap && bundleServer) {\n addImportMapHash(\n {\n packageName: entry.name,\n version: entry.version,\n hash,\n },\n { ...ctx, ...session, importMap, urls: { bundleServer } },\n );\n }\n taskRunner.remove(entry.path);\n session.incrementTargetVersion(entry.path);\n // We can clear the error message now that the override has been added.\n bus.publish(errorEntrySource, '');\n notifyReload({ bus, session });\n }\n return addedOverride;\n}\n\naddPackageOverride.procedure = publicProcedure.input(ZodAddPackageOverrideInput).mutation(addPackageOverride);\n"]}
@@ -3,6 +3,7 @@ export { addPackageOverride } from './addPackageOverride.js';
3
3
  export { ensurePackageBundled } from './ensurePackageBundled.js';
4
4
  export { getData } from './getData.js';
5
5
  export { getSessionId } from './getSessionId.js';
6
+ export { linkPath } from './linkPath.js';
6
7
  export { onDataChanged } from './onDataChanged.js';
7
8
  export { openCodeEditor } from './openCodeEditor.js';
8
9
  export { openConfigEditor } from './openConfigEditor.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,kBAA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O,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
package/lib/apis/index.js CHANGED
@@ -2,6 +2,7 @@ export { addPackageOverride } from './addPackageOverride.js';
2
2
  export { ensurePackageBundled } from './ensurePackageBundled.js';
3
3
  export { getData } from './getData.js';
4
4
  export { getSessionId } from './getSessionId.js';
5
+ export { linkPath } from './linkPath.js';
5
6
  export { onDataChanged } from './onDataChanged.js';
6
7
  export { openCodeEditor } from './openCodeEditor.js';
7
8
  export { openConfigEditor } from './openConfigEditor.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export type {\n EnsurePackageBundledInput,\n EnsurePackageBundledOutput,\n EnsurePackageBundledContext,\n EnsurePackageBundledResult,\n} from './ensurePackageBundled.js';\n\nexport { addPackageOverride } from './addPackageOverride.js';\nexport { ensurePackageBundled } from './ensurePackageBundled.js';\nexport { getData } from './getData.js';\nexport { getSessionId } from './getSessionId.js';\nexport { onDataChanged } from './onDataChanged.js';\nexport { openCodeEditor } from './openCodeEditor.js';\nexport { openConfigEditor } from './openConfigEditor.js';\nexport { openFilePath } from './openFilePath.js';\nexport { reportMetric } from './reportMetric.js';\nexport { syncDownload } from './syncDownload.js';\nexport { syncUpload } from './syncUpload.js';\nexport { validatePackageOverride } from './validatePackageOverride.js';\nexport { restartAllTasks } from './restartAllTasks.js';\nexport { restartTask } from './restartTask.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export type {\n EnsurePackageBundledInput,\n EnsurePackageBundledOutput,\n EnsurePackageBundledContext,\n EnsurePackageBundledResult,\n} from './ensurePackageBundled.js';\n\nexport { addPackageOverride } from './addPackageOverride.js';\nexport { ensurePackageBundled } from './ensurePackageBundled.js';\nexport { getData } from './getData.js';\nexport { getSessionId } from './getSessionId.js';\nexport { linkPath } from './linkPath.js';\nexport { onDataChanged } from './onDataChanged.js';\nexport { openCodeEditor } from './openCodeEditor.js';\nexport { openConfigEditor } from './openConfigEditor.js';\nexport { openFilePath } from './openFilePath.js';\nexport { reportMetric } from './reportMetric.js';\nexport { syncDownload } from './syncDownload.js';\nexport { syncUpload } from './syncUpload.js';\nexport { validatePackageOverride } from './validatePackageOverride.js';\nexport { restartAllTasks } from './restartAllTasks.js';\nexport { restartTask } from './restartTask.js';\n"]}
@@ -0,0 +1,61 @@
1
+ import { z } from 'zod';
2
+ import type { ApiParams } from '../types/ApiParams.js';
3
+ import { type LinkedPath, type ResolveMapEntry } from '@ms-cloudpack/package-utilities';
4
+ declare const ZodLinkPathInput: z.ZodObject<{
5
+ linkedPath: z.ZodObject<{
6
+ path: z.ZodType<string, z.ZodTypeDef, string>;
7
+ rootPath: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
8
+ includeAll: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
9
+ ignoredPackages: z.ZodType<string[] | undefined, z.ZodTypeDef, string[] | undefined>;
10
+ }, "strict", z.ZodTypeAny, LinkedPath, LinkedPath>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ linkedPath: LinkedPath;
13
+ }, {
14
+ linkedPath: LinkedPath;
15
+ }>;
16
+ export type LinkPathInput = z.infer<typeof ZodLinkPathInput>;
17
+ declare const ZodLinkPathOutput: z.ZodObject<{
18
+ resolveMap: z.ZodRecord<z.ZodString, z.ZodType<ResolveMapEntry, z.ZodTypeDef, ResolveMapEntry>>;
19
+ linkedPaths: z.ZodArray<z.ZodObject<{
20
+ path: z.ZodType<string, z.ZodTypeDef, string>;
21
+ rootPath: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
22
+ includeAll: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
23
+ ignoredPackages: z.ZodType<string[] | undefined, z.ZodTypeDef, string[] | undefined>;
24
+ }, "strict", z.ZodTypeAny, LinkedPath, LinkedPath>, "many">;
25
+ }, "strip", z.ZodTypeAny, {
26
+ resolveMap: Record<string, ResolveMapEntry>;
27
+ linkedPaths: LinkedPath[];
28
+ }, {
29
+ resolveMap: Record<string, ResolveMapEntry>;
30
+ linkedPaths: LinkedPath[];
31
+ }>;
32
+ export type LinkPathOutput = z.infer<typeof ZodLinkPathOutput>;
33
+ export declare function linkPath(params: ApiParams<LinkPathInput, 'session' | 'packages' | 'reporter' | 'bus'>): Promise<LinkPathOutput>;
34
+ export declare namespace linkPath {
35
+ var procedure: import("@trpc/server").BuildProcedure<"query", {
36
+ _config: import("@trpc/server").RootConfig<{
37
+ ctx: import("../index.js").Context;
38
+ meta: object;
39
+ errorShape: import("@trpc/server").DefaultErrorShape;
40
+ transformer: import("@trpc/server").DefaultDataTransformer;
41
+ }>;
42
+ _meta: object;
43
+ _ctx_out: import("../index.js").Context;
44
+ _input_in: {
45
+ linkedPath: LinkedPath;
46
+ };
47
+ _input_out: {
48
+ linkedPath: LinkedPath;
49
+ };
50
+ _output_in: {
51
+ resolveMap: Record<string, ResolveMapEntry>;
52
+ linkedPaths: LinkedPath[];
53
+ };
54
+ _output_out: {
55
+ resolveMap: Record<string, ResolveMapEntry>;
56
+ linkedPaths: LinkedPath[];
57
+ };
58
+ }, unknown>;
59
+ }
60
+ export {};
61
+ //# sourceMappingURL=linkPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkPath.d.ts","sourceRoot":"","sources":["../../src/apis/linkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAkB,MAAM,KAAK,CAAC;AAExC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AASxF,QAAA,MAAM,gBAAgB;;;;;;;;;;;EAA0C,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAiB7D,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;EAGrB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE/D,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,SAAS,CAAC,aAAa,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,KAAK,CAAC,GAC5E,OAAO,CAAC,cAAc,CAAC,CAkBzB;yBApBqB,QAAQ"}
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ import { publicProcedure } from '../trpc/common.js';
3
+ import { matchingZodObject } from '../utilities/matchingZodObject.js';
4
+ import { notifyReload } from '../utilities/notifyReload.js';
5
+ const ZodLinkedPath = matchingZodObject({
6
+ path: z.string(),
7
+ rootPath: z.string().optional(),
8
+ includeAll: z.boolean().optional(),
9
+ ignoredPackages: z.string().array().optional(),
10
+ });
11
+ const ZodLinkPathInput = z.object({ linkedPath: ZodLinkedPath });
12
+ const ZodResolveMapEntry = z.lazy(() => matchingZodObject({
13
+ name: z.string(),
14
+ version: z.string(),
15
+ path: z.string(),
16
+ dependencies: z.record(z.string()),
17
+ requiredBy: z.record(z.string()),
18
+ isExternal: z.boolean().optional(),
19
+ isLinked: z.boolean().optional(),
20
+ scopedVersions: z.record(z.lazy(() => ZodResolveMapEntry)).optional(),
21
+ }));
22
+ const ZodResolveMap = z.record(z.string(), ZodResolveMapEntry);
23
+ const ZodLinkPathOutput = z.object({
24
+ resolveMap: ZodResolveMap,
25
+ linkedPaths: z.array(ZodLinkedPath),
26
+ });
27
+ export async function linkPath(params) {
28
+ const { input, ctx } = params;
29
+ const { linkedPath } = input;
30
+ const { session, reporter, bus } = ctx;
31
+ let result = { resolveMap: session.resolveMap, linkedPaths: session.linkedPaths };
32
+ const task = reporter.addTask(`Linking paths in ${session.projectName}`);
33
+ try {
34
+ // Add linked paths to session
35
+ result = await session.addLinkedPath(linkedPath);
36
+ task.complete({ status: 'complete', message: `Linked paths`, forceShow: true });
37
+ session.incrementSessionVersion();
38
+ notifyReload({ bus, session });
39
+ }
40
+ catch {
41
+ task.complete({ status: 'fail', message: `Failed to link paths`, forceShow: true });
42
+ }
43
+ return result;
44
+ }
45
+ linkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).query(linkPath);
46
+ //# sourceMappingURL=linkPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkPath.js","sourceRoot":"","sources":["../../src/apis/linkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAkB,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,MAAM,aAAa,GAAG,iBAAiB,CAAa;IAClD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EA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E,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,GAAG,GAAG,CAAC;IAEvC,IAAI,MAAM,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;IAClF,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,oBAAoB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACzE,IAAI,CAAC;QACH,8BAA8B;QAC9B,MAAM,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChF,OAAO,CAAC,uBAAuB,EAAE,CAAC;QAClC,YAAY,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,QAAQ,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import { z, type ZodSchema } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport { type LinkedPath, type ResolveMapEntry } from '@ms-cloudpack/package-utilities';\n\nconst ZodLinkedPath = matchingZodObject<LinkedPath>({\n path: z.string(),\n rootPath: z.string().optional(),\n includeAll: z.boolean().optional(),\n ignoredPackages: z.string().array().optional(),\n});\n\nconst ZodLinkPathInput = z.object({ linkedPath: ZodLinkedPath });\n\nexport type LinkPathInput = z.infer<typeof ZodLinkPathInput>;\n\nconst ZodResolveMapEntry: ZodSchema<ResolveMapEntry> = z.lazy(() =>\n matchingZodObject<ResolveMapEntry>({\n name: z.string(),\n version: z.string(),\n path: z.string(),\n dependencies: z.record(z.string()),\n requiredBy: z.record(z.string()),\n isExternal: z.boolean().optional(),\n isLinked: z.boolean().optional(),\n scopedVersions: z.record(z.lazy(() => ZodResolveMapEntry)).optional(),\n }),\n);\n\nconst ZodResolveMap = z.record(z.string(), ZodResolveMapEntry);\n\nconst ZodLinkPathOutput = z.object({\n resolveMap: ZodResolveMap,\n linkedPaths: z.array(ZodLinkedPath),\n});\n\nexport type LinkPathOutput = z.infer<typeof ZodLinkPathOutput>;\n\nexport async function linkPath(\n params: ApiParams<LinkPathInput, 'session' | 'packages' | 'reporter' | 'bus'>,\n): Promise<LinkPathOutput> {\n const { input, ctx } = params;\n const { linkedPath } = input;\n const { session, reporter, bus } = ctx;\n\n let result = { resolveMap: session.resolveMap, linkedPaths: session.linkedPaths };\n const task = reporter.addTask(`Linking paths in ${session.projectName}`);\n try {\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 notifyReload({ bus, session });\n } catch {\n task.complete({ status: 'fail', message: `Failed to link paths`, forceShow: true });\n }\n\n return result;\n}\n\nlinkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).query(linkPath);\n"]}
@@ -22,7 +22,7 @@ declare const ZodValidatePackageOverrideOutput: z.ZodObject<{
22
22
  fixable: boolean;
23
23
  }>;
24
24
  export type ValidatePackageOverrideOutput = z.infer<typeof ZodValidatePackageOverrideOutput>;
25
- export declare function validatePackageOverride(params: ApiParams<ValidatePackageOverrideInput, 'session' | 'packages'>): Promise<ValidatePackageOverrideOutput>;
25
+ export declare function validatePackageOverride(params: ApiParams<ValidatePackageOverrideInput, 'session' | 'packages' | 'bus'>): Promise<ValidatePackageOverrideOutput>;
26
26
  export declare namespace validatePackageOverride {
27
27
  var procedure: import("@trpc/server").BuildProcedure<"query", {
28
28
  _config: import("@trpc/server").RootConfig<{
@@ -1 +1 @@
1
- {"version":3,"file":"validatePackageOverride.d.ts","sourceRoot":"","sources":["../../src/apis/validatePackageOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,QAAA,MAAM,+BAA+B;;;;;;;;;;;;EAInC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAE3F,QAAA,MAAM,gCAAgC;;;;;;EAEpC,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE7F,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,SAAS,CAAC,4BAA4B,EAAE,SAAS,GAAG,UAAU,CAAC,GACtE,OAAO,CAAC,6BAA6B,CAAC,CAMxC;yBARqB,uBAAuB"}
1
+ {"version":3,"file":"validatePackageOverride.d.ts","sourceRoot":"","sources":["../../src/apis/validatePackageOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,QAAA,MAAM,+BAA+B;;;;;;;;;;;;EAInC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAE3F,QAAA,MAAM,gCAAgC;;;;;;EAEpC,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE7F,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,SAAS,CAAC,4BAA4B,EAAE,SAAS,GAAG,UAAU,GAAG,KAAK,CAAC,GAC9E,OAAO,CAAC,6BAA6B,CAAC,CAQxC;yBAVqB,uBAAuB"}
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { publicProcedure } from '../trpc/common.js';
3
3
  import { validateOverride } from '../utilities/validateOverride.js';
4
+ import { errorEntrySource } from '../index.browser.js';
4
5
  const ZodValidatePackageOverrideInput = z.object({
5
6
  packageName: z.string(),
6
7
  importPath: z.string(),
@@ -11,6 +12,8 @@ const ZodValidatePackageOverrideOutput = z.object({
11
12
  });
12
13
  export async function validatePackageOverride(params) {
13
14
  const { input, ctx } = params;
15
+ // We need to publish an empty string to the errorEntrySource as the error has been received on the overlay.
16
+ ctx.bus.publish(errorEntrySource, '');
14
17
  return {
15
18
  fixable: await validateOverride(input, ctx),
16
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"validatePackageOverride.js","sourceRoot":"","sources":["../../src/apis/validatePackageOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAGH,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC;AAGH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAAuE;IAEvE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAE9B,OAAO;QACL,OAAO,EAAE,MAAM,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC;KAC5C,CAAC;AACJ,CAAC;AAED,uBAAuB,CAAC,SAAS,GAAG,eAAe;KAChD,KAAK,CAAC,+BAA+B,CAAC;KACtC,MAAM,CAAC,gCAAgC,CAAC;KACxC,KAAK,CAAC,uBAAuB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport { validateOverride } from '../utilities/validateOverride.js';\nimport type { ApiParams } from '../types/ApiParams.js';\n\nconst ZodValidatePackageOverrideInput = z.object({\n packageName: z.string(),\n importPath: z.string(),\n issuerUrl: z.string().optional(),\n});\nexport type ValidatePackageOverrideInput = z.infer<typeof ZodValidatePackageOverrideInput>;\n\nconst ZodValidatePackageOverrideOutput = z.object({\n fixable: z.boolean(),\n});\nexport type ValidatePackageOverrideOutput = z.infer<typeof ZodValidatePackageOverrideOutput>;\n\nexport async function validatePackageOverride(\n params: ApiParams<ValidatePackageOverrideInput, 'session' | 'packages'>,\n): Promise<ValidatePackageOverrideOutput> {\n const { input, ctx } = params;\n\n return {\n fixable: await validateOverride(input, ctx),\n };\n}\n\nvalidatePackageOverride.procedure = publicProcedure\n .input(ZodValidatePackageOverrideInput)\n .output(ZodValidatePackageOverrideOutput)\n .query(validatePackageOverride);\n"]}
1
+ {"version":3,"file":"validatePackageOverride.js","sourceRoot":"","sources":["../../src/apis/validatePackageOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAGH,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC;AAGH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAA+E;IAE/E,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC9B,4GAA4G;IAC5G,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAEtC,OAAO;QACL,OAAO,EAAE,MAAM,gBAAgB,CAAC,KAAK,EAAE,GAAG,CAAC;KAC5C,CAAC;AACJ,CAAC;AAED,uBAAuB,CAAC,SAAS,GAAG,eAAe;KAChD,KAAK,CAAC,+BAA+B,CAAC;KACtC,MAAM,CAAC,gCAAgC,CAAC;KACxC,KAAK,CAAC,uBAAuB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport { validateOverride } from '../utilities/validateOverride.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { errorEntrySource } from '../index.browser.js';\n\nconst ZodValidatePackageOverrideInput = z.object({\n packageName: z.string(),\n importPath: z.string(),\n issuerUrl: z.string().optional(),\n});\nexport type ValidatePackageOverrideInput = z.infer<typeof ZodValidatePackageOverrideInput>;\n\nconst ZodValidatePackageOverrideOutput = z.object({\n fixable: z.boolean(),\n});\nexport type ValidatePackageOverrideOutput = z.infer<typeof ZodValidatePackageOverrideOutput>;\n\nexport async function validatePackageOverride(\n params: ApiParams<ValidatePackageOverrideInput, 'session' | 'packages' | 'bus'>,\n): Promise<ValidatePackageOverrideOutput> {\n const { input, ctx } = params;\n // We need to publish an empty string to the errorEntrySource as the error has been received on the overlay.\n ctx.bus.publish(errorEntrySource, '');\n\n return {\n fixable: await validateOverride(input, ctx),\n };\n}\n\nvalidatePackageOverride.procedure = publicProcedure\n .input(ZodValidatePackageOverrideInput)\n .output(ZodValidatePackageOverrideOutput)\n .query(validatePackageOverride);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAMlE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AASnD,wBAAsB,aAAa,CACjC,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;CACzB,EACD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,CAAC,GAC9C,OAAO,CAAC,OAAO,CAAC,CA+DlB"}
1
+ {"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAOlE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AASnD,wBAAsB,aAAa,CACjC,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;CACzB,EACD,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,CAAC,GAC9C,OAAO,CAAC,OAAO,CAAC,CAmFlB"}
@@ -19,6 +19,7 @@ export async function createSession(options, context) {
19
19
  if (!previousVersions) {
20
20
  await writeJson(versionsPath, versions);
21
21
  }
22
+ const linkedPaths = [];
22
23
  return {
23
24
  id,
24
25
  appPath,
@@ -59,6 +60,19 @@ export async function createSession(options, context) {
59
60
  set importMap(newImportMap) {
60
61
  importMap = newImportMap;
61
62
  },
63
+ linkedPaths,
64
+ addLinkedPath: async (linkedPath) => {
65
+ if (linkedPaths.find((p) => p.path === linkedPath.path)) {
66
+ return { resolveMap: resolveMap, linkedPaths: linkedPaths };
67
+ }
68
+ linkedPaths.push(linkedPath);
69
+ resolveMap = await resolveDependenciesTask({
70
+ appPath,
71
+ additionalPaths: overlayPath ? [overlayPath] : [],
72
+ linkedPaths,
73
+ }, context);
74
+ return { resolveMap, linkedPaths };
75
+ },
62
76
  };
63
77
  }
64
78
  //# sourceMappingURL=createSession.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createSession.js","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAOlF,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAIC,EACD,OAA+C;IAE/C,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEjD,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CA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CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC;QACD,sBAAsB,EAAE,CAAC,SAAiB,EAAE,EAAE;YAC5C,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YACzC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC;YACrC,SAAS,GAAG,SAAS,CAAC;YACtB,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,SAAS;YACX,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,SAAS,CAAC,YAAY;YACxB,SAAS,GAAG,YAAY,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { CloudpackConfig } from '@ms-cloudpack/common-types';\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 { v4 as uuid } from 'uuid';\nimport type { Context } from '../types/Context.js';\nimport type { Session } from '../types/Session.js';\nimport { getLocalCachePath } from '../utilities/getCachePath.js';\nimport { resolveDependenciesTask } from '../utilities/resolveDependenciesTask.js';\n\ntype Versions = {\n sessionVersion: number;\n targetVersions: Record<string, number>;\n};\n\nexport async function createSession(\n options: {\n appPath: string;\n overlayPath?: string;\n config: CloudpackConfig;\n },\n context: Pick<Context, 'reporter' | 'packages'>,\n): Promise<Session> {\n const { appPath, config, overlayPath } = options;\n\n const projectName = path.basename(appPath);\n const id = uuid();\n let resolveMap = await resolveDependenciesTask(\n {\n appPath,\n additionalPaths: overlayPath ? [overlayPath] : [],\n },\n context,\n );\n\n let importMap: ImportMap | undefined = undefined;\n\n const versionsPath = path.join(getLocalCachePath(appPath), 'sessionVersions.json');\n const previousVersions = await readJson<Versions>(versionsPath);\n const versions = previousVersions || { sessionVersion: 0, targetVersions: {} };\n if (!previousVersions) {\n await writeJson(versionsPath, versions);\n }\n\n return {\n id,\n appPath,\n config,\n projectName,\n type: 'web-app',\n mode: 'library',\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 };\n}\n"]}
1
+ {"version":3,"file":"createSession.js","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElF,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAOlF,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,OAIC,EACD,OAA+C;IAE/C,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEjD,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;IAClB,IAAI,UAAU,GAAG,MAAM,uBAAuB,CAC5C;Q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AAC;QACpE,CAAC;QACD,sBAAsB,EAAE,CAAC,SAAiB,EAAE,EAAE;YAC5C,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YACzC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC;YACrC,SAAS,GAAG,SAAS,CAAC;YACtB,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,SAAS;YACX,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,SAAS,CAAC,YAAY;YACxB,SAAS,GAAG,YAAY,CAAC;QAC3B,CAAC;QACD,WAAW;QACX,aAAa,EAAE,KAAK,EAAE,UAAsB,EAAE,EAAE;YAC9C,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;YAC9D,CAAC;YAED,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC7B,UAAU,GAAG,MAAM,uBAAuB,CACxC;gBACE,OAAO;gBACP,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE;gBACjD,WAAW;aACZ,EACD,OAAO,CACR,CAAC;YAEF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;QACrC,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { CloudpackConfig } from '@ms-cloudpack/common-types';\nimport type { ImportMap } from '@ms-cloudpack/import-map';\nimport { readJson, writeJson, writeJsonSync } from '@ms-cloudpack/json-utilities';\nimport type { LinkedPath } from '@ms-cloudpack/package-utilities';\nimport fs from 'fs';\nimport path from 'path';\nimport { v4 as uuid } from 'uuid';\nimport type { Context } from '../types/Context.js';\nimport type { Session } from '../types/Session.js';\nimport { getLocalCachePath } from '../utilities/getCachePath.js';\nimport { resolveDependenciesTask } from '../utilities/resolveDependenciesTask.js';\n\ntype Versions = {\n sessionVersion: number;\n targetVersions: Record<string, number>;\n};\n\nexport async function createSession(\n options: {\n appPath: string;\n overlayPath?: string;\n config: CloudpackConfig;\n },\n context: Pick<Context, 'reporter' | 'packages'>,\n): Promise<Session> {\n const { appPath, config, overlayPath } = options;\n\n const projectName = path.basename(appPath);\n const id = uuid();\n let resolveMap = await resolveDependenciesTask(\n {\n appPath,\n additionalPaths: overlayPath ? [overlayPath] : [],\n },\n context,\n );\n\n let importMap: ImportMap | undefined = undefined;\n\n const versionsPath = path.join(getLocalCachePath(appPath), 'sessionVersions.json');\n const previousVersions = await readJson<Versions>(versionsPath);\n const versions = previousVersions || { sessionVersion: 0, targetVersions: {} };\n if (!previousVersions) {\n await writeJson(versionsPath, versions);\n }\n\n const linkedPaths: LinkedPath[] = [];\n\n return {\n id,\n appPath,\n config,\n projectName,\n type: 'web-app',\n mode: 'library',\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 linkedPaths,\n addLinkedPath: async (linkedPath: LinkedPath) => {\n if (linkedPaths.find((p) => p.path === linkedPath.path)) {\n return { resolveMap: resolveMap, linkedPaths: linkedPaths };\n }\n\n linkedPaths.push(linkedPath);\n resolveMap = await resolveDependenciesTask(\n {\n appPath,\n additionalPaths: overlayPath ? [overlayPath] : [],\n linkedPaths,\n },\n context,\n );\n\n return { resolveMap, linkedPaths };\n },\n };\n}\n"]}
@@ -58,6 +58,9 @@ export declare const taskListSource: import("@ms-cloudpack/data-bus").DataBusPat
58
58
  }>, {
59
59
  id: z.ZodString;
60
60
  errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
61
+ /**
62
+ * Used for tracking the reload count.
63
+ */
61
64
  text: z.ZodString;
62
65
  source: z.ZodString;
63
66
  location: z.ZodOptional<z.ZodObject<{
@@ -136,10 +139,10 @@ export declare const taskListSource: import("@ms-cloudpack/data-bus").DataBusPat
136
139
  } | undefined;
137
140
  }[] | undefined;
138
141
  }>, "many">>;
139
- /**
140
- * Used for tracking the reload count.
141
- */
142
142
  warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
143
+ /**
144
+ * Used for tracking the reload count.
145
+ */
143
146
  text: z.ZodString;
144
147
  source: z.ZodString;
145
148
  location: z.ZodOptional<z.ZodObject<{
@@ -420,4 +423,9 @@ export declare const taskListSource: import("@ms-cloudpack/data-bus").DataBusPat
420
423
  lastUpdated?: number | undefined;
421
424
  }[];
422
425
  }>>;
426
+ /**
427
+ * Used for tracking entry errors: `Failed to resolve module specifier "${packageName}@${version}${filePath}".`
428
+ * This is used to display errors in the UI and to notify the user of the error when autoUpdateEntries is enabled.
429
+ */
430
+ export declare const errorEntrySource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodString>;
423
431
  //# 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;AAKpB;;GAEG;AACH,eAAO,MAAM,iBAAiB,2DAG5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;GAG1B,CAAC;AAEH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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoBD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,2DAG3B,CAAC"}
@@ -2,6 +2,7 @@ import z from 'zod';
2
2
  import { ZodTaskStats } from '../types/TaskStats.js';
3
3
  import { ZodTaskList } from '../types/TaskList.js';
4
4
  import { createDataPath } from '@ms-cloudpack/data-bus';
5
+ import { ZodErrorEntry } from '../types/ErrorEntry.js';
5
6
  /**
6
7
  * Used for tracking the reload count.
7
8
  */
@@ -23,4 +24,12 @@ export const taskListSource = createDataPath({
23
24
  path: ['task', 'list'],
24
25
  type: ZodTaskList,
25
26
  });
27
+ /**
28
+ * Used for tracking entry errors: `Failed to resolve module specifier "${packageName}@${version}${filePath}".`
29
+ * This is used to display errors in the UI and to notify the user of the error when autoUpdateEntries is enabled.
30
+ */
31
+ export const errorEntrySource = createDataPath({
32
+ path: ['error', 'entry'],
33
+ type: ZodErrorEntry,
34
+ });
26
35
  //# 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,EAAE,MAAM,wBAAwB,CAAC;AAExD;;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","sourcesContent":["import z from 'zod';\nimport { ZodTaskStats } from '../types/TaskStats.js';\nimport { ZodTaskList } from '../types/TaskList.js';\nimport { createDataPath } from '@ms-cloudpack/data-bus';\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"]}
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,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;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,GAAG,cAAc,CAAC;IAC7C,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,aAAa;CACpB,CAAC,CAAC","sourcesContent":["import z from 'zod';\nimport { ZodTaskStats } from '../types/TaskStats.js';\nimport { ZodTaskList } from '../types/TaskList.js';\nimport { createDataPath } from '@ms-cloudpack/data-bus';\nimport { ZodErrorEntry } from '../types/ErrorEntry.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 = createDataPath({\n path: ['error', 'entry'],\n type: ZodErrorEntry,\n});\n"]}
@@ -1,6 +1,7 @@
1
1
  export type { TaskStats } from './types/TaskStats.js';
2
2
  export type { TaskDescription } from './types/TaskDescription.js';
3
3
  export type { TaskMessage } from './types/TaskMessage.js';
4
+ export type { ErrorEntry } from './types/ErrorEntry.js';
4
5
  export type { TaskList } from './types/TaskList.js';
5
6
  export type { AddPackageOverrideInput } from './apis/addPackageOverride.js';
6
7
  export type { OpenCodeEditorInput } from './apis/openCodeEditor.js';
@@ -8,6 +9,7 @@ export type { OpenFilePathInput } from './apis/openFilePath.js';
8
9
  export type { ReportMetricInput } from './apis/reportMetric.js';
9
10
  export type { ValidatePackageOverrideInput, ValidatePackageOverrideOutput } from './apis/validatePackageOverride.js';
10
11
  export type { RestartTaskInput } from './apis/restartTask.js';
12
+ export type { LinkPathInput } from './apis/linkPath.js';
11
13
  export { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';
12
- export { taskListSource, taskStatsSource, reloadCountSource } from './data/busSources.js';
14
+ export { taskListSource, taskStatsSource, reloadCountSource, errorEntrySource } from './data/busSources.js';
13
15
  //# 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,YAAY,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACrH,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,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,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,YAAY,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACrH,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { createCloudpackClient } from './trpc/createCloudpackClient.js';
2
- export { taskListSource, taskStatsSource, reloadCountSource } from './data/busSources.js';
2
+ export { taskListSource, taskStatsSource, reloadCountSource, errorEntrySource } 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":"AAYA,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,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 type { AddPackageOverrideInput } from './apis/addPackageOverride.js';\nexport type { OpenCodeEditorInput } from './apis/openCodeEditor.js';\nexport type { OpenFilePathInput } from './apis/openFilePath.js';\nexport type { ReportMetricInput } from './apis/reportMetric.js';\nexport type { ValidatePackageOverrideInput, ValidatePackageOverrideOutput } from './apis/validatePackageOverride.js';\nexport type { RestartTaskInput } from './apis/restartTask.js';\n\nexport { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';\n\nexport { taskListSource, taskStatsSource, reloadCountSource } from './data/busSources.js';\n"]}
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,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 { ErrorEntry } from './types/ErrorEntry.js';\nexport type { TaskList } from './types/TaskList.js';\n\nexport type { AddPackageOverrideInput } from './apis/addPackageOverride.js';\nexport type { OpenCodeEditorInput } from './apis/openCodeEditor.js';\nexport type { OpenFilePathInput } from './apis/openFilePath.js';\nexport type { ReportMetricInput } from './apis/reportMetric.js';\nexport type { ValidatePackageOverrideInput, ValidatePackageOverrideOutput } from './apis/validatePackageOverride.js';\nexport type { RestartTaskInput } from './apis/restartTask.js';\nexport type { LinkPathInput } from './apis/linkPath.js';\n\nexport { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';\n\nexport { taskListSource, taskStatsSource, reloadCountSource, errorEntrySource } from './data/busSources.js';\n"]}
package/lib/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export type { TaskEndDescription } from './types/TaskEndDescription.js';
9
9
  export type { TaskMessage } from './types/TaskMessage.js';
10
10
  export type { TaskOptions } from './types/TaskOptions.js';
11
11
  export type { TaskStartDescription } from './types/TaskStartDescription.js';
12
+ export type { ErrorEntry } from './types/ErrorEntry.js';
12
13
  export type { CloudpackServer } from './trpc/createCloudpackServer.js';
13
14
  export type { AddPackageOverrideInput } from './apis/addPackageOverride.js';
14
15
  export type { OpenCodeEditorInput } from './apis/openCodeEditor.js';
@@ -16,12 +17,13 @@ export type { OpenFilePathInput } from './apis/openFilePath.js';
16
17
  export type { ReportMetricInput } from './apis/reportMetric.js';
17
18
  export type { ValidatePackageOverrideInput, ValidatePackageOverrideOutput } from './apis/validatePackageOverride.js';
18
19
  export type { RestartTaskInput } from './apis/restartTask.js';
20
+ export type { LinkPathInput } from './apis/linkPath.js';
19
21
  export type { EnsurePackageBundledContext, EnsurePackageBundledInput, EnsurePackageBundledOutput, EnsurePackageBundledResult, } from './apis/ensurePackageBundled.js';
20
22
  export type { BundleRequest } from './types/BundleRequest.js';
21
23
  export type { BundleTaskOptions } from './types/BundleTaskOptions.js';
22
24
  export type { OverrideOptions } from './types/OverrideOptions.js';
23
25
  export { TaskRunner } from './utilities/TaskRunner.js';
24
- export { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';
26
+ export { reloadCountSource, taskListSource, taskStatsSource, errorEntrySource } from './data/busSources.js';
25
27
  export { createCloudpackClient } from './trpc/createCloudpackClient.js';
26
28
  export { createCloudpackServer } from './trpc/createCloudpackServer.js';
27
29
  export { ZodTaskDescription } from './types/TaskDescription.js';
@@ -34,5 +36,5 @@ export { getSessionPath } from './utilities/getSessionPath.js';
34
36
  export { getConsumedDependencies } from './utilities/getConsumedDependencies.js';
35
37
  export { getConsumedPaths } from './utilities/getConsumedPaths.js';
36
38
  export { createPartialApiContext } from './common/createPartialApiContext.js';
37
- export { addPackageOverride, ensurePackageBundled, getData, getSessionId, onDataChanged, openCodeEditor, openConfigEditor, openFilePath, reportMetric, syncDownload, syncUpload, validatePackageOverride, } from './apis/index.js';
39
+ export { addPackageOverride, ensurePackageBundled, getData, getSessionId, linkPath, onDataChanged, openCodeEditor, openConfigEditor, openFilePath, reportMetric, syncDownload, syncUpload, validatePackageOverride, } from './apis/index.js';
38
40
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,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,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,YAAY,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGvE,YAAY,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AACrH,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,YAAY,EACV,2BAA2B,EAC3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,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAG9E,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,uBAAuB,GACxB,MAAM,iBAAiB,CAAC"}
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { TaskRunner } from './utilities/TaskRunner.js';
2
- export { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';
2
+ export { reloadCountSource, taskListSource, taskStatsSource, errorEntrySource } from './data/busSources.js';
3
3
  export { createCloudpackClient } from './trpc/createCloudpackClient.js';
4
4
  export { createCloudpackServer } from './trpc/createCloudpackServer.js';
5
5
  export { ZodTaskDescription } from './types/TaskDescription.js';
@@ -14,5 +14,5 @@ export { getConsumedPaths } from './utilities/getConsumedPaths.js';
14
14
  // Utilities
15
15
  export { createPartialApiContext } from './common/createPartialApiContext.js';
16
16
  // API methods
17
- export { addPackageOverride, ensurePackageBundled, getData, getSessionId, onDataChanged, openCodeEditor, openConfigEditor, openFilePath, reportMetric, syncDownload, syncUpload, validatePackageOverride, } from './apis/index.js';
17
+ export { addPackageOverride, ensurePackageBundled, getData, getSessionId, linkPath, onDataChanged, openCodeEditor, openConfigEditor, openFilePath, reportMetric, syncDownload, syncUpload, validatePackageOverride, } from './apis/index.js';
18
18
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,YAAY;AACZ,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,cAAc;AACd,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,OAAO,EACP,YAAY,EACZ,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,uBAAuB,GACxB,MAAM,iBAAiB,CAAC","sourcesContent":["export type { ApiServer } from './types/ApiServer.js';\nexport type { Context, PartialContext } from './types/Context.js';\nexport type { BundleInfo } from './types/BundleInfo.js';\nexport type { Session } from './types/Session.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 { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskOptions } from './types/TaskOptions.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\nexport type { CloudpackServer } from './trpc/createCloudpackServer.js';\n\n// API types\nexport type { AddPackageOverrideInput } from './apis/addPackageOverride.js';\nexport type { OpenCodeEditorInput } from './apis/openCodeEditor.js';\nexport type { OpenFilePathInput } from './apis/openFilePath.js';\nexport type { ReportMetricInput } from './apis/reportMetric.js';\nexport type { ValidatePackageOverrideInput, ValidatePackageOverrideOutput } from './apis/validatePackageOverride.js';\nexport type { RestartTaskInput } from './apis/restartTask.js';\n\n// TODO: delete these type exports once API reporting of \"forgotten\" exports is enabled\n// (they're not used and don't really need to be visible in the API)\nexport type {\n EnsurePackageBundledContext,\n EnsurePackageBundledInput,\n EnsurePackageBundledOutput,\n EnsurePackageBundledResult,\n} from './apis/ensurePackageBundled.js';\nexport type { BundleRequest } from './types/BundleRequest.js';\nexport type { BundleTaskOptions } from './types/BundleTaskOptions.js';\nexport type { OverrideOptions } from './types/OverrideOptions.js';\n\nexport { TaskRunner } from './utilities/TaskRunner.js';\nexport { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';\nexport { createCloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer } from './trpc/createCloudpackServer.js';\nexport { ZodTaskDescription } from './types/TaskDescription.js';\nexport { ZodTaskEndDescription } from './types/TaskEndDescription.js';\nexport { ZodTaskMessage } from './types/TaskMessage.js';\nexport { ZodTaskStartDescription } from './types/TaskStartDescription.js';\nexport { getCachePath, getLocalCachePath } from './utilities/getCachePath.js';\nexport { getActiveSessionsPath } from './utilities/getActiveSessionsPath.js';\nexport { getSessionPath } from './utilities/getSessionPath.js';\nexport { getConsumedDependencies } from './utilities/getConsumedDependencies.js';\nexport { getConsumedPaths } from './utilities/getConsumedPaths.js';\n\n// Utilities\nexport { createPartialApiContext } from './common/createPartialApiContext.js';\n\n// API methods\nexport {\n addPackageOverride,\n ensurePackageBundled,\n getData,\n getSessionId,\n onDataChanged,\n openCodeEditor,\n openConfigEditor,\n openFilePath,\n reportMetric,\n syncDownload,\n syncUpload,\n validatePackageOverride,\n} from './apis/index.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC5G,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,YAAY;AACZ,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,cAAc;AACd,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,uBAAuB,GACxB,MAAM,iBAAiB,CAAC","sourcesContent":["export type { ApiServer } from './types/ApiServer.js';\nexport type { Context, PartialContext } from './types/Context.js';\nexport type { BundleInfo } from './types/BundleInfo.js';\nexport type { Session } from './types/Session.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 { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskOptions } from './types/TaskOptions.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\nexport type { ErrorEntry } from './types/ErrorEntry.js';\nexport type { CloudpackServer } from './trpc/createCloudpackServer.js';\n\n// API types\nexport type { AddPackageOverrideInput } from './apis/addPackageOverride.js';\nexport type { OpenCodeEditorInput } from './apis/openCodeEditor.js';\nexport type { OpenFilePathInput } from './apis/openFilePath.js';\nexport type { ReportMetricInput } from './apis/reportMetric.js';\nexport type { ValidatePackageOverrideInput, ValidatePackageOverrideOutput } from './apis/validatePackageOverride.js';\nexport type { RestartTaskInput } from './apis/restartTask.js';\nexport type { LinkPathInput } from './apis/linkPath.js';\n\n// TODO: delete these type exports once API reporting of \"forgotten\" exports is enabled\n// (they're not used and don't really need to be visible in the API)\nexport type {\n EnsurePackageBundledContext,\n EnsurePackageBundledInput,\n EnsurePackageBundledOutput,\n EnsurePackageBundledResult,\n} from './apis/ensurePackageBundled.js';\nexport type { BundleRequest } from './types/BundleRequest.js';\nexport type { BundleTaskOptions } from './types/BundleTaskOptions.js';\nexport type { OverrideOptions } from './types/OverrideOptions.js';\n\nexport { TaskRunner } from './utilities/TaskRunner.js';\nexport { reloadCountSource, taskListSource, taskStatsSource, errorEntrySource } from './data/busSources.js';\nexport { createCloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer } from './trpc/createCloudpackServer.js';\nexport { ZodTaskDescription } from './types/TaskDescription.js';\nexport { ZodTaskEndDescription } from './types/TaskEndDescription.js';\nexport { ZodTaskMessage } from './types/TaskMessage.js';\nexport { ZodTaskStartDescription } from './types/TaskStartDescription.js';\nexport { getCachePath, getLocalCachePath } from './utilities/getCachePath.js';\nexport { getActiveSessionsPath } from './utilities/getActiveSessionsPath.js';\nexport { getSessionPath } from './utilities/getSessionPath.js';\nexport { getConsumedDependencies } from './utilities/getConsumedDependencies.js';\nexport { getConsumedPaths } from './utilities/getConsumedPaths.js';\n\n// Utilities\nexport { createPartialApiContext } from './common/createPartialApiContext.js';\n\n// API methods\nexport {\n addPackageOverride,\n ensurePackageBundled,\n getData,\n getSessionId,\n linkPath,\n onDataChanged,\n openCodeEditor,\n openConfigEditor,\n openFilePath,\n reportMetric,\n syncDownload,\n syncUpload,\n validatePackageOverride,\n} from './apis/index.js';\n"]}
@@ -77,6 +77,30 @@ export declare function createAppRouter(): {
77
77
  _output_in: string | undefined;
78
78
  _output_out: string | undefined;
79
79
  }, unknown>;
80
+ linkPath: import("@trpc/server").BuildProcedure<"query", {
81
+ _config: import("@trpc/server").RootConfig<{
82
+ ctx: import("../index.js").Context;
83
+ meta: object;
84
+ errorShape: import("@trpc/server").DefaultErrorShape;
85
+ transformer: import("@trpc/server").DefaultDataTransformer;
86
+ }>;
87
+ _meta: object;
88
+ _ctx_out: import("../index.js").Context;
89
+ _input_in: {
90
+ linkedPath: import("@ms-cloudpack/package-utilities").LinkedPath;
91
+ };
92
+ _input_out: {
93
+ linkedPath: import("@ms-cloudpack/package-utilities").LinkedPath;
94
+ };
95
+ _output_in: {
96
+ resolveMap: Record<string, import("@ms-cloudpack/package-utilities").ResolveMapEntry>;
97
+ linkedPaths: import("@ms-cloudpack/package-utilities").LinkedPath[];
98
+ };
99
+ _output_out: {
100
+ resolveMap: Record<string, import("@ms-cloudpack/package-utilities").ResolveMapEntry>;
101
+ linkedPaths: import("@ms-cloudpack/package-utilities").LinkedPath[];
102
+ };
103
+ }, unknown>;
80
104
  onDataChanged: import("@trpc/server").BuildProcedure<"subscription", {
81
105
  _config: import("@trpc/server").RootConfig<{
82
106
  ctx: import("../index.js").Context;
@@ -1 +1 @@
1
- {"version":3,"file":"createAppRouter.d.ts","sourceRoot":"","sources":["../../src/trpc/createAppRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAGzC,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9B;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"createAppRouter.d.ts","sourceRoot":"","sources":["../../src/trpc/createAppRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAGzC,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9B;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC"}
@@ -14,6 +14,12 @@ export declare function createCloudpackServer(context: Context): Promise<{
14
14
  path: string[];
15
15
  }) => any;
16
16
  getSessionId: (options: void) => string | undefined;
17
+ linkPath: (options: {
18
+ linkedPath: import("@ms-cloudpack/package-utilities").LinkedPath;
19
+ }) => Promise<{
20
+ resolveMap: Record<string, import("@ms-cloudpack/package-utilities").ResolveMapEntry>;
21
+ linkedPaths: import("@ms-cloudpack/package-utilities").LinkedPath[];
22
+ }>;
17
23
  onDataChanged: (options: {
18
24
  path: string[];
19
25
  }) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"createCloudpackServer.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyC3D;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"createCloudpackServer.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyC3D;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import z from 'zod';
2
+ export declare const ZodErrorEntry: z.ZodString;
3
+ export type ErrorEntry = z.infer<typeof ZodErrorEntry>;
4
+ //# sourceMappingURL=ErrorEntry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorEntry.d.ts","sourceRoot":"","sources":["../../src/types/ErrorEntry.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,aAAa,aAAa,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import z from 'zod';
2
+ export const ZodErrorEntry = z.string();
3
+ //# sourceMappingURL=ErrorEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorEntry.js","sourceRoot":"","sources":["../../src/types/ErrorEntry.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["import z from 'zod';\n\nexport const ZodErrorEntry = z.string();\n\nexport type ErrorEntry = z.infer<typeof ZodErrorEntry>;\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { ImportMap } from '@ms-cloudpack/import-map';
2
- import type { ResolveMap } from '@ms-cloudpack/package-utilities';
2
+ import type { LinkedPath, ResolveMap } from '@ms-cloudpack/package-utilities';
3
3
  import type { CloudpackConfig } from '@ms-cloudpack/common-types';
4
4
  export interface Session {
5
5
  /**
@@ -69,5 +69,16 @@ export interface Session {
69
69
  * The import map for the session.
70
70
  */
71
71
  importMap: ImportMap | undefined;
72
+ /**
73
+ * Linked paths that are used to resolve packages from other repos.
74
+ */
75
+ linkedPaths: LinkedPath[];
76
+ /**
77
+ * Add the linked path and regenerates the resolve map.
78
+ */
79
+ addLinkedPath: (linkedPath: LinkedPath) => Promise<{
80
+ resolveMap: ResolveMap;
81
+ linkedPaths: LinkedPath[];
82
+ }>;
72
83
  }
73
84
  //# sourceMappingURL=Session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../../src/types/Session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,eAAe,CAAC;IAExB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAE5B;;;;OAIG;IACH,IAAI,EAAE,SAAS,GAAG,aAAa,GAAG,YAAY,CAAC;IAE/C;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,IAAI,EAAE;QACJ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,+FAA+F;QAC/F,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC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AC;IAEpC;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEvC;;OAEG;IACH,sBAAsB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpD;;OAEG;IACH,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACH,WAAW,EAAE,UAAU,EAAE,CAAC;IAE1B;;OAEG;IACH,aAAa,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC;QAAE,UAAU,EAAE,UAAU,CAAC;QAAC,WAAW,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC,CAAC;CAC3G"}
@@ -1 +1 @@
1
- {"version":3,"file":"Session.js","sourceRoot":"","sources":["../../src/types/Session.ts"],"names":[],"mappings":"","sourcesContent":["import type { ImportMap } from '@ms-cloudpack/import-map';\nimport type { ResolveMap } from '@ms-cloudpack/package-utilities';\nimport type { CloudpackConfig } from '@ms-cloudpack/common-types';\n\nexport interface Session {\n /**\n * The session id, used for identifying\n */\n id: string;\n\n /**\n * The config used by the session.\n */\n config: CloudpackConfig;\n\n /**\n * The primary application path to monitor.\n */\n appPath: string;\n\n /**\n * The type of session controls how the code is served via start.\n * Web apps require app server and asset hosting, while libraries only need a bundle service.\n */\n type: 'web-app' | 'library';\n\n /**\n * The mode of the session controls how the code is bundled. Library mode bundles each package\n * in isolation, while development and production modes bundle the full app graph together.\n * Library mode is fastest but packages must be compliant for loading in the browser.\n */\n mode: 'library' | 'development' | 'production';\n\n /**\n * Used to resolve packages in the dependency graph.\n */\n resolveMap: ResolveMap;\n\n /**\n * Reload sequence to ensure that the client is always up to date with the latest changes.\n */\n sequence: number;\n\n /**\n * URLs of the active servers hosting this session.\n * Each URL will only be set after the server is started.\n */\n urls: {\n appServer?: string;\n /** If `useSingleWebServer` is enabled, this will be a URL for bundles under the app server. */\n bundleServer?: string;\n apiServer?: string;\n };\n\n /**\n * Used to force a hard refresh on the client.\n */\n sessionVersion: number;\n\n /**\n * Used to increment the session version by 1.\n */\n incrementSessionVersion: () => void;\n\n /**\n * The name of the project folder.\n * Used to differentiate between multiple projects.\n */\n projectName: string;\n\n /**\n * The version of each target.\n * Used to force a client cache refresh on a single target.\n */\n targetVersions: Record<string, number>;\n\n /**\n * Increments the version for the given target.\n */\n incrementTargetVersion: (inputPath: string) => void;\n\n /**\n * The import map for the session.\n */\n importMap: ImportMap | undefined;\n}\n"]}
1
+ {"version":3,"file":"Session.js","sourceRoot":"","sources":["../../src/types/Session.ts"],"names":[],"mappings":"","sourcesContent":["import type { ImportMap } from '@ms-cloudpack/import-map';\nimport type { LinkedPath, ResolveMap } from '@ms-cloudpack/package-utilities';\nimport type { CloudpackConfig } from '@ms-cloudpack/common-types';\n\nexport interface Session {\n /**\n * The session id, used for identifying\n */\n id: string;\n\n /**\n * The config used by the session.\n */\n config: CloudpackConfig;\n\n /**\n * The primary application path to monitor.\n */\n appPath: string;\n\n /**\n * The type of session controls how the code is served via start.\n * Web apps require app server and asset hosting, while libraries only need a bundle service.\n */\n type: 'web-app' | 'library';\n\n /**\n * The mode of the session controls how the code is bundled. Library mode bundles each package\n * in isolation, while development and production modes bundle the full app graph together.\n * Library mode is fastest but packages must be compliant for loading in the browser.\n */\n mode: 'library' | 'development' | 'production';\n\n /**\n * Used to resolve packages in the dependency graph.\n */\n resolveMap: ResolveMap;\n\n /**\n * Reload sequence to ensure that the client is always up to date with the latest changes.\n */\n sequence: number;\n\n /**\n * URLs of the active servers hosting this session.\n * Each URL will only be set after the server is started.\n */\n urls: {\n appServer?: string;\n /** If `useSingleWebServer` is enabled, this will be a URL for bundles under the app server. */\n bundleServer?: string;\n apiServer?: string;\n };\n\n /**\n * Used to force a hard refresh on the client.\n */\n sessionVersion: number;\n\n /**\n * Used to increment the session version by 1.\n */\n incrementSessionVersion: () => void;\n\n /**\n * The name of the project folder.\n * Used to differentiate between multiple projects.\n */\n projectName: string;\n\n /**\n * The version of each target.\n * Used to force a client cache refresh on a single target.\n */\n targetVersions: Record<string, number>;\n\n /**\n * Increments the version for the given target.\n */\n incrementTargetVersion: (inputPath: string) => void;\n\n /**\n * The import map for the session.\n */\n importMap: ImportMap | undefined;\n\n /**\n * Linked paths that are used to resolve packages from other repos.\n */\n linkedPaths: LinkedPath[];\n\n /**\n * Add the linked path and regenerates the resolve map.\n */\n addLinkedPath: (linkedPath: LinkedPath) => Promise<{ resolveMap: ResolveMap; linkedPaths: LinkedPath[] }>;\n}\n"]}
@@ -1,14 +1,16 @@
1
1
  import { type ResolveMapEntry } from '@ms-cloudpack/package-utilities';
2
2
  import type { Context } from '../types/Context.js';
3
3
  import type { OverrideOptions } from '../types/OverrideOptions.js';
4
+ type OverrideReturn = {
5
+ /** Whether the override was successfully added */
6
+ addedOverride: boolean;
7
+ /** The entry (if any) in the resolve map the override was added to */
8
+ entry: ResolveMapEntry | undefined;
9
+ };
4
10
  /**
5
11
  * The addOverride method is triggered by a user action in the overlay, when we detect new usage of an import path
6
12
  * that isn't recognized. When the user triggers this override, we write it to the cloudpack generated config.
7
13
  */
8
- export declare function addOverride(options: OverrideOptions, context: Pick<Context, 'packages' | 'session'>): Promise<{
9
- /** Whether the override was successfully added */
10
- addedOverride: boolean;
11
- /** The entry (if any) in the resolve map the override was added to */
12
- entry?: ResolveMapEntry;
13
- }>;
14
+ export declare function addOverride(options: OverrideOptions, context: Pick<Context, 'packages' | 'session'>): Promise<OverrideReturn>;
15
+ export {};
14
16
  //# sourceMappingURL=addOverride.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addOverride.d.ts","sourceRoot":"","sources":["../../src/utilities/addOverride.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,CAAC,GAC7C,OAAO,CAAC;IACT,kDAAkD;IAClD,aAAa,EAAE,OAAO,CAAC;IACvB,sEAAsE;IACtE,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,CAAC,CAwHD"}
1
+ {"version":3,"file":"addOverride.d.ts","sourceRoot":"","sources":["../../src/utilities/addOverride.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,KAAK,cAAc,GAAG;IACpB,kDAAkD;IAClD,aAAa,EAAE,OAAO,CAAC;IACvB,sEAAsE;IACtE,KAAK,EAAE,eAAe,GAAG,SAAS,CAAC;CACpC,CAAC;AAaF;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,CAAC,GAC7C,OAAO,CAAC,cAAc,CAAC,CA4HzB"}
@@ -2,97 +2,110 @@ import { checkMatch, readGeneratedConfig, writeGeneratedConfig } from '@ms-cloud
2
2
  import { parseRequestInfo } from '@ms-cloudpack/import-map';
3
3
  import { addExportsMapEntry, findResolveMapEntry, flattenExportsMap, getExportsMap, } from '@ms-cloudpack/package-utilities';
4
4
  import { makeUrl, normalizeRelativePath } from '@ms-cloudpack/path-string-parsing';
5
+ /**
6
+ * Helper so that when addOverride is called multiple times in quick succession, we only process one at a time.
7
+ * This is to avoid that multiple calls of addOverride first read the same version of the generated config,
8
+ * then write the same version of the config with its corresponding update,
9
+ * which would result in the last call overwriting the changes of the previous calls.
10
+ */
11
+ let overrideInProcess = Promise.resolve({
12
+ addedOverride: false,
13
+ entry: undefined,
14
+ });
5
15
  /**
6
16
  * The addOverride method is triggered by a user action in the overlay, when we detect new usage of an import path
7
17
  * that isn't recognized. When the user triggers this override, we write it to the cloudpack generated config.
8
18
  */
9
19
  export async function addOverride(options, context) {
10
- const { packageName, importPath, version, issuerUrl } = options;
11
- const { session, packages } = context;
12
- let addedOverride = false;
13
- let requiredBy = undefined;
14
- if (issuerUrl) {
15
- const { packageName: issuerName, version: issuerVersion } = parseRequestInfo(makeUrl(issuerUrl).pathname);
16
- requiredBy = { name: issuerName, version: issuerVersion };
17
- }
18
- const entry = findResolveMapEntry({
19
- packageName,
20
- resolveMap: session.resolveMap,
21
- definition: requiredBy,
22
- version,
23
- });
24
- if (!entry) {
25
- console.error(`Could not find entry of package "${packageName}" in resolve map`);
26
- return { addedOverride, entry };
27
- }
28
- const packagePath = entry.path;
29
- // Get current exports. We want to add an additional entry to what's there - not replace the default exports,
30
- // so we need the full map for the package.
31
- const exports = await getExportsMap({ packagePath }, { packages, config: session.config });
32
- const flattenedExports = flattenExportsMap(exports);
33
- // Return false if the import path already exists in the exports map.
34
- if (flattenedExports[normalizeRelativePath(importPath)]) {
35
- console.debug(`The import path "${importPath}" already exists in the exports map for "${packageName}".`);
36
- return { addedOverride, entry };
37
- }
38
- const addedExports = {};
39
- // Add the single new exports entry to the exports map.
40
- addedOverride = await addExportsMapEntry({
41
- // This is required as addExportsMapEntry assumes addedExports is a record.
42
- exports: addedExports,
43
- packagePath,
44
- importPath,
45
- }, { packages, config: session.config });
46
- if (!addedOverride) {
47
- console.warn(`Unable to add override for package "${packageName}" to "cloudpack.config.json". The file "${normalizeRelativePath(importPath)}" could not be found. Please check the import path and try again.`);
48
- return { addedOverride, entry };
49
- }
50
- if (Array.isArray(exports)) {
51
- exports.push(addedExports);
52
- }
53
- else {
54
- const definition = await packages.get(packagePath);
55
- if (!definition) {
56
- console.error(`Could not find definition of package "${packageName}" in the cache`);
57
- return { addedOverride, entry };
20
+ overrideInProcess = overrideInProcess.then(async () => {
21
+ const { packageName, importPath, version, issuerUrl } = options;
22
+ const { session, packages } = context;
23
+ let addedOverride = false;
24
+ let requiredBy = undefined;
25
+ if (issuerUrl) {
26
+ const { packageName: issuerName, version: issuerVersion } = parseRequestInfo(makeUrl(issuerUrl).pathname);
27
+ requiredBy = { name: issuerName, version: issuerVersion };
58
28
  }
59
- definition.exports = [exports, addedExports];
60
- }
61
- // Parse the user config if it exists.
62
- const config = await readGeneratedConfig(session.appPath);
63
- // Ensure packageSettings exist.
64
- config.packageSettings ??= [];
65
- const configMatches = config.packageSettings.filter(({ match }) => checkMatch({ name: packageName, version: entry.version, match, exactMatch: true }));
66
- if (!configMatches.length) {
67
- config.packageSettings.push({
68
- match: {
69
- name: packageName,
70
- version: `^${entry.version}`,
71
- },
72
- exports: addedExports,
29
+ const entry = findResolveMapEntry({
30
+ packageName,
31
+ resolveMap: session.resolveMap,
32
+ definition: requiredBy,
33
+ version,
73
34
  });
74
- }
75
- else {
76
- if (configMatches.length > 1) {
77
- console.debug(`Found multiple matches for package "${packageName}" in cloudpack.config.json. Using the first match.`);
35
+ if (!entry) {
36
+ console.error(`Could not find entry of package "${packageName}" in resolve map`);
37
+ return { addedOverride, entry };
78
38
  }
79
- // Use the first match and ensure exports exist
80
- configMatches[0].exports ??= {};
81
- const flattenedMatchExports = flattenExportsMap(configMatches[0].exports);
82
- // Return false if the import path already exists in the match exports map.
83
- if (flattenedMatchExports[normalizeRelativePath(importPath)]) {
84
- console.debug(`The import path "${importPath}" already exists in the config exports map for "${packageName}".`);
85
- return { addedOverride: false, entry };
39
+ const packagePath = entry.path;
40
+ // Get current exports. We want to add an additional entry to what's there - not replace the default exports,
41
+ // so we need the full map for the package.
42
+ const exports = await getExportsMap({ packagePath }, { packages, config: session.config });
43
+ const flattenedExports = flattenExportsMap(exports);
44
+ // Return false if the import path already exists in the exports map.
45
+ if (flattenedExports[normalizeRelativePath(importPath)]) {
46
+ console.debug(`The import path "${importPath}" already exists in the exports map for "${packageName}".`);
47
+ return { addedOverride, entry };
86
48
  }
87
- // Add the single new exports entry to the match exports map.
88
- await addExportsMapEntry({
89
- exports: configMatches[0].exports,
49
+ const addedExports = {};
50
+ // Add the single new exports entry to the exports map.
51
+ addedOverride = await addExportsMapEntry({
52
+ // This is required as addExportsMapEntry assumes addedExports is a record.
53
+ exports: addedExports,
90
54
  packagePath,
91
55
  importPath,
92
56
  }, { packages, config: session.config });
93
- }
94
- await writeGeneratedConfig(config, session.appPath);
95
- console.debug(`Added override for "${packageName}" to "cloudpack.config.json".`);
96
- return { addedOverride, entry };
57
+ if (!addedOverride) {
58
+ console.warn(`Unable to add override for package "${packageName}" to "cloudpack.generated.json". The file "${normalizeRelativePath(importPath)}" could not be found. Please check the import path and try again.`);
59
+ return { addedOverride, entry };
60
+ }
61
+ if (Array.isArray(exports)) {
62
+ exports.push(addedExports);
63
+ }
64
+ else {
65
+ const definition = await packages.get(packagePath);
66
+ if (!definition) {
67
+ console.error(`Could not find definition of package "${packageName}" in the cache`);
68
+ return { addedOverride, entry };
69
+ }
70
+ definition.exports = [exports, addedExports];
71
+ }
72
+ // Parse the user config if it exists.
73
+ const generatedConfig = await readGeneratedConfig(session.appPath);
74
+ // Ensure packageSettings exist.
75
+ generatedConfig.packageSettings ??= [];
76
+ const configMatches = generatedConfig.packageSettings.filter(({ match }) => checkMatch({ name: packageName, version: entry.version, match, exactMatch: true }));
77
+ if (!configMatches.length) {
78
+ generatedConfig.packageSettings.push({
79
+ match: {
80
+ name: packageName,
81
+ version: `^${entry.version}`,
82
+ },
83
+ exports: addedExports,
84
+ });
85
+ }
86
+ else {
87
+ if (configMatches.length > 1) {
88
+ console.debug(`Found multiple matches for package "${packageName}" in cloudpack.generated.json. Using the first match.`);
89
+ }
90
+ // Use the first match and ensure exports exist
91
+ configMatches[0].exports ??= {};
92
+ const flattenedMatchExports = flattenExportsMap(configMatches[0].exports);
93
+ // Return false if the import path already exists in the match exports map.
94
+ if (flattenedMatchExports[normalizeRelativePath(importPath)]) {
95
+ console.debug(`The import path "${importPath}" already exists in the config exports map for "${packageName}".`);
96
+ return { addedOverride: false, entry };
97
+ }
98
+ // Add the single new exports entry to the match exports map.
99
+ await addExportsMapEntry({
100
+ exports: configMatches[0].exports,
101
+ packagePath,
102
+ importPath,
103
+ }, { packages, config: session.config });
104
+ }
105
+ await writeGeneratedConfig(generatedConfig, session.appPath);
106
+ console.log(`Added override for "${packageName}" to "cloudpack.generated.json".`);
107
+ return { addedOverride, entry };
108
+ });
109
+ return overrideInProcess;
97
110
  }
98
111
  //# sourceMappingURL=addOverride.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"addOverride.js","sourceRoot":"","sources":["../../src/utilities/addOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GAEd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAInF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAwB,EACxB,OAA8C;IAO9C,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAChE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACtC,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,IAAI,UAAU,GAAG,SAAS,CAAC;IAE3B,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CA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CAAC,KAAK,CACX,uCAAuC,WAAW,oDAAoD,CACvG,CAAC;QACJ,CAAC;QAED,+CAA+C;QAC/C,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,EAAE,CAAC;QAEhC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAE1E,2EAA2E;QAC3E,IAAI,qBAAqB,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;YAC7D,OAAO,CAAC,KAAK,CAAC,oBAAoB,UAAU,mDAAmD,WAAW,IAAI,CAAC,CAAC;YAChH,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;QACzC,CAAC;QAED,6DAA6D;QAC7D,MAAM,kBAAkB,CACtB;YACE,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO;YACjC,WAAW;YACX,UAAU;SACX,EACD,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CACrC,CAAC;IACJ,CAAC;IAED,MAAM,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACpD,OAAO,CAAC,KAAK,CAAC,uBAAuB,WAAW,+BAA+B,CAAC,CAAC;IAEjF,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;AAClC,CAAC","sourcesContent":["import { checkMatch, readGeneratedConfig, writeGeneratedConfig } from '@ms-cloudpack/config';\nimport { parseRequestInfo } from '@ms-cloudpack/import-map';\nimport {\n addExportsMapEntry,\n findResolveMapEntry,\n flattenExportsMap,\n getExportsMap,\n type ResolveMapEntry,\n} from '@ms-cloudpack/package-utilities';\nimport { makeUrl, normalizeRelativePath } from '@ms-cloudpack/path-string-parsing';\nimport type { Context } from '../types/Context.js';\nimport type { OverrideOptions } from '../types/OverrideOptions.js';\n\n/**\n * The addOverride method is triggered by a user action in the overlay, when we detect new usage of an import path\n * that isn't recognized. When the user triggers this override, we write it to the cloudpack generated config.\n */\nexport async function addOverride(\n options: OverrideOptions,\n context: Pick<Context, 'packages' | 'session'>,\n): Promise<{\n /** Whether the override was successfully added */\n addedOverride: boolean;\n /** The entry (if any) in the resolve map the override was added to */\n entry?: ResolveMapEntry;\n}> {\n const { packageName, importPath, version, issuerUrl } = options;\n const { session, packages } = context;\n let addedOverride = false;\n let requiredBy = undefined;\n\n if (issuerUrl) {\n const { packageName: issuerName, version: issuerVersion } = parseRequestInfo(makeUrl(issuerUrl).pathname);\n requiredBy = { name: issuerName, version: issuerVersion };\n }\n\n const entry = findResolveMapEntry({\n packageName,\n resolveMap: session.resolveMap,\n definition: requiredBy,\n version,\n });\n\n if (!entry) {\n console.error(`Could not find entry of package \"${packageName}\" in resolve map`);\n return { addedOverride, entry };\n }\n\n const packagePath = entry.path;\n\n // Get current exports. We want to add an additional entry to what's there - not replace the default exports,\n // so we need the full map for the package.\n const exports = await getExportsMap({ packagePath }, { packages, config: session.config });\n const flattenedExports = flattenExportsMap(exports);\n\n // Return false if the import path already exists in the exports map.\n if (flattenedExports[normalizeRelativePath(importPath)]) {\n console.debug(`The import path \"${importPath}\" already exists in the exports map for \"${packageName}\".`);\n return { addedOverride, entry };\n }\n\n const addedExports = {};\n\n // Add the single new exports entry to the exports map.\n addedOverride = await addExportsMapEntry(\n {\n // This is required as addExportsMapEntry assumes addedExports is a record.\n exports: addedExports,\n packagePath,\n importPath,\n },\n { packages, config: session.config },\n );\n\n if (!addedOverride) {\n console.warn(\n `Unable to add override for package \"${packageName}\" to \"cloudpack.config.json\". The file \"${normalizeRelativePath(\n importPath,\n )}\" could not be found. Please check the import path and try again.`,\n );\n return { addedOverride, entry };\n }\n\n if (Array.isArray(exports)) {\n exports.push(addedExports);\n } else {\n const definition = await packages.get(packagePath);\n if (!definition) {\n console.error(`Could not find definition of package \"${packageName}\" in the cache`);\n return { addedOverride, entry };\n }\n definition.exports = [exports, addedExports];\n }\n\n // Parse the user config if it exists.\n const config = await readGeneratedConfig(session.appPath);\n\n // Ensure packageSettings exist.\n config.packageSettings ??= [];\n\n const configMatches = config.packageSettings.filter(({ match }) =>\n checkMatch({ name: packageName, version: entry.version, match, exactMatch: true }),\n );\n\n if (!configMatches.length) {\n config.packageSettings.push({\n match: {\n name: packageName,\n version: `^${entry.version}`,\n },\n exports: addedExports,\n });\n } else {\n if (configMatches.length > 1) {\n console.debug(\n `Found multiple matches for package \"${packageName}\" in cloudpack.config.json. Using the first match.`,\n );\n }\n\n // Use the first match and ensure exports exist\n configMatches[0].exports ??= {};\n\n const flattenedMatchExports = flattenExportsMap(configMatches[0].exports);\n\n // Return false if the import path already exists in the match exports map.\n if (flattenedMatchExports[normalizeRelativePath(importPath)]) {\n console.debug(`The import path \"${importPath}\" already exists in the config exports map for \"${packageName}\".`);\n return { addedOverride: false, entry };\n }\n\n // Add the single new exports entry to the match exports map.\n await addExportsMapEntry(\n {\n exports: configMatches[0].exports,\n packagePath,\n importPath,\n },\n { packages, config: session.config },\n );\n }\n\n await writeGeneratedConfig(config, session.appPath);\n console.debug(`Added override for \"${packageName}\" to \"cloudpack.config.json\".`);\n\n return { addedOverride, entry };\n}\n"]}
1
+ {"version":3,"file":"addOverride.js","sourceRoot":"","sources":["../../src/utilities/addOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GAEd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAWnF;;;;;GAKG;AACH,IAAI,iBAAiB,GAA4B,OAAO,CAAC,OAAO,CAAC;IAC/D,aAAa,EAAE,KAAK;IACpB,KAAK,EAAE,SAAS;CACjB,CAAC,CAAC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AAe,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7D,OAAO,CAAC,GAAG,CAAC,uBAAuB,WAAW,kCAAkC,CAAC,CAAC;QAElF,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,OAAO,iBAAiB,CAAC;AAC3B,CAAC","sourcesContent":["import { checkMatch, readGeneratedConfig, writeGeneratedConfig } from '@ms-cloudpack/config';\nimport { parseRequestInfo } from '@ms-cloudpack/import-map';\nimport {\n addExportsMapEntry,\n findResolveMapEntry,\n flattenExportsMap,\n getExportsMap,\n type ResolveMapEntry,\n} from '@ms-cloudpack/package-utilities';\nimport { makeUrl, normalizeRelativePath } from '@ms-cloudpack/path-string-parsing';\nimport type { Context } from '../types/Context.js';\nimport type { OverrideOptions } from '../types/OverrideOptions.js';\n\ntype OverrideReturn = {\n /** Whether the override was successfully added */\n addedOverride: boolean;\n /** The entry (if any) in the resolve map the override was added to */\n entry: ResolveMapEntry | undefined;\n};\n\n/**\n * Helper so that when addOverride is called multiple times in quick succession, we only process one at a time.\n * This is to avoid that multiple calls of addOverride first read the same version of the generated config,\n * then write the same version of the config with its corresponding update,\n * which would result in the last call overwriting the changes of the previous calls.\n */\nlet overrideInProcess: Promise<OverrideReturn> = Promise.resolve({\n addedOverride: false,\n entry: undefined,\n});\n\n/**\n * The addOverride method is triggered by a user action in the overlay, when we detect new usage of an import path\n * that isn't recognized. When the user triggers this override, we write it to the cloudpack generated config.\n */\nexport async function addOverride(\n options: OverrideOptions,\n context: Pick<Context, 'packages' | 'session'>,\n): Promise<OverrideReturn> {\n overrideInProcess = overrideInProcess.then(async () => {\n const { packageName, importPath, version, issuerUrl } = options;\n const { session, packages } = context;\n let addedOverride = false;\n let requiredBy = undefined;\n\n if (issuerUrl) {\n const { packageName: issuerName, version: issuerVersion } = parseRequestInfo(makeUrl(issuerUrl).pathname);\n requiredBy = { name: issuerName, version: issuerVersion };\n }\n\n const entry = findResolveMapEntry({\n packageName,\n resolveMap: session.resolveMap,\n definition: requiredBy,\n version,\n });\n\n if (!entry) {\n console.error(`Could not find entry of package \"${packageName}\" in resolve map`);\n return { addedOverride, entry };\n }\n\n const packagePath = entry.path;\n\n // Get current exports. We want to add an additional entry to what's there - not replace the default exports,\n // so we need the full map for the package.\n const exports = await getExportsMap({ packagePath }, { packages, config: session.config });\n const flattenedExports = flattenExportsMap(exports);\n\n // Return false if the import path already exists in the exports map.\n if (flattenedExports[normalizeRelativePath(importPath)]) {\n console.debug(`The import path \"${importPath}\" already exists in the exports map for \"${packageName}\".`);\n return { addedOverride, entry };\n }\n\n const addedExports = {};\n\n // Add the single new exports entry to the exports map.\n addedOverride = await addExportsMapEntry(\n {\n // This is required as addExportsMapEntry assumes addedExports is a record.\n exports: addedExports,\n packagePath,\n importPath,\n },\n { packages, config: session.config },\n );\n\n if (!addedOverride) {\n console.warn(\n `Unable to add override for package \"${packageName}\" to \"cloudpack.generated.json\". The file \"${normalizeRelativePath(\n importPath,\n )}\" could not be found. Please check the import path and try again.`,\n );\n return { addedOverride, entry };\n }\n\n if (Array.isArray(exports)) {\n exports.push(addedExports);\n } else {\n const definition = await packages.get(packagePath);\n if (!definition) {\n console.error(`Could not find definition of package \"${packageName}\" in the cache`);\n return { addedOverride, entry };\n }\n definition.exports = [exports, addedExports];\n }\n\n // Parse the user config if it exists.\n const generatedConfig = await readGeneratedConfig(session.appPath);\n\n // Ensure packageSettings exist.\n generatedConfig.packageSettings ??= [];\n\n const configMatches = generatedConfig.packageSettings.filter(({ match }) =>\n checkMatch({ name: packageName, version: entry.version, match, exactMatch: true }),\n );\n\n if (!configMatches.length) {\n generatedConfig.packageSettings.push({\n match: {\n name: packageName,\n version: `^${entry.version}`,\n },\n exports: addedExports,\n });\n } else {\n if (configMatches.length > 1) {\n console.debug(\n `Found multiple matches for package \"${packageName}\" in cloudpack.generated.json. Using the first match.`,\n );\n }\n\n // Use the first match and ensure exports exist\n configMatches[0].exports ??= {};\n\n const flattenedMatchExports = flattenExportsMap(configMatches[0].exports);\n\n // Return false if the import path already exists in the match exports map.\n if (flattenedMatchExports[normalizeRelativePath(importPath)]) {\n console.debug(`The import path \"${importPath}\" already exists in the config exports map for \"${packageName}\".`);\n return { addedOverride: false, entry };\n }\n\n // Add the single new exports entry to the match exports map.\n await addExportsMapEntry(\n {\n exports: configMatches[0].exports,\n packagePath,\n importPath,\n },\n { packages, config: session.config },\n );\n }\n\n await writeGeneratedConfig(generatedConfig, session.appPath);\n console.log(`Added override for \"${packageName}\" to \"cloudpack.generated.json\".`);\n\n return { addedOverride, entry };\n });\n\n return overrideInProcess;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/api-server",
3
- "version": "0.44.5",
3
+ "version": "0.44.7",
4
4
  "description": "An implementation of the API server that does interacts with a task scheduler.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,19 +27,19 @@
27
27
  "@lage-run/logger": "^1.3.0",
28
28
  "@lage-run/scheduler": "^1.2.1",
29
29
  "@lage-run/target-graph": "^0.8.9",
30
- "@ms-cloudpack/bundler": "^0.20.12",
31
- "@ms-cloudpack/common-types": "^0.5.3",
32
- "@ms-cloudpack/config": "^0.20.8",
33
- "@ms-cloudpack/create-express-app": "^1.6.13",
30
+ "@ms-cloudpack/bundler": "^0.20.14",
31
+ "@ms-cloudpack/common-types": "^0.6.0",
32
+ "@ms-cloudpack/config": "^0.20.10",
33
+ "@ms-cloudpack/create-express-app": "^1.6.15",
34
34
  "@ms-cloudpack/data-bus": "^0.4.2",
35
35
  "@ms-cloudpack/file-watcher": "^0.1.2",
36
- "@ms-cloudpack/import-map": "^0.5.4",
36
+ "@ms-cloudpack/import-map": "^0.5.6",
37
37
  "@ms-cloudpack/json-utilities": "^0.1.4",
38
- "@ms-cloudpack/package-hashes": "^0.5.19",
39
- "@ms-cloudpack/package-utilities": "^7.4.7",
38
+ "@ms-cloudpack/package-hashes": "^0.5.21",
39
+ "@ms-cloudpack/package-utilities": "^7.4.9",
40
40
  "@ms-cloudpack/path-string-parsing": "^1.2.2",
41
- "@ms-cloudpack/path-utilities": "^2.7.10",
42
- "@ms-cloudpack/remote-cache": "^0.7.5",
41
+ "@ms-cloudpack/path-utilities": "^2.7.12",
42
+ "@ms-cloudpack/remote-cache": "^0.7.6",
43
43
  "@ms-cloudpack/task-reporter": "^0.14.1",
44
44
  "@ms-cloudpack/telemetry": "^0.5.2",
45
45
  "@trpc/client": "^10.45.0",