@stacksjs/defaults 0.75.43 → 0.75.45

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.
@@ -370,7 +370,7 @@ What archiving does is part of every conversation (`conversation.archive`):
370
370
 
371
371
  | Provider | `mode` | Effect in the real app |
372
372
  |---|---|---|
373
- | iMessage | `confirm` | Opens the conversation in Messages at Delete Conversation; the person confirms. Apple has no API, and editing chat.db is ignored or synced everywhere. |
373
+ | iMessage | `confirm` | With a `controller`, Messages' own Delete on the row found by name; without one, opens the conversation for the person to delete. Apple has no API, and editing chat.db is ignored or synced everywhere. |
374
374
  | Slack DM / group DM | `native` | `conversations.close`; Slack reopens it when someone writes. `unarchive` reopens. |
375
375
  | Slack public channel | `native` | `conversations.leave`; `unarchive` rejoins. |
376
376
  | Slack private channel | `unsupported` | Untouched: leaving would need a re-invite. |
@@ -380,8 +380,8 @@ What archiving does is part of every conversation (`conversation.archive`):
380
380
  For iMessage, pass a `controller` (`{ remove(names, url, confirm), recover(names) }`)
381
381
  whenever the app can drive Messages by accessibility: it receives every label
382
382
  Messages might give the row (contact name, formatted number, handle) and should
383
- act on the row found by name, never on the current selection - the driver's
384
- fallback menu script does the latter. With a controller, `unarchive` recovers
383
+ act on the row found by name, never on the current selection. Without a
384
+ controller the driver only opens the conversation in Messages for the person to delete. With a controller, `unarchive` recovers
385
385
  from Recently Deleted, and `confirmDeletes: true` accepts Messages' alert too.
386
386
  Attic (`~/Code/Apps/attic`, `app/Desktop/messages-control.swift`) is the reference.
387
387
 
@@ -37,9 +37,17 @@ navigation otherwise appears as a blank native window.
37
37
 
38
38
  ## API
39
39
 
40
+ Two packages carry "desktop" in their name. `@stacksjs/desktop-build` (this
41
+ repo, `storage/framework/core/desktop`) holds the build and launch helpers
42
+ below. `@stacksjs/desktop` (the stx repo) wraps the Craft bridge for code
43
+ running inside the window; import it from `@stacksjs/desktop/browser` there,
44
+ since its root entry also carries host-side modules that pull in Node builtins
45
+ and fail a browser bundle. Attic (`~/Code/Apps/attic`) uses it for native
46
+ menus, context menus and alerts.
47
+
40
48
  ```typescript
41
- import { openDevWindow } from '@stacksjs/desktop'
42
- import type { Desktop, OpenDevWindowOptions } from '@stacksjs/desktop'
49
+ import { openDevWindow } from '@stacksjs/desktop-build'
50
+ import type { Desktop, OpenDevWindowOptions } from '@stacksjs/desktop-build'
43
51
 
44
52
  interface OpenDevWindowOptions {
45
53
  title?: string
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.75.43",
5
+ "version": "0.75.45",
6
6
  "description": "Stacks, built into VS Code: stx templates, pickier linting and formatting, encrypted env files, the dev server preview and every buddy command. No other extensions required.",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/chrisbbreuer",
@@ -140,8 +140,9 @@
140
140
  "category": "stx"
141
141
  },
142
142
  {
143
- "command": "css.reload",
144
- "title": "Css: Reload Configuration"
143
+ "command": "stx.reloadUtilityClasses",
144
+ "title": "Reload Utility Class Configuration",
145
+ "category": "stx"
145
146
  }
146
147
  ],
147
148
  "menus": {
@@ -364,10 +365,11 @@
364
365
  "default": true,
365
366
  "description": "Enable autocomplete for utility classes"
366
367
  },
367
- "css.remToPxRatio": {
368
+ "stx.utilityClasses.remToPxRatio": {
368
369
  "type": "number",
369
370
  "default": 16,
370
- "description": "Rem to px conversion ratio for hover previews"
371
+ "minimum": 0,
372
+ "markdownDescription": "Pixels per `rem` for the px values utility-class hovers show next to `rem` values. `0` hides them. Replaces `css.remToPxRatio`, which is still read when this is not set."
371
373
  }
372
374
  }
373
375
  }
@@ -411,7 +413,7 @@
411
413
  ]
412
414
  },
413
415
  "devDependencies": {
414
- "@stacksjs/stx-vscode": "^0.2.352",
416
+ "@stacksjs/stx-vscode": "^0.2.355",
415
417
  "@types/vscode": "~1.109.0",
416
418
  "@vscode/vsce": "^4.0.0"
417
419
  }
@@ -31,9 +31,18 @@ function fromStx(path: string): string {
31
31
  return STX_DIR + path.replace(/^\.\//, '')
32
32
  }
33
33
 
34
- /** `manifest` with its stx contributions replaced by the library's. */
34
+ /** The namespace of the extension's own commands; every other one is stx's. */
35
+ export const OWN_COMMAND_PREFIX = 'stacks.'
36
+
37
+ /**
38
+ * `manifest` with its stx contributions replaced by the library's.
39
+ *
40
+ * Commands are told apart by namespace, not by the library's current list: a
41
+ * command stx renamed or dropped is no longer in that list, and filtering by
42
+ * it kept the old entry as if it were this extension's own (`css.reload`
43
+ * outlived its rename to `stx.reloadUtilityClasses` that way).
44
+ */
35
45
  export function withStxContributes(manifest: any, stx: StxContributes): any {
36
- const stxCommands = new Set(stx.commands.map(command => command.command))
37
46
  const contributes = manifest.contributes
38
47
  const sections: Array<{ title: string }> = Array.isArray(contributes.configuration) ? contributes.configuration : [contributes.configuration]
39
48
 
@@ -43,7 +52,7 @@ export function withStxContributes(manifest: any, stx: StxContributes): any {
43
52
  ...contributes,
44
53
  languages: stx.languages.map(language => ({ ...language, configuration: fromStx(language.configuration) })),
45
54
  grammars: stx.grammars.map(grammar => ({ ...grammar, path: fromStx(grammar.path) })),
46
- commands: [...contributes.commands.filter((command: { command: string }) => !stxCommands.has(command.command)), ...stx.commands],
55
+ commands: [...contributes.commands.filter((command: { command: string }) => command.command.startsWith(OWN_COMMAND_PREFIX)), ...stx.commands],
47
56
  configuration: [...sections.filter(section => section.title !== stx.configuration.title), stx.configuration],
48
57
  },
49
58
  }
@@ -10,7 +10,7 @@
10
10
  import { describe, expect, it } from 'bun:test'
11
11
  import { readFileSync } from 'node:fs'
12
12
  import { join } from 'node:path'
13
- import { libraryContributes, withStxContributes } from '../scripts/stx-contributes'
13
+ import { libraryContributes, OWN_COMMAND_PREFIX, withStxContributes } from '../scripts/stx-contributes'
14
14
 
15
15
  const root = join(import.meta.dir, '..')
16
16
  const manifest = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'))
@@ -61,6 +61,19 @@ describe('stx language support', () => {
61
61
  expect(withStxContributes(manifest, libraryContributes(root))).toEqual(manifest)
62
62
  })
63
63
 
64
+ it('declares no stx command the library no longer ships', () => {
65
+ const shipped = new Set(libraryContributes(root).commands.map(command => command.command))
66
+ const stale = manifest.contributes.commands
67
+ .map((command: { command: string }) => command.command)
68
+ .filter((id: string) => !id.startsWith(OWN_COMMAND_PREFIX) && !shipped.has(id))
69
+ expect(stale).toEqual([])
70
+ })
71
+
72
+ it('drops a command stx renamed when syncing', () => {
73
+ const stale = { ...manifest, contributes: { ...manifest.contributes, commands: [...manifest.contributes.commands, { command: 'css.reload', title: 'Css: Reload Configuration' }] } }
74
+ expect(withStxContributes(stale, libraryContributes(root))).toEqual(manifest)
75
+ })
76
+
64
77
  it('declares the stx language and its grammar from the bundled assets', () => {
65
78
  expect(manifest.contributes.languages.map((language: { id: string }) => language.id)).toContain('stx')
66
79
  expect(manifest.contributes.grammars[0].path).toStartWith('./dist/stx/')
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.43",
5
+ "version": "0.75.45",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/stacksjs/stacks.git",
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "@iconify-json/f7": "^1.2.2",
57
57
  "@iconify-json/hugeicons": "^1.2.35",
58
- "@stacksjs/mobile": "^0.75.43",
58
+ "@stacksjs/mobile": "^0.75.45",
59
59
  "@stacksjs/sanitizer": "^0.2.348",
60
60
  "ts-qr-codes": "^0.1.8"
61
61
  }