@@ -70,21 +70,29 @@ In your project (wether theme or addon), you can write this in `valaxy.config.ts
7070export default defineValaxyConfig <ThemeConfig >({
7171 addons: [
7272 addonGitLog ({
73+ repositoryUrl: ' https://github.com/your-username/your-repository.git' ,
7374 contributor: {
7475 strategy: ' prebuilt' , // 'prebuilt' | 'build-time' | 'runtime',
7576 // logArgs: '--first-parent --follow',
7677 },
78+ changelog: {
79+ includeTypes: [' feat' , ' fix' ],
80+ includeBreaking: true ,
81+ },
7782 }),
7883 ],
7984})
8085```
8186
82- | Name | Type | Default | Description |
83- | ------------------------| --------------------------| --------------| -------------|
84- | repositoryUrl | ` string ` | ` undefined ` | GitHub repository URL |
85- | contributor.strategy | ` 'prebuilt' ` \| ` 'build-time' ` \| ` 'runtime' ` | ` 'prebuilt' ` | Data fetching strategy |
86- | contributor.logArgs | ` string ` | ` '' ` | Git log arguments (for 'prebuilt' and 'build-time') |
87- | contributor.githubToken| ` string ` | ` undefined ` | GitHub token (required for 'runtime' strategy) |
87+ | Name | Type | Default | Description |
88+ | ----------------------------- | --------------------------------------------- | ------------- | ---------------------------------------------------------------------------- |
89+ | repositoryUrl | ` string ` | ` undefined ` | GitHub repository URL |
90+ | contributor.strategy | ` 'prebuilt' ` \| ` 'build-time' ` \| ` 'runtime' ` | ` 'prebuilt' ` | Data fetching strategy |
91+ | contributor.logArgs | ` string ` | ` '' ` | Extra ` git log ` arguments (for ` 'prebuilt' ` and ` 'build-time' ` ) |
92+ | contributor.resolveGitHub | ` boolean ` | ` true ` | Look up GitHub usernames for non-noreply emails (requires ` repositoryUrl ` ) |
93+ | changelog.includeTypes | ` string[] ` | ` ['feat', 'fix'] ` | Conventional-commit types included in the changelog |
94+ | changelog.includeBreaking | ` boolean ` | ` true ` | Whether to include ` type!: ` / ` type(scope)!: ` breaking commits |
95+ | changelog.maxCount | ` number ` | ` 100 ` (` 1000 ` in CI) | Max commits per file pulled from ` git log ` |
8896
8997### Strategy Comparison
9098
@@ -175,6 +183,32 @@ export interface Contributor {
175183| github | ` string \| null ` | Only supported ` api ` mode |
176184| hash | ` string ` | A unique hash generated based on the contributor's email |
177185
186+ ### useGitLogState
187+
188+ Same data as ` useGitLog ` , but also exposes loading and error state — useful when rendering UI that depends on the prebuilt ` git-log.json ` fetch.
189+
190+ ``` ts
191+ import { useGitLogState } from ' valaxy-addon-git-log'
192+
193+ const { data, isLoading, error } = useGitLogState ()
194+ ```
195+
196+ ** Return Type:**
197+
198+ ``` ts
199+ {
200+ data : Ref < GitLog >
201+ isLoading : Ref < boolean >
202+ error : Ref < Error | null >
203+ }
204+ ```
205+
206+ | Name | Type | Description |
207+ | --------- | ------------------- | -------------------------------------------------------- |
208+ | ` data ` | ` Ref<GitLog> ` | Same shape as ` useGitLog ` . Updates once the fetch lands. |
209+ | ` isLoading ` | ` Ref<boolean> ` | ` true ` while ` git-log.json ` is being fetched. |
210+ | ` error ` | ` Ref<Error \| null> ` | Set if the fetch / parse fails (e.g. 404, bad JSON). |
211+
178212### useChangelog
179213
180214``` ts
@@ -187,31 +221,32 @@ const changelog = useChangelog()
187221
188222``` ts
189223export interface Changelog {
190- functions: string []
191- version? : string
192224 hash: string
193225 date: string
194226 message: string
195227 refs? : string
228+ /** @deprecated never reliably populated; will be removed in a future major */
196229 body? : string
197230 author_name: string
198231 author_email: string
232+ version? : string
233+ functions? : string []
199234}
200235
201236// type: Changelog[]
202237```
203238
204- | Name | Type | Description |
205- | -------------- | ----------------------- | ----------------------------------------------------------------------- |
206- | ` functions ` | ` string[] ` | List of functions affected or related to the changelog entry. |
207- | ` version ` | ` string ` \| ` undefined ` | Optional version number for the release or update. |
208- | ` hash ` | ` string ` | Unique identifier or commit hash for the change. |
209- | ` date ` | ` string ` | The date when the change was made or the changelog entry was created. |
210- | ` message ` | ` string ` | A brief summary or description of the change. |
211- | ` refs ` | ` string ` \| ` undefined ` | Optional reference information, such as ticket IDs or PR links. |
212- | ` body ` | ` string ` \| ` undefined ` | Optional detailed body content or additional explanation of the change. |
213- | ` author_name ` | ` string ` | Name of the person who made the change. |
214- | ` author_email ` | ` string ` | Email address of the person who made the change. |
239+ | Name | Type | Description |
240+ | -------------- | ----------------------- | ------------------------------------------------------------------------------------------- |
241+ | ` hash ` | ` string ` | Commit hash. |
242+ | ` date ` | ` string ` | ISO 8601 author date of the commit. |
243+ | ` message ` | ` string ` | Commit subject (first line). |
244+ | ` refs ` | ` string ` \| ` undefined ` | Reserved for refs metadata; currently always empty. |
245+ | ` body ` | ` string ` \| ` undefined ` | ** Deprecated ** — never reliably populated due to ` --name-only ` output collisions. |
246+ | ` author_name ` | ` string ` | Name of the commit author. |
247+ | ` author_email ` | ` string ` | Email of the commit author. |
248+ | ` version ` | ` string ` \| ` undefined ` | Parsed version, only set on ` chore: release vX.Y.Z ` commits. |
249+ | ` functions ` | ` string[] ` \| ` undefined ` | Workspace package names extracted from changed file paths (single-file ` getChangelog ` only). |
215250
216251## Other
217252
0 commit comments