@fluid-app/fluid-cli-theme-dev 0.1.648 → 0.1.649

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -5303,6 +5303,10 @@ async function fetchThemesPage(api, page, searchQuery) {
5303
5303
  };
5304
5304
  }
5305
5305
  async function selectTheme(api, message) {
5306
+ if (!process.stdin.isTTY) {
5307
+ console.error("Choosing a theme needs a terminal; pass --theme <name-or-id>.");
5308
+ process.exit(1);
5309
+ }
5306
5310
  const allThemes = [];
5307
5311
  let page = 1;
5308
5312
  let hasMore = true;
@@ -6941,6 +6945,10 @@ function createPullCommand() {
6941
6945
  console.log(` Target: ${chalk.bold(absoluteRoot)}`);
6942
6946
  console.log();
6943
6947
  if (!opts.yes) {
6948
+ if (!process.stdin.isTTY) {
6949
+ console.error(chalk.red("Pulling needs confirmation; pass --yes to pull without a prompt."));
6950
+ process.exit(1);
6951
+ }
6944
6952
  const { confirmed } = await prompts({
6945
6953
  type: "confirm",
6946
6954
  name: "confirmed",
@@ -13663,11 +13671,16 @@ function resolveRoot(root) {
13663
13671
  const workspace = findWorkspace();
13664
13672
  return (workspace && resolveThemeRootFromCwd(workspace)) ?? root;
13665
13673
  }
13666
- /** The refusal's message plus any per-path errors the server listed. */
13674
+ /** A list the server put under one key of a refusal's details. */
13675
+ function detailList(error, key) {
13676
+ const listed = error.details[key];
13677
+ return Array.isArray(listed) ? listed.map(String) : [];
13678
+ }
13679
+ /** The refusal's message plus the per-path errors and paths the server listed. */
13667
13680
  function refusalMessage(error) {
13668
13681
  const message = error.message;
13669
13682
  if (!(error instanceof BranchApiError)) return message;
13670
- return [message, ...(Array.isArray(error.details["errors"]) ? error.details["errors"] : []).map((line) => ` - ${line}`)].join("\n");
13683
+ return [message, ...[...detailList(error, "errors"), ...detailList(error, "paths")].map((line) => ` - ${line}`)].join("\n");
13671
13684
  }
13672
13685
  /** JSON shape Desktop reads; stable across CLI versions. */
13673
13686
  function stagingJson(status) {
@@ -13686,13 +13699,15 @@ async function run$1(opts, action) {
13686
13699
  status: error.status,
13687
13700
  type: error.type,
13688
13701
  message: error.message,
13689
- errors: Array.isArray(error.details["errors"]) ? error.details["errors"] : [],
13702
+ errors: detailList(error, "errors"),
13703
+ paths: detailList(error, "paths"),
13690
13704
  request_id: error.requestId ?? null
13691
13705
  } : {
13692
13706
  status: null,
13693
13707
  type: null,
13694
13708
  message: error.message,
13695
13709
  errors: [],
13710
+ paths: [],
13696
13711
  request_id: null
13697
13712
  };
13698
13713
  console.log(JSON.stringify({ error: refusal }));
@@ -13766,7 +13781,7 @@ function createStagingCommand() {
13766
13781
  report(settled, opts.json);
13767
13782
  if (settled.branch?.state !== "ready") process.exitCode = 1;
13768
13783
  }));
13769
- const publish = withThemeOptions$1(new Command("publish").description("Publish this directory's theme files to staging; production is not touched")).action((opts) => run$1(opts, async () => {
13784
+ const publish = withThemeOptions$1(new Command("publish").description("Publish this directory's theme files to staging; production is not touched")).option("-y, --yes", "Accepted for consistency; publishing never asks").action((opts) => run$1(opts, async () => {
13770
13785
  requireToken();
13771
13786
  const root = new ThemeRoot(resolveRoot(opts.root));
13772
13787
  if (!root.isValid()) throw new Error(`'${root.root}' does not look like a theme directory.`);