paperlint 6.2.3 → 7.0.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.
- package/CONTRIBUTING.md +4 -2
- package/README.md +10 -3
- package/dist/adapters/hotcrp/index.d.ts +7 -0
- package/dist/adapters/hotcrp/index.d.ts.map +1 -0
- package/dist/adapters/hotcrp/index.js +7 -0
- package/dist/adapters/hotcrp/index.js.map +1 -0
- package/dist/adapters/hotcrp/portal.io.d.ts +20 -0
- package/dist/adapters/hotcrp/portal.io.d.ts.map +1 -0
- package/dist/adapters/hotcrp/portal.io.js +90 -0
- package/dist/adapters/hotcrp/portal.io.js.map +1 -0
- package/dist/adapters/hotcrp/response.d.ts +13 -0
- package/dist/adapters/hotcrp/response.d.ts.map +1 -0
- package/dist/adapters/hotcrp/response.js +138 -0
- package/dist/adapters/hotcrp/response.js.map +1 -0
- package/dist/adapters/latex/conditionals.d.ts +21 -0
- package/dist/adapters/latex/conditionals.d.ts.map +1 -0
- package/dist/adapters/latex/conditionals.js +75 -0
- package/dist/adapters/latex/conditionals.js.map +1 -0
- package/dist/adapters/latex/headings.d.ts +10 -0
- package/dist/adapters/latex/headings.d.ts.map +1 -0
- package/dist/adapters/latex/headings.js +129 -0
- package/dist/adapters/latex/headings.js.map +1 -0
- package/dist/adapters/latex/index.d.ts +1 -0
- package/dist/adapters/latex/index.d.ts.map +1 -1
- package/dist/adapters/latex/index.js +3 -0
- package/dist/adapters/latex/index.js.map +1 -1
- package/dist/adapters/latex/parse.d.ts +1 -1
- package/dist/adapters/latex/parse.d.ts.map +1 -1
- package/dist/adapters/latex/parse.js +3 -2
- package/dist/adapters/latex/parse.js.map +1 -1
- package/dist/build.d.ts +1 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +1 -1
- package/dist/build.js.map +1 -1
- package/dist/cli.d.ts +4 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +126 -37
- package/dist/cli.js.map +1 -1
- package/dist/domain/heading-case.d.ts +100 -0
- package/dist/domain/heading-case.d.ts.map +1 -0
- package/dist/domain/heading-case.js +365 -0
- package/dist/domain/heading-case.js.map +1 -0
- package/dist/domain/result.d.ts +4 -0
- package/dist/domain/result.d.ts.map +1 -1
- package/dist/domain/result.js +2 -0
- package/dist/domain/result.js.map +1 -1
- package/dist/domain/submission.d.ts +106 -0
- package/dist/domain/submission.d.ts.map +1 -0
- package/dist/domain/submission.js +39 -0
- package/dist/domain/submission.js.map +1 -0
- package/dist/domain/tex-document.d.ts +32 -0
- package/dist/domain/tex-document.d.ts.map +1 -1
- package/dist/domain/tex-document.js +11 -0
- package/dist/domain/tex-document.js.map +1 -1
- package/dist/domain/venue-name.d.ts +38 -0
- package/dist/domain/venue-name.d.ts.map +1 -0
- package/dist/domain/venue-name.js +71 -0
- package/dist/domain/venue-name.js.map +1 -0
- package/dist/eslint-rules/latex-language.d.ts.map +1 -1
- package/dist/eslint-rules/latex-language.js +16 -3
- package/dist/eslint-rules/latex-language.js.map +1 -1
- package/dist/facts-file.d.ts +3 -3
- package/dist/facts-file.d.ts.map +1 -1
- package/dist/facts-file.js +3 -3
- package/dist/facts-file.js.map +1 -1
- package/dist/folder-venue-rule.d.ts +51 -0
- package/dist/folder-venue-rule.d.ts.map +1 -0
- package/dist/folder-venue-rule.js +96 -0
- package/dist/folder-venue-rule.js.map +1 -0
- package/dist/heading-case.d.ts +48 -0
- package/dist/heading-case.d.ts.map +1 -0
- package/dist/heading-case.js +191 -0
- package/dist/heading-case.js.map +1 -0
- package/dist/init.d.ts +6 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +3 -3
- package/dist/init.js.map +1 -1
- package/dist/lib/paper-config.d.ts.map +1 -1
- package/dist/lib/paper-config.js +5 -1
- package/dist/lib/paper-config.js.map +1 -1
- package/dist/new-paper.d.ts +19 -5
- package/dist/new-paper.d.ts.map +1 -1
- package/dist/new-paper.js +23 -4
- package/dist/new-paper.js.map +1 -1
- package/dist/paper-settings.d.ts +3 -0
- package/dist/paper-settings.d.ts.map +1 -1
- package/dist/paper-settings.js +20 -4
- package/dist/paper-settings.js.map +1 -1
- package/dist/ports/latex.d.ts +7 -1
- package/dist/ports/latex.d.ts.map +1 -1
- package/dist/ports/submission-portal.d.ts +19 -0
- package/dist/ports/submission-portal.d.ts.map +1 -0
- package/dist/ports/submission-portal.js +2 -0
- package/dist/ports/submission-portal.js.map +1 -0
- package/dist/preset-card-rule.d.ts +100 -0
- package/dist/preset-card-rule.d.ts.map +1 -0
- package/dist/preset-card-rule.js +221 -0
- package/dist/preset-card-rule.js.map +1 -0
- package/dist/presets.d.ts +43 -2
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +130 -63
- package/dist/presets.js.map +1 -1
- package/dist/rules-config.js +1 -1
- package/dist/submission.d.ts +61 -0
- package/dist/submission.d.ts.map +1 -0
- package/dist/submission.js +211 -0
- package/dist/submission.js.map +1 -0
- package/dist/tex-requirements.d.ts +36 -3
- package/dist/tex-requirements.d.ts.map +1 -1
- package/dist/tex-requirements.js +30 -2
- package/dist/tex-requirements.js.map +1 -1
- package/dist/tex-venue-rules.d.ts +7 -8
- package/dist/tex-venue-rules.d.ts.map +1 -1
- package/dist/tex-venue-rules.js +10 -14
- package/dist/tex-venue-rules.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/configuration.md +30 -11
- package/docs/optional-rules.md +4 -3
- package/docs/rules/format/page-limit.md +1 -1
- package/docs/rules/paper/folder-venue-leftover.md +104 -0
- package/docs/rules/talk/captions-cover.md +1 -1
- package/docs/rules/talk/duration-floor.md +1 -1
- package/docs/rules/talk/profile.md +1 -1
- package/docs/rules/tex/heading-case.md +424 -0
- package/docs/rules.md +64 -53
- package/docs/skills.md +5 -4
- package/docs/submission.md +64 -0
- package/docs/talk.md +1 -1
- package/eslint-rules/latex-language.test.mjs +12 -0
- package/eslint-rules/latex-language.ts +17 -4
- package/eslint-rules/paper-typography.test.mjs +12 -0
- package/eslint.config.mjs +59 -1
- package/fixtures/build-e2e/acmart/paper.tex +1 -1
- package/fixtures/build-e2e/fallback/expect.json +3 -3
- package/lib/paper-config.ts +6 -1
- package/lib/skill-checks.d.mts +7 -0
- package/lib/skill-checks.mjs +31 -0
- package/lib/skill-trigger-cases.mjs +11 -0
- package/package.json +8 -2
- package/presets/acm-sigconf.jsonc +5 -0
- package/presets/acm-sigconf.md +43 -0
- package/presets/agenticdev.jsonc +27 -6
- package/presets/agenticdev.md +151 -0
- package/presets/aidc.jsonc +12 -0
- package/presets/aidc.md +75 -0
- package/presets/aisec.jsonc +5 -1
- package/presets/aisec.md +117 -0
- package/presets/ieee-conference.jsonc +5 -0
- package/presets/ieee-conference.md +38 -0
- package/presets/realm.jsonc +7 -2
- package/presets/realm.md +166 -0
- package/presets/tex/agenticdev.tex +1 -1
- package/presets/tex-base.jsonc +6 -0
- package/presets/tex-base.md +30 -0
- package/presets/venue-profile.schema.json +57 -2
- package/skills/find-venue/SKILL.md +6 -5
- package/skills/find-venue/SKILL.md.spec.ts +5 -4
- package/skills/paper-pipeline/SKILL.md +5 -6
- package/skills/paper-pipeline/SKILL.md.spec.ts +4 -5
- package/skills/paper-pipeline/paper-pipeline.harness.mjs +4 -0
- package/skills/paper-pipeline/references/acl-venue-rules.md +1 -1
- package/skills/study-accepted-papers/SKILL.md +3 -3
- package/skills/study-accepted-papers/SKILL.md.spec.ts +2 -2
- package/skills/submission-portal/SKILL.md +69 -0
- package/skills/submission-portal/SKILL.md.spec.ts +71 -0
- package/skills/submission-portal/submission-portal.eval.mjs +15 -0
- package/skills/submission-portal/submission-portal.test.ts +81 -0
- package/skills/submit-paper/SKILL.md +27 -22
- package/skills/submit-paper/SKILL.md.spec.ts +26 -21
- package/skills/submit-paper/references/publishers/acm.md +1 -1
- package/src/adapters/hotcrp/cassette/README.md +24 -0
- package/src/adapters/hotcrp/cassette/get-noauth.json +10 -0
- package/src/adapters/hotcrp/cassette/get-paper.json +39 -0
- package/src/adapters/hotcrp/cassette/post-dot.json +21 -0
- package/src/adapters/hotcrp/cassette/post-ok.json +12 -0
- package/src/adapters/hotcrp/index.ts +11 -0
- package/src/adapters/hotcrp/portal.io.ts +130 -0
- package/src/adapters/hotcrp/portal.test.ts +503 -0
- package/src/adapters/hotcrp/response.ts +181 -0
- package/src/adapters/latex/conditionals.ts +130 -0
- package/src/adapters/latex/headings.ts +163 -0
- package/src/adapters/latex/index.test.ts +65 -0
- package/src/adapters/latex/index.ts +3 -0
- package/src/adapters/latex/parse.ts +3 -2
- package/src/build.ts +2 -2
- package/src/cli.test.ts +155 -3
- package/src/cli.ts +161 -25
- package/src/domain/heading-case.test.ts +660 -0
- package/src/domain/heading-case.ts +538 -0
- package/src/domain/result.test.ts +9 -1
- package/src/domain/result.ts +5 -0
- package/src/domain/submission.test.ts +45 -0
- package/src/domain/submission.ts +141 -0
- package/src/domain/tex-document.ts +36 -0
- package/src/domain/venue-name.test.ts +121 -0
- package/src/domain/venue-name.ts +129 -0
- package/src/facts-file.test.ts +4 -4
- package/src/facts-file.ts +6 -6
- package/src/folder-venue-rule.test.ts +182 -0
- package/src/folder-venue-rule.ts +141 -0
- package/src/heading-case.test.ts +500 -0
- package/src/heading-case.ts +275 -0
- package/src/init.test.ts +22 -0
- package/src/init.ts +9 -2
- package/src/new-paper.harness.mjs +11 -9
- package/src/new-paper.test.ts +135 -10
- package/src/new-paper.ts +38 -7
- package/src/paper-settings-commands.test.ts +25 -10
- package/src/paper-settings.test.ts +12 -1
- package/src/paper-settings.ts +25 -5
- package/src/parse-args.test.ts +19 -0
- package/src/ports/latex.ts +7 -0
- package/src/ports/submission-portal.ts +26 -0
- package/src/preset-card-rule.test.ts +266 -0
- package/src/preset-card-rule.ts +384 -0
- package/src/presets.test.ts +212 -37
- package/src/presets.ts +183 -71
- package/src/rule-cases.test.ts +147 -42
- package/src/rules-config.ts +1 -1
- package/src/submission.test.ts +497 -0
- package/src/submission.ts +311 -0
- package/src/talk-rules.test.ts +6 -3
- package/src/tex-requirements.harness.ts +25 -11
- package/src/tex-requirements.test.ts +127 -1
- package/src/tex-requirements.ts +78 -8
- package/src/tex-venue-rules.test.ts +36 -22
- package/src/tex-venue-rules.ts +14 -26
- package/src/types.ts +13 -0
- package/src/venue-rules.test.ts +7 -6
- package/templates/paper/paper.tex +1 -1
- package/skills/submit-paper/references/venues/agenticdev.md +0 -171
- package/skills/submit-paper/references/venues/aisec.md +0 -105
- package/skills/submit-paper/references/venues/realm.md +0 -155
package/dist/paper-settings.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type Result } from "./domain/result.ts";
|
|
|
2
2
|
import type { Files } from "./ports/files.ts";
|
|
3
3
|
import { type Parsed, type RuleEntry } from "./rules-config.ts";
|
|
4
4
|
import { type PaperTalk } from "./domain/talk.ts";
|
|
5
|
+
import { type PaperSubmission } from "./domain/submission.ts";
|
|
5
6
|
/** What one paper declares. Every absent field is null. */
|
|
6
7
|
export interface PaperSettings {
|
|
7
8
|
/** The venue preset the paper is judged against: `paperlint:<name>` or a relative path. */
|
|
@@ -23,6 +24,8 @@ export interface PaperSettings {
|
|
|
23
24
|
readonly identity: readonly string[] | null;
|
|
24
25
|
/** How this paper is presented (`talk/*`); null when it declares no talk. Never the root's. */
|
|
25
26
|
readonly talk: PaperTalk | null;
|
|
27
|
+
/** Which submission on the venue's portal is this paper's; null when it says none. Never the root's. */
|
|
28
|
+
readonly submission: PaperSubmission | null;
|
|
26
29
|
}
|
|
27
30
|
/** Why a paper's settings cannot be read. */
|
|
28
31
|
export type SettingsProblem = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paper-settings.d.ts","sourceRoot":"","sources":["../src/paper-settings.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAEL,KAAK,MAAM,EACX,KAAK,SAAS,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AA;CAAE,CAAC;AAGhF,QAAA,MAAM,aAAa,qCAAsC,CAAC;AAkB1D,uGAAuG;AACvG,wBAAgB,YAAY,CAC1B,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACnC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAYrE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACnC,MAAM,CAAC,SAAS,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,CAS1C;AAuBD,kGAAkG;AAClG,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,OAAO,GACZ,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAmB/B;AA8CD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,MAAM,GACf,MAAM,CAAC,aAAa,GAAG,IAAI,EAAE,eAAe,CAAC,CAS/C;AA6CD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAC3B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC,CAK1C"}
|
package/dist/paper-settings.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* One file name at two levels, one schema (lib/paper-config.mjs → SETTINGS_KEYS):
|
|
5
5
|
*
|
|
6
6
|
* paperlint.json the project (optional): papersDir, rules, defaults
|
|
7
|
-
* <paper>/paperlint.json this paper: { extends, kind, pdf, rules }
|
|
7
|
+
* <paper>/paperlint.json this paper: { extends, kind, pdf, rules, identity, talk, submission }
|
|
8
8
|
* a venue preset `paperlint:<name>` (shipped) or `./x.jsonc` (src/presets.ts)
|
|
9
9
|
*
|
|
10
10
|
* The paper's `extends`, `kind` and `pdf` win over the root's; with no own value, the root's is
|
|
@@ -22,6 +22,7 @@ import { err, ok } from "./domain/result.js";
|
|
|
22
22
|
import { parseRuleEntries, } from "./rules-config.js";
|
|
23
23
|
import { messageOf } from "./domain/text.js";
|
|
24
24
|
import { parsePaperTalk } from "./domain/talk.js";
|
|
25
|
+
import { parsePaperSubmission, } from "./domain/submission.js";
|
|
25
26
|
const KNOWN = Object.keys(SETTINGS_KEYS);
|
|
26
27
|
const STRING_FIELDS = ["extends", "kind", "pdf"];
|
|
27
28
|
const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
@@ -63,13 +64,22 @@ export function identityField(d) {
|
|
|
63
64
|
? ok(v.filter((x) => typeof x === "string"))
|
|
64
65
|
: err(`"identity" must be a list of strings, each with a letter or digit, got ${JSON.stringify(v)}`);
|
|
65
66
|
}
|
|
66
|
-
/** `rules` (checked for shape only) and `
|
|
67
|
+
/** `rules` (checked for shape only), `talk` and `submission`, each null when absent. */
|
|
67
68
|
function rulesAndTalk(json) {
|
|
68
69
|
const rules = json["rules"];
|
|
69
70
|
if (rules !== undefined && !isObject(rules) && !Array.isArray(rules))
|
|
70
71
|
return err(`"rules" must be an object of rule id → severity, or a list of ESLint blocks`);
|
|
71
72
|
const talk = parsePaperTalk(json["talk"]);
|
|
72
|
-
|
|
73
|
+
if (!talk.ok)
|
|
74
|
+
return talk;
|
|
75
|
+
const submission = parsePaperSubmission(json["submission"]);
|
|
76
|
+
return submission.ok
|
|
77
|
+
? ok({
|
|
78
|
+
rules: rules ?? null,
|
|
79
|
+
talk: talk.value,
|
|
80
|
+
submission: submission.value,
|
|
81
|
+
})
|
|
82
|
+
: submission;
|
|
73
83
|
}
|
|
74
84
|
/** The parsed JSON of `paperlint.json` → the settings, or one line saying what is wrong. Pure. */
|
|
75
85
|
export function parsePaperSettings(json) {
|
|
@@ -157,7 +167,12 @@ const joined = (a, b) => a === null && b === null ? null : [...new Set([...(a ??
|
|
|
157
167
|
/** The paper's own values win; each absent one falls back to the root's. */
|
|
158
168
|
function merge(root, paper) {
|
|
159
169
|
const r = root ?? NO_DEFAULTS;
|
|
160
|
-
const p = paper ?? {
|
|
170
|
+
const p = paper ?? {
|
|
171
|
+
...NO_DEFAULTS,
|
|
172
|
+
rules: null,
|
|
173
|
+
talk: null,
|
|
174
|
+
submission: null,
|
|
175
|
+
};
|
|
161
176
|
const merged = {
|
|
162
177
|
extends: p.extends ?? r.extends,
|
|
163
178
|
kind: p.kind ?? r.kind,
|
|
@@ -165,6 +180,7 @@ function merge(root, paper) {
|
|
|
165
180
|
rules: p.rules,
|
|
166
181
|
identity: joined(r.identity, p.identity),
|
|
167
182
|
talk: p.talk,
|
|
183
|
+
submission: p.submission,
|
|
168
184
|
};
|
|
169
185
|
return paper === null && Object.values(merged).every((v) => v === null)
|
|
170
186
|
? null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paper-settings.js","sourceRoot":"","sources":["../src/paper-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EACL,gBAAgB,GAGjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAkB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"paper-settings.js","sourceRoot":"","sources":["../src/paper-settings.ts"],"names":[],"mappings":"AAAA;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
|
|
5
5
|
import type { Include } from "../domain/paper-source.ts";
|
|
6
|
-
import type { ClassLine, DocumentClass, Emphasis, LayoutOverride, Outline, Passage, Span, TextRun } from "../domain/tex-document.ts";
|
|
6
|
+
import type { ClassLine, DocumentClass, Emphasis, LayoutOverride, Outline, Passage, Span, TextRun, TitledHeading } from "../domain/tex-document.ts";
|
|
7
7
|
export interface LatexReader {
|
|
8
8
|
/** The source's `\documentclass`, as one of its states. */
|
|
9
9
|
readonly documentClass: (src: string) => ClassLine;
|
|
10
10
|
/** Its sections, where the back matter begins, and where the document ends. */
|
|
11
11
|
readonly outline: (src: string) => Outline;
|
|
12
|
+
/**
|
|
13
|
+
* Its `\title` and the titles of its `\section`, `\subsection`, `\subsubsection`, `\paragraph`
|
|
14
|
+
* and `\subparagraph` (starred or not, and each optional short title), each as the text the case
|
|
15
|
+
* judge reads: in document order.
|
|
16
|
+
*/
|
|
17
|
+
readonly headings: (src: string) => readonly TitledHeading[];
|
|
12
18
|
/** The text a reader sees: prose, the author block, footnotes — not comments, keys, math, code. */
|
|
13
19
|
readonly renderedRuns: (src: string) => readonly TextRun[];
|
|
14
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"latex.d.ts","sourceRoot":"","sources":["../../src/ports/latex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,QAAQ,EACR,cAAc,EACd,OAAO,EACP,OAAO,EACP,IAAI,EACJ,OAAO,
|
|
1
|
+
{"version":3,"file":"latex.d.ts","sourceRoot":"","sources":["../../src/ports/latex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,QAAQ,EACR,cAAc,EACd,OAAO,EACP,OAAO,EACP,IAA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
|
+
* A conference portal holding a paper's submission — the port `paperlint submission` talks through.
|
|
3
|
+
* Shaped by what the command needs (read one submission, send one change), not by any portal's API;
|
|
4
|
+
* one adapter per portal kind (`src/adapters/hotcrp/`).
|
|
5
|
+
*/
|
|
6
|
+
import type { Result } from "../domain/result.ts";
|
|
7
|
+
import type { PortalFailure, SubmissionChange, SubmissionView, UpdateOutcome } from "../domain/submission.ts";
|
|
8
|
+
export interface SubmissionPortal {
|
|
9
|
+
/** The submission as the portal holds it now. */
|
|
10
|
+
show(id: number): Promise<Result<SubmissionView, PortalFailure>>;
|
|
11
|
+
/**
|
|
12
|
+
* Send a change. Without `save` the portal only checks it (a dry run) and keeps nothing; an
|
|
13
|
+
* answer the portal gave — valid or not — is an outcome, not a failure.
|
|
14
|
+
*/
|
|
15
|
+
update(id: number, change: SubmissionChange, o: {
|
|
16
|
+
readonly save: boolean;
|
|
17
|
+
}): Promise<Result<UpdateOutcome, PortalFailure>>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=submission-portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submission-portal.d.ts","sourceRoot":"","sources":["../../src/ports/submission-portal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC;IACjE;;;OAGG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,gBAAgB,EACxB,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;KAAE,GAC5B,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submission-portal.js","sourceRoot":"","sources":["../../src/ports/submission-portal.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { Files } from "./ports/files.ts";
|
|
2
|
+
import { type Preset } from "./presets.ts";
|
|
3
|
+
/** The first line of the generated section. */
|
|
4
|
+
export declare const SECTION_START = "<!-- paperlint:preset-rules -->";
|
|
5
|
+
/** The last line of the generated section. */
|
|
6
|
+
export declare const SECTION_END = "<!-- /paperlint:preset-rules -->";
|
|
7
|
+
export interface PresetCardDeps {
|
|
8
|
+
readonly files: Files;
|
|
9
|
+
/** The shipped presets and their schema: where `paperlint:<name>` resolves. */
|
|
10
|
+
readonly venuesDir: string;
|
|
11
|
+
/** The repository root: the rule pages are `docs/rules/<group>/<rule>.md` under it. */
|
|
12
|
+
readonly docsRoot: string;
|
|
13
|
+
}
|
|
14
|
+
/** A point of a markdown node, as mdast gives it: @eslint/markdown's parser sets the offset on every node. */
|
|
15
|
+
interface Point {
|
|
16
|
+
readonly line: number;
|
|
17
|
+
readonly column: number;
|
|
18
|
+
readonly offset: number;
|
|
19
|
+
}
|
|
20
|
+
/** The slice of an mdast node the rule reads. */
|
|
21
|
+
export interface MdNode {
|
|
22
|
+
readonly type: string;
|
|
23
|
+
readonly value?: string;
|
|
24
|
+
readonly position: {
|
|
25
|
+
readonly start: Point;
|
|
26
|
+
readonly end: Point;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** The card's root: its top-level blocks. */
|
|
30
|
+
export interface MdRoot extends MdNode {
|
|
31
|
+
readonly children: readonly MdNode[];
|
|
32
|
+
}
|
|
33
|
+
/** What `--fix` may do: replace a range of the card's text, or insert after one. */
|
|
34
|
+
export interface CardFixer {
|
|
35
|
+
replaceTextRange(range: readonly [number, number], text: string): unknown;
|
|
36
|
+
insertTextAfterRange(range: readonly [number, number], text: string): unknown;
|
|
37
|
+
}
|
|
38
|
+
/** The slice of ESLint's rule context this rule uses. */
|
|
39
|
+
export interface CardRuleContext {
|
|
40
|
+
readonly filename: string;
|
|
41
|
+
readonly sourceCode: {
|
|
42
|
+
readonly text: string;
|
|
43
|
+
};
|
|
44
|
+
report(d: {
|
|
45
|
+
readonly node: MdNode;
|
|
46
|
+
readonly messageId: string;
|
|
47
|
+
readonly data?: Readonly<Record<string, string>>;
|
|
48
|
+
readonly fix?: (fixer: CardFixer) => unknown;
|
|
49
|
+
}): void;
|
|
50
|
+
}
|
|
51
|
+
export interface CardRuleModule {
|
|
52
|
+
readonly meta: {
|
|
53
|
+
readonly type: "problem";
|
|
54
|
+
readonly fixable: "code";
|
|
55
|
+
readonly docs: {
|
|
56
|
+
readonly description: string;
|
|
57
|
+
};
|
|
58
|
+
readonly schema: readonly object[];
|
|
59
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
60
|
+
};
|
|
61
|
+
create(context: CardRuleContext): {
|
|
62
|
+
readonly root: (node: MdRoot) => void;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/** One row of the table: a rule of the resolved preset. */
|
|
66
|
+
export interface RuleRow {
|
|
67
|
+
readonly id: string;
|
|
68
|
+
readonly severity: string;
|
|
69
|
+
/** The options after the severity, as JSON; empty when the entry has none. */
|
|
70
|
+
readonly options: string;
|
|
71
|
+
/** The file of the chain that set the entry. */
|
|
72
|
+
readonly origin: string;
|
|
73
|
+
}
|
|
74
|
+
/** A rule entry (`"error"`, `2`, `["error", { … }]`) → its severity and its options as JSON. Pure. */
|
|
75
|
+
export declare function entryParts(entry: unknown): {
|
|
76
|
+
readonly severity: string;
|
|
77
|
+
readonly options: string;
|
|
78
|
+
};
|
|
79
|
+
/** The resolved preset's rules, one row each, by rule id. Pure. */
|
|
80
|
+
export declare const ruleRows: (preset: Preset) => readonly RuleRow[];
|
|
81
|
+
/**
|
|
82
|
+
* The section between the markers for the preset `own`, resolved, as the card `card` shows it —
|
|
83
|
+
* without the markers. Wrapped in prettier-ignore, so the formatter and this rule never disagree
|
|
84
|
+
* about the table's spacing. Pure but for `docExists`.
|
|
85
|
+
*/
|
|
86
|
+
export declare function cardSection(o: {
|
|
87
|
+
readonly preset: Preset;
|
|
88
|
+
readonly own: string;
|
|
89
|
+
readonly card: string;
|
|
90
|
+
readonly venuesDir: string;
|
|
91
|
+
readonly docsRoot: string;
|
|
92
|
+
readonly docExists: (file: string) => boolean;
|
|
93
|
+
readonly extendedBy: readonly string[];
|
|
94
|
+
}): string;
|
|
95
|
+
/** The rule, over `deps`. */
|
|
96
|
+
export declare function presetCardRule(deps: PresetCardDeps): CardRuleModule;
|
|
97
|
+
/** The plugin's rules: `preset/card-rules` once registered under the name `preset`. */
|
|
98
|
+
export declare const presetCardRules: (deps: PresetCardDeps) => Readonly<Record<string, CardRuleModule>>;
|
|
99
|
+
export {};
|
|
100
|
+
//# sourceMappingURL=preset-card-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-card-rule.d.ts","sourceRoot":"","sources":["../src/preset-card-rule.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,cAAc,CAAC;AAEtB,+CAA+C;AAC/C,eAAO,MAAM,aAAa,oCAAoC,CAAC;AAC/D,8CAA8C;AAC9C,eAAO,MAAM,WAAW,qCAAqC,CAAC;AAK9D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,8GAA8G;AAC9G,UAAU,KAAK;IACb,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,C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EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC,GAAG,MAAM,CAkBT;AA8GD,6BAA6B;AAC7B,wBAAgB,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,CA6BnE;AAED,uFAAuF;AACvF,eAAO,MAAM,eAAe,GAC1B,MAAM,cAAc,KACnB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAExC,CAAC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `preset/card-rules` — the rules table in a preset's card, generated from the preset beside it.
|
|
3
|
+
*
|
|
4
|
+
* Every shipped preset has a card, `presets/<name>.md` beside `presets/<name>.jsonc`: what the venue
|
|
5
|
+
* or the template family is, its call for papers, its kinds and limits — prose a person writes. One
|
|
6
|
+
* part of the card is NOT prose: which rules a paper extending the preset runs with, at which
|
|
7
|
+
* severity and options, and which file of the chain set each. That part is generated between two
|
|
8
|
+
* markers and checked on every lint, so it cannot say anything the preset does not:
|
|
9
|
+
*
|
|
10
|
+
* <!-- paperlint:preset-rules -->
|
|
11
|
+
* …generated: what the preset is, its call for papers, the resolved rules…
|
|
12
|
+
* <!-- /paperlint:preset-rules -->
|
|
13
|
+
*
|
|
14
|
+
* A section that differs from what the preset resolves to is reported, and `eslint --fix` writes it.
|
|
15
|
+
* A card with no markers gets the section appended by `--fix`; a card with one marker and not the
|
|
16
|
+
* other is reported and left alone, since where the section should end is a person's call.
|
|
17
|
+
*
|
|
18
|
+
* ── WHY OUR OWN RULE, AND NOT eslint-doc-generator ───────────────────────────────
|
|
19
|
+
* eslint-doc-generator documents an ESLint PLUGIN: its rules, and which of the plugin's exported
|
|
20
|
+
* configs enable each. A preset is not an ESLint config — it is paperlint's own format, merged along
|
|
21
|
+
* an `extends` chain of files (`src/presets.ts`), and the column that matters here (which file of
|
|
22
|
+
* the chain set a rule) has no counterpart in a plugin's configs.
|
|
23
|
+
*
|
|
24
|
+
* ── WHAT IT READS ────────────────────────────────────────────────────────────────
|
|
25
|
+
* The card's markdown tree (the two markers are top-level `html` nodes), the preset beside it through
|
|
26
|
+
* `resolvePreset` — the reader every rule uses — and whether `docs/rules/<rule>.md` exists, to link
|
|
27
|
+
* a rule to its page or, before it has one, to the index `docs/rules.md`.
|
|
28
|
+
*/
|
|
29
|
+
import { basename, dirname, join, relative } from "node:path";
|
|
30
|
+
import { callerPath } from "./caller-path.js";
|
|
31
|
+
import { presetProblemText, resolvePreset, resolveShipped, SHIPPED_PREFIX, } from "./presets.js";
|
|
32
|
+
/** The first line of the generated section. */
|
|
33
|
+
export const SECTION_START = "<!-- paperlint:preset-rules -->";
|
|
34
|
+
/** The last line of the generated section. */
|
|
35
|
+
export const SECTION_END = "<!-- /paperlint:preset-rules -->";
|
|
36
|
+
const PRESET_EXT = ".jsonc";
|
|
37
|
+
const CARD_EXT = ".md";
|
|
38
|
+
/** A rule entry (`"error"`, `2`, `["error", { … }]`) → its severity and its options as JSON. Pure. */
|
|
39
|
+
export function entryParts(entry) {
|
|
40
|
+
// One level of `flat`: an array entry gives its elements, a bare severity itself.
|
|
41
|
+
const [severity, ...options] = [entry].flat();
|
|
42
|
+
return {
|
|
43
|
+
severity: String(severity),
|
|
44
|
+
options: options.map((o) => JSON.stringify(o)).join(", "),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** The resolved preset's rules, one row each, by rule id. Pure. */
|
|
48
|
+
export const ruleRows = (preset) => Object.entries(preset.ruleOrigins)
|
|
49
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
50
|
+
.map(([id, origin]) => ({ id, ...entryParts(preset.rules[id]), origin }));
|
|
51
|
+
/** How a card names a preset file: `paperlint:<name>` when it is shipped, else its path from the card. */
|
|
52
|
+
const specOf = (file, card, venuesDir) => dirname(file) === venuesDir
|
|
53
|
+
? `${SHIPPED_PREFIX}${basename(file, PRESET_EXT)}`
|
|
54
|
+
: relative(dirname(card), file);
|
|
55
|
+
/** A table cell's text with GFM's column separator escaped. Pure. */
|
|
56
|
+
const cell = (text) => text.split("|").join("\\|");
|
|
57
|
+
/** What the card says about where to look for the section's source, and how to rewrite it. */
|
|
58
|
+
const generatedNote = (preset) => `<!-- Generated from ${preset} by \`npx eslint --fix\` (rule preset/card-rules). Edit the preset, not this section. -->`;
|
|
59
|
+
/** The section's first paragraph: what the preset is, its call for papers or its relatives. */
|
|
60
|
+
function identityLine(o) {
|
|
61
|
+
const spec = o.specOf(o.own);
|
|
62
|
+
const extendsText = o.preset.chain
|
|
63
|
+
.slice(-2, -1)
|
|
64
|
+
.map((parent) => ` · extends \`${o.specOf(parent)}\``)
|
|
65
|
+
.join("");
|
|
66
|
+
switch (o.preset.identity.type) {
|
|
67
|
+
case "venue":
|
|
68
|
+
return `**\`${spec}\`** — venue preset for ${o.preset.identity.name} · call for papers: <${o.preset.identity.url}>${extendsText}`;
|
|
69
|
+
case "family": {
|
|
70
|
+
const by = o.extendedBy.length
|
|
71
|
+
? o.extendedBy.map((s) => `\`${s}\``).join(", ")
|
|
72
|
+
: "no shipped preset";
|
|
73
|
+
return `**\`${spec}\`** — template family, no venue of its own${extendsText} · extended by ${by}`;
|
|
74
|
+
}
|
|
75
|
+
case "base":
|
|
76
|
+
return `**\`${basename(o.own)}\`** — the TeX base set: every paper gets it, whatever it extends, and no preset extends it`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** The table, or the sentence that stands for an empty one. Pure. */
|
|
80
|
+
function rulesTable(rows, own, link, originSpec) {
|
|
81
|
+
if (rows.length === 0)
|
|
82
|
+
return "No preset of this chain sets a rule: under it, every rule keeps paperlint's default.";
|
|
83
|
+
return [
|
|
84
|
+
"| rule | severity | options | set in |",
|
|
85
|
+
"| --- | --- | --- | --- |",
|
|
86
|
+
...rows.map((r) => `| [\`${r.id}\`](${link(r.id)}) | ${r.severity} | ${r.options === "" ? "—" : `\`${cell(r.options)}\``} | ${r.origin === own ? "this preset" : `inherited from \`${originSpec(r.origin)}\``} |`),
|
|
87
|
+
].join("\n");
|
|
88
|
+
}
|
|
89
|
+
/** A rule's link from the card: its page under `docs/rules/`, or the index before it has one. */
|
|
90
|
+
const ruleLink = (o) => (id) => {
|
|
91
|
+
const page = join(o.docsRoot, "docs", "rules", `${id}.md`);
|
|
92
|
+
return relative(dirname(o.card), o.docExists(page) ? page : join(o.docsRoot, "docs", "rules.md"));
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* The section between the markers for the preset `own`, resolved, as the card `card` shows it —
|
|
96
|
+
* without the markers. Wrapped in prettier-ignore, so the formatter and this rule never disagree
|
|
97
|
+
* about the table's spacing. Pure but for `docExists`.
|
|
98
|
+
*/
|
|
99
|
+
export function cardSection(o) {
|
|
100
|
+
const link = ruleLink(o);
|
|
101
|
+
const spec = (file) => specOf(file, o.card, o.venuesDir);
|
|
102
|
+
return [
|
|
103
|
+
"<!-- prettier-ignore-start -->",
|
|
104
|
+
generatedNote(basename(o.own)),
|
|
105
|
+
"",
|
|
106
|
+
identityLine({
|
|
107
|
+
preset: o.preset,
|
|
108
|
+
own: o.own,
|
|
109
|
+
specOf: spec,
|
|
110
|
+
extendedBy: o.extendedBy,
|
|
111
|
+
}),
|
|
112
|
+
"",
|
|
113
|
+
rulesTable(ruleRows(o.preset), o.own, link, spec),
|
|
114
|
+
"",
|
|
115
|
+
"<!-- prettier-ignore-end -->",
|
|
116
|
+
].join("\n");
|
|
117
|
+
}
|
|
118
|
+
/** The shipped presets whose chain runs through `file`, by their spec, `file` itself left out. */
|
|
119
|
+
const extendedByOf = (file, deps) => resolveShipped(deps)
|
|
120
|
+
.flatMap((p) => (p.chain.includes(file) ? p.chain.slice(-1) : []))
|
|
121
|
+
.filter((leaf) => leaf !== file)
|
|
122
|
+
.map((leaf) => specOf(leaf, file, deps.venuesDir));
|
|
123
|
+
/** The expected section for the card at `card`, or the finding that stands in its place. */
|
|
124
|
+
function expectedSection(card, deps) {
|
|
125
|
+
const own = join(dirname(card), `${basename(card, CARD_EXT)}${PRESET_EXT}`);
|
|
126
|
+
if (!deps.files.isFile(callerPath(own)))
|
|
127
|
+
return { ok: false, messageId: "noPreset", data: { preset: own } };
|
|
128
|
+
const r = resolvePreset(`./${basename(own)}`, card, deps);
|
|
129
|
+
if (!r.ok) {
|
|
130
|
+
const why = presetProblemText(r.error);
|
|
131
|
+
return { ok: false, messageId: "presetProblem", data: { why } };
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
ok: true,
|
|
135
|
+
text: cardSection({
|
|
136
|
+
preset: r.value,
|
|
137
|
+
own,
|
|
138
|
+
card,
|
|
139
|
+
venuesDir: deps.venuesDir,
|
|
140
|
+
docsRoot: deps.docsRoot,
|
|
141
|
+
docExists: (f) => deps.files.isFile(callerPath(f)),
|
|
142
|
+
extendedBy: extendedByOf(own, deps),
|
|
143
|
+
}),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/** The first top-level `html` node of the card that is exactly `marker`, or null. */
|
|
147
|
+
const markerIn = (root, marker) => root.children
|
|
148
|
+
.filter((n) => n.type === "html")
|
|
149
|
+
.find((n) => String(n.value).trim() === marker) ?? null;
|
|
150
|
+
/** The section to append to a card that has none, after its last line. */
|
|
151
|
+
const appended = (text, section) => `${text.endsWith("\n") ? "" : "\n"}\n${SECTION_START}\n${section}\n${SECTION_END}\n`;
|
|
152
|
+
/** The finding for the section between `start` and `end`: stale, with the fix; null when it is right. */
|
|
153
|
+
function staleSection(between, text, section) {
|
|
154
|
+
const from = between.start.position.end.offset;
|
|
155
|
+
const to = between.end.position.start.offset;
|
|
156
|
+
const expected = `\n${section}\n`;
|
|
157
|
+
return text.slice(from, to) === expected
|
|
158
|
+
? null
|
|
159
|
+
: {
|
|
160
|
+
node: between.start,
|
|
161
|
+
messageId: "stale",
|
|
162
|
+
fix: (fixer) => fixer.replaceTextRange([from, to], expected),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
/** The card's section against `section`, the one its preset resolves to: missing, unpaired, stale, or right (null). */
|
|
166
|
+
function sectionFinding(root, text, section) {
|
|
167
|
+
const start = markerIn(root, SECTION_START);
|
|
168
|
+
const end = markerIn(root, SECTION_END);
|
|
169
|
+
if (start === null)
|
|
170
|
+
return end === null
|
|
171
|
+
? {
|
|
172
|
+
node: root,
|
|
173
|
+
messageId: "missing",
|
|
174
|
+
fix: (fixer) => fixer.insertTextAfterRange([text.length, text.length], appended(text, section)),
|
|
175
|
+
}
|
|
176
|
+
: { node: end, messageId: "unpaired" };
|
|
177
|
+
if (end === null)
|
|
178
|
+
return { node: start, messageId: "unpaired" };
|
|
179
|
+
return staleSection({ start, end }, text, section);
|
|
180
|
+
}
|
|
181
|
+
/** Judge the card `context.filename`: its preset beside it, then its generated section. */
|
|
182
|
+
function judgeCard(context, root, deps) {
|
|
183
|
+
const want = expectedSection(context.filename, deps);
|
|
184
|
+
const finding = want.ok
|
|
185
|
+
? sectionFinding(root, context.sourceCode.text, want.text)
|
|
186
|
+
: { node: root, messageId: want.messageId, data: want.data };
|
|
187
|
+
if (finding !== null)
|
|
188
|
+
context.report(finding);
|
|
189
|
+
}
|
|
190
|
+
/** The rule, over `deps`. */
|
|
191
|
+
export function presetCardRule(deps) {
|
|
192
|
+
return {
|
|
193
|
+
meta: {
|
|
194
|
+
type: "problem",
|
|
195
|
+
fixable: "code",
|
|
196
|
+
docs: {
|
|
197
|
+
description: "a preset card's rules table is the one its preset resolves to — generated, never hand-written",
|
|
198
|
+
},
|
|
199
|
+
schema: [],
|
|
200
|
+
messages: {
|
|
201
|
+
stale: "the rules section does not match the preset beside this card — run `npx eslint --fix` on this file to rewrite it from the preset",
|
|
202
|
+
missing: `this card has no generated rules section — run \`npx eslint --fix\` on this file to append one (between ${SECTION_START} and ${SECTION_END})`,
|
|
203
|
+
unpaired: `the generated rules section needs both markers, ${SECTION_START} and ${SECTION_END}, each on its own line`,
|
|
204
|
+
noPreset: "a preset card describes the preset beside it, and there is none: {{preset}}",
|
|
205
|
+
presetProblem: "the preset beside this card does not resolve, so its rules cannot be listed: {{why}}",
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
create(context) {
|
|
209
|
+
return {
|
|
210
|
+
root(node) {
|
|
211
|
+
judgeCard(context, node, deps);
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/** The plugin's rules: `preset/card-rules` once registered under the name `preset`. */
|
|
218
|
+
export const presetCardRules = (deps) => ({
|
|
219
|
+
"card-rules": presetCardRule(deps),
|
|
220
|
+
});
|
|
221
|
+
//# sourceMappingURL=preset-card-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-card-rule.js","sourceRoot":"","sources":["../src/preset-card-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,cAAc,GAEf,MAAM,cAAc,CAAC;AAEtB,+CAA+C;AAC/C,MAAM,CAAC,MAAM,aAAa,GAAG,iCAAiC,CAAC;AAC/D,8CAA8C;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAE9D,MAAM,UAAU,GAAG,QAAQ,CAAC;AAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC;AAoEvB,sGAAsG;AACtG,MAAM,UAAU,UAAU,CAAC,KAAc;IAIvC,kFAAkF;IAClF,MAAM,CAAC,QAAQ,EAAE,GAAG,OAAO,CAAC,GAAG,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BACrH,QAAQ,EACN,6EAA6E;gBAC/E,aAAa,EACX,sFAAsF;aACzF;SACF;QACD,MAAM,CAAC,OAAO;YACZ,OAAO;gBACL,IAAI,CAAC,IAAI;oBACP,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;gBACjC,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAAoB,EACsB,EAAE,CAAC,CAAC;IAC9C,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC;CACnC,CAAC,CAAC"}
|
package/dist/presets.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type RequiredSection, type TexRequirements, type VenueFormat } from "./tex-requirements.ts";
|
|
1
|
+
import { type PresetIdentity, type RequiredSection, type TexRequirements, type VenueFormat } from "./tex-requirements.ts";
|
|
2
2
|
import { type Result } from "./domain/result.ts";
|
|
3
3
|
import type { Files } from "./ports/files.ts";
|
|
4
4
|
import { type PaperSettings, type SettingsProblem } from "./paper-settings.ts";
|
|
5
5
|
import type { RegisterAnchor } from "./domain/register.ts";
|
|
6
6
|
import type { VenueTalk } from "./domain/talk.ts";
|
|
7
|
+
import type { VenuePortal } from "./domain/submission.ts";
|
|
7
8
|
/** The prefix of a shipped preset's spec. */
|
|
8
9
|
export declare const SHIPPED_PREFIX = "paperlint:";
|
|
9
10
|
/** The longest chain of presets, the paper's own target included. */
|
|
@@ -20,10 +21,17 @@ export interface PresetTemplate {
|
|
|
20
21
|
}
|
|
21
22
|
/** A resolved chain, merged. */
|
|
22
23
|
export interface Preset {
|
|
23
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The preset's id: the spec's file name without its extension (`agenticdev`, `usenix-sec`). The
|
|
26
|
+
* stable key a machine reads — the facts file and the build plan carry it — whatever `name` says.
|
|
27
|
+
*/
|
|
28
|
+
readonly id: string;
|
|
29
|
+
/** The word for this venue in messages: the venue's `name`, else the id. */
|
|
24
30
|
readonly label: string;
|
|
25
31
|
/** Every file of the chain, root first. */
|
|
26
32
|
readonly chain: readonly string[];
|
|
33
|
+
/** What the spec names — the leaf file of the chain: a venue (with its call), or a family. */
|
|
34
|
+
readonly identity: PresetIdentity;
|
|
27
35
|
/**
|
|
28
36
|
* The `\\documentclass` the venue's template uses, as the preset spells it, and the file that
|
|
29
37
|
* spells it; null when no file of the chain names one. Read by the rules and `paperlint new`,
|
|
@@ -38,10 +46,14 @@ export interface Preset {
|
|
|
38
46
|
readonly tex: TexRequirements;
|
|
39
47
|
readonly format: VenueFormat;
|
|
40
48
|
readonly rules: Readonly<Record<string, unknown>>;
|
|
49
|
+
/** Rule id → the file of the chain that set its entry in `rules` (the last one to name it). */
|
|
50
|
+
readonly ruleOrigins: Readonly<Record<string, string>>;
|
|
41
51
|
/** The accepted papers the register rules measure a body against; empty when no file names any. */
|
|
42
52
|
readonly registerAnchors: readonly RegisterAnchor[];
|
|
43
53
|
/** What the venue asks a presenter to send (`talk/*`); null when no file of the chain says. */
|
|
44
54
|
readonly talk: VenueTalk | null;
|
|
55
|
+
/** Where the venue takes submissions (`paperlint submission`); null when no file of the chain says. */
|
|
56
|
+
readonly portal: VenuePortal | null;
|
|
45
57
|
}
|
|
46
58
|
/** Why a spec does not resolve. */
|
|
47
59
|
export type PresetProblem = {
|
|
@@ -58,6 +70,14 @@ export type PresetProblem = {
|
|
|
58
70
|
} | {
|
|
59
71
|
readonly kind: "too-deep";
|
|
60
72
|
readonly chain: readonly string[];
|
|
73
|
+
}
|
|
74
|
+
/** `file` extends `parent`, which a preset of its type may not extend. */
|
|
75
|
+
| {
|
|
76
|
+
readonly kind: "wrong-parent";
|
|
77
|
+
readonly file: string;
|
|
78
|
+
readonly parent: string;
|
|
79
|
+
/** A family extending a venue, or anything extending the base set. */
|
|
80
|
+
readonly parentType: "venue" | "base";
|
|
61
81
|
} | {
|
|
62
82
|
readonly kind: "broken";
|
|
63
83
|
readonly file: string;
|
|
@@ -74,6 +94,27 @@ export declare function mergeFormat(parent: VenueFormat, child: VenueFormat): Ve
|
|
|
74
94
|
export declare function resolvePreset(spec: string, fromFile: string, deps: PresetDeps): Result<Preset, PresetProblem>;
|
|
75
95
|
/** The shipped presets' names (each is spelled `paperlint:<name>`). */
|
|
76
96
|
export declare function shippedPresets(venuesDir: string): string[];
|
|
97
|
+
/** The spec a paper writes in `extends` for the shipped preset `name`: `paperlint:<name>`. */
|
|
98
|
+
export declare const shippedSpec: (name: string) => string;
|
|
99
|
+
/**
|
|
100
|
+
* Every shipped preset that resolves, each read the way a paper extending it would read it. The one
|
|
101
|
+
* piece that reads the presets directory. One that does not resolve is left out: `pdf/profile`
|
|
102
|
+
* owns that.
|
|
103
|
+
*/
|
|
104
|
+
export declare function resolveShipped(deps: PresetDeps): readonly Preset[];
|
|
105
|
+
/** A shipped venue as a name knows it, and the files of its chain: what tells it from a paper's own. */
|
|
106
|
+
export type ShippedVenue = Pick<Preset, "label" | "aliases" | "chain">;
|
|
107
|
+
/**
|
|
108
|
+
* A resolved preset as a name knows it: its label, its aliases, its chain. Pure. (Not Remeda's
|
|
109
|
+
* `pick`: the app layer may not import it — `boundaries/dependencies`, `APP_EXTERNALS`.)
|
|
110
|
+
*/
|
|
111
|
+
export declare const venueOf: ({ label, aliases, chain }: Preset) => ShippedVenue;
|
|
112
|
+
/**
|
|
113
|
+
* THE ONE SOURCE OF VENUE NAMES: every shipped venue's label and `aliases` (with each `name` along
|
|
114
|
+
* its chain). Read by `paperlint new`, which refuses a folder name naming one, and through
|
|
115
|
+
* `otherVenues` by `tex/venue-leftover` and `paper/folder-venue-leftover`.
|
|
116
|
+
*/
|
|
117
|
+
export declare const shippedVenueNames: (deps: PresetDeps) => readonly ShippedVenue[];
|
|
77
118
|
/** One line for a problem, naming what to change. Pure. */
|
|
78
119
|
export declare function presetProblemText(p: PresetProblem): string;
|
|
79
120
|
/** What one paper declares and the preset it resolves to — one answer for every reader. */
|