auditor-lambda 0.2.10 → 0.2.11

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/README.md CHANGED
@@ -183,6 +183,8 @@ The short version is:
183
183
  ```bash
184
184
  npm install
185
185
  npm run verify:release
186
+ npm run release:patch
187
+ npm run release:patch:publish
186
188
  ```
187
189
 
188
190
  For GitHub Actions publication and npm Trusted Publishing setup, see `docs/releasing.md`.
@@ -141,9 +141,13 @@ async function newestMtimeMs(path) {
141
141
  return newest;
142
142
  }
143
143
 
144
- async function shouldBuildDist() {
145
- if (!(await fileExists(distEntry))) {
146
- if (!(await fileExists(sourceRoot)) || !(await fileExists(tsconfigPath))) {
144
+ export async function shouldBuildDistForPaths({
145
+ distEntryPath,
146
+ sourceRootPath,
147
+ tsconfigPath: tsconfigPathValue,
148
+ }) {
149
+ if (!(await fileExists(distEntryPath))) {
150
+ if (!(await fileExists(sourceRootPath)) || !(await fileExists(tsconfigPathValue))) {
147
151
  throw new Error(
148
152
  'Bundled dist is missing and source files are unavailable for rebuild.',
149
153
  );
@@ -151,18 +155,25 @@ async function shouldBuildDist() {
151
155
  return true;
152
156
  }
153
157
 
154
- if (!(await fileExists(sourceRoot)) || !(await fileExists(tsconfigPath))) {
158
+ if (!(await fileExists(sourceRootPath)) || !(await fileExists(tsconfigPathValue))) {
155
159
  return false;
156
160
  }
157
161
 
158
- const distMtime = (await stat(distEntry)).mtimeMs;
159
- const sourceMtime = await newestMtimeMs(sourceRoot);
160
- const tsconfigMtime = (await stat(tsconfigPath)).mtimeMs;
161
- const packageJsonMtime = (await stat(packageJsonPath)).mtimeMs;
162
- const newestInput = Math.max(sourceMtime, tsconfigMtime, packageJsonMtime);
162
+ const distMtime = (await stat(distEntryPath)).mtimeMs;
163
+ const sourceMtime = await newestMtimeMs(sourceRootPath);
164
+ const tsconfigMtime = (await stat(tsconfigPathValue)).mtimeMs;
165
+ const newestInput = Math.max(sourceMtime, tsconfigMtime);
163
166
  return distMtime < newestInput;
164
167
  }
165
168
 
169
+ async function shouldBuildDist() {
170
+ return await shouldBuildDistForPaths({
171
+ distEntryPath: distEntry,
172
+ sourceRootPath: sourceRoot,
173
+ tsconfigPath,
174
+ });
175
+ }
176
+
166
177
  async function releaseBuildLock(handle) {
167
178
  try {
168
179
  await handle?.close();
package/docs/releasing.md CHANGED
@@ -41,6 +41,53 @@ npm publish --dry-run
41
41
 
42
42
  The local dry run is still valuable even though the real publish happens in GitHub Actions. It proves the packed artifact, lifecycle hooks, and publish metadata before you spend a release on a broken workflow run.
43
43
 
44
+ ## Version bump helpers
45
+
46
+ You do not need to look up the current version before cutting a release bump.
47
+
48
+ From the repository root:
49
+
50
+ ```bash
51
+ npm run release:patch
52
+ ```
53
+
54
+ That delegates the increment to `npm version patch`, updates `package.json` and `package-lock.json`, and creates the matching release commit and git tag in the existing repository format:
55
+
56
+ Under the hood, the helper uses `npm version patch --no-git-tag-version` and then creates the release commit and annotated git tag explicitly so the workflow stays compatible with current npm CLI behavior.
57
+
58
+ - commit: `release: vX.Y.Z`
59
+ - tag: `vX.Y.Z`
60
+
61
+ The repository also exposes:
62
+
63
+ - `npm run release:minor`
64
+ - `npm run release:major`
65
+
66
+ After the version bump, push `main` and the new tag, then publish through the GitHub Actions trusted publishing flow.
67
+
68
+ ## One-command release publish
69
+
70
+ When you want the repository to do the full maintainer flow in one command, use:
71
+
72
+ ```bash
73
+ npm run release:patch:publish
74
+ ```
75
+
76
+ That command:
77
+
78
+ 1. verifies the git worktree is clean and you are on `main`
79
+ 2. runs `npm run verify:release`
80
+ 3. bumps the version, commits `package.json` and `package-lock.json`, and creates the annotated release tag
81
+ 4. pushes `main` and the new release tag
82
+ 5. creates the matching GitHub Release
83
+ 6. waits for `publish-package.yml` to publish through Trusted Publishing
84
+ 7. confirms the new npm version resolves from the registry before exiting
85
+
86
+ Minor and major variants are also available:
87
+
88
+ - `npm run release:minor:publish`
89
+ - `npm run release:major:publish`
90
+
44
91
  ## Supported Node lines
45
92
 
46
93
  Routine CI currently exercises the repository on Node `20` and Node `22`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auditor-lambda",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "private": false,
5
5
  "description": "Portable hybrid code-auditing framework for arbitrary repositories.",
6
6
  "type": "module",
@@ -22,6 +22,12 @@
22
22
  "build": "tsc -p tsconfig.json",
23
23
  "check": "tsc -p tsconfig.json --noEmit",
24
24
  "test": "npm run build && node --test tests/*.test.mjs",
25
+ "release:patch": "node scripts/release-and-publish.mjs patch --bump-only",
26
+ "release:minor": "node scripts/release-and-publish.mjs minor --bump-only",
27
+ "release:major": "node scripts/release-and-publish.mjs major --bump-only",
28
+ "release:patch:publish": "node scripts/release-and-publish.mjs patch",
29
+ "release:minor:publish": "node scripts/release-and-publish.mjs minor",
30
+ "release:major:publish": "node scripts/release-and-publish.mjs major",
25
31
  "verify:release": "npm run check && npm test && npm run smoke:linked-audit-code && npm run smoke:packaged-audit-code",
26
32
  "smoke:linked-audit-code": "node scripts/smoke-linked-audit-code.mjs",
27
33
  "smoke:packaged-audit-code": "node scripts/smoke-packaged-audit-code.mjs",