pasika 0.7.2 → 0.7.3

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.
@@ -4630,12 +4630,30 @@ var referenceBlockHeadingsRule = {
4630
4630
  };
4631
4631
 
4632
4632
  // eslint/rules/documentation/support-document-placement.ts
4633
+ import { existsSync as existsSync2 } from "fs";
4633
4634
  import path39 from "path";
4635
+ function checkPlacement(filename, kind) {
4636
+ const parentFolder = path39.basename(path39.dirname(filename));
4637
+ const expectedParent = `${kind}s`;
4638
+ if (parentFolder !== expectedParent) {
4639
+ return `${kind} lives in "${parentFolder}/" instead of "${expectedParent}/"`;
4640
+ }
4641
+ const guideFolderPath = path39.dirname(path39.dirname(filename));
4642
+ const guideFolder = path39.basename(guideFolderPath);
4643
+ if (!guideFolder.endsWith("-guide")) {
4644
+ return `${kind} owner folder "${guideFolder}/" does not use the "*-guide/" suffix`;
4645
+ }
4646
+ const entryPoint = `${guideFolder}.md`;
4647
+ if (!existsSync2(path39.join(guideFolderPath, entryPoint))) {
4648
+ return `${kind} owner folder "${guideFolder}/" has no "${entryPoint}" entry point`;
4649
+ }
4650
+ return void 0;
4651
+ }
4634
4652
  var supportDocumentPlacementRule = {
4635
4653
  meta: {
4636
4654
  type: "problem",
4637
4655
  docs: {
4638
- description: "Rules must live in rules/, references must live in references/.",
4656
+ description: "Rules and references must belong to a guide with a matching entry point.",
4639
4657
  recommended: true
4640
4658
  }
4641
4659
  },
@@ -4644,17 +4662,15 @@ var supportDocumentPlacementRule = {
4644
4662
  root(node) {
4645
4663
  const filename = getFilename(context);
4646
4664
  if (!filename.endsWith(".md")) return;
4647
- const parentFolder = path39.basename(path39.dirname(filename));
4648
- if (filename.endsWith("-rule.md") && parentFolder !== "rules") {
4649
- context.report({
4650
- node,
4651
- message: `rule lives in "${parentFolder}/" instead of "rules/"`
4652
- });
4653
- }
4654
- if (filename.endsWith("-reference.md") && parentFolder !== "references") {
4665
+ let kind;
4666
+ if (filename.endsWith("-rule.md")) kind = "rule";
4667
+ if (filename.endsWith("-reference.md")) kind = "reference";
4668
+ if (!kind) return;
4669
+ const message = checkPlacement(filename, kind);
4670
+ if (message) {
4655
4671
  context.report({
4656
4672
  node,
4657
- message: `reference lives in "${parentFolder}/" instead of "references/"`
4673
+ message
4658
4674
  });
4659
4675
  }
4660
4676
  }
@@ -5072,7 +5088,7 @@ var glossaryTermLinkingRule = {
5072
5088
  };
5073
5089
 
5074
5090
  // eslint/rules/documentation/guide-mentions-documents.ts
5075
- import { existsSync as existsSync2 } from "fs";
5091
+ import { existsSync as existsSync3 } from "fs";
5076
5092
  import path43 from "path";
5077
5093
  function visitSteps3(node, check) {
5078
5094
  if (node.type === "list" && node.ordered) {
@@ -5139,7 +5155,7 @@ var guideMentionsDocumentsRule = {
5139
5155
  const target = linkTarget(link.url);
5140
5156
  if (!target.endsWith(".md")) continue;
5141
5157
  const resolved = path43.normalize(path43.join(guideDir, target));
5142
- if (!existsSync2(resolved)) {
5158
+ if (!existsSync3(resolved)) {
5143
5159
  context.report({
5144
5160
  node: link,
5145
5161
  message: `Guide links a document that does not exist: ${link.url}`
@@ -6183,7 +6199,7 @@ var nextjsStackRule = {
6183
6199
  };
6184
6200
 
6185
6201
  // eslint/rules/package-json/vitest-coverage.ts
6186
- import { existsSync as existsSync3, readFileSync as readFileSync9 } from "fs";
6202
+ import { existsSync as existsSync4, readFileSync as readFileSync9 } from "fs";
6187
6203
  import path47 from "path";
6188
6204
  function memberName5(member) {
6189
6205
  return member.name.type === "String" ? member.name.value : member.name.name;
@@ -6253,7 +6269,7 @@ var vitestCoverageRule = {
6253
6269
  message: 'package.json must declare a "test:unit:coverage" script that runs Vitest with coverage.'
6254
6270
  });
6255
6271
  }
6256
- const configName = VITEST_CONFIG_NAMES.find((name) => existsSync3(path47.join(context.cwd, name)));
6272
+ const configName = VITEST_CONFIG_NAMES.find((name) => existsSync4(path47.join(context.cwd, name)));
6257
6273
  if (!configName) {
6258
6274
  context.report({
6259
6275
  node,
@@ -6308,7 +6324,7 @@ var nextjsPackageJsonRules = {
6308
6324
  };
6309
6325
 
6310
6326
  // eslint/rules/husky/husky-hook.ts
6311
- import { existsSync as existsSync4, readFileSync as readFileSync10 } from "fs";
6327
+ import { existsSync as existsSync5, readFileSync as readFileSync10 } from "fs";
6312
6328
  import path48 from "path";
6313
6329
  function memberName6(member) {
6314
6330
  return member.name.type === "String" ? member.name.value : member.name.name;
@@ -6328,7 +6344,7 @@ var huskyHookRule = {
6328
6344
  if (root.type !== "Object") return;
6329
6345
  if (!context.filename.endsWith("package.json")) return;
6330
6346
  const hookPath = path48.join(context.cwd, ".husky", "pre-commit");
6331
- if (!existsSync4(hookPath)) {
6347
+ if (!existsSync5(hookPath)) {
6332
6348
  context.report({
6333
6349
  node,
6334
6350
  message: "No .husky/pre-commit hook found. Configure husky to run checks before commits."
@@ -6354,7 +6370,7 @@ var huskyHookRule = {
6354
6370
  context.report({ node, message: ".husky/pre-commit must run npx libyear --limit-major-individual=1." });
6355
6371
  }
6356
6372
  const suppressionsPath = path48.join(context.cwd, "eslint-suppressions.json");
6357
- if (existsSync4(suppressionsPath)) {
6373
+ if (existsSync5(suppressionsPath)) {
6358
6374
  requireNamedScript("lint:prune");
6359
6375
  }
6360
6376
  if (scripts?.value.type === "Object") {
@@ -6377,7 +6393,7 @@ var huskyRules = {
6377
6393
  };
6378
6394
 
6379
6395
  // eslint/rules/vulyk/vulyk-docs.ts
6380
- import { existsSync as existsSync5, readFileSync as readFileSync11 } from "fs";
6396
+ import { existsSync as existsSync6, readFileSync as readFileSync11 } from "fs";
6381
6397
  import path49 from "path";
6382
6398
  var PASIKA_REPO = "Bredansky/pasika";
6383
6399
  var BASE_REQUIRED_DOCS = [
@@ -6413,7 +6429,7 @@ var vulykDocsRule = {
6413
6429
  if (root.type !== "Object") return;
6414
6430
  const projectRoot = path49.dirname(path49.resolve(context.filename));
6415
6431
  const configPath = path49.join(projectRoot, "vulyk.config.ts");
6416
- if (!existsSync5(configPath)) {
6432
+ if (!existsSync6(configPath)) {
6417
6433
  context.report({
6418
6434
  node,
6419
6435
  message: "No vulyk.config.ts found. Run npx vulyk@latest init to create one that tracks the framework's docs."
@@ -6438,7 +6454,7 @@ var vulykDocsRule = {
6438
6454
  }
6439
6455
  }
6440
6456
  const agentsPath = path49.join(projectRoot, "AGENTS.md");
6441
- if (!existsSync5(agentsPath)) {
6457
+ if (!existsSync6(agentsPath)) {
6442
6458
  context.report({
6443
6459
  node,
6444
6460
  message: "No AGENTS.md found. Run npx vulyk@latest agents to generate the agent file that routes to the tracked docs."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pasika",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Reusable agent setup package",
5
5
  "repository": {
6
6
  "type": "git",