@ms-cloudpack/cli 0.55.0 → 0.55.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cloudpack.js +0 -1
- package/lib/commands/bundle/execute.js +3 -3
- package/lib/commands/bundle/execute.js.map +1 -1
- package/lib/commands/bundle/index.d.ts.map +1 -1
- package/lib/commands/bundle/index.js +1 -3
- package/lib/commands/bundle/index.js.map +1 -1
- package/lib/commands/cache/clean.d.ts.map +1 -1
- package/lib/commands/cache/clean.js +2 -2
- package/lib/commands/cache/clean.js.map +1 -1
- package/lib/commands/cache/index.d.ts.map +1 -1
- package/lib/commands/cache/index.js +4 -7
- package/lib/commands/cache/index.js.map +1 -1
- package/lib/commands/info/index.d.ts.map +1 -1
- package/lib/commands/info/index.js +5 -9
- package/lib/commands/info/index.js.map +1 -1
- package/lib/commands/info/lockFile/execute.js +2 -2
- package/lib/commands/info/lockFile/execute.js.map +1 -1
- package/lib/commands/info/nonSemverDeps/execute.js +3 -3
- package/lib/commands/info/nonSemverDeps/execute.js.map +1 -1
- package/lib/commands/info/nonSemverDeps/getNonSemverDeps.d.ts +1 -1
- package/lib/commands/info/nonSemverDeps/getNonSemverDeps.d.ts.map +1 -1
- package/lib/commands/info/nonSemverDeps/getNonSemverDeps.js.map +1 -1
- package/lib/commands/init/execute.js +2 -2
- package/lib/commands/init/execute.js.map +1 -1
- package/lib/commands/init/index.d.ts.map +1 -1
- package/lib/commands/init/index.js +1 -3
- package/lib/commands/init/index.js.map +1 -1
- package/lib/commands/start/execute.d.ts.map +1 -1
- package/lib/commands/start/execute.js +8 -10
- package/lib/commands/start/execute.js.map +1 -1
- package/lib/commands/start/index.d.ts.map +1 -1
- package/lib/commands/start/index.js +1 -3
- package/lib/commands/start/index.js.map +1 -1
- package/lib/commands/sync/execute.d.ts.map +1 -1
- package/lib/commands/sync/execute.js +3 -2
- package/lib/commands/sync/execute.js.map +1 -1
- package/lib/commands/sync/index.d.ts.map +1 -1
- package/lib/commands/sync/index.js +1 -3
- package/lib/commands/sync/index.js.map +1 -1
- package/lib/common/CloudpackCommand.d.ts +59 -0
- package/lib/common/CloudpackCommand.d.ts.map +1 -0
- package/lib/common/CloudpackCommand.js +93 -0
- package/lib/common/CloudpackCommand.js.map +1 -0
- package/lib/common/CommandExecutor.d.ts +40 -0
- package/lib/common/CommandExecutor.d.ts.map +1 -0
- package/lib/common/CommandExecutor.js +163 -0
- package/lib/common/CommandExecutor.js.map +1 -0
- package/lib/index.d.ts +9 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +19 -15
- package/lib/index.js.map +1 -1
- package/lib/types/CommandAction.d.ts +9 -4
- package/lib/types/CommandAction.d.ts.map +1 -1
- package/lib/types/CommandAction.js.map +1 -1
- package/lib/types/CommandInitFunction.d.ts +2 -2
- package/lib/types/CommandInitFunction.d.ts.map +1 -1
- package/lib/types/CommandInitFunction.js.map +1 -1
- package/lib/types/ProgramOptions.d.ts +17 -0
- package/lib/types/ProgramOptions.d.ts.map +1 -0
- package/lib/types/ProgramOptions.js +2 -0
- package/lib/types/ProgramOptions.js.map +1 -0
- package/lib/types/SharedOptions.d.ts +1 -6
- package/lib/types/SharedOptions.d.ts.map +1 -1
- package/lib/types/SharedOptions.js.map +1 -1
- package/package.json +5 -5
- package/lib/common/createCommand.d.ts +0 -29
- package/lib/common/createCommand.d.ts.map +0 -1
- package/lib/common/createCommand.js +0 -42
- package/lib/common/createCommand.js.map +0 -1
- package/lib/common/createCommandActionFunction.d.ts +0 -9
- package/lib/common/createCommandActionFunction.d.ts.map +0 -1
- package/lib/common/createCommandActionFunction.js +0 -72
- package/lib/common/createCommandActionFunction.js.map +0 -1
- package/lib/common/createExitFunction.d.ts +0 -13
- package/lib/common/createExitFunction.d.ts.map +0 -1
- package/lib/common/createExitFunction.js +0 -26
- package/lib/common/createExitFunction.js.map +0 -1
- package/lib/common/createInitializeFunction.d.ts +0 -19
- package/lib/common/createInitializeFunction.d.ts.map +0 -1
- package/lib/common/createInitializeFunction.js +0 -52
- package/lib/common/createInitializeFunction.js.map +0 -1
- package/lib/initTelemetry.d.ts +0 -17
- package/lib/initTelemetry.d.ts.map +0 -1
- package/lib/initTelemetry.js +0 -34
- package/lib/initTelemetry.js.map +0 -1
- package/lib/setupReporting.d.ts +0 -13
- package/lib/setupReporting.d.ts.map +0 -1
- package/lib/setupReporting.js +0 -45
- package/lib/setupReporting.js.map +0 -1
- package/lib/types/CommandContext.d.ts +0 -11
- package/lib/types/CommandContext.d.ts.map +0 -1
- package/lib/types/CommandContext.js +0 -2
- package/lib/types/CommandContext.js.map +0 -1
package/bin/cloudpack.js
CHANGED
|
@@ -2,9 +2,9 @@ import { findResolveMapEntry } from '@ms-cloudpack/package-utilities';
|
|
|
2
2
|
import { createPartialApiContext, ensurePackageBundled } from '@ms-cloudpack/api-server/apis';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { bulletedList, formatPackageName } from '@ms-cloudpack/task-reporter';
|
|
5
|
-
export const execute = async (
|
|
6
|
-
const { cwd,
|
|
7
|
-
const
|
|
5
|
+
export const execute = async (params) => {
|
|
6
|
+
const { cwd: appPath, options, reporter, initialize, exit, autoDispose } = params;
|
|
7
|
+
const { package: packageArg } = options;
|
|
8
8
|
const { config, telemetryClient } = await initialize({
|
|
9
9
|
appPath,
|
|
10
10
|
overrideOptions: { debug: !process.env.JEST_WORKER_ID },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/bundle/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC9F,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAE9E,MAAM,CAAC,MAAM,OAAO,GAA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AM,IAAI,CAAC;gBACT,OAAO,EAAE,YAAY,UAAU,sBAAsB;gBACrD,QAAQ,EAAE,CAAC;aACZ,CAAC,CAAC;YAEH,OAAO;QACT,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACvD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,oBAAoB,CAAC;QAC5C,KAAK,EAAE;YACL,IAAI,EAAE,UAAU,EAAE,IAAI,IAAI,WAAW;YACrC,OAAO,EAAE,UAAU,EAAE,OAAO,IAAI,OAAO;YACvC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;YAC7C,WAAW;YACX,iBAAiB;YACjB,WAAW,EAAE,IAAI;YACjB,aAAa,EAAE,KAAK;SACrB;QACD,GAAG;KACJ,CAAC,CAAC;IACH,MAAM,IAAI,CAAC;QACT,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { findResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport type { CommandAction } from '../../types/CommandAction.js';\nimport type { BundleOptions } from './types/BundleOptions.js';\nimport { createPartialApiContext, ensurePackageBundled } from '@ms-cloudpack/api-server/apis';\nimport path from 'path';\nimport { bulletedList, formatPackageName } from '@ms-cloudpack/task-reporter';\n\nexport const execute: CommandAction<BundleOptions> = async (params) => {\n const { cwd: appPath, options, reporter, initialize, exit, autoDispose } = params;\n const { package: packageArg } = options;\n const { config, telemetryClient } = await initialize({\n appPath,\n overrideOptions: { debug: !process.env.JEST_WORKER_ID },\n });\n\n const { bundler: bundlerType, outdir = 'dist/browser-esm', disableSourceMaps } = options;\n\n const [ctx] = autoDispose(\n await createPartialApiContext({\n appPath,\n config,\n reporter,\n telemetryClient,\n items: ['packages', 'watcher', 'session', 'taskRunner', 'bus', 'packageImportPaths', 'packageHashes'],\n }),\n );\n\n let packagePath = appPath;\n\n if (packageArg) {\n let packageName = packageArg;\n let version: string | undefined;\n\n const versionSeparatorIndex = packageName.lastIndexOf('@');\n\n if (versionSeparatorIndex > 0) {\n packageName = packageArg.substring(0, versionSeparatorIndex);\n version = packageArg.substring(versionSeparatorIndex + 1);\n }\n const { resolveMap } = ctx.session;\n const entry = findResolveMapEntry({ packageName, version, resolveMap });\n const versions = [resolveMap[packageName].version, ...Object.keys(resolveMap[packageName].scopedVersions || {})];\n\n if (entry) {\n if (!version && versions.length > 1) {\n // Error out if there are multiple versions available and no version was specified.\n await exit({\n message: `Package \"${packageName}\" has multiple versions available, specify one of the following:\\n${bulletedList(versions.map((v) => formatPackageName({ name: packageName, version: v })))}`,\n exitCode: 1,\n });\n }\n\n packagePath = entry.path;\n console.log(`Package ${formatPackageName({ name: packageName, version: entry.version })} found: ${entry.path}`);\n } else {\n await exit({\n message: `Package \"${packageArg}\" couldn't be found.`,\n exitCode: 1,\n });\n\n return;\n }\n }\n\n const definition = await ctx.packages.get(packagePath);\n const { result } = await ensurePackageBundled({\n input: {\n name: definition?.name ?? '<unknown>',\n version: definition?.version ?? '0.0.0',\n outputPath: path.resolve(packagePath, outdir),\n bundlerType,\n disableSourceMaps,\n shouldForce: true,\n isIncremental: false,\n },\n ctx,\n });\n await exit({\n exitCode: result?.errors?.length === 0 ? 0 : 1,\n });\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/bundle/index.ts"],"names":[],"mappings":"
|
|
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;AAG9E,iCAAiC;AACjC,eAAO,MAAM,IAAI,EAAE,mBAelB,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Option } from 'commander';
|
|
2
|
-
import { createCommand } from '../../common/createCommand.js';
|
|
3
2
|
/** Defines the "bundle" verb. */
|
|
4
3
|
export const init = (program) => {
|
|
5
|
-
|
|
6
|
-
parent: program,
|
|
4
|
+
program.addSubCommand({
|
|
7
5
|
name: 'bundle',
|
|
8
6
|
description: 'Bundles a package.',
|
|
9
7
|
options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/bundle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/bundle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC,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,OAAO,EAAE,IAAI,MAAM,CAAC,kBAAkB,EAAE,mCAAmC,CAAC;YAC5E,OAAO,EAAE,IAAI,MAAM,CACjB,qBAAqB,EACrB,iFAAiF,CAClF;YACD,MAAM,EAAE,IAAI,MAAM,CAAC,iBAAiB,EAAE,2DAA2D,CAAC;YAClG,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 { Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { BundleOptions } from './types/BundleOptions.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 bundler: new Option('--bundler <name>', 'Forces use of a specific bundler.'),\n package: new Option(\n '--package <package>',\n \"Bundles the named package in the current folder's application dependency graph.\",\n ),\n outdir: new Option('--outdir <path>', 'Path to drop the bundle output, relative to current path.'),\n disableSourceMaps: new Option('--disable-source-maps', 'Disables source maps.'),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../src/commands/cache/clean.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,UAAU,YAAY;CAAG;AAEzB,iCAAiC;AACjC,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../src/commands/cache/clean.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,UAAU,YAAY;CAAG;AAEzB,iCAAiC;AACjC,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,YAAY,CAuB/C,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getCachePath } from '@ms-cloudpack/api-server';
|
|
2
2
|
import fsPromises from 'fs/promises';
|
|
3
3
|
/** Clear the Cloudpack cache. */
|
|
4
|
-
export const execute = async (
|
|
5
|
-
const { cwd } =
|
|
4
|
+
export const execute = async (params) => {
|
|
5
|
+
const { cwd, initialize, exit } = params;
|
|
6
6
|
await initialize({ appPath: cwd });
|
|
7
7
|
const cachePath = getCachePath();
|
|
8
8
|
const cacheDescription = `the Cloudpack cache (${cachePath})`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.js","sourceRoot":"","sources":["../../../src/commands/cache/clean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,UAAU,MAAM,aAAa,CAAC;AAKrC,iCAAiC;AACjC,MAAM,CAAC,MAAM,OAAO,GAAgC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"clean.js","sourceRoot":"","sources":["../../../src/commands/cache/clean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,UAAU,MAAM,aAAa,CAAC;AAKrC,iCAAiC;AACjC,MAAM,CAAC,MAAM,OAAO,GAAgC,KAAK,EAAE,MAAM,EAAE,EAAE;IACnE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAEzC,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAEnC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,wBAAwB,SAAS,GAAG,CAAC;IAC9D,IAAI,OAAe,CAAC;IACpB,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACjE,OAAO,GAAG,wBAAwB,gBAAgB,EAAE,CAAC;QACrD,SAAS,GAAG,KAAK,CAAC;IACpB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,GAAG,mBAAmB,gBAAgB,KAAM,GAAa,CAAC,OAAO,IAAI,GAAG,EAAE,CAAC;QAClF,SAAS,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,CAAC;QACT,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO;KACR,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { getCachePath } from '@ms-cloudpack/api-server';\nimport fsPromises from 'fs/promises';\nimport type { CommandAction } from '../../types/CommandAction.js';\n\ninterface CleanOptions {}\n\n/** Clear the Cloudpack cache. */\nexport const execute: CommandAction<CleanOptions> = async (params) => {\n const { cwd, initialize, exit } = params;\n\n await initialize({ appPath: cwd });\n\n const cachePath = getCachePath();\n const cacheDescription = `the Cloudpack cache (${cachePath})`;\n let message: string;\n let hasErrors = false;\n\n try {\n await fsPromises.rm(cachePath, { recursive: true, force: true });\n message = `Successfully cleared ${cacheDescription}`;\n hasErrors = false;\n } catch (err) {\n message = `Failed to clear ${cacheDescription}: ${(err as Error).message || err}`;\n hasErrors = true;\n }\n\n await exit({\n exitCode: hasErrors ? 1 : 0,\n message,\n });\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/cache/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,gCAAgC;AAChC,eAAO,MAAM,IAAI,EAAE,mBAalB,CAAC"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { createCommand } from '../../common/createCommand.js';
|
|
2
1
|
/** Defines the "cache" verb. */
|
|
3
2
|
export const init = (program) => {
|
|
4
|
-
const
|
|
5
|
-
parent: program,
|
|
3
|
+
const cacheCommand = program.addSubCommand({
|
|
6
4
|
name: 'cache',
|
|
7
5
|
description: 'Operations related to the Cloudpack cache (requires a sub-command).',
|
|
6
|
+
usage: '<command>',
|
|
8
7
|
});
|
|
9
|
-
|
|
10
|
-
const cacheCleanCommand = createCommand({
|
|
11
|
-
parent: command,
|
|
8
|
+
cacheCommand.addSubCommand({
|
|
12
9
|
name: 'clean',
|
|
10
|
+
alias: 'clear',
|
|
13
11
|
description: 'Clears the Cloudpack cache.',
|
|
14
12
|
getExecutor: () => import('./clean.js'),
|
|
15
13
|
});
|
|
16
|
-
cacheCleanCommand.alias('clear');
|
|
17
14
|
};
|
|
18
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/cache/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/cache/index.ts"],"names":[],"mappings":"AAEA,gCAAgC;AAChC,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,OAAO,EAAE,EAAE;IACnD,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;QACzC,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,qEAAqE;QAClF,KAAK,EAAE,WAAW;KACnB,CAAC,CAAC;IAEH,YAAY,CAAC,aAAa,CAAC;QACzB,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,6BAA6B;QAC1C,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC;KACxC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import type { CommandInitFunction } from '../../types/CommandInitFunction.js';\n\n/** Defines the \"cache\" verb. */\nexport const init: CommandInitFunction = (program) => {\n const cacheCommand = program.addSubCommand({\n name: 'cache',\n description: 'Operations related to the Cloudpack cache (requires a sub-command).',\n usage: '<command>',\n });\n\n cacheCommand.addSubCommand({\n name: 'clean',\n alias: 'clear',\n description: 'Clears the Cloudpack cache.',\n getExecutor: () => import('./clean.js'),\n });\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/info/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/info/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,+BAA+B;AAC/B,eAAO,MAAM,IAAI,EAAE,mBAsBlB,CAAC"}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { Option } from 'commander';
|
|
2
|
-
import { createCommand } from '../../common/createCommand.js';
|
|
3
2
|
/** Defines the "info" verb. */
|
|
4
3
|
export const init = (program) => {
|
|
5
|
-
const
|
|
6
|
-
parent: program,
|
|
4
|
+
const infoCommand = program.addSubCommand({
|
|
7
5
|
name: 'info',
|
|
8
6
|
description: 'Get repo info relevant to cloudpack (requires a sub-command).',
|
|
7
|
+
usage: '<command>',
|
|
9
8
|
});
|
|
10
|
-
|
|
11
|
-
const lockfileCommand = createCommand({
|
|
12
|
-
parent: command,
|
|
9
|
+
infoCommand.addSubCommand({
|
|
13
10
|
name: 'lock-file',
|
|
11
|
+
alias: 'lockfile',
|
|
14
12
|
description: 'Get info about potentially problematic deps from the lock file (yarn v1 only).',
|
|
15
13
|
getExecutor: () => import('./lockFile/execute.js'),
|
|
16
14
|
});
|
|
17
|
-
|
|
18
|
-
createCommand({
|
|
19
|
-
parent: command,
|
|
15
|
+
infoCommand.addSubCommand({
|
|
20
16
|
name: 'non-semver-deps',
|
|
21
17
|
description: 'Get a list of non-semver deps from local packages.',
|
|
22
18
|
getExecutor: () => import('./nonSemverDeps/execute.js'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/info/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/info/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,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;QACxC,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,+DAA+D;QAC5E,KAAK,EAAE,WAAW;KACnB,CAAC,CAAC;IAEH,WAAW,CAAC,aAAa,CAAC;QACxB,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,gFAAgF;QAC7F,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC;KACnD,CAAC,CAAC;IAEH,WAAW,CAAC,aAAa,CAAC;QACxB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,oDAAoD;QACjE,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,4BAA4B,CAAC;QACvD,OAAO,EAAE;YACP,IAAI,EAAE,IAAI,MAAM,CAAC,QAAQ,EAAE,0BAA0B,CAAC;SACvD;KACF,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 const infoCommand = program.addSubCommand({\n name: 'info',\n description: 'Get repo info relevant to cloudpack (requires a sub-command).',\n usage: '<command>',\n });\n\n infoCommand.addSubCommand({\n name: 'lock-file',\n alias: 'lockfile',\n description: 'Get info about potentially problematic deps from the lock file (yarn v1 only).',\n getExecutor: () => import('./lockFile/execute.js'),\n });\n\n infoCommand.addSubCommand({\n name: 'non-semver-deps',\n description: 'Get a list of non-semver deps from local packages.',\n getExecutor: () => import('./nonSemverDeps/execute.js'),\n options: {\n prod: new Option('--prod', 'Only get production deps'),\n },\n });\n};\n"]}
|
|
@@ -2,8 +2,8 @@ import { checkResolvedVersions } from './checkResolvedVersions.js';
|
|
|
2
2
|
import { readYarnLock } from './readYarnLock.js';
|
|
3
3
|
import { processYarnLock } from './processYarnLock.js';
|
|
4
4
|
/** Executor for the "info lock-file" verb */
|
|
5
|
-
export const execute = async (
|
|
6
|
-
const { cwd } =
|
|
5
|
+
export const execute = async (params) => {
|
|
6
|
+
const { cwd, initialize, exit } = params;
|
|
7
7
|
await initialize({ appPath: cwd });
|
|
8
8
|
let message;
|
|
9
9
|
let success = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../src/commands/info/lockFile/execute.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIvD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,OAAO,GAAmC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../src/commands/info/lockFile/execute.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIvD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,OAAO,GAAmC,KAAK,EAAE,MAAM,EAAE,EAAE;IACtE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IACzC,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAEnC,IAAI,OAAe,CAAC;IACpB,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,IAAI,CAAC;QACH,iEAAiE;QACjE,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YACnC,OAAO,GAAG,UAAU,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,MAAM,gBAAgB,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;YACrD,OAAO,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;YAClD,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,GAAG,qCAAsC,GAAa,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC;IAC/E,CAAC;IAED,MAAM,IAAI,CAAC;QACT,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,OAAO;KACR,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import type { CommandAction } from '../../../types/CommandAction.js';\nimport { checkResolvedVersions } from './checkResolvedVersions.js';\nimport { readYarnLock } from './readYarnLock.js';\nimport { processYarnLock } from './processYarnLock.js';\n\ninterface LockFileOptions {}\n\n/** Executor for the \"info lock-file\" verb */\nexport const execute: CommandAction<LockFileOptions> = async (params) => {\n const { cwd, initialize, exit } = params;\n await initialize({ appPath: cwd });\n\n let message: string;\n let success = false;\n\n try {\n // This returns either the lock file contents or an error message\n const lockResult = await readYarnLock(cwd);\n if (typeof lockResult === 'string') {\n message = lockResult;\n } else {\n const resolvedVersions = processYarnLock(lockResult);\n message = checkResolvedVersions(resolvedVersions);\n success = true;\n }\n } catch (err) {\n message = `Error getting info from lockfile: ${(err as Error).stack || err}`;\n }\n\n await exit({\n exitCode: success ? 0 : 1,\n message,\n });\n};\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { getNonSemverDeps } from './getNonSemverDeps.js';
|
|
2
2
|
/** Executor for the "info non-semver-deps" verb */
|
|
3
|
-
export const execute = async (
|
|
4
|
-
const { cwd } =
|
|
3
|
+
export const execute = async (params) => {
|
|
4
|
+
const { options, cwd, initialize, exit } = params;
|
|
5
5
|
await initialize({ appPath: cwd });
|
|
6
6
|
let message;
|
|
7
7
|
let success = false;
|
|
8
8
|
try {
|
|
9
|
-
message = await getNonSemverDeps(options);
|
|
9
|
+
message = await getNonSemverDeps({ ...options, cwd });
|
|
10
10
|
success = true;
|
|
11
11
|
}
|
|
12
12
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../src/commands/info/nonSemverDeps/execute.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,mDAAmD;AACnD,MAAM,CAAC,MAAM,OAAO,GAAwC,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../src/commands/info/nonSemverDeps/execute.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,mDAAmD;AACnD,MAAM,CAAC,MAAM,OAAO,GAAwC,KAAK,EAAE,MAAM,EAAE,EAAE;IAC3E,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAClD,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAEnC,IAAI,OAAe,CAAC;IACpB,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,gBAAgB,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;QACtD,OAAO,GAAG,IAAI,CAAC;IACjB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,GAAG,4CAA6C,GAAa,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC;IACtF,CAAC;IAED,MAAM,IAAI,CAAC;QACT,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,OAAO;KACR,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import type { CommandAction } from '../../../types/CommandAction.js';\nimport { getNonSemverDeps } from './getNonSemverDeps.js';\n\nexport interface NonSemverDepsOptions {\n /** Only get production deps */\n prod?: boolean;\n}\n\n/** Executor for the \"info non-semver-deps\" verb */\nexport const execute: CommandAction<NonSemverDepsOptions> = async (params) => {\n const { options, cwd, initialize, exit } = params;\n await initialize({ appPath: cwd });\n\n let message: string;\n let success = false;\n\n try {\n message = await getNonSemverDeps({ ...options, cwd });\n success = true;\n } catch (err) {\n message = `Error attempting to get non-semver deps: ${(err as Error).stack || err}`;\n }\n\n await exit({\n exitCode: success ? 0 : 1,\n message,\n });\n};\n"]}
|
|
@@ -6,7 +6,7 @@ export declare function getNonSemverDeps(params: {
|
|
|
6
6
|
cwd: string;
|
|
7
7
|
/** Only include production dependencies */
|
|
8
8
|
prod?: boolean;
|
|
9
|
-
/** Use this
|
|
9
|
+
/** Use this directory as the root instead of calling `findProjectRoot` (for testing) */
|
|
10
10
|
overrideProjectRoot?: string;
|
|
11
11
|
}): Promise<string>;
|
|
12
12
|
//# sourceMappingURL=getNonSemverDeps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNonSemverDeps.d.ts","sourceRoot":"","sources":["../../../../src/commands/info/nonSemverDeps/getNonSemverDeps.ts"],"names":[],"mappings":"AA0BA;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"getNonSemverDeps.d.ts","sourceRoot":"","sources":["../../../../src/commands/info/nonSemverDeps/getNonSemverDeps.ts"],"names":[],"mappings":"AA0BA;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wFAAwF;IACxF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAkDlB"}
|
|
@@ -1 +1 @@
|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AAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,SAAS;KACnB,CAAC,GAAG,IAAI,CACV,CAAC;AACJ,CAAC","sourcesContent":["import type { PackageJson } from '@ms-cloudpack/config-types';\nimport { readJson } from '@ms-cloudpack/json-utilities';\nimport { findProjectRoot } from '@ms-cloudpack/package-utilities';\nimport { table } from '@ms-cloudpack/task-reporter';\nimport path from 'path';\nimport semver from 'semver';\nimport { getPackageInfos, type PackageInfo } from 'workspace-tools';\n\ninterface NonSemverDep {\n parent: string | undefined;\n depName: string;\n type: string;\n version: string | undefined;\n}\n\n// resolutions might apply to prod or dev dependencies, so include it just in case\nconst prodDeps = ['dependencies', 'peerDependencies', 'resolutions'] as const;\nconst allDeps = [...prodDeps, 'devDependencies'] as const;\n\nconst depTypeNames = {\n dependencies: 'prod',\n peerDependencies: 'peer',\n devDependencies: 'dev',\n resolutions: 'resolution',\n};\n\n/**\n * Check the local packages in the monorepo for non-semver deps.\n * Returns either a table of those deps or a message saying there are none.\n */\nexport async function getNonSemverDeps(params: {\n cwd: string;\n /** Only include production dependencies */\n prod?: boolean;\n /** Use this
|
|
1
|
+
{"version":3,"file":"getNonSemverDeps.js","sourceRoot":"","sources":["../../../../src/commands/info/nonSemverDeps/getNonSemverDeps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAoB,MAAM,iBAAiB,CAAC;AASpE,kFAAkF;AAClF,MAAM,QAAQ,GAAG,CAAC,cAAc,EAAE,kBAAkB,EAAE,aAAa,CAAU,CAAC;AAC9E,MAAM,OAAO,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CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;SAClG,IAAI,CAAC,CAAC,CAAC;QACR,0BAA0B;SACzB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;SACpD,GAAG,CACF,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAgB,EAAE,CAAC,CAAC;QAC1C,MAAM,EAAE,GAAG,CAAC,IAAI;QAChB,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC;QACxB,OAAO;KACR,CAAC,CACH,CACJ;SACA,IAAI,EAAE,CAAC;IAEV,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;QAC1B,OAAO,kCAAkC,CAAC;IAC5C,CAAC;IAED,OAAO,CACL,KAAK,CAAC,aAAa,EAAE;QACnB,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,SAAS;KACnB,CAAC,GAAG,IAAI,CACV,CAAC;AACJ,CAAC","sourcesContent":["import type { PackageJson } from '@ms-cloudpack/config-types';\nimport { readJson } from '@ms-cloudpack/json-utilities';\nimport { findProjectRoot } from '@ms-cloudpack/package-utilities';\nimport { table } from '@ms-cloudpack/task-reporter';\nimport path from 'path';\nimport semver from 'semver';\nimport { getPackageInfos, type PackageInfo } from 'workspace-tools';\n\ninterface NonSemverDep {\n parent: string | undefined;\n depName: string;\n type: string;\n version: string | undefined;\n}\n\n// resolutions might apply to prod or dev dependencies, so include it just in case\nconst prodDeps = ['dependencies', 'peerDependencies', 'resolutions'] as const;\nconst allDeps = [...prodDeps, 'devDependencies'] as const;\n\nconst depTypeNames = {\n dependencies: 'prod',\n peerDependencies: 'peer',\n devDependencies: 'dev',\n resolutions: 'resolution',\n};\n\n/**\n * Check the local packages in the monorepo for non-semver deps.\n * Returns either a table of those deps or a message saying there are none.\n */\nexport async function getNonSemverDeps(params: {\n cwd: string;\n /** Only include production dependencies */\n prod?: boolean;\n /** Use this directory as the root instead of calling `findProjectRoot` (for testing) */\n overrideProjectRoot?: string;\n}): Promise<string> {\n const { cwd, prod, overrideProjectRoot } = params;\n\n const projectRoot = overrideProjectRoot || findProjectRoot(cwd) || cwd;\n const packages = getPackageInfos(projectRoot);\n\n // add the root package.json to the package infos\n const rootPkgJsonPath = path.join(projectRoot, 'package.json');\n const rootPkg = await readJson<PackageJson>(rootPkgJsonPath);\n if (!rootPkg) {\n throw new Error(`${rootPkgJsonPath} does not exist`);\n }\n if (!rootPkg.name || !rootPkg.version) {\n throw new Error(`${rootPkgJsonPath} is missing a name and/or version`);\n }\n packages[rootPkg.name] = rootPkg as PackageInfo;\n\n const depTypes = prod ? prodDeps : allDeps;\n\n const nonSemverDeps = Object.values(packages)\n .map((pkg: PackageJson) =>\n depTypes\n // get dependencies, peerDependencies, etc from the package\n .map((dt) => Object.entries(pkg[dt] || {}).map(([name, version]) => ({ name, version, type: dt })))\n .flat(1)\n // get non-semver versions\n .filter(({ version }) => !semver.validRange(version))\n .map(\n ({ name, version, type }): NonSemverDep => ({\n parent: pkg.name,\n depName: name,\n type: depTypeNames[type],\n version,\n }),\n ),\n )\n .flat();\n\n if (!nonSemverDeps.length) {\n return 'No non-semver dependencies found';\n }\n\n return (\n table(nonSemverDeps, {\n parent: 'Parent package',\n depName: 'Dependency',\n type: 'Dep type',\n version: 'Version',\n }) + '\\n'\n );\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init } from './init.js';
|
|
2
2
|
import { formatInitSummary } from './formatInitSummary.js';
|
|
3
3
|
/** Given the path, updates the Cloudpack config with overrides and project settings. */
|
|
4
|
-
export const execute = async (
|
|
5
|
-
const { cwd } =
|
|
4
|
+
export const execute = async (params) => {
|
|
5
|
+
const { options, cwd, initialize, reporter, exit, autoDispose } = params;
|
|
6
6
|
const { config, telemetryClient } = await initialize({ appPath: cwd });
|
|
7
7
|
const summary = await init({ options, appPath: cwd, config, reporter, autoDispose, telemetryClient });
|
|
8
8
|
const message = formatInitSummary(summary, options);
|
|
@@ -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;AAE3D,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAA+B,KAAK,EAAE,EAAE,
|
|
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;AAE3D,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAA+B,KAAK,EAAE,MAAM,EAAE,EAAE;IAClE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IACzE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAEvE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC;IAEtG,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;IAE1C,MAAM,IAAI,CAAC;QACT,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO;KACR,CAAC,CAAC;AACL,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';\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, reporter, exit, autoDispose } = params;\n const { config, telemetryClient } = await initialize({ appPath: cwd });\n\n const summary = await init({ options, appPath: cwd, config, reporter, autoDispose, telemetryClient });\n\n const message = formatInitSummary(summary, options);\n const hasErrors = summary.totalErrors > 0;\n\n await exit({\n exitCode: hasErrors ? 1 : 0,\n message,\n });\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"
|
|
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;AAG9E,+BAA+B;AAC/B,eAAO,MAAM,IAAI,EAAE,mBAelB,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Option } from 'commander';
|
|
2
|
-
import { createCommand } from '../../common/createCommand.js';
|
|
3
2
|
/** Defines the "init" verb. */
|
|
4
3
|
export const init = (program) => {
|
|
5
|
-
|
|
6
|
-
parent: program,
|
|
4
|
+
program.addSubCommand({
|
|
7
5
|
name: 'init',
|
|
8
6
|
description: 'Initializes a given app project and defines the necessary configuration overrides to make an existing app compatible with Cloudpack.',
|
|
9
7
|
options: {
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC,+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,KAAK,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,0DAA0D,CAAC;YACxF,KAAK,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,2CAA2C,CAAC;YACzE,KAAK,EAAE,IAAI,MAAM,CACf,0BAA0B,EAC1B,4FAA4F,CAC7F;SACF;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';\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 reset: new Option('--reset', 'Ignores existing overrides when determining all entries.'),\n check: new Option('--check', 'Fails if any package exports are missing.'),\n match: new Option(\n '--match <name><@version>',\n 'Only evaluate a specific package match. This can be a partial match. (e.g. @ms-cloudpack/)',\n ),\n },\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":"AAAA,OAAO,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/start/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,8BAA8B,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAe5D,wDAAwD;AACxD,wBAAsB,WAAW,kBAKhC;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,YAAY,CAqH/C,CAAC"}
|
|
@@ -8,19 +8,19 @@ import { getStartingAppPath } from './getStartingAppPath.js';
|
|
|
8
8
|
import { openBrowser } from './openBrowser.js';
|
|
9
9
|
import { runPrerequisites } from '../../common/runPrerequisites.js';
|
|
10
10
|
import { createPartialApiContext, ensurePackageBundled } from '@ms-cloudpack/api-server/apis';
|
|
11
|
-
let
|
|
11
|
+
let exitFunction;
|
|
12
12
|
/** Stop all started cloudpack instances, for testing */
|
|
13
13
|
export async function stopServers() {
|
|
14
|
-
|
|
15
|
-
await
|
|
14
|
+
if (exitFunction) {
|
|
15
|
+
await exitFunction({ exitCode: 0, message: 'stopServers called' });
|
|
16
|
+
exitFunction = undefined;
|
|
16
17
|
}
|
|
17
|
-
cleanupFunctions = [];
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Defines the "start" verb entry point.
|
|
21
21
|
*/
|
|
22
|
-
export const execute = async (
|
|
23
|
-
const { cwd } =
|
|
22
|
+
export const execute = async (params) => {
|
|
23
|
+
const { options, cwd, initialize, reporter, autoDispose, exit } = params;
|
|
24
24
|
const appPath = await getStartingAppPath(cwd, options.app);
|
|
25
25
|
const { config, telemetryClient } = await initialize({ appPath });
|
|
26
26
|
console.log('App path:', yellow(appPath));
|
|
@@ -99,10 +99,8 @@ export const execute = async ({ options, initialize, reporter, autoDispose }) =>
|
|
|
99
99
|
}
|
|
100
100
|
}));
|
|
101
101
|
};
|
|
102
|
-
autoDispose({
|
|
103
|
-
|
|
104
|
-
});
|
|
105
|
-
cleanupFunctions.push(cleanup);
|
|
102
|
+
autoDispose({ dispose: cleanup });
|
|
103
|
+
exitFunction = exit;
|
|
106
104
|
const url = appServer.url;
|
|
107
105
|
performance.measure(PerfMeasurementOpenBrowser, PerfMarkerCliEntry);
|
|
108
106
|
// Open the browser.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/start/execute.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE9F,IAAI,
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/start/execute.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAA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,EAAE,GAAG,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC;IAEF,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAClC,YAAY,GAAG,IAAI,CAAC;IAEpB,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC;IAE1B,WAAW,CAAC,OAAO,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;IAEpE,oBAAoB;IACpB,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QAC3B,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YAC7B,sEAAsE;YACtE,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,CAAC,CAAC;YAC1D,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC,CAAC;AAEF,wBAAwB","sourcesContent":["import type { CommandAction, CommandActionParams } from '../../types/CommandAction.js';\nimport type { StartOptions } from './types/StartOptions.js';\n\nimport { writeJson } from '@ms-cloudpack/json-utilities';\nimport { resolve } from '@ms-cloudpack/package-utilities';\nimport { yellow } from '@ms-cloudpack/task-reporter';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { PerfMarkerCliEntry, PerfMeasurementOpenBrowser } from '../../performance/markers.js';\nimport { getStartingAppPath } from './getStartingAppPath.js';\nimport { openBrowser } from './openBrowser.js';\nimport { runPrerequisites } from '../../common/runPrerequisites.js';\nimport { createPartialApiContext, ensurePackageBundled } from '@ms-cloudpack/api-server/apis';\n\nlet exitFunction: CommandActionParams<StartOptions>['exit'] | undefined;\n\n/** Stop all started cloudpack instances, for testing */\nexport async function stopServers() {\n if (exitFunction) {\n await exitFunction({ exitCode: 0, message: 'stopServers called' });\n exitFunction = undefined;\n }\n}\n\n/**\n * Defines the \"start\" verb entry point.\n */\nexport const execute: CommandAction<StartOptions> = async (params) => {\n const { options, cwd, initialize, reporter, autoDispose, exit } = params;\n const appPath = await getStartingAppPath(cwd, options.app);\n const { config, telemetryClient } = await initialize({ appPath });\n\n console.log('App path:', yellow(appPath));\n\n runPrerequisites(config, appPath);\n\n const [apiContext] = autoDispose(\n await createPartialApiContext({\n appPath,\n config,\n reporter,\n telemetryClient,\n items: ['bus', 'watcher', 'taskRunner', 'packages', 'session', 'packageImportPaths', 'packageHashes'],\n overlayPath: await resolve('@ms-cloudpack/overlay', path.dirname(fileURLToPath(import.meta.url))),\n }),\n );\n const { packages, session, packageImportPaths } = 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 if (!definition) {\n throw new Error(`There was no package.json located at \"${appPath}\".`);\n }\n\n if (!definition.name || !definition.version) {\n throw new Error(`The package.json at \"${appPath}\" did not have a name and/or version.`);\n }\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 { startApiServer } = await import('@ms-cloudpack/api-server');\n\n // Start api server for tracking status and handling remote requests.\n const apiServer = await startApiServer(apiContext);\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 { startBundleServer } = await import('@ms-cloudpack/bundle-server');\n const bundleServer = await startBundleServer({\n context: {\n ...apiContext,\n apiServer,\n disableCache: !options.cache,\n },\n });\n\n // Finally start the app server.\n const { startAppServer } = await import('@ms-cloudpack/app-server');\n const appServer = await startAppServer({\n session,\n definition,\n bundleServer,\n apiServer,\n config,\n reporter,\n packages,\n packageImportPaths,\n packageHashes: apiContext.packageHashes,\n });\n\n const cleanup = async () => {\n const servers = [\n ['appServer', appServer] as const,\n ['apiServer', apiServer] as const,\n ['bundleServer', bundleServer] as const,\n ];\n\n await Promise.all(\n servers.map(async ([name, server]) => {\n console.info(`Closing ${name}: ${server.url}`);\n try {\n await server.close();\n console.info(`Closed ${name}: ${server.url}`);\n } catch (err) {\n console.warn('Error closing server:', err);\n }\n }),\n );\n };\n\n autoDispose({ dispose: cleanup });\n exitFunction = exit;\n\n const url = appServer.url;\n\n performance.measure(PerfMeasurementOpenBrowser, PerfMarkerCliEntry);\n\n // Open the browser.\n if (options.open !== false) {\n openBrowser(url).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:', url);\n });\n } else {\n console.log('Please open the browser manually to:', url);\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":"
|
|
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;AAG9E,gCAAgC;AAChC,eAAO,MAAM,IAAI,EAAE,mBAelB,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Option } from 'commander';
|
|
2
|
-
import { createCommand } from '../../common/createCommand.js';
|
|
3
2
|
/** Defines the "start" verb. */
|
|
4
3
|
export const init = (program) => {
|
|
5
|
-
|
|
6
|
-
parent: program,
|
|
4
|
+
program.addSubCommand({
|
|
7
5
|
name: 'start',
|
|
8
6
|
description: 'Starts a web inner-loop from the current package folder.',
|
|
9
7
|
options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/start/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,EAAE,0DAA0D;QACvE,OAAO,EAAE;YACP,aAAa,EAAE,IAAI,MAAM,CAAC,mBAAmB,EAAE,6DAA6D,CAAC;YAC7G,GAAG,EAAE,IAAI,MAAM,CAAC,wBAAwB,EAAE,yCAAyC,CAAC;YACpF,IAAI,EAAE,IAAI,MAAM,CAAC,WAAW,EAAE,0BAA0B,CAAC;YACzD,KAAK,EAAE,IAAI,MAAM,CACf,YAAY,EACZ,8FAA8F,CAC/F;SACF;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 { StartOptions } from './types/StartOptions.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 logResolveMap: new Option('--log-resolve-map', 'Logs the resolve map to \"resolve-map.json\" for diagnostics.'),\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: new Option(\n '--no-cache',\n 'Ensures Cloudpack rebuilds all packages when requested, rather than utilizing cached assets.',\n ),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAIlE,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAIlE,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,WAAW,CAoD9C,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createPartialApiContext, syncDownload, syncUpload } from '@ms-cloudpack/api-server/apis';
|
|
2
2
|
import { runPrerequisites } from '../../common/runPrerequisites.js';
|
|
3
|
-
export const execute = async (
|
|
4
|
-
const { cwd,
|
|
3
|
+
export const execute = async (params) => {
|
|
4
|
+
const { options, cwd, reporter, initialize, exit, autoDispose } = params;
|
|
5
|
+
const { login, upload } = options;
|
|
5
6
|
const { config, telemetryClient } = await initialize({ appPath: cwd });
|
|
6
7
|
if (!config.features?.syncBundles) {
|
|
7
8
|
console.warn('Sync is disabled.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/sync/execute.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,MAAM,CAAC,MAAM,OAAO,GAA+B,KAAK,EAAE,EAAE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AC,CAAC;YAE9B,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CACvB,MAAM,uBAAuB,CAAC;gBAC5B,GAAG,iBAAiB;gBACpB,KAAK,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,oBAAoB,EAAE,eAAe,CAAC;aACtG,CAAC,CACH,CAAC;YACF,MAAM,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QACnC,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CACvB,MAAM,uBAAuB,CAAC;gBAC5B,GAAG,iBAAiB;gBACpB,KAAK,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,eAAe,CAAC;aAChD,CAAC,CACH,CAAC;YACF,MAAM,YAAY,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QACrC,CAAC;QAED,MAAM,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,eAAe,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAClD,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { SyncOptions } from './types/SyncOptions.js';\nimport type { CommandAction } from '../../types/CommandAction.js';\nimport { createPartialApiContext, syncDownload, syncUpload } from '@ms-cloudpack/api-server/apis';\nimport { runPrerequisites } from '../../common/runPrerequisites.js';\n\nexport const execute: CommandAction<SyncOptions> = async (params) => {\n const { options, cwd, reporter, initialize, exit, autoDispose } = params;\n const { login, upload } = options;\n const { config, telemetryClient } = await initialize({ appPath: cwd });\n\n if (!config.features?.syncBundles) {\n console.warn('Sync is disabled.');\n await exit({ exitCode: 0 });\n return;\n }\n\n try {\n const remoteCacheConfig = config.remoteCache;\n if (!remoteCacheConfig) {\n console.warn(\n 'Remote cache is not configured. Please add remoteCache to your cloudpack.config.json file to use this feature.',\n );\n return;\n }\n\n const input = {\n loginMethod: login,\n };\n\n const apiContextOptions = { appPath: cwd, config, reporter, telemetryClient };\n if (upload) {\n runPrerequisites(config, cwd);\n\n const [ctx] = autoDispose(\n await createPartialApiContext({\n ...apiContextOptions,\n items: ['bus', 'taskRunner', 'watcher', 'packages', 'session', 'packageImportPaths', 'packageHashes'],\n }),\n );\n await syncUpload({ input, ctx });\n } else {\n const [ctx] = autoDispose(\n await createPartialApiContext({\n ...apiContextOptions,\n items: ['packages', 'session', 'packageHashes'],\n }),\n );\n await syncDownload({ input, ctx });\n }\n\n await exit({ exitCode: 0 });\n } catch (error) {\n if (error instanceof Error) {\n telemetryClient.rootSpan.recordException(error);\n }\n throw error;\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"
|
|
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,5 +1,4 @@
|
|
|
1
1
|
import { Option } from 'commander';
|
|
2
|
-
import { createCommand } from '../../common/createCommand.js';
|
|
3
2
|
import { isCIBuild } from '../../utilities/isCIBuild.js';
|
|
4
3
|
import { isCodespaces } from '../../utilities/isCodespaces.js';
|
|
5
4
|
function getDefaultLogin() {
|
|
@@ -13,8 +12,7 @@ function getDefaultLogin() {
|
|
|
13
12
|
}
|
|
14
13
|
/** Defines the "sync" verb. */
|
|
15
14
|
export const init = (program) => {
|
|
16
|
-
|
|
17
|
-
parent: program,
|
|
15
|
+
program.addSubCommand({
|
|
18
16
|
name: 'sync',
|
|
19
17
|
description: 'Syncs the packages from/to the remote cache. If the package is not in the local cache, it will be downloaded.',
|
|
20
18
|
options: {
|
|
@@ -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;
|
|
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"]}
|