@rudderjs/core 1.12.0 → 1.12.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/dist/maintenance.d.ts +8 -3
- package/dist/maintenance.d.ts.map +1 -1
- package/dist/maintenance.js +13 -6
- package/dist/maintenance.js.map +1 -1
- package/package.json +4 -4
package/dist/maintenance.d.ts
CHANGED
|
@@ -7,11 +7,16 @@
|
|
|
7
7
|
* `Retry-After` header for every request — except requests that match the
|
|
8
8
|
* allow-list or carry the bypass secret.
|
|
9
9
|
*
|
|
10
|
-
* **Node-only.** This module statically imports `node:fs`/`node:path
|
|
10
|
+
* **Node-only.** This module statically imports `node:fs`/`node:path` and is
|
|
11
11
|
* exported only from `@rudderjs/core`'s main entry, never from
|
|
12
12
|
* `@rudderjs/core/client`. `app-builder` reaches it via a lazy
|
|
13
|
-
* `await import('./maintenance.js')` inside `_createHandler` (server-only)
|
|
14
|
-
*
|
|
13
|
+
* `await import('./maintenance.js')` inside `_createHandler` (server-only).
|
|
14
|
+
*
|
|
15
|
+
* It must stay **client-eval-safe**: the main entry is Node-only but survives
|
|
16
|
+
* browser bundles by being tree-shaken, so this module must have **no
|
|
17
|
+
* module-top-level `fs`/`path` access** (the static imports bind to access-
|
|
18
|
+
* throwing stubs under Vite, which is fine — only an actual `.join()`/
|
|
19
|
+
* `.existsSync()` at eval crashes). Keep every `node:*` call inside a function.
|
|
15
20
|
*/
|
|
16
21
|
import type { MiddlewareHandler } from '@rudderjs/contracts';
|
|
17
22
|
/** Shape of the `storage/framework/down` flag file. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maintenance.d.ts","sourceRoot":"","sources":["../src/maintenance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"maintenance.d.ts","sourceRoot":"","sources":["../src/maintenance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAA2B,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAErF,uDAAuD;AACvD,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,IAAI,EAAM,MAAM,CAAA;IAChB,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4CAA4C;IAC5C,KAAK,CAAC,EAAI,MAAM,CAAA;IAChB,wFAAwF;IACxF,MAAM,CAAC,EAAG,MAAM,CAAA;IAChB,6EAA6E;IAC7E,KAAK,CAAC,EAAI,MAAM,EAAE,CAAA;CACnB;AAED,qEAAqE;AACrE,eAAO,MAAM,yBAAyB,8BAA8B,CAAA;AAUpE,yEAAyE;AACzE,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAEzE;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAsB,GAAG,eAAe,GAAG,IAAI,CAMnF;AAED,gFAAgF;AAChF,wBAAgB,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,GAAE,MAAsB,GAAG,IAAI,CAI7E;AAED,oFAAoF;AACpF,wBAAgB,EAAE,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAKvD;AAkBD,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,4BAAiC,GAAG,iBAAiB,CA8BnG"}
|
package/dist/maintenance.js
CHANGED
|
@@ -7,20 +7,27 @@
|
|
|
7
7
|
* `Retry-After` header for every request — except requests that match the
|
|
8
8
|
* allow-list or carry the bypass secret.
|
|
9
9
|
*
|
|
10
|
-
* **Node-only.** This module statically imports `node:fs`/`node:path
|
|
10
|
+
* **Node-only.** This module statically imports `node:fs`/`node:path` and is
|
|
11
11
|
* exported only from `@rudderjs/core`'s main entry, never from
|
|
12
12
|
* `@rudderjs/core/client`. `app-builder` reaches it via a lazy
|
|
13
|
-
* `await import('./maintenance.js')` inside `_createHandler` (server-only)
|
|
14
|
-
*
|
|
13
|
+
* `await import('./maintenance.js')` inside `_createHandler` (server-only).
|
|
14
|
+
*
|
|
15
|
+
* It must stay **client-eval-safe**: the main entry is Node-only but survives
|
|
16
|
+
* browser bundles by being tree-shaken, so this module must have **no
|
|
17
|
+
* module-top-level `fs`/`path` access** (the static imports bind to access-
|
|
18
|
+
* throwing stubs under Vite, which is fine — only an actual `.join()`/
|
|
19
|
+
* `.existsSync()` at eval crashes). Keep every `node:*` call inside a function.
|
|
15
20
|
*/
|
|
16
21
|
import fs from 'node:fs';
|
|
17
22
|
import path from 'node:path';
|
|
18
|
-
/** App-relative path to the maintenance flag file. */
|
|
19
|
-
const DOWN_FILE = path.join('storage', 'framework', 'down');
|
|
20
23
|
/** Cookie name carrying the bypass secret on subsequent requests. */
|
|
21
24
|
export const MAINTENANCE_BYPASS_COOKIE = 'rudder_maintenance_bypass';
|
|
25
|
+
/**
|
|
26
|
+
* Absolute path to the maintenance flag file. Joined lazily (never at module
|
|
27
|
+
* top level) so this module evaluates harmlessly if it lands in a client graph.
|
|
28
|
+
*/
|
|
22
29
|
function downPath(cwd) {
|
|
23
|
-
return path.join(cwd,
|
|
30
|
+
return path.join(cwd, 'storage', 'framework', 'down');
|
|
24
31
|
}
|
|
25
32
|
/** `true` when the app is in maintenance mode (the flag file exists). */
|
|
26
33
|
export function isDownForMaintenance(cwd = process.cwd()) {
|
package/dist/maintenance.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maintenance.js","sourceRoot":"","sources":["../src/maintenance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"maintenance.js","sourceRoot":"","sources":["../src/maintenance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAiB5B,qEA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G,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,qBAAqB,EAAE,CAAC,CAAA;QACxE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rudderjs/core",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"reflect-metadata": "^0.2.2",
|
|
48
48
|
"zod": "^4.0.0",
|
|
49
|
-
"@rudderjs/contracts": "^1.16.0",
|
|
50
49
|
"@rudderjs/console": "^1.4.0",
|
|
51
|
-
"@rudderjs/
|
|
52
|
-
"@rudderjs/support": "^1.6.0"
|
|
50
|
+
"@rudderjs/contracts": "^1.16.0",
|
|
51
|
+
"@rudderjs/support": "^1.6.0",
|
|
52
|
+
"@rudderjs/router": "^1.9.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "^20.0.0",
|