@ms-cloudpack/api-server 0.44.2 → 0.44.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"openFilePath.d.ts","sourceRoot":"","sources":["../../src/apis/openFilePath.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD,QAAA,MAAM,oBAAoB;;;;;;;;;EAGxB,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAErE,wBAAsB,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,iBAAiB,EAAE,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAWjG;yBAXqB,YAAY"}
1
+ {"version":3,"file":"openFilePath.d.ts","sourceRoot":"","sources":["../../src/apis/openFilePath.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD,QAAA,MAAM,oBAAoB;;;;;;;;;EAGxB,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAErE,wBAAsB,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,iBAAiB,EAAE,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAajG;yBAbqB,YAAY"}
@@ -13,8 +13,10 @@ export async function openFilePath(params) {
13
13
  const { input: { rootPath, relativePath }, ctx: { session }, } = params;
14
14
  const fullPath = join(rootPath, relativePath || '');
15
15
  console.log(`Opening path: ${fullPath}`);
16
- const openCommand = platform() == 'win32' ? 'start' : 'open';
17
- await exec(`${openCommand} ${fullPath}`, { cwd: session.appPath });
16
+ const win32 = platform() == 'win32';
17
+ const openCommand = win32 ? 'start' : 'open';
18
+ const shell = win32 ? 'powershell.exe' : undefined;
19
+ await exec(`${openCommand} ${fullPath}`, { cwd: session.appPath, shell });
18
20
  }
19
21
  // Attach a trpc procedure to the function.
20
22
  openFilePath.procedure = publicProcedure.input(ZodOpenFilePathInput).mutation(openFilePath);
@@ -1 +1 @@
1
- {"version":3,"file":"openFilePath.js","sourceRoot":"","sources":["../../src/apis/openFilePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAGjC,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;AAErC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC;AAGH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAA+C;IAChF,MAAM,EACJ,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,EACjC,GAAG,EAAE,EAAE,OAAO,EAAE,GACjB,GAAG,MAAM,CAAC;IACX,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC;IAEpD,OAAO,CAAC,GAAG,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAC;IACzC,MAAM,WAAW,GAAG,QAAQ,EAAE,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAE7D,MAAM,IAAI,CAAC,GAAG,WAAW,IAAI,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,2CAA2C;AAC3C,YAAY,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\nimport { z } from 'zod';\nimport { join } from 'path';\nimport { platform } from 'os';\nimport { exec as execCallback } from 'child_process';\nimport { promisify } from 'util';\nimport type { ApiParams } from '../types/ApiParams.js';\n\nconst exec = promisify(execCallback);\n\nconst ZodOpenFilePathInput = z.object({\n rootPath: z.string(),\n relativePath: z.string().optional(),\n});\nexport type OpenFilePathInput = z.infer<typeof ZodOpenFilePathInput>;\n\nexport async function openFilePath(params: ApiParams<OpenFilePathInput, 'session'>): Promise<void> {\n const {\n input: { rootPath, relativePath },\n ctx: { session },\n } = params;\n const fullPath = join(rootPath, relativePath || '');\n\n console.log(`Opening path: ${fullPath}`);\n const openCommand = platform() == 'win32' ? 'start' : 'open';\n\n await exec(`${openCommand} ${fullPath}`, { cwd: session.appPath });\n}\n\n// Attach a trpc procedure to the function.\nopenFilePath.procedure = publicProcedure.input(ZodOpenFilePathInput).mutation(openFilePath);\n"]}
1
+ {"version":3,"file":"openFilePath.js","sourceRoot":"","sources":["../../src/apis/openFilePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAGjC,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;AAErC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC;AAGH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAA+C;IAChF,MAAM,EACJ,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,EACjC,GAAG,EAAE,EAAE,OAAO,EAAE,GACjB,GAAG,MAAM,CAAC;IACX,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC;IAEpD,OAAO,CAAC,GAAG,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,QAAQ,EAAE,IAAI,OAAO,CAAC;IACpC,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC;IAEnD,MAAM,IAAI,CAAC,GAAG,WAAW,IAAI,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,2CAA2C;AAC3C,YAAY,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import { publicProcedure } from '../trpc/common.js';\nimport { z } from 'zod';\nimport { join } from 'path';\nimport { platform } from 'os';\nimport { exec as execCallback } from 'child_process';\nimport { promisify } from 'util';\nimport type { ApiParams } from '../types/ApiParams.js';\n\nconst exec = promisify(execCallback);\n\nconst ZodOpenFilePathInput = z.object({\n rootPath: z.string(),\n relativePath: z.string().optional(),\n});\nexport type OpenFilePathInput = z.infer<typeof ZodOpenFilePathInput>;\n\nexport async function openFilePath(params: ApiParams<OpenFilePathInput, 'session'>): Promise<void> {\n const {\n input: { rootPath, relativePath },\n ctx: { session },\n } = params;\n const fullPath = join(rootPath, relativePath || '');\n\n console.log(`Opening path: ${fullPath}`);\n const win32 = platform() == 'win32';\n const openCommand = win32 ? 'start' : 'open';\n const shell = win32 ? 'powershell.exe' : undefined;\n\n await exec(`${openCommand} ${fullPath}`, { cwd: session.appPath, shell });\n}\n\n// Attach a trpc procedure to the function.\nopenFilePath.procedure = publicProcedure.input(ZodOpenFilePathInput).mutation(openFilePath);\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,CAiElB"}
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"}
@@ -45,14 +45,12 @@ export async function createSession(options, context) {
45
45
  versions.sessionVersion++;
46
46
  importMap = undefined;
47
47
  // Write the new session version to the file
48
- // eslint-disable-next-line @ms-cloudpack/internal/no-sync-filesystem -- this function can't be async
49
48
  fs.writeFileSync(versionsPath, JSON.stringify(versions, null, 2));
50
49
  },
51
50
  incrementTargetVersion: (inputPath) => {
52
51
  versions.targetVersions[inputPath] ??= 0;
53
52
  versions.targetVersions[inputPath]++;
54
53
  importMap = undefined;
55
- // eslint-disable-next-line @ms-cloudpack/internal/no-sync-filesystem -- this function can't be async
56
54
  writeJsonSync(versionsPath, versions);
57
55
  },
58
56
  get importMap() {
@@ -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,OA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C,YAAY,EAAE,IAAI,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,qGAAqG;YACrG,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 // eslint-disable-next-line @ms-cloudpack/internal/no-sync-filesystem -- this function can't be async\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 // eslint-disable-next-line @ms-cloudpack/internal/no-sync-filesystem -- this function can't be async\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;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,G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E,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,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"]}
package/lib/index.d.ts CHANGED
@@ -29,6 +29,7 @@ export { ZodTaskEndDescription } from './types/TaskEndDescription.js';
29
29
  export { ZodTaskMessage } from './types/TaskMessage.js';
30
30
  export { ZodTaskStartDescription } from './types/TaskStartDescription.js';
31
31
  export { getCachePath, getLocalCachePath } from './utilities/getCachePath.js';
32
+ export { getActiveSessionsPath } from './utilities/getActiveSessionsPath.js';
32
33
  export { getSessionPath } from './utilities/getSessionPath.js';
33
34
  export { getConsumedDependencies } from './utilities/getConsumedDependencies.js';
34
35
  export { getConsumedPaths } from './utilities/getConsumedPaths.js';
@@ -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,MAA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iB,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,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,uBAAuB,GACxB,MAAM,iBAAiB,CAAC"}
package/lib/index.js CHANGED
@@ -7,6 +7,7 @@ export { ZodTaskEndDescription } from './types/TaskEndDescription.js';
7
7
  export { ZodTaskMessage } from './types/TaskMessage.js';
8
8
  export { ZodTaskStartDescription } from './types/TaskStartDescription.js';
9
9
  export { getCachePath, getLocalCachePath } from './utilities/getCachePath.js';
10
+ export { getActiveSessionsPath } from './utilities/getActiveSessionsPath.js';
10
11
  export { getSessionPath } from './utilities/getSessionPath.js';
11
12
  export { getConsumedDependencies } from './utilities/getConsumedDependencies.js';
12
13
  export { getConsumedPaths } from './utilities/getConsumedPaths.js';
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,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 { 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":"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 +1 @@
1
- {"version":3,"file":"createBundleTask.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAc,KAAK,yBAAyB,EAAE,KAAK,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC7G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,yBAAyB,GAChC,cAAc,CACZ,eAAe,GAAG,oBAAoB,EACtC,MAAM,yBAAyB,CAAC,SAAS,CAAC,GAAG,WAAW,GAAG,MAAM,CAClE,GACF,IAAI,CAAC,aAAa,CAAC,CA8DrB"}
1
+ {"version":3,"file":"createBundleTask.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAc,KAAK,yBAAyB,EAAE,KAAK,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC7G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,yBAAyB,GAChC,cAAc,CACZ,eAAe,GAAG,oBAAoB,EACtC,MAAM,yBAAyB,CAAC,SAAS,CAAC,GAAG,WAAW,GAAG,MAAM,CAClE,GACF,IAAI,CAAC,aAAa,CAAC,CA6DrB"}
@@ -40,7 +40,6 @@ export function createBundleTask(options, context) {
40
40
  return;
41
41
  }
42
42
  bundleRequest.result.dispose?.();
43
- // eslint-disable-next-line @ms-cloudpack/internal/no-sync-filesystem -- this function can't be async
44
43
  fs.rmSync(bundleRequest.result.outputPath, { recursive: true, force: true });
45
44
  bundleRequest.result = undefined;
46
45
  },
@@ -1 +1 @@
1
- {"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAkE,MAAM,iBAAiB,CAAC;AAG7G;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAkC,EAClC,OAIG;IAEH,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IAC5E,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC3C,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACrC,MAAM,IAAI,GAAG,UAAU,WAAW,IAAI,OAAO,EAAE,CAAC;IAEhD,OAAO;QACL,gCAAgC;QAChC,IAAI;QACJ,EAAE;QACF,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;QACvC,KAAK,EAAE,CAAC,UAAU;QAClB,KAAK,CAAC,OAAO;YACX,MAAM,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACnC,IAAI,CAAC;gBACH,iDAAiD;gBACjD,0FAA0F;gBAC1F,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;gBACpC,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;gBAC/C,IAAI,SAAS,IAAI,YAAY,EAAE,CAAC;oBAC9B,MAAM,aAAa,GACjB,UAAU,IAAI,IAAI,IAAI,CAAC,MAAM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EAAE,MAAM,EAAE,MAAM;YAClC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ;YACtC,UAAU,EAAE,aAAa,CAAC,MAAM,EAAE,UAAU,IAAI,EAAE;SACnD,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import { addImportMapHash } from '@ms-cloudpack/import-map';\nimport fs from 'fs';\nimport path from 'path';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { Task } from '../types/Task.js';\nimport { bundleTask, type BundleTaskInternalContext, type BundleTaskInternalOptions } from './bundleTask.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Create a bundle task (internally calls `bundleTask()`) that can be executed by the server's TaskRunner.\n * This allows active tasks to be tracked remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(\n options: BundleTaskInternalOptions,\n context: BundleTaskInternalContext &\n PartialContext<\n 'packageHashes' | 'packageImportPaths',\n keyof BundleTaskInternalContext['session'] | 'importMap' | 'urls'\n >,\n): Task<BundleRequest> {\n const { bundleRequest } = options;\n const { id, packageName, version, packagePath, isExternal } = bundleRequest;\n const { packageHashes, session } = context;\n const { hash, sourceHash } = options;\n const name = `Bundle ${packageName}@${version}`;\n\n return {\n // Name for task runner logging.\n name,\n id,\n dir: `${path.join(packagePath, 'src')}`,\n watch: !isExternal,\n async execute(): Promise<BundleRequest> {\n await bundleTask(options, context);\n try {\n // Add a hash to the import map for this package.\n // (Read the session properties here rather than above because they might not be set yet.)\n const importMap = session.importMap;\n const bundleServer = session.urls.bundleServer;\n if (importMap && bundleServer) {\n const importMapHash =\n sourceHash || hash || (await packageHashes.get({ packagePath, isSourceHashingEnabled: !isExternal }));\n addImportMapHash(\n { packageName, version, hash: importMapHash },\n { ...context, ...session, importMap, urls: { bundleServer } },\n );\n }\n } catch (e) {\n console.error(`Error adding hash to import map for ${bundleRequest.packagePath}:`, (e as Error).stack || e);\n }\n return bundleRequest;\n },\n clear: () => {\n if (!bundleRequest.result) {\n return;\n }\n\n bundleRequest.result.dispose?.();\n\n // eslint-disable-next-line @ms-cloudpack/internal/no-sync-filesystem -- this function can't be async\n fs.rmSync(bundleRequest.result.outputPath, { recursive: true, force: true });\n\n bundleRequest.result = undefined;\n },\n onDispose: () => {\n bundleRequest.result?.dispose?.();\n },\n getErrors: () => bundleRequest.result?.errors,\n getStartDescription: () => ({\n id,\n // Name to display in the overlay.\n name,\n inputPath: packagePath || '',\n }),\n getEndDescription: (taskResult) => ({\n id,\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n outputPath: bundleRequest.result?.outputPath || '',\n }),\n };\n}\n"]}
1
+ {"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAkE,MAAM,iBAAiB,CAAC;AAG7G;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAkC,EAClC,OAIG;IAEH,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IAC5E,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC3C,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACrC,MAAM,IAAI,GAAG,UAAU,WAAW,IAAI,OAAO,EAAE,CAAC;IAEhD,OAAO;QACL,gCAAgC;QAChC,IAAI;QACJ,EAAE;QACF,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;QACvC,KAAK,EAAE,CAAC,UAAU;QAClB,KAAK,CAAC,OAAO;YACX,MAA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,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM;QAC7C,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC1B,EAAE;YACF,kCAAkC;YAClC,IAAI;YACJ,SAAS,EAAE,WAAW,IAAI,EAAE;SAC7B,CAAC;QACF,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAClC,EAAE;YACF,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM;YAClC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ;YACtC,UAAU,EAAE,aAAa,CAAC,MAAM,EAAE,UAAU,IAAI,EAAE;SACnD,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import { addImportMapHash } from '@ms-cloudpack/import-map';\nimport fs from 'fs';\nimport path from 'path';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { Task } from '../types/Task.js';\nimport { bundleTask, type BundleTaskInternalContext, type BundleTaskInternalOptions } from './bundleTask.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Create a bundle task (internally calls `bundleTask()`) that can be executed by the server's TaskRunner.\n * This allows active tasks to be tracked remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(\n options: BundleTaskInternalOptions,\n context: BundleTaskInternalContext &\n PartialContext<\n 'packageHashes' | 'packageImportPaths',\n keyof BundleTaskInternalContext['session'] | 'importMap' | 'urls'\n >,\n): Task<BundleRequest> {\n const { bundleRequest } = options;\n const { id, packageName, version, packagePath, isExternal } = bundleRequest;\n const { packageHashes, session } = context;\n const { hash, sourceHash } = options;\n const name = `Bundle ${packageName}@${version}`;\n\n return {\n // Name for task runner logging.\n name,\n id,\n dir: `${path.join(packagePath, 'src')}`,\n watch: !isExternal,\n async execute(): Promise<BundleRequest> {\n await bundleTask(options, context);\n try {\n // Add a hash to the import map for this package.\n // (Read the session properties here rather than above because they might not be set yet.)\n const importMap = session.importMap;\n const bundleServer = session.urls.bundleServer;\n if (importMap && bundleServer) {\n const importMapHash =\n sourceHash || hash || (await packageHashes.get({ packagePath, isSourceHashingEnabled: !isExternal }));\n addImportMapHash(\n { packageName, version, hash: importMapHash },\n { ...context, ...session, importMap, urls: { bundleServer } },\n );\n }\n } catch (e) {\n console.error(`Error adding hash to import map for ${bundleRequest.packagePath}:`, (e as Error).stack || e);\n }\n return bundleRequest;\n },\n clear: () => {\n if (!bundleRequest.result) {\n return;\n }\n\n bundleRequest.result.dispose?.();\n\n fs.rmSync(bundleRequest.result.outputPath, { recursive: true, force: true });\n\n bundleRequest.result = undefined;\n },\n onDispose: () => {\n bundleRequest.result?.dispose?.();\n },\n getErrors: () => bundleRequest.result?.errors,\n getStartDescription: () => ({\n id,\n // Name to display in the overlay.\n name,\n inputPath: packagePath || '',\n }),\n getEndDescription: (taskResult) => ({\n id,\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n outputPath: bundleRequest.result?.outputPath || '',\n }),\n };\n}\n"]}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Gets the path to the active sessions directory.
3
+ */
4
+ export declare function getActiveSessionsPath(): string;
5
+ //# sourceMappingURL=getActiveSessionsPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getActiveSessionsPath.d.ts","sourceRoot":"","sources":["../../src/utilities/getActiveSessionsPath.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,qBAAqB,WAEpC"}
@@ -0,0 +1,9 @@
1
+ import path from 'path';
2
+ import { getCachePath } from './getCachePath.js';
3
+ /**
4
+ * Gets the path to the active sessions directory.
5
+ */
6
+ export function getActiveSessionsPath() {
7
+ return path.join(getCachePath(), 'active-sessions');
8
+ }
9
+ //# sourceMappingURL=getActiveSessionsPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getActiveSessionsPath.js","sourceRoot":"","sources":["../../src/utilities/getActiveSessionsPath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,iBAAiB,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import path from 'path';\nimport { getCachePath } from './getCachePath.js';\n\n/**\n * Gets the path to the active sessions directory.\n */\nexport function getActiveSessionsPath() {\n return path.join(getCachePath(), 'active-sessions');\n}\n"]}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Gets the path to the cache directory.
3
+ */
1
4
  export declare function getCachePath(): string;
5
+ /**
6
+ * Gets the path to the app's local cache directory.
7
+ */
2
8
  export declare function getLocalCachePath(appPath: string): string;
3
9
  //# sourceMappingURL=getCachePath.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getCachePath.d.ts","sourceRoot":"","sources":["../../src/utilities/getCachePath.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY,WAE3B;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,UAEhD"}
1
+ {"version":3,"file":"getCachePath.d.ts","sourceRoot":"","sources":["../../src/utilities/getCachePath.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,YAAY,WAE3B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,UAEhD"}
@@ -1,8 +1,14 @@
1
1
  import os from 'os';
2
2
  import path from 'path';
3
+ /**
4
+ * Gets the path to the cache directory.
5
+ */
3
6
  export function getCachePath() {
4
7
  return path.join(os.homedir(), '.cloudpack');
5
8
  }
9
+ /**
10
+ * Gets the path to the app's local cache directory.
11
+ */
6
12
  export function getLocalCachePath(appPath) {
7
13
  return path.join(appPath, 'node_modules', '.cache', 'cloudpack');
8
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getCachePath.js","sourceRoot":"","sources":["../../src/utilities/getCachePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import os from 'os';\nimport path from 'path';\n\nexport function getCachePath() {\n return path.join(os.homedir(), '.cloudpack');\n}\n\nexport function getLocalCachePath(appPath: string) {\n return path.join(appPath, 'node_modules', '.cache', 'cloudpack');\n}\n"]}
1
+ {"version":3,"file":"getCachePath.js","sourceRoot":"","sources":["../../src/utilities/getCachePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import os from 'os';\nimport path from 'path';\n\n/**\n * Gets the path to the cache directory.\n */\nexport function getCachePath() {\n return path.join(os.homedir(), '.cloudpack');\n}\n\n/**\n * Gets the path to the app's local cache directory.\n */\nexport function getLocalCachePath(appPath: string) {\n return path.join(appPath, 'node_modules', '.cache', 'cloudpack');\n}\n"]}
@@ -1,3 +1,6 @@
1
1
  import type { Session } from '../types/Session.js';
2
+ /**
3
+ * Gets the path to a session file.
4
+ */
2
5
  export declare function getSessionPath(session: Session): string;
3
6
  //# sourceMappingURL=getSessionPath.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSessionPath.d.ts","sourceRoot":"","sources":["../../src/utilities/getSessionPath.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,UAE9C"}
1
+ {"version":3,"file":"getSessionPath.d.ts","sourceRoot":"","sources":["../../src/utilities/getSessionPath.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,UAE9C"}
@@ -1,6 +1,9 @@
1
1
  import path from 'path';
2
- import { getCachePath } from './getCachePath.js';
2
+ import { getActiveSessionsPath } from './getActiveSessionsPath.js';
3
+ /**
4
+ * Gets the path to a session file.
5
+ */
3
6
  export function getSessionPath(session) {
4
- return path.join(getCachePath(), 'active-sessions', `${session.id}.json`);
7
+ return path.join(getActiveSessionsPath(), `${session.id}.json`);
5
8
  }
6
9
  //# sourceMappingURL=getSessionPath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSessionPath.js","sourceRoot":"","sources":["../../src/utilities/getSessionPath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["import path from 'path';\nimport { getCachePath } from './getCachePath.js';\nimport type { Session } from '../types/Session.js';\n\nexport function getSessionPath(session: Session) {\n return path.join(getCachePath(), 'active-sessions', `${session.id}.json`);\n}\n"]}
1
+ {"version":3,"file":"getSessionPath.js","sourceRoot":"","sources":["../../src/utilities/getSessionPath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import path from 'path';\nimport { getActiveSessionsPath } from './getActiveSessionsPath.js';\nimport type { Session } from '../types/Session.js';\n\n/**\n * Gets the path to a session file.\n */\nexport function getSessionPath(session: Session) {\n return path.join(getActiveSessionsPath(), `${session.id}.json`);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/api-server",
3
- "version": "0.44.2",
3
+ "version": "0.44.4",
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,20 +27,20 @@
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.9",
31
- "@ms-cloudpack/common-types": "^0.5.2",
32
- "@ms-cloudpack/config": "^0.20.6",
33
- "@ms-cloudpack/create-express-app": "^1.6.12",
30
+ "@ms-cloudpack/bundler": "^0.20.11",
31
+ "@ms-cloudpack/common-types": "^0.5.3",
32
+ "@ms-cloudpack/config": "^0.20.8",
33
+ "@ms-cloudpack/create-express-app": "^1.6.13",
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.2",
36
+ "@ms-cloudpack/import-map": "^0.5.4",
37
37
  "@ms-cloudpack/json-utilities": "^0.1.4",
38
- "@ms-cloudpack/package-hashes": "^0.5.17",
39
- "@ms-cloudpack/package-utilities": "^7.4.5",
38
+ "@ms-cloudpack/package-hashes": "^0.5.19",
39
+ "@ms-cloudpack/package-utilities": "^7.4.7",
40
40
  "@ms-cloudpack/path-string-parsing": "^1.2.2",
41
- "@ms-cloudpack/path-utilities": "^2.7.9",
42
- "@ms-cloudpack/remote-cache": "^0.7.4",
43
- "@ms-cloudpack/task-reporter": "^0.14.0",
41
+ "@ms-cloudpack/path-utilities": "^2.7.10",
42
+ "@ms-cloudpack/remote-cache": "^0.7.5",
43
+ "@ms-cloudpack/task-reporter": "^0.14.1",
44
44
  "@ms-cloudpack/telemetry": "^0.5.2",
45
45
  "@trpc/client": "^10.45.0",
46
46
  "@trpc/server": "^10.45.0",