@acryldev/blends 1.7.11 → 1.7.12

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.d.ts CHANGED
@@ -34,6 +34,18 @@ export declare const HELP: string;
34
34
  * Run the CLI and return the exit code: 0 done, 1 failed or refused, 2 a usage error. Never calls `process.exit`.
35
35
  */
36
36
  export declare function runCli(argv: readonly string[], io?: Io): Promise<number>;
37
+ /** The app's desktop shell: where its files are and its Electron entry, relative to the app (POSIX separators, as package.json `main` wants). */
38
+ type DesktopShell = {
39
+ readonly kind: 'copy';
40
+ readonly root: string;
41
+ readonly main: string;
42
+ } | {
43
+ readonly kind: 'package';
44
+ readonly root: string;
45
+ readonly main: string;
46
+ };
47
+ /** The app's desktop shell, or undefined for an app without one (a web-only app). A copy wins over the package: it is what the app runs. */
48
+ export declare function findDesktopShell(appDir: string): DesktopShell | undefined;
37
49
  /**
38
50
  * Whether the app is in the frame already, by its packages: it depends on the desktop shell package and its `cordis.patch.yml` mounts the Blends frame or the workbench. A starter
39
51
  * built that way (ACRYL ADE and Control Center, made from the monorepo) needs neither `add desktop-shell` nor the framing `upgrade`: both would refuse it (the
package/dist/index.js CHANGED
@@ -3207,6 +3207,20 @@ async function kvImport(options, io) {
3207
3207
  await source.close();
3208
3208
  }
3209
3209
  }
3210
+ // src/pack.ts
3211
+ /**
3212
+ * `acrylblends pack`: the app in a folder as an installer for this machine's OS (a DMG, an NSIS installer or a Debian package), made with the published
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
+ * the published package carries in pack/ (scripts-pack.mjs copies it); in ACRYL's checkout the CLI runs it from there.
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));
3218
+ if (script === void 0) {
3219
+ io.stderr.write("error: this copy of @acryldev/blends carries no packer (pack/pack-blank-mac.mjs)\n");
3220
+ return 1;
3221
+ }
3222
+ return spawnSync(process.execPath, [script, ...args], { stdio: "inherit" }).status ?? 1;
3223
+ }
3210
3224
  // src/preflight.ts
3211
3225
  /** The Node the framework needs (the bin refuses an older one before loading anything). */
3212
3226
  const NODE_MINIMUM = [22, 19];
@@ -4466,6 +4480,9 @@ Usage:
4466
4480
  for a page that has to be opened again after its session ended
4467
4481
  acrylblends preflight Check this machine for the workshop: Node, npm, git, a coding agent, a free port
4468
4482
  (and on Windows PowerShell and long paths); one line per check, PASS or the fix
4483
+ acrylblends pack --from <dir> [--product "Name"] [--arch arm64|x64] [--out d]
4484
+ The app in <dir> as an installer for this OS (DMG, NSIS .exe, .deb), made
4485
+ with the published packages; updates come from <dir>'s GitHub releases
4469
4486
  acrylblends build-client [root] [out] Compile the client modules once for production (src/client to dist/client)
4470
4487
  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]
4471
4488
  acrylblends check-deps [dir] Fail when app code imports a database driver or opener outside the file named in
@@ -4510,6 +4527,7 @@ async function runCli(argv, io = processIo()) {
4510
4527
  if (command === "plugins") return listPlugins(io);
4511
4528
  if (command === "open") return await openFrame(args, io);
4512
4529
  if (command === "preflight") return await runPreflight(io);
4530
+ if (command === "pack") return pack(args, io);
4513
4531
  throw new UsageError(`unknown command "${command}"`);
4514
4532
  } catch (error) {
4515
4533
  if (error instanceof UsageError) {
@@ -4530,6 +4548,6 @@ function parseCheckDeps(args) {
4530
4548
  function parseKv(args) {
4531
4549
  return parseKvOptions(args);
4532
4550
  }
4533
- export { FRAME_URL_FILE, HELP, TEMPLATES, TEMPLATE_ALIASES, TEMPLATE_SUMMARY, TargetNotEmptyError, UsageError, VERSION, add, assertTargetFree, closure, copyPlugin, copyTemplate, frameHome, frameUrlPath, init, isFramedByPackages, isOmitted, isTemplate, isValidName, libraryRoot, listPlugins, lookUpFrameUrl, mergeDependencies, mergeTooling, nameFrom, openFrame, parseAddOptions, parseInitOptions, parseUpdateOptions, parseUpgradeOptions, readFrameUrl, readLibrary, readTemplatePlugins, removeFrameUrl, resolveTemplate, runCli, templateDir, templatesRoot, tokenOfFrameUrl, update, upgrade, writeFrameUrl };
4551
+ export { FRAME_URL_FILE, HELP, TEMPLATES, TEMPLATE_ALIASES, TEMPLATE_SUMMARY, TargetNotEmptyError, UsageError, VERSION, add, assertTargetFree, closure, copyPlugin, copyTemplate, findDesktopShell, frameHome, frameUrlPath, init, isFramedByPackages, isOmitted, isTemplate, isValidName, libraryRoot, listPlugins, lookUpFrameUrl, mergeDependencies, mergeTooling, nameFrom, openFrame, parseAddOptions, parseInitOptions, parseUpdateOptions, parseUpgradeOptions, readFrameUrl, readLibrary, readTemplatePlugins, removeFrameUrl, resolveTemplate, runCli, templateDir, templatesRoot, tokenOfFrameUrl, update, upgrade, writeFrameUrl };
4534
4552
 
4535
4553
  //# sourceMappingURL=index.js.map