@specdest/devkit 0.1.2 → 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.
Files changed (61) hide show
  1. package/catalog/modules/checker-runtime/config.ts +4 -3
  2. package/catalog/modules/checker-runtime/fs.ts +4 -3
  3. package/catalog/modules/checker-runtime/manifest.json +6 -1
  4. package/catalog/modules/checker-runtime/runtime.ts +79 -0
  5. package/catalog/rules/abac-permissions-convex/check.ts +4 -3
  6. package/catalog/rules/abac-permissions-convex/manifest.json +3 -5
  7. package/catalog/rules/abac-permissions-supabase/check.ts +4 -3
  8. package/catalog/rules/abac-permissions-supabase/manifest.json +3 -5
  9. package/catalog/rules/convex-multi-presentation/check.ts +13 -12
  10. package/catalog/rules/convex-multi-presentation/manifest.json +3 -5
  11. package/catalog/rules/design-rules/check.ts +5 -4
  12. package/catalog/rules/design-rules/manifest.json +3 -5
  13. package/catalog/rules/e2e-test-rules/SKILL.md +1 -1
  14. package/catalog/rules/e2e-test-rules/check.ts +5 -4
  15. package/catalog/rules/e2e-test-rules/manifest.json +3 -5
  16. package/catalog/rules/error-handling-rules/check.ts +4 -3
  17. package/catalog/rules/error-handling-rules/manifest.json +3 -5
  18. package/catalog/rules/layers-and-contracts/check.ts +6 -5
  19. package/catalog/rules/layers-and-contracts/manifest.json +3 -5
  20. package/catalog/rules/layers-and-contracts-convex/check.ts +7 -6
  21. package/catalog/rules/layers-and-contracts-convex/manifest.json +3 -5
  22. package/catalog/rules/layers-and-contracts-supabase/check.ts +8 -7
  23. package/catalog/rules/layers-and-contracts-supabase/manifest.json +3 -5
  24. package/catalog/rules/module-size-rules/check.ts +9 -8
  25. package/catalog/rules/module-size-rules/manifest.json +3 -5
  26. package/catalog/rules/module-size-rules-convex/check.ts +9 -8
  27. package/catalog/rules/module-size-rules-convex/manifest.json +3 -5
  28. package/catalog/rules/module-size-rules-supabase/check.ts +9 -8
  29. package/catalog/rules/module-size-rules-supabase/manifest.json +3 -5
  30. package/catalog/rules/mutation-command-rules/check.ts +3 -2
  31. package/catalog/rules/mutation-command-rules/manifest.json +3 -5
  32. package/catalog/rules/nearby-contracts/SKILL.md +1 -1
  33. package/catalog/rules/nearby-contracts/check.ts +4 -3
  34. package/catalog/rules/nearby-contracts/manifest.json +3 -5
  35. package/catalog/rules/no-raw-click-buttons/check.ts +3 -2
  36. package/catalog/rules/no-raw-click-buttons/manifest.json +3 -5
  37. package/catalog/rules/public-api-export-barrels/SKILL.md +1 -1
  38. package/catalog/rules/public-api-export-barrels/check.ts +3 -2
  39. package/catalog/rules/public-api-export-barrels/manifest.json +3 -5
  40. package/catalog/rules/route-tree-fresh/check.ts +9 -7
  41. package/catalog/rules/route-tree-fresh/manifest.json +3 -5
  42. package/catalog/rules/strict-typescript/check.ts +16 -8
  43. package/catalog/rules/strict-typescript/manifest.json +3 -5
  44. package/catalog/rules/supabase-contracts/check.ts +10 -9
  45. package/catalog/rules/supabase-contracts/manifest.json +3 -5
  46. package/catalog/rules/supabase-declarative-schema/SKILL.md +1 -1
  47. package/catalog/rules/supabase-declarative-schema/check.ts +5 -4
  48. package/catalog/rules/supabase-declarative-schema/manifest.json +3 -5
  49. package/catalog/rules/tanstack-form-rules/SKILL.md +1 -1
  50. package/catalog/rules/tanstack-form-rules/check.ts +3 -2
  51. package/catalog/rules/tanstack-form-rules/manifest.json +3 -5
  52. package/catalog/rules/unit-test-rules/SKILL.md +1 -1
  53. package/catalog/rules/unit-test-rules/check.ts +6 -5
  54. package/catalog/rules/unit-test-rules/manifest.json +3 -5
  55. package/catalog/rules/unit-test-rules-convex/check.ts +8 -7
  56. package/catalog/rules/unit-test-rules-convex/manifest.json +3 -5
  57. package/catalog/rules/unit-test-rules-supabase/check.ts +7 -6
  58. package/catalog/rules/unit-test-rules-supabase/manifest.json +3 -5
  59. package/catalog/rules/workstation-controller-rules/check.ts +5 -4
  60. package/catalog/rules/workstation-controller-rules/manifest.json +3 -5
  61. 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 Deno.stat(path);
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 Deno.readDir(dir)) {
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 Deno.readTextFile(file));
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 Deno.readTextFile(file) : "";
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 Deno.readTextFile(storyPath);
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
- Deno.exit(1);
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.7",
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 `deno run --allow-read .agents/skills/unit-test-rules/check.ts` before handoff."
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
- "deno",
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 Deno.readTextFile(path);
12
+ return await runtime.readTextFile(path);
12
13
  } catch (error) {
13
- if (error instanceof Deno.errors.NotFound) {
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}: Deno.Command must not spawn bash/sh`,
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
- Deno.exit(1);
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.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 `deno run --allow-read .agents/skills/workstation-controller-rules/check.ts` before handoff."
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
- "deno",
30
- "run",
31
- "--allow-read",
29
+ "node",
32
30
  ".agents/skills/workstation-controller-rules/check.ts"
33
31
  ]
34
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@specdest/devkit",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "specdest": "src/cli.js"