gcf-aif-ext 0.28.0 → 0.29.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/lib/integrate.js CHANGED
@@ -57,6 +57,8 @@ function dropLogs(dir) {
57
57
  * past the commit gate like a merge that needs no hand (git runs no pre-commit for it). `card`,
58
58
  * when given, may stop it too: main's text wins, the human's (a fix made while the branch waited).
59
59
  * True when the merge is done; false leaves the caller to abort it.
60
+ * @param {string} dir
61
+ * @param {string | null} [card]
60
62
  */
61
63
  async function mergedPastIndex(dir, card = null) {
62
64
  const unmerged = git(dir, ['diff', '--name-only', '--diff-filter=U'], { check: false })
@@ -129,6 +131,7 @@ async function syncWithMain(projectDir, dir, id) {
129
131
  git(dir, ['merge', '--no-edit', '-m', `gcf(sync): ${main}`, main], { check: false });
130
132
  const card = `gcf/work/${id}.md`;
131
133
  let res = merge();
134
+ /** @type {(() => void) | null} */
132
135
  let putBack = null;
133
136
  if (!res.ok && cardAloneHolds(dir, main, card)) {
134
137
  putBack = holdCard(dir, card);
@@ -295,6 +298,7 @@ function movedSinceMerge(projectDir, id) {
295
298
  * it took. Lines may be bullets. Empty when the plan has none.
296
299
  */
297
300
  export function planOutcome(text) {
301
+ /** @type {{decide: string | null, reason: string, assume: string[]}} */
298
302
  const out = { decide: null, reason: '', assume: [] };
299
303
  const at = String(text ?? '').search(/^## Outcome[ \t]*$/m);
300
304
  if (at < 0) return out;
package/lib/play-notes.js CHANGED
@@ -72,8 +72,11 @@ export function playNotesOf(planText) {
72
72
 
73
73
  /** The lines under each `### ` heading; a heading the format lacks goes to `unknown`. */
74
74
  function partsOf(block) {
75
+ /** @type {Record<string, string[]>} */
75
76
  const parts = Object.fromEntries(Object.keys(SECTIONS).map((k) => [k, []]));
77
+ /** @type {string[]} */
76
78
  const unknown = [];
79
+ /** @type {string | null | undefined} */
77
80
  let key = null;
78
81
  for (const line of block) {
79
82
  const h = /^###\s+(.+?)\s*$/.exec(line);
@@ -165,6 +168,7 @@ export function playNotesProblems(notes, rows) {
165
168
  /** The card's notes and their warnings, from its plan in `projectDir` (main or its worktree). */
166
169
  export async function playNotesCheck(projectDir, item) {
167
170
  const dir = path.resolve(projectDir);
171
+ /** @type {ReturnType<typeof playOf>} */
168
172
  let play = null;
169
173
  try {
170
174
  play = playOf(await readConfig(path.join(dir, 'gcf')));
package/lib/play-on.js CHANGED
@@ -8,11 +8,12 @@ const FIELDS = ['play_on', 'played_on'];
8
8
  * What the cards' build names lack. A line of game.md `platforms` (the old form) or a line of
9
9
  * words is a warning until Set up translates it; one word that names no build is an error. A
10
10
  * project with no `play:` (or a broken one: its own command says so) has no names to check.
11
- * @param {{data: object}[]} items
11
+ * @param {{data: Record<string, any>}[]} items
12
12
  * @param {string[]} platforms the `platforms` lines of game.md
13
13
  * @returns {{errors: string[], warnings: string[]}}
14
14
  */
15
15
  export function playOnIssues(items, config, platforms = []) {
16
+ /** @type {{errors: string[], warnings: string[]}} */
16
17
  const issues = { errors: [], warnings: [] };
17
18
  let play;
18
19
  try {