@stacksjs/defaults 0.72.25 → 0.72.27

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.
@@ -36,7 +36,7 @@ interface CiRunStateRow {
36
36
  async function loadPreviousStates(): Promise<Map<string, PreviousRunState>> {
37
37
  const rows = await db.unsafe(
38
38
  'SELECT repo_full_name, last_conclusion, last_run_id, last_notified_at FROM ci_run_states',
39
- ).execute() as CiRunStateRow[]
39
+ ).execute() as unknown as CiRunStateRow[]
40
40
 
41
41
  const map = new Map<string, PreviousRunState>()
42
42
  for (const r of rows ?? []) {
@@ -72,7 +72,7 @@ async function loadWindowSamples(windowMinutes: number, nowMs: number): Promise<
72
72
  const rows = await db.unsafe(
73
73
  'SELECT org, running, queued, cap, sampled_at FROM ci_runner_samples WHERE sampled_at >= ? ORDER BY sampled_at ASC',
74
74
  [cutoffIso],
75
- ).execute() as SampleRow[]
75
+ ).execute() as unknown as SampleRow[]
76
76
 
77
77
  return (rows ?? []).map((r): RunnerSample => ({
78
78
  org: r.org,
@@ -86,7 +86,7 @@ async function loadWindowSamples(windowMinutes: number, nowMs: number): Promise<
86
86
  async function loadAlertStates(): Promise<Map<string, RunnerAlertState>> {
87
87
  const rows = await db.unsafe(
88
88
  'SELECT org, alerting, last_alerted_at, last_cleared_at FROM ci_runner_alert_states',
89
- ).execute() as AlertStateRow[]
89
+ ).execute() as unknown as AlertStateRow[]
90
90
 
91
91
  const map = new Map<string, RunnerAlertState>()
92
92
  for (const r of rows ?? []) {
@@ -248,7 +248,7 @@ export async function fetchRunnerHistory(
248
248
  ORDER BY sampled_at DESC
249
249
  LIMIT ?`,
250
250
  [org, cutoffIso, limit],
251
- ).execute() as SampleRow[]
251
+ ).execute() as unknown as SampleRow[]
252
252
 
253
253
  return (rows ?? []).reverse().map((r): RunnerSample => ({
254
254
  org: r.org,
@@ -86,7 +86,7 @@ export default new Action({
86
86
  const boards = await db.unsafe(
87
87
  'SELECT * FROM boards WHERE id = ? LIMIT 1',
88
88
  [id],
89
- ).execute() as BoardRow[]
89
+ ).execute() as unknown as BoardRow[]
90
90
  const board = boards[0]
91
91
  if (!board) {
92
92
  return kanbanError('Board not found', 404)
@@ -96,15 +96,15 @@ export default new Action({
96
96
  db.unsafe(
97
97
  'SELECT * FROM board_columns WHERE board_id = ? ORDER BY position ASC, id ASC',
98
98
  [id],
99
- ).execute() as Promise<ColumnRow[]>,
99
+ ).execute() as unknown as Promise<ColumnRow[]>,
100
100
  db.unsafe(
101
101
  'SELECT * FROM cards WHERE board_id = ? AND archived = false ORDER BY column_id ASC, position ASC, id ASC',
102
102
  [id],
103
- ).execute() as Promise<CardRow[]>,
103
+ ).execute() as unknown as Promise<CardRow[]>,
104
104
  db.unsafe(
105
105
  'SELECT id, board_id, name, color FROM labels WHERE board_id = ? ORDER BY name ASC',
106
106
  [id],
107
- ).execute() as Promise<LabelRow[]>,
107
+ ).execute() as unknown as Promise<LabelRow[]>,
108
108
  ])
109
109
 
110
110
  // Pivot lookups for label + assignee chips on card previews.
@@ -51,7 +51,7 @@ export default new Action({
51
51
  FROM boards b
52
52
  WHERE b.archived = false
53
53
  ORDER BY b.position ASC, b.id ASC
54
- `).execute() as BoardRow[]
54
+ `).execute() as unknown as BoardRow[]
55
55
 
56
56
  const boards = (rows ?? []).map(r => ({
57
57
  id: r.id,
@@ -50,7 +50,7 @@ export default new Action({
50
50
  const cardRows = await db.unsafe(
51
51
  'SELECT * FROM cards WHERE id = ? LIMIT 1',
52
52
  [id],
53
- ).execute() as CardRow[]
53
+ ).execute() as unknown as CardRow[]
54
54
  const card = cardRows?.[0]
55
55
  if (!card) {
56
56
  return kanbanError('Card not found', 404)
@@ -362,7 +362,22 @@ export default class QueryController extends Controller {
362
362
  * asserted: `count` really can be a string, a number or a bigint
363
363
  * depending on the driver, which is why the return type says so.
364
364
  */
365
- return results.map(row => ({
365
+ /*
366
+ * Annotated rather than inferred.
367
+ *
368
+ * `results` comes back from an aggregate select, whose rows are named by
369
+ * their aliases rather than by the table, so each row is
370
+ * `Record<string, unknown>` - and the mapped literal collapses to the
371
+ * same thing rather than to the shape this method promises. Naming the
372
+ * element type is what makes the compiler check the mapping against the
373
+ * signature instead of widening past it.
374
+ */
375
+ return results.map((row): {
376
+ normalized_query: string
377
+ count: string | number | bigint
378
+ avg_duration: string | number
379
+ max_duration: number | undefined
380
+ } => ({
366
381
  normalized_query: String(row.normalized_query ?? ''),
367
382
  count: (typeof row.count === 'number' || typeof row.count === 'bigint' ? row.count : String(row.count ?? '0')),
368
383
  avg_duration: (typeof row.avg_duration === 'number' ? row.avg_duration : String(row.avg_duration ?? '0')),
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.72.25",
5
+ "version": "0.72.27",
6
6
  "description": "A modern Stacks development environment.",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/chrisbbreuer",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.72.25",
5
+ "version": "0.72.27",
6
6
  "description": "The complete managed Stacks application scaffold, including runtime defaults, AI guidance, editor metadata, and npm-backed project support files.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  "dependencies": {
47
47
  "@iconify-json/f7": "^1.2.2",
48
48
  "@iconify-json/hugeicons": "^1.2.27",
49
- "@stacksjs/mobile": "^0.72.25",
49
+ "@stacksjs/mobile": "^0.72.27",
50
50
  "@stacksjs/sanitizer": "^0.2.113"
51
51
  },
52
52
  "scripts": {