@acryldev/blends 1.7.14 → 1.7.16

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.js CHANGED
@@ -55,7 +55,7 @@ var packages = {
55
55
  "path": "../plugins/settings"
56
56
  },
57
57
  "@acryldev/sign-in": {
58
- "version": "0.2.1",
58
+ "version": "0.2.2",
59
59
  "path": "../plugins/sign-in"
60
60
  },
61
61
  "@acryldev/control": {
@@ -3213,10 +3213,10 @@ async function kvImport(options, io) {
3213
3213
  * packages, so a Blend's own repository releases its product without ACRYL's source. The packer is ACRYL's framework/scripts/pack-blank-mac.mjs, which
3214
3214
  * the published package carries in pack/ (scripts-pack.mjs copies it); in ACRYL's checkout the CLI runs it from there.
3215
3215
  */
3216
- function pack(args, io) {
3217
- const script = [new URL("../pack/pack-blank-mac.mjs", import.meta.url), new URL("../../../scripts/pack-blank-mac.mjs", import.meta.url)].map((url) => fileURLToPath(url)).find((file) => existsSync(file));
3216
+ function pack(args, io, file = "pack-blank-mac.mjs") {
3217
+ const script = [new URL(`../pack/${file}`, import.meta.url), new URL(`../../../scripts/${file}`, import.meta.url)].map((url) => fileURLToPath(url)).find((file) => existsSync(file));
3218
3218
  if (script === void 0) {
3219
- io.stderr.write("error: this copy of @acryldev/blends carries no packer (pack/pack-blank-mac.mjs)\n");
3219
+ io.stderr.write(`error: this copy of @acryldev/blends carries no packer (pack/${file})\n`);
3220
3220
  return 1;
3221
3221
  }
3222
3222
  return spawnSync(process.execPath, [script, ...args], { stdio: "inherit" }).status ?? 1;
@@ -3533,11 +3533,11 @@ function blendOfApp(yaml) {
3533
3533
  version
3534
3534
  };
3535
3535
  }
3536
- function sourceOfApp(yaml) {
3536
+ function sourceOfApp(yaml, packageJson) {
3537
3537
  const blend = blendOfApp(yaml);
3538
3538
  if (blend === void 0) return void 0;
3539
3539
  const metadata = /^metadata:\n((?:[ \t]+.*\n?)*)/mu.exec(yaml)?.[1] ?? "";
3540
- const from = /^[ \t]+from:[ \t]*["']?([^"'\s]+)/mu.exec(metadata)?.[1];
3540
+ const from = fromOfPackage(packageJson) ?? /^[ \t]+from:[ \t]*["']?([^"'\s]+)/mu.exec(metadata)?.[1];
3541
3541
  if (from === void 0) return {
3542
3542
  source: blend.id,
3543
3543
  current: blend.version
@@ -3548,6 +3548,15 @@ function sourceOfApp(yaml) {
3548
3548
  current: release === void 0 ? blend.version : release.replace(/^v/u, "")
3549
3549
  };
3550
3550
  }
3551
+ function fromOfPackage(text) {
3552
+ if (text === void 0) return void 0;
3553
+ try {
3554
+ const from = JSON.parse(text).acryl?.from;
3555
+ return typeof from === "string" && from.trim() !== "" ? from.trim() : void 0;
3556
+ } catch {
3557
+ return;
3558
+ }
3559
+ }
3551
3560
  /** The newest `vX.Y.Z` (or `X.Y.Z`) tag among `git ls-remote --tags` lines, as tagged. */
3552
3561
  function newestTag(lsRemote) {
3553
3562
  return lsRemote.split("\n").map((line) => /refs\/tags\/(v?\d+\.\d+\.\d+)$/u.exec(line.trim())?.[1]).filter((tag) => tag !== void 0).reduce((best, tag) => best === void 0 || isNewerVersion(tag.replace(/^v/u, ""), best.replace(/^v/u, "")) ? tag : best, void 0);
@@ -3618,7 +3627,8 @@ async function update(options, io, world = registryWorld(io)) {
3618
3627
  const say = (line) => io.stdout.write(`${line}\n`);
3619
3628
  const manifest = join(app, "blend.yaml");
3620
3629
  if (!existsSync(manifest)) throw new Error(`${app} has no blend.yaml: it was not made from a Blend, so there is nothing to update from`);
3621
- const origin = sourceOfApp(readFileSync(manifest, "utf8"));
3630
+ const packagePath = join(app, "package.json");
3631
+ const origin = sourceOfApp(readFileSync(manifest, "utf8"), existsSync(packagePath) ? readFileSync(packagePath, "utf8") : void 0);
3622
3632
  if (origin === void 0) throw new Error(`${manifest} names no metadata id and version`);
3623
3633
  const fromRepository = origin.source.startsWith("github:");
3624
3634
  const blend = {
@@ -4516,7 +4526,7 @@ Usage:
4516
4526
  acrylblends upgrade [plugin...] [--dir d] [--dry-run] [--force] [--diff]
4517
4527
  Bring the library plugins an app carries (the router, the server, the door, ...) up to this
4518
4528
  version: untouched files are replaced, an edited file stops it (diff shown) unless --force
4519
- acrylblends update [--dir d] [--check] Bring the newer release of what this app was made from (blend.yaml metadata.from: a registry
4529
+ acrylblends update [--dir d] [--check] Bring the newer release of what this app was made from (package.json acryl.from: a registry
4520
4530
  Blend, or a shared GitHub repository's newest vX.Y.Z tag) into it, keeping your changes
4521
4531
  (a git merge); --check only says whether there is one
4522
4532
  acrylblends plugins List the plugin library
@@ -4526,7 +4536,10 @@ Usage:
4526
4536
  (and on Windows PowerShell and long paths); one line per check, PASS or the fix
4527
4537
  acrylblends pack --from <dir> [--product "Name"] [--arch arm64|x64] [--out d]
4528
4538
  The app in <dir> as an installer for this OS (DMG, NSIS .exe, .deb), made
4529
- with the published packages; updates come from <dir>'s GitHub releases
4539
+ with the published packages; updates come from <dir>'s GitHub releases;
4540
+ on Linux also a portable .tar.gz (Arch Linux, Omarchy)
4541
+ acrylblends pkgbuild --dir <d> --product "Name" --version x.y.z --repo owner/name
4542
+ The PKGBUILD (Arch Linux, Omarchy) for a release whose Linux .tar.gz files are in <d>
4530
4543
  acrylblends build-client [root] [out] Compile the client modules once for production (src/client to dist/client)
4531
4544
  acrylblends kv import <kv.json> <db> Move a JSON-file kv store into the kv table of a SQLite database [--overwrite] [--table t] [--migrations dir]
4532
4545
  acrylblends check-deps [dir] Fail when app code imports a database driver or opener outside the file named in
@@ -4572,6 +4585,7 @@ async function runCli(argv, io = processIo()) {
4572
4585
  if (command === "open") return await openFrame(args, io);
4573
4586
  if (command === "preflight") return await runPreflight(io);
4574
4587
  if (command === "pack") return pack(args, io);
4588
+ if (command === "pkgbuild") return pack(args, io, "pkgbuild.mjs");
4575
4589
  throw new UsageError(`unknown command "${command}"`);
4576
4590
  } catch (error) {
4577
4591
  if (error instanceof UsageError) {