chore: move to JSON#237
Conversation
| export const generateMeetingAgenda = agendaIssues => { | ||
| // Format issues as markdown | ||
| let agendaMarkdown = ''; | ||
| const escapeTitle = title => title.replace(/([[\]])/g, '\\$1'); |
aduh95
left a comment
There was a problem hiding this comment.
It's a lot of changes to review, could you give more details on how you generate them and what to review?
|
This moves the |
|
OK but did you generate them? If you used a script, it'd be much easier to review the script and verifies I'm getting similar results when I run it |
|
I wrote them by hand using the original env files 😅 |
|
Using the following script to review: #!/usr/bin/env node
import path from 'node:path';
import { readFile, opendir, writeFile, rm } from 'node:fs/promises';
import { parseEnv } from 'node:util';
const TEMPLATES_DIR = new URL('./templates/', import.meta.url);
async function generateMeetingObject(tag) {
const {
AGENDA_TAG,
ISSUE_LABEL,
CALENDAR_FILTER,
GROUP_NAME,
HACKMD_TEAM_NAME,
ICAL_URL,
JOINING_INSTRUCTIONS,
HOST,
REPO,
USER,
} = parseEnv(await readFile(new URL(`./meeting_base_${tag}`, TEMPLATES_DIR), 'utf8'));
return {
name: GROUP_NAME,
host: HOST || USER,
calendar: {
filter: CALENDAR_FILTER,
url: ICAL_URL,
},
github: {
owner: USER,
repo: REPO,
agendaLabel: AGENDA_TAG,
issueLabels: ISSUE_LABEL,
},
hackmd: {
team: HACKMD_TEAM_NAME,
},
joining: {
participant: JOINING_INSTRUCTIONS.match(/\blink for participants: ?\<?([^\n]+?)\>?\n/i)?.[1],
observer: JOINING_INSTRUCTIONS.match(/\bFor those who just want to watch: ?\<?([^\n]+?)\>?\n/i)?.[1],
},
invited: (await readFile(new URL(`./invited_${tag}`, TEMPLATES_DIR), 'utf8')).trim().split(/(^|\n) ?\* ?/).filter(s => s.trim()),
}
}
for await (const dirent of await opendir(TEMPLATES_DIR)) {
if (dirent.isDirectory() || !dirent.name.startsWith('meeting_base_')) continue;
const tag = dirent.name.slice(13);
await writeFile(
new URL(`./meetings/${tag.toLowerCase()}.meeting.json`, import.meta.url),
JSON.stringify(await generateMeetingObject(tag), undefined, 2) + '\n'
);
}
await rm(TEMPLATES_DIR, { force: true, recursive: true });I'm seeing those differences with this PR. |
|
All the changes seem intentional |
|
There are conflicts to solve |
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Also supersedes #236, and fixes the issue mentioned in that PRs description.