@ms-cloudpack/cli 0.45.3 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/lib/commands/bundle/execute.d.ts +4 -0
  2. package/lib/commands/bundle/execute.d.ts.map +1 -0
  3. package/lib/commands/bundle/{bundle.js → execute.js} +14 -15
  4. package/lib/commands/bundle/execute.js.map +1 -0
  5. package/lib/commands/bundle/index.d.ts.map +1 -1
  6. package/lib/commands/bundle/index.js +4 -2
  7. package/lib/commands/bundle/index.js.map +1 -1
  8. package/lib/commands/init/bundleAndGetImports.d.ts.map +1 -1
  9. package/lib/commands/init/bundleAndGetImports.js +3 -1
  10. package/lib/commands/init/bundleAndGetImports.js.map +1 -1
  11. package/lib/commands/init/execute.d.ts +5 -0
  12. package/lib/commands/init/execute.d.ts.map +1 -0
  13. package/lib/commands/init/execute.js +14 -0
  14. package/lib/commands/init/execute.js.map +1 -0
  15. package/lib/commands/init/index.d.ts.map +1 -1
  16. package/lib/commands/init/index.js +4 -2
  17. package/lib/commands/init/index.js.map +1 -1
  18. package/lib/commands/init/init.d.ts +11 -5
  19. package/lib/commands/init/init.d.ts.map +1 -1
  20. package/lib/commands/init/init.js +79 -102
  21. package/lib/commands/init/init.js.map +1 -1
  22. package/lib/commands/start/index.d.ts.map +1 -1
  23. package/lib/commands/start/index.js +4 -2
  24. package/lib/commands/start/index.js.map +1 -1
  25. package/lib/commands/start/start.d.ts +2 -2
  26. package/lib/commands/start/start.d.ts.map +1 -1
  27. package/lib/commands/start/start.js +92 -114
  28. package/lib/commands/start/start.js.map +1 -1
  29. package/lib/commands/start/startBundleServer.js +4 -4
  30. package/lib/commands/start/startBundleServer.js.map +1 -1
  31. package/lib/commands/sync/index.d.ts.map +1 -1
  32. package/lib/commands/sync/index.js +4 -5
  33. package/lib/commands/sync/index.js.map +1 -1
  34. package/lib/commands/sync/sync.d.ts +2 -2
  35. package/lib/commands/sync/sync.d.ts.map +1 -1
  36. package/lib/commands/sync/sync.js +26 -48
  37. package/lib/commands/sync/sync.js.map +1 -1
  38. package/lib/common/AutoDisposableList.d.ts +7 -0
  39. package/lib/common/AutoDisposableList.d.ts.map +1 -0
  40. package/lib/common/AutoDisposableList.js +17 -0
  41. package/lib/common/AutoDisposableList.js.map +1 -0
  42. package/lib/common/createCommandActionFunction.d.ts +14 -0
  43. package/lib/common/createCommandActionFunction.d.ts.map +1 -0
  44. package/lib/common/createCommandActionFunction.js +66 -0
  45. package/lib/common/createCommandActionFunction.js.map +1 -0
  46. package/lib/common/createExitFunction.d.ts +12 -0
  47. package/lib/common/createExitFunction.d.ts.map +1 -0
  48. package/lib/common/createExitFunction.js +17 -0
  49. package/lib/common/createExitFunction.js.map +1 -0
  50. package/lib/common/createInitializeFunction.d.ts +10 -0
  51. package/lib/common/createInitializeFunction.d.ts.map +1 -0
  52. package/lib/common/createInitializeFunction.js +21 -0
  53. package/lib/common/createInitializeFunction.js.map +1 -0
  54. package/lib/index.d.ts +1 -1
  55. package/lib/index.d.ts.map +1 -1
  56. package/lib/index.js +6 -5
  57. package/lib/index.js.map +1 -1
  58. package/lib/performance/markers.d.ts +0 -4
  59. package/lib/performance/markers.d.ts.map +1 -1
  60. package/lib/performance/markers.js +0 -4
  61. package/lib/performance/markers.js.map +1 -1
  62. package/lib/setupReporting.d.ts +7 -2
  63. package/lib/setupReporting.d.ts.map +1 -1
  64. package/lib/setupReporting.js +3 -2
  65. package/lib/setupReporting.js.map +1 -1
  66. package/lib/tasks/bundleTaskWorker.d.ts.map +1 -1
  67. package/lib/tasks/bundleTaskWorker.js +6 -2
  68. package/lib/tasks/bundleTaskWorker.js.map +1 -1
  69. package/lib/types/AutoDispose.d.ts +3 -0
  70. package/lib/types/AutoDispose.d.ts.map +1 -0
  71. package/lib/types/AutoDispose.js +2 -0
  72. package/lib/types/AutoDispose.js.map +1 -0
  73. package/lib/types/CommandAction.d.ts +21 -0
  74. package/lib/types/CommandAction.d.ts.map +1 -0
  75. package/lib/types/CommandAction.js +2 -0
  76. package/lib/types/CommandAction.js.map +1 -0
  77. package/lib/types/CommandContext.d.ts +10 -0
  78. package/lib/types/CommandContext.d.ts.map +1 -0
  79. package/lib/types/CommandContext.js +2 -0
  80. package/lib/types/CommandContext.js.map +1 -0
  81. package/lib/types/CommandFunction.d.ts +2 -2
  82. package/lib/types/CommandFunction.d.ts.map +1 -1
  83. package/lib/types/CommandFunction.js.map +1 -1
  84. package/lib/types/CreateCommandActionOptions.d.ts +7 -0
  85. package/lib/types/CreateCommandActionOptions.d.ts.map +1 -0
  86. package/lib/types/CreateCommandActionOptions.js +2 -0
  87. package/lib/types/CreateCommandActionOptions.js.map +1 -0
  88. package/lib/types/Disposable.d.ts +4 -0
  89. package/lib/types/Disposable.d.ts.map +1 -0
  90. package/lib/types/Disposable.js +2 -0
  91. package/lib/types/Disposable.js.map +1 -0
  92. package/package.json +7 -10
  93. package/lib/commands/bundle/bundle.d.ts +0 -4
  94. package/lib/commands/bundle/bundle.d.ts.map +0 -1
  95. package/lib/commands/bundle/bundle.js.map +0 -1
  96. package/lib/common/createPartialApiContext.d.ts +0 -14
  97. package/lib/common/createPartialApiContext.d.ts.map +0 -1
  98. package/lib/common/createPartialApiContext.js +0 -101
  99. package/lib/common/createPartialApiContext.js.map +0 -1
  100. package/lib/common/createSession.d.ts +0 -13
  101. package/lib/common/createSession.d.ts.map +0 -1
  102. package/lib/common/createSession.js +0 -62
  103. package/lib/common/createSession.js.map +0 -1
  104. package/lib/tasks/resolveDependenciesTask.d.ts +0 -16
  105. package/lib/tasks/resolveDependenciesTask.d.ts.map +0 -1
  106. package/lib/tasks/resolveDependenciesTask.js +0 -69
  107. package/lib/tasks/resolveDependenciesTask.js.map +0 -1
  108. package/lib/types/TaskContext.d.ts +0 -8
  109. package/lib/types/TaskContext.d.ts.map +0 -1
  110. package/lib/types/TaskContext.js +0 -2
  111. package/lib/types/TaskContext.js.map +0 -1
@@ -0,0 +1,66 @@
1
+ import {} from '@ms-cloudpack/task-reporter';
2
+ import { AutoDisposableList } from './AutoDisposableList.js';
3
+ import { createExitFunction } from './createExitFunction.js';
4
+ import { createInitializeFunction } from './createInitializeFunction.js';
5
+ /**
6
+ * It creates a function that creates a command action.
7
+ * @param createCommandActionFactoryOptions - Options for creating the command action factory.
8
+ * @returns A function that creates a command action.
9
+ */
10
+ export function createCommandActionFunction(createCommandActionFactoryOptions) {
11
+ const { abortController, reporter, cwd } = createCommandActionFactoryOptions;
12
+ /**
13
+ * This function will be called to create a command action.
14
+ */
15
+ return function createAction(getCreateActionOptions) {
16
+ return async (options) => {
17
+ const createActionOptions = getCreateActionOptions();
18
+ // Dynamically import the execute function
19
+ const execute = await createActionOptions.execute.then((m) => m.execute);
20
+ // This list will be used to dispose all registered disposables.
21
+ const autoDisposableList = new AutoDisposableList();
22
+ // This function will be used to register a disposable.
23
+ const autoDispose = autoDisposableList.add.bind(autoDisposableList);
24
+ // This function will be called instead of process.exit. It provides a way to cleanup and exit the process gracefully.
25
+ const exit = createExitFunction({ abortController, reporter, autoDisposableList });
26
+ // This function will be called to initialize the command.
27
+ const initialize = createInitializeFunction({ reporter, autoDispose });
28
+ try {
29
+ // Setup cleanup and close things on completion.
30
+ let sigintCount = 0;
31
+ // Handle SIGINT (Ctrl+C) gracefully.
32
+ process.on('SIGINT', () => {
33
+ sigintCount++;
34
+ if (sigintCount > 1) {
35
+ console.debug('Forcing exit');
36
+ // We are forcing the process to exit.
37
+ // No clean-up is needed because user pressed Ctrl+C twice.
38
+ process.exit(1);
39
+ }
40
+ // We are trying to exit gracefully.
41
+ void exit();
42
+ });
43
+ // This is the abort signal that will be passed to the execute function.
44
+ const abortSignal = abortController.signal;
45
+ // Call the execute function which is the real command logic (ie: real init command logic, real start command logic, etc.)
46
+ await execute({
47
+ cwd,
48
+ options,
49
+ reporter,
50
+ initialize,
51
+ abortSignal,
52
+ autoDispose,
53
+ exit,
54
+ });
55
+ }
56
+ catch (error) {
57
+ // If an error occurs, exit the process with a non-zero exit code.
58
+ await exit({
59
+ hasErrors: true,
60
+ message: error instanceof Error ? error.message : '<Unknown error>',
61
+ });
62
+ }
63
+ };
64
+ };
65
+ }
66
+ //# sourceMappingURL=createCommandActionFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCommandActionFunction.js","sourceRoot":"","sources":["../../src/common/createCommandActionFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,iCAI3C;IACC,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,iCAAiC,CAAC;IAE7E;;OAEG;IACH,OAAO,SAAS,YAAY,CAC1B,sBAAwE;QAExE,OAAO,KAAK,EAAE,OAAuB,EAAE,EAAE;YACvC,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;YAErD,0CAA0C;YAC1C,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YAEzE,gEAAgE;YAChE,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC;YAEpD,uDAAuD;YACvD,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAEpE,sHAAsH;YACtH,MAAM,IAAI,GAAG,kBAAkB,CAAC,EAAE,eAAe,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC,CAAC;YAEnF,0DAA0D;YAC1D,MAAM,UAAU,GAAG,wBAAwB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;YAEvE,IAAI;gBACF,gDAAgD;gBAChD,IAAI,WAAW,GAAG,CAAC,CAAC;gBAEpB,qCAAqC;gBACrC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;oBACxB,WAAW,EAAE,CAAC;oBACd,IAAI,WAAW,GAAG,CAAC,EAAE;wBACnB,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;wBAE9B,sCAAsC;wBACtC,2DAA2D;wBAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBACjB;oBAED,oCAAoC;oBACpC,KAAK,IAAI,EAAE,CAAC;gBACd,CAAC,CAAC,CAAC;gBAEH,wEAAwE;gBACxE,MAAM,WAAW,GAAG,eAAe,CAAC,MAAM,CAAC;gBAE3C,0HAA0H;gBAC1H,MAAM,OAAO,CAAC;oBACZ,GAAG;oBACH,OAAO;oBACP,QAAQ;oBACR,UAAU;oBACV,WAAW;oBACX,WAAW;oBACX,IAAI;iBACL,CAAC,CAAC;aACJ;YAAC,OAAO,KAAK,EAAE;gBACd,kEAAkE;gBAClE,MAAM,IAAI,CAAC;oBACT,SAAS,EAAE,IAAI;oBACf,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB;iBACpE,CAAC,CAAC;aACJ;QACH,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { CreateCommandActionOptions } from '../types/CreateCommandActionOptions.js';\nimport { AutoDisposableList } from './AutoDisposableList.js';\nimport { createExitFunction } from './createExitFunction.js';\nimport { createInitializeFunction } from './createInitializeFunction.js';\n\n/**\n * It creates a function that creates a command action.\n * @param createCommandActionFactoryOptions - Options for creating the command action factory.\n * @returns A function that creates a command action.\n */\nexport function createCommandActionFunction(createCommandActionFactoryOptions: {\n cwd: string;\n abortController: AbortController;\n reporter: TaskReporter;\n}) {\n const { abortController, reporter, cwd } = createCommandActionFactoryOptions;\n\n /**\n * This function will be called to create a command action.\n */\n return function createAction<TActionOptions>(\n getCreateActionOptions: () => CreateCommandActionOptions<TActionOptions>,\n ) {\n return async (options: TActionOptions) => {\n const createActionOptions = getCreateActionOptions();\n\n // Dynamically import the execute function\n const execute = await createActionOptions.execute.then((m) => m.execute);\n\n // This list will be used to dispose all registered disposables.\n const autoDisposableList = new AutoDisposableList();\n\n // This function will be used to register a disposable.\n const autoDispose = autoDisposableList.add.bind(autoDisposableList);\n\n // This function will be called instead of process.exit. It provides a way to cleanup and exit the process gracefully.\n const exit = createExitFunction({ abortController, reporter, autoDisposableList });\n\n // This function will be called to initialize the command.\n const initialize = createInitializeFunction({ reporter, autoDispose });\n\n try {\n // Setup cleanup and close things on completion.\n let sigintCount = 0;\n\n // Handle SIGINT (Ctrl+C) gracefully.\n process.on('SIGINT', () => {\n sigintCount++;\n if (sigintCount > 1) {\n console.debug('Forcing exit');\n\n // We are forcing the process to exit.\n // No clean-up is needed because user pressed Ctrl+C twice.\n process.exit(1);\n }\n\n // We are trying to exit gracefully.\n void exit();\n });\n\n // This is the abort signal that will be passed to the execute function.\n const abortSignal = abortController.signal;\n\n // Call the execute function which is the real command logic (ie: real init command logic, real start command logic, etc.)\n await execute({\n cwd,\n options,\n reporter,\n initialize,\n abortSignal,\n autoDispose,\n exit,\n });\n } catch (error) {\n // If an error occurs, exit the process with a non-zero exit code.\n await exit({\n hasErrors: true,\n message: error instanceof Error ? error.message : '<Unknown error>',\n });\n }\n };\n };\n}\n\nexport type CreateCommandAction = ReturnType<typeof createCommandActionFunction>;\n"]}
@@ -0,0 +1,12 @@
1
+ import { type TaskReporter } from '@ms-cloudpack/task-reporter';
2
+ import type { AutoDisposableList } from './AutoDisposableList.js';
3
+ export declare function createExitFunction(options: {
4
+ reporter: TaskReporter;
5
+ abortController: AbortController;
6
+ autoDisposableList: AutoDisposableList;
7
+ }): (exitOptions?: {
8
+ hasErrors?: boolean;
9
+ message?: string;
10
+ exitCode?: number;
11
+ }) => Promise<never>;
12
+ //# sourceMappingURL=createExitFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createExitFunction.d.ts","sourceRoot":"","sources":["../../src/common/createExitFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,QAAQ,EAAE,YAAY,CAAC;IACvB,eAAe,EAAE,eAAe,CAAC;IACjC,kBAAkB,EAAE,kBAAkB,CAAC;CACxC,kBAIgB;IACX,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,oBAiBJ"}
@@ -0,0 +1,17 @@
1
+ import { red } from '@ms-cloudpack/task-reporter';
2
+ export function createExitFunction(options) {
3
+ const { abortController, reporter, autoDisposableList } = options;
4
+ return async function exit(exitOptions = {}) {
5
+ const { message } = exitOptions;
6
+ const hasErrors = exitOptions.hasErrors ?? reporter.hasErrors();
7
+ // Let the execute function know that we are exiting.
8
+ abortController.abort();
9
+ // Dispose all registered disposables.
10
+ await autoDisposableList.dispose();
11
+ reporter.complete(hasErrors ? red(message) : message);
12
+ // Exit the process with the appropriate exit code.
13
+ const exitCode = exitOptions.exitCode ?? (hasErrors ? 1 : 0);
14
+ process.exit(exitCode);
15
+ };
16
+ }
17
+ //# sourceMappingURL=createExitFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createExitFunction.js","sourceRoot":"","sources":["../../src/common/createExitFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAGrE,MAAM,UAAU,kBAAkB,CAAC,OAIlC;IACC,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC;IAElE,OAAO,KAAK,UAAU,IAAI,CACxB,cAII,EAAE;QAEN,MAAM,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;QAChC,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC;QAEhE,qDAAqD;QACrD,eAAe,CAAC,KAAK,EAAE,CAAC;QAExB,sCAAsC;QACtC,MAAM,kBAAkB,CAAC,OAAO,EAAE,CAAC;QAEnC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAEtD,mDAAmD;QACnD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { type TaskReporter, red } from '@ms-cloudpack/task-reporter';\nimport type { AutoDisposableList } from './AutoDisposableList.js';\n\nexport function createExitFunction(options: {\n reporter: TaskReporter;\n abortController: AbortController;\n autoDisposableList: AutoDisposableList;\n}) {\n const { abortController, reporter, autoDisposableList } = options;\n\n return async function exit(\n exitOptions: {\n hasErrors?: boolean;\n message?: string;\n exitCode?: number;\n } = {},\n ) {\n const { message } = exitOptions;\n const hasErrors = exitOptions.hasErrors ?? reporter.hasErrors();\n\n // Let the execute function know that we are exiting.\n abortController.abort();\n\n // Dispose all registered disposables.\n await autoDisposableList.dispose();\n\n reporter.complete(hasErrors ? red(message) : message);\n\n // Exit the process with the appropriate exit code.\n const exitCode = exitOptions.exitCode ?? (hasErrors ? 1 : 0);\n process.exit(exitCode);\n };\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { type TaskReporter } from '@ms-cloudpack/task-reporter';
2
+ import type { AutoDispose } from '../types/AutoDispose.js';
3
+ export declare function createInitializeFunction(options: {
4
+ reporter: TaskReporter;
5
+ autoDispose: AutoDispose;
6
+ }): (appPath: string) => Promise<{
7
+ telemetryClient: import("@ms-cloudpack/telemetry").TelemetryClient;
8
+ config: import("@ms-cloudpack/config").CloudpackConfig;
9
+ }>;
10
+ //# sourceMappingURL=createInitializeFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createInitializeFunction.d.ts","sourceRoot":"","sources":["../../src/common/createInitializeFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAAE,QAAQ,EAAE,YAAY,CAAC;IAAC,WAAW,EAAE,WAAW,CAAA;CAAE,aAE1D,MAAM;;;GAgBjD"}
@@ -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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC;;;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,iBAwCA"}
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 { readConfig } from '@ms-cloudpack/config';
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 appPath = testOptions?.appPath || process.cwd();
18
+ const cwd = testOptions?.appPath || process.cwd();
19
19
  const reporter = testOptions?.reporter || new TaskReporter();
20
- const config = await readConfig(appPath);
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, { reporter, appPath, config });
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,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAElD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,WAK1B;IACC,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAErC,MAAM,IAAI,GAAG,WAAW,EAAE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAC/C,MAAM,OAAO,GAAG,WAAW,EAAE,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAG,WAAW,EAAE,QAAQ,IAAI,IAAI,YAAY,EAAE,CAAC;IAC7D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;IAEzC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE5C,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAExE,iCAAiC;IACjC,MAAM,YAAY,GAAG,mBAAmB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;IACxE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;IAC/D,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;QACpB,sGAAsG;QACtG,MAAM,IAAI,KAAK,CAAC,4BAA4B,WAAW,IAAI,CAAC,CAAC;KAC9D;IAED,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,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;KAC9D;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 { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport { Command } from 'commander';\nimport glob from 'glob';\nimport path from 'path';\nimport { fileURLToPath, pathToFileURL } from 'url';\nimport { PerfMarkerCliEntry } from './performance/markers.js';\nimport { readConfig } from '@ms-cloudpack/config';\nimport type { CommandFunction } from './types/CommandFunction.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 appPath = testOptions?.appPath || process.cwd();\n const reporter = testOptions?.reporter || new TaskReporter();\n const config = await readConfig(appPath);\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 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, { reporter, appPath, config });\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"]}
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;AACxB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAEtF,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;AAElD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,WAK1B;IACC,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAErC,MAAM,IAAI,GAAG,WAAW,EAAE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAC/C,MAAM,GAAG,GAAG,WAAW,EAAE,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAClD,MAAM,QAAQ,GAAG,WAAW,EAAE,QAAQ,IAAI,IAAI,YAAY,EAAE,CAAC;IAE7D,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;IAE9C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE5C,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAExE,iCAAiC;IACjC,MAAM,YAAY,GAAG,mBAAmB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;IACxE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;IAC/D,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;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"]}
@@ -10,10 +10,6 @@ export declare const PerfMarkerSyncStart = "SYNC_START";
10
10
  * Measures the time it takes to open the browser.
11
11
  */
12
12
  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
13
  /**
18
14
  * Measures the time it takes to complete the download sync operation.
19
15
  */
@@ -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;AAE9C;;GAEG;AACH,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAIhD;;GAEG;AACH,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,wCAAwC,iCAAiC,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,2BAA2B,kBAAkB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,yBAAyB,gBAAgB,CAAC"}
1
+ {"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../src/performance/markers.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAIhD;;GAEG;AACH,eAAO,MAAM,0BAA0B,iBAAiB,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,2BAA2B,kBAAkB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,yBAAyB,gBAAgB,CAAC"}
@@ -12,10 +12,6 @@ export const PerfMarkerSyncStart = 'SYNC_START';
12
12
  * Measures the time it takes to open the browser.
13
13
  */
14
14
  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
15
  /**
20
16
  * Measures the time it takes to complete the download sync operation.
21
17
  */
@@ -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;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAEhD,eAAe;AAEf;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAEzD;;GAEG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,8BAA8B,CAAC;AAEvF;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAAC","sourcesContent":["// Markers\n\n/**\n * Marks the start of the CLI entry point.\n */\nexport const PerfMarkerCliEntry = 'CLI_ENTRY';\n\n/**\n * Marks the start of the sync download/upload operations.\n */\nexport const PerfMarkerSyncStart = 'SYNC_START';\n\n// Measurements\n\n/**\n * Measures the time it takes to open the browser.\n */\nexport const PerfMeasurementOpenBrowser = 'OPEN_BROWSER';\n\n/**\n * Measures the time it takes to start resolving dependencies.\n */\nexport const PerfMeasurementTimeToResolveDependencies = 'TIME_TO_RESOLVE_DEPENDENCIES';\n\n/**\n * Measures the time it takes to complete the download sync operation.\n */\nexport const PerfMeasurementSyncDownload = 'SYNC_DOWNLOAD';\n\n/**\n * Measures the time it takes to complete the upload sync operation.\n */\nexport const PerfMeasurementSyncUpload = 'SYNC_UPLOAD';\n"]}
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;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAEhD,eAAe;AAEf;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAEzD;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,eAAe,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAAC","sourcesContent":["// Markers\n\n/**\n * Marks the start of the CLI entry point.\n */\nexport const PerfMarkerCliEntry = 'CLI_ENTRY';\n\n/**\n * Marks the start of the sync download/upload operations.\n */\nexport const PerfMarkerSyncStart = 'SYNC_START';\n\n// Measurements\n\n/**\n * Measures the time it takes to open the browser.\n */\nexport const PerfMeasurementOpenBrowser = 'OPEN_BROWSER';\n\n/**\n * Measures the time it takes to complete the download sync operation.\n */\nexport const PerfMeasurementSyncDownload = 'SYNC_DOWNLOAD';\n\n/**\n * Measures the time it takes to complete the upload sync operation.\n */\nexport const PerfMeasurementSyncUpload = 'SYNC_UPLOAD';\n"]}
@@ -1,3 +1,8 @@
1
- import type { TaskContext } from './types/TaskContext.js';
2
- export declare function setupReporting({ reporter, config, appPath }: TaskContext): Promise<import("@ms-cloudpack/telemetry").TelemetryClient>;
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":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAoB1D,wBAAsB,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,WAAW,8DA6B9E"}
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"}
@@ -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, } from '@ms-cloudpack/task-reporter';
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({ reporter, config, appPath }) {
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;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;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,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,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO;YACzC,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';\nimport { isCIBuild } from './utilities/isCIBuild.js';\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: isCIBuild() ? 'ci' : 'local',\n appName: definition?.name || '<unknown>',\n },\n },\n reporter,\n );\n\n return telemetryClient;\n}\n"]}
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,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,gBAIpC;IACC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC;IACvD,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,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO;YACzC,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 { 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,iBAKzD"}
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
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
5
- await bundleTask({ bundleRequest: target.options?.bundleRequest });
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,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"]}
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,3 @@
1
+ import type { Disposable } from './Disposable.js';
2
+ export type AutoDispose = <T extends Disposable>(...items: T[]) => T[];
3
+ //# sourceMappingURL=AutoDispose.d.ts.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AutoDispose.js.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CommandAction.js.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CommandContext.js.map
@@ -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 { TaskContext } from './TaskContext.js';
3
- export type CommandFunction = (command: Command, context: TaskContext) => void;
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,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC"}
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 { TaskContext } from './TaskContext.js';\n\nexport type CommandFunction = (command: Command, context: TaskContext) => void;\n"]}
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,7 @@
1
+ import type { CommandAction } from './CommandAction.js';
2
+ export interface CreateCommandActionOptions<TOptions> {
3
+ execute: Promise<{
4
+ execute: CommandAction<TOptions>;
5
+ }>;
6
+ }
7
+ //# sourceMappingURL=CreateCommandActionOptions.d.ts.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CreateCommandActionOptions.js.map
@@ -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,4 @@
1
+ export interface Disposable {
2
+ dispose: () => Promise<void>;
3
+ }
4
+ //# sourceMappingURL=Disposable.d.ts.map
@@ -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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Disposable.js.map
@@ -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.45.3",
3
+ "version": "0.46.0",
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,15 +11,13 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@lage-run/target-graph": "^0.8.6",
14
- "@ms-cloudpack/api-server": "^0.15.0",
15
- "@ms-cloudpack/bundler": "^0.14.11",
16
- "@ms-cloudpack/config": "^0.12.1",
14
+ "@ms-cloudpack/api-server": "^0.16.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.14",
22
- "@ms-cloudpack/package-utilities": "^5.1.3",
19
+ "@ms-cloudpack/overlay": "^0.14.15",
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",
@@ -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,4 +0,0 @@
1
- import type { BundleOptions } from './types/BundleOptions.js';
2
- import type { TaskContext } from '../../types/TaskContext.js';
3
- export declare function bundle(options: BundleOptions, context: TaskContext): Promise<void>;
4
- //# sourceMappingURL=bundle.d.ts.map
@@ -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,14 +0,0 @@
1
- import type { Context } from '@ms-cloudpack/api-server';
2
- import type { TaskReporter } from '@ms-cloudpack/task-reporter';
3
- import type { TelemetryClient } from '@ms-cloudpack/telemetry';
4
- import type { CloudpackConfig } from '@ms-cloudpack/config';
5
- export interface LazyApiContextOptions {
6
- reporter: TaskReporter;
7
- appPath: string;
8
- config: CloudpackConfig;
9
- telemetryClient: TelemetryClient;
10
- }
11
- export declare function createPartialApiContext<TKeys extends Exclude<keyof Context, 'dispose'>, TReturn extends Pick<Context, TKeys | 'dispose' | 'reporter' | 'telemetryClient'>>(options: LazyApiContextOptions & {
12
- items: TKeys[];
13
- }): Promise<TReturn>;
14
- //# sourceMappingURL=createPartialApiContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createPartialApiContext.d.ts","sourceRoot":"","sources":["../../src/common/createPartialApiContext.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAuB,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAM5D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,eAAe,CAAC;IACxB,eAAe,EAAE,eAAe,CAAC;CAClC;AAsFD,wBAAsB,uBAAuB,CAC3C,KAAK,SAAS,OAAO,CAAC,MAAM,OAAO,EAAE,SAAS,CAAC,EAC/C,OAAO,SAAS,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,SAAS,GAAG,UAAU,GAAG,iBAAiB,CAAC,EACjF,OAAO,EAAE,qBAAqB,GAAG;IAAE,KAAK,EAAE,KAAK,EAAE,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAiBvE"}