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.
@@ -23,7 +23,7 @@ Before publishing:
23
23
 
24
24
  ```bash
25
25
  bun run check:packages
26
- npm publish --dry-run --provenance
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 provenance:
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clean-code-tools",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "description": "Clean-code pattern corpus and lint tooling.",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.13",
package/pyproject.toml CHANGED
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "clean-code-tools-python"
9
- version = "1.0.1"
9
+ version = "1.0.4"
10
10
  description = "Python clean-code lint plugin and recommended Ruff/Pylint config."
11
11
  readme = "README.md"
12
12
  requires-python = ">=3.12"
@@ -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 json.loads(packed)[0]["files"]}
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",
package/uv.lock CHANGED
@@ -261,7 +261,7 @@ wheels = [
261
261
 
262
262
  [[package]]
263
263
  name = "clean-code-tools-python"
264
- version = "1.0.1"
264
+ version = "1.0.4"
265
265
  source = { editable = "." }
266
266
  dependencies = [
267
267
  { name = "pylint" },