pasika 0.6.0 → 0.6.1
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.d.ts +2 -0
- package/dist/eslint/pasika/index.js +107 -13
- package/package.json +2 -2
|
@@ -98,6 +98,7 @@ declare const documentationRules: {
|
|
|
98
98
|
"no-nested-how-to": _eslint_markdown.MarkdownRuleDefinition;
|
|
99
99
|
"glossary-term-linking": _eslint_markdown.MarkdownRuleDefinition;
|
|
100
100
|
"guide-mentions-documents": _eslint_markdown.MarkdownRuleDefinition;
|
|
101
|
+
"guide-section-shape": _eslint_markdown.MarkdownRuleDefinition;
|
|
101
102
|
};
|
|
102
103
|
|
|
103
104
|
declare const tailwindRules: {
|
|
@@ -186,6 +187,7 @@ declare const pasikaPlugin: {
|
|
|
186
187
|
"no-nested-how-to": _eslint_markdown.MarkdownRuleDefinition;
|
|
187
188
|
"glossary-term-linking": _eslint_markdown.MarkdownRuleDefinition;
|
|
188
189
|
"guide-mentions-documents": _eslint_markdown.MarkdownRuleDefinition;
|
|
190
|
+
"guide-section-shape": _eslint_markdown.MarkdownRuleDefinition;
|
|
189
191
|
"filename-case": eslint.Rule.RuleModule;
|
|
190
192
|
"import-boundaries": eslint.Rule.RuleModule;
|
|
191
193
|
"named-exports": eslint.Rule.RuleModule;
|
|
@@ -174,7 +174,9 @@ function findSimpleRoot(component, _text, _filename) {
|
|
|
174
174
|
};
|
|
175
175
|
visit(body);
|
|
176
176
|
const rendered = returns.filter((statement) => statement.expression?.kind !== ts.SyntaxKind.NullKeyword);
|
|
177
|
-
const roots = rendered.map(
|
|
177
|
+
const roots = rendered.map(
|
|
178
|
+
(statement) => statement.expression && ts.isExpression(statement.expression) ? rootFromExpression(statement.expression) : void 0
|
|
179
|
+
).filter((root) => root !== void 0);
|
|
178
180
|
if (roots.length !== rendered.length || roots.length === 0) return void 0;
|
|
179
181
|
const firstTag = roots[0]?.tagName;
|
|
180
182
|
if (roots.some((root) => root.tagName !== firstTag)) return void 0;
|
|
@@ -2302,7 +2304,17 @@ var NEXT_ROUTING_FILES3 = /* @__PURE__ */ new Set([
|
|
|
2302
2304
|
"sitemap",
|
|
2303
2305
|
"twitter-image"
|
|
2304
2306
|
]);
|
|
2305
|
-
var INTERACTIVE_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
2307
|
+
var INTERACTIVE_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
2308
|
+
"onClick",
|
|
2309
|
+
"onChange",
|
|
2310
|
+
"onSubmit",
|
|
2311
|
+
"href",
|
|
2312
|
+
"onKeyDown",
|
|
2313
|
+
"onKeyUp",
|
|
2314
|
+
"onFocus",
|
|
2315
|
+
"onBlur",
|
|
2316
|
+
"htmlFor"
|
|
2317
|
+
]);
|
|
2306
2318
|
function tagName(node) {
|
|
2307
2319
|
const name = node.openingElement?.name;
|
|
2308
2320
|
if (name?.type !== "JSXIdentifier") return void 0;
|
|
@@ -2375,7 +2387,9 @@ function isDecorative(node) {
|
|
|
2375
2387
|
return !meaningfulText && !isContentElement(name);
|
|
2376
2388
|
}
|
|
2377
2389
|
function isContentElement(name) {
|
|
2378
|
-
return /^(?:h[1-6]|p|li|dt|dd|blockquote|pre|code|figcaption|caption|th|td|form|fieldset|select|textarea)$/.test(
|
|
2390
|
+
return /^(?:h[1-6]|p|li|dt|dd|blockquote|pre|code|figcaption|caption|th|td|form|fieldset|select|textarea)$/.test(
|
|
2391
|
+
name
|
|
2392
|
+
);
|
|
2379
2393
|
}
|
|
2380
2394
|
function isSoleContentOfWrapper(node) {
|
|
2381
2395
|
const parent = node.parent;
|
|
@@ -4153,7 +4167,7 @@ var overviewRule = {
|
|
|
4153
4167
|
meta: {
|
|
4154
4168
|
type: "problem",
|
|
4155
4169
|
docs: {
|
|
4156
|
-
description: "
|
|
4170
|
+
description: "Required documentation overviews must exist, contain at most two sentences, and not link to other documents.",
|
|
4157
4171
|
recommended: true
|
|
4158
4172
|
}
|
|
4159
4173
|
},
|
|
@@ -4196,6 +4210,41 @@ var overviewRule = {
|
|
|
4196
4210
|
if (!found) {
|
|
4197
4211
|
context.report({ node, message: "no overview follows the title" });
|
|
4198
4212
|
}
|
|
4213
|
+
const validateHeadedOverview = (heading, index, label) => {
|
|
4214
|
+
const overview = node.children[index + 1];
|
|
4215
|
+
if (overview?.type !== "paragraph") {
|
|
4216
|
+
context.report({
|
|
4217
|
+
node: heading,
|
|
4218
|
+
message: `no overview follows ${label}`
|
|
4219
|
+
});
|
|
4220
|
+
return;
|
|
4221
|
+
}
|
|
4222
|
+
if (containsLink(overview)) {
|
|
4223
|
+
context.report({
|
|
4224
|
+
node: overview,
|
|
4225
|
+
message: `overview of ${label} links another document`
|
|
4226
|
+
});
|
|
4227
|
+
}
|
|
4228
|
+
const sectionSentenceCount = countSentences(getTextContent(overview).trim());
|
|
4229
|
+
if (sectionSentenceCount > 2) {
|
|
4230
|
+
context.report({
|
|
4231
|
+
node: overview,
|
|
4232
|
+
message: `overview of ${label} uses ${String(sectionSentenceCount)} sentences, at most two are allowed`
|
|
4233
|
+
});
|
|
4234
|
+
}
|
|
4235
|
+
};
|
|
4236
|
+
const isGuide = filename.endsWith("-guide.md");
|
|
4237
|
+
const isReference = filename.endsWith("-reference.md");
|
|
4238
|
+
if (!isGuide && !isReference) return;
|
|
4239
|
+
for (const [index, child] of node.children.entries()) {
|
|
4240
|
+
if (child.type !== "heading" || child.depth === 1) continue;
|
|
4241
|
+
const title = getTextContent(child).trim();
|
|
4242
|
+
if (isGuide && child.depth === 2 && /^How To \S/.test(title)) {
|
|
4243
|
+
validateHeadedOverview(child, index, `guide section "${title}"`);
|
|
4244
|
+
} else if (isReference) {
|
|
4245
|
+
validateHeadedOverview(child, index, `reference block "${title}"`);
|
|
4246
|
+
}
|
|
4247
|
+
}
|
|
4199
4248
|
}
|
|
4200
4249
|
};
|
|
4201
4250
|
}
|
|
@@ -5049,6 +5098,56 @@ var guideMentionsDocumentsRule = {
|
|
|
5049
5098
|
}
|
|
5050
5099
|
};
|
|
5051
5100
|
|
|
5101
|
+
// eslint/rules/documentation/guide-section-shape.ts
|
|
5102
|
+
var guideSectionShapeRule = {
|
|
5103
|
+
meta: {
|
|
5104
|
+
type: "problem",
|
|
5105
|
+
docs: {
|
|
5106
|
+
description: "Guide sections use How To headings, an overview, and numbered steps.",
|
|
5107
|
+
recommended: true
|
|
5108
|
+
}
|
|
5109
|
+
},
|
|
5110
|
+
create(context) {
|
|
5111
|
+
return {
|
|
5112
|
+
root(node) {
|
|
5113
|
+
if (!getFilename(context).endsWith("-guide.md")) return;
|
|
5114
|
+
const sections = [];
|
|
5115
|
+
for (const [index, child] of node.children.entries()) {
|
|
5116
|
+
if (child.type !== "heading" || child.depth === 1) continue;
|
|
5117
|
+
sections.push({ heading: child, index, title: getTextContent(child).trim() });
|
|
5118
|
+
}
|
|
5119
|
+
if (sections.length === 0) {
|
|
5120
|
+
context.report({ node, message: "guide must contain at least one How To section" });
|
|
5121
|
+
return;
|
|
5122
|
+
}
|
|
5123
|
+
for (const [sectionIndex, section] of sections.entries()) {
|
|
5124
|
+
if (section.heading.depth !== 2) {
|
|
5125
|
+
context.report({
|
|
5126
|
+
node: section.heading,
|
|
5127
|
+
message: `guide section heading "${section.title}" must be level two`
|
|
5128
|
+
});
|
|
5129
|
+
}
|
|
5130
|
+
if (!/^How To \S/.test(section.title)) {
|
|
5131
|
+
context.report({
|
|
5132
|
+
node: section.heading,
|
|
5133
|
+
message: `guide section heading "${section.title}" must start with "How To "`
|
|
5134
|
+
});
|
|
5135
|
+
}
|
|
5136
|
+
const nextSection = sections[sectionIndex + 1];
|
|
5137
|
+
const content = node.children.slice(section.index + 1, nextSection?.index ?? node.children.length);
|
|
5138
|
+
const hasOverviewThenNumberedList = content.length === 2 && content[0]?.type === "paragraph" && content[1]?.type === "list" && content[1].ordered === true;
|
|
5139
|
+
if (!hasOverviewThenNumberedList) {
|
|
5140
|
+
context.report({
|
|
5141
|
+
node: section.heading,
|
|
5142
|
+
message: `guide section "${section.title}" must consist of its overview followed by one numbered list`
|
|
5143
|
+
});
|
|
5144
|
+
}
|
|
5145
|
+
}
|
|
5146
|
+
}
|
|
5147
|
+
};
|
|
5148
|
+
}
|
|
5149
|
+
};
|
|
5150
|
+
|
|
5052
5151
|
// eslint/rules/documentation/index.ts
|
|
5053
5152
|
var documentationRules = {
|
|
5054
5153
|
"doc-kind-suffix": docKindSuffixRule,
|
|
@@ -5073,7 +5172,8 @@ var documentationRules = {
|
|
|
5073
5172
|
"guide-link-anchors": guideLinkAnchorsRule,
|
|
5074
5173
|
"no-nested-how-to": noNestedHowToRule,
|
|
5075
5174
|
"glossary-term-linking": glossaryTermLinkingRule,
|
|
5076
|
-
"guide-mentions-documents": guideMentionsDocumentsRule
|
|
5175
|
+
"guide-mentions-documents": guideMentionsDocumentsRule,
|
|
5176
|
+
"guide-section-shape": guideSectionShapeRule
|
|
5077
5177
|
};
|
|
5078
5178
|
|
|
5079
5179
|
// eslint/rules/tailwind/helpers.ts
|
|
@@ -6374,9 +6474,7 @@ var tailwindStructureRules = {
|
|
|
6374
6474
|
},
|
|
6375
6475
|
language: "css/css",
|
|
6376
6476
|
languageOptions: { tolerant: true },
|
|
6377
|
-
rules: Object.fromEntries(
|
|
6378
|
-
tailwindRuleIds.filter((id) => id !== "pasika/css-entry-point").map((id) => [id, "error"])
|
|
6379
|
-
)
|
|
6477
|
+
rules: Object.fromEntries(tailwindRuleIds.filter((id) => id !== "pasika/css-entry-point").map((id) => [id, "error"]))
|
|
6380
6478
|
};
|
|
6381
6479
|
var tailwindImportGraph = {
|
|
6382
6480
|
files: ["src/**/*.css"],
|
|
@@ -6424,11 +6522,7 @@ var documentationConfig = {
|
|
|
6424
6522
|
language: "markdown/gfm",
|
|
6425
6523
|
rules: Object.fromEntries(documentationRuleIds.map((id) => [id, "error"]))
|
|
6426
6524
|
};
|
|
6427
|
-
var pasikaApp = [
|
|
6428
|
-
pasikaAppPackageJsonConfig,
|
|
6429
|
-
zirkaConfig,
|
|
6430
|
-
documentationConfig
|
|
6431
|
-
];
|
|
6525
|
+
var pasikaApp = [pasikaAppPackageJsonConfig, zirkaConfig, documentationConfig];
|
|
6432
6526
|
var pasikaNextjsAppWithDiagnostic = (preset) => {
|
|
6433
6527
|
let checked = false;
|
|
6434
6528
|
return new Proxy(preset, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pasika",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Reusable agent setup package",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"tsx": "4.23.12",
|
|
63
63
|
"typescript": "6.0.3",
|
|
64
64
|
"vitest": "5.0.0",
|
|
65
|
-
"zirka": "0.0.
|
|
65
|
+
"zirka": "0.0.65",
|
|
66
66
|
"zod": "4.4.3"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|