@tuturuuu/utils 0.22.0 → 0.23.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
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.23.1](https://github.com/tutur3u/platform/compare/utils-v0.23.0...utils-v0.23.1) (2026-08-09)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **platform:** merge notification and group visibility fixes ([4fe9e97](https://github.com/tutur3u/platform/commit/4fe9e970bf61bffaee4353b1ebb83ce2f880a4c8))
9
+ * **platform:** restore notifications and group visibility ([eb570a4](https://github.com/tutur3u/platform/commit/eb570a47e7a3d38fc855fbf3e887ecbde853ece0))
10
+
11
+ ## [0.23.0](https://github.com/tutur3u/platform/compare/utils-v0.22.0...utils-v0.23.0) (2026-08-07)
12
+
13
+
14
+ ### Features
15
+
16
+ * **platform:** expose the running build over HTTP for every app ([7b90d42](https://github.com/tutur3u/platform/commit/7b90d425a38048a1bf317b46f0da78225474f0e5))
17
+
3
18
  ## [0.22.0](https://github.com/tutur3u/platform/compare/utils-v0.21.0...utils-v0.22.0) (2026-08-04)
4
19
 
5
20
 
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.1",
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
+ }
@@ -2,6 +2,7 @@ import { tryToParsePath } from 'next/dist/lib/try-to-parse-path';
2
2
  import { describe, expect, it } from 'vitest';
3
3
  import {
4
4
  createTuturuuuNextConfig,
5
+ createTuturuuuWebWorkspaceApiRewrites,
5
6
  isTuturuuuNextCacheComponentsEnabled,
6
7
  isTuturuuuNextReactCompilerEnabled,
7
8
  isTuturuuuTurbopackRustReactCompilerEnabled,
@@ -249,6 +250,19 @@ describe('createTuturuuuNextConfig', () => {
249
250
  });
250
251
  });
251
252
 
253
+ describe('createTuturuuuWebWorkspaceApiRewrites', () => {
254
+ it('routes reserved static workspace endpoints before satellite dynamic routes', () => {
255
+ expect(
256
+ createTuturuuuWebWorkspaceApiRewrites('https://tuturuuu.com/')
257
+ ).toEqual([
258
+ {
259
+ source: '/api/workspaces/invitations',
260
+ destination: 'https://tuturuuu.com/api/workspaces/invitations',
261
+ },
262
+ ]);
263
+ });
264
+ });
265
+
252
266
  describe('isTuturuuuNextCacheComponentsEnabled', () => {
253
267
  it('keeps cache components enabled by default', () => {
254
268
  expect(isTuturuuuNextCacheComponentsEnabled({})).toBe(true);
@@ -13,6 +13,10 @@ export const TUTURUUU_NEXT_OPTIMIZE_PACKAGE_IMPORTS = [
13
13
  'lucide-react',
14
14
  ] as const;
15
15
 
16
+ export const TUTURUUU_WEB_WORKSPACE_API_RESERVED_PATHS = [
17
+ '/api/workspaces/invitations',
18
+ ] as const;
19
+
16
20
  type NextImageConfig = NonNullable<NextConfig['images']>;
17
21
  type NextImageRemotePattern = NonNullable<
18
22
  NextImageConfig['remotePatterns']
@@ -151,6 +155,15 @@ export function trimTrailingSlashes(value: string) {
151
155
  return end === value.length ? value : value.slice(0, end);
152
156
  }
153
157
 
158
+ export function createTuturuuuWebWorkspaceApiRewrites(webAppUrl: string) {
159
+ const destinationOrigin = trimTrailingSlashes(webAppUrl);
160
+
161
+ return TUTURUUU_WEB_WORKSPACE_API_RESERVED_PATHS.map((source) => ({
162
+ source,
163
+ destination: `${destinationOrigin}${source}`,
164
+ }));
165
+ }
166
+
154
167
  export function isTuturuuuNextDeployedEnvironment(
155
168
  env: Environment = process.env
156
169
  ) {
@@ -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.2'); // 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.2'; // 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. */