@se-studio/project-build 1.1.14 → 1.1.16

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,19 @@
1
1
  # @se-studio/project-build
2
2
 
3
+ ## 1.1.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Call `ensureNextDevFlightPatch()` from `@se-studio/project-build/patch-next-dev` at the top of each marketing app `next.config.ts`. That applies the dest Flight debug-info OOM patch for `pnpm dev`, `pnpm dev:dev`, and a raw `next dev`. `predev` does not run for the last two, which is what local smoke and cloud agents use. The helper no-ops on production builds.
8
+
9
+ Agent session and new-project skills tell agents to add that call before starting a dev server.
10
+
11
+ ## 1.1.15
12
+
13
+ ### Patch Changes
14
+
15
+ - Bump toolchain to Next.js 16.3.4 and Biome 2.5.12. The dest Flight debug-info OOM patch still matches 16.3.4 runtimes.
16
+
3
17
  ## 1.1.14
4
18
 
5
19
  ### Patch Changes
@@ -11,9 +25,9 @@
11
25
  ### Patch Changes
12
26
 
13
27
  - 531e8ca: Add HtmlComponent `externalScripts` so editors can list allowlisted script URLs that load with next/script before customJs.
14
-
28
+
15
29
  Same-origin `/html-components/….js` is always allowed; extra HTTPS hosts are opt-in via `htmlComponentExternalScriptHosts`. Run migration 28 on each customer space after publishing these packages.
16
-
30
+
17
31
  HSD follow-up: bump packages, run 28 on space `gqa3p93n5wse`, set the readiness HtmlComponent to `["/html-components/specialized-transport-readiness/jspdf.umd.min.js"]`, remove the `createElement('script')` loader from `jsContent`, and pass `externalScripts` through the dual-read converter if it is still in use.
18
32
 
19
33
  ## 1.1.12
package/README.md CHANGED
@@ -51,19 +51,17 @@ pnpm setailwind
51
51
 
52
52
  ### Dest Flight debug-info patch
53
53
 
54
- React dest Flight copies unnamed `_debugInfo` without dedup, which can OOM `next dest` on large CMS pages. From the **app directory** (so `next` resolves correctly):
54
+ React dest Flight copies unnamed `_debugInfo` without dedup, which can OOM `next dest` on large CMS pages. Call this at the top of the app `next.config.ts`. Next loads that file for `pnpm dev`, `pnpm dev:dev`, and a raw `next dev` (local smoke and cloud agents) before dest starts. `predev` does not run for `dev:dev`.
55
55
 
56
- ```json
57
- {
58
- "scripts": {
59
- "predev": "pnpm typegen && patch-next-flight-debuginfo"
60
- }
61
- }
56
+ ```ts
57
+ import { ensureNextDevFlightPatch } from '@se-studio/project-build/patch-next-dev';
58
+
59
+ ensureNextDevFlightPatch();
62
60
  ```
63
61
 
64
- Idempotent. When Next/React ship the upstream fix, the command prints a notice and exits 0 — then remove it from `predev`.
62
+ The helper no-ops when `NODE_ENV` is `production` or `NEXT_PHASE` is a production phase, so Vercel builds do not rewrite `node_modules`. It is idempotent. When Next/React ship the upstream fix, the command prints a notice and exits 0 — then remove the call.
65
63
 
66
- Do not write this file in place under `node_modules` yourself; the CLI write+renames to avoid corrupting pnpm hardlinks.
64
+ `patch-next-flight-debuginfo` remains the CLI for the same rewrite. Do not write the runtime files in place under `node_modules` yourself; the patch write+renames to avoid corrupting pnpm hardlinks.
67
65
 
68
66
  ### Management Scripts
69
67
 
@@ -0,0 +1,49 @@
1
+ /**
2
+ * CommonJS entry so Next can load this from next.config.ts.
3
+ * Next transpiles that file to CJS and require()s it. An import-only
4
+ * export is invisible to that require and the OOM patch never runs.
5
+ *
6
+ * The rewrite itself stays in the ESM CLI, spawned here so it stays synchronous
7
+ * before dest starts.
8
+ */
9
+ const { spawnSync } = require('node:child_process');
10
+ const path = require('node:path');
11
+
12
+ const PRODUCTION_PHASES = new Set([
13
+ 'phase-production-build',
14
+ 'phase-production-server',
15
+ 'phase-export',
16
+ ]);
17
+
18
+ function shouldPatchNextDevFlight(env = process.env) {
19
+ if (env.NODE_ENV === 'production') {
20
+ return false;
21
+ }
22
+ const phase = env.NEXT_PHASE;
23
+ if (phase && PRODUCTION_PHASES.has(phase)) {
24
+ return false;
25
+ }
26
+ return true;
27
+ }
28
+
29
+ function ensureNextDevFlightPatch(cwd = process.cwd(), env = process.env) {
30
+ if (!shouldPatchNextDevFlight(env)) {
31
+ return null;
32
+ }
33
+ const script = path.join(__dirname, 'patch-next-flight-debuginfo.js');
34
+ const result = spawnSync(process.execPath, [script], {
35
+ cwd,
36
+ stdio: 'inherit',
37
+ });
38
+ if (result.status !== 0) {
39
+ throw new Error(
40
+ `patch-next-flight-debuginfo exited ${result.status ?? 'null'} (signal ${result.signal ?? 'none'})`,
41
+ );
42
+ }
43
+ return 0;
44
+ }
45
+
46
+ module.exports = {
47
+ ensureNextDevFlightPatch,
48
+ shouldPatchNextDevFlight,
49
+ };
@@ -0,0 +1,4 @@
1
+ export function shouldPatchNextDevFlight(env?: NodeJS.ProcessEnv): boolean;
2
+
3
+ /** Returns null when skipped (production). Returns 0 after a successful patch. */
4
+ export function ensureNextDevFlightPatch(cwd?: string, env?: NodeJS.ProcessEnv): number | null;
@@ -14,7 +14,7 @@
14
14
  * Write + rename, never in place: pnpm may hardlink files into its store.
15
15
  *
16
16
  * Idempotent. If a future Next version no longer contains the pattern, prints
17
- * a notice and exits 0 — then delete the `predev` wiring in consuming apps.
17
+ * a notice and exits 0 — then remove `ensureNextDevFlightPatch()` from next.config.
18
18
  *
19
19
  * Usage (from an app with `next` installed):
20
20
  * patch-next-flight-debuginfo
@@ -14,7 +14,7 @@
14
14
  * Write + rename, never in place: pnpm may hardlink files into its store.
15
15
  *
16
16
  * Idempotent. If a future Next version no longer contains the pattern, prints
17
- * a notice and exits 0 — then delete the `predev` wiring in consuming apps.
17
+ * a notice and exits 0 — then remove `ensureNextDevFlightPatch()` from next.config.
18
18
  *
19
19
  * Usage (from an app with `next` installed):
20
20
  * patch-next-flight-debuginfo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/project-build",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
4
4
  "description": "Build tools and management scripts for SE Studio projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,6 +23,12 @@
23
23
  "./management": {
24
24
  "types": "./dist/management/index.d.ts",
25
25
  "import": "./dist/management/index.js"
26
+ },
27
+ "./patch-next-dev": {
28
+ "types": "./dist/patch-next-dev.d.ts",
29
+ "import": "./dist/patch-next-dev.cjs",
30
+ "require": "./dist/patch-next-dev.cjs",
31
+ "default": "./dist/patch-next-dev.cjs"
26
32
  }
27
33
  },
28
34
  "bin": {
@@ -60,9 +66,9 @@
60
66
  "url": "https://github.com/Something-Else-Studio/se-core-product/issues"
61
67
  },
62
68
  "dependencies": {
63
- "@biomejs/biome": "^2.5.11",
69
+ "@biomejs/biome": "^2.5.12",
64
70
  "@biomejs/js-api": "^6.0.0",
65
- "@biomejs/wasm-nodejs": "^2.5.11",
71
+ "@biomejs/wasm-nodejs": "^2.5.12",
66
72
  "change-case": "^5.4.4",
67
73
  "chroma-js": "^3.2.0",
68
74
  "contentful-management": "^12.15.0",
@@ -75,7 +81,7 @@
75
81
  "vitest": "^4.1.11"
76
82
  },
77
83
  "scripts": {
78
- "build": "tsc --project tsconfig.build.json",
84
+ "build": "tsc --project tsconfig.build.json && cp src/patch-next-dev.cjs src/patch-next-dev.d.ts dist/",
79
85
  "dev": "tsc --project tsconfig.build.json --watch",
80
86
  "type-check": "tsc --noEmit",
81
87
  "lint": "biome lint .",