paperlint 18.0.0 → 18.2.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/README.md +3 -3
- package/dist/adapters/hotcrp/index.d.ts +11 -1
- package/dist/adapters/hotcrp/index.d.ts.map +1 -1
- package/dist/adapters/hotcrp/index.js +11 -1
- package/dist/adapters/hotcrp/index.js.map +1 -1
- package/dist/adapters/hotcrp/site.d.ts.map +1 -1
- package/dist/adapters/hotcrp/site.js +3 -1
- package/dist/adapters/hotcrp/site.js.map +1 -1
- package/dist/adapters/hotcrp/token.d.ts +11 -0
- package/dist/adapters/hotcrp/token.d.ts.map +1 -1
- package/dist/adapters/hotcrp/token.js +34 -7
- package/dist/adapters/hotcrp/token.js.map +1 -1
- package/dist/adapters/latex/document-class.d.ts +28 -5
- package/dist/adapters/latex/document-class.d.ts.map +1 -1
- package/dist/adapters/latex/document-class.js +208 -21
- package/dist/adapters/latex/document-class.js.map +1 -1
- package/dist/adapters/latex/index.d.ts +4 -4
- package/dist/adapters/latex/index.d.ts.map +1 -1
- package/dist/adapters/latex/index.js +5 -2
- package/dist/adapters/latex/index.js.map +1 -1
- package/dist/adapters/latex/parse.d.ts.map +1 -1
- package/dist/adapters/latex/parse.js +5 -0
- package/dist/adapters/latex/parse.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -3
- package/dist/cli.js.map +1 -1
- package/dist/domain/body-pages.d.ts.map +1 -1
- package/dist/domain/body-pages.js +4 -2
- package/dist/domain/body-pages.js.map +1 -1
- package/dist/domain/portal-token.d.ts +26 -10
- package/dist/domain/portal-token.d.ts.map +1 -1
- package/dist/domain/portal-token.js +19 -12
- package/dist/domain/portal-token.js.map +1 -1
- package/dist/domain/tex-document.d.ts +52 -4
- package/dist/domain/tex-document.d.ts.map +1 -1
- package/dist/domain/tex-document.js +9 -0
- package/dist/domain/tex-document.js.map +1 -1
- package/dist/eslint-rules/latex-language.d.ts +10 -0
- package/dist/eslint-rules/latex-language.d.ts.map +1 -1
- package/dist/eslint-rules/latex-language.js +41 -2
- package/dist/eslint-rules/latex-language.js.map +1 -1
- package/dist/ports/latex.d.ts +13 -1
- package/dist/ports/latex.d.ts.map +1 -1
- package/dist/ports/submission-portal.d.ts +7 -0
- package/dist/ports/submission-portal.d.ts.map +1 -1
- package/dist/presets.d.ts +15 -0
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +9 -0
- package/dist/presets.js.map +1 -1
- package/dist/submission.d.ts +3 -2
- package/dist/submission.d.ts.map +1 -1
- package/dist/submission.js +24 -12
- package/dist/submission.js.map +1 -1
- package/dist/tex-requirements.d.ts +2 -0
- package/dist/tex-requirements.d.ts.map +1 -1
- package/dist/tex-requirements.js +7 -2
- package/dist/tex-requirements.js.map +1 -1
- package/dist/tex-venue-rules.d.ts +36 -3
- package/dist/tex-venue-rules.d.ts.map +1 -1
- package/dist/tex-venue-rules.js +181 -33
- package/dist/tex-venue-rules.js.map +1 -1
- package/docs/rules/cycle/port-done.md +3 -0
- package/docs/rules/tex/template.md +96 -1
- package/docs/rules.md +18 -13
- package/docs/submission.md +26 -9
- package/docs/venues.md +51 -12
- package/eslint-rules/latex-language.test.mjs +64 -1
- package/eslint-rules/latex-language.ts +44 -2
- package/eslint.config.mjs +1 -0
- package/fixtures/build-e2e/neurips/PIPELINE-STATUS.md +3 -0
- package/fixtures/build-e2e/neurips/expect.json +20 -0
- package/fixtures/build-e2e/neurips/paper.tex +60 -0
- package/fixtures/build-e2e/neurips/paperlint.json +1 -0
- package/fixtures/build-e2e/neurips-nostyle/PIPELINE-STATUS.md +3 -0
- package/fixtures/build-e2e/neurips-nostyle/expect.json +26 -0
- package/fixtures/build-e2e/neurips-nostyle/paper.tex +56 -0
- package/fixtures/build-e2e/neurips-nostyle/paperlint.json +1 -0
- package/fixtures/build-e2e/neurips-over/PIPELINE-STATUS.md +3 -0
- package/fixtures/build-e2e/neurips-over/expect.json +24 -0
- package/fixtures/build-e2e/neurips-over/paper.tex +56 -0
- package/fixtures/build-e2e/neurips-over/paperlint.json +1 -0
- package/fixtures/real-papers.test.ts +17 -6
- package/package.json +3 -1
- package/presets/aaai-2027.jsonc +126 -0
- package/presets/aaai-2027.md +127 -0
- package/presets/aaai-press.jsonc +167 -0
- package/presets/aaai-press.md +126 -0
- package/presets/icml-2027.jsonc +111 -0
- package/presets/icml-2027.md +130 -0
- package/presets/icml-style.jsonc +125 -0
- package/presets/icml-style.md +77 -0
- package/presets/neurips-2026.jsonc +123 -0
- package/presets/neurips-2026.md +137 -0
- package/presets/neurips-style.jsonc +113 -0
- package/presets/neurips-style.md +85 -0
- package/presets/venue-profile.schema.json +6 -0
- package/skills/build-label-page/scripts/label-page-browser.test.ts +275 -114
- package/src/adapters/hotcrp/cassette/README.md +1 -1
- package/src/adapters/hotcrp/index.ts +12 -0
- package/src/adapters/hotcrp/site.ts +4 -0
- package/src/adapters/hotcrp/token.test.ts +39 -1
- package/src/adapters/hotcrp/token.ts +40 -7
- package/src/adapters/latex/document-class.ts +292 -20
- package/src/adapters/latex/index.test.ts +263 -0
- package/src/adapters/latex/index.ts +12 -3
- package/src/adapters/latex/parse.ts +5 -0
- package/src/cli.test.ts +6 -1
- package/src/cli.ts +4 -3
- package/src/domain/body-pages.test.ts +22 -6
- package/src/domain/body-pages.ts +4 -2
- package/src/domain/portal-token.test.ts +121 -2
- package/src/domain/portal-token.ts +39 -15
- package/src/domain/tex-document.ts +64 -5
- package/src/folder-venue-rule.test.ts +51 -0
- package/src/new-paper.test.ts +2 -2
- package/src/paper-settings-commands.test.ts +1 -1
- package/src/ports/latex.ts +14 -0
- package/src/ports/submission-portal.ts +7 -0
- package/src/preset-card-rule.test.ts +44 -27
- package/src/presets.test.ts +177 -1
- package/src/presets.ts +27 -0
- package/src/rule-cases.test.ts +52 -0
- package/src/submission-show.test.ts +1 -1
- package/src/submission.test.ts +98 -7
- package/src/submission.ts +28 -11
- package/src/tex-requirements.harness.ts +17 -3
- package/src/tex-requirements.ts +13 -2
- package/src/tex-venue-rules.test.ts +1020 -0
- package/src/tex-venue-rules.ts +248 -38
- package/src/venue-rules.test.ts +369 -2
|
@@ -125,7 +125,7 @@ test("the portal's refusal is printed with its own message, exit 1", async () =>
|
|
|
125
125
|
expect(r.code).toBe(1);
|
|
126
126
|
expect(r.errs).toStrictEqual([
|
|
127
127
|
"the portal refused (HTTP 401): Missing credentials",
|
|
128
|
-
"HOTCRP_TOKEN_127_0_0_1_9 was used; it may belong to another hotcrp
|
|
128
|
+
"HOTCRP_TOKEN_127_0_0_1_9 was used; it may belong to another hotcrp install (hotcrp.com sites share one token, a self-hosted install has its own), or be revoked or expired",
|
|
129
129
|
...STEPS,
|
|
130
130
|
]);
|
|
131
131
|
});
|
package/src/submission.test.ts
CHANGED
|
@@ -72,6 +72,85 @@ test("only the site-less HOTCRP_TOKEN set: the rename instruction, and nothing i
|
|
|
72
72
|
expect(r.errs.join("\n")).not.toMatch(/hct_old/);
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
+
test("🔴 a self-hosted site never uses the hosted-service variable: only it set → the site's own variable is asked for", async () => {
|
|
76
|
+
const r = await run({}, { env: { HOTCRP_TOKEN_HOTCRP_COM: "hct_all" } });
|
|
77
|
+
expect(r.code).toBe(2);
|
|
78
|
+
expect(r.seen).toStrictEqual([]);
|
|
79
|
+
expect(r.errs).toStrictEqual([
|
|
80
|
+
`no hotcrp token for ${SITE}: HOTCRP_TOKEN_127_0_0_1_9 is not set`,
|
|
81
|
+
...STEPS,
|
|
82
|
+
]);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test("🔴 the bare HOTCRP_TOKEN stays refused beside the shared variable's absence", async () => {
|
|
86
|
+
const r = await run({}, { env: { HOTCRP_TOKEN: "hct_old" } });
|
|
87
|
+
expect(r.code).toBe(2);
|
|
88
|
+
expect(r.seen).toStrictEqual([]);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const HOSTED_SITE = "https://msr2027.hotcrp.com";
|
|
92
|
+
const HOSTED_PORTAL = { kind: "hotcrp", url: HOSTED_SITE } as const;
|
|
93
|
+
const HOSTED_STEPS = (variable: string) => [
|
|
94
|
+
` 1. create a token on this site: ${HOSTED_SITE}/profile?t=developer (Account settings → Developer → API tokens), with the scopes submeta:read and document:read (show), submeta:write and document:write (update, new) — tick all four to use every subcommand`,
|
|
95
|
+
` 2. set it in your environment — never paste it into a chat: export ${variable}=<the token>`,
|
|
96
|
+
" one token serves every hotcrp.com site: HOTCRP_TOKEN_HOTCRP_COM is read for all of them; HOTCRP_TOKEN_MSR2027, when set, overrides it for msr2027.hotcrp.com alone",
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
test("no token on a hosted-service site: the shared variable is what to set, the per-site override is mentioned", () => {
|
|
100
|
+
expect(
|
|
101
|
+
tokenProblemLines(HOSTED_PORTAL, hotcrpSite(HOSTED_SITE), {
|
|
102
|
+
kind: "missing",
|
|
103
|
+
variable: "HOTCRP_TOKEN_MSR2027",
|
|
104
|
+
shared: "HOTCRP_TOKEN_HOTCRP_COM",
|
|
105
|
+
}),
|
|
106
|
+
).toStrictEqual([
|
|
107
|
+
`no hotcrp token for ${HOSTED_SITE}: HOTCRP_TOKEN_HOTCRP_COM is not set (HOTCRP_TOKEN_MSR2027 would override it for this site)`,
|
|
108
|
+
...HOSTED_STEPS("HOTCRP_TOKEN_HOTCRP_COM"),
|
|
109
|
+
]);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test("only the site-less variable set on a hosted-service site: both variables it may be renamed to", () => {
|
|
113
|
+
expect(
|
|
114
|
+
tokenProblemLines(HOSTED_PORTAL, hotcrpSite(HOSTED_SITE), {
|
|
115
|
+
kind: "site-less",
|
|
116
|
+
variable: "HOTCRP_TOKEN_MSR2027",
|
|
117
|
+
shared: "HOTCRP_TOKEN_HOTCRP_COM",
|
|
118
|
+
siteLess: "HOTCRP_TOKEN",
|
|
119
|
+
}),
|
|
120
|
+
).toStrictEqual([
|
|
121
|
+
"HOTCRP_TOKEN is no longer read. If it was made on a hotcrp.com site, rename it to HOTCRP_TOKEN_HOTCRP_COM (every hotcrp.com site) or HOTCRP_TOKEN_MSR2027 (this site alone); if it was made on a self-hosted install, rename it to that install's variable (HOTCRP_TOKEN_<LABEL>) and create a token here:",
|
|
122
|
+
...HOSTED_STEPS("HOTCRP_TOKEN_HOTCRP_COM"),
|
|
123
|
+
]);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
test("a site-only token in the shared variable: what is wrong, and both ways out", () => {
|
|
127
|
+
expect(
|
|
128
|
+
tokenProblemLines(HOSTED_PORTAL, hotcrpSite(HOSTED_SITE), {
|
|
129
|
+
kind: "site-only",
|
|
130
|
+
variable: "HOTCRP_TOKEN_MSR2027",
|
|
131
|
+
shared: "HOTCRP_TOKEN_HOTCRP_COM",
|
|
132
|
+
}),
|
|
133
|
+
).toStrictEqual([
|
|
134
|
+
'HOTCRP_TOKEN_HOTCRP_COM holds a site-only token (it starts with hct_): that works on one hotcrp.com site only, not on all of them. Create a token with Site availability "All sites" (it starts with hcT_) and set that in HOTCRP_TOKEN_HOTCRP_COM, or move this one to HOTCRP_TOKEN_MSR2027 if it was made on this site:',
|
|
135
|
+
...HOSTED_STEPS("HOTCRP_TOKEN_HOTCRP_COM"),
|
|
136
|
+
]);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test("a 401 on a hosted-service site names the variable that was used", () => {
|
|
140
|
+
const f = { kind: "refused", httpStatus: 401, messages: [] } as const;
|
|
141
|
+
expect(
|
|
142
|
+
tokenRefusedLines(
|
|
143
|
+
HOSTED_PORTAL,
|
|
144
|
+
hotcrpSite(HOSTED_SITE),
|
|
145
|
+
f,
|
|
146
|
+
"HOTCRP_TOKEN_HOTCRP_COM",
|
|
147
|
+
),
|
|
148
|
+
).toStrictEqual([
|
|
149
|
+
"HOTCRP_TOKEN_HOTCRP_COM was used; it may belong to another hotcrp install (hotcrp.com sites share one token, a self-hosted install has its own), or be revoked or expired",
|
|
150
|
+
...HOSTED_STEPS("HOTCRP_TOKEN_HOTCRP_COM"),
|
|
151
|
+
]);
|
|
152
|
+
});
|
|
153
|
+
|
|
75
154
|
test("the site's variable set beside a site-less one: the site's token is the one used", async () => {
|
|
76
155
|
const r = await run(
|
|
77
156
|
{},
|
|
@@ -105,7 +184,7 @@ test("a 401 from the portal: the portal's words, which variable was used, and ho
|
|
|
105
184
|
);
|
|
106
185
|
const said = [
|
|
107
186
|
"the portal refused (HTTP 401): Unauthorized",
|
|
108
|
-
"HOTCRP_TOKEN_127_0_0_1_9 was used; it may belong to another hotcrp
|
|
187
|
+
"HOTCRP_TOKEN_127_0_0_1_9 was used; it may belong to another hotcrp install (hotcrp.com sites share one token, a self-hosted install has its own), or be revoked or expired",
|
|
109
188
|
...STEPS,
|
|
110
189
|
];
|
|
111
190
|
expect(map(runs, (r) => [r.code, r.errs])).toStrictEqual(
|
|
@@ -117,21 +196,33 @@ test("a 403 names a missing scope; any other failure says nothing about the toke
|
|
|
117
196
|
const portal = { kind: "hotcrp", url: SITE } as const;
|
|
118
197
|
const f = (httpStatus: number) =>
|
|
119
198
|
({ kind: "refused", httpStatus, messages: [] }) as const;
|
|
120
|
-
expect(
|
|
199
|
+
expect(
|
|
200
|
+
tokenRefusedLines(
|
|
201
|
+
portal,
|
|
202
|
+
hotcrpSite(SITE),
|
|
203
|
+
f(403),
|
|
204
|
+
"HOTCRP_TOKEN_127_0_0_1_9",
|
|
205
|
+
),
|
|
206
|
+
).toStrictEqual([
|
|
121
207
|
"HOTCRP_TOKEN_127_0_0_1_9 was used; the site turned the request away — the token may lack a scope this subcommand needs",
|
|
122
208
|
...STEPS,
|
|
123
209
|
]);
|
|
124
|
-
expect(tokenRefusedLines(portal, hotcrpSite(SITE), f(500))).toStrictEqual([]);
|
|
125
210
|
expect(
|
|
126
|
-
tokenRefusedLines(portal, hotcrpSite(SITE),
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
211
|
+
tokenRefusedLines(portal, hotcrpSite(SITE), f(500), "X"),
|
|
212
|
+
).toStrictEqual([]);
|
|
213
|
+
expect(
|
|
214
|
+
tokenRefusedLines(
|
|
215
|
+
portal,
|
|
216
|
+
hotcrpSite(SITE),
|
|
217
|
+
{ kind: "unreachable", detail: "x" },
|
|
218
|
+
"X",
|
|
219
|
+
),
|
|
130
220
|
).toStrictEqual([]);
|
|
131
221
|
expect(
|
|
132
222
|
tokenProblemLines(portal, hotcrpSite(SITE), {
|
|
133
223
|
kind: "missing",
|
|
134
224
|
variable: "HOTCRP_TOKEN_127_0_0_1_9",
|
|
225
|
+
shared: null,
|
|
135
226
|
}),
|
|
136
227
|
).toStrictEqual([
|
|
137
228
|
`no hotcrp token for ${SITE}: HOTCRP_TOKEN_127_0_0_1_9 is not set`,
|
package/src/submission.ts
CHANGED
|
@@ -102,10 +102,13 @@ export function tokenSteps(
|
|
|
102
102
|
variable: string,
|
|
103
103
|
): readonly string[] {
|
|
104
104
|
const c = site.credentials;
|
|
105
|
+
const shared = site.sharedVariable;
|
|
105
106
|
return [
|
|
106
107
|
` 1. create a token on this site: ${c.page} (${c.where}), with the scopes ${c.scopes}`,
|
|
107
108
|
` 2. set it in your environment — never paste it into a chat: export ${variable}=<the token>`,
|
|
108
|
-
|
|
109
|
+
shared === null
|
|
110
|
+
? ` a self-hosted install has a variable of its own: ${variable} is read for ${hostOf(portal.url)} alone, and never HOTCRP_TOKEN_HOTCRP_COM, which serves hotcrp.com sites only`
|
|
111
|
+
: ` one token serves every hotcrp.com site: ${shared} is read for all of them; ${site.tokenVariable}, when set, overrides it for ${hostOf(portal.url)} alone`,
|
|
109
112
|
];
|
|
110
113
|
}
|
|
111
114
|
|
|
@@ -115,30 +118,36 @@ export function tokenProblemLines(
|
|
|
115
118
|
site: PortalSite,
|
|
116
119
|
p: TokenProblem,
|
|
117
120
|
): readonly string[] {
|
|
121
|
+
const asked = p.shared ?? p.variable;
|
|
118
122
|
const head =
|
|
119
|
-
p.kind === "
|
|
120
|
-
?
|
|
121
|
-
:
|
|
122
|
-
|
|
123
|
+
p.kind === "site-only"
|
|
124
|
+
? `${p.shared} holds a site-only token (it starts with hct_): that works on one hotcrp.com site only, not on all of them. Create a token with Site availability "All sites" (it starts with hcT_) and set that in ${p.shared}, or move this one to ${p.variable} if it was made on this site:`
|
|
125
|
+
: p.kind === "missing"
|
|
126
|
+
? `no ${portal.kind} token for ${portal.url}: ${asked} is not set${p.shared === null ? "" : ` (${p.variable} would override it for this site)`}`
|
|
127
|
+
: p.shared === null
|
|
128
|
+
? `${p.siteLess} is no longer read: tokens are per ${portal.kind} site. If it was made on ${hostOf(portal.url)}, rename it to ${p.variable}; if it was made on another site, rename it to that site's variable (${site.variablePattern}) and create a token here:`
|
|
129
|
+
: `${p.siteLess} is no longer read. If it was made on a hotcrp.com site, rename it to ${p.shared} (every hotcrp.com site) or ${p.variable} (this site alone); if it was made on a self-hosted install, rename it to that install's variable (${site.variablePattern}) and create a token here:`;
|
|
130
|
+
return [head, ...tokenSteps(portal, site, asked)];
|
|
123
131
|
}
|
|
124
132
|
|
|
125
133
|
/**
|
|
126
134
|
* What to do when the portal turned the token away: 401 is "this site does not know the token", 403
|
|
127
|
-
* a token without the scope — both answered with the site's token page
|
|
135
|
+
* a token without the scope — both answered with the site's token page, and the variable that was
|
|
136
|
+
* `used`. Empty for anything else. Pure.
|
|
128
137
|
*/
|
|
129
138
|
export function tokenRefusedLines(
|
|
130
139
|
portal: SupportedPortal,
|
|
131
140
|
site: PortalSite,
|
|
132
141
|
f: PortalFailure,
|
|
142
|
+
used: string,
|
|
133
143
|
): readonly string[] {
|
|
134
144
|
if (f.kind !== "refused" || (f.httpStatus !== 401 && f.httpStatus !== 403))
|
|
135
145
|
return [];
|
|
136
|
-
const variable = site.tokenVariable;
|
|
137
146
|
const why =
|
|
138
147
|
f.httpStatus === 401
|
|
139
|
-
? `${
|
|
140
|
-
: `${
|
|
141
|
-
return [why, ...tokenSteps(portal, site,
|
|
148
|
+
? `${used} was used; it may belong to another ${portal.kind} install (hotcrp.com sites share one token, a self-hosted install has its own), or be revoked or expired`
|
|
149
|
+
: `${used} was used; the site turned the request away — the token may lack a scope this subcommand needs`;
|
|
150
|
+
return [why, ...tokenSteps(portal, site, used)];
|
|
142
151
|
}
|
|
143
152
|
|
|
144
153
|
export const SUBCOMMANDS = ["new", "show", "update", "topics"] as const;
|
|
@@ -1149,9 +1158,17 @@ export function usageProblem(a: SubmissionArgs): string | null {
|
|
|
1149
1158
|
/** The variables a site's token lookup reads. */
|
|
1150
1159
|
const tokenNames = (site: PortalSite) => ({
|
|
1151
1160
|
variable: site.tokenVariable,
|
|
1161
|
+
shared: site.sharedVariable,
|
|
1162
|
+
siteOnly: site.isSiteOnlyToken,
|
|
1152
1163
|
siteLess: site.siteLessVariable,
|
|
1153
1164
|
});
|
|
1154
1165
|
|
|
1166
|
+
/** The lines for a refusal, naming the variable the token came from. */
|
|
1167
|
+
const refusedWith =
|
|
1168
|
+
(portal: SupportedPortal, site: PortalSite, used: string) =>
|
|
1169
|
+
(f: PortalFailure) =>
|
|
1170
|
+
tokenRefusedLines(portal, site, f, used);
|
|
1171
|
+
|
|
1155
1172
|
/** No token to use: the complete instruction, exit 2 — nothing is sent. */
|
|
1156
1173
|
function tokenMissing(
|
|
1157
1174
|
portal: SupportedPortal,
|
|
@@ -1185,7 +1202,7 @@ export async function runSubmission(
|
|
|
1185
1202
|
const withToken: RunDeps = {
|
|
1186
1203
|
...deps,
|
|
1187
1204
|
portalSite: site,
|
|
1188
|
-
refused: (
|
|
1205
|
+
refused: refusedWith(t.value.portal, site, found.value.variable),
|
|
1189
1206
|
};
|
|
1190
1207
|
const sending = { ...t.value, fields: ready.value.fields };
|
|
1191
1208
|
if (a.sub === "topics") return runTopics(sending, portal, withToken);
|
|
@@ -20,7 +20,8 @@ import { join } from "node:path";
|
|
|
20
20
|
import { createChecker } from "../lib/check.ts";
|
|
21
21
|
|
|
22
22
|
const R = await import("./tex-requirements.ts");
|
|
23
|
-
const { parseTemplate } =
|
|
23
|
+
const { parseTemplate, parseTemplateStyle } =
|
|
24
|
+
await import("./adapters/latex/index.ts");
|
|
24
25
|
const VENUES = (await import("./package-dirs.ts")).presetsDir();
|
|
25
26
|
|
|
26
27
|
const check = createChecker();
|
|
@@ -96,12 +97,25 @@ for (const v of acm) {
|
|
|
96
97
|
// Venues on ONE template must not drift apart: a second list is how the old installer's three
|
|
97
98
|
// dictionaries diverged. Since the ACM venues extend the `acm-sigconf` family, only the family
|
|
98
99
|
// declares the template's packages, so this holds by construction; the check stays for any two
|
|
99
|
-
// standalone presets that name the same template.
|
|
100
|
+
// standalone presets that name the same template. A template is its class AND the style it loads
|
|
101
|
+
// (`template_style`): NeurIPS's `article` + `neurips_2026` is not REALM's bare `article`.
|
|
102
|
+
const styleOf = (v: string): string =>
|
|
103
|
+
parseTemplateStyle(presetOf(v).templateStyle ?? "")?.name ?? "";
|
|
104
|
+
const templateKey = (v: string): string =>
|
|
105
|
+
`${String(templateOf(v))} + ${styleOf(v) || "no style"}`;
|
|
100
106
|
const byTemplate = new Map<unknown, string[]>();
|
|
101
107
|
for (const v of venues.filter((x) => presetOf(x).extends === null)) {
|
|
102
|
-
const t =
|
|
108
|
+
const t = templateKey(v);
|
|
103
109
|
byTemplate.set(t, [...(byTemplate.get(t) ?? []), v]);
|
|
104
110
|
}
|
|
111
|
+
// Guards: the key tells a style family from a bare class — else every article-based style would be
|
|
112
|
+
// held to REALM's list.
|
|
113
|
+
check(
|
|
114
|
+
"neurips-style and acl-latex are two templates: article + neurips_2026, article + no style",
|
|
115
|
+
templateKey("neurips-style") === "article + neurips_2026" &&
|
|
116
|
+
templateKey("acl-latex") === "article + no style",
|
|
117
|
+
`${templateKey("neurips-style")} · ${templateKey("acl-latex")}`,
|
|
118
|
+
);
|
|
105
119
|
for (const [t, vs] of byTemplate)
|
|
106
120
|
check(
|
|
107
121
|
`venues on template ${String(t)} declare the SAME packages (${vs.join(", ")})`,
|
package/src/tex-requirements.ts
CHANGED
|
@@ -211,6 +211,8 @@ export interface PresetFile {
|
|
|
211
211
|
readonly template: string | null;
|
|
212
212
|
/** Class options the venue forbids, read with `template`; empty when the file names none. */
|
|
213
213
|
readonly templateForbids: readonly string[];
|
|
214
|
+
/** The `\\usepackage` line of the style the template loads into its class; null when the file names none. */
|
|
215
|
+
readonly templateStyle: string | null;
|
|
214
216
|
/** Other names the venue goes by in a paper's text; empty when the file names none. */
|
|
215
217
|
readonly aliases: readonly string[];
|
|
216
218
|
/** Whether the venue reviews double-blind; null when the file does not say. */
|
|
@@ -285,6 +287,7 @@ interface PresetBodyJson {
|
|
|
285
287
|
readonly extends?: string;
|
|
286
288
|
readonly parent?: string;
|
|
287
289
|
readonly template?: string;
|
|
290
|
+
readonly template_style?: string;
|
|
288
291
|
readonly template_forbids?: readonly string[];
|
|
289
292
|
readonly aliases?: readonly string[];
|
|
290
293
|
readonly blind?: boolean;
|
|
@@ -553,8 +556,7 @@ export function parsePreset(
|
|
|
553
556
|
identity: identityOf(j),
|
|
554
557
|
extends: orNull(j.extends),
|
|
555
558
|
parent: orNull(j.parent),
|
|
556
|
-
|
|
557
|
-
templateForbids: j.template_forbids ?? [],
|
|
559
|
+
...templateOf(j),
|
|
558
560
|
aliases: j.aliases ?? [],
|
|
559
561
|
blind: orNull(j.blind),
|
|
560
562
|
requiredSections: sectionsOf(j.required_sections),
|
|
@@ -567,6 +569,15 @@ export function parsePreset(
|
|
|
567
569
|
};
|
|
568
570
|
}
|
|
569
571
|
|
|
572
|
+
/** A preset's template: its class line, the options it forbids, and the style it loads. */
|
|
573
|
+
const templateOf = (
|
|
574
|
+
j: PresetBodyJson,
|
|
575
|
+
): Pick<PresetFile, "template" | "templateForbids" | "templateStyle"> => ({
|
|
576
|
+
template: orNull(j.template),
|
|
577
|
+
templateForbids: j.template_forbids ?? [],
|
|
578
|
+
templateStyle: orNull(j.template_style),
|
|
579
|
+
});
|
|
580
|
+
|
|
570
581
|
/** The text of one preset → the TeX requirements it declares itself (none without a `tex` block). */
|
|
571
582
|
export function parseProfile(
|
|
572
583
|
text: string,
|