@polterware/polter 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  runCommand,
21
21
  savePipeline,
22
22
  toolFlags
23
- } from "./chunk-2OZZNSKW.js";
23
+ } from "./chunk-2MXXRP4H.js";
24
24
  export {
25
25
  allCommands,
26
26
  applyActions,
@@ -131,7 +131,15 @@ var supabaseCommands = [
131
131
  tool: "supabase",
132
132
  base: ["link"],
133
133
  label: "link",
134
- hint: "Link to remote project"
134
+ hint: "Link to remote project",
135
+ suggestedArgs: [
136
+ {
137
+ value: "project-ref",
138
+ label: "--project-ref <ref>",
139
+ hint: "Link with project ref",
140
+ args: ["--project-ref"]
141
+ }
142
+ ]
135
143
  },
136
144
  {
137
145
  id: "supabase:unlink",
@@ -863,7 +871,7 @@ function getFlagsForTool(toolId) {
863
871
  }
864
872
 
865
873
  // src/lib/runner.ts
866
- import { spawn } from "child_process";
874
+ import { spawn, spawnSync } from "child_process";
867
875
  import { existsSync } from "fs";
868
876
  import { delimiter, dirname, join, resolve } from "path";
869
877
  function getSupabaseBinaryCandidates() {
@@ -924,8 +932,11 @@ async function runCommand(execution, args, cwd = process.cwd(), options) {
924
932
  cwd,
925
933
  env: resolvedExecution.env,
926
934
  shell: true,
927
- stdio: ["inherit", "pipe", "pipe"]
935
+ stdio: [options?.quiet ? "pipe" : "inherit", "pipe", "pipe"]
928
936
  });
937
+ if (options?.quiet) {
938
+ child.stdin?.end();
939
+ }
929
940
  child.stdout?.on("data", (data) => {
930
941
  const text = data.toString();
931
942
  stdout += text;
@@ -950,6 +961,22 @@ async function runCommand(execution, args, cwd = process.cwd(), options) {
950
961
  });
951
962
  });
952
963
  }
964
+ function runInteractiveCommand(execution, args, cwd = process.cwd()) {
965
+ const resolved = typeof execution === "string" ? { command: execution } : execution;
966
+ const result = spawnSync(resolved.command, args, {
967
+ cwd,
968
+ env: resolved.env,
969
+ shell: true,
970
+ stdio: "inherit"
971
+ });
972
+ return {
973
+ exitCode: result.status,
974
+ signal: result.signal,
975
+ stdout: "",
976
+ stderr: "",
977
+ spawnError: result.error?.message
978
+ };
979
+ }
953
980
  async function runSupabaseCommand(args, cwd = process.cwd()) {
954
981
  return runCommand(resolveSupabaseCommand(cwd), args, cwd);
955
982
  }
@@ -1448,6 +1475,7 @@ export {
1448
1475
  toolFlags,
1449
1476
  getFlagsForTool,
1450
1477
  runCommand,
1478
+ runInteractiveCommand,
1451
1479
  runSupabaseCommand,
1452
1480
  commandExists,
1453
1481
  resolveToolCommand,