@hecks/client 2.7.0 → 2.8.0

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 (2) hide show
  1. package/README.md +26 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -288,7 +288,7 @@ routes (it started with `HECKS_CHECKOUT_DOMAIN` naming its domain) to check the
288
288
 
289
289
  The package version equals `Hecks::VERSION` and is released together with the
290
290
  gem; `spec/hecks_client_version_spec.rb` fails when they differ, and
291
- `bin/release_gem` refuses to push the gem while they do. When
291
+ `bin/release` (and `bin/release_gem` on its own) refuses to publish while they do. When
292
292
  `lib/hecks/version.rb` changes, bump the package in the same change:
293
293
 
294
294
  ```sh
@@ -296,15 +296,34 @@ cd packages/hecks-client
296
296
  npm version <version> --no-git-tag-version # also updates package-lock.json
297
297
  ```
298
298
 
299
- `bin/release_gem` publishes the gem only. Publish the package from this
300
- directory once the gem is out (until the first publish, the tag install above is
301
- the way to consume it). npm is restricting tokens that bypass two-factor
302
- authentication, so publish from an account that can answer the prompt or set up
303
- trusted publishing, rather than relying on a long-lived token:
299
+ Pushing the release tag starts `.github/workflows/publish-client.yml`, which
300
+ publishes the package with npm trusted publishing: a short-lived identity
301
+ token from the workflow run, so no npm token and no one-time code is stored
302
+ anywhere. `bin/release` pushes the tag, publishes the gem, and waits for the
303
+ package to appear on npm (`bin/release --npm-only` waits again after a
304
+ re-run; a version npm already has is skipped).
305
+
306
+ One-time setup, by an owner of the `@hecks` scope, once the package exists:
307
+ on npmjs.com, package `@hecks/client` > Settings > Trusted Publisher > GitHub
308
+ Actions > organization or user `heckslabs`, repository `hecks`, workflow
309
+ filename `publish-client.yml`, environment blank.
310
+
311
+ The first publish, before that can be configured, and any emergency when CI is
312
+ down, is `bin/release --npm-local`. It publishes from this machine with a
313
+ token held in 1Password: the "publish token" field on the "npmjs.com" item in
314
+ the Hecks vault (`release/npm_publish.env` names the vault, item and field;
315
+ the setup is in the header of `bin/release`). That token must be a granular
316
+ token scoped Read and write to the `@hecks` scope with "Bypass two-factor
317
+ authentication" enabled, and short-lived: the account's second factor is a
318
+ passkey, so a token that requires a one-time code cannot publish (npm answers
319
+ `EOTP`). To publish by hand instead (`prepack` builds `dist/` first):
304
320
 
305
321
  ```sh
306
- npm publish --access public # `prepack` builds dist/ first
322
+ npm publish --access public
307
323
  ```
308
324
 
325
+ Until the first publish, the tag install above is the way to consume the
326
+ package.
327
+
309
328
  The steps as a whole are under "Releasing" in the repository's
310
329
  `CONTRIBUTING.md`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hecks/client",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "Client for the body-shaped dispatch protocol a Hecks host answers: read the domain, dispatch commands, read the answers.",
5
5
  "license": "Apache-2.0",
6
6
  "private": false,