@gjermundgaraba/upup 0.5.0 → 0.5.1

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/README.md CHANGED
@@ -130,6 +130,6 @@ vp pack
130
130
 
131
131
  `vp run sparkle` builds upup-sparkle (`native/sparkle`) on macOS, with Xcode's command line tools, into `native/dist`, signed ad hoc unless `UPUP_SIGNING_IDENTITY` names a signing identity, and notarized when `UPUP_NOTARY_KEY` (an App Store Connect API key's .p8 file), `UPUP_NOTARY_KEY_ID` and `UPUP_NOTARY_ISSUER` are set; and then starts it as upup would; the release workflow signs and notarizes it with a Developer ID, and starts it only once its signing identity and notary key are gone. `vp run sparkle:e2e` builds it and installs updates of a fixture app through it, from an appcast served on this Mac.
132
132
 
133
- `vp run sea` builds a standalone `dist-sea/upup` for this machine (macOS or Linux), with Node, OpenTUI's native library and the Audit's grep worker inside, and on macOS upup-sparkle from `native/dist`, built again first if its source changed since, so it runs without Node installed. It extracts those assets to a per-user directory under the system temp directory on first run. `vp run sea:install` builds it and copies it to `~/.local/bin/upup` as a new file, since macOS kills a running copy whose file is overwritten in place.
133
+ `vp run install:local` installs this checkout as a global package, as the release publishes it: on macOS it builds upup-sparkle signed with the `Apple Development` identity in your keychain, or the one `UPUP_SIGNING_IDENTITY` names, notarized only when the notary variables above are set, and starts it as upup would; then it builds the package, packs it and installs the tarball with `vp install -g`. A helper signed by any team updates Sparkle apps that ship installer packages, which one signed ad hoc can't.
134
134
 
135
135
  The Go implementation lives in history at `d2a5ed7`.
package/dist/main.mjs CHANGED
@@ -37,12 +37,11 @@ import { constVoid } from "effect/Function";
37
37
  import { applyEdits, modify, parse as parse$1 } from "jsonc-parser";
38
38
  import { getStaticTOMLValue, parseTOML, traverseNodes } from "toml-eslint-parser";
39
39
  import { XMLParser } from "fast-xml-parser";
40
- import { isSea } from "node:sea";
41
40
  import * as ActionMcp from "@gjermundgaraba/effect-actions/ActionMcp";
42
41
  import * as Action from "@gjermundgaraba/effect-actions/Action";
43
42
  import { setup, types } from "xstate/fsm";
44
43
  // package.json
45
- var version$1 = "0.5.0";
44
+ var version$1 = "0.5.1";
46
45
  // src/ai/Setup.ts
47
46
  const Thinking = Schema.Literals([
48
47
  "off",
@@ -1005,7 +1004,7 @@ const list = async (workspace, args, signal) => await respond(signal, async () =
1005
1004
  return result === "" ? "no entries" : result;
1006
1005
  });
1007
1006
  const decodeAnswer = Schema.decodeUnknownOption(Schema.Union([Schema.Struct({ text: Schema.String }), Schema.Struct({ error: Schema.String })]));
1008
- const grepWorker = process.env["UPUP_GREP_WORKER"] ?? new URL(`grep-worker${path.extname(new URL(import.meta.url).pathname)}`, import.meta.url);
1007
+ const grepWorker = new URL(`grep-worker${path.extname(new URL(import.meta.url).pathname)}`, import.meta.url);
1009
1008
  const search = async (job, timeoutMs, signal) => {
1010
1009
  const { promise, resolve, reject } = Promise.withResolvers();
1011
1010
  const worker = new Worker(grepWorker);
@@ -8757,19 +8756,11 @@ const Manifest$2 = Schema.fromJsonString(Schema.Struct({
8757
8756
  }));
8758
8757
  const zipName = "upup-sparkle.zip";
8759
8758
  const manifestName = "upup-sparkle.json";
8760
- const seaKeys = {
8761
- zip: `sparkle/${zipName}`,
8762
- manifest: `sparkle/${manifestName}`
8763
- };
8764
8759
  const decode = (text, zip) => Schema.decodeEffect(Manifest$2)(text).pipe(Effect.map((manifest) => ({
8765
8760
  zip,
8766
8761
  ...manifest
8767
8762
  })), Effect.option);
8768
8763
  const folder = () => {
8769
- if (isSea()) {
8770
- const assets = process.env["OTUI_ASSET_ROOT"];
8771
- return assets === void 0 ? void 0 : path.join(assets, path.dirname(seaKeys.zip));
8772
- }
8773
8764
  const packageJson = findPackageJSON(import.meta.url);
8774
8765
  return packageJson === void 0 ? void 0 : path.join(path.dirname(packageJson), "native", "dist");
8775
8766
  };
@@ -8851,9 +8842,16 @@ ready() {
8851
8842
  return 1
8852
8843
  fi
8853
8844
  }
8854
- # A copy of what upup handed over, where only this user can write; a failure is step $1's.
8845
+ # A copy of what upup handed over, where only this user can write; a failure is step $1's. Others
8846
+ # may also read a shared one ($2): as root, Sparkle starts its progress agent from upup-sparkle's
8847
+ # framework as the user, so it goes in /var/tmp, whose sticky bit keeps others from moving it. An
8848
+ # app's copy stays private, since its owner gets it after it is checked.
8855
8849
  secure() {
8856
- private=$(mktemp -d 2>"$log") || { private=; fail "$1"; return 1; }
8850
+ if [ "$mode" = root ] && [ "$2" = shared ]; then
8851
+ private=$(mktemp -d /var/tmp/upup.XXXXXX 2>"$log") && chmod 755 "$private" 2>"$log" || { fail "$1"; return 1; }
8852
+ else
8853
+ private=$(mktemp -d 2>"$log") || { fail "$1"; return 1; }
8854
+ fi
8857
8855
  payload="$private/$(basename "$source")"
8858
8856
  "$ditto" "$source" "$payload" 2>"$log" || { fail "$1"; return 1; }
8859
8857
  }
@@ -8867,7 +8865,7 @@ app() {
8867
8865
  if [ -e "$old" ] && [ ! -e "$dest" ]; then recover; return; fi
8868
8866
  rm -rf "$old" "$new" 2>"$log" || { fail cleanup; return; }
8869
8867
  if [ "$mode" = root ]; then
8870
- secure copy || return
8868
+ secure copy private || return
8871
8869
  "$codesign" --verify --deep --strict -R "$check" "$payload" 2>"$log" || { fail recheck; return; }
8872
8870
  owner=$("$stat" -f %u:%g "$dest" 2>"$log") && "$chown" -R "$owner" "$payload" 2>"$log" || { fail copy; return; }
8873
8871
  staged=$payload
@@ -8897,7 +8895,7 @@ app() {
8897
8895
  # upup-sparkle's exit status: 0 installed, 2 nothing to install, 3 Sparkle would install another
8898
8896
  # build, 4 the app is open; its last line on standard error says why.
8899
8897
  sparkle() {
8900
- secure helper || return
8898
+ secure helper shared || return
8901
8899
  sum=$("$shasum" -a 256 "$payload" 2>"$log") || { fail helper; return; }
8902
8900
  [ "\${sum%% *}" = "$check" ] || { echo "its sha256 is \${sum%% *}, not $check" >"$log"; fail helper; return; }
8903
8901
  "$ditto" -x -k "$payload" "$private" 2>"$log" || { fail helper; return; }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "sparkle": "2.10.1",
3
- "sha256": "64e9a29d4608bab349b1365f77fe2f04e97a6724aee7215d52ae9f250a079317",
3
+ "sha256": "0917b2a572ac00d6172824023253f51288e94b39d1c3722c2835452cc3f10f34",
4
4
  "team": "GTS5SR7S89"
5
5
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjermundgaraba/upup",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Understand, audit, and update system tools and project dependencies from one TUI.",
5
5
  "homepage": "https://github.com/gjermundgaraba/upup#readme",
6
6
  "bugs": {
@@ -78,8 +78,7 @@
78
78
  },
79
79
  "scripts": {
80
80
  "build": "vp pack",
81
- "sea": "node scripts/sea.ts",
82
- "sea:install": "node scripts/sea.ts --install",
81
+ "install:local": "node scripts/install-local.ts",
83
82
  "sparkle": "node scripts/sparkle.ts && node scripts/sparkle-smoke.ts",
84
83
  "sparkle:e2e": "node scripts/sparkle.ts && node scripts/sparkle-e2e.ts",
85
84
  "ready": "vp check && vp test && vp run build"