@uapkg/cli 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/app/CompositionRoot.js.map +1 -1
  2. package/dist/app/UAPKGApplication.js.map +1 -1
  3. package/dist/build/BuildMetadata.js +2 -2
  4. package/dist/cli/parseCommandLine.js.map +1 -1
  5. package/dist/cli/parsing/UAPKGCommandLineParser.js.map +1 -1
  6. package/dist/cli/parsing/UAPKGParserRegistry.js.map +1 -1
  7. package/dist/cli/parsing/modules/AddCommandModule.js +4 -4
  8. package/dist/cli/parsing/modules/AddCommandModule.js.map +1 -1
  9. package/dist/cli/parsing/modules/ConfigCommandModule.js +2 -2
  10. package/dist/cli/parsing/modules/ConfigCommandModule.js.map +1 -1
  11. package/dist/cli/parsing/modules/InitCommandModule.js +2 -2
  12. package/dist/cli/parsing/modules/InitCommandModule.js.map +1 -1
  13. package/dist/cli/parsing/modules/InstallCommandModule.js +3 -3
  14. package/dist/cli/parsing/modules/InstallCommandModule.js.map +1 -1
  15. package/dist/cli/parsing/modules/LifecycleCommandModule.js.map +1 -1
  16. package/dist/cli/parsing/modules/ListCommandModule.js +1 -1
  17. package/dist/cli/parsing/modules/ListCommandModule.js.map +1 -1
  18. package/dist/cli/parsing/modules/LoginCommandModule.js +2 -2
  19. package/dist/cli/parsing/modules/LoginCommandModule.js.map +1 -1
  20. package/dist/cli/parsing/modules/LogoutCommandModule.js.map +1 -1
  21. package/dist/cli/parsing/modules/OutdatedCommandModule.js.map +1 -1
  22. package/dist/cli/parsing/modules/PackCommandModule.js +2 -2
  23. package/dist/cli/parsing/modules/PackCommandModule.js.map +1 -1
  24. package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js.map +1 -1
  25. package/dist/cli/parsing/modules/PublishCommandModule.js +3 -3
  26. package/dist/cli/parsing/modules/PublishCommandModule.js.map +1 -1
  27. package/dist/cli/parsing/modules/RegistryCommandModule.js.map +1 -1
  28. package/dist/cli/parsing/modules/RemoveCommandModule.js +1 -1
  29. package/dist/cli/parsing/modules/RemoveCommandModule.js.map +1 -1
  30. package/dist/cli/parsing/modules/RequestsCommandModule.js +1 -1
  31. package/dist/cli/parsing/modules/RequestsCommandModule.js.map +1 -1
  32. package/dist/cli/parsing/modules/UpdateCommandModule.js +3 -3
  33. package/dist/cli/parsing/modules/UpdateCommandModule.js.map +1 -1
  34. package/dist/cli/parsing/modules/WhoamiCommandModule.d.ts.map +1 -1
  35. package/dist/cli/parsing/modules/WhoamiCommandModule.js.map +1 -1
  36. package/dist/cli/parsing/modules/WhyCommandModule.js +1 -1
  37. package/dist/cli/parsing/modules/WhyCommandModule.js.map +1 -1
  38. package/dist/cli/runUAPKGCLI.js.map +1 -1
  39. package/dist/cli-bootstrap.js.map +1 -1
  40. package/dist/commands/AddCommand.js.map +1 -1
  41. package/dist/commands/ConfigCommand.js.map +1 -1
  42. package/dist/commands/InitCommand.d.ts.map +1 -1
  43. package/dist/commands/InitCommand.js +2 -2
  44. package/dist/commands/InitCommand.js.map +1 -1
  45. package/dist/commands/InstallCommand.js.map +1 -1
  46. package/dist/commands/ListCommand.js.map +1 -1
  47. package/dist/commands/LoginCommand.js.map +1 -1
  48. package/dist/commands/LogoutCommand.js.map +1 -1
  49. package/dist/commands/OutdatedCommand.js.map +1 -1
  50. package/dist/commands/PackCommand.js.map +1 -1
  51. package/dist/commands/PackageLifecycleCommand.js.map +1 -1
  52. package/dist/commands/PostinstallCandidateBuilder.js.map +1 -1
  53. package/dist/commands/ProjectGetNameCommand.js.map +1 -1
  54. package/dist/commands/PublishCommand.js.map +1 -1
  55. package/dist/commands/RegistryCommand.js.map +1 -1
  56. package/dist/commands/RemoveCommand.js.map +1 -1
  57. package/dist/commands/RequestsCommand.js.map +1 -1
  58. package/dist/commands/UpdateCommand.js.map +1 -1
  59. package/dist/commands/WhoamiCommand.js.map +1 -1
  60. package/dist/commands/WhyCommand.js.map +1 -1
  61. package/dist/commands/add/DependencyAddResolver.js.map +1 -1
  62. package/dist/control-plane/AccountManager.js +1 -1
  63. package/dist/control-plane/AccountManager.js.map +1 -1
  64. package/dist/control-plane/AuthMetadataStore.js.map +1 -1
  65. package/dist/control-plane/AuthenticationSelector.js +5 -5
  66. package/dist/control-plane/AuthenticationSelector.js.map +1 -1
  67. package/dist/control-plane/ControlPlaneClient.js.map +1 -1
  68. package/dist/control-plane/ControlPlaneEndpoints.js.map +1 -1
  69. package/dist/control-plane/ControlPlaneTypes.js.map +1 -1
  70. package/dist/control-plane/DPoPKeyStore.js.map +1 -1
  71. package/dist/control-plane/GitHubActionsOidcCredentialProvider.js.map +1 -1
  72. package/dist/control-plane/PublishRequestErrorMapper.js.map +1 -1
  73. package/dist/control-plane/RegistryTrustResolver.js.map +1 -1
  74. package/dist/postinstall/api/definePostinstall.js.map +1 -1
  75. package/dist/postinstall/loader/ExportValidator.js.map +1 -1
  76. package/dist/postinstall/loader/PostinstallLoader.js.map +1 -1
  77. package/dist/postinstall/markers/MarkerBlockEditor.js.map +1 -1
  78. package/dist/postinstall/runner/PostinstallOrchestrator.js.map +1 -1
  79. package/dist/postinstall/unreal/BuildCsInjector.js.map +1 -1
  80. package/dist/postinstall/unreal/CSharpInjectionEngine.js.map +1 -1
  81. package/dist/postinstall/unreal/CSharpStructureAnalyzer.d.ts.map +1 -1
  82. package/dist/postinstall/unreal/CSharpStructureAnalyzer.js.map +1 -1
  83. package/dist/postinstall/unreal/TargetCsInjector.js.map +1 -1
  84. package/dist/postinstall/unreal/UnrealSourceCatalog.js.map +1 -1
  85. package/dist/prompts/InkPromptService.js.map +1 -1
  86. package/dist/reporting/DiagnosticReporter.js.map +1 -1
  87. package/dist/reporting/InkDiagnosticRenderer.js.map +1 -1
  88. package/dist/reporting/InstallProgressReporter.js.map +1 -1
  89. package/dist/reporting/JsonReporter.js.map +1 -1
  90. package/dist/reporting/RegistryRequestTerminalFormatter.js +1 -1
  91. package/dist/reporting/RegistryRequestTerminalFormatter.js.map +1 -1
  92. package/dist/reporting/TextDiagnosticRenderer.js.map +1 -1
  93. package/package.json +26 -14
@@ -1 +1 @@
1
- {"version":3,"file":"RequestsCommandModule.js","names":[],"sources":["../../../../src/cli/parsing/modules/RequestsCommandModule.ts"],"sourcesContent":["import type { Argv } from 'yargs';\nimport { createUAPKGCommandLineFactory, type UAPKGRegistryRequestStatus } from '../../UAPKGCommandLine.js';\nimport type { CommandLineSink, UAPKGCommandModule } from '../contracts/UAPKGCommandModule.js';\n\nconst REQUEST_STATUSES = [\n 'queued',\n 'checking',\n 'accepted',\n 'ready',\n 'ready_superseded',\n 'rejected',\n 'operationally_failed',\n] as const;\n\nexport class RequestsCommandModule implements UAPKGCommandModule {\n private readonly factory = createUAPKGCommandLineFactory();\n\n register(parser: Argv, sink: CommandLineSink): Argv {\n return parser.command(\n 'requests',\n 'List or inspect your publishing requests',\n (builder) =>\n builder\n .command(\n 'list',\n 'List your publishing requests',\n (listBuilder) =>\n listBuilder\n .option('registry', { type: 'string', describe: 'Configured registry alias' })\n .option('status', {\n type: 'string',\n choices: REQUEST_STATUSES,\n describe: 'Filter requests by status',\n })\n .option('json', {\n type: 'boolean',\n default: false,\n describe: 'Emit JSON on stdout',\n })\n .strict(),\n (argv) => {\n sink.set(\n this.factory.createRequests('list', {\n cwd: process.cwd(),\n registry: typeof argv.registry === 'string' ? argv.registry : undefined,\n status: typeof argv.status === 'string' ? (argv.status as UAPKGRegistryRequestStatus) : undefined,\n outputFormat: argv.json ? 'json' : 'text',\n }),\n );\n },\n )\n .command(\n 'status <request-id>',\n 'Inspect one publishing request',\n (statusBuilder) =>\n statusBuilder\n .positional('request-id', {\n type: 'string',\n demandOption: true,\n describe: 'Publishing request identifier',\n })\n .option('watch', {\n type: 'boolean',\n default: false,\n describe: 'Watch until the request reaches a terminal state',\n })\n .option('json', {\n type: 'boolean',\n default: false,\n describe: 'Emit JSON on stdout',\n })\n .strict(),\n (argv) => {\n sink.set(\n this.factory.createRequests('status', {\n cwd: process.cwd(),\n requestId: typeof argv['request-id'] === 'string' ? argv['request-id'] : undefined,\n watch: argv.watch === true,\n outputFormat: argv.json ? 'json' : 'text',\n }),\n );\n },\n )\n .demandCommand(1)\n .strict(),\n () => undefined,\n );\n }\n}\n"],"mappings":";;;AAIA,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,IAAa,wBAAb,MAAiE;CAC/D,AAAiB,UAAU,8BAA8B;CAEzD,SAAS,QAAc,MAA6B;EAClD,OAAO,OAAO,QACZ,YACA,6CACC,YACC,QACG,QACC,QACA,kCACC,gBACC,YACG,OAAO,YAAY;GAAE,MAAM;GAAU,UAAU;EAA4B,CAAC,CAAC,CAC7E,OAAO,UAAU;GAChB,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,QAAQ;GACd,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,IACX,SAAS;GACR,KAAK,IACH,KAAK,QAAQ,eAAe,QAAQ;IAClC,KAAK,QAAQ,IAAI;IACjB,UAAU,OAAO,KAAK,aAAa,WAAW,KAAK,WAAW;IAC9D,QAAQ,OAAO,KAAK,WAAW,WAAY,KAAK,SAAwC;IACxF,cAAc,KAAK,OAAO,SAAS;GACrC,CAAC,CACH;EACF,CACF,CAAC,CACA,QACC,uBACA,mCACC,kBACC,cACG,WAAW,cAAc;GACxB,MAAM;GACN,cAAc;GACd,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,SAAS;GACf,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,QAAQ;GACd,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,IACX,SAAS;GACR,KAAK,IACH,KAAK,QAAQ,eAAe,UAAU;IACpC,KAAK,QAAQ,IAAI;IACjB,WAAW,OAAO,KAAK,kBAAkB,WAAW,KAAK,gBAAgB;IACzE,OAAO,KAAK,UAAU;IACtB,cAAc,KAAK,OAAO,SAAS;GACrC,CAAC,CACH;EACF,CACF,CAAC,CACA,cAAc,CAAC,CAAC,CAChB,OAAO,SACN,MACR;CACF;AACF"}
1
+ {"version":3,"file":"RequestsCommandModule.js","names":[],"sources":["../../../../src/cli/parsing/modules/RequestsCommandModule.ts"],"sourcesContent":["import type { Argv } from 'yargs';\nimport { createUAPKGCommandLineFactory, type UAPKGRegistryRequestStatus } from '#cli/cli/UAPKGCommandLine.ts';\nimport type { CommandLineSink, UAPKGCommandModule } from '#cli/cli/parsing/contracts/UAPKGCommandModule.ts';\n\nconst REQUEST_STATUSES = [\n 'queued',\n 'checking',\n 'accepted',\n 'ready',\n 'ready_superseded',\n 'rejected',\n 'operationally_failed',\n] as const;\n\nexport class RequestsCommandModule implements UAPKGCommandModule {\n private readonly factory = createUAPKGCommandLineFactory();\n\n register(parser: Argv, sink: CommandLineSink): Argv {\n return parser.command(\n 'requests',\n 'List or inspect your publishing requests',\n (builder) =>\n builder\n .command(\n 'list',\n 'List your publishing requests',\n (listBuilder) =>\n listBuilder\n .option('registry', { type: 'string', describe: 'Configured registry alias' })\n .option('status', {\n type: 'string',\n choices: REQUEST_STATUSES,\n describe: 'Filter requests by status',\n })\n .option('json', {\n type: 'boolean',\n default: false,\n describe: 'Emit JSON on stdout',\n })\n .strict(),\n (argv) => {\n sink.set(\n this.factory.createRequests('list', {\n cwd: process.cwd(),\n registry: typeof argv.registry === 'string' ? argv.registry : undefined,\n status: typeof argv.status === 'string' ? (argv.status as UAPKGRegistryRequestStatus) : undefined,\n outputFormat: argv.json ? 'json' : 'text',\n }),\n );\n },\n )\n .command(\n 'status <request-id>',\n 'Inspect one publishing request',\n (statusBuilder) =>\n statusBuilder\n .positional('request-id', {\n type: 'string',\n demandOption: true,\n describe: 'Publishing request identifier',\n })\n .option('watch', {\n type: 'boolean',\n default: false,\n describe: 'Watch until the request is ready, rejected, or fails',\n })\n .option('json', {\n type: 'boolean',\n default: false,\n describe: 'Emit JSON on stdout',\n })\n .strict(),\n (argv) => {\n sink.set(\n this.factory.createRequests('status', {\n cwd: process.cwd(),\n requestId: typeof argv['request-id'] === 'string' ? argv['request-id'] : undefined,\n watch: argv.watch === true,\n outputFormat: argv.json ? 'json' : 'text',\n }),\n );\n },\n )\n .demandCommand(1)\n .strict(),\n () => undefined,\n );\n }\n}\n"],"mappings":";;;AAIA,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,IAAa,wBAAb,MAAiE;CAC/D,AAAiB,UAAU,8BAA8B;CAEzD,SAAS,QAAc,MAA6B;EAClD,OAAO,OAAO,QACZ,YACA,6CACC,YACC,QACG,QACC,QACA,kCACC,gBACC,YACG,OAAO,YAAY;GAAE,MAAM;GAAU,UAAU;EAA4B,CAAC,CAAC,CAC7E,OAAO,UAAU;GAChB,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,QAAQ;GACd,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,IACX,SAAS;GACR,KAAK,IACH,KAAK,QAAQ,eAAe,QAAQ;IAClC,KAAK,QAAQ,IAAI;IACjB,UAAU,OAAO,KAAK,aAAa,WAAW,KAAK,WAAW;IAC9D,QAAQ,OAAO,KAAK,WAAW,WAAY,KAAK,SAAwC;IACxF,cAAc,KAAK,OAAO,SAAS;GACrC,CAAC,CACH;EACF,CACF,CAAC,CACA,QACC,uBACA,mCACC,kBACC,cACG,WAAW,cAAc;GACxB,MAAM;GACN,cAAc;GACd,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,SAAS;GACf,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,QAAQ;GACd,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,IACX,SAAS;GACR,KAAK,IACH,KAAK,QAAQ,eAAe,UAAU;IACpC,KAAK,QAAQ,IAAI;IACjB,WAAW,OAAO,KAAK,kBAAkB,WAAW,KAAK,gBAAgB;IACzE,OAAO,KAAK,UAAU;IACtB,cAAc,KAAK,OAAO,SAAS;GACrC,CAAC,CACH;EACF,CACF,CAAC,CACA,cAAc,CAAC,CAAC,CAChB,OAAO,SACN,MACR;CACF;AACF"}
@@ -4,10 +4,10 @@ import { createUAPKGCommandLineFactory } from "../../UAPKGCommandLine.js";
4
4
  var UpdateCommandModule = class {
5
5
  factory = createUAPKGCommandLineFactory();
6
6
  register(parser, sink) {
7
- return parser.command("update [specs..]", "Update dependency graph and lockfile from remote refs", (builder) => builder.positional("specs", {
7
+ return parser.command("update [specs..]", "Update dependencies and the lockfile", (builder) => builder.positional("specs", {
8
8
  type: "string",
9
9
  array: true,
10
- describe: "Optional list of package names to update"
10
+ describe: "Package names with optional version ranges"
11
11
  }).option("force", {
12
12
  type: "boolean",
13
13
  default: false,
@@ -15,7 +15,7 @@ var UpdateCommandModule = class {
15
15
  }).option("dry-run", {
16
16
  type: "boolean",
17
17
  default: false,
18
- describe: "Compute the plan but perform no IO"
18
+ describe: "Preview installation; the manifest, lockfile, and registry cache may still change"
19
19
  }).option("json", {
20
20
  type: "boolean",
21
21
  default: false,
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateCommandModule.js","names":[],"sources":["../../../../src/cli/parsing/modules/UpdateCommandModule.ts"],"sourcesContent":["import type { Argv } from 'yargs';\nimport { createUAPKGCommandLineFactory } from '../../UAPKGCommandLine.js';\nimport type { CommandLineSink, UAPKGCommandModule } from '../contracts/UAPKGCommandModule.js';\n\nexport class UpdateCommandModule implements UAPKGCommandModule {\n private readonly factory = createUAPKGCommandLineFactory();\n\n register(parser: Argv, sink: CommandLineSink) {\n return parser.command(\n 'update [specs..]',\n 'Update dependency graph and lockfile from remote refs',\n (builder) =>\n builder\n .positional('specs', { type: 'string', array: true, describe: 'Optional list of package names to update' })\n .option('force', {\n type: 'boolean',\n default: false,\n describe: 'Override safety policies for local drift/branch divergence',\n })\n .option('dry-run', { type: 'boolean', default: false, describe: 'Compute the plan but perform no IO' })\n .option('json', { type: 'boolean', default: false, describe: 'Emit JSON on stdout' }),\n (argv) => {\n const specsArg = argv.specs;\n const specs = Array.isArray(specsArg) ? (specsArg.filter((v) => typeof v === 'string') as string[]) : [];\n sink.set(\n this.factory.createUpdate({\n cwd: process.cwd(),\n specs,\n force: argv.force,\n dryRun: argv['dry-run'],\n outputFormat: argv.json ? 'json' : 'text',\n }),\n );\n },\n );\n }\n}\n"],"mappings":";;;AAIA,IAAa,sBAAb,MAA+D;CAC7D,AAAiB,UAAU,8BAA8B;CAEzD,SAAS,QAAc,MAAuB;EAC5C,OAAO,OAAO,QACZ,oBACA,0DACC,YACC,QACG,WAAW,SAAS;GAAE,MAAM;GAAU,OAAO;GAAM,UAAU;EAA2C,CAAC,CAAC,CAC1G,OAAO,SAAS;GACf,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,WAAW;GAAE,MAAM;GAAW,SAAS;GAAO,UAAU;EAAqC,CAAC,CAAC,CACtG,OAAO,QAAQ;GAAE,MAAM;GAAW,SAAS;GAAO,UAAU;EAAsB,CAAC,IACvF,SAAS;GACR,MAAM,WAAW,KAAK;GACtB,MAAM,QAAQ,MAAM,QAAQ,QAAQ,IAAK,SAAS,QAAQ,MAAM,OAAO,MAAM,QAAQ,IAAiB,CAAC;GACvG,KAAK,IACH,KAAK,QAAQ,aAAa;IACxB,KAAK,QAAQ,IAAI;IACjB;IACA,OAAO,KAAK;IACZ,QAAQ,KAAK;IACb,cAAc,KAAK,OAAO,SAAS;GACrC,CAAC,CACH;EACF,CACF;CACF;AACF"}
1
+ {"version":3,"file":"UpdateCommandModule.js","names":[],"sources":["../../../../src/cli/parsing/modules/UpdateCommandModule.ts"],"sourcesContent":["import type { Argv } from 'yargs';\nimport { createUAPKGCommandLineFactory } from '#cli/cli/UAPKGCommandLine.ts';\nimport type { CommandLineSink, UAPKGCommandModule } from '#cli/cli/parsing/contracts/UAPKGCommandModule.ts';\n\nexport class UpdateCommandModule implements UAPKGCommandModule {\n private readonly factory = createUAPKGCommandLineFactory();\n\n register(parser: Argv, sink: CommandLineSink) {\n return parser.command(\n 'update [specs..]',\n 'Update dependencies and the lockfile',\n (builder) =>\n builder\n .positional('specs', { type: 'string', array: true, describe: 'Package names with optional version ranges' })\n .option('force', {\n type: 'boolean',\n default: false,\n describe: 'Override safety policies for local drift/branch divergence',\n })\n .option('dry-run', {\n type: 'boolean',\n default: false,\n describe: 'Preview installation; the manifest, lockfile, and registry cache may still change',\n })\n .option('json', { type: 'boolean', default: false, describe: 'Emit JSON on stdout' }),\n (argv) => {\n const specsArg = argv.specs;\n const specs = Array.isArray(specsArg) ? (specsArg.filter((v) => typeof v === 'string') as string[]) : [];\n sink.set(\n this.factory.createUpdate({\n cwd: process.cwd(),\n specs,\n force: argv.force,\n dryRun: argv['dry-run'],\n outputFormat: argv.json ? 'json' : 'text',\n }),\n );\n },\n );\n }\n}\n"],"mappings":";;;AAIA,IAAa,sBAAb,MAA+D;CAC7D,AAAiB,UAAU,8BAA8B;CAEzD,SAAS,QAAc,MAAuB;EAC5C,OAAO,OAAO,QACZ,oBACA,yCACC,YACC,QACG,WAAW,SAAS;GAAE,MAAM;GAAU,OAAO;GAAM,UAAU;EAA6C,CAAC,CAAC,CAC5G,OAAO,SAAS;GACf,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,WAAW;GACjB,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,QAAQ;GAAE,MAAM;GAAW,SAAS;GAAO,UAAU;EAAsB,CAAC,IACvF,SAAS;GACR,MAAM,WAAW,KAAK;GACtB,MAAM,QAAQ,MAAM,QAAQ,QAAQ,IAAK,SAAS,QAAQ,MAAM,OAAO,MAAM,QAAQ,IAAiB,CAAC;GACvG,KAAK,IACH,KAAK,QAAQ,aAAa;IACxB,KAAK,QAAQ,IAAI;IACjB;IACA,OAAO,KAAK;IACZ,QAAQ,KAAK;IACb,cAAc,KAAK,OAAO,SAAS;GACrC,CAAC,CACH;EACF,CACF;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"WhoamiCommandModule.d.ts","names":[],"sources":["../../../../src/cli/parsing/modules/WhoamiCommandModule.ts"],"mappings":";;;cAIa,+BAA+B;mBACzB;EAEjB,SAAS,QAAQ,MAAM,MAAM,kBAAkB"}
1
+ {"version":3,"file":"WhoamiCommandModule.d.ts","names":[],"sources":["../../../../src/cli/parsing/modules/WhoamiCommandModule.ts"],"mappings":";;;cAQa,+BAA+B;mBACzB;EAEjB,SAAS,QAAQ,MAAM,MAAM,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"WhoamiCommandModule.js","names":[],"sources":["../../../../src/cli/parsing/modules/WhoamiCommandModule.ts"],"sourcesContent":["import type { Argv } from 'yargs';\nimport { createUAPKGCommandLineFactory, UAPKG_WHOAMI_FIELDS, type UAPKGWhoamiField } from '../../UAPKGCommandLine.js';\nimport type { CommandLineSink, UAPKGCommandModule } from '../contracts/UAPKGCommandModule.js';\n\nexport class WhoamiCommandModule implements UAPKGCommandModule {\n private readonly factory = createUAPKGCommandLineFactory();\n\n register(parser: Argv, sink: CommandLineSink): Argv {\n return parser.command(\n 'whoami [field]',\n 'Show the account associated with this registry login',\n (builder) =>\n builder\n .positional('field', {\n type: 'string',\n choices: UAPKG_WHOAMI_FIELDS,\n describe: 'Identity or registry field to print',\n })\n .option('registry', {\n type: 'string',\n describe: 'Configured registry alias (defaults to the selected registry)',\n })\n .option('json', {\n type: 'boolean',\n default: false,\n describe: 'Emit JSON on stdout',\n }),\n (argv) => {\n sink.set(\n this.factory.createWhoami({\n cwd: process.cwd(),\n field: typeof argv.field === 'string' ? (argv.field as UAPKGWhoamiField) : undefined,\n registry: typeof argv.registry === 'string' ? argv.registry : undefined,\n outputFormat: argv.json ? 'json' : 'text',\n }),\n );\n },\n );\n }\n}\n"],"mappings":";;;AAIA,IAAa,sBAAb,MAA+D;CAC7D,AAAiB,UAAU,8BAA8B;CAEzD,SAAS,QAAc,MAA6B;EAClD,OAAO,OAAO,QACZ,kBACA,yDACC,YACC,QACG,WAAW,SAAS;GACnB,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,YAAY;GAClB,MAAM;GACN,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,QAAQ;GACd,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,IACJ,SAAS;GACR,KAAK,IACH,KAAK,QAAQ,aAAa;IACxB,KAAK,QAAQ,IAAI;IACjB,OAAO,OAAO,KAAK,UAAU,WAAY,KAAK,QAA6B;IAC3E,UAAU,OAAO,KAAK,aAAa,WAAW,KAAK,WAAW;IAC9D,cAAc,KAAK,OAAO,SAAS;GACrC,CAAC,CACH;EACF,CACF;CACF;AACF"}
1
+ {"version":3,"file":"WhoamiCommandModule.js","names":[],"sources":["../../../../src/cli/parsing/modules/WhoamiCommandModule.ts"],"sourcesContent":["import type { Argv } from 'yargs';\nimport {\n createUAPKGCommandLineFactory,\n UAPKG_WHOAMI_FIELDS,\n type UAPKGWhoamiField,\n} from '#cli/cli/UAPKGCommandLine.ts';\nimport type { CommandLineSink, UAPKGCommandModule } from '#cli/cli/parsing/contracts/UAPKGCommandModule.ts';\n\nexport class WhoamiCommandModule implements UAPKGCommandModule {\n private readonly factory = createUAPKGCommandLineFactory();\n\n register(parser: Argv, sink: CommandLineSink): Argv {\n return parser.command(\n 'whoami [field]',\n 'Show the account associated with this registry login',\n (builder) =>\n builder\n .positional('field', {\n type: 'string',\n choices: UAPKG_WHOAMI_FIELDS,\n describe: 'Identity or registry field to print',\n })\n .option('registry', {\n type: 'string',\n describe: 'Configured registry alias (defaults to the selected registry)',\n })\n .option('json', {\n type: 'boolean',\n default: false,\n describe: 'Emit JSON on stdout',\n }),\n (argv) => {\n sink.set(\n this.factory.createWhoami({\n cwd: process.cwd(),\n field: typeof argv.field === 'string' ? (argv.field as UAPKGWhoamiField) : undefined,\n registry: typeof argv.registry === 'string' ? argv.registry : undefined,\n outputFormat: argv.json ? 'json' : 'text',\n }),\n );\n },\n );\n }\n}\n"],"mappings":";;;AAQA,IAAa,sBAAb,MAA+D;CAC7D,AAAiB,UAAU,8BAA8B;CAEzD,SAAS,QAAc,MAA6B;EAClD,OAAO,OAAO,QACZ,kBACA,yDACC,YACC,QACG,WAAW,SAAS;GACnB,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,YAAY;GAClB,MAAM;GACN,UAAU;EACZ,CAAC,CAAC,CACD,OAAO,QAAQ;GACd,MAAM;GACN,SAAS;GACT,UAAU;EACZ,CAAC,IACJ,SAAS;GACR,KAAK,IACH,KAAK,QAAQ,aAAa;IACxB,KAAK,QAAQ,IAAI;IACjB,OAAO,OAAO,KAAK,UAAU,WAAY,KAAK,QAA6B;IAC3E,UAAU,OAAO,KAAK,aAAa,WAAW,KAAK,WAAW;IAC9D,cAAc,KAAK,OAAO,SAAS;GACrC,CAAC,CACH;EACF,CACF;CACF;AACF"}
@@ -4,7 +4,7 @@ import { createUAPKGCommandLineFactory } from "../../UAPKGCommandLine.js";
4
4
  var WhyCommandModule = class {
5
5
  factory = createUAPKGCommandLineFactory();
6
6
  register(parser, sink) {
7
- return parser.command("why <package>", "Print every dependency path from a graph root to <package>", (builder) => builder.positional("package", {
7
+ return parser.command("why <package>", "Show which dependencies require <package>", (builder) => builder.positional("package", {
8
8
  type: "string",
9
9
  demandOption: true,
10
10
  describe: "Target package name"
@@ -1 +1 @@
1
- {"version":3,"file":"WhyCommandModule.js","names":[],"sources":["../../../../src/cli/parsing/modules/WhyCommandModule.ts"],"sourcesContent":["import type { Argv } from 'yargs';\nimport { createUAPKGCommandLineFactory } from '../../UAPKGCommandLine.js';\nimport type { CommandLineSink, UAPKGCommandModule } from '../contracts/UAPKGCommandModule.js';\n\nexport class WhyCommandModule implements UAPKGCommandModule {\n private readonly factory = createUAPKGCommandLineFactory();\n\n register(parser: Argv, sink: CommandLineSink): Argv {\n return parser.command(\n 'why <package>',\n 'Print every dependency path from a graph root to <package>',\n (builder) =>\n builder\n .positional('package', { type: 'string', demandOption: true, describe: 'Target package name' })\n .option('json', { type: 'boolean', default: false, describe: 'Emit JSON on stdout' }),\n (argv) => {\n sink.set(\n this.factory.createWhy(String(argv.package), {\n cwd: process.cwd(),\n outputFormat: argv.json ? 'json' : 'text',\n }),\n );\n },\n );\n }\n}\n"],"mappings":";;;AAIA,IAAa,mBAAb,MAA4D;CAC1D,AAAiB,UAAU,8BAA8B;CAEzD,SAAS,QAAc,MAA6B;EAClD,OAAO,OAAO,QACZ,iBACA,+DACC,YACC,QACG,WAAW,WAAW;GAAE,MAAM;GAAU,cAAc;GAAM,UAAU;EAAsB,CAAC,CAAC,CAC9F,OAAO,QAAQ;GAAE,MAAM;GAAW,SAAS;GAAO,UAAU;EAAsB,CAAC,IACvF,SAAS;GACR,KAAK,IACH,KAAK,QAAQ,UAAU,OAAO,KAAK,OAAO,GAAG;IAC3C,KAAK,QAAQ,IAAI;IACjB,cAAc,KAAK,OAAO,SAAS;GACrC,CAAC,CACH;EACF,CACF;CACF;AACF"}
1
+ {"version":3,"file":"WhyCommandModule.js","names":[],"sources":["../../../../src/cli/parsing/modules/WhyCommandModule.ts"],"sourcesContent":["import type { Argv } from 'yargs';\nimport { createUAPKGCommandLineFactory } from '#cli/cli/UAPKGCommandLine.ts';\nimport type { CommandLineSink, UAPKGCommandModule } from '#cli/cli/parsing/contracts/UAPKGCommandModule.ts';\n\nexport class WhyCommandModule implements UAPKGCommandModule {\n private readonly factory = createUAPKGCommandLineFactory();\n\n register(parser: Argv, sink: CommandLineSink): Argv {\n return parser.command(\n 'why <package>',\n 'Show which dependencies require <package>',\n (builder) =>\n builder\n .positional('package', { type: 'string', demandOption: true, describe: 'Target package name' })\n .option('json', { type: 'boolean', default: false, describe: 'Emit JSON on stdout' }),\n (argv) => {\n sink.set(\n this.factory.createWhy(String(argv.package), {\n cwd: process.cwd(),\n outputFormat: argv.json ? 'json' : 'text',\n }),\n );\n },\n );\n }\n}\n"],"mappings":";;;AAIA,IAAa,mBAAb,MAA4D;CAC1D,AAAiB,UAAU,8BAA8B;CAEzD,SAAS,QAAc,MAA6B;EAClD,OAAO,OAAO,QACZ,iBACA,8CACC,YACC,QACG,WAAW,WAAW;GAAE,MAAM;GAAU,cAAc;GAAM,UAAU;EAAsB,CAAC,CAAC,CAC9F,OAAO,QAAQ;GAAE,MAAM;GAAW,SAAS;GAAO,UAAU;EAAsB,CAAC,IACvF,SAAS;GACR,KAAK,IACH,KAAK,QAAQ,UAAU,OAAO,KAAK,OAAO,GAAG;IAC3C,KAAK,QAAQ,IAAI;IACjB,cAAc,KAAK,OAAO,SAAS;GACrC,CAAC,CACH;EACF,CACF;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"runUAPKGCLI.js","names":[],"sources":["../../src/cli/runUAPKGCLI.ts"],"sourcesContent":["import { UAPKGApplication } from '../app/UAPKGApplication.js';\nimport { parseUAPKGCommandLine } from './parseCommandLine.js';\n\nexport async function runUAPKGCLI(rawArgv = process.argv) {\n const commandLine = await parseUAPKGCommandLine(rawArgv);\n return await new UAPKGApplication().run(commandLine);\n}\n"],"mappings":";;;;AAGA,eAAsB,YAAY,UAAU,QAAQ,MAAM;CACxD,MAAM,cAAc,MAAM,sBAAsB,OAAO;CACvD,OAAO,MAAM,IAAI,iBAAiB,CAAC,CAAC,IAAI,WAAW;AACrD"}
1
+ {"version":3,"file":"runUAPKGCLI.js","names":[],"sources":["../../src/cli/runUAPKGCLI.ts"],"sourcesContent":["import { UAPKGApplication } from '#cli/app/UAPKGApplication.ts';\nimport { parseUAPKGCommandLine } from '#cli/cli/parseCommandLine.ts';\n\nexport async function runUAPKGCLI(rawArgv = process.argv) {\n const commandLine = await parseUAPKGCommandLine(rawArgv);\n return await new UAPKGApplication().run(commandLine);\n}\n"],"mappings":";;;;AAGA,eAAsB,YAAY,UAAU,QAAQ,MAAM;CACxD,MAAM,cAAc,MAAM,sBAAsB,OAAO;CACvD,OAAO,MAAM,IAAI,iBAAiB,CAAC,CAAC,IAAI,WAAW;AACrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"cli-bootstrap.js","names":[],"sources":["../src/cli-bootstrap.ts"],"sourcesContent":["import Config from '@uapkg/config';\nimport Log, { configureLogger } from '@uapkg/log';\nimport { runUAPKGCLI } from './cli/runUAPKGCLI.js';\n\nConfig.reload({ cwd: process.cwd() });\nconfigureLogger({\n isVerboseEnabled: () => Config.get('term.verbose') === true,\n isQuietEnabled: () => Config.get('term.quiet') === true,\n});\n\nrunUAPKGCLI(process.argv)\n .then((exitCode) => {\n process.exitCode = exitCode;\n })\n .catch((error) => {\n Log.error(error instanceof Error ? error.message : String(error));\n process.exitCode = 1;\n });\n"],"mappings":";;;;;AAIA,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC;AACpC,gBAAgB;CACd,wBAAwB,OAAO,IAAI,cAAc,MAAM;CACvD,sBAAsB,OAAO,IAAI,YAAY,MAAM;AACrD,CAAC;AAED,YAAY,QAAQ,IAAI,CAAC,CACtB,MAAM,aAAa;CAClB,QAAQ,WAAW;AACrB,CAAC,CAAC,CACD,OAAO,UAAU;CAChB,IAAI,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;CAChE,QAAQ,WAAW;AACrB,CAAC"}
1
+ {"version":3,"file":"cli-bootstrap.js","names":[],"sources":["../src/cli-bootstrap.ts"],"sourcesContent":["import Config from '@uapkg/config';\nimport Log, { configureLogger } from '@uapkg/log';\nimport { runUAPKGCLI } from '#cli/cli/runUAPKGCLI.ts';\n\nConfig.reload({ cwd: process.cwd() });\nconfigureLogger({\n isVerboseEnabled: () => Config.get('term.verbose') === true,\n isQuietEnabled: () => Config.get('term.quiet') === true,\n});\n\nrunUAPKGCLI(process.argv)\n .then((exitCode) => {\n process.exitCode = exitCode;\n })\n .catch((error) => {\n Log.error(error instanceof Error ? error.message : String(error));\n process.exitCode = 1;\n });\n"],"mappings":";;;;;AAIA,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC;AACpC,gBAAgB;CACd,wBAAwB,OAAO,IAAI,cAAc,MAAM;CACvD,sBAAsB,OAAO,IAAI,YAAY,MAAM;AACrD,CAAC;AAED,YAAY,QAAQ,IAAI,CAAC,CACtB,MAAM,aAAa;CAClB,QAAQ,WAAW;AACrB,CAAC,CAAC,CACD,OAAO,UAAU;CAChB,IAAI,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;CAChE,QAAQ,WAAW;AACrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AddCommand.js","names":[],"sources":["../../src/commands/AddCommand.ts"],"sourcesContent":["import { parsePackageSpec } from '@uapkg/common';\nimport type { Diagnostic } from '@uapkg/diagnostics';\nimport type { CompositionRoot } from '../app/CompositionRoot.js';\nimport { InstallProgressReporter } from '../reporting/InstallProgressReporter.js';\nimport { DependencyAddResolver } from './add/DependencyAddResolver.js';\nimport type { Command } from './Command.js';\nimport { InstallCommand } from './InstallCommand.js';\n\nexport interface AddCommandOptions {\n readonly spec: string;\n readonly pin: boolean;\n readonly dev: boolean;\n readonly registry?: string;\n readonly force: boolean;\n readonly dryRun: boolean;\n readonly outputFormat: 'text' | 'json';\n}\n\n/**\n * `uapkg add <@Org/Name@range>` — parse the spec, mutate the manifest,\n * delegate to `InstallCommand` for the resolve/install/postinstall pipeline.\n *\n * This command is deliberately thin — it is a manifest-mutation shim around\n * `install`. All resolution/installation invariants live one level down.\n */\nexport class AddCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: AddCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n const specResult = parsePackageSpec(this.options.spec);\n if (!specResult.ok) return this.fail(specResult.diagnostics);\n const spec = specResult.value;\n\n const addResolver = new DependencyAddResolver(this.root);\n const resolved = await addResolver.resolve(spec, this.options.registry);\n if (!resolved.ok) return this.fail(resolved.diagnostics);\n\n const addResult = await this.root.packageManifest.addDependency(\n spec.name as unknown as string,\n resolved.value.dependency,\n {\n bucket: this.options.dev ? 'devDependencies' : 'dependencies',\n pin: this.options.pin,\n },\n );\n if (!addResult.ok) return this.fail(addResult.diagnostics);\n\n // Delegate to Install for the resolve/execute/postinstall pipeline.\n const install = new InstallCommand(this.root, {\n force: this.options.force,\n frozen: false,\n dryRun: this.options.dryRun,\n outputFormat: this.options.outputFormat,\n });\n return install.execute();\n }\n\n private fail(diagnostics: readonly Diagnostic[]): number {\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({ status: 'error', command: 'add', diagnostics });\n } else {\n this.root.diagnostics.reportAll(diagnostics);\n }\n return 1;\n }\n}\n\n// Silence an unused-import warning in strict TS setups; retained for type clarity.\nvoid InstallProgressReporter;\n"],"mappings":";;;;;;;;;;;;AAyBA,IAAa,aAAb,MAA2C;CAEtB;CACA;CAFnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;CAChB;CAEH,MAAa,UAA2B;EACtC,MAAM,aAAa,iBAAiB,KAAK,QAAQ,IAAI;EACrD,IAAI,CAAC,WAAW,IAAI,OAAO,KAAK,KAAK,WAAW,WAAW;EAC3D,MAAM,OAAO,WAAW;EAGxB,MAAM,WAAW,MAAM,IADC,sBAAsB,KAAK,IAClB,CAAC,CAAC,QAAQ,MAAM,KAAK,QAAQ,QAAQ;EACtE,IAAI,CAAC,SAAS,IAAI,OAAO,KAAK,KAAK,SAAS,WAAW;EAEvD,MAAM,YAAY,MAAM,KAAK,KAAK,gBAAgB,cAChD,KAAK,MACL,SAAS,MAAM,YACf;GACE,QAAQ,KAAK,QAAQ,MAAM,oBAAoB;GAC/C,KAAK,KAAK,QAAQ;EACpB,CACF;EACA,IAAI,CAAC,UAAU,IAAI,OAAO,KAAK,KAAK,UAAU,WAAW;EASzD,OAAO,IANa,eAAe,KAAK,MAAM;GAC5C,OAAO,KAAK,QAAQ;GACpB,QAAQ;GACR,QAAQ,KAAK,QAAQ;GACrB,cAAc,KAAK,QAAQ;EAC7B,CACa,CAAC,CAAC,QAAQ;CACzB;CAEA,AAAQ,KAAK,aAA4C;EACvD,IAAI,KAAK,QAAQ,iBAAiB,QAChC,KAAK,KAAK,KAAK,KAAK;GAAE,QAAQ;GAAS,SAAS;GAAO;EAAY,CAAC;OAEpE,KAAK,KAAK,YAAY,UAAU,WAAW;EAE7C,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"AddCommand.js","names":[],"sources":["../../src/commands/AddCommand.ts"],"sourcesContent":["import { parsePackageSpec } from '@uapkg/common';\nimport type { Diagnostic } from '@uapkg/diagnostics';\nimport type { CompositionRoot } from '#cli/app/CompositionRoot.ts';\nimport { InstallProgressReporter } from '#cli/reporting/InstallProgressReporter.ts';\nimport { DependencyAddResolver } from '#cli/commands/add/DependencyAddResolver.ts';\nimport type { Command } from '#cli/commands/Command.ts';\nimport { InstallCommand } from '#cli/commands/InstallCommand.ts';\n\nexport interface AddCommandOptions {\n readonly spec: string;\n readonly pin: boolean;\n readonly dev: boolean;\n readonly registry?: string;\n readonly force: boolean;\n readonly dryRun: boolean;\n readonly outputFormat: 'text' | 'json';\n}\n\n/**\n * `uapkg add <@Org/Name@range>` — parse the spec, mutate the manifest,\n * delegate to `InstallCommand` for the resolve/install/postinstall pipeline.\n *\n * This command is deliberately thin — it is a manifest-mutation shim around\n * `install`. All resolution/installation invariants live one level down.\n */\nexport class AddCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: AddCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n const specResult = parsePackageSpec(this.options.spec);\n if (!specResult.ok) return this.fail(specResult.diagnostics);\n const spec = specResult.value;\n\n const addResolver = new DependencyAddResolver(this.root);\n const resolved = await addResolver.resolve(spec, this.options.registry);\n if (!resolved.ok) return this.fail(resolved.diagnostics);\n\n const addResult = await this.root.packageManifest.addDependency(\n spec.name as unknown as string,\n resolved.value.dependency,\n {\n bucket: this.options.dev ? 'devDependencies' : 'dependencies',\n pin: this.options.pin,\n },\n );\n if (!addResult.ok) return this.fail(addResult.diagnostics);\n\n // Delegate to Install for the resolve/execute/postinstall pipeline.\n const install = new InstallCommand(this.root, {\n force: this.options.force,\n frozen: false,\n dryRun: this.options.dryRun,\n outputFormat: this.options.outputFormat,\n });\n return install.execute();\n }\n\n private fail(diagnostics: readonly Diagnostic[]): number {\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({ status: 'error', command: 'add', diagnostics });\n } else {\n this.root.diagnostics.reportAll(diagnostics);\n }\n return 1;\n }\n}\n\n// Silence an unused-import warning in strict TS setups; retained for type clarity.\nvoid InstallProgressReporter;\n"],"mappings":";;;;;;;;;;;;AAyBA,IAAa,aAAb,MAA2C;CAEtB;CACA;CAFnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;CAChB;CAEH,MAAa,UAA2B;EACtC,MAAM,aAAa,iBAAiB,KAAK,QAAQ,IAAI;EACrD,IAAI,CAAC,WAAW,IAAI,OAAO,KAAK,KAAK,WAAW,WAAW;EAC3D,MAAM,OAAO,WAAW;EAGxB,MAAM,WAAW,MAAM,IADC,sBAAsB,KAAK,IAClB,CAAC,CAAC,QAAQ,MAAM,KAAK,QAAQ,QAAQ;EACtE,IAAI,CAAC,SAAS,IAAI,OAAO,KAAK,KAAK,SAAS,WAAW;EAEvD,MAAM,YAAY,MAAM,KAAK,KAAK,gBAAgB,cAChD,KAAK,MACL,SAAS,MAAM,YACf;GACE,QAAQ,KAAK,QAAQ,MAAM,oBAAoB;GAC/C,KAAK,KAAK,QAAQ;EACpB,CACF;EACA,IAAI,CAAC,UAAU,IAAI,OAAO,KAAK,KAAK,UAAU,WAAW;EASzD,OAAO,IANa,eAAe,KAAK,MAAM;GAC5C,OAAO,KAAK,QAAQ;GACpB,QAAQ;GACR,QAAQ,KAAK,QAAQ;GACrB,cAAc,KAAK,QAAQ;EAC7B,CACa,CAAC,CAAC,QAAQ;CACzB;CAEA,AAAQ,KAAK,aAA4C;EACvD,IAAI,KAAK,QAAQ,iBAAiB,QAChC,KAAK,KAAK,KAAK,KAAK;GAAE,QAAQ;GAAS,SAAS;GAAO;EAAY,CAAC;OAEpE,KAAK,KAAK,YAAY,UAAU,WAAW;EAE7C,OAAO;CACT;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigCommand.js","names":[],"sources":["../../src/commands/ConfigCommand.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport {\n type ConfigInstance,\n createConfig,\n isLeafConfigPath,\n parseConfigCliValue,\n validateConfigPath,\n} from '@uapkg/config';\nimport { createParseErrorDiagnostic, type Diagnostic } from '@uapkg/diagnostics';\nimport Log from '@uapkg/log';\nimport type { UAPKGConfigAction, UAPKGConfigScope, UAPKGOutputFormat } from '../cli/UAPKGCommandLine.js';\nimport { DiagnosticReporter } from '../reporting/DiagnosticReporter.js';\nimport type { Command } from './Command.js';\n\nexport interface ConfigCommandOptions {\n cwd: string;\n action: UAPKGConfigAction;\n pathToProperty?: string;\n rawValue?: string;\n scope?: UAPKGConfigScope;\n output: UAPKGOutputFormat;\n showOrigin: boolean;\n trace: boolean;\n}\n\nexport class ConfigCommand implements Command {\n private readonly reporter = new DiagnosticReporter();\n\n constructor(private readonly options: ConfigCommandOptions) {}\n\n async execute() {\n const flagError = this.validateFlags();\n if (flagError) return this.fail([flagError]);\n\n const config = createConfig({ cwd: this.options.cwd });\n this.reportIfText(config.getDiagnostics());\n\n const action = this.options.action;\n switch (action) {\n case 'get':\n return this.executeGet(config);\n case 'list':\n return this.executeList(config);\n case 'set':\n return this.executeSet(config);\n case 'delete':\n return this.executeDelete(config);\n case 'edit':\n return this.executeEdit(config);\n default:\n return this.fail([createParseErrorDiagnostic(`Unsupported config action: ${String(action satisfies never)}`)]);\n }\n }\n\n private executeGet(config: ConfigInstance) {\n const pathToProperty = this.options.pathToProperty;\n if (!pathToProperty) {\n return this.fail([createParseErrorDiagnostic('config get requires path_to_property')]);\n }\n\n if (this.options.trace) {\n const trace = config.trace(pathToProperty).map((entry) => ({\n ...entry,\n file: entry.file ? config.toDisplayPath(entry.file) : undefined,\n }));\n this.print(trace);\n return 0;\n }\n\n if (this.options.showOrigin) {\n if (this.options.scope === 'global') {\n const value = config.get(pathToProperty, { scope: 'global' });\n this.print({\n value,\n source: 'global',\n file: value === null ? undefined : config.toDisplayPath(config.getEditTarget({ scope: 'global' })),\n });\n return 0;\n }\n\n if (this.options.scope === 'local') {\n const value = config.get(pathToProperty, { scope: 'local' });\n const localFile = config.getEditTarget({ scope: 'local' });\n this.print({\n value,\n source: 'local',\n file: value === null ? undefined : config.toDisplayPath(localFile),\n });\n return 0;\n }\n\n const result = config.getWithOrigin(pathToProperty);\n if (!result) {\n this.print({ value: null, source: 'default' });\n return 0;\n }\n this.print({\n ...result,\n file: result.file ? config.toDisplayPath(result.file) : undefined,\n });\n return 0;\n }\n\n if (this.options.scope === 'global') {\n this.print(config.get(pathToProperty, { scope: 'global' }));\n return 0;\n }\n\n if (this.options.scope === 'local') {\n this.print(config.get(pathToProperty, { scope: 'local' }));\n return 0;\n }\n\n this.print(config.get(pathToProperty));\n return 0;\n }\n\n private executeList(config: ConfigInstance) {\n if (this.options.scope === 'global') {\n this.print(config.getAll({ scope: 'global' }));\n return 0;\n }\n\n if (this.options.scope === 'local') {\n this.print(config.getAll({ scope: 'local' }));\n return 0;\n }\n\n this.print(config.getAll());\n return 0;\n }\n\n private executeSet(config: ConfigInstance) {\n const pathToProperty = this.options.pathToProperty;\n const rawValue = this.options.rawValue;\n\n if (!pathToProperty || rawValue === undefined) {\n return this.fail([createParseErrorDiagnostic('config set requires path_to_property and value')]);\n }\n\n const pathValidation = validateConfigPath(pathToProperty);\n if (!pathValidation.ok) return this.fail(pathValidation.diagnostics);\n\n if (!isLeafConfigPath(pathToProperty)) {\n return this.fail([\n createParseErrorDiagnostic(\n `config set only supports leaf properties. Use a concrete path like \"${pathToProperty}.<field>\".`,\n ),\n ]);\n }\n\n const parsedValue = parseConfigCliValue(pathToProperty, rawValue);\n if (!parsedValue.ok) return this.fail(parsedValue.diagnostics);\n\n const plan = config.set(pathToProperty, parsedValue.value, this.options.scope ? { scope: this.options.scope } : {});\n if (!plan.ok) return this.fail(plan.diagnostics);\n\n fs.mkdirSync(path.dirname(plan.value.file), { recursive: true });\n fs.writeFileSync(plan.value.file, `${JSON.stringify(plan.value.values, null, 2)}\\n`, 'utf8');\n config.reload({ cwd: this.options.cwd });\n this.reportIfText(config.getDiagnostics());\n return 0;\n }\n\n private executeDelete(config: ConfigInstance) {\n const pathToProperty = this.options.pathToProperty;\n if (!pathToProperty) {\n return this.fail([createParseErrorDiagnostic('config delete requires path_to_property')]);\n }\n\n const plan = config.delete(pathToProperty, this.options.scope ? { scope: this.options.scope } : {});\n if (!plan.ok) return this.fail(plan.diagnostics);\n\n fs.mkdirSync(path.dirname(plan.value.file), { recursive: true });\n fs.writeFileSync(plan.value.file, `${JSON.stringify(plan.value.values, null, 2)}\\n`, 'utf8');\n config.reload({ cwd: this.options.cwd });\n this.reportIfText(config.getDiagnostics());\n return 0;\n }\n\n private executeEdit(config: ConfigInstance) {\n const filePath = config.getEditTarget(this.options.scope ? { scope: this.options.scope } : {});\n\n if (!fs.existsSync(filePath)) {\n fs.mkdirSync(path.dirname(filePath), { recursive: true });\n fs.writeFileSync(filePath, '{}\\n', 'utf8');\n }\n\n const editorValue = config.get('editor');\n const editor = typeof editorValue === 'string' ? editorValue : process.platform === 'win32' ? 'notepad.exe' : 'vi';\n\n const result = spawnSync(editor, [filePath], {\n cwd: this.options.cwd,\n shell: true,\n stdio: 'inherit',\n });\n\n if (result.error) {\n return this.fail([createParseErrorDiagnostic(`Failed to open editor '${editor}': ${result.error.message}`)]);\n }\n\n if ((result.status ?? 0) !== 0) {\n return this.fail([createParseErrorDiagnostic(`Editor exited with status ${result.status}`)]);\n }\n\n return 0;\n }\n\n private validateFlags(): Diagnostic | null {\n if (this.options.showOrigin && this.options.trace) {\n return createParseErrorDiagnostic('--show-origin and --trace cannot be used together');\n }\n return null;\n }\n\n private fail(diagnostics: readonly Diagnostic[]): number {\n this.reporter.reportAll(diagnostics);\n return 1;\n }\n\n private reportIfText(diagnostics: readonly Diagnostic[]): void {\n if (this.options.output === 'text') {\n this.reporter.reportAll(diagnostics);\n }\n }\n\n private print(value: unknown) {\n if (this.options.output === 'json' || typeof value === 'object') {\n Log.info(JSON.stringify(value, null, 2));\n return;\n }\n\n Log.info(JSON.stringify(value));\n }\n}\n"],"mappings":";;;;;;;;;AA2BA,IAAa,gBAAb,MAA8C;CAGf;CAF7B,AAAiB,WAAW,IAAI,mBAAmB;CAEnD,YAAY,AAAiB,SAA+B;EAA/B;CAAgC;CAE7D,MAAM,UAAU;EACd,MAAM,YAAY,KAAK,cAAc;EACrC,IAAI,WAAW,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC;EAE3C,MAAM,SAAS,aAAa,EAAE,KAAK,KAAK,QAAQ,IAAI,CAAC;EACrD,KAAK,aAAa,OAAO,eAAe,CAAC;EAEzC,MAAM,SAAS,KAAK,QAAQ;EAC5B,QAAQ,QAAR;GACE,KAAK,OACH,OAAO,KAAK,WAAW,MAAM;GAC/B,KAAK,QACH,OAAO,KAAK,YAAY,MAAM;GAChC,KAAK,OACH,OAAO,KAAK,WAAW,MAAM;GAC/B,KAAK,UACH,OAAO,KAAK,cAAc,MAAM;GAClC,KAAK,QACH,OAAO,KAAK,YAAY,MAAM;GAChC,SACE,OAAO,KAAK,KAAK,CAAC,2BAA2B,8BAA8B,OAAO,MAAsB,GAAG,CAAC,CAAC;EACjH;CACF;CAEA,AAAQ,WAAW,QAAwB;EACzC,MAAM,iBAAiB,KAAK,QAAQ;EACpC,IAAI,CAAC,gBACH,OAAO,KAAK,KAAK,CAAC,2BAA2B,sCAAsC,CAAC,CAAC;EAGvF,IAAI,KAAK,QAAQ,OAAO;GACtB,MAAM,QAAQ,OAAO,M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OAAO,KAAK,OAAO,MAAM,SAAS,CAAC,CAAC;EAG7G,KAAK,OAAO,UAAU,OAAO,GAC3B,OAAO,KAAK,KAAK,CAAC,2BAA2B,6BAA6B,OAAO,QAAQ,CAAC,CAAC;EAG7F,OAAO;CACT;CAEA,AAAQ,gBAAmC;EACzC,IAAI,KAAK,QAAQ,cAAc,KAAK,QAAQ,OAC1C,OAAO,2BAA2B,mDAAmD;EAEvF,OAAO;CACT;CAEA,AAAQ,KAAK,aAA4C;EACvD,KAAK,SAAS,UAAU,WAAW;EACnC,OAAO;CACT;CAEA,AAAQ,aAAa,aAA0C;EAC7D,IAAI,KAAK,QAAQ,WAAW,QAC1B,KAAK,SAAS,UAAU,WAAW;CAEvC;CAEA,AAAQ,MAAM,OAAgB;EAC5B,IAAI,KAAK,QAAQ,WAAW,UAAU,OAAO,UAAU,UAAU;GAC/D,IAAI,KAAK,KAAK,UAAU,OAAO,MAAM,CAAC,CAAC;GACvC;EACF;EAEA,IAAI,KAAK,KAAK,UAAU,KAAK,CAAC;CAChC;AACF"}
1
+ {"version":3,"file":"ConfigCommand.js","names":[],"sources":["../../src/commands/ConfigCommand.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport {\n type ConfigInstance,\n createConfig,\n isLeafConfigPath,\n parseConfigCliValue,\n validateConfigPath,\n} from '@uapkg/config';\nimport { createParseErrorDiagnostic, type Diagnostic } from '@uapkg/diagnostics';\nimport Log from '@uapkg/log';\nimport type { UAPKGConfigAction, UAPKGConfigScope, UAPKGOutputFormat } from '#cli/cli/UAPKGCommandLine.ts';\nimport { DiagnosticReporter } from '#cli/reporting/DiagnosticReporter.ts';\nimport type { Command } from '#cli/commands/Command.ts';\n\nexport interface ConfigCommandOptions {\n cwd: string;\n action: UAPKGConfigAction;\n pathToProperty?: string;\n rawValue?: string;\n scope?: UAPKGConfigScope;\n output: UAPKGOutputFormat;\n showOrigin: boolean;\n trace: boolean;\n}\n\nexport class ConfigCommand implements Command {\n private readonly reporter = new DiagnosticReporter();\n\n constructor(private readonly options: ConfigCommandOptions) {}\n\n async execute() {\n const flagError = this.validateFlags();\n if (flagError) return this.fail([flagError]);\n\n const config = createConfig({ cwd: this.options.cwd });\n this.reportIfText(config.getDiagnostics());\n\n const action = this.options.action;\n switch (action) {\n case 'get':\n return this.executeGet(config);\n case 'list':\n return this.executeList(config);\n case 'set':\n return this.executeSet(config);\n case 'delete':\n return this.executeDelete(config);\n case 'edit':\n return this.executeEdit(config);\n default:\n return this.fail([createParseErrorDiagnostic(`Unsupported config action: ${String(action satisfies never)}`)]);\n }\n }\n\n private executeGet(config: ConfigInstance) {\n const pathToProperty = this.options.pathToProperty;\n if (!pathToProperty) {\n return this.fail([createParseErrorDiagnostic('config get requires path_to_property')]);\n }\n\n if (this.options.trace) {\n const trace = config.trace(pathToProperty).map((entry) => ({\n ...entry,\n file: entry.file ? config.toDisplayPath(entry.file) : undefined,\n }));\n this.print(trace);\n return 0;\n }\n\n if (this.options.showOrigin) {\n if (this.options.scope === 'global') {\n const value = config.get(pathToProperty, { scope: 'global' });\n this.print({\n value,\n source: 'global',\n file: value === null ? undefined : config.toDisplayPath(config.getEditTarget({ scope: 'global' })),\n });\n return 0;\n }\n\n if (this.options.scope === 'local') {\n const value = config.get(pathToProperty, { scope: 'local' });\n const localFile = config.getEditTarget({ scope: 'local' });\n this.print({\n value,\n source: 'local',\n file: value === null ? undefined : config.toDisplayPath(localFile),\n });\n return 0;\n }\n\n const result = config.getWithOrigin(pathToProperty);\n if (!result) {\n this.print({ value: null, source: 'default' });\n return 0;\n }\n this.print({\n ...result,\n file: result.file ? config.toDisplayPath(result.file) : undefined,\n });\n return 0;\n }\n\n if (this.options.scope === 'global') {\n this.print(config.get(pathToProperty, { scope: 'global' }));\n return 0;\n }\n\n if (this.options.scope === 'local') {\n this.print(config.get(pathToProperty, { scope: 'local' }));\n return 0;\n }\n\n this.print(config.get(pathToProperty));\n return 0;\n }\n\n private executeList(config: ConfigInstance) {\n if (this.options.scope === 'global') {\n this.print(config.getAll({ scope: 'global' }));\n return 0;\n }\n\n if (this.options.scope === 'local') {\n this.print(config.getAll({ scope: 'local' }));\n return 0;\n }\n\n this.print(config.getAll());\n return 0;\n }\n\n private executeSet(config: ConfigInstance) {\n const pathToProperty = this.options.pathToProperty;\n const rawValue = this.options.rawValue;\n\n if (!pathToProperty || rawValue === undefined) {\n return this.fail([createParseErrorDiagnostic('config set requires path_to_property and value')]);\n }\n\n const pathValidation = validateConfigPath(pathToProperty);\n if (!pathValidation.ok) return this.fail(pathValidation.diagnostics);\n\n if (!isLeafConfigPath(pathToProperty)) {\n return this.fail([\n createParseErrorDiagnostic(\n `config set only supports leaf properties. Use a concrete path like \"${pathToProperty}.<field>\".`,\n ),\n ]);\n }\n\n const parsedValue = parseConfigCliValue(pathToProperty, rawValue);\n if (!parsedValue.ok) return this.fail(parsedValue.diagnostics);\n\n const plan = config.set(pathToProperty, parsedValue.value, this.options.scope ? { scope: this.options.scope } : {});\n if (!plan.ok) return this.fail(plan.diagnostics);\n\n fs.mkdirSync(path.dirname(plan.value.file), { recursive: true });\n fs.writeFileSync(plan.value.file, `${JSON.stringify(plan.value.values, null, 2)}\\n`, 'utf8');\n config.reload({ cwd: this.options.cwd });\n this.reportIfText(config.getDiagnostics());\n return 0;\n }\n\n private executeDelete(config: ConfigInstance) {\n const pathToProperty = this.options.pathToProperty;\n if (!pathToProperty) {\n return this.fail([createParseErrorDiagnostic('config delete requires path_to_property')]);\n }\n\n const plan = config.delete(pathToProperty, this.options.scope ? { scope: this.options.scope } : {});\n if (!plan.ok) return this.fail(plan.diagnostics);\n\n fs.mkdirSync(path.dirname(plan.value.file), { recursive: true });\n fs.writeFileSync(plan.value.file, `${JSON.stringify(plan.value.values, null, 2)}\\n`, 'utf8');\n config.reload({ cwd: this.options.cwd });\n this.reportIfText(config.getDiagnostics());\n return 0;\n }\n\n private executeEdit(config: ConfigInstance) {\n const filePath = config.getEditTarget(this.options.scope ? { scope: this.options.scope } : {});\n\n if (!fs.existsSync(filePath)) {\n fs.mkdirSync(path.dirname(filePath), { recursive: true });\n fs.writeFileSync(filePath, '{}\\n', 'utf8');\n }\n\n const editorValue = config.get('editor');\n const editor = typeof editorValue === 'string' ? editorValue : process.platform === 'win32' ? 'notepad.exe' : 'vi';\n\n const result = spawnSync(editor, [filePath], {\n cwd: this.options.cwd,\n shell: true,\n stdio: 'inherit',\n });\n\n if (result.error) {\n return this.fail([createParseErrorDiagnostic(`Failed to open editor '${editor}': ${result.error.message}`)]);\n }\n\n if ((result.status ?? 0) !== 0) {\n return this.fail([createParseErrorDiagnostic(`Editor exited with status ${result.status}`)]);\n }\n\n return 0;\n }\n\n private validateFlags(): Diagnostic | null {\n if (this.options.showOrigin && this.options.trace) {\n return createParseErrorDiagnostic('--show-origin and --trace cannot be used together');\n }\n return null;\n }\n\n private fail(diagnostics: readonly Diagnostic[]): number {\n this.reporter.reportAll(diagnostics);\n return 1;\n }\n\n private reportIfText(diagnostics: readonly Diagnostic[]): void {\n if (this.options.output === 'text') {\n this.reporter.reportAll(diagnostics);\n }\n }\n\n private print(value: unknown) {\n if (this.options.output === 'json' || typeof value === 'object') {\n Log.info(JSON.stringify(value, null, 2));\n return;\n }\n\n Log.info(JSON.stringify(value));\n }\n}\n"],"mappings":";;;;;;;;;AA2BA,IAAa,gBAAb,MAA8C;CAGf;CAF7B,AAAiB,WAAW,IAAI,mBAAmB;CAEnD,YAAY,AAAiB,SAA+B;EAA/B;CAAgC;CAE7D,MAAM,UAAU;EACd,MAAM,YAAY,KAAK,cAAc;EACrC,IAAI,WAAW,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC;EAE3C,MAAM,SAAS,aAAa,EAAE,KAAK,KAAK,QAAQ,IAAI,CAAC;EACrD,KAAK,aAAa,OAAO,eAAe,CAAC;EAEzC,MAAM,SAAS,KAAK,QAAQ;EAC5B,QAAQ,QAAR;GACE,KAAK,OACH,OAAO,KAAK,WAAW,MA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BAAuB;mBAEf;mBACA;mBACA;mBACA;EAJnB,YACmB,MAAM,iBACN,SAAS,oBACT,UAAU,wBACV,SAAS;EAGf,WAAW;UA2ChB"}
1
+ {"version":3,"file":"InitCommand.d.ts","names":[],"sources":["../../src/commands/InitCommand.ts"],"mappings":";;;;;;UASiB;WACN,eAAe;WACf;;cAaE,uBAAuB;mBAEf;mBACA;mBACA;mBACA;EAJnB,YACmB,MAAM,iBACN,SAAS,oBACT,UAAU,wBACV,SAAS;EAGf,WAAW;UA6ChB"}
@@ -20,7 +20,7 @@ var InitCommand = class {
20
20
  return 1;
21
21
  }
22
22
  const detected = this.detector.detect(this.root.cwd);
23
- const kind = this.options.explicitKind ?? await this.prompts.select("Select manifest kind", [{
23
+ const kind = this.options.explicitKind ?? await this.prompts.select("Manifest type", [{
24
24
  label: "Project",
25
25
  value: "project"
26
26
  }, {
@@ -30,7 +30,7 @@ var InitCommand = class {
30
30
  const rawName = this.options.explicitName ?? await this.prompts.text("Package name", detected.suggestedName);
31
31
  const nameResult = PackageNameSchema.safeParse(rawName.trim());
32
32
  if (!nameResult.success) {
33
- process.stderr.write(`[uapkg] Invalid package name "${rawName}": must be lowercase alphanumeric with hyphens\n`);
33
+ process.stderr.write(`[uapkg] Invalid package name "${rawName}": use lowercase letters, digits, and hyphens, optionally scoped as @owner/package (214 characters maximum)\n`);
34
34
  return 1;
35
35
  }
36
36
  const versionResult = PackageVersionSchema.safeParse(DEFAULT_INITIAL_VERSION);
@@ -1 +1 @@
1
- {"version":3,"file":"InitCommand.js","names":[],"sources":["../../src/commands/InitCommand.ts"],"sourcesContent":["import type { PackageName, PackageVersion } from '@uapkg/common-schema';\nimport { PackageNameSchema, PackageVersionSchema } from '@uapkg/common-schema';\nimport { ManifestReader, ManifestWriter } from '@uapkg/package-manifest';\nimport type { Manifest, ManifestKind } from '@uapkg/package-manifest-schema';\nimport type { CompositionRoot } from '../app/CompositionRoot.js';\nimport type { ProjectContextDetector } from '../prompts/ProjectContextDetector.js';\nimport type { PromptService } from '../prompts/PromptService.js';\nimport type { Command } from './Command.js';\n\nexport interface InitCommandOptions {\n readonly explicitKind?: ManifestKind;\n readonly explicitName?: string;\n}\n\n// ---------------------------------------------------------------------------\n// InitCommand — creates a minimal `uapkg.json` (new schema) for the current\n// working directory, interactively selecting `kind` + `name` when missing.\n//\n// - Writes via `@uapkg/package-manifest` ManifestWriter.\n// - Pre-check uses ManifestReader (fails fast if manifest already present).\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_INITIAL_VERSION = '0.1.0';\n\nexport class InitCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: InitCommandOptions,\n private readonly detector: ProjectContextDetector,\n private readonly prompts: PromptService,\n ) {}\n\n public async execute(): Promise<number> {\n const existing = await new ManifestReader().read(this.root.cwd);\n if (existing.ok) {\n process.stderr.write('[uapkg] uapkg.json already exists in current directory\\n');\n return 1;\n }\n\n const detected = this.detector.detect(this.root.cwd);\n const kind =\n this.options.explicitKind ??\n ((await this.prompts.select(\n 'Select manifest kind',\n [\n { label: 'Project', value: 'project' },\n { label: 'Plugin', value: 'plugin' },\n ],\n detected.suggestedKind,\n )) as ManifestKind);\n\n const rawName = this.options.explicitName ?? (await this.prompts.text('Package name', detected.suggestedName));\n\n const nameResult = PackageNameSchema.safeParse(rawName.trim());\n if (!nameResult.success) {\n process.stderr.write(`[uapkg] Invalid package name \"${rawName}\": must be lowercase alphanumeric with hyphens\\n`);\n return 1;\n }\n const versionResult = PackageVersionSchema.safeParse(DEFAULT_INITIAL_VERSION);\n if (!versionResult.success) {\n process.stderr.write(`[uapkg] Internal error: default version \"${DEFAULT_INITIAL_VERSION}\" rejected by schema\\n`);\n return 1;\n }\n\n const manifest: Manifest = this.buildManifest(kind, nameResult.data, versionResult.data);\n const writeResult = await new ManifestWriter().write(this.root.cwd, manifest);\n if (!writeResult.ok) {\n this.root.diagnostics.reportAll(writeResult.diagnostics);\n return 1;\n }\n\n process.stdout.write(`[uapkg] Created uapkg.json (${kind}) for ${String(nameResult.data)}\\n`);\n return 0;\n }\n\n private buildManifest(kind: ManifestKind, name: PackageName, version: PackageVersion): Manifest {\n if (kind === 'plugin') {\n return { name, version, kind: 'plugin' };\n }\n return { name, version, kind: 'project' };\n }\n}\n"],"mappings":";;;;AAsBA,MAAM,0BAA0B;AAEhC,IAAa,cAAb,MAA4C;CAEvB;CACA;CACA;CACA;CAJnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB,AAAiB,UACjB,AAAiB,SACjB;EAJiB;EACA;EACA;EACA;CAChB;CAEH,MAAa,UAA2B;EAEtC,KAAI,MADmB,IAAI,eAAe,CAAC,CAAC,KAAK,KAAK,KAAK,GAAG,EAClD,CAAC,IAAI;GACf,QAAQ,OAAO,MAAM,0DAA0D;GAC/E,OAAO;EACT;EAEA,MAAM,WAAW,KAAK,SAAS,OAAO,KAAK,KAAK,GAAG;EACnD,MAAM,OACJ,KAAK,QAAQ,gBACX,MAAM,KAAK,QAAQ,OACnB,wBACA,CACE;GAAE,OAAO;GAAW,OAAO;EAAU,GACrC;GAAE,OAAO;GAAU,OAAO;EAAS,CACrC,GACA,SAAS,aACX;EAEF,MAAM,UAAU,KAAK,QAAQ,gBAAiB,MAAM,KAAK,QAAQ,KAAK,gBAAgB,SAAS,aAAa;EAE5G,MAAM,aAAa,kBAAkB,UAAU,QAAQ,KAAK,CAAC;EAC7D,IAAI,CAAC,WAAW,SAAS;GACvB,QAAQ,OAAO,MAAM,iCAAiC,QAAQ,iDAAiD;GAC/G,OAAO;EACT;EACA,MAAM,gBAAgB,qBAAqB,UAAU,uBAAuB;EAC5E,IAAI,CAAC,cAAc,SAAS;GAC1B,QAAQ,OAAO,MAAM,4CAA4C,wBAAwB,uBAAuB;GAChH,OAAO;EACT;EAEA,MAAM,WAAqB,KAAK,cAAc,MAAM,WAAW,MAAM,cAAc,IAAI;EACvF,MAAM,cAAc,MAAM,IAAI,eAAe,CAAC,CAAC,MAAM,KAAK,KAAK,KAAK,QAAQ;EAC5E,IAAI,CAAC,YAAY,IAAI;GACnB,KAAK,KAAK,YAAY,UAAU,YAAY,WAAW;GACvD,OAAO;EACT;EAEA,QAAQ,OAAO,MAAM,+BAA+B,KAAK,QAAQ,OAAO,WAAW,IAAI,EAAE,GAAG;EAC5F,OAAO;CACT;CAEA,AAAQ,cAAc,MAAoB,MAAmB,SAAmC;EAC9F,IAAI,SAAS,UACX,OAAO;GAAE;GAAM;GAAS,MAAM;EAAS;EAEzC,OAAO;GAAE;GAAM;GAAS,MAAM;EAAU;CAC1C;AACF"}
1
+ {"version":3,"file":"InitCommand.js","names":[],"sources":["../../src/commands/InitCommand.ts"],"sourcesContent":["import type { PackageName, PackageVersion } from '@uapkg/common-schema';\nimport { PackageNameSchema, PackageVersionSchema } from '@uapkg/common-schema';\nimport { ManifestReader, ManifestWriter } from '@uapkg/package-manifest';\nimport type { Manifest, ManifestKind } from '@uapkg/package-manifest-schema';\nimport type { CompositionRoot } from '#cli/app/CompositionRoot.ts';\nimport type { ProjectContextDetector } from '#cli/prompts/ProjectContextDetector.ts';\nimport type { PromptService } from '#cli/prompts/PromptService.ts';\nimport type { Command } from '#cli/commands/Command.ts';\n\nexport interface InitCommandOptions {\n readonly explicitKind?: ManifestKind;\n readonly explicitName?: string;\n}\n\n// ---------------------------------------------------------------------------\n// InitCommand — creates a minimal `uapkg.json` (new schema) for the current\n// working directory, interactively selecting `kind` + `name` when missing.\n//\n// - Writes via `@uapkg/package-manifest` ManifestWriter.\n// - Pre-check uses ManifestReader (fails fast if manifest already present).\n// ---------------------------------------------------------------------------\n\nconst DEFAULT_INITIAL_VERSION = '0.1.0';\n\nexport class InitCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: InitCommandOptions,\n private readonly detector: ProjectContextDetector,\n private readonly prompts: PromptService,\n ) {}\n\n public async execute(): Promise<number> {\n const existing = await new ManifestReader().read(this.root.cwd);\n if (existing.ok) {\n process.stderr.write('[uapkg] uapkg.json already exists in current directory\\n');\n return 1;\n }\n\n const detected = this.detector.detect(this.root.cwd);\n const kind =\n this.options.explicitKind ??\n ((await this.prompts.select(\n 'Manifest type',\n [\n { label: 'Project', value: 'project' },\n { label: 'Plugin', value: 'plugin' },\n ],\n detected.suggestedKind,\n )) as ManifestKind);\n\n const rawName = this.options.explicitName ?? (await this.prompts.text('Package name', detected.suggestedName));\n\n const nameResult = PackageNameSchema.safeParse(rawName.trim());\n if (!nameResult.success) {\n process.stderr.write(\n `[uapkg] Invalid package name \"${rawName}\": use lowercase letters, digits, and hyphens, optionally scoped as @owner/package (214 characters maximum)\\n`,\n );\n return 1;\n }\n const versionResult = PackageVersionSchema.safeParse(DEFAULT_INITIAL_VERSION);\n if (!versionResult.success) {\n process.stderr.write(`[uapkg] Internal error: default version \"${DEFAULT_INITIAL_VERSION}\" rejected by schema\\n`);\n return 1;\n }\n\n const manifest: Manifest = this.buildManifest(kind, nameResult.data, versionResult.data);\n const writeResult = await new ManifestWriter().write(this.root.cwd, manifest);\n if (!writeResult.ok) {\n this.root.diagnostics.reportAll(writeResult.diagnostics);\n return 1;\n }\n\n process.stdout.write(`[uapkg] Created uapkg.json (${kind}) for ${String(nameResult.data)}\\n`);\n return 0;\n }\n\n private buildManifest(kind: ManifestKind, name: PackageName, version: PackageVersion): Manifest {\n if (kind === 'plugin') {\n return { name, version, kind: 'plugin' };\n }\n return { name, version, kind: 'project' };\n }\n}\n"],"mappings":";;;;AAsBA,MAAM,0BAA0B;AAEhC,IAAa,cAAb,MAA4C;CAEvB;CACA;CACA;CACA;CAJnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB,AAAiB,UACjB,AAAiB,SACjB;EAJiB;EACA;EACA;EACA;CAChB;CAEH,MAAa,UAA2B;EAEtC,KAAI,MADmB,IAAI,eAAe,CAAC,CAAC,KAAK,KAAK,KAAK,GAAG,EAClD,CAAC,IAAI;GACf,QAAQ,OAAO,MAAM,0DAA0D;GAC/E,OAAO;EACT;EAEA,MAAM,WAAW,KAAK,SAAS,OAAO,KAAK,KAAK,GAAG;EACnD,MAAM,OACJ,KAAK,QAAQ,gBACX,MAAM,KAAK,QAAQ,OACnB,iBACA,CACE;GAAE,OAAO;GAAW,OAAO;EAAU,GACrC;GAAE,OAAO;GAAU,OAAO;EAAS,CACrC,GACA,SAAS,aACX;EAEF,MAAM,UAAU,KAAK,QAAQ,gBAAiB,MAAM,KAAK,QAAQ,KAAK,gBAAgB,SAAS,aAAa;EAE5G,MAAM,aAAa,kBAAkB,UAAU,QAAQ,KAAK,CAAC;EAC7D,IAAI,CAAC,WAAW,SAAS;GACvB,QAAQ,OAAO,MACb,iCAAiC,QAAQ,8GAC3C;GACA,OAAO;EACT;EACA,MAAM,gBAAgB,qBAAqB,UAAU,uBAAuB;EAC5E,IAAI,CAAC,cAAc,SAAS;GAC1B,QAAQ,OAAO,MAAM,4CAA4C,wBAAwB,uBAAuB;GAChH,OAAO;EACT;EAEA,MAAM,WAAqB,KAAK,cAAc,MAAM,WAAW,MAAM,cAAc,IAAI;EACvF,MAAM,cAAc,MAAM,IAAI,eAAe,CAAC,CAAC,MAAM,KAAK,KAAK,KAAK,QAAQ;EAC5E,IAAI,CAAC,YAAY,IAAI;GACnB,KAAK,KAAK,YAAY,UAAU,YAAY,WAAW;GACvD,OAAO;EACT;EAEA,QAAQ,OAAO,MAAM,+BAA+B,KAAK,QAAQ,OAAO,WAAW,IAAI,EAAE,GAAG;EAC5F,OAAO;CACT;CAEA,AAAQ,cAAc,MAAoB,MAAmB,SAAmC;EAC9F,IAAI,SAAS,UACX,OAAO;GAAE;GAAM;GAAS,MAAM;EAAS;EAEzC,OAAO;GAAE;GAAM;GAAS,MAAM;EAAU;CAC1C;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"InstallCommand.js","names":[],"sources":["../../src/commands/InstallCommand.ts"],"sourcesContent":["import type { Diagnostic } from '@uapkg/diagnostics';\nimport type { Lockfile } from '@uapkg/package-manifest-schema';\nimport type { CompositionRoot } from '../app/CompositionRoot.js';\nimport { InstallProgressReporter } from '../reporting/InstallProgressReporter.js';\nimport type { Command } from './Command.js';\nimport { PostinstallCandidateBuilder } from './PostinstallCandidateBuilder.js';\n\nexport interface InstallCommandOptions {\n readonly force: boolean;\n readonly frozen: boolean;\n readonly dryRun: boolean;\n readonly outputFormat: 'text' | 'json';\n}\n\n/**\n * `uapkg install` — resolve → plan → download/extract/remove → postinstall.\n *\n * Pipeline (never throws; errors become diagnostics):\n *\n * 1. Read manifest + previous lockfile (best-effort).\n * 2. `PackageManifest.install({ frozen })` → writes a fresh lockfile.\n * 3. `Installer.execute(...)` → executes the install plan.\n * 4. Consume installer's status stream in parallel via `InstallProgressReporter`.\n * 5. On success (non-dryRun), `PostinstallOrchestrator.run()` for added/updated plugins.\n * 6. Report summary + diagnostics.\n *\n * `--force` and `--frozen` are mutually exclusive; the parser layer enforces this.\n */\nexport class InstallCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: InstallCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n const pm = this.root.packageManifest;\n const commandDiagnostics: Diagnostic[] = [];\n\n const manifestResult = await pm.readManifest();\n if (!manifestResult.ok) return this.fail(manifestResult.diagnostics);\n const manifest = manifestResult.value;\n\n let previousLockfile: Lockfile | null = null;\n if (!this.options.frozen) {\n const previousLockfileResult = await pm.readLockfileOptional();\n if (!previousLockfileResult.ok) return this.fail(previousLockfileResult.diagnostics);\n previousLockfile = previousLockfileResult.value;\n }\n\n const installResult = await pm.install({ frozen: this.options.frozen });\n if (!installResult.ok) return this.fail([...commandDiagnostics, ...installResult.diagnostics]);\n commandDiagnostics.push(...installResult.diagnostics);\n const lockfile = installResult.value;\n if (this.options.frozen) {\n previousLockfile = lockfile;\n }\n\n const progress = new InstallProgressReporter();\n const consumer = progress.consume(this.root.installer.getStatusStream());\n\n // Trusted roots for verification-gated traversal: the manifest's declared buckets.\n const rootDependencies = [\n ...Object.keys(manifest.dependencies ?? {}),\n ...Object.keys(manifest.devDependencies ?? {}),\n ...Object.keys(manifest.peerDependencies ?? {}),\n ];\n\n const executeResult = await this.root.installer.execute(lockfile, previousLockfile, {\n manifestRoot: this.root.cwd,\n force: this.options.force,\n dryRun: this.options.dryRun,\n rootDependencies,\n });\n await consumer;\n\n if (!executeResult.ok) return this.fail([...commandDiagnostics, ...executeResult.diagnostics]);\n const report = executeResult.value;\n const plan = report.plan;\n const hasBranchFailures = report.failed.length > 0 || report.skipped.length > 0;\n\n const builder = new PostinstallCandidateBuilder();\n const candidates = builder.build(this.root, plan, lockfile, new Set(report.installed));\n const manifestType = builder.resolveManifestType(manifest);\n\n let postDiagnostics: readonly Diagnostic[] = [];\n if (!this.options.dryRun && candidates.length > 0) {\n const moduleNameOverride = manifest.kind === 'project' ? manifest.postinstall?.modules : undefined;\n const postResult = await this.root.postinstall.run({\n projectRoot: this.root.cwd,\n manifestType,\n candidates,\n moduleNameOverride,\n });\n postDiagnostics = postResult.diagnostics;\n if (!postResult.ok) {\n return this.fail([...commandDiagnostics, ...executeResult.diagnostics, ...postResult.diagnostics]);\n }\n }\n\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({\n status: hasBranchFailures ? 'error' : 'ok',\n command: 'install',\n data: {\n plan: plan.summary,\n installed: report.installed,\n failed: report.failed,\n skipped: report.skipped,\n incompleteClosure: report.incompleteClosure,\n },\n diagnostics: [...commandDiagnostics, ...executeResult.diagnostics, ...postDiagnostics],\n });\n return hasBranchFailures ? 1 : 0;\n }\n\n this.root.diagnostics.reportAll([...commandDiagnostics, ...executeResult.diagnostics, ...postDiagnostics]);\n progress.renderSummary(plan.summary);\n return hasBranchFailures ? 1 : 0;\n }\n\n private fail(diagnostics: readonly Diagnostic[]): number {\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({ status: 'error', command: 'install', diagnostics });\n } else {\n this.root.diagnostics.reportAll(diagnostics);\n }\n return 1;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,IAAa,iBAAb,MAA+C;CAE1B;CAC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C,KAAK,KAAK,KAAK,KAAK;GAAE,QAAQ;GAAS,SAAS;GAAW;EAAY,CAAC;OAExE,KAAK,KAAK,YAAY,UAAU,WAAW;EAE7C,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"InstallCommand.js","names":[],"sources":["../../src/commands/InstallCommand.ts"],"sourcesContent":["import type { Diagnostic } from '@uapkg/diagnostics';\nimport type { Lockfile } from '@uapkg/package-manifest-schema';\nimport type { CompositionRoot } from '#cli/app/CompositionRoot.ts';\nimport { InstallProgressReporter } from '#cli/reporting/InstallProgressReporter.ts';\nimport type { Command } from '#cli/commands/Command.ts';\nimport { PostinstallCandidateBuilder } from '#cli/commands/PostinstallCandidateBuilder.ts';\n\nexport interface InstallCommandOptions {\n readonly force: boolean;\n readonly frozen: boolean;\n readonly dryRun: boolean;\n readonly outputFormat: 'text' | 'json';\n}\n\n/**\n * `uapkg install` — resolve → plan → download/extract/remove → postinstall.\n *\n * Pipeline (never throws; errors become diagnostics):\n *\n * 1. Read manifest + previous lockfile (best-effort).\n * 2. `PackageManifest.install({ frozen })` → writes a fresh lockfile.\n * 3. `Installer.execute(...)` → executes the install plan.\n * 4. Consume installer's status stream in parallel via `InstallProgressReporter`.\n * 5. On success (non-dryRun), `PostinstallOrchestrator.run()` for added/updated plugins.\n * 6. Report summary + diagnostics.\n *\n * `--force` and `--frozen` are mutually exclusive; the parser layer enforces this.\n */\nexport class InstallCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: InstallCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n const pm = this.root.packageManifest;\n const commandDiagnostics: Diagnostic[] = [];\n\n const manifestResult = await pm.readManifest();\n if (!manifestResult.ok) return this.fail(manifestResult.diagnostics);\n const manifest = manifestResult.value;\n\n let previousLockfile: Lockfile | null = null;\n if (!this.options.frozen) {\n const previousLockfileResult = await pm.readLockfileOptional();\n if (!previousLockfileResult.ok) return this.fail(previousLockfileResult.diagnostics);\n previousLockfile = previousLockfileResult.value;\n }\n\n const installResult = await pm.install({ frozen: this.options.frozen });\n if (!installResult.ok) return this.fail([...commandDiagnostics, ...installResult.diagnostics]);\n commandDiagnostics.push(...installResult.diagnostics);\n const lockfile = installResult.value;\n if (this.options.frozen) {\n previousLockfile = lockfile;\n }\n\n const progress = new InstallProgressReporter();\n const consumer = progress.consume(this.root.installer.getStatusStream());\n\n // Trusted roots for verification-gated traversal: the manifest's declared buckets.\n const rootDependencies = [\n ...Object.keys(manifest.dependencies ?? {}),\n ...Object.keys(manifest.devDependencies ?? {}),\n ...Object.keys(manifest.peerDependencies ?? {}),\n ];\n\n const executeResult = await this.root.installer.execute(lockfile, previousLockfile, {\n manifestRoot: this.root.cwd,\n force: this.options.force,\n dryRun: this.options.dryRun,\n rootDependencies,\n });\n await consumer;\n\n if (!executeResult.ok) return this.fail([...commandDiagnostics, ...executeResult.diagnostics]);\n const report = executeResult.value;\n const plan = report.plan;\n const hasBranchFailures = report.failed.length > 0 || report.skipped.length > 0;\n\n const builder = new PostinstallCandidateBuilder();\n const candidates = builder.build(this.root, plan, lockfile, new Set(report.installed));\n const manifestType = builder.resolveManifestType(manifest);\n\n let postDiagnostics: readonly Diagnostic[] = [];\n if (!this.options.dryRun && candidates.length > 0) {\n const moduleNameOverride = manifest.kind === 'project' ? manifest.postinstall?.modules : undefined;\n const postResult = await this.root.postinstall.run({\n projectRoot: this.root.cwd,\n manifestType,\n candidates,\n moduleNameOverride,\n });\n postDiagnostics = postResult.diagnostics;\n if (!postResult.ok) {\n return this.fail([...commandDiagnostics, ...executeResult.diagnostics, ...postResult.diagnostics]);\n }\n }\n\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({\n status: hasBranchFailures ? 'error' : 'ok',\n command: 'install',\n data: {\n plan: plan.summary,\n installed: report.installed,\n failed: report.failed,\n skipped: report.skipped,\n incompleteClosure: report.incompleteClosure,\n },\n diagnostics: [...commandDiagnostics, ...executeResult.diagnostics, ...postDiagnostics],\n });\n return hasBranchFailures ? 1 : 0;\n }\n\n this.root.diagnostics.reportAll([...commandDiagnostics, ...executeResult.diagnostics, ...postDiagnostics]);\n progress.renderSummary(plan.summary);\n return hasBranchFailures ? 1 : 0;\n }\n\n private fail(diagnostics: readonly Diagnostic[]): number {\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({ status: 'error', command: 'install', diagnostics });\n } else {\n this.root.diagnostics.reportAll(diagnostics);\n }\n return 1;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4BA,IAAa,iBAAb,MAA+C;CAE1B;CACA;CAFnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;CAChB;CAEH,MAAa,UAA2B;EACtC,MAAM,KAAK,KAAK,KAAK;EACrB,MAAM,qBAAmC,CAAC;EAE1C,MAAM,iBAAiB,MAAM,GAAG,aAAa;EAC7C,IAAI,CAAC,eAAe,IAAI,OAAO,KAAK,KAAK,eAAe,WAAW;EACnE,MAAM,WAAW,eAAe;EAEhC,IAAI,mBAAoC;EACxC,IAAI,CAAC,KAAK,QAAQ,QAAQ;GACxB,MAAM,yBAAyB,MAAM,GAAG,qBAAqB;GAC7D,IAAI,CAAC,uBAAuB,IAAI,OAAO,KAAK,KAAK,uBAAuB,WAAW;GACnF,mBAAmB,uBAAuB;EAC5C;EAEA,MAAM,gBAAgB,MAAM,GAAG,QAAQ,EAAE,QAAQ,KAAK,QAAQ,OAAO,CAAC;EACtE,IAAI,CAAC,cAAc,IAAI,OAAO,KAAK,KAAK,CAAC,GAAG,oBAAoB,GAAG,cAAc,WAAW,CAAC;EAC7F,mBAAmB,KAAK,GAAG,cAAc,WAAW;EACpD,MAAM,WAAW,cAAc;EAC/B,IAAI,KAAK,QAAQ,QACf,mBAAmB;EAGrB,MAAM,WAAW,IAAI,wBAAwB;EAC7C,MAAM,WAAW,SAAS,QAAQ,KAAK,KAAK,UAAU,gBAAgB,CAAC;EAGvE,MAAM,mBAAmB;GACvB,GAAG,OAAO,KAAK,SAAS,gBAAgB,CAAC,CAA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AO;IAC5B;IACA,aAAa;KAAC,GAAG;KAAoB,GAAG,cAAc;KAAa,GAAG;IAAe;GACvF,CAAC;GACD,OAAO,oBAAoB,IAAI;EACjC;EAEA,KAAK,KAAK,YAAY,UAAU;GAAC,GAAG;GAAoB,GAAG,cAAc;GAAa,GAAG;EAAe,CAAC;EACzG,SAAS,cAAc,KAAK,OAAO;EACnC,OAAO,oBAAoB,IAAI;CACjC;CAEA,AAAQ,KAAK,aAA4C;EACvD,IAAI,KAAK,QAAQ,iBAAiB,QAChC,KAAK,KAAK,KAAK,KAAK;GAAE,QAAQ;GAAS,SAAS;GAAW;EAAY,CAAC;OAExE,KAAK,KAAK,YAAY,UAAU,WAAW;EAE7C,OAAO;CACT;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ListCommand.js","names":[],"sources":["../../src/commands/ListCommand.ts"],"sourcesContent":["import type { CompositionRoot } from '../app/CompositionRoot.js';\nimport type { Command } from './Command.js';\n\nexport interface ListCommandOptions {\n readonly depth: number;\n readonly outputFormat: 'text' | 'json';\n}\n\n/**\n * `uapkg list [--depth N]` — renders the resolved dependency tree.\n *\n * Pulls the lockfile via {@link PackageManifest.readLockfile}. A depth of 0\n * prints only root declarations; `Infinity` prints everything (duplicates\n * guarded so cycles can't loop forever).\n */\nexport class ListCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: ListCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n const manifestResult = await this.root.packageManifest.readManifest();\n const lockfileResult = await this.root.packageManifest.getLockfileForReadOnly();\n\n if (!manifestResult.ok) {\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({\n status: 'error',\n command: 'list',\n diagnostics: [...(manifestResult.diagnostics ?? [])],\n });\n } else {\n this.root.diagnostics.reportAll(manifestResult.diagnostics);\n }\n return 1;\n }\n\n if (!lockfileResult.ok) {\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({\n status: 'error',\n command: 'list',\n diagnostics: [...(lockfileResult.diagnostics ?? [])],\n });\n } else {\n this.root.diagnostics.reportAll(lockfileResult.diagnostics);\n }\n return 1;\n }\n\n if (this.options.outputFormat === 'text') {\n this.root.diagnostics.reportAll(lockfileResult.diagnostics);\n }\n\n const lockfile = lockfileResult.value;\n const manifest = manifestResult.value;\n const declared = Object.keys({\n ...manifest.dependencies,\n ...manifest.devDependencies,\n });\n\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({\n status: 'ok',\n command: 'list',\n data: { declared, packages: lockfile.packages },\n diagnostics: lockfileResult.diagnostics,\n });\n return 0;\n }\n\n process.stdout.write(`${this.root.cwd}\\n`);\n for (const name of declared) {\n const locked = (lockfile.packages as Record<string, { version: string; registry: string }>)[name];\n if (!locked) {\n process.stdout.write(` ${name} (not in lockfile)\\n`);\n continue;\n }\n process.stdout.write(` ${name}@${locked.version} [${locked.registry}]\\n`);\n }\n if (this.options.depth > 0) {\n const remaining = Object.entries(\n lockfile.packages as Record<string, { version: string; registry: string }>,\n ).filter(([name]) => !declared.includes(name));\n if (remaining.length > 0) {\n process.stdout.write(' --- transitive ---\\n');\n for (const [name, locked] of remaining) {\n process.stdout.write(` ${name}@${locked.version} [${locked.registry}]\\n`);\n }\n }\n }\n return 0;\n }\n}\n"],"mappings":";;;;;;;;AAeA,IAAa,cAAb,MAA4C;CAEvB;CACA;CAFnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;CAChB;CAEH,MAAa,UAA2B;EACtC,MAAM,iBAAiB,MAAM,KAAK,KAAK,gBAAgB,aAAa;EACpE,MAAM,iBAAiB,MAAM,KAAK,KAAK,gBAAgB,uBAAuB;EAE9E,IAAI,CAAC,eAAe,IAAI;GACtB,IAAI,KAAK,QAAQ,iBAAiB,QAChC,KAAK,KAAK,KAAK,KAAK;IAClB,QAAQ;IACR,SAAS;IACT,aAAa,CAAC,GAAI,eAAe,eAAe,CAAC,CAAE;GACrD,CAAC;QAED,KAAK,KAAK,YAAY,UAAU,eAAe,WAAW;GAE5D,O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SAAS,IAAI;GAE9E;EACF;EACA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"ListCommand.js","names":[],"sources":["../../src/commands/ListCommand.ts"],"sourcesContent":["import type { CompositionRoot } from '#cli/app/CompositionRoot.ts';\nimport type { Command } from '#cli/commands/Command.ts';\n\nexport interface ListCommandOptions {\n readonly depth: number;\n readonly outputFormat: 'text' | 'json';\n}\n\n/**\n * `uapkg list [--depth N]` — renders the resolved dependency tree.\n *\n * Pulls the lockfile via {@link PackageManifest.readLockfile}. A depth of 0\n * prints only root declarations; `Infinity` prints everything (duplicates\n * guarded so cycles can't loop forever).\n */\nexport class ListCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: ListCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n const manifestResult = await this.root.packageManifest.readManifest();\n const lockfileResult = await this.root.packageManifest.getLockfileForReadOnly();\n\n if (!manifestResult.ok) {\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({\n status: 'error',\n command: 'list',\n diagnostics: [...(manifestResult.diagnostics ?? [])],\n });\n } else {\n this.root.diagnostics.reportAll(manifestResult.diagnostics);\n }\n return 1;\n }\n\n if (!lockfileResult.ok) {\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({\n status: 'error',\n command: 'list',\n diagnostics: [...(lockfileResult.diagnostics ?? [])],\n });\n } else {\n this.root.diagnostics.reportAll(lockfileResult.diagnostics);\n }\n return 1;\n }\n\n if (this.options.outputFormat === 'text') {\n this.root.diagnostics.reportAll(lockfileResult.diagnostics);\n }\n\n const lockfile = lockfileResult.value;\n const manifest = manifestResult.value;\n const declared = Object.keys({\n ...manifest.dependencies,\n ...manifest.devDependencies,\n });\n\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({\n status: 'ok',\n command: 'list',\n data: { declared, packages: lockfile.packages },\n diagnostics: lockfileResult.diagnostics,\n });\n return 0;\n }\n\n process.stdout.write(`${this.root.cwd}\\n`);\n for (const name of declared) {\n const locked = (lockfile.packages as Record<string, { version: string; registry: string }>)[name];\n if (!locked) {\n process.stdout.write(` ${name} (not in lockfile)\\n`);\n continue;\n }\n process.stdout.write(` ${name}@${locked.version} [${locked.registry}]\\n`);\n }\n if (this.options.depth > 0) {\n const remaining = Object.entries(\n lockfile.packages as Record<string, { version: string; registry: string }>,\n ).filter(([name]) => !declared.includes(name));\n if (remaining.length > 0) {\n process.stdout.write(' --- transitive ---\\n');\n for (const [name, locked] of remaining) {\n process.stdout.write(` ${name}@${locked.version} [${locked.registry}]\\n`);\n }\n }\n }\n return 0;\n }\n}\n"],"mappings":";;;;;;;;AAeA,IAAa,cAAb,MAA4C;CAEvB;CACA;CAFnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;CAChB;CAEH,MAAa,UAA2B;EACtC,MAAM,iBAAiB,MAAM,KAAK,KAAK,gBAAgB,aAAa;EACpE,MAAM,iBAAiB,MAAM,KAAK,KAAK,gBAAgB,uBAAuB;EAE9E,IAAI,CAAC,eAAe,IAAI;GACtB,IAAI,KAAK,QAAQ,iBAAiB,QAChC,KAAK,KAAK,KAAK,KAAK;IAClB,QAAQ;IACR,SAAS;IACT,aAAa,CAAC,GAAI,eAAe,eAAe,CAAC,CAAE;GACrD,CAAC;QAED,KAAK,KAAK,YAAY,UAAU,eAAe,WAAW;GAE5D,OAAO;EACT;EAEA,IAAI,CAAC,eAAe,IAAI;GACtB,IAAI,KAAK,QAAQ,iBAAiB,QAChC,KAAK,KAAK,KAAK,KAAK;IAClB,QAAQ;IACR,SAAS;IACT,aAAa,CAAC,GAAI,eAAe,eAAe,CAAC,CAAE;GACrD,CAAC;QAED,KAAK,KAAK,YAAY,UAAU,eAAe,WAAW;GAE5D,OAAO;EACT;EAEA,IAAI,KAAK,QAAQ,iBAAiB,QAChC,KAAK,KAAK,YAAY,UAAU,eAAe,WAAW;EAG5D,MAAM,WAAW,eAAe;EAChC,MAAM,WAAW,eAAe;EAChC,MAAM,WAAW,OAAO,KAAK;GAC3B,GAAG,SAAS;GACZ,GAAG,SAAS;EACd,CAAC;EAED,IAAI,KAAK,QAAQ,iBAAiB,QAAQ;GACxC,KAAK,KAAK,KAAK,KAAK;IAClB,QAAQ;IACR,SAAS;IACT,MAAM;KAAE;KAAU,UAAU,SAAS;IAAS;IAC9C,aAAa,eAAe;GAC9B,CAAC;GACD,OAAO;EACT;EAEA,QAAQ,OAAO,MAAM,GAAG,KAAK,KAAK,IAAI,GAAG;EACzC,KAAK,MAAM,QAAQ,UAAU;GAC3B,MAAM,SAAU,SAAS,SAAmE;GAC5F,IAAI,CAAC,QAAQ;IACX,QAAQ,OAAO,MAAM,KAAK,KAAK,qBAAqB;IACpD;GACF;GACA,QAAQ,OAAO,MAAM,KAAK,KAAK,GAAG,OAAO,QAAQ,KAAK,OAAO,SAAS,IAAI;EAC5E;EACA,IAAI,KAAK,QAAQ,QAAQ,GAAG;GAC1B,MAAM,YAAY,OAAO,QACvB,SAAS,QACX,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,SAAS,IAAI,CAAC;GAC7C,IAAI,UAAU,SAAS,GAAG;IACxB,QAAQ,OAAO,MAAM,wBAAwB;IAC7C,KAAK,MAAM,CAAC,MAAM,WAAW,WAC3B,QAAQ,OAAO,MAAM,KAAK,KAAK,GAAG,OAAO,QAAQ,KAAK,OAAO,SAAS,IAAI;GAE9E;EACF;EACA,OAAO;CACT;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoginCommand.js","names":[],"sources":["../../src/commands/LoginCommand.ts"],"sourcesContent":["import type { CompositionRoot } from '../app/CompositionRoot.js';\nimport type { UAPKGOutputFormat } from '../cli/UAPKGCommandLine.js';\nimport { type LoginProgressEvent, loginDiagnosticForError } from '../control-plane/AccountManager.js';\nimport type { Command } from './Command.js';\n\nexport interface LoginCommandOptions {\n readonly registry?: string;\n readonly deviceName?: string;\n readonly reauthorize: boolean;\n readonly outputFormat: UAPKGOutputFormat;\n}\n\nexport class LoginCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: LoginCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n try {\n const trust = await this.root.registryTrustResolver.resolve(this.options.registry);\n const result = await this.root.accountManager.login(trust, {\n deviceName: this.options.deviceName,\n reauthorize: this.options.reauthorize,\n onProgress: (event) => this.reportProgress(event),\n });\n if (this.options.outputFormat === 'json') {\n this.root.json.emitSuccess('login', {\n registry: { alias: trust.alias, id: trust.registryId, name: trust.registryName },\n account: result.grant.account,\n deviceName: result.grant.deviceName,\n expiresAt: result.grant.expiresAt,\n warnings: result.warnings,\n });\n } else {\n process.stdout.write(\n `Logged in to \"${trust.alias}\" as ${result.grant.account.username} on ${result.grant.deviceName}.\\n`,\n );\n }\n for (const warning of result.warnings) {\n process.stderr.write(`Warning: ${warning}\\n`);\n }\n return 0;\n } catch (error) {\n const diagnostic = loginDiagnosticForError(error);\n if (this.options.outputFormat === 'json') {\n this.root.json.emitError('login', [diagnostic]);\n } else {\n process.stderr.write(`${diagnostic.message}\\n`);\n }\n return 1;\n }\n }\n\n private reportProgress(event: LoginProgressEvent): void {\n switch (event.type) {\n case 'preparing':\n process.stderr.write(`Preparing browser authorization for \"${event.registryAlias}\"…\\n`);\n break;\n case 'opening-browser':\n process.stderr.write('Opening the UAPKG account page…\\n');\n break;\n case 'browser-open-failed':\n process.stderr.write(\n `Unable to open the browser automatically. Open this one-time URL to continue:\\n${event.authorizationUrl}\\n`,\n );\n break;\n case 'waiting-for-decision':\n process.stderr.write('Waiting for you to approve or deny access in the browser…\\n');\n break;\n case 'approval-received':\n process.stderr.write('Approval received. Verifying the account…\\n');\n break;\n case 'saving-local-credentials':\n process.stderr.write(\"Saving credentials in this device's protected credential store…\\n\");\n break;\n case 'confirming-with-service':\n process.stderr.write('Local credentials saved. Confirming the login with UAPKG…\\n');\n break;\n default:\n event satisfies never;\n }\n }\n}\n"],"mappings":";;;AAYA,IAAa,eAAb,MAA6C;CAExB;CACA;CAFnB,AAAO,YACL,AAAiB,MAC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KAAK;IACH,QAAQ,OAAO,MAAM,6CAA6C;IAClE;GACF,KAAK;IACH,QAAQ,OAAO,MAAM,mEAAmE;IACxF;GACF,KAAK,2BACH,QAAQ,OAAO,MAAM,6DAA6D;EAItF;CACF;AACF"}
1
+ {"version":3,"file":"LoginCommand.js","names":[],"sources":["../../src/commands/LoginCommand.ts"],"sourcesContent":["import type { CompositionRoot } from '#cli/app/CompositionRoot.ts';\nimport type { UAPKGOutputFormat } from '#cli/cli/UAPKGCommandLine.ts';\nimport { type LoginProgressEvent, loginDiagnosticForError } from '#cli/control-plane/AccountManager.ts';\nimport type { Command } from '#cli/commands/Command.ts';\n\nexport interface LoginCommandOptions {\n readonly registry?: string;\n readonly deviceName?: string;\n readonly reauthorize: boolean;\n readonly outputFormat: UAPKGOutputFormat;\n}\n\nexport class LoginCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: LoginCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n try {\n const trust = await this.root.registryTrustResolver.resolve(this.options.registry);\n const result = await this.root.accountManager.login(trust, {\n deviceName: this.options.deviceName,\n reauthorize: this.options.reauthorize,\n onProgress: (event) => this.reportProgress(event),\n });\n if (this.options.outputFormat === 'json') {\n this.root.json.emitSuccess('login', {\n registry: { alias: trust.alias, id: trust.registryId, name: trust.registryName },\n account: result.grant.account,\n deviceName: result.grant.deviceName,\n expiresAt: result.grant.expiresAt,\n warnings: result.warnings,\n });\n } else {\n process.stdout.write(\n `Logged in to \"${trust.alias}\" as ${result.grant.account.username} on ${result.grant.deviceName}.\\n`,\n );\n }\n for (const warning of result.warnings) {\n process.stderr.write(`Warning: ${warning}\\n`);\n }\n return 0;\n } catch (error) {\n const diagnostic = loginDiagnosticForError(error);\n if (this.options.outputFormat === 'json') {\n this.root.json.emitError('login', [diagnostic]);\n } else {\n process.stderr.write(`${diagnostic.message}\\n`);\n }\n return 1;\n }\n }\n\n private reportProgress(event: LoginProgressEvent): void {\n switch (event.type) {\n case 'preparing':\n process.stderr.write(`Preparing browser authorization for \"${event.registryAlias}\"…\\n`);\n break;\n case 'opening-browser':\n process.stderr.write('Opening the UAPKG account page…\\n');\n break;\n case 'browser-open-failed':\n process.stderr.write(\n `Unable to open the browser automatically. Open this one-time URL to continue:\\n${event.authorizationUrl}\\n`,\n );\n break;\n case 'waiting-for-decision':\n process.stderr.write('Waiting for you to approve or deny access in the browser…\\n');\n break;\n case 'approval-received':\n process.stderr.write('Approval received. Verifying the account…\\n');\n break;\n case 'saving-local-credentials':\n process.stderr.write(\"Saving credentials in this device's protected credential store…\\n\");\n break;\n case 'confirming-with-service':\n process.stderr.write('Local credentials saved. Confirming the login with UAPKG…\\n');\n break;\n default:\n event satisfies never;\n }\n }\n}\n"],"mappings":";;;AAYA,IAAa,eAAb,MAA6C;CAExB;CACA;CAFnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;CAChB;CAEH,MAAa,UAA2B;EACtC,IAAI;GACF,MAAM,QAAQ,MAAM,KAAK,KAAK,sBAAsB,QAAQ,KAAK,QAAQ,QAAQ;GACjF,MAAM,SAAS,MAAM,KAAK,KAAK,eAAe,MAAM,OAAO;IACzD,YAAY,KAAK,QAAQ;IACzB,aAAa,KAAK,QAAQ;IAC1B,aAAa,UAAU,KAAK,eAAe,KAAK;GAClD,CAAC;GACD,IAAI,KAAK,QAAQ,iBAAiB,QAChC,KAAK,KAAK,KAAK,YAAY,SAAS;IAClC,UAAU;KAAE,OAAO,MAAM;KAAO,IAAI,MAAM;KAAY,MAAM,MAAM;IAAa;IAC/E,SAAS,OAAO,MAAM;IACtB,YAAY,OAAO,MAAM;IACzB,WAAW,OAAO,MAAM;IACxB,UAAU,OAAO;GACnB,CAAC;QAED,QAAQ,OAAO,MACb,iBAAiB,MAAM,MAAM,OAAO,OAAO,MAAM,QAAQ,SAAS,MAAM,OAAO,MAAM,WAAW,IAClG;GAEF,KAAK,MAAM,WAAW,OAAO,UAC3B,QAAQ,OAAO,MAAM,YAAY,QAAQ,GAAG;GAE9C,OAAO;EACT,SAAS,OAAO;GACd,MAAM,aAAa,wBAAwB,KAAK;GAChD,IAAI,KAAK,QAAQ,iBAAiB,QAChC,KAAK,KAAK,KAAK,UAAU,SAAS,CAAC,UAAU,CAAC;QAE9C,QAAQ,OAAO,MAAM,GAAG,WAAW,QAAQ,GAAG;GAEhD,OAAO;EACT;CACF;CAEA,AAAQ,eAAe,OAAiC;EACtD,QAAQ,MAAM,MAAd;GACE,KAAK;IACH,QAAQ,OAAO,MAAM,wCAAwC,MAAM,cAAc,KAAK;IACtF;GACF,KAAK;IACH,QAAQ,OAAO,MAAM,mCAAmC;IACxD;GACF,KAAK;IACH,QAAQ,OAAO,MACb,kFAAkF,MAAM,iBAAiB,GAC3G;IACA;GACF,KAAK;IACH,QAAQ,OAAO,MAAM,6DAA6D;IAClF;GACF,KAAK;IACH,QAAQ,OAAO,MAAM,6CAA6C;IAClE;GACF,KAAK;IACH,QAAQ,OAAO,MAAM,mEAAmE;IACxF;GACF,KAAK,2BACH,QAAQ,OAAO,MAAM,6DAA6D;EAItF;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"LogoutCommand.js","names":[],"sources":["../../src/commands/LogoutCommand.ts"],"sourcesContent":["import type { CompositionRoot } from '../app/CompositionRoot.js';\nimport type { UAPKGOutputFormat } from '../cli/UAPKGCommandLine.js';\nimport { describeControlPlaneError } from '../control-plane/AccountManager.js';\nimport type { Command } from './Command.js';\n\nexport interface LogoutCommandOptions {\n readonly registry?: string;\n readonly localOnly: boolean;\n readonly outputFormat: UAPKGOutputFormat;\n}\n\nexport class LogoutCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: LogoutCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n try {\n const trust = await this.root.registryTrustResolver.resolve(this.options.registry);\n const result = await this.root.accountManager.logout(trust, this.options.localOnly);\n if (this.options.outputFormat === 'json') {\n process.stdout.write(\n `${JSON.stringify({\n ok: true,\n registry: { alias: trust.alias, id: trust.registryId },\n removed: result === 'removed',\n serverRevoked: result === 'removed' && !this.options.localOnly,\n })}\\n`,\n );\n } else if (result === 'not-logged-in') {\n process.stdout.write(`No saved login exists for \"${trust.alias}\".\\n`);\n } else if (this.options.localOnly) {\n process.stdout.write(\n `Removed the local login for \"${trust.alias}\". The remote grant may remain active; revoke it from the account website.\\n`,\n );\n } else {\n process.stdout.write(`Revoked and removed the saved login for \"${trust.alias}\".\\n`);\n }\n return 0;\n } catch (error) {\n process.stderr.write(`${describeControlPlaneError(error)}\\n`);\n return 1;\n }\n }\n}\n"],"mappings":";;;AAWA,IAAa,gBAAb,MAA8C;CAEzB;CACA;CAFnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;CAChB;CAEH,MAAa,UAA2B;EACtC,IAAI;GACF,MAAM,QAAQ,MAAM,KAAK,KAAK,sBAAsB,QAAQ,KAAK,QAAQ,QAAQ;GACjF,MAAM,SAAS,MAAM,KAAK,KAAK,eAAe,OAAO,OAAO,KAAK,QAAQ,SAAS;GAClF,IAAI,KAAK,QAAQ,iBAAiB,QAChC,QAAQ,OAAO,MACb,GAAG,KAAK,UAAU;IAChB,IAAI;IACJ,UAAU;KAAE,OAAO,MAAM;KAAO,IAAI,MAAM;IAAW;IACrD,SAAS,WAAW;IACpB,eAAe,WAAW,aAAa,CAAC,KAAK,QAAQ;GACvD,CAAC,EAAE,GACL;QACK,IAAI,WAAW,iBACpB,QAAQ,OAAO,MAAM,8BAA8B,MAAM,MAAM,KAAK;QAC/D,IAAI,KAAK,QAAQ,WACtB,QAAQ,OAAO,MACb,gCAAgC,MAAM,MAAM,6EAC9C;QAEA,QAAQ,OAAO,MAAM,4CAA4C,MAAM,MAAM,KAAK;GAEpF,OAAO;EACT,SAAS,OAAO;GACd,QAAQ,OAAO,MAAM,GAAG,0BAA0B,KAAK,EAAE,GAAG;GAC5D,OAAO;EACT;CACF;AACF"}
1
+ {"version":3,"file":"LogoutCommand.js","names":[],"sources":["../../src/commands/LogoutCommand.ts"],"sourcesContent":["import type { CompositionRoot } from '#cli/app/CompositionRoot.ts';\nimport type { UAPKGOutputFormat } from '#cli/cli/UAPKGCommandLine.ts';\nimport { describeControlPlaneError } from '#cli/control-plane/AccountManager.ts';\nimport type { Command } from '#cli/commands/Command.ts';\n\nexport interface LogoutCommandOptions {\n readonly registry?: string;\n readonly localOnly: boolean;\n readonly outputFormat: UAPKGOutputFormat;\n}\n\nexport class LogoutCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: LogoutCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n try {\n const trust = await this.root.registryTrustResolver.resolve(this.options.registry);\n const result = await this.root.accountManager.logout(trust, this.options.localOnly);\n if (this.options.outputFormat === 'json') {\n process.stdout.write(\n `${JSON.stringify({\n ok: true,\n registry: { alias: trust.alias, id: trust.registryId },\n removed: result === 'removed',\n serverRevoked: result === 'removed' && !this.options.localOnly,\n })}\\n`,\n );\n } else if (result === 'not-logged-in') {\n process.stdout.write(`No saved login exists for \"${trust.alias}\".\\n`);\n } else if (this.options.localOnly) {\n process.stdout.write(\n `Removed the local login for \"${trust.alias}\". The remote grant may remain active; revoke it from the account website.\\n`,\n );\n } else {\n process.stdout.write(`Revoked and removed the saved login for \"${trust.alias}\".\\n`);\n }\n return 0;\n } catch (error) {\n process.stderr.write(`${describeControlPlaneError(error)}\\n`);\n return 1;\n }\n }\n}\n"],"mappings":";;;AAWA,IAAa,gBAAb,MAA8C;CAEzB;CACA;CAFnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;CAChB;CAEH,MAAa,UAA2B;EACtC,IAAI;GACF,MAAM,QAAQ,MAAM,KAAK,KAAK,sBAAsB,QAAQ,KAAK,QAAQ,QAAQ;GACjF,MAAM,SAAS,MAAM,KAAK,KAAK,eAAe,OAAO,OAAO,KAAK,QAAQ,SAAS;GAClF,IAAI,KAAK,QAAQ,iBAAiB,QAChC,QAAQ,OAAO,MACb,GAAG,KAAK,UAAU;IAChB,IAAI;IACJ,UAAU;KAAE,OAAO,MAAM;KAAO,IAAI,MAAM;IAAW;IACrD,SAAS,WAAW;IACpB,eAAe,WAAW,aAAa,CAAC,KAAK,QAAQ;GACvD,CAAC,EAAE,GACL;QACK,IAAI,WAAW,iBACpB,QAAQ,OAAO,MAAM,8BAA8B,MAAM,MAAM,KAAK;QAC/D,IAAI,KAAK,QAAQ,WACtB,QAAQ,OAAO,MACb,gCAAgC,MAAM,MAAM,6EAC9C;QAEA,QAAQ,OAAO,MAAM,4CAA4C,MAAM,MAAM,KAAK;GAEpF,OAAO;EACT,SAAS,OAAO;GACd,QAAQ,OAAO,MAAM,GAAG,0BAA0B,KAAK,EAAE,GAAG;GAC5D,OAAO;EACT;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"OutdatedCommand.js","names":[],"sources":["../../src/commands/OutdatedCommand.ts"],"sourcesContent":["import type { CompositionRoot } from '../app/CompositionRoot.js';\nimport type { Command } from './Command.js';\n\nexport interface OutdatedCommandOptions {\n readonly outputFormat: 'text' | 'json';\n}\n\n/**\n * `uapkg outdated` — emits one row per declared dependency with\n * `current / wanted / latest / status` taken from\n * {@link PackageManifest.checkOutdated}.\n *\n * Exit code 0 when all rows are `up-to-date`; otherwise 2 so CI gates can\n * branch on it. JSON mode emits the full array on stdout in a single write.\n */\nexport class OutdatedCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: OutdatedCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n const result = await this.root.packageManifest.checkOutdated();\n\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({\n status: result.ok ? 'ok' : 'error',\n command: 'outdated',\n data: result.ok ? result.value : undefined,\n diagnostics: result.diagnostics,\n });\n return result.ok ? (result.value.some((r) => r.status !== 'up-to-date') ? 2 : 0) : 1;\n }\n\n this.root.diagnostics.reportAll(result.diagnostics);\n if (!result.ok) return 1;\n\n const rows = result.value;\n if (rows.length === 0) {\n process.stdout.write('No declared dependencies.\\n');\n return 0;\n }\n const outdated = rows.filter((r) => r.status !== 'up-to-date');\n for (const row of rows) {\n process.stdout.write(\n `${row.status.padEnd(16)} ${row.name.padEnd(32)} ${row.current} → ${row.wanted} (latest ${row.latest})\\n`,\n );\n }\n return outdated.length > 0 ? 2 : 0;\n }\n}\n"],"mappings":";;;;;;;;;AAeA,IAAa,kBAAb,MAAgD;CAE3B;CACA;CAFnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;CAChB;CAEH,MAAa,UAA2B;EACtC,MAAM,SAAS,MAAM,KAAK,KAAK,gBAAgB,cAAc;EAE7D,IAAI,KAAK,QAAQ,iBAAiB,QAAQ;GACxC,KAAK,KAAK,KAAK,KAAK;IAClB,QAAQ,OAAO,KAAK,OAAO;IAC3B,SAAS;IACT,MAAM,OAAO,KAAK,OAAO,QAAQ;IACjC,aAAa,OAAO;GACtB,CAAC;GACD,OAAO,OAAO,KAAM,OAAO,MAAM,MAAM,MAAM,EAAE,WAAW,YAAY,IAAI,IAAI,IAAK;EACrF;EAEA,KAAK,KAAK,YAAY,UAAU,OAAO,WAAW;EAClD,IAAI,CAAC,OAAO,IAAI,OAAO;EAEvB,MAAM,OAAO,OAAO;EACpB,IAAI,KAAK,WAAW,GAAG;GACrB,QAAQ,OAAO,MAAM,6BAA6B;GAClD,OAAO;EACT;EACA,MAAM,WAAW,KAAK,QAAQ,MAAM,EAAE,WAAW,YAAY;EAC7D,KAAK,MAAM,OAAO,MAChB,QAAQ,OAAO,MACb,GAAG,IAAI,OAAO,OAAO,EAAE,EAAE,GAAG,IAAI,KAAK,OAAO,EAAE,EAAE,GAAG,IAAI,QAAQ,KAAK,IAAI,OAAO,WAAW,IAAI,OAAO,IACvG;EAEF,OAAO,SAAS,SAAS,IAAI,IAAI;CACnC;AACF"}
1
+ {"version":3,"file":"OutdatedCommand.js","names":[],"sources":["../../src/commands/OutdatedCommand.ts"],"sourcesContent":["import type { CompositionRoot } from '#cli/app/CompositionRoot.ts';\nimport type { Command } from '#cli/commands/Command.ts';\n\nexport interface OutdatedCommandOptions {\n readonly outputFormat: 'text' | 'json';\n}\n\n/**\n * `uapkg outdated` — emits one row per declared dependency with\n * `current / wanted / latest / status` taken from\n * {@link PackageManifest.checkOutdated}.\n *\n * Exit code 0 when all rows are `up-to-date`; otherwise 2 so CI gates can\n * branch on it. JSON mode emits the full array on stdout in a single write.\n */\nexport class OutdatedCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: OutdatedCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n const result = await this.root.packageManifest.checkOutdated();\n\n if (this.options.outputFormat === 'json') {\n this.root.json.emit({\n status: result.ok ? 'ok' : 'error',\n command: 'outdated',\n data: result.ok ? result.value : undefined,\n diagnostics: result.diagnostics,\n });\n return result.ok ? (result.value.some((r) => r.status !== 'up-to-date') ? 2 : 0) : 1;\n }\n\n this.root.diagnostics.reportAll(result.diagnostics);\n if (!result.ok) return 1;\n\n const rows = result.value;\n if (rows.length === 0) {\n process.stdout.write('No declared dependencies.\\n');\n return 0;\n }\n const outdated = rows.filter((r) => r.status !== 'up-to-date');\n for (const row of rows) {\n process.stdout.write(\n `${row.status.padEnd(16)} ${row.name.padEnd(32)} ${row.current} → ${row.wanted} (latest ${row.latest})\\n`,\n );\n }\n return outdated.length > 0 ? 2 : 0;\n }\n}\n"],"mappings":";;;;;;;;;AAeA,IAAa,kBAAb,MAAgD;CAE3B;CACA;CAFnB,AAAO,YACL,AAAiB,MACjB,AAAiB,SACjB;EAFiB;EACA;CAChB;CAEH,MAAa,UAA2B;EACtC,MAAM,SAAS,MAAM,KAAK,KAAK,gBAAgB,cAAc;EAE7D,IAAI,KAAK,QAAQ,iBAAiB,QAAQ;GACxC,KAAK,KAAK,KAAK,KAAK;IAClB,QAAQ,OAAO,KAAK,OAAO;IAC3B,SAAS;IACT,MAAM,OAAO,KAAK,OAAO,QAAQ;IACjC,aAAa,OAAO;GACtB,CAAC;GACD,OAAO,OAAO,KAAM,OAAO,MAAM,MAAM,MAAM,EAAE,WAAW,YAAY,IAAI,IAAI,IAAK;EACrF;EAEA,KAAK,KAAK,YAAY,UAAU,OAAO,WAAW;EAClD,IAAI,CAAC,OAAO,IAAI,OAAO;EAEvB,MAAM,OAAO,OAAO;EACpB,IAAI,KAAK,WAAW,GAAG;GACrB,QAAQ,OAAO,MAAM,6BAA6B;GAClD,OAAO;EACT;EACA,MAAM,WAAW,KAAK,QAAQ,MAAM,EAAE,WAAW,YAAY;EAC7D,KAAK,MAAM,OAAO,MAChB,QAAQ,OAAO,MACb,GAAG,IAAI,OAAO,OAAO,EAAE,EAAE,GAAG,IAAI,KAAK,OAAO,EAAE,EAAE,GAAG,IAAI,QAAQ,KAAK,IAAI,OAAO,WAAW,IAAI,OAAO,IACvG;EAEF,OAAO,SAAS,SAAS,IAAI,IAAI;CACnC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"PackCommand.js","names":[],"sources":["../../src/commands/PackCommand.ts"],"sourcesContent":["import { pack } from '@uapkg/pack';\nimport { DiagnosticReporter } from '../reporting/DiagnosticReporter.js';\nimport type { Command } from './Command.js';\n\nexport interface PackCommandOptions {\n cwd: string;\n dryRun: boolean;\n allowMissingLfs: boolean;\n outFile?: string;\n}\n\nexport class PackCommand implements Command {\n constructor(private readonly options: PackCommandOptions) {}\n\n async execute() {\n const result = await pack({\n cwd: this.options.cwd,\n dryRun: this.options.dryRun,\n allowMissingLfs: this.options.allowMissingLfs,\n outFile: this.options.outFile,\n });\n\n if (!result.ok) {\n new DiagnosticReporter().reportAll(result.diagnostics);\n return 1;\n }\n\n return 0;\n }\n}\n"],"mappings":";;;;AAWA,IAAa,cAAb,MAA4C;CACb;CAA7B,YAAY,AAAiB,SAA6B;EAA7B;CAA8B;CAE3D,MAAM,UAAU;EACd,MAAM,SAAS,MAAM,KAAK;GACxB,KAAK,KAAK,QAAQ;GAClB,QAAQ,KAAK,QAAQ;GACrB,iBAAiB,KAAK,QAAQ;GAC9B,SAAS,KAAK,QAAQ;EACxB,CAAC;EAED,IAAI,CAAC,OAAO,IAAI;GACd,IAAI,mBAAmB,CAAC,CAAC,UAAU,OAAO,WAAW;GACrD,OAAO;EACT;EAEA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"PackCommand.js","names":[],"sources":["../../src/commands/PackCommand.ts"],"sourcesContent":["import { pack } from '@uapkg/pack';\nimport { DiagnosticReporter } from '#cli/reporting/DiagnosticReporter.ts';\nimport type { Command } from '#cli/commands/Command.ts';\n\nexport interface PackCommandOptions {\n cwd: string;\n dryRun: boolean;\n allowMissingLfs: boolean;\n outFile?: string;\n}\n\nexport class PackCommand implements Command {\n constructor(private readonly options: PackCommandOptions) {}\n\n async execute() {\n const result = await pack({\n cwd: this.options.cwd,\n dryRun: this.options.dryRun,\n allowMissingLfs: this.options.allowMissingLfs,\n outFile: this.options.outFile,\n });\n\n if (!result.ok) {\n new DiagnosticReporter().reportAll(result.diagnostics);\n return 1;\n }\n\n return 0;\n }\n}\n"],"mappings":";;;;AAWA,IAAa,cAAb,MAA4C;CACb;CAA7B,YAAY,AAAiB,SAA6B;EAA7B;CAA8B;CAE3D,MAAM,UAAU;EACd,MAAM,SAAS,MAAM,KAAK;GACxB,KAAK,KAAK,QAAQ;GAClB,QAAQ,KAAK,QAAQ;GACrB,iBAAiB,KAAK,QAAQ;GAC9B,SAAS,KAAK,QAAQ;EACxB,CAAC;EAED,IAAI,CAAC,OAAO,IAAI;GACd,IAAI,mBAAmB,CAAC,CAAC,UAAU,OAAO,WAAW;GACrD,OAAO;EACT;EAEA,OAAO;CACT;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"PackageLifecycleCommand.js","names":[],"sources":["../../src/commands/PackageLifecycleCommand.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport type { CompositionRoot } from '../app/CompositionRoot.js';\nimport type { UAPKGLifecycleCommandName, UAPKGOutputFormat } from '../cli/UAPKGCommandLine.js';\nimport { describeControlPlaneError } from '../control-plane/AccountManager.js';\nimport { AuthenticationSelector } from '../control-plane/AuthenticationSelector.js';\nimport { ControlPlaneClient } from '../control-plane/ControlPlaneClient.js';\nimport {\n type ControlPlaneAuthMode,\n ControlPlaneError,\n type RegistryRequestDetail,\n type RegistryRequestStatus,\n type RegistryRequestSubmission,\n} from '../control-plane/ControlPlaneTypes.js';\nimport { PublishIdempotencyStore } from '../control-plane/PublishIdempotencyStore.js';\nimport { InkPromptService } from '../prompts/InkPromptService.js';\nimport {\n formatRegistryRequestTerminal,\n isRegistryRequestSuccessStatus,\n isRegistryRequestTerminalStatus,\n} from '../reporting/RegistryRequestTerminalFormatter.js';\nimport type { Command } from './Command.js';\n\nconst WATCH_TIMEOUT_MS = 30 * 60 * 1000;\nconst REASON_REQUIRED: ReadonlySet<UAPKGLifecycleCommandName> = new Set(['yank', 'unyank', 'unpublish', 'deprecate']);\n\nexport interface PackageLifecycleCommandOptions {\n readonly operation: UAPKGLifecycleCommandName;\n readonly packageName: string;\n readonly packageVersion: string;\n readonly reason?: string;\n readonly registry?: string;\n readonly auth: ControlPlaneAuthMode;\n readonly detach: boolean;\n readonly outputFormat: UAPKGOutputFormat;\n}\n\n/**\n * Shared implementation of the five route-derived package lifecycle\n * operations (`uapkg yank|unyank|unpublish|deprecate|undeprecate`). Each\n * command posts to its dedicated submission route and watches the request\n * to readiness unless detached.\n */\nexport class PackageLifecycleCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: PackageLifecycleCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n try {\n const { operation, packageName, packageVersion } = this.options;\n if (!packageName.trim() || !packageVersion.trim()) {\n throw new Error(`uapkg ${operation} requires a package name and an exact version.`);\n }\n const reason = this.options.reason?.trim();\n if (REASON_REQUIRED.has(operation) && !reason) {\n throw new Error(`uapkg ${operation} requires --reason describing why the version is changing state.`);\n }\n\n const trust = await this.root.registryTrustResolver.resolve(this.options.registry);\n const selector = new AuthenticationSelector(this.root.accountManager, new InkPromptService());\n const oidcTarget = { registryId: trust.registryId, packageName: packageName.trim() };\n const requestedScopes = this.options.detach\n ? (['publishing.request.create'] as const)\n : (['publishing.request.create', 'publishing.request.read.self'] as const);\n let authentication = await selector.select(this.options.auth, trust, requestedScopes, true, oidcTarget);\n let requestOtp = authentication.otp;\n authentication = { kind: authentication.kind, credential: authentication.credential };\n\n const submission: RegistryRequestSubmission = {\n registryId: trust.registryId,\n payload: {\n packageName: packageName.trim(),\n packageVersion: packageVersion.trim(),\n ...(reason ? { reason } : {}),\n },\n };\n\n const idempotencyStore = new PublishIdempotencyStore();\n const submissionDigest = PublishIdempotencyStore.submissionDigest(operation, submission);\n const idempotencyKey = idempotencyStore.getOrCreate(submissionDigest, () => randomUUID());\n\n const client = new ControlPlaneClient(trust.apiBaseUrl);\n let created: Awaited<ReturnType<ControlPlaneClient['submitRegistryRequest']>>;\n try {\n created = await client.submitRegistryRequest(authentication.credential, operation, submission, {\n idempotencyKey,\n otp: requestOtp,\n });\n } finally {\n // Do not retain the request-bound code during status reads or watch.\n requestOtp = undefined;\n }\n if (this.options.detach) {\n this.printCreated(created.requestId, created.status, trust.alias);\n return 0;\n }\n\n let detail = await client.getRegistryRequestDetail(authentication.credential, created.requestId);\n let previousStatus = '';\n const deadline = Date.now() + WATCH_TIMEOUT_MS;\n while (!isRegistryRequestTerminalStatus(detail.request.status)) {\n if (Date.now() >= deadline) {\n throw new Error(\n `Timed out waiting for request ${detail.request.id}. Check it with \\`uapkg requests status ${detail.request.id}\\`.`,\n );\n }\n if (this.options.outputFormat === 'text' && detail.request.status !== previousStatus) {\n process.stdout.write(\n `${detail.request.id}: ${detail.request.status}${detail.request.currentStep ? ` (${detail.request.currentStep})` : ''}\\n`,\n );\n previousStatus = detail.request.status;\n }\n await delay(2_000);\n try {\n detail = await client.getRegistryRequestDetail(authentication.credential, created.requestId);\n } catch (error) {\n if (!(error instanceof ControlPlaneError) || error.status !== 401) throw error;\n if (authentication.kind === 'gat') throw error;\n if (authentication.kind === 'login') {\n this.root.accountManager.invalidateAccessCredentials(trust);\n }\n authentication = await selector.select(\n authentication.kind,\n trust,\n ['publishing.request.read.self'],\n false,\n oidcTarget,\n );\n detail = await client.getRegistryRequestDetail(authentication.credential, created.requestId);\n }\n }\n\n idempotencyStore.clear(submissionDigest);\n\n if (isRegistryRequestSuccessStatus(detail.request.status)) {\n let refreshWarning: string | undefined;\n try {\n await this.root.registryTrustResolver.forceRefresh(trust);\n } catch (error) {\n refreshWarning = error instanceof Error ? error.message : String(error);\n }\n this.printTerminal(detail, trust.alias, refreshWarning);\n return 0;\n }\n\n this.printTerminal(detail, trust.alias);\n return 1;\n } catch (error) {\n process.stderr.write(`${describeControlPlaneError(error)}\\n`);\n return 1;\n }\n }\n\n private printCreated(requestId: string, status: RegistryRequestStatus, registryAlias: string): void {\n if (this.options.outputFormat === 'json') {\n process.stdout.write(\n `${JSON.stringify({\n ok: true,\n operation: this.options.operation,\n registry: registryAlias,\n requestId,\n status,\n })}\\n`,\n );\n return;\n }\n process.stdout.write(\n `${this.options.operation} request ${requestId} for ${this.options.packageName}@${this.options.packageVersion}: ${status}.\\n`,\n );\n }\n\n private printTerminal(detail: RegistryRequestDetail, registryAlias: string, refreshWarning?: string): void {\n const output = formatRegistryRequestTerminal({\n detail,\n registryAlias,\n outputFormat: this.options.outputFormat,\n presentation: {\n kind: 'lifecycle',\n operation: this.options.operation,\n packageName: this.options.packageName,\n packageVersion: this.options.packageVersion,\n },\n ...(refreshWarning ? { registryRefreshWarning: refreshWarning } : {}),\n });\n process.stdout.write(output.stdout);\n if (output.stderr) process.stderr.write(output.stderr);\n }\n}\n\nfunction delay(milliseconds: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, milliseconds));\n}\n"],"mappings":";;;;;;;;;;AAsBA,MAAM,mBAAmB;AACzB,MAAM,kCAA0D,IAAI,IAAI;CAAC;CAAQ;CAAU;CAAa;AAAW,CAAC;;;;;;;AAmBpH,IAAa,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leCommand.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport type { CompositionRoot } from '#cli/app/CompositionRoot.ts';\nimport type { UAPKGLifecycleCommandName, UAPKGOutputFormat } from '#cli/cli/UAPKGCommandLine.ts';\nimport { describeControlPlaneError } from '#cli/control-plane/AccountManager.ts';\nimport { AuthenticationSelector } from '#cli/control-plane/AuthenticationSelector.ts';\nimport { ControlPlaneClient } from '#cli/control-plane/ControlPlaneClient.ts';\nimport {\n type ControlPlaneAuthMode,\n ControlPlaneError,\n type RegistryRequestDetail,\n type RegistryRequestStatus,\n type RegistryRequestSubmission,\n} from '#cli/control-plane/ControlPlaneTypes.ts';\nimport { PublishIdempotencyStore } from '#cli/control-plane/PublishIdempotencyStore.ts';\nimport { InkPromptService } from '#cli/prompts/InkPromptService.tsx';\nimport {\n formatRegistryRequestTerminal,\n isRegistryRequestSuccessStatus,\n isRegistryRequestTerminalStatus,\n} from '#cli/reporting/RegistryRequestTerminalFormatter.ts';\nimport type { Command } from '#cli/commands/Command.ts';\n\nconst WATCH_TIMEOUT_MS = 30 * 60 * 1000;\nconst REASON_REQUIRED: ReadonlySet<UAPKGLifecycleCommandName> = new Set(['yank', 'unyank', 'unpublish', 'deprecate']);\n\nexport interface PackageLifecycleCommandOptions {\n readonly operation: UAPKGLifecycleCommandName;\n readonly packageName: string;\n readonly packageVersion: string;\n readonly reason?: string;\n readonly registry?: string;\n readonly auth: ControlPlaneAuthMode;\n readonly detach: boolean;\n readonly outputFormat: UAPKGOutputFormat;\n}\n\n/**\n * Shared implementation of the five route-derived package lifecycle\n * operations (`uapkg yank|unyank|unpublish|deprecate|undeprecate`). Each\n * command posts to its dedicated submission route and watches the request\n * to readiness unless detached.\n */\nexport class PackageLifecycleCommand implements Command {\n public constructor(\n private readonly root: CompositionRoot,\n private readonly options: PackageLifecycleCommandOptions,\n ) {}\n\n public async execute(): Promise<number> {\n try {\n const { operation, packageName, packageVersion } = this.options;\n if (!packageName.trim() || !packageVersion.trim()) {\n throw new Error(`uapkg ${operation} requires a package name and an exact version.`);\n }\n const reason = this.options.reason?.trim();\n if (REASON_REQUIRED.has(operation) && !reason) {\n throw new Error(`uapkg ${operation} requires --reason describing why the version is changing state.`);\n }\n\n const trust = await this.root.registryTrustResolver.resolve(this.options.registry);\n const selector = new AuthenticationSelector(this.root.accountManager, new InkPromptService());\n const oidcTarget = { registryId: trust.registryId, packageName: packageName.trim() };\n const requestedScopes = this.options.detach\n ? (['publishing.request.create'] as const)\n : (['publishing.request.create', 'publishing.request.read.self'] as const);\n let authentication = await selector.select(this.options.auth, trust, requestedScopes, true, oidcTarget);\n let requestOtp = authentication.otp;\n authentication = { kind: authentication.kind, credential: authentication.credential };\n\n const submission: RegistryRequestSubmission = {\n registryId: trust.registryId,\n payload: {\n packageName: packageName.trim(),\n packageVersion: packageVersion.trim(),\n ...(reason ? { reason } : {}),\n },\n };\n\n const idempotencyStore = new PublishIdempotencyStore();\n const submissionDigest = PublishIdempotencyStore.submissionDigest(operation, submission);\n const idempotencyKey = idempotencyStore.getOrCreate(submissionDigest, () => randomUUID());\n\n const client = new ControlPlaneClient(trust.apiBaseUrl);\n let created: Awaited<ReturnType<ControlPlaneClient['submitRegistryRequest']>>;\n try {\n created = await client.submitRegistryRequest(authentication.credential, operation, submission, {\n idempotencyKey,\n otp: requestOtp,\n });\n } finally {\n // Do not retain the request-bound code during status reads or watch.\n requestOtp = undefined;\n }\n if (this.options.detach) {\n this.printCreated(created.requestId, created.status, trust.alias);\n return 0;\n }\n\n let detail = await client.getRegistryRequestDetail(authentication.credential, created.requestId);\n let previousStatus = '';\n const deadline = Date.now() + WATCH_TIMEOUT_MS;\n while (!isRegistryRequestTerminalStatus(detail.request.status)) {\n if (Date.now() >= deadline) {\n throw new Error(\n `Timed out waiting for request ${detail.request.id}. Check it with \\`uapkg requests status ${detail.request.id}\\`.`,\n );\n }\n if (this.options.outputFormat === 'text' && detail.request.status !== previousStatus) {\n process.stdout.write(\n `${detail.request.id}: ${detail.request.status}${detail.request.currentStep ? ` (${detail.request.currentStep})` : ''}\\n`,\n );\n previousStatus = detail.request.status;\n }\n await delay(2_000);\n try {\n detail = await client.getRegistryRequestDetail(authentication.credential, created.requestId);\n } catch (error) {\n if (!(error instanceof ControlPlaneError) || error.status !== 401) throw error;\n if (authentication.kind === 'gat') throw error;\n if (authentication.kind === 'login') {\n this.root.accountManager.invalidateAccessCredentials(trust);\n }\n authentication = await selector.select(\n authentication.kind,\n trust,\n ['publishing.request.read.self'],\n false,\n oidcTarget,\n );\n detail = await client.getRegistryRequestDetail(authentication.credential, created.requestId);\n }\n }\n\n idempotencyStore.clear(submissionDigest);\n\n if (isRegistryRequestSuccessStatus(detail.request.status)) {\n let refreshWarning: string | undefined;\n try {\n await this.root.registryTrustResolver.forceRefresh(trust);\n } catch (error) {\n refreshWarning = error instanceof Error ? error.message : String(error);\n }\n this.printTerminal(detail, trust.alias, refreshWarning);\n return 0;\n }\n\n this.printTerminal(detail, trust.alias);\n return 1;\n } catch (error) {\n process.stderr.write(`${describeControlPlaneError(error)}\\n`);\n return 1;\n }\n }\n\n private printCreated(requestId: string, status: RegistryRequestStatus, registryAlias: string): void {\n if (this.options.outputFormat === 'json') {\n process.stdout.write(\n `${JSON.stringify({\n ok: true,\n operation: this.options.operation,\n registry: registryAlias,\n requestId,\n status,\n })}\\n`,\n );\n return;\n }\n process.stdout.write(\n `${this.options.operation} request ${requestId} for ${this.options.packageName}@${this.options.packageVersion}: ${status}.\\n`,\n );\n }\n\n private printTerminal(detail: RegistryRequestDetail, registryAlias: string, refreshWarning?: string): void {\n const output = formatRegistryRequestTerminal({\n detail,\n registryAlias,\n outputFormat: this.options.outputFormat,\n presentation: {\n kind: 'lifecycle',\n operation: this.options.operation,\n packageName: this.options.packageName,\n packageVersion: this.options.packageVersion,\n },\n ...(refreshWarning ? { registryRefreshWarning: refreshWarning } : {}),\n });\n process.stdout.write(output.stdout);\n if (output.stderr) process.stderr.write(output.stderr);\n }\n}\n\nfunction delay(milli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AAQ,OAAO,MAAM,OAAO,MAAM;CACvD;AACF;AAEA,SAAS,MAAM,cAAqC;CAClD,OAAO,IAAI,SAAS,YAAY,WAAW,SAAS,YAAY,CAAC;AACnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"PostinstallCandidateBuilder.js","names":["path"],"sources":["../../src/commands/PostinstallCandidateBuilder.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { InstallPlan } from '@uapkg/installer';\nimport type { Lockfile, Manifest } from '@uapkg/package-manifest-schema';\nimport type { CompositionRoot } from '../app/CompositionRoot.js';\nimport type { PostinstallCandidate } from '../postinstall/runner/PostinstallOrchestrator.js';\n\n/**\n * Builds the {@link PostinstallCandidate} list that the postinstall\n * orchestrator consumes after an installer run.\n *\n * Rules:\n * * Only `add` and `update` actions produce candidates (unchanged/remove never run postinstall).\n * * `pluginRoot` is derived from the action's declared install `path` resolved\n * against the manifest root — matching what the extractor wrote to disk.\n * * `registry` is sourced from the lockfile entry; if the lockfile lacks the\n * package (shouldn't happen post-install, but be defensive), the action is\n * dropped.\n *\n * This adapter lives in the CLI rather than in `@uapkg/uapkg/postinstall/`\n * to keep the postinstall subsystem independent of `@uapkg/installer`.\n */\nexport class PostinstallCandidateBuilder {\n public build(\n root: CompositionRoot,\n plan: InstallPlan,\n lockfile: Lockfile,\n installedNames?: ReadonlySet<string>,\n ): PostinstallCandidate[] {\n const lockPackages = lockfile.packages as Record<string, { registry: string }>;\n const candidates: PostinstallCandidate[] = [];\n for (const action of plan.actions) {\n if (action.type !== 'add' && action.type !== 'update') continue;\n // Failed/skipped branches never run postinstall.\n if (installedNames && !installedNames.has(action.packageName)) continue;\n const locked = lockPackages[action.packageName];\n const registry = locked?.registry ?? action.registry;\n if (!registry) continue;\n candidates.push({\n packageName: action.packageName,\n registry: registry as string,\n pluginRoot: path.join(root.cwd, action.path),\n });\n }\n return candidates;\n }\n\n /** Convenience: returns `'project' | 'plugin'` for the orchestrator's input. */\n public resolveManifestType(manifest: Manifest): 'project' | 'plugin' {\n return manifest.kind === 'project' ? 'project' : 'plugin';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,IAAa,8BAAb,MAAyC;CACvC,AAAO,MACL,MACA,MACA,UACA,gBACwB;EACxB,MAAM,eAAe,SAAS;EAC9B,MAAM,aAAqC,CAAC;EAC5C,KAAK,MAAM,UAAU,KAAK,SAAS;GACjC,IAAI,OAAO,SAAS,SAAS,OAAO,SAAS,UAAU;GAEvD,IAAI,kBAAkB,CAAC,eAAe,IAAI,OAAO,WAAW,GAAG;GAE/D,MAAM,WADS,aAAa,OAAO,YACZ,EAAE,YAAY,OAAO;GAC5C,IAAI,CAAC,UAAU;GACf,WAAW,KAAK;IACd,aAAa,OAAO;IACV;IACV,YAAYA,OAAK,KAAK,KAAK,KAAK,OAAO,IAAI;GAC7C,CAAC;EACH;EACA,OAAO;CACT;;CAGA,AAAO,oBAAoB,UAA0C;EACnE,OAAO,SAAS,SAAS,YAAY,YAAY;CACnD;AACF"}
1
+ {"version":3,"file":"PostinstallCandidateBuilder.js","names":["path"],"sources":["../../src/commands/PostinstallCandidateBuilder.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { InstallPlan } from '@uapkg/installer';\nimport type { Lockfile, Manifest } from '@uapkg/package-manifest-schema';\nimport type { CompositionRoot } from '#cli/app/CompositionRoot.ts';\nimport type { PostinstallCandidate } from '#cli/postinstall/runner/PostinstallOrchestrator.ts';\n\n/**\n * Builds the {@link PostinstallCandidate} list that the postinstall\n * orchestrator consumes after an installer run.\n *\n * Rules:\n * * Only `add` and `update` actions produce candidates (unchanged/remove never run postinstall).\n * * `pluginRoot` is derived from the action's declared install `path` resolved\n * against the manifest root — matching what the extractor wrote to disk.\n * * `registry` is sourced from the lockfile entry; if the lockfile lacks the\n * package (shouldn't happen post-install, but be defensive), the action is\n * dropped.\n *\n * This adapter lives in the CLI rather than in `@uapkg/uapkg/postinstall/`\n * to keep the postinstall subsystem independent of `@uapkg/installer`.\n */\nexport class PostinstallCandidateBuilder {\n public build(\n root: CompositionRoot,\n plan: InstallPlan,\n lockfile: Lockfile,\n installedNames?: ReadonlySet<string>,\n ): PostinstallCandidate[] {\n const lockPackages = lockfile.packages as Record<string, { registry: string }>;\n const candidates: PostinstallCandidate[] = [];\n for (const action of plan.actions) {\n if (action.type !== 'add' && action.type !== 'update') continue;\n // Failed/skipped branches never run postinstall.\n if (installedNames && !installedNames.has(action.packageName)) continue;\n const locked = lockPackages[action.packageName];\n const registry = locked?.registry ?? action.registry;\n if (!registry) continue;\n candidates.push({\n packageName: action.packageName,\n registry: registry as string,\n pluginRoot: path.join(root.cwd, action.path),\n });\n }\n return candidates;\n }\n\n /** Convenience: returns `'project' | 'plugin'` for the orchestrator's input. */\n public resolveManifestType(manifest: Manifest): 'project' | 'plugin' {\n return manifest.kind === 'project' ? 'project' : 'plugin';\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,IAAa,8BAAb,MAAyC;CACvC,AAAO,MACL,MACA,MACA,UACA,gBACwB;EACxB,MAAM,eAAe,SAAS;EAC9B,MAAM,aAAqC,CAAC;EAC5C,KAAK,MAAM,UAAU,KAAK,SAAS;GACjC,IAAI,OAAO,SAAS,SAAS,OAAO,SAAS,UAAU;GAEvD,IAAI,kBAAkB,CAAC,eAAe,IAAI,OAAO,WAAW,GAAG;GAE/D,MAAM,WADS,aAAa,OAAO,YACZ,EAAE,YAAY,OAAO;GAC5C,IAAI,CAAC,UAAU;GACf,WAAW,KAAK;IACd,aAAa,OAAO;IACV;IACV,YAAYA,OAAK,KAAK,KAAK,KAAK,OAAO,IAAI;GAC7C,CAAC;EACH;EACA,OAAO;CACT;;CAGA,AAAO,oBAAoB,UAA0C;EACnE,OAAO,SAAS,SAAS,YAAY,YAAY;CACnD;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectGetNameCommand.js","names":[],"sources":["../../src/commands/ProjectGetNameCommand.ts"],"sourcesContent":["import { ManifestReader } from '@uapkg/package-manifest';\nimport type { CompositionRoot } from '../app/CompositionRoot.js';\nimport type { Command } from './Command.js';\n\n/**\n * Options for {@link ProjectGetNameCommand}. Reserved for future expansion\n * (e.g. alternate output format); today the command is fully parameterized\n * by {@link CompositionRoot}.\n */\nexport type ProjectGetNameCommandOptions = Record<string, never>;\n\n// ---------------------------------------------------------------------------\n// ProjectGetNameCommand — prints the `name` field of the current project\n// manifest to stdout. Fails with exit code 1 if the manifest is absent, not\n// a project, or invalid. Intended for shell wrapping in CI scripts.\n// ---------------------------------------------------------------------------\n\nexport class ProjectGetNameCommand implements Command {\n public constructor(private readonly root: CompositionRoot) {}\n\n public async execute(): Promise<number> {\n const result = await new ManifestReader().read(this.root.cwd);\n if (!result.ok) {\n this.root.diagnostics.reportAll(result.diagnostics);\n return 1;\n }\n if (result.value.kind !== 'project') {\n process.stderr.write(`[uapkg] Expected manifest kind 'project', received '${result.value.kind}'\\n`);\n return 1;\n }\n process.stdout.write(`${String(result.value.name)}\\n`);\n return 0;\n }\n}\n"],"mappings":";;;AAiBA,IAAa,wBAAb,MAAsD;CAChB;CAApC,AAAO,YAAY,AAAiB,MAAuB;EAAvB;CAAwB;CAE5D,MAAa,UAA2B;EACtC,MAAM,SAAS,MAAM,IAAI,eAAe,CAAC,CAAC,KAAK,KAAK,KAAK,GAAG;EAC5D,IAAI,CAAC,OAAO,IAAI;GACd,KAAK,KAAK,YAAY,UAAU,OAAO,WAAW;GAClD,OAAO;EACT;EACA,IAAI,OAAO,MAAM,SAAS,WAAW;GACnC,QAAQ,OAAO,MAAM,uDAAuD,OAAO,MAAM,KAAK,IAAI;GAClG,OAAO;EACT;EACA,QAAQ,OAAO,MAAM,GAAG,OAAO,OAAO,MAAM,IAAI,EAAE,GAAG;EACrD,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"ProjectGetNameCommand.js","names":[],"sources":["../../src/commands/ProjectGetNameCommand.ts"],"sourcesContent":["import { ManifestReader } from '@uapkg/package-manifest';\nimport type { CompositionRoot } from '#cli/app/CompositionRoot.ts';\nimport type { Command } from '#cli/commands/Command.ts';\n\n/**\n * Options for {@link ProjectGetNameCommand}. Reserved for future expansion\n * (e.g. alternate output format); today the command is fully parameterized\n * by {@link CompositionRoot}.\n */\nexport type ProjectGetNameCommandOptions = Record<string, never>;\n\n// ---------------------------------------------------------------------------\n// ProjectGetNameCommand — prints the `name` field of the current project\n// manifest to stdout. Fails with exit code 1 if the manifest is absent, not\n// a project, or invalid. Intended for shell wrapping in CI scripts.\n// ---------------------------------------------------------------------------\n\nexport class ProjectGetNameCommand implements Command {\n public constructor(private readonly root: CompositionRoot) {}\n\n public async execute(): Promise<number> {\n const result = await new ManifestReader().read(this.root.cwd);\n if (!result.ok) {\n this.root.diagnostics.reportAll(result.diagnostics);\n return 1;\n }\n if (result.value.kind !== 'project') {\n process.stderr.write(`[uapkg] Expected manifest kind 'project', received '${result.value.kind}'\\n`);\n return 1;\n }\n process.stdout.write(`${String(result.value.name)}\\n`);\n return 0;\n }\n}\n"],"mappings":";;;AAiBA,IAAa,wBAAb,MAAsD;CAChB;CAApC,AAAO,YAAY,AAAiB,MAAuB;EAAvB;CAAwB;CAE5D,MAAa,UAA2B;EACtC,MAAM,SAAS,MAAM,IAAI,eAAe,CAAC,CAAC,KAAK,KAAK,KAAK,GAAG;EAC5D,IAAI,CAAC,OAAO,IAAI;GACd,KAAK,KAAK,YAAY,UAAU,OAAO,WAAW;GAClD,OAAO;EACT;EACA,IAAI,OAAO,MAAM,SAAS,WAAW;GACnC,QAAQ,OAAO,MAAM,uDAAuD,OAAO,MAAM,KAAK,IAAI;GAClG,OAAO;EACT;EACA,QAAQ,OAAO,MAAM,GAAG,OAAO,OAAO,MAAM,IAAI,EAAE,GAAG;EACrD,OAAO;CACT;AACF"}