@ms-cloudpack/cli 0.42.1 → 0.42.2
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/commands/bundle/bundle.d.ts +1 -1
- package/lib/commands/bundle/bundle.d.ts.map +1 -1
- package/lib/commands/bundle/bundle.js +6 -4
- package/lib/commands/bundle/bundle.js.map +1 -1
- package/lib/commands/init/bundleAndGetImports.d.ts.map +1 -1
- package/lib/commands/init/bundleAndGetImports.js +2 -3
- package/lib/commands/init/bundleAndGetImports.js.map +1 -1
- package/lib/commands/init/init.js +3 -3
- package/lib/commands/init/init.js.map +1 -1
- package/lib/commands/start/start.d.ts +1 -1
- package/lib/commands/start/start.d.ts.map +1 -1
- package/lib/commands/start/start.js +7 -7
- package/lib/commands/start/start.js.map +1 -1
- package/lib/commands/start/startBundleServer.d.ts.map +1 -1
- package/lib/commands/start/startBundleServer.js +1 -2
- package/lib/commands/start/startBundleServer.js.map +1 -1
- package/lib/commands/sync/sync.d.ts +1 -1
- package/lib/commands/sync/sync.d.ts.map +1 -1
- package/lib/commands/sync/sync.js +17 -4
- package/lib/commands/sync/sync.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -10
- package/lib/index.js.map +1 -1
- package/lib/initTelemetry.d.ts +3 -15
- package/lib/initTelemetry.d.ts.map +1 -1
- package/lib/initTelemetry.js +6 -19
- package/lib/initTelemetry.js.map +1 -1
- package/lib/setupReporting.d.ts +3 -0
- package/lib/setupReporting.d.ts.map +1 -0
- package/lib/{commands/start/setupReporting.js → setupReporting.js} +13 -3
- package/lib/setupReporting.js.map +1 -0
- package/lib/tasks/bundleTaskWorker.js +1 -1
- package/lib/tasks/bundleTaskWorker.js.map +1 -1
- package/lib/types/Watcher.d.ts +1 -1
- package/lib/types/Watcher.d.ts.map +1 -1
- package/lib/types/Watcher.js.map +1 -1
- package/package.json +4 -8
- package/lib/commands/start/createBundleRequestForPackage.d.ts +0 -11
- package/lib/commands/start/createBundleRequestForPackage.d.ts.map +0 -1
- package/lib/commands/start/createBundleRequestForPackage.js +0 -21
- package/lib/commands/start/createBundleRequestForPackage.js.map +0 -1
- package/lib/commands/start/createBundleTask.d.ts +0 -10
- package/lib/commands/start/createBundleTask.d.ts.map +0 -1
- package/lib/commands/start/createBundleTask.js +0 -42
- package/lib/commands/start/createBundleTask.js.map +0 -1
- package/lib/commands/start/setupReporting.d.ts +0 -3
- package/lib/commands/start/setupReporting.d.ts.map +0 -1
- package/lib/commands/start/setupReporting.js.map +0 -1
- package/lib/commands/sync/Task.d.ts +0 -6
- package/lib/commands/sync/Task.d.ts.map +0 -1
- package/lib/commands/sync/Task.js +0 -2
- package/lib/commands/sync/Task.js.map +0 -1
- package/lib/commands/sync/createDownloadTask.d.ts +0 -5
- package/lib/commands/sync/createDownloadTask.d.ts.map +0 -1
- package/lib/commands/sync/createDownloadTask.js +0 -22
- package/lib/commands/sync/createDownloadTask.js.map +0 -1
- package/lib/commands/sync/createUploadTask.d.ts +0 -5
- package/lib/commands/sync/createUploadTask.d.ts.map +0 -1
- package/lib/commands/sync/createUploadTask.js +0 -18
- package/lib/commands/sync/createUploadTask.js.map +0 -1
- package/lib/commands/sync/getPackagesToSync.d.ts +0 -9
- package/lib/commands/sync/getPackagesToSync.d.ts.map +0 -1
- package/lib/commands/sync/getPackagesToSync.js +0 -24
- package/lib/commands/sync/getPackagesToSync.js.map +0 -1
- package/lib/commands/sync/syncInternal.d.ts +0 -10
- package/lib/commands/sync/syncInternal.d.ts.map +0 -1
- package/lib/commands/sync/syncInternal.js +0 -39
- package/lib/commands/sync/syncInternal.js.map +0 -1
- package/lib/common/getBundleDetails.d.ts +0 -14
- package/lib/common/getBundleDetails.d.ts.map +0 -1
- package/lib/common/getBundleDetails.js +0 -35
- package/lib/common/getBundleDetails.js.map +0 -1
- package/lib/tasks/bundleTask.d.ts +0 -9
- package/lib/tasks/bundleTask.d.ts.map +0 -1
- package/lib/tasks/bundleTask.js +0 -119
- package/lib/tasks/bundleTask.js.map +0 -1
- package/lib/tasks/formatBundleErrors.d.ts +0 -9
- package/lib/tasks/formatBundleErrors.d.ts.map +0 -1
- package/lib/tasks/formatBundleErrors.js +0 -19
- package/lib/tasks/formatBundleErrors.js.map +0 -1
- package/lib/tasks/getFileSizeSync.d.ts +0 -5
- package/lib/tasks/getFileSizeSync.d.ts.map +0 -1
- package/lib/tasks/getFileSizeSync.js +0 -16
- package/lib/tasks/getFileSizeSync.js.map +0 -1
- package/lib/tasks/hashPackage.d.ts +0 -6
- package/lib/tasks/hashPackage.d.ts.map +0 -1
- package/lib/tasks/hashPackage.js +0 -21
- package/lib/tasks/hashPackage.js.map +0 -1
- package/lib/types/BundleRequest.d.ts +0 -26
- package/lib/types/BundleRequest.d.ts.map +0 -1
- package/lib/types/BundleRequest.js +0 -2
- package/lib/types/BundleRequest.js.map +0 -1
- package/lib/types/BundleTaskOptions.d.ts +0 -4
- package/lib/types/BundleTaskOptions.d.ts.map +0 -1
- package/lib/types/BundleTaskOptions.js +0 -2
- package/lib/types/BundleTaskOptions.js.map +0 -1
package/lib/initTelemetry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initTelemetry.js","sourceRoot":"","sources":["../src/initTelemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAmC,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"initTelemetry.js","sourceRoot":"","sources":["../src/initTelemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAmC,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAU7F,IAAI,eAA4C,CAAC;AACjD,MAAM,CAAC,IAAI,QAA0B,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAA6B,EAAE,YAA0B;IAC3F,MAAM,kBAAkB,GACtB,OAAO,CAAC,eAAe,EAAE,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC;IAErG,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACvG,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;QAC5B,YAAY,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;KACvD;IAED,eAAe,GAAG,MAAM,qBAAqB,CAAC;QAC5C,cAAc,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,kBAAkB;QAClB,QAAQ;QACR,gBAAgB,EAAE,WAAW;QAC7B,WAAW,EAAE,KAAK;KACnB,CAAC,CAAC;IAEH,IAAI,OAAO,CAAC,oBAAoB,EAAE;QAChC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE;YACvE,eAAe,CAAC,sBAAsB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;SACpD;KACF;IAED,iGAAiG;IACjG,QAAQ,GAAG,eAAe,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IAEzD,IAAI,QAAQ,EAAE;QACZ,qFAAqF;QACrF,4BAA4B,CAAC,QAAQ,CAAC,CAAC;KACxC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,OAAO,eAAe,EAAE,QAAQ,EAAE,CAAC;AACrC,CAAC","sourcesContent":["import { type TelemetryConfig } from '@ms-cloudpack/config';\nimport { getVersion } from '@ms-cloudpack/package-utilities';\nimport { type Span, type TelemetryClient, createTelemetryClient } from '@ms-cloudpack/telemetry';\nimport { registerPerformanceObservers } from './performance/registerPerformanceObservers.js';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\n\nexport interface TelemetryInitOptions {\n useDebugLogging: boolean;\n useVerboseLogging: boolean;\n telemetryConfig: TelemetryConfig | undefined;\n sharedSpanAttributes?: Record<string, string>;\n}\n\nlet telemetryClient: TelemetryClient | undefined;\nexport let rootSpan: Span | undefined;\n\n/**\n * Initialize the telemetry client, create the root span, register performance observers.\n * Telemetry will not be sent if no instrumentation key is found.\n * @param options - options to initialize telemetry\n * @returns\n */\nexport async function initTelemetry(options: TelemetryInitOptions, taskReporter: TaskReporter) {\n const instrumentationKey =\n options.telemetryConfig?.instrumentationKey || process.env.CLOUDPACK_TELEMETRY_INSTRUMENTATION_KEY;\n\n const logLevel = options.useVerboseLogging ? 'VERBOSE' : options.useDebugLogging ? 'DEBUG' : undefined;\n if (!options.useDebugLogging) {\n taskReporter.ignoreLogMessage('ApplicationInsights:');\n }\n\n telemetryClient = await createTelemetryClient({\n productVersion: getVersion(import.meta.url),\n instrumentationKey,\n logLevel,\n serviceNamespace: 'cloudpack',\n serviceName: 'cli',\n });\n\n if (options.sharedSpanAttributes) {\n for (const [key, value] of Object.entries(options.sharedSpanAttributes)) {\n telemetryClient.setSharedSpanAttribute(key, value);\n }\n }\n\n // This is the root span for the CLI. It will be used to track the duration of the CLI execution.\n rootSpan = telemetryClient.getTracer()?.startSpan('CLI');\n\n if (rootSpan) {\n // Register performance observers to track performance metrics as events of CLI span.\n registerPerformanceObservers(rootSpan);\n }\n\n return telemetryClient;\n}\n\n/**\n * Ends rootSpan and flushes all telemetry.\n * No-op if telemetry is not initialized.\n * @returns a promise that resolves when telemetry is flushed and shutdown.\n */\nexport function stopTelemetry() {\n rootSpan?.end();\n return telemetryClient?.shutdown();\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupReporting.d.ts","sourceRoot":"","sources":["../src/setupReporting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAmB1D,wBAAsB,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,WAAW,8DA6B9E"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { getVersion } from '@ms-cloudpack/package-utilities';
|
|
2
|
-
import { initTelemetry } from '
|
|
2
|
+
import { initTelemetry } from './initTelemetry.js';
|
|
3
3
|
import { bold, defaultLoggingConfig, verboseLoggingConfig, debugLoggingConfig, } from '@ms-cloudpack/task-reporter';
|
|
4
|
+
import { readJson } from '@ms-cloudpack/json-utilities';
|
|
5
|
+
import path from 'path';
|
|
4
6
|
const { argv } = process;
|
|
5
7
|
const useDebugLogging = argv.includes('--debug') || argv.includes('-d');
|
|
6
8
|
const verb = argv[2];
|
|
7
9
|
const useVerboseLogging = argv.includes('--verbose') || argv.includes('-v') || verb === 'bundle';
|
|
8
10
|
const version = getVersion(import.meta.url);
|
|
9
|
-
export async function setupReporting({ reporter, config }) {
|
|
11
|
+
export async function setupReporting({ reporter, config, appPath }) {
|
|
10
12
|
reporter.setOptions({
|
|
11
13
|
productName: 'Cloudpack',
|
|
12
14
|
version,
|
|
@@ -16,10 +18,18 @@ export async function setupReporting({ reporter, config }) {
|
|
|
16
18
|
...(useVerboseLogging && verboseLoggingConfig),
|
|
17
19
|
...(useDebugLogging && debugLoggingConfig),
|
|
18
20
|
});
|
|
19
|
-
await
|
|
21
|
+
const definition = (await readJson(path.join(appPath, 'package.json')));
|
|
22
|
+
const telemetryClient = await initTelemetry({
|
|
20
23
|
useDebugLogging,
|
|
21
24
|
useVerboseLogging,
|
|
22
25
|
telemetryConfig: config.telemetry,
|
|
26
|
+
sharedSpanAttributes: {
|
|
27
|
+
verb,
|
|
28
|
+
arguments: argv.slice(3).join(' '),
|
|
29
|
+
environment: process.env.CI || process.env.TF_BUILD ? 'ci' : 'local',
|
|
30
|
+
appName: definition?.name || '<unknown>',
|
|
31
|
+
},
|
|
23
32
|
}, reporter);
|
|
33
|
+
return telemetryClient;
|
|
24
34
|
}
|
|
25
35
|
//# sourceMappingURL=setupReporting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupReporting.js","sourceRoot":"","sources":["../src/setupReporting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACL,IAAI,EACJ,oBAAoB,EACpB,oBAAoB,EAEpB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxE,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACrB,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,QAAQ,CAAC;AACjG,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAe;IAC7E,QAAQ,CAAC,UAAU,CAAC;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO;QACP,WAAW,EAAE,GAAG,EAAE,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG;QAC/D,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,GAAG,oBAAoB;QACvB,GAAG,CAAC,iBAAiB,IAAI,oBAAoB,CAAC;QAC9C,GAAG,CAAC,eAAe,IAAI,kBAAkB,CAAC;KACpB,CAAC,CAAC;IAE1B,MAAM,UAAU,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAgB,CAAC;IAEvF,MAAM,eAAe,GAAG,MAAM,aAAa,CACzC;QACE,eAAe;QACf,iBAAiB;QACjB,eAAe,EAAE,MAAM,CAAC,SAAS;QACjC,oBAAoB,EAAE;YACpB,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YAClC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO;YACpE,OAAO,EAAE,UAAU,EAAE,IAAI,IAAI,WAAW;SACzC;KACF,EACD,QAAQ,CACT,CAAC;IAEF,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import { getVersion } from '@ms-cloudpack/package-utilities';\nimport type { TaskContext } from './types/TaskContext.js';\nimport { initTelemetry } from './initTelemetry.js';\nimport {\n bold,\n defaultLoggingConfig,\n verboseLoggingConfig,\n type TaskReporterOptions,\n debugLoggingConfig,\n} from '@ms-cloudpack/task-reporter';\nimport { readJson } from '@ms-cloudpack/json-utilities';\nimport path from 'path';\nimport type { PackageJson } from '@ms-cloudpack/bundler-types';\n\nconst { argv } = process;\nconst useDebugLogging = argv.includes('--debug') || argv.includes('-d');\nconst verb = argv[2];\nconst useVerboseLogging = argv.includes('--verbose') || argv.includes('-v') || verb === 'bundle';\nconst version = getVersion(import.meta.url);\n\nexport async function setupReporting({ reporter, config, appPath }: TaskContext) {\n reporter.setOptions({\n productName: 'Cloudpack',\n version,\n description: () => `Running \"${bold(argv.slice(2).join(' '))}\"`,\n helpMessage: config.helpMessage,\n ...defaultLoggingConfig,\n ...(useVerboseLogging && verboseLoggingConfig),\n ...(useDebugLogging && debugLoggingConfig),\n } as TaskReporterOptions);\n\n const definition = (await readJson(path.join(appPath, 'package.json'))) as PackageJson;\n\n const telemetryClient = await initTelemetry(\n {\n useDebugLogging,\n useVerboseLogging,\n telemetryConfig: config.telemetry,\n sharedSpanAttributes: {\n verb,\n arguments: argv.slice(3).join(' '),\n environment: process.env.CI || process.env.TF_BUILD ? 'ci' : 'local',\n appName: definition?.name || '<unknown>',\n },\n },\n reporter,\n );\n\n return telemetryClient;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundleTaskWorker.js","sourceRoot":"","sources":["../../src/tasks/bundleTaskWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bundleTaskWorker.js","sourceRoot":"","sources":["../../src/tasks/bundleTaskWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAGtD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,GAAG,CAAC,IAAwB;IACxD,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,mEAAmE;IACnE,MAAM,UAAU,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC;AACrE,CAAC","sourcesContent":["import { bundleTask } from '@ms-cloudpack/api-server';\nimport type { Target } from '@lage-run/target-graph';\n\nexport default async function run(data: { target: Target }) {\n const { target } = data;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n await bundleTask({ bundleRequest: target.options?.bundleRequest });\n}\n"]}
|
package/lib/types/Watcher.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Watcher.d.ts","sourceRoot":"","sources":["../../src/types/Watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Watcher.d.ts","sourceRoot":"","sources":["../../src/types/Watcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;CAC/C"}
|
package/lib/types/Watcher.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Watcher.js","sourceRoot":"","sources":["../../src/types/Watcher.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleRequest } from '
|
|
1
|
+
{"version":3,"file":"Watcher.js","sourceRoot":"","sources":["../../src/types/Watcher.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleRequest } from '@ms-cloudpack/api-server';\n\nexport interface Watcher {\n watch: (bundleRequest: BundleRequest) => void;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/cli",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.2",
|
|
4
4
|
"description": "The Cloudpack command line interface - a tool for managing fast inner and outer looping in web apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -11,28 +11,24 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@lage-run/target-graph": "^0.8.6",
|
|
14
|
-
"@ms-cloudpack/api-server": "^0.12.
|
|
14
|
+
"@ms-cloudpack/api-server": "^0.12.2",
|
|
15
15
|
"@ms-cloudpack/bundler": "^0.14.5",
|
|
16
16
|
"@ms-cloudpack/config": "^0.11.0",
|
|
17
17
|
"@ms-cloudpack/create-express-app": "^1.3.9",
|
|
18
18
|
"@ms-cloudpack/json-utilities": "^0.0.7",
|
|
19
|
-
"@ms-cloudpack/overlay": "^0.14.
|
|
19
|
+
"@ms-cloudpack/overlay": "^0.14.3",
|
|
20
20
|
"@ms-cloudpack/package-utilities": "^5.1.0",
|
|
21
21
|
"@ms-cloudpack/path-string-parsing": "^1.0.3",
|
|
22
22
|
"@ms-cloudpack/path-utilities": "^2.3.2",
|
|
23
|
-
"@ms-cloudpack/task-reporter": "^0.7.
|
|
23
|
+
"@ms-cloudpack/task-reporter": "^0.7.1",
|
|
24
24
|
"@ms-cloudpack/telemetry": "^0.3.6",
|
|
25
|
-
"@ms-cloudpack/remote-cache": "^0.0.1",
|
|
26
25
|
"commander": "^11.0.0",
|
|
27
26
|
"cross-spawn": "^7.0.3",
|
|
28
27
|
"es-module-lexer": "^1.0.3",
|
|
29
|
-
"fast-glob": "^3.2.12",
|
|
30
|
-
"filenamify": "^6.0.0",
|
|
31
28
|
"fs-extra": "^11.0.0",
|
|
32
29
|
"glob": "^8.0.0",
|
|
33
30
|
"glob-hasher": "^1.2.1",
|
|
34
31
|
"jsdom": "^22.0.0",
|
|
35
|
-
"object-hash": "^3.0.0",
|
|
36
32
|
"open": "^9.0.0",
|
|
37
33
|
"prompts": "^2.4.2",
|
|
38
34
|
"semver": "^7.3.7",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CloudpackConfig } from '@ms-cloudpack/config';
|
|
2
|
-
import type { ResolveMapEntry } from '@ms-cloudpack/package-utilities';
|
|
3
|
-
import type { BundleRequest } from '../../types/BundleRequest.js';
|
|
4
|
-
import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';
|
|
5
|
-
export declare function createBundleRequestForPackage(options: {
|
|
6
|
-
packageEntry: ResolveMapEntry;
|
|
7
|
-
}, context: {
|
|
8
|
-
config: CloudpackConfig;
|
|
9
|
-
packages: PackageDefinitionsCache;
|
|
10
|
-
}): Promise<BundleRequest>;
|
|
11
|
-
//# sourceMappingURL=createBundleRequestForPackage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createBundleRequestForPackage.d.ts","sourceRoot":"","sources":["../../../src/commands/start/createBundleRequestForPackage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,wBAAsB,6BAA6B,CACjD,OAAO,EAAE;IACP,YAAY,EAAE,eAAe,CAAC;CAC/B,EACD,OAAO,EAAE;IACP,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,uBAAuB,CAAC;CACnC,GACA,OAAO,CAAC,aAAa,CAAC,CAmBxB"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { getBundleDetails } from '../../common/getBundleDetails.js';
|
|
2
|
-
export async function createBundleRequestForPackage(options, context) {
|
|
3
|
-
const { packageEntry } = options;
|
|
4
|
-
const { config } = context;
|
|
5
|
-
const { features = {} } = config;
|
|
6
|
-
const { path, version, name } = packageEntry;
|
|
7
|
-
const { bundleId, isExternal, outputLocation } = await getBundleDetails({ packagePath: path }, context);
|
|
8
|
-
return {
|
|
9
|
-
id: bundleId,
|
|
10
|
-
packagePath: path,
|
|
11
|
-
packageName: name,
|
|
12
|
-
isExternal,
|
|
13
|
-
outputPath: outputLocation.path,
|
|
14
|
-
version,
|
|
15
|
-
disableSourceMaps: features.disableSourceMaps,
|
|
16
|
-
enableFindImports: features.enqueueDependencies,
|
|
17
|
-
enableCacheInternalPackages: features.cacheInternalPackages,
|
|
18
|
-
...context,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=createBundleRequestForPackage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createBundleRequestForPackage.js","sourceRoot":"","sources":["../../../src/commands/start/createBundleRequestForPackage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIpE,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAEC,EACD,OAGC;IAED,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IACjC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IACjC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC;IAC7C,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,MAAM,gBAAgB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAExG,OAAO;QACL,EAAE,EAAE,QAAQ;QACZ,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,IAAI;QACjB,UAAU;QACV,UAAU,EAAE,cAAc,CAAC,IAAI;QAC/B,OAAO;QACP,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;QAC7C,iBAAiB,EAAE,QAAQ,CAAC,mBAAmB;QAC/C,2BAA2B,EAAE,QAAQ,CAAC,qBAAqB;QAC3D,GAAG,OAAO;KACX,CAAC;AACJ,CAAC","sourcesContent":["import type { CloudpackConfig } from '@ms-cloudpack/config';\nimport type { ResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport { getBundleDetails } from '../../common/getBundleDetails.js';\nimport type { BundleRequest } from '../../types/BundleRequest.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\n\nexport async function createBundleRequestForPackage(\n options: {\n packageEntry: ResolveMapEntry;\n },\n context: {\n config: CloudpackConfig;\n packages: PackageDefinitionsCache;\n },\n): Promise<BundleRequest> {\n const { packageEntry } = options;\n const { config } = context;\n const { features = {} } = config;\n const { path, version, name } = packageEntry;\n const { bundleId, isExternal, outputLocation } = await getBundleDetails({ packagePath: path }, context);\n\n return {\n id: bundleId,\n packagePath: path,\n packageName: name,\n isExternal,\n outputPath: outputLocation.path,\n version,\n disableSourceMaps: features.disableSourceMaps,\n enableFindImports: features.enqueueDependencies,\n enableCacheInternalPackages: features.cacheInternalPackages,\n ...context,\n };\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { BundleTaskOptions } from '../../types/BundleTaskOptions.js';
|
|
2
|
-
import type { BundleRequest } from '../../types/BundleRequest.js';
|
|
3
|
-
import type { Task } from '@ms-cloudpack/api-server';
|
|
4
|
-
import type { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
5
|
-
/**
|
|
6
|
-
* Creates a bundle task tracked in the task runner of the api server. This allows active tasks to be tracked
|
|
7
|
-
* remotely (e.g. in the browser) and allows the user to cancel tasks.
|
|
8
|
-
*/
|
|
9
|
-
export declare function createBundleTask(bundleRequest: BundleRequest, options?: BundleTaskOptions, reporter?: TaskReporter): Task<BundleRequest>;
|
|
10
|
-
//# sourceMappingURL=createBundleTask.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createBundleTask.d.ts","sourceRoot":"","sources":["../../../src/commands/start/createBundleTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,IAAI,EAAiC,MAAM,0BAA0B,CAAC;AAIpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,aAAa,EAC5B,OAAO,CAAC,EAAE,iBAAiB,EAC3B,QAAQ,CAAC,EAAE,YAAY,GACtB,IAAI,CAAC,aAAa,CAAC,CAoCrB"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import { bundleTask } from '../../tasks/bundleTask.js';
|
|
4
|
-
/**
|
|
5
|
-
* Creates a bundle task tracked in the task runner of the api server. This allows active tasks to be tracked
|
|
6
|
-
* remotely (e.g. in the browser) and allows the user to cancel tasks.
|
|
7
|
-
*/
|
|
8
|
-
export function createBundleTask(bundleRequest, options, reporter) {
|
|
9
|
-
const { id, packageName, version, outputPath, packagePath, isExternal } = bundleRequest;
|
|
10
|
-
return {
|
|
11
|
-
name: `Bundle ${packageName}@${version}`,
|
|
12
|
-
id,
|
|
13
|
-
dir: `${path.join(packagePath, 'src')}`,
|
|
14
|
-
watch: !isExternal,
|
|
15
|
-
async execute() {
|
|
16
|
-
await bundleTask({ bundleRequest, options, reporter });
|
|
17
|
-
return bundleRequest;
|
|
18
|
-
},
|
|
19
|
-
clear: () => {
|
|
20
|
-
bundleRequest.result?.dispose?.();
|
|
21
|
-
bundleRequest.result = undefined;
|
|
22
|
-
// eslint-disable-next-line no-restricted-syntax -- this function can't be async
|
|
23
|
-
fs.rmSync(outputPath, { recursive: true, force: true });
|
|
24
|
-
},
|
|
25
|
-
onDispose: () => {
|
|
26
|
-
bundleRequest.result?.dispose?.();
|
|
27
|
-
},
|
|
28
|
-
getErrors: () => bundleRequest.result?.errors,
|
|
29
|
-
getStartDescription: () => ({
|
|
30
|
-
id,
|
|
31
|
-
name: `Bundle ${packageName}@${version}`,
|
|
32
|
-
inputPath: packagePath || '',
|
|
33
|
-
outputPath,
|
|
34
|
-
}),
|
|
35
|
-
getEndDescription: (taskResult) => ({
|
|
36
|
-
id,
|
|
37
|
-
errors: taskResult?.result?.errors,
|
|
38
|
-
warnings: taskResult?.result?.warnings,
|
|
39
|
-
}),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=createBundleTask.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../../src/commands/start/createBundleTask.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,aAA4B,EAC5B,OAA2B,EAC3B,QAAuB;IAEvB,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IAExF,OAAO;QACL,IAAI,EAAE,UAAU,WAAW,IAAI,OAAO,EAAE;QACxC,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,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;YAEvD,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,KAAK,EAAE,GAAG,EAAE;YACV,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;YAClC,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;YACjC,gFAAgF;YAChF,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,SAAS,EAAE,GAAG,EAAE;YACd,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;QACpC,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,MAAgC;QACvE,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC1B,EAAE;YACF,IAAI,EAAE,UAAU,WAAW,IAAI,OAAO,EAAE;YACxC,SAAS,EAAE,WAAW,IAAI,EAAE;YAC5B,UAAU;SACX,CAAC;QACF,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAChC,CAAC;YACC,EAAE;YACF,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM;YAClC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ;SACvC,CAAuB;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["import type { BundleTaskOptions } from '../../types/BundleTaskOptions.js';\nimport type { BundleRequest } from '../../types/BundleRequest.js';\nimport type { Task, TaskEndDescription, TaskError } from '@ms-cloudpack/api-server';\nimport path from 'path';\nimport fs from 'fs';\nimport { bundleTask } from '../../tasks/bundleTask.js';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\n\n/**\n * Creates a bundle task tracked in the task runner of the api server. This allows active tasks to be tracked\n * remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(\n bundleRequest: BundleRequest,\n options?: BundleTaskOptions,\n reporter?: TaskReporter,\n): Task<BundleRequest> {\n const { id, packageName, version, outputPath, packagePath, isExternal } = bundleRequest;\n\n return {\n name: `Bundle ${packageName}@${version}`,\n id,\n dir: `${path.join(packagePath, 'src')}`,\n watch: !isExternal,\n async execute(): Promise<BundleRequest> {\n await bundleTask({ bundleRequest, options, reporter });\n\n return bundleRequest;\n },\n clear: () => {\n bundleRequest.result?.dispose?.();\n bundleRequest.result = undefined;\n // eslint-disable-next-line no-restricted-syntax -- this function can't be async\n fs.rmSync(outputPath, { recursive: true, force: true });\n },\n onDispose: () => {\n bundleRequest.result?.dispose?.();\n },\n getErrors: () => bundleRequest.result?.errors as unknown as TaskError[],\n getStartDescription: () => ({\n id,\n name: `Bundle ${packageName}@${version}`,\n inputPath: packagePath || '',\n outputPath,\n }),\n getEndDescription: (taskResult) =>\n ({\n id,\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n }) as TaskEndDescription,\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupReporting.d.ts","sourceRoot":"","sources":["../../../src/commands/start/setupReporting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAgB9D,wBAAsB,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,QAAQ,CAAC,iBAmBlG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupReporting.js","sourceRoot":"","sources":["../../../src/commands/start/setupReporting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,IAAI,EACJ,oBAAoB,EACpB,oBAAoB,EAEpB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AAErC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxE,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACrB,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,QAAQ,CAAC;AACjG,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE5C,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,EAA4C;IACjG,QAAQ,CAAC,UAAU,CAAC;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO;QACP,WAAW,EAAE,GAAG,EAAE,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG;QAC/D,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,GAAG,oBAAoB;QACvB,GAAG,CAAC,iBAAiB,IAAI,oBAAoB,CAAC;QAC9C,GAAG,CAAC,eAAe,IAAI,kBAAkB,CAAC;KACpB,CAAC,CAAC;IAE1B,MAAM,aAAa,CACjB;QACE,eAAe;QACf,iBAAiB;QACjB,eAAe,EAAE,MAAM,CAAC,SAAS;KAClC,EACD,QAAQ,CACT,CAAC;AACJ,CAAC","sourcesContent":["import { getVersion } from '@ms-cloudpack/package-utilities';\nimport type { TaskContext } from '../../types/TaskContext.js';\nimport { initTelemetry } from '../../initTelemetry.js';\nimport {\n bold,\n defaultLoggingConfig,\n verboseLoggingConfig,\n type TaskReporterOptions,\n debugLoggingConfig,\n} from '@ms-cloudpack/task-reporter';\n\nconst { argv } = process;\nconst useDebugLogging = argv.includes('--debug') || argv.includes('-d');\nconst verb = argv[2];\nconst useVerboseLogging = argv.includes('--verbose') || argv.includes('-v') || verb === 'bundle';\nconst version = getVersion(import.meta.url);\n\nexport async function setupReporting({ reporter, config }: Pick<TaskContext, 'reporter' | 'config'>) {\n reporter.setOptions({\n productName: 'Cloudpack',\n version,\n description: () => `Running \"${bold(argv.slice(2).join(' '))}\"`,\n helpMessage: config.helpMessage,\n ...defaultLoggingConfig,\n ...(useVerboseLogging && verboseLoggingConfig),\n ...(useDebugLogging && debugLoggingConfig),\n } as TaskReporterOptions);\n\n await initTelemetry(\n {\n useDebugLogging,\n useVerboseLogging,\n telemetryConfig: config.telemetry,\n },\n reporter,\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/Task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAC;CAChD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Task.js","sourceRoot":"","sources":["../../../src/commands/sync/Task.ts"],"names":[],"mappings":"","sourcesContent":["import type { TaskReporterTaskResult } from '@ms-cloudpack/task-reporter';\n\nexport interface Task {\n name: string;\n execute: () => Promise<TaskReporterTaskResult>;\n}\n"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { RemoteCacheClient } from '@ms-cloudpack/remote-cache';
|
|
2
|
-
import { type PackageToSync } from './getPackagesToSync.js';
|
|
3
|
-
import type { Task } from './Task.js';
|
|
4
|
-
export declare function createDownloadTask(client: RemoteCacheClient, { folderName, packageName, path, version }: PackageToSync): Task;
|
|
5
|
-
//# sourceMappingURL=createDownloadTask.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDownloadTask.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/createDownloadTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAItC,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,iBAAiB,EACzB,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,aAAa,GACxD,IAAI,CAmBN"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {} from './getPackagesToSync.js';
|
|
2
|
-
import { existsSync } from 'fs';
|
|
3
|
-
import { bulletedList } from '@ms-cloudpack/task-reporter';
|
|
4
|
-
export function createDownloadTask(client, { folderName, packageName, path, version }) {
|
|
5
|
-
return {
|
|
6
|
-
name: `Downloading ${packageName}@${version}`,
|
|
7
|
-
execute: async () => {
|
|
8
|
-
if (existsSync(path)) {
|
|
9
|
-
return { status: 'skip', message: 'Package is already exist in the local cache.' };
|
|
10
|
-
}
|
|
11
|
-
const result = await client.downloadFolder(folderName, path);
|
|
12
|
-
if (!result) {
|
|
13
|
-
return { status: 'skip', message: `not found in the remote cache.` };
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
status: 'complete',
|
|
17
|
-
details: bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Version: ${version}`]),
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=createDownloadTask.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDownloadTask.js","sourceRoot":"","sources":["../../../src/commands/sync/createDownloadTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,MAAM,UAAU,kBAAkB,CAChC,MAAyB,EACzB,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAiB;IAEzD,OAAO;QACL,IAAI,EAAE,eAAe,WAAW,IAAI,OAAO,EAAE;QAC7C,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE;gBACpB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,8CAA8C,EAAE,CAAC;aACpF;YAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YAC7D,IAAI,CAAC,MAAM,EAAE;gBACX,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gCAAgC,EAAE,CAAC;aACtE;YAED,OAAO;gBACL,MAAM,EAAE,UAAU;gBAClB,OAAO,EAAE,YAAY,CAAC,CAAC,eAAe,UAAU,EAAE,EAAE,SAAS,IAAI,EAAE,EAAE,YAAY,OAAO,EAAE,CAAC,CAAC;aAC7F,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { RemoteCacheClient } from '@ms-cloudpack/remote-cache';\nimport { type PackageToSync } from './getPackagesToSync.js';\nimport type { Task } from './Task.js';\nimport { existsSync } from 'fs';\nimport { bulletedList } from '@ms-cloudpack/task-reporter';\n\nexport function createDownloadTask(\n client: RemoteCacheClient,\n { folderName, packageName, path, version }: PackageToSync,\n): Task {\n return {\n name: `Downloading ${packageName}@${version}`,\n execute: async () => {\n if (existsSync(path)) {\n return { status: 'skip', message: 'Package is already exist in the local cache.' };\n }\n\n const result = await client.downloadFolder(folderName, path);\n if (!result) {\n return { status: 'skip', message: `not found in the remote cache.` };\n }\n\n return {\n status: 'complete',\n details: bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Version: ${version}`]),\n };\n },\n };\n}\n"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { RemoteCacheClient } from '@ms-cloudpack/remote-cache';
|
|
2
|
-
import type { PackageToSync } from './getPackagesToSync.js';
|
|
3
|
-
import type { Task } from './Task.js';
|
|
4
|
-
export declare function createUploadTask(client: RemoteCacheClient, { folderName, packageName, path, version }: PackageToSync): Task;
|
|
5
|
-
//# sourceMappingURL=createUploadTask.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createUploadTask.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/createUploadTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAItC,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,iBAAiB,EACzB,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,aAAa,GACxD,IAAI,CAeN"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'fs';
|
|
2
|
-
import { bulletedList } from '@ms-cloudpack/task-reporter';
|
|
3
|
-
export function createUploadTask(client, { folderName, packageName, path, version }) {
|
|
4
|
-
return {
|
|
5
|
-
name: `Uploading ${packageName}@${version}`,
|
|
6
|
-
execute: async () => {
|
|
7
|
-
if (!existsSync(path)) {
|
|
8
|
-
return { status: 'skip', message: `Not found in the local cache.` };
|
|
9
|
-
}
|
|
10
|
-
await client.uploadFolder(folderName, path);
|
|
11
|
-
return {
|
|
12
|
-
status: 'complete',
|
|
13
|
-
details: bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Version: ${version}`]),
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=createUploadTask.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createUploadTask.js","sourceRoot":"","sources":["../../../src/commands/sync/createUploadTask.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,MAAM,UAAU,gBAAgB,CAC9B,MAAyB,EACzB,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAiB;IAEzD,OAAO;QACL,IAAI,EAAE,aAAa,WAAW,IAAI,OAAO,EAAE;QAC3C,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBACrB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC;aACrE;YAED,MAAM,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YAC5C,OAAO;gBACL,MAAM,EAAE,UAAU;gBAClB,OAAO,EAAE,YAAY,CAAC,CAAC,eAAe,UAAU,EAAE,EAAE,SAAS,IAAI,EAAE,EAAE,YAAY,OAAO,EAAE,CAAC,CAAC;aAC7F,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { RemoteCacheClient } from '@ms-cloudpack/remote-cache';\nimport type { PackageToSync } from './getPackagesToSync.js';\nimport type { Task } from './Task.js';\nimport { existsSync } from 'fs';\nimport { bulletedList } from '@ms-cloudpack/task-reporter';\n\nexport function createUploadTask(\n client: RemoteCacheClient,\n { folderName, packageName, path, version }: PackageToSync,\n): Task {\n return {\n name: `Uploading ${packageName}@${version}`,\n execute: async () => {\n if (!existsSync(path)) {\n return { status: 'skip', message: `Not found in the local cache.` };\n }\n\n await client.uploadFolder(folderName, path);\n return {\n status: 'complete',\n details: bulletedList([`FolderName: ${folderName}`, `Path: ${path}`, `Version: ${version}`]),\n };\n },\n };\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
2
|
-
export interface PackageToSync {
|
|
3
|
-
path: string;
|
|
4
|
-
folderName: string;
|
|
5
|
-
packageName: string;
|
|
6
|
-
version: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function getPackagesToSync(appPath: string, reporter: TaskReporter): Promise<PackageToSync[]>;
|
|
9
|
-
//# sourceMappingURL=getPackagesToSync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getPackagesToSync.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/getPackagesToSync.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAyBzG"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createPackageDefinitions, readConfig } from '@ms-cloudpack/config';
|
|
2
|
-
import { resolveDependenciesTask } from '../../tasks/resolveDependenciesTask.js';
|
|
3
|
-
import { findResolveMapEntry } from '@ms-cloudpack/package-utilities';
|
|
4
|
-
import { getBundleDetails } from '../../common/getBundleDetails.js';
|
|
5
|
-
export async function getPackagesToSync(appPath, reporter) {
|
|
6
|
-
const list = [];
|
|
7
|
-
const config = await readConfig(appPath);
|
|
8
|
-
const packages = createPackageDefinitions({ config });
|
|
9
|
-
const resolveMap = await resolveDependenciesTask({ appPath }, { packages, reporter });
|
|
10
|
-
const packageEntries = Object.keys(resolveMap)
|
|
11
|
-
.map((packageName) => findResolveMapEntry({
|
|
12
|
-
packageName,
|
|
13
|
-
resolveMap,
|
|
14
|
-
}))
|
|
15
|
-
.filter((item) => item);
|
|
16
|
-
for (const { path: packagePath, name, version } of packageEntries) {
|
|
17
|
-
const details = await getBundleDetails({ packagePath }, { packages });
|
|
18
|
-
if (details.isExternal) {
|
|
19
|
-
list.push({ ...details.outputLocation, packageName: name, version });
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return list;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=getPackagesToSync.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getPackagesToSync.js","sourceRoot":"","sources":["../../../src/commands/sync/getPackagesToSync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAwB,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAUpE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAe,EAAE,QAAsB;IAC7E,MAAM,IAAI,GAAoB,EAAE,CAAC;IAEjC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAEtD,MAAM,UAAU,GAAG,MAAM,uBAAuB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEtF,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3C,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CACnB,mBAAmB,CAAC;QAClB,WAAW;QACX,UAAU;KACX,CAAC,CACH;SACA,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAsB,CAAC;IAE/C,KAAK,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,cAAc,EAAE;QACjE,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACtE,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;SACtE;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { createPackageDefinitions, readConfig } from '@ms-cloudpack/config';\nimport { resolveDependenciesTask } from '../../tasks/resolveDependenciesTask.js';\nimport { findResolveMapEntry, type ResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport { getBundleDetails } from '../../common/getBundleDetails.js';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\n\nexport interface PackageToSync {\n path: string;\n folderName: string;\n packageName: string;\n version: string;\n}\n\nexport async function getPackagesToSync(appPath: string, reporter: TaskReporter): Promise<PackageToSync[]> {\n const list: PackageToSync[] = [];\n\n const config = await readConfig(appPath);\n const packages = createPackageDefinitions({ config });\n\n const resolveMap = await resolveDependenciesTask({ appPath }, { packages, reporter });\n\n const packageEntries = Object.keys(resolveMap)\n .map((packageName) =>\n findResolveMapEntry({\n packageName,\n resolveMap,\n }),\n )\n .filter((item) => item) as ResolveMapEntry[];\n\n for (const { path: packagePath, name, version } of packageEntries) {\n const details = await getBundleDetails({ packagePath }, { packages });\n if (details.isExternal) {\n list.push({ ...details.outputLocation, packageName: name, version });\n }\n }\n\n return list;\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { TaskContext } from '../../types/TaskContext.js';
|
|
2
|
-
import type { SyncOptions } from './types/SyncOptions.js';
|
|
3
|
-
/**
|
|
4
|
-
* Syncs the packages to the remote cache.
|
|
5
|
-
* @param syncOptions - The options for the sync command.
|
|
6
|
-
* @param context - The task context.
|
|
7
|
-
* @returns The number of packages synced.
|
|
8
|
-
*/
|
|
9
|
-
export declare function syncInternal({ upload: isUpload }: SyncOptions, context: TaskContext): Promise<void>;
|
|
10
|
-
//# sourceMappingURL=syncInternal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"syncInternal.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/syncInternal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAW9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCzG"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { getPackagesToSync } from './getPackagesToSync.js';
|
|
2
|
-
import { createUploadTask } from './createUploadTask.js';
|
|
3
|
-
import { createDownloadTask } from './createDownloadTask.js';
|
|
4
|
-
import { PerfMarkerSyncStart, PerfMeasurementSyncDownload, PerfMeasurementSyncUpload, } from '../../performance/markers.js';
|
|
5
|
-
import { readConfig } from '@ms-cloudpack/config';
|
|
6
|
-
import { RemoteCacheClient, getAuthenticatedConnectionString } from '@ms-cloudpack/remote-cache';
|
|
7
|
-
/**
|
|
8
|
-
* Syncs the packages to the remote cache.
|
|
9
|
-
* @param syncOptions - The options for the sync command.
|
|
10
|
-
* @param context - The task context.
|
|
11
|
-
* @returns The number of packages synced.
|
|
12
|
-
*/
|
|
13
|
-
export async function syncInternal({ upload: isUpload }, context) {
|
|
14
|
-
const { appPath, reporter } = context;
|
|
15
|
-
const config = await readConfig(appPath);
|
|
16
|
-
if (!config.remoteCache) {
|
|
17
|
-
console.warn('Remote cache is not configured. Please add remoteCache to your cloudpack.config.json file.');
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const { container, storageAccount } = config.remoteCache;
|
|
21
|
-
const connectionString = await getAuthenticatedConnectionString({
|
|
22
|
-
storageAccount,
|
|
23
|
-
container,
|
|
24
|
-
permissions: { read: !isUpload, write: isUpload },
|
|
25
|
-
});
|
|
26
|
-
const client = new RemoteCacheClient({
|
|
27
|
-
container,
|
|
28
|
-
connectionString,
|
|
29
|
-
});
|
|
30
|
-
const list = await getPackagesToSync(appPath, reporter);
|
|
31
|
-
performance.mark(PerfMarkerSyncStart);
|
|
32
|
-
const uploads = list.map((item) => {
|
|
33
|
-
const { name, execute } = isUpload ? createUploadTask(client, item) : createDownloadTask(client, item);
|
|
34
|
-
return reporter.runTask(name, execute);
|
|
35
|
-
});
|
|
36
|
-
await Promise.all(uploads);
|
|
37
|
-
performance.measure(isUpload ? PerfMeasurementSyncUpload : PerfMeasurementSyncDownload, PerfMarkerSyncStart);
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=syncInternal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"syncInternal.js","sourceRoot":"","sources":["../../../src/commands/sync/syncInternal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAGjG;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAe,EAAE,OAAoB;IACxF,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAEtC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;QACvB,OAAO,CAAC,IAAI,CAAC,4FAA4F,CAAC,CAAC;QAC3G,OAAO;KACR;IAED,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC;IACzD,MAAM,gBAAgB,GAAG,MAAM,gCAAgC,CAAC;QAC9D,cAAc;QACd,SAAS;QACT,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;KAClD,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC;QACnC,SAAS;QACT,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAExD,WAAW,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAEtC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAChC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACvG,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAE3B,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,2BAA2B,EAAE,mBAAmB,CAAC,CAAC;AAC/G,CAAC","sourcesContent":["import type { TaskContext } from '../../types/TaskContext.js';\nimport { getPackagesToSync } from './getPackagesToSync.js';\nimport { createUploadTask } from './createUploadTask.js';\nimport { createDownloadTask } from './createDownloadTask.js';\nimport {\n PerfMarkerSyncStart,\n PerfMeasurementSyncDownload,\n PerfMeasurementSyncUpload,\n} from '../../performance/markers.js';\nimport { readConfig } from '@ms-cloudpack/config';\nimport { RemoteCacheClient, getAuthenticatedConnectionString } from '@ms-cloudpack/remote-cache';\nimport type { SyncOptions } from './types/SyncOptions.js';\n\n/**\n * Syncs the packages to the remote cache.\n * @param syncOptions - The options for the sync command.\n * @param context - The task context.\n * @returns The number of packages synced.\n */\nexport async function syncInternal({ upload: isUpload }: SyncOptions, context: TaskContext): Promise<void> {\n const { appPath, reporter } = context;\n\n const config = await readConfig(appPath);\n if (!config.remoteCache) {\n console.warn('Remote cache is not configured. Please add remoteCache to your cloudpack.config.json file.');\n return;\n }\n\n const { container, storageAccount } = config.remoteCache;\n const connectionString = await getAuthenticatedConnectionString({\n storageAccount,\n container,\n permissions: { read: !isUpload, write: isUpload },\n });\n\n const client = new RemoteCacheClient({\n container,\n connectionString,\n });\n\n const list = await getPackagesToSync(appPath, reporter);\n\n performance.mark(PerfMarkerSyncStart);\n\n const uploads = list.map((item) => {\n const { name, execute } = isUpload ? createUploadTask(client, item) : createDownloadTask(client, item);\n return reporter.runTask(name, execute);\n });\n\n await Promise.all(uploads);\n\n performance.measure(isUpload ? PerfMeasurementSyncUpload : PerfMeasurementSyncDownload, PerfMarkerSyncStart);\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';
|
|
2
|
-
export declare function getBundleDetails(options: {
|
|
3
|
-
packagePath: string;
|
|
4
|
-
}, context: {
|
|
5
|
-
packages: PackageDefinitionsCache;
|
|
6
|
-
}): Promise<{
|
|
7
|
-
bundleId: string;
|
|
8
|
-
isExternal: boolean;
|
|
9
|
-
outputLocation: {
|
|
10
|
-
path: string;
|
|
11
|
-
folderName: string;
|
|
12
|
-
};
|
|
13
|
-
}>;
|
|
14
|
-
//# sourceMappingURL=getBundleDetails.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getBundleDetails.d.ts","sourceRoot":"","sources":["../../src/common/getBundleDetails.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,wBAAsB,gBAAgB,CACpC,OAAO,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,EAChC,OAAO,EAAE;IAAE,QAAQ,EAAE,uBAAuB,CAAA;CAAE;;;;;;;GAmC/C"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { isExternalPackage } from '@ms-cloudpack/package-utilities';
|
|
2
|
-
import hash from 'object-hash';
|
|
3
|
-
import filenamify from 'filenamify';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { getCachePath } from '@ms-cloudpack/api-server';
|
|
6
|
-
export async function getBundleDetails(options, context) {
|
|
7
|
-
const { packagePath } = options;
|
|
8
|
-
const { packages } = context;
|
|
9
|
-
const definition = await packages.get(packagePath);
|
|
10
|
-
if (!definition) {
|
|
11
|
-
throw new Error(`Package definition (package.json) missing or invalid at "${packagePath}"`);
|
|
12
|
-
}
|
|
13
|
-
const { name: packageName, version } = definition;
|
|
14
|
-
if (!packageName) {
|
|
15
|
-
throw new Error(`Package definition (package.json) missing name at "${packagePath}"`);
|
|
16
|
-
}
|
|
17
|
-
const isExternal = isExternalPackage(packagePath);
|
|
18
|
-
const bundleId = hash({
|
|
19
|
-
name: packageName,
|
|
20
|
-
...definition,
|
|
21
|
-
version: (isExternal ? version : packagePath) || packagePath,
|
|
22
|
-
});
|
|
23
|
-
// Derive where the output should be.
|
|
24
|
-
const folderName = `${filenamify(packageName)}-${version}-${bundleId}`;
|
|
25
|
-
const outputPath = path.join(getCachePath(), folderName);
|
|
26
|
-
return {
|
|
27
|
-
bundleId,
|
|
28
|
-
isExternal,
|
|
29
|
-
outputLocation: {
|
|
30
|
-
path: outputPath,
|
|
31
|
-
folderName,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=getBundleDetails.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getBundleDetails.js","sourceRoot":"","sources":["../../src/common/getBundleDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAgC,EAChC,OAA8C;IAE9C,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAChC,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC7B,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAEnD,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,4DAA4D,WAAW,GAAG,CAAC,CAAC;KAC7F;IAED,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;IAElD,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,sDAAsD,WAAW,GAAG,CAAC,CAAC;KACvF;IAED,MAAM,UAAU,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,IAAI,CAAC;QACpB,IAAI,EAAE,WAAW;QACjB,GAAG,UAAU;QACb,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,WAAW;KAC7D,CAAC,CAAC;IAEH,qCAAqC;IACrC,MAAM,UAAU,GAAG,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;IACvE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,UAAU,CAAC,CAAC;IAEzD,OAAO;QACL,QAAQ;QACR,UAAU;QACV,cAAc,EAAE;YACd,IAAI,EAAE,UAAU;YAChB,UAAU;SACX;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { isExternalPackage } from '@ms-cloudpack/package-utilities';\nimport hash from 'object-hash';\nimport filenamify from 'filenamify';\nimport path from 'path';\nimport { getCachePath } from '@ms-cloudpack/api-server';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\n\nexport async function getBundleDetails(\n options: { packagePath: string },\n context: { packages: PackageDefinitionsCache },\n) {\n const { packagePath } = options;\n const { packages } = context;\n const definition = await packages.get(packagePath);\n\n if (!definition) {\n throw new Error(`Package definition (package.json) missing or invalid at \"${packagePath}\"`);\n }\n\n const { name: packageName, version } = definition;\n\n if (!packageName) {\n throw new Error(`Package definition (package.json) missing name at \"${packagePath}\"`);\n }\n\n const isExternal = isExternalPackage(packagePath);\n const bundleId = hash({\n name: packageName,\n ...definition,\n version: (isExternal ? version : packagePath) || packagePath,\n });\n\n // Derive where the output should be.\n const folderName = `${filenamify(packageName)}-${version}-${bundleId}`;\n const outputPath = path.join(getCachePath(), folderName);\n\n return {\n bundleId,\n isExternal,\n outputLocation: {\n path: outputPath,\n folderName,\n },\n };\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
2
|
-
import type { BundleTaskOptions } from '../types/BundleTaskOptions.js';
|
|
3
|
-
import type { BundleRequest } from '../types/BundleRequest.js';
|
|
4
|
-
export declare function bundleTask({ bundleRequest, options, reporter, }: {
|
|
5
|
-
bundleRequest: BundleRequest;
|
|
6
|
-
options?: BundleTaskOptions;
|
|
7
|
-
reporter?: TaskReporter;
|
|
8
|
-
}): Promise<BundleRequest>;
|
|
9
|
-
//# sourceMappingURL=bundleTask.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundleTask.d.ts","sourceRoot":"","sources":["../../src/tasks/bundleTask.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,6BAA6B,CAAC;AAIrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAO/D,wBAAsB,UAAU,CAAC,EAC/B,aAAa,EACb,OAAY,EACZ,QAAQ,GACT,EAAE;IACD,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,0BAwDA"}
|