@stacksjs/config 0.70.148 → 0.70.149

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.
@@ -1,4 +1,5 @@
1
1
  import type { StacksConfig } from '@stacksjs/types';
2
+ export declare function userConfigUrl(name: string, cwd?: unknown): string;
2
3
  export declare const overrides: StacksConfig;
3
4
  export declare const overridesReady: Promise<StacksConfig>;
4
5
  export default overrides;
package/dist/overrides.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { resolve } from "node:path";
2
+ import { pathToFileURL } from "node:url";
1
3
  import { validateConfig } from "./validators";
2
4
  const skipConfigLoading = process.env.SKIP_CONFIG_LOADING === "true", skipConfigValidation = process.env.SKIP_CONFIG_VALIDATION === "true", OVERRIDES_KEY = Symbol.for("@stacksjs/config:overrides"), READY_KEY = Symbol.for("@stacksjs/config:overridesReady");
3
5
  function defaultsForOverrides() {
@@ -44,42 +46,47 @@ export const overrides = sharedOverrides ?? (() => {
44
46
  return created;
45
47
  })();
46
48
  const userConfigs = [
47
- ["ai", "~/config/ai"],
48
- ["analytics", "~/config/analytics"],
49
- ["app", "~/config/app"],
50
- ["auth", "~/config/auth"],
51
- ["cache", "~/config/cache"],
52
- ["cli", "~/config/cli"],
53
- ["cloud", "~/config/cloud"],
54
- ["cms", "~/config/cms"],
55
- ["commerce", "~/config/commerce"],
56
- ["dashboard", "~/config/dashboard"],
57
- ["database", "~/config/database"],
58
- ["dns", "~/config/dns"],
59
- ["email", "~/config/email"],
60
- ["errors", "~/config/errors"],
61
- ["featureFlags", "~/config/feature-flags"],
62
- ["git", "~/config/git"],
63
- ["hashing", "~/config/hashing"],
64
- ["library", "~/config/library"],
65
- ["logging", "~/config/logging"],
66
- ["marketing", "~/config/marketing"],
67
- ["monitoring", "~/config/monitoring"],
68
- ["notification", "~/config/notification"],
69
- ["payment", "~/config/payment"],
70
- ["ports", "~/config/ports"],
71
- ["queue", "~/config/queue"],
72
- ["realtime", "~/config/realtime"],
73
- ["saas", "~/config/saas"],
74
- ["searchEngine", "~/config/search-engine"],
75
- ["security", "~/config/security"],
76
- ["services", "~/config/services"],
77
- ["filesystems", "~/config/filesystems"],
78
- ["team", "~/config/team"],
79
- ["ui", "~/config/ui"]
80
- ], sharedReady = globalScope[READY_KEY];
49
+ ["ai", "ai"],
50
+ ["analytics", "analytics"],
51
+ ["app", "app"],
52
+ ["auth", "auth"],
53
+ ["cache", "cache"],
54
+ ["cli", "cli"],
55
+ ["cloud", "cloud"],
56
+ ["cms", "cms"],
57
+ ["commerce", "commerce"],
58
+ ["dashboard", "dashboard"],
59
+ ["database", "database"],
60
+ ["dns", "dns"],
61
+ ["email", "email"],
62
+ ["errors", "errors"],
63
+ ["featureFlags", "feature-flags"],
64
+ ["git", "git"],
65
+ ["hashing", "hashing"],
66
+ ["library", "library"],
67
+ ["logging", "logging"],
68
+ ["marketing", "marketing"],
69
+ ["monitoring", "monitoring"],
70
+ ["notification", "notification"],
71
+ ["payment", "payment"],
72
+ ["ports", "ports"],
73
+ ["queue", "queue"],
74
+ ["realtime", "realtime"],
75
+ ["saas", "saas"],
76
+ ["searchEngine", "search-engine"],
77
+ ["security", "security"],
78
+ ["services", "services"],
79
+ ["filesystems", "filesystems"],
80
+ ["team", "team"],
81
+ ["ui", "ui"]
82
+ ];
83
+ export function userConfigUrl(name, cwd = process.cwd()) {
84
+ return pathToFileURL(resolve(cwd, "config", `${name}.ts`)).href;
85
+ }
86
+ const sharedReady = globalScope[READY_KEY];
81
87
  export const overridesReady = sharedReady ?? (() => {
82
- const promise = skipConfigLoading ? Promise.resolve(overrides) : Promise.all(userConfigs.map(async ([key, modulePath]) => {
88
+ const promise = skipConfigLoading ? Promise.resolve(overrides) : Promise.all(userConfigs.map(async ([key, name]) => {
89
+ const modulePath = userConfigUrl(name);
83
90
  try {
84
91
  const mod = await import(modulePath);
85
92
  if (mod?.default !== void 0)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/config",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.70.148",
5
+ "version": "0.70.149",
6
6
  "description": "The Stacks config helper methods.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -53,9 +53,9 @@
53
53
  "ts-pantry": "^0.10.11"
54
54
  },
55
55
  "devDependencies": {
56
- "@stacksjs/alias": "0.70.148",
56
+ "@stacksjs/alias": "0.70.149",
57
57
  "better-dx": "^0.2.17",
58
- "@stacksjs/types": "0.70.148",
58
+ "@stacksjs/types": "0.70.149",
59
59
  "bunfig": "^0.15.11"
60
60
  }
61
61
  }