@tuturuuu/utils 0.22.0 → 0.23.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.23.0](https://github.com/tutur3u/platform/compare/utils-v0.22.0...utils-v0.23.0) (2026-08-07)
4
+
5
+
6
+ ### Features
7
+
8
+ * **platform:** expose the running build over HTTP for every app ([7b90d42](https://github.com/tutur3u/platform/commit/7b90d425a38048a1bf317b46f0da78225474f0e5))
9
+
3
10
  ## [0.22.0](https://github.com/tutur3u/platform/compare/utils-v0.21.0...utils-v0.22.0) (2026-08-04)
4
11
 
5
12
 
package/biome.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "root": false,
3
- "$schema": "https://biomejs.dev/schemas/2.5.6/schema.json",
3
+ "$schema": "https://biomejs.dev/schemas/2.5.7/schema.json",
4
4
  "extends": "//"
5
5
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tuturuuu/utils",
3
3
  "license": "MIT",
4
- "version": "0.22.0",
4
+ "version": "0.23.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/tutur3u/platform",
@@ -24,10 +24,10 @@
24
24
  "@tiptap/react": "3.29.2",
25
25
  "@tuturuuu/google": "0.1.0",
26
26
  "@tuturuuu/icons": "0.1.0",
27
- "@tuturuuu/internal-api": "0.27.0",
27
+ "@tuturuuu/internal-api": "0.29.0",
28
28
  "@tuturuuu/supabase": "0.5.0",
29
29
  "@upstash/ratelimit": "^2.0.8",
30
- "@upstash/redis": "^1.38.1",
30
+ "@upstash/redis": "^1.38.2",
31
31
  "clsx": "^2.1.1",
32
32
  "date-fns": "^4.4.0",
33
33
  "dayjs": "^1.11.21",
@@ -41,11 +41,11 @@
41
41
  "tailwind-merge": "^3.6.0",
42
42
  "uuid": "^14.0.1",
43
43
  "y-prosemirror": "^1.3.7",
44
- "yjs": "^13.6.31",
44
+ "yjs": "^13.6.32",
45
45
  "zod": "^4.4.3"
46
46
  },
47
47
  "devDependencies": {
48
- "@tuturuuu/types": "0.26.0",
48
+ "@tuturuuu/types": "0.27.0",
49
49
  "@tuturuuu/typescript-config": "0.1.1",
50
50
  "@types/diff": "^8.0.0",
51
51
  "@types/node": "^26.1.2",
@@ -0,0 +1,23 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { createBuildInfoHandler } from './build-info-route';
3
+
4
+ describe('createBuildInfoHandler', () => {
5
+ it('reports the app name and the build the bundle was made from', async () => {
6
+ const response = createBuildInfoHandler('tasks')();
7
+ const body = await response.json();
8
+
9
+ expect(response.status).toBe(200);
10
+ expect(body.appName).toBe('tasks');
11
+ expect(typeof body.commitHash).toBe('string');
12
+ expect(body.commitHash.length).toBeGreaterThan(0);
13
+ expect(typeof body.version).toBe('string');
14
+ });
15
+
16
+ it('is never cached', () => {
17
+ // A cached build stamp would defeat the point: it could report a commit
18
+ // the edge served earlier rather than the one running now.
19
+ const response = createBuildInfoHandler('web')();
20
+
21
+ expect(response.headers.get('cache-control')).toContain('no-store');
22
+ });
23
+ });
@@ -0,0 +1,29 @@
1
+ import { getPlatformReleaseInfo } from './platform-release';
2
+
3
+ /**
4
+ * Answer "which commit is actually serving this app right now?" over HTTP.
5
+ *
6
+ * The build metadata has always been generated into the bundle, but nothing
7
+ * exposed it at runtime, so the only way to check what a deployment contained
8
+ * was to infer it. That inference is unreliable: a deployment cancelled by a
9
+ * later push can leave an app serving code from before a merge while every
10
+ * workflow reports success, and `vercel inspect` returns no git metadata for
11
+ * these projects. Without this endpoint, "is my fix live?" is unanswerable.
12
+ *
13
+ * Returns a plain `Response` so route handlers in every app can re-export it
14
+ * without this module depending on a framework.
15
+ */
16
+ export function createBuildInfoHandler(appName: string) {
17
+ return function GET(): Response {
18
+ const info = getPlatformReleaseInfo(appName);
19
+
20
+ return new Response(JSON.stringify(info, null, 2), {
21
+ headers: {
22
+ 'content-type': 'application/json; charset=utf-8',
23
+ // Never let a CDN answer this: a cached build stamp is worse than none.
24
+ 'cache-control': 'no-store, max-age=0',
25
+ },
26
+ status: 200,
27
+ });
28
+ };
29
+ }
@@ -7,7 +7,7 @@ import {
7
7
 
8
8
  describe('platform release metadata', () => {
9
9
  it('uses the centralized shared browser app version', () => {
10
- expect(TUTURUUU_PLATFORM_VERSION).toBe('0.32.0'); // x-release-please-version
10
+ expect(TUTURUUU_PLATFORM_VERSION).toBe('0.35.0'); // x-release-please-version
11
11
  });
12
12
 
13
13
  it('preserves the source timestamp in builtAt and derives a short hash', () => {
@@ -1,6 +1,6 @@
1
1
  import { PLATFORM_BUILD_METADATA } from './generated/platform-build-metadata';
2
2
 
3
- export const TUTURUUU_PLATFORM_VERSION = '0.32.0'; // x-release-please-version
3
+ export const TUTURUUU_PLATFORM_VERSION = '0.35.0'; // x-release-please-version
4
4
 
5
5
  export type PlatformBuildMetadataInput = {
6
6
  /** ISO timestamp of the source commit used for the build, not deployment time. */