Skip to content

Commit 8fb1651

Browse files
committed
docs: update metadata docs
1 parent 930817b commit 8fb1651

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66

77
-----
88
This package provides two Hatch plugins:
9-
- [version source plugin](https://hatch.pypa.io/latest/plugins/version-source/) that reads/writes the package version from the `version` field of the NodeJS `package.json` file.
10-
- [metadata hook plugin](https://hatch.pypa.io/latest/plugins/metadata-hook/) that reads PEP 621 metadata from the NodeJS `package.json` file.
119

10+
- [version source plugin](https://hatch.pypa.io/latest/plugins/version-source/) that reads/writes the package version
11+
from the `version` field of the NodeJS `package.json` file.
12+
- [metadata hook plugin](https://hatch.pypa.io/latest/plugins/metadata-hook/) that reads PEP 621 metadata from the
13+
NodeJS `package.json` file.
1214

1315
**Table of Contents**
1416

@@ -45,17 +47,19 @@ The [version source plugin](https://hatch.pypa.io/latest/plugins/version-source/
4547
[version]
4648
source = "nodejs"
4749
```
48-
50+
4951
### Semver
5052

5153
The semver specification defines the following version sections:
54+
5255
- `major`
5356
- `minor`
5457
- `patch`
5558
- `pre-release`
5659
- `build`
5760

5861
Meanwhile, [PEP 440](https://peps.python.org/pep-0440/#version-scheme) defines:
62+
5963
- `epoch`
6064
- `major`
6165
- `minor`
@@ -64,21 +68,22 @@ Meanwhile, [PEP 440](https://peps.python.org/pep-0440/#version-scheme) defines:
6468
- `post-release`
6569
- `dev-release`
6670

67-
In order to ensure round-trip support, and ensure semantic consistency between NodeJS and Python, this plugin only accepts the common version parts:
71+
In order to ensure round-trip support, and ensure semantic consistency between NodeJS and Python, this plugin only
72+
accepts the common version parts:
73+
6874
- `major`
6975
- `minor`
7076
- `patch`
7177
- `pre-release`
7278

73-
e.g. `1.2.3-rc0`.
79+
e.g. `1.2.3-rc0`.
7480

7581
### Version source options
7682

7783
| Option | Type | Default | Description |
7884
|---------------| --- |---------------|--------------------------------------------|
7985
| `path` | `str` | `package.json` | Relative path to the `package.json` file. |
8086

81-
8287
## Metadata hook
8388

8489
The [metadata hook plugin](https://hatch.pypa.io/dev/plugins/metadata-hook/reference/) name is `nodejs`.
@@ -97,12 +102,14 @@ The [metadata hook plugin](https://hatch.pypa.io/dev/plugins/metadata-hook/refer
97102

98103
### Metadata hook options
99104

100-
| Option | Type | Default | Description |
101-
|-------------------------------|-----------------|----------------|------------------------------------------------------------------------------------------------------------|
102-
| `path` | `str` | `package.json` | Relative path to the `package.json` file. |
103-
| `fields` | `list` of `str` | `None` | Optional list of `pyproject.toml` fields to take from their counterparts in `package.json`. |
104-
| `contributors-as-maintainers` | `bool` | `True` | Whether contributors in `package.json` should be considered maintainers (otherwise, treat them as authors).|
105-
105+
| Option | Type | Default | Description |
106+
|-------------------------------|-----------------|------------------|-------------------------------------------------------------------------------------------------------------|
107+
| `path` | `str` | `"package.json"` | Relative path to the `package.json` file. |
108+
| `fields` | `list` of `str` | `None` | Optional list of `pyproject.toml` fields to take from their counterparts in `package.json`. |
109+
| `contributors-as-maintainers` | `bool` | `True` | Whether contributors in `package.json` should be considered maintainers (otherwise, treat them as authors). |
110+
| `bugs-label` | `str` | `"Bug Tracker"` | The key in the URLs table of `pyproject.toml` that is populated by the `bugs` field in `package.json` |
111+
| `homepage-label` | `str` | `"Homepage"` | The key in the URLs table of `pyproject.toml` that is populated by the `homepage` field in `package.json` |
112+
| `repository-label` | `str` | `"Repository"` | The key in the URLs table of `pyproject.toml` that is populated by the `repository` field in `package.json` |
106113

107114
## License
108115

0 commit comments

Comments
 (0)