@stryke/trpc-next 0.5.80 → 0.5.81

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 (52) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/action-handler.cjs +1 -0
  3. package/dist/action-handler.d.cts +1 -0
  4. package/dist/action-handler.d.cts.map +1 -1
  5. package/dist/action-handler.d.mts +1 -0
  6. package/dist/action-handler.d.mts.map +1 -1
  7. package/dist/action-handler.mjs +1 -0
  8. package/dist/action-handler.mjs.map +1 -1
  9. package/dist/env/src/environment-checks.cjs +11 -1
  10. package/dist/env/src/environment-checks.mjs +1 -1
  11. package/dist/env/src/environment-checks.mjs.map +1 -1
  12. package/dist/env/src/get-env-paths.cjs +10 -0
  13. package/dist/env/src/get-env-paths.mjs +10 -0
  14. package/dist/env/src/get-env-paths.mjs.map +1 -0
  15. package/dist/env/src/index.cjs +6 -0
  16. package/dist/env/src/index.mjs +6 -0
  17. package/dist/env/src/load-env.cjs +4 -0
  18. package/dist/env/src/load-env.mjs +4 -0
  19. package/dist/env/src/providers.cjs +111 -0
  20. package/dist/env/src/providers.mjs +111 -0
  21. package/dist/env/src/providers.mjs.map +1 -0
  22. package/dist/env/src/runtime-checks.cjs +60 -0
  23. package/dist/env/src/runtime-checks.mjs +53 -0
  24. package/dist/env/src/runtime-checks.mjs.map +1 -0
  25. package/dist/fs/src/exists.mjs +2 -0
  26. package/dist/fs/src/read-file.mjs +2 -0
  27. package/dist/shared.mjs.map +1 -1
  28. package/dist/string-format/src/acronyms.cjs +413 -0
  29. package/dist/string-format/src/acronyms.mjs +413 -0
  30. package/dist/string-format/src/acronyms.mjs.map +1 -0
  31. package/dist/string-format/src/format-special-cases.cjs +1 -0
  32. package/dist/string-format/src/format-special-cases.mjs +1 -0
  33. package/dist/string-format/src/title-case.cjs +2 -0
  34. package/dist/string-format/src/title-case.mjs +2 -0
  35. package/dist/tanstack-query/client.cjs +1 -0
  36. package/dist/tanstack-query/client.d.cts +2 -2
  37. package/dist/tanstack-query/client.d.cts.map +1 -1
  38. package/dist/tanstack-query/client.d.mts +3 -3
  39. package/dist/tanstack-query/client.d.mts.map +1 -1
  40. package/dist/tanstack-query/client.mjs +1 -0
  41. package/dist/tanstack-query/client.mjs.map +1 -1
  42. package/dist/tanstack-query/server.cjs +26 -4
  43. package/dist/tanstack-query/server.d.cts +28 -5
  44. package/dist/tanstack-query/server.d.cts.map +1 -1
  45. package/dist/tanstack-query/server.d.mts +28 -5
  46. package/dist/tanstack-query/server.d.mts.map +1 -1
  47. package/dist/tanstack-query/server.mjs +26 -4
  48. package/dist/tanstack-query/server.mjs.map +1 -1
  49. package/dist/url/src/index.d.mts +2 -0
  50. package/dist/url/src/storm-url.d.mts +1 -0
  51. package/dist/url/src/types.d.mts +1 -1
  52. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  # Changelog for Stryke - TRPC Next
4
4
 
5
+ ## [0.5.81](https://github.com/storm-software/stryke/releases/tag/trpc-next%400.5.81) (03/23/2026)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **monorepo:** Update all repository projects to resolve linting failures ([e9fb597b](https://github.com/storm-software/stryke/commit/e9fb597b))
10
+
11
+ ### Updated Dependencies
12
+
13
+ - Updated **types** to **v0.11.2**
14
+ - Updated **path** to **v0.27.3**
15
+ - Updated **env** to **v0.20.81**
16
+ - Updated **url** to **v0.4.14**
17
+
5
18
  ## [0.5.80](https://github.com/storm-software/stryke/releases/tag/trpc-next%400.5.80) (03/16/2026)
6
19
 
7
20
  ### Miscellaneous
@@ -7,6 +7,7 @@ defu = require_rolldown_runtime.__toESM(defu);
7
7
  /**
8
8
  * This client invokes procedures directly on the server without fetching over HTTP.
9
9
  *
10
+ * @param cookies - A function that returns the cookies to be passed to the API
10
11
  * @param t - The tRPC instance
11
12
  * @param createContext - An optional function to generate a context
12
13
  */
@@ -10,6 +10,7 @@ import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adap
10
10
  /**
11
11
  * This client invokes procedures directly on the server without fetching over HTTP.
12
12
  *
13
+ * @param cookies - A function that returns the cookies to be passed to the API
13
14
  * @param t - The tRPC instance
14
15
  * @param createContext - An optional function to generate a context
15
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"action-handler.d.cts","names":[],"sources":["../src/action-handler.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AAoCA;;AAEa,iBAFG,6BAEH,CAAA,kBAAA;EAEM,OAAA,EAFN,UAEM,CAFK,YAEL,CAAA;CAAc,EAAA,iBAAd,WAAc,GAAA,WAAA,CAAA,CAAA,OAAA,EAAA,GAAA,GAEhB,OAFgB,CAER,sBAFQ,CAAA,EAAA,CAAA,EAG5B,SAH4B,EAAA,aAAA,CAAA,EAAA,GAAA,GAIV,YAJU,CAIG,QAJH,CAAA,CAAA,EAAA,CAAA,cAIE,aAAA,CAAyC,YAJ3C,CAAA,CAAA,IAAA,EAI2C,KAJ3C,EAAA,8BAI2C,iBAJ3C,CAAA;EAER,KAAA,mCAAA,MAAA,CAAA;EAAR,MAAA,oCAAA,MAAA,CAAA;EACZ,UAAA,oCAAA,UAAA,CAAA,CAAA,YAAA,CAAA;CAC+B,CAAA"}
1
+ {"version":3,"file":"action-handler.d.cts","names":[],"sources":["../src/action-handler.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AAqCA;;;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"}
@@ -10,6 +10,7 @@ import { ReadonlyRequestCookies } from "next/dist/server/web/spec-extension/adap
10
10
  /**
11
11
  * This client invokes procedures directly on the server without fetching over HTTP.
12
12
  *
13
+ * @param cookies - A function that returns the cookies to be passed to the API
13
14
  * @param t - The tRPC instance
14
15
  * @param createContext - An optional function to generate a context
15
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"action-handler.d.mts","names":[],"sources":["../src/action-handler.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AAoCA;;AAEa,iBAFG,6BAEH,CAAA,kBAAA;EAEM,OAAA,EAFN,UAEM,CAFK,YAEL,CAAA;CAAc,EAAA,iBAAd,WAAc,GAAA,WAAA,CAAA,CAAA,OAAA,EAAA,GAAA,GAEhB,OAFgB,CAER,sBAFQ,CAAA,EAAA,CAAA,EAG5B,SAH4B,EAAA,aAAA,CAAA,EAAA,GAAA,GAIV,YAJU,CAIG,QAJH,CAAA,CAAA,EAAA,CAAA,cAIE,aAAA,CAAyC,YAJ3C,CAAA,CAAA,IAAA,EAI2C,KAJ3C,EAAA,8BAI2C,iBAJ3C,CAAA;EAER,KAAA,mCAAA,MAAA,CAAA;EAAR,MAAA,oCAAA,MAAA,CAAA;EACZ,UAAA,oCAAA,UAAA,CAAA,CAAA,YAAA,CAAA;CAC+B,CAAA"}
1
+ {"version":3,"file":"action-handler.d.mts","names":[],"sources":["../src/action-handler.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AAqCA;;;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"}
@@ -5,6 +5,7 @@ import defu from "defu";
5
5
  /**
6
6
  * This client invokes procedures directly on the server without fetching over HTTP.
7
7
  *
8
+ * @param cookies - A function that returns the cookies to be passed to the API
8
9
  * @param t - The tRPC instance
9
10
  * @param createContext - An optional function to generate a context
10
11
  */
@@ -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\n/* eslint-disable camelcase */\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 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":";;;;;;;;;;AAoCA,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\n/* eslint-disable camelcase */\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":";;;;;;;;;;;AAqCA,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"}
@@ -84,4 +84,14 @@ const nodeVersion = (process?.versions?.node || "").replace(/^v/, "") || null;
84
84
  const nodeMajorVersion = Number(nodeVersion?.split(".")[0]) || null;
85
85
 
86
86
  //#endregion
87
- exports.isDevelopment = isDevelopment;
87
+ exports.hasTTY = hasTTY;
88
+ exports.isDebug = isDebug;
89
+ exports.isDevelopment = isDevelopment;
90
+ exports.isDevelopmentMode = isDevelopmentMode;
91
+ exports.isProductionMode = isProductionMode;
92
+ exports.isStaging = isStaging;
93
+ exports.isTest = isTest;
94
+ exports.isTestMode = isTestMode;
95
+ exports.isWindows = isWindows;
96
+ exports.nodeVersion = nodeVersion;
97
+ exports.platform = platform;
@@ -84,5 +84,5 @@ const nodeVersion = (process?.versions?.node || "").replace(/^v/, "") || null;
84
84
  const nodeMajorVersion = Number(nodeVersion?.split(".")[0]) || null;
85
85
 
86
86
  //#endregion
87
- export { isDevelopment };
87
+ export { hasTTY, isDebug, isDevelopment, isDevelopmentMode, isProductionMode, isStaging, isTest, isTestMode, isWindows, nodeVersion, platform };
88
88
  //# sourceMappingURL=environment-checks.mjs.map
@@ -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 // eslint-disable-next-line @cspell/spellchecker\n \"preprod\",\n // eslint-disable-next-line @cspell/spellchecker\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 // eslint-disable-next-line @cspell/spellchecker\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/** 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;;AAGxD,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":["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/** 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;;AAGxD,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"}
@@ -0,0 +1,10 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ require('../../string-format/src/title-case.cjs');
3
+ let node_os = require("node:os");
4
+ node_os = require_rolldown_runtime.__toESM(node_os);
5
+
6
+ //#region ../env/src/get-env-paths.ts
7
+ const homedir = node_os.default.homedir();
8
+ const tmpdir = node_os.default.tmpdir();
9
+
10
+ //#endregion
@@ -0,0 +1,10 @@
1
+ import "../../string-format/src/title-case.mjs";
2
+ import os from "node:os";
3
+ import "node:path";
4
+
5
+ //#region ../env/src/get-env-paths.ts
6
+ const homedir = os.homedir();
7
+ const tmpdir = os.tmpdir();
8
+
9
+ //#endregion
10
+ //# sourceMappingURL=get-env-paths.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-env-paths.mjs","names":[],"sources":["../../../../env/src/get-env-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 { joinPaths } from \"@stryke/path/join-paths\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\n// Forked from https://www.npmjs.com/package/env-paths\n\nconst homedir = os.homedir();\nconst tmpdir = os.tmpdir();\n\n/**\n * Options for the `getEnvPaths` function.\n */\nexport interface GetEnvPathsOptions {\n /**\n * The name of the organization\n *\n * @defaultValue \"storm-software\"\n */\n orgId?: string;\n\n /**\n * The name of the specific application to use as a nested folder inside the organization's folder\n *\n * For example: `~/ ... /storm-software/Log/<appId>`\n */\n appId?: string;\n\n /**\n * The name of the specific application to use as a nested folder inside the organization's folder\n *\n * When a value is provided, it will use `~/ ... /storm-software/Log/<appId>/<nestedDir>`\n *\n * @remarks\n * If no child is provided, it will use `~/ ... /storm-software/Log/<appId>`\n */\n nestedDir?: string;\n\n /**\n * The suffix to append to the project name.\n *\n * @remarks\n * If `suffix` is `true`, the project name will be suffixed with `\"nodejs\"`.\n *\n * @defaultValue false\n */\n suffix?: string | boolean | null;\n\n /**\n * The root directory of the workspace that is used for determining the `cache` and `tmp` paths if they were not already set by other means.\n */\n workspaceRoot?: string;\n}\n\nexport interface EnvPaths {\n data: string;\n config: string;\n cache: string;\n log: string;\n temp: string;\n}\n\nconst macos = (orgId: string): EnvPaths => {\n const library = joinPaths(homedir, \"Library\");\n\n return {\n data: joinPaths(library, \"Application Support\", orgId),\n config: joinPaths(library, \"Preferences\", orgId),\n cache: joinPaths(library, \"Caches\", orgId),\n log: joinPaths(library, \"Logs\", orgId),\n temp: joinPaths(tmpdir, orgId)\n };\n};\n\nconst windows = (orgId: string): EnvPaths => {\n const appData =\n process.env.APPDATA || joinPaths(homedir, \"AppData\", \"Roaming\");\n const localAppData =\n process.env.LOCALAPPDATA || joinPaths(homedir, \"AppData\", \"Local\");\n\n const windowsFormattedOrgId = titleCase(orgId).trim().replace(/\\s+/g, \"\");\n\n return {\n // Data/config/cache/log are invented by me as Windows isn't opinionated about this\n data: joinPaths(localAppData, windowsFormattedOrgId, \"Data\"),\n config: joinPaths(appData, windowsFormattedOrgId, \"Config\"),\n cache: joinPaths(localAppData, \"Cache\", orgId),\n log: joinPaths(localAppData, windowsFormattedOrgId, \"Log\"),\n temp: joinPaths(tmpdir, orgId)\n };\n};\n\n// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html\nconst linux = (orgId: string): EnvPaths => {\n const username = path.basename(homedir);\n\n return {\n data: joinPaths(\n process.env.XDG_DATA_HOME || joinPaths(homedir, \".local\", \"share\"),\n orgId\n ),\n config: joinPaths(\n process.env.XDG_CONFIG_HOME || joinPaths(homedir, \".config\"),\n orgId\n ),\n cache: joinPaths(\n process.env.XDG_CACHE_HOME || joinPaths(homedir, \".cache\"),\n orgId\n ),\n // https://wiki.debian.org/XDGBaseDirectorySpecification#state\n log: joinPaths(\n process.env.XDG_STATE_HOME || joinPaths(homedir, \".local\", \"state\"),\n orgId\n ),\n // https://devenv.sh/files-and-variables/#devenv_root\n temp:\n process.env.DEVENV_RUNTIME || process.env.XDG_RUNTIME_DIR\n ? joinPaths(\n (process.env.DEVENV_RUNTIME || process.env.XDG_RUNTIME_DIR)!,\n orgId\n )\n : joinPaths(tmpdir, username, orgId)\n };\n};\n\n/**\n * Get paths for storing things like data, config, logs, and cache in the current runtime environment.\n *\n * @remarks\n * On macOS, directories are generally created in `~/Library/Application Support/<name>`.\n * On Windows, directories are generally created in `%AppData%/<name>`.\n * On Linux, directories are generally created in `~/.config/<name>` - this is determined via the [XDG Base Directory spec](https://specifications.freedesktop.org/basedir-spec/latest/).\n *\n * If the `STORM_DATA_DIR`, `STORM_CONFIG_DIR`, `STORM_CACHE_DIR`, `STORM_LOG_DIR`, or `STORM_TEMP_DIR` environment variables are set, they will be used instead of the default paths.\n *\n * @param options - Parameters used to determine the specific paths for the current project/runtime environment\n * @returns An object containing the various paths for the runtime environment\n */\nexport function getEnvPaths(options: GetEnvPathsOptions = {}): EnvPaths {\n let orgId = options.orgId || \"storm-software\";\n if (!orgId) {\n throw new Error(\n \"You need to provide an orgId to the `getEnvPaths` function\"\n );\n }\n\n if (options.suffix) {\n // Add suffix to prevent possible conflict with native apps\n orgId += `-${typeof options.suffix === \"string\" ? options.suffix : \"nodejs\"}`;\n }\n\n let result = {} as EnvPaths;\n\n if (process.platform === \"darwin\") {\n result = macos(orgId);\n } else if (process.platform === \"win32\") {\n result = windows(orgId);\n } else {\n result = linux(orgId);\n }\n\n if (process.env.STORM_DATA_DIR) {\n result.data = process.env.STORM_DATA_DIR;\n } else if (process.env.STORM_CONFIG_DIR) {\n result.config = process.env.STORM_CONFIG_DIR;\n } else if (process.env.STORM_CACHE_DIR) {\n result.cache = process.env.STORM_CACHE_DIR;\n } else if (process.env.STORM_LOG_DIR) {\n result.log = process.env.STORM_LOG_DIR;\n } else if (process.env.STORM_TEMP_DIR) {\n result.temp = process.env.STORM_TEMP_DIR;\n }\n\n if (options.workspaceRoot) {\n result.cache ??= joinPaths(\n options.workspaceRoot,\n \"node_modules\",\n \".cache\",\n orgId\n );\n result.temp ??= joinPaths(options.workspaceRoot, \"tmp\", orgId);\n result.log ??= joinPaths(result.temp, \"logs\");\n result.config ??= joinPaths(options.workspaceRoot, \".config\", orgId);\n }\n\n return Object.keys(result).reduce((ret, key) => {\n if (result[key as keyof EnvPaths]) {\n const filePath = result[key as keyof EnvPaths];\n\n ret[key as keyof EnvPaths] =\n options.appId &&\n options.appId !== options.orgId &&\n options.appId !== options.nestedDir\n ? joinPaths(filePath, options.appId)\n : filePath;\n\n if (\n options.nestedDir &&\n options.nestedDir !== options.orgId &&\n options.nestedDir !== options.appId\n ) {\n ret[key as keyof EnvPaths] = joinPaths(\n ret[key as keyof EnvPaths],\n options.nestedDir\n );\n }\n }\n\n return ret;\n }, {} as EnvPaths);\n}\n"],"mappings":";;;;;AAyBA,MAAM,UAAU,GAAG,SAAS;AAC5B,MAAM,SAAS,GAAG,QAAQ"}
@@ -0,0 +1,6 @@
1
+ const require_ci_checks = require('./ci-checks.cjs');
2
+ const require_environment_checks = require('./environment-checks.cjs');
3
+ require('./get-env-paths.cjs');
4
+ require('./load-env.cjs');
5
+ const require_providers = require('./providers.cjs');
6
+ const require_runtime_checks = require('./runtime-checks.cjs');
@@ -0,0 +1,6 @@
1
+ import { isCI } from "./ci-checks.mjs";
2
+ import { hasTTY, isDebug, isDevelopment, isDevelopmentMode, isProductionMode, isStaging, isTest, isTestMode, isWindows, nodeVersion, platform } from "./environment-checks.mjs";
3
+ import "./get-env-paths.mjs";
4
+ import "./load-env.mjs";
5
+ import { providerInfo } from "./providers.mjs";
6
+ import { isBun, isDeno, isEdgeLight, isFastly, isNetlify, isNode, isWorkerd, runtimeInfo } from "./runtime-checks.mjs";
@@ -0,0 +1,4 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ let defu = require("defu");
3
+ defu = require_rolldown_runtime.__toESM(defu);
4
+ require("@dotenvx/dotenvx");
@@ -0,0 +1,4 @@
1
+ import "../../fs/src/exists.mjs";
2
+ import "../../fs/src/read-file.mjs";
3
+ import defu from "defu";
4
+ import "@dotenvx/dotenvx";
@@ -0,0 +1,111 @@
1
+
2
+ //#region ../env/src/providers.ts
3
+ const providers = [
4
+ ["APPVEYOR"],
5
+ [
6
+ "AWS_AMPLIFY",
7
+ "AWS_APP_ID",
8
+ { ci: true }
9
+ ],
10
+ ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
11
+ ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
12
+ ["APPCIRCLE", "AC_APPCIRCLE"],
13
+ ["BAMBOO", "bamboo_planKey"],
14
+ ["BITBUCKET", "BITBUCKET_COMMIT"],
15
+ ["BITRISE", "BITRISE_IO"],
16
+ ["BUDDY", "BUDDY_WORKSPACE_ID"],
17
+ ["BUILDKITE"],
18
+ ["CIRCLE", "CIRCLECI"],
19
+ ["CIRRUS", "CIRRUS_CI"],
20
+ [
21
+ "CLOUDFLARE_PAGES",
22
+ "CF_PAGES",
23
+ { ci: true }
24
+ ],
25
+ ["CODEBUILD", "CODEBUILD_BUILD_ARN"],
26
+ ["CODEFRESH", "CF_BUILD_ID"],
27
+ ["DRONE"],
28
+ ["DRONE", "DRONE_BUILD_EVENT"],
29
+ ["DSARI"],
30
+ ["GITHUB_ACTIONS"],
31
+ ["GITLAB", "GITLAB_CI"],
32
+ ["GITLAB", "CI_MERGE_REQUEST_ID"],
33
+ ["GOCD", "GO_PIPELINE_LABEL"],
34
+ ["LAYERCI"],
35
+ ["HUDSON", "HUDSON_URL"],
36
+ ["JENKINS", "JENKINS_URL"],
37
+ ["MAGNUM"],
38
+ ["NETLIFY"],
39
+ [
40
+ "NETLIFY",
41
+ "NETLIFY_LOCAL",
42
+ { ci: false }
43
+ ],
44
+ ["NEVERCODE"],
45
+ ["RENDER"],
46
+ ["SAIL", "SAILCI"],
47
+ ["SEMAPHORE"],
48
+ ["SCREWDRIVER"],
49
+ ["SHIPPABLE"],
50
+ ["SOLANO", "TDDIUM"],
51
+ ["STRIDER"],
52
+ ["TEAMCITY", "TEAMCITY_VERSION"],
53
+ ["TRAVIS"],
54
+ ["VERCEL", "NOW_BUILDER"],
55
+ [
56
+ "VERCEL",
57
+ "VERCEL",
58
+ { ci: false }
59
+ ],
60
+ [
61
+ "VERCEL",
62
+ "VERCEL_ENV",
63
+ { ci: false }
64
+ ],
65
+ ["APPCENTER", "APPCENTER_BUILD_ID"],
66
+ [
67
+ "CODESANDBOX",
68
+ "CODESANDBOX_SSE",
69
+ { ci: false }
70
+ ],
71
+ ["STACKBLITZ"],
72
+ ["STORMKIT"],
73
+ ["CLEAVR"],
74
+ ["ZEABUR"],
75
+ [
76
+ "CODESPHERE",
77
+ "CODESPHERE_APP_ID",
78
+ { ci: true }
79
+ ],
80
+ ["RAILWAY", "RAILWAY_PROJECT_ID"],
81
+ ["RAILWAY", "RAILWAY_SERVICE_ID"],
82
+ ["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"],
83
+ [
84
+ "FIREBASE_APP_HOSTING",
85
+ "FIREBASE_APP_HOSTING",
86
+ { ci: true }
87
+ ]
88
+ ];
89
+ function detectProvider() {
90
+ if (process?.env) for (const provider$1 of providers) {
91
+ const envName = provider$1[1] || provider$1[0];
92
+ if (process?.env[envName]) return {
93
+ name: provider$1[0].toLowerCase(),
94
+ ...provider$1[2]
95
+ };
96
+ }
97
+ if (process?.env?.SHELL === "/bin/jsh" && process?.versions?.webcontainer) return {
98
+ name: "stackblitz",
99
+ ci: false
100
+ };
101
+ return {
102
+ name: "",
103
+ ci: false
104
+ };
105
+ }
106
+ /** Current provider info */
107
+ const providerInfo = detectProvider();
108
+ const provider = providerInfo.name;
109
+
110
+ //#endregion
111
+ exports.providerInfo = providerInfo;
@@ -0,0 +1,111 @@
1
+ //#region ../env/src/providers.ts
2
+ const providers = [
3
+ ["APPVEYOR"],
4
+ [
5
+ "AWS_AMPLIFY",
6
+ "AWS_APP_ID",
7
+ { ci: true }
8
+ ],
9
+ ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
10
+ ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
11
+ ["APPCIRCLE", "AC_APPCIRCLE"],
12
+ ["BAMBOO", "bamboo_planKey"],
13
+ ["BITBUCKET", "BITBUCKET_COMMIT"],
14
+ ["BITRISE", "BITRISE_IO"],
15
+ ["BUDDY", "BUDDY_WORKSPACE_ID"],
16
+ ["BUILDKITE"],
17
+ ["CIRCLE", "CIRCLECI"],
18
+ ["CIRRUS", "CIRRUS_CI"],
19
+ [
20
+ "CLOUDFLARE_PAGES",
21
+ "CF_PAGES",
22
+ { ci: true }
23
+ ],
24
+ ["CODEBUILD", "CODEBUILD_BUILD_ARN"],
25
+ ["CODEFRESH", "CF_BUILD_ID"],
26
+ ["DRONE"],
27
+ ["DRONE", "DRONE_BUILD_EVENT"],
28
+ ["DSARI"],
29
+ ["GITHUB_ACTIONS"],
30
+ ["GITLAB", "GITLAB_CI"],
31
+ ["GITLAB", "CI_MERGE_REQUEST_ID"],
32
+ ["GOCD", "GO_PIPELINE_LABEL"],
33
+ ["LAYERCI"],
34
+ ["HUDSON", "HUDSON_URL"],
35
+ ["JENKINS", "JENKINS_URL"],
36
+ ["MAGNUM"],
37
+ ["NETLIFY"],
38
+ [
39
+ "NETLIFY",
40
+ "NETLIFY_LOCAL",
41
+ { ci: false }
42
+ ],
43
+ ["NEVERCODE"],
44
+ ["RENDER"],
45
+ ["SAIL", "SAILCI"],
46
+ ["SEMAPHORE"],
47
+ ["SCREWDRIVER"],
48
+ ["SHIPPABLE"],
49
+ ["SOLANO", "TDDIUM"],
50
+ ["STRIDER"],
51
+ ["TEAMCITY", "TEAMCITY_VERSION"],
52
+ ["TRAVIS"],
53
+ ["VERCEL", "NOW_BUILDER"],
54
+ [
55
+ "VERCEL",
56
+ "VERCEL",
57
+ { ci: false }
58
+ ],
59
+ [
60
+ "VERCEL",
61
+ "VERCEL_ENV",
62
+ { ci: false }
63
+ ],
64
+ ["APPCENTER", "APPCENTER_BUILD_ID"],
65
+ [
66
+ "CODESANDBOX",
67
+ "CODESANDBOX_SSE",
68
+ { ci: false }
69
+ ],
70
+ ["STACKBLITZ"],
71
+ ["STORMKIT"],
72
+ ["CLEAVR"],
73
+ ["ZEABUR"],
74
+ [
75
+ "CODESPHERE",
76
+ "CODESPHERE_APP_ID",
77
+ { ci: true }
78
+ ],
79
+ ["RAILWAY", "RAILWAY_PROJECT_ID"],
80
+ ["RAILWAY", "RAILWAY_SERVICE_ID"],
81
+ ["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"],
82
+ [
83
+ "FIREBASE_APP_HOSTING",
84
+ "FIREBASE_APP_HOSTING",
85
+ { ci: true }
86
+ ]
87
+ ];
88
+ function detectProvider() {
89
+ if (process?.env) for (const provider$1 of providers) {
90
+ const envName = provider$1[1] || provider$1[0];
91
+ if (process?.env[envName]) return {
92
+ name: provider$1[0].toLowerCase(),
93
+ ...provider$1[2]
94
+ };
95
+ }
96
+ if (process?.env?.SHELL === "/bin/jsh" && process?.versions?.webcontainer) return {
97
+ name: "stackblitz",
98
+ ci: false
99
+ };
100
+ return {
101
+ name: "",
102
+ ci: false
103
+ };
104
+ }
105
+ /** Current provider info */
106
+ const providerInfo = detectProvider();
107
+ const provider = providerInfo.name;
108
+
109
+ //#endregion
110
+ export { providerInfo };
111
+ //# sourceMappingURL=providers.mjs.map
@@ -0,0 +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,SAAS,oBAAoB;CAC9B,CAAC,QAAQ;CACT,CAAC,iBAAiB;CAClB,CAAC,UAAU,YAAY;CACvB,CAAC,UAAU,sBAAsB;CACjC,CAAC,QAAQ,oBAAoB;CAC7B,CAAC,UAAU;CACX,CAAC,UAAU,aAAa;CACxB,CAAC,WAAW,cAAc;CAC1B,CAAC,SAAS;CACV,CAAC,UAAU;CACX;EAAC;EAAW;EAAiB,EAAE,IAAI,OAAO;EAAC;CAC3C,CAAC,YAAY;CACb,CAAC,SAAS;CACV,CAAC,QAAQ,SAAS;CAClB,CAAC,YAAY;CACb,CAAC,cAAc;CACf,CAAC,YAAY;CACb,CAAC,UAAU,SAAS;CACpB,CAAC,UAAU;CACX,CAAC,YAAY,mBAAmB;CAChC,CAAC,SAAS;CACV,CAAC,UAAU,cAAc;CACzB;EAAC;EAAU;EAAU,EAAE,IAAI,OAAO;EAAC;CACnC;EAAC;EAAU;EAAc,EAAE,IAAI,OAAO;EAAC;CACvC,CAAC,aAAa,qBAAqB;CACnC;EAAC;EAAe;EAAmB,EAAE,IAAI,OAAO;EAAC;CACjD,CAAC,aAAa;CACd,CAAC,WAAW;CACZ,CAAC,SAAS;CACV,CAAC,SAAS;CACV;EAAC;EAAc;EAAqB,EAAE,IAAI,MAAM;EAAC;CACjD,CAAC,WAAW,qBAAqB;CACjC,CAAC,WAAW,qBAAqB;CACjC,CAAC,eAAe,qBAAqB;CACrC;EAAC;EAAwB;EAAwB,EAAE,IAAI,MAAM;EAAC;CAC/D;AAQD,SAAS,iBAA+B;AAEtC,KAAI,SAAS,IACX,MAAK,MAAMC,cAAY,WAAW;EAChC,MAAM,UAAUA,WAAS,MAAMA,WAAS;AACxC,MAAI,SAAS,IAAI,SACf,QAAO;GACL,MAAMA,WAAS,GAAG,aAAa;GAC/B,GAAIA,WAAS;GACd;;AAMP,KAAI,SAAS,KAAK,UAAU,cAAc,SAAS,UAAU,aAC3D,QAAO;EACL,MAAM;EACN,IAAI;EACL;AAGH,QAAO;EACL,MAAM;EACN,IAAI;EACL;;;AAIH,MAAa,eAAe,gBAAgB;AAC5C,MAAaC,WAAyB,aAAa"}
@@ -0,0 +1,60 @@
1
+
2
+ //#region ../env/src/runtime-checks.ts
3
+ /**
4
+ * Indicates if running in Node.js or a Node.js compatible runtime.
5
+ *
6
+ * **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.
7
+ *
8
+ * Use `runtime === "node"` if you need strict check for Node.js runtime.
9
+ */
10
+ const isNode = process?.release?.name === "node";
11
+ /**
12
+ * Indicates if running in Bun runtime.
13
+ */
14
+ const isBun = Boolean(Bun) || Boolean(process?.versions?.bun);
15
+ /**
16
+ * Indicates if running in Deno runtime.
17
+ */
18
+ const isDeno = Boolean(Deno);
19
+ /**
20
+ * Indicates if running in Fastly runtime.
21
+ */
22
+ const isFastly = Boolean(fastly);
23
+ /**
24
+ * Indicates if running in Netlify runtime.
25
+ */
26
+ const isNetlify = Boolean(Netlify);
27
+ /**
28
+ *
29
+ * Indicates if running in EdgeLight (Vercel Edge) runtime.
30
+ */
31
+ const isEdgeLight = Boolean(EdgeRuntime);
32
+ /**
33
+ * Indicates if running in Cloudflare Workers runtime.
34
+ */
35
+ const isWorkerd = navigator?.userAgent === "Cloudflare-Workers";
36
+ const runtimeChecks = [
37
+ [isNetlify, "netlify"],
38
+ [isEdgeLight, "edge-light"],
39
+ [isWorkerd, "workerd"],
40
+ [isFastly, "fastly"],
41
+ [isDeno, "deno"],
42
+ [isBun, "bun"],
43
+ [isNode, "node"]
44
+ ];
45
+ function detectRuntime() {
46
+ const detectedRuntime = runtimeChecks.find((check) => check[0]);
47
+ if (detectedRuntime) return { name: detectedRuntime[1] };
48
+ }
49
+ const runtimeInfo = detectRuntime();
50
+ const runtime = runtimeInfo?.name || "";
51
+
52
+ //#endregion
53
+ exports.isBun = isBun;
54
+ exports.isDeno = isDeno;
55
+ exports.isEdgeLight = isEdgeLight;
56
+ exports.isFastly = isFastly;
57
+ exports.isNetlify = isNetlify;
58
+ exports.isNode = isNode;
59
+ exports.isWorkerd = isWorkerd;
60
+ exports.runtimeInfo = runtimeInfo;
@@ -0,0 +1,53 @@
1
+ //#region ../env/src/runtime-checks.ts
2
+ /**
3
+ * Indicates if running in Node.js or a Node.js compatible runtime.
4
+ *
5
+ * **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.
6
+ *
7
+ * Use `runtime === "node"` if you need strict check for Node.js runtime.
8
+ */
9
+ const isNode = process?.release?.name === "node";
10
+ /**
11
+ * Indicates if running in Bun runtime.
12
+ */
13
+ const isBun = Boolean(Bun) || Boolean(process?.versions?.bun);
14
+ /**
15
+ * Indicates if running in Deno runtime.
16
+ */
17
+ const isDeno = Boolean(Deno);
18
+ /**
19
+ * Indicates if running in Fastly runtime.
20
+ */
21
+ const isFastly = Boolean(fastly);
22
+ /**
23
+ * Indicates if running in Netlify runtime.
24
+ */
25
+ const isNetlify = Boolean(Netlify);
26
+ /**
27
+ *
28
+ * Indicates if running in EdgeLight (Vercel Edge) runtime.
29
+ */
30
+ const isEdgeLight = Boolean(EdgeRuntime);
31
+ /**
32
+ * Indicates if running in Cloudflare Workers runtime.
33
+ */
34
+ const isWorkerd = navigator?.userAgent === "Cloudflare-Workers";
35
+ const runtimeChecks = [
36
+ [isNetlify, "netlify"],
37
+ [isEdgeLight, "edge-light"],
38
+ [isWorkerd, "workerd"],
39
+ [isFastly, "fastly"],
40
+ [isDeno, "deno"],
41
+ [isBun, "bun"],
42
+ [isNode, "node"]
43
+ ];
44
+ function detectRuntime() {
45
+ const detectedRuntime = runtimeChecks.find((check) => check[0]);
46
+ if (detectedRuntime) return { name: detectedRuntime[1] };
47
+ }
48
+ const runtimeInfo = detectRuntime();
49
+ const runtime = runtimeInfo?.name || "";
50
+
51
+ //#endregion
52
+ export { isBun, isDeno, isEdgeLight, isFastly, isNetlify, isNode, isWorkerd, runtimeInfo };
53
+ //# sourceMappingURL=runtime-checks.mjs.map
@@ -0,0 +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"}
@@ -0,0 +1,2 @@
1
+ import "node:fs";
2
+ import "node:fs/promises";
@@ -0,0 +1,2 @@
1
+ import "node:fs";
2
+ import "node:fs/promises";
@@ -1 +1 @@
1
- {"version":3,"file":"shared.mjs","names":[],"sources":["../src/shared.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 { Temporal } from \"@js-temporal/polyfill\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { StormURLInterface } from \"@stryke/url/types\";\nimport type { QueryClientConfig } from \"@tanstack/react-query\";\nimport {\n defaultShouldDehydrateQuery,\n QueryClient\n} from \"@tanstack/react-query\";\nimport type { DataTransformer } from \"@trpc/server/unstable-core-do-not-import\";\nimport defu from \"defu\";\nimport superjson from \"superjson\";\n\nexport function getTRPCServerUrl(\n baseUrl: string | StormURLInterface,\n version: number | null = 1\n) {\n return joinPaths(\n typeof baseUrl === \"string\" ? baseUrl : baseUrl.host || \"\",\n \"api\",\n version ? `v${version}` : \"\",\n \"trpc\"\n );\n}\n\nsuperjson.registerCustom(\n {\n isApplicable: (v): v is Temporal.PlainDate =>\n v instanceof Temporal.PlainDate,\n serialize: v => v.toJSON(),\n deserialize: v => Temporal.PlainDate.from(v)\n },\n \"Temporal.PlainDate\"\n);\n\nsuperjson.registerCustom(\n {\n isApplicable: (v): v is Temporal.PlainDateTime =>\n v instanceof Temporal.PlainDateTime,\n serialize: v => v.toJSON(),\n deserialize: v => Temporal.PlainDateTime.from(v)\n },\n \"Temporal.PlainDateTime\"\n);\n\nexport const transformer = superjson as DataTransformer;\n\n/**\n * Create a TRPC Tanstack Query client.\n *\n * @param queryClientConfig - The query client config\n * @returns The TRPC Tanstack Query client\n */\nexport const createQueryClient = (\n queryClientConfig: Partial<QueryClientConfig> = {}\n) =>\n new QueryClient(\n defu(queryClientConfig, {\n defaultOptions: {\n queries: {\n // Since queries are prefetched on the server, we set a stale time so that\n // queries aren't immediately re-fetched on the client\n staleTime: 1000 * 30\n },\n dehydrate: {\n // include pending queries in dehydration\n // this allows us to prefetch in RSC and\n // send promises over the RSC boundary\n shouldDehydrateQuery: (query: any) =>\n defaultShouldDehydrateQuery(query) ||\n query.state.status === \"pending\",\n serializeData: transformer.serialize\n },\n hydrate: {\n deserializeData: transformer.deserialize\n }\n }\n })\n );\n"],"mappings":";;;;;;;AA8BA,SAAgB,iBACd,SACA,UAAyB,GACzB;AACA,QAAO,UACL,OAAO,YAAY,WAAW,UAAU,QAAQ,QAAQ,IACxD,OACA,UAAU,IAAI,YAAY,IAC1B,OACD;;AAGH,UAAU,eACR;CACE,eAAe,MACb,aAAa,SAAS;CACxB,YAAW,MAAK,EAAE,QAAQ;CAC1B,cAAa,MAAK,SAAS,UAAU,KAAK,EAAE;CAC7C,EACD,qBACD;AAED,UAAU,eACR;CACE,eAAe,MACb,aAAa,SAAS;CACxB,YAAW,MAAK,EAAE,QAAQ;CAC1B,cAAa,MAAK,SAAS,cAAc,KAAK,EAAE;CACjD,EACD,yBACD;AAED,MAAa,cAAc;;;;;;;AAQ3B,MAAa,qBACX,oBAAgD,EAAE,KAElD,IAAI,YACF,KAAK,mBAAmB,EACtB,gBAAgB;CACd,SAAS,EAGP,WAAW,MAAO,IACnB;CACD,WAAW;EAIT,uBAAuB,UACrB,4BAA4B,MAAM,IAClC,MAAM,MAAM,WAAW;EACzB,eAAe,YAAY;EAC5B;CACD,SAAS,EACP,iBAAiB,YAAY,aAC9B;CACF,EACF,CAAC,CACH"}
1
+ {"version":3,"file":"shared.mjs","names":[],"sources":["../src/shared.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 { Temporal } from \"@js-temporal/polyfill\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport type { StormURLInterface } from \"@stryke/url/types\";\nimport type { QueryClientConfig } from \"@tanstack/react-query\";\nimport {\n defaultShouldDehydrateQuery,\n QueryClient\n} from \"@tanstack/react-query\";\nimport type { DataTransformer } from \"@trpc/server/unstable-core-do-not-import\";\nimport defu from \"defu\";\nimport superjson from \"superjson\";\n\nexport function getTRPCServerUrl(\n baseUrl: string | StormURLInterface,\n version: number | null = 1\n) {\n return joinPaths(\n typeof baseUrl === \"string\" ? baseUrl : baseUrl.host || \"\",\n \"api\",\n version ? `v${version}` : \"\",\n \"trpc\"\n );\n}\n\nsuperjson.registerCustom(\n {\n isApplicable: (v): v is Temporal.PlainDate =>\n v instanceof Temporal.PlainDate,\n serialize: v => v.toJSON(),\n deserialize: v => Temporal.PlainDate.from(v)\n },\n \"Temporal.PlainDate\"\n);\n\nsuperjson.registerCustom(\n {\n isApplicable: (v): v is Temporal.PlainDateTime =>\n v instanceof Temporal.PlainDateTime,\n serialize: v => v.toJSON(),\n deserialize: v => Temporal.PlainDateTime.from(v)\n },\n \"Temporal.PlainDateTime\"\n);\n\nexport const transformer = superjson as DataTransformer;\n\n/**\n * Create a TRPC Tanstack Query client.\n *\n * @param queryClientConfig - The query client config\n * @returns The TRPC Tanstack Query client\n */\nexport const createQueryClient = (\n queryClientConfig: Partial<QueryClientConfig> = {}\n) =>\n new QueryClient(\n defu(queryClientConfig, {\n defaultOptions: {\n queries: {\n // Since queries are prefetched on the server, we set a stale time so that\n // queries aren't immediately re-fetched on the client\n staleTime: 1000 * 30\n },\n dehydrate: {\n // include pending queries in dehydration\n // this allows us to prefetch in RSC and\n // send promises over the RSC boundary\n shouldDehydrateQuery: (query: any) =>\n defaultShouldDehydrateQuery(query) ||\n query.state.status === \"pending\",\n // eslint-disable-next-line ts/unbound-method\n serializeData: transformer.serialize\n },\n hydrate: {\n // eslint-disable-next-line ts/unbound-method\n deserializeData: transformer.deserialize\n }\n }\n })\n );\n"],"mappings":";;;;;;;AA8BA,SAAgB,iBACd,SACA,UAAyB,GACzB;AACA,QAAO,UACL,OAAO,YAAY,WAAW,UAAU,QAAQ,QAAQ,IACxD,OACA,UAAU,IAAI,YAAY,IAC1B,OACD;;AAGH,UAAU,eACR;CACE,eAAe,MACb,aAAa,SAAS;CACxB,YAAW,MAAK,EAAE,QAAQ;CAC1B,cAAa,MAAK,SAAS,UAAU,KAAK,EAAE;CAC7C,EACD,qBACD;AAED,UAAU,eACR;CACE,eAAe,MACb,aAAa,SAAS;CACxB,YAAW,MAAK,EAAE,QAAQ;CAC1B,cAAa,MAAK,SAAS,cAAc,KAAK,EAAE;CACjD,EACD,yBACD;AAED,MAAa,cAAc;;;;;;;AAQ3B,MAAa,qBACX,oBAAgD,EAAE,KAElD,IAAI,YACF,KAAK,mBAAmB,EACtB,gBAAgB;CACd,SAAS,EAGP,WAAW,MAAO,IACnB;CACD,WAAW;EAIT,uBAAuB,UACrB,4BAA4B,MAAM,IAClC,MAAM,MAAM,WAAW;EAEzB,eAAe,YAAY;EAC5B;CACD,SAAS,EAEP,iBAAiB,YAAY,aAC9B;CACF,EACF,CAAC,CACH"}