pasika 0.5.1 → 0.5.2
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/dist/eslint/pasika/index.js +30 -1
- package/package.json +1 -1
|
@@ -5725,18 +5725,37 @@ var huskyRules = {
|
|
|
5725
5725
|
import { existsSync as existsSync3, readFileSync as readFileSync9 } from "fs";
|
|
5726
5726
|
import path46 from "path";
|
|
5727
5727
|
var PASIKA_REPO = "Bredansky/pasika";
|
|
5728
|
+
var BASE_REQUIRED_DOCS = [
|
|
5729
|
+
{ name: "documentation-guide", path: "docs/documentation-guide" },
|
|
5730
|
+
{ name: "framework-adoption-guide", path: "docs/framework-adoption-guide" },
|
|
5731
|
+
{ name: "repository-policy", path: "docs/repository-policy.md" }
|
|
5732
|
+
];
|
|
5733
|
+
var NEXTJS_REQUIRED_DOCS = [
|
|
5734
|
+
{ name: "code-organization-guide", path: "docs/code-organization-guide" },
|
|
5735
|
+
{ name: "styling-guide", path: "docs/styling-guide" }
|
|
5736
|
+
];
|
|
5737
|
+
function memberName5(member) {
|
|
5738
|
+
return member.name.type === "String" ? member.name.value : member.name.name;
|
|
5739
|
+
}
|
|
5740
|
+
function hasDependency(root, name) {
|
|
5741
|
+
const section = root.members.find((member) => memberName5(member) === "dependencies");
|
|
5742
|
+
if (section?.value.type !== "Object") return false;
|
|
5743
|
+
return section.value.members.some((member) => memberName5(member) === name);
|
|
5744
|
+
}
|
|
5728
5745
|
var vulykDocsRule = {
|
|
5729
5746
|
meta: {
|
|
5730
5747
|
schema: [],
|
|
5731
5748
|
type: "problem",
|
|
5732
5749
|
docs: {
|
|
5733
|
-
description: "Require vulyk.config.ts to track the framework's docs from pasika and the generated AGENTS.md."
|
|
5750
|
+
description: "Require vulyk.config.ts to track the framework's required docs from pasika and the generated AGENTS.md."
|
|
5734
5751
|
}
|
|
5735
5752
|
},
|
|
5736
5753
|
create(context) {
|
|
5737
5754
|
return {
|
|
5738
5755
|
Document(node) {
|
|
5739
5756
|
if (!context.filename.endsWith("package.json")) return;
|
|
5757
|
+
const root = node.body;
|
|
5758
|
+
if (root.type !== "Object") return;
|
|
5740
5759
|
const projectRoot = path46.dirname(path46.resolve(context.filename));
|
|
5741
5760
|
const configPath = path46.join(projectRoot, "vulyk.config.ts");
|
|
5742
5761
|
if (!existsSync3(configPath)) {
|
|
@@ -5752,6 +5771,16 @@ var vulykDocsRule = {
|
|
|
5752
5771
|
node,
|
|
5753
5772
|
message: "vulyk.config.ts must track the framework's docs from the pasika repository."
|
|
5754
5773
|
});
|
|
5774
|
+
return;
|
|
5775
|
+
}
|
|
5776
|
+
const requiredDocs = hasDependency(root, "next") ? [...BASE_REQUIRED_DOCS, ...NEXTJS_REQUIRED_DOCS] : BASE_REQUIRED_DOCS;
|
|
5777
|
+
for (const doc of requiredDocs) {
|
|
5778
|
+
if (!config.includes(doc.path)) {
|
|
5779
|
+
context.report({
|
|
5780
|
+
node,
|
|
5781
|
+
message: `vulyk.config.ts must track the framework's ${doc.name} docs from pasika (${PASIKA_REPO}/${doc.path}).`
|
|
5782
|
+
});
|
|
5783
|
+
}
|
|
5755
5784
|
}
|
|
5756
5785
|
const agentsPath = path46.join(projectRoot, "AGENTS.md");
|
|
5757
5786
|
if (!existsSync3(agentsPath)) {
|