@ms-cloudpack/cli 0.45.3 → 0.46.1
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/execute.d.ts +4 -0
- package/lib/commands/bundle/execute.d.ts.map +1 -0
- package/lib/commands/bundle/{bundle.js → execute.js} +14 -15
- package/lib/commands/bundle/execute.js.map +1 -0
- package/lib/commands/bundle/index.d.ts.map +1 -1
- package/lib/commands/bundle/index.js +4 -2
- package/lib/commands/bundle/index.js.map +1 -1
- package/lib/commands/init/bundleAndGetImports.d.ts.map +1 -1
- package/lib/commands/init/bundleAndGetImports.js +3 -1
- package/lib/commands/init/bundleAndGetImports.js.map +1 -1
- package/lib/commands/init/execute.d.ts +5 -0
- package/lib/commands/init/execute.d.ts.map +1 -0
- package/lib/commands/init/execute.js +14 -0
- package/lib/commands/init/execute.js.map +1 -0
- package/lib/commands/init/index.d.ts.map +1 -1
- package/lib/commands/init/index.js +4 -2
- package/lib/commands/init/index.js.map +1 -1
- package/lib/commands/init/init.d.ts +11 -5
- package/lib/commands/init/init.d.ts.map +1 -1
- package/lib/commands/init/init.js +79 -102
- package/lib/commands/init/init.js.map +1 -1
- package/lib/commands/start/{start.d.ts → execute.d.ts} +3 -3
- package/lib/commands/start/execute.d.ts.map +1 -0
- package/lib/commands/start/execute.js +127 -0
- package/lib/commands/start/execute.js.map +1 -0
- package/lib/commands/start/index.d.ts.map +1 -1
- package/lib/commands/start/index.js +4 -2
- package/lib/commands/start/index.js.map +1 -1
- package/lib/commands/start/startBundleServer.d.ts +1 -1
- package/lib/commands/start/startBundleServer.d.ts.map +1 -1
- package/lib/commands/start/startBundleServer.js +6 -19
- package/lib/commands/start/startBundleServer.js.map +1 -1
- package/lib/commands/sync/execute.d.ts +4 -0
- package/lib/commands/sync/execute.d.ts.map +1 -0
- package/lib/commands/sync/execute.js +31 -0
- package/lib/commands/sync/execute.js.map +1 -0
- package/lib/commands/sync/index.d.ts.map +1 -1
- package/lib/commands/sync/index.js +4 -5
- package/lib/commands/sync/index.js.map +1 -1
- package/lib/common/AutoDisposableList.d.ts +7 -0
- package/lib/common/AutoDisposableList.d.ts.map +1 -0
- package/lib/common/AutoDisposableList.js +17 -0
- package/lib/common/AutoDisposableList.js.map +1 -0
- package/lib/common/createCommandActionFunction.d.ts +14 -0
- package/lib/common/createCommandActionFunction.d.ts.map +1 -0
- package/lib/common/createCommandActionFunction.js +66 -0
- package/lib/common/createCommandActionFunction.js.map +1 -0
- package/lib/common/createExitFunction.d.ts +12 -0
- package/lib/common/createExitFunction.d.ts.map +1 -0
- package/lib/common/createExitFunction.js +17 -0
- package/lib/common/createExitFunction.js.map +1 -0
- package/lib/common/createInitializeFunction.d.ts +10 -0
- package/lib/common/createInitializeFunction.d.ts.map +1 -0
- package/lib/common/createInitializeFunction.js +21 -0
- package/lib/common/createInitializeFunction.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +6 -5
- package/lib/index.js.map +1 -1
- package/lib/initTelemetry.js +1 -1
- package/lib/initTelemetry.js.map +1 -1
- package/lib/performance/markers.d.ts +0 -16
- package/lib/performance/markers.d.ts.map +1 -1
- package/lib/performance/markers.js +0 -16
- package/lib/performance/markers.js.map +1 -1
- package/lib/performance/registerPerformanceObservers.d.ts +2 -2
- package/lib/performance/registerPerformanceObservers.d.ts.map +1 -1
- package/lib/performance/registerPerformanceObservers.js +5 -8
- package/lib/performance/registerPerformanceObservers.js.map +1 -1
- package/lib/setupReporting.d.ts +7 -2
- package/lib/setupReporting.d.ts.map +1 -1
- package/lib/setupReporting.js +3 -2
- package/lib/setupReporting.js.map +1 -1
- package/lib/tasks/bundleTaskWorker.d.ts.map +1 -1
- package/lib/tasks/bundleTaskWorker.js +6 -2
- package/lib/tasks/bundleTaskWorker.js.map +1 -1
- package/lib/types/AutoDispose.d.ts +3 -0
- package/lib/types/AutoDispose.d.ts.map +1 -0
- package/lib/types/AutoDispose.js +2 -0
- package/lib/types/AutoDispose.js.map +1 -0
- package/lib/types/CommandAction.d.ts +21 -0
- package/lib/types/CommandAction.d.ts.map +1 -0
- package/lib/types/CommandAction.js +2 -0
- package/lib/types/CommandAction.js.map +1 -0
- package/lib/types/CommandContext.d.ts +10 -0
- package/lib/types/CommandContext.d.ts.map +1 -0
- package/lib/types/CommandContext.js +2 -0
- package/lib/types/CommandContext.js.map +1 -0
- package/lib/types/CommandFunction.d.ts +2 -2
- package/lib/types/CommandFunction.d.ts.map +1 -1
- package/lib/types/CommandFunction.js.map +1 -1
- package/lib/types/CreateCommandActionOptions.d.ts +7 -0
- package/lib/types/CreateCommandActionOptions.d.ts.map +1 -0
- package/lib/types/CreateCommandActionOptions.js +2 -0
- package/lib/types/CreateCommandActionOptions.js.map +1 -0
- package/lib/types/Disposable.d.ts +4 -0
- package/lib/types/Disposable.d.ts.map +1 -0
- package/lib/types/Disposable.js +2 -0
- package/lib/types/Disposable.js.map +1 -0
- package/package.json +8 -11
- package/lib/commands/bundle/bundle.d.ts +0 -4
- package/lib/commands/bundle/bundle.d.ts.map +0 -1
- package/lib/commands/bundle/bundle.js.map +0 -1
- package/lib/commands/start/parseRequestInfo.d.ts +0 -7
- package/lib/commands/start/parseRequestInfo.d.ts.map +0 -1
- package/lib/commands/start/parseRequestInfo.js +0 -14
- package/lib/commands/start/parseRequestInfo.js.map +0 -1
- package/lib/commands/start/start.d.ts.map +0 -1
- package/lib/commands/start/start.js +0 -149
- package/lib/commands/start/start.js.map +0 -1
- package/lib/commands/sync/sync.d.ts +0 -4
- package/lib/commands/sync/sync.d.ts.map +0 -1
- package/lib/commands/sync/sync.js +0 -53
- package/lib/commands/sync/sync.js.map +0 -1
- package/lib/common/createPartialApiContext.d.ts +0 -14
- package/lib/common/createPartialApiContext.d.ts.map +0 -1
- package/lib/common/createPartialApiContext.js +0 -101
- package/lib/common/createPartialApiContext.js.map +0 -1
- package/lib/common/createSession.d.ts +0 -13
- package/lib/common/createSession.d.ts.map +0 -1
- package/lib/common/createSession.js +0 -62
- package/lib/common/createSession.js.map +0 -1
- package/lib/common/prepareOutputPath.d.ts +0 -5
- package/lib/common/prepareOutputPath.d.ts.map +0 -1
- package/lib/common/prepareOutputPath.js +0 -14
- package/lib/common/prepareOutputPath.js.map +0 -1
- package/lib/tasks/resolveDependenciesTask.d.ts +0 -16
- package/lib/tasks/resolveDependenciesTask.d.ts.map +0 -1
- package/lib/tasks/resolveDependenciesTask.js +0 -69
- package/lib/tasks/resolveDependenciesTask.js.map +0 -1
- package/lib/types/TaskContext.d.ts +0 -8
- package/lib/types/TaskContext.d.ts.map +0 -1
- package/lib/types/TaskContext.js +0 -2
- package/lib/types/TaskContext.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {} from '@ms-cloudpack/task-reporter';
|
|
2
|
+
import { readConfig } from '@ms-cloudpack/config';
|
|
3
|
+
import { setupReporting } from '../setupReporting.js';
|
|
4
|
+
export function createInitializeFunction(options) {
|
|
5
|
+
const { reporter, autoDispose } = options;
|
|
6
|
+
return async function initialize(appPath) {
|
|
7
|
+
const config = await readConfig(appPath);
|
|
8
|
+
const telemetryClient = await setupReporting({ appPath, config, reporter });
|
|
9
|
+
// Dispose the telemetry client when the app is closing
|
|
10
|
+
const disposeTelemetryClient = telemetryClient.shutdown.bind(telemetryClient);
|
|
11
|
+
const disposableTelemetry = {
|
|
12
|
+
dispose: disposeTelemetryClient,
|
|
13
|
+
};
|
|
14
|
+
autoDispose(disposableTelemetry);
|
|
15
|
+
return {
|
|
16
|
+
telemetryClient,
|
|
17
|
+
config,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=createInitializeFunction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInitializeFunction.js","sourceRoot":"","sources":["../../src/common/createInitializeFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,MAAM,UAAU,wBAAwB,CAAC,OAA6D;IACpG,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAC1C,OAAO,KAAK,UAAU,UAAU,CAAC,OAAe;QAC9C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,eAAe,GAAG,MAAM,cAAc,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;QAE5E,uDAAuD;QACvD,MAAM,sBAAsB,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC9E,MAAM,mBAAmB,GAAe;YACtC,OAAO,EAAE,sBAAsB;SAChC,CAAC;QACF,WAAW,CAAC,mBAAmB,CAAC,CAAC;QAEjC,OAAO;YACL,eAAe;YACf,MAAM;SACP,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { readConfig } from '@ms-cloudpack/config';\nimport { setupReporting } from '../setupReporting.js';\nimport type { AutoDispose } from '../types/AutoDispose.js';\nimport type { Disposable } from '../types/Disposable.js';\n\nexport function createInitializeFunction(options: { reporter: TaskReporter; autoDispose: AutoDispose }) {\n const { reporter, autoDispose } = options;\n return async function initialize(appPath: string) {\n const config = await readConfig(appPath);\n const telemetryClient = await setupReporting({ appPath, config, reporter });\n\n // Dispose the telemetry client when the app is closing\n const disposeTelemetryClient = telemetryClient.shutdown.bind(telemetryClient);\n const disposableTelemetry: Disposable = {\n dispose: disposeTelemetryClient,\n };\n autoDispose(disposableTelemetry);\n\n return {\n telemetryClient,\n config,\n };\n };\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
2
1
|
import { Command } from 'commander';
|
|
2
|
+
import { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
3
3
|
/**
|
|
4
4
|
* Entry point for the cloudpack CLI.
|
|
5
5
|
* Resolves all commands defined within the "./commands" folder.
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAM3D;;;GAGG;AACH,wBAAsB,IAAI,CAAC,WAAW,CAAC,EAAE;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAChD,iBA2CA"}
|
package/lib/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getVersion } from '@ms-cloudpack/package-utilities';
|
|
2
|
-
import { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
3
2
|
import { Command } from 'commander';
|
|
4
3
|
import glob from 'glob';
|
|
5
4
|
import path from 'path';
|
|
6
5
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
7
6
|
import { PerfMarkerCliEntry } from './performance/markers.js';
|
|
8
|
-
import {
|
|
7
|
+
import { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
8
|
+
import { createCommandActionFunction } from './common/createCommandActionFunction.js';
|
|
9
9
|
const currentFilePath = fileURLToPath(import.meta.url);
|
|
10
10
|
const currentPath = path.dirname(currentFilePath);
|
|
11
11
|
/**
|
|
@@ -15,9 +15,9 @@ const currentPath = path.dirname(currentFilePath);
|
|
|
15
15
|
export async function main(testOptions) {
|
|
16
16
|
performance.mark(PerfMarkerCliEntry);
|
|
17
17
|
const argv = testOptions?.argv || process.argv;
|
|
18
|
-
const
|
|
18
|
+
const cwd = testOptions?.appPath || process.cwd();
|
|
19
19
|
const reporter = testOptions?.reporter || new TaskReporter();
|
|
20
|
-
const
|
|
20
|
+
const abortController = new AbortController();
|
|
21
21
|
const program = new Command();
|
|
22
22
|
const version = getVersion(import.meta.url);
|
|
23
23
|
program.name('cloudpack').version(version).usage('<command> [options]');
|
|
@@ -28,9 +28,10 @@ export async function main(testOptions) {
|
|
|
28
28
|
// There was an issue with the glob above not working in tests, so make sure that doesn't happen again
|
|
29
29
|
throw new Error(`No commands found under "${currentPath}".`);
|
|
30
30
|
}
|
|
31
|
+
const createAction = createCommandActionFunction({ cwd, reporter, abortController });
|
|
31
32
|
for (const commandPath of commands) {
|
|
32
33
|
const commandFunction = (await import(pathToFileURL(path.join(currentPath, commandPath)).toString()));
|
|
33
|
-
commandFunction.init(program,
|
|
34
|
+
commandFunction.init(program, createAction);
|
|
34
35
|
}
|
|
35
36
|
program.option('-v, --verbose', 'Show additional details about the running tasks. (default: false)');
|
|
36
37
|
program.option('-d, --debug', 'Show debug information (superset of --verbose). (default: false)');
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAC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;QACpB,sGAAsG;QACtG,MAAM,IAAI,KAAK,CAAC,4BAA4B,WAAW,IAAI,CAAC,CAAC;KAC9D;IAED,MAAM,YAAY,GAAG,2BAA2B,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC;IAErF,KAAK,MAAM,WAAW,IAAI,QAAQ,EAAE;QAClC,MAAM,eAAe,GAAG,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAEnG,CAAC;QAEF,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;KAC7C;IAED,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,mEAAmE,CAAC,CAAC;IACrG,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,kEAAkE,CAAC,CAAC;IAClG,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,gDAAgD,CAAC,CAAC;IAEnF,WAAW,EAAE,iBAAiB,EAAE,CAAC,OAAO,CAAC,CAAC;IAE1C,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAE/B,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QAC7B,OAAO,CAAC,IAAI,EAAE,CAAC;KAChB;AACH,CAAC","sourcesContent":["import { getVersion } from '@ms-cloudpack/package-utilities';\nimport { Command } from 'commander';\nimport glob from 'glob';\nimport path from 'path';\nimport { fileURLToPath, pathToFileURL } from 'url';\nimport { PerfMarkerCliEntry } from './performance/markers.js';\nimport type { CommandFunction } from './types/CommandFunction.js';\nimport { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { createCommandActionFunction } from './common/createCommandActionFunction.js';\n\nconst currentFilePath = fileURLToPath(import.meta.url);\nconst currentPath = path.dirname(currentFilePath);\n\n/**\n * Entry point for the cloudpack CLI.\n * Resolves all commands defined within the \"./commands\" folder.\n */\nexport async function main(testOptions?: {\n appPath: string;\n argv: string[];\n reporter: TaskReporter;\n preParseOverrides?: (program: Command) => void;\n}) {\n performance.mark(PerfMarkerCliEntry);\n\n const argv = testOptions?.argv || process.argv;\n const cwd = testOptions?.appPath || process.cwd();\n const reporter = testOptions?.reporter || new TaskReporter();\n\n const abortController = new AbortController();\n\n const program = new Command();\n const version = getVersion(import.meta.url);\n\n program.name('cloudpack').version(version).usage('<command> [options]');\n\n // Ensure the glob works in tests\n const commandsGlob = `commands/*/index${path.extname(currentFilePath)}`;\n const commands = glob.sync(commandsGlob, { cwd: currentPath });\n if (!commands.length) {\n // There was an issue with the glob above not working in tests, so make sure that doesn't happen again\n throw new Error(`No commands found under \"${currentPath}\".`);\n }\n\n const createAction = createCommandActionFunction({ cwd, reporter, abortController });\n\n for (const commandPath of commands) {\n const commandFunction = (await import(pathToFileURL(path.join(currentPath, commandPath)).toString())) as {\n init: CommandFunction;\n };\n\n commandFunction.init(program, createAction);\n }\n\n program.option('-v, --verbose', 'Show additional details about the running tasks. (default: false)');\n program.option('-d, --debug', 'Show debug information (superset of --verbose). (default: false)');\n program.option('-n, --no-color', 'Disable colors in the output. (default: false)');\n\n testOptions?.preParseOverrides?.(program);\n\n await program.parseAsync(argv);\n\n if (program.args.length === 0) {\n program.help();\n }\n}\n"]}
|
package/lib/initTelemetry.js
CHANGED
|
@@ -28,7 +28,7 @@ export async function initTelemetry(options, taskReporter) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
// Register performance observers to track performance metrics as events of CLI span.
|
|
31
|
-
registerPerformanceObservers(telemetryClient
|
|
31
|
+
registerPerformanceObservers(telemetryClient);
|
|
32
32
|
return telemetryClient;
|
|
33
33
|
}
|
|
34
34
|
//# sourceMappingURL=initTelemetry.js.map
|
package/lib/initTelemetry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initTelemetry.js","sourceRoot":"","sources":["../src/initTelemetry.ts"],"names":[],"mappings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Version } from '@ms-cloudpack/package-utilities';\nimport { 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\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 const telemetryClient = await createTelemetryClient({\n productVersion: getVersion(import.meta.url),\n instrumentationKey,\n logLevel,\n serviceNamespace: 'cloudpack',\n serviceName: 'cli',\n rootSpanName: '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 // Register performance observers to track performance metrics as events of CLI span.\n registerPerformanceObservers(telemetryClient);\n\n return telemetryClient;\n}\n"]}
|
|
@@ -2,24 +2,8 @@
|
|
|
2
2
|
* Marks the start of the CLI entry point.
|
|
3
3
|
*/
|
|
4
4
|
export declare const PerfMarkerCliEntry = "CLI_ENTRY";
|
|
5
|
-
/**
|
|
6
|
-
* Marks the start of the sync download/upload operations.
|
|
7
|
-
*/
|
|
8
|
-
export declare const PerfMarkerSyncStart = "SYNC_START";
|
|
9
5
|
/**
|
|
10
6
|
* Measures the time it takes to open the browser.
|
|
11
7
|
*/
|
|
12
8
|
export declare const PerfMeasurementOpenBrowser = "OPEN_BROWSER";
|
|
13
|
-
/**
|
|
14
|
-
* Measures the time it takes to start resolving dependencies.
|
|
15
|
-
*/
|
|
16
|
-
export declare const PerfMeasurementTimeToResolveDependencies = "TIME_TO_RESOLVE_DEPENDENCIES";
|
|
17
|
-
/**
|
|
18
|
-
* Measures the time it takes to complete the download sync operation.
|
|
19
|
-
*/
|
|
20
|
-
export declare const PerfMeasurementSyncDownload = "SYNC_DOWNLOAD";
|
|
21
|
-
/**
|
|
22
|
-
* Measures the time it takes to complete the upload sync operation.
|
|
23
|
-
*/
|
|
24
|
-
export declare const PerfMeasurementSyncUpload = "SYNC_UPLOAD";
|
|
25
9
|
//# sourceMappingURL=markers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../src/performance/markers.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,kBAAkB,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../src/performance/markers.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAI9C;;GAEG;AACH,eAAO,MAAM,0BAA0B,iBAAiB,CAAC"}
|
|
@@ -3,25 +3,9 @@
|
|
|
3
3
|
* Marks the start of the CLI entry point.
|
|
4
4
|
*/
|
|
5
5
|
export const PerfMarkerCliEntry = 'CLI_ENTRY';
|
|
6
|
-
/**
|
|
7
|
-
* Marks the start of the sync download/upload operations.
|
|
8
|
-
*/
|
|
9
|
-
export const PerfMarkerSyncStart = 'SYNC_START';
|
|
10
6
|
// Measurements
|
|
11
7
|
/**
|
|
12
8
|
* Measures the time it takes to open the browser.
|
|
13
9
|
*/
|
|
14
10
|
export const PerfMeasurementOpenBrowser = 'OPEN_BROWSER';
|
|
15
|
-
/**
|
|
16
|
-
* Measures the time it takes to start resolving dependencies.
|
|
17
|
-
*/
|
|
18
|
-
export const PerfMeasurementTimeToResolveDependencies = 'TIME_TO_RESOLVE_DEPENDENCIES';
|
|
19
|
-
/**
|
|
20
|
-
* Measures the time it takes to complete the download sync operation.
|
|
21
|
-
*/
|
|
22
|
-
export const PerfMeasurementSyncDownload = 'SYNC_DOWNLOAD';
|
|
23
|
-
/**
|
|
24
|
-
* Measures the time it takes to complete the upload sync operation.
|
|
25
|
-
*/
|
|
26
|
-
export const PerfMeasurementSyncUpload = 'SYNC_UPLOAD';
|
|
27
11
|
//# sourceMappingURL=markers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markers.js","sourceRoot":"","sources":["../../src/performance/markers.ts"],"names":[],"mappings":"AAAA,UAAU;AAEV;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAE9C
|
|
1
|
+
{"version":3,"file":"markers.js","sourceRoot":"","sources":["../../src/performance/markers.ts"],"names":[],"mappings":"AAAA,UAAU;AAEV;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAE9C,eAAe;AAEf;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CAAC","sourcesContent":["// Markers\n\n/**\n * Marks the start of the CLI entry point.\n */\nexport const PerfMarkerCliEntry = 'CLI_ENTRY';\n\n// Measurements\n\n/**\n * Measures the time it takes to open the browser.\n */\nexport const PerfMeasurementOpenBrowser = 'OPEN_BROWSER';\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TelemetryClient } from '@ms-cloudpack/telemetry';
|
|
2
2
|
/**
|
|
3
3
|
* Registers a performance observer that will log all performance measurements and markers to Application Insights.
|
|
4
4
|
* @param span The span to add the events to.
|
|
5
5
|
*/
|
|
6
|
-
export declare function registerPerformanceObservers(
|
|
6
|
+
export declare function registerPerformanceObservers(telemetryClient: TelemetryClient): void;
|
|
7
7
|
//# sourceMappingURL=registerPerformanceObservers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerPerformanceObservers.d.ts","sourceRoot":"","sources":["../../src/performance/registerPerformanceObservers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registerPerformanceObservers.d.ts","sourceRoot":"","sources":["../../src/performance/registerPerformanceObservers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,eAAe,EAAE,eAAe,QAc5E"}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import { blue } from '@ms-cloudpack/task-reporter';
|
|
2
1
|
import { PerformanceObserver } from 'perf_hooks';
|
|
3
2
|
/**
|
|
4
3
|
* Registers a performance observer that will log all performance measurements and markers to Application Insights.
|
|
5
4
|
* @param span The span to add the events to.
|
|
6
5
|
*/
|
|
7
|
-
export function registerPerformanceObservers(
|
|
6
|
+
export function registerPerformanceObservers(telemetryClient) {
|
|
8
7
|
const perfMeasurementObserver = new PerformanceObserver((items) => {
|
|
9
|
-
for (const
|
|
10
|
-
|
|
11
|
-
console.debug(`Performance-Measurement: ${blue(entry.name)} took ${entry.duration}ms`);
|
|
8
|
+
for (const { name, duration } of items.getEntries()) {
|
|
9
|
+
telemetryClient.performance.record({ name, value: duration });
|
|
12
10
|
}
|
|
13
11
|
});
|
|
14
12
|
perfMeasurementObserver.observe({ entryTypes: ['measure'] });
|
|
15
13
|
const perfMarkObserver = new PerformanceObserver((items) => {
|
|
16
|
-
for (const
|
|
17
|
-
|
|
18
|
-
console.debug(`Performance-Marker: ${blue(entry.name)} at ${entry.startTime}ms`);
|
|
14
|
+
for (const { name, startTime } of items.getEntries()) {
|
|
15
|
+
telemetryClient.performance.record({ name, value: startTime });
|
|
19
16
|
}
|
|
20
17
|
});
|
|
21
18
|
perfMarkObserver.observe({ entryTypes: ['mark'] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerPerformanceObservers.js","sourceRoot":"","sources":["../../src/performance/registerPerformanceObservers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registerPerformanceObservers.js","sourceRoot":"","sources":["../../src/performance/registerPerformanceObservers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,eAAgC;IAC3E,MAAM,uBAAuB,GAAG,IAAI,mBAAmB,CAAC,CAAC,KAAK,EAAE,EAAE;QAChE,KAAK,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE,EAAE;YACnD,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;SAC/D;IACH,CAAC,CAAC,CAAC;IACH,uBAAuB,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAE7D,MAAM,gBAAgB,GAAG,IAAI,mBAAmB,CAAC,CAAC,KAAK,EAAE,EAAE;QACzD,KAAK,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE,EAAE;YACpD,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SAChE;IACH,CAAC,CAAC,CAAC;IACH,gBAAgB,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import type { TelemetryClient } from '@ms-cloudpack/telemetry';\nimport { PerformanceObserver } from 'perf_hooks';\n\n/**\n * Registers a performance observer that will log all performance measurements and markers to Application Insights.\n * @param span The span to add the events to.\n */\nexport function registerPerformanceObservers(telemetryClient: TelemetryClient) {\n const perfMeasurementObserver = new PerformanceObserver((items) => {\n for (const { name, duration } of items.getEntries()) {\n telemetryClient.performance.record({ name, value: duration });\n }\n });\n perfMeasurementObserver.observe({ entryTypes: ['measure'] });\n\n const perfMarkObserver = new PerformanceObserver((items) => {\n for (const { name, startTime } of items.getEntries()) {\n telemetryClient.performance.record({ name, value: startTime });\n }\n });\n perfMarkObserver.observe({ entryTypes: ['mark'] });\n}\n"]}
|
package/lib/setupReporting.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
2
|
+
import type { CloudpackConfig } from '@ms-cloudpack/config';
|
|
3
|
+
export declare function setupReporting(reportingOptions: {
|
|
4
|
+
reporter: TaskReporter;
|
|
5
|
+
config: CloudpackConfig;
|
|
6
|
+
appPath: string;
|
|
7
|
+
}): Promise<import("@ms-cloudpack/telemetry").TelemetryClient>;
|
|
3
8
|
//# sourceMappingURL=setupReporting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupReporting.d.ts","sourceRoot":"","sources":["../src/setupReporting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setupReporting.d.ts","sourceRoot":"","sources":["../src/setupReporting.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,6BAA6B,CAAC;AAKrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAQ5D,wBAAsB,cAAc,CAAC,gBAAgB,EAAE;IACrD,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB,8DA8BA"}
|
package/lib/setupReporting.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getVersion } from '@ms-cloudpack/package-utilities';
|
|
2
2
|
import { initTelemetry } from './initTelemetry.js';
|
|
3
|
-
import { bold, defaultLoggingConfig, verboseLoggingConfig, debugLoggingConfig
|
|
3
|
+
import { bold, defaultLoggingConfig, verboseLoggingConfig, debugLoggingConfig } from '@ms-cloudpack/task-reporter';
|
|
4
4
|
import { readJson } from '@ms-cloudpack/json-utilities';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import { isCIBuild } from './utilities/isCIBuild.js';
|
|
@@ -9,7 +9,8 @@ const useDebugLogging = argv.includes('--debug') || argv.includes('-d');
|
|
|
9
9
|
const verb = argv[2];
|
|
10
10
|
const useVerboseLogging = argv.includes('--verbose') || argv.includes('-v') || verb === 'bundle';
|
|
11
11
|
const version = getVersion(import.meta.url);
|
|
12
|
-
export async function setupReporting(
|
|
12
|
+
export async function setupReporting(reportingOptions) {
|
|
13
|
+
const { appPath, config, reporter } = reportingOptions;
|
|
13
14
|
reporter.setOptions({
|
|
14
15
|
productName: 'Cloudpack',
|
|
15
16
|
version,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupReporting.js","sourceRoot":"","sources":["../src/setupReporting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"setupReporting.js","sourceRoot":"","sources":["../src/setupReporting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEnH,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC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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 { initTelemetry } from './initTelemetry.js';\nimport { bold, defaultLoggingConfig, verboseLoggingConfig, debugLoggingConfig } from '@ms-cloudpack/task-reporter';\nimport type { TaskReporter, TaskReporterOptions } from '@ms-cloudpack/task-reporter';\nimport { readJson } from '@ms-cloudpack/json-utilities';\nimport path from 'path';\nimport type { PackageJson } from '@ms-cloudpack/bundler-types';\nimport { isCIBuild } from './utilities/isCIBuild.js';\nimport type { CloudpackConfig } from '@ms-cloudpack/config';\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(reportingOptions: {\n reporter: TaskReporter;\n config: CloudpackConfig;\n appPath: string;\n}) {\n const { appPath, config, reporter } = reportingOptions;\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: isCIBuild() ? '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.d.ts","sourceRoot":"","sources":["../../src/tasks/bundleTaskWorker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,wBAA8B,GAAG,CAAC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"bundleTaskWorker.d.ts","sourceRoot":"","sources":["../../src/tasks/bundleTaskWorker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,wBAA8B,GAAG,CAAC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,iBAUzD"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { bundleTask } from '@ms-cloudpack/api-server';
|
|
2
2
|
export default async function run(data) {
|
|
3
3
|
const { target } = data;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
await bundleTask({
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
6
|
+
bundleRequest: target.options?.bundleRequest,
|
|
7
|
+
// TODO: Need to pass real resolveMap here
|
|
8
|
+
resolveMap: {},
|
|
9
|
+
});
|
|
6
10
|
}
|
|
7
11
|
//# sourceMappingURL=bundleTaskWorker.js.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,MAAM,UAAU,CAAC;QACf,mEAAmE;QACnE,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,aAAa;QAE5C,0CAA0C;QAC1C,UAAU,EAAE,EAAE;KACf,CAAC,CAAC;AACL,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 await bundleTask({\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n bundleRequest: target.options?.bundleRequest,\n\n // TODO: Need to pass real resolveMap here\n resolveMap: {},\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoDispose.d.ts","sourceRoot":"","sources":["../../src/types/AutoDispose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,SAAS,UAAU,EAAE,GAAG,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoDispose.js","sourceRoot":"","sources":["../../src/types/AutoDispose.ts"],"names":[],"mappings":"","sourcesContent":["import type { Disposable } from './Disposable.js';\n\nexport type AutoDispose = <T extends Disposable>(...items: T[]) => T[];\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
2
|
+
import type { CloudpackConfig } from '@ms-cloudpack/config';
|
|
3
|
+
import type { TelemetryClient } from '@ms-cloudpack/telemetry';
|
|
4
|
+
import type { AutoDispose } from './AutoDispose.js';
|
|
5
|
+
export type CommandActionOptions<TOptions> = {
|
|
6
|
+
options: TOptions;
|
|
7
|
+
reporter: TaskReporter;
|
|
8
|
+
cwd: string;
|
|
9
|
+
initialize: (appPath: string) => Promise<{
|
|
10
|
+
telemetryClient: TelemetryClient;
|
|
11
|
+
config: CloudpackConfig;
|
|
12
|
+
}>;
|
|
13
|
+
autoDispose: AutoDispose;
|
|
14
|
+
abortSignal: AbortSignal;
|
|
15
|
+
exit: (result: {
|
|
16
|
+
exitCode: number;
|
|
17
|
+
message?: string;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
export type CommandAction<TOptions> = (options: CommandActionOptions<TOptions>) => Promise<void>;
|
|
21
|
+
//# sourceMappingURL=CommandAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandAction.d.ts","sourceRoot":"","sources":["../../src/types/CommandAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,oBAAoB,CAAC,QAAQ,IAAI;IAC3C,OAAO,EAAE,QAAQ,CAAC;IAClB,QAAQ,EAAE,YAAY,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;QACvC,eAAe,EAAE,eAAe,CAAC;QACjC,MAAM,EAAE,eAAe,CAAC;KACzB,CAAC,CAAC;IACH,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzE,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,QAAQ,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandAction.js","sourceRoot":"","sources":["../../src/types/CommandAction.ts"],"names":[],"mappings":"","sourcesContent":["import type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { CloudpackConfig } from '@ms-cloudpack/config';\nimport type { TelemetryClient } from '@ms-cloudpack/telemetry';\nimport type { AutoDispose } from './AutoDispose.js';\n\nexport type CommandActionOptions<TOptions> = {\n options: TOptions;\n reporter: TaskReporter;\n cwd: string;\n initialize: (appPath: string) => Promise<{\n telemetryClient: TelemetryClient;\n config: CloudpackConfig;\n }>;\n autoDispose: AutoDispose;\n abortSignal: AbortSignal;\n exit: (result: { exitCode: number; message?: string }) => Promise<void>;\n};\n\nexport type CommandAction<TOptions> = (options: CommandActionOptions<TOptions>) => Promise<void>;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CloudpackConfig, readConfig } from '@ms-cloudpack/config';
|
|
2
|
+
import type { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
3
|
+
import type { TelemetryClient } from '@ms-cloudpack/telemetry';
|
|
4
|
+
export type CreateCommandContext = () => Promise<CommandContext>;
|
|
5
|
+
export interface CommandContext {
|
|
6
|
+
reporter: TaskReporter;
|
|
7
|
+
readConfig: typeof readConfig;
|
|
8
|
+
createTelemetryClient: (config: CloudpackConfig) => Promise<TelemetryClient>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=CommandContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandContext.d.ts","sourceRoot":"","sources":["../../src/types/CommandContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,YAAY,CAAC;IACvB,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,qBAAqB,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CAC9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandContext.js","sourceRoot":"","sources":["../../src/types/CommandContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { CloudpackConfig, readConfig } from '@ms-cloudpack/config';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { TelemetryClient } from '@ms-cloudpack/telemetry';\n\nexport type CreateCommandContext = () => Promise<CommandContext>;\n\nexport interface CommandContext {\n reporter: TaskReporter;\n readConfig: typeof readConfig;\n createTelemetryClient: (config: CloudpackConfig) => Promise<TelemetryClient>;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
|
-
import type {
|
|
3
|
-
export type CommandFunction = (command: Command,
|
|
2
|
+
import type { CreateCommandAction } from '../common/createCommandActionFunction.js';
|
|
3
|
+
export type CommandFunction = (command: Command, createAction: CreateCommandAction) => void;
|
|
4
4
|
//# sourceMappingURL=CommandFunction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandFunction.d.ts","sourceRoot":"","sources":["../../src/types/CommandFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"CommandFunction.d.ts","sourceRoot":"","sources":["../../src/types/CommandFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,KAAK,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandFunction.js","sourceRoot":"","sources":["../../src/types/CommandFunction.ts"],"names":[],"mappings":"","sourcesContent":["import type { Command } from 'commander';\nimport type {
|
|
1
|
+
{"version":3,"file":"CommandFunction.js","sourceRoot":"","sources":["../../src/types/CommandFunction.ts"],"names":[],"mappings":"","sourcesContent":["import type { Command } from 'commander';\nimport type { CreateCommandAction } from '../common/createCommandActionFunction.js';\n\nexport type CommandFunction = (command: Command, createAction: CreateCommandAction) => void;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateCommandActionOptions.d.ts","sourceRoot":"","sources":["../../src/types/CreateCommandActionOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,0BAA0B,CAAC,QAAQ;IAClD,OAAO,EAAE,OAAO,CAAC;QACf,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;KAClC,CAAC,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateCommandActionOptions.js","sourceRoot":"","sources":["../../src/types/CreateCommandActionOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { CommandAction } from './CommandAction.js';\n\nexport interface CreateCommandActionOptions<TOptions> {\n execute: Promise<{\n execute: CommandAction<TOptions>;\n }>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Disposable.d.ts","sourceRoot":"","sources":["../../src/types/Disposable.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Disposable.js","sourceRoot":"","sources":["../../src/types/Disposable.ts"],"names":[],"mappings":"","sourcesContent":["export interface Disposable {\n dispose: () => Promise<void>;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.1",
|
|
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,19 +11,17 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@lage-run/target-graph": "^0.8.6",
|
|
14
|
-
"@ms-cloudpack/api-server": "^0.
|
|
15
|
-
"@ms-cloudpack/bundler": "^0.14.
|
|
16
|
-
"@ms-cloudpack/config": "^0.12.
|
|
14
|
+
"@ms-cloudpack/api-server": "^0.17.0",
|
|
15
|
+
"@ms-cloudpack/bundler": "^0.14.12",
|
|
16
|
+
"@ms-cloudpack/config": "^0.12.2",
|
|
17
17
|
"@ms-cloudpack/create-express-app": "^1.3.9",
|
|
18
|
-
"@ms-cloudpack/data-bus": "^0.4.0",
|
|
19
|
-
"@ms-cloudpack/file-watcher": "^0.1.0",
|
|
20
18
|
"@ms-cloudpack/json-utilities": "^0.0.7",
|
|
21
|
-
"@ms-cloudpack/overlay": "^0.14.
|
|
22
|
-
"@ms-cloudpack/package-utilities": "^5.1.
|
|
19
|
+
"@ms-cloudpack/overlay": "^0.14.16",
|
|
20
|
+
"@ms-cloudpack/package-utilities": "^5.1.4",
|
|
23
21
|
"@ms-cloudpack/path-string-parsing": "^1.0.3",
|
|
24
22
|
"@ms-cloudpack/path-utilities": "^2.3.2",
|
|
25
23
|
"@ms-cloudpack/task-reporter": "^0.7.2",
|
|
26
|
-
"@ms-cloudpack/telemetry": "^0.3.
|
|
24
|
+
"@ms-cloudpack/telemetry": "^0.3.8",
|
|
27
25
|
"commander": "^11.0.0",
|
|
28
26
|
"cross-spawn": "^7.0.3",
|
|
29
27
|
"fs-extra": "^11.0.0",
|
|
@@ -32,8 +30,7 @@
|
|
|
32
30
|
"jsdom": "^22.0.0",
|
|
33
31
|
"open": "^9.0.0",
|
|
34
32
|
"prompts": "^2.4.2",
|
|
35
|
-
"semver": "^7.3.7"
|
|
36
|
-
"uuid": "^9.0.0"
|
|
33
|
+
"semver": "^7.3.7"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
36
|
"@ms-cloudpack/bundler-types": "*",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../src/commands/bundle/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAM9D,wBAAsB,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,iBA8BxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../../src/commands/bundle/bundle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAsB,EAAE,OAAoB;IACvE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,kBAAkB,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC;IACzF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEnD,MAAM,eAAe,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;IAEtD,MAAM,GAAG,GAAG,MAAM,uBAAuB,CAAC;QACxC,GAAG,OAAO;QACV,eAAe;QACf,KAAK,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,CAAC;KAC/D,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAEvD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,oBAAoB,CAAC;QAC5C,KAAK,EAAE;YACL,IAAI,EAAE,UAAU,EAAE,IAAI,IAAI,WAAW;YACrC,OAAO,EAAE,UAAU,EAAE,OAAO,IAAI,OAAO;YACvC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;YAC7C,WAAW;YACX,iBAAiB;SAClB;QACD,GAAG;KACJ,CAAC,CAAC;IAEH,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;IACpB,MAAM,eAAe,CAAC,QAAQ,EAAE,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAEpB,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,uBAAuB","sourcesContent":["import type { BundleOptions } from './types/BundleOptions.js';\nimport type { TaskContext } from '../../types/TaskContext.js';\nimport { setupReporting } from '../../setupReporting.js';\nimport { ensurePackageBundled } from '@ms-cloudpack/api-server/apis';\nimport path from 'path';\nimport { createPartialApiContext } from '../../common/createPartialApiContext.js';\n\nexport async function bundle(options: BundleOptions, context: TaskContext) {\n const { bundler: bundlerType, outdir = 'dist/browser-esm', disableSourceMaps } = options;\n const { reporter, appPath: packagePath } = context;\n\n const telemetryClient = await setupReporting(context);\n\n const ctx = await createPartialApiContext({\n ...context,\n telemetryClient,\n items: ['packages', 'watcher', 'session', 'taskRunner', 'bus'],\n });\n\n const definition = await ctx.packages.get(packagePath);\n\n const { result } = await ensurePackageBundled({\n input: {\n name: definition?.name ?? '<unknown>',\n version: definition?.version ?? '0.0.0',\n outputPath: path.resolve(packagePath, outdir),\n bundlerType,\n disableSourceMaps,\n },\n ctx,\n });\n\n await ctx.dispose();\n await telemetryClient.shutdown();\n reporter.complete();\n\n process.exit(result?.errors?.length === 0 ? 0 : 1);\n}\n\n// cspell:ignore outdir\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseRequestInfo.d.ts","sourceRoot":"","sources":["../../../src/commands/start/parseRequestInfo.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM;;;;;EAiBnD"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function parseRequestInfo(requestPath) {
|
|
2
|
-
const matches = requestPath.match(/[/]?(@[-_a-z-A-Z0-9.]+\/[-_a-z-A-Z0-9.]+|[a-zA-Z-0-9.]+)(@([-_a-zA-Z-0-9.]+))?(\/v([0-9.]+))?(\/(bundled|unbundled))?(\/[-_/a-zA-Z0-9.+]+)?/) || [];
|
|
3
|
-
const packageName = matches[1] || '';
|
|
4
|
-
const version = matches[3] || '';
|
|
5
|
-
const bundled = (matches.length > 8 && matches[7]) === 'bundled';
|
|
6
|
-
const filePath = (matches.length > 8 && matches[8]) || '';
|
|
7
|
-
return {
|
|
8
|
-
packageName,
|
|
9
|
-
version,
|
|
10
|
-
bundled,
|
|
11
|
-
filePath,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=parseRequestInfo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseRequestInfo.js","sourceRoot":"","sources":["../../../src/commands/start/parseRequestInfo.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAClD,MAAM,OAAO,GACX,WAAW,CAAC,KAAK,CACf,6IAA6I,CAC9I,IAAI,EAAE,CAAC;IAEV,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACjC,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;IACjE,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAE1D,OAAO;QACL,WAAW;QACX,OAAO;QACP,OAAO;QACP,QAAQ;KACT,CAAC;AACJ,CAAC","sourcesContent":["export function parseRequestInfo(requestPath: string) {\n const matches =\n requestPath.match(\n /[/]?(@[-_a-z-A-Z0-9.]+\\/[-_a-z-A-Z0-9.]+|[a-zA-Z-0-9.]+)(@([-_a-zA-Z-0-9.]+))?(\\/v([0-9.]+))?(\\/(bundled|unbundled))?(\\/[-_/a-zA-Z0-9.+]+)?/,\n ) || [];\n\n const packageName = matches[1] || '';\n const version = matches[3] || '';\n const bundled = (matches.length > 8 && matches[7]) === 'bundled';\n const filePath = (matches.length > 8 && matches[8]) || '';\n\n return {\n packageName,\n version,\n bundled,\n filePath,\n };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/start/start.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAQ5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAO9D,wDAAwD;AACxD,wBAAsB,WAAW,kBAKhC;AAqBD;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,iBAuItE"}
|