@ms-cloudpack/cli 0.72.47 → 0.72.49

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 (50) hide show
  1. package/lib/commands/bundle/index.d.ts.map +1 -1
  2. package/lib/commands/bundle/index.js +1 -0
  3. package/lib/commands/bundle/index.js.map +1 -1
  4. package/lib/commands/bundle/types/BundleOptions.d.ts +5 -8
  5. package/lib/commands/bundle/types/BundleOptions.d.ts.map +1 -1
  6. package/lib/commands/bundle/types/BundleOptions.js.map +1 -1
  7. package/lib/commands/init/execute.d.ts.map +1 -1
  8. package/lib/commands/init/execute.js +5 -1
  9. package/lib/commands/init/execute.js.map +1 -1
  10. package/lib/commands/init/index.d.ts.map +1 -1
  11. package/lib/commands/init/index.js +2 -1
  12. package/lib/commands/init/index.js.map +1 -1
  13. package/lib/commands/init/types/InitOptions.d.ts +2 -10
  14. package/lib/commands/init/types/InitOptions.d.ts.map +1 -1
  15. package/lib/commands/init/types/InitOptions.js.map +1 -1
  16. package/lib/commands/link/types/LinkOptions.d.ts +2 -3
  17. package/lib/commands/link/types/LinkOptions.d.ts.map +1 -1
  18. package/lib/commands/link/types/LinkOptions.js.map +1 -1
  19. package/lib/commands/start/getStartingAppPath.d.ts +0 -1
  20. package/lib/commands/start/getStartingAppPath.d.ts.map +1 -1
  21. package/lib/commands/start/getStartingAppPath.js +7 -6
  22. package/lib/commands/start/getStartingAppPath.js.map +1 -1
  23. package/lib/commands/start/index.d.ts.map +1 -1
  24. package/lib/commands/start/index.js +2 -1
  25. package/lib/commands/start/index.js.map +1 -1
  26. package/lib/commands/start/types/StartOptions.d.ts +2 -11
  27. package/lib/commands/start/types/StartOptions.d.ts.map +1 -1
  28. package/lib/commands/start/types/StartOptions.js.map +1 -1
  29. package/lib/commands/sync/execute.d.ts.map +1 -1
  30. package/lib/commands/sync/execute.js +5 -3
  31. package/lib/commands/sync/execute.js.map +1 -1
  32. package/lib/commands/sync/types/SyncOptions.d.ts +2 -3
  33. package/lib/commands/sync/types/SyncOptions.d.ts.map +1 -1
  34. package/lib/commands/sync/types/SyncOptions.js.map +1 -1
  35. package/lib/types/ReusedOptions.d.ts +16 -0
  36. package/lib/types/ReusedOptions.d.ts.map +1 -0
  37. package/lib/types/ReusedOptions.js +2 -0
  38. package/lib/types/ReusedOptions.js.map +1 -0
  39. package/lib/utilities/findCloudpackAppPaths.d.ts.map +1 -1
  40. package/lib/utilities/findCloudpackAppPaths.js +2 -1
  41. package/lib/utilities/findCloudpackAppPaths.js.map +1 -1
  42. package/lib/utilities/getConfigOptionsFromCliOptions.d.ts +1 -1
  43. package/lib/utilities/getConfigOptionsFromCliOptions.d.ts.map +1 -1
  44. package/lib/utilities/getConfigOptionsFromCliOptions.js +1 -0
  45. package/lib/utilities/getConfigOptionsFromCliOptions.js.map +1 -1
  46. package/lib/utilities/reusedOptions.d.ts +5 -1
  47. package/lib/utilities/reusedOptions.d.ts.map +1 -1
  48. package/lib/utilities/reusedOptions.js +6 -1
  49. package/lib/utilities/reusedOptions.js.map +1 -1
  50. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/bundle/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAI9E,iCAAiC;AACjC,eAAO,MAAM,IAAI,EAAE,mBAoBlB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/bundle/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAI9E,iCAAiC;AACjC,eAAO,MAAM,IAAI,EAAE,mBAqBlB,CAAC"}
@@ -16,6 +16,7 @@ export const init = (program) => {
16
16
  outdir: new Option('--outdir <path>', 'Path for the bundle output, relative to current path (or the resolved path to --package if specified). ' +
17
17
  'Default is a path under the cloudpack cache.'),
18
18
  disableSourceMaps: new Option('--disable-source-maps', 'Disable source maps.'),
19
+ logBundleInfo: reusedOptions.logBundleInfo(),
19
20
  },
20
21
  getExecutor: () => import('./execute.js'),
21
22
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/bundle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,iCAAiC;AACjC,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,aAAa,CAAgB;QACnC,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,oBAAoB;QACjC,OAAO,EAAE;YACP,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;YAC9C,OAAO,EAAE,IAAI,MAAM,CAAC,kBAAkB,EAAE,iCAAiC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;YAChG,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,4BAA4B,CAAC;YACxD,OAAO,EAAE,IAAI,MAAM,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE;gBACnE,MAAM,IAAI,oBAAoB,CAAC,kCAAkC,CAAC,CAAC;YACrE,CAAC,CAAC;YACF,MAAM,EAAE,IAAI,MAAM,CAChB,iBAAiB,EACjB,yGAAyG;gBACvG,8CAA8C,CACjD;YACD,iBAAiB,EAAE,IAAI,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,CAAC;SAC/E;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { bundlerNames } from '@ms-cloudpack/bundler';\nimport { InvalidArgumentError, Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { BundleOptions } from './types/BundleOptions.js';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"bundle\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<BundleOptions>({\n name: 'bundle',\n description: 'Bundles a package.',\n options: {\n mode: reusedOptions.mode({ action: 'bundle' }),\n bundler: new Option('--bundler <name>', 'Force using a specific bundler.').choices(bundlerNames),\n match: reusedOptions.match('Bundle specific package(s)'),\n package: new Option('--package <package>').hideHelp().argParser(() => {\n throw new InvalidArgumentError('Use --match instead of --package');\n }),\n outdir: new Option(\n '--outdir <path>',\n 'Path for the bundle output, relative to current path (or the resolved path to --package if specified). ' +\n 'Default is a path under the cloudpack cache.',\n ),\n disableSourceMaps: new Option('--disable-source-maps', 'Disable source maps.'),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/bundle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,iCAAiC;AACjC,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,aAAa,CAAgB;QACnC,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,oBAAoB;QACjC,OAAO,EAAE;YACP,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;YAC9C,OAAO,EAAE,IAAI,MAAM,CAAC,kBAAkB,EAAE,iCAAiC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;YAChG,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,4BAA4B,CAAC;YACxD,OAAO,EAAE,IAAI,MAAM,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE;gBACnE,MAAM,IAAI,oBAAoB,CAAC,kCAAkC,CAAC,CAAC;YACrE,CAAC,CAAC;YACF,MAAM,EAAE,IAAI,MAAM,CAChB,iBAAiB,EACjB,yGAAyG;gBACvG,8CAA8C,CACjD;YACD,iBAAiB,EAAE,IAAI,MAAM,CAAC,uBAAuB,EAAE,sBAAsB,CAAC;YAC9E,aAAa,EAAE,aAAa,CAAC,aAAa,EAAE;SAC7C;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { bundlerNames } from '@ms-cloudpack/bundler';\nimport { InvalidArgumentError, Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { BundleOptions } from './types/BundleOptions.js';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"bundle\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<BundleOptions>({\n name: 'bundle',\n description: 'Bundles a package.',\n options: {\n mode: reusedOptions.mode({ action: 'bundle' }),\n bundler: new Option('--bundler <name>', 'Force using a specific bundler.').choices(bundlerNames),\n match: reusedOptions.match('Bundle specific package(s)'),\n package: new Option('--package <package>').hideHelp().argParser(() => {\n throw new InvalidArgumentError('Use --match instead of --package');\n }),\n outdir: new Option(\n '--outdir <path>',\n 'Path for the bundle output, relative to current path (or the resolved path to --package if specified). ' +\n 'Default is a path under the cloudpack cache.',\n ),\n disableSourceMaps: new Option('--disable-source-maps', 'Disable source maps.'),\n logBundleInfo: reusedOptions.logBundleInfo(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
@@ -1,5 +1,8 @@
1
- import type { BundleMode, PackageSettingsMatch } from '@ms-cloudpack/common-types';
2
- export interface BundleOptions {
1
+ import type { ReusedOptions } from '../../../types/ReusedOptions.js';
2
+ /**
3
+ * Options for the `cloudpack bundle` command.
4
+ */
5
+ export interface BundleOptions extends Pick<ReusedOptions, 'logBundleInfo' | 'match' | 'mode'> {
3
6
  /**
4
7
  * Force using a specific bundler (ori/rollup/rspack/webpack).
5
8
  *
@@ -22,11 +25,5 @@ export interface BundleOptions {
22
25
  * @deprecated Removed in favor of `match`.
23
26
  */
24
27
  package?: string;
25
- /**
26
- * If set, only evaluate matching packages.
27
- */
28
- match?: PackageSettingsMatch[];
29
- /** The mode to bundle in. */
30
- mode: BundleMode;
31
28
  }
32
29
  //# sourceMappingURL=BundleOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BundleOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/bundle/types/BundleOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEnF,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAE/B,6BAA6B;IAC7B,IAAI,EAAE,UAAU,CAAC;CAClB"}
1
+ {"version":3,"file":"BundleOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/bundle/types/BundleOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,aAAa,EAAE,eAAe,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5F;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -1 +1 @@
1
- {"version":3,"file":"BundleOptions.js","sourceRoot":"","sources":["../../../../src/commands/bundle/types/BundleOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMode, PackageSettingsMatch } from '@ms-cloudpack/common-types';\n\nexport interface BundleOptions {\n /**\n * Force using a specific bundler (ori/rollup/rspack/webpack).\n *\n * Default is automatically choosing the bundler based on package contents, unless there any\n * relevant package settings specify a bundler.\n */\n bundler?: string;\n\n /**\n * Disables source maps.\n */\n disableSourceMaps?: boolean;\n\n /**\n * Path for the bundle output. This is usually relative to the app path.\n * If `package` is set, it's relative to the package path.\n *\n * If not set, the bundle output is dropped in the default path under the cloudpack cache.\n */\n outdir?: string;\n\n /**\n * @deprecated Removed in favor of `match`.\n */\n package?: string;\n\n /**\n * If set, only evaluate matching packages.\n */\n match?: PackageSettingsMatch[];\n\n /** The mode to bundle in. */\n mode: BundleMode;\n}\n"]}
1
+ {"version":3,"file":"BundleOptions.js","sourceRoot":"","sources":["../../../../src/commands/bundle/types/BundleOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReusedOptions } from '../../../types/ReusedOptions.js';\n\n/**\n * Options for the `cloudpack bundle` command.\n */\nexport interface BundleOptions extends Pick<ReusedOptions, 'logBundleInfo' | 'match' | 'mode'> {\n /**\n * Force using a specific bundler (ori/rollup/rspack/webpack).\n *\n * Default is automatically choosing the bundler based on package contents, unless there any\n * relevant package settings specify a bundler.\n */\n bundler?: string;\n\n /**\n * Disables source maps.\n */\n disableSourceMaps?: boolean;\n\n /**\n * Path for the bundle output. This is usually relative to the app path.\n * If `package` is set, it's relative to the package path.\n *\n * If not set, the bundle output is dropped in the default path under the cloudpack cache.\n */\n outdir?: string;\n\n /**\n * @deprecated Removed in favor of `match`.\n */\n package?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/init/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAMlE,wFAAwF;AACxF,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,WAAW,CA6B9C,CAAC"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/init/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAOlE,wFAAwF;AACxF,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,WAAW,CAgC9C,CAAC"}
@@ -2,13 +2,17 @@ import { init } from './init.js';
2
2
  import { formatInitSummary } from './formatInitSummary.js';
3
3
  import { findCloudpackAppPaths } from '../../utilities/findCloudpackAppPaths.js';
4
4
  import { InitSummaryData } from './InitSummaryData.js';
5
+ import { getConfigOptionsFromCliOptions } from '../../utilities/getConfigOptionsFromCliOptions.js';
5
6
  /** Given the path, updates the Cloudpack config with overrides and project settings. */
6
7
  export const execute = async (params) => {
7
8
  const { options, cwd, initialize, autoDispose, setInterruptMessageHandler } = params;
8
9
  const appPaths = findCloudpackAppPaths(cwd);
9
10
  // `findCloudpackAppPaths` will only return an array of paths in which cloudpack.config.json was found.
10
11
  // To ensure initialize can be run even if no cloudpack.config.json was found, we use the cwd directory as a fallback.
11
- const contexts = await initialize({ appPaths: appPaths.length > 0 ? appPaths : [cwd] });
12
+ const contexts = await initialize({
13
+ appPaths: appPaths.length > 0 ? appPaths : [cwd],
14
+ configOptions: getConfigOptionsFromCliOptions(options),
15
+ });
12
16
  const appSummaries = Object.fromEntries(contexts.map((context) => [context.appPath, new InitSummaryData(context.appPath)]));
13
17
  const summarizeOptions = { check: options.check, verb: 'init' };
14
18
  setInterruptMessageHandler(() => formatInitSummary({
@@ -1 +1 @@
1
- {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/init/execute.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAA+B,KAAK,EAAE,MAAM,EAAE,EAAE;IAClE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,0BAA0B,EAAE,GAAG,MAAM,CAAC;IAErF,MAAM,QAAQ,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAE5C,uGAAuG;IACvG,sHAAsH;IACtH,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAExF,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CACrC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CACnF,CAAC;IAEF,MAAM,gBAAgB,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAW,CAAC;IAEzE,0BAA0B,CAAC,GAAG,EAAE,CAC9B,iBAAiB,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACvE,aAAa,EAAE,IAAI;QACnB,GAAG,gBAAgB;KACpB,CAAC,CACH,CAAC;IAEF,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;IAE/E,OAAO;QACL,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;QACtD,OAAO,EAAE,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,gBAAgB,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { InitOptions } from './types/InitOptions.js';\nimport type { CommandAction } from '../../types/CommandAction.js';\nimport { init } from './init.js';\nimport { formatInitSummary } from './formatInitSummary.js';\nimport { findCloudpackAppPaths } from '../../utilities/findCloudpackAppPaths.js';\nimport { InitSummaryData } from './InitSummaryData.js';\n\n/** Given the path, updates the Cloudpack config with overrides and project settings. */\nexport const execute: CommandAction<InitOptions> = async (params) => {\n const { options, cwd, initialize, autoDispose, setInterruptMessageHandler } = params;\n\n const appPaths = findCloudpackAppPaths(cwd);\n\n // `findCloudpackAppPaths` will only return an array of paths in which cloudpack.config.json was found.\n // To ensure initialize can be run even if no cloudpack.config.json was found, we use the cwd directory as a fallback.\n const contexts = await initialize({ appPaths: appPaths.length > 0 ? appPaths : [cwd] });\n\n const appSummaries = Object.fromEntries(\n contexts.map((context) => [context.appPath, new InitSummaryData(context.appPath)]),\n );\n\n const summarizeOptions = { check: options.check, verb: 'init' } as const;\n\n setInterruptMessageHandler(() =>\n formatInitSummary({\n summaries: Object.values(appSummaries).map((s) => s.summarize(options)),\n isInterrupted: true,\n ...summarizeOptions,\n }),\n );\n\n const summaries = await init({ appSummaries, options, contexts, autoDispose });\n\n return {\n hasErrors: summaries.some((summary) => summary.failed),\n message: formatInitSummary({ summaries, ...summarizeOptions }),\n };\n};\n"]}
1
+ {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/init/execute.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAC;AAEnG,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAA+B,KAAK,EAAE,MAAM,EAAE,EAAE;IAClE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,0BAA0B,EAAE,GAAG,MAAM,CAAC;IAErF,MAAM,QAAQ,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAE5C,uGAAuG;IACvG,sHAAsH;IACtH,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC;QAChC,QAAQ,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAChD,aAAa,EAAE,8BAA8B,CAAC,OAAO,CAAC;KACvD,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CACrC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CACnF,CAAC;IAEF,MAAM,gBAAgB,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAW,CAAC;IAEzE,0BAA0B,CAAC,GAAG,EAAE,CAC9B,iBAAiB,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACvE,aAAa,EAAE,IAAI;QACnB,GAAG,gBAAgB;KACpB,CAAC,CACH,CAAC;IAEF,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;IAE/E,OAAO;QACL,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;QACtD,OAAO,EAAE,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,gBAAgB,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { InitOptions } from './types/InitOptions.js';\nimport type { CommandAction } from '../../types/CommandAction.js';\nimport { init } from './init.js';\nimport { formatInitSummary } from './formatInitSummary.js';\nimport { findCloudpackAppPaths } from '../../utilities/findCloudpackAppPaths.js';\nimport { InitSummaryData } from './InitSummaryData.js';\nimport { getConfigOptionsFromCliOptions } from '../../utilities/getConfigOptionsFromCliOptions.js';\n\n/** Given the path, updates the Cloudpack config with overrides and project settings. */\nexport const execute: CommandAction<InitOptions> = async (params) => {\n const { options, cwd, initialize, autoDispose, setInterruptMessageHandler } = params;\n\n const appPaths = findCloudpackAppPaths(cwd);\n\n // `findCloudpackAppPaths` will only return an array of paths in which cloudpack.config.json was found.\n // To ensure initialize can be run even if no cloudpack.config.json was found, we use the cwd directory as a fallback.\n const contexts = await initialize({\n appPaths: appPaths.length > 0 ? appPaths : [cwd],\n configOptions: getConfigOptionsFromCliOptions(options),\n });\n\n const appSummaries = Object.fromEntries(\n contexts.map((context) => [context.appPath, new InitSummaryData(context.appPath)]),\n );\n\n const summarizeOptions = { check: options.check, verb: 'init' } as const;\n\n setInterruptMessageHandler(() =>\n formatInitSummary({\n summaries: Object.values(appSummaries).map((s) => s.summarize(options)),\n isInterrupted: true,\n ...summarizeOptions,\n }),\n );\n\n const summaries = await init({ appSummaries, options, contexts, autoDispose });\n\n return {\n hasErrors: summaries.some((summary) => summary.failed),\n message: formatInitSummary({ summaries, ...summarizeOptions }),\n };\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAI9E,+BAA+B;AAC/B,eAAO,MAAM,IAAI,EAAE,mBAelB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAI9E,+BAA+B;AAC/B,eAAO,MAAM,IAAI,EAAE,mBAgBlB,CAAC"}
@@ -8,10 +8,11 @@ export const init = (program) => {
8
8
  'configuration overrides (cloudpack.generated.json).',
9
9
  options: {
10
10
  logResolveMap: reusedOptions.logResolveMap(),
11
+ logBundleInfo: reusedOptions.logBundleInfo({ requiresNoCache: true }),
11
12
  reset: new Option('--reset', 'Ignore the previous generated config.').conflicts('check'),
12
13
  check: new Option('--check', 'Fail if updates to the generated config are required.').conflicts('reset'),
13
14
  match: reusedOptions.match('Only evaluate specific package(s)').conflicts('reset'),
14
- cache: reusedOptions.noCache(),
15
+ cache: reusedOptions.cache(),
15
16
  },
16
17
  getExecutor: () => import('./execute.js'),
17
18
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,+BAA+B;AAC/B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,aAAa,CAAc;QACjC,IAAI,EAAE,MAAM;QACZ,WAAW,EACT,6EAA6E;YAC7E,qDAAqD;QACvD,OAAO,EAAE;YACP,aAAa,EAAE,aAAa,CAAC,aAAa,EAAE;YAC5C,KAAK,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,uCAAuC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;YACxF,KAAK,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,uDAAuD,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;YACxG,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;YAClF,KAAK,EAAE,aAAa,CAAC,OAAO,EAAE;SAC/B;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { InitOptions } from './types/InitOptions.js';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"init\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<InitOptions>({\n name: 'init',\n description:\n \"Validate an app's compatibility with Cloudpack, and generate any necessary \" +\n 'configuration overrides (cloudpack.generated.json).',\n options: {\n logResolveMap: reusedOptions.logResolveMap(),\n reset: new Option('--reset', 'Ignore the previous generated config.').conflicts('check'),\n check: new Option('--check', 'Fail if updates to the generated config are required.').conflicts('reset'),\n match: reusedOptions.match('Only evaluate specific package(s)').conflicts('reset'),\n cache: reusedOptions.noCache(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,+BAA+B;AAC/B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,aAAa,CAAc;QACjC,IAAI,EAAE,MAAM;QACZ,WAAW,EACT,6EAA6E;YAC7E,qDAAqD;QACvD,OAAO,EAAE;YACP,aAAa,EAAE,aAAa,CAAC,aAAa,EAAE;YAC5C,aAAa,EAAE,aAAa,CAAC,aAAa,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;YACrE,KAAK,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,uCAAuC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;YACxF,KAAK,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,uDAAuD,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;YACxG,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;YAClF,KAAK,EAAE,aAAa,CAAC,KAAK,EAAE;SAC7B;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { InitOptions } from './types/InitOptions.js';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"init\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<InitOptions>({\n name: 'init',\n description:\n \"Validate an app's compatibility with Cloudpack, and generate any necessary \" +\n 'configuration overrides (cloudpack.generated.json).',\n options: {\n logResolveMap: reusedOptions.logResolveMap(),\n logBundleInfo: reusedOptions.logBundleInfo({ requiresNoCache: true }),\n reset: new Option('--reset', 'Ignore the previous generated config.').conflicts('check'),\n check: new Option('--check', 'Fail if updates to the generated config are required.').conflicts('reset'),\n match: reusedOptions.match('Only evaluate specific package(s)').conflicts('reset'),\n cache: reusedOptions.cache(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
@@ -1,10 +1,8 @@
1
- import type { PackageSettingsMatch } from '@ms-cloudpack/common-types';
1
+ import type { ReusedOptions } from '../../../types/ReusedOptions.js';
2
2
  /**
3
3
  * Defines the options for the "init" command.
4
4
  */
5
- export interface InitOptions {
6
- /** Writes the resolve map to `resolve-map.json`. */
7
- logResolveMap?: boolean;
5
+ export interface InitOptions extends Pick<ReusedOptions, 'cache' | 'logBundleInfo' | 'logResolveMap' | 'match'> {
8
6
  /**
9
7
  * Ignore the previous generated config.
10
8
  */
@@ -13,11 +11,5 @@ export interface InitOptions {
13
11
  * Fail if updates to the generated config are required.
14
12
  */
15
13
  check?: boolean;
16
- /**
17
- * Only evaluate specific package(s).
18
- */
19
- match?: PackageSettingsMatch[];
20
- /** Whether to use the cache */
21
- cache?: boolean;
22
14
  }
23
15
  //# sourceMappingURL=InitOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InitOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/types/InitOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,oDAAoD;IACpD,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAE/B,+BAA+B;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
1
+ {"version":3,"file":"InitOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/types/InitOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,eAAe,GAAG,eAAe,GAAG,OAAO,CAAC;IAC7G;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"InitOptions.js","sourceRoot":"","sources":["../../../../src/commands/init/types/InitOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PackageSettingsMatch } from '@ms-cloudpack/common-types';\n\n/**\n * Defines the options for the \"init\" command.\n */\nexport interface InitOptions {\n /** Writes the resolve map to `resolve-map.json`. */\n logResolveMap?: boolean;\n\n /**\n * Ignore the previous generated config.\n */\n reset?: boolean;\n\n /**\n * Fail if updates to the generated config are required.\n */\n check?: boolean;\n\n /**\n * Only evaluate specific package(s).\n */\n match?: PackageSettingsMatch[];\n\n /** Whether to use the cache */\n cache?: boolean;\n}\n"]}
1
+ {"version":3,"file":"InitOptions.js","sourceRoot":"","sources":["../../../../src/commands/init/types/InitOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReusedOptions } from '../../../types/ReusedOptions.js';\n\n/**\n * Defines the options for the \"init\" command.\n */\nexport interface InitOptions extends Pick<ReusedOptions, 'cache' | 'logBundleInfo' | 'logResolveMap' | 'match'> {\n /**\n * Ignore the previous generated config.\n */\n reset?: boolean;\n\n /**\n * Fail if updates to the generated config are required.\n */\n check?: boolean;\n}\n"]}
@@ -1,4 +1,5 @@
1
- export interface LinkOptions {
1
+ import type { ReusedOptions } from '../../../types/ReusedOptions.js';
2
+ export interface LinkOptions extends Pick<ReusedOptions, 'logResolveMap'> {
2
3
  /**
3
4
  * Ignore these packages when linking.
4
5
  * This can be used for packages in the current repo that have issues being bundled.
@@ -16,7 +17,5 @@ export interface LinkOptions {
16
17
  * @default "dedupe"
17
18
  */
18
19
  resolveStrategy: 'dedupe' | 'duplicate';
19
- /** Writes the linked resolve map to `resolve-map-linked.json`. */
20
- logResolveMap?: boolean;
21
20
  }
22
21
  //# sourceMappingURL=LinkOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/link/types/LinkOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,4EAA4E;IAC5E,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;OAMG;IACH,eAAe,EAAE,QAAQ,GAAG,WAAW,CAAC;IAExC,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
1
+ {"version":3,"file":"LinkOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/link/types/LinkOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC;IACvE;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,4EAA4E;IAC5E,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;OAMG;IACH,eAAe,EAAE,QAAQ,GAAG,WAAW,CAAC;CACzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LinkOptions.js","sourceRoot":"","sources":["../../../../src/commands/link/types/LinkOptions.ts"],"names":[],"mappings":"","sourcesContent":["export interface LinkOptions {\n /**\n * Ignore these packages when linking.\n * This can be used for packages in the current repo that have issues being bundled.\n */\n ignore?: string[];\n\n /** Link all internal packages discovered within the linked repo's graph. */\n all?: boolean;\n\n /** Don't apply resolutions from the host repo's package.json to linked packages. */\n ignoreResolutions?: boolean;\n\n /**\n * Strategy to use when resolving linked packages.\n * - `\"dedupe\"`: Attempt to dedupe packages from the resolve map by removing all but the\n * highest version that satisfies semver requirements from all parent entries.\n * - `\"duplicate\"`: Allow duplicates in the resolve map (don't bump dependencies).\n * @default \"dedupe\"\n */\n resolveStrategy: 'dedupe' | 'duplicate';\n\n /** Writes the linked resolve map to `resolve-map-linked.json`. */\n logResolveMap?: boolean;\n}\n"]}
1
+ {"version":3,"file":"LinkOptions.js","sourceRoot":"","sources":["../../../../src/commands/link/types/LinkOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReusedOptions } from '../../../types/ReusedOptions.js';\n\nexport interface LinkOptions extends Pick<ReusedOptions, 'logResolveMap'> {\n /**\n * Ignore these packages when linking.\n * This can be used for packages in the current repo that have issues being bundled.\n */\n ignore?: string[];\n\n /** Link all internal packages discovered within the linked repo's graph. */\n all?: boolean;\n\n /** Don't apply resolutions from the host repo's package.json to linked packages. */\n ignoreResolutions?: boolean;\n\n /**\n * Strategy to use when resolving linked packages.\n * - `\"dedupe\"`: Attempt to dedupe packages from the resolve map by removing all but the\n * highest version that satisfies semver requirements from all parent entries.\n * - `\"duplicate\"`: Allow duplicates in the resolve map (don't bump dependencies).\n * @default \"dedupe\"\n */\n resolveStrategy: 'dedupe' | 'duplicate';\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  import type { CommandExitParams } from '../../types/CommandAction.js';
2
2
  export declare const appPromptQuestionName = "app";
3
- export type AppPromptKeys = typeof appPromptQuestionName;
4
3
  /**
5
4
  * Gets the appPath from which Cloudpack will start. If the CWD is a Cloudpack-enabled app,
6
5
  * we'll start there; otherwise, we'll scan for Cloudpack-enabled app and present the user
@@ -1 +1 @@
1
- {"version":3,"file":"getStartingAppPath.d.ts","sourceRoot":"","sources":["../../../src/commands/start/getStartingAppPath.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAC3C,MAAM,MAAM,aAAa,GAAG,OAAO,qBAAqB,CAAC;AAEzD;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAoD9G"}
1
+ {"version":3,"file":"getStartingAppPath.d.ts","sourceRoot":"","sources":["../../../src/commands/start/getStartingAppPath.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGtE,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAG3C;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,iBAAiB,CAAC,CAoD9G"}
@@ -3,6 +3,7 @@ import fs from 'fs';
3
3
  import path from 'path';
4
4
  import prompts from 'prompts';
5
5
  import { findCloudpackAppPaths } from '../../utilities/findCloudpackAppPaths.js';
6
+ import { appConfigFileName } from '@ms-cloudpack/config';
6
7
  export const appPromptQuestionName = 'app';
7
8
  /**
8
9
  * Gets the appPath from which Cloudpack will start. If the CWD is a Cloudpack-enabled app,
@@ -13,19 +14,19 @@ export const appPromptQuestionName = 'app';
13
14
  * @returns The app path of the app that Cloudpack should start, or an exit options object if the user cancels
14
15
  */
15
16
  export async function getStartingAppPath(cwd, desiredApp) {
16
- const cwdIsCloudpackApp = fs.existsSync(path.resolve(path.join(cwd, 'cloudpack.config.json')));
17
+ const cwdIsCloudpackApp = fs.existsSync(path.join(cwd, appConfigFileName));
17
18
  if (cwdIsCloudpackApp) {
18
19
  return cwd;
19
20
  }
20
- const folderPaths = findCloudpackAppPaths(cwd);
21
- if (folderPaths.length === 0) {
21
+ const cloudpackAppPaths = findCloudpackAppPaths(cwd);
22
+ if (cloudpackAppPaths.length === 0) {
22
23
  return cwd;
23
24
  }
24
- if (folderPaths.length === 1) {
25
- return folderPaths[0];
25
+ if (cloudpackAppPaths.length === 1) {
26
+ return cloudpackAppPaths[0];
26
27
  }
27
28
  const packages = new PackageDefinitions();
28
- const choices = await Promise.all(folderPaths.map(async (dir) => {
29
+ const choices = await Promise.all(cloudpackAppPaths.map(async (dir) => {
29
30
  const pkg = await packages.get(dir);
30
31
  return {
31
32
  title: pkg.name,
@@ -1 +1 @@
1
- {"version":3,"file":"getStartingAppPath.js","sourceRoot":"","sources":["../../../src/commands/start/getStartingAppPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAwB,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAGjF,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAG3C;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,GAAW,EAAE,UAAmB;IACvE,MAAM,iBAAiB,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAC/F,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,WAAW,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAC/C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,kBAAk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EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC9C,CAAC;IAED,OAAO,QAAQ,CAAC,GAAa,CAAC;AAChC,CAAC","sourcesContent":["import { PackageDefinitions } from '@ms-cloudpack/package-utilities';\nimport fs from 'fs';\nimport path from 'path';\nimport prompts, { type Choice } from 'prompts';\nimport { findCloudpackAppPaths } from '../../utilities/findCloudpackAppPaths.js';\nimport type { CommandExitParams } from '../../types/CommandAction.js';\n\nexport const appPromptQuestionName = 'app';\nexport type AppPromptKeys = typeof appPromptQuestionName;\n\n/**\n * Gets the appPath from which Cloudpack will start. If the CWD is a Cloudpack-enabled app,\n * we'll start there; otherwise, we'll scan for Cloudpack-enabled app and present the user\n * with a menu. If no app are found, Cloudpack will just try to start the CWD anyway.\n * @param cwd - The current working directory to start in when finding the starting app path\n * @param desiredApp - The app that should be started as specified via --app arg\n * @returns The app path of the app that Cloudpack should start, or an exit options object if the user cancels\n */\nexport async function getStartingAppPath(cwd: string, desiredApp?: string): Promise<string | CommandExitParams> {\n const cwdIsCloudpackApp = fs.existsSync(path.resolve(path.join(cwd, 'cloudpack.config.json')));\n if (cwdIsCloudpackApp) {\n return cwd;\n }\n\n const folderPaths = findCloudpackAppPaths(cwd);\n if (folderPaths.length === 0) {\n return cwd;\n }\n if (folderPaths.length === 1) {\n return folderPaths[0];\n }\n\n const packages = new PackageDefinitions();\n\n const choices = await Promise.all<Choice>(\n folderPaths.map(async (dir) => {\n const pkg = await packages.get(dir);\n return {\n title: pkg.name,\n description: pkg?.description ?? 'An awesome app that would be even more awesome with a proper description',\n value: dir,\n };\n }),\n );\n choices.sort((c1, c2) => c1.title.localeCompare(c2.title));\n\n if (desiredApp) {\n const matchingApps = choices.filter((choice) => choice.title.includes(desiredApp));\n if (matchingApps.length === 1) {\n return matchingApps[0].value as string;\n }\n const exactMatch = matchingApps.find((choice) => choice.title === desiredApp);\n if (exactMatch) {\n return exactMatch.value as string;\n }\n }\n\n const response = await prompts<AppPromptKeys>({\n type: 'select',\n name: appPromptQuestionName,\n message: 'Select the app you want to start',\n choices,\n });\n\n // This will be undefined if the user cancels the prompt\n if (!response.app) {\n return { isInterrupted: true, message: '' };\n }\n\n return response.app as string;\n}\n"]}
1
+ {"version":3,"file":"getStartingAppPath.js","sourceRoot":"","sources":["../../../src/commands/start/getStartingAppPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAwB,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAG3C;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,GAAW,EAAE,UAAmB;IACvE,MAAM,iBAAiB,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAC3E,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC;IACrD,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;IAE1C,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,iBAAiB,CAAC,GAAG,CAAC,KAAK,EA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AAC;AAChC,CAAC","sourcesContent":["import { PackageDefinitions } from '@ms-cloudpack/package-utilities';\nimport fs from 'fs';\nimport path from 'path';\nimport prompts, { type Choice } from 'prompts';\nimport { findCloudpackAppPaths } from '../../utilities/findCloudpackAppPaths.js';\nimport type { CommandExitParams } from '../../types/CommandAction.js';\nimport { appConfigFileName } from '@ms-cloudpack/config';\n\nexport const appPromptQuestionName = 'app';\ntype AppPromptKeys = typeof appPromptQuestionName;\n\n/**\n * Gets the appPath from which Cloudpack will start. If the CWD is a Cloudpack-enabled app,\n * we'll start there; otherwise, we'll scan for Cloudpack-enabled app and present the user\n * with a menu. If no app are found, Cloudpack will just try to start the CWD anyway.\n * @param cwd - The current working directory to start in when finding the starting app path\n * @param desiredApp - The app that should be started as specified via --app arg\n * @returns The app path of the app that Cloudpack should start, or an exit options object if the user cancels\n */\nexport async function getStartingAppPath(cwd: string, desiredApp?: string): Promise<string | CommandExitParams> {\n const cwdIsCloudpackApp = fs.existsSync(path.join(cwd, appConfigFileName));\n if (cwdIsCloudpackApp) {\n return cwd;\n }\n\n const cloudpackAppPaths = findCloudpackAppPaths(cwd);\n if (cloudpackAppPaths.length === 0) {\n return cwd;\n }\n if (cloudpackAppPaths.length === 1) {\n return cloudpackAppPaths[0];\n }\n\n const packages = new PackageDefinitions();\n\n const choices = await Promise.all<Choice>(\n cloudpackAppPaths.map(async (dir) => {\n const pkg = await packages.get(dir);\n return {\n title: pkg.name,\n description: pkg?.description ?? 'An awesome app that would be even more awesome with a proper description',\n value: dir,\n };\n }),\n );\n choices.sort((c1, c2) => c1.title.localeCompare(c2.title));\n\n if (desiredApp) {\n const matchingApps = choices.filter((choice) => choice.title.includes(desiredApp));\n if (matchingApps.length === 1) {\n return matchingApps[0].value as string;\n }\n const exactMatch = matchingApps.find((choice) => choice.title === desiredApp);\n if (exactMatch) {\n return exactMatch.value as string;\n }\n }\n\n const response = await prompts<AppPromptKeys>({\n type: 'select',\n name: appPromptQuestionName,\n message: 'Select the app you want to start',\n choices,\n });\n\n // This will be undefined if the user cancels the prompt\n if (!response.app) {\n return { isInterrupted: true, message: '' };\n }\n\n return response.app as string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAK9E,gCAAgC;AAChC,eAAO,MAAM,IAAI,EAAE,mBAoBlB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAK9E,gCAAgC;AAChC,eAAO,MAAM,IAAI,EAAE,mBAqBlB,CAAC"}
@@ -10,8 +10,9 @@ export const init = (program) => {
10
10
  mode: reusedOptions.mode({ action: 'run' }),
11
11
  app: new Option('--app <appPackageName>', 'Run Cloudpack targeting a specific app (only needed if running init at a higher level in the repo).'),
12
12
  open: new Option('--no-open', 'Do not open the browser.'),
13
- cache: reusedOptions.noCache(),
13
+ cache: reusedOptions.cache(),
14
14
  logResolveMap: reusedOptions.logResolveMap(),
15
+ logBundleInfo: reusedOptions.logBundleInfo({ requiresNoCache: true }),
15
16
  apiServerPort: getPortOption('--api-server-port <port>', 'API'),
16
17
  appServerPort: getPortOption('--app-server-port <port>', 'app'),
17
18
  bundleServerPort: getPortOption('--bundle-server-port <port>', 'bundle'),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,gCAAgC;AAChC,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,OA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AW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACrB,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACnC,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QAClB,MAAM,IAAI,oBAAoB,CAAC,qCAAqC,KAAK,GAAG,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { InvalidArgumentError, Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { StartOptions } from './types/StartOptions.js';\nimport { portNumbers } from 'get-port';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"start\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<StartOptions>({\n name: 'start',\n description: 'Starts a web inner-loop from the current package folder.',\n options: {\n mode: reusedOptions.mode({ action: 'run' }),\n app: new Option(\n '--app <appPackageName>',\n 'Run Cloudpack targeting a specific app (only needed if running init at a higher level in the repo).',\n ),\n open: new Option('--no-open', 'Do not open the browser.'),\n cache: reusedOptions.noCache(),\n logResolveMap: reusedOptions.logResolveMap(),\n apiServerPort: getPortOption('--api-server-port <port>', 'API'),\n appServerPort: getPortOption('--app-server-port <port>', 'app'),\n bundleServerPort: getPortOption('--bundle-server-port <port>', 'bundle'),\n login: reusedOptions.login(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n\nfunction getPortOption(flags: string, name: string): Option {\n return new Option(flags, `Port to use for the ${name} server (single, comma-separated, or range with dash).`)\n .argParser(parsePorts)\n .hideHelp();\n}\n\nfunction parsePorts(value: string): number[] {\n if (value.includes('-')) {\n const split = value.split('-');\n if (split.length !== 2) {\n throw new InvalidArgumentError(`Invalid port range: \"${value}\"`);\n }\n return [...portNumbers(parseNumber(split[0]), parseNumber(split[1]))];\n }\n\n return value.split(',').map(parseNumber);\n}\n\nfunction parseNumber(value: string): number {\n value = value.trim();\n const parsed = parseInt(value, 10);\n if (isNaN(parsed)) {\n throw new InvalidArgumentError(`Port must be a number; received: \"${value}\"`);\n }\n return parsed;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,gCAAgC;AAChC,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,aAAa,CAAe;QAClC,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,0DAA0D;QACvE,OAAO,EAAE;YACP,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;YAC3C,GAAG,EAAE,IAAI,MAAM,CACb,wBAAwB,EACxB,qGAAqG,CACtG;YACD,IAAI,EAAE,IAAI,MAAM,CAAC,WAAW,EAAE,0BAA0B,CAAC;YACzD,KAAK,EAAE,aAAa,CAAC,KAAK,EAAE;YAC5B,aAAa,EAAE,aAAa,CAAC,aAAa,EAAE;YAC5C,aAAa,EAAE,aAAa,CAAC,aAAa,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC;YACrE,aAAa,EAAE,aAAa,CAAC,0BAA0B,EAAE,KAAK,CAAC;YAC/D,aAAa,EAAE,aAAa,CAAC,0BAA0B,EAAE,KAAK,CAAC;YAC/D,gBA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import { InvalidArgumentError, Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { StartOptions } from './types/StartOptions.js';\nimport { portNumbers } from 'get-port';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"start\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<StartOptions>({\n name: 'start',\n description: 'Starts a web inner-loop from the current package folder.',\n options: {\n mode: reusedOptions.mode({ action: 'run' }),\n app: new Option(\n '--app <appPackageName>',\n 'Run Cloudpack targeting a specific app (only needed if running init at a higher level in the repo).',\n ),\n open: new Option('--no-open', 'Do not open the browser.'),\n cache: reusedOptions.cache(),\n logResolveMap: reusedOptions.logResolveMap(),\n logBundleInfo: reusedOptions.logBundleInfo({ requiresNoCache: true }),\n apiServerPort: getPortOption('--api-server-port <port>', 'API'),\n appServerPort: getPortOption('--app-server-port <port>', 'app'),\n bundleServerPort: getPortOption('--bundle-server-port <port>', 'bundle'),\n login: reusedOptions.login(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n\nfunction getPortOption(flags: string, name: string): Option {\n return new Option(flags, `Port to use for the ${name} server (single, comma-separated, or range with dash).`)\n .argParser(parsePorts)\n .hideHelp();\n}\n\nfunction parsePorts(value: string): number[] {\n if (value.includes('-')) {\n const split = value.split('-');\n if (split.length !== 2) {\n throw new InvalidArgumentError(`Invalid port range: \"${value}\"`);\n }\n return [...portNumbers(parseNumber(split[0]), parseNumber(split[1]))];\n }\n\n return value.split(',').map(parseNumber);\n}\n\nfunction parseNumber(value: string): number {\n value = value.trim();\n const parsed = parseInt(value, 10);\n if (isNaN(parsed)) {\n throw new InvalidArgumentError(`Port must be a number; received: \"${value}\"`);\n }\n return parsed;\n}\n"]}
@@ -1,23 +1,14 @@
1
- import type { BundleMode } from '@ms-cloudpack/common-types';
2
- import type { LoginMethod } from '@ms-cloudpack/remote-cache';
3
- export interface StartOptions {
4
- /** Writes the resolve map to `resolve-map.json`. */
5
- logResolveMap?: boolean;
6
- /** The mode to start in (library/development/production). */
7
- mode: BundleMode;
1
+ import type { ReusedOptions } from '../../../types/ReusedOptions.js';
2
+ export interface StartOptions extends Pick<ReusedOptions, 'cache' | 'login' | 'logBundleInfo' | 'logResolveMap' | 'mode'> {
8
3
  /** Specifies which specific app to run, in the case of running `init` at a higher level in the repo. */
9
4
  app?: string;
10
5
  /** Whether to open the browser (default true) */
11
6
  open?: boolean;
12
- /** Whether to use the cache on first request (default true) */
13
- cache?: boolean;
14
7
  /** Mostly for testing: custom port for the API server */
15
8
  apiServerPort?: number | number[];
16
9
  /** Mostly for testing: custom port for the app server (also set in config via `server.port`) */
17
10
  appServerPort?: number | number[];
18
11
  /** Mostly for testing: custom port for the bundle server */
19
12
  bundleServerPort?: number | number[];
20
- /** How to authenticate against the remote cache */
21
- login: LoginMethod;
22
13
  }
23
14
  //# sourceMappingURL=StartOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StartOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/start/types/StartOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC3B,oDAAoD;IACpD,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,6DAA6D;IAC7D,IAAI,EAAE,UAAU,CAAC;IAEjB,wGAAwG;IACxG,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,yDAAyD;IACzD,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAElC,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAElC,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAErC,mDAAmD;IACnD,KAAK,EAAE,WAAW,CAAC;CACpB"}
1
+ {"version":3,"file":"StartOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/start/types/StartOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,OAAO,GAAG,eAAe,GAAG,eAAe,GAAG,MAAM,CAAC;IAC3F,wGAAwG;IACxG,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,yDAAyD;IACzD,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAElC,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAElC,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StartOptions.js","sourceRoot":"","sources":["../../../../src/commands/start/types/StartOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMode } from '@ms-cloudpack/common-types';\nimport type { LoginMethod } from '@ms-cloudpack/remote-cache';\n\nexport interface StartOptions {\n /** Writes the resolve map to `resolve-map.json`. */\n logResolveMap?: boolean;\n\n /** The mode to start in (library/development/production). */\n mode: BundleMode;\n\n /** Specifies which specific app to run, in the case of running `init` at a higher level in the repo. */\n app?: string;\n\n /** Whether to open the browser (default true) */\n open?: boolean;\n\n /** Whether to use the cache on first request (default true) */\n cache?: boolean;\n\n /** Mostly for testing: custom port for the API server */\n apiServerPort?: number | number[];\n\n /** Mostly for testing: custom port for the app server (also set in config via `server.port`) */\n appServerPort?: number | number[];\n\n /** Mostly for testing: custom port for the bundle server */\n bundleServerPort?: number | number[];\n\n /** How to authenticate against the remote cache */\n login: LoginMethod;\n}\n"]}
1
+ {"version":3,"file":"StartOptions.js","sourceRoot":"","sources":["../../../../src/commands/start/types/StartOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReusedOptions } from '../../../types/ReusedOptions.js';\n\nexport interface StartOptions\n extends Pick<ReusedOptions, 'cache' | 'login' | 'logBundleInfo' | 'logResolveMap' | 'mode'> {\n /** Specifies which specific app to run, in the case of running `init` at a higher level in the repo. */\n app?: string;\n\n /** Whether to open the browser (default true) */\n open?: boolean;\n\n /** Mostly for testing: custom port for the API server */\n apiServerPort?: number | number[];\n\n /** Mostly for testing: custom port for the app server (also set in config via `server.port`) */\n appServerPort?: number | number[];\n\n /** Mostly for testing: custom port for the bundle server */\n bundleServerPort?: number | number[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/execute.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAM1D,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,WAAW,CA2F9C,CAAC"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/execute.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAM1D,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,WAAW,CA8F9C,CAAC"}
@@ -19,7 +19,7 @@ export const execute = async (params) => {
19
19
  }
20
20
  if (!environmentInfo.cloudpack.isSyncEnabled) {
21
21
  span.setAttribute('syncDisabled', true);
22
- return { message: 'CLOUDPACK_SYNC environment variable is set. Sync is disabled by the user.' };
22
+ return { message: 'Sync is disabled by the user (CLOUDPACK_SYNC environment variable is set).' };
23
23
  }
24
24
  const remoteCacheConfig = config.remoteCache;
25
25
  if (!remoteCacheConfig) {
@@ -55,7 +55,8 @@ export const execute = async (params) => {
55
55
  syncResult = await syncDownload({ input: undefined, ctx });
56
56
  }
57
57
  return {
58
- message: `Sync completed with ${syncResult.success} successes, ${syncResult.failed} failures, and ${syncResult['already-exist'] + syncResult['not-found']} items that did not require syncing.`,
58
+ message: `Sync completed with ${syncResult.success} successes, ${syncResult.failed} failures, ` +
59
+ `and ${syncResult['already-exist'] + syncResult['not-found']} items that did not require syncing.`,
59
60
  };
60
61
  });
61
62
  }
@@ -63,7 +64,8 @@ export const execute = async (params) => {
63
64
  if (error instanceof Error) {
64
65
  if (error.name === 'AuthenticationRequiredError' && error.message.includes('CrossPlatformLockError')) {
65
66
  return {
66
- message: red(`Cloudpack encountered an issue acquiring authentication lock. It seems Cloudpack Sync may already be active in another process. Please wait for the current process to complete and then try again`),
67
+ message: red(`Cloudpack encountered an issue acquiring the authentication lock. It seems "cloudpack sync" may already ` +
68
+ `be running in another process. Please wait for the other process to complete and then try again.`),
67
69
  exitCode: ExitCodeGenericError,
68
70
  };
69
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/sync/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,UAAU,EAAmB,MAAM,0BAA0B,CAAC;AAC9G,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAClD,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,GAGrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAGvE,SAAS,cAAc,CAAC,KAAc,EAAE,IAAY;IAClD,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;AAC1E,C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OAAO,EAAE,GAAG,CAAC,oEAAoE,CAAC;oBAClF,QAAQ,EAAE,2BAA2B;iBACtC,CAAC;YACJ,CAAC;YAED,IAAI,cAAc,CAAC,KAAK,EAAE,oBAAoB,CAAC,EAAE,CAAC;gBAChD,OAAO;oBACL,OAAO,EAAE,GAAG,CAAC,+DAA+D,CAAC;oBAC7E,QAAQ,EAAE,oBAAoB;iBAC/B,CAAC;YACJ,CAAC;QACH,CAAC;QAED,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { createPartialApiContext, syncDownload, syncUpload, type SyncResult } from '@ms-cloudpack/api-server';\nimport { environmentInfo } from '@ms-cloudpack/environment';\nimport { red } from '@ms-cloudpack/task-reporter';\nimport {\n ExitCodeAuthenticationError,\n ExitCodeGenericError,\n type CommandAction,\n type CommandExitParams,\n} from '../../types/CommandAction.js';\nimport { runPrerequisites } from '../../utilities/runPrerequisites.js';\nimport type { SyncOptions } from './types/SyncOptions.js';\n\nfunction checkErrorCode(error: unknown, code: string): boolean {\n return error instanceof Error && 'code' in error && error.code === code;\n}\n\nexport const execute: CommandAction<SyncOptions> = async (params) => {\n const { options, cwd, initialize, autoDispose } = params;\n const { login, upload } = options;\n const apiContextOptions = await initialize({ appPath: cwd });\n const { config, telemetryClient } = apiContextOptions;\n try {\n // Await here to ensure that try-catch block catches any errors thrown inside the async function\n return await telemetryClient.tracer.startActiveSpan('SYNC_EXECUTE', async (span): Promise<CommandExitParams> => {\n if (!config.features?.syncBundles) {\n return { message: 'Sync is disabled' };\n }\n\n if (!environmentInfo.cloudpack.isSyncEnabled) {\n span.setAttribute('syncDisabled', true);\n return { message: 'CLOUDPACK_SYNC environment variable is set. Sync is disabled by the user.' };\n }\n\n const remoteCacheConfig = config.remoteCache;\n if (!remoteCacheConfig) {\n return {\n message:\n 'Remote cache is not configured. Please add remoteCache to your cloudpack.config.json file to use this feature.',\n };\n }\n\n let syncResult: SyncResult;\n if (upload) {\n await runPrerequisites(apiContextOptions);\n\n const [ctx] = autoDispose(\n await createPartialApiContext({\n ...apiContextOptions,\n items: [\n 'bus',\n 'taskRunner',\n 'watcher',\n 'packages',\n 'session',\n 'packageImportPaths',\n 'packageHashes',\n 'remoteCacheClient',\n ],\n remoteCacheClientLoginMethod: login,\n }),\n );\n syncResult = await syncUpload({ input: undefined, ctx });\n } else {\n const [ctx] = autoDispose(\n await createPartialApiContext({\n ...apiContextOptions,\n items: ['packages', 'session', 'packageHashes', 'remoteCacheClient'],\n remoteCacheClientLoginMethod: login,\n }),\n );\n syncResult = await syncDownload({ input: undefined, ctx });\n }\n\n return {\n message: `Sync completed with ${syncResult.success} successes, ${syncResult.failed} failures, and ${syncResult['already-exist'] + syncResult['not-found']} items that did not require syncing.`,\n };\n });\n } catch (error) {\n if (error instanceof Error) {\n if (error.name === 'AuthenticationRequiredError' && error.message.includes('CrossPlatformLockError')) {\n return {\n message: red(\n `Cloudpack encountered an issue acquiring authentication lock. It seems Cloudpack Sync may already be active in another process. Please wait for the current process to complete and then try again`,\n ),\n exitCode: ExitCodeGenericError,\n };\n }\n if (\n error.name === 'AuthenticationRequiredError' ||\n ('statusCode' in error && (error.statusCode === '401' || error.statusCode === '403'))\n ) {\n return {\n message: red('Authentication error. Please check your credentials and try again.'),\n exitCode: ExitCodeAuthenticationError,\n };\n }\n\n if (checkErrorCode(error, 'REQUEST_SEND_ERROR')) {\n return {\n message: red('Connection error. Please check your connection and try again.'),\n exitCode: ExitCodeGenericError,\n };\n }\n }\n\n throw error;\n }\n};\n"]}
1
+ {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/sync/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,UAAU,EAAmB,MAAM,0BAA0B,CAAC;AAC9G,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAClD,OAAO,EACL,2BAA2B,E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ACxG,kGAAkG,CACrG;oBACD,QAAQ,EAAE,oBAAoB;iBAC/B,CAAC;YACJ,CAAC;YACD,IACE,KAAK,CAAC,IAAI,KAAK,6BAA6B;gBAC5C,CAAC,YAAY,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,UAAU,KAAK,KAAK,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,CAAC,EACrF,CAAC;gBACD,OAAO;oBACL,OAAO,EAAE,GAAG,CAAC,oEAAoE,CAAC;oBAClF,QAAQ,EAAE,2BAA2B;iBACtC,CAAC;YACJ,CAAC;YAED,IAAI,cAAc,CAAC,KAAK,EAAE,oBAAoB,CAAC,EAAE,CAAC;gBAChD,OAAO;oBACL,OAAO,EAAE,GAAG,CAAC,+DAA+D,CAAC;oBAC7E,QAAQ,EAAE,oBAAoB;iBAC/B,CAAC;YACJ,CAAC;QACH,CAAC;QAED,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { createPartialApiContext, syncDownload, syncUpload, type SyncResult } from '@ms-cloudpack/api-server';\nimport { environmentInfo } from '@ms-cloudpack/environment';\nimport { red } from '@ms-cloudpack/task-reporter';\nimport {\n ExitCodeAuthenticationError,\n ExitCodeGenericError,\n type CommandAction,\n type CommandExitParams,\n} from '../../types/CommandAction.js';\nimport { runPrerequisites } from '../../utilities/runPrerequisites.js';\nimport type { SyncOptions } from './types/SyncOptions.js';\n\nfunction checkErrorCode(error: unknown, code: string): boolean {\n return error instanceof Error && 'code' in error && error.code === code;\n}\n\nexport const execute: CommandAction<SyncOptions> = async (params) => {\n const { options, cwd, initialize, autoDispose } = params;\n const { login, upload } = options;\n const apiContextOptions = await initialize({ appPath: cwd });\n const { config, telemetryClient } = apiContextOptions;\n try {\n // Await here to ensure that try-catch block catches any errors thrown inside the async function\n return await telemetryClient.tracer.startActiveSpan('SYNC_EXECUTE', async (span): Promise<CommandExitParams> => {\n if (!config.features?.syncBundles) {\n return { message: 'Sync is disabled' };\n }\n\n if (!environmentInfo.cloudpack.isSyncEnabled) {\n span.setAttribute('syncDisabled', true);\n return { message: 'Sync is disabled by the user (CLOUDPACK_SYNC environment variable is set).' };\n }\n\n const remoteCacheConfig = config.remoteCache;\n if (!remoteCacheConfig) {\n return {\n message:\n 'Remote cache is not configured. Please add remoteCache to your cloudpack.config.json file to use this feature.',\n };\n }\n\n let syncResult: SyncResult;\n if (upload) {\n await runPrerequisites(apiContextOptions);\n\n const [ctx] = autoDispose(\n await createPartialApiContext({\n ...apiContextOptions,\n items: [\n 'bus',\n 'taskRunner',\n 'watcher',\n 'packages',\n 'session',\n 'packageImportPaths',\n 'packageHashes',\n 'remoteCacheClient',\n ],\n remoteCacheClientLoginMethod: login,\n }),\n );\n syncResult = await syncUpload({ input: undefined, ctx });\n } else {\n const [ctx] = autoDispose(\n await createPartialApiContext({\n ...apiContextOptions,\n items: ['packages', 'session', 'packageHashes', 'remoteCacheClient'],\n remoteCacheClientLoginMethod: login,\n }),\n );\n syncResult = await syncDownload({ input: undefined, ctx });\n }\n\n return {\n message:\n `Sync completed with ${syncResult.success} successes, ${syncResult.failed} failures, ` +\n `and ${syncResult['already-exist'] + syncResult['not-found']} items that did not require syncing.`,\n };\n });\n } catch (error) {\n if (error instanceof Error) {\n if (error.name === 'AuthenticationRequiredError' && error.message.includes('CrossPlatformLockError')) {\n return {\n message: red(\n `Cloudpack encountered an issue acquiring the authentication lock. It seems \"cloudpack sync\" may already ` +\n `be running in another process. Please wait for the other process to complete and then try again.`,\n ),\n exitCode: ExitCodeGenericError,\n };\n }\n if (\n error.name === 'AuthenticationRequiredError' ||\n ('statusCode' in error && (error.statusCode === '401' || error.statusCode === '403'))\n ) {\n return {\n message: red('Authentication error. Please check your credentials and try again.'),\n exitCode: ExitCodeAuthenticationError,\n };\n }\n\n if (checkErrorCode(error, 'REQUEST_SEND_ERROR')) {\n return {\n message: red('Connection error. Please check your connection and try again.'),\n exitCode: ExitCodeGenericError,\n };\n }\n }\n\n throw error;\n }\n};\n"]}
@@ -1,6 +1,5 @@
1
- import type { LoginMethod } from '@ms-cloudpack/remote-cache';
2
- export interface SyncOptions {
1
+ import type { ReusedOptions } from '../../../types/ReusedOptions.js';
2
+ export interface SyncOptions extends Pick<ReusedOptions, 'login'> {
3
3
  upload: boolean;
4
- login: LoginMethod;
5
4
  }
6
5
  //# sourceMappingURL=SyncOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SyncOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/sync/types/SyncOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,WAAW,CAAC;CACpB"}
1
+ {"version":3,"file":"SyncOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/sync/types/SyncOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;IAC/D,MAAM,EAAE,OAAO,CAAC;CACjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"SyncOptions.js","sourceRoot":"","sources":["../../../../src/commands/sync/types/SyncOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { LoginMethod } from '@ms-cloudpack/remote-cache';\n\nexport interface SyncOptions {\n upload: boolean;\n login: LoginMethod;\n}\n"]}
1
+ {"version":3,"file":"SyncOptions.js","sourceRoot":"","sources":["../../../../src/commands/sync/types/SyncOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReusedOptions } from '../../../types/ReusedOptions.js';\n\nexport interface SyncOptions extends Pick<ReusedOptions, 'login'> {\n upload: boolean;\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import type { CloudpackConfig, PackageSettingsMatch } from '@ms-cloudpack/common-types';
2
+ import type { LoginMethod } from '@ms-cloudpack/remote-cache';
3
+ /**
4
+ * Types for options from `reusedOptions.ts` (pick the properties you need).
5
+ */
6
+ export interface ReusedOptions extends Pick<CloudpackConfig, 'logBundleInfo' | 'mode'> {
7
+ /** Whether to use the cache */
8
+ cache?: boolean;
9
+ /** Writes the resolve map to `resolve-map.json`. */
10
+ logResolveMap?: boolean;
11
+ /** Only evaluate/consider specific package(s). */
12
+ match?: PackageSettingsMatch[];
13
+ /** How to authenticate against the remote cache */
14
+ login: LoginMethod;
15
+ }
16
+ //# sourceMappingURL=ReusedOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReusedOptions.d.ts","sourceRoot":"","sources":["../../src/types/ReusedOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,eAAe,EAAE,eAAe,GAAG,MAAM,CAAC;IACpF,+BAA+B;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,oDAAoD;IACpD,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,kDAAkD;IAClD,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAE/B,mDAAmD;IACnD,KAAK,EAAE,WAAW,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ReusedOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReusedOptions.js","sourceRoot":"","sources":["../../src/types/ReusedOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { CloudpackConfig, PackageSettingsMatch } from '@ms-cloudpack/common-types';\nimport type { LoginMethod } from '@ms-cloudpack/remote-cache';\n\n/**\n * Types for options from `reusedOptions.ts` (pick the properties you need).\n */\nexport interface ReusedOptions extends Pick<CloudpackConfig, 'logBundleInfo' | 'mode'> {\n /** Whether to use the cache */\n cache?: boolean;\n\n /** Writes the resolve map to `resolve-map.json`. */\n logResolveMap?: boolean;\n\n /** Only evaluate/consider specific package(s). */\n match?: PackageSettingsMatch[];\n\n /** How to authenticate against the remote cache */\n login: LoginMethod;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"findCloudpackAppPaths.d.ts","sourceRoot":"","sources":["../../src/utilities/findCloudpackAppPaths.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAIpE"}
1
+ {"version":3,"file":"findCloudpackAppPaths.d.ts","sourceRoot":"","sources":["../../src/utilities/findCloudpackAppPaths.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAIpE"}
@@ -1,3 +1,4 @@
1
+ import { appConfigFileName } from '@ms-cloudpack/config';
1
2
  import glob from 'fast-glob';
2
3
  import path from 'path';
3
4
  /**
@@ -6,6 +7,6 @@ import path from 'path';
6
7
  * @returns An array of app paths corresponding to all discovered Cloudpack apps
7
8
  */
8
9
  export function findCloudpackAppPaths(startingPath) {
9
- return (glob.sync(['**/cloudpack.config.json'], { cwd: startingPath, ignore: ['**/node_modules/**'] }) ?? []).map((file) => path.join(startingPath, path.dirname(file)));
10
+ return (glob.sync([`**/${appConfigFileName}`], { cwd: startingPath, ignore: ['**/node_modules/**'] }) ?? []).map((file) => path.join(startingPath, path.dirname(file)));
10
11
  }
11
12
  //# sourceMappingURL=findCloudpackAppPaths.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"findCloudpackAppPaths.js","sourceRoot":"","sources":["../../src/utilities/findCloudpackAppPaths.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAoB;IACxD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,0BAA0B,CAAC,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAC/G,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CACtD,CAAC;AACJ,CAAC","sourcesContent":["import glob from 'fast-glob';\nimport path from 'path';\n\n/**\n * Find folders in the repo containing a `cloudpack.config.json` file.\n * @param startingPath The path to start searching from when finding Cloudpack apps\n * @returns An array of app paths corresponding to all discovered Cloudpack apps\n */\nexport function findCloudpackAppPaths(startingPath: string): string[] {\n return (glob.sync(['**/cloudpack.config.json'], { cwd: startingPath, ignore: ['**/node_modules/**'] }) ?? []).map(\n (file) => path.join(startingPath, path.dirname(file)),\n );\n}\n"]}
1
+ {"version":3,"file":"findCloudpackAppPaths.js","sourceRoot":"","sources":["../../src/utilities/findCloudpackAppPaths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAoB;IACxD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,iBAAiB,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAC9G,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CACtD,CAAC;AACJ,CAAC","sourcesContent":["import { appConfigFileName } from '@ms-cloudpack/config';\nimport glob from 'fast-glob';\nimport path from 'path';\n\n/**\n * Find folders in the repo containing a `cloudpack.config.json` file.\n * @param startingPath The path to start searching from when finding Cloudpack apps\n * @returns An array of app paths corresponding to all discovered Cloudpack apps\n */\nexport function findCloudpackAppPaths(startingPath: string): string[] {\n return (glob.sync([`**/${appConfigFileName}`], { cwd: startingPath, ignore: ['**/node_modules/**'] }) ?? []).map(\n (file) => path.join(startingPath, path.dirname(file)),\n );\n}\n"]}
@@ -4,5 +4,5 @@ import type { BundleOptions } from '../commands/bundle/types/BundleOptions.js';
4
4
  * Translate CLI options into `readConfig` options. (This currently uses partial `BundleOptions` as
5
5
  * the type, but it works for anything with at least one of the listed properties.)
6
6
  */
7
- export declare function getConfigOptionsFromCliOptions(options: Partial<Pick<BundleOptions, 'mode' | 'bundler'>>): ReadConfigOptions;
7
+ export declare function getConfigOptionsFromCliOptions(options: Partial<Pick<BundleOptions, 'mode' | 'bundler' | 'logBundleInfo'>>): ReadConfigOptions;
8
8
  //# sourceMappingURL=getConfigOptionsFromCliOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getConfigOptionsFromCliOptions.d.ts","sourceRoot":"","sources":["../../src/utilities/getConfigOptionsFromCliOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE/E;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GACxD,iBAAiB,CAOnB"}
1
+ {"version":3,"file":"getConfigOptionsFromCliOptions.d.ts","sourceRoot":"","sources":["../../src/utilities/getConfigOptionsFromCliOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE/E;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,eAAe,CAAC,CAAC,GAC1E,iBAAiB,CAQnB"}
@@ -5,6 +5,7 @@
5
5
  export function getConfigOptionsFromCliOptions(options) {
6
6
  return {
7
7
  mode: options.mode,
8
+ logBundleInfo: options.logBundleInfo,
8
9
  // Handle --bundler by passing it as a universal package override, which will be appended
9
10
  // to any user-provided packageSettings so that it takes precedence.
10
11
  extraPackageSettings: options.bundler ? [{ match: '*', bundler: options.bundler }] : undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"getConfigOptionsFromCliOptions.js","sourceRoot":"","sources":["../../src/utilities/getConfigOptionsFromCliOptions.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAC5C,OAAyD;IAEzD,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,yFAAyF;QACzF,oEAAoE;QACpE,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;KAC/F,CAAC;AACJ,CAAC","sourcesContent":["import type { ReadConfigOptions } from '@ms-cloudpack/config';\nimport type { BundleOptions } from '../commands/bundle/types/BundleOptions.js';\n\n/**\n * Translate CLI options into `readConfig` options. (This currently uses partial `BundleOptions` as\n * the type, but it works for anything with at least one of the listed properties.)\n */\nexport function getConfigOptionsFromCliOptions(\n options: Partial<Pick<BundleOptions, 'mode' | 'bundler'>>,\n): ReadConfigOptions {\n return {\n mode: options.mode,\n // Handle --bundler by passing it as a universal package override, which will be appended\n // to any user-provided packageSettings so that it takes precedence.\n extraPackageSettings: options.bundler ? [{ match: '*', bundler: options.bundler }] : undefined,\n };\n}\n"]}
1
+ {"version":3,"file":"getConfigOptionsFromCliOptions.js","sourceRoot":"","sources":["../../src/utilities/getConfigOptionsFromCliOptions.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAC5C,OAA2E;IAE3E,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,yFAAyF;QACzF,oEAAoE;QACpE,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;KAC/F,CAAC;AACJ,CAAC","sourcesContent":["import type { ReadConfigOptions } from '@ms-cloudpack/config';\nimport type { BundleOptions } from '../commands/bundle/types/BundleOptions.js';\n\n/**\n * Translate CLI options into `readConfig` options. (This currently uses partial `BundleOptions` as\n * the type, but it works for anything with at least one of the listed properties.)\n */\nexport function getConfigOptionsFromCliOptions(\n options: Partial<Pick<BundleOptions, 'mode' | 'bundler' | 'logBundleInfo'>>,\n): ReadConfigOptions {\n return {\n mode: options.mode,\n logBundleInfo: options.logBundleInfo,\n // Handle --bundler by passing it as a universal package override, which will be appended\n // to any user-provided packageSettings so that it takes precedence.\n extraPackageSettings: options.bundler ? [{ match: '*', bundler: options.bundler }] : undefined,\n };\n}\n"]}
@@ -3,6 +3,9 @@ import { Option } from 'commander';
3
3
  * These options are used by multiple commands, but should be manually added.
4
4
  */
5
5
  export declare const reusedOptions: {
6
+ readonly logBundleInfo: (options?: {
7
+ requiresNoCache?: boolean;
8
+ }) => Option;
6
9
  readonly logResolveMap: () => Option;
7
10
  /**
8
11
  * @param descriptionStart Start of description for this command, e.g. "Bundle specific package(s)"
@@ -12,7 +15,8 @@ export declare const reusedOptions: {
12
15
  readonly mode: (options: {
13
16
  action: "bundle" | "run";
14
17
  }) => Option;
15
- readonly noCache: () => Option;
18
+ /** `--no-cache` option */
19
+ readonly cache: () => Option;
16
20
  readonly login: () => Option;
17
21
  };
18
22
  //# sourceMappingURL=reusedOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reusedOptions.d.ts","sourceRoot":"","sources":["../../src/utilities/reusedOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,MAAM,EAAE,MAAM,WAAW,CAAC;AAIzD;;GAEG;AACH,eAAO,MAAM,aAAa;;IAExB;;;OAGG;uCACuB,MAAM;6BAKhB;QAAE,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAA;KAAE;;;CAYpC,CAAC"}
1
+ {"version":3,"file":"reusedOptions.d.ts","sourceRoot":"","sources":["../../src/utilities/reusedOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,MAAM,EAAE,MAAM,WAAW,CAAC;AAKzD;;GAEG;AACH,eAAO,MAAM,aAAa;uCACE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE;;IAOvD;;;OAGG;uCACuB,MAAM;6BAKhB;QAAE,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAA;KAAE;IAO5C,0BAA0B;;;CAQgD,CAAC"}
@@ -5,6 +5,8 @@ import { environmentInfo } from '@ms-cloudpack/environment';
5
5
  * These options are used by multiple commands, but should be manually added.
6
6
  */
7
7
  export const reusedOptions = {
8
+ logBundleInfo: (options) => new Option('--log-bundle-info', 'For each package, write log files in its output folder with bundle input, output, and analyzed info.' +
9
+ (options?.requiresNoCache ? ' (Note: requires --no-cache option if bundle output already exists.)' : '')),
8
10
  logResolveMap: () => new Option('--log-resolve-map', 'Log the resolve map to "resolve-map.json" for diagnostics.'),
9
11
  /**
10
12
  * @param descriptionStart Start of description for this command, e.g. "Bundle specific package(s)"
@@ -14,10 +16,13 @@ export const reusedOptions = {
14
16
  mode: (options) => new Option('--mode <mode>', `The mode to ${options.action === 'bundle' ? 'bundle the package' : 'run the app'} in. (library | production)`)
15
17
  .argParser(parseBundleMode)
16
18
  .default('library'),
17
- noCache: () => new Option('--no-cache', 'Rebuild all packages, rather than using cached assets.'),
19
+ /** `--no-cache` option */
20
+ cache: () => new Option('--no-cache', 'Rebuild all packages, rather than using cached assets.'),
18
21
  login: () => new Option('--login <method>', 'How to authenticate against the remote cache.')
19
22
  .choices(['interactive', 'azure-cli', 'device-code'])
20
23
  .default(getDefaultLogin(), '"azure-cli" in CI, "device-code" in Github Codespaces, "interactive" otherwise'),
24
+ // Verify the type with `satisfies` to preserve individual function signatures.
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
26
  };
22
27
  /** Parse the session mode based on user input (e.g. --mode argument in start.) */
23
28
  function parseBundleMode(mode) {
@@ -1 +1 @@
1
- {"version":3,"file":"reusedOptions.js","sourceRoot":"","sources":["../../src/utilities/reusedOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,mBAAmB,EAAE,4DAA4D,CAAC;IAClH;;;OAGG;IACH,KAAK,EAAE,CAAC,gBAAwB,EAAE,EAAE,CAClC,IAAI,MAAM,CACR,oBAAoB,EACpB,GAAG,gBAAgB,gEAAgE,CACpF,CAAC,SAAS,CAAC,UAAU,CAAC;IACzB,IAAI,EAAE,CAAC,OAAqC,EAAE,EAAE,CAC9C,IAAI,MAAM,CACR,eAAe,EACf,eAAe,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,aAAa,6BAA6B,CAC/G;SACE,SAAS,CAAC,eAAe,CAAC;SAC1B,OAAO,CAAC,SAAS,CAAC;IACvB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,YAAY,EAAE,wDAAwD,CAAC;IACjG,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,MAAM,CAAC,kBAAkB,EAAE,+CAA+C,CAAC;SAC5E,OAAO,CAAC,CAAC,aAAa,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;SACpD,OAAO,CAAC,eAAe,EAAE,EAAE,gFAAgF,CAAC;CACzG,CAAC;AAEX,kFAAkF;AAClF,SAAS,eAAe,CAAC,IAAY;IACnC,QAAQ,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QAC3B,KAAK,KAAK,CAAC;QACX,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,KAAK,CAAC;QACX,KAAK,aAAa;YAChB,OAAO,aAAa,CAAC;QACvB,KAAK,MAAM,CAAC;QACZ,KAAK,YAAY;YACf,OAAO,YAAY,CAAC;QACtB;YACE,MAAM,IAAI,oBAAoB,CAAC,4CAA4C,CAAC,CAAC;IACjF,CAAC;AACH,CAAC;AAED,SAAS,eAAe;IACtB,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;AAC3G,CAAC","sourcesContent":["import type { BundleMode } from '@ms-cloudpack/common-types';\nimport { InvalidArgumentError, Option } from 'commander';\nimport { parseMatch } from './parseMatch.js';\nimport { environmentInfo } from '@ms-cloudpack/environment';\n\n/**\n * These options are used by multiple commands, but should be manually added.\n */\nexport const reusedOptions = {\n logResolveMap: () => new Option('--log-resolve-map', 'Log the resolve map to \"resolve-map.json\" for diagnostics.'),\n /**\n * @param descriptionStart Start of description for this command, e.g. \"Bundle specific package(s)\"\n * (it will automatically include an optional version note and examples)\n */\n match: (descriptionStart: string) =>\n new Option(\n '--match <match...>',\n `${descriptionStart}, optionally with a version: e.g. \"foo\", \"@foo/*\", \"foo@1.2.3\"`,\n ).argParser(parseMatch),\n mode: (options: { action: 'bundle' | 'run' }) =>\n new Option(\n '--mode <mode>',\n `The mode to ${options.action === 'bundle' ? 'bundle the package' : 'run the app'} in. (library | production)`,\n )\n .argParser(parseBundleMode)\n .default('library'),\n noCache: () => new Option('--no-cache', 'Rebuild all packages, rather than using cached assets.'),\n login: () =>\n new Option('--login <method>', 'How to authenticate against the remote cache.')\n .choices(['interactive', 'azure-cli', 'device-code'])\n .default(getDefaultLogin(), '\"azure-cli\" in CI, \"device-code\" in Github Codespaces, \"interactive\" otherwise'),\n} as const;\n\n/** Parse the session mode based on user input (e.g. --mode argument in start.) */\nfunction parseBundleMode(mode: string): BundleMode {\n switch (mode.toLowerCase()) {\n case 'lib':\n case 'library':\n return 'library';\n case 'dev':\n case 'development':\n return 'development';\n case 'prod':\n case 'production':\n return 'production';\n default:\n throw new InvalidArgumentError(`Valid options are 'lib', 'dev', or 'prod'.`);\n }\n}\n\nfunction getDefaultLogin(): string {\n return environmentInfo.isCI ? 'azure-cli' : environmentInfo.isCodespaces ? 'device-code' : 'interactive';\n}\n"]}
1
+ {"version":3,"file":"reusedOptions.js","sourceRoot":"","sources":["../../src/utilities/reusedOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAG5D;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,aAAa,EAAE,CAAC,OAAuC,EAAE,EAAE,CACzD,IAAI,MAAM,CACR,mBAAmB,EACnB,sGAAsG;QACpG,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,sEAAsE,CAAC,CAAC,CAAC,EAAE,CAAC,CAC3G;IACH,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,mBA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YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;AAC3G,CAAC","sourcesContent":["import type { BundleMode } from '@ms-cloudpack/common-types';\nimport { InvalidArgumentError, Option } from 'commander';\nimport { parseMatch } from './parseMatch.js';\nimport { environmentInfo } from '@ms-cloudpack/environment';\nimport type { ReusedOptions } from '../types/ReusedOptions.js';\n\n/**\n * These options are used by multiple commands, but should be manually added.\n */\nexport const reusedOptions = {\n logBundleInfo: (options?: { requiresNoCache?: boolean }) =>\n new Option(\n '--log-bundle-info',\n 'For each package, write log files in its output folder with bundle input, output, and analyzed info.' +\n (options?.requiresNoCache ? ' (Note: requires --no-cache option if bundle output already exists.)' : ''),\n ),\n logResolveMap: () => new Option('--log-resolve-map', 'Log the resolve map to \"resolve-map.json\" for diagnostics.'),\n /**\n * @param descriptionStart Start of description for this command, e.g. \"Bundle specific package(s)\"\n * (it will automatically include an optional version note and examples)\n */\n match: (descriptionStart: string) =>\n new Option(\n '--match <match...>',\n `${descriptionStart}, optionally with a version: e.g. \"foo\", \"@foo/*\", \"foo@1.2.3\"`,\n ).argParser(parseMatch),\n mode: (options: { action: 'bundle' | 'run' }) =>\n new Option(\n '--mode <mode>',\n `The mode to ${options.action === 'bundle' ? 'bundle the package' : 'run the app'} in. (library | production)`,\n )\n .argParser(parseBundleMode)\n .default('library'),\n /** `--no-cache` option */\n cache: () => new Option('--no-cache', 'Rebuild all packages, rather than using cached assets.'),\n login: () =>\n new Option('--login <method>', 'How to authenticate against the remote cache.')\n .choices(['interactive', 'azure-cli', 'device-code'])\n .default(getDefaultLogin(), '\"azure-cli\" in CI, \"device-code\" in Github Codespaces, \"interactive\" otherwise'),\n // Verify the type with `satisfies` to preserve individual function signatures.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n} as const satisfies Record<keyof ReusedOptions, (...args: any[]) => Option>;\n\n/** Parse the session mode based on user input (e.g. --mode argument in start.) */\nfunction parseBundleMode(mode: string): BundleMode {\n switch (mode.toLowerCase()) {\n case 'lib':\n case 'library':\n return 'library';\n case 'dev':\n case 'development':\n return 'development';\n case 'prod':\n case 'production':\n return 'production';\n default:\n throw new InvalidArgumentError(`Valid options are 'lib', 'dev', or 'prod'.`);\n }\n}\n\nfunction getDefaultLogin(): string {\n return environmentInfo.isCI ? 'azure-cli' : environmentInfo.isCodespaces ? 'device-code' : 'interactive';\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/cli",
3
- "version": "0.72.47",
3
+ "version": "0.72.49",
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",
@@ -10,34 +10,34 @@
10
10
  "cloudpack": "./bin/cloudpack.js"
11
11
  },
12
12
  "dependencies": {
13
- "@ms-cloudpack/api-server": "^0.58.12",
14
- "@ms-cloudpack/app-server": "^0.17.42",
15
- "@ms-cloudpack/bundler": "^0.23.35",
16
- "@ms-cloudpack/common-types": "^0.24.4",
17
- "@ms-cloudpack/config": "^0.33.11",
13
+ "@ms-cloudpack/api-server": "^0.58.14",
14
+ "@ms-cloudpack/app-server": "^0.17.44",
15
+ "@ms-cloudpack/bundler": "^0.23.37",
16
+ "@ms-cloudpack/common-types": "^0.24.6",
17
+ "@ms-cloudpack/config": "^0.33.13",
18
18
  "@ms-cloudpack/environment": "^0.1.1",
19
19
  "@ms-cloudpack/json-utilities": "^0.1.10",
20
- "@ms-cloudpack/overlay": "^0.17.123",
21
- "@ms-cloudpack/package-utilities": "^11.3.1",
20
+ "@ms-cloudpack/overlay": "^0.17.125",
21
+ "@ms-cloudpack/package-utilities": "^11.3.3",
22
22
  "@ms-cloudpack/path-string-parsing": "^1.2.6",
23
- "@ms-cloudpack/path-utilities": "^3.0.1",
24
- "@ms-cloudpack/remote-cache": "^0.10.7",
25
- "@ms-cloudpack/setup-utilities": "^0.5.11",
23
+ "@ms-cloudpack/path-utilities": "^3.0.3",
24
+ "@ms-cloudpack/remote-cache": "^0.10.9",
25
+ "@ms-cloudpack/setup-utilities": "^0.5.13",
26
26
  "@ms-cloudpack/task-reporter": "^0.15.0",
27
- "@ms-cloudpack/telemetry": "^0.10.11",
27
+ "@ms-cloudpack/telemetry": "^0.10.13",
28
28
  "@yarnpkg/lockfile": "^1.1.0",
29
- "commander": "^11.1.0",
29
+ "commander": "^13.0.0",
30
30
  "cross-spawn": "^7.0.3",
31
31
  "didyoumean": "^1.2.2",
32
32
  "fast-glob": "^3.2.12",
33
33
  "get-port": "^7.0.0",
34
- "open": "^9.0.0",
34
+ "open": "^10.0.0",
35
35
  "prompts": "^2.4.2",
36
36
  "semver": "^7.6.0",
37
37
  "workspace-tools": "^0.38.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@ms-cloudpack/common-types": "^0.24.4",
40
+ "@ms-cloudpack/common-types": "^0.24.6",
41
41
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
42
42
  "@ms-cloudpack/scripts": "^0.0.1",
43
43
  "@ms-cloudpack/test-utilities": "^0.5.0",