stacks 0.58.51 → 0.58.53
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/core/actions/dist/src/deploy/index.js +2 -2
- package/core/actions/dist/src/upgrade.js +1 -1
- package/core/actions/package.json +1 -1
- package/core/actions/src/build/cli.ts +1 -1
- package/core/actions/src/build/server.ts +9 -0
- package/core/actions/src/deploy/index.ts +2 -2
- package/core/actions/tsconfig.json +3 -0
- package/core/ai/dist/index.js +28 -130
- package/core/ai/package.json +3 -3
- package/core/ai/tsconfig.json +3 -0
- package/core/alias/package.json +1 -1
- package/core/alias/tsconfig.json +3 -0
- package/core/analytics/package.json +1 -1
- package/core/analytics/tsconfig.json +3 -0
- package/core/api/package.json +1 -1
- package/core/api/tsconfig.json +3 -0
- package/core/arrays/package.json +1 -1
- package/core/arrays/tsconfig.json +3 -0
- package/core/auth/package.json +1 -1
- package/core/auth/tsconfig.json +3 -0
- package/core/buddy/dist/{chunk-91084836e95161e8.js → chunk-d52e40a990b45728.js} +152 -84
- package/core/buddy/dist/cli.js +4 -1
- package/core/buddy/dist/index.js +3 -1
- package/core/buddy/package.json +1 -1
- package/core/buddy/src/cli.ts +2 -0
- package/core/buddy/src/commands/build.ts +17 -1
- package/core/buddy/src/commands/deploy.ts +2 -2
- package/core/buddy/src/commands/index.ts +1 -0
- package/core/buddy/src/commands/list.ts +39 -0
- package/core/buddy/src/commands/setup.ts +57 -1
- package/core/buddy/tsconfig.json +3 -0
- package/core/build/package.json +1 -1
- package/core/build/tsconfig.json +3 -0
- package/core/bun-create/bud/package.json +1 -1
- package/core/bun-create/buddy/package.json +1 -1
- package/core/bun-create/stack/package.json +1 -1
- package/core/bun-create/stacks/package.json +1 -1
- package/core/bun-create/stx/package.json +2 -1
- package/core/bun-plugin-yaml/package.json +1 -1
- package/core/bun-plugin-yaml/tsconfig.json +3 -0
- package/core/cache/package.json +2 -2
- package/core/cache/tsconfig.json +3 -0
- package/core/chat/package.json +8 -8
- package/core/chat/tsconfig.json +3 -0
- package/core/cli/dist/index.js +1 -1
- package/core/cli/package.json +1 -1
- package/core/cli/tsconfig.json +3 -0
- package/core/cloud/build.ts +1 -1
- package/core/cloud/deploy.ts +10 -1
- package/core/cloud/dist/index.js +167 -806
- package/core/cloud/package.json +29 -30
- package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package-lock.json +6 -6
- package/core/cloud/src/cloud/aws-sdk-layer/nodejs/package.json +2 -2
- package/core/cloud/src/cloud/cdn.ts +59 -6
- package/core/cloud/src/cloud/compute.ts +29 -19
- package/core/cloud/src/cloud/dns.ts +8 -0
- package/core/cloud/src/cloud/index.ts +8 -2
- package/core/cloud/src/cloud/queue.ts +46 -0
- package/core/cloud/src/cloud/router-layer/nodejs/package.json +1 -1
- package/core/cloud/src/cloud/security.ts +1 -1
- package/core/cloud/src/helpers.ts +13 -1
- package/core/cloud/tsconfig.json +3 -0
- package/core/collections/package.json +1 -1
- package/core/collections/tsconfig.json +3 -0
- package/core/config/dist/index.js +154 -83
- package/core/config/package.json +2 -2
- package/core/config/tsconfig.json +3 -0
- package/core/database/package.json +1 -1
- package/core/database/src/kysely-bun-worker/mitt.ts +1 -1
- package/core/database/tsconfig.json +3 -0
- package/core/datetime/package.json +1 -1
- package/core/datetime/tsconfig.json +3 -0
- package/core/desktop/package.json +1 -1
- package/core/desktop/tsconfig.json +3 -0
- package/core/development/package.json +1 -1
- package/core/development/tsconfig.json +3 -0
- package/core/dns/package.json +4 -4
- package/core/dns/tsconfig.json +3 -0
- package/core/docs/package.json +1 -1
- package/core/docs/tsconfig.json +3 -0
- package/core/email/package.json +14 -14
- package/core/email/tsconfig.json +3 -0
- package/core/enums/dist/index.js +1 -0
- package/core/enums/package.json +1 -1
- package/core/enums/src/index.ts +1 -0
- package/core/enums/tsconfig.json +3 -0
- package/core/env/package.json +1 -1
- package/core/env/tsconfig.json +3 -0
- package/core/error-handling/package.json +1 -1
- package/core/error-handling/tsconfig.json +3 -0
- package/core/eslint-config/package.json +9 -9
- package/core/eslint-config/src/configs/typescript.ts +1 -0
- package/core/eslint-config/src/factory.ts +1 -0
- package/core/events/package.json +1 -1
- package/core/events/src/index.ts +3 -6
- package/core/events/tsconfig.json +3 -0
- package/core/faker/package.json +1 -1
- package/core/faker/tsconfig.json +3 -0
- package/core/git/package.json +1 -1
- package/core/git/tsconfig.json +3 -0
- package/core/health/package.json +1 -1
- package/core/health/tsconfig.json +3 -0
- package/core/http/package.json +1 -1
- package/core/http/tsconfig.json +3 -0
- package/core/lint/package.json +3 -3
- package/core/lint/tsconfig.json +3 -0
- package/core/logging/package.json +1 -1
- package/core/logging/tsconfig.json +3 -0
- package/core/notifications/package.json +23 -23
- package/core/notifications/tsconfig.json +3 -0
- package/core/objects/package.json +1 -1
- package/core/objects/tsconfig.json +3 -0
- package/core/orm/package.json +1 -1
- package/core/orm/tsconfig.json +3 -0
- package/core/path/package.json +1 -1
- package/core/path/tsconfig.json +3 -0
- package/core/payments/dist/index.js +22 -7
- package/core/payments/package.json +2 -2
- package/core/payments/tsconfig.json +3 -0
- package/core/push/package.json +5 -5
- package/core/push/tsconfig.json +3 -0
- package/core/query-builder/package.json +1 -1
- package/core/query-builder/tsconfig.json +3 -0
- package/core/queue/package.json +1 -1
- package/core/queue/tsconfig.json +3 -0
- package/core/raycast/package.json +1 -1
- package/core/realtime/package.json +1 -1
- package/core/realtime/tsconfig.json +3 -0
- package/core/repl/package.json +1 -1
- package/core/repl/tsconfig.json +3 -0
- package/core/router/dist/index.js +2 -2
- package/core/router/package.json +1 -1
- package/core/router/src/router.ts +11 -11
- package/core/router/src/server.ts +2 -2
- package/core/router/tsconfig.json +3 -0
- package/core/scheduler/build.ts +1 -1
- package/core/scheduler/dist/index.js +682 -152
- package/core/scheduler/package.json +7 -4
- package/core/scheduler/src/constants.ts +81 -0
- package/core/scheduler/src/errors.ts +7 -0
- package/core/scheduler/src/index.ts +15 -317
- package/core/scheduler/src/job.ts +315 -0
- package/core/scheduler/src/schedule.ts +111 -0
- package/core/scheduler/src/time.ts +823 -0
- package/core/scheduler/src/types/cron.ts +98 -0
- package/core/scheduler/src/types/utils.ts +14 -0
- package/core/scheduler/src/utils.ts +19 -0
- package/core/scheduler/tests/cron.fuzz.ts +120 -0
- package/core/scheduler/tests/cron.test.ts +1241 -0
- package/core/scheduler/tests/crontime.test.ts +778 -0
- package/core/scheduler/tsconfig.json +3 -0
- package/core/search-engine/package.json +1 -1
- package/core/search-engine/tsconfig.json +3 -0
- package/core/security/package.json +1 -1
- package/core/security/tsconfig.json +3 -0
- package/core/server/package.json +1 -1
- package/core/server/tsconfig.json +3 -0
- package/core/signals/package.json +1 -1
- package/core/signals/tsconfig.json +3 -0
- package/core/slug/package.json +1 -1
- package/core/slug/tsconfig.json +3 -0
- package/core/sms/package.json +11 -11
- package/core/sms/tsconfig.json +3 -0
- package/core/storage/package.json +1 -1
- package/core/storage/tsconfig.json +3 -0
- package/core/strings/package.json +2 -2
- package/core/strings/tsconfig.json +3 -0
- package/core/tables/package.json +1 -1
- package/core/tables/tsconfig.json +3 -0
- package/core/testing/package.json +1 -1
- package/core/testing/tsconfig.json +3 -0
- package/core/tinker/package.json +1 -1
- package/core/tinker/tsconfig.json +3 -0
- package/core/tunnel/package.json +1 -1
- package/core/tunnel/tsconfig.json +3 -0
- package/core/types/package.json +3 -3
- package/core/types/src/app.ts +2 -2
- package/core/types/src/cli.ts +1 -1
- package/core/types/src/cloud.ts +5 -1
- package/core/types/src/cron-jobs.ts +1 -0
- package/core/types/src/queue.ts +3 -1
- package/core/types/tsconfig.json +3 -0
- package/core/ui/package.json +4 -4
- package/core/ui/tsconfig.json +3 -0
- package/core/utils/dist/index.js +1 -1
- package/core/utils/package.json +1 -1
- package/core/utils/src/promise.ts +2 -2
- package/core/utils/tsconfig.json +3 -0
- package/core/validation/package.json +1 -1
- package/core/validation/src/rules.ts +3 -3
- package/core/validation/tsconfig.json +3 -0
- package/core/vite/dist/index.js +1 -1
- package/core/vite/package.json +1 -1
- package/core/vite/tsconfig.json +3 -0
- package/core/whois/package.json +1 -1
- package/core/whois/tsconfig.json +3 -0
- package/core/x-ray/package.json +1 -1
- package/core/x-ray/tsconfig.json +3 -0
- package/core/zsh-buddy/README.md +6 -2
- package/core/zsh-buddy/buddy.plugin.zsh +109 -0
- package/core/zsh-buddy/package.json +1 -1
- package/ide/dictionary.txt +2 -0
- package/ide/vscode/package.json +1 -1
- package/package.json +1 -1
- package/buddy +0 -2
- package/core/actions/src/zip/api.ts +0 -22
- package/core/bud +0 -2
- package/core/cloud/buddy +0 -2
- package/core/cloud/src/cloud/package/README.md +0 -59
- package/core/cloud/src/cloud/package/package.json +0 -63
- package/core/scheduler/tests/example.test.ts +0 -5
package/core/server/package.json
CHANGED
package/core/slug/package.json
CHANGED
package/core/sms/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/sms",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.58.
|
|
4
|
+
"version": "0.58.53",
|
|
5
5
|
"description": "The Stacks SMS integration. Painlessly create & manage your inboxes, templates, and send sms.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -65,16 +65,16 @@
|
|
|
65
65
|
"@stacksjs/types": "workspace:*"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
|
-
"@novu/gupshup": "^0.
|
|
69
|
-
"@novu/nexmo": "^0.
|
|
70
|
-
"@novu/node": "^0.
|
|
71
|
-
"@novu/plivo": "^0.
|
|
72
|
-
"@novu/sms77": "^0.
|
|
73
|
-
"@novu/sns": "^0.
|
|
74
|
-
"@novu/stateless": "^0.
|
|
75
|
-
"@novu/telnyx": "^0.
|
|
76
|
-
"@novu/termii": "^0.
|
|
77
|
-
"@novu/twilio": "^0.
|
|
68
|
+
"@novu/gupshup": "^0.23.0",
|
|
69
|
+
"@novu/nexmo": "^0.23.0",
|
|
70
|
+
"@novu/node": "^0.23.0",
|
|
71
|
+
"@novu/plivo": "^0.23.0",
|
|
72
|
+
"@novu/sms77": "^0.23.0",
|
|
73
|
+
"@novu/sns": "^0.23.0",
|
|
74
|
+
"@novu/stateless": "^0.23.0",
|
|
75
|
+
"@novu/telnyx": "^0.23.0",
|
|
76
|
+
"@novu/termii": "^0.23.0",
|
|
77
|
+
"@novu/twilio": "^0.23.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@stacksjs/config": "workspace:*",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/strings",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.58.
|
|
4
|
+
"version": "0.58.53",
|
|
5
5
|
"description": "The Stacks string utilities.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -77,6 +77,6 @@
|
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@stacksjs/development": "workspace:*",
|
|
80
|
-
"@types/validator": "^13.11.
|
|
80
|
+
"@types/validator": "^13.11.9"
|
|
81
81
|
}
|
|
82
82
|
}
|
package/core/tables/package.json
CHANGED
package/core/tinker/package.json
CHANGED
package/core/tunnel/package.json
CHANGED
package/core/types/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.58.
|
|
4
|
+
"version": "0.58.53",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@mdit-vue/plugin-component": "^2.0.0",
|
|
52
52
|
"@mdit-vue/plugin-frontmatter": "^2.0.0",
|
|
53
53
|
"@mdit-vue/types": "^2.0.0",
|
|
54
|
-
"@novu/stateless": "^0.
|
|
54
|
+
"@novu/stateless": "^0.23.0",
|
|
55
55
|
"@rollup/pluginutils": "^5.1.0",
|
|
56
56
|
"@stacksjs/validation": "workspace:*",
|
|
57
57
|
"@types/aws4": "^1.11.6",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"meilisearch": "^0.37.0",
|
|
71
71
|
"neverthrow": "^6.1.0",
|
|
72
72
|
"ora": "^8.0.1",
|
|
73
|
-
"unocss": "^0.58.
|
|
73
|
+
"unocss": "^0.58.5",
|
|
74
74
|
"unplugin-auto-import": "^0.17.5",
|
|
75
75
|
"unplugin-vue-components": "^0.26.0",
|
|
76
76
|
"vite": "^5.0.12",
|
package/core/types/src/app.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type AppEnvType = '
|
|
1
|
+
export type AppEnvType = 'local' | 'dev' | 'stage' | 'prod'
|
|
2
2
|
|
|
3
3
|
interface Ports {
|
|
4
4
|
frontend: number
|
|
@@ -46,7 +46,7 @@ export interface AppOptions {
|
|
|
46
46
|
* running in. This may determine how you prefer to configure various
|
|
47
47
|
* services the application utilizes. Set this in your ".env" file
|
|
48
48
|
*
|
|
49
|
-
* @default "
|
|
49
|
+
* @default "local"
|
|
50
50
|
*/
|
|
51
51
|
env: AppEnvType
|
|
52
52
|
|
package/core/types/src/cli.ts
CHANGED
|
@@ -179,7 +179,7 @@ export type ActionOptions = {
|
|
|
179
179
|
'count'?: number
|
|
180
180
|
} & CliOptions & DomainsOptions
|
|
181
181
|
|
|
182
|
-
export type BuildOption = 'components' | 'vueComponents' | 'webComponents' | 'elements' | 'functions' | 'docs' | 'views' | 'stacks' | 'all' | 'buddy'
|
|
182
|
+
export type BuildOption = 'components' | 'vueComponents' | 'webComponents' | 'elements' | 'functions' | 'docs' | 'views' | 'stacks' | 'all' | 'buddy' | 'server'
|
|
183
183
|
export type BuildOptions = {
|
|
184
184
|
[key in BuildOption]: boolean;
|
|
185
185
|
} & CliOptions
|
package/core/types/src/cloud.ts
CHANGED
|
@@ -64,7 +64,7 @@ export interface CloudOptions {
|
|
|
64
64
|
defaultTtl: number
|
|
65
65
|
maxTtl: number
|
|
66
66
|
compress: boolean
|
|
67
|
-
priceClass
|
|
67
|
+
priceClass?: 'PriceClass_100' | 'PriceClass_200' | 'PriceClass_All'
|
|
68
68
|
originShieldRegion: string
|
|
69
69
|
cookieBehavior: 'none' | 'allowList' | 'all'
|
|
70
70
|
allowList: {
|
|
@@ -72,6 +72,10 @@ export interface CloudOptions {
|
|
|
72
72
|
headers: string[]
|
|
73
73
|
queryStrings: string[]
|
|
74
74
|
}
|
|
75
|
+
realtimeLogs: {
|
|
76
|
+
enabled: boolean
|
|
77
|
+
samplingRate: number
|
|
78
|
+
}
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
api: ApiOptions
|
package/core/types/src/queue.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { DeepPartial } from './utils'
|
|
2
|
+
|
|
1
3
|
export interface QueueOptions {
|
|
2
4
|
default: 'sync' | 'database' | 'redis' | 'sqs'
|
|
3
5
|
connections: {
|
|
@@ -33,4 +35,4 @@ export interface QueueOptions {
|
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
export type QueueConfig =
|
|
38
|
+
export type QueueConfig = DeepPartial<QueueOptions>
|
package/core/ui/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.58.
|
|
4
|
+
"version": "0.58.53",
|
|
5
5
|
"description": "The Stacks UI engine.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@stacksjs/config": "workspace:*",
|
|
64
64
|
"@stacksjs/router": "workspace:*",
|
|
65
65
|
"pinia": "^2.1.7",
|
|
66
|
-
"unocss": "^0.58.
|
|
66
|
+
"unocss": "^0.58.5",
|
|
67
67
|
"vite-plugin-vue-layouts": "^0.11.0",
|
|
68
68
|
"vue": "^3.4.15",
|
|
69
69
|
"vue-tsc": "^1.8.27"
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@iconify-json/heroicons": "^1.1.19",
|
|
74
74
|
"@iconify-json/heroicons-outline": "^1.1.10",
|
|
75
75
|
"@iconify-json/heroicons-solid": "^1.1.11",
|
|
76
|
-
"@iconify/json": "^2.2.
|
|
76
|
+
"@iconify/json": "^2.2.180",
|
|
77
77
|
"@julr/unocss-preset-forms": "^0.1.0",
|
|
78
78
|
"@stacksjs/build": "workspace:*",
|
|
79
79
|
"@stacksjs/config": "workspace:*",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@unhead/vue": "^1.8.10",
|
|
82
82
|
"pinia": "^2.1.7",
|
|
83
83
|
"unhead": "^1.8.10",
|
|
84
|
-
"unocss": "^0.58.
|
|
84
|
+
"unocss": "^0.58.5",
|
|
85
85
|
"unocss-preset-primitives": "0.0.2-beta.0",
|
|
86
86
|
"vite-plugin-vue-layouts": "^0.11.0",
|
|
87
87
|
"vue": "^3.4.15",
|
package/core/utils/dist/index.js
CHANGED
package/core/utils/package.json
CHANGED
|
@@ -15,8 +15,8 @@ export interface SingletonPromiseReturn<T> {
|
|
|
15
15
|
* Promise with `resolve` and `reject` methods of itself
|
|
16
16
|
*/
|
|
17
17
|
export interface ControlledPromise<T = void> extends Promise<T> {
|
|
18
|
-
resolve(value: T | PromiseLike<T>)
|
|
19
|
-
reject(reason?: any)
|
|
18
|
+
resolve: (value: T | PromiseLike<T>) => void
|
|
19
|
+
reject: (reason?: any) => void
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -28,7 +28,7 @@ export interface FieldContext {
|
|
|
28
28
|
/**
|
|
29
29
|
* Mutate the value of field under validation.
|
|
30
30
|
*/
|
|
31
|
-
mutate(newValue: any, field: FieldContext)
|
|
31
|
+
mutate: (newValue: any, field: FieldContext) => void
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Report error to the error reporter
|
|
@@ -87,12 +87,12 @@ export interface ErrorReporterContract {
|
|
|
87
87
|
/**
|
|
88
88
|
* Creates an instance of an exception to throw
|
|
89
89
|
*/
|
|
90
|
-
createError()
|
|
90
|
+
createError: () => Error
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* Report error for a field
|
|
94
94
|
*/
|
|
95
|
-
report(message: string, rule: string, field: FieldContext, args?: Record<string, any>)
|
|
95
|
+
report: (message: string, rule: string, field: FieldContext, args?: Record<string, any>) => any
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
export const isMoney = validator.createRule((value: unknown, _, field: FieldContext) => {
|
package/core/vite/dist/index.js
CHANGED
|
@@ -609,7 +609,7 @@ var web_components_default = defineConfig6(({ command }) => {
|
|
|
609
609
|
// src/plugin/docs.ts
|
|
610
610
|
import {kolorist as c2} from "@stacksjs/cli";
|
|
611
611
|
// package.json
|
|
612
|
-
var version = "0.58.
|
|
612
|
+
var version = "0.58.53";
|
|
613
613
|
|
|
614
614
|
// src/plugin/docs.ts
|
|
615
615
|
var docsEngine = {
|
package/core/vite/package.json
CHANGED
package/core/whois/package.json
CHANGED
package/core/x-ray/package.json
CHANGED
package/core/zsh-buddy/README.md
CHANGED
|
@@ -4,11 +4,15 @@ This package contains the zsh-buddy plugin.
|
|
|
4
4
|
|
|
5
5
|
## ☘️ Features
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- It will find and execute `buddy` from anywhere within the project file tree _(and you don't need to prefix it with php or ./)_
|
|
8
|
+
- It provides auto-completion for `buddy` commands _(that also work anywhere within the project)_
|
|
9
|
+
- You can specify an editor to automatically open new files created by `buddy make:*` commands
|
|
8
10
|
|
|
9
11
|
## 🤖 Usage
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
```
|
|
14
|
+
buddy setup:oh-my-zsh
|
|
15
|
+
```
|
|
12
16
|
|
|
13
17
|
To view the full documentation, please visit [https://stacksjs.org/ui](https://stacksjs.org/zsh).
|
|
14
18
|
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
#--------------------------------------------------------------------------
|
|
2
|
+
# Stacks buddy plugin for zsh
|
|
3
|
+
#--------------------------------------------------------------------------
|
|
4
|
+
#
|
|
5
|
+
# This plugin adds an `buddy` shell command that will find and execute
|
|
6
|
+
# Stacks's buddy command from anywhere within the project. It also
|
|
7
|
+
# adds shell completions that work anywhere buddy can be located.
|
|
8
|
+
#
|
|
9
|
+
# Many thanks to Jess Archer for providing the initial scripts:
|
|
10
|
+
# https://github.com/jessarcher/zsh-artisan
|
|
11
|
+
|
|
12
|
+
function buddy() {
|
|
13
|
+
local buddy_path=`_buddy_find`
|
|
14
|
+
|
|
15
|
+
if [ "$buddy_path" = "" ]; then
|
|
16
|
+
>&2 echo "zsh-buddy: buddy not found. Are you in a Stacks directory?"
|
|
17
|
+
return 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
local buddy_path=`dirname $buddy_path`
|
|
21
|
+
local buddy_cmd
|
|
22
|
+
|
|
23
|
+
buddy_cmd="bun $buddy_path/buddy $*"
|
|
24
|
+
|
|
25
|
+
local buddy_start_time=`date +%s`
|
|
26
|
+
|
|
27
|
+
eval $buddy_cmd $*
|
|
28
|
+
|
|
29
|
+
local buddy_exit_status=$? # Store the exit status so we can return it later
|
|
30
|
+
|
|
31
|
+
if [[ $1 = "make:"* && $BUDDY_OPEN_ON_MAKE_EDITOR != "" ]]; then
|
|
32
|
+
# Find and open files created by buddy
|
|
33
|
+
find \
|
|
34
|
+
"$buddy_path/app" \
|
|
35
|
+
"$buddy_path/tests" \
|
|
36
|
+
-type f \
|
|
37
|
+
-newermt "-$((`date +%s` - $buddy_start_time + 1)) seconds" \
|
|
38
|
+
-exec $BUDDY_OPEN_ON_MAKE_EDITOR {} \; 2>/dev/null
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
return $buddy_exit_status
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function bud() {
|
|
45
|
+
buddy $*
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function stacks() {
|
|
49
|
+
buddy $*
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function stx() {
|
|
53
|
+
buddy $*
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function b() {
|
|
57
|
+
buddy $*
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function bi() {
|
|
61
|
+
buddy install
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function ba() {
|
|
65
|
+
buddy add "$@"
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function bd() {
|
|
69
|
+
buddy dev "$@"
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function bb() {
|
|
73
|
+
buddy build "$@"
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function bt() {
|
|
77
|
+
buddy test
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function bu() {
|
|
81
|
+
buddy upgrade
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
compdef _buddy_add_completion buddy
|
|
85
|
+
|
|
86
|
+
function _buddy_find() {
|
|
87
|
+
# Look for buddy up the file tree until the root directory
|
|
88
|
+
local dir=.
|
|
89
|
+
until [ $dir -ef / ]; do
|
|
90
|
+
if [ -f "$dir/buddy" ]; then
|
|
91
|
+
echo "$dir/buddy"
|
|
92
|
+
return 0
|
|
93
|
+
fi
|
|
94
|
+
|
|
95
|
+
dir+=/..
|
|
96
|
+
done
|
|
97
|
+
|
|
98
|
+
return 1
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function _buddy_add_completion() {
|
|
102
|
+
if [ "`_buddy_find`" != "" ]; then
|
|
103
|
+
compadd `_buddy_get_command_list`
|
|
104
|
+
fi
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function _buddy_get_command_list() {
|
|
108
|
+
buddy list | sed "s/[[:space:]].*//g"
|
|
109
|
+
}
|
package/ide/dictionary.txt
CHANGED