A CLI for publishing standard.site documents to ATProto sequoia.pub
standard site lexicon cli publishing

Fix formatting #27

merged opened by heaths.dev targeting main from heaths.dev/sequoia: fix-build

Seems tangled doesn't fire pull_requeset triggers for PRs from forks. Odd, and concerning. Anyway, this fixes some formatting issues I noticed since the pipeline failed. Given the tests I added - and more might be good to consider - should a new "test" pipeline be added as well? Still, without external PRs triggering them, no checks will stop the PR from being merged incidentally.

Apparently it's by design: https://tangled.org/tangled.org/core/issues/338. A GitHub-style "Approve and run" would be nice at the very least.

Also of note: the latest nix package for biome is older: https://search.nixos.org/packages?channel=25.11&query=biome&show=biome. It generates a warning (not new) but doesn't fail the pipeline.

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:tg3tb5wukiml4xmxml6qm637/sh.tangled.repo.pull/3mffqtrdlnt22
+20 -6
Diff #0
+5 -1
packages/cli/src/lib/markdown.ts
··· 40 raw = toml.parse(frontmatterStr) as Record<string, unknown>; 41 } else { 42 // Use CORE_SCHEMA to keep dates as strings rather than Date objects 43 - raw = (yaml.load(frontmatterStr, { schema: yaml.CORE_SCHEMA }) as Record<string, unknown>) ?? {}; 44 } 45 46 // Apply field mappings to normalize to standard PostFrontmatter fields
··· 40 raw = toml.parse(frontmatterStr) as Record<string, unknown>; 41 } else { 42 // Use CORE_SCHEMA to keep dates as strings rather than Date objects 43 + raw = 44 + (yaml.load(frontmatterStr, { schema: yaml.CORE_SCHEMA }) as Record< 45 + string, 46 + unknown 47 + >) ?? {}; 48 } 49 50 // Apply field mappings to normalize to standard PostFrontmatter fields
+15 -5
packages/cli/test/markdown.test.ts
··· 79 --- 80 `; 81 const { rawFrontmatter } = parseFrontmatter(content); 82 - expect(rawFrontmatter.excerpt).toBe("This is a folded multiline string\n"); 83 }); 84 85 it("parses YAML stripped folded multiline string", () => { ··· 90 --- 91 `; 92 const { rawFrontmatter } = parseFrontmatter(content); 93 - expect(rawFrontmatter.excerpt).toBe("This is a stripped folded multiline string"); 94 }); 95 96 it("parses YAML literal multiline string", () => { ··· 101 --- 102 `; 103 const { rawFrontmatter } = parseFrontmatter(content); 104 - expect(rawFrontmatter.excerpt).toBe("This is a literal\nmultiline string\n"); 105 }); 106 107 it("parses YAML kept literal multiline string", () => { ··· 114 --- 115 `; 116 const { rawFrontmatter } = parseFrontmatter(content); 117 - expect(rawFrontmatter.excerpt).toBe("This is a kept literal\nmultiline string\n\n"); 118 }); 119 120 it("parses boolean true", () => { ··· 339 unpublished: true 340 --- 341 `; 342 - const { frontmatter } = parseFrontmatter(content, { draft: "unpublished" }); 343 expect(frontmatter.draft).toBe(true); 344 }); 345
··· 79 --- 80 `; 81 const { rawFrontmatter } = parseFrontmatter(content); 82 + expect(rawFrontmatter.excerpt).toBe( 83 + "This is a folded multiline string\n", 84 + ); 85 }); 86 87 it("parses YAML stripped folded multiline string", () => { ··· 92 --- 93 `; 94 const { rawFrontmatter } = parseFrontmatter(content); 95 + expect(rawFrontmatter.excerpt).toBe( 96 + "This is a stripped folded multiline string", 97 + ); 98 }); 99 100 it("parses YAML literal multiline string", () => { ··· 105 --- 106 `; 107 const { rawFrontmatter } = parseFrontmatter(content); 108 + expect(rawFrontmatter.excerpt).toBe( 109 + "This is a literal\nmultiline string\n", 110 + ); 111 }); 112 113 it("parses YAML kept literal multiline string", () => { ··· 120 --- 121 `; 122 const { rawFrontmatter } = parseFrontmatter(content); 123 + expect(rawFrontmatter.excerpt).toBe( 124 + "This is a kept literal\nmultiline string\n\n", 125 + ); 126 }); 127 128 it("parses boolean true", () => { ··· 347 unpublished: true 348 --- 349 `; 350 + const { frontmatter } = parseFrontmatter(content, { 351 + draft: "unpublished", 352 + }); 353 expect(frontmatter.draft).toBe(true); 354 }); 355

History

1 round 3 comments
sign up or login to add to the discussion
heaths.dev submitted #0
1 commit
expand
Fix formatting
expand 3 comments

It's just whitespace changes. I ran bun format. Would you be open to a .editorconfig that tells many supporting editors to use tabs for your repo? Catches the issue earlier.

Also, should bun dev run bun lint and bun format? Is it meant to be an all-encompassing dev command? I knew of bun but haven't used it prior so don't know what's idiomatic here. For npm/pnpm, some projects with which I'm involved do have something like that so it just does everything.

Of course, if tangled ran pipelines for forks that would also be nice and I could've caught this earlier.

Would you be open to a .editorconfig that tells many supporting editors to use tabs for your repo?

Sure! One of those finer details that hasn't come up until now with more contributors

should bun dev run bun lint and bun format?

It can! Bun is more used for package management and monorepo setup similar to pnpm so if you wanted to add that in you can. Would probably help streamlines things too.

Looks like biome might actually support some .editorconfig settings so I'll see if I can't use that to avoid some duplication. I'll try various scenarios. If it doesn't work (the older bug indicates there may be some rough edges), it's not like there's much duplication or these stylistic decisions change often, if ever.

pull request successfully merged