@replanejs/next 0.8.8 → 0.8.11

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/index.cjs CHANGED
@@ -25,6 +25,11 @@ const __replanejs_sdk = __toESM(require("@replanejs/sdk"));
25
25
  const __replanejs_react = __toESM(require("@replanejs/react"));
26
26
  const react_jsx_runtime = __toESM(require("react/jsx-runtime"));
27
27
 
28
+ //#region src/version.ts
29
+ const VERSION = "0.8.11";
30
+ const DEFAULT_AGENT = `replane-js-next/${VERSION}`;
31
+
32
+ //#endregion
28
33
  //#region src/root.tsx
29
34
  /**
30
35
  * Server component that fetches Replane configs and provides them to the app.
@@ -54,9 +59,13 @@ const react_jsx_runtime = __toESM(require("react/jsx-runtime"));
54
59
  * ```
55
60
  */
56
61
  async function ReplaneRoot({ options, children }) {
57
- const snapshot = await (0, __replanejs_sdk.getReplaneSnapshot)(options);
62
+ const optionsWithAgent = {
63
+ ...options,
64
+ agent: options.agent ?? DEFAULT_AGENT
65
+ };
66
+ const snapshot = await (0, __replanejs_sdk.getReplaneSnapshot)(optionsWithAgent);
58
67
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__replanejs_react.ReplaneProvider, {
59
- options,
68
+ options: optionsWithAgent,
60
69
  snapshot,
61
70
  children
62
71
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/root.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAYA;;;AAKW,UALM,gBAKN,CAAA,UAAA,MAAA,CAAA,CAAA;EAAoB;AAIV;AA8BrB;;EAAiC,OAAqB,EAlC3C,sBAkC2C,CAlCtB,CAkCsB,CAAA;EAAO;;;EAA8B,QAAG,EA9BlF,SA8BkF;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAxE;;;GAAqD,iBAAiB,KAAE,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/root.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAaA;;;AAKW,UALM,gBAKN,CAAA,UAAA,MAAA,CAAA,CAAA;EAAoB;AAIV;AA8BrB;;EAAiC,OAAqB,EAlC3C,sBAkC2C,CAlCtB,CAkCsB,CAAA;EAAO;;;EAA8B,QAAG,EA9BlF,SA8BkF;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAxE;;;GAAqD,iBAAiB,KAAE,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/root.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAYA;;;AAKW,UALM,gBAKN,CAAA,UAAA,MAAA,CAAA,CAAA;EAAoB;AAIV;AA8BrB;;EAAiC,OAAqB,EAlC3C,sBAkC2C,CAlCtB,CAkCsB,CAAA;EAAO;;;EAA8B,QAAG,EA9BlF,SA8BkF;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAxE;;;GAAqD,iBAAiB,KAAE,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/root.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAaA;;;AAKW,UALM,gBAKN,CAAA,UAAA,MAAA,CAAA,CAAA;EAAoB;AAIV;AA8BrB;;EAAiC,OAAqB,EAlC3C,sBAkC2C,CAlCtB,CAkCsB,CAAA;EAAO;;;EAA8B,QAAG,EA9BlF,SA8BkF;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAxE;;;GAAqD,iBAAiB,KAAE,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
package/dist/index.js CHANGED
@@ -2,6 +2,11 @@ import { ReplaneError, ReplaneErrorCode, createInMemoryReplaneClient, createRepl
2
2
  import { ReplaneProvider, ReplaneProvider as ReplaneProvider$1, clearSuspenseCache, createConfigHook, createReplaneHook, getReplaneSnapshot, useConfig, useReplane } from "@replanejs/react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
 
5
+ //#region src/version.ts
6
+ const VERSION = "0.8.11";
7
+ const DEFAULT_AGENT = `replane-js-next/${VERSION}`;
8
+
9
+ //#endregion
5
10
  //#region src/root.tsx
6
11
  /**
7
12
  * Server component that fetches Replane configs and provides them to the app.
@@ -31,9 +36,13 @@ import { jsx } from "react/jsx-runtime";
31
36
  * ```
32
37
  */
33
38
  async function ReplaneRoot({ options, children }) {
34
- const snapshot = await getReplaneSnapshot$1(options);
39
+ const optionsWithAgent = {
40
+ ...options,
41
+ agent: options.agent ?? DEFAULT_AGENT
42
+ };
43
+ const snapshot = await getReplaneSnapshot$1(optionsWithAgent);
35
44
  return /* @__PURE__ */ jsx(ReplaneProvider$1, {
36
- options,
45
+ options: optionsWithAgent,
37
46
  snapshot,
38
47
  children
39
48
  });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReplaneProvider"],"sources":["../src/root.tsx"],"sourcesContent":["/**\n * Server-side utilities for Next.js\n * Use this module in Server Components, getServerSideProps, or getStaticProps\n */\n\nimport type { ReactNode } from \"react\";\nimport { getReplaneSnapshot, type ReplaneClientOptions } from \"@replanejs/sdk\";\nimport { ReplaneProvider } from \"@replanejs/react\";\n\n/**\n * Props for ReplaneRoot server component\n */\nexport interface ReplaneRootProps<T extends object> {\n /**\n * Options for Replane client.\n * Used for both server-side fetching and client-side live updates.\n */\n options: ReplaneClientOptions<T>;\n /**\n * React children to render inside the provider\n */\n children: ReactNode;\n}\n\n/**\n * Server component that fetches Replane configs and provides them to the app.\n * This is the simplest way to set up Replane in Next.js App Router.\n *\n * @example Basic usage in layout.tsx\n * ```tsx\n * // app/layout.tsx\n * import { ReplaneRoot } from \"@replanejs/next\";\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * <ReplaneRoot\n * options={{\n * baseUrl: process.env.NEXT_PUBLIC_REPLANE_BASE_URL!,\n * sdkKey: process.env.NEXT_PUBLIC_REPLANE_SDK_KEY!,\n * }}\n * >\n * {children}\n * </ReplaneRoot>\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport async function ReplaneRoot<T extends object>({ options, children }: ReplaneRootProps<T>) {\n const snapshot = await getReplaneSnapshot(options);\n\n return (\n <ReplaneProvider options={options} snapshot={snapshot}>\n {children}\n </ReplaneProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,eAAsB,YAA8B,EAAE,SAAS,UAA+B,EAAE;CAC9F,MAAM,WAAW,MAAM,qBAAmB,QAAQ;AAElD,wBACE,IAACA;EAAyB;EAAmB;EAC1C;GACe;AAErB"}
1
+ {"version":3,"file":"index.js","names":["ReplaneProvider"],"sources":["../src/version.ts","../src/root.tsx"],"sourcesContent":["// Auto-generated - do not edit manually\nexport const VERSION = \"0.8.11\";\nexport const DEFAULT_AGENT = `replane-js-next/${VERSION}`;\n","/**\n * Server-side utilities for Next.js\n * Use this module in Server Components, getServerSideProps, or getStaticProps\n */\n\nimport type { ReactNode } from \"react\";\nimport { getReplaneSnapshot, type ReplaneClientOptions } from \"@replanejs/sdk\";\nimport { ReplaneProvider } from \"@replanejs/react\";\nimport { DEFAULT_AGENT } from \"./version\";\n\n/**\n * Props for ReplaneRoot server component\n */\nexport interface ReplaneRootProps<T extends object> {\n /**\n * Options for Replane client.\n * Used for both server-side fetching and client-side live updates.\n */\n options: ReplaneClientOptions<T>;\n /**\n * React children to render inside the provider\n */\n children: ReactNode;\n}\n\n/**\n * Server component that fetches Replane configs and provides them to the app.\n * This is the simplest way to set up Replane in Next.js App Router.\n *\n * @example Basic usage in layout.tsx\n * ```tsx\n * // app/layout.tsx\n * import { ReplaneRoot } from \"@replanejs/next\";\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * <ReplaneRoot\n * options={{\n * baseUrl: process.env.NEXT_PUBLIC_REPLANE_BASE_URL!,\n * sdkKey: process.env.NEXT_PUBLIC_REPLANE_SDK_KEY!,\n * }}\n * >\n * {children}\n * </ReplaneRoot>\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport async function ReplaneRoot<T extends object>({ options, children }: ReplaneRootProps<T>) {\n const optionsWithAgent = {\n ...options,\n agent: options.agent ?? DEFAULT_AGENT,\n };\n const snapshot = await getReplaneSnapshot(optionsWithAgent);\n\n return (\n <ReplaneProvider options={optionsWithAgent} snapshot={snapshot}>\n {children}\n </ReplaneProvider>\n );\n}\n"],"mappings":";;;;;AACA,MAAa,UAAU;AACvB,MAAa,iBAAiB,kBAAkB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkDxD,eAAsB,YAA8B,EAAE,SAAS,UAA+B,EAAE;CAC9F,MAAM,mBAAmB;EACvB,GAAG;EACH,OAAO,QAAQ,SAAS;CACzB;CACD,MAAM,WAAW,MAAM,qBAAmB,iBAAiB;AAE3D,wBACE,IAACA;EAAgB,SAAS;EAA4B;EACnD;GACe;AAErB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@replanejs/next",
3
- "version": "0.8.8",
3
+ "version": "0.8.11",
4
4
  "description": "Next.js SDK for Replane - feature flags and remote configuration with SSR support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -45,8 +45,8 @@
45
45
  "react": ">=18.0.0"
46
46
  },
47
47
  "dependencies": {
48
- "@replanejs/react": "^0.8.8",
49
- "@replanejs/sdk": "^0.8.8"
48
+ "@replanejs/react": "^0.8.11",
49
+ "@replanejs/sdk": "^0.8.11"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/node": "^22.19.3",
@@ -66,6 +66,7 @@
66
66
  "access": "public"
67
67
  },
68
68
  "scripts": {
69
+ "prebuild": "node ../../scripts/update-version.js .",
69
70
  "build": "tsdown",
70
71
  "dev": "tsdown --watch",
71
72
  "typecheck": "tsc --noEmit",