@runlot/next 0.1.0-rc.15 → 0.1.0-rc.150

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/store.js CHANGED
@@ -1,32 +1,34 @@
1
- // 요청 문맥 저장소 (docs/nextjs.md §4).
1
+ // The request-context store (docs/nextjs.md §4).
2
2
  //
3
- // `runlot/next` 의 `env` 는 워커 진입점이 받은 `(request, env, ctx)` 를 읽는다.
4
- // Next 의 서버 컴포넌트에는 그 셋을 인자로 내려보낼 자리가 없으므로 —
5
- // `page.tsx` 는 `props` 만 받는다 — 진입 wrapper 가 AsyncLocalStorage 에 넣고
6
- // 이 모듈이 그것을 꺼낸다.
3
+ // The `env` of `runlot/next` reads the `(request, env, ctx)` the worker entry
4
+ // point received. A Next server component has no place to pass those three down
5
+ // as arguments — `page.tsx` only receives `props` — so the entry wrapper puts
6
+ // them into an AsyncLocalStorage and this module takes them back out.
7
7
  //
8
- // **저장소는 `globalThis` 의 심볼 하나다.** 모듈 인스턴스가 하나라는 보장이
9
- // 없어서다: OpenNext 가 낸 `worker.js` 는 이미 묶인 번들이라 그 안에 이 패키지의
10
- // 사본이 들어 있고, 그 곁에 세우는 `runlot-entry.js` 를 우리가 다시 묶으면 사본이
11
- // 하나 더 생긴다. 모듈 지역 변수에 저장소를 두면 wrapper 가 넣은 값을 페이지가
12
- // 못 본다 — 조용히 "요청이 없습니다" 가 된다. OpenNext 자신도 같은 이유로
13
- // `Symbol.for("__cloudflare-context__")` 를 쓴다.
8
+ // **The store is one symbol on `globalThis`.** Because there is no guarantee of
9
+ // a single module instance: the `worker.js` OpenNext emits is an already-bundled
10
+ // bundle that contains a copy of this package inside it, and bundling the
11
+ // `runlot-entry.js` we stand up beside it makes one more copy. Keep the store in
12
+ // a module-local variable and the page cannot see the value the wrapper put in —
13
+ // it quietly becomes "there is no request". OpenNext itself uses
14
+ // `Symbol.for("__cloudflare-context__")` for the same reason.
14
15
  import { AsyncLocalStorage } from "node:async_hooks";
15
16
  const STORE = Symbol.for("runlot.next.store");
16
17
  const g = globalThis;
17
- /** 요청 문맥 저장소. 진입 wrapper 가 넣고 `env`·`request()`·`waitUntil()` 이 읽는다. */
18
+ /** The request-context store. The entry wrapper puts into it and `env`,
19
+ * `request()` and `waitUntil()` read from it. */
18
20
  export const als = (g[STORE] ??= new AsyncLocalStorage());
19
21
  /**
20
- * 저장소 밖에서 부를 때의 문장.
22
+ * The sentence for being called outside the store.
21
23
  *
22
- * 조용히 `null`·`undefined` 를 주지 않는 이유는 docs/auth.md §4 와 같다 — "안 됨"
23
- * 이 빈 값이 되면 모든 페이지가 로그아웃 상태로 보이고, 그것을 알아채는 자리는
24
- * 배포 뒤뿐이다.
24
+ * The reason it does not quietly hand back `null` or `undefined` is the same as
25
+ * docs/auth.md §4 — when "cannot be done" becomes an empty value, every page
26
+ * looks logged out, and the only place that is noticed is after a deploy.
25
27
  */
26
- export const OUTSIDE_REQUEST = "runlot/next 의 `env` 는 요청 안에서만 읽을 수 있습니다. " +
27
- "모듈 최상단이나 빌드 시점 정적 렌더에는 요청이 없습니다 — " +
28
- "서버 컴포넌트·라우트 핸들러·미들웨어 안으로 옮기세요. " +
29
- "`next dev` 는 아직 runlot 바인딩을 모릅니다; `runlot deploy` 로 확인합니다.";
28
+ export const OUTSIDE_REQUEST = "The `env` of runlot/next can only be read inside a request. " +
29
+ "There is no request at module top level or in a build-time static render — " +
30
+ "move it inside a server component, a route handler or middleware. " +
31
+ "Runlot bindings are not available under `next dev`. Deploy with `runlot deploy` and check there.";
30
32
  export function store() {
31
33
  const s = als.getStore();
32
34
  if (!s)
package/dist/store.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,EAAE;AACF,kEAAkE;AAClE,4CAA4C;AAC5C,mEAAmE;AACnE,iBAAiB;AACjB,EAAE;AACF,oDAAoD;AACpD,0DAA0D;AAC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AAe,GAC1B,8DAA8D;IAC9D,6EAA6E;IAC7E,oEAAoE;IACpE,kGAAkG,CAAC;AAErG,MAAM,UAAU,KAAK;IACnB,MAAM,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;IACzC,OAAO,CAAC,CAAC;AACX,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@runlot/next",
3
- "version": "0.1.0-rc.15",
4
- "description": "Next.js 어댑터 — env 프록시와 OpenNext 빌드 (docs/nextjs.md)",
3
+ "version": "0.1.0-rc.150",
4
+ "description": "Next.js adapter for Runlot — request-scoped env plus the OpenNext build",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -42,14 +42,14 @@
42
42
  "dependencies": {
43
43
  "@opennextjs/aws": "4.1.4",
44
44
  "@opennextjs/cloudflare": "^1.20.6",
45
- "@runlot/auth": "0.1.0-rc.15",
46
- "@runlot/pg": "0.1.0-rc.15"
45
+ "@runlot/auth": "0.1.0-rc.150",
46
+ "@runlot/pg": "0.1.0-rc.150"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/node": "^22.10.2",
50
50
  "esbuild": "^0.24.2",
51
51
  "typescript": "^5.7.2",
52
- "@runlot/config": "0.1.0-rc.15"
52
+ "@runlot/config": "0.1.0-rc.150"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "tsc -p tsconfig.build.json",