putitoutthere 0.2.29 → 0.2.31

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.
Files changed (150) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/MIGRATIONS.md +1311 -0
  3. package/README.md +373 -41
  4. package/action.yml +9 -0
  5. package/dist/action.d.ts.map +1 -1
  6. package/dist/action.js +28 -6
  7. package/dist/action.js.map +1 -1
  8. package/dist/cascade.js +14 -7
  9. package/dist/cascade.js.map +1 -1
  10. package/dist/check-crate-size.d.ts +26 -0
  11. package/dist/check-crate-size.d.ts.map +1 -0
  12. package/dist/check-crate-size.js +99 -0
  13. package/dist/check-crate-size.js.map +1 -0
  14. package/dist/check.d.ts.map +1 -1
  15. package/dist/check.js +116 -16
  16. package/dist/check.js.map +1 -1
  17. package/dist/cli.d.ts +17 -4
  18. package/dist/cli.d.ts.map +1 -1
  19. package/dist/cli.js +173 -22
  20. package/dist/cli.js.map +1 -1
  21. package/dist/completeness.js +6 -3
  22. package/dist/completeness.js.map +1 -1
  23. package/dist/config.d.ts +2 -0
  24. package/dist/config.d.ts.map +1 -1
  25. package/dist/config.js +20 -5
  26. package/dist/config.js.map +1 -1
  27. package/dist/ensure-tag.d.ts +17 -0
  28. package/dist/ensure-tag.d.ts.map +1 -0
  29. package/dist/ensure-tag.js +28 -0
  30. package/dist/ensure-tag.js.map +1 -0
  31. package/dist/env.js +6 -3
  32. package/dist/env.js.map +1 -1
  33. package/dist/error-codes.d.ts +89 -0
  34. package/dist/error-codes.d.ts.map +1 -1
  35. package/dist/error-codes.js +102 -0
  36. package/dist/error-codes.js.map +1 -1
  37. package/dist/git.d.ts +5 -0
  38. package/dist/git.d.ts.map +1 -1
  39. package/dist/git.js +19 -6
  40. package/dist/git.js.map +1 -1
  41. package/dist/glob.d.ts +9 -0
  42. package/dist/glob.d.ts.map +1 -1
  43. package/dist/glob.js +29 -1
  44. package/dist/glob.js.map +1 -1
  45. package/dist/handlers/crates.d.ts +15 -0
  46. package/dist/handlers/crates.d.ts.map +1 -1
  47. package/dist/handlers/crates.js +84 -9
  48. package/dist/handlers/crates.js.map +1 -1
  49. package/dist/handlers/npm-platform.d.ts +11 -0
  50. package/dist/handlers/npm-platform.d.ts.map +1 -1
  51. package/dist/handlers/npm-platform.js +91 -8
  52. package/dist/handlers/npm-platform.js.map +1 -1
  53. package/dist/handlers/npm.d.ts.map +1 -1
  54. package/dist/handlers/npm.js +59 -9
  55. package/dist/handlers/npm.js.map +1 -1
  56. package/dist/handlers/pypi.d.ts +0 -6
  57. package/dist/handlers/pypi.d.ts.map +1 -1
  58. package/dist/handlers/pypi.js +28 -10
  59. package/dist/handlers/pypi.js.map +1 -1
  60. package/dist/log.js +16 -8
  61. package/dist/log.js.map +1 -1
  62. package/dist/normalize-artifacts.js +8 -4
  63. package/dist/normalize-artifacts.js.map +1 -1
  64. package/dist/plan-skew.d.ts +14 -0
  65. package/dist/plan-skew.d.ts.map +1 -0
  66. package/dist/plan-skew.js +28 -0
  67. package/dist/plan-skew.js.map +1 -0
  68. package/dist/plan-status-types.d.ts +42 -0
  69. package/dist/plan-status-types.d.ts.map +1 -0
  70. package/dist/plan-status-types.js +10 -0
  71. package/dist/plan-status-types.js.map +1 -0
  72. package/dist/plan-status.d.ts +23 -0
  73. package/dist/plan-status.d.ts.map +1 -0
  74. package/dist/plan-status.js +66 -0
  75. package/dist/plan-status.js.map +1 -0
  76. package/dist/plan.d.ts +8 -0
  77. package/dist/plan.d.ts.map +1 -1
  78. package/dist/plan.js +125 -25
  79. package/dist/plan.js.map +1 -1
  80. package/dist/preflight.d.ts +79 -0
  81. package/dist/preflight.d.ts.map +1 -1
  82. package/dist/preflight.js +715 -33
  83. package/dist/preflight.js.map +1 -1
  84. package/dist/publish.d.ts +7 -0
  85. package/dist/publish.d.ts.map +1 -1
  86. package/dist/publish.js +49 -18
  87. package/dist/publish.js.map +1 -1
  88. package/dist/python-versions.d.ts +40 -0
  89. package/dist/python-versions.d.ts.map +1 -0
  90. package/dist/python-versions.js +142 -0
  91. package/dist/python-versions.js.map +1 -0
  92. package/dist/reconcile-types.d.ts +36 -0
  93. package/dist/reconcile-types.d.ts.map +1 -0
  94. package/dist/reconcile-types.js +9 -0
  95. package/dist/reconcile-types.js.map +1 -0
  96. package/dist/reconcile.d.ts +21 -0
  97. package/dist/reconcile.d.ts.map +1 -0
  98. package/dist/reconcile.js +54 -0
  99. package/dist/reconcile.js.map +1 -0
  100. package/dist/release-packages.d.ts +33 -0
  101. package/dist/release-packages.d.ts.map +1 -0
  102. package/dist/release-packages.js +74 -0
  103. package/dist/release-packages.js.map +1 -0
  104. package/dist/resolve-tag-commit.d.ts +22 -0
  105. package/dist/resolve-tag-commit.d.ts.map +1 -0
  106. package/dist/resolve-tag-commit.js +26 -0
  107. package/dist/resolve-tag-commit.js.map +1 -0
  108. package/dist/retry.js +14 -7
  109. package/dist/retry.js.map +1 -1
  110. package/dist/status-classify.d.ts +17 -0
  111. package/dist/status-classify.d.ts.map +1 -0
  112. package/dist/status-classify.js +37 -0
  113. package/dist/status-classify.js.map +1 -0
  114. package/dist/status-format.d.ts +9 -0
  115. package/dist/status-format.d.ts.map +1 -0
  116. package/dist/status-format.js +19 -0
  117. package/dist/status-format.js.map +1 -0
  118. package/dist/status-types.d.ts +31 -0
  119. package/dist/status-types.d.ts.map +1 -0
  120. package/dist/status-types.js +8 -0
  121. package/dist/status-types.js.map +1 -0
  122. package/dist/status.d.ts +28 -0
  123. package/dist/status.d.ts.map +1 -0
  124. package/dist/status.js +72 -0
  125. package/dist/status.js.map +1 -0
  126. package/dist/tag-template.js +2 -1
  127. package/dist/tag-template.js.map +1 -1
  128. package/dist/trailer.js +16 -9
  129. package/dist/trailer.js.map +1 -1
  130. package/dist/types.d.ts +11 -0
  131. package/dist/types.d.ts.map +1 -1
  132. package/dist/types.js +4 -2
  133. package/dist/types.js.map +1 -1
  134. package/dist/verbose.js +7 -4
  135. package/dist/verbose.js.map +1 -1
  136. package/dist/wheel-abi.d.ts +37 -0
  137. package/dist/wheel-abi.d.ts.map +1 -0
  138. package/dist/wheel-abi.js +118 -0
  139. package/dist/wheel-abi.js.map +1 -0
  140. package/dist/write-crate-version.d.ts +32 -0
  141. package/dist/write-crate-version.d.ts.map +1 -0
  142. package/dist/write-crate-version.js +52 -0
  143. package/dist/write-crate-version.js.map +1 -0
  144. package/dist/write-launcher.d.ts +82 -0
  145. package/dist/write-launcher.d.ts.map +1 -0
  146. package/dist/write-launcher.js +236 -0
  147. package/dist/write-launcher.js.map +1 -0
  148. package/dist/write-version.js +2 -1
  149. package/dist/write-version.js.map +1 -1
  150. package/package.json +4 -2
package/dist/env.js CHANGED
@@ -82,16 +82,19 @@ export function buildSubprocessEnv(ctxEnv = {}, extras = {}) {
82
82
  const out = {};
83
83
  for (const name of DEFAULT_ENV_PASSTHROUGH) {
84
84
  const v = process.env[name];
85
- if (typeof v === 'string')
85
+ if (typeof v === 'string') {
86
86
  out[name] = v;
87
+ }
87
88
  }
88
89
  for (const [k, v] of Object.entries(ctxEnv)) {
89
- if (typeof v === 'string')
90
+ if (typeof v === 'string') {
90
91
  out[k] = v;
92
+ }
91
93
  }
92
94
  for (const [k, v] of Object.entries(extras)) {
93
- if (typeof v === 'string')
95
+ if (typeof v === 'string') {
94
96
  out[k] = v;
97
+ }
95
98
  }
96
99
  return out;
97
100
  }
package/dist/env.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,UAAU,QAAQ,CAAC,CAAqB;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3C,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,uBAAuB,GAAsB;IACjD,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS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AAQ,EAAE,CAAC;YAAA,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAAA,CAAC;IAC1C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -36,6 +36,15 @@ export declare const ErrorCodes: {
36
36
  * declares. Failing at preflight prevents wasting a build run on
37
37
  * a precondition checkable in milliseconds. #280. */
38
38
  readonly NPM_MISSING_REPOSITORY: "PIOT_NPM_MISSING_REPOSITORY";
39
+ /** An npm package's `package.json` declares a `name` that differs from
40
+ * the `[[package]].name` configured in `putitoutthere.toml` (or the
41
+ * `npm` override when set). `npm publish` packs the manifest `name`,
42
+ * but the engine's idempotency probe (`npm view <name>`) and the
43
+ * tag/URL bookkeeping use the configured name — so a divergence
44
+ * silently breaks idempotency and can publish under an unexpected
45
+ * name. The npm analogue of PIOT_PYPI_NAME_MISMATCH /
46
+ * PIOT_CRATES_NAME_MISMATCH. #301. */
47
+ readonly NPM_NAME_MISMATCH: "PIOT_NPM_NAME_MISMATCH";
39
48
  /** A crates package's `Cargo.toml` is missing one or more
40
49
  * required `[package]` metadata fields (`description` and
41
50
  * `license`/`license-file`). crates.io rejects the publish with
@@ -54,6 +63,86 @@ export declare const ErrorCodes: {
54
63
  * (the recommended path; setuptools-scm and the maturin
55
64
  * Cargo.toml-driven path are equally valid). */
56
65
  readonly PYPI_STATIC_VERSION: "PIOT_PYPI_STATIC_VERSION";
66
+ /** A pypi package's `pyproject.toml` declares a `[project].name` that
67
+ * differs from the `[[package]].name` configured in
68
+ * `putitoutthere.toml` (or the `pypi` override when set). The build
69
+ * tool will pack the wrong name and the upload either lands on the
70
+ * wrong registered project or 403s with a confusing "no such project"
71
+ * message. #301. */
72
+ readonly PYPI_NAME_MISMATCH: "PIOT_PYPI_NAME_MISMATCH";
73
+ /** A pypi package's `[build-system].build-backend` is set but does
74
+ * not match the configured `build` mode (e.g. `build = "maturin"`
75
+ * but the pyproject declares `hatchling.build`). The build tool
76
+ * surfaces a confusing tail-end error long after maturin has run.
77
+ * #301. */
78
+ readonly PYPI_BUILD_BACKEND_MISMATCH: "PIOT_PYPI_BUILD_BACKEND_MISMATCH";
79
+ /** A pypi package declares `dynamic = ["version"]` but no
80
+ * version-source backend block (`[tool.hatch.version]` /
81
+ * `[tool.setuptools_scm]`) is present, so the build backend has no
82
+ * way to compute a version at pack time. #301. */
83
+ readonly PYPI_DYNAMIC_VERSION_NO_BACKEND: "PIOT_PYPI_DYNAMIC_VERSION_NO_BACKEND";
84
+ /** A maturin pypi package declares `[package.bundle_cli]` but
85
+ * `[tool.maturin].include` does not cover the configured
86
+ * `bundle_cli.stage_to` path, so the cross-compiled binary will
87
+ * never make it inside the wheel. The post-build wheel-content
88
+ * guard catches it, but only after maturin has run. #301. */
89
+ readonly PYPI_MATURIN_INCLUDE_MISSING: "PIOT_PYPI_MATURIN_INCLUDE_MISSING";
90
+ /** A crates package's `Cargo.toml` declares a `[package].name` that
91
+ * differs from the `[[package]].name` configured in
92
+ * `putitoutthere.toml` (or the `crate` override when set). cargo
93
+ * publish will pack the wrong crate, often 404'ing on the registry
94
+ * side after a verification build that took 10+ minutes. #301. */
95
+ readonly CRATES_NAME_MISMATCH: "PIOT_CRATES_NAME_MISMATCH";
96
+ /** A `bundle_cli.bin` is configured but the target `Cargo.toml` has
97
+ * no `[[bin]]` table with that name (and the implicit-bin name
98
+ * derived from `[package].name` does not match either). `cargo
99
+ * build --bin <bin>` fails with `no bin target named ...` mid-
100
+ * build. #301. */
101
+ readonly CRATES_MISSING_BIN: "PIOT_CRATES_MISSING_BIN";
102
+ /** A `features` list (either on a `kind = "crates"` package or on
103
+ * a `bundle_cli` block) references a feature that the target
104
+ * `Cargo.toml` does not declare in `[features]`. `cargo build
105
+ * --features <list>` fails with `Package ... does not have these
106
+ * features`. #301. */
107
+ readonly CRATES_FEATURE_NOT_DECLARED: "PIOT_CRATES_FEATURE_NOT_DECLARED";
108
+ /** A crates package's `Cargo.toml` declares `version.workspace =
109
+ * true`, but no ancestor `Cargo.toml` with a `[workspace]` table
110
+ * declares `[workspace.package].version`. cargo fails with
111
+ * `error: failed to inherit "version" from workspace`. #301. */
112
+ readonly CRATES_WORKSPACE_VERSION_MISMATCH: "PIOT_CRATES_WORKSPACE_VERSION_MISMATCH";
113
+ /** crates.io rejected `cargo publish` because the crate has never been
114
+ * published. Trusted Publishing on crates.io binds to an
115
+ * already-published crate — the OIDC mint succeeds, the exchanged
116
+ * token reaches cargo, but the registry returns 404 ("crate `<name>`
117
+ * does not exist or you do not have permission to publish to it").
118
+ * The fix is one bootstrap publish with a classic `CARGO_REGISTRY_TOKEN`;
119
+ * trusted publishing works for every release after. #284. */
120
+ readonly CRATES_FIRST_PUBLISH_TP_REJECTED: "PIOT_CRATES_FIRST_PUBLISH_TP_REJECTED";
121
+ /** A crates package's `.crate`, as produced by `cargo package`, is
122
+ * larger than crates.io's 10 MiB (`10485760`-byte) upload limit.
123
+ * `cargo publish` would fail with `413 Payload Too Large` only
124
+ * mid-release, after the verification build; `runChecks` reproduces
125
+ * the tarball at PR time so the regression is caught before merge.
126
+ * A tracked symlink pointing into a build directory, or a missing
127
+ * `[package].exclude`, is the usual cause of build output landing
128
+ * in the crate. #362. */
129
+ readonly CRATES_PACKAGE_TOO_LARGE: "PIOT_CRATES_PACKAGE_TOO_LARGE";
130
+ /** A manifest's declared repository URL resolves to a different
131
+ * `owner/repo` than the GitHub repository the workflow is running
132
+ * from (`GITHUB_REPOSITORY`). npm's provenance verification compares
133
+ * `package.json#repository.url` against the OIDC source claim and
134
+ * returns a 422 after artifact upload — Cargo.toml `[package].repository`
135
+ * and pyproject.toml `[project.urls]` carry the same risk on
136
+ * crates.io / PyPI trusted-publisher paths. Failing at preflight
137
+ * catches the mismatch in milliseconds. */
138
+ readonly REPO_URL_MISMATCH: "PIOT_REPO_URL_MISMATCH";
139
+ /** The GitHub repository the workflow is running from is private.
140
+ * putitoutthere refuses to publish from a private repository:
141
+ * npm provenance attestations embed a source-ref pointer that
142
+ * consumers cannot dereference when the repo is private, and the
143
+ * same source-visibility expectation underpins the trusted-publisher
144
+ * story on the other registries. */
145
+ readonly REPO_PRIVATE: "PIOT_REPO_PRIVATE";
57
146
  };
58
147
  export type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
59
148
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../src/error-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,UAAU;IACrB;;;8CAG0C;;IAE1C;;;;;;kDAM8C;;IAE9C;;;;;0DAKsD;;IAEtD;;;;;;iCAM6B;;IAE7B;;;;;;;;qDAQiD;;CAEzC,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,SAAS,EAM/C,CAAC"}
1
+ {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../src/error-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,UAAU;IACrB;;;8CAG0C;;IAE1C;;;;;;kDAM8C;;IAE9C;;;;;0DAKsD;;IAEtD;;;;;;;2CAOuC;;IAEvC;;;;;;iCAM6B;;IAE7B;;;;;;;;qDAQiD;;IAEjD;;;;;yBAKqB;;IAErB;;;;gBAIY;;IAEZ;;;uDAGmD;;IAEnD;;;;kEAI8D;;IAE9D;;;;uEAImE;;IAEnE;;;;uBAImB;;IAEnB;;;;2BAIuB;;IAEvB;;;qEAGiE;;IAEjE;;;;;;kEAM8D;;IAE9D;;;;;;;8BAO0B;;IAE1B;;;;;;;gDAO4C;;IAE5C;;;;;yCAKqC;;CAE7B,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,SAAS,EAmB/C,CAAC"}
@@ -36,6 +36,15 @@ export const ErrorCodes = {
36
36
  * declares. Failing at preflight prevents wasting a build run on
37
37
  * a precondition checkable in milliseconds. #280. */
38
38
  NPM_MISSING_REPOSITORY: 'PIOT_NPM_MISSING_REPOSITORY',
39
+ /** An npm package's `package.json` declares a `name` that differs from
40
+ * the `[[package]].name` configured in `putitoutthere.toml` (or the
41
+ * `npm` override when set). `npm publish` packs the manifest `name`,
42
+ * but the engine's idempotency probe (`npm view <name>`) and the
43
+ * tag/URL bookkeeping use the configured name — so a divergence
44
+ * silently breaks idempotency and can publish under an unexpected
45
+ * name. The npm analogue of PIOT_PYPI_NAME_MISMATCH /
46
+ * PIOT_CRATES_NAME_MISMATCH. #301. */
47
+ NPM_NAME_MISMATCH: 'PIOT_NPM_NAME_MISMATCH',
39
48
  /** A crates package's `Cargo.toml` is missing one or more
40
49
  * required `[package]` metadata fields (`description` and
41
50
  * `license`/`license-file`). crates.io rejects the publish with
@@ -54,6 +63,86 @@ export const ErrorCodes = {
54
63
  * (the recommended path; setuptools-scm and the maturin
55
64
  * Cargo.toml-driven path are equally valid). */
56
65
  PYPI_STATIC_VERSION: 'PIOT_PYPI_STATIC_VERSION',
66
+ /** A pypi package's `pyproject.toml` declares a `[project].name` that
67
+ * differs from the `[[package]].name` configured in
68
+ * `putitoutthere.toml` (or the `pypi` override when set). The build
69
+ * tool will pack the wrong name and the upload either lands on the
70
+ * wrong registered project or 403s with a confusing "no such project"
71
+ * message. #301. */
72
+ PYPI_NAME_MISMATCH: 'PIOT_PYPI_NAME_MISMATCH',
73
+ /** A pypi package's `[build-system].build-backend` is set but does
74
+ * not match the configured `build` mode (e.g. `build = "maturin"`
75
+ * but the pyproject declares `hatchling.build`). The build tool
76
+ * surfaces a confusing tail-end error long after maturin has run.
77
+ * #301. */
78
+ PYPI_BUILD_BACKEND_MISMATCH: 'PIOT_PYPI_BUILD_BACKEND_MISMATCH',
79
+ /** A pypi package declares `dynamic = ["version"]` but no
80
+ * version-source backend block (`[tool.hatch.version]` /
81
+ * `[tool.setuptools_scm]`) is present, so the build backend has no
82
+ * way to compute a version at pack time. #301. */
83
+ PYPI_DYNAMIC_VERSION_NO_BACKEND: 'PIOT_PYPI_DYNAMIC_VERSION_NO_BACKEND',
84
+ /** A maturin pypi package declares `[package.bundle_cli]` but
85
+ * `[tool.maturin].include` does not cover the configured
86
+ * `bundle_cli.stage_to` path, so the cross-compiled binary will
87
+ * never make it inside the wheel. The post-build wheel-content
88
+ * guard catches it, but only after maturin has run. #301. */
89
+ PYPI_MATURIN_INCLUDE_MISSING: 'PIOT_PYPI_MATURIN_INCLUDE_MISSING',
90
+ /** A crates package's `Cargo.toml` declares a `[package].name` that
91
+ * differs from the `[[package]].name` configured in
92
+ * `putitoutthere.toml` (or the `crate` override when set). cargo
93
+ * publish will pack the wrong crate, often 404'ing on the registry
94
+ * side after a verification build that took 10+ minutes. #301. */
95
+ CRATES_NAME_MISMATCH: 'PIOT_CRATES_NAME_MISMATCH',
96
+ /** A `bundle_cli.bin` is configured but the target `Cargo.toml` has
97
+ * no `[[bin]]` table with that name (and the implicit-bin name
98
+ * derived from `[package].name` does not match either). `cargo
99
+ * build --bin <bin>` fails with `no bin target named ...` mid-
100
+ * build. #301. */
101
+ CRATES_MISSING_BIN: 'PIOT_CRATES_MISSING_BIN',
102
+ /** A `features` list (either on a `kind = "crates"` package or on
103
+ * a `bundle_cli` block) references a feature that the target
104
+ * `Cargo.toml` does not declare in `[features]`. `cargo build
105
+ * --features <list>` fails with `Package ... does not have these
106
+ * features`. #301. */
107
+ CRATES_FEATURE_NOT_DECLARED: 'PIOT_CRATES_FEATURE_NOT_DECLARED',
108
+ /** A crates package's `Cargo.toml` declares `version.workspace =
109
+ * true`, but no ancestor `Cargo.toml` with a `[workspace]` table
110
+ * declares `[workspace.package].version`. cargo fails with
111
+ * `error: failed to inherit "version" from workspace`. #301. */
112
+ CRATES_WORKSPACE_VERSION_MISMATCH: 'PIOT_CRATES_WORKSPACE_VERSION_MISMATCH',
113
+ /** crates.io rejected `cargo publish` because the crate has never been
114
+ * published. Trusted Publishing on crates.io binds to an
115
+ * already-published crate — the OIDC mint succeeds, the exchanged
116
+ * token reaches cargo, but the registry returns 404 ("crate `<name>`
117
+ * does not exist or you do not have permission to publish to it").
118
+ * The fix is one bootstrap publish with a classic `CARGO_REGISTRY_TOKEN`;
119
+ * trusted publishing works for every release after. #284. */
120
+ CRATES_FIRST_PUBLISH_TP_REJECTED: 'PIOT_CRATES_FIRST_PUBLISH_TP_REJECTED',
121
+ /** A crates package's `.crate`, as produced by `cargo package`, is
122
+ * larger than crates.io's 10 MiB (`10485760`-byte) upload limit.
123
+ * `cargo publish` would fail with `413 Payload Too Large` only
124
+ * mid-release, after the verification build; `runChecks` reproduces
125
+ * the tarball at PR time so the regression is caught before merge.
126
+ * A tracked symlink pointing into a build directory, or a missing
127
+ * `[package].exclude`, is the usual cause of build output landing
128
+ * in the crate. #362. */
129
+ CRATES_PACKAGE_TOO_LARGE: 'PIOT_CRATES_PACKAGE_TOO_LARGE',
130
+ /** A manifest's declared repository URL resolves to a different
131
+ * `owner/repo` than the GitHub repository the workflow is running
132
+ * from (`GITHUB_REPOSITORY`). npm's provenance verification compares
133
+ * `package.json#repository.url` against the OIDC source claim and
134
+ * returns a 422 after artifact upload — Cargo.toml `[package].repository`
135
+ * and pyproject.toml `[project.urls]` carry the same risk on
136
+ * crates.io / PyPI trusted-publisher paths. Failing at preflight
137
+ * catches the mismatch in milliseconds. */
138
+ REPO_URL_MISMATCH: 'PIOT_REPO_URL_MISMATCH',
139
+ /** The GitHub repository the workflow is running from is private.
140
+ * putitoutthere refuses to publish from a private repository:
141
+ * npm provenance attestations embed a source-ref pointer that
142
+ * consumers cannot dereference when the repo is private, and the
143
+ * same source-visibility expectation underpins the trusted-publisher
144
+ * story on the other registries. */
145
+ REPO_PRIVATE: 'PIOT_REPO_PRIVATE',
57
146
  };
58
147
  /**
59
148
  * Iterable form of the codes. Walked by tests for uniqueness/format
@@ -63,7 +152,20 @@ export const ALL_ERROR_CODES = [
63
152
  ErrorCodes.AUTH_NO_TOKEN,
64
153
  ErrorCodes.PUBLISH_EMPTY_PLAN,
65
154
  ErrorCodes.NPM_MISSING_REPOSITORY,
155
+ ErrorCodes.NPM_NAME_MISMATCH,
66
156
  ErrorCodes.CRATES_MISSING_METADATA,
67
157
  ErrorCodes.PYPI_STATIC_VERSION,
158
+ ErrorCodes.PYPI_NAME_MISMATCH,
159
+ ErrorCodes.PYPI_BUILD_BACKEND_MISMATCH,
160
+ ErrorCodes.PYPI_DYNAMIC_VERSION_NO_BACKEND,
161
+ ErrorCodes.PYPI_MATURIN_INCLUDE_MISSING,
162
+ ErrorCodes.CRATES_NAME_MISMATCH,
163
+ ErrorCodes.CRATES_MISSING_BIN,
164
+ ErrorCodes.CRATES_FEATURE_NOT_DECLARED,
165
+ ErrorCodes.CRATES_WORKSPACE_VERSION_MISMATCH,
166
+ ErrorCodes.CRATES_FIRST_PUBLISH_TP_REJECTED,
167
+ ErrorCodes.CRATES_PACKAGE_TOO_LARGE,
168
+ ErrorCodes.REPO_URL_MISMATCH,
169
+ ErrorCodes.REPO_PRIVATE,
68
170
  ];
69
171
  //# sourceMappingURL=error-codes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../src/error-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;;;8CAG0C;IAC1C,aAAa,EAAE,oBAAoB;IACnC;;;;;;kDAM8C;IAC9C,kBAAkB,EAAE,yBAAyB;IAC7C;;;;;0DAKsD;IACtD,sBAAsB,EAAE,6BAA6B;IACrD;;;;;;iCAM6B;IAC7B,uBAAuB,EAAE,8BAA8B;IACvD;;;;;;;;qDAQiD;IACjD,mBAAmB,EAAE,0BAA0B;CACvC,CAAC;AAIX;;;GAGG;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M,CAAC,MAAM,eAAe,GAAyB;IACnD,UAAU,CAAC,aAAa;IACxB,UAAU,CAAC,kBAAkB;IAC7B,UAAU,CAAC,sBAAsB;IACjC,UAAU,CAAC,iBAAiB;IAC5B,UAAU,CAAC,uBAAuB;IAClC,UAAU,CAAC,mBAAmB;IAC9B,UAAU,CAAC,kBAAkB;IAC7B,UAAU,CAAC,2BAA2B;IACtC,UAAU,CAAC,+BAA+B;IAC1C,UAAU,CAAC,4BAA4B;IACvC,UAAU,CAAC,oBAAoB;IAC/B,UAAU,CAAC,kBAAkB;IAC7B,UAAU,CAAC,2BAA2B;IACtC,UAAU,CAAC,iCAAiC;IAC5C,UAAU,CAAC,gCAAgC;IAC3C,UAAU,CAAC,wBAAwB;IACnC,UAAU,CAAC,iBAAiB;IAC5B,UAAU,CAAC,YAAY;CACxB,CAAC"}
package/dist/git.d.ts CHANGED
@@ -21,6 +21,11 @@ export declare function diffNames(from: string, to: string, opts?: GitOptions):
21
21
  export declare function tagList(glob: string, opts?: GitOptions): string[];
22
22
  export declare function createTag(name: string, sha: string, opts?: TagOptions): void;
23
23
  export declare function pushTag(name: string, opts?: GitOptions): void;
24
+ /**
25
+ * The commit a tag points at. `rev-list -n 1` dereferences an annotated
26
+ * tag down to the commit it ultimately references.
27
+ */
28
+ export declare function tagCommit(name: string, opts?: GitOptions): string;
24
29
  /**
25
30
  * Find the highest-semver tag for a given package.
26
31
  *
package/dist/git.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,UAAU,UAAW,SAAQ,UAAU;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAgDD,wBAAgB,UAAU,CAAC,IAAI,GAAE,UAAe,GAAG,MAAM,CAExD;AAED,wBAAgB,UAAU,CAAC,GAAG,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V,IAAI,GAAE,UAAe,GACpB,MAAM,EAAE,CAIV;AAID,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe,GAAG,MAAM,EAAE,CAIrE;AAED,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,UAAe,GACpB,IAAI,CAGN;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe,GAAG,IAAI,CAEjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe,GAAG,MAAM,CAErE;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CACrB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,UAAe,GACpB,MAAM,GAAG,IAAI,CAmBf"}
package/dist/git.js CHANGED
@@ -62,21 +62,24 @@ export function commitParents(sha, opts = {}) {
62
62
  // %P = parent SHAs, space-separated. Merge commits have ≥2;
63
63
  // plain commits have 1; root commits have 0.
64
64
  const out = run(['log', '-1', '--format=%P', sha], opts);
65
- if (out === '')
65
+ if (out === '') {
66
66
  return [];
67
+ }
67
68
  return out.split(' ').filter((s) => s.length > 0);
68
69
  }
69
70
  export function diffNames(from, to, opts = {}) {
70
71
  const out = run(['diff', '--name-only', `${from}..${to}`], opts);
71
- if (out === '')
72
+ if (out === '') {
72
73
  return [];
74
+ }
73
75
  return out.split('\n').filter((l) => l.length > 0);
74
76
  }
75
77
  /* ------------------------------ tags ------------------------------ */
76
78
  export function tagList(glob, opts = {}) {
77
79
  const out = run(['tag', '-l', glob], opts);
78
- if (out === '')
80
+ if (out === '') {
79
81
  return [];
82
+ }
80
83
  return out.split('\n').filter((l) => l.length > 0);
81
84
  }
82
85
  export function createTag(name, sha, opts = {}) {
@@ -86,6 +89,13 @@ export function createTag(name, sha, opts = {}) {
86
89
  export function pushTag(name, opts = {}) {
87
90
  run(['push', 'origin', name], opts);
88
91
  }
92
+ /**
93
+ * The commit a tag points at. `rev-list -n 1` dereferences an annotated
94
+ * tag down to the commit it ultimately references.
95
+ */
96
+ export function tagCommit(name, opts = {}) {
97
+ return run(['rev-list', '-n', '1', name], opts);
98
+ }
89
99
  /* -------------------------- last-tag resolver -------------------------- */
90
100
  /**
91
101
  * Find the highest-semver tag for a given package.
@@ -103,8 +113,9 @@ export function lastTag(packageName, tagFormat, opts = {}) {
103
113
  let best = null;
104
114
  for (const tag of candidates) {
105
115
  const versionPart = parseTagVersion(tagFormat, packageName, tag);
106
- if (versionPart === null)
116
+ if (versionPart === null) {
107
117
  continue;
118
+ }
108
119
  let parsed;
109
120
  try {
110
121
  parsed = parseSemver(versionPart);
@@ -121,10 +132,12 @@ export function lastTag(packageName, tagFormat, opts = {}) {
121
132
  }
122
133
  function greater(a, b) {
123
134
  /* v8 ignore next 2 -- comparison branches not all reachable from current test data */
124
- if (a.major !== b.major)
135
+ if (a.major !== b.major) {
125
136
  return a.major > b.major;
126
- if (a.minor !== b.minor)
137
+ }
138
+ if (a.minor !== b.minor) {
127
139
  return a.minor > b.minor;
140
+ }
128
141
  return a.patch > b.patch;
129
142
  }
130
143
  //# sourceMappingURL=git.js.map
package/dist/git.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAe,MAAM,cAAc,CAAC;AAUxD,wEAAwE;AAExE,SAAS,GAAG,CAAC,IAAc,EAAE,OAAmB,EAAE;IAChD,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE;YAC/B,GAAG,EAAE,IAAI,CAAC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,CAAC,EAAE,CAAC;YAC3C,IAAI,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,EAAE,GAAG,IAAI,IAAI,CAAC;AAC3B,CAAC;AAED,SAAS,OAAO,CAAC,CAAS,EAAE,CAAS;IACnC,sFAAsF;IACtF,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;QAAA,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IAAA,CAAC;IACpD,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;QAAA,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IAAA,CAAC;IACpD,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;AAC3B,CAAC"}
package/dist/glob.d.ts CHANGED
@@ -12,4 +12,13 @@
12
12
  */
13
13
  export declare function matchesGlob(pattern: string, path: string): boolean;
14
14
  export declare function matchesAny(patterns: readonly string[], path: string): boolean;
15
+ /**
16
+ * Expand a relative path glob against the filesystem, returning the
17
+ * directories it matches. Mirrors how cargo resolves `[workspace].members`
18
+ * entries: a literal entry (no glob metacharacter) resolves to a single
19
+ * path returned whether or not it exists — callers handle a missing
20
+ * directory — while a glob entry is matched one path segment at a time
21
+ * against the real directory tree, so only existing directories come back.
22
+ */
23
+ export declare function expandDirGlob(baseDir: string, pattern: string): string[];
15
24
  //# sourceMappingURL=glob.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAElE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK7E"}
1
+ {"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAaH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAElE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK7E;AAID;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAiBxE"}
package/dist/glob.js CHANGED
@@ -10,6 +10,8 @@
10
10
  *
11
11
  * Issue #10.
12
12
  */
13
+ import { existsSync, readdirSync } from 'node:fs';
14
+ import { join } from 'node:path';
13
15
  import { minimatch } from 'minimatch';
14
16
  const OPTS = {
15
17
  dot: true,
@@ -21,9 +23,35 @@ export function matchesGlob(pattern, path) {
21
23
  }
22
24
  export function matchesAny(patterns, path) {
23
25
  for (const p of patterns) {
24
- if (matchesGlob(p, path))
26
+ if (matchesGlob(p, path)) {
25
27
  return true;
28
+ }
26
29
  }
27
30
  return false;
28
31
  }
32
+ const GLOB_META = /[*?[\]{}]/;
33
+ /**
34
+ * Expand a relative path glob against the filesystem, returning the
35
+ * directories it matches. Mirrors how cargo resolves `[workspace].members`
36
+ * entries: a literal entry (no glob metacharacter) resolves to a single
37
+ * path returned whether or not it exists — callers handle a missing
38
+ * directory — while a glob entry is matched one path segment at a time
39
+ * against the real directory tree, so only existing directories come back.
40
+ */
41
+ export function expandDirGlob(baseDir, pattern) {
42
+ const segments = pattern.split('/').filter((s) => s.length > 0);
43
+ let dirs = [baseDir];
44
+ for (const segment of segments) {
45
+ if (!GLOB_META.test(segment)) {
46
+ dirs = dirs.map((d) => join(d, segment));
47
+ continue;
48
+ }
49
+ dirs = dirs
50
+ .filter((d) => existsSync(d))
51
+ .flatMap((d) => readdirSync(d, { withFileTypes: true })
52
+ .filter((e) => e.isDirectory() && matchesGlob(segment, e.name))
53
+ .map((e) => join(d, e.name)));
54
+ }
55
+ return dirs;
56
+ }
29
57
  //# sourceMappingURL=glob.js.map
package/dist/glob.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"glob.js","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,IAAI,GAAG;IACX,GAAG,EAAE,IAAI;IACT,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,IAAI,EAAE,oDAAoD;CAC7D,CAAC;AAEX,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,IAAY;IACvD,OAAO,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,QAA2B,EAAE,IAAY;IAClE,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,IAAI,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;IACxC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"glob.js","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,IAAI,GAAG;IACX,GAAG,EAAE,IAAI;IACT,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,IAAI,EAAE,oDAAoD;CAC7D,CAAC;AAEX,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,IAAY;IACvD,O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AC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAC/B,CAAC;IACN,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -27,6 +27,21 @@
27
27
  * up (same for classic token fallback).
28
28
  */
29
29
  import type { Handler } from '../types.js';
30
+ /**
31
+ * Match cargo's stderr shape when crates.io rejects the TP exchange
32
+ * because the crate has never been published. The fixture at
33
+ * `test/integration/fixtures/registry-responses/crates-io/publish-first-publish-tp-rejected.txt`
34
+ * captures the canonical shape; the catalog at
35
+ * `notes/upstream-behaviors.md` is the source of truth for the contract.
36
+ *
37
+ * Two anchors keep false positives out: a 404-status line and either
38
+ * the registry's "crate `<name>` does not exist" prose or the
39
+ * "trusted publish" mention. An unrelated 404 in some other cargo
40
+ * subcommand (e.g. a missing index file) won't carry the prose; an
41
+ * unrelated `does not exist` (e.g. a missing dependency) won't carry
42
+ * the 404 status.
43
+ */
44
+ export declare function looksLikeFirstPublishTpRejection(stderr: string | undefined): boolean;
30
45
  /**
31
46
  * Rewrites the first `version = "..."` assignment inside `[package]`.
32
47
  * Preserves everything else in the file byte-for-byte. Throws if the
@@ -1 +1 @@
1
- {"version":3,"file":"crates.d.ts","sourceRoot":"","sources":["../../src/handlers/crates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,KAAK,EAAO,OAAO,EAAiB,MAAM,aAAa,CAAC;AAiN/D;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAa3E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,MAAM,EACtB,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,GACtC,MAAM,EAAE,GAAG,IAAI,CA6FjB;AAQD,eAAO,MAAM,MAAM,EAAE,OAKpB,CAAC"}
1
+ {"version":3,"file":"crates.d.ts","sourceRoot":"","sources":["../../src/handlers/crates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,KAAK,EAAO,OAAO,EAAiB,MAAM,aAAa,CAAC;AAmO/D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAOpF;AAUD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAa3E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,MAAM,EACtB,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,GACtC,MAAM,EAAE,GAAG,IAAI,CA6FjB;AA8BD,eAAO,MAAM,MAAM,EAAE,OAMpB,CAAC"}