@ms-cloudpack/cli 0.70.0 → 0.70.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/lib/commands/bundle/index.d.ts.map +1 -1
  2. package/lib/commands/bundle/index.js +6 -8
  3. package/lib/commands/bundle/index.js.map +1 -1
  4. package/lib/commands/bundle/types/BundleOptions.d.ts +6 -3
  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/index.d.ts.map +1 -1
  8. package/lib/commands/init/index.js +4 -3
  9. package/lib/commands/init/index.js.map +1 -1
  10. package/lib/commands/init/types/InitOptions.d.ts +3 -3
  11. package/lib/commands/init/types/InitOptions.js.map +1 -1
  12. package/lib/commands/link/index.js +9 -5
  13. package/lib/commands/link/index.js.map +1 -1
  14. package/lib/commands/link/types/LinkOptions.d.ts +12 -8
  15. package/lib/commands/link/types/LinkOptions.d.ts.map +1 -1
  16. package/lib/commands/link/types/LinkOptions.js.map +1 -1
  17. package/lib/commands/setup/execute.d.ts +1 -1
  18. package/lib/commands/setup/execute.d.ts.map +1 -1
  19. package/lib/commands/setup/execute.js +1 -1
  20. package/lib/commands/setup/execute.js.map +1 -1
  21. package/lib/commands/setup/index.d.ts +1 -1
  22. package/lib/commands/setup/index.d.ts.map +1 -1
  23. package/lib/commands/setup/index.js +4 -3
  24. package/lib/commands/setup/index.js.map +1 -1
  25. package/lib/commands/start/execute.d.ts.map +1 -1
  26. package/lib/commands/start/execute.js +32 -32
  27. package/lib/commands/start/execute.js.map +1 -1
  28. package/lib/commands/start/index.d.ts.map +1 -1
  29. package/lib/commands/start/index.js +3 -6
  30. package/lib/commands/start/index.js.map +1 -1
  31. package/lib/commands/sync/index.d.ts.map +1 -1
  32. package/lib/commands/sync/index.js +5 -4
  33. package/lib/commands/sync/index.js.map +1 -1
  34. package/lib/commands/unlink/index.d.ts.map +1 -1
  35. package/lib/commands/unlink/index.js +1 -1
  36. package/lib/commands/unlink/index.js.map +1 -1
  37. package/lib/utilities/reusedOptions.d.ts +3 -0
  38. package/lib/utilities/reusedOptions.d.ts.map +1 -1
  39. package/lib/utilities/reusedOptions.js +22 -3
  40. package/lib/utilities/reusedOptions.js.map +1 -1
  41. package/package.json +11 -11
  42. package/lib/utilities/parseBundleMode.d.ts +0 -4
  43. package/lib/utilities/parseBundleMode.d.ts.map +0 -1
  44. package/lib/utilities/parseBundleMode.js +0 -18
  45. package/lib/utilities/parseBundleMode.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/bundle/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAK9E,iCAAiC;AACjC,eAAO,MAAM,IAAI,EAAE,mBAyBlB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/bundle/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAK9E,iCAAiC;AACjC,eAAO,MAAM,IAAI,EAAE,mBAuBlB,CAAC"}
@@ -1,23 +1,21 @@
1
1
  import { InvalidArgumentError, Option } from 'commander';
2
2
  import { parseMatch } from '../../utilities/parseMatch.js';
3
- import { parseBundleMode } from '../../utilities/parseBundleMode.js';
3
+ import { reusedOptions } from '../../utilities/reusedOptions.js';
4
4
  /** Defines the "bundle" verb. */
5
5
  export const init = (program) => {
6
6
  program.addSubCommand({
7
7
  name: 'bundle',
8
8
  description: 'Bundles a package.',
9
9
  options: {
10
- mode: new Option('--mode <mode>', 'The mode to run the app in. (library | development | production)')
11
- .argParser(parseBundleMode)
12
- .default('library'),
13
- bundler: new Option('--bundler <name>', 'Forces use of a specific bundler.'),
10
+ mode: reusedOptions.mode({ action: 'bundle' }),
11
+ bundler: new Option('--bundler <name>', 'Force using a specific bundler.').choices(['ori', 'rollup', 'webpack']),
14
12
  match: new Option('--match <match...>', 'Bundle specific package(s), optionally with a version: e.g. "foo", "@foo/*", "foo@1.2.3"').argParser(parseMatch),
15
13
  package: new Option('--package <package>').hideHelp().argParser(() => {
16
14
  throw new InvalidArgumentError('Use --match instead of --package');
17
15
  }),
18
- outdir: new Option('--outdir <path>', 'Path to drop the bundle output, relative to current or package path. ' +
19
- 'If not set, uses the default path under the cloudpack cache.'),
20
- disableSourceMaps: new Option('--disable-source-maps', 'Disables source maps.'),
16
+ outdir: new Option('--outdir <path>', 'Path for the bundle output, relative to current path (or the resolved path to --package if specified). ' +
17
+ 'Default is a path under the cloudpack cache.'),
18
+ disableSourceMaps: new Option('--disable-source-maps', 'Disable source maps.'),
21
19
  },
22
20
  getExecutor: () => import('./execute.js'),
23
21
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/bundle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,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,IAAI,MAAM,CAAC,eAAe,EAAE,kEAAkE,CAAC;iBAClG,SAAS,CAAC,eAAe,CAAC;iBAC1B,OAAO,CAAC,SAAS,CAAC;YACrB,OAAO,EAAE,IAAI,MAAM,CAAC,kBAAkB,EAAE,mCAAmC,CAAC;YAC5E,KAAK,EAAE,IAAI,MAAM,CACf,oBAAoB,EACpB,0FAA0F,CAC3F,CAAC,SAAS,CAAC,UAAU,CAAC;YACvB,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,uEAAuE;gBACrE,8DAA8D,CACjE;YACD,iBAAiB,EAAE,IAAI,MAAM,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;SAChF;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { InvalidArgumentError, Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { BundleOptions } from './types/BundleOptions.js';\nimport { parseMatch } from '../../utilities/parseMatch.js';\nimport { parseBundleMode } from '../../utilities/parseBundleMode.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: new Option('--mode <mode>', 'The mode to run the app in. (library | development | production)')\n .argParser(parseBundleMode)\n .default('library'),\n bundler: new Option('--bundler <name>', 'Forces use of a specific bundler.'),\n match: new Option(\n '--match <match...>',\n 'Bundle specific package(s), optionally with a version: e.g. \"foo\", \"@foo/*\", \"foo@1.2.3\"',\n ).argParser(parseMatch),\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 to drop the bundle output, relative to current or package path. ' +\n 'If not set, uses the default path under the cloudpack cache.',\n ),\n disableSourceMaps: new Option('--disable-source-maps', 'Disables 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,oBAAoB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,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,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;YAChH,KAAK,EAAE,IAAI,MAAM,CACf,oBAAoB,EACpB,0FAA0F,CAC3F,CAAC,SAAS,CAAC,UAAU,CAAC;YACvB,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 { InvalidArgumentError, Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { BundleOptions } from './types/BundleOptions.js';\nimport { parseMatch } from '../../utilities/parseMatch.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(['ori', 'rollup', 'webpack']),\n match: new Option(\n '--match <match...>',\n 'Bundle specific package(s), optionally with a version: e.g. \"foo\", \"@foo/*\", \"foo@1.2.3\"',\n ).argParser(parseMatch),\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,7 +1,10 @@
1
1
  import type { BundleMode, PackageSettingsMatch } from '@ms-cloudpack/common-types';
2
2
  export interface BundleOptions {
3
3
  /**
4
- * Forces use of a specific bundler. 'ori' | 'rollup' | 'auto'. Defaults to "auto".
4
+ * Force using a specific bundler (ori/rollup/webpack).
5
+ *
6
+ * Default is automatically choosing the bundler based on package contents, unless there any
7
+ * relevant package settings specify a bundler.
5
8
  */
6
9
  bundler?: string;
7
10
  /**
@@ -9,7 +12,7 @@ export interface BundleOptions {
9
12
  */
10
13
  disableSourceMaps?: boolean;
11
14
  /**
12
- * Path to drop the bundle output. This is usually relative to the app path.
15
+ * Path for the bundle output. This is usually relative to the app path.
13
16
  * If `package` is set, it's relative to the package path.
14
17
  *
15
18
  * If not set, the bundle output is dropped in the default path under the cloudpack cache.
@@ -23,7 +26,7 @@ export interface BundleOptions {
23
26
  * If set, only evaluate matching packages.
24
27
  */
25
28
  match?: PackageSettingsMatch[];
26
- /** The mode to bundle in (library/development/production). */
29
+ /** The mode to bundle in. */
27
30
  mode: BundleMode;
28
31
  }
29
32
  //# 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;;OAEG;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,8DAA8D;IAC9D,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,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 +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 * Forces use of a specific bundler. 'ori' | 'rollup' | 'auto'. Defaults to \"auto\".\n */\n bundler?: string;\n\n /**\n * Disables source maps.\n */\n disableSourceMaps?: boolean;\n\n /**\n * Path to drop 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 (library/development/production). */\n mode: BundleMode;\n}\n"]}
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/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 +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;AAK9E,+BAA+B;AAC/B,eAAO,MAAM,IAAI,EAAE,mBAmBlB,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;AAK9E,+BAA+B;AAC/B,eAAO,MAAM,IAAI,EAAE,mBAoBlB,CAAC"}
@@ -5,11 +5,12 @@ import { reusedOptions } from '../../utilities/reusedOptions.js';
5
5
  export const init = (program) => {
6
6
  program.addSubCommand({
7
7
  name: 'init',
8
- description: 'Initializes a given app project and defines the necessary configuration overrides to make an existing app compatible with Cloudpack.',
8
+ description: "Validate an app's compatibility with Cloudpack, and generate any necessary " +
9
+ 'configuration overrides (cloudpack.generated.json).',
9
10
  options: {
10
11
  logResolveMap: reusedOptions.logResolveMap(),
11
- reset: new Option('--reset', 'Ignores existing overrides when determining all entries.').conflicts('check'),
12
- check: new Option('--check', 'Fails if any package exports are missing.').conflicts('reset'),
12
+ reset: new Option('--reset', 'Ignore the previous generated config.').conflicts('check'),
13
+ check: new Option('--check', 'Fail if updates to the generated config are required.').conflicts('reset'),
13
14
  match: new Option('--match <match...>', 'Only evaluate specific package(s), optionally with a version: e.g. "foo", "@foo/*", "foo@1.2.3"')
14
15
  .conflicts('reset')
15
16
  .argParser(parseMatch),
@@ -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,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,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,sIAAsI;QACxI,OAAO,EAAE;YACP,aAAa,EAAE,aAAa,CAAC,aAAa,EAAE;YAC5C,KAAK,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,0DAA0D,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;YAC3G,KAAK,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,2CAA2C,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;YAC5F,KAAK,EAAE,IAAI,MAAM,CACf,oBAAoB,EACpB,iGAAiG,CAClG;iBACE,SAAS,CAAC,OAAO,CAAC;iBAClB,SAAS,CAAC,UAAU,CAAC;YACxB,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 { parseMatch } from '../../utilities/parseMatch.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 'Initializes a given app project and defines the necessary configuration overrides to make an existing app compatible with Cloudpack.',\n options: {\n logResolveMap: reusedOptions.logResolveMap(),\n reset: new Option('--reset', 'Ignores existing overrides when determining all entries.').conflicts('check'),\n check: new Option('--check', 'Fails if any package exports are missing.').conflicts('reset'),\n match: new Option(\n '--match <match...>',\n 'Only evaluate specific package(s), optionally with a version: e.g. \"foo\", \"@foo/*\", \"foo@1.2.3\"',\n )\n .conflicts('reset')\n .argParser(parseMatch),\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,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,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,IAAI,MAAM,CACf,oBAAoB,EACpB,iGAAiG,CAClG;iBACE,SAAS,CAAC,OAAO,CAAC;iBAClB,SAAS,CAAC,UAAU,CAAC;YACxB,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 { parseMatch } from '../../utilities/parseMatch.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: new Option(\n '--match <match...>',\n 'Only evaluate specific package(s), optionally with a version: e.g. \"foo\", \"@foo/*\", \"foo@1.2.3\"',\n )\n .conflicts('reset')\n .argParser(parseMatch),\n cache: reusedOptions.noCache(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
@@ -6,15 +6,15 @@ export interface InitOptions {
6
6
  /** Writes the resolve map to `resolve-map.json`. */
7
7
  logResolveMap?: boolean;
8
8
  /**
9
- * Whether to ignore existing overrides when determining all entries.
9
+ * Ignore the previous generated config.
10
10
  */
11
11
  reset?: boolean;
12
12
  /**
13
- * Whether to fail on missing exports.
13
+ * Fail if updates to the generated config are required.
14
14
  */
15
15
  check?: boolean;
16
16
  /**
17
- * If set, only evaluate matching packages.
17
+ * Only evaluate specific package(s).
18
18
  */
19
19
  match?: PackageSettingsMatch[];
20
20
  /** Whether to use the cache */
@@ -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 * Whether to ignore existing overrides when determining all entries.\n */\n reset?: boolean;\n\n /**\n * Whether to fail on missing exports.\n */\n check?: boolean;\n\n /**\n * If set, only evaluate matching packages.\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 { 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"]}
@@ -4,12 +4,16 @@ import { reusedOptions } from '../../utilities/reusedOptions.js';
4
4
  export const init = (program) => {
5
5
  program.addSubCommand({
6
6
  name: 'link',
7
- description: 'Links the package or packages found within the current folder from an existing Cloudpack start session.',
7
+ description: 'Links the package(s) found within the current folder to an existing cloudpack start session.',
8
8
  options: {
9
- ignore: new Option('--ignore [packages...]', 'Ignores the given packages when linking. This can be used to ignore packages that are part of the current repo but have issues being bundled.'),
10
- all: new Option('--all', 'If specified, will link all internal packages discovered within the linked repo graph.'),
11
- ignoreResolutions: new Option('--ignore-resolutions', 'If specified, ignores resolutions from the host repo definition to the linked packages.'),
12
- resolveStrategy: new Option('--resolve-strategy <strategy>', 'The strategy to use when resolving linked packages. Options are "dedupe" or "duplicate". Defaults to "dedupe".')
9
+ ignore: new Option('--ignore [packages...]', 'Ignore these packages when linking. This can be used for packages in the current repo ' +
10
+ 'that have issues being bundled.'),
11
+ all: new Option('--all', "Link all internal packages discovered within the linked repo's graph."),
12
+ ignoreResolutions: new Option('--ignore-resolutions', "Don't apply resolutions from the host repo's package.json to linked packages."),
13
+ resolveStrategy: new Option('--resolve-strategy <strategy>', 'Strategy to use when resolving linked packages.\n' +
14
+ '- "dedupe": Attempt to dedupe packages from the resolve map by removing all but the ' +
15
+ 'highest version that satisfies semver requirements from all parent entries.\n' +
16
+ `- "duplicate": Allow duplicates in the resolve map (don't bump dependencies).`)
13
17
  .choices(['dedupe', 'duplicate'])
14
18
  .default('dedupe'),
15
19
  logResolveMap: reusedOptions.logResolveMap(),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/link/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,yGAAyG;QAC3G,OAAO,EAAE;YACP,MAAM,EAAE,IAAI,MAAM,CAChB,wBAAwB,EACxB,+IAA+I,CAChJ;YACD,GAAG,EAAE,IAAI,MAAM,CACb,OAAO,EACP,wFAAwF,CACzF;YACD,iBAAiB,EAAE,IAAI,MAAM,CAC3B,sBAAsB,EACtB,yFAAyF,CAC1F;YACD,eAAe,EAAE,IAAI,MAAM,CACzB,+BAA+B,EAC/B,gHAAgH,CACjH;iBACE,OAAO,CAAC,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;iBAChC,OAAO,CAAC,QAAQ,CAAC;YACpB,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 { Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { LinkOptions } from './types/LinkOptions.js';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"link\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<LinkOptions>({\n name: 'link',\n description:\n 'Links the package or packages found within the current folder from an existing Cloudpack start session.',\n options: {\n ignore: new Option(\n '--ignore [packages...]',\n 'Ignores the given packages when linking. This can be used to ignore packages that are part of the current repo but have issues being bundled.',\n ),\n all: new Option(\n '--all',\n 'If specified, will link all internal packages discovered within the linked repo graph.',\n ),\n ignoreResolutions: new Option(\n '--ignore-resolutions',\n 'If specified, ignores resolutions from the host repo definition to the linked packages.',\n ),\n resolveStrategy: new Option(\n '--resolve-strategy <strategy>',\n 'The strategy to use when resolving linked packages. Options are \"dedupe\" or \"duplicate\". Defaults to \"dedupe\".',\n )\n .choices(['dedupe', 'duplicate'])\n .default('dedupe'),\n logResolveMap: reusedOptions.logResolveMap(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/link/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,EAAE,8FAA8F;QAC3G,OAAO,EAAE;YACP,MAAM,EAAE,IAAI,MAAM,CAChB,wBAAwB,EACxB,wFAAwF;gBACtF,iCAAiC,CACpC;YACD,GAAG,EAAE,IAAI,MAAM,CAAC,OAAO,EAAE,uEAAuE,CAAC;YACjG,iBAAiB,EAAE,IAAI,MAAM,CAC3B,sBAAsB,EACtB,+EAA+E,CAChF;YACD,eAAe,EAAE,IAAI,MAAM,CACzB,+BAA+B,EAC/B,mDAAmD;gBACjD,sFAAsF;gBACtF,+EAA+E;gBAC/E,+EAA+E,CAClF;iBACE,OAAO,CAAC,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;iBAChC,OAAO,CAAC,QAAQ,CAAC;YACpB,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 { Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { LinkOptions } from './types/LinkOptions.js';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"link\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<LinkOptions>({\n name: 'link',\n description: 'Links the package(s) found within the current folder to an existing cloudpack start session.',\n options: {\n ignore: new Option(\n '--ignore [packages...]',\n 'Ignore these packages when linking. This can be used for packages in the current repo ' +\n 'that have issues being bundled.',\n ),\n all: new Option('--all', \"Link all internal packages discovered within the linked repo's graph.\"),\n ignoreResolutions: new Option(\n '--ignore-resolutions',\n \"Don't apply resolutions from the host repo's package.json to linked packages.\",\n ),\n resolveStrategy: new Option(\n '--resolve-strategy <strategy>',\n 'Strategy to use when resolving linked packages.\\n' +\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' +\n `- \"duplicate\": Allow duplicates in the resolve map (don't bump dependencies).`,\n )\n .choices(['dedupe', 'duplicate'])\n .default('dedupe'),\n logResolveMap: reusedOptions.logResolveMap(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
@@ -1,15 +1,19 @@
1
1
  export interface LinkOptions {
2
- /** Ignores the given packages when linking. This can be used to ignore packages that are part of the current repo but have issues being bundled. */
2
+ /**
3
+ * Ignore these packages when linking.
4
+ * This can be used for packages in the current repo that have issues being bundled.
5
+ */
3
6
  ignore?: string[];
4
- /** If specified, will link all internal packages discovered within the linked repo graph. */
7
+ /** Link all internal packages discovered within the linked repo's graph. */
5
8
  all?: boolean;
6
- /** If specified, ignores resolutions from the host repo definition to the linked packages. */
9
+ /** Don't apply resolutions from the host repo's package.json to linked packages. */
7
10
  ignoreResolutions?: boolean;
8
- /** The strategy to use when resolving linked packages. Defaults to "dedupe".
9
- * - The "dedupe" strategy will attempt to remove duplicate packages from the resolve map
10
- * by removing all but the highest version that satisfies the semver requirements of all the parent entries.
11
- * - The "duplicate" strategy will not make any attempt to bump dependencies to the highest version, and will instead
12
- * duplicate the package in the resolve map.
11
+ /**
12
+ * Strategy to use when resolving linked packages.
13
+ * - `"dedupe"`: Attempt to dedupe packages from the resolve map by removing all but the
14
+ * highest version that satisfies semver requirements from all parent entries.
15
+ * - `"duplicate"`: Allow duplicates in the resolve map (don't bump dependencies).
16
+ * @default "dedupe"
13
17
  */
14
18
  resolveStrategy: 'dedupe' | 'duplicate';
15
19
  /** Writes the linked resolve map to `resolve-map-linked.json`. */
@@ -1 +1 @@
1
- {"version":3,"file":"LinkOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/link/types/LinkOptions.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,oJAAoJ;IACpJ,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,6FAA6F;IAC7F,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,8FAA8F;IAC9F,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,eAAe,EAAE,QAAQ,GAAG,WAAW,CAAC;IACxC,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,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 +1 @@
1
- {"version":3,"file":"LinkOptions.js","sourceRoot":"","sources":["../../../../src/commands/link/types/LinkOptions.ts"],"names":[],"mappings":"","sourcesContent":["export interface LinkOptions {\n /** Ignores the given packages when linking. This can be used to ignore packages that are part of the current repo but have issues being bundled. */\n ignore?: string[];\n /** If specified, will link all internal packages discovered within the linked repo graph. */\n all?: boolean;\n /** If specified, ignores resolutions from the host repo definition to the linked packages. */\n ignoreResolutions?: boolean;\n /** The strategy to use when resolving linked packages. Defaults to \"dedupe\".\n * - The \"dedupe\" strategy will attempt to remove duplicate packages from the resolve map\n * by removing all but the highest version that satisfies the semver requirements of all the parent entries.\n * - The \"duplicate\" strategy will not make any attempt to bump dependencies to the highest version, and will instead\n * duplicate the package in the resolve map.\n */\n resolveStrategy: 'dedupe' | 'duplicate';\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":["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"]}
@@ -2,6 +2,6 @@ import type { CommandAction } from '../../types/CommandAction.js';
2
2
  export interface SetupOptions {
3
3
  force?: boolean;
4
4
  }
5
- /** Executor for the "info non-semver-deps" verb */
5
+ /** Executor for the "setup" verb */
6
6
  export declare const execute: CommandAction<SetupOptions>;
7
7
  //# sourceMappingURL=execute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/setup/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,mDAAmD;AACnD,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,YAAY,CAe/C,CAAC"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/setup/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,oCAAoC;AACpC,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,YAAY,CAe/C,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { setup } from '@ms-cloudpack/setup-utilities';
2
- /** Executor for the "info non-semver-deps" verb */
2
+ /** Executor for the "setup" verb */
3
3
  export const execute = async (params) => {
4
4
  const { cwd, initialize, exit } = params;
5
5
  const { config } = await initialize({ appPath: cwd });
@@ -1 +1 @@
1
- {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/setup/execute.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAMtD,mDAAmD;AACnD,MAAM,CAAC,MAAM,OAAO,GAAgC,KAAK,EAAE,MAAM,EAAE,EAAE;IACnE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACzC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IACtD,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAClC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC;IAEpC,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;QACpB,MAAM,KAAK,CAAC;YACV,MAAM;YACN,uBAAuB,EAAE,KAAK,KAAK,IAAI;YACvC,GAAG;SACJ,CAAC,CAAC;IACL,CAAC;IAED,MAAM,IAAI,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["import type { CommandAction } from '../../types/CommandAction.js';\nimport { setup } from '@ms-cloudpack/setup-utilities';\n\nexport interface SetupOptions {\n force?: boolean;\n}\n\n/** Executor for the \"info non-semver-deps\" verb */\nexport const execute: CommandAction<SetupOptions> = async (params) => {\n const { cwd, initialize, exit } = params;\n const { config } = await initialize({ appPath: cwd });\n const { devServer = {} } = config;\n const { domain, https } = devServer;\n\n if (domain || https) {\n await setup({\n domain,\n shouldCreateCertificate: https === true,\n cwd,\n });\n }\n\n await exit({ message: 'Setup complete.' });\n};\n"]}
1
+ {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/setup/execute.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAMtD,oCAAoC;AACpC,MAAM,CAAC,MAAM,OAAO,GAAgC,KAAK,EAAE,MAAM,EAAE,EAAE;IACnE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACzC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IACtD,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAClC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC;IAEpC,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;QACpB,MAAM,KAAK,CAAC;YACV,MAAM;YACN,uBAAuB,EAAE,KAAK,KAAK,IAAI;YACvC,GAAG;SACJ,CAAC,CAAC;IACL,CAAC;IAED,MAAM,IAAI,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["import type { CommandAction } from '../../types/CommandAction.js';\nimport { setup } from '@ms-cloudpack/setup-utilities';\n\nexport interface SetupOptions {\n force?: boolean;\n}\n\n/** Executor for the \"setup\" verb */\nexport const execute: CommandAction<SetupOptions> = async (params) => {\n const { cwd, initialize, exit } = params;\n const { config } = await initialize({ appPath: cwd });\n const { devServer = {} } = config;\n const { domain, https } = devServer;\n\n if (domain || https) {\n await setup({\n domain,\n shouldCreateCertificate: https === true,\n cwd,\n });\n }\n\n await exit({ message: 'Setup complete.' });\n};\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { CommandInitFunction } from '../../types/CommandInitFunction.js';
2
- /** Defines the "info" verb. */
2
+ /** Defines the "setup" verb. */
3
3
  export declare const init: CommandInitFunction;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/setup/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,+BAA+B;AAC/B,eAAO,MAAM,IAAI,EAAE,mBAUlB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/setup/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAG9E,gCAAgC;AAChC,eAAO,MAAM,IAAI,EAAE,mBAYlB,CAAC"}
@@ -1,11 +1,12 @@
1
1
  import { Option } from 'commander';
2
- /** Defines the "info" verb. */
2
+ /** Defines the "setup" verb. */
3
3
  export const init = (program) => {
4
4
  program.addSubCommand({
5
5
  name: 'setup',
6
- description: 'Sets up cert and hosts file settings for the relevant inner loop domain and https preferences.',
6
+ description: 'Sets up cert and hosts file settings for the relevant inner loop domain and HTTPS options ' +
7
+ '(based on the devServer config).',
7
8
  options: {
8
- force: new Option('--force', 'Forces execution of setup steps.'),
9
+ force: new Option('--force', 'Force execution of setup steps.'),
9
10
  },
10
11
  hideSharedOptions: ['cachePath', 'features'],
11
12
  getExecutor: () => import('./execute.js'),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/setup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,+BAA+B;AAC/B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,aAAa,CAAC;QACpB,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,gGAAgG;QAC7G,OAAO,EAAE;YACP,KAAK,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,kCAAkC,CAAC;SACjE;QACD,iBAAiB,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC;QAC5C,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';\n\n/** Defines the \"info\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand({\n name: 'setup',\n description: 'Sets up cert and hosts file settings for the relevant inner loop domain and https preferences.',\n options: {\n force: new Option('--force', 'Forces execution of setup steps.'),\n },\n hideSharedOptions: ['cachePath', 'features'],\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/setup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC,gCAAgC;AAChC,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,aAAa,CAAe;QAClC,IAAI,EAAE,OAAO;QACb,WAAW,EACT,4FAA4F;YAC5F,kCAAkC;QACpC,OAAO,EAAE;YACP,KAAK,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,iCAAiC,CAAC;SAChE;QACD,iBAAiB,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC;QAC5C,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 { SetupOptions } from './execute.js';\n\n/** Defines the \"setup\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<SetupOptions>({\n name: 'setup',\n description:\n 'Sets up cert and hosts file settings for the relevant inner loop domain and HTTPS options ' +\n '(based on the devServer config).',\n options: {\n force: new Option('--force', 'Force execution of setup steps.'),\n },\n hideSharedOptions: ['cachePath', 'features'],\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/start/execute.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAKlE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI5D;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,YAAY,CAkJ/C,CAAC"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/start/execute.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAKlE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI5D;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,YAAY,CAgH/C,CAAC"}
@@ -50,40 +50,13 @@ export const execute = async (params) => {
50
50
  // Write the resolve map to disk.
51
51
  await writeJson(path.join(appPath, 'resolve-map.json'), session.resolveMap);
52
52
  }
53
- const domains = config.devServer?.domain
54
- ? Array.isArray(config.devServer.domain)
55
- ? config.devServer.domain
56
- : [config.devServer.domain]
57
- : [];
58
- const primaryDomain = domains[0];
59
- // If a cert is needed, check that it exists.
60
- if (config.devServer?.https === true && !(await getCertificate({ domain: config.devServer?.domain, cwd: appPath }))) {
61
- await exit({
62
- exitCode: 1,
63
- message: `The local site is configured to use https in cloudpack.config.json, but is missing a cert.\n\nRun "${cyan(bold('cloudpack setup'))}" to create the required certificate and try start again.\n`,
64
- });
65
- return;
66
- }
67
- const { createCloudpackServer } = await import('@ms-cloudpack/api-server');
68
- let apiServer;
69
53
  // Start api server for tracking status and handling remote requests.
70
- try {
71
- apiServer = await createCloudpackServer({ port: options.apiServerPort }, apiContext);
72
- }
73
- catch (err) {
74
- const error = err;
75
- if (error.code === 'EADDRNOTAVAIL' && config.devServer?.domain) {
76
- await exit({
77
- exitCode: 1,
78
- message: `The domain "${cyan(bold(primaryDomain))}" in cloudpack.config.json is not resolvable.\n\n` +
79
- `Run "${cyan(bold('cloudpack setup'))}" to add the appropriate entries to your hosts file and ` +
80
- `try start again.\n`,
81
- });
82
- return;
83
- }
84
- console.error('Error creating api server:', err);
85
- throw err;
54
+ const serverOrError = await createApiServer(options, apiContext);
55
+ if (typeof serverOrError === 'string') {
56
+ await exit({ exitCode: 1, message: serverOrError });
57
+ return;
86
58
  }
59
+ const apiServer = serverOrError;
87
60
  // Kick off bundling app package as soon as api server is ready.
88
61
  void ensurePackageBundled({
89
62
  input: { name: definition.name, version: definition.version },
@@ -130,5 +103,32 @@ export const execute = async (params) => {
130
103
  console.log('Please open the browser manually to:', defaultUrl);
131
104
  }
132
105
  };
106
+ /**
107
+ * Create the API server, or return an error message if the server could not be created.
108
+ */
109
+ async function createApiServer(options, apiContext) {
110
+ const { session } = apiContext;
111
+ const { config } = session;
112
+ const { devServer, appPath } = config;
113
+ // If a cert is needed, check that it exists.
114
+ if (devServer?.https === true && !(await getCertificate({ domain: devServer?.domain, cwd: appPath }))) {
115
+ return (`The local site is configured to use https in cloudpack.config.json, but is missing a cert.\n\n` +
116
+ `Run "${cyan(bold('cloudpack setup'))}" to create the required certificate and try start again.\n`);
117
+ }
118
+ const { createCloudpackServer } = await import('@ms-cloudpack/api-server');
119
+ try {
120
+ return await createCloudpackServer({ port: options.apiServerPort }, apiContext);
121
+ }
122
+ catch (err) {
123
+ const error = err;
124
+ if (error.code === 'EADDRNOTAVAIL' && devServer?.domain) {
125
+ const primaryDomain = (Array.isArray(devServer.domain) ? devServer.domain : [devServer.domain])[0];
126
+ return (`The domain "${cyan(bold(primaryDomain))}" in cloudpack.config.json is not resolvable.\n\n` +
127
+ `Run "${cyan(bold('cloudpack setup'))}" to add the appropriate entries to your hosts file and ` +
128
+ `try start again.\n`);
129
+ }
130
+ return `Error creating API server: ${err.stack || err}`;
131
+ }
132
+ }
133
133
  // cspell:ignore Prereqs
134
134
  //# sourceMappingURL=execute.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/start/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgC,KAAK,EAAE,MAAM,EAAE,EAAE;IACnE,MAAM,EAAE,OAAO,EAAE,G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CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QAC3B,WAAW,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACpC,sEAAsE;YACtE,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,CAAC,CAAC;YAC1D,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,UAAU,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,UAAU,CAAC,CAAC;IAClE,CAAC;AACH,CAAC,CAAC;AAEF,wBAAwB","sourcesContent":["import { createPartialApiContext, ensurePackageBundled } from '@ms-cloudpack/api-server';\nimport { writeJson } from '@ms-cloudpack/json-utilities';\nimport { isExternalPackage, resolve } from '@ms-cloudpack/package-utilities';\nimport { makeUrl } from '@ms-cloudpack/path-string-parsing';\nimport { cyan, yellow, bold } from '@ms-cloudpack/task-reporter';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { PerfMarkerCliEntry, PerfMeasurementOpenBrowser } from '../../performance/markers.js';\nimport type { CommandAction } from '../../types/CommandAction.js';\nimport { runPrerequisites } from '../../utilities/runPrerequisites.js';\nimport { getStartingAppPath } from './getStartingAppPath.js';\nimport { openBrowser } from './openBrowser.js';\nimport { trackSession } from './trackSession.js';\nimport type { StartOptions } from './types/StartOptions.js';\nimport { getCertificate } from '@ms-cloudpack/setup-utilities';\nimport { setStopServersFunction } from '../../utilities/stopServers.js';\n\n/**\n * Defines the \"start\" verb entry point.\n */\nexport const execute: CommandAction<StartOptions> = async (params) => {\n const { options, cwd, initialize, autoDispose, exit } = params;\n setStopServersFunction(exit);\n\n const appPath = await getStartingAppPath(cwd, options.app);\n const apiContextOptions = await initialize({ appPath, mode: options.mode });\n const { config, telemetryClient } = apiContextOptions;\n\n console.log('App path:', yellow(appPath));\n console.log('Bundle mode:', yellow(options.mode));\n\n runPrerequisites(apiContextOptions);\n\n const currentDir = path.dirname(fileURLToPath(import.meta.url));\n let overlayPath = await resolve('@ms-cloudpack/overlay', currentDir);\n\n // If overlay is an internal package, resolve the overlay from the current package's linked node modules\n // to \"externalize\" it, so that we always use the bundled version of the overlay instead of the source.\n if (overlayPath && !isExternalPackage(overlayPath)) {\n const cliPath = await resolve('@ms-cloudpack/cli', currentDir);\n overlayPath = cliPath ? path.join(cliPath, 'node_modules', '@ms-cloudpack/overlay') : undefined;\n }\n\n const [apiContext] = autoDispose(\n await createPartialApiContext({\n ...apiContextOptions,\n items: ['bus', 'watcher', 'taskRunner', 'packages', 'session', 'packageImportPaths', 'packageHashes'],\n overlayPath,\n }),\n );\n const { packages, session } = apiContext;\n\n // Increment the session version if caching is disabled.\n if (options.cache === false) {\n session.incrementSessionVersion();\n }\n\n // Make sure the package has a valid definition.\n const definition = await packages.get(appPath);\n\n // Set shared telemetry attributes which will be sent with all telemetry events.\n telemetryClient.setSharedSpanAttribute('sessionId', session.id);\n\n if (options.logResolveMap) {\n // Write the resolve map to disk.\n await writeJson(path.join(appPath, 'resolve-map.json'), session.resolveMap);\n }\n\n const domains = config.devServer?.domain\n ? Array.isArray(config.devServer.domain)\n ? config.devServer.domain\n : [config.devServer.domain]\n : [];\n const primaryDomain = domains[0];\n\n // If a cert is needed, check that it exists.\n if (config.devServer?.https === true && !(await getCertificate({ domain: config.devServer?.domain, cwd: appPath }))) {\n await exit({\n exitCode: 1,\n message: `The local site is configured to use https in cloudpack.config.json, but is missing a cert.\\n\\nRun \"${cyan(bold('cloudpack setup'))}\" to create the required certificate and try start again.\\n`,\n });\n return;\n }\n\n const { createCloudpackServer } = await import('@ms-cloudpack/api-server');\n let apiServer: Awaited<ReturnType<typeof createCloudpackServer>> | undefined;\n\n // Start api server for tracking status and handling remote requests.\n try {\n apiServer = await createCloudpackServer({ port: options.apiServerPort }, apiContext);\n } catch (err) {\n const error = err as { code: string };\n\n if (error.code === 'EADDRNOTAVAIL' && config.devServer?.domain) {\n await exit({\n exitCode: 1,\n message:\n `The domain \"${cyan(bold(primaryDomain))}\" in cloudpack.config.json is not resolvable.\\n\\n` +\n `Run \"${cyan(bold('cloudpack setup'))}\" to add the appropriate entries to your hosts file and ` +\n `try start again.\\n`,\n });\n\n return;\n }\n\n console.error('Error creating api server:', err);\n\n throw err;\n }\n\n // Kick off bundling app package as soon as api server is ready.\n void ensurePackageBundled({\n input: { name: definition.name, version: definition.version },\n ctx: apiContext,\n });\n\n // Then start bundle and app servers for hosting the app.\n const { startServers } = await import('@ms-cloudpack/app-server');\n const servers = await startServers(\n {\n definition,\n bundleServerOptions: { disableCache: !options.cache, port: options.bundleServerPort },\n port: options.appServerPort,\n },\n apiContext,\n );\n\n // Save the session to active sessions.\n const sessionTracker = await trackSession(session);\n\n const cleanup = async () => {\n // Stop tracking the session.\n await sessionTracker.close();\n\n await Promise.all(\n Object.entries({ apiServer, ...servers }).map(async ([name, server]) => {\n if (!server) return;\n\n const desc = `${name} (${server.url})`;\n console.info(`Closing ${desc}`);\n try {\n await server.close();\n console.info(`Closed ${desc}`);\n } catch (err) {\n console.warn(`Error closing ${desc}:`, err);\n }\n }),\n );\n };\n\n autoDispose({ dispose: cleanup });\n\n const defaultUrl = makeUrl(config.devServer?.defaultPath || '', session.urls.appServer).href;\n\n performance.measure(PerfMeasurementOpenBrowser, PerfMarkerCliEntry);\n\n // Open the browser.\n if (options.open !== false) {\n openBrowser(defaultUrl).catch((err) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n console.warn('Error opening browser:', err?.stack || err);\n console.warn('Please open the browser manually to:', defaultUrl);\n });\n } else {\n console.log('Please open the browser manually to:', defaultUrl);\n }\n};\n\n// cspell:ignore Prereqs\n"]}
1
+ {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/start/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAgC,MAAM,0BAA0B,CAAC;AACvH,O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,iBAAiB,CAAC,CAAC,0DAA0D;gBAC/F,oBAAoB,CACrB,CAAC;QACJ,CAAC;QAED,OAAO,8BAA+B,GAAa,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC;IACrE,CAAC;AACH,CAAC;AAED,wBAAwB","sourcesContent":["import { createPartialApiContext, ensurePackageBundled, type ApiServer, type Context } from '@ms-cloudpack/api-server';\nimport { writeJson } from '@ms-cloudpack/json-utilities';\nimport { isExternalPackage, resolve } from '@ms-cloudpack/package-utilities';\nimport { makeUrl } from '@ms-cloudpack/path-string-parsing';\nimport { cyan, yellow, bold } from '@ms-cloudpack/task-reporter';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { PerfMarkerCliEntry, PerfMeasurementOpenBrowser } from '../../performance/markers.js';\nimport type { CommandAction } from '../../types/CommandAction.js';\nimport { runPrerequisites } from '../../utilities/runPrerequisites.js';\nimport { getStartingAppPath } from './getStartingAppPath.js';\nimport { openBrowser } from './openBrowser.js';\nimport { trackSession } from './trackSession.js';\nimport type { StartOptions } from './types/StartOptions.js';\nimport { getCertificate } from '@ms-cloudpack/setup-utilities';\nimport { setStopServersFunction } from '../../utilities/stopServers.js';\n\n/**\n * Defines the \"start\" verb entry point.\n */\nexport const execute: CommandAction<StartOptions> = async (params) => {\n const { options, cwd, initialize, autoDispose, exit } = params;\n setStopServersFunction(exit);\n\n const appPath = await getStartingAppPath(cwd, options.app);\n const apiContextOptions = await initialize({ appPath, mode: options.mode });\n const { config, telemetryClient } = apiContextOptions;\n\n console.log('App path:', yellow(appPath));\n console.log('Bundle mode:', yellow(options.mode));\n\n runPrerequisites(apiContextOptions);\n\n const currentDir = path.dirname(fileURLToPath(import.meta.url));\n let overlayPath = await resolve('@ms-cloudpack/overlay', currentDir);\n\n // If overlay is an internal package, resolve the overlay from the current package's linked node modules\n // to \"externalize\" it, so that we always use the bundled version of the overlay instead of the source.\n if (overlayPath && !isExternalPackage(overlayPath)) {\n const cliPath = await resolve('@ms-cloudpack/cli', currentDir);\n overlayPath = cliPath ? path.join(cliPath, 'node_modules', '@ms-cloudpack/overlay') : undefined;\n }\n\n const [apiContext] = autoDispose(\n await createPartialApiContext({\n ...apiContextOptions,\n items: ['bus', 'watcher', 'taskRunner', 'packages', 'session', 'packageImportPaths', 'packageHashes'],\n overlayPath,\n }),\n );\n const { packages, session } = apiContext;\n\n // Increment the session version if caching is disabled.\n if (options.cache === false) {\n session.incrementSessionVersion();\n }\n\n // Make sure the package has a valid definition.\n const definition = await packages.get(appPath);\n\n // Set shared telemetry attributes which will be sent with all telemetry events.\n telemetryClient.setSharedSpanAttribute('sessionId', session.id);\n\n if (options.logResolveMap) {\n // Write the resolve map to disk.\n await writeJson(path.join(appPath, 'resolve-map.json'), session.resolveMap);\n }\n\n // Start api server for tracking status and handling remote requests.\n const serverOrError = await createApiServer(options, apiContext);\n if (typeof serverOrError === 'string') {\n await exit({ exitCode: 1, message: serverOrError });\n return;\n }\n const apiServer = serverOrError;\n\n // Kick off bundling app package as soon as api server is ready.\n void ensurePackageBundled({\n input: { name: definition.name, version: definition.version },\n ctx: apiContext,\n });\n\n // Then start bundle and app servers for hosting the app.\n const { startServers } = await import('@ms-cloudpack/app-server');\n const servers = await startServers(\n {\n definition,\n bundleServerOptions: { disableCache: !options.cache, port: options.bundleServerPort },\n port: options.appServerPort,\n },\n apiContext,\n );\n\n // Save the session to active sessions.\n const sessionTracker = await trackSession(session);\n\n const cleanup = async () => {\n // Stop tracking the session.\n await sessionTracker.close();\n\n await Promise.all(\n Object.entries({ apiServer, ...servers }).map(async ([name, server]) => {\n if (!server) return;\n\n const desc = `${name} (${server.url})`;\n console.info(`Closing ${desc}`);\n try {\n await server.close();\n console.info(`Closed ${desc}`);\n } catch (err) {\n console.warn(`Error closing ${desc}:`, err);\n }\n }),\n );\n };\n\n autoDispose({ dispose: cleanup });\n\n const defaultUrl = makeUrl(config.devServer?.defaultPath || '', session.urls.appServer).href;\n\n performance.measure(PerfMeasurementOpenBrowser, PerfMarkerCliEntry);\n\n // Open the browser.\n if (options.open !== false) {\n openBrowser(defaultUrl).catch((err) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n console.warn('Error opening browser:', err?.stack || err);\n console.warn('Please open the browser manually to:', defaultUrl);\n });\n } else {\n console.log('Please open the browser manually to:', defaultUrl);\n }\n};\n\n/**\n * Create the API server, or return an error message if the server could not be created.\n */\nasync function createApiServer(options: StartOptions, apiContext: Context): Promise<ApiServer | string> {\n const { session } = apiContext;\n const { config } = session;\n const { devServer, appPath } = config;\n\n // If a cert is needed, check that it exists.\n if (devServer?.https === true && !(await getCertificate({ domain: devServer?.domain, cwd: appPath }))) {\n return (\n `The local site is configured to use https in cloudpack.config.json, but is missing a cert.\\n\\n` +\n `Run \"${cyan(bold('cloudpack setup'))}\" to create the required certificate and try start again.\\n`\n );\n }\n\n const { createCloudpackServer } = await import('@ms-cloudpack/api-server');\n\n try {\n return await createCloudpackServer({ port: options.apiServerPort }, apiContext);\n } catch (err) {\n const error = err as { code: string };\n\n if (error.code === 'EADDRNOTAVAIL' && devServer?.domain) {\n const primaryDomain = (Array.isArray(devServer.domain) ? devServer.domain : [devServer.domain])[0];\n\n return (\n `The domain \"${cyan(bold(primaryDomain))}\" in cloudpack.config.json is not resolvable.\\n\\n` +\n `Run \"${cyan(bold('cloudpack setup'))}\" to add the appropriate entries to your hosts file and ` +\n `try start again.\\n`\n );\n }\n\n return `Error creating API server: ${(err as Error).stack || err}`;\n }\n}\n\n// cspell:ignore Prereqs\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;AAM9E,gCAAgC;AAChC,eAAO,MAAM,IAAI,EAAE,mBAkBlB,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,mBAmBlB,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { InvalidArgumentError, Option } from 'commander';
2
- import { parseBundleMode } from '../../utilities/parseBundleMode.js';
3
2
  import { portNumbers } from 'get-port';
4
3
  import { reusedOptions } from '../../utilities/reusedOptions.js';
5
4
  /** Defines the "start" verb. */
@@ -8,13 +7,11 @@ export const init = (program) => {
8
7
  name: 'start',
9
8
  description: 'Starts a web inner-loop from the current package folder.',
10
9
  options: {
11
- mode: new Option('--mode <mode>', 'The mode to run the app in. (library | development | production)')
12
- .argParser(parseBundleMode)
13
- .default('library'),
14
- logResolveMap: reusedOptions.logResolveMap(),
15
- app: new Option('--app <appPackageName>', 'Run Cloudpack targeting a specific app.'),
10
+ mode: reusedOptions.mode({ action: 'run' }),
11
+ app: new Option('--app <appPackageName>', 'Run Cloudpack targeting a specific app (only needed if running init at a higher level in the repo).'),
16
12
  open: new Option('--no-open', 'Do not open the browser.'),
17
13
  cache: reusedOptions.noCache(),
14
+ logResolveMap: reusedOptions.logResolveMap(),
18
15
  apiServerPort: getPortOption('--api-server-port <port>', 'API'),
19
16
  appServerPort: getPortOption('--app-server-port <port>', 'app'),
20
17
  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,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,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,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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 { parseBundleMode } from '../../utilities/parseBundleMode.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: new Option('--mode <mode>', 'The mode to run the app in. (library | development | production)')\n .argParser(parseBundleMode)\n .default('library'),\n logResolveMap: reusedOptions.logResolveMap(),\n app: new Option('--app <appPackageName>', 'Run Cloudpack targeting a specific app.'),\n open: new Option('--no-open', 'Do not open the browser.'),\n cache: reusedOptions.noCache(),\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 },\n getExecutor: () => import('./execute.js'),\n });\n};\n\nfunction getPortOption(flags: string, name: string) {\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) {\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,OAAO,EAAE;YAC9B,aAAa,EAAE,aAAa,CAAC,aAAa,EAAE;YAC5C,aAAa,EAAE,aAAa,CAAC,0BAA0B,EAAE,KAAK,CAAC;YAC/D,aAAa,EAAE,aAAa,CAAC,0BAA0B,EAAE,KAAK,CAAC;YAC/D,gBAAgB,EAAE,aAAa,CAAC,6BAA6B,EAAE,QAAQ,CAAC;SACzE;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,SAAS,aAAa,CAAC,KAAa,EAAE,IAAY;IAChD,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,uBAAuB,IAAI,wDAAwD,CAAC;SAC1G,SAAS,CAAC,UAAU,CAAC;SACrB,QAAQ,EAAE,CAAC;AAChB,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,oBAAoB,CAAC,wBAAwB,KAAK,GAAG,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,CAAC,GAAG,WAAW,CAAC,WAAW,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 },\n getExecutor: () => import('./execute.js'),\n });\n};\n\nfunction getPortOption(flags: string, name: string) {\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) {\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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAiB9E,+BAA+B;AAC/B,eAAO,MAAM,IAAI,EAAE,mBAgBlB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAiB9E,+BAA+B;AAC/B,eAAO,MAAM,IAAI,EAAE,mBAclB,CAAC"}
@@ -14,12 +14,13 @@ function getDefaultLogin() {
14
14
  export const init = (program) => {
15
15
  program.addSubCommand({
16
16
  name: 'sync',
17
- description: 'Syncs the packages from/to the remote cache. If the package is not in the local cache, it will be downloaded.',
17
+ description: 'Syncs packages from/to the remote cache. ' +
18
+ 'By default (without --upload) it will download any packages not found in the local cache.',
18
19
  options: {
19
- upload: new Option('--upload', 'Uploads the packages to the remote cache.'),
20
- login: new Option('--login <method>', 'The way to authenticate against remote cache')
20
+ upload: new Option('--upload', 'Upload packages to the remote cache (instead of downloading).'),
21
+ login: new Option('--login <method>', 'How to authenticate against the remote cache.')
21
22
  .choices(['interactive', 'azure-cli', 'device-code'])
22
- .default(getDefaultLogin(), 'Default login method is azure-cli in CI, device-code in Github Codespaces and interactive otherwise.'),
23
+ .default(getDefaultLogin(), '"azure-cli" in CI, "device-code" in Github Codespaces, "interactive" otherwise'),
23
24
  },
24
25
  getExecutor: () => import('./execute.js'),
25
26
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,SAAS,eAAe;IACtB,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,IAAI,YAAY,EAAE,EAAE,CAAC;QACnB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,+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,+GAA+G;QACjH,OAAO,EAAE;YACP,MAAM,EAAE,IAAI,MAAM,CAAC,UAAU,EAAE,2CAA2C,CAAC;YAC3E,KAAK,EAAE,IAAI,MAAM,CAAC,kBAAkB,EAAE,8CAA8C,CAAC;iBAClF,OAAO,CAAC,CAAC,aAAa,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;iBACpD,OAAO,CACN,eAAe,EAAE,EACjB,sGAAsG,CACvG;SACJ;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 { SyncOptions } from './types/SyncOptions.js';\nimport { isCIBuild } from '../../utilities/isCIBuild.js';\nimport { isCodespaces } from '../../utilities/isCodespaces.js';\n\nfunction getDefaultLogin() {\n if (isCIBuild()) {\n return 'azure-cli';\n }\n\n if (isCodespaces()) {\n return 'device-code';\n }\n\n return 'interactive';\n}\n\n/** Defines the \"sync\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<SyncOptions>({\n name: 'sync',\n description:\n 'Syncs the packages from/to the remote cache. If the package is not in the local cache, it will be downloaded.',\n options: {\n upload: new Option('--upload', 'Uploads the packages to the remote cache.'),\n login: new Option('--login <method>', 'The way to authenticate against remote cache')\n .choices(['interactive', 'azure-cli', 'device-code'])\n .default(\n getDefaultLogin(),\n 'Default login method is azure-cli in CI, device-code in Github Codespaces and interactive otherwise.',\n ),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,SAAS,eAAe;IACtB,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,IAAI,YAAY,EAAE,EAAE,CAAC;QACnB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,+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,2CAA2C;YAC3C,2FAA2F;QAC7F,OAAO,EAAE;YACP,MAAM,EAAE,IAAI,MAAM,CAAC,UAAU,EAAE,+DAA+D,CAAC;YAC/F,KAAK,EAAE,IAAI,MAAM,CAAC,kBAAkB,EAAE,+CAA+C,CAAC;iBACnF,OAAO,CAAC,CAAC,aAAa,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;iBACpD,OAAO,CAAC,eAAe,EAAE,EAAE,gFAAgF,CAAC;SAChH;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 { SyncOptions } from './types/SyncOptions.js';\nimport { isCIBuild } from '../../utilities/isCIBuild.js';\nimport { isCodespaces } from '../../utilities/isCodespaces.js';\n\nfunction getDefaultLogin() {\n if (isCIBuild()) {\n return 'azure-cli';\n }\n\n if (isCodespaces()) {\n return 'device-code';\n }\n\n return 'interactive';\n}\n\n/** Defines the \"sync\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<SyncOptions>({\n name: 'sync',\n description:\n 'Syncs packages from/to the remote cache. ' +\n 'By default (without --upload) it will download any packages not found in the local cache.',\n options: {\n upload: new Option('--upload', 'Upload packages to the remote cache (instead of downloading).'),\n login: 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 },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/unlink/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAI9E,iCAAiC;AACjC,eAAO,MAAM,IAAI,EAAE,mBAUlB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/unlink/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAI9E,iCAAiC;AACjC,eAAO,MAAM,IAAI,EAAE,mBASlB,CAAC"}
@@ -3,7 +3,7 @@ import { reusedOptions } from '../../utilities/reusedOptions.js';
3
3
  export const init = (program) => {
4
4
  program.addSubCommand({
5
5
  name: 'unlink',
6
- description: 'Unlinks the package or packages found within the current folder from an existing Cloudpack start session.',
6
+ description: 'Unlinks the package(s) found within the current folder from a cloudpack start session.',
7
7
  options: {
8
8
  logResolveMap: reusedOptions.logResolveMap(),
9
9
  },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/unlink/index.ts"],"names":[],"mappings":"AAEA,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,EACT,2GAA2G;QAC7G,OAAO,EAAE;YACP,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 type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { UnlinkOptions } from './types/UnlinkOptions.js';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"unlink\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<UnlinkOptions>({\n name: 'unlink',\n description:\n 'Unlinks the package or packages found within the current folder from an existing Cloudpack start session.',\n options: {\n logResolveMap: reusedOptions.logResolveMap(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/unlink/index.ts"],"names":[],"mappings":"AAEA,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,wFAAwF;QACrG,OAAO,EAAE;YACP,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 type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { UnlinkOptions } from './types/UnlinkOptions.js';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"unlink\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<UnlinkOptions>({\n name: 'unlink',\n description: 'Unlinks the package(s) found within the current folder from a cloudpack start session.',\n options: {\n logResolveMap: reusedOptions.logResolveMap(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
@@ -5,5 +5,8 @@ import { Option } from 'commander';
5
5
  export declare const reusedOptions: {
6
6
  logResolveMap: () => Option;
7
7
  noCache: () => Option;
8
+ mode: (options: {
9
+ action: "bundle" | "run";
10
+ }) => Option;
8
11
  };
9
12
  //# sourceMappingURL=reusedOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reusedOptions.d.ts","sourceRoot":"","sources":["../../src/utilities/reusedOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,aAAa;;;CAIzB,CAAC"}
1
+ {"version":3,"file":"reusedOptions.d.ts","sourceRoot":"","sources":["../../src/utilities/reusedOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,MAAM,EAAE,MAAM,WAAW,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,aAAa;;;oBAGR;QAAE,MAAM,EAAE,QAAQ,GAAG,KAAK,CAAA;KAAE;CAO7C,CAAC"}
@@ -1,9 +1,28 @@
1
- import { Option } from 'commander';
1
+ import { InvalidArgumentError, Option } from 'commander';
2
2
  /**
3
3
  * These options are used by multiple commands, but should be manually added.
4
4
  */
5
5
  export const reusedOptions = {
6
- logResolveMap: () => new Option('--log-resolve-map', 'Logs the resolve map to "resolve-map.json" for diagnostics.'),
7
- noCache: () => new Option('--no-cache', 'Ensures Cloudpack rebuilds all packages, rather than utilizing cached assets.'),
6
+ logResolveMap: () => new Option('--log-resolve-map', 'Log the resolve map to "resolve-map.json" for diagnostics.'),
7
+ noCache: () => new Option('--no-cache', 'Rebuild all packages, rather than using cached assets.'),
8
+ mode: (options) => new Option('--mode <mode>', `The mode to ${options.action === 'bundle' ? 'bundle the package' : 'run the app'} in. (library | production)`)
9
+ .argParser(parseBundleMode)
10
+ .default('library'),
8
11
  };
12
+ /** Parse the session mode based on user input (e.g. --mode argument in start.) */
13
+ function parseBundleMode(mode) {
14
+ switch (mode.toLowerCase()) {
15
+ case 'lib':
16
+ case 'library':
17
+ return 'library';
18
+ case 'dev':
19
+ case 'development':
20
+ return 'development';
21
+ case 'prod':
22
+ case 'production':
23
+ return 'production';
24
+ default:
25
+ throw new InvalidArgumentError(`Valid options are 'lib', 'dev', or 'prod'.`);
26
+ }
27
+ }
9
28
  //# sourceMappingURL=reusedOptions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reusedOptions.js","sourceRoot":"","sources":["../../src/utilities/reusedOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,mBAAmB,EAAE,6DAA6D,CAAC;IACnH,OAAO,EAAE,GAAG,EAAE,CACZ,IAAI,MAAM,CAAC,YAAY,EAAE,+EAA+E,CAAC;CAC5G,CAAC","sourcesContent":["import { Option } from 'commander';\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', 'Logs the resolve map to \"resolve-map.json\" for diagnostics.'),\n noCache: () =>\n new Option('--no-cache', 'Ensures Cloudpack rebuilds all packages, rather than utilizing cached assets.'),\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;AAEzD;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,mBAAmB,EAAE,4DAA4D,CAAC;IAClH,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,YAAY,EAAE,wDAAwD,CAAC;IACjG,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;CACxB,CAAC;AAEF,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","sourcesContent":["import type { BundleMode } from '@ms-cloudpack/common-types';\nimport { InvalidArgumentError, Option } from 'commander';\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 noCache: () => new Option('--no-cache', 'Rebuild all packages, rather than using cached assets.'),\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};\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/cli",
3
- "version": "0.70.0",
3
+ "version": "0.70.2",
4
4
  "description": "The Cloudpack command line interface - a tool for managing fast inner and outer looping in web apps.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -10,18 +10,18 @@
10
10
  "cloudpack": "./bin/cloudpack.js"
11
11
  },
12
12
  "dependencies": {
13
- "@ms-cloudpack/api-server": "^0.52.1",
14
- "@ms-cloudpack/app-server": "^0.15.16",
15
- "@ms-cloudpack/common-types": "^0.19.7",
16
- "@ms-cloudpack/config": "^0.29.1",
13
+ "@ms-cloudpack/api-server": "^0.52.3",
14
+ "@ms-cloudpack/app-server": "^0.15.18",
15
+ "@ms-cloudpack/common-types": "^0.20.0",
16
+ "@ms-cloudpack/config": "^0.29.2",
17
17
  "@ms-cloudpack/feature-flags": "^0.1.1",
18
18
  "@ms-cloudpack/json-utilities": "^0.1.7",
19
- "@ms-cloudpack/overlay": "^0.17.69",
20
- "@ms-cloudpack/package-utilities": "^10.1.1",
19
+ "@ms-cloudpack/overlay": "^0.17.71",
20
+ "@ms-cloudpack/package-utilities": "^10.1.2",
21
21
  "@ms-cloudpack/path-string-parsing": "^1.2.4",
22
- "@ms-cloudpack/path-utilities": "^2.7.44",
23
- "@ms-cloudpack/remote-cache": "^0.8.10",
24
- "@ms-cloudpack/setup-utilities": "^0.4.0",
22
+ "@ms-cloudpack/path-utilities": "^2.7.45",
23
+ "@ms-cloudpack/remote-cache": "^0.8.11",
24
+ "@ms-cloudpack/setup-utilities": "^0.4.1",
25
25
  "@ms-cloudpack/task-reporter": "^0.14.5",
26
26
  "@ms-cloudpack/telemetry": "^0.6.2",
27
27
  "@yarnpkg/lockfile": "^1.1.0",
@@ -36,7 +36,7 @@
36
36
  "workspace-tools": "^0.36.4"
37
37
  },
38
38
  "devDependencies": {
39
- "@ms-cloudpack/common-types": "^0.19.7",
39
+ "@ms-cloudpack/common-types": "^0.20.0",
40
40
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
41
41
  "@ms-cloudpack/scripts": "^0.0.1",
42
42
  "@ms-cloudpack/test-utilities": "^0.5.0",
@@ -1,4 +0,0 @@
1
- import type { BundleMode } from '@ms-cloudpack/common-types';
2
- /** Parse the session mode based on user input (e.g. --mode argument in start.) */
3
- export declare function parseBundleMode(mode: string): BundleMode;
4
- //# sourceMappingURL=parseBundleMode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseBundleMode.d.ts","sourceRoot":"","sources":["../../src/utilities/parseBundleMode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAcxD"}
@@ -1,18 +0,0 @@
1
- import { InvalidArgumentError } from 'commander';
2
- /** Parse the session mode based on user input (e.g. --mode argument in start.) */
3
- export function parseBundleMode(mode) {
4
- switch (mode.toLowerCase()) {
5
- case 'lib':
6
- case 'library':
7
- return 'library';
8
- case 'dev':
9
- case 'development':
10
- return 'development';
11
- case 'prod':
12
- case 'production':
13
- return 'production';
14
- default:
15
- throw new InvalidArgumentError(`Valid options are 'lib', 'dev', or 'prod'.`);
16
- }
17
- }
18
- //# sourceMappingURL=parseBundleMode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseBundleMode.js","sourceRoot":"","sources":["../../src/utilities/parseBundleMode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,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","sourcesContent":["import type { BundleMode } from '@ms-cloudpack/common-types';\nimport { InvalidArgumentError } from 'commander';\n\n/** Parse the session mode based on user input (e.g. --mode argument in start.) */\nexport function 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"]}