@absolutejs/changelog 0.2.0 → 0.4.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.
package/dist/surface.d.ts CHANGED
@@ -1,24 +1,17 @@
1
- /**
2
- * The exported names of one declaration file, each with the declaration it
3
- * stands for.
4
- *
5
- * Overloads and merged declarations share a name; they are joined, so adding
6
- * an overload reads as a change to that name rather than as a replacement.
7
- */
8
- export declare const exportedDeclarations: (source: string) => Map<string, string>;
9
1
  export type PackageSurface = Map<string, string>;
2
+ /** Whether a manifest claims to ship types at all. A package that ships none
3
+ * has no promise of this kind to check; one that claims some and has none is
4
+ * a package about to publish types it did not build. */
5
+ export declare const declaresTypes: (manifest: unknown) => boolean;
10
6
  /** The surface of a package tarball, already gunzipped. */
11
- export declare const surfaceOfArchive: (archive: Uint8Array) => PackageSurface;
7
+ export declare const surfaceOfArchive: (archive: Uint8Array) => PackageSurface | undefined;
12
8
  /**
13
- * Every exported name in a package's declaration files.
14
- *
15
- * A name usually appears twice: where it is declared, and in the index that
16
- * passes it along. The declaration wins wherever both are found, whichever
17
- * file the archive happened to put first -- otherwise the same package reads
18
- * as `export { syncSocket }` in one version and as its full signature in the
19
- * next, and the two compare as a change nobody made.
9
+ * The public surface of a package: what its entry points export, and what
10
+ * each of those names is declared as.
20
11
  */
21
- export declare const surfaceOfFiles: (files: Iterable<string>) => PackageSurface;
12
+ export declare const surfaceOfFiles: (files: ReadonlyMap<string, string>, entries: readonly string[]) => PackageSurface;
13
+ /** The declaration files a manifest points at, as paths inside the package. */
14
+ export declare const typeEntriesOf: (manifest: unknown, files: ReadonlyMap<string, string>) => string[];
22
15
  declare const SHAPE: {
23
16
  readonly members: "members";
24
17
  readonly parameters: "parameters";
@@ -44,12 +37,18 @@ export type SurfaceDiff = {
44
37
  /**
45
38
  * What moved between two surfaces.
46
39
  *
47
- * Removed is the one that breaks a build outright. Changed is the one that may:
48
- * a widened parameter is not a break and a narrowed one is, and telling them
49
- * apart is a job for whoever reads the two declarations -- so both are carried
50
- * rather than judged here.
40
+ * Removed is the one that breaks a build outright. Changed is the one that
41
+ * may: a widened parameter is not a break and a narrowed one is, and telling
42
+ * them apart is a job for whoever reads the two declarations -- so both are
43
+ * carried rather than judged here.
51
44
  */
52
45
  export declare const diffSurface: (before: PackageSurface, after: PackageSurface) => SurfaceDiff;
53
- /** The changes in a diff that a caller would notice. */
46
+ /**
47
+ * The changes a consumer would notice, for an advisor deciding what to put in
48
+ * front of somebody.
49
+ *
50
+ * Not for the gate: `types` changes are still changes, and the package that
51
+ * made one is the party that can say in one line whether it matters.
52
+ */
54
53
  export declare const notable: (diff: SurfaceDiff) => SurfaceChange[];
55
54
  export {};
package/dist/write.d.ts CHANGED
@@ -1,4 +1,13 @@
1
1
  import { type Changelog } from "./types";
2
+ /**
3
+ * The line that says this file was generated.
4
+ *
5
+ * Load-bearing: adopting a package reads whatever `CHANGELOG.md` said before
6
+ * and keeps it as history, and on a second adoption the file it generated the
7
+ * first time is what it finds. Without a way to recognise its own output it
8
+ * files that as history and prints the header underneath itself.
9
+ */
10
+ export declare const GENERATED_MARKER = "This file is generated by `absolute-changelog`";
2
11
  export type MarkdownOptions = {
3
12
  /** Whatever the package's changelog said before it was generated, kept
4
13
  * under the releases that came after it. History is not noise. */
package/package.json CHANGED
@@ -1,73 +1,76 @@
1
1
  {
2
- "name": "@absolutejs/changelog",
3
- "version": "0.2.0",
4
- "description": "The changelog contract for the AbsoluteJS packages. Changes are written as typed entries the compiler checks, the release gate reconciles them against the package's own published types so a change nobody wrote down cannot ship, and migrations are data rather than prose so an upgrade can be applied instead of read.",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/absolutejs/changelog.git"
8
- },
9
- "homepage": "https://github.com/absolutejs/changelog",
10
- "bugs": {
11
- "url": "https://github.com/absolutejs/changelog/issues"
12
- },
13
- "main": "./dist/index.js",
14
- "module": "./dist/index.js",
15
- "types": "./dist/index.d.ts",
16
- "type": "module",
17
- "license": "MIT",
18
- "author": "Alex Kahn",
19
- "exports": {
20
- ".": {
21
- "types": "./dist/index.d.ts",
22
- "import": "./dist/index.js",
23
- "default": "./dist/index.js"
24
- }
25
- },
26
- "bin": {
27
- "absolute-changelog": "dist/cli.js"
28
- },
29
- "publishConfig": {
30
- "access": "public"
31
- },
32
- "files": [
33
- "CHANGELOG.md",
34
- "LICENSE",
35
- "README.md",
36
- "changelog.json",
37
- "dist"
38
- ],
39
- "scripts": {
40
- "build": "rm -rf dist && bun build src/index.ts src/cli.ts --outdir dist --root src --sourcemap --target=bun && tsc --project tsconfig.build.json",
41
- "test": "bun test tests/",
42
- "typecheck": "tsc --noEmit",
43
- "format": "prettier --write \"./**/*.{ts,json,md}\"",
44
- "lint": "eslint . --max-warnings 0",
45
- "changelog": "bun src/cli.ts",
46
- "check:package": "bun run typecheck && bun run lint && bun run test && bun run build && bun src/cli.ts check",
47
- "release": "bun run format && bun run check:package && bun publish",
48
- "prepublishOnly": "bun src/cli.ts check"
49
- },
50
- "keywords": [
51
- "absolutejs",
52
- "changelog",
53
- "codemod",
54
- "migration",
55
- "release",
56
- "semver",
57
- "upgrade"
58
- ],
59
- "devDependencies": {
60
- "@eslint/js": "^10.0.1",
61
- "@stylistic/eslint-plugin": "^5.10.0",
62
- "@types/bun": "^1.3.14",
63
- "@typescript-eslint/parser": "^8.68.0",
64
- "eslint": "^10.9.1",
65
- "eslint-plugin-absolute": "^0.11.34",
66
- "eslint-plugin-promise": "^7.3.0",
67
- "eslint-plugin-security": "^4.0.1",
68
- "globals": "^17.11.0",
69
- "prettier": "^3.5.3",
70
- "typescript": "^5.8.3",
71
- "typescript-eslint": "^8.56.0"
72
- }
2
+ "name": "@absolutejs/changelog",
3
+ "version": "0.4.0",
4
+ "description": "The changelog contract for the AbsoluteJS packages. Changes are written as typed entries the compiler checks, the release gate reconciles them against the package's own published types so a change nobody wrote down cannot ship, and migrations are data rather than prose so an upgrade can be applied instead of read.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/absolutejs/changelog.git"
8
+ },
9
+ "homepage": "https://github.com/absolutejs/changelog",
10
+ "bugs": {
11
+ "url": "https://github.com/absolutejs/changelog/issues"
12
+ },
13
+ "main": "./dist/index.js",
14
+ "module": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "type": "module",
17
+ "license": "MIT",
18
+ "author": "Alex Kahn",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/index.js",
23
+ "default": "./dist/index.js"
24
+ }
25
+ },
26
+ "bin": {
27
+ "absolute-changelog": "dist/cli.js"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "files": [
33
+ "CHANGELOG.md",
34
+ "LICENSE",
35
+ "README.md",
36
+ "changelog.json",
37
+ "dist"
38
+ ],
39
+ "scripts": {
40
+ "build": "rm -rf dist && bun build src/index.ts src/cli.ts --outdir dist --root src --sourcemap --target=bun --external typescript && tsc --project tsconfig.build.json",
41
+ "test": "bun test tests/",
42
+ "typecheck": "tsc --noEmit",
43
+ "format": "prettier --write \"./**/*.{ts,json,md}\"",
44
+ "lint": "eslint . --max-warnings 0",
45
+ "changelog": "bun src/cli.ts",
46
+ "check:package": "bun run typecheck && bun run lint && bun run test && bun run build && bun src/cli.ts check",
47
+ "release": "bun run format && bun run check:package && bun publish",
48
+ "prepublishOnly": "bun src/cli.ts check"
49
+ },
50
+ "keywords": [
51
+ "absolutejs",
52
+ "changelog",
53
+ "codemod",
54
+ "migration",
55
+ "release",
56
+ "semver",
57
+ "upgrade"
58
+ ],
59
+ "devDependencies": {
60
+ "@eslint/js": "^10.0.1",
61
+ "@stylistic/eslint-plugin": "^5.10.0",
62
+ "@types/bun": "^1.3.14",
63
+ "@typescript-eslint/parser": "^8.68.0",
64
+ "eslint": "^10.9.1",
65
+ "eslint-plugin-absolute": "^0.11.34",
66
+ "eslint-plugin-promise": "^7.3.0",
67
+ "eslint-plugin-security": "^4.0.1",
68
+ "globals": "^17.11.0",
69
+ "prettier": "^3.5.3",
70
+ "typescript": "^5.8.3",
71
+ "typescript-eslint": "^8.56.0"
72
+ },
73
+ "dependencies": {
74
+ "typescript": "^5.8.3"
75
+ }
73
76
  }