@stryke/trpc-next 0.5.87 → 0.5.89

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.
Files changed (100) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
  3. package/dist/action-handler.cjs +5 -4
  4. package/dist/action-handler.d.cts +7 -8
  5. package/dist/action-handler.d.cts.map +1 -1
  6. package/dist/action-handler.d.mts +7 -8
  7. package/dist/action-handler.d.mts.map +1 -1
  8. package/dist/action-handler.mjs.map +1 -1
  9. package/dist/client.cjs +8 -7
  10. package/dist/client.d.cts +2 -3
  11. package/dist/client.d.cts.map +1 -1
  12. package/dist/client.d.mts +2 -3
  13. package/dist/client.d.mts.map +1 -1
  14. package/dist/env/src/environment-checks.cjs +6 -6
  15. package/dist/env/src/environment-checks.mjs +6 -6
  16. package/dist/env/src/environment-checks.mjs.map +1 -1
  17. package/dist/env/src/get-env-paths.cjs +2 -2
  18. package/dist/env/src/load-env.cjs +2 -2
  19. package/dist/env/src/providers.cjs +4 -4
  20. package/dist/env/src/providers.mjs +4 -4
  21. package/dist/env/src/providers.mjs.map +1 -1
  22. package/dist/env/src/runtime-checks.mjs.map +1 -1
  23. package/dist/index.cjs +5 -4
  24. package/dist/path/src/join-paths.mjs.map +1 -1
  25. package/dist/server.cjs +10 -9
  26. package/dist/server.d.cts +1 -1
  27. package/dist/server.d.cts.map +1 -1
  28. package/dist/server.d.mts +1 -1
  29. package/dist/server.d.mts.map +1 -1
  30. package/dist/shared.cjs +12 -11
  31. package/dist/shared.d.cts.map +1 -1
  32. package/dist/shared.d.mts.map +1 -1
  33. package/dist/shield/constructors.cjs +4 -3
  34. package/dist/shield/constructors.d.cts +0 -1
  35. package/dist/shield/constructors.d.cts.map +1 -1
  36. package/dist/shield/constructors.d.mts +0 -1
  37. package/dist/shield/constructors.d.mts.map +1 -1
  38. package/dist/shield/constructors.mjs +3 -3
  39. package/dist/shield/constructors.mjs.map +1 -1
  40. package/dist/shield/generator.cjs +1 -0
  41. package/dist/shield/generator.d.cts +0 -1
  42. package/dist/shield/generator.d.cts.map +1 -1
  43. package/dist/shield/generator.d.mts +0 -1
  44. package/dist/shield/generator.d.mts.map +1 -1
  45. package/dist/shield/generator.mjs.map +1 -1
  46. package/dist/shield/index.cjs +1 -0
  47. package/dist/shield/rules.cjs +1 -0
  48. package/dist/shield/rules.d.cts.map +1 -1
  49. package/dist/shield/rules.d.mts.map +1 -1
  50. package/dist/shield/rules.mjs.map +1 -1
  51. package/dist/shield/shield.cjs +1 -0
  52. package/dist/shield/shield.d.cts +0 -1
  53. package/dist/shield/shield.d.cts.map +1 -1
  54. package/dist/shield/shield.d.mts +0 -1
  55. package/dist/shield/shield.d.mts.map +1 -1
  56. package/dist/shield/types.d.cts.map +1 -1
  57. package/dist/shield/types.d.mts.map +1 -1
  58. package/dist/shield/utils.cjs +1 -0
  59. package/dist/shield/utils.d.cts +0 -1
  60. package/dist/shield/utils.d.cts.map +1 -1
  61. package/dist/shield/utils.d.mts +0 -1
  62. package/dist/shield/utils.d.mts.map +1 -1
  63. package/dist/shield/utils.mjs.map +1 -1
  64. package/dist/shield/validation.cjs +3 -2
  65. package/dist/shield/validation.d.cts +0 -1
  66. package/dist/shield/validation.d.cts.map +1 -1
  67. package/dist/shield/validation.d.mts +0 -1
  68. package/dist/shield/validation.d.mts.map +1 -1
  69. package/dist/shield/validation.mjs +2 -2
  70. package/dist/shield/validation.mjs.map +1 -1
  71. package/dist/string-format/src/acronyms.cjs +0 -1
  72. package/dist/string-format/src/acronyms.mjs +0 -1
  73. package/dist/string-format/src/acronyms.mjs.map +1 -1
  74. package/dist/tanstack-query/client.cjs +8 -7
  75. package/dist/tanstack-query/client.d.cts +4 -5
  76. package/dist/tanstack-query/client.d.cts.map +1 -1
  77. package/dist/tanstack-query/client.d.mts +4 -5
  78. package/dist/tanstack-query/client.d.mts.map +1 -1
  79. package/dist/tanstack-query/client.mjs.map +1 -1
  80. package/dist/tanstack-query/server.cjs +9 -8
  81. package/dist/tanstack-query/server.d.cts +4 -6
  82. package/dist/tanstack-query/server.d.cts.map +1 -1
  83. package/dist/tanstack-query/server.d.mts +4 -6
  84. package/dist/tanstack-query/server.d.mts.map +1 -1
  85. package/dist/tanstack-query/server.mjs.map +1 -1
  86. package/dist/types/src/base.d.cts +0 -1
  87. package/dist/types/src/base.d.cts.map +1 -1
  88. package/dist/types/src/base.d.mts +0 -1
  89. package/dist/types/src/base.d.mts.map +1 -1
  90. package/dist/types.d.cts.map +1 -1
  91. package/dist/types.d.mts.map +1 -1
  92. package/dist/url/src/index.d.cts +1 -0
  93. package/dist/url/src/index.d.mts +1 -2
  94. package/dist/url/src/storm-url.d.cts +1 -0
  95. package/dist/url/src/storm-url.d.mts +1 -1
  96. package/dist/url/src/types.d.cts +1 -2
  97. package/dist/url/src/types.d.cts.map +1 -1
  98. package/dist/url/src/types.d.mts +0 -1
  99. package/dist/url/src/types.d.mts.map +1 -1
  100. package/package.json +94 -36
package/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  # Changelog for Stryke - TRPC Next
4
4
 
5
+ ## [0.5.89](https://github.com/storm-software/stryke/releases/tag/trpc-next%400.5.89) (05/06/2026)
6
+
7
+ ### Updated Dependencies
8
+
9
+ - Updated **path** to **v0.29.0**
10
+ - Updated **env** to **v0.20.89**
11
+ - Updated **url** to **v0.4.21**
12
+
13
+ ## [0.5.88](https://github.com/storm-software/stryke/releases/tag/trpc-next%400.5.88) (05/06/2026)
14
+
15
+ ### Miscellaneous
16
+
17
+ - **monorepo:** Resolve issues with workspace packages' build configuration ([f4a3941f](https://github.com/storm-software/stryke/commit/f4a3941f))
18
+
19
+ ### Updated Dependencies
20
+
21
+ - Updated **types** to **v0.12.1**
22
+ - Updated **path** to **v0.28.3**
23
+ - Updated **env** to **v0.20.88**
24
+ - Updated **url** to **v0.4.20**
25
+
5
26
  ## [0.5.87](https://github.com/storm-software/stryke/releases/tag/trpc-next%400.5.87) (05/01/2026)
6
27
 
7
28
  ### Updated Dependencies
@@ -1,4 +1,4 @@
1
- //#region rolldown:runtime
1
+ //#region \0rolldown/runtime.js
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,7 +1,8 @@
1
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
- let __trpc_next_app_dir_server = require("@trpc/next/app-dir/server");
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+ let _trpc_next_app_dir_server = require("@trpc/next/app-dir/server");
3
4
  let defu = require("defu");
4
- defu = require_rolldown_runtime.__toESM(defu);
5
+ defu = require_runtime.__toESM(defu, 1);
5
6
 
6
7
  //#region src/action-handler.ts
7
8
  /**
@@ -12,7 +13,7 @@ defu = require_rolldown_runtime.__toESM(defu);
12
13
  * @param createContext - An optional function to generate a context
13
14
  */
14
15
  function createTRPCServerActionHandler(cookies, t, createContext = async () => ({})) {
15
- return (0, __trpc_next_app_dir_server.experimental_createServerActionHandler)(t, { createContext: async () => {
16
+ return (0, _trpc_next_app_dir_server.experimental_createServerActionHandler)(t, { createContext: async () => {
16
17
  return (0, defu.default)(await Promise.resolve(createContext()), { headers: { cookies: (await cookies()).toString() ?? "" } });
17
18
  } });
18
19
  }
@@ -1,12 +1,11 @@
1
1
  import { MaybePromise } from "./types/src/base.cjs";
2
2
  import { BaseContext } from "./types.cjs";
3
- import * as _trpc_server0 from "@trpc/server";
4
- import * as _trpc_next_app_dir_server0 from "@trpc/next/app-dir/server";
3
+ import * as _$_trpc_server0 from "@trpc/server";
4
+ import * as _$_trpc_next_app_dir_server0 from "@trpc/next/app-dir/server";
5
5
  import { AnyRootTypes, RootConfig } from "@trpc/server/unstable-core-do-not-import";
6
- import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies";
6
+ import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies.js";
7
7
 
8
8
  //#region src/action-handler.d.ts
9
-
10
9
  /**
11
10
  * This client invokes procedures directly on the server without fetching over HTTP.
12
11
  *
@@ -16,10 +15,10 @@ import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adap
16
15
  */
17
16
  declare function createTRPCServerActionHandler<TInstance extends {
18
17
  _config: RootConfig<AnyRootTypes>;
19
- }, TContext extends BaseContext = BaseContext>(cookies: () => Promise<ReadonlyRequestCookies>, t: TInstance, createContext?: () => MaybePromise<TContext>): <TProc extends _trpc_server0.AnyProcedure>(proc: TProc) => _trpc_next_app_dir_server0.TRPCActionHandler<{
20
- input: _trpc_server0.inferProcedureInput<TProc>;
21
- output: _trpc_server0.inferProcedureOutput<TProc>;
22
- errorShape: _trpc_server0.inferTRPCClientTypes<TInstance>["errorShape"];
18
+ }, TContext extends BaseContext = BaseContext>(cookies: () => Promise<ReadonlyRequestCookies>, t: TInstance, createContext?: () => MaybePromise<TContext>): <TProc extends _$_trpc_server0.AnyProcedure>(proc: TProc) => _$_trpc_next_app_dir_server0.TRPCActionHandler<{
19
+ input: _$_trpc_server0.inferProcedureInput<TProc>;
20
+ output: _$_trpc_server0.inferProcedureOutput<TProc>;
21
+ errorShape: _$_trpc_server0.inferTRPCClientTypes<TInstance>["errorShape"];
23
22
  }>;
24
23
  //#endregion
25
24
  export { createTRPCServerActionHandler };
@@ -1 +1 @@
1
- {"version":3,"file":"action-handler.d.cts","names":[],"sources":["../src/action-handler.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AAmCA;;;AAImB,iBAJH,6BAIG,CAAA,kBAAA;EAAc,OAAA,EAFpB,UAEoB,CAFT,YAES,CAAA;CAER,EAAA,iBAFN,WAEM,GAFQ,WAER,CAAA,CAAA,OAAA,EAAA,GAAA,GAAR,OAAQ,CAAA,sBAAA,CAAA,EAAA,CAAA,EACpB,SADoB,EAAA,aAAA,CAAA,EAAA,GAAA,GAEF,YAFE,CAEW,QAFX,CAAA,CAAA,EAAA,CAAA,cAEU,aAAA,CAAyC,YAFnD,CAAA,CAAA,IAAA,EAEmD,KAFnD,EAAA,8BAEmD,iBAFnD,CAAA;EAAR,KAAA,mCAAA,MAAA,CAAA;EACZ,MAAA,oCAAA,MAAA,CAAA;EAC+B,UAAA,oCAAA,UAAA,CAAA,CAAA,YAAA,CAAA;CAAb,CAAA"}
1
+ {"version":3,"file":"action-handler.d.cts","names":[],"sources":["../src/action-handler.ts"],"mappings":";;;;;;;;;;;;AAmCA;;;iBAAgB,6BAAA;EAEZ,OAAA,EAAS,UAAA,CAAW,YAAA;AAAA,oBAEL,WAAA,GAAc,WAAA,CAAA,CAE/B,OAAA,QAAe,OAAA,CAAQ,sBAAA,GACvB,CAAA,EAAG,SAAA,EACH,aAAA,SAAqB,YAAA,CAAa,QAAA,mBAAD,eAAA,CAAyC,YAAA,EAAA,IAAA,EAAA,KAAA,kCAAA,iBAAA"}
@@ -1,12 +1,11 @@
1
1
  import { MaybePromise } from "./types/src/base.mjs";
2
2
  import { BaseContext } from "./types.mjs";
3
- import * as _trpc_next_app_dir_server0 from "@trpc/next/app-dir/server";
4
- import * as _trpc_server0 from "@trpc/server";
3
+ import * as _$_trpc_next_app_dir_server0 from "@trpc/next/app-dir/server";
4
+ import * as _$_trpc_server0 from "@trpc/server";
5
5
  import { AnyRootTypes, RootConfig } from "@trpc/server/unstable-core-do-not-import";
6
- import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies";
6
+ import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adapters/request-cookies.js";
7
7
 
8
8
  //#region src/action-handler.d.ts
9
-
10
9
  /**
11
10
  * This client invokes procedures directly on the server without fetching over HTTP.
12
11
  *
@@ -16,10 +15,10 @@ import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adap
16
15
  */
17
16
  declare function createTRPCServerActionHandler<TInstance extends {
18
17
  _config: RootConfig<AnyRootTypes>;
19
- }, TContext extends BaseContext = BaseContext>(cookies: () => Promise<ReadonlyRequestCookies>, t: TInstance, createContext?: () => MaybePromise<TContext>): <TProc extends _trpc_server0.AnyProcedure>(proc: TProc) => _trpc_next_app_dir_server0.TRPCActionHandler<{
20
- input: _trpc_server0.inferProcedureInput<TProc>;
21
- output: _trpc_server0.inferProcedureOutput<TProc>;
22
- errorShape: _trpc_server0.inferTRPCClientTypes<TInstance>["errorShape"];
18
+ }, TContext extends BaseContext = BaseContext>(cookies: () => Promise<ReadonlyRequestCookies>, t: TInstance, createContext?: () => MaybePromise<TContext>): <TProc extends _$_trpc_server0.AnyProcedure>(proc: TProc) => _$_trpc_next_app_dir_server0.TRPCActionHandler<{
19
+ input: _$_trpc_server0.inferProcedureInput<TProc>;
20
+ output: _$_trpc_server0.inferProcedureOutput<TProc>;
21
+ errorShape: _$_trpc_server0.inferTRPCClientTypes<TInstance>["errorShape"];
23
22
  }>;
24
23
  //#endregion
25
24
  export { createTRPCServerActionHandler };
@@ -1 +1 @@
1
- {"version":3,"file":"action-handler.d.mts","names":[],"sources":["../src/action-handler.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AAmCA;;;AAImB,iBAJH,6BAIG,CAAA,kBAAA;EAAc,OAAA,EAFpB,UAEoB,CAFT,YAES,CAAA;CAER,EAAA,iBAFN,WAEM,GAFQ,WAER,CAAA,CAAA,OAAA,EAAA,GAAA,GAAR,OAAQ,CAAA,sBAAA,CAAA,EAAA,CAAA,EACpB,SADoB,EAAA,aAAA,CAAA,EAAA,GAAA,GAEF,YAFE,CAEW,QAFX,CAAA,CAAA,EAAA,CAAA,cAEU,aAAA,CAAyC,YAFnD,CAAA,CAAA,IAAA,EAEmD,KAFnD,EAAA,8BAEmD,iBAFnD,CAAA;EAAR,KAAA,mCAAA,MAAA,CAAA;EACZ,MAAA,oCAAA,MAAA,CAAA;EAC+B,UAAA,oCAAA,UAAA,CAAA,CAAA,YAAA,CAAA;CAAb,CAAA"}
1
+ {"version":3,"file":"action-handler.d.mts","names":[],"sources":["../src/action-handler.ts"],"mappings":";;;;;;;;;;;;AAmCA;;;iBAAgB,6BAAA;EAEZ,OAAA,EAAS,UAAA,CAAW,YAAA;AAAA,oBAEL,WAAA,GAAc,WAAA,CAAA,CAE/B,OAAA,QAAe,OAAA,CAAQ,sBAAA,GACvB,CAAA,EAAG,SAAA,EACH,aAAA,SAAqB,YAAA,CAAa,QAAA,mBAAD,eAAA,CAAyC,YAAA,EAAA,IAAA,EAAA,KAAA,kCAAA,iBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"action-handler.mjs","names":[],"sources":["../src/action-handler.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { MaybePromise } from \"@stryke/types\";\nimport { experimental_createServerActionHandler } from \"@trpc/next/app-dir/server\";\nimport type {\n AnyRootTypes,\n RootConfig\n} from \"@trpc/server/unstable-core-do-not-import\";\nimport defu from \"defu\";\nimport type { ReadonlyRequestCookies } from \"next/dist/server/web/spec-extension/adapters/request-cookies\";\nimport type { BaseContext } from \"./types\";\n\n/**\n * This client invokes procedures directly on the server without fetching over HTTP.\n *\n * @param cookies - A function that returns the cookies to be passed to the API\n * @param t - The tRPC instance\n * @param createContext - An optional function to generate a context\n */\nexport function createTRPCServerActionHandler<\n TInstance extends {\n _config: RootConfig<AnyRootTypes>;\n },\n TContext extends BaseContext = BaseContext\n>(\n cookies: () => Promise<ReadonlyRequestCookies>,\n t: TInstance,\n createContext: () => MaybePromise<TContext> = async () => ({}) as TContext\n) {\n return experimental_createServerActionHandler(t, {\n createContext: async () => {\n const context = await Promise.resolve(createContext());\n\n return defu(context, {\n headers: {\n // Pass the cookie header to the API\n cookies: (await cookies()).toString() ?? \"\"\n }\n });\n }\n });\n}\n"],"mappings":";;;;;;;;;;;AAmCA,SAAgB,8BAMd,SACA,GACA,gBAA8C,aAAa,EAAE,GAC7D;AACA,QAAO,uCAAuC,GAAG,EAC/C,eAAe,YAAY;AAGzB,SAAO,KAFS,MAAM,QAAQ,QAAQ,eAAe,CAAC,EAEjC,EACnB,SAAS,EAEP,UAAU,MAAM,SAAS,EAAE,UAAU,IAAI,IAC1C,EACF,CAAC;IAEL,CAAC"}
1
+ {"version":3,"file":"action-handler.mjs","names":[],"sources":["../src/action-handler.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { MaybePromise } from \"@stryke/types\";\nimport { experimental_createServerActionHandler } from \"@trpc/next/app-dir/server\";\nimport type {\n AnyRootTypes,\n RootConfig\n} from \"@trpc/server/unstable-core-do-not-import\";\nimport defu from \"defu\";\nimport type { ReadonlyRequestCookies } from \"next/dist/server/web/spec-extension/adapters/request-cookies\";\nimport type { BaseContext } from \"./types\";\n\n/**\n * This client invokes procedures directly on the server without fetching over HTTP.\n *\n * @param cookies - A function that returns the cookies to be passed to the API\n * @param t - The tRPC instance\n * @param createContext - An optional function to generate a context\n */\nexport function createTRPCServerActionHandler<\n TInstance extends {\n _config: RootConfig<AnyRootTypes>;\n },\n TContext extends BaseContext = BaseContext\n>(\n cookies: () => Promise<ReadonlyRequestCookies>,\n t: TInstance,\n createContext: () => MaybePromise<TContext> = async () => ({}) as TContext\n) {\n return experimental_createServerActionHandler(t, {\n createContext: async () => {\n const context = await Promise.resolve(createContext());\n\n return defu(context, {\n headers: {\n // Pass the cookie header to the API\n cookies: (await cookies()).toString() ?? \"\"\n }\n });\n }\n });\n}\n"],"mappings":";;;;;;;;;;;AAmCA,SAAgB,8BAMd,SACA,GACA,gBAA8C,aAAa,EAAE,GAC7D;AACA,QAAO,uCAAuC,GAAG,EAC/C,eAAe,YAAY;AAGzB,SAAO,KAAK,MAFU,QAAQ,QAAQ,eAAe,CAAC,EAEjC,EACnB,SAAS,EAEP,UAAU,MAAM,SAAS,EAAE,UAAU,IAAI,IAC1C,EACF,CAAC;IAEL,CAAC"}
package/dist/client.cjs CHANGED
@@ -1,10 +1,11 @@
1
1
  "use client";
2
2
 
3
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
4
5
  const require_shared = require('./shared.cjs');
5
- let __trpc_client = require("@trpc/client");
6
- let __trpc_next_app_dir_client = require("@trpc/next/app-dir/client");
7
- let __trpc_next_app_dir_links_nextHttp = require("@trpc/next/app-dir/links/nextHttp");
6
+ let _trpc_client = require("@trpc/client");
7
+ let _trpc_next_app_dir_client = require("@trpc/next/app-dir/client");
8
+ let _trpc_next_app_dir_links_nextHttp = require("@trpc/next/app-dir/links/nextHttp");
8
9
 
9
10
  //#region src/client.ts
10
11
  /**
@@ -14,8 +15,8 @@ let __trpc_next_app_dir_links_nextHttp = require("@trpc/next/app-dir/links/nextH
14
15
  * @returns A tRPC client that can be used to make requests to the server.
15
16
  */
16
17
  function createTRPCClient(baseUrl) {
17
- return (0, __trpc_next_app_dir_client.experimental_createTRPCNextAppDirClient)({ config() {
18
- return { links: [(0, __trpc_client.loggerLink)({ enabled: (_op) => true }), (0, __trpc_next_app_dir_links_nextHttp.experimental_nextHttpLink)({
18
+ return (0, _trpc_next_app_dir_client.experimental_createTRPCNextAppDirClient)({ config() {
19
+ return { links: [(0, _trpc_client.loggerLink)({ enabled: (_op) => true }), (0, _trpc_next_app_dir_links_nextHttp.experimental_nextHttpLink)({
19
20
  transformer: require_shared.transformer,
20
21
  batch: true,
21
22
  url: require_shared.getTRPCServerUrl(baseUrl),
@@ -31,7 +32,7 @@ function createTRPCClient(baseUrl) {
31
32
  * @returns A function that can be used to create a tRPC action hook.
32
33
  */
33
34
  function createUseAction() {
34
- return (0, __trpc_next_app_dir_client.experimental_createActionHook)({ links: [(0, __trpc_client.loggerLink)(), (0, __trpc_next_app_dir_client.experimental_serverActionLink)({ transformer: require_shared.transformer })] });
35
+ return (0, _trpc_next_app_dir_client.experimental_createActionHook)({ links: [(0, _trpc_client.loggerLink)(), (0, _trpc_next_app_dir_client.experimental_serverActionLink)({ transformer: require_shared.transformer })] });
35
36
  }
36
37
 
37
38
  //#endregion
package/dist/client.d.cts CHANGED
@@ -1,17 +1,16 @@
1
1
  import { AnyTRPCRouter } from "@trpc/server";
2
2
  import { ActionHandlerDef, TRPCActionHandler } from "@trpc/next/app-dir/server";
3
- import * as _trpc_client0 from "@trpc/client";
3
+ import * as _$_trpc_client0 from "@trpc/client";
4
4
  import { UseTRPCActionResult } from "@trpc/next/app-dir/client";
5
5
 
6
6
  //#region src/client.d.ts
7
-
8
7
  /**
9
8
  * Creates a tRPC client for the Next.js app directory.
10
9
  *
11
10
  * @param baseUrl - The base URL for the tRPC server. This is typically the URL of the Next.js app.
12
11
  * @returns A tRPC client that can be used to make requests to the server.
13
12
  */
14
- declare function createTRPCClient<TRouter extends AnyTRPCRouter>(baseUrl: string): _trpc_client0.TRPCClient<TRouter>;
13
+ declare function createTRPCClient<TRouter extends AnyTRPCRouter>(baseUrl: string): _$_trpc_client0.TRPCClient<TRouter>;
15
14
  /**
16
15
  * Creates a tRPC action hook for the Next.js app directory.
17
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.cts","names":[],"sources":["../src/client.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAyCA;;;AACiB,iBADD,gBACC,CAAA,gBADgC,aAChC,CAAA,CAAA,OAAA,EAAA,MAAA,CAAA,EAAA,aAAA,CAAA,UAAA,CAAA,OAAA,CAAA;;AA8BjB;;;;AASa,iBATG,eASH,CAAA,gBATmC,aASnC,CAAA,CAAA,CAAA,EAAA,CAAA,aADiD,gBACjD,CAAA,CAAA,OAAA,EAAA,iBAAA,CAAkB,IAAlB,CAAA,EAAA,aAAA,CAAA,EAAA,GAAA,EAAA,GAEN,mBAFM,CAEc,IAFd,CAAA"}
1
+ {"version":3,"file":"client.d.cts","names":[],"sources":["../src/client.ts"],"mappings":";;;;;;;;;AAyCA;;;iBAAgB,gBAAA,iBAAiC,aAAA,CAAA,CAC/C,OAAA,WAAe,eAAA,CAAA,UAAA,CAAA,OAAA;;;;;;iBA8BD,eAAA,iBAAgC,aAAA,CAAA,CAAA,iBAQc,gBAAA,EAC1D,OAAA,EAAS,iBAAA,CAAkB,IAAA,GAC3B,aAAA,WACG,mBAAA,CAAoB,IAAA"}
package/dist/client.d.mts CHANGED
@@ -1,17 +1,16 @@
1
1
  import { ActionHandlerDef, TRPCActionHandler } from "@trpc/next/app-dir/server";
2
- import * as _trpc_client0 from "@trpc/client";
2
+ import * as _$_trpc_client0 from "@trpc/client";
3
3
  import { UseTRPCActionResult } from "@trpc/next/app-dir/client";
4
4
  import { AnyTRPCRouter } from "@trpc/server";
5
5
 
6
6
  //#region src/client.d.ts
7
-
8
7
  /**
9
8
  * Creates a tRPC client for the Next.js app directory.
10
9
  *
11
10
  * @param baseUrl - The base URL for the tRPC server. This is typically the URL of the Next.js app.
12
11
  * @returns A tRPC client that can be used to make requests to the server.
13
12
  */
14
- declare function createTRPCClient<TRouter extends AnyTRPCRouter>(baseUrl: string): _trpc_client0.TRPCClient<TRouter>;
13
+ declare function createTRPCClient<TRouter extends AnyTRPCRouter>(baseUrl: string): _$_trpc_client0.TRPCClient<TRouter>;
15
14
  /**
16
15
  * Creates a tRPC action hook for the Next.js app directory.
17
16
  *
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.mts","names":[],"sources":["../src/client.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAyCA;;;AACiB,iBADD,gBACC,CAAA,gBADgC,aAChC,CAAA,CAAA,OAAA,EAAA,MAAA,CAAA,EAAA,aAAA,CAAA,UAAA,CAAA,OAAA,CAAA;;AA8BjB;;;;AASa,iBATG,eASH,CAAA,gBATmC,aASnC,CAAA,CAAA,CAAA,EAAA,CAAA,aADiD,gBACjD,CAAA,CAAA,OAAA,EAAA,iBAAA,CAAkB,IAAlB,CAAA,EAAA,aAAA,CAAA,EAAA,GAAA,EAAA,GAEN,mBAFM,CAEc,IAFd,CAAA"}
1
+ {"version":3,"file":"client.d.mts","names":[],"sources":["../src/client.ts"],"mappings":";;;;;;;;;AAyCA;;;iBAAgB,gBAAA,iBAAiC,aAAA,CAAA,CAC/C,OAAA,WAAe,eAAA,CAAA,UAAA,CAAA,OAAA;;;;;;iBA8BD,eAAA,iBAAgC,aAAA,CAAA,CAAA,iBAQc,gBAAA,EAC1D,OAAA,EAAS,iBAAA,CAAkB,IAAA,GAC3B,aAAA,WACG,mBAAA,CAAoB,IAAA"}
@@ -21,7 +21,7 @@ const isStaging = [
21
21
  * @param mode - The mode string to check.
22
22
  * @returns Whether the environment is production
23
23
  */
24
- function isProductionMode(mode$1) {
24
+ function isProductionMode(mode) {
25
25
  return [
26
26
  "prd",
27
27
  "prod",
@@ -29,7 +29,7 @@ function isProductionMode(mode$1) {
29
29
  "preprod",
30
30
  "preproduction",
31
31
  "uat"
32
- ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
32
+ ].includes(mode?.toLowerCase()?.replace(/[\s\-_]/g, ""));
33
33
  }
34
34
  /** Detect if `NODE_ENV` environment variable is `production` */
35
35
  const isProduction = isProductionMode(mode);
@@ -39,7 +39,7 @@ const isProduction = isProductionMode(mode);
39
39
  * @param mode - The mode string to check.
40
40
  * @returns Whether the environment is test
41
41
  */
42
- function isTestMode(mode$1) {
42
+ function isTestMode(mode) {
43
43
  return [
44
44
  "tst",
45
45
  "test",
@@ -49,7 +49,7 @@ function isTestMode(mode$1) {
49
49
  "staging",
50
50
  "qa",
51
51
  "qualityassurance"
52
- ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
52
+ ].includes(mode?.toLowerCase()?.replace(/[\s\-_]/g, ""));
53
53
  }
54
54
  /** Detect if `NODE_ENV` environment variable is `test` */
55
55
  const isTest = isTestMode(mode) || isStaging || Boolean(process.env.TEST);
@@ -59,13 +59,13 @@ const isTest = isTestMode(mode) || isStaging || Boolean(process.env.TEST);
59
59
  * @param mode - The mode string to check.
60
60
  * @returns Whether the environment is development
61
61
  */
62
- function isDevelopmentMode(mode$1) {
62
+ function isDevelopmentMode(mode) {
63
63
  return [
64
64
  "dev",
65
65
  "development",
66
66
  "int",
67
67
  "integration"
68
- ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
68
+ ].includes(mode?.toLowerCase()?.replace(/[\s\-_]/g, ""));
69
69
  }
70
70
  /** Detect if `NODE_ENV` environment variable is `dev` or `development` */
71
71
  const isDevelopment = isDevelopmentMode(mode) || isDebug;
@@ -21,7 +21,7 @@ const isStaging = [
21
21
  * @param mode - The mode string to check.
22
22
  * @returns Whether the environment is production
23
23
  */
24
- function isProductionMode(mode$1) {
24
+ function isProductionMode(mode) {
25
25
  return [
26
26
  "prd",
27
27
  "prod",
@@ -29,7 +29,7 @@ function isProductionMode(mode$1) {
29
29
  "preprod",
30
30
  "preproduction",
31
31
  "uat"
32
- ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
32
+ ].includes(mode?.toLowerCase()?.replace(/[\s\-_]/g, ""));
33
33
  }
34
34
  /** Detect if `NODE_ENV` environment variable is `production` */
35
35
  const isProduction = isProductionMode(mode);
@@ -39,7 +39,7 @@ const isProduction = isProductionMode(mode);
39
39
  * @param mode - The mode string to check.
40
40
  * @returns Whether the environment is test
41
41
  */
42
- function isTestMode(mode$1) {
42
+ function isTestMode(mode) {
43
43
  return [
44
44
  "tst",
45
45
  "test",
@@ -49,7 +49,7 @@ function isTestMode(mode$1) {
49
49
  "staging",
50
50
  "qa",
51
51
  "qualityassurance"
52
- ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
52
+ ].includes(mode?.toLowerCase()?.replace(/[\s\-_]/g, ""));
53
53
  }
54
54
  /** Detect if `NODE_ENV` environment variable is `test` */
55
55
  const isTest = isTestMode(mode) || isStaging || Boolean(process.env.TEST);
@@ -59,13 +59,13 @@ const isTest = isTestMode(mode) || isStaging || Boolean(process.env.TEST);
59
59
  * @param mode - The mode string to check.
60
60
  * @returns Whether the environment is development
61
61
  */
62
- function isDevelopmentMode(mode$1) {
62
+ function isDevelopmentMode(mode) {
63
63
  return [
64
64
  "dev",
65
65
  "development",
66
66
  "int",
67
67
  "integration"
68
- ].includes(mode$1?.toLowerCase()?.replace(/[\s\-_]/g, ""));
68
+ ].includes(mode?.toLowerCase()?.replace(/[\s\-_]/g, ""));
69
69
  }
70
70
  /** Detect if `NODE_ENV` environment variable is `dev` or `development` */
71
71
  const isDevelopment = isDevelopmentMode(mode) || isDebug;
@@ -1 +1 @@
1
- {"version":3,"file":"environment-checks.mjs","names":["mode"],"sources":["../../../../env/src/environment-checks.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isCI } from \"./ci-checks\";\n\n/** Value of process.platform */\nexport const platform = process?.platform || \"\";\n\n/** Detect if stdout.TTY is available */\nexport const hasTTY = Boolean(process?.stdout && process?.stdout.isTTY);\n\n/** Detect if `DEBUG` environment variable is set */\nexport const isDebug = Boolean(process.env.DEBUG);\n\n/** Detect the `NODE_ENV` environment variable */\nconst mode =\n process.env.STORM_MODE ||\n process.env.NEXT_PUBLIC_VERCEL_ENV ||\n process.env.NODE_ENV ||\n \"production\";\n\n/** Detect if the application is running in a staging environment */\nexport const isStaging = [\"stg\", \"stage\", \"staging\"].includes(\n mode?.toLowerCase()\n);\n\n/**\n * Check if the current environment is production.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is production\n */\nexport function isProductionMode(mode: string) {\n return [\n \"prd\",\n \"prod\",\n \"production\",\n\n \"preprod\",\n\n \"preproduction\",\n \"uat\"\n ].includes(mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\"));\n}\n\n/** Detect if `NODE_ENV` environment variable is `production` */\nexport const isProduction = isProductionMode(mode);\n\n/**\n * Check if the current environment is test.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is test\n */\nexport function isTestMode(mode: string) {\n return [\n \"tst\",\n \"test\",\n \"testing\",\n \"stg\",\n \"stage\",\n \"staging\",\n \"qa\",\n\n \"qualityassurance\"\n ].includes(mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\"));\n}\n\n/** Detect if `NODE_ENV` environment variable is `test` */\nexport const isTest =\n isTestMode(mode) || isStaging || Boolean(process.env.TEST);\n\n/**\n * Check if the current environment is development.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is development\n */\nexport function isDevelopmentMode(mode: string) {\n return [\"dev\", \"development\", \"int\", \"integration\"].includes(\n mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\")\n );\n}\n\n/** Detect if `NODE_ENV` environment variable is `dev` or `development` */\nexport const isDevelopment = isDevelopmentMode(mode) || isDebug;\n\n/**\n * Convert a mode string to a standardized mode value of \"production\", \"development\", or \"test\".\n *\n * @param mode - The mode string to convert.\n * @returns The standardized mode value.\n */\nexport function toMode(mode: string): \"production\" | \"development\" | \"test\" {\n if (isProductionMode(mode)) {\n return \"production\";\n } else if (isTestMode(mode)) {\n return \"test\";\n } else if (isDevelopmentMode(mode)) {\n return \"development\";\n }\n\n return \"production\";\n}\n\n/** Detect if MINIMAL environment variable is set, running in CI or test or TTY is unavailable */\nexport const isMinimal =\n Boolean(process.env.MINIMAL) || isCI() || isTest || !hasTTY;\n\n/** Detect if process.platform is Windows */\nexport const isWindows = /^win/i.test(platform);\n\n/** Detect if process.platform is Linux */\nexport const isLinux = /^linux/i.test(platform);\n\n/** Detect if process.platform is macOS (darwin kernel) */\nexport const isMacOS = /^darwin/i.test(platform);\n\n/** Color Support */\nexport const isColorSupported =\n !process.env.NO_COLOR &&\n (Boolean(process.env.FORCE_COLOR) ||\n ((hasTTY || isWindows) && process.env.TERM !== \"dumb\") ||\n isCI());\n\nfunction parseVersion(versionString = \"\") {\n if (/^\\d{3,4}$/.test(versionString)) {\n const match = /(\\d{1,2})(\\d{2})/.exec(versionString) ?? [];\n\n return {\n major: 0,\n minor: Number.parseInt(match[1]!, 10),\n patch: Number.parseInt(match[2]!, 10)\n };\n }\n\n const versions = (versionString ?? \"\")\n .split(\".\")\n .map(n => Number.parseInt(n, 10));\n\n return {\n major: versions[0],\n minor: versions[1],\n patch: versions[2]\n };\n}\n\n/**\n * Check if the current environment supports hyperlinks in the terminal.\n *\n * @param stream - The stream to check for TTY support (default: process.stdout)\n * @returns Whether hyperlinks are supported\n */\nexport function isHyperlinkSupported(\n stream: NodeJS.WriteStream = process.stdout\n): boolean {\n if (process.env.FORCE_HYPERLINK) {\n return !(\n process.env.FORCE_HYPERLINK.length > 0 &&\n Number.parseInt(process.env.FORCE_HYPERLINK, 10) === 0\n );\n }\n\n // Netlify does not run a TTY, it does not need `supportsColor` check\n if (process.env.NETLIFY) {\n return true;\n } else if (!isColorSupported) {\n return false;\n } else if (stream && !stream.isTTY) {\n return false;\n } else if (\"WT_SESSION\" in process.env) {\n return true;\n } else if (process.platform === \"win32\") {\n return false;\n } else if (isCI()) {\n return false;\n } else if (process.env.TEAMCITY_VERSION) {\n return false;\n } else if (process.env.TERM_PROGRAM) {\n const version = parseVersion(process.env.TERM_PROGRAM_VERSION);\n\n switch (process.env.TERM_PROGRAM) {\n case \"iTerm.app\": {\n if (version.major === 3) {\n return version.minor !== undefined && version.minor >= 1;\n }\n\n return version.major !== undefined && version.major > 3;\n }\n case \"WezTerm\": {\n return version.major !== undefined && version.major >= 20_200_620;\n }\n case \"vscode\": {\n // Cursor forked VS Code and supports hyperlinks in 0.x.x\n if (process.env.CURSOR_TRACE_ID) {\n return true;\n }\n\n return (\n version.minor !== undefined &&\n version.major !== undefined &&\n (version.major > 1 || (version.major === 1 && version.minor >= 72))\n );\n }\n case \"ghostty\": {\n return true;\n }\n }\n }\n\n if (process.env.VTE_VERSION) {\n // 0.50.0 was supposed to support hyperlinks, but throws a segfault\n if (process.env.VTE_VERSION === \"0.50.0\") {\n return false;\n }\n\n const version = parseVersion(process.env.VTE_VERSION);\n\n return (\n (version.major !== undefined && version.major > 0) ||\n (version.minor !== undefined && version.minor >= 50)\n );\n }\n\n if (process.env.TERM === \"alacritty\") {\n return true;\n }\n\n return false;\n}\n\n/** Node.js versions */\nexport const nodeVersion =\n (process?.versions?.node || \"\").replace(/^v/, \"\") || null;\n\nexport const nodeMajorVersion = Number(nodeVersion?.split(\".\")[0]) || null;\n"],"mappings":";;;;AAqBA,MAAa,WAAW,SAAS,YAAY;;AAG7C,MAAa,SAAS,QAAQ,SAAS,UAAU,SAAS,OAAO,MAAM;;AAGvE,MAAa,UAAU,QAAQ,QAAQ,IAAI,MAAM;;AAGjD,MAAM,OACJ,QAAQ,IAAI,cACZ,QAAQ,IAAI,0BACZ,QAAQ,IAAI,YACZ;;AAGF,MAAa,YAAY;CAAC;CAAO;CAAS;CAAU,CAAC,SACnD,MAAM,aAAa,CACpB;;;;;;;AAQD,SAAgB,iBAAiB,QAAc;AAC7C,QAAO;EACL;EACA;EACA;EAEA;EAEA;EACA;EACD,CAAC,SAASA,QAAM,aAAa,EAAE,QAAQ,YAAY,GAAG,CAAC;;;AAI1D,MAAa,eAAe,iBAAiB,KAAK;;;;;;;AAQlD,SAAgB,WAAW,QAAc;AACvC,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACD,CAAC,SAASA,QAAM,aAAa,EAAE,QAAQ,YAAY,GAAG,CAAC;;;AAI1D,MAAa,SACX,WAAW,KAAK,IAAI,aAAa,QAAQ,QAAQ,IAAI,KAAK;;;;;;;AAQ5D,SAAgB,kBAAkB,QAAc;AAC9C,QAAO;EAAC;EAAO;EAAe;EAAO;EAAc,CAAC,SAClDA,QAAM,aAAa,EAAE,QAAQ,YAAY,GAAG,CAC7C;;;AAIH,MAAa,gBAAgB,kBAAkB,KAAK,IAAI;;AAqBxD,MAAa,YACX,QAAQ,QAAQ,IAAI,QAAQ,IAAI,MAAM,IAAI,UAAU,CAAC;;AAGvD,MAAa,YAAY,QAAQ,KAAK,SAAS;;AAG/C,MAAa,UAAU,UAAU,KAAK,SAAS;;AAG/C,MAAa,UAAU,WAAW,KAAK,SAAS;;AAGhD,MAAa,mBACX,CAAC,QAAQ,IAAI,aACZ,QAAQ,QAAQ,IAAI,YAAY,KAC7B,UAAU,cAAc,QAAQ,IAAI,SAAS,UAC/C,MAAM;;AA6GV,MAAa,eACV,SAAS,UAAU,QAAQ,IAAI,QAAQ,MAAM,GAAG,IAAI;AAEvD,MAAa,mBAAmB,OAAO,aAAa,MAAM,IAAI,CAAC,GAAG,IAAI"}
1
+ {"version":3,"file":"environment-checks.mjs","names":[],"sources":["../../../../env/src/environment-checks.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isCI } from \"./ci-checks\";\n\n/** Value of process.platform */\nexport const platform = process?.platform || \"\";\n\n/** Detect if stdout.TTY is available */\nexport const hasTTY = Boolean(process?.stdout && process?.stdout.isTTY);\n\n/** Detect if `DEBUG` environment variable is set */\nexport const isDebug = Boolean(process.env.DEBUG);\n\n/** Detect the `NODE_ENV` environment variable */\nconst mode =\n process.env.STORM_MODE ||\n process.env.NEXT_PUBLIC_VERCEL_ENV ||\n process.env.NODE_ENV ||\n \"production\";\n\n/** Detect if the application is running in a staging environment */\nexport const isStaging = [\"stg\", \"stage\", \"staging\"].includes(\n mode?.toLowerCase()\n);\n\n/**\n * Check if the current environment is production.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is production\n */\nexport function isProductionMode(mode: string) {\n return [\n \"prd\",\n \"prod\",\n \"production\",\n\n \"preprod\",\n\n \"preproduction\",\n \"uat\"\n ].includes(mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\"));\n}\n\n/** Detect if `NODE_ENV` environment variable is `production` */\nexport const isProduction = isProductionMode(mode);\n\n/**\n * Check if the current environment is test.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is test\n */\nexport function isTestMode(mode: string) {\n return [\n \"tst\",\n \"test\",\n \"testing\",\n \"stg\",\n \"stage\",\n \"staging\",\n \"qa\",\n\n \"qualityassurance\"\n ].includes(mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\"));\n}\n\n/** Detect if `NODE_ENV` environment variable is `test` */\nexport const isTest =\n isTestMode(mode) || isStaging || Boolean(process.env.TEST);\n\n/**\n * Check if the current environment is development.\n *\n * @param mode - The mode string to check.\n * @returns Whether the environment is development\n */\nexport function isDevelopmentMode(mode: string) {\n return [\"dev\", \"development\", \"int\", \"integration\"].includes(\n mode?.toLowerCase()?.replace(/[\\s\\-_]/g, \"\")\n );\n}\n\n/** Detect if `NODE_ENV` environment variable is `dev` or `development` */\nexport const isDevelopment = isDevelopmentMode(mode) || isDebug;\n\n/**\n * Convert a mode string to a standardized mode value of \"production\", \"development\", or \"test\".\n *\n * @param mode - The mode string to convert.\n * @returns The standardized mode value.\n */\nexport function toMode(mode: string): \"production\" | \"development\" | \"test\" {\n if (isProductionMode(mode)) {\n return \"production\";\n } else if (isTestMode(mode)) {\n return \"test\";\n } else if (isDevelopmentMode(mode)) {\n return \"development\";\n }\n\n return \"production\";\n}\n\n/** Detect if MINIMAL environment variable is set, running in CI or test or TTY is unavailable */\nexport const isMinimal =\n Boolean(process.env.MINIMAL) || isCI() || isTest || !hasTTY;\n\n/** Detect if process.platform is Windows */\nexport const isWindows = /^win/i.test(platform);\n\n/** Detect if process.platform is Linux */\nexport const isLinux = /^linux/i.test(platform);\n\n/** Detect if process.platform is macOS (darwin kernel) */\nexport const isMacOS = /^darwin/i.test(platform);\n\n/** Color Support */\nexport const isColorSupported =\n !process.env.NO_COLOR &&\n (Boolean(process.env.FORCE_COLOR) ||\n ((hasTTY || isWindows) && process.env.TERM !== \"dumb\") ||\n isCI());\n\nfunction parseVersion(versionString = \"\") {\n if (/^\\d{3,4}$/.test(versionString)) {\n const match = /(\\d{1,2})(\\d{2})/.exec(versionString) ?? [];\n\n return {\n major: 0,\n minor: Number.parseInt(match[1]!, 10),\n patch: Number.parseInt(match[2]!, 10)\n };\n }\n\n const versions = (versionString ?? \"\")\n .split(\".\")\n .map(n => Number.parseInt(n, 10));\n\n return {\n major: versions[0],\n minor: versions[1],\n patch: versions[2]\n };\n}\n\n/**\n * Check if the current environment supports hyperlinks in the terminal.\n *\n * @param stream - The stream to check for TTY support (default: process.stdout)\n * @returns Whether hyperlinks are supported\n */\nexport function isHyperlinkSupported(\n stream: NodeJS.WriteStream = process.stdout\n): boolean {\n if (process.env.FORCE_HYPERLINK) {\n return !(\n process.env.FORCE_HYPERLINK.length > 0 &&\n Number.parseInt(process.env.FORCE_HYPERLINK, 10) === 0\n );\n }\n\n // Netlify does not run a TTY, it does not need `supportsColor` check\n if (process.env.NETLIFY) {\n return true;\n } else if (!isColorSupported) {\n return false;\n } else if (stream && !stream.isTTY) {\n return false;\n } else if (\"WT_SESSION\" in process.env) {\n return true;\n } else if (process.platform === \"win32\") {\n return false;\n } else if (isCI()) {\n return false;\n } else if (process.env.TEAMCITY_VERSION) {\n return false;\n } else if (process.env.TERM_PROGRAM) {\n const version = parseVersion(process.env.TERM_PROGRAM_VERSION);\n\n switch (process.env.TERM_PROGRAM) {\n case \"iTerm.app\": {\n if (version.major === 3) {\n return version.minor !== undefined && version.minor >= 1;\n }\n\n return version.major !== undefined && version.major > 3;\n }\n case \"WezTerm\": {\n return version.major !== undefined && version.major >= 20_200_620;\n }\n case \"vscode\": {\n // Cursor forked VS Code and supports hyperlinks in 0.x.x\n if (process.env.CURSOR_TRACE_ID) {\n return true;\n }\n\n return (\n version.minor !== undefined &&\n version.major !== undefined &&\n (version.major > 1 || (version.major === 1 && version.minor >= 72))\n );\n }\n case \"ghostty\": {\n return true;\n }\n }\n }\n\n if (process.env.VTE_VERSION) {\n // 0.50.0 was supposed to support hyperlinks, but throws a segfault\n if (process.env.VTE_VERSION === \"0.50.0\") {\n return false;\n }\n\n const version = parseVersion(process.env.VTE_VERSION);\n\n return (\n (version.major !== undefined && version.major > 0) ||\n (version.minor !== undefined && version.minor >= 50)\n );\n }\n\n if (process.env.TERM === \"alacritty\") {\n return true;\n }\n\n return false;\n}\n\n/** Node.js versions */\nexport const nodeVersion =\n (process?.versions?.node || \"\").replace(/^v/, \"\") || null;\n\nexport const nodeMajorVersion = Number(nodeVersion?.split(\".\")[0]) || null;\n"],"mappings":";;;;AAqBA,MAAa,WAAW,SAAS,YAAY;;AAG7C,MAAa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,aAAa,MAAM,IAAI,CAAC,GAAG,IAAI"}
@@ -1,7 +1,7 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
1
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
2
  require('../../string-format/src/title-case.cjs');
3
3
  let node_os = require("node:os");
4
- node_os = require_rolldown_runtime.__toESM(node_os);
4
+ node_os = require_runtime.__toESM(node_os, 1);
5
5
 
6
6
  //#region ../env/src/get-env-paths.ts
7
7
  const homedir = node_os.default.homedir();
@@ -1,4 +1,4 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
1
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
2
  let defu = require("defu");
3
- defu = require_rolldown_runtime.__toESM(defu);
3
+ defu = require_runtime.__toESM(defu, 1);
4
4
  require("@dotenvx/dotenvx");
@@ -87,11 +87,11 @@ const providers = [
87
87
  ]
88
88
  ];
89
89
  function detectProvider() {
90
- if (process?.env) for (const provider$1 of providers) {
91
- const envName = provider$1[1] || provider$1[0];
90
+ if (process?.env) for (const provider of providers) {
91
+ const envName = provider[1] || provider[0];
92
92
  if (process?.env[envName]) return {
93
- name: provider$1[0].toLowerCase(),
94
- ...provider$1[2]
93
+ name: provider[0].toLowerCase(),
94
+ ...provider[2]
95
95
  };
96
96
  }
97
97
  if (process?.env?.SHELL === "/bin/jsh" && process?.versions?.webcontainer) return {
@@ -86,11 +86,11 @@ const providers = [
86
86
  ]
87
87
  ];
88
88
  function detectProvider() {
89
- if (process?.env) for (const provider$1 of providers) {
90
- const envName = provider$1[1] || provider$1[0];
89
+ if (process?.env) for (const provider of providers) {
90
+ const envName = provider[1] || provider[0];
91
91
  if (process?.env[envName]) return {
92
- name: provider$1[0].toLowerCase(),
93
- ...provider$1[2]
92
+ name: provider[0].toLowerCase(),
93
+ ...provider[2]
94
94
  };
95
95
  }
96
96
  if (process?.env?.SHELL === "/bin/jsh" && process?.versions?.webcontainer) return {
@@ -1 +1 @@
1
- {"version":3,"file":"providers.mjs","names":["providers: InternalProvider[]","provider","provider: ProviderName"],"sources":["../../../../env/src/providers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n// Reference: https://github.com/watson/ci-info/blob/v3.2.0/vendors.json\n\nexport type ProviderName =\n | \"\"\n | \"appveyor\"\n | \"aws_amplify\"\n | \"azure_pipelines\"\n | \"azure_static\"\n | \"appcircle\"\n | \"bamboo\"\n | \"bitbucket\"\n | \"bitrise\"\n | \"buddy\"\n | \"buildkite\"\n | \"circle\"\n | \"cirrus\"\n | \"cloudflare_pages\"\n | \"codebuild\"\n | \"codefresh\"\n | \"drone\"\n | \"drone\"\n | \"dsari\"\n | \"github_actions\"\n | \"gitlab\"\n | \"gocd\"\n | \"layerci\"\n | \"hudson\"\n | \"jenkins\"\n | \"magnum\"\n | \"netlify\"\n | \"nevercode\"\n | \"render\"\n | \"sail\"\n | \"semaphore\"\n | \"screwdriver\"\n | \"shippable\"\n | \"solano\"\n | \"strider\"\n | \"teamcity\"\n | \"travis\"\n | \"vercel\"\n | \"appcenter\"\n | \"codesandbox\"\n | \"stackblitz\"\n | \"stormkit\"\n | \"cleavr\"\n | \"zeabur\"\n | \"codesphere\"\n | \"railway\"\n | \"deno-deploy\"\n | \"firebase_app_hosting\";\n\ntype InternalProvider = [\n providerName: Uppercase<ProviderName>,\n envName?: string,\n meta?: Record<string, any>\n];\n\nconst providers: InternalProvider[] = [\n [\"APPVEYOR\"],\n [\"AWS_AMPLIFY\", \"AWS_APP_ID\", { ci: true }],\n [\"AZURE_PIPELINES\", \"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI\"],\n [\"AZURE_STATIC\", \"INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN\"],\n [\"APPCIRCLE\", \"AC_APPCIRCLE\"],\n [\"BAMBOO\", \"bamboo_planKey\"],\n [\"BITBUCKET\", \"BITBUCKET_COMMIT\"],\n [\"BITRISE\", \"BITRISE_IO\"],\n [\"BUDDY\", \"BUDDY_WORKSPACE_ID\"],\n [\"BUILDKITE\"],\n [\"CIRCLE\", \"CIRCLECI\"],\n [\"CIRRUS\", \"CIRRUS_CI\"],\n [\"CLOUDFLARE_PAGES\", \"CF_PAGES\", { ci: true }],\n [\"CODEBUILD\", \"CODEBUILD_BUILD_ARN\"],\n [\"CODEFRESH\", \"CF_BUILD_ID\"],\n [\"DRONE\"],\n [\"DRONE\", \"DRONE_BUILD_EVENT\"],\n [\"DSARI\"],\n [\"GITHUB_ACTIONS\"],\n [\"GITLAB\", \"GITLAB_CI\"],\n [\"GITLAB\", \"CI_MERGE_REQUEST_ID\"],\n [\"GOCD\", \"GO_PIPELINE_LABEL\"],\n [\"LAYERCI\"],\n [\"HUDSON\", \"HUDSON_URL\"],\n [\"JENKINS\", \"JENKINS_URL\"],\n [\"MAGNUM\"],\n [\"NETLIFY\"],\n [\"NETLIFY\", \"NETLIFY_LOCAL\", { ci: false }],\n [\"NEVERCODE\"],\n [\"RENDER\"],\n [\"SAIL\", \"SAILCI\"],\n [\"SEMAPHORE\"],\n [\"SCREWDRIVER\"],\n [\"SHIPPABLE\"],\n [\"SOLANO\", \"TDDIUM\"],\n [\"STRIDER\"],\n [\"TEAMCITY\", \"TEAMCITY_VERSION\"],\n [\"TRAVIS\"],\n [\"VERCEL\", \"NOW_BUILDER\"],\n [\"VERCEL\", \"VERCEL\", { ci: false }],\n [\"VERCEL\", \"VERCEL_ENV\", { ci: false }],\n [\"APPCENTER\", \"APPCENTER_BUILD_ID\"],\n [\"CODESANDBOX\", \"CODESANDBOX_SSE\", { ci: false }],\n [\"STACKBLITZ\"],\n [\"STORMKIT\"],\n [\"CLEAVR\"],\n [\"ZEABUR\"],\n [\"CODESPHERE\", \"CODESPHERE_APP_ID\", { ci: true }],\n [\"RAILWAY\", \"RAILWAY_PROJECT_ID\"],\n [\"RAILWAY\", \"RAILWAY_SERVICE_ID\"],\n [\"DENO-DEPLOY\", \"DENO_DEPLOYMENT_ID\"],\n [\"FIREBASE_APP_HOSTING\", \"FIREBASE_APP_HOSTING\", { ci: true }]\n];\n\nexport interface ProviderInfo {\n name: ProviderName;\n ci?: boolean;\n [meta: string]: any;\n}\n\nfunction detectProvider(): ProviderInfo {\n // Based on env\n if (process?.env) {\n for (const provider of providers) {\n const envName = provider[1] || provider[0];\n if (process?.env[envName]) {\n return {\n name: provider[0].toLowerCase(),\n ...(provider[2] as any)\n };\n }\n }\n }\n\n // Stackblitz / Webcontainer\n if (process?.env?.SHELL === \"/bin/jsh\" && process?.versions?.webcontainer) {\n return {\n name: \"stackblitz\",\n ci: false\n };\n }\n\n return {\n name: \"\",\n ci: false\n };\n}\n\n/** Current provider info */\nexport const providerInfo = detectProvider();\nexport const provider: ProviderName = providerInfo.name;\n"],"mappings":";AA4EA,MAAMA,YAAgC;CACpC,CAAC,WAAW;CACZ;EAAC;EAAe;EAAc,EAAE,IAAI,MAAM;EAAC;CAC3C,CAAC,mBAAmB,qCAAqC;CACzD,CAAC,gBAAgB,wCAAwC;CACzD,CAAC,aAAa,eAAe;CAC7B,CAAC,UAAU,iBAAiB;CAC5B,CAAC,aAAa,mBAAmB;CACjC,CAAC,WAAW,aAAa;CACzB,CAAC,SAAS,qBAAqB;CAC/B,CAAC,YAAY;CACb,CAAC,UAAU,WAAW;CACtB,CAAC,UAAU,YAAY;CACvB;EAAC;EAAoB;EAAY,EAAE,IAAI,MAAM;EAAC;CAC9C,CAAC,aAAa,sBAAsB;CACpC,CAAC,aAAa,cAAc;CAC5B,CAAC,QAAQ;CACT,CAAC,SA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AAM;EACN,IAAI;EACL;;;AAIH,MAAa,eAAe,gBAAgB;AAC5C,MAAaC,WAAyB,aAAa"}
1
+ {"version":3,"file":"providers.mjs","names":[],"sources":["../../../../env/src/providers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n// Reference: https://github.com/watson/ci-info/blob/v3.2.0/vendors.json\n\nexport type ProviderName =\n | \"\"\n | \"appveyor\"\n | \"aws_amplify\"\n | \"azure_pipelines\"\n | \"azure_static\"\n | \"appcircle\"\n | \"bamboo\"\n | \"bitbucket\"\n | \"bitrise\"\n | \"buddy\"\n | \"buildkite\"\n | \"circle\"\n | \"cirrus\"\n | \"cloudflare_pages\"\n | \"codebuild\"\n | \"codefresh\"\n | \"drone\"\n | \"drone\"\n | \"dsari\"\n | \"github_actions\"\n | \"gitlab\"\n | \"gocd\"\n | \"layerci\"\n | \"hudson\"\n | \"jenkins\"\n | \"magnum\"\n | \"netlify\"\n | \"nevercode\"\n | \"render\"\n | \"sail\"\n | \"semaphore\"\n | \"screwdriver\"\n | \"shippable\"\n | \"solano\"\n | \"strider\"\n | \"teamcity\"\n | \"travis\"\n | \"vercel\"\n | \"appcenter\"\n | \"codesandbox\"\n | \"stackblitz\"\n | \"stormkit\"\n | \"cleavr\"\n | \"zeabur\"\n | \"codesphere\"\n | \"railway\"\n | \"deno-deploy\"\n | \"firebase_app_hosting\";\n\ntype InternalProvider = [\n providerName: Uppercase<ProviderName>,\n envName?: string,\n meta?: Record<string, any>\n];\n\nconst providers: InternalProvider[] = [\n [\"APPVEYOR\"],\n [\"AWS_AMPLIFY\", \"AWS_APP_ID\", { ci: true }],\n [\"AZURE_PIPELINES\", \"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI\"],\n [\"AZURE_STATIC\", \"INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN\"],\n [\"APPCIRCLE\", \"AC_APPCIRCLE\"],\n [\"BAMBOO\", \"bamboo_planKey\"],\n [\"BITBUCKET\", \"BITBUCKET_COMMIT\"],\n [\"BITRISE\", \"BITRISE_IO\"],\n [\"BUDDY\", \"BUDDY_WORKSPACE_ID\"],\n [\"BUILDKITE\"],\n [\"CIRCLE\", \"CIRCLECI\"],\n [\"CIRRUS\", \"CIRRUS_CI\"],\n [\"CLOUDFLARE_PAGES\", \"CF_PAGES\", { ci: true }],\n [\"CODEBUILD\", \"CODEBUILD_BUILD_ARN\"],\n [\"CODEFRESH\", \"CF_BUILD_ID\"],\n [\"DRONE\"],\n [\"DRONE\", \"DRONE_BUILD_EVENT\"],\n [\"DSARI\"],\n [\"GITHUB_ACTIONS\"],\n [\"GITLAB\", \"GITLAB_CI\"],\n [\"GITLAB\", \"CI_MERGE_REQUEST_ID\"],\n [\"GOCD\", \"GO_PIPELINE_LABEL\"],\n [\"LAYERCI\"],\n [\"HUDSON\", \"HUDSON_URL\"],\n [\"JENKINS\", \"JENKINS_URL\"],\n [\"MAGNUM\"],\n [\"NETLIFY\"],\n [\"NETLIFY\", \"NETLIFY_LOCAL\", { ci: false }],\n [\"NEVERCODE\"],\n [\"RENDER\"],\n [\"SAIL\", \"SAILCI\"],\n [\"SEMAPHORE\"],\n [\"SCREWDRIVER\"],\n [\"SHIPPABLE\"],\n [\"SOLANO\", \"TDDIUM\"],\n [\"STRIDER\"],\n [\"TEAMCITY\", \"TEAMCITY_VERSION\"],\n [\"TRAVIS\"],\n [\"VERCEL\", \"NOW_BUILDER\"],\n [\"VERCEL\", \"VERCEL\", { ci: false }],\n [\"VERCEL\", \"VERCEL_ENV\", { ci: false }],\n [\"APPCENTER\", \"APPCENTER_BUILD_ID\"],\n [\"CODESANDBOX\", \"CODESANDBOX_SSE\", { ci: false }],\n [\"STACKBLITZ\"],\n [\"STORMKIT\"],\n [\"CLEAVR\"],\n [\"ZEABUR\"],\n [\"CODESPHERE\", \"CODESPHERE_APP_ID\", { ci: true }],\n [\"RAILWAY\", \"RAILWAY_PROJECT_ID\"],\n [\"RAILWAY\", \"RAILWAY_SERVICE_ID\"],\n [\"DENO-DEPLOY\", \"DENO_DEPLOYMENT_ID\"],\n [\"FIREBASE_APP_HOSTING\", \"FIREBASE_APP_HOSTING\", { ci: true }]\n];\n\nexport interface ProviderInfo {\n name: ProviderName;\n ci?: boolean;\n [meta: string]: any;\n}\n\nfunction detectProvider(): ProviderInfo {\n // Based on env\n if (process?.env) {\n for (const provider of providers) {\n const envName = provider[1] || provider[0];\n if (process?.env[envName]) {\n return {\n name: provider[0].toLowerCase(),\n ...(provider[2] as any)\n };\n }\n }\n }\n\n // Stackblitz / Webcontainer\n if (process?.env?.SHELL === \"/bin/jsh\" && process?.versions?.webcontainer) {\n return {\n name: \"stackblitz\",\n ci: false\n };\n }\n\n return {\n name: \"\",\n ci: false\n };\n}\n\n/** Current provider info */\nexport const providerInfo = detectProvider();\nexport const provider: ProviderName = providerInfo.name;\n"],"mappings":";AA4EA,MAAM,YAAgC;CACpC,CAAC,WAAW;CACZ;EAAC;EAAe;EAAc,EAAE,IAAI,MAAM;EAAC;CAC3C,CAAC,mBAAmB,qCAAqC;CACzD,CAAC,gBAAgB,wCAAwC;CACzD,CAAC,aAAa,eAAe;CAC7B,CAAC,UAAU,iBAAiB;CAC5B,CAAC,aAAa,mBAAmB;CACjC,CAAC,WAAW,aAAa;CACzB,CAAC,SAAS,qBAAqB;CAC/B,CAAC,YAAY;CACb,CAAC,UAAU,WAAW;CACtB,CAAC,UAAU,YAAY;CACvB;EAAC;EAAoB;EAAY,EAAE,IAAI,MAAM;EAAC;CAC9C,CAAC,aAAa,sBAAsB;CACpC,CA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ACL,MAAM;EACN,IAAI;EACL;AAGH,QAAO;EACL,MAAM;EACN,IAAI;EACL;;;AAIH,MAAa,eAAe,gBAAgB;AAC5C,MAAa,WAAyB,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-checks.mjs","names":["runtimeChecks: [boolean, RuntimeName][]","runtime: RuntimeName"],"sources":["../../../../env/src/runtime-checks.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n// https://runtime-keys.proposal.wintercg.org/\nexport type RuntimeName =\n | \"workerd\"\n | \"deno\"\n | \"netlify\"\n | \"node\"\n | \"bun\"\n | \"edge-light\"\n | \"fastly\"\n | \"\";\n\nexport interface RuntimeInfo {\n name: RuntimeName;\n}\n\n/**\n * Indicates if running in Node.js or a Node.js compatible runtime.\n *\n * **Note:** When running code in Bun and Deno with Node.js compatibility mode, `isNode` flag will be also `true`, indicating running in a Node.js compatible runtime.\n *\n * Use `runtime === \"node\"` if you need strict check for Node.js runtime.\n */\nexport const isNode = process?.release?.name === \"node\";\n\n/**\n * Indicates if running in Bun runtime.\n */\nexport const isBun = Boolean(Bun) || Boolean(process?.versions?.bun);\n\n/**\n * Indicates if running in Deno runtime.\n */\nexport const isDeno = Boolean(Deno);\n\n/**\n * Indicates if running in Fastly runtime.\n */\nexport const isFastly = Boolean(fastly);\n\n/**\n * Indicates if running in Netlify runtime.\n */\nexport const isNetlify = Boolean(Netlify);\n\n/**\n *\n * Indicates if running in EdgeLight (Vercel Edge) runtime.\n */\nexport const isEdgeLight = Boolean(EdgeRuntime);\n// https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent\n\n/**\n * Indicates if running in Cloudflare Workers runtime.\n */\nexport const isWorkerd = navigator?.userAgent === \"Cloudflare-Workers\";\n\n/**\n * Indicates if the code is running on the server-side\n */\nexport const isRuntimeServer =\n isNode ||\n isBun ||\n isDeno ||\n isFastly ||\n isNetlify ||\n isEdgeLight ||\n isWorkerd;\n\n/**\n * Indicates if the code is running in the browser (and not on the server).\n */\nexport const isRuntimeClient = !isRuntimeServer;\n\nconst runtimeChecks: [boolean, RuntimeName][] = [\n [isNetlify, \"netlify\"],\n [isEdgeLight, \"edge-light\"],\n [isWorkerd, \"workerd\"],\n [isFastly, \"fastly\"],\n [isDeno, \"deno\"],\n [isBun, \"bun\"],\n [isNode, \"node\"]\n];\n\nfunction detectRuntime(): RuntimeInfo | undefined {\n const detectedRuntime = runtimeChecks.find(check => check[0]);\n\n if (detectedRuntime) {\n const name = detectedRuntime[1];\n\n return { name };\n }\n\n return undefined;\n}\n\nexport const runtimeInfo = detectRuntime();\n\nexport const runtime: RuntimeName = runtimeInfo?.name || \"\";\n"],"mappings":";;;;;;;;AAwCA,MAAa,SAAS,SAAS,SAAS,SAAS;;;;AAKjD,MAAa,QAAQ,QAAQ,IAAI,IAAI,QAAQ,SAAS,UAAU,IAAI;;;;AAKpE,MAAa,SAAS,QAAQ,KAAK;;;;AAKnC,MAAa,WAAW,QAAQ,OAAO;;;;AAKvC,MAAa,YAAY,QAAQ,QAAQ;;;;;AAMzC,MAAa,cAAc,QAAQ,YAAY;;;;AAM/C,MAAa,YAAY,WAAW,cAAc;AAmBlD,MAAMA,gBAA0C;CAC9C,CAAC,WAAW,UAAU;CACtB,CAAC,aAAa,aAAa;CAC3B,CAAC,WAAW,UAAU;CACtB,CAAC,UAAU,SAAS;CACpB,CAAC,QAAQ,OAAO;CAChB,CAAC,OAAO,MAAM;CACd,CAAC,QAAQ,OAAO;CACjB;AAED,SAAS,gBAAyC;CAChD,MAAM,kBAAkB,cAAc,MAAK,UAAS,MAAM,GAAG;AAE7D,KAAI,gBAGF,QAAO,EAAE,MAFI,gBAAgB,IAEd;;AAMnB,MAAa,cAAc,eAAe;AAE1C,MAAaC,UAAuB,aAAa,QAAQ"}
1
+ {"version":3,"file":"runtime-checks.mjs","names":[],"sources":["../../../../env/src/runtime-checks.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n// https://runtime-keys.proposal.wintercg.org/\nexport type RuntimeName =\n | \"workerd\"\n | \"deno\"\n | \"netlify\"\n | \"node\"\n | \"bun\"\n | \"edge-light\"\n | \"fastly\"\n | \"\";\n\nexport interface RuntimeInfo {\n name: RuntimeName;\n}\n\n/**\n * Indicates if running in Node.js or a Node.js compatible runtime.\n *\n * **Note:** When running code in Bun and Deno with Node.js compatibility mode, `isNode` flag will be also `true`, indicating running in a Node.js compatible runtime.\n *\n * Use `runtime === \"node\"` if you need strict check for Node.js runtime.\n */\nexport const isNode = process?.release?.name === \"node\";\n\n/**\n * Indicates if running in Bun runtime.\n */\nexport const isBun = Boolean(Bun) || Boolean(process?.versions?.bun);\n\n/**\n * Indicates if running in Deno runtime.\n */\nexport const isDeno = Boolean(Deno);\n\n/**\n * Indicates if running in Fastly runtime.\n */\nexport const isFastly = Boolean(fastly);\n\n/**\n * Indicates if running in Netlify runtime.\n */\nexport const isNetlify = Boolean(Netlify);\n\n/**\n *\n * Indicates if running in EdgeLight (Vercel Edge) runtime.\n */\nexport const isEdgeLight = Boolean(EdgeRuntime);\n// https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent\n\n/**\n * Indicates if running in Cloudflare Workers runtime.\n */\nexport const isWorkerd = navigator?.userAgent === \"Cloudflare-Workers\";\n\n/**\n * Indicates if the code is running on the server-side\n */\nexport const isRuntimeServer =\n isNode ||\n isBun ||\n isDeno ||\n isFastly ||\n isNetlify ||\n isEdgeLight ||\n isWorkerd;\n\n/**\n * Indicates if the code is running in the browser (and not on the server).\n */\nexport const isRuntimeClient = !isRuntimeServer;\n\nconst runtimeChecks: [boolean, RuntimeName][] = [\n [isNetlify, \"netlify\"],\n [isEdgeLight, \"edge-light\"],\n [isWorkerd, \"workerd\"],\n [isFastly, \"fastly\"],\n [isDeno, \"deno\"],\n [isBun, \"bun\"],\n [isNode, \"node\"]\n];\n\nfunction detectRuntime(): RuntimeInfo | undefined {\n const detectedRuntime = runtimeChecks.find(check => check[0]);\n\n if (detectedRuntime) {\n const name = detectedRuntime[1];\n\n return { name };\n }\n\n return undefined;\n}\n\nexport const runtimeInfo = detectRuntime();\n\nexport const runtime: RuntimeName = runtimeInfo?.name || \"\";\n"],"mappings":";;;;;;;;AAwCA,MAAa,SAAS,SAAS,SAAS,SAAS;;;;AAKjD,MAAa,QAAQ,QAAQ,IAAI,IAAI,QAAQ,SAAS,UAAU,IAAI;;;;AAKpE,MAAa,SAAS,QAAQ,KAAK;;;;AAKnC,MAAa,WAAW,QAAQ,OAAO;;;;AAKvC,MAAa,YAAY,QAAQ,QAAQ;;;;;AAMzC,MAAa,cAAc,QAAQ,YAAY;;;;AAM/C,MAAa,YAAY,WAAW,cAAc;AAmBlD,MAAM,gBAA0C;CAC9C,CAAC,WAAW,UAAU;CACtB,CAAC,aAAa,aAAa;CAC3B,CAAC,WAAW,UAAU;CACtB,CAAC,UAAU,SAAS;CACpB,CAAC,QAAQ,OAAO;CAChB,CAAC,OAAO,MAAM;CACd,CAAC,QAAQ,OAAO;CACjB;AAED,SAAS,gBAAyC;CAChD,MAAM,kBAAkB,cAAc,MAAK,UAAS,MAAM,GAAG;AAE7D,KAAI,gBAGF,QAAO,EAAE,MAFI,gBAAgB,IAEd;;AAMnB,MAAa,cAAc,eAAe;AAE1C,MAAa,UAAuB,aAAa,QAAQ"}
package/dist/index.cjs CHANGED
@@ -1,11 +1,12 @@
1
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
3
  const require_action_handler = require('./action-handler.cjs');
3
4
  const require_shared = require('./shared.cjs');
4
5
  const require_client = require('./client.cjs');
5
6
  const require_server = require('./server.cjs');
6
7
  const require_tanstack_query_client = require('./tanstack-query/client.cjs');
7
8
  const require_tanstack_query_server = require('./tanstack-query/server.cjs');
8
- let __trpc_server_adapters_next_app_dir = require("@trpc/server/adapters/next-app-dir");
9
+ let _trpc_server_adapters_next_app_dir = require("@trpc/server/adapters/next-app-dir");
9
10
 
10
11
  exports.createQueryClient = require_shared.createQueryClient;
11
12
  exports.createTRPCClient = require_client.createTRPCClient;
@@ -18,13 +19,13 @@ exports.getTRPCServerUrl = require_shared.getTRPCServerUrl;
18
19
  Object.defineProperty(exports, 'notFound', {
19
20
  enumerable: true,
20
21
  get: function () {
21
- return __trpc_server_adapters_next_app_dir.experimental_notFound;
22
+ return _trpc_server_adapters_next_app_dir.experimental_notFound;
22
23
  }
23
24
  });
24
25
  Object.defineProperty(exports, 'redirect', {
25
26
  enumerable: true,
26
27
  get: function () {
27
- return __trpc_server_adapters_next_app_dir.experimental_redirect;
28
+ return _trpc_server_adapters_next_app_dir.experimental_redirect;
28
29
  }
29
30
  });
30
31
  exports.transformer = require_shared.transformer;
@@ -1 +1 @@
1
- {"version":3,"file":"join-paths.mjs","names":["char: string | null"],"sources":["../../../../path/src/join-paths.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isAbsolute } from \"./is-type\";\nimport {\n DRIVE_LETTER_REGEX,\n DRIVE_LETTER_START_REGEX,\n UNC_REGEX\n} from \"./regex\";\nimport { slash } from \"./slash\";\n\n// Util to normalize windows paths to posix\nfunction normalizeWindowsPath(input = \"\") {\n if (!input) {\n return input;\n }\n return input\n .replace(/\\\\/g, \"/\")\n .replace(DRIVE_LETTER_START_REGEX, r => r.toUpperCase());\n}\n\nfunction correctPaths(path?: string) {\n if (!path || path.length === 0) {\n return \".\";\n }\n\n // Normalize windows argument\n path = normalizeWindowsPath(path);\n\n const isUNCPath = path.match(UNC_REGEX);\n const isPathAbsolute = isAbsolute(path);\n const trailingSeparator = path[path.length - 1] === \"/\";\n\n // Normalize the path\n path = normalizeString(path, !isPathAbsolute);\n\n if (path.length === 0) {\n if (isPathAbsolute) {\n return \"/\";\n }\n return trailingSeparator ? \"./\" : \".\";\n }\n if (trailingSeparator) {\n path += \"/\";\n }\n if (DRIVE_LETTER_REGEX.test(path)) {\n path += \"/\";\n }\n\n if (isUNCPath) {\n if (!isPathAbsolute) {\n return `//./${path}`;\n }\n return `//${path}`;\n }\n\n return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;\n}\n\n/**\n * Joins all given path segments together using the platform-specific separator as a delimiter.\n *\n * @remarks\n * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.\n *\n * @example\n * ```ts\n * import { joinPaths } from 'stryke/path';\n *\n * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');\n * console.log(fullPath); // Output: 'folder1/folder3/file.txt'\n *\n * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');\n * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'\n *\n * const windowsPath = joinPaths('C:\\\\', 'Users', 'Public', '..', 'Documents', 'file.txt');\n * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'\n *\n * const uncPath = joinPaths('\\\\\\\\Server\\\\Share', 'Folder', 'File.txt');\n * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'\n * ```\n *\n * @param segments - The path segments to join.\n * @returns The joined and normalized path string.\n */\nexport function joinPaths(...segments: string[]): string {\n let result = \"\";\n for (const segment of segments) {\n if (segment && slash(segment).replaceAll(/\\//g, \"\") !== \".\") {\n if (result) {\n if (slash(segment).replaceAll(/\\//g, \"\") === \"..\") {\n result = slash(result)\n .replace(/\\/+$/, \"\")\n .replace(/\\/*[^/]+$/, \"\");\n } else {\n result = `${slash(result).replace(/\\/+$/, \"\")}/${slash(\n segment\n ).replace(/^\\/+/, \"\")}`;\n }\n } else if (slash(segment).replaceAll(/\\//g, \"\") !== \"..\") {\n result = segment;\n }\n }\n }\n\n return correctPaths(result);\n}\n\nexport const join = joinPaths;\n\n/**\n * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.\n *\n * @param path - The path to normalize.\n * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.\n * @returns the normalized path string.\n */\nfunction normalizeString(path: string, allowAboveRoot: boolean) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let char: string | null = null;\n for (let index = 0; index <= path.length; ++index) {\n if (index < path.length) {\n // casted because we know it exists thanks to the length check\n char = path[index] as string;\n } else if (char === \"/\") {\n break;\n } else {\n char = \"/\";\n }\n if (char === \"/\") {\n if (lastSlash === index - 1 || dots === 1) {\n // NOOP\n } else if (dots === 2) {\n if (\n res.length < 2 ||\n lastSegmentLength !== 2 ||\n res[res.length - 1] !== \".\" ||\n res[res.length - 2] !== \".\"\n ) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(\"/\");\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\");\n }\n lastSlash = index;\n dots = 0;\n continue;\n } else if (res.length > 0) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = index;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n res += res.length > 0 ? \"/..\" : \"..\";\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) {\n res += `/${path.slice(lastSlash + 1, index)}`;\n } else {\n res = path.slice(lastSlash + 1, index);\n }\n lastSegmentLength = index - lastSlash - 1;\n }\n lastSlash = index;\n dots = 0;\n } else if (char === \".\" && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n"],"mappings":";;;;;AA2BA,SAAS,qBAAqB,QAAQ,IAAI;AACxC,KAAI,CAAC,MACH,QAAO;AAET,QAAO,MACJ,QAAQ,OAAO,IAAI,CACnB,QAAQ,2BAA0B,MAAK,EAAE,aAAa,CAAC;;AAG5D,SAAS,aAAa,MAAe;AACnC,KAAI,CAAC,QAAQ,KAAK,WAAW,EAC3B,QAAO;AAIT,QAAO,qBAAqB,KAAK;CAEjC,MAAM,YAAY,KAAK,MAAM,UAAU;CACvC,MAAM,iBAAiB,WAAW,KAAK;CACvC,MAAM,oBAAoB,KAAK,KAAK,SAAS,OAAO;AAGpD,QAAO,gBAAgB,MAAM,CAAC,eAAe;AAE7C,KAAI,KAAK,WAAW,GAAG;AACrB,MAAI,eACF,QAAO;AAET,SAAO,oBAAoB,OAAO;;AAEpC,KAAI,kBACF,SAAQ;AAEV,KAAI,mBAAmB,KAAK,KAAK,CAC/B,SAAQ;AAGV,KAAI,WAAW;AACb,MAAI,CAAC,eACH,QAAO,OAAO;AAEhB,SAAO,KAAK;;AAGd,QAAO,kBAAkB,CAAC,WAAW,KAAK,GAAG,IAAI,SAAS;;;;;;;;;;;;;;;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,0BAAoB;AACpB,kBAAY;AACZ,aAAO;AACP;;;AAGJ,QAAI,gBAAgB;AAClB,YAAO,IAAI,SAAS,IAAI,QAAQ;AAChC,yBAAoB;;UAEjB;AACL,QAAI,IAAI,SAAS,EACf,QAAO,IAAI,KAAK,MAAM,YAAY,GAAG,MAAM;QAE3C,OAAM,KAAK,MAAM,YAAY,GAAG,MAAM;AAExC,wBAAoB,QAAQ,YAAY;;AAE1C,eAAY;AACZ,UAAO;aACE,SAAS,OAAO,SAAS,GAClC,GAAE;MAEF,QAAO;;AAGX,QAAO"}
1
+ {"version":3,"file":"join-paths.mjs","names":[],"sources":["../../../../path/src/join-paths.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isAbsolute } from \"./is-type\";\nimport {\n DRIVE_LETTER_REGEX,\n DRIVE_LETTER_START_REGEX,\n UNC_REGEX\n} from \"./regex\";\nimport { slash } from \"./slash\";\n\n// Util to normalize windows paths to posix\nfunction normalizeWindowsPath(input = \"\") {\n if (!input) {\n return input;\n }\n return input\n .replace(/\\\\/g, \"/\")\n .replace(DRIVE_LETTER_START_REGEX, r => r.toUpperCase());\n}\n\nfunction correctPaths(path?: string) {\n if (!path || path.length === 0) {\n return \".\";\n }\n\n // Normalize windows argument\n path = normalizeWindowsPath(path);\n\n const isUNCPath = path.match(UNC_REGEX);\n const isPathAbsolute = isAbsolute(path);\n const trailingSeparator = path[path.length - 1] === \"/\";\n\n // Normalize the path\n path = normalizeString(path, !isPathAbsolute);\n\n if (path.length === 0) {\n if (isPathAbsolute) {\n return \"/\";\n }\n return trailingSeparator ? \"./\" : \".\";\n }\n if (trailingSeparator) {\n path += \"/\";\n }\n if (DRIVE_LETTER_REGEX.test(path)) {\n path += \"/\";\n }\n\n if (isUNCPath) {\n if (!isPathAbsolute) {\n return `//./${path}`;\n }\n return `//${path}`;\n }\n\n return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;\n}\n\n/**\n * Joins all given path segments together using the platform-specific separator as a delimiter.\n *\n * @remarks\n * Multiple segments can be provided as separate arguments. The resulting path is normalized to remove any redundant or unnecessary segments.\n *\n * @example\n * ```ts\n * import { joinPaths } from 'stryke/path';\n *\n * const fullPath = joinPaths('folder1', 'folder2', '..', 'folder3', 'file.txt');\n * console.log(fullPath); // Output: 'folder1/folder3/file.txt'\n *\n * const absolutePath = joinPaths('/root', 'folder', '.', 'subfolder', 'file.txt');\n * console.log(absolutePath); // Output: '/root/folder/subfolder/file.txt'\n *\n * const windowsPath = joinPaths('C:\\\\', 'Users', 'Public', '..', 'Documents', 'file.txt');\n * console.log(windowsPath); // Output: 'C:/Users/Documents/file.txt'\n *\n * const uncPath = joinPaths('\\\\\\\\Server\\\\Share', 'Folder', 'File.txt');\n * console.log(uncPath); // Output: '//Server/Share/Folder/File.txt'\n * ```\n *\n * @param segments - The path segments to join.\n * @returns The joined and normalized path string.\n */\nexport function joinPaths(...segments: string[]): string {\n let result = \"\";\n for (const segment of segments) {\n if (segment && slash(segment).replaceAll(/\\//g, \"\") !== \".\") {\n if (result) {\n if (slash(segment).replaceAll(/\\//g, \"\") === \"..\") {\n result = slash(result)\n .replace(/\\/+$/, \"\")\n .replace(/\\/*[^/]+$/, \"\");\n } else {\n result = `${slash(result).replace(/\\/+$/, \"\")}/${slash(\n segment\n ).replace(/^\\/+/, \"\")}`;\n }\n } else if (slash(segment).replaceAll(/\\//g, \"\") !== \"..\") {\n result = segment;\n }\n }\n }\n\n return correctPaths(result);\n}\n\nexport const join = joinPaths;\n\n/**\n * Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.\n *\n * @param path - The path to normalize.\n * @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.\n * @returns the normalized path string.\n */\nfunction normalizeString(path: string, allowAboveRoot: boolean) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let char: string | null = null;\n for (let index = 0; index <= path.length; ++index) {\n if (index < path.length) {\n // casted because we know it exists thanks to the length check\n char = path[index] as string;\n } else if (char === \"/\") {\n break;\n } else {\n char = \"/\";\n }\n if (char === \"/\") {\n if (lastSlash === index - 1 || dots === 1) {\n // NOOP\n } else if (dots === 2) {\n if (\n res.length < 2 ||\n lastSegmentLength !== 2 ||\n res[res.length - 1] !== \".\" ||\n res[res.length - 2] !== \".\"\n ) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(\"/\");\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\");\n }\n lastSlash = index;\n dots = 0;\n continue;\n } else if (res.length > 0) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = index;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n res += res.length > 0 ? \"/..\" : \"..\";\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) {\n res += `/${path.slice(lastSlash + 1, index)}`;\n } else {\n res = path.slice(lastSlash + 1, index);\n }\n lastSegmentLength = index - lastSlash - 1;\n }\n lastSlash = index;\n dots = 0;\n } else if (char === \".\" && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n"],"mappings":";;;;;AA2BA,SAAS,qBAAqB,QAAQ,IAAI;AACxC,KAAI,CAAC,MACH,QAAO;AAET,QAAO,MACJ,QAAQ,OAAO,IAAI,CACnB,QAAQ,2BAA0B,MAAK,EAAE,aAAa,CAAC;;AAG5D,SAAS,aAAa,MAAe;AACnC,KAAI,CAAC,QAA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