Skip to content

Commit 8f56e02

Browse files
committed
docs: clarify urlTemplate usage and repo_url derivation for registry target
1 parent 866ecfa commit 8f56e02

File tree

1 file changed

+34
-18
lines changed

1 file changed

+34
-18
lines changed

docs/src/content/docs/targets/registry.md

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,30 @@ Avoid having multiple `registry` targets—it supports batching multiple apps an
1111

1212
## Configuration
1313

14-
| Option | Description |
15-
|--------|-------------|
16-
| `apps` | Dict of app configs keyed by canonical name (e.g., `app:craft`) |
14+
| Option | Description |
15+
| ------ | ---------------------------------------------------------------------------- |
16+
| `apps` | Dict of app configs keyed by canonical name (e.g., `app:craft`) |
1717
| `sdks` | Dict of SDK configs keyed by canonical name (e.g., `maven:io.sentry:sentry`) |
1818

1919
### App/SDK Options
2020

21-
| Option | Description |
22-
|--------|-------------|
23-
| `urlTemplate` | URL template for download links |
24-
| `linkPrereleases` | Update for preview releases. Default: `false` |
25-
| `checksums` | List of checksum configs |
26-
| `onlyIfPresent` | Only run if matching file exists |
27-
| `name` | Human-readable name (used when creating new packages) |
28-
| `packageUrl` | Link to package registry page, e.g., npmjs.com (used when creating new packages) |
29-
| `mainDocsUrl` | Link to main documentation (used when creating new packages) |
30-
| `apiDocsUrl` | Link to API documentation (used when creating new packages) |
21+
| Option | Description |
22+
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23+
| `urlTemplate` | URL template for artifact download links in the manifest. Supports `{{version}}`, `{{file}}`, and `{{revision}}` variables. Primarily for apps and CDN-hosted assets—not needed for SDK packages installed from public registries (npm, PyPI, etc.) |
24+
| `linkPrereleases` | Update for preview releases. Default: `false` |
25+
| `checksums` | List of checksum configs |
26+
| `onlyIfPresent` | Only run if matching file exists |
27+
| `name` | Human-readable name (used when creating new packages) |
28+
| `packageUrl` | Link to package registry page, e.g., npmjs.com (used when creating new packages) |
29+
| `mainDocsUrl` | Link to main documentation (used when creating new packages) |
30+
| `apiDocsUrl` | Link to API documentation (used when creating new packages) |
3131

3232
### Checksum Configuration
3333

3434
```yaml
3535
checksums:
36-
- algorithm: sha256 # or sha384, sha512
37-
format: hex # or base64
36+
- algorithm: sha256 # or sha384, sha512
37+
format: hex # or base64
3838
```
3939
4040
## Example
@@ -46,7 +46,7 @@ targets:
4646
'npm:@sentry/browser':
4747
apps:
4848
'app:craft':
49-
urlTemplate: 'https://example.com/{{version}}/{{file}}'
49+
urlTemplate: 'https://downloads.sentry-cdn.com/craft/{{version}}/{{file}}'
5050
checksums:
5151
- algorithm: sha256
5252
format: hex
@@ -69,9 +69,25 @@ targets:
6969
name: 'Sentry WASM'
7070
packageUrl: 'https://www.npmjs.com/package/@sentry/wasm'
7171
mainDocsUrl: 'https://docs.sentry.io/platforms/javascript/'
72-
urlTemplate: 'https://example.com/{{version}}/{{file}}'
7372
```
7473
7574
## Manifest Metadata
7675
77-
The `repo_url` field is always derived from your GitHub repository configuration. When specified, the metadata fields (`name`, `packageUrl`, `mainDocsUrl`, `apiDocsUrl`) are applied to every release, allowing you to update package metadata by changing your `.craft.yml` configuration.
76+
### `repo_url`
77+
78+
The `repo_url` field is automatically set on every publish—it is not user-configurable per target. Craft resolves it in two ways:
79+
80+
1. **Auto-detection (default):** Craft reads the `origin` git remote URL and extracts the owner and repo. Both HTTPS (`https://github.com/org/repo.git`) and SSH (`git@github.com:org/repo.git`) formats are supported. For most repositories, no configuration is needed.
81+
82+
2. **Explicit config (rare):** If auto-detection isn't possible (e.g., the remote is not on `github.com`), you can provide it via a top-level `github` block in `.craft.yml`:
83+
```yaml
84+
github:
85+
owner: getsentry
86+
repo: sentry-javascript
87+
```
88+
89+
The value is always overwritten on every publish, so it stays in sync with the actual repository.
90+
91+
### Other metadata
92+
93+
When specified, the metadata fields (`name`, `packageUrl`, `mainDocsUrl`, `apiDocsUrl`) are applied to every release, allowing you to update package metadata by changing your `.craft.yml` configuration.

0 commit comments

Comments
 (0)