acryl 0.1.44 → 0.2.2

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.
Files changed (2) hide show
  1. package/desktop-runtime.js +12 -4
  2. package/package.json +5 -5
@@ -51,10 +51,18 @@ function defaultDownload(url) {
51
51
 
52
52
  /** Download the matching desktop installer into the managed cache and return its path. */
53
53
  export async function acquireDesktopInstaller({ version, download = defaultDownload, open }) {
54
- const tag = `desktop-v${version}`
55
- const response = await fetch(`${API}/${tag}`, { headers: { Accept: 'application/vnd.github+json' } })
56
- if (!response.ok) fail(`desktop release ${tag} not found (${response.status})`)
57
- const release = await response.json()
54
+ // The installers are assets of the release itself (`v<version>`, with the CLI and Web archives). Releases up to 0.2.1 kept them in a separate `desktop-v<version>` one.
55
+ const tags = [`v${version}`, `desktop-v${version}`]
56
+ let release
57
+ let lastStatus = 0
58
+ for (const tag of tags) {
59
+ const response = await fetch(`${API}/${tag}`, { headers: { Accept: 'application/vnd.github+json' } })
60
+ lastStatus = response.status
61
+ if (!response.ok) continue
62
+ const candidate = await response.json()
63
+ if (Array.isArray(candidate?.assets) && candidate.assets.some(asset => typeof asset?.name === 'string' && /\.(dmg|deb|exe)$/u.test(asset.name))) { release = candidate; break }
64
+ }
65
+ if (release === undefined) fail(`desktop release ${tags.join(' or ')} not found (${lastStatus})`)
58
66
  const installer = selectDesktopInstaller(release)
59
67
  const root = managedDesktopRoot()
60
68
  const dir = join(root, version)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acryl",
3
- "version": "0.1.44",
3
+ "version": "0.2.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,10 +15,10 @@
15
15
  "README.md"
16
16
  ],
17
17
  "optionalDependencies": {
18
- "acryl-cli-darwin-arm64": "0.1.44",
19
- "acryl-cli-linux-arm64": "0.1.44",
20
- "acryl-cli-linux-x64": "0.1.44",
21
- "acryl-cli-windows-x64": "0.1.44"
18
+ "acryl-cli-darwin-arm64": "0.2.2",
19
+ "acryl-cli-linux-arm64": "0.2.2",
20
+ "acryl-cli-linux-x64": "0.2.2",
21
+ "acryl-cli-windows-x64": "0.2.2"
22
22
  },
23
23
  "engines": {
24
24
  "node": ">=22.19.0 || >=24.0.0"