stacks 0.46.4 → 0.47.0

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 (132) hide show
  1. package/.gitignore +4 -0
  2. package/README.md +2 -1
  3. package/buddy/README.md +2 -1
  4. package/buddy/package.json +13 -4
  5. package/buddy/src/cli.ts +37 -20
  6. package/buddy/src/commands/create.ts +13 -13
  7. package/buddy/src/commands/key.ts +12 -2
  8. package/buddy/src/index.ts +3 -0
  9. package/components/vue/package.json +1 -1
  10. package/components/web/package.json +1 -1
  11. package/core/actions/package.json +5 -4
  12. package/core/actions/src/helpers/package-json.ts +1 -1
  13. package/core/actions/src/key-generate.ts +10 -0
  14. package/core/ai/package.json +3 -3
  15. package/core/alias/package.json +3 -3
  16. package/core/arrays/package.json +3 -3
  17. package/core/auth/package.json +3 -3
  18. package/core/build/package.json +3 -3
  19. package/core/cache/package.json +4 -4
  20. package/core/chat/README.md +89 -0
  21. package/core/chat/node_modules/.bin/maizzle +17 -0
  22. package/core/chat/node_modules/.bin/mkdist +17 -0
  23. package/{buddy/node_modules/.bin/pnpm → core/chat/node_modules/.bin/tsc} +2 -2
  24. package/core/chat/node_modules/.bin/tsserver +17 -0
  25. package/core/chat/package.json +62 -0
  26. package/core/chat/src/drivers/discord.ts +15 -0
  27. package/core/chat/src/drivers/slack.ts +22 -0
  28. package/core/chat/src/index.ts +2 -0
  29. package/core/chat/tests/example.test.ts +7 -0
  30. package/core/cli/package.json +3 -3
  31. package/core/cloud/package.json +3 -3
  32. package/core/collections/package.json +3 -3
  33. package/core/config/package.json +3 -3
  34. package/core/config/src/index.ts +1 -1
  35. package/core/dashboard/package.json +3 -3
  36. package/core/database/package.json +3 -3
  37. package/core/datetime/package.json +3 -3
  38. package/core/desktop/package.json +3 -3
  39. package/core/docs/package.json +3 -3
  40. package/core/domains/package.json +3 -3
  41. package/core/drivers/package.json +3 -3
  42. package/core/email/dist/utils/template.html +8 -0
  43. package/core/email/node_modules/.bin/maizzle +17 -0
  44. package/core/email/package.json +15 -3
  45. package/core/email/src/drivers/actions/send.ts +36 -0
  46. package/core/email/src/drivers/emailjs.ts +21 -0
  47. package/core/email/src/drivers/mailgun.ts +19 -0
  48. package/core/email/src/drivers/mailjet.ts +18 -0
  49. package/core/email/src/drivers/mandrill.ts +17 -0
  50. package/core/email/src/drivers/netcore.ts +17 -0
  51. package/core/email/src/drivers/nodemailer.ts +21 -0
  52. package/core/email/src/drivers/postmark.ts +17 -0
  53. package/core/email/src/drivers/sendgrid.ts +18 -0
  54. package/core/email/src/drivers/ses.ts +19 -0
  55. package/core/email/src/index.ts +9 -1
  56. package/core/email/src/utils/config.ts +5 -0
  57. package/core/email/src/utils/template.html +8 -0
  58. package/core/error-handling/package.json +3 -3
  59. package/core/events/README.md +76 -0
  60. package/core/events/build.config.ts +15 -0
  61. package/core/events/node_modules/.bin/mkdist +17 -0
  62. package/{buddy/node_modules/.bin/pnpx → core/events/node_modules/.bin/tsc} +2 -2
  63. package/core/events/node_modules/.bin/tsserver +17 -0
  64. package/core/events/package.json +55 -0
  65. package/core/events/src/index.ts +30 -0
  66. package/core/events/tests/example.test.ts +7 -0
  67. package/core/git/package.json +3 -3
  68. package/core/health/package.json +3 -3
  69. package/core/lint/package.json +3 -3
  70. package/core/logging/package.json +3 -3
  71. package/core/modules/package.json +3 -3
  72. package/core/notifications/package.json +24 -24
  73. package/core/objects/package.json +3 -3
  74. package/core/path/package.json +3 -3
  75. package/core/path/src/index.ts +1 -0
  76. package/core/payments/package.json +3 -3
  77. package/core/push/README.md +89 -0
  78. package/core/push/node_modules/.bin/maizzle +17 -0
  79. package/core/push/node_modules/.bin/mkdist +17 -0
  80. package/core/push/node_modules/.bin/tsc +17 -0
  81. package/core/push/node_modules/.bin/tsserver +17 -0
  82. package/core/push/package.json +60 -0
  83. package/core/push/src/drivers/expo.ts +19 -0
  84. package/core/push/src/drivers/fcm.ts +19 -0
  85. package/core/push/src/index.ts +2 -0
  86. package/core/push/tests/example.test.ts +7 -0
  87. package/core/realtime/package.json +3 -3
  88. package/core/router/package.json +3 -3
  89. package/core/search-engine/package.json +4 -4
  90. package/core/security/package.json +3 -3
  91. package/core/security/src/crypt.ts +2 -2
  92. package/core/server/package.json +3 -3
  93. package/core/sms/README.md +89 -0
  94. package/core/sms/node_modules/.bin/maizzle +17 -0
  95. package/core/sms/node_modules/.bin/mkdist +17 -0
  96. package/core/sms/node_modules/.bin/tsc +17 -0
  97. package/core/sms/node_modules/.bin/tsserver +17 -0
  98. package/core/sms/package.json +68 -0
  99. package/core/sms/src/drivers/gupshup.ts +21 -0
  100. package/core/sms/src/drivers/nexmo.ts +22 -0
  101. package/core/sms/src/drivers/plivo.ts +22 -0
  102. package/core/sms/src/drivers/sms77.ts +21 -0
  103. package/core/sms/src/drivers/sns.ts +22 -0
  104. package/core/sms/src/drivers/telnyx.ts +22 -0
  105. package/core/sms/src/drivers/termii.ts +21 -0
  106. package/core/sms/src/drivers/twilio.ts +22 -0
  107. package/core/sms/src/index.ts +8 -0
  108. package/core/sms/tests/example.test.ts +7 -0
  109. package/core/storage/package.json +3 -3
  110. package/core/strings/package.json +3 -3
  111. package/core/testing/node_modules/.bin/playwright +17 -0
  112. package/core/testing/package.json +4 -3
  113. package/core/testing/src/index.ts +2 -1
  114. package/core/types/node_modules/.bin/vitepress +2 -2
  115. package/core/types/package.json +5 -5
  116. package/core/types/src/app.ts +0 -9
  117. package/core/types/src/cli.ts +1 -0
  118. package/core/types/src/debug.ts +1 -1
  119. package/core/types/src/deploy.ts +1 -1
  120. package/core/types/src/events.ts +22 -0
  121. package/core/types/src/index.ts +1 -0
  122. package/core/types/src/notifications.ts +2 -4
  123. package/core/ui/node_modules/.bin/vue-tsc +2 -2
  124. package/core/ui/package.json +4 -4
  125. package/core/utils/package.json +6 -6
  126. package/core/x-ray/package.json +3 -3
  127. package/functions/package.json +1 -1
  128. package/package.json +6 -4
  129. package/tests/feature/example.spec.ts +20 -0
  130. package/tests/unit/example.test.ts +7 -0
  131. package/tsconfig.json +2 -0
  132. package/core/actions/src/key.ts +0 -48
@@ -0,0 +1,22 @@
1
+ import { TwilioSmsProvider } from '@novu/twilio'
2
+ import { italic } from '@stacksjs/cli'
3
+ import type { SmsOptions } from '@stacksjs/types'
4
+ import { ResultAsync } from '@stacksjs/error-handling'
5
+ import { notification } from '@stacksjs/config'
6
+
7
+ const env = notification.sms.twilio
8
+
9
+ const provider = new TwilioSmsProvider({
10
+ accountSid: env.sid,
11
+ authToken: env.authToken,
12
+ from: env.from,
13
+ })
14
+
15
+ function send(options: SmsOptions) {
16
+ return ResultAsync.fromPromise(
17
+ provider.sendMessage(options),
18
+ () => new Error(`Failed to send message using provider: ${italic('Twilio')}`),
19
+ )
20
+ }
21
+
22
+ export { send as Send, send }
@@ -0,0 +1,8 @@
1
+ export * as twilio from './drivers/twilio'
2
+ export * as plivo from './drivers/plivo'
3
+ export * as nexmo from './drivers/nexmo'
4
+ export * as sms77 from './drivers/sms77'
5
+ export * as sns from './drivers/sns'
6
+ export * as gupshup from './drivers/gupshup'
7
+ export * as telnyx from './drivers/telnyx'
8
+ export * as termii from './drivers/termii'
@@ -0,0 +1,7 @@
1
+ import { assert, describe, test } from 'vitest'
2
+
3
+ describe('example test', () => {
4
+ test('assert', () => {
5
+ assert.equal(1, 1)
6
+ })
7
+ })
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/storage",
3
3
  "type": "module",
4
- "version": "0.46.4",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "The Stacks file system.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "engines": {
40
40
  "node": ">=v18.12.1",
41
- "pnpm": ">=7.19.0"
41
+ "pnpm": ">=7.20.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "mkdist -d",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/strings",
3
3
  "type": "module",
4
- "version": "0.46.4",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "The Stacks string utilities.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  ],
47
47
  "engines": {
48
48
  "node": ">=v18.12.1",
49
- "pnpm": ">=7.19.0"
49
+ "pnpm": ">=7.20.0"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "unbuild",
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="$NODE_PATH:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/@playwright+test@1.29.1/node_modules/@playwright/test/cli.js" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/@playwright+test@1.29.1/node_modules/@playwright/test/cli.js" "$@"
17
+ fi
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/testing",
3
3
  "type": "module",
4
- "version": "0.46.4",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "The Stacks way to test.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  ],
38
38
  "engines": {
39
39
  "node": ">=v18.12.1",
40
- "pnpm": ">=7.19.0"
40
+ "pnpm": ">=7.20.0"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "mkdist -d",
@@ -46,6 +46,7 @@
46
46
  "typecheck": "tsc --noEmit"
47
47
  },
48
48
  "peerDependencies": {
49
+ "@playwright/test": "^1.29.1",
49
50
  "@vitest/coverage-istanbul": "^0.26.2",
50
51
  "@vitest/ui": "^0.26.2",
51
52
  "vitest": "^0.26.2"
@@ -1 +1,2 @@
1
- export * from 'vitest'
1
+ export * as unit from 'vitest'
2
+ export * as feature from '@playwright/test'
@@ -11,7 +11,7 @@ else
11
11
  export NODE_PATH="$NODE_PATH:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vitepress@1.0.0-alpha.33_o4l5fnurgl7shvybs3txghyb5a/node_modules/vitepress/bin/vitepress.js" "$@"
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vitepress@1.0.0-alpha.33_j73j5xdbzpkigstapj6vkce2xy/node_modules/vitepress/bin/vitepress.js" "$@"
15
15
  else
16
- exec node "$basedir/../../../../../node_modules/.pnpm/vitepress@1.0.0-alpha.33_o4l5fnurgl7shvybs3txghyb5a/node_modules/vitepress/bin/vitepress.js" "$@"
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/vitepress@1.0.0-alpha.33_j73j5xdbzpkigstapj6vkce2xy/node_modules/vitepress/bin/vitepress.js" "$@"
17
17
  fi
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/types",
3
3
  "type": "module",
4
- "version": "0.46.4",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "The Stacks framework types.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "engines": {
36
36
  "node": ">=v18.12.1",
37
- "pnpm": ">=7.19.0"
37
+ "pnpm": ">=7.20.0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "mkdist -d",
@@ -43,7 +43,7 @@
43
43
  "typecheck": "tsc --noEmit"
44
44
  },
45
45
  "devDependencies": {
46
- "@mdit-vue/plugin-component": "^0.11.1",
46
+ "@mdit-vue/plugin-component": "^0.11.2",
47
47
  "@mdit-vue/plugin-frontmatter": "^0.11.1",
48
48
  "@mdit-vue/types": "^0.11.0",
49
49
  "@rollup/pluginutils": "^5.0.2",
@@ -53,7 +53,7 @@
53
53
  "@types/fs-extra": "^9.0.13",
54
54
  "@types/markdown-it-link-attributes": "^3.0.1",
55
55
  "@types/minimatch": "^5.1.2",
56
- "@types/node": "^18.11.17",
56
+ "@types/node": "^18.11.18",
57
57
  "@types/nprogress": "^0.2.0",
58
58
  "@types/pluralize": "^0.0.29",
59
59
  "@types/prompts": "^2.4.2",
@@ -128,13 +128,4 @@ export interface AppOptions {
128
128
  cipher: string
129
129
 
130
130
  // inspect: <InspectOptions>{},
131
-
132
- /**
133
- * **Font**
134
- *
135
- * Description WIP.
136
- *
137
- * @default object
138
- */
139
- font: object
140
131
  }
@@ -235,6 +235,7 @@ export const enum Action {
235
235
  TestUi = 'test-ui', // ✅
236
236
  TestCoverage = 'test-coverage', // ✅
237
237
  Typecheck = 'typecheck', // wip
238
+ KeyGenerate = 'key-generate', // wip
238
239
  }
239
240
 
240
241
  export type { CAC as CLI } from 'cac'
@@ -1,5 +1,5 @@
1
1
  export interface DebugOptions {
2
- driver: string
2
+ driver?: string
3
3
  enabled: boolean
4
4
  host: string
5
5
  port: number
@@ -7,5 +7,5 @@ export interface DeployOptions {
7
7
  * @default string 'netlify'
8
8
  * @see https://stacksjs.dev/docs/components
9
9
  */
10
- host: 'netlify' | 'vercel'
10
+ driver: 'netlify' | 'vercel'
11
11
  }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * **Events**
3
+ *
4
+ * This configuration defines all of your events. Because Stacks is full-typed, you may
5
+ * hover any of the options below and the definitions will be provided. In case you
6
+ * have any questions, feel free to reach out via Discord or GitHub Discussions.
7
+ *
8
+ * @example To fire an event, you may use any of the following approaches:
9
+ * ```ts
10
+ * useEvent('user:registered', { name: 'Chris'})
11
+ * dispatch('user:registered', { name: 'Chris'})
12
+ * ````
13
+
14
+ * @example To capture an event, you may use any of the following approaches:
15
+ * ```ts
16
+ * useListen('user:registered', (user) => console.log(user))
17
+ * listen('user:registered', (user) => console.log(user))
18
+ * ```
19
+ */
20
+ export interface Events {
21
+ [key: string]: any
22
+ }
@@ -8,6 +8,7 @@ export * from './deploy'
8
8
  export * from './debug'
9
9
  export * from './docs'
10
10
  export * from './errors'
11
+ export * from './events'
11
12
  export * from './exit-code'
12
13
  export * from './fs'
13
14
  export * from './git'
@@ -3,11 +3,9 @@ import type { IChatOptions, IEmailOptions, ISendMessageSuccessResponse, ISmsOpti
3
3
  export interface NotificationOptions {
4
4
  driver?: string
5
5
 
6
- novu: {
7
- key: string
8
- }
9
-
10
6
  email: {
7
+ purgeCSS: boolean
8
+
11
9
  sendgrid: {
12
10
  key: string
13
11
  from: string
@@ -11,7 +11,7 @@ else
11
11
  export NODE_PATH="$NODE_PATH:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
- exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vue-tsc@1.0.16_typescript@4.9.4/node_modules/vue-tsc/bin/vue-tsc.js" "$@"
14
+ exec "$basedir/node" "$basedir/../../../../../node_modules/.pnpm/vue-tsc@1.0.18_typescript@4.9.4/node_modules/vue-tsc/bin/vue-tsc.js" "$@"
15
15
  else
16
- exec node "$basedir/../../../../../node_modules/.pnpm/vue-tsc@1.0.16_typescript@4.9.4/node_modules/vue-tsc/bin/vue-tsc.js" "$@"
16
+ exec node "$basedir/../../../../../node_modules/.pnpm/vue-tsc@1.0.18_typescript@4.9.4/node_modules/vue-tsc/bin/vue-tsc.js" "$@"
17
17
  fi
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/ui",
3
3
  "type": "module",
4
- "version": "0.46.4",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "The Stacks atomic UI engine, powered by UnoCSS.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "engines": {
40
40
  "node": ">=v18.12.1",
41
- "pnpm": ">=7.19.0"
41
+ "pnpm": ">=7.20.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "mkdist -d",
@@ -56,7 +56,7 @@
56
56
  "pinia": "^2.0.28",
57
57
  "unocss": "^0.48.0",
58
58
  "vue": "^3.2.45",
59
- "vue-tsc": "^1.0.16"
59
+ "vue-tsc": "^1.0.18"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@stacksjs/testing": "workspace:*",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/utils",
3
3
  "type": "module",
4
- "version": "0.46.4",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "The Stacks helper functions.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "engines": {
40
40
  "node": ">=v18.12.1",
41
- "pnpm": ">=7.19.0"
41
+ "pnpm": ">=7.20.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "mkdist -d",
@@ -54,10 +54,10 @@
54
54
  "@stacksjs/path": "workspace:*",
55
55
  "@stacksjs/storage": "workspace:*",
56
56
  "@stacksjs/types": "workspace:*",
57
- "@vueuse/core": "^9.8.2",
57
+ "@vueuse/core": "^9.9.0",
58
58
  "@vueuse/head": "^1.0.22",
59
- "@vueuse/math": "^9.8.2",
60
- "@vueuse/shared": "^9.8.2",
59
+ "@vueuse/math": "^9.9.0",
60
+ "@vueuse/shared": "^9.9.0",
61
61
  "defu": "^6.1.1",
62
62
  "detect-indent": "^7.0.1",
63
63
  "detect-newline": "^4.0.0",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/x-ray",
3
3
  "type": "module",
4
- "version": "0.46.4",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "All you need to debug, log & analyze.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  ],
40
40
  "engines": {
41
41
  "node": ">=v18.12.1",
42
- "pnpm": ">=7.19.0"
42
+ "pnpm": ">=7.20.0"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "echo 'wip'",
@@ -2,7 +2,7 @@
2
2
  "name": "hello-world-fx",
3
3
  "type": "module",
4
4
  "version": "",
5
- "packageManager": "pnpm@7.19.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "Your function library description.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "stacks",
3
3
  "type": "module",
4
- "version": "0.46.4",
5
- "packageManager": "pnpm@7.19.0",
4
+ "version": "0.47.0",
5
+ "packageManager": "pnpm@7.20.0",
6
6
  "description": "The Stacks framework.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -61,11 +61,11 @@
61
61
  ],
62
62
  "engines": {
63
63
  "node": ">=v18.12.1",
64
- "pnpm": ">=7.19.0"
64
+ "pnpm": ">=7.20.0"
65
65
  },
66
66
  "web-types": "./web-types.json",
67
67
  "dependencies": {
68
- "@stacksjs/buddy": "0.46.4"
68
+ "@stacksjs/buddy": "0.47.0"
69
69
  },
70
70
  "scripts": {
71
71
  "buddy": "esno ./buddy/src/cli.ts",
@@ -146,6 +146,8 @@
146
146
  "types:generate": "vue-tsc --declaration --emitDeclarationOnly && esno ./core/actions/src/copy-types.ts",
147
147
  "types:fix": "esno actions/src/fix-types.ts",
148
148
  "test": "pnpm buddy test",
149
+ "test:unit": "pnpm buddy test:unit",
150
+ "test:e2e": "pnpm buddy test:e2e",
149
151
  "test:ui": "pnpm buddy test:ui",
150
152
  "test:coverage": "pnpm buddy test:coverage",
151
153
  "test:types": "vue-tsc --noEmit"
@@ -0,0 +1,20 @@
1
+ import { expect, test } from '@playwright/test'
2
+
3
+ test('homepage has title and links to intro page', async ({ page }) => {
4
+ await page.goto('https://playwright.dev/')
5
+
6
+ // Expect a title "to contain" a substring.
7
+ await expect(page).toHaveTitle(/Playwright/)
8
+
9
+ // create a locator
10
+ const getStarted = page.getByRole('link', { name: 'Get started' })
11
+
12
+ // Expect an attribute "to be strictly equal" to the value.
13
+ await expect(getStarted).toHaveAttribute('href', '/docs/intro')
14
+
15
+ // Click the get started link.
16
+ await getStarted.click()
17
+
18
+ // Expects the URL to contain intro.
19
+ await expect(page).toHaveURL(/.*intro/)
20
+ })
@@ -0,0 +1,7 @@
1
+ import { assert, describe, test } from 'vitest'
2
+
3
+ describe('example test', () => {
4
+ test('assert', () => {
5
+ assert.equal(1, 1)
6
+ })
7
+ })
package/tsconfig.json CHANGED
@@ -80,6 +80,8 @@
80
80
  "@stacksjs/storage/*": ["./core/storage/src/*"],
81
81
  "@stacksjs/strings": ["./core/strings/src/index.ts"],
82
82
  "@stacksjs/strings/*": ["./core/strings/src/*"],
83
+ "@stacksjs/testing": ["./core/testing/src/index.ts"],
84
+ "@stacksjs/testing/*": ["./core/testing/src/*"],
83
85
  "@stacksjs/types": ["./core/types/src/index.ts"],
84
86
  "@stacksjs/types/*": ["./core/types/src/*"],
85
87
  "@stacksjs/ui": ["./core/ui/src/index.ts"],
@@ -1,48 +0,0 @@
1
- import { getRandomValues } from 'node:crypto'
2
- import { log, runCommand } from '@stacksjs/cli'
3
- // import { generateAppKey } from '@stacksjs/security'
4
- import type { CliOptions as KeyOptions } from '@stacksjs/types'
5
- import { setEnvValue } from '@stacksjs/utils'
6
- import { isFile } from '@stacksjs/storage'
7
- import utf8 from 'crypto-js/enc-utf8'
8
- import base64 from 'crypto-js/enc-base64'
9
-
10
- export async function invoke(options: KeyOptions) {
11
- await generate(options)
12
- }
13
-
14
- /**
15
- * An alias of the invoke method.
16
- * @param options
17
- * @returns
18
- */
19
- export async function key(options: KeyOptions) {
20
- return invoke(options)
21
- }
22
-
23
- export async function generate(options: KeyOptions) {
24
- try {
25
- log.info('Setting random application key.')
26
-
27
- if (!isFile('.env'))
28
- await runCommand('cp .env.example .env', options)
29
- // spawn('cp .env.example .env', { stdio: debug, cwd: projectPath() })
30
-
31
- await setEnvValue('APP_KEY', await generateAppKey())
32
- log.success('Application key set')
33
-
34
- return true
35
- }
36
- catch (error) {
37
- log.error('There was an error generating your key.', error)
38
- process.exit()
39
- }
40
- }
41
-
42
- export async function generateAppKey() {
43
- const random = getRandomValues(new Uint8Array(32))
44
- const encodedWord = utf8.parse(random.toString())
45
- const key = base64.stringify(encodedWord)
46
-
47
- return `base64:${key}`
48
- }