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