@cbnventures/nova 0.19.0 → 0.20.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 (242) hide show
  1. package/build/package.json +6 -3
  2. package/build/src/cli/generate/github/issue-template.d.ts.map +1 -1
  3. package/build/src/cli/generate/github/issue-template.js +4 -93
  4. package/build/src/cli/generate/github/issue-template.js.map +1 -1
  5. package/build/src/cli/generate/must-haves/agent-conventions.d.ts.map +1 -1
  6. package/build/src/cli/generate/must-haves/agent-conventions.js +12 -3
  7. package/build/src/cli/generate/must-haves/agent-conventions.js.map +1 -1
  8. package/build/src/cli/generate/must-haves/dotenv.d.ts +4 -7
  9. package/build/src/cli/generate/must-haves/dotenv.d.ts.map +1 -1
  10. package/build/src/cli/generate/must-haves/dotenv.js +120 -417
  11. package/build/src/cli/generate/must-haves/dotenv.js.map +1 -1
  12. package/build/src/cli/generate/must-haves/gitignore.d.ts +0 -8
  13. package/build/src/cli/generate/must-haves/gitignore.d.ts.map +1 -1
  14. package/build/src/cli/generate/must-haves/gitignore.js +7 -395
  15. package/build/src/cli/generate/must-haves/gitignore.js.map +1 -1
  16. package/build/src/cli/recipe/github/sync-identity.js +1 -1
  17. package/build/src/cli/recipe/github/sync-identity.js.map +1 -1
  18. package/build/src/cli/recipe/github/sync-policies.d.ts.map +1 -1
  19. package/build/src/cli/recipe/github/sync-policies.js +8 -1
  20. package/build/src/cli/recipe/github/sync-policies.js.map +1 -1
  21. package/build/src/cli/utility/changelog.d.ts +2 -0
  22. package/build/src/cli/utility/changelog.d.ts.map +1 -1
  23. package/build/src/cli/utility/changelog.js +154 -2
  24. package/build/src/cli/utility/changelog.js.map +1 -1
  25. package/build/src/cli/utility/initialize.d.ts +3 -0
  26. package/build/src/cli/utility/initialize.d.ts.map +1 -1
  27. package/build/src/cli/utility/initialize.js +305 -1
  28. package/build/src/cli/utility/initialize.js.map +1 -1
  29. package/build/src/lib/dotenv.d.ts +3 -0
  30. package/build/src/lib/dotenv.d.ts.map +1 -0
  31. package/build/src/lib/dotenv.js +66 -0
  32. package/build/src/lib/dotenv.js.map +1 -0
  33. package/build/src/lib/file-discovery.d.ts +3 -0
  34. package/build/src/lib/file-discovery.d.ts.map +1 -0
  35. package/build/src/lib/file-discovery.js +32 -0
  36. package/build/src/lib/file-discovery.js.map +1 -0
  37. package/build/src/lib/item.d.ts +3 -1
  38. package/build/src/lib/item.d.ts.map +1 -1
  39. package/build/src/lib/item.js +9 -0
  40. package/build/src/lib/item.js.map +1 -1
  41. package/build/src/lib/markdown-slug.d.ts +4 -0
  42. package/build/src/lib/markdown-slug.d.ts.map +1 -0
  43. package/build/src/lib/markdown-slug.js +25 -0
  44. package/build/src/lib/markdown-slug.js.map +1 -0
  45. package/build/src/lib/nova-config.d.ts +5 -0
  46. package/build/src/lib/nova-config.d.ts.map +1 -1
  47. package/build/src/lib/nova-config.js +135 -13
  48. package/build/src/lib/nova-config.js.map +1 -1
  49. package/build/src/lib/regex.d.ts +68 -0
  50. package/build/src/lib/regex.d.ts.map +1 -1
  51. package/build/src/lib/regex.js +70 -2
  52. package/build/src/lib/regex.js.map +1 -1
  53. package/build/src/lib/type-declaration-engine.d.ts +32 -0
  54. package/build/src/lib/type-declaration-engine.d.ts.map +1 -0
  55. package/build/src/lib/type-declaration-engine.js +770 -0
  56. package/build/src/lib/type-declaration-engine.js.map +1 -0
  57. package/build/src/lib/utility.d.ts.map +1 -1
  58. package/build/src/lib/utility.js +8 -8
  59. package/build/src/lib/utility.js.map +1 -1
  60. package/build/src/rules/eslint/conventions/require-kebab-case-filename.d.ts.map +1 -1
  61. package/build/src/rules/eslint/conventions/require-kebab-case-filename.js.map +1 -1
  62. package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts.map +1 -1
  63. package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.js +3 -3
  64. package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.js.map +1 -1
  65. package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.d.ts.map +1 -1
  66. package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.js +3 -2
  67. package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.js.map +1 -1
  68. package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.js +2 -2
  69. package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.js.map +1 -1
  70. package/build/src/rules/eslint/jsdoc/require-jsdoc-since.d.ts +1 -1
  71. package/build/src/rules/eslint/jsdoc/require-jsdoc-since.d.ts.map +1 -1
  72. package/build/src/rules/eslint/jsdoc/require-jsdoc-since.js +102 -6
  73. package/build/src/rules/eslint/jsdoc/require-jsdoc-since.js.map +1 -1
  74. package/build/src/rules/eslint/regex/no-regex-literals.d.ts +1 -0
  75. package/build/src/rules/eslint/regex/no-regex-literals.d.ts.map +1 -1
  76. package/build/src/rules/eslint/regex/no-regex-literals.js +39 -1
  77. package/build/src/rules/eslint/regex/no-regex-literals.js.map +1 -1
  78. package/build/src/rules/eslint/typescript/require-type-naming.js +2 -2
  79. package/build/src/rules/eslint/typescript/require-type-naming.js.map +1 -1
  80. package/build/src/rules/vitest/dotenv/register.d.ts +3 -0
  81. package/build/src/rules/vitest/dotenv/register.d.ts.map +1 -0
  82. package/build/src/rules/vitest/dotenv/register.js +21 -0
  83. package/build/src/rules/vitest/dotenv/register.js.map +1 -0
  84. package/build/src/rules/vitest/dotenv/rules.d.ts +3 -0
  85. package/build/src/rules/vitest/dotenv/rules.d.ts.map +1 -0
  86. package/build/src/rules/vitest/dotenv/rules.js +32 -0
  87. package/build/src/rules/vitest/dotenv/rules.js.map +1 -0
  88. package/build/src/rules/vitest/enable.d.ts +3 -0
  89. package/build/src/rules/vitest/enable.d.ts.map +1 -0
  90. package/build/src/rules/vitest/enable.js +7 -0
  91. package/build/src/rules/vitest/enable.js.map +1 -0
  92. package/build/src/rules/vitest/frontmatter/register.d.ts +3 -0
  93. package/build/src/rules/vitest/frontmatter/register.d.ts.map +1 -0
  94. package/build/src/rules/vitest/frontmatter/register.js +51 -0
  95. package/build/src/rules/vitest/frontmatter/register.js.map +1 -0
  96. package/build/src/rules/vitest/frontmatter/rules.d.ts +15 -0
  97. package/build/src/rules/vitest/frontmatter/rules.d.ts.map +1 -0
  98. package/build/src/rules/vitest/frontmatter/rules.js +498 -0
  99. package/build/src/rules/vitest/frontmatter/rules.js.map +1 -0
  100. package/build/src/rules/vitest/index.d.ts +8 -0
  101. package/build/src/rules/vitest/index.d.ts.map +1 -0
  102. package/build/src/rules/vitest/index.js +7 -0
  103. package/build/src/rules/vitest/index.js.map +1 -0
  104. package/build/src/rules/vitest/link/register.d.ts +3 -0
  105. package/build/src/rules/vitest/link/register.d.ts.map +1 -0
  106. package/build/src/rules/vitest/link/register.js +43 -0
  107. package/build/src/rules/vitest/link/register.js.map +1 -0
  108. package/build/src/rules/vitest/link/rules.d.ts +12 -0
  109. package/build/src/rules/vitest/link/rules.d.ts.map +1 -0
  110. package/build/src/rules/vitest/link/rules.js +313 -0
  111. package/build/src/rules/vitest/link/rules.js.map +1 -0
  112. package/build/src/rules/vitest/markdown-table/register.d.ts +3 -0
  113. package/build/src/rules/vitest/markdown-table/register.d.ts.map +1 -0
  114. package/build/src/rules/vitest/markdown-table/register.js +25 -0
  115. package/build/src/rules/vitest/markdown-table/register.js.map +1 -0
  116. package/build/src/rules/vitest/markdown-table/rules.d.ts +3 -0
  117. package/build/src/rules/vitest/markdown-table/rules.d.ts.map +1 -0
  118. package/build/src/rules/vitest/markdown-table/rules.js +99 -0
  119. package/build/src/rules/vitest/markdown-table/rules.js.map +1 -0
  120. package/build/src/rules/vitest/terminology/register.d.ts +3 -0
  121. package/build/src/rules/vitest/terminology/register.d.ts.map +1 -0
  122. package/build/src/rules/vitest/terminology/register.js +38 -0
  123. package/build/src/rules/vitest/terminology/register.js.map +1 -0
  124. package/build/src/rules/vitest/terminology/rules.d.ts +10 -0
  125. package/build/src/rules/vitest/terminology/rules.d.ts.map +1 -0
  126. package/build/src/rules/vitest/terminology/rules.js +202 -0
  127. package/build/src/rules/vitest/terminology/rules.js.map +1 -0
  128. package/build/src/rules/vitest/type-declarations/register.d.ts +3 -0
  129. package/build/src/rules/vitest/type-declarations/register.d.ts.map +1 -0
  130. package/build/src/rules/vitest/type-declarations/register.js +30 -0
  131. package/build/src/rules/vitest/type-declarations/register.js.map +1 -0
  132. package/build/src/rules/vitest/type-declarations/rules.d.ts +11 -0
  133. package/build/src/rules/vitest/type-declarations/rules.d.ts.map +1 -0
  134. package/build/src/rules/vitest/type-declarations/rules.js +666 -0
  135. package/build/src/rules/vitest/type-declarations/rules.js.map +1 -0
  136. package/build/src/toolkit/logger.d.ts.map +1 -1
  137. package/build/src/toolkit/logger.js +3 -1
  138. package/build/src/toolkit/logger.js.map +1 -1
  139. package/build/src/types/cli/generate/github/issue-template.d.ts +10 -30
  140. package/build/src/types/cli/generate/github/workflows.d.ts +7 -7
  141. package/build/src/types/cli/generate/must-haves/agent-conventions.d.ts +8 -1
  142. package/build/src/types/cli/generate/must-haves/dotenv.d.ts +79 -327
  143. package/build/src/types/cli/generate/must-haves/gitignore.d.ts +12 -342
  144. package/build/src/types/cli/recipe/github/sync-features.d.ts +1 -1
  145. package/build/src/types/cli/recipe/github/sync-identity.d.ts +2 -2
  146. package/build/src/types/cli/recipe/github/sync-policies.d.ts +3 -1
  147. package/build/src/types/cli/utility/changelog.d.ts +92 -0
  148. package/build/src/types/cli/utility/initialize.d.ts +195 -0
  149. package/build/src/types/lib/constants.d.ts +1 -1
  150. package/build/src/types/lib/dotenv.d.ts +67 -0
  151. package/build/src/types/lib/file-discovery.d.ts +40 -0
  152. package/build/src/types/lib/item.d.ts +19 -0
  153. package/build/src/types/lib/markdown-slug.d.ts +25 -0
  154. package/build/src/types/lib/nova-config.d.ts +108 -16
  155. package/build/src/types/lib/regex.d.ts +193 -18
  156. package/build/src/types/lib/type-declaration-engine.d.ts +1036 -0
  157. package/build/src/types/lib/utility.d.ts +2 -2
  158. package/build/src/types/lib/workflow-templates.d.ts +1 -1
  159. package/build/src/types/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts +2 -2
  160. package/build/src/types/rules/eslint/jsdoc/require-jsdoc-since.d.ts +71 -1
  161. package/build/src/types/rules/eslint/regex/no-regex-literals.d.ts +44 -0
  162. package/build/src/types/rules/eslint/typescript/require-type-naming.d.ts +3 -3
  163. package/build/src/types/rules/vitest/dotenv/register.d.ts +31 -0
  164. package/build/src/types/rules/vitest/dotenv/rules.d.ts +29 -0
  165. package/build/src/types/rules/vitest/enable.d.ts +12 -0
  166. package/build/src/types/rules/vitest/frontmatter/register.d.ts +63 -0
  167. package/build/src/types/rules/vitest/frontmatter/rules.d.ts +430 -0
  168. package/build/src/types/rules/vitest/index.d.ts +399 -0
  169. package/build/src/types/rules/vitest/link/register.d.ts +79 -0
  170. package/build/src/types/rules/vitest/link/rules.d.ts +368 -0
  171. package/build/src/types/rules/vitest/markdown-table/register.d.ts +33 -0
  172. package/build/src/types/rules/vitest/markdown-table/rules.d.ts +55 -0
  173. package/build/src/types/rules/vitest/terminology/register.d.ts +48 -0
  174. package/build/src/types/rules/vitest/terminology/rules.d.ts +190 -0
  175. package/build/src/types/rules/vitest/type-declarations/register.d.ts +46 -0
  176. package/build/src/types/rules/vitest/type-declarations/rules.d.ts +820 -0
  177. package/build/src/types/shared.d.ts +71 -4
  178. package/build/src/types/tests/cli/generate/github/issue-template.test.d.ts +34 -17
  179. package/build/src/types/tests/cli/generate/github/workflows-helpers.test.d.ts +8 -8
  180. package/build/src/types/tests/cli/generate/must-haves/agent-conventions.test.d.ts +79 -11
  181. package/build/src/types/tests/cli/generate/must-haves/dotenv.test.d.ts +105 -15
  182. package/build/src/types/tests/cli/generate/must-haves/gitignore.test.d.ts +11 -20
  183. package/build/src/types/tests/cli/recipe/github/handle-gh-failure.test.d.ts +3 -3
  184. package/build/src/types/tests/cli/recipe/github/sync-features.test.d.ts +17 -17
  185. package/build/src/types/tests/cli/recipe/github/sync-identity.test.d.ts +69 -23
  186. package/build/src/types/tests/cli/recipe/github/sync-policies.test.d.ts +89 -20
  187. package/build/src/types/tests/cli/scaffold/docs/docusaurus.test.d.ts +4 -0
  188. package/build/src/types/tests/cli/utility/changelog.test.d.ts +262 -0
  189. package/build/src/types/tests/cli/utility/initialize.test.d.ts +31 -0
  190. package/build/src/types/tests/lib/dotenv.test.d.ts +95 -0
  191. package/build/src/types/tests/lib/file-discovery.test.d.ts +37 -0
  192. package/build/src/types/tests/lib/item.test.d.ts +21 -0
  193. package/build/src/types/tests/lib/markdown-slug.test.d.ts +24 -0
  194. package/build/src/types/tests/lib/nova-config.test.d.ts +263 -0
  195. package/build/src/types/tests/lib/regex.test.d.ts +252 -0
  196. package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-since.test.d.ts +18 -0
  197. package/build/src/types/tests/rules/vitest/dotenv.test.d.ts +19 -0
  198. package/build/src/types/tests/rules/vitest/enable.test.d.ts +27 -0
  199. package/build/src/types/tests/rules/vitest/frontmatter.test.d.ts +8 -0
  200. package/build/src/types/tests/rules/vitest/link.test.d.ts +74 -0
  201. package/build/src/types/tests/rules/vitest/markdown-table.test.d.ts +28 -0
  202. package/build/src/types/tests/rules/vitest/terminology.test.d.ts +39 -0
  203. package/build/src/types/tests/rules/vitest/type-declarations.test.d.ts +10 -0
  204. package/build/src/types/tests/scaffold-version-drift.test.d.ts +42 -0
  205. package/build/src/types/tests/since-version.test.d.ts +137 -0
  206. package/build/src/types/tests/toolkit/logger.test.d.ts +45 -0
  207. package/build/src/types/tests/type-declarations.test.d.ts +34 -1821
  208. package/build/src/types/toolkit/logger.d.ts +4 -0
  209. package/build/templates/generators/github/workflows/check-sponsor-gated-issues/base.yml +1 -1
  210. package/build/templates/generators/github/workflows/publish/base.yml +1 -1
  211. package/build/templates/generators/github/workflows/publish/targets/aws-amplify-nextjs.yml +1 -1
  212. package/build/templates/generators/github/workflows/publish/targets/cloudflare-pages-docusaurus.yml +1 -1
  213. package/build/templates/generators/github/workflows/publish/targets/docker-hub.yml +1 -1
  214. package/build/templates/generators/github/workflows/publish/targets/ghcr.yml +1 -1
  215. package/build/templates/generators/github/workflows/publish/targets/github-action.yml +1 -1
  216. package/build/templates/generators/github/workflows/publish/targets/github-packages.yml +1 -1
  217. package/build/templates/generators/github/workflows/publish/targets/github-pages-docusaurus.yml +4 -4
  218. package/build/templates/generators/github/workflows/publish/targets/npm.yml +1 -1
  219. package/build/templates/generators/github/workflows/publish/targets/vercel-nextjs.yml +1 -1
  220. package/build/templates/generators/must-haves/agent-conventions/AGENTS.md +1 -2
  221. package/build/templates/generators/must-haves/agent-conventions/CLAUDE.md +1 -2
  222. package/build/templates/generators/must-haves/agent-conventions/conventions/java.md +5 -5
  223. package/build/templates/generators/must-haves/agent-conventions/conventions/kotlin.md +4 -4
  224. package/build/templates/generators/must-haves/agent-conventions/conventions/php.md +2 -2
  225. package/build/templates/generators/must-haves/agent-conventions/conventions/typescript.md +6 -6
  226. package/build/templates/generators/must-haves/dotenv/env +5 -2
  227. package/build/templates/generators/must-haves/dotenv/env.sample +6 -3
  228. package/build/templates/generators/must-haves/gitignore/gitignore +6 -0
  229. package/build/templates/scaffold/app/express/package.json +5 -5
  230. package/build/templates/scaffold/app/nextjs/package.json +7 -7
  231. package/build/templates/scaffold/app/vite/package.json +3 -3
  232. package/build/templates/scaffold/app/workers/package.json +3 -3
  233. package/build/templates/scaffold/docs/docusaurus/docs/intro.md +6 -0
  234. package/build/templates/scaffold/docs/docusaurus/package.json +11 -7
  235. package/build/templates/scaffold/docs/docusaurus/src/tests/frontmatter.test.ts +21 -0
  236. package/build/templates/scaffold/docs/docusaurus/src/tests/link.test.ts +14 -0
  237. package/build/templates/scaffold/docs/docusaurus/src/tests/markdown-table.test.ts +14 -0
  238. package/build/templates/scaffold/docs/docusaurus/src/tests/terminology.test.ts +14 -0
  239. package/build/templates/scaffold/docs/docusaurus/vitest.config.ts +22 -0
  240. package/build/templates/scaffold/docs/docusaurus/vitest.setup.ts +26 -0
  241. package/package.json +6 -3
  242. package/build/templates/generators/must-haves/agent-conventions/cursorrules +0 -55
@@ -0,0 +1,202 @@
1
+ import { strictEqual } from 'node:assert/strict';
2
+ import { existsSync } from 'node:fs';
3
+ import { readFile } from 'node:fs/promises';
4
+ import { join } from 'node:path';
5
+ import { it } from 'vitest';
6
+ import { slugifyHeading } from '../../../lib/markdown-slug.js';
7
+ import { LIB_REGEX_PATTERN_CODE_BLOCK, LIB_REGEX_PATTERN_HEADING_H2_LINE, LIB_REGEX_PATTERN_TERMINOLOGY_TITLE_ATTR, LIB_REGEX_PATTERN_TERMINOLOGY_TO_ATTR, } from '../../../lib/regex.js';
8
+ import { isEnabled } from '../enable.js';
9
+ export function componentPattern(componentName) {
10
+ return `<${componentName}\\s+([^>]*)>([^<]*)</${componentName}>`;
11
+ }
12
+ export async function buildValidAnchors(config) {
13
+ const validAnchors = new Set();
14
+ const terminologyPath = config['terminologyPath'];
15
+ if (existsSync(terminologyPath) === false) {
16
+ return validAnchors;
17
+ }
18
+ const terminologyContent = await readFile(terminologyPath, 'utf-8');
19
+ for (const headingMatch of terminologyContent.matchAll(new RegExp(LIB_REGEX_PATTERN_HEADING_H2_LINE, 'gm'))) {
20
+ const headingCapture = headingMatch[1] ?? '';
21
+ const anchor = slugifyHeading(headingCapture);
22
+ validAnchors.add(anchor);
23
+ }
24
+ return validAnchors;
25
+ }
26
+ export async function titleAttrPresent(config, enable) {
27
+ if (isEnabled('terminology-title-attr-present', enable) === false) {
28
+ return;
29
+ }
30
+ const files = config['files'];
31
+ const componentRegexSource = componentPattern(config['componentName']);
32
+ for (const file of files) {
33
+ it(`terminology title attributes present in ${file}`, async () => {
34
+ const filePath = join(config['rootDir'], file);
35
+ const content = await readFile(filePath, 'utf-8');
36
+ const strippedContent = content.replace(new RegExp(LIB_REGEX_PATTERN_CODE_BLOCK, 'g'), '');
37
+ const failures = [];
38
+ for (const componentMatch of strippedContent.matchAll(new RegExp(componentRegexSource, 'g'))) {
39
+ const attrs = componentMatch[1] ?? '';
40
+ const titleMatch = new RegExp(LIB_REGEX_PATTERN_TERMINOLOGY_TITLE_ATTR).exec(attrs);
41
+ if (titleMatch === null || (titleMatch[1] ?? '').length === 0) {
42
+ failures.push(`${file}: <${config['componentName']}> missing or empty title attribute`);
43
+ }
44
+ }
45
+ strictEqual(failures.length, 0, [
46
+ '',
47
+ 'Terminology title attribute issues:',
48
+ failures.join('\n'),
49
+ ].join('\n'));
50
+ return;
51
+ });
52
+ }
53
+ return;
54
+ }
55
+ export async function toAttrPresent(config, enable) {
56
+ if (isEnabled('terminology-to-attr-present', enable) === false) {
57
+ return;
58
+ }
59
+ const files = config['files'];
60
+ const componentRegexSource = componentPattern(config['componentName']);
61
+ for (const file of files) {
62
+ it(`terminology to attributes present in ${file}`, async () => {
63
+ const filePath = join(config['rootDir'], file);
64
+ const content = await readFile(filePath, 'utf-8');
65
+ const strippedContent = content.replace(new RegExp(LIB_REGEX_PATTERN_CODE_BLOCK, 'g'), '');
66
+ const failures = [];
67
+ for (const componentMatch of strippedContent.matchAll(new RegExp(componentRegexSource, 'g'))) {
68
+ const attrs = componentMatch[1] ?? '';
69
+ const toMatch = new RegExp(LIB_REGEX_PATTERN_TERMINOLOGY_TO_ATTR).exec(attrs);
70
+ if (toMatch === null || (toMatch[1] ?? '').length === 0) {
71
+ failures.push(`${file}: <${config['componentName']}> missing or empty to attribute`);
72
+ }
73
+ }
74
+ strictEqual(failures.length, 0, [
75
+ '',
76
+ 'Terminology to attribute issues:',
77
+ failures.join('\n'),
78
+ ].join('\n'));
79
+ return;
80
+ });
81
+ }
82
+ return;
83
+ }
84
+ export async function childrenNonempty(config, enable) {
85
+ if (isEnabled('terminology-children-nonempty', enable) === false) {
86
+ return;
87
+ }
88
+ const files = config['files'];
89
+ const componentRegexSource = componentPattern(config['componentName']);
90
+ for (const file of files) {
91
+ it(`terminology children non-empty in ${file}`, async () => {
92
+ const filePath = join(config['rootDir'], file);
93
+ const content = await readFile(filePath, 'utf-8');
94
+ const strippedContent = content.replace(new RegExp(LIB_REGEX_PATTERN_CODE_BLOCK, 'g'), '');
95
+ const failures = [];
96
+ for (const componentMatch of strippedContent.matchAll(new RegExp(componentRegexSource, 'g'))) {
97
+ const children = (componentMatch[2] ?? '').trim();
98
+ if (children.length === 0) {
99
+ failures.push(`${file}: <${config['componentName']}> has empty children`);
100
+ }
101
+ }
102
+ strictEqual(failures.length, 0, [
103
+ '',
104
+ 'Terminology children issues:',
105
+ failures.join('\n'),
106
+ ].join('\n'));
107
+ return;
108
+ });
109
+ }
110
+ return;
111
+ }
112
+ export async function toPointsToBase(config, enable) {
113
+ if (isEnabled('terminology-to-points-to-base', enable) === false) {
114
+ return;
115
+ }
116
+ const files = config['files'];
117
+ const componentRegexSource = componentPattern(config['componentName']);
118
+ const expectedBase = config['expectedBase'];
119
+ for (const file of files) {
120
+ it(`terminology to points to base in ${file}`, async () => {
121
+ const filePath = join(config['rootDir'], file);
122
+ const content = await readFile(filePath, 'utf-8');
123
+ const strippedContent = content.replace(new RegExp(LIB_REGEX_PATTERN_CODE_BLOCK, 'g'), '');
124
+ const failures = [];
125
+ for (const componentMatch of strippedContent.matchAll(new RegExp(componentRegexSource, 'g'))) {
126
+ const attrs = componentMatch[1] ?? '';
127
+ const toMatch = new RegExp(LIB_REGEX_PATTERN_TERMINOLOGY_TO_ATTR).exec(attrs);
128
+ if (toMatch === null) {
129
+ continue;
130
+ }
131
+ const toValue = toMatch[1] ?? '';
132
+ if (toValue !== expectedBase && toValue.startsWith(`${expectedBase}#`) === false) {
133
+ failures.push(`${file}: <${config['componentName']} to="${toValue}"> does not point to ${expectedBase}`);
134
+ }
135
+ }
136
+ strictEqual(failures.length, 0, [
137
+ '',
138
+ 'Terminology to-base issues:',
139
+ failures.join('\n'),
140
+ ].join('\n'));
141
+ return;
142
+ });
143
+ }
144
+ return;
145
+ }
146
+ export async function anchorResolves(config, enable) {
147
+ if (isEnabled('terminology-anchor-resolves', enable) === false) {
148
+ return;
149
+ }
150
+ const terminologyPath = config['terminologyPath'];
151
+ if (existsSync(terminologyPath) === false) {
152
+ return;
153
+ }
154
+ const validAnchors = await buildValidAnchors(config);
155
+ const files = config['files'];
156
+ const componentRegexSource = componentPattern(config['componentName']);
157
+ const expectedBase = config['expectedBase'];
158
+ for (const file of files) {
159
+ it(`terminology anchors resolve in ${file}`, async () => {
160
+ const filePath = join(config['rootDir'], file);
161
+ const content = await readFile(filePath, 'utf-8');
162
+ const strippedContent = content.replace(new RegExp(LIB_REGEX_PATTERN_CODE_BLOCK, 'g'), '');
163
+ const failures = [];
164
+ for (const componentMatch of strippedContent.matchAll(new RegExp(componentRegexSource, 'g'))) {
165
+ const toMatch = new RegExp(LIB_REGEX_PATTERN_TERMINOLOGY_TO_ATTR).exec(componentMatch[1] ?? '');
166
+ if (toMatch === null) {
167
+ continue;
168
+ }
169
+ const toValue = toMatch[1] ?? '';
170
+ if (toValue.startsWith(`${expectedBase}#`) === false) {
171
+ continue;
172
+ }
173
+ const anchor = toValue.slice(`${expectedBase}#`.length);
174
+ if (validAnchors.has(anchor) === false) {
175
+ failures.push(`${file}: <${config['componentName']} to="${toValue}"> references unknown anchor "#${anchor}"`);
176
+ }
177
+ }
178
+ strictEqual(failures.length, 0, [
179
+ '',
180
+ 'Terminology anchor issues:',
181
+ failures.join('\n'),
182
+ ].join('\n'));
183
+ return;
184
+ });
185
+ }
186
+ return;
187
+ }
188
+ export function componentValidation(config, enable) {
189
+ if (isEnabled('terminology-component-validation', enable) === false) {
190
+ return;
191
+ }
192
+ const terminologyPath = config['terminologyPath'];
193
+ if (existsSync(terminologyPath) === false) {
194
+ return;
195
+ }
196
+ it(`terminology component validation is active${''}`, () => {
197
+ strictEqual(existsSync(terminologyPath), true, 'terminology source page must exist when validation is active');
198
+ return;
199
+ });
200
+ return;
201
+ }
202
+ //# sourceMappingURL=rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../../../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AO;AACT,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Rules_Vitest_TypeDeclarations_Register_RegisterTypeDeclarationSuite_Config, Rules_Vitest_TypeDeclarations_Register_RegisterTypeDeclarationSuite_Returns } from '../../../types/rules/vitest/type-declarations/register.d.ts';
2
+ export declare function registerTypeDeclarationSuite(config: Rules_Vitest_TypeDeclarations_Register_RegisterTypeDeclarationSuite_Config): Rules_Vitest_TypeDeclarations_Register_RegisterTypeDeclarationSuite_Returns;
3
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../src/rules/vitest/type-declarations/register.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,0EAA0E,EAC1E,2EAA2E,EAO5E,MAAM,6DAA6D,CAAC;AAerE,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,0EAA0E,GAAG,2EAA2E,CA4B5M"}
@@ -0,0 +1,30 @@
1
+ import { describe } from 'vitest';
2
+ import { deriveDtsMapping } from '../../../lib/type-declaration-engine.js';
3
+ import { crossSectionReferences, filenameValidation, firstComeFirstServeOrder, identifierVsFileName, objectPropertyTypes, sectionAlphabeticalOrder, sectionCoverage, standaloneTypeFiles, variableTypeSymmetry, } from './rules.js';
4
+ export function registerTypeDeclarationSuite(config) {
5
+ describe('type declarations', async () => {
6
+ const packageRoot = config['packageRoot'] ?? process.cwd();
7
+ const typeRoots = config['typeRoots'] ?? ['src'];
8
+ const standaloneTypeFilesConfig = config['standaloneTypeFiles'] ?? [];
9
+ const mapping = config['mapping'] ?? deriveDtsMapping(typeRoots);
10
+ const enable = config['enable'];
11
+ const resolved = {
12
+ packageRoot,
13
+ typeRoots,
14
+ standaloneTypeFiles: standaloneTypeFilesConfig,
15
+ mapping,
16
+ };
17
+ await crossSectionReferences(resolved, enable);
18
+ await sectionAlphabeticalOrder(resolved, enable);
19
+ await firstComeFirstServeOrder(resolved, enable);
20
+ await objectPropertyTypes(resolved, enable);
21
+ await sectionCoverage(resolved, enable);
22
+ await variableTypeSymmetry(resolved, enable);
23
+ await identifierVsFileName(resolved, enable);
24
+ await filenameValidation(resolved, enable);
25
+ await standaloneTypeFiles(resolved, enable);
26
+ return;
27
+ });
28
+ return;
29
+ }
30
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../../../../src/rules/vitest/type-declarations/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AA0BpB,MAAM,UAAU,4BAA4B,CAAC,MAAkF;IAC7H,QAAQ,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,WAAW,GAAqG,MAAM,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAC7J,MAAM,SAAS,GAAmG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjJ,MAAM,yBAAyB,GAAmH,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC;QACtL,MAAM,OAAO,GAAiG,MAAM,CAAC,SAAS,CAAC,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC/J,MAAM,MAAM,GAAgG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC7H,MAAM,QAAQ,GAAkG;YAC9G,WAAW;YACX,SAAS;YACT,mBAAmB,EAAE,yBAAyB;YAC9C,OAAO;SACR,CAAC;QAEF,MAAM,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACjD,MAAM,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACjD,MAAM,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC5C,MAAM,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACxC,MAAM,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC7C,MAAM,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC7C,MAAM,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC3C,MAAM,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAE5C,OAAO;IACT,CAAC,CAAC,CAAC;IAEH,OAAO;AACT,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { Rules_Vitest_TypeDeclarations_Rules_CrossSectionReferences_Config, Rules_Vitest_TypeDeclarations_Rules_CrossSectionReferences_Enable, Rules_Vitest_TypeDeclarations_Rules_CrossSectionReferences_Returns, Rules_Vitest_TypeDeclarations_Rules_FilenameValidation_Config, Rules_Vitest_TypeDeclarations_Rules_FilenameValidation_Enable, Rules_Vitest_TypeDeclarations_Rules_FilenameValidation_Returns, Rules_Vitest_TypeDeclarations_Rules_FirstComeFirstServeOrder_Config, Rules_Vitest_TypeDeclarations_Rules_FirstComeFirstServeOrder_Enable, Rules_Vitest_TypeDeclarations_Rules_FirstComeFirstServeOrder_Returns, Rules_Vitest_TypeDeclarations_Rules_IdentifierVsFileName_Config, Rules_Vitest_TypeDeclarations_Rules_IdentifierVsFileName_Enable, Rules_Vitest_TypeDeclarations_Rules_IdentifierVsFileName_Returns, Rules_Vitest_TypeDeclarations_Rules_ObjectPropertyTypes_Config, Rules_Vitest_TypeDeclarations_Rules_ObjectPropertyTypes_Enable, Rules_Vitest_TypeDeclarations_Rules_ObjectPropertyTypes_Returns, Rules_Vitest_TypeDeclarations_Rules_SectionAlphabeticalOrder_Config, Rules_Vitest_TypeDeclarations_Rules_SectionAlphabeticalOrder_Enable, Rules_Vitest_TypeDeclarations_Rules_SectionAlphabeticalOrder_Returns, Rules_Vitest_TypeDeclarations_Rules_SectionCoverage_Config, Rules_Vitest_TypeDeclarations_Rules_SectionCoverage_Enable, Rules_Vitest_TypeDeclarations_Rules_SectionCoverage_Returns, Rules_Vitest_TypeDeclarations_Rules_StandaloneTypeFiles_Config, Rules_Vitest_TypeDeclarations_Rules_StandaloneTypeFiles_Enable, Rules_Vitest_TypeDeclarations_Rules_StandaloneTypeFiles_Returns, Rules_Vitest_TypeDeclarations_Rules_VariableTypeSymmetry_Config, Rules_Vitest_TypeDeclarations_Rules_VariableTypeSymmetry_Enable, Rules_Vitest_TypeDeclarations_Rules_VariableTypeSymmetry_Returns } from '../../../types/rules/vitest/type-declarations/rules.d.ts';
2
+ export declare function crossSectionReferences(config: Rules_Vitest_TypeDeclarations_Rules_CrossSectionReferences_Config, enable: Rules_Vitest_TypeDeclarations_Rules_CrossSectionReferences_Enable): Rules_Vitest_TypeDeclarations_Rules_CrossSectionReferences_Returns;
3
+ export declare function sectionAlphabeticalOrder(config: Rules_Vitest_TypeDeclarations_Rules_SectionAlphabeticalOrder_Config, enable: Rules_Vitest_TypeDeclarations_Rules_SectionAlphabeticalOrder_Enable): Rules_Vitest_TypeDeclarations_Rules_SectionAlphabeticalOrder_Returns;
4
+ export declare function firstComeFirstServeOrder(config: Rules_Vitest_TypeDeclarations_Rules_FirstComeFirstServeOrder_Config, enable: Rules_Vitest_TypeDeclarations_Rules_FirstComeFirstServeOrder_Enable): Rules_Vitest_TypeDeclarations_Rules_FirstComeFirstServeOrder_Returns;
5
+ export declare function objectPropertyTypes(config: Rules_Vitest_TypeDeclarations_Rules_ObjectPropertyTypes_Config, enable: Rules_Vitest_TypeDeclarations_Rules_ObjectPropertyTypes_Enable): Rules_Vitest_TypeDeclarations_Rules_ObjectPropertyTypes_Returns;
6
+ export declare function sectionCoverage(config: Rules_Vitest_TypeDeclarations_Rules_SectionCoverage_Config, enable: Rules_Vitest_TypeDeclarations_Rules_SectionCoverage_Enable): Rules_Vitest_TypeDeclarations_Rules_SectionCoverage_Returns;
7
+ export declare function variableTypeSymmetry(config: Rules_Vitest_TypeDeclarations_Rules_VariableTypeSymmetry_Config, enable: Rules_Vitest_TypeDeclarations_Rules_VariableTypeSymmetry_Enable): Rules_Vitest_TypeDeclarations_Rules_VariableTypeSymmetry_Returns;
8
+ export declare function identifierVsFileName(config: Rules_Vitest_TypeDeclarations_Rules_IdentifierVsFileName_Config, enable: Rules_Vitest_TypeDeclarations_Rules_IdentifierVsFileName_Enable): Rules_Vitest_TypeDeclarations_Rules_IdentifierVsFileName_Returns;
9
+ export declare function filenameValidation(config: Rules_Vitest_TypeDeclarations_Rules_FilenameValidation_Config, enable: Rules_Vitest_TypeDeclarations_Rules_FilenameValidation_Enable): Rules_Vitest_TypeDeclarations_Rules_FilenameValidation_Returns;
10
+ export declare function standaloneTypeFiles(config: Rules_Vitest_TypeDeclarations_Rules_StandaloneTypeFiles_Config, enable: Rules_Vitest_TypeDeclarations_Rules_StandaloneTypeFiles_Enable): Rules_Vitest_TypeDeclarations_Rules_StandaloneTypeFiles_Returns;
11
+ //# sourceMappingURL=rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../../../src/rules/vitest/type-declarations/rules.ts"],"names":[],"mappings":"AAyDA,OAAO,KAAK,EAEV,iEAAiE,EAKjE,iEAAiE,EAQjE,kEAAkE,EAalE,6DAA6D,EAE7D,6DAA6D,EAO7D,8DAA8D,EAU9D,mEAAmE,EAGnE,mEAAmE,EAQnE,oEAAoE,EAiBpE,+DAA+D,EAE/D,+DAA+D,EAM/D,gEAAgE,EAOhE,8DAA8D,EAK9D,8DAA8D,EAW9D,+DAA+D,EAW/D,mEAAmE,EAGnE,mEAAmE,EAKnE,oEAAoE,EAapE,0DAA0D,EAO1D,0DAA0D,EAG1D,2DAA2D,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