@acryldev/blends 1.7.6 → 1.7.8

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
@@ -47,7 +47,7 @@ var packages = {
47
47
  "path": "../plugins/app-shell"
48
48
  },
49
49
  "@acryldev/workspace": {
50
- "version": "0.2.1",
50
+ "version": "0.2.2",
51
51
  "path": "../plugins/workspace"
52
52
  },
53
53
  "@acryldev/settings": {
@@ -95,7 +95,7 @@ var packages = {
95
95
  "path": "../plugins/versions"
96
96
  },
97
97
  "@acryldev/blends-frame": {
98
- "version": "0.2.4",
98
+ "version": "0.2.5",
99
99
  "path": "../plugins/blends-frame"
100
100
  }
101
101
  };
@@ -17,9 +17,9 @@ ACRYL Control Center lists your apps, makes new ones and starts them. Download i
17
17
 
18
18
  | | Apple Silicon / ARM | Intel / x64 |
19
19
  | --- | --- | --- |
20
- | macOS | [ACRYL-Control-Center-mac-arm64.dmg](https://github.com/acryldev/acryl/releases/download/control-center-v0.2.2/ACRYL-Control-Center-mac-arm64.dmg) | [ACRYL-Control-Center-mac-x64.dmg](https://github.com/acryldev/acryl/releases/download/control-center-v0.2.2/ACRYL-Control-Center-mac-x64.dmg) |
21
- | Windows | [ACRYL-Control-Center-win-arm64.exe](https://github.com/acryldev/acryl/releases/download/control-center-v0.2.2/ACRYL-Control-Center-win-arm64.exe) | [ACRYL-Control-Center-win-x64.exe](https://github.com/acryldev/acryl/releases/download/control-center-v0.2.2/ACRYL-Control-Center-win-x64.exe) |
22
- | Linux (Debian, Ubuntu) | [ACRYL-Control-Center-linux-arm64.deb](https://github.com/acryldev/acryl/releases/download/control-center-v0.2.2/ACRYL-Control-Center-linux-arm64.deb) | [ACRYL-Control-Center-linux-x64.deb](https://github.com/acryldev/acryl/releases/download/control-center-v0.2.2/ACRYL-Control-Center-linux-x64.deb) |
20
+ | macOS | [ACRYL-Control-Center-mac-arm64.dmg](https://github.com/acrylblends/63-acryl-control-center/releases/latest/download/ACRYL-Control-Center-mac-arm64.dmg) | [ACRYL-Control-Center-mac-x64.dmg](https://github.com/acrylblends/63-acryl-control-center/releases/latest/download/ACRYL-Control-Center-mac-x64.dmg) |
21
+ | Windows | [ACRYL-Control-Center-win-arm64.exe](https://github.com/acrylblends/63-acryl-control-center/releases/latest/download/ACRYL-Control-Center-win-arm64.exe) | [ACRYL-Control-Center-win-x64.exe](https://github.com/acrylblends/63-acryl-control-center/releases/latest/download/ACRYL-Control-Center-win-x64.exe) |
22
+ | Linux (Debian, Ubuntu) | [ACRYL-Control-Center-linux-arm64.deb](https://github.com/acrylblends/63-acryl-control-center/releases/latest/download/ACRYL-Control-Center-linux-arm64.deb) | [ACRYL-Control-Center-linux-x64.deb](https://github.com/acrylblends/63-acryl-control-center/releases/latest/download/ACRYL-Control-Center-linux-x64.deb) |
23
23
 
24
24
  The apps are not signed yet: on macOS the first start is right-click > Open; on Windows SmartScreen may ask, More info > Run anyway; on Linux
25
25
  `sudo apt install ./ACRYL-Control-Center-linux-x64.deb`. Or, with Node.js installed, start it without a download:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/blends",
3
- "version": "1.7.6",
3
+ "version": "1.7.8",
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",
@@ -8,7 +8,7 @@
8
8
  * another app or with the real user's data.
9
9
  */
10
10
 
11
- import { mkdirSync, readFileSync } from 'node:fs'
11
+ import { mkdirSync, readFileSync, unwatchFile, watchFile } from 'node:fs'
12
12
  import { join } from 'node:path'
13
13
  import { fileURLToPath, pathToFileURL } from 'node:url'
14
14
  import { app, BrowserWindow, dialog, ipcMain, Menu, MenuItem, screen, shell } from 'electron'
@@ -147,6 +147,16 @@ if (!app.requestSingleInstanceLock()) {
147
147
  void app.whenReady().then(async () => {
148
148
  // The Dock shows the app's own icon even when the bundle could not be branded (brand.ts); a no-op where there is no Dock.
149
149
  app.dock?.setIcon(iconFile(projectRoot))
150
+ // An icon chosen in Settings > App (written to assets/icon.png by the frame's host) shows at once, in the Dock and on every window.
151
+ const ownIcon = join(projectRoot, 'assets', 'icon.png')
152
+ watchFile(ownIcon, { interval: 1000 }, () => {
153
+ const icon = iconFile(projectRoot)
154
+ app.dock?.setIcon(icon)
155
+ for (const open of BrowserWindow.getAllWindows()) if (!open.isDestroyed()) open.setIcon(icon)
156
+ })
157
+ app.on('will-quit', () => {
158
+ unwatchFile(ownIcon)
159
+ })
150
160
  // The hook above is registered before the app's modules are loaded, so the app may have .tsx pages: they are loaded here, not as a static import.
151
161
  // A dev server is already running from this folder (`npm run dev`): the door allows one process per folder, so the window opens on that server instead of starting a second one,
152
162
  // and closing the window leaves it running.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/desktop-shell",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
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": {
@@ -6,7 +6,7 @@
6
6
  "provides": ["pluginShare"],
7
7
  "dependencies": {
8
8
  "@deepseek-ai/cordis": "4.0.4",
9
- "@acryldev/app-persistence": "0.1.3",
9
+ "@acryldev/app-persistence": "0.1.4",
10
10
  "@acryldev/blends-core": "0.6.0",
11
11
  "@acryldev/plugin-hub-core": "0.2.2",
12
12
  "yaml": "2.9.0"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/save",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Save the app to its own git repository, and share it: a repository of its own on GitHub, created and pushed only after a person confirms the plan. Refuses a file that holds a secret, and a private app going to a public remote.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -6,7 +6,7 @@
6
6
  "provides": [],
7
7
  "dependencies": {
8
8
  "@deepseek-ai/cordis": "4.0.4",
9
- "@acryldev/app-persistence": "0.1.3"
9
+ "@acryldev/app-persistence": "0.1.4"
10
10
  },
11
11
  "mount": "add the scripts \"save\": \"node plugins/save/cli.ts\" and \"share\": \"node plugins/save/share-cli.ts\" to package.json; mount the plugin to give the agent a save_app tool",
12
12
  "entries": {
@@ -5,12 +5,15 @@
5
5
  * --confirm <plan> send exactly this plan (the JSON `--json` printed, as it is or base64url-encoded so no shell can change it), and nothing when
6
6
  * the app no longer matches it: for a person's own surface that showed them the plan and took their yes (the ACRYL
7
7
  * launcher's Share)
8
+ * --list list it in the Blends store too (public only), as Community under your name; --category <address> and
9
+ * --subcategory <address> place it (default: its earlier place, else its starter's category), --license <id> (default MIT)
8
10
  * Exits 1 when the share was refused.
9
11
  */
10
12
  import { realpathSync } from 'node:fs'
11
13
  import { createInterface } from 'node:readline/promises'
12
14
  import { fileURLToPath } from 'node:url'
13
15
  import { parseArgs } from 'node:util'
16
+ import { CATEGORIES_URL, type CatalogCategory, readCategories } from '@acryldev/app-persistence'
14
17
  import { planShare, renderSharePlan, type SharePlan, type ShareResult, shareApp } from './share.ts'
15
18
 
16
19
  function report(result: ShareResult): number {
@@ -21,6 +24,12 @@ function report(result: ShareResult): number {
21
24
  return 1
22
25
  }
23
26
  console.log(`shared to ${result.remote}${result.created ? ' (created)' : ''}`)
27
+ if (result.listed !== undefined)
28
+ console.log(
29
+ result.listed.created
30
+ ? `listed in the Blends store from ${result.listed.tag}: acrylblends.github.io shows it within about an hour`
31
+ : `${result.listed.tag} was already tagged, so the store keeps that version: raise the version in package.json to list this one`,
32
+ )
24
33
  return 0
25
34
  }
26
35
 
@@ -44,6 +53,17 @@ function readPlan(text: string): unknown {
44
53
  return undefined
45
54
  }
46
55
 
56
+ /** The store's category list; without it (offline) a place is not checked here, and the store's sync still is. */
57
+ async function publishedCategories(): Promise<{ categories?: readonly CatalogCategory[] }> {
58
+ try {
59
+ const response = await fetch(CATEGORIES_URL, { signal: AbortSignal.timeout(10_000) })
60
+ const categories = response.ok ? readCategories(await response.json()) : 'unreachable'
61
+ return typeof categories === 'string' ? {} : { categories }
62
+ } catch {
63
+ return {}
64
+ }
65
+ }
66
+
47
67
  async function main(argv: readonly string[]): Promise<number> {
48
68
  const appRoot = fileURLToPath(new URL('../..', import.meta.url))
49
69
  const { values } = parseArgs({
@@ -54,6 +74,10 @@ async function main(argv: readonly string[]): Promise<number> {
54
74
  visibility: { type: 'string' },
55
75
  json: { type: 'boolean' },
56
76
  confirm: { type: 'string' },
77
+ list: { type: 'boolean' },
78
+ category: { type: 'string' },
79
+ subcategory: { type: 'string' },
80
+ license: { type: 'string' },
57
81
  },
58
82
  })
59
83
  if (
@@ -64,7 +88,18 @@ async function main(argv: readonly string[]): Promise<number> {
64
88
  console.error('not shared: --visibility is private or public')
65
89
  return 1
66
90
  }
91
+ const listing = values.list === true || values.category !== undefined
67
92
  const options = {
93
+ ...(listing
94
+ ? {
95
+ list: {
96
+ ...(values.category === undefined ? {} : { category: values.category }),
97
+ ...(values.subcategory === undefined ? {} : { subcategory: values.subcategory }),
98
+ ...(values.license === undefined ? {} : { license: values.license }),
99
+ },
100
+ ...(await publishedCategories()),
101
+ }
102
+ : {}),
68
103
  ...(values.owner === undefined ? {} : { owner: values.owner }),
69
104
  ...(values.visibility === undefined
70
105
  ? {}
@@ -5,22 +5,46 @@
5
5
  * same guards hold: no file that holds a secret, and a private app never goes to a public repository.
6
6
  */
7
7
  import { spawnSync } from 'node:child_process'
8
- import { readFileSync, writeFileSync } from 'node:fs'
8
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs'
9
9
  import { basename, join } from 'node:path'
10
10
  import {
11
+ type AppIdentity,
12
+ type CatalogCategory,
11
13
  connectRemote,
12
14
  type GitPort,
15
+ GITHUB_VIA_GH,
13
16
  gitCli,
14
17
  githubHosting,
15
18
  type HostingPort,
16
19
  PersistenceError,
20
+ type Placement,
21
+ placementOf,
22
+ placementProblem,
17
23
  readAppIdentity,
18
24
  type SecretFinding,
19
25
  saveApp,
26
+ suggestPlacement,
20
27
  type Visibility,
28
+ withId,
29
+ withLicense,
30
+ withPlacement,
21
31
  withVisibility,
22
32
  } from '@acryldev/app-persistence'
23
33
 
34
+ /** The GitHub topic acrylblends.github.io's hourly sync finds a Blend's repository by. */
35
+ export const BLEND_TOPIC = 'acrylblends-blend'
36
+
37
+ /** Where and how the Blends store lists the app: shown in the plan, written by the share. */
38
+ export interface StoreListing {
39
+ /** Its id in the store, under its owner's name (`ana.notes`): an app made from a starter is `acrylblends.<name>`, which only official owners may list. */
40
+ readonly id: string
41
+ readonly placement: Placement
42
+ /** An SPDX licence id (MIT): a public Blend names its terms. */
43
+ readonly license: string
44
+ /** The tag people start from (`--from github:owner/repo#v1.0.0`): v and the app's version. */
45
+ readonly tag: string
46
+ }
47
+
24
48
  /** What a share would send, and where. */
25
49
  export interface SharePlan {
26
50
  /** The repository: `owner/name` for one to be created, the remote's address for an app that has one. */
@@ -30,6 +54,8 @@ export interface SharePlan {
30
54
  readonly visibility: Visibility
31
55
  /** How many files changed since the last save; the share saves them first. */
32
56
  readonly changes: number
57
+ /** Listed in the Blends store too (acrylblends.github.io and Control Center's store), as Community under the owner's name. */
58
+ readonly listing?: StoreListing
33
59
  }
34
60
 
35
61
  export type ShareRefused = {
@@ -45,6 +71,8 @@ export type ShareResult =
45
71
  readonly created: boolean
46
72
  /** The version saved by the share, when something had changed. */
47
73
  readonly commit?: string
74
+ /** The store listing: its tag, and whether this share made it (an existing tag is kept, so a new listing needs a new version). */
75
+ readonly listed?: { readonly tag: string; readonly created: boolean }
48
76
  }
49
77
  | ShareRefused
50
78
 
@@ -53,6 +81,10 @@ export interface ShareOptions {
53
81
  readonly owner?: string
54
82
  /** Who may see a new repository; blend.yaml's metadata.visibility when absent. A share with it records it there, so later saves agree. */
55
83
  readonly visibility?: Visibility
84
+ /** List it in the Blends store. Any part not given is taken from the app: its earlier listing, else its starter's category; licence MIT. */
85
+ readonly list?: { readonly category?: string; readonly subcategory?: string; readonly license?: string }
86
+ /** The published category list (acrylblends.github.io/categories.json), to check the place against; unchecked when absent. */
87
+ readonly categories?: readonly CatalogCategory[]
56
88
  }
57
89
 
58
90
  /** What a share needs from the computer; tests give their own. */
@@ -63,6 +95,8 @@ export interface SharePorts {
63
95
  account(): string | undefined
64
96
  /** How many files differ from the last save. */
65
97
  pending(): number
98
+ /** Label `owner/repo` for the Blends store and push the tag; false when the tag already existed (it is never moved). */
99
+ list(repository: string, tag: string): boolean
66
100
  }
67
101
 
68
102
  /** The person's own git and gh, in the app's folder. */
@@ -82,6 +116,17 @@ export function sharePorts(appRoot: string): SharePorts {
82
116
  const result = run('git', ['status', '--porcelain'])
83
117
  return result.status === 0 ? result.stdout.split('\n').filter(Boolean).length : 0
84
118
  },
119
+ list: (repository, tag) => {
120
+ const must = (command: string, args: readonly string[], what: string) => {
121
+ const result = run(command, args)
122
+ if (result.status !== 0) throw new PersistenceError(`${what}: ${(result.stderr || result.stdout).trim()}`)
123
+ }
124
+ must('gh', ['repo', 'edit', repository, '--add-topic', BLEND_TOPIC], 'could not label the repository for the Blends store')
125
+ if (run('git', ['rev-parse', '-q', '--verify', `refs/tags/${tag}`]).status === 0) return false
126
+ must('git', ['tag', tag], `could not tag ${tag}`)
127
+ must('git', [...GITHUB_VIA_GH, 'push', '--quiet', 'origin', `refs/tags/${tag}`], `could not push ${tag}`)
128
+ return true
129
+ },
85
130
  }
86
131
  }
87
132
 
@@ -96,12 +141,106 @@ const repositoryName = (name: string): string =>
96
141
  .replace(/^[-.]+|[-.]+$/gu, '')
97
142
  .toLowerCase()
98
143
 
144
+ /** `owner/repo` of a GitHub remote address, or undefined for another host. */
145
+ export const githubRepository = (remote: string): string | undefined =>
146
+ /github\.com[/:]([^/]+\/[^/]+?)(?:\.git)?\/?$/u.exec(remote)?.[1]
147
+
148
+ const INSTALL_SCRIPTS = ['preinstall', 'install', 'postinstall', 'prepublish', 'preprepare', 'prepare', 'postprepare']
149
+ const LICENSE_ID = /^[A-Za-z0-9][A-Za-z0-9.+-]*$/u
150
+
151
+ interface PackageJson { version?: unknown; keywords?: unknown; scripts?: Record<string, unknown>; [key: string]: unknown }
152
+ const packageOf = (appRoot: string): PackageJson | undefined => {
153
+ try {
154
+ return JSON.parse(readFileSync(join(appRoot, 'package.json'), 'utf8')) as PackageJson
155
+ } catch {
156
+ return undefined
157
+ }
158
+ }
159
+
160
+ /** The store listing a share asked for, as the person will read it, or why it cannot be listed. */
161
+ function planListing(appRoot: string, identity: AppIdentity, visibility: Visibility, repository: string | undefined, options: ShareOptions): StoreListing | ShareRefused | undefined {
162
+ const asked = options.list
163
+ if (asked === undefined) return undefined
164
+ if (visibility !== 'public') return refused('only a public app can be listed in the Blends store: choose public')
165
+ if (repository === undefined) return refused('only an app on GitHub can be listed in the Blends store')
166
+ if (identity.description === undefined) return refused('the store lists an app with its description: add one to blend.yaml (metadata.description)')
167
+ const pkg = packageOf(appRoot)
168
+ if (pkg === undefined) return refused('the app has no readable package.json')
169
+ const script = INSTALL_SCRIPTS.find(name => typeof pkg.scripts?.[name] === 'string')
170
+ if (script !== undefined) return refused(`package.json defines the install script "${script}", which a listed app may not`)
171
+ const categories = options.categories ?? []
172
+ const placement: Placement | undefined = asked.category !== undefined
173
+ ? { category: asked.category, ...(asked.subcategory === undefined ? {} : { subcategory: asked.subcategory }) }
174
+ : placementOf(pkg.keywords) ?? suggestPlacement(identity.category, categories)
175
+ if (placement === undefined) return refused('choose its category, one of acrylblends.github.io/blends (for example --category gaming)')
176
+ const problem = categories.length > 0 ? placementProblem(placement, categories) : undefined
177
+ if (problem !== undefined) return refused(problem)
178
+ const license = asked.license ?? identity.license ?? 'MIT'
179
+ if (!LICENSE_ID.test(license)) return refused(`"${license}" is not a licence id (such as MIT or Apache-2.0)`)
180
+ const version = typeof pkg.version === 'string' ? pkg.version : identity.version ?? '0.1.0'
181
+ const name = (identity.id ?? '').split('.').slice(1).join('.') || repository.split('/')[1] || ''
182
+ const id = `${(repository.split('/')[0] ?? '').toLowerCase()}.${name.toLowerCase()}`
183
+ return { id, placement, license, tag: `v${version}` }
184
+ }
185
+
186
+ const MIT = (year: number, holder: string) => `MIT License
187
+
188
+ Copyright (c) ${String(year)} ${holder}
189
+
190
+ Permission is hereby granted, free of charge, to any person obtaining a copy
191
+ of this software and associated documentation files (the "Software"), to deal
192
+ in the Software without restriction, including without limitation the rights
193
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
194
+ copies of the Software, and to permit persons to whom the Software is
195
+ furnished to do so, subject to the following conditions:
196
+
197
+ The above copyright notice and this permission notice shall be included in all
198
+ copies or substantial portions of the Software.
199
+
200
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
201
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
202
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
203
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
204
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
205
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
206
+ SOFTWARE.
207
+ `
208
+
209
+ /**
210
+ * The files the store reads, written into the app before it is saved: the licence in blend.yaml (and an MIT LICENSE file when it has none),
211
+ * the marker and placement keywords in package.json, and the acryl.template.json that lets people start an app from it. Returns blend.yaml's text.
212
+ */
213
+ function writeListing(appRoot: string, manifestText: string, listing: StoreListing, repository: string): string {
214
+ const identity = readAppIdentity(manifestText)
215
+ let text = manifestText
216
+ if (identity.id !== listing.id) text = withId(text, listing.id)
217
+ if (identity.license !== listing.license) text = withLicense(text, listing.license)
218
+ if (text !== manifestText) writeFileSync(join(appRoot, 'blend.yaml'), text)
219
+ const pkg = packageOf(appRoot) ?? {}
220
+ const before = Array.isArray(pkg.keywords) ? pkg.keywords.filter((word): word is string => typeof word === 'string') : []
221
+ const keywords = withPlacement(before.includes(BLEND_TOPIC) ? before : [...before, BLEND_TOPIC], listing.placement)
222
+ if (JSON.stringify(keywords) !== JSON.stringify(pkg.keywords)) writeFileSync(join(appRoot, 'package.json'), `${JSON.stringify({ ...pkg, keywords }, null, 2)}\n`)
223
+ const template = join(appRoot, 'acryl.template.json')
224
+ if (!existsSync(template)) writeFileSync(template, `${JSON.stringify({ name: identity.name ?? basename(appRoot), description: identity.description ?? '' }, null, 2)}\n`)
225
+ if (listing.license === 'MIT' && !['LICENSE', 'LICENSE.md', 'LICENSE.txt'].some(file => existsSync(join(appRoot, file))))
226
+ writeFileSync(join(appRoot, 'LICENSE'), MIT(new Date().getFullYear(), repository.split('/')[0] ?? ''))
227
+ return text
228
+ }
229
+
99
230
  /** What sharing the app would send. Sends nothing and changes nothing. */
100
231
  export function planShare(
101
232
  appRoot: string,
102
233
  options: ShareOptions = {},
103
234
  ports: SharePorts = sharePorts(appRoot),
104
235
  ): SharePlan | ShareRefused {
236
+ const plan = planRepository(appRoot, options, ports)
237
+ if ('ok' in plan) return plan
238
+ const listing = planListing(appRoot, readAppIdentity(manifestOf(appRoot)), plan.visibility, plan.create ? plan.repository : githubRepository(plan.repository), options)
239
+ if (listing !== undefined && 'ok' in listing) return listing
240
+ return listing === undefined ? plan : { ...plan, listing }
241
+ }
242
+
243
+ function planRepository(appRoot: string, options: ShareOptions, ports: SharePorts): SharePlan | ShareRefused {
105
244
  const identity = readAppIdentity(manifestOf(appRoot))
106
245
  const visibility = options.visibility ?? identity.visibility
107
246
  const changes = ports.pending()
@@ -136,7 +275,8 @@ export const sameSharePlan = (a: SharePlan, b: SharePlan): boolean =>
136
275
  a.repository === b.repository &&
137
276
  a.create === b.create &&
138
277
  a.visibility === b.visibility &&
139
- a.changes === b.changes
278
+ a.changes === b.changes &&
279
+ JSON.stringify(a.listing) === JSON.stringify(b.listing)
140
280
 
141
281
  /** The person's yes: share exactly the plan they read. An app that changed since is not shared; the plan is read again first. */
142
282
  export function shareApp(
@@ -159,7 +299,9 @@ export function shareApp(
159
299
  manifestText = withVisibility(manifestText, options.visibility)
160
300
  writeFileSync(join(appRoot, 'blend.yaml'), manifestText)
161
301
  }
302
+ const repository = now.create ? now.repository : githubRepository(now.repository)
162
303
  try {
304
+ if (now.listing !== undefined && repository !== undefined) manifestText = writeListing(appRoot, manifestText, now.listing, repository)
163
305
  let remote = now.repository
164
306
  if (now.create) {
165
307
  const connected = connectRemote(
@@ -179,11 +321,15 @@ export function shareApp(
179
321
  }
180
322
  // Nothing new to save: the versions already saved still have to reach the remote.
181
323
  if (saved.status === 'nothing-to-save') ports.git.push()
324
+ const listed = now.listing !== undefined && repository !== undefined
325
+ ? { tag: now.listing.tag, created: ports.list(repository, now.listing.tag) }
326
+ : undefined
182
327
  return {
183
328
  ok: true,
184
329
  remote,
185
330
  created: now.create,
186
331
  ...(saved.status === 'saved' ? { commit: saved.commit } : {}),
332
+ ...(listed === undefined ? {} : { listed }),
187
333
  }
188
334
  } catch (error) {
189
335
  if (error instanceof PersistenceError) return refused(error.message)
@@ -200,5 +346,11 @@ export function renderSharePlan(plan: SharePlan): string {
200
346
  plan.changes === 0
201
347
  ? 'the versions saved so far'
202
348
  : `${String(plan.changes)} changed ${plan.changes === 1 ? 'file' : 'files'}, saved first, and the versions saved so far`
203
- return `Share this app to ${where}: ${what}.`
349
+ const listed = plan.listing === undefined
350
+ ? ''
351
+ : ` Listed in the Blends store as ${plan.listing.id}, Community, under ${placementWords(plan.listing.placement)} (licence ${plan.listing.license}, people start from ${plan.listing.tag}).`
352
+ return `Share this app to ${where}: ${what}.${listed}`
204
353
  }
354
+
355
+ const placementWords = (placement: Placement): string =>
356
+ placement.subcategory === undefined ? placement.category : `${placement.category} › ${placement.subcategory}`
@@ -44,5 +44,9 @@
44
44
  "1.5.19",
45
45
  "1.5.20",
46
46
  "1.5.21",
47
- "1.6.0"
47
+ "1.6.0",
48
+ "1.7.4",
49
+ "1.7.5",
50
+ "1.7.6",
51
+ "1.7.7"
48
52
  ]