@stacksjs/config 0.42.2 → 0.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,9 +21,9 @@ pnpm i -D @stacksjs/config
21
21
  Now, you can use it in your project:
22
22
 
23
23
  ```js
24
- import * as config from '@stacksjs/config'
25
- // or
26
24
  import { app, deploy, docs, git, hashing, library, services, ui } from '@stacksjs/config'
25
+
26
+ console.log(app)
27
27
  ```
28
28
 
29
29
  Learn more in the docs.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
- import { CliOptions, AppOptions, DeployOptions, DocsConfig, GitOptions, HashingOptions, LibraryOptions, UiOptions } from '@stacksjs/types';
1
+ import { CliOptions, AppOptions, DebugOptions, DeployOptions, DocsConfig, GitOptions, HashingOptions, LibraryOptions, SearchEngineOptions, UiOptions } from '@stacksjs/types';
2
2
 
3
+ type Config = 'app' | 'cache' | 'database' | 'debug' | 'deploy' | 'docs' | 'git' | 'hashing' | 'library' | 'notification' | 'searchEngine' | 'services' | 'storage' | 'ui';
4
+ declare function config(key?: Config, fallback?: any): any;
5
+ declare function env(key: string, fallback: any): any;
3
6
  /**
4
7
  * Determines the level of debugging.
5
8
  * @param options
@@ -7,7 +10,7 @@ import { CliOptions, AppOptions, DeployOptions, DocsConfig, GitOptions, HashingO
7
10
  declare function determineDebugMode(options?: CliOptions): boolean;
8
11
 
9
12
  /**
10
- * ### Application Options
13
+ * **Application Options**
11
14
  *
12
15
  * This configuration defines all of your application options. Because Stacks is full-typed,
13
16
  * you may hover any of the options below and the definitions will be provided. In case
@@ -16,7 +19,63 @@ declare function determineDebugMode(options?: CliOptions): boolean;
16
19
  declare const app: AppOptions;
17
20
 
18
21
  /**
19
- * ### Deployment Options
22
+ * **Cache Options**
23
+ *
24
+ * This configuration defines all of your cache options. Because Stacks is full-typed,
25
+ * you may hover any of the options below and the definitions will be provided. In case
26
+ * you have any questions, feel free to reach out via Discord or GitHub Discussions.
27
+ */
28
+ declare const cache: {
29
+ default: any;
30
+ redis: {
31
+ driver: string;
32
+ connection: string;
33
+ host: any;
34
+ port: any;
35
+ };
36
+ memcached: {
37
+ driver: string;
38
+ persistent_id: any;
39
+ sasl: any[];
40
+ options: {};
41
+ servers: {
42
+ host: any;
43
+ port: any;
44
+ weight: number;
45
+ }[];
46
+ };
47
+ dynamodb: {
48
+ driver: string;
49
+ key: any;
50
+ secret: any;
51
+ region: any;
52
+ table: any;
53
+ endpoint: any;
54
+ };
55
+ };
56
+
57
+ /**
58
+ * **Database Options**
59
+ *
60
+ * This configuration defines all of your database options. Because Stacks is full-typed,
61
+ * you may hover any of the options below and the definitions will be provided. In case
62
+ * you have any questions, feel free to reach out via Discord or GitHub Discussions.
63
+ */
64
+ declare const database: {
65
+ driver: string;
66
+ };
67
+
68
+ /**
69
+ * **Debug Options**
70
+ *
71
+ * This configuration defines all of your database options. Because Stacks is full-typed,
72
+ * you may hover any of the options below and the definitions will be provided. In case
73
+ * you have any questions, feel free to reach out via Discord or GitHub Discussions.
74
+ */
75
+ declare const debug: DebugOptions;
76
+
77
+ /**
78
+ * **Deployment Options**
20
79
  *
21
80
  * This configuration defines all of your deploy options. Because Stacks is full-typed,
22
81
  * you may hover any of the options below and the definitions will be provided. In case
@@ -25,7 +84,7 @@ declare const app: AppOptions;
25
84
  declare const deploy: DeployOptions;
26
85
 
27
86
  /**
28
- * ### Documentation Options
87
+ * **Documentation Options**
29
88
  *
30
89
  * This configuration defines all of your documentation options. Because Stacks is full-typed,
31
90
  * you may hover any of the options below and the definitions will be provided. In case
@@ -40,7 +99,7 @@ declare namespace docs {
40
99
  }
41
100
 
42
101
  /**
43
- * ### Git Options
102
+ * **Git Options**
44
103
  *
45
104
  * This configuration defines all of your git options. Because Stacks is full-typed, you may
46
105
  * hover any of the options below and the definitions will be provided. In case you
@@ -51,7 +110,7 @@ declare const git: GitOptions;
51
110
  declare const hashing: HashingOptions;
52
111
 
53
112
  /**
54
- * ### Library Options
113
+ * **Library Options**
55
114
  *
56
115
  * This configuration defines all of your library options. Because Stacks is full-typed, you
57
116
  * may hover any of the options below and the definitions will be provided. In case you
@@ -60,7 +119,125 @@ declare const hashing: HashingOptions;
60
119
  declare const library: LibraryOptions;
61
120
 
62
121
  /**
63
- * ### Services
122
+ * **Notification Options**
123
+ *
124
+ * This configuration defines all of your notification options. Because Stacks is full-typed,
125
+ * you may hover any of the options below and the definitions will be provided. In case
126
+ * you have any questions, feel free to reach out via Discord or GitHub Discussions.
127
+ */
128
+ declare const notification: {
129
+ email: {
130
+ sendgrid: {
131
+ key: any;
132
+ from: any;
133
+ senderName: any;
134
+ };
135
+ emailjs: {
136
+ from: any;
137
+ host: any;
138
+ user: any;
139
+ password: any;
140
+ port: any;
141
+ secure: any;
142
+ };
143
+ mailgun: {
144
+ key: any;
145
+ domain: any;
146
+ username: any;
147
+ from: any;
148
+ };
149
+ mailjet: {
150
+ key: any;
151
+ secret: any;
152
+ from: any;
153
+ };
154
+ mandrill: {
155
+ key: any;
156
+ from: any;
157
+ };
158
+ netcore: {
159
+ key: any;
160
+ from: any;
161
+ };
162
+ nodemailer: {
163
+ from: any;
164
+ host: any;
165
+ user: any;
166
+ password: any;
167
+ port: any;
168
+ secure: any;
169
+ };
170
+ postmark: {
171
+ key: any;
172
+ from: any;
173
+ };
174
+ ses: {
175
+ region: any;
176
+ key: any;
177
+ secret: any;
178
+ from: any;
179
+ };
180
+ };
181
+ sms: {
182
+ twilio: {
183
+ sid: any;
184
+ authToken: any;
185
+ from: any;
186
+ };
187
+ nexmo: {
188
+ key: any;
189
+ secret: any;
190
+ from: any;
191
+ };
192
+ gupshup: {
193
+ user: any;
194
+ password: any;
195
+ };
196
+ plivo: {
197
+ sid: any;
198
+ authToken: any;
199
+ from: any;
200
+ };
201
+ sms77: {
202
+ key: any;
203
+ from: any;
204
+ };
205
+ sns: {
206
+ region: any;
207
+ key: any;
208
+ secret: any;
209
+ };
210
+ telnyx: {
211
+ key: any;
212
+ messageProfileId: any;
213
+ from: any;
214
+ };
215
+ termii: {
216
+ key: any;
217
+ from: any;
218
+ };
219
+ };
220
+ chat: {
221
+ discord: {};
222
+ slack: {
223
+ appId: any;
224
+ clientID: any;
225
+ secret: any;
226
+ };
227
+ };
228
+ };
229
+
230
+ /**
231
+ * **Search Engine Options**
232
+ *
233
+ * This configuration defines all of your search engine options. Because Stacks is full-typed,
234
+ * you may hover any of the options below and the definitions will be provided. In case
235
+ * you have any questions, feel free to reach out via Discord or GitHub Discussions.
236
+ */
237
+ declare const searchEngine: SearchEngineOptions;
238
+
239
+ /**
240
+ * **Services**
64
241
  *
65
242
  * This configuration defines all of your services. Because Stacks is full-typed, you may
66
243
  * hover any of the options below and the definitions will be provided. In case you
@@ -96,48 +273,23 @@ declare const services: {
96
273
  };
97
274
 
98
275
  /**
99
- * ### UI Engine Options
276
+ * **Database Options**
100
277
  *
101
- * This configuration defines all of your UI Engine options. Because Stacks is full-typed, you
102
- * may hover any of the options below and the definitions will be provided. In case you
103
- * have any questions, feel free to reach out via Discord or GitHub Discussions.
278
+ * This configuration defines all of your database options. Because Stacks is full-typed,
279
+ * you may hover any of the options below and the definitions will be provided. In case
280
+ * you have any questions, feel free to reach out via Discord or GitHub Discussions.
104
281
  */
105
- declare const ui: UiOptions;
282
+ declare const storage: {
283
+ driver: string;
284
+ };
106
285
 
107
286
  /**
108
- * ### Cache Options
287
+ * **UI Engine Options**
109
288
  *
110
- * This configuration defines all of your cache options. Because Stacks is full-typed,
111
- * you may hover any of the options below and the definitions will be provided. In case
112
- * you have any questions, feel free to reach out via Discord or GitHub Discussions.
289
+ * This configuration defines all of your UI Engine options. Because Stacks is full-typed, you
290
+ * may hover any of the options below and the definitions will be provided. In case you
291
+ * have any questions, feel free to reach out via Discord or GitHub Discussions.
113
292
  */
114
- declare const cache: {
115
- default: any;
116
- redis: {
117
- driver: string;
118
- connection: string;
119
- host: any;
120
- port: any;
121
- };
122
- memcached: {
123
- driver: string;
124
- persistent_id: any;
125
- sasl: any[];
126
- options: {};
127
- servers: {
128
- host: any;
129
- port: any;
130
- weight: number;
131
- }[];
132
- };
133
- dynamodb: {
134
- driver: string;
135
- key: any;
136
- secret: any;
137
- region: any;
138
- table: any;
139
- endpoint: any;
140
- };
141
- };
293
+ declare const ui: UiOptions;
142
294
 
143
- export { app, cache, deploy, determineDebugMode, docs, git, hashing, library, services, ui };
295
+ export { app, cache, config, database, debug, deploy, determineDebugMode, docs, env, git, hashing, library, notification, searchEngine, services, storage, ui };
package/dist/index.mjs CHANGED
@@ -1,6 +1,33 @@
1
- import { env } from '@stacksjs/utils';
1
+ import { env as env$1 } from '@stacksjs/utils';
2
2
  import { frameworkPath } from '@stacksjs/path';
3
3
 
4
+ const c = {
5
+ __proto__: null,
6
+ get docs () { return docs$1; },
7
+ get config () { return config; },
8
+ get env () { return env; },
9
+ get determineDebugMode () { return determineDebugMode; },
10
+ get app () { return app; },
11
+ get cache () { return cache; },
12
+ get database () { return database; },
13
+ get debug () { return debug; },
14
+ get deploy () { return deploy; },
15
+ get git () { return git; },
16
+ get hashing () { return hashing; },
17
+ get library () { return library; },
18
+ get notification () { return notification; },
19
+ get searchEngine () { return searchEngine; },
20
+ get services () { return services; },
21
+ get storage () { return storage; },
22
+ get ui () { return ui; }
23
+ };
24
+
25
+ function config(key, fallback) {
26
+ return key ? c[key] : fallback;
27
+ }
28
+ function env(key, fallback) {
29
+ return fallback;
30
+ }
4
31
  function determineDebugMode(options) {
5
32
  if (options?.debug === true)
6
33
  return true;
@@ -10,12 +37,12 @@ function determineDebugMode(options) {
10
37
  }
11
38
 
12
39
  const app = {
13
- name: env("APP_NAME", "Stacks"),
14
- env: env("APP_ENV", "local"),
15
- key: env("APP_KEY", ""),
16
- debug: env("APP_DEBUG", false),
17
- url: env("APP_URL", "https://localhost"),
18
- port: env("APP_PORT", 3333),
40
+ name: env$1("APP_NAME", "Stacks"),
41
+ env: env$1("APP_ENV", "local"),
42
+ key: env$1("APP_KEY", ""),
43
+ debug: env$1("APP_DEBUG", false),
44
+ url: env$1("APP_URL", "https://localhost"),
45
+ port: env$1("APP_PORT", 3333),
19
46
  timezone: "UTC",
20
47
  locale: "en",
21
48
  fallbackLocale: "en",
@@ -23,6 +50,49 @@ const app = {
23
50
  editor: "vscode"
24
51
  };
25
52
 
53
+ const cache = {
54
+ default: env$1("CACHE_DRIVER", "redis"),
55
+ redis: {
56
+ driver: "redis",
57
+ connection: "cache",
58
+ host: env$1("REDIS_HOST", "127.0.0.1"),
59
+ port: env$1("REDIS_PORT", "6379")
60
+ },
61
+ memcached: {
62
+ driver: "memcached",
63
+ persistent_id: env$1("MEMCACHED_PERSISTENT_ID", ""),
64
+ sasl: [
65
+ env$1("MEMCACHED_USERNAME", ""),
66
+ env$1("MEMCACHED_PASSWORD", "")
67
+ ],
68
+ options: {},
69
+ servers: [{
70
+ host: env$1("MEMCACHED_HOST", "127.0.0.1"),
71
+ port: env$1("MEMCACHED_PORT", 11211),
72
+ weight: 100
73
+ }]
74
+ },
75
+ dynamodb: {
76
+ driver: "dynamodb",
77
+ key: env$1("AWS_ACCESS_KEY_ID", ""),
78
+ secret: env$1("AWS_SECRET_ACCESS_KEY", ""),
79
+ region: env$1("AWS_DEFAULT_REGION", "us-east-1"),
80
+ table: env$1("DYNAMODB_CACHE_TABLE", "cache"),
81
+ endpoint: env$1("DYNAMODB_ENDPOINT", "")
82
+ }
83
+ };
84
+
85
+ const database = {
86
+ driver: "planetscale"
87
+ };
88
+
89
+ const debug = {
90
+ driver: "ray",
91
+ enabled: true,
92
+ host: "localhost",
93
+ port: 23517
94
+ };
95
+
26
96
  const deploy = {
27
97
  host: "netlify"
28
98
  };
@@ -271,6 +341,120 @@ const library = {
271
341
  }
272
342
  };
273
343
 
344
+ const notification = {
345
+ email: {
346
+ sendgrid: {
347
+ key: env$1("SENDGRID_API_KEY", "test-value"),
348
+ from: env$1("SENDGRID_FROM", "test-value"),
349
+ senderName: env$1("SENDGRID_SENDER_NAME", "test-value")
350
+ },
351
+ emailjs: {
352
+ from: env$1("EMAILJS_FROM_EMAIL", "test-value"),
353
+ host: env$1("EMAILJS_HOST", "test-value"),
354
+ user: env$1("EMAILJS_USERNAME", "test-value"),
355
+ password: env$1("EMAILJS_PASSWORD", "test-value"),
356
+ port: env$1("EMAILJS_PORT", 40),
357
+ secure: env$1("EMAILJS_SECURE", true)
358
+ },
359
+ mailgun: {
360
+ key: env$1("MAILGUN_API_KEY", "test-value"),
361
+ domain: env$1("MAILGUN_DOMAIN", "test-value"),
362
+ username: env$1("MAILGUN_USERNAME", "test-value"),
363
+ from: env$1("MAILGUN_FROM", "test-value")
364
+ },
365
+ mailjet: {
366
+ key: env$1("MAILJET_API_KEY", "test-value"),
367
+ secret: env$1("MAILJET_API_SECRET", "test-value"),
368
+ from: env$1("MAILJET_FROM_EMAIL", "test-value")
369
+ },
370
+ mandrill: {
371
+ key: env$1("MANDRILL_API_KEY", "test-value"),
372
+ from: env$1("MANDRILL_EMAIL", "test-value")
373
+ },
374
+ netcore: {
375
+ key: env$1("NETCORE_API_KEY", "test-value"),
376
+ from: env$1("NETCORE_FROM", "test-value")
377
+ },
378
+ nodemailer: {
379
+ from: env$1("NODEMAILER_FROM_EMAIL", "test-value"),
380
+ host: env$1("NODEMAILER_HOST", "test-value"),
381
+ user: env$1("NODEMAILER_USERNAME", "test-value"),
382
+ password: env$1("NODEMAILER_PASSWORD", "test-value"),
383
+ port: env$1("NODEMAILER_PORT", 40),
384
+ secure: env$1("NODEMAILER_SECURE", true)
385
+ },
386
+ postmark: {
387
+ key: env$1("POSTMARK_API_KEY", "test-value"),
388
+ from: env$1("POSTMARK_FROM", "test-value")
389
+ },
390
+ ses: {
391
+ region: env$1("SES_REGION", "test-value"),
392
+ key: env$1("SES_ACCESS_KEY_ID", "test-value"),
393
+ secret: env$1("SES_SECRET_ACCESS_KEY", "test-value"),
394
+ from: env$1("SES_FROM", "test-value")
395
+ }
396
+ },
397
+ sms: {
398
+ twilio: {
399
+ sid: env$1("TWILIO_ACCOUNT_SID", "test-value"),
400
+ authToken: env$1("TWILIO_AUTH_TOKEN", "test-value"),
401
+ from: env$1("TWILIO_FROM_NUMBER", "test-value")
402
+ },
403
+ nexmo: {
404
+ key: env$1("VONAGE_API_KEY", "test-value"),
405
+ secret: env$1("VONAGE_API_SECRET", "test-value"),
406
+ from: env$1("VONAGE_FROM_NUMBER", "test-value")
407
+ },
408
+ gupshup: {
409
+ user: env$1("GUPSHUP_USER_ID", "test-value"),
410
+ password: env$1("GUPSHUP_PASSWORD", "test-value")
411
+ },
412
+ plivo: {
413
+ sid: env$1("PLIVO_ACCOUNT_ID", "test-value"),
414
+ authToken: env$1("PLIVO_AUTH_TOKEN", "test-value"),
415
+ from: env$1("PLIVO_FROM_NUMBER", "test-value")
416
+ },
417
+ sms77: {
418
+ key: env$1("SMS77_API_KEY", "test-value"),
419
+ from: env$1("SMS77_FROM", "test-value")
420
+ },
421
+ sns: {
422
+ region: env$1("SNS_REGION", "test-value"),
423
+ key: env$1("SNS_ACCESS_KEY_ID", "test-value"),
424
+ secret: env$1("SNS_SECRET_ACCESS_KEY", "test-value")
425
+ },
426
+ telnyx: {
427
+ key: env$1("TELNYX_API_KEY", "test-value"),
428
+ messageProfileId: env$1("TELNYX_MESSAGE_PROFILE_ID", "test-value"),
429
+ from: env$1("TELNYX_FROM", "test-value")
430
+ },
431
+ termii: {
432
+ key: env$1("TERMII_API_KEY", "test-value"),
433
+ from: env$1("TERMII_SENDER", "test-value")
434
+ }
435
+ },
436
+ chat: {
437
+ discord: {},
438
+ slack: {
439
+ appId: env$1("SLACK_APPLICATION_ID", "test-value"),
440
+ clientID: env$1("SLACK_CLIENT_ID", "test-value"),
441
+ secret: env$1("SLACK_SECRET_KEY", "test-value")
442
+ }
443
+ }
444
+ };
445
+
446
+ const searchEngine = {
447
+ driver: "meilisearch",
448
+ meilisearch: {
449
+ host: "",
450
+ apiKey: ""
451
+ }
452
+ };
453
+
454
+ const storage = {
455
+ driver: "s3"
456
+ };
457
+
274
458
  const ui = {
275
459
  shortcuts: [
276
460
  ["btn", "inline-flex items-center px-4 py-2 ml-2 border border-transparent shadow-sm text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-pointer"]
@@ -286,36 +470,4 @@ const ui = {
286
470
  }
287
471
  };
288
472
 
289
- const cache = {
290
- default: env("CACHE_DRIVER", "redis"),
291
- redis: {
292
- driver: "redis",
293
- connection: "cache",
294
- host: env("REDIS_HOST", "127.0.0.1"),
295
- port: env("REDIS_PORT", "6379")
296
- },
297
- memcached: {
298
- driver: "memcached",
299
- persistent_id: env("MEMCACHED_PERSISTENT_ID"),
300
- sasl: [
301
- env("MEMCACHED_USERNAME", ""),
302
- env("MEMCACHED_PASSWORD", "")
303
- ],
304
- options: {},
305
- servers: [{
306
- host: env("MEMCACHED_HOST", "127.0.0.1"),
307
- port: env("MEMCACHED_PORT", 11211),
308
- weight: 100
309
- }]
310
- },
311
- dynamodb: {
312
- driver: "dynamodb",
313
- key: env("AWS_ACCESS_KEY_ID"),
314
- secret: env("AWS_SECRET_ACCESS_KEY"),
315
- region: env("AWS_DEFAULT_REGION", "us-east-1"),
316
- table: env("DYNAMODB_CACHE_TABLE", "cache"),
317
- endpoint: env("DYNAMODB_ENDPOINT")
318
- }
319
- };
320
-
321
- export { app, cache, deploy, determineDebugMode, docs$1 as docs, git, hashing, library, services, ui };
473
+ export { app, cache, config, database, debug, deploy, determineDebugMode, docs$1 as docs, env, git, hashing, library, notification, searchEngine, services, storage, ui };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/config",
3
3
  "type": "module",
4
- "version": "0.42.2",
5
- "packageManager": "pnpm@7.17.0",
4
+ "version": "0.43.1",
5
+ "packageManager": "pnpm@7.17.1",
6
6
  "description": "The Stacks configuration.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -32,16 +32,16 @@
32
32
  ],
33
33
  "engines": {
34
34
  "node": ">=v18.12.1",
35
- "pnpm": ">=7.17.0"
35
+ "pnpm": ">=7.17.1"
36
36
  },
37
37
  "peerDependencies": {
38
- "@stacksjs/utils": "0.42.2"
38
+ "@stacksjs/utils": "0.43.1"
39
39
  },
40
40
  "devDependencies": {
41
41
  "mkdist": "^1.0.0",
42
42
  "typescript": "^4.9.3",
43
43
  "unbuild": "^1.0.1",
44
- "@stacksjs/testing": "0.42.2"
44
+ "@stacksjs/testing": "0.43.1"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "unbuild",