@acryldev/blends 1.7.24 → 1.7.26

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.
@@ -90,7 +90,7 @@ Next:
90
90
  `cd ben-notes && npm install && npm run dev` starts it. The app is Ben's: its history starts at one commit, and it remembers where it came from
91
91
  (`package.json` `acryl.from`) so that it can be updated.
92
92
 
93
- An official starter has a short id (`npx acryl new my-app --from acrylblends.csv-explorer`). A Community Blend has the id the store shows
93
+ An official starter has a short id (`npx acryl@latest new my-app --from acrylblends.csv-explorer`). A Community Blend has the id the store shows
94
94
  (`inboxxobni.sh-guide-notes`), and that works the same way: the id is looked up in the store's list of Community Blends and the app is made from the release
95
95
  the store lists, as if you had written its `github:` form. The app remembers that release, so `update` works. When neither the starters nor the Community list
96
96
  know an id, the error says so.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/blends",
3
- "version": "1.7.24",
3
+ "version": "1.7.26",
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",
@@ -70,7 +70,7 @@ export const PORT_ENV = 'ACRYLBLENDS_PORT'
70
70
  * desktop shell's packaged host only (frame.ts startFrameHost).
71
71
  */
72
72
  export const PROGRAM_ENV = 'ACRYLBLENDS_PROGRAM'
73
- /** The app's name, for a process that runs from the bundle on the app's `source` folder: the folder's own name says nothing (`source`). Set by `instanceEnv`. */
73
+ /** The app's name, for a process that runs from the bundle on the app's `source` folder (the folder's own name says nothing: `source`), or in a hosted box (its folder is called by the image). Set by `instanceEnv`, or by whoever hosts the app. */
74
74
  export const NAME_ENV = 'ACRYLBLENDS_NAME'
75
75
  export const HOST_ENV = 'ACRYLBLENDS_HOST'
76
76
  /** The names hosting platforms set: used when `ACRYLBLENDS_PORT` and `ACRYLBLENDS_HOST` are not. */
@@ -138,7 +138,8 @@ export function projectInstance(
138
138
  platform: NodeJS.Platform = process.platform,
139
139
  ): AppInstance {
140
140
  const root = resolve(projectRoot)
141
- const name = declaredName(root) ?? plainName(root)
141
+ // The environment's name wins, as it does for a pinned home: a hosting platform (a WebBox) names the app, whose folder is called whatever its image called it.
142
+ const name = env[NAME_ENV]?.trim() || declaredName(root) || plainName(root)
142
143
  const folders = appHomes(root, platform, env, personHome(env, platform))
143
144
  // An app made before the data moved still has `<app>/.acrylblends`: it is moved once, here, at start. A move that fails stops the app with the old folder intact.
144
145
  const moved = migrateOldHome(root, folders.data)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acryldev/instance",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Where the app keeps things (home, port, run lock), chosen once from the environment or the project folder.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -34,7 +34,9 @@ test('serves the index route: the first screen to a browser, the JSON hello to a
34
34
  withApp(async (app) => {
35
35
  const api = await app.root.router.request(`/`)
36
36
  assert.equal(api.status, 200)
37
- assert.deepEqual(await api.json(), { app: APP_NAME, ok: true })
37
+ // The app answers with its instance's name: the folder's or the package's, which `create-acrylblends --from` and a WebBox change after the app was written.
38
+ const appName = app.root.get('appInstance')?.name ?? APP_NAME
39
+ assert.deepEqual(await api.json(), { app: appName, ok: true })
38
40
  const page = await app.root.router.request(`/`, {
39
41
  headers: { accept: 'text/html,application/xhtml+xml,*/*;q=0.8' },
40
42
  })
@@ -42,7 +44,7 @@ test('serves the index route: the first screen to a browser, the JSON hello to a
42
44
  assert.match(page.headers.get('content-type') ?? '', /text\/html/)
43
45
  const html = await page.text()
44
46
  // The ACRYL frame's first tile asks for a page: the root must never hand it JSON (Chrome's viewer is nearly invisible in the dark frame).
45
- assert.ok(html.includes(`<h1>${APP_NAME}</h1>`), 'the page names the app')
47
+ assert.ok(html.includes(`<h1>${appName}</h1>`), 'the page names the app')
46
48
  assert.ok(html.includes('href="./about"'), 'the page links to About relatively')
47
49
  }))
48
50