@specdest/devkit 0.1.3 → 0.2.0
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/catalog/modules/checker-runtime/config.ts +4 -3
- package/catalog/modules/checker-runtime/fs.ts +4 -3
- package/catalog/modules/checker-runtime/manifest.json +6 -1
- package/catalog/modules/checker-runtime/runtime.ts +79 -0
- package/catalog/rules/abac-permissions-convex/check.ts +4 -3
- package/catalog/rules/abac-permissions-convex/manifest.json +3 -5
- package/catalog/rules/abac-permissions-supabase/check.ts +4 -3
- package/catalog/rules/abac-permissions-supabase/manifest.json +3 -5
- package/catalog/rules/convex-multi-presentation/check.ts +13 -12
- package/catalog/rules/convex-multi-presentation/manifest.json +3 -5
- package/catalog/rules/design-rules/check.ts +5 -4
- package/catalog/rules/design-rules/manifest.json +3 -5
- package/catalog/rules/e2e-test-rules/SKILL.md +1 -1
- package/catalog/rules/e2e-test-rules/check.ts +5 -4
- package/catalog/rules/e2e-test-rules/manifest.json +3 -5
- package/catalog/rules/error-handling-rules/check.ts +4 -3
- package/catalog/rules/error-handling-rules/manifest.json +3 -5
- package/catalog/rules/layers-and-contracts/check.ts +6 -5
- package/catalog/rules/layers-and-contracts/manifest.json +3 -5
- package/catalog/rules/layers-and-contracts-convex/check.ts +7 -6
- package/catalog/rules/layers-and-contracts-convex/manifest.json +3 -5
- package/catalog/rules/layers-and-contracts-supabase/check.ts +8 -7
- package/catalog/rules/layers-and-contracts-supabase/manifest.json +3 -5
- package/catalog/rules/module-size-rules/check.ts +9 -8
- package/catalog/rules/module-size-rules/manifest.json +3 -5
- package/catalog/rules/module-size-rules-convex/check.ts +9 -8
- package/catalog/rules/module-size-rules-convex/manifest.json +3 -5
- package/catalog/rules/module-size-rules-supabase/check.ts +9 -8
- package/catalog/rules/module-size-rules-supabase/manifest.json +3 -5
- package/catalog/rules/mutation-command-rules/check.ts +3 -2
- package/catalog/rules/mutation-command-rules/manifest.json +3 -5
- package/catalog/rules/nearby-contracts/SKILL.md +1 -1
- package/catalog/rules/nearby-contracts/check.ts +4 -3
- package/catalog/rules/nearby-contracts/manifest.json +3 -5
- package/catalog/rules/no-raw-click-buttons/check.ts +3 -2
- package/catalog/rules/no-raw-click-buttons/manifest.json +3 -5
- package/catalog/rules/public-api-export-barrels/SKILL.md +1 -1
- package/catalog/rules/public-api-export-barrels/check.ts +3 -2
- package/catalog/rules/public-api-export-barrels/manifest.json +3 -5
- package/catalog/rules/route-tree-fresh/check.ts +9 -7
- package/catalog/rules/route-tree-fresh/manifest.json +3 -5
- package/catalog/rules/strict-typescript/check.ts +16 -8
- package/catalog/rules/strict-typescript/manifest.json +3 -5
- package/catalog/rules/supabase-contracts/check.ts +10 -9
- package/catalog/rules/supabase-contracts/manifest.json +3 -5
- package/catalog/rules/supabase-declarative-schema/SKILL.md +1 -1
- package/catalog/rules/supabase-declarative-schema/check.ts +5 -4
- package/catalog/rules/supabase-declarative-schema/manifest.json +3 -5
- package/catalog/rules/tanstack-form-rules/SKILL.md +1 -1
- package/catalog/rules/tanstack-form-rules/check.ts +3 -2
- package/catalog/rules/tanstack-form-rules/manifest.json +3 -5
- package/catalog/rules/unit-test-rules/SKILL.md +1 -1
- package/catalog/rules/unit-test-rules/check.ts +6 -5
- package/catalog/rules/unit-test-rules/manifest.json +3 -5
- package/catalog/rules/unit-test-rules-convex/check.ts +8 -7
- package/catalog/rules/unit-test-rules-convex/manifest.json +3 -5
- package/catalog/rules/unit-test-rules-supabase/check.ts +7 -6
- package/catalog/rules/unit-test-rules-supabase/manifest.json +3 -5
- package/catalog/rules/workstation-controller-rules/check.ts +5 -4
- package/catalog/rules/workstation-controller-rules/manifest.json +3 -5
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { runtime } from "../shared/runtime.ts";
|
|
1
2
|
// oxlint-disable no-console no-await-in-loop
|
|
2
3
|
const violations: string[] = [];
|
|
3
4
|
const requiredDataDisplayStories = ["Empty", "Loading", "MinimumData", "FullData"] as const;
|
|
@@ -56,7 +57,7 @@ const zodSchemaFactories = [
|
|
|
56
57
|
|
|
57
58
|
async function exists(path: string): Promise<boolean> {
|
|
58
59
|
try {
|
|
59
|
-
await
|
|
60
|
+
await runtime.stat(path);
|
|
60
61
|
return true;
|
|
61
62
|
} catch {
|
|
62
63
|
return false;
|
|
@@ -65,7 +66,7 @@ async function exists(path: string): Promise<boolean> {
|
|
|
65
66
|
|
|
66
67
|
async function* walk(dir: string): AsyncGenerator<string> {
|
|
67
68
|
try {
|
|
68
|
-
for await (const entry of
|
|
69
|
+
for await (const entry of runtime.readDir(dir)) {
|
|
69
70
|
const path = dir + "/" + entry.name;
|
|
70
71
|
if (entry.isDirectory) yield* walk(path);
|
|
71
72
|
if (entry.isFile) yield path;
|
|
@@ -310,7 +311,7 @@ async function readAllTests(root: string): Promise<string> {
|
|
|
310
311
|
const texts: string[] = [];
|
|
311
312
|
for await (const file of walk(root)) {
|
|
312
313
|
if (file.endsWith(".test.ts") || file.endsWith(".test.tsx")) {
|
|
313
|
-
texts.push(await
|
|
314
|
+
texts.push(await runtime.readTextFile(file));
|
|
314
315
|
}
|
|
315
316
|
}
|
|
316
317
|
return texts.join("\n");
|
|
@@ -336,7 +337,7 @@ const hasDynamicDalBehaviorSuite =
|
|
|
336
337
|
/(?:safeParse|\.parse\s*\()/u.test(sharedTests);
|
|
337
338
|
|
|
338
339
|
for await (const file of walk("src")) {
|
|
339
|
-
const sourceText = isImplementation(file) ? await
|
|
340
|
+
const sourceText = isImplementation(file) ? await runtime.readTextFile(file) : "";
|
|
340
341
|
|
|
341
342
|
if (isUiComponentBoundary(file, sourceText)) {
|
|
342
343
|
const storyPath = storyPathFor(file);
|
|
@@ -345,7 +346,7 @@ for await (const file of walk("src")) {
|
|
|
345
346
|
continue;
|
|
346
347
|
}
|
|
347
348
|
|
|
348
|
-
const storyText = await
|
|
349
|
+
const storyText = await runtime.readTextFile(storyPath);
|
|
349
350
|
if (importsZod(storyText) || definesLocalZodSchema(storyText)) {
|
|
350
351
|
violations.push(
|
|
351
352
|
storyPath +
|
|
@@ -486,6 +487,6 @@ for await (const file of walk("src")) {
|
|
|
486
487
|
|
|
487
488
|
if (violations.length) {
|
|
488
489
|
console.error(violations.join("\n"));
|
|
489
|
-
|
|
490
|
+
runtime.exit(1);
|
|
490
491
|
}
|
|
491
492
|
console.log("unit-test-rules ok");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "unit-test-rules-supabase",
|
|
3
3
|
"kind": "rule",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.8",
|
|
5
5
|
"requires": [
|
|
6
6
|
"checker-runtime"
|
|
7
7
|
],
|
|
@@ -20,15 +20,13 @@
|
|
|
20
20
|
"kind": "shared-markdown-section",
|
|
21
21
|
"path": "AGENTS.md",
|
|
22
22
|
"heading": "## Specdest backend rule: unit-test-rules",
|
|
23
|
-
"body": "Use `.agents/skills/unit-test-rules/SKILL.md` for this backend-specific rule. Run `
|
|
23
|
+
"body": "Use `.agents/skills/unit-test-rules/SKILL.md` for this backend-specific rule. Run `node .agents/skills/unit-test-rules/check.ts` before handoff."
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
26
|
"obsolete": [],
|
|
27
27
|
"check": {
|
|
28
28
|
"command": [
|
|
29
|
-
"
|
|
30
|
-
"run",
|
|
31
|
-
"--allow-read",
|
|
29
|
+
"node",
|
|
32
30
|
".agents/skills/unit-test-rules/check.ts"
|
|
33
31
|
]
|
|
34
32
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { runtime } from "../shared/runtime.ts";
|
|
1
2
|
// oxlint-disable no-console
|
|
2
3
|
import { walk } from "../shared/fs.ts";
|
|
3
4
|
|
|
@@ -8,9 +9,9 @@ const violations: string[] = [];
|
|
|
8
9
|
|
|
9
10
|
async function readText(path: string) {
|
|
10
11
|
try {
|
|
11
|
-
return await
|
|
12
|
+
return await runtime.readTextFile(path);
|
|
12
13
|
} catch (error) {
|
|
13
|
-
if (error instanceof
|
|
14
|
+
if (error instanceof runtime.errors.NotFound) {
|
|
14
15
|
violations.push(`${path}: required workstation controller file is missing`);
|
|
15
16
|
return "";
|
|
16
17
|
}
|
|
@@ -75,7 +76,7 @@ async function checkCommandSafety() {
|
|
|
75
76
|
forbidMatch(
|
|
76
77
|
source,
|
|
77
78
|
/new\s+Deno\.Command\(\s*["'](?:bash|sh)["']/u,
|
|
78
|
-
`${file}:
|
|
79
|
+
`${file}: runtime.Command must not spawn bash/sh`,
|
|
79
80
|
);
|
|
80
81
|
forbidMatch(source, /args:\s*\[\s*["']-c["']/u, `${file}: shell command -c args are forbidden`);
|
|
81
82
|
forbidMatch(source, /shell:\s*true/u, `${file}: shell: true is forbidden`);
|
|
@@ -102,6 +103,6 @@ await checkLintWiring();
|
|
|
102
103
|
if (violations.length) {
|
|
103
104
|
console.error(`# workstation controller rule violations: ${violations.length}`);
|
|
104
105
|
console.error(violations.join("\n"));
|
|
105
|
-
|
|
106
|
+
runtime.exit(1);
|
|
106
107
|
}
|
|
107
108
|
console.log("workstation-controller-rules ok");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "workstation-controller-rules",
|
|
3
3
|
"kind": "rule",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"requires": [
|
|
6
6
|
"checker-runtime"
|
|
7
7
|
],
|
|
@@ -20,15 +20,13 @@
|
|
|
20
20
|
"kind": "shared-markdown-section",
|
|
21
21
|
"path": "AGENTS.md",
|
|
22
22
|
"heading": "## Specdest rule: workstation-controller-rules",
|
|
23
|
-
"body": "Use `.agents/skills/workstation-controller-rules/SKILL.md` when working in this rule area. Run `
|
|
23
|
+
"body": "Use `.agents/skills/workstation-controller-rules/SKILL.md` when working in this rule area. Run `node .agents/skills/workstation-controller-rules/check.ts` before handoff."
|
|
24
24
|
}
|
|
25
25
|
],
|
|
26
26
|
"obsolete": [],
|
|
27
27
|
"check": {
|
|
28
28
|
"command": [
|
|
29
|
-
"
|
|
30
|
-
"run",
|
|
31
|
-
"--allow-read",
|
|
29
|
+
"node",
|
|
32
30
|
".agents/skills/workstation-controller-rules/check.ts"
|
|
33
31
|
]
|
|
34
32
|
}
|