@scalar/release-notes 0.1.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +132 -0
  4. package/dist/cli.d.ts +4 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +18 -0
  7. package/dist/commands/generate.d.ts +5 -0
  8. package/dist/commands/generate.d.ts.map +1 -0
  9. package/dist/commands/generate.js +105 -0
  10. package/dist/commands/sync-markdown.d.ts +5 -0
  11. package/dist/commands/sync-markdown.d.ts.map +1 -0
  12. package/dist/commands/sync-markdown.js +25 -0
  13. package/dist/config/define-config.d.ts +6 -0
  14. package/dist/config/define-config.d.ts.map +1 -0
  15. package/dist/config/define-config.js +4 -0
  16. package/dist/config/read-config.d.ts +18 -0
  17. package/dist/config/read-config.d.ts.map +1 -0
  18. package/dist/config/read-config.js +86 -0
  19. package/dist/config/types.d.ts +70 -0
  20. package/dist/config/types.d.ts.map +1 -0
  21. package/dist/config/types.js +1 -0
  22. package/dist/core/detect-versioned-changelog-paths.d.ts +5 -0
  23. package/dist/core/detect-versioned-changelog-paths.d.ts.map +1 -0
  24. package/dist/core/detect-versioned-changelog-paths.js +56 -0
  25. package/dist/core/extract-changelog-section.d.ts +5 -0
  26. package/dist/core/extract-changelog-section.d.ts.map +1 -0
  27. package/dist/core/extract-changelog-section.js +16 -0
  28. package/dist/core/fetch-pull-requests.d.ts +28 -0
  29. package/dist/core/fetch-pull-requests.d.ts.map +1 -0
  30. package/dist/core/fetch-pull-requests.js +65 -0
  31. package/dist/core/generate-release-note.d.ts +45 -0
  32. package/dist/core/generate-release-note.d.ts.map +1 -0
  33. package/dist/core/generate-release-note.js +186 -0
  34. package/dist/core/paths.d.ts +7 -0
  35. package/dist/core/paths.d.ts.map +1 -0
  36. package/dist/core/paths.js +13 -0
  37. package/dist/core/products.d.ts +8 -0
  38. package/dist/core/products.d.ts.map +1 -0
  39. package/dist/core/products.js +12 -0
  40. package/dist/core/run-release-notes-generator.d.ts +26 -0
  41. package/dist/core/run-release-notes-generator.d.ts.map +1 -0
  42. package/dist/core/run-release-notes-generator.js +150 -0
  43. package/dist/index.d.ts +22 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +15 -0
  46. package/dist/providers/anthropic.d.ts +9 -0
  47. package/dist/providers/anthropic.d.ts.map +1 -0
  48. package/dist/providers/anthropic.js +53 -0
  49. package/dist/providers/openai.d.ts +9 -0
  50. package/dist/providers/openai.d.ts.map +1 -0
  51. package/dist/providers/openai.js +54 -0
  52. package/dist/types.d.ts +129 -0
  53. package/dist/types.d.ts.map +1 -0
  54. package/dist/types.js +167 -0
  55. package/dist/writers/write-release-notes-json.d.ts +15 -0
  56. package/dist/writers/write-release-notes-json.d.ts.map +1 -0
  57. package/dist/writers/write-release-notes-json.js +114 -0
  58. package/dist/writers/write-release-notes-markdown.d.ts +13 -0
  59. package/dist/writers/write-release-notes-markdown.d.ts.map +1 -0
  60. package/dist/writers/write-release-notes-markdown.js +23 -0
  61. package/dist/writers/write-release-notes-schema.d.ts +20 -0
  62. package/dist/writers/write-release-notes-schema.d.ts.map +1 -0
  63. package/dist/writers/write-release-notes-schema.js +37 -0
  64. package/package.json +68 -0
  65. package/schemas/release-notes.schema.json +232 -0
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@scalar/release-notes",
3
+ "description": "Generate curated release notes from Changesets changelogs with pluggable AI providers",
4
+ "license": "MIT",
5
+ "author": "Scalar (https://github.com/scalar)",
6
+ "homepage": "https://github.com/scalar/scalar",
7
+ "bugs": "https://github.com/scalar/scalar/issues/new/choose",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/scalar/scalar.git",
11
+ "directory": "packages/release-notes"
12
+ },
13
+ "keywords": [
14
+ "release-notes",
15
+ "changelog",
16
+ "changesets",
17
+ "ai"
18
+ ],
19
+ "version": "0.1.1",
20
+ "engines": {
21
+ "node": ">=22"
22
+ },
23
+ "type": "module",
24
+ "main": "dist/index.js",
25
+ "module": "dist/index.js",
26
+ "types": "dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "import": "./dist/index.js",
30
+ "types": "./dist/index.d.ts",
31
+ "default": "./dist/index.js"
32
+ },
33
+ "./cli": {
34
+ "import": "./dist/cli.js",
35
+ "types": "./dist/cli.d.ts",
36
+ "default": "./dist/cli.js"
37
+ },
38
+ "./schema": "./schemas/release-notes.schema.json"
39
+ },
40
+ "files": [
41
+ "dist",
42
+ "schemas",
43
+ "README.md",
44
+ "CHANGELOG.md"
45
+ ],
46
+ "bin": {
47
+ "scalar-release-notes": "dist/cli.js"
48
+ },
49
+ "sideEffects": false,
50
+ "dependencies": {
51
+ "commander": "13.1.0",
52
+ "zod": "^4.3.5",
53
+ "@scalar/helpers": "0.8.2"
54
+ },
55
+ "devDependencies": {
56
+ "@types/node": "^24.1.0",
57
+ "tsx": "4.19.4",
58
+ "vitest": "4.1.0"
59
+ },
60
+ "scripts": {
61
+ "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
62
+ "schema:generate": "tsx scripts/generate-schema.ts",
63
+ "schema:generate:stage": "tsx scripts/stage-generated-schema.ts",
64
+ "start": "node dist/cli.js",
65
+ "test": "vitest --run",
66
+ "types:check": "tsgo --noEmit"
67
+ }
68
+ }
@@ -0,0 +1,232 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://scalar.com/schemas/release-notes.schema.json",
4
+ "title": "Release notes",
5
+ "type": "array",
6
+ "items": {
7
+ "type": "object",
8
+ "properties": {
9
+ "version": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[\\w.]+)?(?:\\+[\\w.]+)?$",
12
+ "description": "Semver-style version string for the release (for example `3.5.1`)."
13
+ },
14
+ "date": {
15
+ "type": "string",
16
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
17
+ "description": "Release date in ISO `YYYY-MM-DD` format."
18
+ },
19
+ "title": {
20
+ "type": "string",
21
+ "minLength": 1,
22
+ "maxLength": 120,
23
+ "description": "Short, sentence-case headline summarizing the release."
24
+ },
25
+ "content": {
26
+ "description": "Body copy and rich blocks after the headline: `paragraph` for intro text, `list` for bullet highlights, then headings, media, and optional `href` blocks.",
27
+ "maxItems": 40,
28
+ "type": "array",
29
+ "items": {
30
+ "oneOf": [
31
+ {
32
+ "type": "object",
33
+ "properties": {
34
+ "type": {
35
+ "type": "string",
36
+ "const": "paragraph",
37
+ "description": "Discriminator for the paragraph block type."
38
+ },
39
+ "text": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "maxLength": 2000,
43
+ "description": "Plain-text paragraph copy. Use multiple paragraph blocks for multi-paragraph notes."
44
+ }
45
+ },
46
+ "required": ["type", "text"],
47
+ "additionalProperties": false,
48
+ "description": "A free-form paragraph rendered between other content blocks."
49
+ },
50
+ {
51
+ "type": "object",
52
+ "properties": {
53
+ "type": {
54
+ "type": "string",
55
+ "const": "heading",
56
+ "description": "Discriminator for the heading block type."
57
+ },
58
+ "text": {
59
+ "type": "string",
60
+ "minLength": 1,
61
+ "maxLength": 120,
62
+ "description": "Subsection heading shown inside the release entry."
63
+ },
64
+ "level": {
65
+ "description": "Heading level. Defaults to 3 (rendered below the release title).",
66
+ "anyOf": [
67
+ {
68
+ "type": "number",
69
+ "const": 3
70
+ },
71
+ {
72
+ "type": "number",
73
+ "const": 4
74
+ }
75
+ ]
76
+ }
77
+ },
78
+ "required": ["type", "text"],
79
+ "additionalProperties": false,
80
+ "description": "A subsection heading inside a release entry."
81
+ },
82
+ {
83
+ "type": "object",
84
+ "properties": {
85
+ "type": {
86
+ "type": "string",
87
+ "const": "list",
88
+ "description": "Discriminator for the list block type."
89
+ },
90
+ "items": {
91
+ "minItems": 1,
92
+ "maxItems": 20,
93
+ "type": "array",
94
+ "items": {
95
+ "type": "string",
96
+ "minLength": 1,
97
+ "maxLength": 280,
98
+ "description": "A single-sentence list item."
99
+ },
100
+ "description": "Bullet items rendered as a list. Keep each item to a single sentence."
101
+ },
102
+ "ordered": {
103
+ "description": "Render as a numbered list when `true`. Defaults to a bullet list.",
104
+ "type": "boolean"
105
+ }
106
+ },
107
+ "required": ["type", "items"],
108
+ "additionalProperties": false,
109
+ "description": "A bullet (or numbered) list of single-sentence items."
110
+ },
111
+ {
112
+ "type": "object",
113
+ "properties": {
114
+ "type": {
115
+ "type": "string",
116
+ "const": "image",
117
+ "description": "Discriminator for the image block type."
118
+ },
119
+ "src": {
120
+ "type": "string",
121
+ "format": "uri",
122
+ "description": "Absolute URL of the image asset."
123
+ },
124
+ "alt": {
125
+ "type": "string",
126
+ "minLength": 1,
127
+ "maxLength": 280,
128
+ "description": "Accessibility text. Required - describe what the image shows."
129
+ },
130
+ "caption": {
131
+ "description": "Optional caption rendered beneath the image.",
132
+ "type": "string",
133
+ "minLength": 1,
134
+ "maxLength": 280
135
+ },
136
+ "width": {
137
+ "description": "Optional natural width of the image in pixels. Helps the layout reserve space before the image loads.",
138
+ "type": "integer",
139
+ "exclusiveMinimum": 0,
140
+ "maximum": 9007199254740991
141
+ },
142
+ "height": {
143
+ "description": "Optional natural height of the image in pixels. Helps the layout reserve space before the image loads.",
144
+ "type": "integer",
145
+ "exclusiveMinimum": 0,
146
+ "maximum": 9007199254740991
147
+ }
148
+ },
149
+ "required": ["type", "src", "alt"],
150
+ "additionalProperties": false,
151
+ "description": "An inline image. Provide alt text for accessibility and an optional caption rendered beneath."
152
+ },
153
+ {
154
+ "type": "object",
155
+ "properties": {
156
+ "type": {
157
+ "type": "string",
158
+ "const": "video",
159
+ "description": "Discriminator for the video block type."
160
+ },
161
+ "src": {
162
+ "type": "string",
163
+ "format": "uri",
164
+ "description": "Absolute URL of an MP4/WebM video asset (self-hosted works best)."
165
+ },
166
+ "poster": {
167
+ "description": "Optional URL of a poster image shown before the video starts playing.",
168
+ "type": "string",
169
+ "format": "uri"
170
+ },
171
+ "caption": {
172
+ "description": "Optional caption rendered beneath the video.",
173
+ "type": "string",
174
+ "minLength": 1,
175
+ "maxLength": 280
176
+ },
177
+ "autoplay": {
178
+ "description": "When `true`, the video starts playing as soon as it is rendered. Pair with `muted: true`.",
179
+ "type": "boolean"
180
+ },
181
+ "loop": {
182
+ "description": "When `true`, the video loops back to the start when it ends.",
183
+ "type": "boolean"
184
+ },
185
+ "muted": {
186
+ "description": "When `true`, the video is muted. Required for autoplay to work in modern browsers.",
187
+ "type": "boolean"
188
+ },
189
+ "controls": {
190
+ "description": "When `true`, native playback controls are shown. Defaults to `true` when omitted.",
191
+ "type": "boolean"
192
+ }
193
+ },
194
+ "required": ["type", "src"],
195
+ "additionalProperties": false,
196
+ "description": "An inline video clip. Self-hosted MP4/WebM URLs work best - autoplay clips should also set `muted: true`."
197
+ },
198
+ {
199
+ "type": "object",
200
+ "properties": {
201
+ "type": {
202
+ "type": "string",
203
+ "const": "href",
204
+ "description": "Discriminator for an outbound URL block."
205
+ },
206
+ "href": {
207
+ "type": "string",
208
+ "format": "uri",
209
+ "description": "Destination URL (opened in a new tab)."
210
+ },
211
+ "label": {
212
+ "type": "string",
213
+ "minLength": 1,
214
+ "maxLength": 120,
215
+ "description": "Accessible link text (for example \"Read full release notes\")."
216
+ }
217
+ },
218
+ "required": ["type", "href", "label"],
219
+ "additionalProperties": false,
220
+ "description": "Call-to-action link (for example to full release notes on GitHub)."
221
+ }
222
+ ],
223
+ "description": "Rich content block rendered inside a release note (paragraph, heading, list, image, video, or href)."
224
+ }
225
+ }
226
+ },
227
+ "required": ["version", "date", "title"],
228
+ "additionalProperties": false,
229
+ "description": "A single curated release note."
230
+ },
231
+ "description": "Curated, user-facing release notes. Newest entry first."
232
+ }