@staff0rd/assist 0.100.0 → 0.101.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 (2) hide show
  1. package/dist/index.js +21 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.100.0",
9
+ version: "0.101.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -6734,6 +6734,15 @@ function registerRoam(program2) {
6734
6734
  // src/commands/run/index.ts
6735
6735
  import { spawn as spawn5 } from "child_process";
6736
6736
 
6737
+ // src/shared/formatElapsed.ts
6738
+ function formatElapsed(ms) {
6739
+ const secs = ms / 1e3;
6740
+ if (secs < 60) return `${secs.toFixed(1)}s`;
6741
+ const mins = Math.floor(secs / 60);
6742
+ const remainSecs = secs - mins * 60;
6743
+ return `${mins}m ${remainSecs.toFixed(1)}s`;
6744
+ }
6745
+
6737
6746
  // src/commands/run/resolveParams.ts
6738
6747
  function resolveParams(params, cliArgs) {
6739
6748
  if (!params || params.length === 0) return cliArgs;
@@ -6869,12 +6878,18 @@ function onSpawnError(err) {
6869
6878
  process.exit(1);
6870
6879
  }
6871
6880
  function spawnCommand2(fullCommand, env) {
6881
+ const start3 = Date.now();
6872
6882
  const child = spawn5(fullCommand, [], {
6873
6883
  stdio: "inherit",
6874
6884
  shell: true,
6875
6885
  env: env ? { ...process.env, ...expandEnv(env) } : void 0
6876
6886
  });
6877
- child.on("close", (code) => process.exit(code ?? 0));
6887
+ child.on("close", (code) => {
6888
+ const elapsed = formatElapsed(Date.now() - start3);
6889
+ console.log(`
6890
+ Done in ${elapsed}`);
6891
+ process.exit(code ?? 0);
6892
+ });
6878
6893
  child.on("error", onSpawnError);
6879
6894
  }
6880
6895
  function listRunConfigs() {
@@ -7066,7 +7081,10 @@ var runCommand = program.command("run").description("Run a configured command fr
7066
7081
  run2(name, args);
7067
7082
  });
7068
7083
  runCommand.command("list").description("List configured run commands").action(listRunConfigs);
7069
- runCommand.command("add").description("Add a new run configuration to assist.yml").allowUnknownOption().allowExcessArguments().action(() => add2());
7084
+ runCommand.command("add").description("Add a new run configuration to assist.yml").argument("<name>", "Name for the run configuration").argument("<command>", "Command to execute").argument("[args...]", "Static args to pass to the command").addHelpText(
7085
+ "after",
7086
+ '\nPositional params can be added to the config manually:\n params:\n - name: env # assist run deploy prod \u2192 appends "prod"\n required: true\n - name: tag\n default: latest'
7087
+ ).allowUnknownOption().allowExcessArguments().action(() => add2());
7070
7088
  registerNew(program);
7071
7089
  var lintCommand = program.command("lint").description("Run lint checks for conventions not enforced by biomejs").action(lint);
7072
7090
  lintCommand.command("init").description("Initialize Biome with standard linter config").action(init);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.100.0",
3
+ "version": "0.101.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {