@forthtilliath/expo-release-updates 0.9.0 → 0.10.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/README.md CHANGED
@@ -95,9 +95,9 @@ if (release && isUpdateAvailable(currentVersion, release.version)) {
95
95
  }
96
96
  ```
97
97
 
98
- ### `fetchReleaseHistory({ owner, repo, limit?, token?, timeoutMs?, signal? })`
98
+ ### `fetchReleaseHistory({ owner, repo, limit?, includePrereleases?, token?, timeoutMs?, signal? })`
99
99
 
100
- Fetches the most recent published releases (version, notes, publish date), most recent first — draft releases, visible with a token, are left out. `limit` defaults to `10` (clamped to GitHub's 1–100) — useful for a "release history" / "what's new" screen.
100
+ Fetches the most recent published releases (version, notes, publish date), most recent first — draft releases, visible with a token, are left out. `limit` defaults to `10` (clamped to GitHub's 1–100) — useful for a "release history" / "what's new" screen. Pre-releases are listed too, unless `includePrereleases: false` (pass the same value as to `fetchLatestRelease`, so users who don't get test versions don't see them listed either; fewer than `limit` entries may then come back).
101
101
 
102
102
  ```ts
103
103
  const history = await fetchReleaseHistory({
@@ -71,9 +71,12 @@ export declare function fetchLatestRelease(options: FetchLatestReleaseOptions):
71
71
  /**
72
72
  * Fetches the most recent published releases for a repo (version, notes,
73
73
  * publish date), most recent first — useful for a "release history" screen.
74
- * Draft releases (only visible with a token) are left out.
74
+ * Draft releases (only visible with a token) are left out, and so are
75
+ * pre-releases with `includePrereleases: false` (the list may then hold fewer
76
+ * than `limit` entries).
75
77
  */
76
78
  export declare function fetchReleaseHistory(ref: GithubRepoRef & {
77
79
  limit?: number;
80
+ includePrereleases?: boolean;
78
81
  }): Promise<ReleaseHistoryEntry[]>;
79
82
  //# sourceMappingURL=githubReleases.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"githubReleases.d.ts","sourceRoot":"","sources":["../src/githubReleases.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,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,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAiCD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,aAAa,UAEtE;AAwGD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAyB/B;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,aAAa,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAE,GACpE,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAkBhC"}
@@ -142,14 +142,17 @@ export async function fetchLatestRelease(options) {
142
142
  /**
143
143
  * Fetches the most recent published releases for a repo (version, notes,
144
144
  * publish date), most recent first — useful for a "release history" screen.
145
- * Draft releases (only visible with a token) are left out.
145
+ * Draft releases (only visible with a token) are left out, and so are
146
+ * pre-releases with `includePrereleases: false` (the list may then hold fewer
147
+ * than `limit` entries).
146
148
  */
147
149
  export async function fetchReleaseHistory(ref) {
148
- const { limit = 10 } = ref;
150
+ const { limit = 10, includePrereleases = true } = ref;
149
151
  const perPage = Math.min(Math.max(Math.trunc(limit), 1), MAX_PER_PAGE);
150
152
  const data = await fetchGithubJson(`${releasesUrl(ref)}?per_page=${String(perPage)}`, ref);
151
153
  return releasesIn(data)
152
- .filter((release) => release.draft !== true)
154
+ .filter((release) => release.draft !== true &&
155
+ (includePrereleases || release.prerelease !== true))
153
156
  .map((release) => ({
154
157
  version: versionOf(release),
155
158
  notes: notesOf(release),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forthtilliath/expo-release-updates",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -34,17 +34,17 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@forthtilliath/ts-kit": "^0.15.0"
37
+ "@forthtilliath/ts-kit": "^0.16.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@vitest/coverage-v8": "5.0.5",
41
- "eslint": "10.7.0",
42
- "expo-file-system": "~57.0.2",
41
+ "eslint": "10.14.0",
42
+ "expo-file-system": "~57.0.7",
43
43
  "expo-intent-launcher": "~57.0.1",
44
44
  "typescript": "^5.9.3",
45
45
  "vitest": "^5.0.5",
46
+ "@forthtilliath/eslint-config": "0.10.1",
46
47
  "@forthtilliath/typescript-config": "0.1.1",
47
- "@forthtilliath/eslint-config": "0.10.0",
48
48
  "@forthtilliath/test-kit": "0.4.0"
49
49
  },
50
50
  "scripts": {