@hailstails/hone 0.1.0-pre.2 → 0.1.0-pre.3
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/ADOPTING.md +14 -14
- package/MIGRATING.md +1 -1
- package/README.md +11 -8
- package/package.json +1 -1
package/ADOPTING.md
CHANGED
|
@@ -18,11 +18,19 @@ Hone ships as one npm package tarball: built JavaScript with its own packages bu
|
|
|
18
18
|
|
|
19
19
|
**The npm package is named `@hailstails/hone`.** The unscoped name `hone` on npm belongs to an unrelated package: never run `npm install hone`. The package `@hailstails/hone` installs one command, `hone`. Its tarball is named `hailstails-hone-<version>.tgz`, the file name `npm pack` gives a scoped package. Version `0.1.0-pre.1` was released under the old name `honed`; [MIGRATING.md](MIGRATING.md#11-moving-from-honed-to-hailstailshone) says how to move from it.
|
|
20
20
|
|
|
21
|
-
The current version, `0.1.0-pre.
|
|
21
|
+
The current version, `0.1.0-pre.3`, is a pre-release: its commands, flags and files may still change before `0.1.0`.
|
|
22
22
|
|
|
23
|
-
The main route is
|
|
23
|
+
The main route is the npm registry. Pre-releases are published under the dist-tag `next`, so name it:
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
```bash
|
|
26
|
+
npm install --save-dev @hailstails/hone@next
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
npm records it in `package.json`, and the exact version it installed in the lockfile. Check the name before you run it: `@hailstails/hone`, never the unscoped `hone`. With pnpm or Yarn, add `@hailstails/hone@next` with their own `add -D` command at the workspace root. `next` names the newest pre-release approved on npm, so it can trail the newest GitHub release for a while; [README.md](README.md#developing-hone) says how a version reaches npm.
|
|
30
|
+
|
|
31
|
+
The alternative is a tarball, copied into the repository so every teammate and CI runner installs the same bytes without the registry. This page writes its location as `<hone-tarball>`: a path such as `vendor/hailstails-hone/hailstails-hone-0.1.0-pre.3.tgz`, or an `https://` URL your team serves it from. Download `hailstails-hone-0.1.0-pre.3.tgz` from the [`v0.1.0-pre.3` GitHub release](https://github.com/HailsTails/hone/releases/tag/v0.1.0-pre.3), which the release workflow creates, marked as a pre-release, when the tag `v0.1.0-pre.3` is pushed. Until that tag exists, use the [`v0.1.0-pre.2` release](https://github.com/HailsTails/hone/releases/tag/v0.1.0-pre.2), or build the tarball from a pinned commit as below; the earlier [`v0.1.0-pre.1` release](https://github.com/HailsTails/hone/releases/tag/v0.1.0-pre.1) holds the first pre-release under the old name `honed`.
|
|
32
|
+
|
|
33
|
+
To build the tarball yourself, install [bun](https://bun.sh) and pick the commit to pin, such as the latest on [`main`](https://github.com/HailsTails/hone/commits/main). Then run, with that commit's SHA in place of `<pinned-sha>`:
|
|
26
34
|
|
|
27
35
|
```bash
|
|
28
36
|
git clone -c core.longpaths=true https://github.com/HailsTails/hone.git /tmp/hone-source
|
|
@@ -30,7 +38,7 @@ git -C /tmp/hone-source checkout <pinned-sha>
|
|
|
30
38
|
cd /tmp/hone-source && bun install --frozen-lockfile && bun run pack-package && cd -
|
|
31
39
|
```
|
|
32
40
|
|
|
33
|
-
The last command prints `pack package: wrote <path>/artefacts/hailstails-hone-0.1.0-pre.
|
|
41
|
+
The last command prints `pack package: wrote <path>/artefacts/hailstails-hone-0.1.0-pre.3.tgz`. Copy the downloaded or built tarball into `<repo>/vendor/hailstails-hone/` and commit it with a message naming the release tag or the pinned SHA. The commands in this guide are POSIX shell; on Windows run them in Git Bash.
|
|
34
42
|
|
|
35
43
|
Install it as a development dependency of the repository root, beside the toolchain:
|
|
36
44
|
|
|
@@ -40,14 +48,6 @@ npm install --save-dev <hone-tarball>
|
|
|
40
48
|
|
|
41
49
|
npm records it in `package.json` and the lockfile. With pnpm or Yarn, add the same tarball with their own `add -D` command at the workspace root.
|
|
42
50
|
|
|
43
|
-
After the first registry publish of `@hailstails/hone`, the registry is a third route, with no tarball to copy or commit. Pre-releases are published under the dist-tag `next`, so name it:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
npm install --save-dev @hailstails/hone@next
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
npm records the exact version it installed in the lockfile. Check the name before you run it: `@hailstails/hone`, never the unscoped `hone`. Until that first publish, npm answers this command with `404 Not Found`; use one of the tarball routes above.
|
|
50
|
-
|
|
51
51
|
Add the two commands to the root `package.json` scripts:
|
|
52
52
|
|
|
53
53
|
```json
|
|
@@ -72,7 +72,7 @@ A repository that already has them in range needs nothing more. A package that i
|
|
|
72
72
|
|
|
73
73
|
Hone finds these by Node's resolution upward from where the package is installed, so in a monorepo they must resolve from the repository root: declare them in the root `package.json` (with pnpm, `pnpm add -Dw` at the versions the packages already use), even where packages also declare their own. Yarn Plug'n'Play is not supported, because Hone resolves the toolchain through `node_modules`.
|
|
74
74
|
|
|
75
|
-
Commit `package.json`, the lockfile and the tarball if it is a file in the repository. To update later, repeat this step with a newer tarball.
|
|
75
|
+
Commit `package.json`, the lockfile and the tarball if it is a file in the repository. To update later, run `npm install --save-dev @hailstails/hone@next` again, or repeat this step with a newer tarball.
|
|
76
76
|
|
|
77
77
|
## 3. Read what each discipline means
|
|
78
78
|
|
|
@@ -276,7 +276,7 @@ To use an agent, give it the lens file, the rule pages it names, the change and
|
|
|
276
276
|
|
|
277
277
|
To update, repeat step 2 on a branch with a tarball built from a newer pinned SHA, compare the installed rule pages under `node_modules/@hailstails/hone/rules/` with the old ones, re-run `hone:project` if any clause is `eslint`, run the check, and commit with a message naming the new SHA. Rule text can change between pins, so read the changed pages. Before updating to a pin that has the causal why-chain contract, follow [MIGRATING.md section 8](MIGRATING.md#8-moving-to-causal-why-chains): pass `--base-revision` first, or the update's check reports `legacy-chain-unmeasured`.
|
|
278
278
|
|
|
279
|
-
To remove, run `npm uninstall @hailstails/hone`, delete the two `hone:` scripts,
|
|
279
|
+
To remove, run `npm uninstall @hailstails/hone`, delete the two `hone:` scripts, any vendored tarball, `disciplines.json`, `discipline-exceptions.json` and, with `eslint` clauses, `disciplines.eslint.mjs` and its spread in the flat config, and take the check out of the validation script.
|
|
280
280
|
|
|
281
281
|
## Worked example
|
|
282
282
|
|
package/MIGRATING.md
CHANGED
|
@@ -231,7 +231,7 @@ Version `0.1.0-pre.1` was published as the GitHub release tarball `honed-0.1.0-p
|
|
|
231
231
|
| governance rule `honed/inline-config` | `hone-core/inline-config` |
|
|
232
232
|
| rule pages under `node_modules/honed/rules/` | `node_modules/@hailstails/hone/rules/` |
|
|
233
233
|
|
|
234
|
-
1. **Swap the package.** Run `npm uninstall honed`, then install `@hailstails/hone` as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 says: the tarball `hailstails-hone-0.1.0-pre.
|
|
234
|
+
1. **Swap the package.** Run `npm uninstall honed`, then install `@hailstails/hone` as [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 says: `npm install --save-dev @hailstails/hone@next`, or the tarball `hailstails-hone-0.1.0-pre.3.tgz` from the `v0.1.0-pre.3` release. Remove the vendored `honed-0.1.0-pre.1.tgz` if the repository keeps one, or replace it with the new tarball. `typescript` is now a required peer, where `honed` declared it optional: if the repository root does not already declare it, npm 7 and later install the newest supported release on their own, so add it to `devDependencies` at the version the repository uses.
|
|
235
235
|
2. **Re-project straight away** if any clause is `eslint`, before the check, the linter or anything else runs: `npm run --silent hone:project`, then commit `disciplines.eslint.mjs`. Until then the committed projection still imports `honed/...`, which is no longer installed, so the repository's own ESLint cannot load its configuration and the check stops with `load failure: runner-failed eslint team-config-unloadable Cannot find package 'honed' imported from ...disciplines.eslint.mjs` and exit 2. `hone project` does not load the old projection, so it runs and repairs it. Its import specifiers change from `honed/...` to `@hailstails/hone/...`, and its block names from `honed/...` to `hone-core/...`, in that same re-projection. The disciplines' rule ids `hone/...` and `hone-cd<N>/...` stay, so an `eslint-disable` comment, team config entry or suppression needs renaming only if it names `honed/inline-config`, which is now `hone-core/inline-config`.
|
|
236
236
|
3. **Keep the scripts.** `"hone:check": "hone check --repo ."` and `"hone:project": "hone project --repo ."` work unchanged, because the command is still `hone`.
|
|
237
237
|
4. **Repoint agent instructions** from `node_modules/honed/rules/` to `node_modules/@hailstails/hone/rules/`.
|
package/README.md
CHANGED
|
@@ -5,10 +5,10 @@ Hone checks a repository against the disciplines it has chosen to adopt. It is a
|
|
|
5
5
|
**Install the npm package `@hailstails/hone`.** The unscoped name `hone` on npm belongs to an unrelated package: never run `npm install hone`. `@hailstails/hone` installs one command, `hone`:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install --save-dev
|
|
8
|
+
npm install --save-dev @hailstails/hone@next
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Version `0.1.0-pre.
|
|
11
|
+
Version `0.1.0-pre.3` is a pre-release, and pre-releases are published to npm under the dist-tag `next`. The alternative is the tarball `hailstails-hone-0.1.0-pre.3.tgz`, downloaded from the [`v0.1.0-pre.3` GitHub release](https://github.com/HailsTails/hone/releases/tag/v0.1.0-pre.3) once that tag is pushed and installed with `npm install --save-dev <path-to-tarball>`. The earlier [`v0.1.0-pre.1` release](https://github.com/HailsTails/hone/releases/tag/v0.1.0-pre.1) holds the first pre-release under the package's old name, `honed`; [MIGRATING.md](MIGRATING.md#11-moving-from-honed-to-hailstailshone) says how to move from it. [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 has the steps, and the alternative of building the tarball from a pinned commit.
|
|
12
12
|
|
|
13
13
|
Two mechanisms ship: `audit`, a standalone TypeScript syntax walker, and `eslint`, which runs the clause as an ESLint rule inside the team's own ESLint setup. [rules/README.md](rules/README.md) lists every shared discipline with its clauses: the audit mechanism checks 20 disciplines, and ESLint pieces check clauses of CD-1, CD-6, CD-7, CD-10, CD-14, CD-27, CD-40, CD-41, CD-42 and CD-44. The rest are judgement rules, applied in review with the review methods in [methods/](methods/README.md).
|
|
14
14
|
|
|
@@ -143,7 +143,7 @@ At the repository root; absent means no exceptions. Each entry names a selected
|
|
|
143
143
|
|
|
144
144
|
## Installing
|
|
145
145
|
|
|
146
|
-
Hone installs as one npm package, `@hailstails/hone`, downloaded as `hailstails-hone-0.1.0-pre.
|
|
146
|
+
Hone installs as one npm package, `@hailstails/hone`, installed as `@hailstails/hone@next` from npm, downloaded as `hailstails-hone-0.1.0-pre.3.tgz` from the `v0.1.0-pre.3` GitHub release once that tag is pushed, or built by `bun run pack-package` into `artefacts/hailstails-hone-0.1.0-pre.3.tgz`, the file name `npm pack` gives the scoped package, and added to the repository root as a development dependency; [ADOPTING.md](ADOPTING.md#2-install-the-hone-package) step 2 has the steps. The package is plain JavaScript with `zod`, `jsonc-parser` and `@eslint/plugin-kit` bundled in, so it has no `dependencies`; its licences are reproduced in `THIRD-PARTY-NOTICES.md` inside it. It declares the toolchain as `peerDependencies`, `typescript` required and the ESLint packages optional, and exposes one command, `hone`, whose subcommands `hone check` and `hone project` are described under Commands. It ships the rule data and pages, both mechanisms, the review methods and the why-chain contract, and no TypeScript source. Version `0.1.0-pre.3` is a pre-release.
|
|
147
147
|
|
|
148
148
|
With the ESLint mechanism selected, a packaged install's projection imports each piece by package name, `@hailstails/hone/mechanisms/eslint/<DisciplineId>/...`, so the repository's ESLint must resolve the package from the repository root. Hone compares the committed projection `disciplines.eslint.mjs` byte for byte with what `hone project` would write now.
|
|
149
149
|
|
|
@@ -208,10 +208,13 @@ Continuous integration runs `check`, `build-package`, `package-determinism` and
|
|
|
208
208
|
|
|
209
209
|
A release starts from a pushed tag `v<version>` that matches the `version` in `package.json`. The release workflow runs `check`, `package-determinism` and `install-proof`, packs the tarball with `pack-package`, records the tarball's name and SHA-256 as outputs of the release job, and attaches it to a GitHub release for that tag. `gh release create` creates that release as a draft, uploads the tarball and only then publishes it, so with immutable releases on, the tarball is attached before the release's assets and tag become immutable. `scripts/release-text-command.ts` prints the release's title and notes from the identity, and its dist-tag: `next` when the version has a pre-release part such as `-pre.1` before any `+` build metadata, otherwise `latest`. The release is marked as a pre-release exactly when its dist-tag is `next`, and the step stops if any of the three cannot be printed. The release does not wait on npm.
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
A version reaches npm in four steps:
|
|
212
212
|
|
|
213
|
-
|
|
213
|
+
1. The pushed tag creates the GitHub release, as above.
|
|
214
|
+
2. A second job downloads that release's tarball, refuses it unless its SHA-256 equals the one the release job recorded in the same run, and stages it with `npm stage publish` under the release job's dist-tag. A staged version is held by npm and cannot be installed. Its dist-tag is fixed when it is staged.
|
|
215
|
+
3. The npm owner approves it, on npmjs.com under `@hailstails/hone`, Staged Packages, or with `npm stage approve <stage-id>`. Approval needs the owner's two-factor sign-in, so CI cannot approve.
|
|
216
|
+
4. The version is published under its dist-tag and installable.
|
|
214
217
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
+
The second job runs in the GitHub environment `npm`, which accepts only `v*` tags, and only when the repository variable `NPM_PUBLISH` is `enabled`; with any other value, or none, it is skipped and the release is unaffected. It authenticates by npm trusted publishing, so no npm token is stored. The trusted publisher is saved on npmjs.com under `@hailstails/hone`, Settings, Trusted publishing, GitHub Actions, as: user `HailsTails`, repository `hone`, workflow filename `release.yml`, environment `npm`, with both allowed actions, "npm publish" and "npm dist-tag", unticked, so CI can only stage. The published `package.json` carries `repository`, `homepage` and `bugs` from the identity's repository, which trusted publishing matches against this repository, and `publishConfig.access` `public`, because npm otherwise publishes a scoped package as restricted. `build-package` fails if a shipped page names the tarball at a version other than the one in `package.json`.
|
|
219
|
+
|
|
220
|
+
npm does not check a trusted publisher when it is saved, and one that has not completed a successful publish within 2 days of being added expires and can no longer be used or edited. npm's documentation does not say whether a staged publish counts as that first publish, so save the trusted publisher only just before pushing a tag, and approve the staged version within the same 2 days. A re-run of an older release run stages a version npm already has, so it cannot complete that first publish.
|
package/package.json
CHANGED