@specdest/devkit 0.2.2 → 0.3.1
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/README.md +17 -18
- package/package.json +4 -4
- package/src/canonical-project-operations.js +164 -0
- package/src/canonical-project.js +78 -0
- package/src/canonical-source.js +114 -0
- package/src/cli.js +2 -2
- package/src/git-catalog.js +105 -0
- package/src/index.js +6 -2
- package/src/project-operations.js +65 -6
- package/src/remote-installer.js +478 -0
- package/src/sync-core.js +20 -7
- package/catalog/README.md +0 -11
- package/catalog/modules/backend-convex/manifest.json +0 -14
- package/catalog/modules/backend-convex-expo/manifest.json +0 -11
- package/catalog/modules/backend-supabase/manifest.json +0 -15
- package/catalog/modules/backend-supabase-expo/manifest.json +0 -11
- package/catalog/modules/checker-runtime/config.ts +0 -25
- package/catalog/modules/checker-runtime/fs.ts +0 -48
- package/catalog/modules/checker-runtime/manifest.json +0 -29
- package/catalog/modules/checker-runtime/runtime.ts +0 -79
- package/catalog/modules/devflow/.agents/skills/devflow/SKILL.md +0 -33
- package/catalog/modules/devflow/.devflow.json +0 -10
- package/catalog/modules/devflow/manifest.json +0 -35
- package/catalog/modules/e2e-playwright/.agents/skills/e2e-playwright/SKILL.md +0 -85
- package/catalog/modules/e2e-playwright/.agents/skills/e2e-playwright/scripts/activeScenario.mjs +0 -130
- package/catalog/modules/e2e-playwright/.agents/skills/e2e-playwright/scripts/checkLocalEnvironment.mjs +0 -7
- package/catalog/modules/e2e-playwright/.agents/skills/e2e-playwright/scripts/completeActiveScenario.mjs +0 -36
- package/catalog/modules/e2e-playwright/.agents/skills/e2e-playwright/scripts/createActiveScenario.mjs +0 -143
- package/catalog/modules/e2e-playwright/.agents/skills/e2e-playwright/scripts/localEnvironment.mjs +0 -43
- package/catalog/modules/e2e-playwright/.agents/skills/e2e-playwright/scripts/prompt.mjs +0 -25
- package/catalog/modules/e2e-playwright/.agents/skills/e2e-playwright/scripts/runActiveScenario.mjs +0 -66
- package/catalog/modules/e2e-playwright/.agents/skills/e2e-playwright/scripts/runAuthoringScenario.mjs +0 -146
- package/catalog/modules/e2e-playwright/.agents/skills/e2e-playwright/scripts/seed.mjs +0 -56
- package/catalog/modules/e2e-playwright/.agents/skills/e2e-playwright/scripts/seedActiveScenario.mjs +0 -6
- package/catalog/modules/e2e-playwright/docs/e2e-playwright/README.md +0 -103
- package/catalog/modules/e2e-playwright/manifest.json +0 -206
- package/catalog/modules/e2e-playwright/playwright.e2e.config.ts +0 -39
- package/catalog/modules/e2e-playwright/tests/e2e/support/e2ePlaywrightFlow.ts +0 -107
- package/catalog/modules/e2e-playwright/tests/e2e/support/fixtures.ts +0 -27
- package/catalog/modules/local-log/AGENTS.local-log.md +0 -13
- package/catalog/modules/local-log/docs/features/local-logging/README.md +0 -70
- package/catalog/modules/local-log/manifest.json +0 -39
- package/catalog/modules/local-log/tmp/logs/.gitignore +0 -2
- package/catalog/modules/local-log/tools/local-log/README.md +0 -47
- package/catalog/modules/local-log/tools/local-log/local-log.mjs +0 -241
- package/catalog/modules/stack-common-vite/manifest.json +0 -16
- package/catalog/modules/stack-expo-convex/manifest.json +0 -31
- package/catalog/modules/stack-expo-supabase/manifest.json +0 -44
- package/catalog/modules/stack-vite-convex/manifest.json +0 -32
- package/catalog/modules/stack-vite-supabase/manifest.json +0 -45
- package/catalog/rules/abac-permissions-convex/SKILL.md +0 -17
- package/catalog/rules/abac-permissions-convex/check.ts +0 -87
- package/catalog/rules/abac-permissions-convex/manifest.json +0 -33
- package/catalog/rules/abac-permissions-supabase/SKILL.md +0 -17
- package/catalog/rules/abac-permissions-supabase/check.ts +0 -87
- package/catalog/rules/abac-permissions-supabase/manifest.json +0 -33
- package/catalog/rules/convex-multi-presentation/SKILL.md +0 -47
- package/catalog/rules/convex-multi-presentation/check.ts +0 -205
- package/catalog/rules/convex-multi-presentation/manifest.json +0 -47
- package/catalog/rules/convex-multi-presentation/policy.ts +0 -261
- package/catalog/rules/design-rules/SKILL.md +0 -12
- package/catalog/rules/design-rules/check.ts +0 -84
- package/catalog/rules/design-rules/config.json +0 -5
- package/catalog/rules/design-rules/manifest.json +0 -38
- package/catalog/rules/e2e-test-rules/SKILL.md +0 -46
- package/catalog/rules/e2e-test-rules/check.ts +0 -145
- package/catalog/rules/e2e-test-rules/config.json +0 -32
- package/catalog/rules/e2e-test-rules/manifest.json +0 -38
- package/catalog/rules/error-handling-rules/SKILL.md +0 -21
- package/catalog/rules/error-handling-rules/check.ts +0 -73
- package/catalog/rules/error-handling-rules/manifest.json +0 -33
- package/catalog/rules/layers-and-contracts/SKILL.md +0 -36
- package/catalog/rules/layers-and-contracts/check.ts +0 -266
- package/catalog/rules/layers-and-contracts/manifest.json +0 -33
- package/catalog/rules/layers-and-contracts-convex/SKILL.md +0 -49
- package/catalog/rules/layers-and-contracts-convex/check.ts +0 -289
- package/catalog/rules/layers-and-contracts-convex/manifest.json +0 -38
- package/catalog/rules/layers-and-contracts-convex/policy.ts +0 -68
- package/catalog/rules/layers-and-contracts-supabase/SKILL.md +0 -52
- package/catalog/rules/layers-and-contracts-supabase/check.ts +0 -371
- package/catalog/rules/layers-and-contracts-supabase/manifest.json +0 -38
- package/catalog/rules/layers-and-contracts-supabase/policy.ts +0 -68
- package/catalog/rules/module-size-rules/SKILL.md +0 -5
- package/catalog/rules/module-size-rules/check.ts +0 -144
- package/catalog/rules/module-size-rules/config.json +0 -6
- package/catalog/rules/module-size-rules/manifest.json +0 -38
- package/catalog/rules/module-size-rules-convex/SKILL.md +0 -5
- package/catalog/rules/module-size-rules-convex/check.ts +0 -146
- package/catalog/rules/module-size-rules-convex/config.json +0 -6
- package/catalog/rules/module-size-rules-convex/manifest.json +0 -38
- package/catalog/rules/module-size-rules-supabase/SKILL.md +0 -5
- package/catalog/rules/module-size-rules-supabase/check.ts +0 -146
- package/catalog/rules/module-size-rules-supabase/config.json +0 -12
- package/catalog/rules/module-size-rules-supabase/manifest.json +0 -38
- package/catalog/rules/mutation-command-rules/SKILL.md +0 -15
- package/catalog/rules/mutation-command-rules/check.ts +0 -30
- package/catalog/rules/mutation-command-rules/config.json +0 -19
- package/catalog/rules/mutation-command-rules/manifest.json +0 -38
- package/catalog/rules/nearby-contracts/SKILL.md +0 -18
- package/catalog/rules/nearby-contracts/check.ts +0 -138
- package/catalog/rules/nearby-contracts/config.json +0 -10
- package/catalog/rules/nearby-contracts/manifest.json +0 -38
- package/catalog/rules/no-raw-click-buttons/SKILL.md +0 -5
- package/catalog/rules/no-raw-click-buttons/check.ts +0 -37
- package/catalog/rules/no-raw-click-buttons/manifest.json +0 -33
- package/catalog/rules/public-api-export-barrels/SKILL.md +0 -45
- package/catalog/rules/public-api-export-barrels/check.ts +0 -73
- package/catalog/rules/public-api-export-barrels/config.json +0 -4
- package/catalog/rules/public-api-export-barrels/manifest.json +0 -38
- package/catalog/rules/route-tree-fresh/SKILL.md +0 -16
- package/catalog/rules/route-tree-fresh/check.ts +0 -66
- package/catalog/rules/route-tree-fresh/manifest.json +0 -33
- package/catalog/rules/strict-typescript/SKILL.md +0 -3
- package/catalog/rules/strict-typescript/check.ts +0 -119
- package/catalog/rules/strict-typescript/manifest.json +0 -33
- package/catalog/rules/supabase-contracts/SKILL.md +0 -3
- package/catalog/rules/supabase-contracts/check.ts +0 -172
- package/catalog/rules/supabase-contracts/manifest.json +0 -33
- package/catalog/rules/supabase-declarative-schema/SKILL.md +0 -30
- package/catalog/rules/supabase-declarative-schema/check.ts +0 -262
- package/catalog/rules/supabase-declarative-schema/config.json +0 -8
- package/catalog/rules/supabase-declarative-schema/manifest.json +0 -38
- package/catalog/rules/tanstack-form-rules/SKILL.md +0 -11
- package/catalog/rules/tanstack-form-rules/check.ts +0 -58
- package/catalog/rules/tanstack-form-rules/manifest.json +0 -33
- package/catalog/rules/unit-test-rules/SKILL.md +0 -55
- package/catalog/rules/unit-test-rules/check.ts +0 -132
- package/catalog/rules/unit-test-rules/config.json +0 -22
- package/catalog/rules/unit-test-rules/manifest.json +0 -38
- package/catalog/rules/unit-test-rules-convex/SKILL.md +0 -41
- package/catalog/rules/unit-test-rules-convex/check.ts +0 -418
- package/catalog/rules/unit-test-rules-convex/manifest.json +0 -33
- package/catalog/rules/unit-test-rules-supabase/SKILL.md +0 -40
- package/catalog/rules/unit-test-rules-supabase/check.ts +0 -492
- package/catalog/rules/unit-test-rules-supabase/manifest.json +0 -33
- package/catalog/rules/workstation-controller-rules/SKILL.md +0 -22
- package/catalog/rules/workstation-controller-rules/check.ts +0 -108
- package/catalog/rules/workstation-controller-rules/manifest.json +0 -33
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "e2e-playwright",
|
|
3
|
-
"kind": "module",
|
|
4
|
-
"version": "1.0.1",
|
|
5
|
-
"artifacts": [
|
|
6
|
-
{
|
|
7
|
-
"kind": "managed-file",
|
|
8
|
-
"path": ".agents/skills/e2e-playwright/SKILL.md",
|
|
9
|
-
"source": ".agents/skills/e2e-playwright/SKILL.md"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"kind": "managed-file",
|
|
13
|
-
"path": ".agents/skills/e2e-playwright/scripts/activeScenario.mjs",
|
|
14
|
-
"source": ".agents/skills/e2e-playwright/scripts/activeScenario.mjs"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"kind": "managed-file",
|
|
18
|
-
"path": ".agents/skills/e2e-playwright/scripts/checkLocalEnvironment.mjs",
|
|
19
|
-
"source": ".agents/skills/e2e-playwright/scripts/checkLocalEnvironment.mjs"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"kind": "managed-file",
|
|
23
|
-
"path": ".agents/skills/e2e-playwright/scripts/completeActiveScenario.mjs",
|
|
24
|
-
"source": ".agents/skills/e2e-playwright/scripts/completeActiveScenario.mjs"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"kind": "managed-file",
|
|
28
|
-
"path": ".agents/skills/e2e-playwright/scripts/createActiveScenario.mjs",
|
|
29
|
-
"source": ".agents/skills/e2e-playwright/scripts/createActiveScenario.mjs"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"kind": "managed-file",
|
|
33
|
-
"path": ".agents/skills/e2e-playwright/scripts/localEnvironment.mjs",
|
|
34
|
-
"source": ".agents/skills/e2e-playwright/scripts/localEnvironment.mjs"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"kind": "managed-file",
|
|
38
|
-
"path": ".agents/skills/e2e-playwright/scripts/prompt.mjs",
|
|
39
|
-
"source": ".agents/skills/e2e-playwright/scripts/prompt.mjs"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"kind": "managed-file",
|
|
43
|
-
"path": ".agents/skills/e2e-playwright/scripts/runActiveScenario.mjs",
|
|
44
|
-
"source": ".agents/skills/e2e-playwright/scripts/runActiveScenario.mjs"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"kind": "managed-file",
|
|
48
|
-
"path": ".agents/skills/e2e-playwright/scripts/runAuthoringScenario.mjs",
|
|
49
|
-
"source": ".agents/skills/e2e-playwright/scripts/runAuthoringScenario.mjs"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"kind": "managed-file",
|
|
53
|
-
"path": ".agents/skills/e2e-playwright/scripts/seed.mjs",
|
|
54
|
-
"source": ".agents/skills/e2e-playwright/scripts/seed.mjs"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"kind": "managed-file",
|
|
58
|
-
"path": ".agents/skills/e2e-playwright/scripts/seedActiveScenario.mjs",
|
|
59
|
-
"source": ".agents/skills/e2e-playwright/scripts/seedActiveScenario.mjs"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"kind": "managed-file",
|
|
63
|
-
"path": "docs/e2e-playwright/README.md",
|
|
64
|
-
"source": "docs/e2e-playwright/README.md"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"kind": "scaffold",
|
|
68
|
-
"path": "playwright.e2e.config.ts",
|
|
69
|
-
"source": "playwright.e2e.config.ts"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"kind": "managed-file",
|
|
73
|
-
"path": "tests/e2e/support/e2ePlaywrightFlow.ts",
|
|
74
|
-
"source": "tests/e2e/support/e2ePlaywrightFlow.ts"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"kind": "managed-file",
|
|
78
|
-
"path": "tests/e2e/support/fixtures.ts",
|
|
79
|
-
"source": "tests/e2e/support/fixtures.ts"
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"kind": "shared-json-field",
|
|
83
|
-
"path": "package.json",
|
|
84
|
-
"fieldPath": [
|
|
85
|
-
"scripts",
|
|
86
|
-
"start:local"
|
|
87
|
-
],
|
|
88
|
-
"value": "vite --host 127.0.0.1 --port 5173 --strictPort"
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"kind": "shared-json-field",
|
|
92
|
-
"path": "package.json",
|
|
93
|
-
"fieldPath": [
|
|
94
|
-
"scripts",
|
|
95
|
-
"test:e2e"
|
|
96
|
-
],
|
|
97
|
-
"value": "playwright test --config playwright.e2e.config.ts"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"kind": "shared-json-field",
|
|
101
|
-
"path": "package.json",
|
|
102
|
-
"fieldPath": [
|
|
103
|
-
"scripts",
|
|
104
|
-
"test:e2e:ui"
|
|
105
|
-
],
|
|
106
|
-
"value": "playwright test --config playwright.e2e.config.ts --ui"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"kind": "shared-json-field",
|
|
110
|
-
"path": "package.json",
|
|
111
|
-
"fieldPath": [
|
|
112
|
-
"scripts",
|
|
113
|
-
"test:e2e:report"
|
|
114
|
-
],
|
|
115
|
-
"value": "playwright show-report playwright-report/e2e"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"kind": "shared-json-field",
|
|
119
|
-
"path": "package.json",
|
|
120
|
-
"fieldPath": [
|
|
121
|
-
"scripts",
|
|
122
|
-
"e2e:create"
|
|
123
|
-
],
|
|
124
|
-
"value": "node .agents/skills/e2e-playwright/scripts/createActiveScenario.mjs"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"kind": "shared-json-field",
|
|
128
|
-
"path": "package.json",
|
|
129
|
-
"fieldPath": [
|
|
130
|
-
"scripts",
|
|
131
|
-
"e2e:check-local"
|
|
132
|
-
],
|
|
133
|
-
"value": "node .agents/skills/e2e-playwright/scripts/checkLocalEnvironment.mjs"
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
"kind": "shared-json-field",
|
|
137
|
-
"path": "package.json",
|
|
138
|
-
"fieldPath": [
|
|
139
|
-
"scripts",
|
|
140
|
-
"e2e:seed"
|
|
141
|
-
],
|
|
142
|
-
"value": "node .agents/skills/e2e-playwright/scripts/seedActiveScenario.mjs"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"kind": "shared-json-field",
|
|
146
|
-
"path": "package.json",
|
|
147
|
-
"fieldPath": [
|
|
148
|
-
"scripts",
|
|
149
|
-
"e2e:run"
|
|
150
|
-
],
|
|
151
|
-
"value": "node .agents/skills/e2e-playwright/scripts/runActiveScenario.mjs"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"kind": "shared-json-field",
|
|
155
|
-
"path": "package.json",
|
|
156
|
-
"fieldPath": [
|
|
157
|
-
"scripts",
|
|
158
|
-
"e2e:author"
|
|
159
|
-
],
|
|
160
|
-
"value": "node .agents/skills/e2e-playwright/scripts/runAuthoringScenario.mjs"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"kind": "shared-json-field",
|
|
164
|
-
"path": "package.json",
|
|
165
|
-
"fieldPath": [
|
|
166
|
-
"scripts",
|
|
167
|
-
"e2e:complete"
|
|
168
|
-
],
|
|
169
|
-
"value": "node .agents/skills/e2e-playwright/scripts/completeActiveScenario.mjs"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"kind": "shared-json-field",
|
|
173
|
-
"path": "package.json",
|
|
174
|
-
"fieldPath": [
|
|
175
|
-
"devDependencies",
|
|
176
|
-
"@playwright/test"
|
|
177
|
-
],
|
|
178
|
-
"value": "^1.57.0"
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"kind": "shared-json-field",
|
|
182
|
-
"path": "package.json",
|
|
183
|
-
"fieldPath": [
|
|
184
|
-
"devDependencies",
|
|
185
|
-
"@types/node"
|
|
186
|
-
],
|
|
187
|
-
"value": "^25.9.4"
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
"kind": "shared-json-field",
|
|
191
|
-
"path": "package.json",
|
|
192
|
-
"fieldPath": [
|
|
193
|
-
"devDependencies",
|
|
194
|
-
"playwright"
|
|
195
|
-
],
|
|
196
|
-
"value": "^1.57.0"
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
"kind": "shared-markdown-section",
|
|
200
|
-
"path": "AGENTS.md",
|
|
201
|
-
"heading": "## E2E Playwright authoring",
|
|
202
|
-
"body": "Use `.agents/skills/e2e-playwright/SKILL.md` for local Playwright E2E scenario authoring. Keep app-specific selectors, routes, auth, seed data, and business flows in project scenarios. Never target production URLs."
|
|
203
|
-
}
|
|
204
|
-
],
|
|
205
|
-
"obsolete": []
|
|
206
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { defineConfig, devices } from "@playwright/test";
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
|
-
|
|
4
|
-
const baseURL = process.env["E2E_BASE_URL"] ?? "http://127.0.0.1:5173";
|
|
5
|
-
const hasPackageScripts = existsSync("package-scripts.yml") || existsSync("package-scripts.yaml");
|
|
6
|
-
const webServerCommand =
|
|
7
|
-
process.env["E2E_WEB_SERVER_COMMAND"] ??
|
|
8
|
-
(hasPackageScripts ? "nps start.local" : "npm run start:local");
|
|
9
|
-
const isActiveScenarioRun = Boolean(process.env["E2E_PLAYWRIGHT_ACTIVE_SCENARIO_ID"]);
|
|
10
|
-
|
|
11
|
-
export default defineConfig({
|
|
12
|
-
testDir: "./tests/e2e",
|
|
13
|
-
testIgnore: isActiveScenarioRun ? [] : ["**/_active/**"],
|
|
14
|
-
timeout: 60_000,
|
|
15
|
-
expect: { timeout: 10_000 },
|
|
16
|
-
fullyParallel: false,
|
|
17
|
-
workers: 1,
|
|
18
|
-
outputDir: "test-results/playwright-artifacts",
|
|
19
|
-
reporter: [
|
|
20
|
-
["list"],
|
|
21
|
-
["html", { outputFolder: "playwright-report/e2e", open: "never" }],
|
|
22
|
-
["json", { outputFile: "test-results/e2e-report.json" }],
|
|
23
|
-
],
|
|
24
|
-
use: {
|
|
25
|
-
baseURL,
|
|
26
|
-
trace: "retain-on-failure",
|
|
27
|
-
screenshot: "only-on-failure",
|
|
28
|
-
video: "retain-on-failure",
|
|
29
|
-
actionTimeout: 10_000,
|
|
30
|
-
navigationTimeout: 30_000,
|
|
31
|
-
},
|
|
32
|
-
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"], channel: undefined } }],
|
|
33
|
-
webServer: {
|
|
34
|
-
command: webServerCommand,
|
|
35
|
-
url: baseURL,
|
|
36
|
-
reuseExistingServer: !process.env["CI"],
|
|
37
|
-
timeout: 120_000,
|
|
38
|
-
},
|
|
39
|
-
});
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { BrowserContext, Locator, Page, TestInfo } from "@playwright/test";
|
|
2
|
-
|
|
3
|
-
export type E2EPlaywrightFlowContext = {
|
|
4
|
-
readonly context: BrowserContext;
|
|
5
|
-
readonly page: Page;
|
|
6
|
-
readonly testInfo?: TestInfo;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export type E2EPlaywrightFlowStep = {
|
|
10
|
-
readonly name: string;
|
|
11
|
-
readonly run: (context: E2EPlaywrightFlowContext) => Promise<void>;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type E2EPlaywrightFlow = readonly E2EPlaywrightFlowStep[];
|
|
15
|
-
|
|
16
|
-
export type E2EPlaywrightFlowRunOptions = {
|
|
17
|
-
readonly until?: string;
|
|
18
|
-
readonly pauseAfter?: string;
|
|
19
|
-
readonly trace?: boolean;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export function step(
|
|
23
|
-
name: string,
|
|
24
|
-
run: (context: E2EPlaywrightFlowContext) => Promise<void>,
|
|
25
|
-
): E2EPlaywrightFlowStep {
|
|
26
|
-
return { name, run };
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function e2ePlaywrightFlowOptionsFromEnv(
|
|
30
|
-
env: Record<string, string | undefined> = process.env,
|
|
31
|
-
): E2EPlaywrightFlowRunOptions {
|
|
32
|
-
const options: E2EPlaywrightFlowRunOptions = {
|
|
33
|
-
trace: env["E2E_PLAYWRIGHT_TRACE_STEPS"] !== "0",
|
|
34
|
-
};
|
|
35
|
-
const until = nonEmpty(env["E2E_PLAYWRIGHT_UNTIL_STEP"]);
|
|
36
|
-
const pauseAfter = nonEmpty(env["E2E_PLAYWRIGHT_PAUSE_AFTER_STEP"]);
|
|
37
|
-
if (until) return { ...options, until };
|
|
38
|
-
if (pauseAfter) return { ...options, pauseAfter };
|
|
39
|
-
return options;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export async function runE2EPlaywrightFlow(
|
|
43
|
-
flow: E2EPlaywrightFlow,
|
|
44
|
-
context: E2EPlaywrightFlowContext,
|
|
45
|
-
options: E2EPlaywrightFlowRunOptions = {},
|
|
46
|
-
): Promise<void> {
|
|
47
|
-
assertKnownStepName(flow, options.until, "until");
|
|
48
|
-
assertKnownStepName(flow, options.pauseAfter, "pause-after");
|
|
49
|
-
|
|
50
|
-
for (const [index, flowStep] of flow.entries()) {
|
|
51
|
-
const stepNumber = index + 1;
|
|
52
|
-
const prefix = `[e2e-playwright] step ${stepNumber}/${flow.length}: ${flowStep.name}`;
|
|
53
|
-
|
|
54
|
-
if (options.trace ?? true) console.log(`${prefix} start`);
|
|
55
|
-
|
|
56
|
-
try {
|
|
57
|
-
await flowStep.run(context);
|
|
58
|
-
} catch (error) {
|
|
59
|
-
throw new Error(
|
|
60
|
-
[`${prefix} failed`, error instanceof Error ? error.message : String(error)].join("\n"),
|
|
61
|
-
{ cause: error },
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (options.trace ?? true) console.log(`${prefix} done`);
|
|
66
|
-
|
|
67
|
-
if (options.pauseAfter === flowStep.name) {
|
|
68
|
-
console.log(`${prefix} pausing after step`);
|
|
69
|
-
await context.page.pause();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (options.until === flowStep.name) {
|
|
73
|
-
console.log(`${prefix} stopping because --until matched`);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export async function readNumberFromText(locator: Locator): Promise<number> {
|
|
80
|
-
const text = await locator.textContent();
|
|
81
|
-
const normalized = (text ?? "").replace(/[^0-9.-]/g, "");
|
|
82
|
-
const value = Number(normalized);
|
|
83
|
-
if (!Number.isFinite(value)) throw new Error(`Could not read number from text: ${text ?? ""}`);
|
|
84
|
-
return value;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function assertKnownStepName(
|
|
88
|
-
flow: E2EPlaywrightFlow,
|
|
89
|
-
stepName: string | undefined,
|
|
90
|
-
label: string,
|
|
91
|
-
): void {
|
|
92
|
-
if (!stepName) return;
|
|
93
|
-
if (flow.some((flowStep) => flowStep.name === stepName)) return;
|
|
94
|
-
|
|
95
|
-
throw new Error(
|
|
96
|
-
[
|
|
97
|
-
`Unknown E2E Playwright ${label} step: ${stepName}`,
|
|
98
|
-
"Available steps:",
|
|
99
|
-
...flow.map((flowStep) => `- ${flowStep.name}`),
|
|
100
|
-
].join("\n"),
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function nonEmpty(value: string | undefined): string | undefined {
|
|
105
|
-
const trimmed = value?.trim();
|
|
106
|
-
return trimmed ? trimmed : undefined;
|
|
107
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { expect, test as base } from "@playwright/test";
|
|
2
|
-
|
|
3
|
-
export const test = base.extend<{ readonly collectBrowserDiagnostics: void }>({
|
|
4
|
-
collectBrowserDiagnostics: [
|
|
5
|
-
async ({ page }, use, testInfo) => {
|
|
6
|
-
const messages: string[] = [];
|
|
7
|
-
page.on("console", (message) => {
|
|
8
|
-
messages.push(`[console:${message.type()}] ${message.text()}`);
|
|
9
|
-
});
|
|
10
|
-
page.on("pageerror", (error) => {
|
|
11
|
-
messages.push(`[pageerror] ${error.message}`);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
await use();
|
|
15
|
-
|
|
16
|
-
if (testInfo.status !== testInfo.expectedStatus && messages.length > 0) {
|
|
17
|
-
await testInfo.attach("browser-diagnostics.txt", {
|
|
18
|
-
body: messages.join("\n"),
|
|
19
|
-
contentType: "text/plain",
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
{ auto: true },
|
|
24
|
-
],
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export { expect };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Local log debugging instructions
|
|
2
|
-
|
|
3
|
-
When the user reports an error, inspect `tmp/logs/activity-*.jsonl` before guessing.
|
|
4
|
-
|
|
5
|
-
Use:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
node tools/local-log/local-log.mjs tail 200
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Correlate `.start`, `.success`, and `.error` events by `requestId`. Check `source`, `event`, `durationMs`, `details`, `result`, and `error`. Search the codebase for the event name and failing operation. Sensitive fields should appear as `[REDACTED]`.
|
|
12
|
-
|
|
13
|
-
Do not delete logs until the issue is understood. Do not remove logging as part of a fix. Add structured context when the existing records are insufficient. See `docs/features/local-logging/README.md` and `tools/local-log/README.md`.
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# Local diagnostic logging
|
|
2
|
-
|
|
3
|
-
This feature provides a dependency-free Node.js logger and maintenance CLI. It writes local newline-delimited JSON files that developers and coding agents can inspect when diagnosing errors.
|
|
4
|
-
|
|
5
|
-
## Installed components
|
|
6
|
-
|
|
7
|
-
```text
|
|
8
|
-
tools/local-log/local-log.mjs
|
|
9
|
-
tools/local-log/README.md
|
|
10
|
-
tmp/logs/.gitignore
|
|
11
|
-
AGENTS.local-log.md
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Log location
|
|
15
|
-
|
|
16
|
-
```text
|
|
17
|
-
tmp/logs/activity-YYYY-MM-DD.jsonl
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Set `LOCAL_LOG_ROOT` to use a different absolute directory. Set `LOCAL_LOG_SOURCE` to identify the process writing through the CLI.
|
|
21
|
-
|
|
22
|
-
## Application API
|
|
23
|
-
|
|
24
|
-
```js
|
|
25
|
-
import { createLocalLogger, traceOperation } from "./tools/local-log/local-log.mjs";
|
|
26
|
-
|
|
27
|
-
const log = createLocalLogger({ source: "worker" });
|
|
28
|
-
|
|
29
|
-
await log.write({
|
|
30
|
-
event: "worker.started",
|
|
31
|
-
requestId: crypto.randomUUID(),
|
|
32
|
-
details: { queue: "default" },
|
|
33
|
-
});
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Use `traceOperation()` to record start, success, error, duration, and a shared request ID around an asynchronous operation.
|
|
37
|
-
|
|
38
|
-
## Commands
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
node tools/local-log/local-log.mjs write user.click '{"control":"save"}'
|
|
42
|
-
node tools/local-log/local-log.mjs tail 200
|
|
43
|
-
node tools/local-log/local-log.mjs clear-old 7
|
|
44
|
-
node tools/local-log/local-log.mjs clear-all
|
|
45
|
-
node tools/local-log/local-log.mjs path
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Data behavior
|
|
49
|
-
|
|
50
|
-
- sensitive key names are written as `[REDACTED]`;
|
|
51
|
-
- large strings, arrays, objects, and nesting are bounded;
|
|
52
|
-
- circular references are converted to `[Circular]`;
|
|
53
|
-
- log files are local and ignored by Git;
|
|
54
|
-
- the logger does not transmit data.
|
|
55
|
-
|
|
56
|
-
## Browser and process boundaries
|
|
57
|
-
|
|
58
|
-
Browser code cannot write repository files directly. Forward browser activity to a trusted local process, then call this logger there. Use the same `requestId` on both sides of the boundary.
|
|
59
|
-
|
|
60
|
-
## Debugging workflow
|
|
61
|
-
|
|
62
|
-
1. Read `AGENTS.local-log.md`.
|
|
63
|
-
2. Run `node tools/local-log/local-log.mjs tail 200`.
|
|
64
|
-
3. Find error events or records where `level` is `error`.
|
|
65
|
-
4. Correlate related operations using `requestId`.
|
|
66
|
-
5. Search the codebase for the event name.
|
|
67
|
-
6. Reproduce and fix the underlying operation.
|
|
68
|
-
7. Preserve or improve structured logging.
|
|
69
|
-
|
|
70
|
-
Additional API examples are in `tools/local-log/README.md`.
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "local-log",
|
|
3
|
-
"kind": "module",
|
|
4
|
-
"version": "1.1.0",
|
|
5
|
-
"artifacts": [
|
|
6
|
-
{
|
|
7
|
-
"kind": "managed-file",
|
|
8
|
-
"path": "AGENTS.local-log.md",
|
|
9
|
-
"source": "AGENTS.local-log.md"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"kind": "managed-file",
|
|
13
|
-
"path": "docs/features/local-logging/README.md",
|
|
14
|
-
"source": "docs/features/local-logging/README.md"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"kind": "managed-file",
|
|
18
|
-
"path": "tmp/logs/.gitignore",
|
|
19
|
-
"source": "tmp/logs/.gitignore"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"kind": "managed-file",
|
|
23
|
-
"path": "tools/local-log/README.md",
|
|
24
|
-
"source": "tools/local-log/README.md"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"kind": "managed-file",
|
|
28
|
-
"path": "tools/local-log/local-log.mjs",
|
|
29
|
-
"source": "tools/local-log/local-log.mjs"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"kind": "shared-markdown-section",
|
|
33
|
-
"path": "AGENTS.md",
|
|
34
|
-
"heading": "## Local diagnostic logging",
|
|
35
|
-
"body": "When diagnosing an error, inspect project-local logs before guessing. Run `node tools/local-log/local-log.mjs tail 200`, correlate records by `requestId`, keep sensitive fields redacted, and see `AGENTS.local-log.md` plus `docs/features/local-logging/README.md`."
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
"obsolete": []
|
|
39
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# Local diagnostic logging
|
|
2
|
-
|
|
3
|
-
This directory contains a dependency-free Node.js logger that writes newline-delimited JSON into `tmp/logs/`.
|
|
4
|
-
|
|
5
|
-
## Application API
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
import { createLocalLogger, traceOperation } from "./tools/local-log/local-log.mjs";
|
|
9
|
-
|
|
10
|
-
const log = createLocalLogger({ source: "api" });
|
|
11
|
-
|
|
12
|
-
await log.write({
|
|
13
|
-
event: "user.click",
|
|
14
|
-
requestId: crypto.randomUUID(),
|
|
15
|
-
details: { control: "save-project" },
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const result = await traceOperation(
|
|
19
|
-
log,
|
|
20
|
-
{
|
|
21
|
-
event: "native.message",
|
|
22
|
-
requestId: crypto.randomUUID(),
|
|
23
|
-
details: { type: "project.save" },
|
|
24
|
-
},
|
|
25
|
-
() => sendMessage(),
|
|
26
|
-
);
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Use the same `requestId` on both sides of a process boundary.
|
|
30
|
-
|
|
31
|
-
A browser cannot write directly to the local filesystem. Forward browser events to a trusted local server or native process, then call this logger there.
|
|
32
|
-
|
|
33
|
-
## CLI
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
node tools/local-log/local-log.mjs write user.click '{"control":"save"}'
|
|
37
|
-
node tools/local-log/local-log.mjs tail 200
|
|
38
|
-
node tools/local-log/local-log.mjs clear-old 7
|
|
39
|
-
node tools/local-log/local-log.mjs clear-all
|
|
40
|
-
node tools/local-log/local-log.mjs path
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Set `LOCAL_LOG_ROOT` to override `tmp/logs` and `LOCAL_LOG_SOURCE` to identify a process.
|
|
44
|
-
|
|
45
|
-
## Data handling
|
|
46
|
-
|
|
47
|
-
Keys containing token, password, secret, authorization, cookie, API key, or private key are replaced with `[REDACTED]`. Large and deeply nested values are truncated.
|