stacks 0.47.2 → 0.48.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.
Files changed (148) hide show
  1. package/buddy/art/social.png +0 -0
  2. package/buddy/package.json +1 -1
  3. package/buddy/src/commands/make.ts +27 -12
  4. package/buddy/src/commands/test.ts +40 -2
  5. package/core/actions/package.json +2 -2
  6. package/core/actions/src/helpers/utils.ts +21 -1
  7. package/core/actions/src/make.ts +37 -6
  8. package/core/actions/src/test-coverage.ts +1 -1
  9. package/core/actions/src/test-feature.ts +5 -0
  10. package/core/actions/src/test-unit.ts +5 -0
  11. package/core/ai/package.json +1 -1
  12. package/core/alias/package.json +1 -1
  13. package/core/alias/src/index.ts +8 -0
  14. package/core/arrays/package.json +1 -1
  15. package/core/auth/package.json +1 -1
  16. package/core/build/package.json +3 -3
  17. package/core/cache/package.json +3 -3
  18. package/core/chat/README.md +33 -40
  19. package/core/chat/package.json +4 -5
  20. package/core/cli/package.json +1 -1
  21. package/core/cloud/package.json +1 -1
  22. package/core/collections/package.json +1 -1
  23. package/core/config/package.json +1 -1
  24. package/core/dashboard/package.json +1 -1
  25. package/core/database/package.json +1 -1
  26. package/core/datetime/package.json +1 -1
  27. package/core/desktop/package.json +1 -1
  28. package/core/docs/node_modules/.bin/vitepress +2 -2
  29. package/core/docs/package.json +2 -2
  30. package/core/domains/package.json +1 -1
  31. package/core/drivers/package.json +1 -1
  32. package/core/email/README.md +101 -35
  33. package/core/email/package.json +10 -2
  34. package/core/email/src/utils/config.ts +1 -1
  35. package/core/error-handling/package.json +2 -2
  36. package/core/events/package.json +1 -1
  37. package/core/git/package.json +1 -1
  38. package/core/health/package.json +1 -1
  39. package/core/lint/node_modules/.bin/eslint +2 -2
  40. package/core/lint/package.json +3 -3
  41. package/core/logging/package.json +1 -1
  42. package/core/modules/package.json +1 -1
  43. package/core/notifications/README.md +7 -2
  44. package/core/notifications/package.json +5 -1
  45. package/core/notifications/src/drivers/chat.ts +1 -0
  46. package/core/notifications/src/drivers/email.ts +1 -0
  47. package/core/notifications/src/drivers/push.ts +1 -0
  48. package/core/notifications/src/drivers/sms.ts +1 -0
  49. package/core/notifications/src/index.ts +37 -9
  50. package/core/notifications/src/utils/config.ts +2 -2
  51. package/core/notifications/tests/chat/Slack.test.ts +5 -4
  52. package/core/notifications/tests/email/Mailgun.test.ts +4 -3
  53. package/core/notifications/tests/email/Sendgrid.test.ts +3 -3
  54. package/core/notifications/tests/sms/Twilio.test.ts +3 -3
  55. package/core/objects/package.json +1 -1
  56. package/core/path/package.json +1 -1
  57. package/core/path/src/index.ts +25 -0
  58. package/core/payments/package.json +1 -1
  59. package/core/push/README.md +24 -42
  60. package/core/push/package.json +1 -1
  61. package/core/realtime/package.json +1 -1
  62. package/core/router/package.json +1 -1
  63. package/core/search-engine/package.json +1 -1
  64. package/core/security/package.json +1 -1
  65. package/core/server/package.json +1 -1
  66. package/core/sms/README.md +82 -35
  67. package/core/sms/package.json +10 -4
  68. package/core/storage/package.json +1 -1
  69. package/core/storage/src/index.ts +13 -0
  70. package/core/strings/README.md +10 -2
  71. package/core/strings/package.json +4 -2
  72. package/core/strings/src/case.ts +14 -0
  73. package/core/strings/src/index.ts +4 -97
  74. package/core/strings/src/pluralize.ts +1 -0
  75. package/core/strings/src/utils.ts +80 -0
  76. package/core/strings/src/validation.ts +182 -0
  77. package/core/tables/README.md +109 -0
  78. package/core/tables/examples/vue/App.vue +12 -0
  79. package/core/tables/examples/vue/favicon.png +0 -0
  80. package/core/tables/examples/vue/index.html +20 -0
  81. package/core/tables/examples/web/favicon.png +0 -0
  82. package/core/tables/examples/web/index.html +13 -0
  83. package/core/tables/node_modules/.bin/mkdist +17 -0
  84. package/core/tables/node_modules/.bin/tsc +17 -0
  85. package/core/tables/node_modules/.bin/tsserver +17 -0
  86. package/core/tables/node_modules/.bin/unbuild +17 -0
  87. package/core/tables/package.json +97 -0
  88. package/core/tables/src/cli/index.ts +1 -0
  89. package/core/tables/src/components/Demo.vue +89 -0
  90. package/core/tables/src/components/README.md +111 -0
  91. package/core/tables/src/components/Table.vue +342 -0
  92. package/core/tables/src/components/TableBody.vue +33 -0
  93. package/core/tables/src/components/TableCellActionItems.vue +9 -0
  94. package/core/tables/src/components/TableFilters.vue +703 -0
  95. package/core/tables/src/components/TableHead.vue +87 -0
  96. package/core/tables/src/components/TablePagination.vue +146 -0
  97. package/core/tables/src/components/TableRow.vue +78 -0
  98. package/core/tables/src/components/TableSearch.vue +38 -0
  99. package/core/tables/src/components/Tooltip.vue +10 -0
  100. package/core/tables/src/config/tables.ts +1 -0
  101. package/core/tables/src/docs/index.md +0 -0
  102. package/core/tables/src/functions/README.md +8 -0
  103. package/core/tables/src/functions/dark.ts +3 -0
  104. package/core/tables/src/functions/index.ts +2 -0
  105. package/core/tables/src/functions/table.ts +180 -0
  106. package/core/tables/tests/example.test.ts +7 -0
  107. package/core/testing/node_modules/.bin/vitest +2 -2
  108. package/core/testing/package.json +9 -6
  109. package/core/types/node_modules/.bin/vitepress +2 -2
  110. package/core/types/package.json +3 -3
  111. package/core/types/src/cli.ts +10 -2
  112. package/core/types/src/hashing.ts +15 -0
  113. package/core/types/src/index.ts +2 -0
  114. package/core/types/src/notifications.ts +1 -0
  115. package/core/types/src/reactivity.ts +3 -0
  116. package/core/types/src/tables.ts +48 -0
  117. package/core/ui/node_modules/.bin/vue-tsc +2 -2
  118. package/core/ui/package.json +2 -2
  119. package/core/utils/package.json +1 -1
  120. package/core/x-ray/package.json +1 -1
  121. package/package.json +3 -2
  122. package/tsconfig.json +8 -0
  123. package/vitest.config.ts +2 -0
  124. package/core/notifications/src/drivers/chat/discord.ts +0 -15
  125. package/core/notifications/src/drivers/chat/index.ts +0 -2
  126. package/core/notifications/src/drivers/chat/slack.ts +0 -22
  127. package/core/notifications/src/drivers/email/actions/send.ts +0 -36
  128. package/core/notifications/src/drivers/email/emailjs.ts +0 -21
  129. package/core/notifications/src/drivers/email/index.ts +0 -9
  130. package/core/notifications/src/drivers/email/mailgun.ts +0 -19
  131. package/core/notifications/src/drivers/email/mailjet.ts +0 -18
  132. package/core/notifications/src/drivers/email/mandrill.ts +0 -17
  133. package/core/notifications/src/drivers/email/netcore.ts +0 -17
  134. package/core/notifications/src/drivers/email/nodemailer.ts +0 -21
  135. package/core/notifications/src/drivers/email/postmark.ts +0 -17
  136. package/core/notifications/src/drivers/email/sendgrid.ts +0 -18
  137. package/core/notifications/src/drivers/email/ses.ts +0 -19
  138. package/core/notifications/src/drivers/push/expo.ts +0 -19
  139. package/core/notifications/src/drivers/push/fcm.ts +0 -19
  140. package/core/notifications/src/drivers/sms/gupshup.ts +0 -21
  141. package/core/notifications/src/drivers/sms/index.ts +0 -8
  142. package/core/notifications/src/drivers/sms/nexmo.ts +0 -22
  143. package/core/notifications/src/drivers/sms/plivo.ts +0 -22
  144. package/core/notifications/src/drivers/sms/sms77.ts +0 -21
  145. package/core/notifications/src/drivers/sms/sns.ts +0 -22
  146. package/core/notifications/src/drivers/sms/telnyx.ts +0 -22
  147. package/core/notifications/src/drivers/sms/termii.ts +0 -21
  148. package/core/notifications/src/drivers/sms/twilio.ts +0 -22
@@ -82,6 +82,10 @@ export function cachePath(path?: string) {
82
82
  return corePath(`cache/${path || ''}`)
83
83
  }
84
84
 
85
+ export function chatPath(path?: string) {
86
+ return corePath(`chat/${path || ''}`)
87
+ }
88
+
85
89
  export function cliPath(path?: string) {
86
90
  return corePath(`cli/${path || ''}`)
87
91
  }
@@ -126,6 +130,10 @@ export function customElementsDataPath() {
126
130
  return frameworkPath('custom-elements.json')
127
131
  }
128
132
 
133
+ export function emailPath(path?: string) {
134
+ return corePath(`email/${path || ''}`)
135
+ }
136
+
129
137
  export function errorHandlingPath(path?: string) {
130
138
  return corePath(`error-handling/${path || ''}`)
131
139
  }
@@ -222,6 +230,10 @@ export function projectPath(filePath = '') {
222
230
  return resolve(path, filePath)
223
231
  }
224
232
 
233
+ export function pushPath(path?: string) {
234
+ return corePath(`push/${path || ''}`)
235
+ }
236
+
225
237
  export function routerPath(path?: string) {
226
238
  return corePath(`router/${path || ''}`)
227
239
  }
@@ -230,6 +242,10 @@ export function searchEnginePath(path?: string) {
230
242
  return corePath(`search-engine/${path || ''}`)
231
243
  }
232
244
 
245
+ export function smsPath(path?: string) {
246
+ return corePath(`sms/${path || ''}`)
247
+ }
248
+
233
249
  export function routesPath(path?: string) {
234
250
  return projectPath(`routes/${path || ''}`)
235
251
  }
@@ -258,6 +274,10 @@ export function testingPath(path?: string) {
258
274
  return corePath(`testing/${path || ''}`)
259
275
  }
260
276
 
277
+ export function testsPath(path?: string) {
278
+ return frameworkPath(`tests/${path || ''}`)
279
+ }
280
+
261
281
  export function typesPath(path?: string) {
262
282
  return corePath(`types/${path || ''}`)
263
283
  }
@@ -288,6 +308,7 @@ export const path = {
288
308
  buildEntriesPath,
289
309
  buildPath,
290
310
  cachePath,
311
+ chatPath,
291
312
  cliPath,
292
313
  collectionsPath,
293
314
  componentsPath,
@@ -299,6 +320,7 @@ export const path = {
299
320
  docsPath,
300
321
  domainsPath,
301
322
  driversPath,
323
+ emailPath,
302
324
  errorHandlingPath,
303
325
  examplesPath,
304
326
  frameworkPath,
@@ -317,8 +339,10 @@ export const path = {
317
339
  pagesPath,
318
340
  pathPath,
319
341
  projectPath,
342
+ pushPath,
320
343
  routerPath,
321
344
  searchEnginePath,
345
+ smsPath,
322
346
  routesPath,
323
347
  scriptsPath,
324
348
  securityPath,
@@ -328,6 +352,7 @@ export const path = {
328
352
  stringsPath,
329
353
  tablesPath,
330
354
  testingPath,
355
+ testsPath,
331
356
  typesPath,
332
357
  uiPath,
333
358
  utilsPath,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/payments",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.1",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks payments package. Currently supporting Stripe.",
7
7
  "author": "Chris Breuer",
@@ -1,62 +1,36 @@
1
- # Stacks Notifications
1
+ # Stacks Chat
2
2
 
3
- wip
3
+ Stacks Push is driver system for Pushing messages through apps.
4
4
 
5
5
  ## ☘️ Features
6
6
 
7
- wip
8
-
9
- - ⚡️
10
-
11
- wip
7
+ - 📦 Push Messages
12
8
 
13
9
  ## 🤖 Usage
14
10
 
15
- wip
16
-
17
11
  ```bash
18
- pnpm i -D @stacksjs/notifications
12
+ pnpm i -D @stacksjs/push
19
13
  ```
20
14
 
21
- Now, you can use it in your project:
15
+ You may now use it in your project:
22
16
 
23
- ```js
24
- import notifications from '@stacksjs/notifications'
25
-
26
- // wip
27
- ```
28
-
29
- ## 🤖 Drivers
30
-
31
- ### Email
17
+ wip
32
18
 
33
- - Sendgrid
34
- - Mailgun
35
- - Mailjet
36
- - Netcore
37
- - Nodemailer
38
- - Post Mark
39
- - Ses
40
- - Mandrill
41
- - EmailJS
19
+ ### Drivers
42
20
 
43
- ### SMS
21
+ Drivers are configured with the following environment variables:
44
22
 
45
- - Twilio
46
- - Nexmo
47
- - Gupshup
48
- - Plivo
49
- - SMS77
50
- - SNS
51
- - Telnyx
52
- - Termii
23
+ #### Discord
53
24
 
54
- ### Chat
25
+ - None
55
26
 
56
- - Discord
57
- - Slack
27
+ #### Slack
58
28
 
59
- Learn more in the docs.
29
+ ```bash
30
+ SLACK_APPLICATION_ID=SAID123
31
+ SLACK_CLIENT_ID=SCID123
32
+ SLACK_SECRET_KEY=SSK123
33
+ ```
60
34
 
61
35
  ## 🧪 Testing
62
36
 
@@ -82,6 +56,14 @@ For casual chit-chat with others using this package:
82
56
 
83
57
  [Join the Stacks Discord Server](https://discord.ow3.org)
84
58
 
59
+ ## 🙏🏼 Credits
60
+
61
+ Many thanks to the following core technologies & people who have contributed to this package:
62
+
63
+ - [Chris Breuer](https://github.com/chrisbbreuer)
64
+ - [Novu](https://novu.co/)
65
+ - [All Contributors](../../contributors)
66
+
85
67
  ## 📄 License
86
68
 
87
69
  The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/push",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.1",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks Push integration",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/realtime",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.1",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks realtime integration.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/router",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.1",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks framework router.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/search-engine",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.1",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks search engine integrations.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/security",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.1",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks framework security.",
7
7
  "author": "Chris Breuer",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/server",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.1",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "Local development and production-ready.",
7
7
  "author": "Chris Breuer",
@@ -1,60 +1,99 @@
1
- # Stacks Notifications
1
+ # Stacks SMS
2
2
 
3
- wip
3
+ Stacks SMS is driver system for sending SMS messages.
4
4
 
5
5
  ## ☘️ Features
6
6
 
7
- wip
7
+ - 📦 Send SMS
8
8
 
9
- - ⚡️
9
+ ## 🤖 Usage
10
10
 
11
- wip
11
+ ```bash
12
+ pnpm i -D @stacksjs/sms
13
+ ```
12
14
 
13
- ## 🤖 Usage
15
+ You may now use it in your project:
16
+
17
+ ```ts
18
+ import * as sms from '@stacksjs/sms'
19
+ /* Then choose a driver. E.g for twilio */
20
+ const notification = sms.twilio
21
+
22
+ notification.send(SMSOptions)
23
+
24
+ interface SMSOptions {
25
+ to: string
26
+ content: string
27
+ from?: string
28
+ attachments?: AttachmentOptions[]
29
+ id?: string
30
+ }
31
+ ```
14
32
 
15
- wip
33
+ ### Drivers
34
+
35
+ Drivers are configured with the following environment variables:
36
+
37
+ #### Twilio
16
38
 
17
39
  ```bash
18
- pnpm i -D @stacksjs/notifications
40
+ TWILIO_ACCOUNT_SID=ACtest
41
+ TWILIO_AUTH_TOKEN=testtoken
42
+ TWILIO_FROM_NUMBER=+112345
43
+ TWILIO_TO_NUMBER=+145678
19
44
  ```
20
45
 
21
- Now, you can use it in your project:
46
+ #### Nexmo
47
+
48
+ ```bash
49
+ VONAGE_API_KEY=VN123
50
+ VONAGE_API_SECRET=testkey
51
+ VONAGE_FROM_NUMBER=+112345
52
+ ```
53
+
54
+ #### Gupshup
55
+
56
+ ```bash
57
+ GUPSHUP_USER_ID=GU123
58
+ GUPSHUP_PASSWORD=password
59
+ ```
22
60
 
23
- ```js
24
- import notifications from '@stacksjs/notifications'
61
+ #### Plivo
25
62
 
26
- // wip
63
+ ```bash
64
+ PLIVO_ACCOUNT_ID=PA123
65
+ PLIVO_AUTH_TOKEN=testtoken
66
+ PLIVO_FROM_NUMBER=+112345
27
67
  ```
28
68
 
29
- ## 🤖 Drivers
69
+ #### SMS77
30
70
 
31
- ### Email
71
+ ```bash
72
+ SMS77_API_KEY=SA123
73
+ SMS77_FROM=from@example.com
74
+ ```
32
75
 
33
- - Sendgrid
34
- - Mailgun
35
- - Mailjet
36
- - Netcore
37
- - Nodemailer
38
- - Post Mark
39
- - Ses
40
- - Mandrill
41
- - EmailJS
76
+ #### SNS
42
77
 
43
- ### SMS
78
+ ```bash
79
+ SMS77_API_KEY=SA123
80
+ SMS77_FROM=from@example.com
81
+ ```
44
82
 
45
- - Twilio
46
- - Nexmo
47
- - Gupshup
48
- - Plivo
49
- - SMS77
50
- - SNS
51
- - Telnyx
52
- - Termii
83
+ #### Telnyx
53
84
 
54
- ### Chat
85
+ ```bash
86
+ TELNYX_API_KEY=TA123
87
+ TELNYX_MESSAGE_PROFILE_ID=testprofileid
88
+ TELNYX_FROM=from@example.com
89
+ ```
90
+
91
+ #### Termii
55
92
 
56
- - Discord
57
- - Slack
93
+ ```bash
94
+ TERMII_API_KEY=TermA123
95
+ TERMII_SENDER=from@example.com
96
+ ```
58
97
 
59
98
  Learn more in the docs.
60
99
 
@@ -82,6 +121,14 @@ For casual chit-chat with others using this package:
82
121
 
83
122
  [Join the Stacks Discord Server](https://discord.ow3.org)
84
123
 
124
+ ## 🙏🏼 Credits
125
+
126
+ Many thanks to the following core technologies & people who have contributed to this package:
127
+
128
+ - [Chris Breuer](https://github.com/chrisbbreuer)
129
+ - [Novu](https://novu.co/)
130
+ - [All Contributors](../../contributors)
131
+
85
132
  ## 📄 License
86
133
 
87
134
  The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/sms",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.1",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks SMS integration. Painlessly create & manage your inboxes, templates, and send sms.",
7
7
  "author": "Chris Breuer",
@@ -19,9 +19,15 @@
19
19
  "keywords": [
20
20
  "sms",
21
21
  "ses",
22
- "aws",
23
- "maizzle",
24
- "stacks"
22
+ "stacks",
23
+ "gupshup",
24
+ "nexmo",
25
+ "plivo",
26
+ "sms77",
27
+ "sns",
28
+ "telnyx",
29
+ "termii",
30
+ "twilio"
25
31
  ],
26
32
  "main": "dist/index.mjs",
27
33
  "module": "dist/index.mjs",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/storage",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.1",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks file system.",
7
7
  "author": "Chris Breuer",
@@ -87,6 +87,7 @@ export function isFolder(path: string): boolean {
87
87
  }
88
88
  }
89
89
 
90
+
90
91
  /**
91
92
  * Determine whether a path is a file.
92
93
  */
@@ -169,6 +170,18 @@ export function doesFolderExist(path: string) {
169
170
  return fs.existsSync(path)
170
171
  }
171
172
 
173
+ export function createFolder(dir: string): Promise<void> {
174
+ return new Promise((resolve, reject) => {
175
+ fs.mkdirs(dir, (err: any) => {
176
+ if (err)
177
+ reject(err)
178
+
179
+ else
180
+ resolve()
181
+ })
182
+ })
183
+ }
184
+
172
185
  export const filesystem = {
173
186
  _dirname,
174
187
  readJsonFile,
@@ -17,9 +17,16 @@ Now, you can use it in your project:
17
17
 
18
18
  ```js
19
19
  import {
20
- addIrregularRule, addPluralRule, addSingularRule, addUncountableRule, camelCase, capitalCase, constantCase, dotCase,
20
+ // pluralize
21
+ addIrregularRule, addPluralRule, addSingularRule, addUncountableRule,
22
+
23
+ // case
24
+ camelCase, capitalCase, constantCase, dotCase,
21
25
  headerCase, isPlural, isSingular, kebabCase, noCase, paramCase, pascalCase,
22
- pathCase, plural, sentenceCase, singular, snakeCase
26
+ pathCase, plural, sentenceCase, singular, snakeCase,
27
+
28
+ // validation
29
+ isEmail, isStrongPassword, isAlphanumeric, validateUsername, isURL, isMobilePhone, isAlpha, isPostalCode, isDate, isNumeric, isBoolean, isHexColor, isHexadecimal, isBase64, isUUID, isJSON, isCreditCard, isISBN, isIP, isIPRange, isMACAddress, isLatLong, isLatitude, isLongitude, isCurrency, isDataURI, isMimeType, isJWT, isMongoId, isAscii, isBase32, isByteLength, isFQDN, isFullWidth, isHalfWidth, isHash, isHSL, isIBAN, isIdentityCard, isISIN, isISO8601, isISRC, isISSN, isISO31661Alpha2, isISO31661Alpha3
23
30
  } from '@stacksjs/strings'
24
31
 
25
32
  console.log(camelCase('hello world')) // helloWorld
@@ -58,6 +65,7 @@ Many thanks to the following core technologies & people who have contributed to
58
65
 
59
66
  - [change-case](https://www.npmjs.com/package/change-case)
60
67
  - [pluralize](https://www.npmjs.com/package/pluralize)
68
+ - [validation](https://www.npmjs.com/package/validation)
61
69
  - [Chris Breuer](https://github.com/chrisbbreuer)
62
70
  - [All Contributors](../../contributors)
63
71
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/strings",
3
3
  "type": "module",
4
- "version": "0.47.2",
4
+ "version": "0.48.1",
5
5
  "packageManager": "pnpm@7.21.0",
6
6
  "description": "The Stacks string utilities.",
7
7
  "author": "Chris Breuer",
@@ -57,8 +57,10 @@
57
57
  "peerDependencies": {
58
58
  "@stacksjs/alias": "workspace:*",
59
59
  "@types/pluralize": "^0.0.29",
60
+ "@types/validator": "^13.7.10",
60
61
  "change-case": "^4.1.2",
61
- "pluralize": "^8.0.0"
62
+ "pluralize": "^8.0.0",
63
+ "validator": "^13.7.0"
62
64
  },
63
65
  "devDependencies": {
64
66
  "@stacksjs/testing": "workspace:*",
@@ -0,0 +1,14 @@
1
+ export {
2
+ camelCase,
3
+ capitalCase,
4
+ constantCase,
5
+ dotCase,
6
+ headerCase,
7
+ noCase,
8
+ paramCase,
9
+ paramCase as kebabCase,
10
+ pascalCase,
11
+ pathCase,
12
+ sentenceCase,
13
+ snakeCase,
14
+ } from 'change-case'
@@ -1,97 +1,4 @@
1
- export { plural, singular, isPlural, isSingular, addPluralRule, addSingularRule, addIrregularRule, addUncountableRule } from 'pluralize'
2
-
3
- export {
4
- camelCase,
5
- capitalCase,
6
- constantCase,
7
- dotCase,
8
- headerCase,
9
- noCase,
10
- paramCase,
11
- paramCase as kebabCase,
12
- pascalCase,
13
- pathCase,
14
- sentenceCase,
15
- snakeCase,
16
- } from 'change-case'
17
-
18
- /**
19
- * Replace backslash to slash
20
- *
21
- * @category String
22
- */
23
- export function slash(str: string) {
24
- return str.replace(/\\/g, '/')
25
- }
26
-
27
- /**
28
- * Ensure prefix of a string
29
- *
30
- * @category String
31
- */
32
- export function ensurePrefix(prefix: string, str: string) {
33
- if (!str.startsWith(prefix))
34
- return prefix + str
35
- return str
36
- }
37
-
38
- /**
39
- * Ensure suffix of a string
40
- *
41
- * @category String
42
- */
43
- export function ensureSuffix(suffix: string, str: string) {
44
- if (!str.endsWith(suffix))
45
- return str + suffix
46
- return str
47
- }
48
-
49
- /**
50
- * Dead simple template engine, just like Python's `.format()`
51
- *
52
- * @category String
53
- * @example
54
- * ```
55
- * const result = template(
56
- * 'Hello {0}! My name is {1}.',
57
- * 'Buddy',
58
- * 'Chris'
59
- * ) // Hello Buddy! My name is Chris.
60
- * ```
61
- */
62
- export function template(str: string, ...args: any[]): string {
63
- return str.replace(/{(\d+)}/g, (match, key) => {
64
- const index = Number(key)
65
- if (Number.isNaN(index))
66
- return match
67
- return args[index]
68
- })
69
- }
70
-
71
- // port from nanoid
72
- // https://github.com/ai/nanoid
73
- const urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
74
- /**
75
- * Generate a random string
76
- * @category String
77
- */
78
- export function randomStr(size = 16, dict = urlAlphabet) {
79
- let id = ''
80
- let i = size
81
- const len = dict.length
82
- while (i--)
83
- id += dict[(Math.random() * len) | 0]
84
- return id
85
- }
86
-
87
- /**
88
- * First letter uppercase, other lowercase
89
- * @category string
90
- * @example
91
- * ```
92
- * capitalize('hello') => 'Hello'
93
- * ```
94
- */
95
- export function capitalize(str: string): string {
96
- return str[0].toUpperCase() + str.slice(1).toLowerCase()
97
- }
1
+ export * from './case'
2
+ export * from './utils'
3
+ export * from './pluralize'
4
+ export * from './validation'
@@ -0,0 +1 @@
1
+ export { plural, singular, isPlural, isSingular, addPluralRule, addSingularRule, addIrregularRule, addUncountableRule } from 'pluralize'