@stryke/env 0.20.96 → 0.20.97

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 (68) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/_virtual/_rolldown/runtime.cjs +14 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  4. package/dist/ci-checks.cjs +11 -0
  5. package/dist/ci-checks.mjs +7 -1
  6. package/dist/ci-checks.mjs.map +1 -1
  7. package/dist/ci-checks.test.cjs +13 -0
  8. package/dist/ci-checks.test.d.cts +1 -0
  9. package/dist/ci-checks.test.d.mts +1 -0
  10. package/dist/ci-checks.test.mjs +14 -0
  11. package/dist/ci-checks.test.mjs.map +1 -0
  12. package/dist/environment-checks.cjs +28 -0
  13. package/dist/environment-checks.mjs +23 -1
  14. package/dist/environment-checks.mjs.map +1 -1
  15. package/dist/environment-checks.test.cjs +13 -0
  16. package/dist/environment-checks.test.d.cts +1 -0
  17. package/dist/environment-checks.test.d.mts +1 -0
  18. package/dist/environment-checks.test.mjs +14 -0
  19. package/dist/environment-checks.test.mjs.map +1 -0
  20. package/dist/get-env-paths.cjs +8 -1
  21. package/dist/get-env-paths.mjs +3 -1
  22. package/dist/get-env-paths.mjs.map +1 -1
  23. package/dist/get-env-paths.test.cjs +13 -0
  24. package/dist/get-env-paths.test.d.cts +1 -0
  25. package/dist/get-env-paths.test.d.mts +1 -0
  26. package/dist/get-env-paths.test.mjs +14 -0
  27. package/dist/get-env-paths.test.mjs.map +1 -0
  28. package/dist/index.cjs +53 -0
  29. package/dist/index.mjs +49 -1
  30. package/dist/index.mjs.map +1 -0
  31. package/dist/index.test.cjs +13 -0
  32. package/dist/index.test.d.cts +1 -0
  33. package/dist/index.test.d.mts +1 -0
  34. package/dist/index.test.mjs +14 -0
  35. package/dist/index.test.mjs.map +1 -0
  36. package/dist/load-env.cjs +14 -1
  37. package/dist/load-env.mjs +9 -1
  38. package/dist/load-env.mjs.map +1 -1
  39. package/dist/load-env.test.cjs +13 -0
  40. package/dist/load-env.test.d.cts +1 -0
  41. package/dist/load-env.test.d.mts +1 -0
  42. package/dist/load-env.test.mjs +14 -0
  43. package/dist/load-env.test.mjs.map +1 -0
  44. package/dist/providers.cjs +12 -1
  45. package/dist/providers.mjs +7 -1
  46. package/dist/providers.mjs.map +1 -1
  47. package/dist/providers.test.cjs +13 -0
  48. package/dist/providers.test.d.cts +1 -0
  49. package/dist/providers.test.d.mts +1 -0
  50. package/dist/providers.test.mjs +14 -0
  51. package/dist/providers.test.mjs.map +1 -0
  52. package/dist/runtime-checks.cjs +21 -1
  53. package/dist/runtime-checks.mjs +16 -1
  54. package/dist/runtime-checks.mjs.map +1 -1
  55. package/dist/runtime-checks.test.cjs +13 -0
  56. package/dist/runtime-checks.test.d.cts +1 -0
  57. package/dist/runtime-checks.test.d.mts +1 -0
  58. package/dist/runtime-checks.test.mjs +14 -0
  59. package/dist/runtime-checks.test.mjs.map +1 -0
  60. package/dist/types.cjs +9 -1
  61. package/dist/types.mjs +4 -1
  62. package/dist/types.mjs.map +1 -1
  63. package/dist/types.test.cjs +13 -0
  64. package/dist/types.test.d.cts +1 -0
  65. package/dist/types.test.d.mts +1 -0
  66. package/dist/types.test.mjs +14 -0
  67. package/dist/types.test.mjs.map +1 -0
  68. package/package.json +38 -6
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  # Changelog for Stryke - Env
4
4
 
5
+ ## [0.20.96](https://github.com/storm-software/stryke/releases/tag/env%400.20.96) (05/27/2026)
6
+
7
+ ### Updated Dependencies
8
+
9
+ - Updated **convert** to **v0.7.10**
10
+ - Updated **fs** to **v0.33.79**
11
+ - Updated **path** to **v0.29.6**
12
+ - Updated **string-format** to **v0.17.21**
13
+
5
14
  ## [0.20.95](https://github.com/storm-software/stryke/releases/tag/env%400.20.95) (05/27/2026)
6
15
 
7
16
  ### Updated Dependencies
@@ -5,6 +5,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __exportAll = (all, no_symbols) => {
9
+ let target = {};
10
+ for (var name in all) {
11
+ __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ }
16
+ if (!no_symbols) {
17
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
18
+ }
19
+ return target;
20
+ };
8
21
  var __copyProps = (to, from, except, desc) => {
9
22
  if (from && typeof from === "object" || typeof from === "function") {
10
23
  for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
@@ -26,4 +39,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
39
 
27
40
  //#endregion
28
41
 
42
+ exports.__exportAll = __exportAll;
29
43
  exports.__toESM = __toESM;
@@ -0,0 +1,18 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) {
6
+ __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ }
11
+ if (!no_symbols) {
12
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
13
+ }
14
+ return target;
15
+ };
16
+
17
+ //#endregion
18
+ export { __exportAll };
@@ -1,6 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
3
 
3
4
  //#region src/ci-checks.ts
5
+ var ci_checks_exports = /* @__PURE__ */ require_runtime.__exportAll({
6
+ isCI: () => isCI,
7
+ isInteractive: () => isInteractive
8
+ });
4
9
  /**
5
10
  * Returns true if the current environment is a CI environment.
6
11
  *
@@ -20,5 +25,11 @@ const isInteractive = (stream = process.stdin) => {
20
25
  };
21
26
 
22
27
  //#endregion
28
+ Object.defineProperty(exports, 'ci_checks_exports', {
29
+ enumerable: true,
30
+ get: function () {
31
+ return ci_checks_exports;
32
+ }
33
+ });
23
34
  exports.isCI = isCI;
24
35
  exports.isInteractive = isInteractive;
@@ -1,4 +1,10 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
2
+
1
3
  //#region src/ci-checks.ts
4
+ var ci_checks_exports = /* @__PURE__ */ __exportAll({
5
+ isCI: () => isCI,
6
+ isInteractive: () => isInteractive
7
+ });
2
8
  /**
3
9
  * Returns true if the current environment is a CI environment.
4
10
  *
@@ -18,5 +24,5 @@ const isInteractive = (stream = process.stdin) => {
18
24
  };
19
25
 
20
26
  //#endregion
21
- export { isCI, isInteractive };
27
+ export { ci_checks_exports, isCI, isInteractive };
22
28
  //# sourceMappingURL=ci-checks.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ci-checks.mjs","names":[],"sources":["../src/ci-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/**\n * Returns true if the current environment is a CI environment.\n *\n * @returns True if the current environment is a CI environment.\n */\nexport const isCI = (\n env: Record<string, string | undefined> = process.env\n): boolean => {\n // From https://github.com/watson/ci-info/blob/44e98cebcdf4403f162195fbcf90b1f69fc6e047/index.js#L54-L61\n // Evaluating at runtime makes it possible to change the values in our tests\n // This list is probably not exhaustive though `process.env.CI` should be enough\n // but since we were using this utility in the past, we want to keep the same behavior\n return Boolean(\n env.STORM_CI || // Custom CI\n env.CI || // Travis CI, CircleCI, Cirrus CI, GitLab CI, Appveyor, CodeShip, dsari\n env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI\n env.BUILD_NUMBER || // Jenkins, TeamCity\n env.RUN_ID || // TaskCluster, dsari\n // From `env` from v4.0.0 https://github.com/watson/ci-info/blob/3e1488e98680f1f776785fe8708a157b7f00e568/vendors.json\n env.AGOLA_GIT_REF ||\n env.AC_APPCIRCLE ||\n env.APPVEYOR ||\n env.CODEBUILD ||\n env.TF_BUILD ||\n env.bamboo_planKey ||\n env.BITBUCKET_COMMIT ||\n env.BITRISE_IO ||\n env.BUDDY_WORKSPACE_ID ||\n env.BUILDKITE ||\n env.CIRCLECI ||\n env.CIRRUS_CI ||\n env.CF_BUILD_ID ||\n env.CM_BUILD_ID ||\n env.CI_NAME ||\n env.DRONE ||\n env.DSARI ||\n env.EARTHLY_CI ||\n env.EAS_BUILD ||\n env.GERRIT_PROJECT ||\n env.GITEA_ACTIONS ||\n env.GITHUB_ACTIONS ||\n env.GITLAB_CI ||\n env.GOCD ||\n env.BUILDER_OUTPUT ||\n env.HARNESS_BUILD_ID ||\n env.JENKINS_URL ||\n env.BUILD_ID ||\n env.LAYERCI ||\n env.MAGNUM ||\n env.NETLIFY ||\n env.NEVERCODE ||\n env.PROW_JOB_ID ||\n env.RELEASE_BUILD_ID ||\n env.RENDER ||\n env.SAILCI ||\n env.HUDSON ||\n env.JENKINS_URL ||\n env.BUILD_ID ||\n env.SCREWDRIVER ||\n env.SEMAPHORE ||\n env.SOURCEHUT ||\n env.STRIDER ||\n env.TASK_ID ||\n env.RUN_ID ||\n env.TEAMCITY_VERSION ||\n env.TRAVIS ||\n env.VELA ||\n env.NOW_BUILDER ||\n // See https://github.com/prisma/prisma/issues/22380 for why we commented it out\n // Users deploying on Vercel might have this env var set in the local dev env\n // env.VERCEL ||\n env.APPCENTER_BUILD_ID ||\n env.CI_XCODE_PROJECT ||\n env.XCS ||\n false\n );\n};\n\n// Same logic as https://github.com/sindresorhus/is-interactive/blob/dc8037ae1a61d828cfb42761c345404055b1e036/index.js\n// But defaults to check `stdin` for our prompts\n// It checks that the stream is TTY, not a dumb terminal\n\n/**\n * Check if the current process is interactive\n *\n * @param stream - The stream to check\n * @returns True if the current process is interactive\n */\nexport const isInteractive = (stream = process.stdin): boolean => {\n return Boolean(stream?.isTTY && process.env.TERM !== \"dumb\");\n};\n"],"mappings":";;;;;;AAuBA,MAAa,QACX,MAA0C,QAAQ,QACtC;AAKZ,QAAO,QACL,IAAI,YACJ,IAAI,MACJ,IAAI,0BACJ,IAAI,gBACJ,IAAI,UAEJ,IAAI,iBACJ,IAAI,gBACJ,IAAI,YACJ,IAAI,aACJ,IAAI,YACJ,IAAI,kBACJ,IAAI,oBACJ,IAAI,cACJ,IAAI,sBACJ,IAAI,aACJ,IAAI,YACJ,IAAI,aACJ,IAAI,eACJ,IAAI,eACJ,IAAI,WACJ,IAAI,SACJ,IAAI,SACJ,IAAI,cACJ,IAAI,aACJ,IAAI,kBACJ,IAAI,iBACJ,IAAI,kBACJ,IAAI,aACJ,IAAI,QACJ,IAAI,kBACJ,IAAI,oBACJ,IAAI,eACJ,IAAI,YACJ,IAAI,WACJ,IAAI,UACJ,IAAI,WACJ,IAAI,aACJ,IAAI,eACJ,IAAI,oBACJ,IAAI,UACJ,IAAI,UACJ,IAAI,UACJ,IAAI,eACJ,IAAI,YACJ,IAAI,eACJ,IAAI,aACJ,IAAI,aACJ,IAAI,WACJ,IAAI,WACJ,IAAI,UACJ,IAAI,oBACJ,IAAI,UACJ,IAAI,QACJ,IAAI,eAIJ,IAAI,sBACJ,IAAI,oBACJ,IAAI,OACJ,MACD;;;;;;;;AAaH,MAAa,iBAAiB,SAAS,QAAQ,UAAmB;AAChE,QAAO,QAAQ,QAAQ,SAAS,QAAQ,IAAI,SAAS,OAAO"}
1
+ {"version":3,"file":"ci-checks.mjs","names":[],"sources":["../src/ci-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/**\n * Returns true if the current environment is a CI environment.\n *\n * @returns True if the current environment is a CI environment.\n */\nexport const isCI = (\n env: Record<string, string | undefined> = process.env\n): boolean => {\n // From https://github.com/watson/ci-info/blob/44e98cebcdf4403f162195fbcf90b1f69fc6e047/index.js#L54-L61\n // Evaluating at runtime makes it possible to change the values in our tests\n // This list is probably not exhaustive though `process.env.CI` should be enough\n // but since we were using this utility in the past, we want to keep the same behavior\n return Boolean(\n env.STORM_CI || // Custom CI\n env.CI || // Travis CI, CircleCI, Cirrus CI, GitLab CI, Appveyor, CodeShip, dsari\n env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI\n env.BUILD_NUMBER || // Jenkins, TeamCity\n env.RUN_ID || // TaskCluster, dsari\n // From `env` from v4.0.0 https://github.com/watson/ci-info/blob/3e1488e98680f1f776785fe8708a157b7f00e568/vendors.json\n env.AGOLA_GIT_REF ||\n env.AC_APPCIRCLE ||\n env.APPVEYOR ||\n env.CODEBUILD ||\n env.TF_BUILD ||\n env.bamboo_planKey ||\n env.BITBUCKET_COMMIT ||\n env.BITRISE_IO ||\n env.BUDDY_WORKSPACE_ID ||\n env.BUILDKITE ||\n env.CIRCLECI ||\n env.CIRRUS_CI ||\n env.CF_BUILD_ID ||\n env.CM_BUILD_ID ||\n env.CI_NAME ||\n env.DRONE ||\n env.DSARI ||\n env.EARTHLY_CI ||\n env.EAS_BUILD ||\n env.GERRIT_PROJECT ||\n env.GITEA_ACTIONS ||\n env.GITHUB_ACTIONS ||\n env.GITLAB_CI ||\n env.GOCD ||\n env.BUILDER_OUTPUT ||\n env.HARNESS_BUILD_ID ||\n env.JENKINS_URL ||\n env.BUILD_ID ||\n env.LAYERCI ||\n env.MAGNUM ||\n env.NETLIFY ||\n env.NEVERCODE ||\n env.PROW_JOB_ID ||\n env.RELEASE_BUILD_ID ||\n env.RENDER ||\n env.SAILCI ||\n env.HUDSON ||\n env.JENKINS_URL ||\n env.BUILD_ID ||\n env.SCREWDRIVER ||\n env.SEMAPHORE ||\n env.SOURCEHUT ||\n env.STRIDER ||\n env.TASK_ID ||\n env.RUN_ID ||\n env.TEAMCITY_VERSION ||\n env.TRAVIS ||\n env.VELA ||\n env.NOW_BUILDER ||\n // See https://github.com/prisma/prisma/issues/22380 for why we commented it out\n // Users deploying on Vercel might have this env var set in the local dev env\n // env.VERCEL ||\n env.APPCENTER_BUILD_ID ||\n env.CI_XCODE_PROJECT ||\n env.XCS ||\n false\n );\n};\n\n// Same logic as https://github.com/sindresorhus/is-interactive/blob/dc8037ae1a61d828cfb42761c345404055b1e036/index.js\n// But defaults to check `stdin` for our prompts\n// It checks that the stream is TTY, not a dumb terminal\n\n/**\n * Check if the current process is interactive\n *\n * @param stream - The stream to check\n * @returns True if the current process is interactive\n */\nexport const isInteractive = (stream = process.stdin): boolean => {\n return Boolean(stream?.isTTY && process.env.TERM !== \"dumb\");\n};\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAa,QACX,MAA0C,QAAQ,QACtC;AAKZ,QAAO,QACL,IAAI,YACJ,IAAI,MACJ,IAAI,0BACJ,IAAI,gBACJ,IAAI,UAEJ,IAAI,iBACJ,IAAI,gBACJ,IAAI,YACJ,IAAI,aACJ,IAAI,YACJ,IAAI,kBACJ,IAAI,oBACJ,IAAI,cACJ,IAAI,sBACJ,IAAI,aACJ,IAAI,YACJ,IAAI,aACJ,IAAI,eACJ,IAAI,eACJ,IAAI,WACJ,IAAI,SACJ,IAAI,SACJ,IAAI,cACJ,IAAI,aACJ,IAAI,kBACJ,IAAI,iBACJ,IAAI,kBACJ,IAAI,aACJ,IAAI,QACJ,IAAI,kBACJ,IAAI,oBACJ,IAAI,eACJ,IAAI,YACJ,IAAI,WACJ,IAAI,UACJ,IAAI,WACJ,IAAI,aACJ,IAAI,eACJ,IAAI,oBACJ,IAAI,UACJ,IAAI,UACJ,IAAI,UACJ,IAAI,eACJ,IAAI,YACJ,IAAI,eACJ,IAAI,aACJ,IAAI,aACJ,IAAI,WACJ,IAAI,WACJ,IAAI,UACJ,IAAI,oBACJ,IAAI,UACJ,IAAI,QACJ,IAAI,eAIJ,IAAI,sBACJ,IAAI,oBACJ,IAAI,OACJ,MACD;;;;;;;;AAaH,MAAa,iBAAiB,SAAS,QAAQ,UAAmB;AAChE,QAAO,QAAQ,QAAQ,SAAS,QAAQ,IAAI,SAAS,OAAO"}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_ci_checks = require('./ci-checks.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/ci-checks.test.ts
6
+ (0, vitest.describe)("ci-checks.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_ci_checks.ci_checks_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_ci_checks.ci_checks_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,14 @@
1
+ import { ci_checks_exports } from "./ci-checks.mjs";
2
+ import { describe, expect, it } from "vitest";
3
+
4
+ //#region src/ci-checks.test.ts
5
+ describe("ci-checks.ts exports", () => {
6
+ it("loads module exports", () => {
7
+ expect(ci_checks_exports).toBeDefined();
8
+ expect(typeof ci_checks_exports).toBe("object");
9
+ });
10
+ });
11
+
12
+ //#endregion
13
+ export { };
14
+ //# sourceMappingURL=ci-checks.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-checks.test.mjs","names":["moduleExports"],"sources":["../src/ci-checks.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./ci-checks.ts\";\n\ndescribe(\"ci-checks.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,8BAA8B;AACrC,IAAG,8BAA8B;AAC/B,SAAOA,kBAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,kBAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
@@ -1,7 +1,29 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
3
  const require_ci_checks = require('./ci-checks.cjs');
3
4
 
4
5
  //#region src/environment-checks.ts
6
+ var environment_checks_exports = /* @__PURE__ */ require_runtime.__exportAll({
7
+ hasTTY: () => hasTTY,
8
+ isColorSupported: () => isColorSupported,
9
+ isDebug: () => isDebug,
10
+ isDevelopment: () => isDevelopment,
11
+ isDevelopmentMode: () => isDevelopmentMode,
12
+ isHyperlinkSupported: () => isHyperlinkSupported,
13
+ isLinux: () => isLinux,
14
+ isMacOS: () => isMacOS,
15
+ isMinimal: () => isMinimal,
16
+ isProduction: () => isProduction,
17
+ isProductionMode: () => isProductionMode,
18
+ isStaging: () => isStaging,
19
+ isTest: () => isTest,
20
+ isTestMode: () => isTestMode,
21
+ isWindows: () => isWindows,
22
+ nodeMajorVersion: () => nodeMajorVersion,
23
+ nodeVersion: () => nodeVersion,
24
+ platform: () => platform,
25
+ toMode: () => toMode
26
+ });
5
27
  /** Value of process.platform */
6
28
  const platform = process?.platform || "";
7
29
  /** Detect if stdout.TTY is available */
@@ -149,6 +171,12 @@ const nodeVersion = (process?.versions?.node || "").replace(/^v/, "") || null;
149
171
  const nodeMajorVersion = Number(nodeVersion?.split(".")[0]) || null;
150
172
 
151
173
  //#endregion
174
+ Object.defineProperty(exports, 'environment_checks_exports', {
175
+ enumerable: true,
176
+ get: function () {
177
+ return environment_checks_exports;
178
+ }
179
+ });
152
180
  exports.hasTTY = hasTTY;
153
181
  exports.isColorSupported = isColorSupported;
154
182
  exports.isDebug = isDebug;
@@ -1,6 +1,28 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
1
2
  import { isCI } from "./ci-checks.mjs";
2
3
 
3
4
  //#region src/environment-checks.ts
5
+ var environment_checks_exports = /* @__PURE__ */ __exportAll({
6
+ hasTTY: () => hasTTY,
7
+ isColorSupported: () => isColorSupported,
8
+ isDebug: () => isDebug,
9
+ isDevelopment: () => isDevelopment,
10
+ isDevelopmentMode: () => isDevelopmentMode,
11
+ isHyperlinkSupported: () => isHyperlinkSupported,
12
+ isLinux: () => isLinux,
13
+ isMacOS: () => isMacOS,
14
+ isMinimal: () => isMinimal,
15
+ isProduction: () => isProduction,
16
+ isProductionMode: () => isProductionMode,
17
+ isStaging: () => isStaging,
18
+ isTest: () => isTest,
19
+ isTestMode: () => isTestMode,
20
+ isWindows: () => isWindows,
21
+ nodeMajorVersion: () => nodeMajorVersion,
22
+ nodeVersion: () => nodeVersion,
23
+ platform: () => platform,
24
+ toMode: () => toMode
25
+ });
4
26
  /** Value of process.platform */
5
27
  const platform = process?.platform || "";
6
28
  /** Detect if stdout.TTY is available */
@@ -148,5 +170,5 @@ const nodeVersion = (process?.versions?.node || "").replace(/^v/, "") || null;
148
170
  const nodeMajorVersion = Number(nodeVersion?.split(".")[0]) || null;
149
171
 
150
172
  //#endregion
151
- export { hasTTY, isColorSupported, isDebug, isDevelopment, isDevelopmentMode, isHyperlinkSupported, isLinux, isMacOS, isMinimal, isProduction, isProductionMode, isStaging, isTest, isTestMode, isWindows, nodeMajorVersion, nodeVersion, platform, toMode };
173
+ export { environment_checks_exports, hasTTY, isColorSupported, isDebug, isDevelopment, isDevelopmentMode, isHyperlinkSupported, isLinux, isMacOS, isMinimal, isProduction, isProductionMode, isStaging, isTest, isTestMode, isWindows, nodeMajorVersion, nodeVersion, platform, toMode };
152
174
  //# sourceMappingURL=environment-checks.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"environment-checks.mjs","names":[],"sources":["../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,MAAc;AAC7C,QAAO;EACL;EACA;EACA;EAEA;EAEA;EACA;EACD,CAAC,SAAS,MAAM,aAAa,EAAE,QAAQ,YAAY,GAAG,CAAC;;;AAI1D,MAAa,eAAe,iBAAiB,KAAK;;;;;;;AAQlD,SAAgB,WAAW,MAAc;AACvC,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACD,CAAC,SAAS,MAAM,aAAa,EAAE,QAAQ,YAAY,GAAG,CAAC;;;AAI1D,MAAa,SACX,WAAW,KAAK,IAAI,aAAa,QAAQ,QAAQ,IAAI,KAAK;;;;;;;AAQ5D,SAAgB,kBAAkB,MAAc;AAC9C,QAAO;EAAC;EAAO;EAAe;EAAO;EAAc,CAAC,SAClD,MAAM,aAAa,EAAE,QAAQ,YAAY,GAAG,CAC7C;;;AAIH,MAAa,gBAAgB,kBAAkB,KAAK,IAAI;;;;;;;AAQxD,SAAgB,OAAO,MAAqD;AAC1E,KAAI,iBAAiB,KAAK,CACxB,QAAO;UACE,WAAW,KAAK,CACzB,QAAO;UACE,kBAAkB,KAAK,CAChC,QAAO;AAGT,QAAO;;;AAIT,MAAa,YACX,QAAQ,QAAQ,IAAI,QAAQ,IAAI,MAAM,IAAI,UAAU,CAAC;;AAGvD,MAA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AAQ;GAExD,KAAK,UACH,QAAO,QAAQ,UAAU,UAAa,QAAQ,SAAS;GAEzD,KAAK;AAEH,QAAI,QAAQ,IAAI,gBACd,QAAO;AAGT,WACE,QAAQ,UAAU,UAClB,QAAQ,UAAU,WACjB,QAAQ,QAAQ,KAAM,QAAQ,UAAU,KAAK,QAAQ,SAAS;GAGnE,KAAK,UACH,QAAO;;;AAKb,KAAI,QAAQ,IAAI,aAAa;AAE3B,MAAI,QAAQ,IAAI,gBAAgB,SAC9B,QAAO;EAGT,MAAM,UAAU,aAAa,QAAQ,IAAI,YAAY;AAErD,SACG,QAAQ,UAAU,UAAa,QAAQ,QAAQ,KAC/C,QAAQ,UAAU,UAAa,QAAQ,SAAS;;AAIrD,KAAI,QAAQ,IAAI,SAAS,YACvB,QAAO;AAGT,QAAO;;;AAIT,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":["../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,MAAc;AAC7C,QAAO;EACL;EACA;EACA;EAEA;EAEA;EACA;EACD,CAAC,SAAS,MAAM,aAAa,EAAE,QAAQ,YAAY,GAAG,CAAC;;;AAI1D,MAAa,eAAe,iBAAiB,KA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,OAAO,aAAa,MAAM,IAAI,CAAC,GAAG,IAAI"}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_environment_checks = require('./environment-checks.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/environment-checks.test.ts
6
+ (0, vitest.describe)("environment-checks.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_environment_checks.environment_checks_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_environment_checks.environment_checks_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,14 @@
1
+ import { environment_checks_exports } from "./environment-checks.mjs";
2
+ import { describe, expect, it } from "vitest";
3
+
4
+ //#region src/environment-checks.test.ts
5
+ describe("environment-checks.ts exports", () => {
6
+ it("loads module exports", () => {
7
+ expect(environment_checks_exports).toBeDefined();
8
+ expect(typeof environment_checks_exports).toBe("object");
9
+ });
10
+ });
11
+
12
+ //#endregion
13
+ export { };
14
+ //# sourceMappingURL=environment-checks.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-checks.test.mjs","names":["moduleExports"],"sources":["../src/environment-checks.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./environment-checks.ts\";\n\ndescribe(\"environment-checks.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,uCAAuC;AAC9C,IAAG,8BAA8B;AAC/B,SAAOA,2BAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,2BAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
@@ -8,6 +8,7 @@ let node_path = require("node:path");
8
8
  node_path = require_runtime.__toESM(node_path, 1);
9
9
 
10
10
  //#region src/get-env-paths.ts
11
+ var get_env_paths_exports = /* @__PURE__ */ require_runtime.__exportAll({ getEnvPaths: () => getEnvPaths });
11
12
  const homedir = node_os.default.homedir();
12
13
  const tmpdir = node_os.default.tmpdir();
13
14
  const macos = (orgId) => {
@@ -85,4 +86,10 @@ function getEnvPaths(options = {}) {
85
86
  }
86
87
 
87
88
  //#endregion
88
- exports.getEnvPaths = getEnvPaths;
89
+ exports.getEnvPaths = getEnvPaths;
90
+ Object.defineProperty(exports, 'get_env_paths_exports', {
91
+ enumerable: true,
92
+ get: function () {
93
+ return get_env_paths_exports;
94
+ }
95
+ });
@@ -1,9 +1,11 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
1
2
  import { joinPaths } from "@stryke/path/join-paths";
2
3
  import { titleCase } from "@stryke/string-format/title-case";
3
4
  import os from "node:os";
4
5
  import path from "node:path";
5
6
 
6
7
  //#region src/get-env-paths.ts
8
+ var get_env_paths_exports = /* @__PURE__ */ __exportAll({ getEnvPaths: () => getEnvPaths });
7
9
  const homedir = os.homedir();
8
10
  const tmpdir = os.tmpdir();
9
11
  const macos = (orgId) => {
@@ -81,5 +83,5 @@ function getEnvPaths(options = {}) {
81
83
  }
82
84
 
83
85
  //#endregion
84
- export { getEnvPaths };
86
+ export { getEnvPaths, get_env_paths_exports };
85
87
  //# sourceMappingURL=get-env-paths.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-env-paths.mjs","names":[],"sources":["../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;AAsD1B,MAAM,SAAS,UAA4B;CACzC,MAAM,UAAU,UAAU,SAAS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S;AAC7B,KAAI,CAAC,MACH,OAAM,IAAI,MACR,6DACD;AAGH,KAAI,QAAQ,OAEV,UAAS,IAAI,OAAO,QAAQ,WAAW,WAAW,QAAQ,SAAS;CAGrE,IAAI,SAAS,EAAE;AAEf,KAAI,QAAQ,aAAa,SACvB,UAAS,MAAM,MAAM;UACZ,QAAQ,aAAa,QAC9B,UAAS,QAAQ,MAAM;KAEvB,UAAS,MAAM,MAAM;AAGvB,KAAI,QAAQ,IAAI,eACd,QAAO,OAAO,QAAQ,IAAI;UACjB,QAAQ,IAAI,iBACrB,QAAO,SAAS,QAAQ,IAAI;UACnB,QAAQ,IAAI,gBACrB,QAAO,QAAQ,QAAQ,IAAI;UAClB,QAAQ,IAAI,cACrB,QAAO,MAAM,QAAQ,IAAI;UAChB,QAAQ,IAAI,eACrB,QAAO,OAAO,QAAQ,IAAI;AAG5B,KAAI,QAAQ,eAAe;AACzB,SAAO,UAAU,UACf,QAAQ,eACR,gBACA,UACA,MACD;AACD,SAAO,SAAS,UAAU,QAAQ,eAAe,OAAO,MAAM;AAC9D,SAAO,QAAQ,UAAU,OAAO,MAAM,OAAO;AAC7C,SAAO,WAAW,UAAU,QAAQ,eAAe,WAAW,MAAM;;AAGtE,QAAO,OAAO,KAAK,OAAO,CAAC,QAAQ,KAAK,QAAQ;AAC9C,MAAI,OAAO,MAAwB;GACjC,MAAM,WAAW,OAAO;AAExB,OAAI,OACF,QAAQ,SACR,QAAQ,UAAU,QAAQ,SAC1B,QAAQ,UAAU,QAAQ,YACtB,UAAU,UAAU,QAAQ,MAAM,GAClC;AAEN,OACE,QAAQ,aACR,QAAQ,cAAc,QAAQ,SAC9B,QAAQ,cAAc,QAAQ,MAE9B,KAAI,OAAyB,UAC3B,IAAI,MACJ,QAAQ,UACT;;AAIL,SAAO;IACN,EAAE,CAAa"}
1
+ {"version":3,"file":"get-env-paths.mjs","names":[],"sources":["../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;AAsD1B,MAAM,SAAS,UAA4B;CACzC,MAAM,UAAU,UAAU,SAAS,UAAU;AAE7C,QAAO;EACL,MAAM,UAAU,SAAS,uBAAuB,MAAM;EACtD,QAAQ,UAAU,SAAS,eAAe,MAAM;EAChD,OAAO,UAAU,SAAS,UAAU,MAAM;EAC1C,KAAK,UAAU,SAAS,QAAQ,MAAM;EACtC,MAAM,UAAU,QAAQ,MAAM;EAC/B;;AAGH,MAAM,WAAW,UAA4B;CAC3C,MAAM,UACJ,QAAQ,IAAI,WAAW,UAAU,SAAS,WAAW,UAAU;CACjE,MAAM,eACJ,QAAQ,IAAI,gBAAgB,UAAU,SAAS,WAAW,QAAQ;CAEpE,MAAM,wBAAwB,UAAU,MAAM,CAAC,MAAM,CAAC,QAAQ,QAAQ,GAAG;AAEzE,QAAO;EAEL,MAAM,UAAU,cAAc,uBAAuB,OAAO;EAC5D,QAAQ,UAAU,SAAS,uBAAuB,SAAS;EAC3D,OAAO,UAAU,cAAc,SAAS,MAAM;EAC9C,KAAK,UAAU,cAAc,uBAAuB,MAAM;EAC1D,MAAM,UAAU,QAAQ,MAAM;EAC/B;;AAIH,MAAM,SAAS,UAA4B;CACzC,MAAM,WAAW,KAAK,SAAS,QAAQ;AAEvC,QAAO;EACL,MAAM,UACJ,QAAQ,IAAI,iBAAiB,UAAU,SAAS,UAAU,QAAQ,EAClE,MACD;EACD,QAAQ,UACN,QAAQ,IAAI,mBAAmB,UAAU,SAAS,UAAU,EAC5D,MACD;EACD,OAAO,UACL,QAAQ,IAAI,kBAAkB,UAAU,SAAS,SAAS,EAC1D,MACD;EAED,KAAK,U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B,UAAU,UAAU,QAAQ,MAAM,GAClC;AAEN,OACE,QAAQ,aACR,QAAQ,cAAc,QAAQ,SAC9B,QAAQ,cAAc,QAAQ,MAE9B,KAAI,OAAyB,UAC3B,IAAI,MACJ,QAAQ,UACT;;AAIL,SAAO;IACN,EAAE,CAAa"}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_get_env_paths = require('./get-env-paths.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/get-env-paths.test.ts
6
+ (0, vitest.describe)("get-env-paths.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_get_env_paths.get_env_paths_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_get_env_paths.get_env_paths_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,14 @@
1
+ import { get_env_paths_exports } from "./get-env-paths.mjs";
2
+ import { describe, expect, it } from "vitest";
3
+
4
+ //#region src/get-env-paths.test.ts
5
+ describe("get-env-paths.ts exports", () => {
6
+ it("loads module exports", () => {
7
+ expect(get_env_paths_exports).toBeDefined();
8
+ expect(typeof get_env_paths_exports).toBe("object");
9
+ });
10
+ });
11
+
12
+ //#endregion
13
+ export { };
14
+ //# sourceMappingURL=get-env-paths.test.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-env-paths.test.mjs","names":["moduleExports"],"sources":["../src/get-env-paths.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./get-env-paths.ts\";\n\ndescribe(\"get-env-paths.ts exports\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n});\n"],"mappings":";;;;AAGA,SAAS,kCAAkC;AACzC,IAAG,8BAA8B;AAC/B,SAAOA,sBAAc,CAAC,aAAa;AACnC,SAAO,OAAOA,sBAAc,CAAC,KAAK,SAAS;GAC3C;EACF"}
package/dist/index.cjs CHANGED
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
3
  const require_ci_checks = require('./ci-checks.cjs');
3
4
  const require_environment_checks = require('./environment-checks.cjs');
4
5
  const require_get_env_paths = require('./get-env-paths.cjs');
@@ -7,6 +8,52 @@ const require_load_env = require('./load-env.cjs');
7
8
  const require_providers = require('./providers.cjs');
8
9
  const require_runtime_checks = require('./runtime-checks.cjs');
9
10
 
11
+ //#region src/index.ts
12
+ var src_exports = /* @__PURE__ */ require_runtime.__exportAll({
13
+ ENV_PREFIXES: () => require_types.ENV_PREFIXES,
14
+ getEnvFilesForMode: () => require_load_env.getEnvFilesForMode,
15
+ getEnvPaths: () => require_get_env_paths.getEnvPaths,
16
+ hasTTY: () => require_environment_checks.hasTTY,
17
+ isBun: () => require_runtime_checks.isBun,
18
+ isCI: () => require_ci_checks.isCI,
19
+ isColorSupported: () => require_environment_checks.isColorSupported,
20
+ isDebug: () => require_environment_checks.isDebug,
21
+ isDeno: () => require_runtime_checks.isDeno,
22
+ isDevelopment: () => require_environment_checks.isDevelopment,
23
+ isDevelopmentMode: () => require_environment_checks.isDevelopmentMode,
24
+ isEdgeLight: () => require_runtime_checks.isEdgeLight,
25
+ isFastly: () => require_runtime_checks.isFastly,
26
+ isHyperlinkSupported: () => require_environment_checks.isHyperlinkSupported,
27
+ isInteractive: () => require_ci_checks.isInteractive,
28
+ isLinux: () => require_environment_checks.isLinux,
29
+ isMacOS: () => require_environment_checks.isMacOS,
30
+ isMinimal: () => require_environment_checks.isMinimal,
31
+ isNetlify: () => require_runtime_checks.isNetlify,
32
+ isNode: () => require_runtime_checks.isNode,
33
+ isProduction: () => require_environment_checks.isProduction,
34
+ isProductionMode: () => require_environment_checks.isProductionMode,
35
+ isRuntimeClient: () => require_runtime_checks.isRuntimeClient,
36
+ isRuntimeServer: () => require_runtime_checks.isRuntimeServer,
37
+ isStaging: () => require_environment_checks.isStaging,
38
+ isTest: () => require_environment_checks.isTest,
39
+ isTestMode: () => require_environment_checks.isTestMode,
40
+ isWindows: () => require_environment_checks.isWindows,
41
+ isWorkerd: () => require_runtime_checks.isWorkerd,
42
+ loadClientEnv: () => require_load_env.loadClientEnv,
43
+ loadEnv: () => require_load_env.loadEnv,
44
+ loadEnvFile: () => require_load_env.loadEnvFile,
45
+ loadServerEnv: () => require_load_env.loadServerEnv,
46
+ nodeMajorVersion: () => require_environment_checks.nodeMajorVersion,
47
+ nodeVersion: () => require_environment_checks.nodeVersion,
48
+ platform: () => require_environment_checks.platform,
49
+ provider: () => require_providers.provider,
50
+ providerInfo: () => require_providers.providerInfo,
51
+ runtime: () => require_runtime_checks.runtime,
52
+ runtimeInfo: () => require_runtime_checks.runtimeInfo,
53
+ toMode: () => require_environment_checks.toMode
54
+ });
55
+
56
+ //#endregion
10
57
  exports.ENV_PREFIXES = require_types.ENV_PREFIXES;
11
58
  exports.getEnvFilesForMode = require_load_env.getEnvFilesForMode;
12
59
  exports.getEnvPaths = require_get_env_paths.getEnvPaths;
@@ -47,4 +94,10 @@ exports.provider = require_providers.provider;
47
94
  exports.providerInfo = require_providers.providerInfo;
48
95
  exports.runtime = require_runtime_checks.runtime;
49
96
  exports.runtimeInfo = require_runtime_checks.runtimeInfo;
97
+ Object.defineProperty(exports, 'src_exports', {
98
+ enumerable: true,
99
+ get: function () {
100
+ return src_exports;
101
+ }
102
+ });
50
103
  exports.toMode = require_environment_checks.toMode;
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
1
2
  import { isCI, isInteractive } from "./ci-checks.mjs";
2
3
  import { hasTTY, isColorSupported, isDebug, isDevelopment, isDevelopmentMode, isHyperlinkSupported, isLinux, isMacOS, isMinimal, isProduction, isProductionMode, isStaging, isTest, isTestMode, isWindows, nodeMajorVersion, nodeVersion, platform, toMode } from "./environment-checks.mjs";
3
4
  import { getEnvPaths } from "./get-env-paths.mjs";
@@ -6,4 +7,51 @@ import { getEnvFilesForMode, loadClientEnv, loadEnv, loadEnvFile, loadServerEnv
6
7
  import { provider, providerInfo } from "./providers.mjs";
7
8
  import { isBun, isDeno, isEdgeLight, isFastly, isNetlify, isNode, isRuntimeClient, isRuntimeServer, isWorkerd, runtime, runtimeInfo } from "./runtime-checks.mjs";
8
9
 
9
- export { ENV_PREFIXES, getEnvFilesForMode, getEnvPaths, hasTTY, isBun, isCI, isColorSupported, isDebug, isDeno, isDevelopment, isDevelopmentMode, isEdgeLight, isFastly, isHyperlinkSupported, isInteractive, isLinux, isMacOS, isMinimal, isNetlify, isNode, isProduction, isProductionMode, isRuntimeClient, isRuntimeServer, isStaging, isTest, isTestMode, isWindows, isWorkerd, loadClientEnv, loadEnv, loadEnvFile, loadServerEnv, nodeMajorVersion, nodeVersion, platform, provider, providerInfo, runtime, runtimeInfo, toMode };
10
+ //#region src/index.ts
11
+ var src_exports = /* @__PURE__ */ __exportAll({
12
+ ENV_PREFIXES: () => ENV_PREFIXES,
13
+ getEnvFilesForMode: () => getEnvFilesForMode,
14
+ getEnvPaths: () => getEnvPaths,
15
+ hasTTY: () => hasTTY,
16
+ isBun: () => isBun,
17
+ isCI: () => isCI,
18
+ isColorSupported: () => isColorSupported,
19
+ isDebug: () => isDebug,
20
+ isDeno: () => isDeno,
21
+ isDevelopment: () => isDevelopment,
22
+ isDevelopmentMode: () => isDevelopmentMode,
23
+ isEdgeLight: () => isEdgeLight,
24
+ isFastly: () => isFastly,
25
+ isHyperlinkSupported: () => isHyperlinkSupported,
26
+ isInteractive: () => isInteractive,
27
+ isLinux: () => isLinux,
28
+ isMacOS: () => isMacOS,
29
+ isMinimal: () => isMinimal,
30
+ isNetlify: () => isNetlify,
31
+ isNode: () => isNode,
32
+ isProduction: () => isProduction,
33
+ isProductionMode: () => isProductionMode,
34
+ isRuntimeClient: () => isRuntimeClient,
35
+ isRuntimeServer: () => isRuntimeServer,
36
+ isStaging: () => isStaging,
37
+ isTest: () => isTest,
38
+ isTestMode: () => isTestMode,
39
+ isWindows: () => isWindows,
40
+ isWorkerd: () => isWorkerd,
41
+ loadClientEnv: () => loadClientEnv,
42
+ loadEnv: () => loadEnv,
43
+ loadEnvFile: () => loadEnvFile,
44
+ loadServerEnv: () => loadServerEnv,
45
+ nodeMajorVersion: () => nodeMajorVersion,
46
+ nodeVersion: () => nodeVersion,
47
+ platform: () => platform,
48
+ provider: () => provider,
49
+ providerInfo: () => providerInfo,
50
+ runtime: () => runtime,
51
+ runtimeInfo: () => runtimeInfo,
52
+ toMode: () => toMode
53
+ });
54
+
55
+ //#endregion
56
+ export { ENV_PREFIXES, getEnvFilesForMode, getEnvPaths, hasTTY, isBun, isCI, isColorSupported, isDebug, isDeno, isDevelopment, isDevelopmentMode, isEdgeLight, isFastly, isHyperlinkSupported, isInteractive, isLinux, isMacOS, isMinimal, isNetlify, isNode, isProduction, isProductionMode, isRuntimeClient, isRuntimeServer, isStaging, isTest, isTestMode, isWindows, isWorkerd, loadClientEnv, loadEnv, loadEnvFile, loadServerEnv, nodeMajorVersion, nodeVersion, platform, provider, providerInfo, runtime, runtimeInfo, src_exports, toMode };
57
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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/**\n * The env library used by Storm Software for building NodeJS applications.\n *\n * @remarks\n * A package containing utility functions to handle environment specific processes\n *\n * @packageDocumentation\n */\n\nexport * from \"./ci-checks\";\nexport * from \"./environment-checks\";\nexport * from \"./get-env-paths\";\nexport * from \"./load-env\";\nexport * from \"./providers\";\nexport * from \"./runtime-checks\";\nexport * from \"./types\";\n"],"mappings":""}
@@ -0,0 +1,13 @@
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_index = require('./index.cjs');
3
+ let vitest = require("vitest");
4
+
5
+ //#region src/index.test.ts
6
+ (0, vitest.describe)("index.ts exports", () => {
7
+ (0, vitest.it)("loads module exports", () => {
8
+ (0, vitest.expect)(require_index.src_exports).toBeDefined();
9
+ (0, vitest.expect)(typeof require_index.src_exports).toBe("object");
10
+ });
11
+ });
12
+
13
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };