gitsona 0.1.2 → 0.1.3

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 CHANGED
@@ -1,109 +1,81 @@
1
1
  # gitsona
2
2
 
3
- Draws your GitHub profile README from what you actually do on GitHub. One command, no hosted service.
3
+ [![npm](https://img.shields.io/npm/v/gitsona)](https://www.npmjs.com/package/gitsona) [![CI](https://github.com/kanywst/gitsona/actions/workflows/ci.yml/badge.svg)](https://github.com/kanywst/gitsona/actions/workflows/ci.yml)
4
4
 
5
- ```sh
6
- npx gitsona
7
- ```
8
-
9
- To run the unreleased code on `main` instead, use `npx --allow-git=all github:kanywst/gitsona`. `--allow-git=all` is needed on npm 12 and later, which refuses packages fetched from git by default. Older npm ignores it.
10
-
11
- It reads your public activity, works out what you build and how you work, and writes a `README.md` and a folder of SVGs to `./<you>`. Push that folder to your `<you>/<you>` repository and it shows on your profile.
5
+ **Your GitHub profile README, drawn from what you actually do.**
12
6
 
13
7
  <picture>
14
8
  <source media="(prefers-color-scheme: dark)" srcset="docs/example/hero-dark.svg">
15
9
  <img alt="Example hero: a contour map of the last 12 months of contributions next to the name kt, the headline Security, authorization and AI agents, and four numbers" src="docs/example/hero-light.svg" width="100%">
16
10
  </picture>
17
11
 
18
- The example above and below is the author's own profile, drawn from live data.
12
+ It reads your public activity, works out what you build and how you work, and writes a `README.md` plus SVGs for your profile repo. Nothing is hosted: the images are plain files in your own repo and make no outside requests. The examples here are the author's profile, drawn from live data.
13
+
14
+ ## Two steps to your profile
15
+
16
+ 1. **Look.** `npx gitsona --preview`, then open `<you>/gitsona-preview.html`.
17
+ 2. **Ship.** `npx gitsona --push --action` commits it to your `<you>/<you>` repo (asks first), with a workflow that redraws it every Monday. Leave out `--action` to redraw by hand.
18
+
19
+ The token comes from `GITSONA_TOKEN`, `GITHUB_TOKEN`, `GH_TOKEN`, or `gh auth token`, and gitsona draws the account behind it. To draw someone else, name them: `npx gitsona octocat --preview`.
19
20
 
20
- ## What it draws
21
+ ## What it finds
21
22
 
22
- | Section | What it shows | Where it comes from |
23
- | --- | --- | --- |
24
- | Hero | Headline, one-line summary, four numbers, and the last 12 months as contour relief | Topics and descriptions of your repos, languages by bytes, contribution calendar |
25
- | Working style | Own repos or upstream, specialist or generalist, in bursts or every day, few or many projects | Each spectrum prints the numbers that placed the marker |
26
- | Rhythm | Weekday by hour of your commits, and commits per month | A year of commit search, read in each commit's own time zone |
27
- | Projects | Cards for notable repositories you have not pinned, since GitHub shows pins right below | Stars, releases, recent pushes and fit with your main domains |
28
- | Languages over time | The language mix of repositories created each year | Language bytes per repository |
29
- | Upstream | Projects owned by others where your pull requests were merged | PR search, with your own organizations left out |
23
+ **How you work.** Four spectra, each with the numbers that placed the marker.
30
24
 
31
25
  <picture>
32
26
  <source media="(prefers-color-scheme: dark)" srcset="docs/example/traits-dark.svg">
33
27
  <img alt="Working style: four spectra with evidence, such as 64 merged PRs across 46 projects owned by others" src="docs/example/traits-light.svg" width="100%">
34
28
  </picture>
35
29
 
30
+ **When you work.** Weekday by hour, read in each commit's own time zone.
31
+
36
32
  <picture>
37
33
  <source media="(prefers-color-scheme: dark)" srcset="docs/example/rhythm-dark.svg">
38
34
  <img alt="Rhythm: a weekday by hour dot grid with the 22:00 to 02:00 window highlighted, labelled Night owl" src="docs/example/rhythm-light.svg" width="100%">
39
35
  </picture>
40
36
 
37
+ **Where you give back.** Merged pull requests in projects owned by others.
38
+
41
39
  <picture>
42
40
  <source media="(prefers-color-scheme: dark)" srcset="docs/example/upstream-dark.svg">
43
41
  <img alt="Upstream: merged pull requests per project, led by dexidp/dex and spiffe/spire" src="docs/example/upstream-light.svg" width="100%">
44
42
  </picture>
45
43
 
46
- ## Usage
44
+ Plus project cards for notable repos you haven't pinned, and your language mix year by year. All six (`hero`, `traits`, `rhythm`, `projects`, `strata`, `upstream`) are drawn by default; `--sections` picks and orders them.
47
45
 
48
- ```sh
49
- npx gitsona [user] [options]
50
- ```
46
+ ## Pick a typeface
47
+
48
+ <picture>
49
+ <source media="(prefers-color-scheme: dark)" srcset="docs/fonts/presets-dark.svg">
50
+ <img alt="The six --font presets: pixel, geist, mono, grotesk, rounded and retro, each setting the words Night owl" src="docs/fonts/presets-light.svg" width="100%">
51
+ </picture>
52
+
53
+ `--font pixel` is the default. `--display-font your.otf` swaps in your own face for the name and headlines. The bundled faces are under the SIL Open Font License.
51
54
 
52
- With no user, it draws the account behind your token. The token comes from `GITHUB_TOKEN`, `GH_TOKEN`, or `gh auth token`.
55
+ ## Options
53
56
 
54
57
  | Option | Effect |
55
58
  | --- | --- |
56
- | `-o, --out <dir>` | Output directory. Defaults to `./<user>`, or `.` inside a `<user>/<user>` checkout |
57
- | `--preview` | Also write `gitsona-preview.html`, a local page framed like a GitHub profile with a light/dark switch |
58
- | `--push` | Create `<user>/<user>` if needed, commit and push. Asks before each step unless `-y` |
59
+ | `--preview` | Also write `gitsona-preview.html`, framed like a GitHub profile with a light/dark switch |
60
+ | `--push` | Create `<you>/<you>` if needed, commit and push. `-y` skips the questions |
59
61
  | `--action` | Add a weekly workflow that redraws the profile |
60
- | `--sections <list>` | Pick and order sections: `hero,traits,rhythm,projects,strata,upstream` |
61
- | `--font <name>` | Typeface preset, see below. Defaults to `pixel` |
62
- | `--display-font <file>` | Use your own `.ttf` or `.otf` for the name and headlines |
62
+ | `--sections <list>` | Pick and order sections, such as `hero,rhythm` |
63
+ | `--font <name>` | `pixel`, `geist`, `mono`, `grotesk`, `rounded` or `retro` |
63
64
  | `--accent <hex>` | Accent colour. Defaults to your top language's colour |
64
- | `--private` | Let private repositories count toward language and topic stats. Their names are never drawn |
65
- | `--no-motion` | Skip the contour draw-in on the hero |
66
- | `--no-cursor` | Leave out the accent `_` after your name |
67
- | `--save-raw <file>`, `--from-raw <file>` | Save the fetched data, or render from it without calling GitHub |
68
-
69
- `gitsona --help` lists everything.
70
-
71
- ## Typefaces
72
-
73
- Six presets ship with the package, all under the SIL Open Font License. The first face sets the name and headlines, the second the text and numbers.
74
-
75
- | `--font` | Faces |
76
- | --- | --- |
77
- | `pixel` | Pixelify Sans, Geist Mono |
78
- | `geist` | Geist Mono and Geist, Geist Mono |
79
- | `mono` | Geist Mono throughout |
80
- | `grotesk` | Space Grotesk, Space Mono |
81
- | `rounded` | Rubik throughout |
82
- | `retro` | Departure Mono, Geist Mono |
65
+ | `--private` | Count private repos in language and topic stats. Their names are never drawn |
83
66
 
84
- ![pixel](docs/fonts/pixel.svg)
85
-
86
- ![geist](docs/fonts/geist.svg)
87
-
88
- ![mono](docs/fonts/mono.svg)
89
-
90
- ![grotesk](docs/fonts/grotesk.svg)
91
-
92
- ![rounded](docs/fonts/rounded.svg)
93
-
94
- ![retro](docs/fonts/retro.svg)
67
+ `npx gitsona --help` lists the rest. Output goes to `./<you>`, or to `.` inside a `<you>/<you>` checkout; `-o` changes it.
95
68
 
96
69
  ## Re-running
97
70
 
98
- The generated part of `README.md` sits between `<!-- gitsona:start -->` and `<!-- gitsona:end -->`. Anything you write outside those markers stays. A README without markers keeps its old content below the new block; `--replace` overwrites it instead.
99
-
100
- With `--action`, a workflow redraws the profile every Monday and commits only when something changed. It runs the gitsona version that wrote it, so a new release never changes your profile on its own; run `--action` again to move to it. The default `GITHUB_TOKEN` sees public activity. For private contribution counts, add a token with read access to your repositories as the `GITSONA_TOKEN` secret.
71
+ - Only the block between `<!-- gitsona:start -->` and `<!-- gitsona:end -->` is redrawn. Anything you write outside it stays. A README without the markers keeps its old content below the new block; `--replace` overwrites the whole file instead.
72
+ - The weekly workflow commits only when something changed, and stays on the gitsona version that wrote it. Run `--action` again to upgrade. For private contribution counts, add a token with repo read access as the `GITSONA_TOKEN` secret.
101
73
 
102
74
  ## Notes
103
75
 
104
- - The images make no outside requests. Text is drawn as glyph outlines shaped with HarfBuzz, because GitHub serves README images under a CSP that can block embedded fonts. Characters outside the chosen faces, such as a name in kanji, fall back to the viewer's system font.
76
+ - Images make no outside requests. Text is drawn as glyph outlines shaped with HarfBuzz, since GitHub's image CSP can block embedded fonts. Characters outside the chosen faces, such as a name in kanji, fall back to the viewer's system font.
105
77
  - The GitHub mobile app ignores `<picture>` and always shows the light images.
106
- - Commit search only covers default branches. The rhythm panel is a sample of up to 100 commits per month, so it describes habits, not totals.
78
+ - Commit search covers default branches only, and the rhythm panel samples up to 100 commits per month: it describes habits, not totals.
107
79
 
108
80
  ## Development
109
81
 
@@ -111,10 +83,13 @@ With `--action`, a workflow redraws the profile every Monday and commits only wh
111
83
  bun install
112
84
  bun test
113
85
  bun src/cli.ts <user> --preview
86
+ # SVG to PNG with headless Chromium
114
87
  scripts/shot.sh out/<user>/gitsona/*.svg
88
+ # redraw docs/fonts/presets-*.svg
89
+ bun scripts/specimens.ts
115
90
  ```
116
91
 
117
- `scripts/shot.sh` renders SVGs to PNG with headless Chromium for a visual check.
92
+ To try unreleased `main`: `npx --allow-git=all github:kanywst/gitsona` (npm 12 and later need the flag).
118
93
 
119
94
  ## License
120
95
 
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Kept equal to package.json by test/version.test.ts; the release workflow runs that test before publishing. */
2
- export const VERSION = "0.1.2";
2
+ export const VERSION = "0.1.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitsona",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "One command to turn your real GitHub activity into a profile README that looks designed and says something true about you.",
5
5
  "type": "module",
6
6
  "bin": {