@ms-cloudpack/api-server 0.63.10 → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/apis/addPackageOverride.d.ts +1 -1
- package/lib/apis/addPackageOverride.js +7 -7
- package/lib/apis/addPackageOverride.js.map +1 -1
- package/lib/apis/ensurePackageBundled.js.map +1 -1
- package/lib/apis/getData.d.ts +7 -13
- package/lib/apis/getData.d.ts.map +1 -1
- package/lib/apis/getData.js +3 -4
- package/lib/apis/getData.js.map +1 -1
- package/lib/apis/getLinkConfig.d.ts +2 -2
- package/lib/apis/getLinkConfig.d.ts.map +1 -1
- package/lib/apis/getLinkConfig.js +3 -2
- package/lib/apis/getLinkConfig.js.map +1 -1
- package/lib/apis/getSessionId.d.ts +2 -6
- package/lib/apis/getSessionId.d.ts.map +1 -1
- package/lib/apis/getSessionId.js +3 -4
- package/lib/apis/getSessionId.js.map +1 -1
- package/lib/apis/linkPath.d.ts +29 -3
- package/lib/apis/linkPath.js +2 -2
- package/lib/apis/linkPath.js.map +1 -1
- package/lib/apis/notifyLinkChange.d.ts +2 -2
- package/lib/apis/notifyLinkChange.d.ts.map +1 -1
- package/lib/apis/notifyLinkChange.js +3 -2
- package/lib/apis/notifyLinkChange.js.map +1 -1
- package/lib/apis/onDataChanged.d.ts +7 -13
- package/lib/apis/onDataChanged.d.ts.map +1 -1
- package/lib/apis/onDataChanged.js +3 -7
- package/lib/apis/onDataChanged.js.map +1 -1
- package/lib/apis/openCodeEditor.d.ts +9 -19
- package/lib/apis/openCodeEditor.d.ts.map +1 -1
- package/lib/apis/openCodeEditor.js +6 -6
- package/lib/apis/openCodeEditor.js.map +1 -1
- package/lib/apis/openConfigEditor.d.ts +1 -1
- package/lib/apis/openConfigEditor.d.ts.map +1 -1
- package/lib/apis/openConfigEditor.js +3 -2
- package/lib/apis/openConfigEditor.js.map +1 -1
- package/lib/apis/openFilePath.d.ts +6 -12
- package/lib/apis/openFilePath.d.ts.map +1 -1
- package/lib/apis/openFilePath.js +4 -4
- package/lib/apis/openFilePath.js.map +1 -1
- package/lib/apis/publishData.d.ts +7 -13
- package/lib/apis/publishData.d.ts.map +1 -1
- package/lib/apis/publishData.js +3 -3
- package/lib/apis/publishData.js.map +1 -1
- package/lib/apis/reportSpan.d.ts +10 -20
- package/lib/apis/reportSpan.d.ts.map +1 -1
- package/lib/apis/reportSpan.js +5 -5
- package/lib/apis/reportSpan.js.map +1 -1
- package/lib/apis/restartAllTasks.d.ts +1 -1
- package/lib/apis/restartAllTasks.d.ts.map +1 -1
- package/lib/apis/restartAllTasks.js +14 -7
- package/lib/apis/restartAllTasks.js.map +1 -1
- package/lib/apis/restartTask.d.ts +4 -18
- package/lib/apis/restartTask.d.ts.map +1 -1
- package/lib/apis/restartTask.js +6 -5
- package/lib/apis/restartTask.js.map +1 -1
- package/lib/apis/unlinkPath.d.ts +29 -3
- package/lib/apis/unlinkPath.js +2 -2
- package/lib/apis/unlinkPath.js.map +1 -1
- package/lib/apis/validatePackageOverride.d.ts +1 -1
- package/lib/apis/validatePackageOverride.js +5 -8
- package/lib/apis/validatePackageOverride.js.map +1 -1
- package/lib/common/createApiContext.d.ts.map +1 -1
- package/lib/common/createApiContext.js +4 -1
- package/lib/common/createApiContext.js.map +1 -1
- package/lib/common/createMockContext.d.ts +16 -9
- package/lib/common/createMockContext.d.ts.map +1 -1
- package/lib/common/createMockContext.js +21 -16
- package/lib/common/createMockContext.js.map +1 -1
- package/lib/common/createMockSession.d.ts +1 -1
- package/lib/common/createMockSession.d.ts.map +1 -1
- package/lib/common/createMockSession.js.map +1 -1
- package/lib/common/createSession.d.ts +5 -1
- package/lib/common/createSession.d.ts.map +1 -1
- package/lib/common/createSession.js +1 -1
- package/lib/common/createSession.js.map +1 -1
- package/lib/data/busSources.d.ts +27 -240
- package/lib/data/busSources.d.ts.map +1 -1
- package/lib/data/busSources.js +2 -2
- package/lib/data/busSources.js.map +1 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/trpc/common.d.ts +41 -2
- package/lib/trpc/common.d.ts.map +1 -1
- package/lib/trpc/common.js +44 -3
- package/lib/trpc/common.js.map +1 -1
- package/lib/types/BundleInfo.d.ts +1 -1
- package/lib/types/BundleInfo.d.ts.map +1 -1
- package/lib/types/BundleInfo.js.map +1 -1
- package/lib/types/LinkPath.d.ts +16 -92
- package/lib/types/LinkPath.d.ts.map +1 -1
- package/lib/types/LinkPath.js +21 -17
- package/lib/types/LinkPath.js.map +1 -1
- package/lib/types/Task.d.ts +20 -12
- package/lib/types/Task.d.ts.map +1 -1
- package/lib/types/Task.js.map +1 -1
- package/lib/types/TaskDescription.d.ts +19 -73
- package/lib/types/TaskDescription.d.ts.map +1 -1
- package/lib/types/TaskDescription.js +15 -12
- package/lib/types/TaskDescription.js.map +1 -1
- package/lib/types/TaskList.d.ts +6 -115
- package/lib/types/TaskList.d.ts.map +1 -1
- package/lib/types/TaskList.js +3 -2
- package/lib/types/TaskList.js.map +1 -1
- package/lib/types/TaskMessage.d.ts +3 -11
- package/lib/types/TaskMessage.d.ts.map +1 -1
- package/lib/types/TaskMessage.js +4 -4
- package/lib/types/TaskMessage.js.map +1 -1
- package/lib/types/TaskMessageLocation.d.ts +2 -6
- package/lib/types/TaskMessageLocation.d.ts.map +1 -1
- package/lib/types/TaskMessageLocation.js +3 -3
- package/lib/types/TaskMessageLocation.js.map +1 -1
- package/lib/types/TaskStats.d.ts +26 -17
- package/lib/types/TaskStats.d.ts.map +1 -1
- package/lib/types/TaskStats.js +4 -3
- package/lib/types/TaskStats.js.map +1 -1
- package/lib/types/Timing.d.ts +8 -18
- package/lib/types/Timing.d.ts.map +1 -1
- package/lib/types/Timing.js +5 -8
- package/lib/types/Timing.js.map +1 -1
- package/lib/types/ZodGetLinkConfigOutput.d.ts +2 -2
- package/lib/types/ZodGetLinkConfigOutput.d.ts.map +1 -1
- package/lib/types/ZodGetLinkConfigOutput.js +12 -10
- package/lib/types/ZodGetLinkConfigOutput.js.map +1 -1
- package/lib/types/ZodNotifyLinkChangeInput.d.ts +12 -44
- package/lib/types/ZodNotifyLinkChangeInput.d.ts.map +1 -1
- package/lib/types/ZodNotifyLinkChangeInput.js +7 -3
- package/lib/types/ZodNotifyLinkChangeInput.js.map +1 -1
- package/lib/types/ZodResolveMap.d.ts +2 -2
- package/lib/types/ZodResolveMap.d.ts.map +1 -1
- package/lib/types/ZodResolveMap.js +6 -6
- package/lib/types/ZodResolveMap.js.map +1 -1
- package/lib/utilities/TaskRunner.d.ts +56 -18
- package/lib/utilities/TaskRunner.d.ts.map +1 -1
- package/lib/utilities/TaskRunner.js +176 -98
- package/lib/utilities/TaskRunner.js.map +1 -1
- package/lib/utilities/createBundleTask.d.ts.map +1 -1
- package/lib/utilities/createBundleTask.js +9 -15
- package/lib/utilities/createBundleTask.js.map +1 -1
- package/lib/utilities/getConsumedDependencies.d.ts.map +1 -1
- package/lib/utilities/getConsumedDependencies.js +3 -0
- package/lib/utilities/getConsumedDependencies.js.map +1 -1
- package/lib/utilities/getConsumedPaths.d.ts.map +1 -1
- package/lib/utilities/getConsumedPaths.js +3 -0
- package/lib/utilities/getConsumedPaths.js.map +1 -1
- package/lib/utilities/matchingZodObject.d.ts +15 -9
- package/lib/utilities/matchingZodObject.d.ts.map +1 -1
- package/lib/utilities/matchingZodObject.js +16 -6
- package/lib/utilities/matchingZodObject.js.map +1 -1
- package/lib/utilities/notifyReload.d.ts.map +1 -1
- package/lib/utilities/notifyReload.js +2 -1
- package/lib/utilities/notifyReload.js.map +1 -1
- package/lib/utilities/waitForBusData.d.ts +2 -2
- package/lib/utilities/waitForBusData.d.ts.map +1 -1
- package/lib/utilities/waitForBusData.js.map +1 -1
- package/package.json +16 -16
- package/lib/types/TaskEndDescription.d.ts +0 -26
- package/lib/types/TaskEndDescription.d.ts.map +0 -1
- package/lib/types/TaskEndDescription.js +0 -8
- package/lib/types/TaskEndDescription.js.map +0 -1
- package/lib/types/TaskStartDescription.d.ts +0 -19
- package/lib/types/TaskStartDescription.d.ts.map +0 -1
- package/lib/types/TaskStartDescription.js +0 -8
- package/lib/types/TaskStartDescription.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApiContext.js","sourceRoot":"","sources":["../../src/common/createApiContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAY1D;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAgC;IAEhC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,4BAA4B,EAAE,GAAG,OAAO,CAAC;IAEhG,OAAO,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QACrF,wDAAwD;QACxD,MAAM,QAAQ,GAAG,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QAEtD,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;QAEtF,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,8BAA8B,CAAC,CAAC;QACvE,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC;YACtC,GAAG,EAAE,MAAM,CAAC,OAAO;YACnB,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;SAC9D,CAAC,CAAC;QAEH,IAAI,iBAA2D,CAAC;QAChE,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;QACrD,IAAI,4BAA4B,IAAI,iBAAiB,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,iBAAiB,EAAE,GAAG,EAAE;YACpC,sDAAsD;YACtD,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,OAAO;YACL,GAAG,OAAO;YACV,GAAG;YACH,OAAO;YACP,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;gBACxB,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;YAC/B,CAAC;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { Context } from '../types/Context.js';\nimport type { CreateSessionOptions } from './createSession.js';\nimport type { LoginMethod } from '@ms-cloudpack/remote-cache';\nimport { createPackageDefinitions } from '@ms-cloudpack/config';\nimport { reloadCountSource } from '../data/busSources.js';\n\nexport interface CreateApiContextOptions\n extends CreateSessionOptions,\n Pick<Context, 'reporter' | 'telemetryClient' | 'taskRunner'> {\n /**\n * Login method for the remote cache.\n * If this isn't provided, `context.remoteCacheClient` will not be set.\n */\n remoteCacheClientLoginMethod?: LoginMethod;\n}\n\n/**\n * Asynchronously initialize a partial `Context`, encapsulating async importing of certain modules\n * to speed up boot time.\n *\n * This version skips some properties that are only needed for starting an app.\n * For a full context, use `createApiContext`.\n */\nexport function createPartialApiContext(\n options: CreateApiContextOptions,\n): Promise<Omit<Context, 'bus' | 'watcher' | 'dispose'>> {\n const { reporter, taskRunner, telemetryClient, config, remoteCacheClientLoginMethod } = options;\n\n return telemetryClient.tracer.startActiveSpan('CREATE_PARTIAL_API_CONTEXT', async () => {\n // Start by creating the properties that are always used\n const packages = createPackageDefinitions({ config });\n\n const { createSession } = await import('./createSession.js');\n const session = await createSession(options, { reporter, packages, telemetryClient });\n\n const { PackageHashes } = await import('@ms-cloudpack/package-hashes');\n const packageHashes = new PackageHashes({\n cwd: config.appPath,\n context: { config, packages, resolveMap: session.resolveMap },\n });\n\n let remoteCacheClient: Context['remoteCacheClient'] | undefined;\n const remoteCacheConfig = session.config.remoteCache;\n if (remoteCacheClientLoginMethod && remoteCacheConfig) {\n remoteCacheClient = await import('@ms-cloudpack/remote-cache').then(({ createRemoteCacheClient }) =>\n createRemoteCacheClient({\n context: { reporter, telemetryClient },\n options: { cachePath: session.cachePath, loginMethod: remoteCacheClientLoginMethod, ...remoteCacheConfig },\n }),\n );\n }\n\n return { reporter, taskRunner, telemetryClient, packageHashes, packages, session, remoteCacheClient };\n });\n}\n\n/**\n * Asynchronously initialize a `Context`, encapsulating async importing of certain packages/modules\n * to speed up boot time.\n *\n * When finished with the context, call `dispose` to clean up resources.\n *\n * NOTE: This version initializes the data bus and the file watcher, which are only needed when\n * starting a server (and add unnecessary overhead otherwise). For other commands, use\n * `createPartialApiContext`.\n */\nexport async function createApiContext(options: CreateApiContextOptions): Promise<Context> {\n return options.telemetryClient.tracer.startActiveSpan('CREATE_API_CONTEXT', async () => {\n const context = await createPartialApiContext(options);\n\n const { createWatcher } = await import('@ms-cloudpack/file-watcher');\n const watcher = createWatcher({\n // Use watcher in fork by default for better performance in large apps.\n type: context.session.config.features?.enableWatcherInFork !== false ? 'fork' : 'default',\n });\n\n const { createDataBus } = await import('@ms-cloudpack/data-bus');\n const bus = createDataBus();\n // Without this line, the overlay won't work.\n context.taskRunner.connectToBus(bus);\n\n bus.subscribe(reloadCountSource, () => {\n // Clear and reload the console when the page reloads.\n context.reporter.reset();\n });\n\n return {\n ...context,\n bus,\n watcher,\n dispose: async () => {\n await watcher.dispose();\n context.taskRunner.dispose();\n },\n };\n });\n}\n"]}
|
|
@@ -1,26 +1,33 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { Session } from '@ms-cloudpack/common-types';
|
|
2
|
+
import { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
3
3
|
import { type TelemetryClient } from '@ms-cloudpack/telemetry';
|
|
4
|
-
import type {
|
|
4
|
+
import type { Context, PartialContext } from '../types/Context.js';
|
|
5
5
|
import { type CreateMockSessionOptions } from './createMockSession.js';
|
|
6
|
+
import { type CreateSessionOptions } from './createSession.js';
|
|
7
|
+
import type { EnsurePackageBundledContext } from '../apis/ensurePackageBundled.js';
|
|
6
8
|
/**
|
|
7
9
|
* Create a mock context using info from the real filesystem.
|
|
8
10
|
* This is suitable for most tests using `ensurePackageBundled` and other scenarios.
|
|
9
|
-
*
|
|
11
|
+
*
|
|
12
|
+
* Unless `sessionOptions.cachePath` is provided, it will use `<appPath>/.cache` to avoid
|
|
13
|
+
* pollution of global state.
|
|
10
14
|
*/
|
|
11
15
|
export declare function createMockContext(params: {
|
|
12
16
|
appPath: string;
|
|
13
17
|
sessionOptions?: Partial<Omit<CreateSessionOptions, 'config'>>;
|
|
18
|
+
reporter?: TaskReporter;
|
|
14
19
|
/** No-op telemetry client. You might want to create this only once and pass it in. */
|
|
15
20
|
telemetryClient?: TelemetryClient;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})
|
|
21
|
+
}): Promise<Omit<EnsurePackageBundledContext, 'bus' | 'watcher'>>;
|
|
22
|
+
/**
|
|
23
|
+
* Like {@link createMockContext} (uses real filesystem and session), but also initializes a data bus.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createMockContextWithBus(params: Parameters<typeof createMockContext>[0]): Promise<Omit<EnsurePackageBundledContext, 'bus' | 'watcher'> & Pick<Context, 'bus'>>;
|
|
19
26
|
type AllowedContextKeys = Exclude<keyof Context, 'watcher' | 'dispose' | 'remoteCacheClient'>;
|
|
20
27
|
/**
|
|
21
|
-
* Initialize only the requested context keys (plus `'session'`) using info from the real filesystem.
|
|
28
|
+
* Initialize only the requested context keys (plus a fake `'session'`) using info from the real filesystem.
|
|
22
29
|
*
|
|
23
|
-
* The returned `Session` object contains:
|
|
30
|
+
* The returned `Session` object is a mock which contains:
|
|
24
31
|
* - `config` from the filesystem (with defaults if there is no config)
|
|
25
32
|
* - `cachePath` set to `appPath/.cache` to prevent interference with the real cache or other tests
|
|
26
33
|
* - `resolveMap` will be an empty object unless `params.createResolveMap` is true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMockContext.d.ts","sourceRoot":"","sources":["../../src/common/createMockContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createMockContext.d.ts","sourceRoot":"","sources":["../../src/common/createMockContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAI1D,OAAO,EAAmB,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAA6B,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1F,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAqB,KAAK,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAEnF;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC/D,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,sFAAsF;IACtF,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,GAAG,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,KAAK,GAAG,SAAS,CAAC,CAAC,CAqBhE;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAC9C,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,KAAK,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAKtF;AAED,KAAK,kBAAkB,GAAG,OAAO,CAAC,MAAM,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,mBAAmB,CAAC,CAAC;AAE9F;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAAC,YAAY,SAAS,kBAAkB,EACpF,MAAM,EAAE,wBAAwB,GAAG;IACjC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,sFAAsF;IACtF,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,GACA,OAAO,CAAC,cAAc,CAAC,YAAY,EAAE,MAAM,OAAO,CAAC,CAAC,CAgDtD"}
|
|
@@ -1,39 +1,44 @@
|
|
|
1
1
|
import { createPackageDefinitions, readConfig } from '@ms-cloudpack/config';
|
|
2
|
-
import { createSession } from './createSession.js';
|
|
3
|
-
import { createNoOpTelemetryClient } from '@ms-cloudpack/telemetry';
|
|
4
|
-
import { noLoggingConfig, TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
5
|
-
import { TaskRunner } from '../utilities/TaskRunner.js';
|
|
6
|
-
import { PackageHashes } from '@ms-cloudpack/package-hashes';
|
|
7
2
|
import { createDataBus } from '@ms-cloudpack/data-bus';
|
|
3
|
+
import { PackageHashes } from '@ms-cloudpack/package-hashes';
|
|
4
|
+
import { noLoggingConfig, TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
5
|
+
import { createNoOpTelemetryClient } from '@ms-cloudpack/telemetry';
|
|
8
6
|
import path from 'path';
|
|
7
|
+
import { TaskRunner } from '../utilities/TaskRunner.js';
|
|
9
8
|
import { createMockSession } from './createMockSession.js';
|
|
9
|
+
import { createSession } from './createSession.js';
|
|
10
10
|
/**
|
|
11
11
|
* Create a mock context using info from the real filesystem.
|
|
12
12
|
* This is suitable for most tests using `ensurePackageBundled` and other scenarios.
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
|
+
* Unless `sessionOptions.cachePath` is provided, it will use `<appPath>/.cache` to avoid
|
|
15
|
+
* pollution of global state.
|
|
14
16
|
*/
|
|
15
17
|
export async function createMockContext(params) {
|
|
16
|
-
const { appPath, sessionOptions, telemetryClient = createNoOpTelemetryClient() } = params;
|
|
18
|
+
const { appPath, sessionOptions, telemetryClient = createNoOpTelemetryClient(), reporter = new TaskReporter(noLoggingConfig), } = params;
|
|
17
19
|
const config = await readConfig(appPath);
|
|
18
20
|
const packages = createPackageDefinitions({ config });
|
|
19
|
-
const reporter = new TaskReporter(noLoggingConfig);
|
|
20
21
|
const session = await createSession({ config, cachePath: path.join(appPath, '.cache'), ...sessionOptions }, { reporter, packages, telemetryClient });
|
|
21
22
|
const taskRunner = new TaskRunner();
|
|
22
23
|
const packageHashes = new PackageHashes({
|
|
23
24
|
cwd: appPath,
|
|
24
25
|
context: { config, packages, resolveMap: session.resolveMap },
|
|
25
26
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
return { reporter, taskRunner, telemetryClient, packageHashes, packages, session };
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Like {@link createMockContext} (uses real filesystem and session), but also initializes a data bus.
|
|
31
|
+
*/
|
|
32
|
+
export async function createMockContextWithBus(params) {
|
|
33
|
+
const context = await createMockContext(params);
|
|
34
|
+
const bus = createDataBus();
|
|
35
|
+
context.taskRunner.connectToBus(bus);
|
|
36
|
+
return { ...context, bus };
|
|
32
37
|
}
|
|
33
38
|
/**
|
|
34
|
-
* Initialize only the requested context keys (plus `'session'`) using info from the real filesystem.
|
|
39
|
+
* Initialize only the requested context keys (plus a fake `'session'`) using info from the real filesystem.
|
|
35
40
|
*
|
|
36
|
-
* The returned `Session` object contains:
|
|
41
|
+
* The returned `Session` object is a mock which contains:
|
|
37
42
|
* - `config` from the filesystem (with defaults if there is no config)
|
|
38
43
|
* - `cachePath` set to `appPath/.cache` to prevent interference with the real cache or other tests
|
|
39
44
|
* - `resolveMap` will be an empty object unless `params.createResolveMap` is true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMockContext.js","sourceRoot":"","sources":["../../src/common/createMockContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createMockContext.js","sourceRoot":"","sources":["../../src/common/createMockContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAwB,MAAM,yBAAyB,CAAC;AAC1F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAiC,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAA6B,MAAM,oBAAoB,CAAC;AAG9E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAMvC;IACC,MAAM,EACJ,OAAO,EACP,cAAc,EACd,eAAe,GAAG,yBAAyB,EAAE,EAC7C,QAAQ,GAAG,IAAI,YAAY,CAAC,eAAe,CAAC,GAC7C,GAAG,MAAM,CAAC;IAEX,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,MAAM,aAAa,CACjC,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,GAAG,cAAc,EAAE,EACtE,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CACxC,CAAC;IACF,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IACpC,MAAM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,WAAW,EAAE,CAAC;QAC9B,QAAQ,GAAG,EAAE,CAAC;YACZ,KAAK,KAAK;gBACR,OAAO,CAAC,UAAU,KAAK,IAAI,UAAU,EAAE,CAAC;gBACxC,OAAO,CAAC,GAAG,GAAG,aAAa,EAAE,CAAC;gBAC9B,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBAC7C,MAAM;YACR,KAAK,UAAU;gBACb,oEAAoE;gBACpE,OAAO,CAAC,QAAQ,GAAG,QAAS,CAAC;gBAC7B,MAAM;YACR,KAAK,YAAY;gBACf,OAAO,CAAC,UAAU,KAAK,IAAI,UAAU,EAAE,CAAC;gBACxC,MAAM;YACR,KAAK,eAAe;gBAClB,OAAO,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC;oBACxC,GAAG,EAAE,OAAO;oBACZ,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;iBAC9D,CAAC,CAAC;gBACH,MAAM;YACR,KAAK,UAAU;gBACb,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBAC5B,MAAM;YACR,KAAK,iBAAiB;gBACpB,OAAO,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,yBAAyB,EAAE,CAAC;gBAChF,MAAM;YACR,KAAK,SAAS;gBACZ,MAAM;YACR;gBACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type { Session } from '@ms-cloudpack/common-types';\nimport { createPackageDefinitions, readConfig } from '@ms-cloudpack/config';\nimport { createDataBus } from '@ms-cloudpack/data-bus';\nimport { PackageHashes } from '@ms-cloudpack/package-hashes';\nimport { noLoggingConfig, TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { createNoOpTelemetryClient, type TelemetryClient } from '@ms-cloudpack/telemetry';\nimport path from 'path';\nimport type { Context, PartialContext } from '../types/Context.js';\nimport { TaskRunner } from '../utilities/TaskRunner.js';\nimport { createMockSession, type CreateMockSessionOptions } from './createMockSession.js';\nimport { createSession, type CreateSessionOptions } from './createSession.js';\nimport type { EnsurePackageBundledContext } from '../apis/ensurePackageBundled.js';\n\n/**\n * Create a mock context using info from the real filesystem.\n * This is suitable for most tests using `ensurePackageBundled` and other scenarios.\n *\n * Unless `sessionOptions.cachePath` is provided, it will use `<appPath>/.cache` to avoid\n * pollution of global state.\n */\nexport async function createMockContext(params: {\n appPath: string;\n sessionOptions?: Partial<Omit<CreateSessionOptions, 'config'>>;\n reporter?: TaskReporter;\n /** No-op telemetry client. You might want to create this only once and pass it in. */\n telemetryClient?: TelemetryClient;\n}): Promise<Omit<EnsurePackageBundledContext, 'bus' | 'watcher'>> {\n const {\n appPath,\n sessionOptions,\n telemetryClient = createNoOpTelemetryClient(),\n reporter = new TaskReporter(noLoggingConfig),\n } = params;\n\n const config = await readConfig(appPath);\n const packages = createPackageDefinitions({ config });\n const session = await createSession(\n { config, cachePath: path.join(appPath, '.cache'), ...sessionOptions },\n { reporter, packages, telemetryClient },\n );\n const taskRunner = new TaskRunner();\n const packageHashes = new PackageHashes({\n cwd: appPath,\n context: { config, packages, resolveMap: session.resolveMap },\n });\n\n return { reporter, taskRunner, telemetryClient, packageHashes, packages, session };\n}\n\n/**\n * Like {@link createMockContext} (uses real filesystem and session), but also initializes a data bus.\n */\nexport async function createMockContextWithBus(\n params: Parameters<typeof createMockContext>[0],\n): Promise<Omit<EnsurePackageBundledContext, 'bus' | 'watcher'> & Pick<Context, 'bus'>> {\n const context = await createMockContext(params);\n const bus = createDataBus();\n context.taskRunner.connectToBus(bus);\n return { ...context, bus };\n}\n\ntype AllowedContextKeys = Exclude<keyof Context, 'watcher' | 'dispose' | 'remoteCacheClient'>;\n\n/**\n * Initialize only the requested context keys (plus a fake `'session'`) using info from the real filesystem.\n *\n * The returned `Session` object is a mock which contains:\n * - `config` from the filesystem (with defaults if there is no config)\n * - `cachePath` set to `appPath/.cache` to prevent interference with the real cache or other tests\n * - `resolveMap` will be an empty object unless `params.createResolveMap` is true\n * - Basic mocks of other properties which can be updated as needed\n */\nexport async function createPartialMockContext<TContextKeys extends AllowedContextKeys>(\n params: CreateMockSessionOptions & {\n context: TContextKeys[];\n /** No-op telemetry client. You might want to create this only once and pass it in. */\n telemetryClient?: TelemetryClient;\n },\n): Promise<PartialContext<TContextKeys, keyof Session>> {\n const { appPath } = params;\n const contextKeys = params.context as AllowedContextKeys[];\n\n const config = await readConfig(appPath);\n const packages = createPackageDefinitions({ config });\n // Pass through the real config and package definitions when creating the session,\n // to allow creating a real resolve map if needed.\n const session = await createMockSession(params, { config, packages });\n // Only create a reporter (which overrides console logging) if requested\n const reporter = contextKeys.includes('reporter' as TContextKeys) ? new TaskReporter(noLoggingConfig) : undefined;\n\n const context = { session } as Pick<Context, AllowedContextKeys>;\n\n for (const key of contextKeys) {\n switch (key) {\n case 'bus':\n context.taskRunner ??= new TaskRunner();\n context.bus = createDataBus();\n context.taskRunner.connectToBus(context.bus);\n break;\n case 'reporter':\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n context.reporter = reporter!;\n break;\n case 'taskRunner':\n context.taskRunner ??= new TaskRunner();\n break;\n case 'packageHashes':\n context.packageHashes = new PackageHashes({\n cwd: appPath,\n context: { config, packages, resolveMap: session.resolveMap },\n });\n break;\n case 'packages':\n context.packages = packages;\n break;\n case 'telemetryClient':\n context.telemetryClient = params.telemetryClient || createNoOpTelemetryClient();\n break;\n case 'session':\n break;\n default:\n throw new Error(`Unsupported context key: ${key}`);\n }\n }\n\n return context;\n}\n"]}
|
|
@@ -11,7 +11,7 @@ export interface CreateMockSessionOptions {
|
|
|
11
11
|
/**
|
|
12
12
|
* Create a mock session without reading anything from the filesystem.
|
|
13
13
|
*/
|
|
14
|
-
export declare function createMockSessionNoFS(params: Omit<CreateMockSessionOptions, '
|
|
14
|
+
export declare function createMockSessionNoFS(params: Omit<CreateMockSessionOptions, 'createResolveMap'>): Session;
|
|
15
15
|
/**
|
|
16
16
|
* Create a mock session. The returned object contains:
|
|
17
17
|
* - `config` from the filesystem (with defaults if there is no config)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMockSession.d.ts","sourceRoot":"","sources":["../../src/common/createMockSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAMpG,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,
|
|
1
|
+
{"version":3,"file":"createMockSession.d.ts","sourceRoot":"","sources":["../../src/common/createMockSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAMpG,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,IAAI,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,GAAG,OAAO,CAqBzG;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,wBAAwB,EAChC,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,QAAQ,CAAC,EAAE,uBAAuB,CAAC;CACpC,GACA,OAAO,CAAC,OAAO,CAAC,CAWlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMockSession.js","sourceRoot":"","sources":["../../src/common/createMockSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAYxB;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,
|
|
1
|
+
{"version":3,"file":"createMockSession.js","sourceRoot":"","sources":["../../src/common/createMockSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAYxB;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAA0D;IAC9F,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,UAAU,EAAE,EAAE,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,GAAG,MAAM,CAAC;IAC/F,MAAM,OAAO,GAAY;QACvB,EAAE,EAAE,SAAS;QACb,SAAS;QACT,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE;QACnD,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;QACnC,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,CAAC;QACX,IAAI,EAAE,EAAE;QACR,cAAc,EAAE,EAAE;QAClB,cAAc,EAAE,CAAC;QACjB,uBAAuB,EAAE,GAAG,EAAE,GAAE,CAAC;QACjC,sBAAsB,EAAE,GAAG,EAAE,GAAE,CAAC;QAChC,SAAS,EAAE,SAAS;QACpB,kBAAkB,EAAE,IAAI,GAAG,EAAE;QAC7B,WAAW,EAAE,EAAE;QACf,aAAa,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;QAC7C,gBAAgB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;KACjD,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAgC,EAChC,OAGC;IAED,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAC3B,MAAM,OAAO,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IAChE,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACvE,CAAC;QACD,OAAO,CAAC,UAAU,GAAG,MAAM,gBAAgB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9G,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type { CloudpackConfig, PackageDefinitionsCache, Session } from '@ms-cloudpack/common-types';\nimport { readConfig } from '@ms-cloudpack/config';\nimport { createResolveMap } from '@ms-cloudpack/package-utilities';\nimport { randomUUID } from 'crypto';\nimport path from 'path';\n\nexport interface CreateMockSessionOptions {\n appPath: string;\n /** Custom cache path. Defaults to `appPath/.cache`. */\n cachePath?: string;\n /** Whether to create a real resolve map. */\n createResolveMap?: boolean;\n /** Session ID. Defaults to a random UUID. */\n sessionId?: string;\n}\n\n/**\n * Create a mock session without reading anything from the filesystem.\n */\nexport function createMockSessionNoFS(params: Omit<CreateMockSessionOptions, 'createResolveMap'>): Session {\n const { appPath, sessionId = randomUUID(), cachePath = path.join(appPath, '.cache') } = params;\n const session: Session = {\n id: sessionId,\n cachePath,\n config: { appPath, mode: 'library', generated: {} },\n projectName: path.basename(appPath),\n resolveMap: {},\n sequence: 0,\n urls: {},\n targetVersions: {},\n sessionVersion: 1,\n incrementSessionVersion: () => {},\n incrementTargetVersion: () => {},\n importMap: undefined,\n packageImportPaths: new Map(),\n linkedPaths: [],\n addLinkedPath: () => Promise.resolve(session),\n removeLinkedPath: () => Promise.resolve(session),\n };\n return session;\n}\n\n/**\n * Create a mock session. The returned object contains:\n * - `config` from the filesystem (with defaults if there is no config)\n * - `cachePath` set to `appPath/.cache` to prevent interference with the real cache or other tests\n * - `resolveMap` will be an empty object unless `params.createResolveMap` is true\n * - Basic mocks of other properties which can be updated as needed\n */\nexport async function createMockSession(\n params: CreateMockSessionOptions,\n context?: {\n config?: CloudpackConfig;\n packages?: PackageDefinitionsCache;\n },\n): Promise<Session> {\n const { appPath } = params;\n const session = createMockSessionNoFS(params);\n session.config = context?.config || (await readConfig(appPath));\n if (params.createResolveMap) {\n if (!context?.packages) {\n throw new Error('Cannot create a real resolve map without packages');\n }\n session.resolveMap = await createResolveMap({ appPath, rootPath: appPath }, { packages: context.packages });\n }\n return session;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CloudpackConfig, Session } from '@ms-cloudpack/common-types';
|
|
1
|
+
import type { CloudpackConfig, Session, ResolveMap } from '@ms-cloudpack/common-types';
|
|
2
2
|
import type { Context } from '../types/Context.js';
|
|
3
3
|
export type SessionVersions = {
|
|
4
4
|
sessionVersion: number;
|
|
@@ -20,6 +20,10 @@ export interface CreateSessionOptions {
|
|
|
20
20
|
* This should only be used for the `bundle` command when it's bundling the current package.
|
|
21
21
|
*/
|
|
22
22
|
skipResolveDependencies?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Mock resolve map for testing
|
|
25
|
+
*/
|
|
26
|
+
resolveMap?: ResolveMap;
|
|
23
27
|
}
|
|
24
28
|
export declare function createSession(options: CreateSessionOptions, context: Pick<Context, 'reporter' | 'packages' | 'telemetryClient'>): Promise<Session>;
|
|
25
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAc,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAc,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAMnG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAInD,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,eAAe,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,iBAAiB,CAAC,GAClE,OAAO,CAAC,OAAO,CAAC,CAoGlB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/D"}
|
|
@@ -9,7 +9,7 @@ export async function createSession(options, context) {
|
|
|
9
9
|
const { appPath } = config;
|
|
10
10
|
const projectName = path.basename(appPath);
|
|
11
11
|
const id = randomUUID();
|
|
12
|
-
let resolveMap = await createResolveMapTask({ appPath, additionalPaths, skipResolveDependencies }, context);
|
|
12
|
+
let resolveMap = options.resolveMap || (await createResolveMapTask({ appPath, additionalPaths, skipResolveDependencies }, context));
|
|
13
13
|
let importMap = undefined;
|
|
14
14
|
const versionsPath = _getSessionVersionsPath(appPath);
|
|
15
15
|
const previousVersions = await readJson(versionsPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSession.js","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"createSession.js","sourceRoot":"","sources":["../../src/common/createSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CA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,MAAM,oBAAoB,CACrC,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,uBAAuB,EAAE,KAAK,EAAE,EACzE,OAAO,CACR,CAAC;YAEF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;QACrC,CAAC;QACD,gBAAgB,EAAE,KAAK,EAAE,UAAsB,EAAE,EAAE;YACjD,IAAI,uBAAuB,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;YAClF,CAAC;YAED,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC;YACvE,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;gBACjB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;YACrC,CAAC;YAED,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC7B,UAAU,GAAG,MAAM,oBAAoB,CACrC,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,uBAAuB,EAAE,KAAK,EAAE,EACzE,OAAO,CACR,CAAC;YAEF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;QACrC,CAAC;QACD,SAAS;KACV,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import type { CloudpackConfig, Session, LinkedPath, ResolveMap } from '@ms-cloudpack/common-types';\nimport { getCachePath, getLocalCachePath } from '@ms-cloudpack/config';\nimport type { ImportMap } from '@ms-cloudpack/import-map';\nimport { readJson, writeJson, writeJsonSync } from '@ms-cloudpack/json-utilities';\nimport fs from 'fs';\nimport path from 'path';\nimport type { Context } from '../types/Context.js';\nimport { createResolveMapTask } from '../utilities/createResolveMapTask.js';\nimport { randomUUID } from 'crypto';\n\nexport type SessionVersions = {\n sessionVersion: number;\n targetVersions: Record<string, number>;\n};\n\nexport interface CreateSessionOptions {\n config: CloudpackConfig;\n /**\n * Any additional packages whose dependencies we want to resolve, such as the overlay.\n */\n additionalPaths?: string[];\n /**\n * Custom cache folder for the session.\n * If not provided, will use the one from user preferences if set, or the default cache path.\n */\n cachePath?: string;\n /**\n * Skip full dependency resolution (`resolveMap` will only contain the package at `config.appPath`).\n * This should only be used for the `bundle` command when it's bundling the current package.\n */\n skipResolveDependencies?: boolean;\n /**\n * Mock resolve map for testing\n */\n resolveMap?: ResolveMap;\n}\n\nexport async function createSession(\n options: CreateSessionOptions,\n context: Pick<Context, 'reporter' | 'packages' | 'telemetryClient'>,\n): Promise<Session> {\n const { config, additionalPaths, skipResolveDependencies } = options;\n const { appPath } = config;\n\n const projectName = path.basename(appPath);\n const id = randomUUID();\n let resolveMap =\n options.resolveMap || (await createResolveMapTask({ appPath, additionalPaths, skipResolveDependencies }, context));\n\n let importMap: ImportMap | undefined = undefined;\n\n const versionsPath = _getSessionVersionsPath(appPath);\n const previousVersions = await readJson<SessionVersions>(versionsPath);\n const versions = previousVersions || { sessionVersion: 0, targetVersions: {} };\n if (!previousVersions) {\n await writeJson(versionsPath, versions);\n }\n\n // In the future, we might put all the user preferences in the session, but right now the only\n // preference is cachePath, so we just read that and save the custom or default value.\n const cachePath = await getCachePath(options.cachePath);\n\n const linkedPaths: LinkedPath[] = [];\n\n return {\n id,\n config,\n projectName,\n get resolveMap() {\n return resolveMap;\n },\n set resolveMap(newResolveMap) {\n // If the resolve map changes, clear the import map\n // so that it is regenerated on the next request\n importMap = undefined;\n resolveMap = newResolveMap;\n },\n sequence: 0,\n urls: {},\n targetVersions: versions.targetVersions,\n get sessionVersion() {\n return versions.sessionVersion;\n },\n incrementSessionVersion: () => {\n versions.sessionVersion++;\n importMap = undefined;\n // Write the new session version to the file\n fs.writeFileSync(versionsPath, JSON.stringify(versions, null, 2));\n },\n incrementTargetVersion: (inputPath: string) => {\n versions.targetVersions[inputPath] ??= 0;\n versions.targetVersions[inputPath]++;\n importMap = undefined;\n writeJsonSync(versionsPath, versions);\n },\n get importMap() {\n return importMap;\n },\n set importMap(newImportMap) {\n importMap = newImportMap;\n },\n packageImportPaths: new Map(),\n linkedPaths,\n addLinkedPath: async (linkedPath: LinkedPath) => {\n if (skipResolveDependencies) {\n throw new Error('Cannot use `addLinkedPath` with `skipResolveDependencies`');\n }\n\n if (linkedPaths.some((p) => p.path === linkedPath.path)) {\n return { resolveMap, linkedPaths };\n }\n\n linkedPaths.push(linkedPath);\n resolveMap = await createResolveMapTask(\n { appPath, additionalPaths, linkedPaths, skipResolveDependencies: false },\n context,\n );\n\n return { resolveMap, linkedPaths };\n },\n removeLinkedPath: async (linkedPath: LinkedPath) => {\n if (skipResolveDependencies) {\n throw new Error('Cannot use `removeLinkedPath` with `skipResolveDependencies`');\n }\n\n const index = linkedPaths.findIndex((p) => p.path === linkedPath.path);\n if (index === -1) {\n return { resolveMap, linkedPaths };\n }\n\n linkedPaths.splice(index, 1);\n resolveMap = await createResolveMapTask(\n { appPath, additionalPaths, linkedPaths, skipResolveDependencies: false },\n context,\n );\n\n return { resolveMap, linkedPaths };\n },\n cachePath,\n };\n}\n\n/**\n * Get `sessionVersions.json` path. Exported for the test.\n * @internal\n */\nexport function _getSessionVersionsPath(appPath: string): string {\n return path.join(getLocalCachePath(appPath), 'sessionVersions.json');\n}\n"]}
|
package/lib/data/busSources.d.ts
CHANGED
|
@@ -1,269 +1,56 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
import { type DataBusPath } from '@ms-cloudpack/data-bus';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
3
2
|
/**
|
|
4
3
|
* Used for tracking the reload count.
|
|
5
4
|
*/
|
|
6
|
-
export declare const reloadCountSource: DataBusPath<z.
|
|
5
|
+
export declare const reloadCountSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniNumber<number>>;
|
|
7
6
|
/**
|
|
8
7
|
* Used for tracking the task stats displayed in the badge.
|
|
9
8
|
*/
|
|
10
|
-
export declare const taskStatsSource: DataBusPath<z.
|
|
11
|
-
status: z.ZodUnion<[z.ZodLiteral<"idle">, z.ZodUnion<[z.ZodLiteral<"pending">, z.ZodLiteral<"unknown">]>]>;
|
|
12
|
-
remainingTasks: z.ZodNumber;
|
|
13
|
-
totalTasks: z.ZodNumber;
|
|
14
|
-
totalErrors: z.ZodNumber;
|
|
15
|
-
totalWarnings: z.ZodNumber;
|
|
16
|
-
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
status: "idle" | "unknown" | "pending";
|
|
18
|
-
remainingTasks: number;
|
|
19
|
-
totalTasks: number;
|
|
20
|
-
totalErrors: number;
|
|
21
|
-
totalWarnings: number;
|
|
22
|
-
}, {
|
|
23
|
-
status: "idle" | "unknown" | "pending";
|
|
24
|
-
remainingTasks: number;
|
|
25
|
-
totalTasks: number;
|
|
26
|
-
totalErrors: number;
|
|
27
|
-
totalWarnings: number;
|
|
28
|
-
}>>;
|
|
9
|
+
export declare const taskStatsSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("../index.browser.js").TaskStats>, z.core.$strict>>;
|
|
29
10
|
/**
|
|
30
11
|
* Used for tracking the list of tasks.
|
|
31
12
|
*/
|
|
32
|
-
export declare const taskListSource: DataBusPath<z.
|
|
33
|
-
tasks: z.ZodArray<z.ZodObject<{
|
|
34
|
-
status: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"pending">, z.ZodLiteral<"complete">]>>;
|
|
35
|
-
timings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
36
|
-
name: z.ZodString;
|
|
37
|
-
start: z.ZodNumber;
|
|
38
|
-
end: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
threwException: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
-
}, "strip", z.ZodTypeAny, {
|
|
41
|
-
name: string;
|
|
42
|
-
start: number;
|
|
43
|
-
end?: number | undefined;
|
|
44
|
-
threwException?: boolean | undefined;
|
|
45
|
-
}, {
|
|
46
|
-
name: string;
|
|
47
|
-
start: number;
|
|
48
|
-
end?: number | undefined;
|
|
49
|
-
threwException?: boolean | undefined;
|
|
50
|
-
}>, "many">>;
|
|
51
|
-
startTime: z.ZodNumber;
|
|
52
|
-
durationMilliseconds: z.ZodOptional<z.ZodNumber>;
|
|
53
|
-
lastUpdated: z.ZodOptional<z.ZodNumber>;
|
|
54
|
-
name: z.ZodOptional<z.ZodString>;
|
|
55
|
-
inputPath: z.ZodOptional<z.ZodString>;
|
|
56
|
-
outputPath: z.ZodOptional<z.ZodString>;
|
|
57
|
-
} & {
|
|
58
|
-
id: z.ZodString;
|
|
59
|
-
errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
60
|
-
text: z.ZodType<string, z.ZodTypeDef, string>;
|
|
61
|
-
source: z.ZodType<string, z.ZodTypeDef, string>;
|
|
62
|
-
location: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageLocation | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageLocation | undefined>;
|
|
63
|
-
notes: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined>;
|
|
64
|
-
}, "strict", z.ZodTypeAny, import("@ms-cloudpack/common-types").BundleMessage, import("@ms-cloudpack/common-types").BundleMessage>, "many">>;
|
|
65
|
-
warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
66
|
-
text: z.ZodType<string, z.ZodTypeDef, string>;
|
|
67
|
-
source: z.ZodType<string, z.ZodTypeDef, string>;
|
|
68
|
-
location: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageLocation | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageLocation | undefined>;
|
|
69
|
-
notes: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined>;
|
|
70
|
-
}, "strict", z.ZodTypeAny, import("@ms-cloudpack/common-types").BundleMessage, import("@ms-cloudpack/common-types").BundleMessage>, "many">>;
|
|
71
|
-
}, "strip", z.ZodTypeAny, {
|
|
72
|
-
id: string;
|
|
73
|
-
startTime: number;
|
|
74
|
-
status?: "pending" | "complete" | undefined;
|
|
75
|
-
name?: string | undefined;
|
|
76
|
-
inputPath?: string | undefined;
|
|
77
|
-
outputPath?: string | undefined;
|
|
78
|
-
errors?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
|
|
79
|
-
warnings?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
|
|
80
|
-
timings?: {
|
|
81
|
-
name: string;
|
|
82
|
-
start: number;
|
|
83
|
-
end?: number | undefined;
|
|
84
|
-
threwException?: boolean | undefined;
|
|
85
|
-
}[] | undefined;
|
|
86
|
-
durationMilliseconds?: number | undefined;
|
|
87
|
-
lastUpdated?: number | undefined;
|
|
88
|
-
}, {
|
|
89
|
-
id: string;
|
|
90
|
-
startTime: number;
|
|
91
|
-
status?: "pending" | "complete" | undefined;
|
|
92
|
-
name?: string | undefined;
|
|
93
|
-
inputPath?: string | undefined;
|
|
94
|
-
outputPath?: string | undefined;
|
|
95
|
-
errors?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
|
|
96
|
-
warnings?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
|
|
97
|
-
timings?: {
|
|
98
|
-
name: string;
|
|
99
|
-
start: number;
|
|
100
|
-
end?: number | undefined;
|
|
101
|
-
threwException?: boolean | undefined;
|
|
102
|
-
}[] | undefined;
|
|
103
|
-
durationMilliseconds?: number | undefined;
|
|
104
|
-
lastUpdated?: number | undefined;
|
|
105
|
-
}>, "many">;
|
|
106
|
-
}, "strip", z.ZodTypeAny, {
|
|
107
|
-
tasks: {
|
|
108
|
-
id: string;
|
|
109
|
-
startTime: number;
|
|
110
|
-
status?: "pending" | "complete" | undefined;
|
|
111
|
-
name?: string | undefined;
|
|
112
|
-
inputPath?: string | undefined;
|
|
113
|
-
outputPath?: string | undefined;
|
|
114
|
-
errors?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
|
|
115
|
-
warnings?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
|
|
116
|
-
timings?: {
|
|
117
|
-
name: string;
|
|
118
|
-
start: number;
|
|
119
|
-
end?: number | undefined;
|
|
120
|
-
threwException?: boolean | undefined;
|
|
121
|
-
}[] | undefined;
|
|
122
|
-
durationMilliseconds?: number | undefined;
|
|
123
|
-
lastUpdated?: number | undefined;
|
|
124
|
-
}[];
|
|
125
|
-
}, {
|
|
126
|
-
tasks: {
|
|
127
|
-
id: string;
|
|
128
|
-
startTime: number;
|
|
129
|
-
status?: "pending" | "complete" | undefined;
|
|
130
|
-
name?: string | undefined;
|
|
131
|
-
inputPath?: string | undefined;
|
|
132
|
-
outputPath?: string | undefined;
|
|
133
|
-
errors?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
|
|
134
|
-
warnings?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
|
|
135
|
-
timings?: {
|
|
136
|
-
name: string;
|
|
137
|
-
start: number;
|
|
138
|
-
end?: number | undefined;
|
|
139
|
-
threwException?: boolean | undefined;
|
|
140
|
-
}[] | undefined;
|
|
141
|
-
durationMilliseconds?: number | undefined;
|
|
142
|
-
lastUpdated?: number | undefined;
|
|
143
|
-
}[];
|
|
144
|
-
}>>;
|
|
13
|
+
export declare const taskListSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("../index.browser.js").TaskList>, z.core.$strict>>;
|
|
145
14
|
/**
|
|
146
15
|
* Used for tracking entry errors: `Failed to resolve module specifier "${packageName}@${version}${filePath}".`
|
|
147
16
|
* This is used to display errors in the UI and to notify the user of the error when autoUpdateEntries is enabled.
|
|
148
17
|
*/
|
|
149
|
-
export declare const errorEntrySource: DataBusPath<z.
|
|
18
|
+
export declare const errorEntrySource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniString<string>>;
|
|
150
19
|
/**
|
|
151
20
|
* Used for tracking link updates.
|
|
152
21
|
*/
|
|
153
|
-
export declare const linkUpdateSource: DataBusPath<z.
|
|
154
|
-
packagePath: z.
|
|
155
|
-
hash: z.
|
|
156
|
-
definition: z.
|
|
157
|
-
name: z.
|
|
158
|
-
version: z.
|
|
159
|
-
exports: z.
|
|
160
|
-
dependencies: z.
|
|
161
|
-
peerDependencies: z.
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
version: string;
|
|
165
|
-
exports?: any;
|
|
166
|
-
dependencies?: Record<string, string | undefined> | undefined;
|
|
167
|
-
peerDependencies?: Record<string, string | undefined> | undefined;
|
|
168
|
-
}, {
|
|
169
|
-
name: string;
|
|
170
|
-
version: string;
|
|
171
|
-
exports?: any;
|
|
172
|
-
dependencies?: Record<string, string | undefined> | undefined;
|
|
173
|
-
peerDependencies?: Record<string, string | undefined> | undefined;
|
|
174
|
-
}>>;
|
|
175
|
-
}, "strip", z.ZodTypeAny, {
|
|
176
|
-
packagePath: string;
|
|
177
|
-
hash?: string | undefined;
|
|
178
|
-
definition?: {
|
|
179
|
-
name: string;
|
|
180
|
-
version: string;
|
|
181
|
-
exports?: any;
|
|
182
|
-
dependencies?: Record<string, string | undefined> | undefined;
|
|
183
|
-
peerDependencies?: Record<string, string | undefined> | undefined;
|
|
184
|
-
} | undefined;
|
|
185
|
-
}, {
|
|
186
|
-
packagePath: string;
|
|
187
|
-
hash?: string | undefined;
|
|
188
|
-
definition?: {
|
|
189
|
-
name: string;
|
|
190
|
-
version: string;
|
|
191
|
-
exports?: any;
|
|
192
|
-
dependencies?: Record<string, string | undefined> | undefined;
|
|
193
|
-
peerDependencies?: Record<string, string | undefined> | undefined;
|
|
194
|
-
} | undefined;
|
|
195
|
-
}>>;
|
|
22
|
+
export declare const linkUpdateSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<{
|
|
23
|
+
packagePath: z.ZodMiniString<string>;
|
|
24
|
+
hash: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
25
|
+
definition: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
26
|
+
name: z.ZodMiniString<string>;
|
|
27
|
+
version: z.ZodMiniString<string>;
|
|
28
|
+
exports: z.ZodMiniOptional<z.ZodMiniAny>;
|
|
29
|
+
dependencies: z.ZodMiniOptional<z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniUndefined, z.ZodMiniString<string>]>>>>;
|
|
30
|
+
peerDependencies: z.ZodMiniOptional<z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniUndefined, z.ZodMiniString<string>]>>>>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
196
33
|
/**
|
|
197
34
|
* Used for fetching the host configuration.
|
|
198
35
|
*/
|
|
199
|
-
export declare const linkConfigSource: DataBusPath<z.
|
|
36
|
+
export declare const linkConfigSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniType<import("@ms-cloudpack/common-types").CloudpackLinkConfig, import("@ms-cloudpack/common-types").CloudpackLinkConfig, z.core.$ZodTypeInternals<import("@ms-cloudpack/common-types").CloudpackLinkConfig, import("@ms-cloudpack/common-types").CloudpackLinkConfig>>>;
|
|
200
37
|
/**
|
|
201
38
|
* Used for tracking linked paths.
|
|
202
39
|
*/
|
|
203
|
-
export declare const linkPathsSource: DataBusPath<z.
|
|
204
|
-
linkedPath: z.
|
|
205
|
-
|
|
206
|
-
rootPath: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
207
|
-
includeAll: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
|
|
208
|
-
ignoredPackages: z.ZodType<string[] | undefined, z.ZodTypeDef, string[] | undefined>;
|
|
209
|
-
ignoreResolutions: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
|
|
210
|
-
resolveStrategy: z.ZodType<"dedupe" | "duplicate" | undefined, z.ZodTypeDef, "dedupe" | "duplicate" | undefined>;
|
|
211
|
-
remote: z.ZodType<{
|
|
212
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
213
|
-
hostUrl: string;
|
|
214
|
-
packages: import("@ms-cloudpack/common-types").SerializablePackageDefinitionsCache;
|
|
215
|
-
packageHashes: import("@ms-cloudpack/common-types").SerializablePackageHashesCache;
|
|
216
|
-
} | undefined, z.ZodTypeDef, {
|
|
217
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
218
|
-
hostUrl: string;
|
|
219
|
-
packages: import("@ms-cloudpack/common-types").SerializablePackageDefinitionsCache;
|
|
220
|
-
packageHashes: import("@ms-cloudpack/common-types").SerializablePackageHashesCache;
|
|
221
|
-
} | undefined>;
|
|
222
|
-
}, "strict", z.ZodTypeAny, import("@ms-cloudpack/common-types").LinkedPath, import("@ms-cloudpack/common-types").LinkedPath>;
|
|
223
|
-
}, "strip", z.ZodTypeAny, {
|
|
224
|
-
linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
|
|
225
|
-
}, {
|
|
226
|
-
linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
|
|
227
|
-
}>>;
|
|
40
|
+
export declare const linkPathsSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<{
|
|
41
|
+
linkedPath: z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("@ms-cloudpack/common-types").LinkedPath>, z.core.$strict>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
228
43
|
/**
|
|
229
44
|
* Used for tracking when linking is done.
|
|
230
45
|
*/
|
|
231
|
-
export declare const linkDoneSource: DataBusPath<z.
|
|
232
|
-
resolveMap: z.
|
|
233
|
-
linkedPaths: z.
|
|
234
|
-
|
|
235
|
-
rootPath: z.ZodType<string | undefined, z.ZodTypeDef, string | undefined>;
|
|
236
|
-
includeAll: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
|
|
237
|
-
ignoredPackages: z.ZodType<string[] | undefined, z.ZodTypeDef, string[] | undefined>;
|
|
238
|
-
ignoreResolutions: z.ZodType<boolean | undefined, z.ZodTypeDef, boolean | undefined>;
|
|
239
|
-
resolveStrategy: z.ZodType<"dedupe" | "duplicate" | undefined, z.ZodTypeDef, "dedupe" | "duplicate" | undefined>;
|
|
240
|
-
remote: z.ZodType<{
|
|
241
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
242
|
-
hostUrl: string;
|
|
243
|
-
packages: import("@ms-cloudpack/common-types").SerializablePackageDefinitionsCache;
|
|
244
|
-
packageHashes: import("@ms-cloudpack/common-types").SerializablePackageHashesCache;
|
|
245
|
-
} | undefined, z.ZodTypeDef, {
|
|
246
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
247
|
-
hostUrl: string;
|
|
248
|
-
packages: import("@ms-cloudpack/common-types").SerializablePackageDefinitionsCache;
|
|
249
|
-
packageHashes: import("@ms-cloudpack/common-types").SerializablePackageHashesCache;
|
|
250
|
-
} | undefined>;
|
|
251
|
-
}, "strict", z.ZodTypeAny, import("@ms-cloudpack/common-types").LinkedPath, import("@ms-cloudpack/common-types").LinkedPath>, "many">;
|
|
252
|
-
}, "strip", z.ZodTypeAny, {
|
|
253
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
254
|
-
linkedPaths: import("@ms-cloudpack/common-types").LinkedPath[];
|
|
255
|
-
}, {
|
|
256
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
257
|
-
linkedPaths: import("@ms-cloudpack/common-types").LinkedPath[];
|
|
258
|
-
}>>;
|
|
46
|
+
export declare const linkDoneSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<{
|
|
47
|
+
resolveMap: z.ZodMiniType<import("@ms-cloudpack/common-types").ResolveMap, import("@ms-cloudpack/common-types").ResolveMap, z.core.$ZodTypeInternals<import("@ms-cloudpack/common-types").ResolveMap, import("@ms-cloudpack/common-types").ResolveMap>>;
|
|
48
|
+
linkedPaths: z.ZodMiniArray<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("@ms-cloudpack/common-types").LinkedPath>, z.core.$strict>>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
259
50
|
/**
|
|
260
51
|
* Used for detecting host disconnection on link.
|
|
261
52
|
*/
|
|
262
|
-
export declare const linkDisconnectedSource: DataBusPath<z.
|
|
263
|
-
reason: z.
|
|
264
|
-
},
|
|
265
|
-
reason: "lost" | "unreachable";
|
|
266
|
-
}, {
|
|
267
|
-
reason: "lost" | "unreachable";
|
|
268
|
-
}>>;
|
|
53
|
+
export declare const linkDisconnectedSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<{
|
|
54
|
+
reason: z.ZodMiniLiteral<"lost" | "unreachable">;
|
|
55
|
+
}, z.core.$strip>>;
|
|
269
56
|
//# sourceMappingURL=busSources.d.ts.map
|