clean-code-tools 1.0.1 → 1.0.4
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/docs/publishing.md +4 -2
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/check_packages.py +15 -1
- package/uv.lock +1 -1
package/docs/publishing.md
CHANGED
|
@@ -23,7 +23,7 @@ Before publishing:
|
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
25
|
bun run check:packages
|
|
26
|
-
npm publish --dry-run
|
|
26
|
+
npm publish --dry-run
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
The package must not set `private: true`; otherwise npm refuses publication. The
|
|
@@ -34,6 +34,8 @@ files:
|
|
|
34
34
|
- `.github/workflows/publish-main.yml`
|
|
35
35
|
|
|
36
36
|
The workflows use Node 24 so the bundled npm supports trusted publishing.
|
|
37
|
+
npm provenance can be re-enabled with `--provenance` if this repository is
|
|
38
|
+
public; npm rejects provenance for private GitHub repositories.
|
|
37
39
|
|
|
38
40
|
## Python / Pylint
|
|
39
41
|
|
|
@@ -113,7 +115,7 @@ Use SemVer for both registries:
|
|
|
113
115
|
|
|
114
116
|
## References
|
|
115
117
|
|
|
116
|
-
- npm publishing and
|
|
118
|
+
- npm publishing and trusted publishing:
|
|
117
119
|
<https://docs.github.com/en/actions/tutorials/publish-packages/publish-nodejs-packages>
|
|
118
120
|
- npm package versions are immutable after publish:
|
|
119
121
|
<https://docs.npmjs.com/cli/v11/commands/npm-publish/>
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
@@ -25,9 +25,23 @@ def run(command: list[str], *, cwd: Path = ROOT, check: bool = True) -> subproce
|
|
|
25
25
|
return completed
|
|
26
26
|
|
|
27
27
|
|
|
28
|
+
def npm_pack_payload(output: str) -> list[dict[str, object]]:
|
|
29
|
+
try:
|
|
30
|
+
payload = json.loads(output)
|
|
31
|
+
except json.JSONDecodeError:
|
|
32
|
+
start = output.find("[")
|
|
33
|
+
end = output.rfind("]")
|
|
34
|
+
if start == -1 or end == -1 or end <= start:
|
|
35
|
+
raise SystemExit(f"Could not parse npm pack JSON output:\n{output}") from None
|
|
36
|
+
payload = json.loads(output[start : end + 1])
|
|
37
|
+
if not isinstance(payload, list) or not payload:
|
|
38
|
+
raise SystemExit(f"Expected npm pack JSON array, got:\n{output}")
|
|
39
|
+
return payload
|
|
40
|
+
|
|
41
|
+
|
|
28
42
|
def check_npm_package() -> None:
|
|
29
43
|
packed = run(["npm", "pack", "--dry-run", "--json"]).stdout
|
|
30
|
-
package_files = {item["path"] for item in
|
|
44
|
+
package_files = {item["path"] for item in npm_pack_payload(packed)[0]["files"]}
|
|
31
45
|
required_files = {
|
|
32
46
|
"src/js/eslint-plugin-clean-code.mjs",
|
|
33
47
|
"configs/eslint.clean-code.recommended.mjs",
|