@jskit-ai/jskit-catalog 0.2.118 → 0.2.119

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.
@@ -6,55 +6,55 @@
6
6
  "release": {
7
7
  "packages": {
8
8
  "@jskit-ai/agent": "0.1.3",
9
- "@jskit-ai/agent-docs": "0.1.366",
9
+ "@jskit-ai/agent-docs": "0.1.367",
10
10
  "@jskit-ai/agent-runtime": "0.1.49",
11
11
  "@jskit-ai/architecture-inspector": "0.1.34",
12
- "@jskit-ai/assistant-core": "0.2.94",
13
- "@jskit-ai/assistant-runtime": "0.2.100",
14
- "@jskit-ai/assistant-voice": "0.2.100",
15
- "@jskit-ai/assistant-voice-sherpa": "0.1.147",
12
+ "@jskit-ai/assistant-core": "0.2.95",
13
+ "@jskit-ai/assistant-runtime": "0.2.101",
14
+ "@jskit-ai/assistant-voice": "0.2.101",
15
+ "@jskit-ai/assistant-voice-sherpa": "0.1.148",
16
16
  "@jskit-ai/auth-core": "0.2.40",
17
17
  "@jskit-ai/auth-pass": "0.1.9",
18
18
  "@jskit-ai/auth-provider-local-core": "0.2.48",
19
19
  "@jskit-ai/auth-provider-local-db-core": "0.1.210",
20
- "@jskit-ai/auth-provider-oidc-core": "0.2.73",
20
+ "@jskit-ai/auth-provider-oidc-core": "0.2.74",
21
21
  "@jskit-ai/auth-provider-supabase-core": "0.2.43",
22
- "@jskit-ai/auth-web": "0.2.64",
22
+ "@jskit-ai/auth-web": "0.2.65",
23
23
  "@jskit-ai/config-eslint": "0.1.254",
24
24
  "@jskit-ai/connector-google-calendar": "0.2.60",
25
25
  "@jskit-ai/connectors-catalog": "0.2.63",
26
26
  "@jskit-ai/connectors-core": "0.2.60",
27
27
  "@jskit-ai/connectors-web": "0.2.60",
28
28
  "@jskit-ai/console-core": "0.2.72",
29
- "@jskit-ai/console-web": "0.1.306",
29
+ "@jskit-ai/console-web": "0.1.307",
30
30
  "@jskit-ai/crud-core": "0.2.61",
31
31
  "@jskit-ai/database-runtime": "0.1.292",
32
32
  "@jskit-ai/database-runtime-mysql": "0.1.290",
33
33
  "@jskit-ai/database-runtime-postgres": "0.1.289",
34
34
  "@jskit-ai/http-runtime": "0.2.36",
35
- "@jskit-ai/http-web": "0.2.65",
36
- "@jskit-ai/jskit-catalog": "0.2.118",
35
+ "@jskit-ai/http-web": "0.2.66",
36
+ "@jskit-ai/jskit-catalog": "0.2.119",
37
37
  "@jskit-ai/kernel": "0.2.35",
38
- "@jskit-ai/material-web": "0.1.15",
39
- "@jskit-ai/mobile-capacitor": "0.2.56",
38
+ "@jskit-ai/material-web": "0.1.16",
39
+ "@jskit-ai/mobile-capacitor": "0.2.57",
40
40
  "@jskit-ai/oidc-issuer-core": "0.1.61",
41
41
  "@jskit-ai/payments-core": "0.2.49",
42
42
  "@jskit-ai/payments-web": "0.2.36",
43
- "@jskit-ai/realtime": "0.2.59",
44
- "@jskit-ai/release": "0.1.16",
43
+ "@jskit-ai/realtime": "0.2.60",
44
+ "@jskit-ai/release": "0.1.17",
45
45
  "@jskit-ai/resource-core": "0.1.226",
46
46
  "@jskit-ai/resource-crud-core": "0.1.228",
47
47
  "@jskit-ai/resource-runtime": "0.2.57",
48
48
  "@jskit-ai/rewarded-core": "0.2.72",
49
- "@jskit-ai/rewarded-web": "0.2.82",
50
- "@jskit-ai/shell-web": "0.2.56",
49
+ "@jskit-ai/rewarded-web": "0.2.83",
50
+ "@jskit-ai/shell-web": "0.2.57",
51
51
  "@jskit-ai/storage-runtime": "0.1.281",
52
52
  "@jskit-ai/uploads-image-web": "0.2.35",
53
53
  "@jskit-ai/uploads-runtime": "0.2.35",
54
54
  "@jskit-ai/users-core": "0.2.72",
55
- "@jskit-ai/users-web": "0.2.90",
55
+ "@jskit-ai/users-web": "0.2.91",
56
56
  "@jskit-ai/workspaces-core": "0.2.72",
57
- "@jskit-ai/workspaces-web": "0.2.90"
57
+ "@jskit-ai/workspaces-web": "0.2.91"
58
58
  },
59
59
  "singletonPackages": [
60
60
  "@jskit-ai/assistant-runtime",
@@ -185,7 +185,7 @@
185
185
  },
186
186
  {
187
187
  "packageId": "@jskit-ai/assistant-core",
188
- "version": "0.2.94",
188
+ "version": "0.2.95",
189
189
  "description": "Reusable assistant client/server/shared primitives without surface-specific routes or settings ownership.",
190
190
  "jskit": {
191
191
  "kind": "runtime",
@@ -369,7 +369,7 @@
369
369
  },
370
370
  {
371
371
  "packageId": "@jskit-ai/assistant-runtime",
372
- "version": "0.2.100",
372
+ "version": "0.2.101",
373
373
  "description": "Capability-based assistant runtime with per-surface chat, transcripts, settings, and action tools.",
374
374
  "jskit": {
375
375
  "kind": "runtime",
@@ -475,16 +475,16 @@
475
475
  },
476
476
  "packageJson": {
477
477
  "dependencies": {
478
- "@jskit-ai/assistant-core": "0.2.94",
478
+ "@jskit-ai/assistant-core": "0.2.95",
479
479
  "@jskit-ai/resource-core": "0.1.226",
480
480
  "json-rest-schema": "^1.0.20"
481
481
  },
482
482
  "peerDependencies": {
483
483
  "@jskit-ai/http-runtime": "0.2.36",
484
- "@jskit-ai/http-web": "0.2.65",
484
+ "@jskit-ai/http-web": "0.2.66",
485
485
  "@jskit-ai/kernel": "0.2.35",
486
- "@jskit-ai/realtime": "0.2.59",
487
- "@jskit-ai/shell-web": "0.2.56",
486
+ "@jskit-ai/realtime": "0.2.60",
487
+ "@jskit-ai/shell-web": "0.2.57",
488
488
  "@tanstack/vue-query": "^5.90.5",
489
489
  "vue": "^3.5.13",
490
490
  "vuetify": "^4.0.0",
@@ -495,7 +495,7 @@
495
495
  },
496
496
  {
497
497
  "packageId": "@jskit-ai/assistant-voice",
498
- "version": "0.2.100",
498
+ "version": "0.2.101",
499
499
  "description": "Duplex voice conversations with application-owned targets and authorization, and the speech service engine with its client.",
500
500
  "jskit": {
501
501
  "kind": "runtime",
@@ -541,7 +541,7 @@
541
541
  },
542
542
  "packageJson": {
543
543
  "dependencies": {
544
- "@jskit-ai/assistant-core": "0.2.94",
544
+ "@jskit-ai/assistant-core": "0.2.95",
545
545
  "ws": "^8.20.1"
546
546
  },
547
547
  "peerDependencies": {
@@ -553,7 +553,7 @@
553
553
  },
554
554
  {
555
555
  "packageId": "@jskit-ai/assistant-voice-sherpa",
556
- "version": "0.1.147",
556
+ "version": "0.1.148",
557
557
  "description": "Optional native Sherpa speech engine and explicit model preparation for assistant voice.",
558
558
  "jskit": {
559
559
  "kind": "runtime",
@@ -591,7 +591,7 @@
591
591
  },
592
592
  "packageJson": {
593
593
  "dependencies": {
594
- "@jskit-ai/assistant-voice": "0.2.100",
594
+ "@jskit-ai/assistant-voice": "0.2.101",
595
595
  "sherpa-onnx-node": "1.13.6"
596
596
  }
597
597
  }
@@ -888,7 +888,7 @@
888
888
  },
889
889
  {
890
890
  "packageId": "@jskit-ai/auth-provider-oidc-core",
891
- "version": "0.2.73",
891
+ "version": "0.2.74",
892
892
  "description": "Sign in through any OpenID Connect issuer: self-registration or a static client, app-owned sessions, and back-channel logout.",
893
893
  "jskit": {
894
894
  "kind": "runtime",
@@ -1028,7 +1028,7 @@
1028
1028
  },
1029
1029
  {
1030
1030
  "packageId": "@jskit-ai/auth-web",
1031
- "version": "0.2.64",
1031
+ "version": "0.2.65",
1032
1032
  "description": "Auth web module: Fastify auth routes plus web login/sign-out scaffolds.",
1033
1033
  "jskit": {
1034
1034
  "kind": "runtime",
@@ -1373,7 +1373,7 @@
1373
1373
  "@jskit-ai/auth-core": "0.2.40",
1374
1374
  "@jskit-ai/http-runtime": "0.2.36",
1375
1375
  "@jskit-ai/kernel": "0.2.35",
1376
- "@jskit-ai/shell-web": "0.2.56",
1376
+ "@jskit-ai/shell-web": "0.2.57",
1377
1377
  "@tanstack/vue-query": "^5.90.5",
1378
1378
  "pinia": "^4.0.3",
1379
1379
  "vue": "^3.5.44",
@@ -1631,7 +1631,7 @@
1631
1631
  },
1632
1632
  {
1633
1633
  "packageId": "@jskit-ai/console-web",
1634
- "version": "0.1.306",
1634
+ "version": "0.1.307",
1635
1635
  "description": "Authenticated console surface scaffold and surface policy wiring.",
1636
1636
  "jskit": {
1637
1637
  "kind": "runtime",
@@ -1728,8 +1728,8 @@
1728
1728
  "@jskit-ai/console-core": "0.2.72"
1729
1729
  },
1730
1730
  "peerDependencies": {
1731
- "@jskit-ai/auth-web": "0.2.64",
1732
- "@jskit-ai/shell-web": "0.2.56"
1731
+ "@jskit-ai/auth-web": "0.2.65",
1732
+ "@jskit-ai/shell-web": "0.2.57"
1733
1733
  }
1734
1734
  }
1735
1735
  },
@@ -2000,7 +2000,7 @@
2000
2000
  },
2001
2001
  {
2002
2002
  "packageId": "@jskit-ai/http-web",
2003
- "version": "0.2.65",
2003
+ "version": "0.2.66",
2004
2004
  "description": "Neutral Vue request, command, resource, and CRUD UI runtime for JSKIT web applications.",
2005
2005
  "jskit": {
2006
2006
  "kind": "runtime",
@@ -2086,8 +2086,8 @@
2086
2086
  "peerDependencies": {
2087
2087
  "@jskit-ai/http-runtime": "0.2.36",
2088
2088
  "@jskit-ai/kernel": "0.2.35",
2089
- "@jskit-ai/realtime": "0.2.59",
2090
- "@jskit-ai/shell-web": "0.2.56",
2089
+ "@jskit-ai/realtime": "0.2.60",
2090
+ "@jskit-ai/shell-web": "0.2.57",
2091
2091
  "@tanstack/vue-query": "^5.90.5",
2092
2092
  "vue": "^3.5.13",
2093
2093
  "vue-router": "^5.0.4",
@@ -2097,7 +2097,7 @@
2097
2097
  },
2098
2098
  {
2099
2099
  "packageId": "@jskit-ai/material-web",
2100
- "version": "0.1.15",
2100
+ "version": "0.1.16",
2101
2101
  "description": "Exact Material 3 for JSKIT Vuetify apps: seed-generated light and dark schemes, Material Symbols Rounded icon aliases, Roboto Flex and Material 3 component defaults.",
2102
2102
  "jskit": {
2103
2103
  "kind": "runtime",
@@ -2126,7 +2126,7 @@
2126
2126
  },
2127
2127
  {
2128
2128
  "packageId": "@jskit-ai/mobile-capacitor",
2129
- "version": "0.2.56",
2129
+ "version": "0.2.57",
2130
2130
  "description": "Thin Capacitor client integration for JSKIT mobile-shell launch routing and auth callback completion.",
2131
2131
  "jskit": {
2132
2132
  "kind": "runtime",
@@ -2178,7 +2178,7 @@
2178
2178
  },
2179
2179
  "peerDependencies": {
2180
2180
  "@jskit-ai/kernel": "0.2.35",
2181
- "@jskit-ai/shell-web": "0.2.56"
2181
+ "@jskit-ai/shell-web": "0.2.57"
2182
2182
  }
2183
2183
  }
2184
2184
  },
@@ -2378,7 +2378,7 @@
2378
2378
  },
2379
2379
  {
2380
2380
  "packageId": "@jskit-ai/realtime",
2381
- "version": "0.2.59",
2381
+ "version": "0.2.60",
2382
2382
  "description": "Thin, generic realtime runtime wrappers for socket.io server and client.",
2383
2383
  "jskit": {
2384
2384
  "kind": "runtime",
@@ -2770,7 +2770,7 @@
2770
2770
  },
2771
2771
  {
2772
2772
  "packageId": "@jskit-ai/rewarded-web",
2773
- "version": "0.2.82",
2773
+ "version": "0.2.83",
2774
2774
  "description": "Rewarded gate client workflow with explicitly composed application delivery.",
2775
2775
  "jskit": {
2776
2776
  "kind": "runtime",
@@ -2824,14 +2824,14 @@
2824
2824
  "peerDependencies": {
2825
2825
  "@jskit-ai/http-runtime": "0.2.36",
2826
2826
  "@jskit-ai/kernel": "0.2.35",
2827
- "@jskit-ai/shell-web": "0.2.56",
2827
+ "@jskit-ai/shell-web": "0.2.57",
2828
2828
  "vue": "^3.5.13"
2829
2829
  }
2830
2830
  }
2831
2831
  },
2832
2832
  {
2833
2833
  "packageId": "@jskit-ai/shell-web",
2834
- "version": "0.2.56",
2834
+ "version": "0.2.57",
2835
2835
  "description": "Web shell layout runtime with outlet-based placement contributions.",
2836
2836
  "jskit": {
2837
2837
  "kind": "runtime",
@@ -3609,7 +3609,7 @@
3609
3609
  },
3610
3610
  {
3611
3611
  "packageId": "@jskit-ai/users-web",
3612
- "version": "0.2.90",
3612
+ "version": "0.2.91",
3613
3613
  "description": "Users web module with account, profile, and user-specific shell UI.",
3614
3614
  "jskit": {
3615
3615
  "kind": "runtime",
@@ -3818,11 +3818,11 @@
3818
3818
  "@jskit-ai/users-core": "0.2.72"
3819
3819
  },
3820
3820
  "peerDependencies": {
3821
- "@jskit-ai/auth-web": "0.2.64",
3821
+ "@jskit-ai/auth-web": "0.2.65",
3822
3822
  "@jskit-ai/http-runtime": "0.2.36",
3823
- "@jskit-ai/http-web": "0.2.65",
3823
+ "@jskit-ai/http-web": "0.2.66",
3824
3824
  "@jskit-ai/kernel": "0.2.35",
3825
- "@jskit-ai/shell-web": "0.2.56",
3825
+ "@jskit-ai/shell-web": "0.2.57",
3826
3826
  "@tanstack/vue-query": "^5.90.5",
3827
3827
  "vue": "^3.5.13",
3828
3828
  "vue-router": "^5.0.4",
@@ -4040,7 +4040,7 @@
4040
4040
  },
4041
4041
  {
4042
4042
  "packageId": "@jskit-ai/workspaces-web",
4043
- "version": "0.2.90",
4043
+ "version": "0.2.91",
4044
4044
  "description": "Workspace web module: workspace selector, tools widget, workspace surfaces, members UI, and settings hosts.",
4045
4045
  "jskit": {
4046
4046
  "kind": "runtime",
@@ -4292,11 +4292,11 @@
4292
4292
  "@jskit-ai/workspaces-core": "0.2.72"
4293
4293
  },
4294
4294
  "peerDependencies": {
4295
- "@jskit-ai/auth-web": "0.2.64",
4296
- "@jskit-ai/http-web": "0.2.65",
4295
+ "@jskit-ai/auth-web": "0.2.65",
4296
+ "@jskit-ai/http-web": "0.2.66",
4297
4297
  "@jskit-ai/kernel": "0.2.35",
4298
- "@jskit-ai/shell-web": "0.2.56",
4299
- "@jskit-ai/users-web": "0.2.90",
4298
+ "@jskit-ai/shell-web": "0.2.57",
4299
+ "@jskit-ai/users-web": "0.2.91",
4300
4300
  "@tanstack/vue-query": "^5.90.5",
4301
4301
  "vue": "^3.5.13",
4302
4302
  "vue-router": "^5.0.4",
@@ -4328,7 +4328,7 @@
4328
4328
  "@jskit-ai/shell-web"
4329
4329
  ],
4330
4330
  "packageId": "@jskit-ai/assistant-runtime",
4331
- "packageVersion": "0.2.100",
4331
+ "packageVersion": "0.2.101",
4332
4332
  "documentPath": "patterns/assistant-surface/PATTERN.md",
4333
4333
  "examplePath": "patterns/assistant-surface/example",
4334
4334
  "files": [
@@ -4390,7 +4390,7 @@
4390
4390
  "@jskit-ai/shell-web"
4391
4391
  ],
4392
4392
  "packageId": "@jskit-ai/auth-web",
4393
- "packageVersion": "0.2.64",
4393
+ "packageVersion": "0.2.65",
4394
4394
  "documentPath": "patterns/auth-surface/PATTERN.md",
4395
4395
  "examplePath": "patterns/auth-surface/example",
4396
4396
  "files": [
@@ -4431,7 +4431,7 @@
4431
4431
  "@jskit-ai/auth-web"
4432
4432
  ],
4433
4433
  "packageId": "@jskit-ai/auth-provider-oidc-core",
4434
- "packageVersion": "0.2.73",
4434
+ "packageVersion": "0.2.74",
4435
4435
  "documentPath": "patterns/oidc-sign-in/PATTERN.md",
4436
4436
  "examplePath": "patterns/oidc-sign-in/example",
4437
4437
  "files": [
@@ -4460,7 +4460,7 @@
4460
4460
  "@jskit-ai/kernel"
4461
4461
  ],
4462
4462
  "packageId": "@jskit-ai/auth-web",
4463
- "packageVersion": "0.2.64",
4463
+ "packageVersion": "0.2.65",
4464
4464
  "documentPath": "patterns/own-design-sign-in/PATTERN.md",
4465
4465
  "examplePath": "patterns/own-design-sign-in/example",
4466
4466
  "files": [
@@ -4932,7 +4932,7 @@
4932
4932
  "@jskit-ai/shell-web"
4933
4933
  ],
4934
4934
  "packageId": "@jskit-ai/console-web",
4935
- "packageVersion": "0.1.306",
4935
+ "packageVersion": "0.1.307",
4936
4936
  "documentPath": "patterns/console-surface/PATTERN.md",
4937
4937
  "examplePath": "patterns/console-surface/example",
4938
4938
  "files": [
@@ -5027,7 +5027,7 @@
5027
5027
  "@jskit-ai/resource-crud-core"
5028
5028
  ],
5029
5029
  "packageId": "@jskit-ai/http-web",
5030
- "packageVersion": "0.2.65",
5030
+ "packageVersion": "0.2.66",
5031
5031
  "documentPath": "patterns/crud-screen-set/PATTERN.md",
5032
5032
  "examplePath": "patterns/crud-screen-set/example",
5033
5033
  "files": [
@@ -5144,7 +5144,7 @@
5144
5144
  "@jskit-ai/mobile-capacitor"
5145
5145
  ],
5146
5146
  "packageId": "@jskit-ai/mobile-capacitor",
5147
- "packageVersion": "0.2.56",
5147
+ "packageVersion": "0.2.57",
5148
5148
  "documentPath": "patterns/android-application/PATTERN.md",
5149
5149
  "examplePath": "patterns/android-application/example",
5150
5150
  "files": [
@@ -5168,7 +5168,7 @@
5168
5168
  "@jskit-ai/shell-web"
5169
5169
  ],
5170
5170
  "packageId": "@jskit-ai/realtime",
5171
- "packageVersion": "0.2.59",
5171
+ "packageVersion": "0.2.60",
5172
5172
  "documentPath": "patterns/realtime-application/PATTERN.md",
5173
5173
  "examplePath": "patterns/realtime-application/example",
5174
5174
  "files": [
@@ -5192,7 +5192,7 @@
5192
5192
  "@jskit-ai/rewarded-web"
5193
5193
  ],
5194
5194
  "packageId": "@jskit-ai/rewarded-web",
5195
- "packageVersion": "0.2.82",
5195
+ "packageVersion": "0.2.83",
5196
5196
  "documentPath": "patterns/google-rewarded/PATTERN.md",
5197
5197
  "examplePath": "patterns/google-rewarded/example",
5198
5198
  "files": [
@@ -5219,7 +5219,7 @@
5219
5219
  "@jskit-ai/shell-web"
5220
5220
  ],
5221
5221
  "packageId": "@jskit-ai/shell-web",
5222
- "packageVersion": "0.2.56",
5222
+ "packageVersion": "0.2.57",
5223
5223
  "documentPath": "patterns/application-shell/PATTERN.md",
5224
5224
  "examplePath": "patterns/application-shell/example",
5225
5225
  "files": [
@@ -5265,7 +5265,7 @@
5265
5265
  "@jskit-ai/shell-web"
5266
5266
  ],
5267
5267
  "packageId": "@jskit-ai/shell-web",
5268
- "packageVersion": "0.2.56",
5268
+ "packageVersion": "0.2.57",
5269
5269
  "documentPath": "patterns/page-and-placement/PATTERN.md",
5270
5270
  "examplePath": "patterns/page-and-placement/example",
5271
5271
  "files": [
@@ -5301,7 +5301,7 @@
5301
5301
  "@jskit-ai/users-web"
5302
5302
  ],
5303
5303
  "packageId": "@jskit-ai/users-web",
5304
- "packageVersion": "0.2.90",
5304
+ "packageVersion": "0.2.91",
5305
5305
  "documentPath": "patterns/account-settings/PATTERN.md",
5306
5306
  "examplePath": "patterns/account-settings/example",
5307
5307
  "files": [
@@ -5400,7 +5400,7 @@
5400
5400
  "@jskit-ai/workspaces-web"
5401
5401
  ],
5402
5402
  "packageId": "@jskit-ai/workspaces-web",
5403
- "packageVersion": "0.2.90",
5403
+ "packageVersion": "0.2.91",
5404
5404
  "documentPath": "patterns/workspace-surfaces/PATTERN.md",
5405
5405
  "examplePath": "patterns/workspace-surfaces/example",
5406
5406
  "files": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/jskit-catalog",
3
- "version": "0.2.118",
3
+ "version": "0.2.119",
4
4
  "description": "Published metadata catalog for JSKIT package metadata.",
5
5
  "type": "module",
6
6
  "files": [
package/scripts/jskit.mjs CHANGED
@@ -61,10 +61,12 @@ function usage() {
61
61
  " config with a webServer uses browserTestConfig() of @jskit-ai/jskit-catalog/browser-tests (one",
62
62
  " production-build server and database per worker), never a development server, and every one",
63
63
  " has a globalTimeout. It fails on the app's test sources (test/*): a test file that waits a fixed",
64
- " time (waitForTimeout, a setTimeout promise, an awaited sleep) without `// jskit-test: fixed-wait -",
65
- " <reason>` on the line before, a test script, runner config or test file that names the test",
66
- " database itself, a script that gives jskit test its files (so npm test -- <file> would run them",
67
- " all), a CI workflow whose TEST_DB_NAME or BROWSER_TEST_DB_NAME is its DB_NAME, and a root Vite",
64
+ " time (waitForTimeout, a setTimeout promise, an awaited sleep; not a timer racing another wait in",
65
+ " Promise.race, nor a poll loop's interval) without `// jskit-test: fixed-wait - <what the window",
66
+ " proves, or the latency the stand-in simulates>` on the line before, a test script, runner config",
67
+ " or test file that names the test database itself, a script that gives jskit test the files node's",
68
+ " default pattern selects anyway (so npm test -- <file> would run them all), a CI workflow whose",
69
+ " TEST_DB_NAME or BROWSER_TEST_DB_NAME is its DB_NAME, and a root Vite",
68
70
  " config whose dts writes a generated file into src. It fails when two table resources",
69
71
  " (defineTableResource) of the app and its installed JSKIT packages share a table or a name",
70
72
  " (data/one-resource-per-table), or when a system",
@@ -318,4 +318,4 @@ async function runTests(args) {
318
318
  return exitCode;
319
319
  }
320
320
 
321
- export { planTestRuns, runTests, withTimeReporter };
321
+ export { DEFAULT_PATTERN, findTestFiles, planTestRuns, runTests, withTimeReporter };
@@ -0,0 +1,153 @@
1
+ // What test/fixed-sleep needs to know about a wait that its line cannot show: whether it is an element of
2
+ // `Promise.race([...])`, a bound on another wait, and whether a loop around it in its own function re-reads a
3
+ // condition, a poll interval. A tokenizer (strings, template literals, comments, regular expressions) and bracket
4
+ // matching, no syntax tree: a source whose brackets do not match scans to null, and the rule reads its lines alone.
5
+
6
+ const CLOSERS = new Map([[")", "("], ["]", "["], ["}", "{"]]);
7
+ const TOKEN = /=>|===|!==|==|!=|<=|>=|&&|\|\||\?\?|\+\+|--|\+=|-=|\?\.|\.\.\.|[\w$]+|\S/uy;
8
+ // A `/` after a value divides; after anything else, or one of these words, it starts a regular expression.
9
+ const VALUE = /^(?:[\w$]+|[)\]}]|\+\+|--)$/u;
10
+ const BEFORE_EXPRESSION = /^(?:return|typeof|instanceof|in|of|new|delete|void|throw|case|do|else|await|yield)$/u;
11
+ const COMPARISON = /^(?:<|<=|>|>=|!=|!==)$/u;
12
+ const NOT_A_COUNT = /^(?:&&|\|\||\?\?|!|\?|===|==|\(|"|'|`)$/u;
13
+ const STEP = /^(?:\+\+|--|\+=|-=)$/u;
14
+
15
+ /** Tokens from `at` to the end, or from a template's `${` to its `}`; null when a string, comment or regex never ends. */
16
+ function tokenize(text, at = 0, inTemplate = false) {
17
+ const tokens = [];
18
+ for (let depth = 0; at < text.length;) {
19
+ const start = at;
20
+ const char = text[at];
21
+ const previous = tokens.at(-1);
22
+ if (/\s/u.test(char)) at += 1;
23
+ else if (text.startsWith("//", at)) at = text.includes("\n", at) ? text.indexOf("\n", at) : text.length;
24
+ else if (text.startsWith("/*", at)) at = text.includes("*/", at + 2) ? text.indexOf("*/", at + 2) + 2 : -1;
25
+ else if ("\"'`".includes(char) || (char === "/" && (!previous ||
26
+ (!previous.quoted && (BEFORE_EXPRESSION.test(previous.value) || !VALUE.test(previous.value)))))) {
27
+ at = char === "`" ? skipTemplate(text, at + 1) : skipQuoted(text, at + 1, char);
28
+ while (char === "/" && at > 0 && /[a-z]/u.test(text[at] ?? "")) at += 1;
29
+ tokens.push({ value: char, quoted: char, start, end: at });
30
+ } else if (inTemplate && char === "}" && depth === 0) {
31
+ return { tokens, end: at + 1 };
32
+ } else {
33
+ depth += char === "{" ? 1 : char === "}" ? -1 : 0;
34
+ TOKEN.lastIndex = at;
35
+ at += TOKEN.exec(text)[0].length;
36
+ tokens.push({ value: text.slice(start, at), start, end: at });
37
+ }
38
+ if (at < 0) return null;
39
+ }
40
+ return inTemplate ? null : { tokens, end: at };
41
+ }
42
+
43
+ /** The end of a string or regular expression whose opening `quote` came just before `at`, or -1. */
44
+ function skipQuoted(text, at, quote) {
45
+ for (let inClass = false; at < text.length && text[at] !== "\n"; at += text[at] === "\\" ? 2 : 1) {
46
+ if (text[at] === quote && !inClass) return at + 1;
47
+ if (quote === "/" && "[]".includes(text[at])) inClass = text[at] === "[";
48
+ }
49
+ return -1;
50
+ }
51
+
52
+ function skipTemplate(text, at) {
53
+ while (at < text.length && text[at] !== "`") {
54
+ at = text.startsWith("${", at) ? tokenize(text, at + 2, true)?.end ?? Infinity : at + (text[at] === "\\" ? 2 : 1);
55
+ }
56
+ return at < text.length ? at + 1 : -1;
57
+ }
58
+
59
+ /** The source's tokens, each with `parent`, its innermost open bracket, and each bracket with its `partner`; or null. */
60
+ function scanSource(text) {
61
+ const tokens = tokenize(String(text))?.tokens;
62
+ const open = [];
63
+ for (const [index, token] of (tokens || []).entries()) {
64
+ token.parent = open.at(-1) ?? -1;
65
+ if (token.quoted) continue;
66
+ if ("([{".includes(token.value)) {
67
+ open.push(index);
68
+ } else if (CLOSERS.has(token.value)) {
69
+ if (tokens[open.at(-1)]?.value !== CLOSERS.get(token.value)) return null;
70
+ token.partner = open.pop();
71
+ tokens[token.partner].partner = index;
72
+ }
73
+ }
74
+ return tokens && open.length < 1 ? tokens : null;
75
+ }
76
+
77
+ const precededBy = (tokens, index, ...values) => values.every((value, back) => tokens[index - 1 - back]?.value === value);
78
+
79
+ /** The `for` or `while` keyword whose header closes at `close`, or -1. */
80
+ function loopKeyword(tokens, close) {
81
+ const open = tokens[close]?.value === ")" ? tokens[close].partner : -1;
82
+ if (precededBy(tokens, open, "for") || precededBy(tokens, open, "while")) return open - 1;
83
+ return precededBy(tokens, open, "await", "for") ? open - 2 : -1;
84
+ }
85
+
86
+ /** What the `{` at `open` starts: a function, a loop (with its keyword's index), a switch, or another block. */
87
+ function blockOf(tokens, open) {
88
+ const previous = tokens[open - 1];
89
+ if (previous?.value === "=>") return { kind: "function" };
90
+ if (previous?.value === "do") return { kind: "loop", keyword: open - 1 };
91
+ if (loopKeyword(tokens, open - 1) >= 0) return { kind: "loop", keyword: loopKeyword(tokens, open - 1) };
92
+ if (previous?.value !== ")") return { kind: "block" };
93
+ const keyword = tokens[previous.partner - 1]?.value;
94
+ return { kind: keyword === "switch" ? "switch" : /^(?:if|catch|with)$/u.test(keyword) ? "block" : "function" };
95
+ }
96
+
97
+ /** Whether a loop (its keyword's index, its `{` or -1) reads a condition each round, or returns or breaks on one. */
98
+ function rereads(tokens, keyword, body) {
99
+ const header = tokens[keyword].value === "do" ? tokens[body].partner + 2 : keyword + (precededBy(tokens, keyword + 2, "await") ? 2 : 1);
100
+ const parts = [[]];
101
+ for (let index = header + 1; tokens[header]?.value === "(" && index < tokens[header].partner; index += 1) {
102
+ if (tokens[index].parent === header && tokens[index].value === ";") parts.push([]);
103
+ else parts.at(-1).push(tokens[index]);
104
+ }
105
+ // A for-of or for-in: a `for` header without `;`, its `of` or `in` at the top (not `of()` or `"x" in y` in a test).
106
+ const iterates = tokens[keyword].value === "for" && parts.length < 2 &&
107
+ parts[0].some((token) => token.parent === header && /^(?:of|in)$/u.test(token.value));
108
+ const own = body >= 0 ? tokens.slice(body + 1, tokens[body].partner) : [];
109
+ const steps = [...(parts[2] || []), ...own];
110
+ const stepped = new Set(steps.filter((token, index) => STEP.test(steps[index + 1]?.value) || STEP.test(steps[index - 1]?.value))
111
+ .map(({ value }) => value));
112
+ const words = (parts.length === 3 ? parts[1] : parts[0]).map(({ value }) => value).join(" ")
113
+ .replace(/\b(?:Date|performance) \. now \( \)/gu, "now()").split(" ").filter(Boolean);
114
+ // A loop that only counts rounds or watches the clock waits a fixed time in all; its condition is a single
115
+ // comparison of its own step, or the clock, with a value.
116
+ const counts = words.length < 1 || /^(?:true|1)$/u.test(words.join(" ")) || (words.filter((word) => COMPARISON.test(word)).length === 1 &&
117
+ !words.some((word) => NOT_A_COUNT.test(word)) && words.some((word) => word === "now()" || stepped.has(word)));
118
+ if (!iterates && !counts) return true;
119
+ return own.some((token, offset) => {
120
+ const index = body + 1 + offset;
121
+ const conditional = token.parent !== body || precededBy(tokens, index, "else") ||
122
+ (precededBy(tokens, index, ")") && precededBy(tokens, tokens[index - 1].partner, "if"));
123
+ return /^(?:return|break)$/u.test(token.value) && conditional && !leaves(tokens, index, body, token.value === "break");
124
+ });
125
+ }
126
+
127
+ /** Whether a return or break at `index` leaves a function (a break also a loop or switch) nested inside `body`. */
128
+ function leaves(tokens, index, body, isBreak) {
129
+ for (let open = tokens[index].parent; open > body; open = tokens[open].parent) {
130
+ const { kind } = tokens[open].value === "{" ? blockOf(tokens, open) : { kind: "expression" };
131
+ if (kind === "function" || (isBreak && (kind === "loop" || kind === "switch"))) return true;
132
+ }
133
+ return false;
134
+ }
135
+
136
+ /** Whether the wait whose code starts at `offset` is an element of Promise.race([...]) or polls in a loop. */
137
+ function excusedWait(text, offset, tokens = scanSource(text)) {
138
+ const index = tokens ? tokens.findIndex((token) => token.end > offset) : -1;
139
+ const token = tokens?.[index];
140
+ if (!token || token.start > offset) return false;
141
+ if (token.quoted) return "\"'`".includes(token.quoted) && excusedWait(text.slice(token.start + 1, token.end - 1), offset - token.start - 1);
142
+ if (tokens[token.parent]?.value === "[" && precededBy(tokens, token.parent, "(", "race", ".", "Promise")) return true;
143
+ const braceless = loopKeyword(tokens, (precededBy(tokens, index, "await") ? index - 1 : index) - 1);
144
+ if (braceless >= 0 && rereads(tokens, braceless, -1)) return true;
145
+ for (let open = token.parent; open >= 0; open = tokens[open].parent) {
146
+ const block = tokens[open].value === "{" ? blockOf(tokens, open) : { kind: "expression" };
147
+ if (block.kind === "function") return false;
148
+ if (block.kind === "loop" && rereads(tokens, block.keyword, open)) return true;
149
+ }
150
+ return false;
151
+ }
152
+
153
+ export { excusedWait, scanSource };
@@ -1,18 +1,25 @@
1
1
  import { readdir, readFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { fileExists } from "./files.mjs";
4
+ import { DEFAULT_PATTERN, findTestFiles } from "./test-command.mjs";
5
+ import { excusedWait, scanSource } from "./test-sources-scan.mjs";
4
6
 
5
7
  // The test-source part of plain `jskit check`: what an app's tests, test scripts, CI workflows and Vite config hold that
6
8
  // makes a run slow, fragile or unsafe, each found by its shape:
7
- // - test/fixed-sleep: a test file waits a fixed time instead of for its condition. The one fixed wait a test needs, a
8
- // window that proves nothing happens (no second read within it), says so on the line before:
9
- // `// jskit-test: fixed-wait - <what the window proves>`; a marker without a reason is a finding itself.
9
+ // - test/fixed-sleep: a test file waits a fixed time instead of for its condition. A timer racing another wait in
10
+ // `Promise.race([...])` bounds that wait, and a wait in a loop that re-reads its condition each round is a poll's
11
+ // interval: neither is reported (test-sources-scan.mjs). The fixed waits a test needs, a window that proves nothing
12
+ // happens (no second read within it) or the latency a stand-in simulates, say so on the line before:
13
+ // `// jskit-test: fixed-wait - <what the window proves, or the latency the stand-in simulates>`; a marker without a
14
+ // reason is a finding itself.
10
15
  // - test/fixed-database-name: a test script, Playwright or Vitest config, or test source names the test database
11
16
  // itself, so two runs (two sessions, two checkouts) share it and wipe each other's rows. The run's test-only env file
12
17
  // or its host names it, `jskit test --databases` gives each file its own copy, and browserTestConfig()'s prepare module
13
- // derives each browser worker's.
18
+ // derives each browser worker's. A name in a thrown error's message text names no database.
14
19
  // - test/test-database-is-app-database: a CI workflow gives TEST_DB_NAME or BROWSER_TEST_DB_NAME the value of its DB_NAME.
15
- // - test/script-files: a script gives `jskit test` its files, so `npm test -- <file>` runs every file and that one.
20
+ // - test/script-files: a script gives `jskit test` the files node's default pattern selects anyway, so `npm test --
21
+ // <file>` runs every file and that one. A script that runs some of them, or files the pattern leaves out, names them
22
+ // for a reason.
16
23
  // - test/generated-into-src: the app's Vite config writes a generated file (`dts`) into src, which the browser tests'
17
24
  // frontend build reads, so a build is never kept for reuse.
18
25
  // No other comment excuses them.
@@ -35,7 +42,9 @@ const PROMISE_SLEEP = new RegExp(
35
42
  "(?:\\1|\\(\\s*\\)\\s*=>\\s*\\{?\\s*\\1\\s*\\(\\s*\\)\\s*;?\\s*\\}?)\\s*,\\s*(\\d[\\d_]*(?:\\.\\d+)?)\\s*\\)\\s*;?\\s*\\}?\\s*\\)?",
36
43
  "u"
37
44
  );
38
- const AWAITED_SLEEP = /\bawait\s+(?:[A-Za-z_$][\w$]*\.)?(?:setTimeout|sleep|delay|wait|pause)\s*\(\s*(\d[\d_]*(?:\.\d+)?)\s*[,)]/u;
45
+ // An awaited setTimeout, sleep, delay or pause, its own or an object's (timers.setTimeout), and wait: its own or node's
46
+ // scheduler.wait. Another object's wait is that object's method, such as a fake clock's advance (page.wait(60_000)).
47
+ const AWAITED_SLEEP = /\bawait\s+(?:(?:[A-Za-z_$][\w$]*\.)?(?:setTimeout|sleep|delay|pause)|(?:scheduler\.)?wait)\s*\(\s*(\d[\d_]*(?:\.\d+)?)\s*[,)]/u;
39
48
 
40
49
  // The options of `jskit test` (node's test runner) that take the next argument as their value.
41
50
  const VALUE_OPTIONS = new Set([
@@ -60,9 +69,12 @@ const GENERATED_INTO_SRC = /\bdts\s*:\s*(["'`])((?:\.\/)?src\/[^"'`]+)\1/gu;
60
69
  const DATABASE_FIX = "the run's test-only env file or the host names the database, `jskit test --databases` gives each " +
61
70
  "test file its own copy of TEST_DB_NAME, and browserTestConfig()'s prepare module derives each worker's from " +
62
71
  "BROWSER_TEST_DB_NAME.";
72
+ const MARKER_FORM = "// jskit-test: fixed-wait - <what the window proves, or the latency the stand-in simulates>";
63
73
  const SLEEP_FIX = "wait for the condition instead: a web-first assertion (await expect(locator).toBeVisible()), " +
64
74
  "expect.poll(), the event itself, or a fake clock (mock.timers, vi.useFakeTimers(), page.clock). A window that proves " +
65
- "nothing happens says so on the line before: // jskit-test: fixed-wait - <what the window proves>.";
75
+ `nothing happens, or the latency a stand-in simulates, says so on the line before: ${MARKER_FORM}.`;
76
+ // A database name in a thrown error's message text, `throw new Error(\`DB_NAME (${process.env.DB_NAME || "unset"}) ...\`)`.
77
+ const IN_THROWN_MESSAGE = /\bthrow\s+new\s+[A-Za-z_$][\w$.]*\s*\(\s*`(?:[^`\\]|\\.)*\$\{[^`}]*$/u;
66
78
 
67
79
  /** Every file of the app outside dependencies, builds, test output and dot-directories, relative and POSIX. */
68
80
  async function listFiles(root, relative = "") {
@@ -91,29 +103,36 @@ const isTestFile = (file) => SOURCE_FILE.test(file) &&
91
103
 
92
104
  const asNumber = (literal) => Number(String(literal).replace(/_/gu, ""));
93
105
 
94
- /** The fixed wait a line makes, as written, or "" (a zero-delay timer yields a turn, it waits for no time). */
106
+ /** The fixed wait a line makes, as written, and where it starts; null for none (a zero-delay timer waits for no time). */
95
107
  function fixedWait(line) {
96
108
  const waitForTimeout = line.match(WAIT_FOR_TIMEOUT);
97
- if (waitForTimeout) return waitForTimeout[0];
109
+ if (waitForTimeout) return { wait: waitForTimeout[0], column: waitForTimeout.index };
98
110
  for (const pattern of [PROMISE_SLEEP, AWAITED_SLEEP]) {
99
111
  const match = line.match(pattern);
100
- if (match && asNumber(match[match.length - 1]) > 0) return match[0].trim();
112
+ if (match && asNumber(match[match.length - 1]) > 0) return { wait: match[0].trim(), column: match.index + match[0].search(/\S/u) };
101
113
  }
102
- return "";
114
+ return null;
103
115
  }
104
116
 
105
- function checkFixedWaits(file, lines, report) {
117
+ function checkFixedWaits(file, text, report) {
118
+ const lines = text.split("\n");
119
+ let tokens;
120
+ let offset = 0;
106
121
  lines.forEach((line, index) => {
122
+ const lineStart = offset;
123
+ offset += line.length + 1;
107
124
  if (COMMENT_LINE.test(line)) return;
108
- const wait = fixedWait(line);
109
- if (!wait) return;
125
+ const found = fixedWait(line);
126
+ if (!found) return;
127
+ tokens = tokens === undefined ? scanSource(text) : tokens;
128
+ if (excusedWait(text, lineStart + found.column, tokens)) return;
110
129
  const marker = index > 0 ? lines[index - 1].match(MARKER) : null;
111
130
  if (!marker) {
112
- report({ file, line: index + 1, rule: "test/fixed-sleep", message: `waits a fixed time (${wait}); ${SLEEP_FIX}` });
131
+ report({ file, line: index + 1, rule: "test/fixed-sleep", message: `waits a fixed time (${found.wait}); ${SLEEP_FIX}` });
113
132
  } else if (!MARKER_REASON.test(marker[1])) {
114
133
  report({ file, line: index, rule: "test/fixed-sleep",
115
- message: "has a jskit-test: fixed-wait marker without a reason; write what the window proves after it " +
116
- "(// jskit-test: fixed-wait - <what the window proves>), or wait for the condition instead." });
134
+ message: "has a jskit-test: fixed-wait marker without a reason; write after it what the window proves, or the " +
135
+ `latency the stand-in simulates (${MARKER_FORM}), or wait for the condition instead.` });
117
136
  }
118
137
  });
119
138
  }
@@ -122,7 +141,7 @@ function checkDatabaseNames(file, lines, { configFile }, report) {
122
141
  lines.forEach((line, index) => {
123
142
  if (COMMENT_LINE.test(line)) return;
124
143
  const match = line.match(LITERAL_FALLBACK) || line.match(LITERAL_ASSIGNMENT) || (configFile && line.match(LITERAL_PROPERTY));
125
- if (!match) return;
144
+ if (!match || IN_THROWN_MESSAGE.test(line.slice(0, match.index))) return;
126
145
  report({ file, line: index + 1, rule: "test/fixed-database-name",
127
146
  message: `names the test database itself (${match[0].replace(/^[\s{,]+/u, "")}); drop the name and read the variable ` +
128
147
  `as the run gives it: ${DATABASE_FIX}` });
@@ -151,17 +170,30 @@ function jskitTestFiles(script) {
151
170
  return files;
152
171
  }
153
172
 
154
- function checkScripts(file, contents, report) {
173
+ /**
174
+ * Whether the files a script names are the ones `jskit test` runs given none: node's default pattern. A glob or folder
175
+ * that matches no file leaves `jskit test` with the default's files too.
176
+ */
177
+ function selectsDefaultFiles(directory, files, defaults) {
178
+ const named = findTestFiles(files, directory);
179
+ const chosen = named.length > 0 ? named : defaults();
180
+ return chosen.length === defaults().length && chosen.every((file, index) => file === defaults()[index]);
181
+ }
182
+
183
+ function checkScripts(root, file, contents, report) {
155
184
  let manifest;
156
185
  try {
157
186
  manifest = JSON.parse(contents);
158
187
  } catch {
159
188
  return;
160
189
  }
190
+ const directory = path.join(root, path.posix.dirname(file));
191
+ let defaultFiles;
192
+ const defaults = () => (defaultFiles ??= findTestFiles([DEFAULT_PATTERN], directory));
161
193
  for (const [name, script] of Object.entries(manifest?.scripts || {})) {
162
194
  const line = lineOf(contents, `"${name}"`, '"scripts"');
163
195
  const files = jskitTestFiles(script);
164
- if (files.length > 0) {
196
+ if (files.length > 0 && selectsDefaultFiles(directory, files, defaults)) {
165
197
  const run = name === "test" ? "npm test" : `npm run ${name}`;
166
198
  report({ file, line, rule: "test/script-files",
167
199
  message: `${file}'s ${name} script names ${files.join(" ")}: drop ${files.length > 1 ? "them" : "it"}. \`jskit test\` finds ` +
@@ -227,16 +259,16 @@ async function checkTestSources({ projectRoot }) {
227
259
  if (WORKFLOW.test(file)) {
228
260
  checkWorkflow(file, (await read()).split("\n"), report);
229
261
  } else if (name === "package.json") {
230
- checkScripts(file, await read(), report);
262
+ checkScripts(root, file, await read(), report);
231
263
  } else if (VITE_CONFIG.test(file)) {
232
264
  checkViteConfig(file, await read(), report);
233
265
  } else if (RUNNER_CONFIG.test(name)) {
234
266
  checkDatabaseNames(file, (await read()).split("\n"), { configFile: true }, report);
235
267
  } else if (isTestFile(file)) {
236
268
  testFiles += 1;
237
- const lines = (await read()).split("\n");
238
- checkFixedWaits(file, lines, report);
239
- checkDatabaseNames(file, lines, { configFile: false }, report);
269
+ const text = await read();
270
+ checkFixedWaits(file, text, report);
271
+ checkDatabaseNames(file, text.split("\n"), { configFile: false }, report);
240
272
  }
241
273
  }
242
274
  findings.sort((left, right) => left.file.localeCompare(right.file) || left.line - right.line);