codebase-snapshot 0.9.0 → 0.9.1

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/CHANGELOG.md CHANGED
@@ -4,6 +4,53 @@ All notable changes to `codebase-snapshot`.
4
4
 
5
5
  ---
6
6
 
7
+ ## A note on version numbers
8
+
9
+ This package started its public life as `@ankurhalder/codebase-snapshot`, which reached 4.4.1. It
10
+ moved to the unscoped name and **restarted at 0.9.0**, so the numbers below are not a continuation of
11
+ the old line — `0.9.0` is newer than `4.4.1`, not older. 1.0.0 is reserved for when the CLI surface
12
+ is settled.
13
+
14
+ Two versions exist on the registry that are not releases, and both are deprecated:
15
+
16
+ | Version | What it is |
17
+ | :-- | :-- |
18
+ | `codebase-snapshot@4.5.0` | Published for about an hour under the new name before the scheme was reset to 0.9.0. Withdrawn, never the supported version. |
19
+ | `codebase-snapshot@0.0.0-stage` | npm's own staging placeholder, created automatically during the first publish of the name. Not a release. |
20
+
21
+ Deleting them requires account-level rights that the release pipeline does not have, so they are
22
+ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 since it existed.
23
+
24
+ ## 0.9.1
25
+
26
+ ### The documentation now derives its version from `package.json`
27
+
28
+ A documented version is a promise about the release, and every one of them was hand-written — so they
29
+ rotted silently at each bump. The README still described a `0.x` line whose numbers appeared nowhere
30
+ in it, `SECURITY.md` advertised **"4.x supported"** on a project whose latest release was 0.9.0, and
31
+ both `setup` examples printed `4.4.0` and `4.1.1` as the dependency the command adds.
32
+
33
+ Versions now live in exactly one place, and `scripts/sync-docs.mjs` writes them into the documentation:
34
+
35
+ - Prose carries marked spans — `<!--@majorMinor-->0.9<!--/@majorMinor-->` — which GitHub renders as
36
+ the value and hides as a comment.
37
+ - Code-block examples are matched by shape instead, because inside a fence an HTML comment is literal
38
+ text and the marker syntax would leak into the page.
39
+ - `npm run verify` fails when anything is out of step, and `npm run site` and `prepack` both sync
40
+ first, so the docs site and the published README cannot contradict the package they describe.
41
+
42
+ Changelog history is deliberately excluded. It records what happened at each version, and rewriting a
43
+ past entry would falsify that record rather than maintain it.
44
+
45
+ ### Other corrections in this pass
46
+
47
+ - `SECURITY.md` supported versions: 0.9.x, with a sentence explaining why 0.9.0 is newer than 4.4.1.
48
+ - The README states the pre-1.0 contract once, in wording that does not go stale.
49
+ - The changelog opens with a note on the version numbering, so the registry's three versions are not
50
+ a mystery to anyone reading them.
51
+ - The `v4.5.0` release and git tag were deleted; that version no longer exists on npm.
52
+
53
+ ---
7
54
  ## 0.9.0
8
55
 
9
56
  ### The package is now `codebase-snapshot`, unscoped
@@ -41,7 +88,7 @@ name on the next run, so an existing snapshot keeps working and is upgraded in p
41
88
 
42
89
  ### Documentation site
43
90
 
44
- The docs now have a crawlable home at <https://codebase-snapshot.ankurhalder.com>, generated from
91
+ The docs now have a crawlable home at <https://ankurhalder.github.io/codebase-snapshot/>, generated from
45
92
  `README.md` and `docs/` in this repository, with a sitemap, its own `robots.txt`, an `llms.txt` at
46
93
  the site root and a Markdown twin per page. GitHub's `robots.txt` blocks directory-tree and raw-file
47
94
  paths and publishes no repository sitemap, so `docs/` had no crawlable entry point before this.
package/README.md CHANGED
@@ -50,7 +50,7 @@ npx codebase-snapshot generate # no install, one-off
50
50
  npm install -D codebase-snapshot # or add it to a project
51
51
  ```
52
52
 
53
- This is a **0.x** release. Version numbers follow semver's 0.x conventions, so the CLI surface may change in a minor release until 1.0.0 — pin an exact version if you need a fixed surface today.`n`nAny npm-compatible client works — npm, yarn (classic and Berry with strict PnP), pnpm and bun —
53
+ This is a **<!--@major-->0<!--/@major-->.x** release. Version numbers follow semver's 0.x conventions, so the CLI surface may change in a minor release until 1.0.0 — pin an exact version if you need a fixed surface today.`n`nAny npm-compatible client works — npm, yarn (classic and Berry with strict PnP), pnpm and bun —
54
54
  each verified against the packed tarball before release. Requires **Node.js 18+**.
55
55
 
56
56
  Published from GitHub Actions with [build provenance](https://docs.npmjs.com/generating-provenance-statements): npm shows the tarball was built from this repository at a tagged commit, and `npm audit signatures` verifies it.
package/SECURITY.md CHANGED
@@ -6,8 +6,12 @@ Only the latest published release receives security fixes.
6
6
 
7
7
  | Version | Supported |
8
8
  | :--- | :--- |
9
- | 4.x | ✅ |
10
- | 3.x and older | ❌ |
9
+ | <!--@majorMinor-->0.9<!--/@majorMinor-->.x | ✅ |
10
+ | anything older | ❌ |
11
+
12
+ The number line restarted at 0.9.0 when the package moved to the unscoped `codebase-snapshot` name,
13
+ so <!--@majorMinor-->0.9<!--/@majorMinor-->.x is newer than 4.4.1, not older. That is explained in full in the
14
+ [changelog](CHANGELOG.md#a-note-on-version-numbers).
11
15
 
12
16
  ## Reporting a vulnerability
13
17
 
package/dist/bin.js CHANGED
@@ -4294,7 +4294,7 @@ function gitignorePath(cwd, filePath) {
4294
4294
 
4295
4295
  // src/version.ts
4296
4296
  var GENERATOR_NAME = "codebase-snapshot";
4297
- var GENERATOR_VERSION = "0.9.0";
4297
+ var GENERATOR_VERSION = "0.9.1";
4298
4298
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
4299
4299
  function isOurGeneratorName(name) {
4300
4300
  if (typeof name !== "string") return false;
@@ -8148,7 +8148,7 @@ function buildAgentContract() {
8148
8148
  id: "verify",
8149
8149
  run: `npx ${PACKAGE_NAME}@latest --version`,
8150
8150
  // The requirement is the major version; the exact build is context. A
8151
- // floating tag may print 4.0.7 today and 4.0.9 next week, and an agent
8151
+ // floating tag may print a different patch today than next week, and an agent
8152
8152
  // must not conclude that a working tool is broken because of a patch.
8153
8153
  expect: `prints v${MAJOR_VERSION} or newer on stdout and exits 0 (this build is v${GENERATOR_VERSION}: compare the major version, not the patch)`,
8154
8154
  notes: `If it prints an older major than this contract's, the @latest tag is behind the release: pin the exact version with \`npx ${PACKAGE_NAME}@${GENERATOR_VERSION} --version\` instead of retrying @latest. If it prints nothing, clear the npm cache and retry, or use \`npx -p <pkg> codebase-snapshot\`.`
@@ -5421,7 +5421,7 @@ function validateSnapshot(configInput) {
5421
5421
 
5422
5422
  // src/version.ts
5423
5423
  var GENERATOR_NAME = "codebase-snapshot";
5424
- var GENERATOR_VERSION = "0.9.0";
5424
+ var GENERATOR_VERSION = "0.9.1";
5425
5425
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
5426
5426
  function isOurGeneratorName(name) {
5427
5427
  if (typeof name !== "string") return false;
@@ -7881,5 +7881,5 @@ async function generateSnapshotAsync(configInput, options) {
7881
7881
  }
7882
7882
 
7883
7883
  export { ARTIFACT_NAMES, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, GENERATOR_NAME, GENERATOR_VERSION, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, PRESETS, PromptCancelled, SCHEMA_VERSION, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, describeManifestShapeProblem, detectLanguage, detectPreset, escapeControls, explainPath, fenceForContent, fenceForText, formatNumber, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, gitignorePath, globToRegExp, isBinaryBuffer, isBinaryExtension, isBinaryFile, isDiscoveryMode, isInteractive, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, unknownPresetMessage, validateSnapshot };
7884
- //# sourceMappingURL=chunk-FJ4RQYY2.js.map
7885
- //# sourceMappingURL=chunk-FJ4RQYY2.js.map
7884
+ //# sourceMappingURL=chunk-HT7J3NWT.js.map
7885
+ //# sourceMappingURL=chunk-HT7J3NWT.js.map
package/dist/cli.cjs CHANGED
@@ -4286,7 +4286,7 @@ function gitignorePath(cwd, filePath) {
4286
4286
 
4287
4287
  // src/version.ts
4288
4288
  var GENERATOR_NAME = "codebase-snapshot";
4289
- var GENERATOR_VERSION = "0.9.0";
4289
+ var GENERATOR_VERSION = "0.9.1";
4290
4290
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
4291
4291
  function isOurGeneratorName(name) {
4292
4292
  if (typeof name !== "string") return false;
@@ -8119,7 +8119,7 @@ function buildAgentContract() {
8119
8119
  id: "verify",
8120
8120
  run: `npx ${PACKAGE_NAME}@latest --version`,
8121
8121
  // The requirement is the major version; the exact build is context. A
8122
- // floating tag may print 4.0.7 today and 4.0.9 next week, and an agent
8122
+ // floating tag may print a different patch today than next week, and an agent
8123
8123
  // must not conclude that a working tool is broken because of a patch.
8124
8124
  expect: `prints v${MAJOR_VERSION} or newer on stdout and exits 0 (this build is v${GENERATOR_VERSION}: compare the major version, not the patch)`,
8125
8125
  notes: `If it prints an older major than this contract's, the @latest tag is behind the release: pin the exact version with \`npx ${PACKAGE_NAME}@${GENERATOR_VERSION} --version\` instead of retrying @latest. If it prints nothing, clear the npm cache and retry, or use \`npx -p <pkg> codebase-snapshot\`.`
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GENERATOR_VERSION, loadConfigFileDetailed, resolveConfig, validateSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, PromptCancelled, MIN_MAX_PART_BYTES, SCHEMA_VERSION, PRESETS, parseByteSize, gitignorePath, appendGitignoreEntries, escapeControls, renderExplainText } from './chunk-FJ4RQYY2.js';
1
+ import { GENERATOR_VERSION, loadConfigFileDetailed, resolveConfig, validateSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, PromptCancelled, MIN_MAX_PART_BYTES, SCHEMA_VERSION, PRESETS, parseByteSize, gitignorePath, appendGitignoreEntries, escapeControls, renderExplainText } from './chunk-HT7J3NWT.js';
2
2
  import { spawnSync } from 'child_process';
3
3
  import * as fs from 'fs';
4
4
  import * as path2 from 'path';
@@ -240,7 +240,7 @@ function buildAgentContract() {
240
240
  id: "verify",
241
241
  run: `npx ${PACKAGE_NAME}@latest --version`,
242
242
  // The requirement is the major version; the exact build is context. A
243
- // floating tag may print 4.0.7 today and 4.0.9 next week, and an agent
243
+ // floating tag may print a different patch today than next week, and an agent
244
244
  // must not conclude that a working tool is broken because of a patch.
245
245
  expect: `prints v${MAJOR_VERSION} or newer on stdout and exits 0 (this build is v${GENERATOR_VERSION}: compare the major version, not the patch)`,
246
246
  notes: `If it prints an older major than this contract's, the @latest tag is behind the release: pin the exact version with \`npx ${PACKAGE_NAME}@${GENERATOR_VERSION} --version\` instead of retrying @latest. If it prints nothing, clear the npm cache and retry, or use \`npx -p <pkg> codebase-snapshot\`.`
package/dist/index.cjs CHANGED
@@ -5450,7 +5450,7 @@ function validateSnapshot(configInput) {
5450
5450
 
5451
5451
  // src/version.ts
5452
5452
  var GENERATOR_NAME = "codebase-snapshot";
5453
- var GENERATOR_VERSION = "0.9.0";
5453
+ var GENERATOR_VERSION = "0.9.1";
5454
5454
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
5455
5455
  function isOurGeneratorName(name) {
5456
5456
  if (typeof name !== "string") return false;
package/dist/index.d.cts CHANGED
@@ -398,7 +398,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
398
398
  * `package.json` carries the same version; `npm run verify` compares the two.
399
399
  */
400
400
  declare const GENERATOR_NAME = "codebase-snapshot";
401
- declare const GENERATOR_VERSION = "0.9.0";
401
+ declare const GENERATOR_VERSION = "0.9.1";
402
402
 
403
403
  declare const DEFAULT_SECRET_PATTERNS: SecretRule[];
404
404
 
package/dist/index.d.ts CHANGED
@@ -398,7 +398,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
398
398
  * `package.json` carries the same version; `npm run verify` compares the two.
399
399
  */
400
400
  declare const GENERATOR_NAME = "codebase-snapshot";
401
- declare const GENERATOR_VERSION = "0.9.0";
401
+ declare const GENERATOR_VERSION = "0.9.1";
402
402
 
403
403
  declare const DEFAULT_SECRET_PATTERNS: SecretRule[];
404
404
 
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { ARTIFACT_NAMES, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, GENERATOR_NAME, GENERATOR_VERSION, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, PRESETS, PromptCancelled, SCHEMA_VERSION, anchorForPath, assertReplaceable, assertUsableConfigInput, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, explainPath, fenceForContent, fenceForText, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, globToRegExp, isBinaryBuffer, isBinaryExtension, isBinaryFile, isInteractive, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, validateSnapshot } from './chunk-FJ4RQYY2.js';
1
+ export { ARTIFACT_NAMES, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, GENERATOR_NAME, GENERATOR_VERSION, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, PRESETS, PromptCancelled, SCHEMA_VERSION, anchorForPath, assertReplaceable, assertUsableConfigInput, collectFiles, compareManifests, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, explainPath, fenceForContent, fenceForText, generateProjectTree, generateSnapshot, generateSnapshotAsync, getPreset, globToRegExp, isBinaryBuffer, isBinaryExtension, isBinaryFile, isInteractive, isResolvedConfig, isSensitivePath, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveConfig, resolveSafeOutputDirs, runInit, scanAndRedactSecrets, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, truncatePreview, truncateToBytes, validateSnapshot } from './chunk-HT7J3NWT.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
package/docs/cli.md CHANGED
@@ -124,7 +124,7 @@ The whole first run in one command, with defaults and no prompts:
124
124
  🚀 Setup for: /path/to/repo
125
125
  ✅ Created snapshot.config.ts (preset: nextjs)
126
126
  Added npm scripts: snapshot, snapshot:validate
127
- Added devDependency: codebase-snapshot ^4.4.0
127
+ Added devDependency: codebase-snapshot ^0.9.1
128
128
  Added to .gitignore: snapshot/, snapshot.tmp/
129
129
  ⏳ Installing dependencies…
130
130
  ✅ Installed dependencies (npm install, 2.1s)
@@ -161,7 +161,7 @@ It also has three side effects on files you own, and it says so when it does the
161
161
  ```
162
162
  ✅ Created snapshot.config.ts (preset: node-lib)
163
163
  Added npm scripts: snapshot, snapshot:validate
164
- Added devDependency: codebase-snapshot ^4.1.1
164
+ Added devDependency: codebase-snapshot ^0.9.1
165
165
  Added to .gitignore: snapshot/, snapshot.tmp/
166
166
  ```
167
167
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-snapshot",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Turn a codebase into token-efficient, size-budgeted Markdown parts for an LLM: an AST partitioner, snapshot generator, secret auditor and drift validator for ChatGPT, Claude and Cursor.",
5
5
  "keywords": [
6
6
  "codebase",
@@ -91,11 +91,12 @@
91
91
  "test:coverage": "node --test --experimental-test-coverage tests/*.test.js",
92
92
  "prepublishOnly": "npm run build",
93
93
  "publish:create": "npm publish packages/create --access public",
94
- "prepack": "npm run build",
94
+ "prepack": "npm run sync-docs && npm run build",
95
95
  "pack-check": "node scripts/pack-check.mjs",
96
- "site": "node scripts/build-site.mjs",
96
+ "sync-docs": "node scripts/sync-docs.mjs",
97
+ "site": "npm run sync-docs && node scripts/build-site.mjs",
97
98
  "seo-rank": "node scripts/seo-rank.mjs",
98
- "verify": "npm run check && npm run pack-check"
99
+ "verify": "npm run check && npm run sync-docs -- --check && npm run pack-check"
99
100
  },
100
101
  "dependencies": {
101
102
  "typescript": "^5.0.0"