@shardflux/cli 0.13.5 → 0.13.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.6
4
+
5
+ - `shard` makes the macOS menu bar app's executable runnable when it installs or starts the app, so a menu bar copied
6
+ from `@shardflux/menubar-darwin` 0.1.1 or 0.1.2 starts (and an existing copy of those is repaired).
7
+
3
8
  ## 0.13.5
4
9
 
5
10
  - `shard update` brings this computer's Shardflux install up to date in one step: it checks shard (the `shardflux`
package/dist/args.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const CLI_VERSION = "0.13.5";
1
+ export declare const CLI_VERSION = "0.13.6";
2
2
  export interface OptionSpec {
3
3
  type: 'string' | 'boolean';
4
4
  short?: string;
package/dist/args.js CHANGED
@@ -12,7 +12,7 @@
12
12
  import { parseArgs } from 'node:util';
13
13
  import { ACCOUNT_COMMANDS } from "./account-args.js";
14
14
  import { UsageError } from "./errors.js";
15
- export const CLI_VERSION = '0.13.5';
15
+ export const CLI_VERSION = '0.13.6';
16
16
  export const GLOBAL_OPTIONS = {
17
17
  'api-url': { type: 'string', value: '<url>', description: 'API base URL (default $SHARDFLUX_API_URL, else https://api.shardflux.dev).' },
18
18
  json: { type: 'boolean', description: 'Print machine-readable JSON on stdout (errors as JSON on stderr).' },
package/dist/menubar.d.ts CHANGED
@@ -10,6 +10,11 @@ export interface MenubarStatus {
10
10
  type NativeStatus = Omit<MenubarStatus, 'installed' | 'version'>;
11
11
  export declare function compareBundleVersions(left: string, right: string): number;
12
12
  export declare function parseNativeStatus(text: string): NativeStatus;
13
+ /**
14
+ * The app's executables keep their execute permission (0.13.6+). @shardflux/menubar-darwin 0.1.1 and 0.1.2 reached npm
15
+ * without it (pnpm's packer drops it), so an app copied from them could not run; this also repairs such an install.
16
+ */
17
+ export declare function makeExecutable(app: string): void;
13
18
  /** Native tools use argument arrays, bounded deadlines, and the installed app's own process/login projection. */
14
19
  export declare class MenubarManager {
15
20
  #private;
package/dist/menubar.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { execFile } from 'node:child_process';
2
- import { cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, renameSync, rmSync } from 'node:fs';
2
+ import { chmodSync, cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readdirSync, renameSync, rmSync } from 'node:fs';
3
3
  import { createRequire } from 'node:module';
4
4
  import { homedir } from 'node:os';
5
5
  import { dirname, join } from 'node:path';
@@ -30,6 +30,25 @@ export function parseNativeStatus(text) {
30
30
  }
31
31
  return row;
32
32
  }
33
+ /**
34
+ * The app's executables keep their execute permission (0.13.6+). @shardflux/menubar-darwin 0.1.1 and 0.1.2 reached npm
35
+ * without it (pnpm's packer drops it), so an app copied from them could not run; this also repairs such an install.
36
+ */
37
+ export function makeExecutable(app) {
38
+ const dir = join(app, 'Contents', 'MacOS');
39
+ let names;
40
+ try {
41
+ names = readdirSync(dir);
42
+ }
43
+ catch {
44
+ return;
45
+ }
46
+ for (const name of names) {
47
+ const file = join(dir, name), stat = lstatSync(file);
48
+ if (stat.isFile() && (stat.mode & 0o111) !== 0o111)
49
+ chmodSync(file, 0o755);
50
+ }
51
+ }
33
52
  /** Native tools use argument arrays, bounded deadlines, and the installed app's own process/login projection. */
34
53
  export class MenubarManager {
35
54
  app;
@@ -64,6 +83,7 @@ export class MenubarManager {
64
83
  return version;
65
84
  }
66
85
  async #control(action, ...args) {
86
+ makeExecutable(this.app);
67
87
  return parseNativeStatus(await this.#run(join(this.app, 'Contents', 'MacOS', 'ShardfluxMenuBar'), ['--control', action, ...args]));
68
88
  }
69
89
  async status() {
@@ -114,6 +134,7 @@ export class MenubarManager {
114
134
  await this.stop();
115
135
  if (current.installed)
116
136
  renameSync(this.app, backup);
137
+ makeExecutable(staged);
117
138
  try {
118
139
  renameSync(staged, this.app);
119
140
  committed = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shardflux/cli",
3
- "version": "0.13.5",
3
+ "version": "0.13.6",
4
4
  "type": "module",
5
5
  "description": "shard: the Shardflux command line. Create an account, sign in, set up keys and billing, then open, run commands in, move files to, suspend, resume and fork serverless agent workspaces.",
6
6
  "license": "Apache-2.0",
@@ -58,7 +58,7 @@
58
58
  "typescript-eslint": "8.70.1"
59
59
  },
60
60
  "optionalDependencies": {
61
- "@shardflux/menubar-darwin": "^0.1.2"
61
+ "@shardflux/menubar-darwin": "^0.1.3"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "node scripts/build.mjs",