@acryldev/blends 1.7.32 → 1.7.34

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
@@ -19,6 +19,22 @@ dependencies - and a composition of plugins that runs in a browser or a desktop
19
19
 
20
20
  ---
21
21
 
22
+ ## Get started
23
+
24
+ Install ACRYL Control Center in one line. No Node and no admin for the app itself (if git or a desktop library is missing, Linux asks for sudo once), the download is checked against GitHub's sha256, and Windows and macOS open it without warnings because it is not browser-downloaded.
25
+
26
+ **macOS and Linux**
27
+ ```sh
28
+ curl -fsSL https://acryl.dev/install.sh | bash
29
+ ```
30
+
31
+ **Windows (PowerShell)**
32
+ ```powershell
33
+ irm https://acryl.dev/install.ps1 | iex
34
+ ```
35
+
36
+ **Developers:** `npx acryl@latest`
37
+
22
38
  ```ts
23
39
  import { Acryl } from 'acrylblends'
24
40
 
package/dist/index.js CHANGED
@@ -87,7 +87,7 @@ var packages = {
87
87
  "path": "../plugins/system-prompt"
88
88
  },
89
89
  "@acryldev/app-context": {
90
- "version": "0.2.1",
90
+ "version": "0.2.2",
91
91
  "path": "../plugins/app-context"
92
92
  },
93
93
  "@acryldev/versions": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/blends",
3
- "version": "1.7.32",
3
+ "version": "1.7.34",
4
4
  "description": "The Acryl web framework (import { Acryl } from \"acrylblends\") and the acrylblends command that scaffolds Cordis apps.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -7,9 +7,10 @@ import { type ChildProcess, spawn } from 'node:child_process'
7
7
  import { existsSync, readFileSync } from 'node:fs'
8
8
  import { createRequire } from 'node:module'
9
9
  import { join } from 'node:path'
10
+ import { selectInstance } from '@acryldev/instance'
10
11
  import { acrylRoot, appIdOf, personHome } from '@acryldev/instance/home'
11
12
  import { APP_ROOT_ENV } from './app-root.ts'
12
- import { appTitle, brandedElectron, iconFile } from './brand.ts'
13
+ import { brandedElectron, iconFile } from './brand.ts'
13
14
 
14
15
  /** The sysctl that makes the sandbox fail for an Electron without an AppArmor profile; its value, or `undefined` where it does not exist (every system but a recent Ubuntu). */
15
16
  export const RESTRICT_USERNS = '/proc/sys/kernel/apparmor_restrict_unprivileged_userns'
@@ -78,6 +79,23 @@ function mainFile(): string {
78
79
  return existsSync(compiled) ? compiled : join(import.meta.dirname, 'main.ts')
79
80
  }
80
81
 
82
+ /**
83
+ * What the branded Electron of an app is made from: where it lives, its id, the name the Dock and Cmd+Tab show and its icon. The name is the one the instance gives
84
+ * (the app's Blend name in `blend.yaml`, else its package's, or ACRYLBLENDS_NAME): the window's title and About say the same, so the Dock never reads differently.
85
+ */
86
+ export function brandingOf(
87
+ projectRoot: string,
88
+ env: Record<string, string | undefined>,
89
+ platform: NodeJS.Platform,
90
+ ): { folder: string; id: string; name: string; icon: string } {
91
+ return {
92
+ folder: join(acrylRoot(platform, env, personHome(env, platform)), 'electron'),
93
+ id: appIdOf(projectRoot),
94
+ name: selectInstance({ projectRoot, env }).name,
95
+ icon: iconFile(projectRoot),
96
+ }
97
+ }
98
+
81
99
  /**
82
100
  * Start the app in `projectRoot` as a desktop app: `npm run desktop` (bin.ts) with the app's folder, `extra` its arguments. Electron's main learns the
83
101
  * app from ACRYLBLENDS_APP_ROOT (app-root.ts), since the shell is installed in node_modules, outside the app's tree.
@@ -91,13 +109,7 @@ export function launchDesktop(projectRoot: string, extra: readonly string[]): Ch
91
109
  // macOS: the Dock and Cmd+Tab name the app and draw its icon only when the bundle says so (brand.ts); a copy that cannot be made leaves the stock Electron, with a note.
92
110
  const branded = brandedElectron({
93
111
  binary: electron,
94
- folder: join(
95
- acrylRoot(process.platform, process.env, personHome(process.env, process.platform)),
96
- 'electron',
97
- ),
98
- id: appIdOf(projectRoot),
99
- name: appTitle(projectRoot),
100
- icon: iconFile(projectRoot),
112
+ ...brandingOf(projectRoot, process.env, process.platform),
101
113
  })
102
114
  if (branded.problem !== undefined)
103
115
  console.warn(`desktop: the Dock shows Electron's own name and icon (${branded.problem})`)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/desktop-shell",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Run the app as a desktop app: an Electron window on the app's own server. `npm run desktop`; the app's code never imports electron.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: acryl-app
3
- description: How the __APP_NAME__ app is put together - its blend.yaml rows, its plugins/ folder and src/ - and how to change it, run it and check it through the door. Use before adding a feature, a route, a plugin or a dependency to this app, and before saying the work is done. Also use when asked to click, open, close, collapse, show or type something on screen: that is done with the door, not by editing code.
3
+ description: "How the __APP_NAME__ app is put together - its blend.yaml rows, its plugins/ folder and src/ - and how to change it, run it and check it through the door. Use before adding a feature, a route, a plugin or a dependency to this app, and before saying the work is done. Also use when asked to click, open, close, collapse, show or type something on screen: that is done with the door, not by editing code."
4
4
  ---
5
5
 
6
6
  # Working in __APP_NAME__