heroshot 0.5.0 → 0.7.0
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 +26 -68
- package/dist/cli.js +1186 -613
- package/dist/templates/heroshotReadme.txt +27 -0
- package/editor/dist/editor.js +351 -128
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -18,24 +18,22 @@ The manual fix is tedious: open browser, navigate, log in, screenshot, crop, sav
|
|
|
18
18
|
|
|
19
19
|
**Heroshot fixes this.** Define your screenshots once - point and click, no CSS selectors - and regenerate them with one command whenever you need.
|
|
20
20
|
|
|
21
|
+
```bash
|
|
22
|
+
npx heroshot
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
First run opens a browser with a visual picker. Click what you want, name it, done. Screenshots land in `heroshots/`, config saves to `.heroshot/config.json`. Next run regenerates everything headlessly.
|
|
26
|
+
|
|
21
27
|
<table align="center">
|
|
22
28
|
<tr>
|
|
23
|
-
<th></th>
|
|
24
|
-
<th>Light</th>
|
|
25
|
-
<th>Dark</th>
|
|
26
|
-
</tr>
|
|
27
|
-
<tr>
|
|
28
|
-
<th>Desktop</th>
|
|
29
29
|
<td><img src="https://github.com/omachala/heroshot/blob/main/docs/public/screenshots/hero-desktop-light.png?raw=true" alt="Desktop Light"></td>
|
|
30
30
|
<td><img src="https://github.com/omachala/heroshot/blob/main/docs/public/screenshots/hero-desktop-dark.png?raw=true" alt="Desktop Dark"></td>
|
|
31
31
|
</tr>
|
|
32
32
|
<tr>
|
|
33
|
-
<th>Tablet</th>
|
|
34
33
|
<td><img src="https://github.com/omachala/heroshot/blob/main/docs/public/screenshots/hero-tablet-light.png?raw=true" alt="Tablet Light"></td>
|
|
35
34
|
<td><img src="https://github.com/omachala/heroshot/blob/main/docs/public/screenshots/hero-tablet-dark.png?raw=true" alt="Tablet Dark"></td>
|
|
36
35
|
</tr>
|
|
37
36
|
<tr>
|
|
38
|
-
<th>Mobile</th>
|
|
39
37
|
<td><img src="https://github.com/omachala/heroshot/blob/main/docs/public/screenshots/hero-mobile-light.png?raw=true" alt="Mobile Light"></td>
|
|
40
38
|
<td><img src="https://github.com/omachala/heroshot/blob/main/docs/public/screenshots/hero-mobile-dark.png?raw=true" alt="Mobile Dark"></td>
|
|
41
39
|
</tr>
|
|
@@ -43,17 +41,9 @@ The manual fix is tedious: open browser, navigate, log in, screenshot, crop, sav
|
|
|
43
41
|
|
|
44
42
|
<p align="center"><em>6 screenshots from one config entry - always in sync with the live site.</em></p>
|
|
45
43
|
|
|
46
|
-
## Get Started
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
npx heroshot
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
First run opens a browser with a visual picker. Click what you want, name it, done. Screenshots land in `heroshots/`, config saves to `.heroshot/config.json`. Next run regenerates everything headlessly.
|
|
53
|
-
|
|
54
44
|
## Use in Your Docs
|
|
55
45
|
|
|
56
|
-
**VitePress**
|
|
46
|
+
**VitePress** · [Full guide](https://heroshot.sh/docs/integrations/vitepress)
|
|
57
47
|
|
|
58
48
|
```ts
|
|
59
49
|
// .vitepress/config.ts
|
|
@@ -62,26 +52,26 @@ export default defineConfig({ vite: { plugins: [heroshot()] } });
|
|
|
62
52
|
```
|
|
63
53
|
|
|
64
54
|
```vue
|
|
55
|
+
<script setup>
|
|
56
|
+
import { Heroshot } from 'heroshot/vue';
|
|
57
|
+
</script>
|
|
58
|
+
|
|
65
59
|
<Heroshot name="dashboard" alt="Dashboard" />
|
|
66
60
|
```
|
|
67
61
|
|
|
68
|
-
**Docusaurus**
|
|
62
|
+
**Docusaurus** · [Full guide](https://heroshot.sh/docs/integrations/docusaurus)
|
|
69
63
|
|
|
70
64
|
```js
|
|
71
65
|
// docusaurus.config.js
|
|
72
66
|
plugins: [['heroshot/plugins/docusaurus', {}]];
|
|
73
67
|
```
|
|
74
68
|
|
|
75
|
-
```
|
|
69
|
+
```tsx
|
|
76
70
|
import { Heroshot } from 'heroshot/docusaurus';
|
|
77
|
-
<Heroshot name="dashboard" alt="Dashboard"
|
|
71
|
+
<Heroshot name="dashboard" alt="Dashboard" />;
|
|
78
72
|
```
|
|
79
73
|
|
|
80
|
-
**MkDocs**
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
pip install heroshot
|
|
84
|
-
```
|
|
74
|
+
**MkDocs** · [Full guide](https://heroshot.sh/docs/integrations/mkdocs)
|
|
85
75
|
|
|
86
76
|
```yaml
|
|
87
77
|
# mkdocs.yml
|
|
@@ -96,53 +86,21 @@ plugins:
|
|
|
96
86
|
|
|
97
87
|
One component/macro, all variants - light/dark mode switches automatically, responsive sizes via srcset.
|
|
98
88
|
|
|
99
|
-
##
|
|
100
|
-
|
|
101
|
-
Keep screenshots always current by running heroshot in CI. Quick setup:
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
# Get your session key (for authenticated sites)
|
|
105
|
-
npx heroshot session-key
|
|
106
|
-
|
|
107
|
-
# Add to GitHub secrets
|
|
108
|
-
gh secret set HEROSHOT_SESSION_KEY
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Then create `.github/workflows/heroshot.yml`:
|
|
112
|
-
|
|
113
|
-
```yaml
|
|
114
|
-
name: Update Screenshots
|
|
115
|
-
|
|
116
|
-
on:
|
|
117
|
-
workflow_dispatch:
|
|
118
|
-
|
|
119
|
-
jobs:
|
|
120
|
-
screenshots:
|
|
121
|
-
runs-on: ubuntu-latest
|
|
122
|
-
steps:
|
|
123
|
-
- uses: actions/checkout@v4
|
|
124
|
-
- uses: actions/setup-node@v4
|
|
125
|
-
with:
|
|
126
|
-
node-version: 20
|
|
127
|
-
- run: npx heroshot
|
|
128
|
-
env:
|
|
129
|
-
HEROSHOT_SESSION_KEY: ${{ secrets.HEROSHOT_SESSION_KEY }}
|
|
130
|
-
- run: |
|
|
131
|
-
git config user.name "github-actions[bot]"
|
|
132
|
-
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
133
|
-
git add heroshots/
|
|
134
|
-
git diff --staged --quiet || git commit -m "chore: update screenshots" && git push
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Go to Actions → Update Screenshots → Run workflow. Done.
|
|
89
|
+
## Learn More
|
|
138
90
|
|
|
139
|
-
|
|
91
|
+
| | |
|
|
92
|
+
| ------------------- | --------------------------------------------------------------------- |
|
|
93
|
+
| **Documentation** | [heroshot.sh](https://heroshot.sh) |
|
|
94
|
+
| **Getting Started** | [Quick start guide](https://heroshot.sh/docs/getting-started) |
|
|
95
|
+
| **Configuration** | [Config options](https://heroshot.sh/docs/config) |
|
|
96
|
+
| **CI/CD Setup** | [Automated updates](https://heroshot.sh/docs/guide/automated-updates) |
|
|
97
|
+
| **CLI Reference** | [All commands & flags](https://heroshot.sh/docs/cli) |
|
|
140
98
|
|
|
141
|
-
##
|
|
99
|
+
## Contributing
|
|
142
100
|
|
|
143
|
-
|
|
101
|
+
This is a community project aiming to solve screenshot automation end-to-end and any feedback is valuable. Open an [issue](https://github.com/omachala/heroshot/issues) for bugs, questions, or feature requests. Pull requests are more than welcome.
|
|
144
102
|
|
|
145
|
-
|
|
103
|
+
If you like it, give the repo a ⭐
|
|
146
104
|
|
|
147
105
|
## License
|
|
148
106
|
|