@ms-cloudpack/cli 0.72.12 → 0.72.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/bundle/execute.d.ts.map +1 -1
- package/lib/commands/bundle/execute.js +7 -8
- package/lib/commands/bundle/execute.js.map +1 -1
- package/lib/commands/cache/clean.d.ts.map +1 -1
- package/lib/commands/cache/clean.js +6 -11
- package/lib/commands/cache/clean.js.map +1 -1
- package/lib/commands/config/delete.js +4 -4
- package/lib/commands/config/delete.js.map +1 -1
- package/lib/commands/config/get.js +5 -5
- package/lib/commands/config/get.js.map +1 -1
- package/lib/commands/config/list.js +5 -5
- package/lib/commands/config/list.js.map +1 -1
- package/lib/commands/config/set.js +4 -4
- package/lib/commands/config/set.js.map +1 -1
- package/lib/commands/info/lockFile/execute.d.ts.map +1 -1
- package/lib/commands/info/lockFile/execute.js +10 -14
- package/lib/commands/info/lockFile/execute.js.map +1 -1
- package/lib/commands/info/nonSemverDeps/execute.d.ts.map +1 -1
- package/lib/commands/info/nonSemverDeps/execute.js +8 -10
- package/lib/commands/info/nonSemverDeps/execute.js.map +1 -1
- package/lib/commands/init/evaluatePath.d.ts +2 -2
- package/lib/commands/init/evaluatePath.d.ts.map +1 -1
- package/lib/commands/init/evaluatePath.js +2 -2
- package/lib/commands/init/evaluatePath.js.map +1 -1
- package/lib/commands/init/execute.js +4 -4
- package/lib/commands/init/execute.js.map +1 -1
- package/lib/commands/init/init.js +148 -146
- package/lib/commands/init/init.js.map +1 -1
- package/lib/commands/link/execute.d.ts.map +1 -1
- package/lib/commands/link/execute.js +8 -4
- package/lib/commands/link/execute.js.map +1 -1
- package/lib/commands/link/getSessionToLink.d.ts +5 -4
- package/lib/commands/link/getSessionToLink.d.ts.map +1 -1
- package/lib/commands/link/getSessionToLink.js +36 -20
- package/lib/commands/link/getSessionToLink.js.map +1 -1
- package/lib/commands/setup/execute.js +2 -2
- package/lib/commands/setup/execute.js.map +1 -1
- package/lib/commands/start/execute.d.ts.map +1 -1
- package/lib/commands/start/execute.js +37 -21
- package/lib/commands/start/execute.js.map +1 -1
- package/lib/commands/start/getStartingAppPath.d.ts +5 -2
- package/lib/commands/start/getStartingAppPath.d.ts.map +1 -1
- package/lib/commands/start/getStartingAppPath.js +36 -9
- package/lib/commands/start/getStartingAppPath.js.map +1 -1
- package/lib/commands/sync/execute.d.ts.map +1 -1
- package/lib/commands/sync/execute.js +43 -42
- package/lib/commands/sync/execute.js.map +1 -1
- package/lib/commands/unlink/execute.d.ts.map +1 -1
- package/lib/commands/unlink/execute.js +8 -4
- package/lib/commands/unlink/execute.js.map +1 -1
- package/lib/types/CommandAction.d.ts +14 -8
- package/lib/types/CommandAction.d.ts.map +1 -1
- package/lib/types/CommandAction.js.map +1 -1
- package/lib/utilities/CommandExecutor.d.ts +8 -4
- package/lib/utilities/CommandExecutor.d.ts.map +1 -1
- package/lib/utilities/CommandExecutor.js +58 -49
- package/lib/utilities/CommandExecutor.js.map +1 -1
- package/lib/utilities/parseMatch.d.ts.map +1 -1
- package/lib/utilities/parseMatch.js +5 -0
- package/lib/utilities/parseMatch.js.map +1 -1
- package/lib/utilities/runPrerequisites.js +1 -1
- package/lib/utilities/runPrerequisites.js.map +1 -1
- package/package.json +13 -13
- package/lib/commands/link/getSessionFromUser.d.ts +0 -9
- package/lib/commands/link/getSessionFromUser.d.ts.map +0 -1
- package/lib/commands/link/getSessionFromUser.js +0 -26
- package/lib/commands/link/getSessionFromUser.js.map +0 -1
- package/lib/commands/start/createPathToChoiceMap.d.ts +0 -16
- package/lib/commands/start/createPathToChoiceMap.d.ts.map +0 -1
- package/lib/commands/start/createPathToChoiceMap.js +0 -29
- package/lib/commands/start/createPathToChoiceMap.js.map +0 -1
- package/lib/commands/start/getAppPathFromUser.d.ts +0 -9
- package/lib/commands/start/getAppPathFromUser.d.ts.map +0 -1
- package/lib/commands/start/getAppPathFromUser.js +0 -28
- package/lib/commands/start/getAppPathFromUser.js.map +0 -1
- package/lib/commands/start/getMatchingApps.d.ts +0 -9
- package/lib/commands/start/getMatchingApps.d.ts.map +0 -1
- package/lib/commands/start/getMatchingApps.js +0 -10
- package/lib/commands/start/getMatchingApps.js.map +0 -1
- package/lib/performance/registerPerformanceObservers.d.ts +0 -7
- package/lib/performance/registerPerformanceObservers.d.ts.map +0 -1
- package/lib/performance/registerPerformanceObservers.js +0 -20
- package/lib/performance/registerPerformanceObservers.js.map +0 -1
- package/lib/utilities/stopServers.d.ts +0 -13
- package/lib/utilities/stopServers.d.ts.map +0 -1
- package/lib/utilities/stopServers.js +0 -18
- package/lib/utilities/stopServers.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/bundle/execute.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/bundle/execute.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,aAAa,CAgFhD,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { plural, red, yellow } from '@ms-cloudpack/task-reporter';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { getFilteredPackages } from '../../utilities/getFilteredPackages.js';
|
|
5
5
|
export const execute = async (params) => {
|
|
6
|
-
const { cwd: appPath, options, reporter, initialize,
|
|
6
|
+
const { cwd: appPath, options, reporter, initialize, autoDispose } = params;
|
|
7
7
|
const apiContextOptions = await initialize({
|
|
8
8
|
appPath,
|
|
9
9
|
configOptions: {
|
|
@@ -20,11 +20,10 @@ export const execute = async (params) => {
|
|
|
20
20
|
}));
|
|
21
21
|
const pathsToBundle = options.match ? getFilteredPackages(ctx.session.resolveMap, options.match) : [appPath];
|
|
22
22
|
if (!pathsToBundle.length) {
|
|
23
|
-
|
|
23
|
+
return {
|
|
24
24
|
message: 'No matching packages found to bundle.',
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
return;
|
|
25
|
+
hasErrors: true,
|
|
26
|
+
};
|
|
28
27
|
}
|
|
29
28
|
// Show completed bundle tasks so the user knows what's happening.
|
|
30
29
|
reporter.setOptions({ ...reporter.getOptions(), showCompleted: true });
|
|
@@ -66,9 +65,9 @@ export const execute = async (params) => {
|
|
|
66
65
|
]
|
|
67
66
|
.filter(Boolean)
|
|
68
67
|
.join(', ');
|
|
69
|
-
|
|
68
|
+
return {
|
|
70
69
|
message: `Bundling ${status}\n`,
|
|
71
|
-
|
|
72
|
-
}
|
|
70
|
+
hasErrors: !!errorPackagesCount,
|
|
71
|
+
};
|
|
73
72
|
};
|
|
74
73
|
//# sourceMappingURL=execute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/bundle/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,MAAM,CAAC,MAAM,OAAO,GAAiC,KAAK,EAAE,MAAM,EAAE,EAAE;IACpE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/b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E,MAAM,EAAE,CAAC;YACnC,iBAAiB,EAAE,CAAC;QACtB,CAAC;aAAM,CAAC;YACN,oBAAoB,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG;QACb,kBAAkB,IAAI,GAAG,CAAC,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;QACzE,iBAAiB,IAAI,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,mCAAmC,CAAC,CAAC;QAC3F,oBAAoB,IAAI,MAAM,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;KAC5E;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO;QACL,OAAO,EAAE,YAAY,MAAM,IAAI;QAC/B,SAAS,EAAE,CAAC,CAAC,kBAAkB;KAChC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { createPartialApiContext, ensurePackageBundled } from '@ms-cloudpack/api-server';\nimport { plural, red, yellow } from '@ms-cloudpack/task-reporter';\nimport path from 'path';\nimport type { CommandAction } from '../../types/CommandAction.js';\nimport type { BundleOptions } from './types/BundleOptions.js';\nimport { getFilteredPackages } from '../../utilities/getFilteredPackages.js';\n\nexport const execute: CommandAction<BundleOptions> = async (params) => {\n const { cwd: appPath, options, reporter, initialize, autoDispose } = params;\n const apiContextOptions = await initialize({\n appPath,\n configOptions: {\n mode: options.mode,\n // Handle --bundler by passing it as a universal package override, which will be appended\n // to any user-provided packageSettings so that it takes precedence.\n extraPackageSettings: options.bundler ? [{ match: '*', bundler: options.bundler }] : undefined,\n },\n });\n\n console.log('Bundle mode:', yellow(options.mode));\n\n const [ctx] = autoDispose(\n await createPartialApiContext({\n ...apiContextOptions,\n items: ['packages', 'watcher', 'session', 'taskRunner', 'bus', 'packageImportPaths', 'packageHashes'],\n }),\n );\n\n const pathsToBundle = options.match ? getFilteredPackages(ctx.session.resolveMap, options.match) : [appPath];\n\n if (!pathsToBundle.length) {\n return {\n message: 'No matching packages found to bundle.',\n hasErrors: true,\n };\n }\n\n // Show completed bundle tasks so the user knows what's happening.\n reporter.setOptions({ ...reporter.getOptions(), showCompleted: true });\n\n let warnPackagesCount = 0;\n let errorPackagesCount = 0;\n let successPackagesCount = 0;\n\n for (const packagePath of pathsToBundle) {\n // If outdir is set, resolve relative to the package/app path.\n // Otherwise, use the default path under the cloudpack cache to stay consistent with init and start,\n // and to avoid potentially messing with the package's original output.\n const outputPath = options.outdir ? path.resolve(packagePath, options.outdir) : undefined;\n\n const definition = await ctx.packages.get(packagePath);\n\n const { result } = await ensurePackageBundled({\n input: {\n name: definition.name,\n version: definition.version,\n outputPath,\n disableSourceMaps: options.disableSourceMaps,\n shouldForce: true,\n isIncremental: false,\n },\n ctx,\n });\n\n console.log('Output:', result.outputPath, '\\n');\n\n if (result.errors?.length) {\n errorPackagesCount++;\n } else if (result.warnings?.length) {\n warnPackagesCount++;\n } else {\n successPackagesCount++;\n }\n }\n\n const status = [\n errorPackagesCount && red(plural(errorPackagesCount, 'package$s failed')),\n warnPackagesCount && yellow(plural(warnPackagesCount, 'package$s succeeded with warnings')),\n successPackagesCount && plural(successPackagesCount, 'package$s succeeded'),\n ]\n .filter(Boolean)\n .join(', ');\n\n return {\n message: `Bundling ${status}\\n`,\n hasErrors: !!errorPackagesCount,\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,CAkB/C,CAAC"}
|
|
@@ -2,25 +2,20 @@ import { getCachePath } from '@ms-cloudpack/config';
|
|
|
2
2
|
import fsPromises from 'fs/promises';
|
|
3
3
|
/** Clear the Cloudpack cache. */
|
|
4
4
|
export const execute = async (params) => {
|
|
5
|
-
const { cwd, initialize,
|
|
5
|
+
const { cwd, initialize, options } = params;
|
|
6
6
|
await initialize({ appPath: cwd });
|
|
7
7
|
const cachePath = await getCachePath(options.cachePath);
|
|
8
8
|
const cacheDescription = `the Cloudpack cache (${cachePath})`;
|
|
9
|
-
let message;
|
|
10
|
-
let hasErrors = false;
|
|
11
9
|
try {
|
|
12
10
|
// NOTE: if the method used here changes, be sure to update what cache.e2e.test.ts spies on
|
|
13
11
|
await fsPromises.rm(cachePath, { recursive: true, force: true });
|
|
14
|
-
message
|
|
15
|
-
hasErrors = false;
|
|
12
|
+
return { message: `Successfully cleared ${cacheDescription}` };
|
|
16
13
|
}
|
|
17
14
|
catch (err) {
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
return {
|
|
16
|
+
message: `Failed to clear ${cacheDescription}: ${err.message || err}`,
|
|
17
|
+
hasErrors: true,
|
|
18
|
+
};
|
|
20
19
|
}
|
|
21
|
-
await exit({
|
|
22
|
-
exitCode: hasErrors ? 1 : 0,
|
|
23
|
-
message,
|
|
24
|
-
});
|
|
25
20
|
};
|
|
26
21
|
//# sourceMappingURL=clean.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.js","sourceRoot":"","sources":["../../../src/commands/cache/clean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,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,
|
|
1
|
+
{"version":3,"file":"clean.js","sourceRoot":"","sources":["../../../src/commands/cache/clean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,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,OAAO,EAAE,GAAG,MAAM,CAAC;IAE5C,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAEnC,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,wBAAwB,SAAS,GAAG,CAAC;IAE9D,IAAI,CAAC;QACH,2FAA2F;QAC3F,MAAM,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACjE,OAAO,EAAE,OAAO,EAAE,wBAAwB,gBAAgB,EAAE,EAAE,CAAC;IACjE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE,mBAAmB,gBAAgB,KAAM,GAAa,CAAC,OAAO,IAAI,GAAG,EAAE;YAChF,SAAS,EAAE,IAAI;SAChB,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { getCachePath } from '@ms-cloudpack/config';\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, options } = params;\n\n await initialize({ appPath: cwd });\n\n const cachePath = await getCachePath(options.cachePath);\n const cacheDescription = `the Cloudpack cache (${cachePath})`;\n\n try {\n // NOTE: if the method used here changes, be sure to update what cache.e2e.test.ts spies on\n await fsPromises.rm(cachePath, { recursive: true, force: true });\n return { message: `Successfully cleared ${cacheDescription}` };\n } catch (err) {\n return {\n message: `Failed to clear ${cacheDescription}: ${(err as Error).message || err}`,\n hasErrors: true,\n };\n }\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { updateUserPreference } from '@ms-cloudpack/config';
|
|
2
2
|
/** Delete a Cloudpack user preference value. */
|
|
3
3
|
export const execute = async (params) => {
|
|
4
|
-
const { cwd, args, initialize
|
|
4
|
+
const { cwd, args, initialize } = params;
|
|
5
5
|
const key = args[0];
|
|
6
6
|
await initialize({ appPath: cwd });
|
|
7
7
|
try {
|
|
@@ -10,13 +10,13 @@ export const execute = async (params) => {
|
|
|
10
10
|
await updateUserPreference({ key, deleteValue: true });
|
|
11
11
|
// Following the pattern of other tools, we don't output anything on success,
|
|
12
12
|
// or if the key was valid but didn't exist.
|
|
13
|
-
|
|
13
|
+
return { message: '' };
|
|
14
14
|
}
|
|
15
15
|
catch (err) {
|
|
16
|
-
|
|
16
|
+
return {
|
|
17
17
|
hasErrors: true,
|
|
18
18
|
message: `Failed to delete "${key}": ${err.message || err}`,
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/config/delete.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAQ5D,gDAAgD;AAChD,MAAM,CAAC,MAAM,OAAO,GAAiC,KAAK,EAAE,MAAM,EAAE,EAAE;IACpE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/config/delete.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAQ5D,gDAAgD;AAChD,MAAM,CAAC,MAAM,OAAO,GAAiC,KAAK,EAAE,MAAM,EAAE,EAAE;IACpE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAA0B,CAAC;IAE7C,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAEnC,IAAI,CAAC;QACH,qFAAqF;QACrF,yCAAyC;QACzC,MAAM,oBAAoB,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,6EAA6E;QAC7E,4CAA4C;QAC5C,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,qBAAqB,GAAG,MAAO,GAAa,CAAC,OAAO,IAAI,GAAG,EAAE;SACvE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { UserPreferences } from '@ms-cloudpack/common-types';\nimport type { CommandAction } from '../../types/CommandAction.js';\nimport { updateUserPreference } from '@ms-cloudpack/config';\n\nexport interface DeleteOptions {}\n\nexport interface DeleteArguments {\n key: string;\n}\n\n/** Delete a Cloudpack user preference value. */\nexport const execute: CommandAction<DeleteOptions> = async (params) => {\n const { cwd, args, initialize } = params;\n const key = args[0] as keyof UserPreferences;\n\n await initialize({ appPath: cwd });\n\n try {\n // Commander should have validated the key based on the given choices, and the update\n // function will also validate its input.\n await updateUserPreference({ key, deleteValue: true });\n // Following the pattern of other tools, we don't output anything on success,\n // or if the key was valid but didn't exist.\n return { message: '' };\n } catch (err) {\n return {\n hasErrors: true,\n message: `Failed to delete \"${key}\": ${(err as Error).message || err}`,\n };\n }\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { allUserPreferences, readUserPreferences } from '@ms-cloudpack/config';
|
|
2
2
|
/** Get a Cloudpack user preference value. */
|
|
3
3
|
export const execute = async (params) => {
|
|
4
|
-
const { cwd, args, initialize
|
|
4
|
+
const { cwd, args, initialize } = params;
|
|
5
5
|
// Commander should have validated the key based on the given choices.
|
|
6
6
|
const key = args[0];
|
|
7
7
|
await initialize({ appPath: cwd });
|
|
@@ -10,15 +10,15 @@ export const execute = async (params) => {
|
|
|
10
10
|
throw new Error(`Invalid key name`);
|
|
11
11
|
}
|
|
12
12
|
const userPreferences = await readUserPreferences();
|
|
13
|
-
|
|
13
|
+
return {
|
|
14
14
|
message: `${userPreferences[key] || ''}`,
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
16
|
}
|
|
17
17
|
catch (err) {
|
|
18
|
-
|
|
18
|
+
return {
|
|
19
19
|
hasErrors: true,
|
|
20
20
|
message: `Failed to get "${key}": ${err.message || err}`,
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=get.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/config/get.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAQ/E,6CAA6C;AAC7C,MAAM,CAAC,MAAM,OAAO,GAA8B,KAAK,EAAE,MAAM,EAAE,EAAE;IACjE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/config/get.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAQ/E,6CAA6C;AAC7C,MAAM,CAAC,MAAM,OAAO,GAA8B,KAAK,EAAE,MAAM,EAAE,EAAE;IACjE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACzC,sEAAsE;IACtE,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAA0B,CAAC;IAE7C,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAEnC,IAAI,CAAC;QACH,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACtC,CAAC;QAED,MAAM,eAAe,GAAG,MAAM,mBAAmB,EAAE,CAAC;QACpD,OAAO;YACL,OAAO,EAAE,GAAG,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE;SACzC,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,kBAAkB,GAAG,MAAO,GAAa,CAAC,OAAO,IAAI,GAAG,EAAE;SACpE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { UserPreferences } from '@ms-cloudpack/common-types';\nimport type { CommandAction } from '../../types/CommandAction.js';\nimport { allUserPreferences, readUserPreferences } from '@ms-cloudpack/config';\n\nexport interface GetOptions {}\n\nexport interface GetArguments {\n key: string;\n}\n\n/** Get a Cloudpack user preference value. */\nexport const execute: CommandAction<GetOptions> = async (params) => {\n const { cwd, args, initialize } = params;\n // Commander should have validated the key based on the given choices.\n const key = args[0] as keyof UserPreferences;\n\n await initialize({ appPath: cwd });\n\n try {\n if (!allUserPreferences[key]) {\n throw new Error(`Invalid key name`);\n }\n\n const userPreferences = await readUserPreferences();\n return {\n message: `${userPreferences[key] || ''}`,\n };\n } catch (err) {\n return {\n hasErrors: true,\n message: `Failed to get \"${key}\": ${(err as Error).message || err}`,\n };\n }\n};\n"]}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { readUserPreferences } from '@ms-cloudpack/config';
|
|
2
2
|
/** List Cloudpack user preferences. */
|
|
3
3
|
export const execute = async (params) => {
|
|
4
|
-
const { cwd, initialize
|
|
4
|
+
const { cwd, initialize } = params;
|
|
5
5
|
await initialize({ appPath: cwd });
|
|
6
6
|
try {
|
|
7
7
|
const userPreferences = await readUserPreferences();
|
|
8
|
-
|
|
8
|
+
return {
|
|
9
9
|
message: Object.entries(userPreferences)
|
|
10
10
|
.map(([key, value]) => `${key}: ${value}`)
|
|
11
11
|
.join('\n'),
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
}
|
|
14
14
|
catch (err) {
|
|
15
|
-
|
|
15
|
+
return {
|
|
16
16
|
hasErrors: true,
|
|
17
17
|
message: `Failed to list preferences: ${err.message || err}`,
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/config/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAI3D,uCAAuC;AACvC,MAAM,CAAC,MAAM,OAAO,GAA+B,KAAK,EAAE,MAAM,EAAE,EAAE;IAClE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/config/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAI3D,uCAAuC;AACvC,MAAM,CAAC,MAAM,OAAO,GAA+B,KAAK,EAAE,MAAM,EAAE,EAAE;IAClE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACnC,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAEnC,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,MAAM,mBAAmB,EAAE,CAAC;QACpD,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;iBACrC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,KAAK,EAAE,CAAC;iBACzC,IAAI,CAAC,IAAI,CAAC;SACd,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,+BAAgC,GAAa,CAAC,OAAO,IAAI,GAAG,EAAE;SACxE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { CommandAction } from '../../types/CommandAction.js';\nimport { readUserPreferences } from '@ms-cloudpack/config';\n\nexport interface ListOptions {}\n\n/** List Cloudpack user preferences. */\nexport const execute: CommandAction<ListOptions> = async (params) => {\n const { cwd, initialize } = params;\n await initialize({ appPath: cwd });\n\n try {\n const userPreferences = await readUserPreferences();\n return {\n message: Object.entries(userPreferences)\n .map(([key, value]) => `${key}: ${value}`)\n .join('\\n'),\n };\n } catch (err) {\n return {\n hasErrors: true,\n message: `Failed to list preferences: ${(err as Error).message || err}`,\n };\n }\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { updateUserPreference } from '@ms-cloudpack/config';
|
|
2
2
|
/** Delete a Cloudpack user preference value. */
|
|
3
3
|
export const execute = async (params) => {
|
|
4
|
-
const { cwd, args, initialize
|
|
4
|
+
const { cwd, args, initialize } = params;
|
|
5
5
|
const [key, newValue] = args;
|
|
6
6
|
await initialize({ appPath: cwd });
|
|
7
7
|
try {
|
|
@@ -9,13 +9,13 @@ export const execute = async (params) => {
|
|
|
9
9
|
// function will also validate its input.
|
|
10
10
|
await updateUserPreference({ key: key, newValue });
|
|
11
11
|
// Following the pattern of other tools, we don't output anything on success.
|
|
12
|
-
|
|
12
|
+
return { message: '' };
|
|
13
13
|
}
|
|
14
14
|
catch (err) {
|
|
15
|
-
|
|
15
|
+
return {
|
|
16
16
|
hasErrors: true,
|
|
17
17
|
message: `Failed to set "${key}": ${err.message || err}`,
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=set.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../src/commands/config/set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAW5D,gDAAgD;AAChD,MAAM,CAAC,MAAM,OAAO,GAA8B,KAAK,EAAE,MAAM,EAAE,EAAE;IACjE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../src/commands/config/set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAW5D,gDAAgD;AAChD,MAAM,CAAC,MAAM,OAAO,GAA8B,KAAK,EAAE,MAAM,EAAE,EAAE;IACjE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACzC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC;IAE7B,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAEnC,IAAI,CAAC;QACH,qFAAqF;QACrF,yCAAyC;QACzC,MAAM,oBAAoB,CAAC,EAAE,GAAG,EAAE,GAA4B,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC5E,6EAA6E;QAC7E,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,kBAAkB,GAAG,MAAO,GAAa,CAAC,OAAO,IAAI,GAAG,EAAE;SACpE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { updateUserPreference } from '@ms-cloudpack/config';\nimport type { CommandAction } from '../../types/CommandAction.js';\nimport type { UserPreferences } from '@ms-cloudpack/common-types';\n\nexport interface SetOptions {}\n\nexport interface SetArguments {\n key: string;\n value: string;\n}\n\n/** Delete a Cloudpack user preference value. */\nexport const execute: CommandAction<SetOptions> = async (params) => {\n const { cwd, args, initialize } = params;\n const [key, newValue] = args;\n\n await initialize({ appPath: cwd });\n\n try {\n // Commander should have validated the key based on the given choices, and the update\n // function will also validate its input.\n await updateUserPreference({ key: key as keyof UserPreferences, newValue });\n // Following the pattern of other tools, we don't output anything on success.\n return { message: '' };\n } catch (err) {\n return {\n hasErrors: true,\n message: `Failed to set \"${key}\": ${(err as Error).message || err}`,\n };\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../../src/commands/info/lockFile/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAKrE,UAAU,eAAe;CAAG;AAE5B,6CAA6C;AAC7C,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../../src/commands/info/lockFile/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAKrE,UAAU,eAAe;CAAG;AAE5B,6CAA6C;AAC7C,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,eAAe,CAqBlD,CAAC"}
|
|
@@ -3,28 +3,24 @@ import { readYarnLock } from './readYarnLock.js';
|
|
|
3
3
|
import { processYarnLock } from './processYarnLock.js';
|
|
4
4
|
/** Executor for the "info lock-file" verb */
|
|
5
5
|
export const execute = async (params) => {
|
|
6
|
-
const { cwd, initialize
|
|
6
|
+
const { cwd, initialize } = params;
|
|
7
7
|
await initialize({ appPath: cwd });
|
|
8
|
-
let message;
|
|
9
|
-
let success = false;
|
|
10
8
|
try {
|
|
11
9
|
// This returns either the lock file contents or an error message
|
|
12
10
|
const lockResult = await readYarnLock(cwd);
|
|
13
11
|
if (typeof lockResult === 'string') {
|
|
14
|
-
message
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
const resolvedVersions = processYarnLock(lockResult);
|
|
18
|
-
message = checkResolvedVersions(resolvedVersions);
|
|
19
|
-
success = true;
|
|
12
|
+
return { message: lockResult, hasErrors: true };
|
|
20
13
|
}
|
|
14
|
+
const resolvedVersions = processYarnLock(lockResult);
|
|
15
|
+
return {
|
|
16
|
+
message: checkResolvedVersions(resolvedVersions),
|
|
17
|
+
};
|
|
21
18
|
}
|
|
22
19
|
catch (err) {
|
|
23
|
-
|
|
20
|
+
return {
|
|
21
|
+
message: `Error getting info from lockfile: ${err.stack || err}`,
|
|
22
|
+
hasErrors: true,
|
|
23
|
+
};
|
|
24
24
|
}
|
|
25
|
-
await exit({
|
|
26
|
-
exitCode: success ? 0 : 1,
|
|
27
|
-
message,
|
|
28
|
-
});
|
|
29
25
|
};
|
|
30
26
|
//# sourceMappingURL=execute.js.map
|
|
@@ -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,MAAM,EAAE,EAAE;IACtE,MAAM,EAAE,GAAG,EAAE,UAAU,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,GAAG,MAAM,CAAC;IACnC,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAEnC,IAAI,CAAC;QACH,iEAAiE;QACjE,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YACnC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAClD,CAAC;QAED,MAAM,gBAAgB,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;QACrD,OAAO;YACL,OAAO,EAAE,qBAAqB,CAAC,gBAAgB,CAAC;SACjD,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE,qCAAsC,GAAa,CAAC,KAAK,IAAI,GAAG,EAAE;YAC3E,SAAS,EAAE,IAAI;SAChB,CAAC;IACJ,CAAC;AACH,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 } = params;\n await initialize({ appPath: cwd });\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 return { message: lockResult, hasErrors: true };\n }\n\n const resolvedVersions = processYarnLock(lockResult);\n return {\n message: checkResolvedVersions(resolvedVersions),\n };\n } catch (err) {\n return {\n message: `Error getting info from lockfile: ${(err as Error).stack || err}`,\n hasErrors: true,\n };\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../../src/commands/info/nonSemverDeps/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGrE,MAAM,WAAW,oBAAoB;IACnC,+BAA+B;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,mDAAmD;AACnD,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../../src/commands/info/nonSemverDeps/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGrE,MAAM,WAAW,oBAAoB;IACnC,+BAA+B;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,mDAAmD;AACnD,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAcvD,CAAC"}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { getNonSemverDeps } from './getNonSemverDeps.js';
|
|
2
2
|
/** Executor for the "info non-semver-deps" verb */
|
|
3
3
|
export const execute = async (params) => {
|
|
4
|
-
const { options, cwd, initialize
|
|
4
|
+
const { options, cwd, initialize } = params;
|
|
5
5
|
await initialize({ appPath: cwd });
|
|
6
|
-
let message;
|
|
7
|
-
let success = false;
|
|
8
6
|
try {
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
return {
|
|
8
|
+
message: await getNonSemverDeps({ ...options, cwd }),
|
|
9
|
+
};
|
|
11
10
|
}
|
|
12
11
|
catch (err) {
|
|
13
|
-
|
|
12
|
+
return {
|
|
13
|
+
message: `Error attempting to get non-semver deps: ${err.stack || err}`,
|
|
14
|
+
hasErrors: true,
|
|
15
|
+
};
|
|
14
16
|
}
|
|
15
|
-
await exit({
|
|
16
|
-
exitCode: success ? 0 : 1,
|
|
17
|
-
message,
|
|
18
|
-
});
|
|
19
17
|
};
|
|
20
18
|
//# sourceMappingURL=execute.js.map
|
|
@@ -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,MAAM,EAAE,EAAE;IAC3E,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,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,GAAG,MAAM,CAAC;IAC5C,MAAM,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAEnC,IAAI,CAAC;QACH,OAAO;YACL,OAAO,EAAE,MAAM,gBAAgB,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,CAAC;SACrD,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE,4CAA6C,GAAa,CAAC,KAAK,IAAI,GAAG,EAAE;YAClF,SAAS,EAAE,IAAI;SAChB,CAAC;IACJ,CAAC;AACH,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 } = params;\n await initialize({ appPath: cwd });\n\n try {\n return {\n message: await getNonSemverDeps({ ...options, cwd }),\n };\n } catch (err) {\n return {\n message: `Error attempting to get non-semver deps: ${(err as Error).stack || err}`,\n hasErrors: true,\n };\n }\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EnsurePackageBundledContext } from '@ms-cloudpack/api-server';
|
|
2
2
|
import type { CloudpackConfig, PackageImporterContext } from '@ms-cloudpack/common-types';
|
|
3
3
|
import type { ResolveMap } from '@ms-cloudpack/package-utilities';
|
|
4
|
-
import type {
|
|
4
|
+
import type { Span } from '@ms-cloudpack/telemetry';
|
|
5
5
|
import type { InitSummaryData } from './InitSummaryData.js';
|
|
6
6
|
import type { InitOptions } from './types/InitOptions.js';
|
|
7
7
|
/**
|
|
@@ -18,7 +18,7 @@ export declare function evaluatePath(options: {
|
|
|
18
18
|
config: CloudpackConfig;
|
|
19
19
|
appPath: string;
|
|
20
20
|
resolveMap: ResolveMap;
|
|
21
|
-
|
|
21
|
+
span: Span;
|
|
22
22
|
initOptions: InitOptions;
|
|
23
23
|
summaryData: InitSummaryData;
|
|
24
24
|
ctx: EnsurePackageBundledContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluatePath.d.ts","sourceRoot":"","sources":["../../../src/commands/init/evaluatePath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAC1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAA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|
|
@@ -7,7 +7,7 @@ import { evaluateDynamicImports } from './evaluateDynamicImports.js';
|
|
|
7
7
|
* in the generated config.
|
|
8
8
|
*/
|
|
9
9
|
export async function evaluatePath(options) {
|
|
10
|
-
const { packagePath, config, initOptions,
|
|
10
|
+
const { packagePath, config, initOptions, span, resolveMap, summaryData, ctx, importerContext, shouldForce, isMultiApp, priority, appPath, } = options;
|
|
11
11
|
const { packages } = ctx;
|
|
12
12
|
const { features } = config;
|
|
13
13
|
// This line is the reason we have to track the importerContext for packages to evaluate:
|
|
@@ -77,7 +77,7 @@ export async function evaluatePath(options) {
|
|
|
77
77
|
// importPathsToEvaluate?.forEach((path) => pathsToEvaluate.set(path, importerContext));
|
|
78
78
|
// importPathsToRefresh?.forEach((path) => pathsToRefresh.add(path));
|
|
79
79
|
if (initOptions.check && (exportsChanges.length || evalErrors.length || dynamicImportsChanges?.length)) {
|
|
80
|
-
|
|
80
|
+
span.addEvent('INIT_CHECK_FAILED', {
|
|
81
81
|
// Don't log the specific errors to telemetry, as they may contain sensitive information.
|
|
82
82
|
reason: exportsChanges || dynamicImportsChanges ? 'Config needs to be updated.' : 'Errors found with imports.',
|
|
83
83
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluatePath.js","sourceRoot":"","sources":["../../../src/commands/init/evaluatePath.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAkBlC;IAQC,MAAM,EACJ,WAAW,EACX,MAAM,EACN,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"evaluatePath.js","sourceRoot":"","sources":["../../../src/commands/init/evaluatePath.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBA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G,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC7C,CAAC;QACD,2BAA2B,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,iGAAiG;IACjG,6EAA6E;IAC7E,wFAAwF;IACxF,qEAAqE;IAErE,IAAI,WAAW,CAAC,KAAK,IAAI,CAAC,cAAc,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,IAAI,qBAAqB,EAAE,MAAM,CAAC,EAAE,CAAC;QACvG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE;YACjC,yFAAyF;YACzF,MAAM,EAAE,cAAc,IAAI,qBAAqB,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,4BAA4B;SAC/G,CAAC,CAAC;QAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAC9B,CAAC;IAED,OAAO;QACL,eAAe;QACf,cAAc;KACf,CAAC;AACJ,CAAC","sourcesContent":["import type { EnsurePackageBundledContext } from '@ms-cloudpack/api-server';\nimport type { CloudpackConfig, PackageImporterContext } from '@ms-cloudpack/common-types';\nimport type { ResolveMap } from '@ms-cloudpack/package-utilities';\nimport type { Span } from '@ms-cloudpack/telemetry';\nimport type { InitSummaryData } from './InitSummaryData.js';\nimport type { InitOptions } from './types/InitOptions.js';\nimport type { GeneratedPackageChanges } from './types/GeneratedPackageChanges.js';\n\nimport { ensurePackageBundled } from '@ms-cloudpack/api-server';\nimport { evaluateImportsForOverrides } from './evaluateImportsForOverrides.js';\nimport { evaluateDynamicImports } from './evaluateDynamicImports.js';\n\n/**\n * A helper which given the packagePath, tries to evaluate the path by bundling things, finding imports,\n * and cross checking the imports with explicit exports. If any exports are missing, they are documented\n * in the generated config.\n */\nexport async function evaluatePath(options: {\n /** Path to evaluate. */\n packagePath: string;\n /** Info about how the parent package */\n importerContext: PackageImporterContext | undefined;\n /** Config so far. This will be modified if new overrides are needed. */\n config: CloudpackConfig;\n appPath: string;\n resolveMap: ResolveMap;\n span: Span;\n initOptions: InitOptions;\n summaryData: InitSummaryData;\n ctx: EnsurePackageBundledContext;\n /** Whether init is running in a multi-app scenario. */\n isMultiApp: boolean;\n shouldForce: boolean;\n /** The priority of the package being evaluated. To be used in the task runner. */\n priority: number;\n}): Promise<{\n /** Map from new package path (to be evaluated) to info about the parent. */\n pathsToEvaluate?: Map<string, PackageImporterContext | undefined>;\n /** Package paths for which new exports were added, so the package should be re-processed. */\n pathsToRefresh?: Set<string>;\n /** Whether a fatal error was encountered. */\n shouldExit?: boolean;\n}> {\n const {\n packagePath,\n config,\n initOptions,\n span,\n resolveMap,\n summaryData,\n ctx,\n importerContext,\n shouldForce,\n isMultiApp,\n priority,\n appPath,\n } = options;\n const { packages } = ctx;\n const { features } = config;\n\n // This line is the reason we have to track the importerContext for packages to evaluate:\n // otherwise if a non-semver package is read here, we'd lose the modifications from the initial\n // time the package was read (and getNonSemverTransform was called) when building the resolve map.\n const definition = await packages.get(packagePath, { refresh: true, importerContext });\n const { name, version } = definition;\n\n console.debug(`Evaluating ${packagePath} with context ${JSON.stringify(importerContext)}`);\n\n // Bundle the package and find the imports it depends on.\n const { result } = await ensurePackageBundled({\n input: {\n name,\n version,\n isIncremental: false,\n shouldGetBundleInfo: true,\n shouldForce,\n shouldRerun: shouldForce,\n useHashAsId: isMultiApp,\n priority,\n disableCache: !initOptions.cache,\n },\n ctx,\n });\n\n const { errors, warnings, info, outputPath } = result;\n\n // Record the results for the summary.\n summaryData.recordResult({ name, version, path: packagePath, errors, warnings, info, outputPath });\n\n // If there were errors or no imports, return early.\n if (errors?.length || !info) {\n return {};\n }\n\n // Given the package imports, find the missing exports maps and update packageOverrides.\n const {\n exportsChanges,\n includedDependenciesChanges,\n errors: evalErrors,\n pathsToEvaluate,\n pathsToRefresh,\n } = await evaluateImportsForOverrides({\n definition,\n packagePath,\n packages,\n info,\n config,\n resolveMap,\n importerContext,\n appPath,\n });\n\n if (evalErrors.length) {\n summaryData.addErrors(packagePath, evalErrors);\n }\n summaryData.recordGeneratedChanges(exportsChanges);\n summaryData.recordGeneratedChanges(includedDependenciesChanges);\n\n let dynamicImportsChanges: undefined | GeneratedPackageChanges[] = undefined;\n if (features?.evaluateDynamicImports) {\n const evaluatedDynamicImports = await evaluateDynamicImports({\n definition,\n packagePath,\n info,\n config,\n packages,\n importerContext,\n });\n\n const { pathsToEvaluate: dynamicImportPathsToEvaluate, pathsToRefresh: dynamicImportPathsToRefresh } =\n evaluatedDynamicImports;\n dynamicImportsChanges = evaluatedDynamicImports.dynamicImportsChanges;\n\n summaryData.recordGeneratedChanges(dynamicImportsChanges);\n\n for (const [evalPath, evalContext] of dynamicImportPathsToEvaluate.entries()) {\n pathsToEvaluate.set(evalPath, evalContext);\n }\n dynamicImportPathsToRefresh.forEach((path) => pathsToRefresh.add(path));\n }\n\n // Uncomment this when #1694 init does not cache packages correctly after editing config is fixed\n // and the heap does not reach the limit as almost every package is enqueued.\n // importPathsToEvaluate?.forEach((path) => pathsToEvaluate.set(path, importerContext));\n // importPathsToRefresh?.forEach((path) => pathsToRefresh.add(path));\n\n if (initOptions.check && (exportsChanges.length || evalErrors.length || dynamicImportsChanges?.length)) {\n span.addEvent('INIT_CHECK_FAILED', {\n // Don't log the specific errors to telemetry, as they may contain sensitive information.\n reason: exportsChanges || dynamicImportsChanges ? 'Config needs to be updated.' : 'Errors found with imports.',\n });\n\n return { shouldExit: true };\n }\n\n return {\n pathsToEvaluate,\n pathsToRefresh,\n };\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import { findCloudpackAppPaths } from '../../utilities/findCloudpackAppPaths.js'
|
|
|
4
4
|
import { InitSummaryData } from './InitSummaryData.js';
|
|
5
5
|
/** Given the path, updates the Cloudpack config with overrides and project settings. */
|
|
6
6
|
export const execute = async (params) => {
|
|
7
|
-
const { options, cwd, initialize,
|
|
7
|
+
const { options, cwd, initialize, autoDispose, setInterruptMessageHandler } = params;
|
|
8
8
|
const appPaths = findCloudpackAppPaths(cwd);
|
|
9
9
|
// `findCloudpackAppPaths` will only return an array of paths in which cloudpack.config.json was found.
|
|
10
10
|
// To ensure initialize can be run even if no cloudpack.config.json was found, we use the cwd directory as a fallback.
|
|
@@ -16,9 +16,9 @@ export const execute = async (params) => {
|
|
|
16
16
|
isInterrupted: true,
|
|
17
17
|
}));
|
|
18
18
|
const summaries = await init({ appSummaries, options, contexts, autoDispose });
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
return {
|
|
20
|
+
hasErrors: summaries.some((summary) => summary.failed),
|
|
21
21
|
message: formatInitSummary({ summaries, options }),
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=execute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/init/execute.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAA+B,KAAK,EAAE,MAAM,EAAE,EAAE;IAClE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/init/execute.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,wFAAwF;A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';\nimport type { CommandAction } from '../../types/CommandAction.js';\nimport { init } from './init.js';\nimport { formatInitSummary } from './formatInitSummary.js';\nimport { findCloudpackAppPaths } from '../../utilities/findCloudpackAppPaths.js';\nimport { InitSummaryData } from './InitSummaryData.js';\n\n/** Given the path, updates the Cloudpack config with overrides and project settings. */\nexport const execute: CommandAction<InitOptions> = async (params) => {\n const { options, cwd, initialize, autoDispose, setInterruptMessageHandler } = params;\n\n const appPaths = findCloudpackAppPaths(cwd);\n\n // `findCloudpackAppPaths` will only return an array of paths in which cloudpack.config.json was found.\n // To ensure initialize can be run even if no cloudpack.config.json was found, we use the cwd directory as a fallback.\n const contexts = await initialize({ appPaths: appPaths.length > 0 ? appPaths : [cwd] });\n\n const appSummaries = Object.fromEntries(\n contexts.map((context) => [context.appPath, new InitSummaryData(context.appPath)]),\n );\n\n setInterruptMessageHandler(() =>\n formatInitSummary({\n summaries: Object.values(appSummaries).map((s) => s.summarize(options)),\n options,\n isInterrupted: true,\n }),\n );\n\n const summaries = await init({ appSummaries, options, contexts, autoDispose });\n\n return {\n hasErrors: summaries.some((summary) => summary.failed),\n message: formatInitSummary({ summaries, options }),\n };\n};\n"]}
|